windmc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* windmc.h -- header file for windmc program.
  2. Copyright (C) 2007-2022 Free Software Foundation, Inc.
  3. Written by Kai Tietz, Onevision.
  4. This file is part of GNU Binutils.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  16. 02110-1301, USA. */
  17. #include "ansidecl.h"
  18. /* This is the header file for the windmc program. It defines
  19. structures and declares functions used within the program. */
  20. #include "winduni.h"
  21. #ifndef WINDMC_HXX
  22. #define WINDMC_HXX
  23. /* Global flag variables (set by windmc.c file. */
  24. extern int mcset_custom_bit;
  25. extern int mcset_out_values_are_decimal;
  26. extern rc_uint_type mcset_max_message_length;
  27. extern unichar *mcset_msg_id_typedef;
  28. /* Lexer keyword definition and internal memory structures. */
  29. typedef struct mc_keyword
  30. {
  31. struct mc_keyword *next;
  32. const char *group_name;
  33. size_t len;
  34. unichar *usz;
  35. int rid;
  36. rc_uint_type nval;
  37. unichar *sval;
  38. wind_language_t lang_info;
  39. } mc_keyword;
  40. typedef struct mc_node_lang
  41. {
  42. struct mc_node_lang *next;
  43. rc_uint_type vid;
  44. const mc_keyword *lang;
  45. unichar *message;
  46. } mc_node_lang;
  47. typedef struct mc_node
  48. {
  49. struct mc_node *next;
  50. unichar *user_text;
  51. const mc_keyword *facility;
  52. const mc_keyword *severity;
  53. unichar *symbol;
  54. rc_uint_type id;
  55. rc_uint_type vid;
  56. unichar *id_typecast;
  57. mc_node_lang *sub;
  58. } mc_node;
  59. extern mc_node *mc_nodes;
  60. void mc_add_keyword (unichar *, int, const char *, rc_uint_type, unichar *);
  61. const mc_keyword *enum_facility (int);
  62. const mc_keyword *enum_severity (int);
  63. mc_node_lang *mc_add_node_lang (mc_node *, const mc_keyword *, rc_uint_type);
  64. mc_node *mc_add_node (void);
  65. /* Standard yacc/flex stuff. */
  66. void yyerror (const char *);
  67. int yylex (void);
  68. int yyparse (void);
  69. /* mclex.c */
  70. void mc_set_inputfile (const char *);
  71. void mc_set_content (const unichar *);
  72. /* Lexer control variables. Used by mcparser.y file. */
  73. extern bool mclex_want_nl;
  74. extern bool mclex_want_line;
  75. extern bool mclex_want_filename;
  76. void mc_fatal (const char *, ...);
  77. void mc_warn (const char *, ...);
  78. #endif