UilSrcDef.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these librararies and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*
  24. * @OSF_COPYRIGHT@
  25. * COPYRIGHT NOTICE
  26. * Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  27. * ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  28. * the full copyright text.
  29. */
  30. /*
  31. * HISTORY
  32. */
  33. /* $XConsortium: UilSrcDef.h /main/10 1995/07/14 09:38:34 drk $ */
  34. /*
  35. * (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  36. /*
  37. **++
  38. ** FACILITY:
  39. **
  40. ** User Interface Language Compiler (UIL)
  41. **
  42. ** ABSTRACT:
  43. **
  44. ** This include file defines the interface to the UIL source
  45. ** management procedures in the UIL compiler.
  46. **
  47. **--
  48. **/
  49. #ifndef UilSrcDef_h
  50. #define UilSrcDef_h
  51. /*
  52. ** Interface to src_open_source
  53. */
  54. #define src_k_open_normal 1 /* open succeeded */
  55. #define src_k_open_error 0 /* open was unsuccessful */
  56. /*
  57. ** Close return statuses
  58. */
  59. #define src_k_close_normal 1 /* close succeeded */
  60. #define src_k_close_error 0 /* close was unsuccessful */
  61. /*
  62. ** Interface to src_get_source_line
  63. */
  64. #define src_k_read_truncated 3 /* record truncated */
  65. #define src_k_read_error 2 /* error during read */
  66. #define src_k_read_normal 1 /* record read normally */
  67. #define src_k_end_source 0 /* end of source */
  68. /*
  69. ** Source records describe the lines of the source program. The are
  70. ** used to retrieve the source file for the listing and diagnostics.
  71. ** Diagnostics randomly access these data structures by maintaining
  72. ** the address of the corresponding source record in tokens, the parse
  73. ** stack and symbol table entries. The listing file walks the source
  74. ** records via the linked list provide by ar_next_source_record.
  75. */
  76. #define _src_null_access_key( _key ) (_key.l_key == EOF)
  77. #define src_k_key_length 4
  78. typedef struct
  79. {
  80. unsigned long l_key;
  81. } z_key;
  82. typedef struct _src_message_item_type
  83. {
  84. struct _src_message_item_type *az_next_message;
  85. status l_message_number;
  86. unsigned char b_source_pos;
  87. char c_text[ 1 ];
  88. } src_message_item_type;
  89. #define src_message_item_type_size \
  90. (sizeof(src_message_item_type) -\
  91. sizeof( struct _src_message_item_type.c_text))
  92. typedef struct _src_machine_code_type
  93. {
  94. struct _src_machine_code_type *az_next_machine_code;
  95. unsigned short int w_offset;
  96. unsigned short int w_code_len;
  97. union {
  98. long q_longdata[1]; /* longword alias for data*/
  99. char c_data[ 1 ]; /* byte alias for data */
  100. } data;
  101. } src_machine_code_type;
  102. #define src_machine_code_type_size \
  103. (sizeof(src_machine_code_type) -\
  104. sizeof( struct _src_machine_code_type.c_text))
  105. /*
  106. ** Mask for bits in b_flags of the source record
  107. */
  108. #define src_m_form_feed (1<<0)
  109. #define src_m_unprintable_chars (1<<1)
  110. typedef struct _src_source_record_type
  111. {
  112. struct _src_source_record_type *az_next_source_record;
  113. src_message_item_type *az_message_list;
  114. unsigned short w_line_number;
  115. unsigned char b_file_number;
  116. unsigned char b_flags;
  117. z_key z_access_key;
  118. src_machine_code_type *az_machine_code_list;
  119. unsigned short w_machine_code_cnt;
  120. } src_source_record_type;
  121. /*
  122. ** Source buffers describe the lines of the source program that are
  123. ** currently being SCAN. Include files and macros a can cause a program
  124. ** to have more than 1 source buffer. These buffers are managed as a
  125. ** stack, implemented via a linked list.
  126. */
  127. typedef struct _src_source_buffer_type
  128. {
  129. struct _src_source_buffer_type *az_prior_source_buffer;
  130. unsigned short w_current_line_number;
  131. unsigned short w_current_position;
  132. char b_file_number;
  133. char c_text[ src_k_max_source_line_length+1];
  134. } src_source_buffer_type;
  135. #endif /* UilSrcDef_h */
  136. /* DON'T ADD STUFF AFTER THIS #endif */