home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- *
- * xdbx - X Window System interface to dbx
- *
- * Copyright 1989 The University of Texas at Austin
- *
- * Author: Po Cheung
- * Date: March 10, 1989
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation. The University of Texas at Austin makes no
- * representations about the suitability of this software for any purpose.
- * It is provided "as is" without express or implied warranty.
- *
- ******************************************************************************/
-
-
- #include <stdio.h>
- #include <X11/Xos.h>
- #include <X11/IntrinsicP.h>
- #include <X11/StringDefs.h>
- #include <X11/Cardinals.h>
- #include <X11/Xatom.h>
- #include <X11/Shell.h>
- #include <X11/VPaned.h>
- #include <X11/Form.h>
- #include <X11/AsciiText.h>
- #include <X11/TextP.h>
- #include <X11/Box.h>
- #include <X11/List.h>
- #include <X11/Command.h>
- #include <X11/Label.h>
-
- #define MIN(a,b) ((a)<(b) ? (a) : (b))
- #define MAX(a,b) ((a)>(b) ? (a) : (b))
-
- #define DIALOGSIZE 10000 /* max size of dialog window buffer */
- #define LINESIZ 200 /* input line length */
- #define MAXNAME 30 /* max identifier length */
- #define MAXARGS 10 /* max number of args */
- #define MAXFILES 256 /* max number of files in fileTable */
- #define MAXSTOPS 256 /* max number of stops */
- #define MAXSIGNS 100 /* max number of signs */
- #define OFFSET 2 /* offset for adjusting sign position */
- #define CHARS_PER_LINE 20 /* estimated number of chars per line */
- #define ADD_LINES 50 /* # of lines to be added in realloc */
- #define PROMPT "(xdbx) " /* xdbx prompt string */
- #define TITLE "xdbx 1.0" /* xdbx title string */
- #define CANCEL "<Cancel>" /* string for file menu */
- #define DELIMITERS " !%^&*()+=~|;:{},/#<?\"\n\t"
-
-
- typedef int Line;
-
- #ifdef sparc
- typedef struct dirent Directory;
- #else
- typedef struct direct Directory;
- #endif
-
- typedef struct {
- Dimension shellWidth; /* xdbx window width */
- Dimension lineLabelWidth; /* line label width */
- Dimension sourceHeight; /* source window height */
- Dimension leftMargin; /* left margin of source window */
- Dimension dialogHeight; /* dialog window height */
- Dimension dialogMinHeight; /* dialog window minimum height */
- Dimension messageHeight; /* message window height */
- Dimension buttonWidth; /* command button width */
- Dimension commandHSpace; /* command horizontal spacing */
- Dimension commandVSpace; /* command vertical spacing */
- Dimension commandMinHeight; /* source window height */
- Dimension commandMaxHeight; /* source window height */
- Dimension columnSpacing; /* file menu column spacing */
- int filesPerColumn; /* number of files per column in file menu */
- Boolean noTitleBar; /* xdbx option : title bar */
- Pixel stopForeground; /* foreground color of stop sign */
- Pixel arrowForeground; /* foreground color of arrow sign */
- Pixel updownForeground; /* foreground color of updown sign */
-
- Boolean dbxopt_r; /* dbx option -r */
- Boolean dbxopt_i; /* dbx option -i */
- String includeDir; /* dbx option -I includeDir */
- Boolean dbxopt_k; /* dbx option -k */
- String cfile; /* Berkeley dbx option -c file */
- Boolean dbxopt_kbd; /* SunOS 3.4 dbx option -kbd */
- int fcount; /* SunOS 4.0 dbx option -f fcount */
- String startup; /* SunOS 4.0 dbx option -s startup */
- String tstartup; /* SunOS 4.0 dbx option -sr tstartup */
- } XdbxResources;
-
- typedef struct {
- char *filename; /* name of file on display */
- char funcname[MAXNAME]; /* current function */
- char *buf; /* buffer holding source file */
- long filesize; /* size of file in bytes */
- Line lines; /* # of lines on display */
- Line currentline; /* line where caret is */
- Line topline; /* top line number in the window */
- Line bottomline; /* bottom line number in window */
- Line lastline; /* number of lines in source file */
- XtTextPosition topPosition; /* top display position of buffer */
- XtTextPosition *linepos; /* array of text pos for each newline */
- } FileRec, *FileRecPtr;
-
-
- typedef struct {
- char *mesg; /* part of matched string */
- unsigned stop; /* stop number */
- char *func; /* function name */
- unsigned line; /* line number */
- char *file; /* file name */
- } Tokens;
-
- #define NTOKENS 5 /* number of tokens */
-
- typedef struct {
- char *pat; /* regular expression */
- struct re_pattern_buffer *buf; /* buffer for compile regex */
- int reg_token[NTOKENS]; /* register number */
- } PatternRec, *PatternRecPtr;
-
-
- typedef struct {
- Cardinal i; /* index to arrowsign[] */
- char filename[MAXNAME]; /* filename associated with */
- Line line; /* line number */
- } Arrow;
-
- typedef struct {
- Cardinal i; /* index to updownsign[] */
- char filename[MAXNAME]; /* filename associated with */
- Line line; /* line number */
- } Updown;
-
- typedef struct {
- char *filename; /* filename associated with */
- Line line; /* line number of stop */
- unsigned tag; /* used in deleting stops */
- } Stops;
-