macro.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifdef _WIN32
  2. #include <io.h>
  3. #else
  4. #include <ctype.h>
  5. #endif
  6. typedef struct MACROTEXT {
  7. MACROTEXT *next;
  8. MACROTEXT *prev;
  9. char *macroText;
  10. } MACROTEXT;
  11. typedef struct MACROENTRY
  12. {
  13. MACROENTRY *next;
  14. MACROENTRY *prev;
  15. char *macroName;
  16. MACROTEXT *firstMacroParms;
  17. MACROTEXT *lastMacroParms;
  18. MACROTEXT *firstMacroLines;
  19. MACROTEXT *lastMacroLines;
  20. unsigned int numParms;
  21. char *fileName;
  22. unsigned int lineNo;
  23. unsigned int nLines;
  24. bool bIsDefine;
  25. } MACROENTRY;
  26. #define MAX_IFDEF_DEPTH 1024
  27. typedef struct IFDEFINFO
  28. {
  29. bool lastbProcessingIFDEF; // save off for if we were processing #ifdef
  30. bool lastbIFDEF; // wether ifdef was true or not
  31. bool lastbCompareDefine; // wether we compare #ifdef or #ifndef
  32. unsigned int lastIfDefStartLine; // where we started for this #ifdef
  33. } IFDEFINFO;
  34. typedef void (*MACROFUNCTIONPTR)(char *, unsigned int *, char **);
  35. typedef struct MACROFUNCTIONS {
  36. const char *name;
  37. MACROFUNCTIONPTR function;
  38. } MACROFUNCTIONS;