home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume3 / xdbx / part03 / defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-14  |  5.3 KB  |  144 lines

  1. /****************************************************************************** 
  2.  *
  3.  *  xdbx - X Window System interface to dbx
  4.  *
  5.  *  Copyright 1989 The University of Texas at Austin
  6.  *
  7.  *  Author:    Po Cheung
  8.  *  Date:    March 10, 1989
  9.  *
  10.  *  Permission to use, copy, modify, and distribute this software and
  11.  *  its documentation for any purpose and without fee is hereby granted,
  12.  *  provided that the above copyright notice appear in all copies and that
  13.  *  both that copyright notice and this permission notice appear in
  14.  *  supporting documentation.  The University of Texas at Austin makes no 
  15.  *  representations about the suitability of this software for any purpose.  
  16.  *  It is provided "as is" without express or implied warranty.
  17.  *
  18.  ******************************************************************************/
  19.  
  20.  
  21. #include <stdio.h>
  22. #include <X11/Xos.h>
  23. #include <X11/IntrinsicP.h>
  24. #include <X11/StringDefs.h>
  25. #include <X11/Cardinals.h>
  26. #include <X11/Xatom.h>
  27. #include <X11/Shell.h>
  28. #include <X11/VPaned.h>
  29. #include <X11/Form.h>
  30. #include <X11/AsciiText.h>
  31. #include <X11/TextP.h>
  32. #include <X11/Box.h>
  33. #include <X11/List.h>
  34. #include <X11/Command.h>
  35. #include <X11/Label.h>
  36.  
  37. #define MIN(a,b)    ((a)<(b) ? (a) : (b))
  38. #define MAX(a,b)    ((a)>(b) ? (a) : (b))
  39.  
  40. #define DIALOGSIZE      10000        /* max size of dialog window buffer */
  41. #define LINESIZ         200        /* input line length */
  42. #define MAXNAME         30        /* max identifier length */
  43. #define MAXARGS     10        /* max number of args */
  44. #define MAXFILES     256        /* max number of files in fileTable */
  45. #define MAXSTOPS     256        /* max number of stops */
  46. #define    MAXSIGNS    100        /* max number of signs */
  47. #define OFFSET        2        /* offset for adjusting sign position */
  48. #define CHARS_PER_LINE  20        /* estimated number of chars per line */
  49. #define ADD_LINES       50        /* # of lines to be added in realloc */
  50. #define PROMPT      "(xdbx) "    /* xdbx prompt string */
  51. #define TITLE          "xdbx 1.0"    /* xdbx title string */
  52. #define CANCEL      "<Cancel>"    /* string for file menu */
  53. #define DELIMITERS    " !%^&*()+=~|;:{},/#<?\"\n\t"
  54.  
  55.  
  56. typedef int         Line;
  57.  
  58. #ifdef sparc
  59. typedef struct dirent     Directory;
  60. #else
  61. typedef struct direct     Directory;
  62. #endif
  63.  
  64. typedef struct {
  65.     Dimension shellWidth;    /* xdbx window width */
  66.     Dimension lineLabelWidth;    /* line label width */
  67.     Dimension sourceHeight;    /* source window height */
  68.     Dimension leftMargin;    /* left margin of source window */
  69.     Dimension dialogHeight;    /* dialog window height */
  70.     Dimension dialogMinHeight;    /* dialog window minimum height */
  71.     Dimension messageHeight;    /* message window height */
  72.     Dimension buttonWidth;    /* command button width */
  73.     Dimension commandHSpace;    /* command horizontal spacing */
  74.     Dimension commandVSpace;    /* command vertical spacing */
  75.     Dimension commandMinHeight;    /* source window height */
  76.     Dimension commandMaxHeight;    /* source window height */
  77.     Dimension columnSpacing;    /* file menu column spacing */
  78.     int          filesPerColumn;    /* number of files per column in file menu */
  79.     Boolean   noTitleBar;    /* xdbx option : title bar */
  80.     Pixel     stopForeground;        /* foreground color of stop sign */
  81.     Pixel     arrowForeground;        /* foreground color of arrow sign */
  82.     Pixel     updownForeground;    /* foreground color of updown sign */
  83.  
  84.     Boolean   dbxopt_r;        /* dbx option -r */
  85.     Boolean   dbxopt_i;        /* dbx option -i */
  86.     String    includeDir;    /* dbx option -I includeDir */
  87.     Boolean   dbxopt_k;        /* dbx option -k */
  88.     String    cfile;        /* Berkeley  dbx option -c file */
  89.     Boolean   dbxopt_kbd;    /* SunOS 3.4 dbx option -kbd */
  90.     int          fcount;        /* SunOS 4.0 dbx option -f fcount */
  91.     String    startup;        /* SunOS 4.0 dbx option -s startup */
  92.     String    tstartup;        /* SunOS 4.0 dbx option -sr tstartup */
  93. } XdbxResources;
  94.  
  95. typedef struct {
  96.     char         *filename;    /* name of file on display */
  97.     char         funcname[MAXNAME];    /* current function */
  98.     char         *buf;        /* buffer holding source file */
  99.     long        filesize;    /* size of file in bytes */
  100.     Line         lines;        /* # of lines on display */
  101.     Line         currentline;    /* line where caret is */
  102.     Line         topline;    /* top line number in the window */
  103.     Line         bottomline;    /* bottom line number in window */
  104.     Line         lastline;    /* number of lines in source file */
  105.     XtTextPosition     topPosition;    /* top display position of buffer */
  106.     XtTextPosition     *linepos;    /* array of text pos for each newline */
  107. } FileRec, *FileRecPtr;
  108.  
  109.  
  110. typedef struct {
  111.     char    *mesg;            /* part of matched string */
  112.     unsigned    stop;            /* stop number */
  113.     char     *func;            /* function name */
  114.     unsigned    line;            /* line number */
  115.     char    *file;            /* file name */
  116. } Tokens;
  117.  
  118. #define NTOKENS    5            /* number of tokens */
  119.  
  120. typedef struct {
  121.     char            *pat;        /* regular expression */
  122.     struct re_pattern_buffer    *buf;        /* buffer for compile regex */
  123.     int                reg_token[NTOKENS];    /* register number */
  124. } PatternRec, *PatternRecPtr;
  125.  
  126.  
  127. typedef struct {
  128.     Cardinal    i;            /* index to arrowsign[] */
  129.     char    filename[MAXNAME];    /* filename associated with */
  130.     Line     line;            /* line number */
  131. } Arrow;
  132.  
  133. typedef struct {
  134.     Cardinal    i;            /* index to updownsign[] */
  135.     char    filename[MAXNAME];    /* filename associated with */
  136.     Line     line;            /* line number */
  137. } Updown;
  138.  
  139. typedef struct {
  140.     char    *filename;        /* filename associated with */
  141.     Line     line;            /* line number of stop */
  142.     unsigned     tag;            /* used in deleting stops */
  143. } Stops;
  144.