Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

173 lines
6.3 KiB

  1. // globals.h - global variables/needed across modules
  2. //
  3. // Copyright (c) 1988-1990, Microsoft Corporation. All rights reserved.
  4. //
  5. // Purpose:
  6. // Globals.c is the routine in which global variables reside. Globals.h mirrors
  7. // the declarations in globals.c as externs and is included in all routines that
  8. // use globals.
  9. //
  10. // Notes:
  11. // This module was created for an interesting reason. NMAKE handles recursive
  12. // calls by saving its global variables somewhere in memory. It handles this by
  13. // allocating all global variables which have value changes in each recursive
  14. // in adjacent memory. The routine called recursively is doMake() and before it
  15. // is called the address of this chunk of memory is stored. When the recursive
  16. // call returns the memory is restored using the stored address. startOfSave and
  17. // endOfSave give the location of this chunk. The reason this method was opted
  18. // for is that spawning of NMAKE would consume a lot of memory under DOS. This
  19. // might not be very efficient under OS/2 because the code gets shared.
  20. //
  21. // Revision History:
  22. // 15-Nov-1993 JdR Major speed improvements
  23. // 04-Apr-1990 SB Add fHeapChk
  24. // 01-Dec-1989 SB Made some variables near and pushed some into saveArea
  25. // 19-Oct-1989 SB variable fOptionK added (ifdef SLASHK)
  26. // 02-Oct-1989 SB add dynamic inline file handling support
  27. // 24-Apr-1989 SB Added ext_size, filename_size, filenameext_size &
  28. // resultbuf_size for OS/2 1.2 support
  29. // 05-Apr-1989 SB made revList, delList, scriptFileList NEAR
  30. // 22-Mar-1989 SB removed tmpFileStack and related variables
  31. // 16-Feb-1989 SB added delList to have scriptfile deletes at end of make
  32. // 21-Dec-1988 SB Added scriptFileList to handle multiple script files
  33. // removed tmpScriptFile and fKeep (not reqd anymore)
  34. // 19-Dec-1988 SB Added fKeep to handle KEEP/NOKEEP
  35. // 14-Dec-1988 SB Added tmpScriptFile for 'z' option
  36. // 30-Nov-1988 SB Added revList to handle 'z' option
  37. // 23-Nov-1988 SB Added CmdLine[] to handle extmake syntax
  38. // made pCmdLineCopy Global in build.c
  39. // 21-Oct-1988 SB Added fInheritUserEnv to inherit macros
  40. // 20-Sep-1988 RB Clean up.
  41. // 17-Aug-1988 RB Declare everything NEAR.
  42. // 06-Jul-1988 rj Ditched shell and argVector globals.
  43. // Put all ECS declarations as macros in here.
  44. #if defined(STATISTICS)
  45. extern unsigned long CntfindMacro;
  46. extern unsigned long CntmacroChains;
  47. extern unsigned long CntinsertMacro;
  48. extern unsigned long CntfindTarget;
  49. extern unsigned long CnttargetChains;
  50. extern unsigned long CntStriCmp;
  51. extern unsigned long CntunQuotes;
  52. extern unsigned long CntFreeStrList;
  53. extern unsigned long CntAllocStrList;
  54. #endif
  55. extern BOOL fOptionK; // user specified /K ?
  56. extern BOOL fDescRebuildOrder; // user specified /O ?
  57. extern BOOL fSlashKStatus;
  58. // boolean used by action.c & nmake.c
  59. // Required for NMAKE enhancement -- to make NMAKE inherit user modified
  60. // changes in the environment. To be set to true before defineMacro() is
  61. // called so that user defined changes in environment variables are
  62. // reflected in the environment. If set to false then these changes are
  63. // made only in NMAKE tables and the environment remains unchanged
  64. extern BOOL fInheritUserEnv;
  65. extern BOOL fRebuildOnTie; // TRUE if /b specified, Rebuild on tie
  66. // Used by action.c and nmake.c
  67. // delList is the list of delete commands for deleting inline files which are
  68. // to be deleted before NMAKE exits & have a NOKEEP action specified.
  69. extern STRINGLIST * delList;
  70. // Complete list of generated inline files. Required to avoid duplicate names
  71. extern STRINGLIST * inlineFileList;
  72. // from NMAKE.C
  73. extern BOOL firstToken; // to initialize parser
  74. extern BOOL bannerDisplayed;
  75. extern UCHAR flags; // holds -d -s -n -i
  76. extern UCHAR gFlags; // "global" -- all targets
  77. extern char makeflags[];
  78. extern FILE * file;
  79. extern STRINGLIST * makeTargets; // list of targets to make
  80. extern STRINGLIST * makeFiles; // user can specify > 1
  81. extern BOOL fDebug;
  82. // from LEXER.C
  83. extern unsigned line;
  84. extern BOOL colZero; // global flag set if at column zero
  85. // of a makefile/tools.ini
  86. extern char * fName;
  87. extern char * string;
  88. extern INCLUDEINFO incStack[MAXINCLUDE];
  89. extern int incTop;
  90. // Inline file list -- Gets created in lexer.c and is used by action.c to
  91. // produce a delete command when 'NOKEEP' or Z option is set
  92. extern SCRIPTLIST * scriptFileList;
  93. // from PARSER.C
  94. #define STACKSIZE 16
  95. extern UCHAR stack[STACKSIZE];
  96. extern int top; // gets pre-incremented before use
  97. extern unsigned currentLine; // used for all error messages
  98. extern BOOL init; // global boolean value to indicate
  99. // if tools.ini is being parsed
  100. // from ACTION.C
  101. extern MACRODEF * macroTable[MAXMACRO];
  102. extern MAKEOBJECT * targetTable[MAXTARGET];
  103. extern STRINGLIST * macros;
  104. extern STRINGLIST * dotSuffixList;
  105. extern STRINGLIST * dotPreciousList;
  106. extern RULELIST * rules;
  107. extern STRINGLIST * list;
  108. extern char * name;
  109. extern BUILDBLOCK * block;
  110. extern UCHAR currentFlags;
  111. extern UCHAR actionFlags;
  112. // from BUILD.C
  113. extern unsigned errorLevel;
  114. extern unsigned numCommands;
  115. extern char * pCmdLineCopy;
  116. // Used to store expanded Command Line returned by SPRINTF, the result on
  117. // expanding extmake syntax part in the command line
  118. extern char CmdLine[MAXCMDLINELENGTH];
  119. // from IFEXPR.C
  120. #define IFSTACKSIZE 16
  121. extern UCHAR ifStack[IFSTACKSIZE];
  122. extern int ifTop; // gets pre-incremented before use
  123. extern char * lbufPtr; // pointer to alloc'd buffer
  124. // we don't use a static buffer so
  125. // that buffer may be realloced
  126. extern char * prevDirPtr; // ptr to directive to be processed
  127. extern unsigned lbufSize; // initial size of the buffer
  128. // from UTIL.C
  129. extern char * dollarDollarAt;
  130. extern char * dollarLessThan;
  131. extern char * dollarStar;
  132. extern char * dollarAt;
  133. extern STRINGLIST * dollarQuestion;
  134. extern STRINGLIST * dollarStarStar;
  135. extern char buf[MAXBUF]; // from parser.c
  136. extern const char suffixes[]; // from action.c
  137. extern const char ignore[];
  138. extern const char silent[];
  139. extern const char precious[];