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.

72 lines
1.6 KiB

  1. #if !defined (JD_MISC_H)
  2. #define JD_MISC_H
  3. /*++
  4. Copyright (c) 1996 Microsoft Corporation
  5. Module Name:
  6. jd_misc.h
  7. Abstract:
  8. header file for jd_misc.cpp
  9. Author:
  10. jaroslad
  11. Revision History:
  12. 06-01-96 ( Jaroslad ) Original.
  13. --*/
  14. #include <windows.h>
  15. int random(int low, int high);
  16. enum Tptr_type {TYPE_TCHAR,TYPE_INT,TYPE_LONG, TYPE_WORD,TYPE_DWORD,TYPE_LPCTSTR};
  17. enum Topt_mand {OPT,MAND}; // switches can be optional or mandatory
  18. struct SParamDef
  19. {
  20. _TCHAR *sw; // letter for switch
  21. int param_number; //number of parameters (0-zero,1 means exactly one,
  22. // >1 means not more param than
  23. void * ptr; // pointer to assign value of switch (depends on sw_type)
  24. enum Tptr_type ptr_type;
  25. enum Topt_mand opt_mand;
  26. _TCHAR * text_desc; //description for usage print
  27. _TCHAR * text_param; //what param the switch requires
  28. //(if in usage is '...-c [file]' text_param is "file" )
  29. WORD * param_read; //same as curr_param_read, but used to export value to caller
  30. WORD curr_param_read; // current nuber of params already assigned to ptr;
  31. // applies only with param_number >1
  32. };
  33. typedef struct SParamDef TParamDef;
  34. void DisplayUsageAndExit( _TCHAR **argv, TParamDef *tt);
  35. void DisplayUsage( _TCHAR **argv, TParamDef *tt);
  36. void ParseParam(int argc, _TCHAR ** argv, TParamDef * tt);
  37. int time_printf(_TCHAR *format, ...);
  38. void fatal_error_printf(_TCHAR *format, ...);
  39. void error_printf(_TCHAR *format, ...);
  40. #define YES TRUE
  41. #define NO FALSE
  42. #define SUCCESS TRUE
  43. #define FAILURE FALSE
  44. #endif