home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume8 / xdbx / part02 / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-28  |  7.8 KB  |  213 lines

  1. /*****************************************************************************
  2.  *
  3.  *  xdbx - X Window System interface to the dbx debugger
  4.  *
  5.  *  Copyright 1989 The University of Texas at Austin
  6.  *  Copyright 1990 Microelectronics and Computer Technology Corporation
  7.  *
  8.  *  Permission to use, copy, modify, and distribute this software and its
  9.  *  documentation for any purpose and without fee is hereby granted,
  10.  *  provided that the above copyright notice appear in all copies and that
  11.  *  both that copyright notice and this permission notice appear in
  12.  *  supporting documentation, and that the name of The University of Texas
  13.  *  and Microelectronics and Computer Technology Corporation (MCC) not be 
  14.  *  used in advertising or publicity pertaining to distribution of
  15.  *  the software without specific, written prior permission.  The
  16.  *  University of Texas and MCC makes no representations about the 
  17.  *  suitability of this software for any purpose.  It is provided "as is" 
  18.  *  without express or implied warranty.
  19.  *
  20.  *  THE UNIVERSITY OF TEXAS AND MCC DISCLAIMS ALL WARRANTIES WITH REGARD TO
  21.  *  THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  22.  *  FITNESS, IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR MCC BE LIABLE FOR
  23.  *  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  24.  *  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  25.  *  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  26.  *  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  *
  28.  *  Author:      Po Cheung
  29.  *  Created:       March 10, 1989
  30.  *
  31.  *****************************************************************************/
  32.  
  33. /*  defs.h
  34.  *
  35.  *    Contain #includes, #defines and typedefs
  36.  */
  37.  
  38. #include <stdio.h>
  39. #include <sys/param.h>
  40. #include <X11/Xos.h>
  41. #include <X11/IntrinsicP.h>
  42. #include <X11/StringDefs.h>
  43. #include <X11/Xaw/Cardinals.h>
  44. #include <X11/Xatom.h>
  45. #include <X11/Shell.h>
  46. #include <X11/Xaw/Paned.h>
  47. #include <X11/Xaw/Grip.h>
  48. #include <X11/Xaw/Form.h>
  49. #include <X11/Xaw/MenuButton.h>
  50. #include <X11/Xaw/SimpleMenu.h>
  51. #include <X11/Xaw/SmeBSB.h>
  52. #include <X11/Xaw/AsciiText.h>
  53. #include <X11/Xaw/TextP.h>
  54. #include <X11/Xaw/TextSrc.h>
  55. #include <X11/Xaw/Box.h>
  56. #include <X11/Xaw/Dialog.h>
  57. #include <X11/Xaw/List.h>
  58. #include <X11/Xaw/Command.h>
  59. #include <X11/Xaw/Label.h>
  60. #include <X11/cursorfont.h>
  61.  
  62. /* incompatibility of header file with X11R4 documentation */
  63. #define XawChainTop    XtChainTop
  64. #define XawChainBottom    XtChainBottom
  65. #define XawChainLeft    XtChainLeft
  66. #define XawChainRight    XtChainRight
  67.  
  68. #ifndef AssignMax
  69. #define AssignMax(x, y)     if ((y) > (x)) x = (y)
  70. #endif
  71. #ifndef AssignMin
  72. #define AssignMin(x, y)     if ((y) < (x)) x = (y)
  73. #endif
  74.  
  75. #define LINESIZ         512        /* input line length */
  76. #define MAXNAME         256        /* max identifier length */
  77. #define MAXARGS     20        /* max number of args */
  78. #define ADD_SIZE     16        /* # of files added during Realloc */
  79. #define CHARS_PER_LINE  20        /* estimated number of chars per line */
  80. #define ADD_LINES       50        /* # of lines to be added in realloc */
  81. #define NTOKENS        6        /* number of tokens */
  82. #define DEBUGGER          "dbx"        /* name of executable */
  83. #define XDBXPROMPT      "(xdbx) "    /* xdbx prompt string */
  84. #define DELIMITERS    " !%^&*()+=~|;:{},/#<?\"\n\t"
  85.  
  86. #define STOP_AT_HELP    "Please select a line to stop at"
  87. #define STOP_IN_HELP    "Please select a function to stop in"
  88. #define DELETE_HELP    "Please select a stop sign to delete"
  89. #define PRINT_HELP    "Please select an expression to print"
  90. #define UNDISPLAY_HELP    "Please select an expression to undisplay"
  91. #define SEARCH_HELP    "Nothing to search"
  92.  
  93. #define    LASTCH(s)    (s[strlen(s)-1])
  94. #define    SECLASTCH(s)    (s[strlen(s)-2])
  95.  
  96. #ifdef SUNOS4
  97. typedef struct dirent     Directory;
  98. #else
  99. typedef struct direct     Directory;
  100. #endif
  101.  
  102. typedef struct {
  103.     Boolean   bell;        /* if True, bell on */
  104.     Boolean   displayWindow;    /* if True, display window on startup */
  105.     String    delimiters;    /* set of delimiters for word selection */
  106.     String    prompt;        /* prompt string for xdbx */
  107.  
  108.     Pixel     stop_color;    /* color of stop sign */
  109.     Pixel     arrow_color;    /* color of arrow sign */
  110.     Pixel     updown_color;    /* color of updown sign */
  111.     Pixel     bomb_color;    /* color of bomb sign */
  112.  
  113.     Dimension dataDpyMaxHeight;    /* data display window maximum height */
  114.     Dimension dataDpyMaxWidth;    /* data display window maximum width */
  115.  
  116.     Boolean   bigicon;        /* xdbx option -bigicon */
  117.     Boolean   debug;        /* xdbx option -debug */
  118.  
  119.     Boolean   dbxopt_r;        /* dbx option -r */
  120.     Boolean   dbxopt_i;        /* dbx option -i */
  121.     String    includeDir;    /* dbx option -I includeDir */
  122.     Boolean   dbxopt_k;        /* dbx option -k */
  123.     String    cfile;        /* Berkeley  dbx option -c file */
  124.     Boolean   dbxopt_kbd;    /* Sun dbx option -kbd */
  125.     String    fcount;        /* SunOS 4.0 dbx option -f fcount */
  126.     String    startup;        /* SunOS 4.0 dbx option -s startup */
  127.     String    tstartup;        /* SunOS 4.0 dbx option -sr tstartup */
  128.     Boolean   pixie;        /* Mips dbx option -pixie */
  129. } XdbxResources;
  130.  
  131. typedef struct {
  132.     char         *filename;    /* name of file */
  133.     char         *pathname;    /* full path name of file */
  134.     char         *buf;        /* buffer holding source file */
  135.     long        filesize;    /* size of file in bytes */
  136.     time_t        mtime;        /* time last modified */
  137.     int             lines;        /* # of lines on display */
  138.     int             currentline;    /* line where caret is */
  139.     int             topline;    /* top line number in the window */
  140.     int             bottomline;    /* bottom line number in window */
  141.     int             lastline;    /* number of lines in source file */
  142.     XawTextPosition     topPosition;    /* top display position of buffer */
  143.     XawTextPosition     *linepos;    /* array of text pos for each newline */
  144. } FileRec, *FileRecPtr;
  145.  
  146. typedef struct {
  147.     char    *mesg;            /* part of matched string */
  148.     unsigned    stop;            /* stop number */
  149.     char     *func;            /* function name */
  150.     int        line;            /* line number */
  151.     char    *file;            /* file name */
  152.     char    *display;        /* variable display output */
  153. } Tokens;
  154.  
  155. typedef struct dataDpyList {
  156.     struct dataDpyRec    *dataDpy;
  157.     struct dataDpyList    *next;
  158. } DataDpyList;
  159.  
  160. typedef struct dataDpyRec {
  161.     int            id;
  162.     Widget              popupshell;             /* parent of popup */
  163.     Widget              popup;                  /* form widget */
  164.     Widget              label;                  /* label widget */
  165.     Widget              dataDpyWindow;          /* window for displaying data */
  166.     char                *buf;                   /* text buffer */
  167.     int                 buflen;
  168.     XawTextPosition     *linepos;
  169.     int                 numlines;
  170.     int                 maxLineLength;
  171.     int            state;            /* EMPTY, UNUSED, USED */
  172.     struct dataDpyRec    *parent;        /* pointer to parent */
  173.     struct dataDpyList    *childlist;        /* list of children */
  174. } DataDpyRec, *DataDpyRecPtr;
  175.  
  176. typedef struct {
  177.     char            *pat;        /* regular expression */
  178.     struct re_pattern_buffer    *buf;        /* buffer for compile regex */
  179.     int                reg_token[NTOKENS];    /* register number */
  180. } PatternRec, *PatternRecPtr;
  181.  
  182. typedef struct commandRec {
  183.     char        *command;
  184.     struct commandRec    *next;
  185. } CommandRec, *CommandRecPtr;
  186.  
  187. typedef struct {
  188.     Cardinal    i;            /* index to arrowsign[] */
  189.     char    file[MAXNAME];        /* file associated with */
  190.     int         line;            /* line number */
  191.     char     func[MAXNAME];        /* function name associated with */
  192. } Arrow;
  193.  
  194. typedef struct {
  195.     Cardinal    i;            /* index to updownsign[] */
  196.     char    file[MAXNAME];        /* file associated with */
  197.     int         line;            /* line number */
  198.     char     func[MAXNAME];        /* function name associated with */
  199. } Updown;
  200.  
  201. typedef struct {
  202.     char    *file;            /* file associated with */
  203.     int         line;            /* line number of stop */
  204.     unsigned    tag;                    /* used in deleting stops */
  205. } Stops;
  206.  
  207. typedef struct {
  208.     Cardinal    i;            /* index to bombsign[] */
  209.     char    file[MAXNAME];        /* file associated with */
  210.     int         line;            /* line number */
  211.     char     func[MAXNAME];        /* function name associated with */
  212. } Bomb;
  213.