Subversion Repositories pentevo

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef MHMT_PARSEARG_H
  2.  
  3. #define MHMT_PARSEARG_H
  4.  
  5.  
  6. #include "mhmt-types.h"
  7.  
  8.  
  9.  
  10. // string identifiers which are to be repeated somewhere
  11. #define ARGSTR_MEGALZ "mlz"
  12. #define ARGSTR_HRUM   "hrm"
  13. #define ARGSTR_HRUST  "hst"
  14. #define ARGSTR_ZX7    "zx7"
  15.  
  16. #define ARGSTR_8  "8"
  17. #define ARGSTR_16 "16"
  18.  
  19. #define ARGSTR_MW256   "maxwin256"
  20. #define ARGSTR_MW512   "maxwin512"
  21. #define ARGSTR_MW1024  "maxwin1024"
  22. #define ARGSTR_MW2048  "maxwin2048"
  23. #define ARGSTR_MW2176  "maxwin2176"
  24. #define ARGSTR_MW4096  "maxwin4096"
  25. #define ARGSTR_MW4352  "maxwin4352"
  26. #define ARGSTR_MW8192  "maxwin8192"
  27. #define ARGSTR_MW16384 "maxwin16384"
  28. #define ARGSTR_MW32768 "maxwin32768"
  29. #define ARGSTR_MW65536 "maxwin65536"
  30.  
  31. #define ARGSTR_PB "prebin"
  32.  
  33. //argument types
  34. #define ARG_INIT    0 // not to be placed in srgtbl.type!
  35. #define ARG_MODE    1 // pack/depack
  36. #define ARG_GREEDY  2
  37. #define ARG_PTYPE   3 // pack type (megalz/hrum/hrust)
  38. #define ARG_ZXHEAD  4
  39. #define ARG_WORD    5
  40. #define ARG_BIGEND  6
  41. #define ARG_MAXWIN  7
  42. #define ARG_PREBIN  8 // name of prebinary
  43. #define ARG_NOARG 255 // just top-fill value for argstore[]
  44.  
  45.  
  46. // argument table to match commandline args
  47. struct argtbl
  48. {
  49.         char * name;
  50.         ULONG type;
  51.         char * fname;
  52. };
  53.  
  54.  
  55.  
  56. // size of temporary argument storing array in parse_args()
  57. #define ARG_STORE_SIZE 17
  58.  
  59. // return bit values for parse_args()
  60. // possible combinations:
  61. // SHOWHELP with or without ERROR,
  62. // GO without ERROR,
  63. // ERROR alone,
  64. // nothing (if no args at all)
  65. #define ARG_PARSER_SHOWHELP 1
  66. #define ARG_PARSER_GO       2
  67. #define ARG_PARSER_ERROR    256
  68.  
  69. ULONG parse_args(int argc, char* argv[]);
  70.  
  71. void sort_args( struct argtbl * args, ULONG argsize );
  72.  
  73. LONG get_maxwin( char * txtmaxwin );
  74.  
  75. struct argtbl * match_arg(char * argument);
  76.  
  77. LONG cmp_str_nocase(char * left, char * right);
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. #endif
  85.  
  86.