home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dosdisas.zip / parsehdr.zip / PARSEHDR.H < prev    next >
C/C++ Source or Header  |  1993-12-08  |  3KB  |  99 lines

  1. /*
  2.  *$Log:    parsehdr.h,v $
  3.  */
  4. /* Header file for parsehdr.c */
  5.  
  6. typedef unsigned long dword;    /* 32 bits    */
  7. typedef unsigned char byte;        /* 8 bits     */ 
  8. typedef unsigned short word;    /* 16 bits    */
  9. typedef unsigned char boolT;    /* 8 bits     */
  10.  
  11. #define TRUE  1
  12. #define FALSE 0
  13.  
  14. #define BUFF_SIZE 8192          /* Holds a declaration */
  15. #define FBUF_SIZE 32700         /* Holds part of a header file */
  16.  
  17. #define    NARGS        15
  18. #define    NAMES_L        160
  19. #define    TYPES_L        160
  20. #define    FUNC_L        160
  21.  
  22. #define    ERRF    stdout
  23.  
  24. void    phError(char *errmsg);
  25. void    phWarning(char *errmsg);
  26.  
  27. #define    ERR(msg)        phError(msg)
  28. #ifdef DEBUG
  29. #define    DBG(str) printf(str);
  30. #else
  31. #define DBG(str) ;
  32. #endif
  33. #define    WARN(msg)        phWarning(msg)
  34. #define OUT(str)        fprintf(outfile, str)
  35.  
  36. #define    PH_PARAMS    32
  37. #define PH_NAMESZ    15
  38.  
  39. #define  SYMLEN     16                  /* Including the null */
  40. #define  Int        long                /* For locident.h */
  41. #define  int16 short int                /* For locident.h */
  42. #include "locident.h"                   /* For the hlType enum */
  43. #define  bool       unsigned char       /* For internal use */
  44. #define  TRUE       1
  45. #define  FALSE      0
  46.  
  47. typedef
  48. struct ph_func_tag
  49. {
  50.     char    name[SYMLEN];               /* Name of function or arg */
  51.     hlType  typ;                        /* Return type */
  52.     int     numArg;                     /* Number of args */
  53.     int     firstArg;                   /* Index of first arg in chain */
  54.     int     next;                       /* Index of next function in chain */
  55.     bool    bVararg;                    /* True if variable num args */
  56. } PH_FUNC_STRUCT;
  57.  
  58. typedef
  59. struct ph_arg_tag
  60. {
  61.     char    name[SYMLEN];               /* Name of function or arg */
  62.     hlType  typ;                        /* Parameter type */
  63. } PH_ARG_STRUCT;
  64.  
  65. #define DELTA_FUNC 32                   /* Number to alloc at once */
  66.  
  67.  
  68. #define    PH_JUNK            0        /* LPSTR        buffer, nothing happened */
  69. #define    PH_PROTO        1        /* LPPH_FUNC     ret val, func name, args */
  70. #define    PH_FUNCTION        2        /* LPPH_FUNC    ret val, func name, args */
  71. #define    PH_TYPEDEF        3        /* LPPH_DEF      definer and definee      */
  72. #define    PH_DEFINE        4        /* LPPH_DEF      definer and definee      */
  73. #define    PH_ERROR        5        /* LPSTR        error string             */
  74. #define    PH_WARNING        6        /* LPSTR         warning string           */
  75. #define    PH_MPROTO        7        /* ????? multi proto????                 */
  76. #define    PH_VAR            8        /* ????? var decl                        */
  77.  
  78. /* PROTOS */
  79.  
  80. boolT    phData(char *buff, int ndata);
  81. boolT    phPost(void);
  82. boolT    phFree(void);
  83. void    checkHeap(char *msg);   /* For debugging only */
  84.  
  85. void    phBuffToFunc(char *buff);
  86.  
  87. void    phBuffToDef(char *buff);
  88.  
  89.  
  90. #define TOK_TYPE    256         /* A type name (e.g. "int") */
  91. #define TOK_NAME    257         /* A function or parameter name */
  92. #define TOK_DOTS    258         /* "..." */
  93. #define TOK_EOL     259         /* End of line */
  94.  
  95. typedef enum
  96. {
  97.     BT_INT, BT_CHAR, BT_FLOAT, BT_DOUBLE, BT_STRUCT, BT_VOID, BT_UNKWN
  98. } baseType;
  99.