Leaked source code of windows server 2003
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.

91 lines
2.3 KiB

  1. /************************************************************************/
  2. /* */
  3. /* RCPP - Resource Compiler Pre-Processor for NT system */
  4. /* */
  5. /* P0MACROS.C - Preprocessor Macros definitions */
  6. /* */
  7. /* 27-Nov-90 w-BrianM Update for NT from PM SDK RCPP */
  8. /* */
  9. /************************************************************************/
  10. #include "rc.h"
  11. int afxReadOnlySymbols = FALSE;
  12. int afxHiddenSymbols = FALSE;
  13. WCHAR* afxSzReadOnlySymbols = L"APSTUDIO_READONLY_SYMBOLS";
  14. WCHAR* afxSzHiddenSymbols = L"APSTUDIO_HIDDEN_SYMBOLS";
  15. static WCHAR lineBuffer[2048];
  16. void
  17. AfxOutputMacroUse(
  18. pdefn_t p
  19. )
  20. {
  21. if (!fAFXSymbols)
  22. return;
  23. if (afxHiddenSymbols)
  24. return;
  25. swprintf(lineBuffer,
  26. L" %c\"%s%c%s%c%d\"",
  27. SYMUSESTART,
  28. DEFN_NAME(p),
  29. SYMDELIMIT,
  30. Filename,
  31. SYMDELIMIT,
  32. Linenumber);
  33. move_to_exp(lineBuffer);
  34. }
  35. void
  36. AfxOutputMacroDefn(
  37. pdefn_t p
  38. )
  39. {
  40. char flags;
  41. int nLen;
  42. if (!fAFXSymbols || OUTPUTFILE == NULL)
  43. return;
  44. if (wcscmp(DEFN_NAME(p), afxSzReadOnlySymbols) == 0) {
  45. afxReadOnlySymbols = TRUE;
  46. return;
  47. }
  48. if (wcscmp(DEFN_NAME(p), afxSzHiddenSymbols) == 0) {
  49. afxHiddenSymbols = TRUE;
  50. return;
  51. }
  52. if (afxHiddenSymbols || DEFN_TEXT(p) == NULL)
  53. return;
  54. if (afxReadOnlySymbols)
  55. flags = SYS_RESOURCE;
  56. else
  57. flags = 0;
  58. nLen = swprintf(lineBuffer,
  59. L"%c%s%c%s%c%d%c%c%c",
  60. SYMDEFSTART,
  61. DEFN_NAME(p),
  62. SYMDELIMIT,
  63. DEFN_TEXT(p),
  64. SYMDELIMIT,
  65. #if 0
  66. Filename,
  67. SYMDELIMIT,
  68. // don't forget to add %s%c
  69. #endif
  70. Linenumber,
  71. SYMDELIMIT,
  72. (char)flags | '\200', // (char)0x80,
  73. SYMDELIMIT);
  74. myfwrite(lineBuffer, nLen * sizeof(WCHAR), 1, OUTPUTFILE);
  75. }