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.

143 lines
3.0 KiB

  1. /*++
  2. PRIVATE.H
  3. Header files and privates for the options project
  4. Created, DavidCHR 6/9/1997
  5. --*/
  6. #include "..\inc\master.h"
  7. #include ".\options.h"
  8. #include ".\client.h"
  9. #define STRCASECMP lstrcmpiA
  10. #define STRNCASECMP _strnicmp
  11. #ifdef DEBUG_OPTIONS
  12. #define OPTIONS_DEBUG printf
  13. #else
  14. #define OPTIONS_DEBUG /* nothing */
  15. #endif
  16. typedef struct savenode {
  17. PVOID DataElement;
  18. ULONG DeallocMethod;
  19. struct savenode *next;
  20. } SAVENODE, *PSAVENODE;
  21. typedef struct {
  22. PSAVENODE FirstNode;
  23. PSAVENODE LastNode;
  24. } SAVEQUEUE, *PSAVEQUEUE;
  25. typedef union _optionUnion {
  26. PVOID *raw_data;
  27. OPTFUNC *func;
  28. OPTFUNC2 *func2;
  29. int *integer;
  30. float *real;
  31. PCHAR *string;
  32. BOOL *boolean;
  33. optionStruct *optStruct;
  34. #ifdef WINNT
  35. UNICODE_STRING *unicode_string;
  36. PWCHAR *wstring;
  37. #endif
  38. } optionUnion, OPTU, *POPTU;
  39. #define OPT_FLAG_INTERNAL_JUMPOUT 0x10 // for internal use only.
  40. /* The DeallocationMethods are: */
  41. typedef enum {
  42. DEALLOC_METHOD_TOO_SMALL = 0, /* MUST BE FIRST */
  43. DeallocWithFree,
  44. DeallocWithLocalFree,
  45. DeallocWithOptionDealloc,
  46. DEALLOC_METHOD_TOO_LARGE /* MUST BE LAST */
  47. } DEALLOC_METHOD;
  48. BOOL
  49. ParseSublist( POPTU Option,
  50. PCHAR *argv,
  51. int argc,
  52. int theIndex,
  53. int *argsused,
  54. ULONG flags,
  55. PBOOL pbStopParsing,
  56. PSAVEQUEUE pQueue ); /* sublist.c */
  57. BOOL
  58. StoreOption( optionStruct *opt,
  59. PCHAR *argv,
  60. int argc,
  61. int argi,
  62. int opti,
  63. ULONG flags,
  64. int *argsused,
  65. BOOL includes_arg,
  66. PBOOL pbStopParsing,
  67. PSAVEQUEUE pQueue ); /* store.c */
  68. BOOL
  69. ParseOneOption( int argc,
  70. PCHAR *argv,
  71. int argi,
  72. ULONG flags,
  73. optionStruct *options,
  74. int *argsused,
  75. PBOOL pbStopParsing,
  76. PSAVEQUEUE pSaveQueue ); // parse.c
  77. BOOL
  78. ParseCompare( optionStruct *optionEntry,
  79. ULONG flags,
  80. PCHAR argument ); /* compare.c */
  81. /* Use this macro to easily get an option union from the necessarily-
  82. obscured structure_entry. */
  83. #define POPTU_CAST( structure_entry ) ( (POPTU) &((structure_entry).data) )
  84. // EXAMPLE: POPTU_CAST( options[opti] )->string
  85. BOOL
  86. FindUnusedOptions( optionStruct *options,
  87. ULONG flags,
  88. /* OPTIONAL */ PCHAR prefix,
  89. PSAVEQUEUE pQueue ) ; // nonnull.c
  90. BOOL
  91. StoreEnvironmentOption( optionStruct *opt,
  92. ULONG flags,
  93. PSAVEQUEUE pQueue); // store.c
  94. BOOL
  95. ResolveEnumFromStrings( ULONG cStrings,
  96. PCHAR *strings,
  97. optionStruct *theOpt,
  98. ULONG *pcArgsUsed ); // enum.c
  99. BOOL
  100. PrintEnumValues( FILE *out,
  101. PCHAR header,
  102. optEnumStruct *pStringTable ); // enum.c