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.

144 lines
3.9 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: structo.h
  3. *
  4. * Copyright (c) 1985-96, Microsoft Corporation
  5. *
  6. * 04/09/96 GerardoB Created
  7. \***************************************************************************/
  8. #include <stdio.h>
  9. #include <stddef.h>
  10. #include <windows.h>
  11. /***************************************************************************\
  12. * Defines
  13. \***************************************************************************/
  14. // Working files
  15. #define SOWF_APPENDOUTPUT 0x0001
  16. #define SOWF_INCLUDEINPUTFILE 0x0002
  17. #define SOWF_INLCLUDEPRECOMPH 0x0004
  18. #define SOWF_LISTONLY 0x0008
  19. // soCloseWorkingFiles
  20. #define SOCWF_DEFAULT 0x0
  21. #define SOCWF_CLEANUP 0x1
  22. // soLogMsg
  23. #define SOLM_DEFAULT 0x0000
  24. #define SOLM_NOLABEL 0x0001
  25. #define SOLM_ERROR 0x0002
  26. #define SOLM_WARNING 0x0004
  27. #define SOLM_API 0x0008
  28. #define SOLM_APIERROR (SOLM_API | SOLM_ERROR)
  29. #define SOLM_NOEOL 0x0010
  30. #define SOLM_APPEND (SOLM_NOLABEL | SOLM_NOEOL)
  31. // Field info
  32. #define SOFI_ALLOCATED 0x0001
  33. #define SOFI_ARRAY 0x0002
  34. #define SOFI_ARRAYALLOCATED 0x0004
  35. #define SOFI_BIT 0x0008
  36. /***************************************************************************\
  37. * Structures
  38. \***************************************************************************/
  39. typedef struct _FILEMAP
  40. {
  41. /*
  42. * hfileInput is assumed to be the first field of this structure
  43. */
  44. union {
  45. HANDLE hfileInput;
  46. HANDLE hfile;
  47. };
  48. HANDLE hmap;
  49. char * pmapStart;
  50. char * pmap;
  51. char * pmapEnd;
  52. } FILEMAP, * PFILEMAP;
  53. typedef struct _STRUCTLIST
  54. {
  55. UINT uSize;
  56. char * pszName;
  57. UINT uCount;
  58. } STRUCTLIST, * PSTRUCTLIST;
  59. typedef struct _WORKINGFILES
  60. {
  61. DWORD dwOptions;
  62. char * pszInputFile;
  63. FILEMAP;
  64. char * pszOutputFile;
  65. HANDLE hfileOutput;
  66. HANDLE hfileTemp;
  67. char * pszStructsFile;
  68. PSTRUCTLIST psl;
  69. DWORD uTablesCount;
  70. char * pszIncInputFileExt;
  71. } WORKINGFILES, * PWORKINGFILES;
  72. typedef struct _BLOCK
  73. {
  74. char * pBegin;
  75. char * pEnd;
  76. char * pName;
  77. UINT uNameSize;
  78. } BLOCK, * PBLOCK;
  79. typedef struct _FIELDINFO
  80. {
  81. char * pszStructName;
  82. char * pType;
  83. DWORD dwFlags;
  84. UINT uTypeSize;
  85. char * pArray;
  86. UINT uArraySize;
  87. } FIELDINFO, * PFIELDINFO;
  88. /***************************************************************************\
  89. * Globals
  90. \***************************************************************************/
  91. // socode.c
  92. extern char * gpszHeader [];
  93. extern char * gpszTail [];
  94. // soglobal.c
  95. extern char gszPrecomph [];
  96. extern char gszIncInput [];
  97. extern char gszStructTag [];
  98. extern char gszStructDef [];
  99. extern char gszStructDefFmt [];
  100. extern char gszStructBegin [];
  101. extern char gszStructEnd [];
  102. extern char gszStructFieldOffsetFmt [];
  103. extern char gszStructAbsoluteOffsetFmt [];
  104. extern char gszStructLastRecord [];
  105. extern char gszStructRelativeOffsetFmt [];
  106. extern char gszStructArrayRelativeOffsetFmt [];
  107. extern char gszTableDef [];
  108. extern char gszTableEntryFmt [];
  109. extern char gszTableEnd [];
  110. extern STRUCTLIST gpslEmbeddedStructs [];
  111. /***************************************************************************\
  112. * Funtion Prototypes
  113. \***************************************************************************/
  114. // sofile.c
  115. BOOL soCopyStructuresTable (PWORKINGFILES pwf);
  116. BOOL soCloseWorkingFiles (PWORKINGFILES pwf, DWORD dwFlags);
  117. BOOL soOpenWorkingFiles (PWORKINGFILES pwf);
  118. BOOL __cdecl soWriteFile(HANDLE hfile, char *pszfmt, ...);
  119. // soparse.c
  120. char * soCopyTagName (char * pTagName, UINT uTagSize);
  121. char * soFindChar (char * pmap, char * pmapEnd, char c);
  122. char * soFindTag (char * pmap, char * pmapEnd, char * pszTag);
  123. char * soGetIdentifier (char * pmap, char * pmapEnd, UINT * puSize);
  124. BOOL soIsIdentifierChar (char c);
  125. char * soParseStruct (PWORKINGFILES pwf);
  126. // soutil.c
  127. void __cdecl soLogMsg(DWORD dwFlags, char *pszfmt, ...);