home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / util / makedepend / def.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-12  |  2.8 KB  |  111 lines

  1. /*
  2.  * $XConsortium: def.h,v 1.17 91/05/13 10:23:29 rws Exp $
  3.  */
  4. #include <X11/Xosdefs.h>
  5. #include <stdio.h>
  6. #include <ctype.h>
  7. #ifndef X_NOT_POSIX
  8. #ifndef _POSIX_SOURCE
  9. #define _POSIX_SOURCE
  10. #endif
  11. #endif
  12. #include <sys/types.h>
  13. #include <fcntl.h>
  14. #include <sys/stat.h>
  15.  
  16. #define MAXDEFINES    512
  17. #define MAXFILES    512
  18. #define MAXDIRS        20
  19. #define SYMTABINC    10    /* must be > 1 for define() to work right */
  20. #define    TRUE        1
  21. #define    FALSE        0
  22.  
  23. /* the following must match the directives table in main.c */
  24. #define    IF        0
  25. #define    IFDEF        1
  26. #define    IFNDEF        2
  27. #define    ELSE        3
  28. #define    ENDIF        4
  29. #define    DEFINE        5
  30. #define    UNDEF        6
  31. #define    INCLUDE        7
  32. #define    LINE        8
  33. #define    PRAGMA        9
  34. #define ERROR           10
  35. #define IDENT           11
  36. #define SCCS            12
  37. #define ELIF            13
  38. #define EJECT           14
  39. #define IFFALSE         15     /* pseudo value --- never matched */
  40. #define ELIFFALSE       16     /* pseudo value --- never matched */
  41. #define INCLUDEDOT      17     /* pseudo value --- never matched */
  42. #define IFGUESSFALSE    18     /* pseudo value --- never matched */
  43. #define ELIFGUESSFALSE  19     /* pseudo value --- never matched */
  44.  
  45. #ifdef DEBUG
  46. extern int    _debugmask;
  47. /*
  48.  * debug levels are:
  49.  * 
  50.  *     0    show ifn*(def)*,endif
  51.  *     1    trace defined/!defined
  52.  *     2    show #include
  53.  *     3    show #include SYMBOL
  54.  *     4-6    unused
  55.  */
  56. #define debug(level,arg) { if (_debugmask & (1 << level)) warning arg; }
  57. #else
  58. #define    debug(level,arg) /**/
  59. #endif /* DEBUG */
  60.  
  61. typedef    unsigned char boolean;
  62.  
  63. struct symtab {
  64.     char    *s_name;
  65.     char    *s_value;
  66. };
  67.  
  68. struct    inclist {
  69.     char        *i_incstring;    /* string from #include line */
  70.     char        *i_file;    /* path name of the include file */
  71.     struct inclist    **i_list;    /* list of files it itself includes */
  72.     int        i_listlen;    /* length of i_list */
  73.     struct symtab    *i_defs;    /* symbol table for this file */
  74.     struct symtab    *i_lastdef;    /* last symbol defined */
  75.     int        i_deflen;    /* number of defines */
  76.     boolean        i_defchecked;    /* whether defines have been checked */
  77.     boolean        i_notified;    /* whether we have revealed includes */
  78.     boolean        i_marked;    /* whether it's in the makefile */
  79.     boolean        i_searched;    /* whether we have read this */
  80.     boolean         i_included_sym; /* whether #include SYMBOL was found */
  81.                     /* Can't use i_list if TRUE */
  82. };
  83.  
  84. struct filepointer {
  85.     char    *f_p;
  86.     char    *f_base;
  87.     char    *f_end;
  88.     long    f_len;
  89.     long    f_line;
  90. };
  91.  
  92. #ifndef X_NOT_STDC_ENV
  93. #include <stdlib.h>
  94. #if defined(macII) && !defined(__STDC__)  /* stdlib.h fails to define these */
  95. char *malloc(), *realloc();
  96. #endif /* macII */
  97. #else
  98. char            *malloc();
  99. char            *realloc();
  100. #endif
  101.  
  102. char            *copy();
  103. char            *basename();
  104. char            *getline();
  105. struct symtab        *slookup();
  106. struct symtab        *isdefined();
  107. struct symtab        *fdefined();
  108. struct filepointer    *getfile();
  109. struct inclist        *newinclude();
  110. struct inclist        *inc_path();
  111.