parser_local_proto.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef __PARSER_LOCAL_PROTO_H__
  2. #define __PARSER_LOCAL_PROTO_H__
  3. #include <grass/config.h>
  4. #if defined(HAVE_LANGINFO_H)
  5. #include <langinfo.h>
  6. #endif
  7. #if defined(__MINGW32__) && defined(USE_NLS)
  8. #include <localcharset.h>
  9. #endif
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include <ctype.h>
  14. #include <unistd.h>
  15. #include <stdarg.h>
  16. #include <sys/types.h>
  17. #include <grass/gis.h>
  18. #include <grass/glocale.h>
  19. #include <grass/spawn.h>
  20. struct Item
  21. {
  22. struct Option *option;
  23. struct Flag *flag;
  24. struct Item *next_item;
  25. };
  26. struct state {
  27. int no_interactive;
  28. int n_opts;
  29. int n_flags;
  30. int n_keys;
  31. int n_keys_alloc;
  32. int overwrite;
  33. int quiet;
  34. int has_required;
  35. struct GModule module_info; /* general information on the corresponding module */
  36. const char *pgm_name;
  37. const char *pgm_path;
  38. struct Flag first_flag; /* First flag in a linked list */
  39. struct Flag *current_flag; /* Pointer for traversing list */
  40. struct Option first_option;
  41. struct Option *current_option;
  42. struct Item first_item;
  43. struct Item *current_item;
  44. int n_items;
  45. };
  46. extern struct state *st;
  47. #define BAD_SYNTAX 1
  48. #define OUT_OF_RANGE 2
  49. #define MISSING_VALUE 3
  50. #define AMBIGUOUS 4
  51. #define REPLACED 5
  52. #define KEYLENGTH 64
  53. /* functions which are used by several parser functions in different files */
  54. void G__usage_xml(void);
  55. void G__usage_html(void);
  56. void G__script(void);
  57. void G__wps_print_process_description(void);
  58. int G__uses_new_gisprompt(void);
  59. void G__print_keywords(FILE *fd, void (*format)(FILE *, const char *));
  60. #endif