![]() |
|
|||
File indexing completed on 2025-02-21 10:15:55
0001 /* 0002 * Motif 0003 * 0004 * Copyright (c) 1987-2012, The Open Group. All rights reserved. 0005 * 0006 * These libraries and programs are free software; you can 0007 * redistribute them and/or modify them under the terms of the GNU 0008 * Lesser General Public License as published by the Free Software 0009 * Foundation; either version 2 of the License, or (at your option) 0010 * any later version. 0011 * 0012 * These libraries and programs are distributed in the hope that 0013 * they will be useful, but WITHOUT ANY WARRANTY; without even the 0014 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 0015 * PURPOSE. See the GNU Lesser General Public License for more 0016 * details. 0017 * 0018 * You should have received a copy of the GNU Lesser General Public 0019 * License along with these librararies and programs; if not, write 0020 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 0021 * Floor, Boston, MA 02110-1301 USA 0022 */ 0023 0024 /* 0025 **++ 0026 ** FACILITY: 0027 ** 0028 ** User Interface Language Compiler (UIL) 0029 ** 0030 ** ABSTRACT: 0031 ** 0032 ** This include file defines the interfaces necessry to the binary 0033 ** data base in the WML & UIL compilers. 0034 ** 0035 **-- 0036 **/ 0037 0038 #ifndef UilDBDef_h 0039 #define UilDBDef_h 0040 0041 /*********************************************************************** 0042 ****************** From UilDef.h ***************************************/ 0043 #define _BIT_INDEX(_type) \ 0044 (((unsigned int) (_type)) >> 3) 0045 0046 #define _BIT_MASK(_type) \ 0047 (1 << (((unsigned int) (_type)) & 0x7)) 0048 0049 #define _BIT_SET(table_entry_addr, _type) \ 0050 ( _BIT_MASK (_type) & \ 0051 ( ((unsigned char *) (table_entry_addr)) \ 0052 [ _BIT_INDEX (_type) ] ) ) 0053 0054 /******************************************************************* 0055 **************** From UilSymDef.h *********************************/ 0056 /* 0057 ** Hash table size 0058 */ 0059 0060 #define sym_k_hash_table_limit 127 0061 0062 /* 0063 ** Symbol tags. These values are used in the tag field of every object header 0064 ** to identify the type of the entry. 0065 */ 0066 0067 #define sym_k_error_entry (127) 0068 /* An error entry is used when compilation errors are detected in the */ 0069 /* source program. Its use reduces cascading errors caused by missing */ 0070 /* information and allows the compilation to continue and thus */ 0071 /* additional errors may be detected */ 0072 #define sym_k_value_entry 1 0073 /* A value entry contains information about a UIL literal value */ 0074 /* (integer, string, compound string, xbitmapfile, argument, color, */ 0075 /* icon, etc.). The b_type field is used to determine the datatype of */ 0076 /* this value. */ 0077 #define sym_k_name_entry 2 0078 /* A name entry corresponds to a name (identifier) used in the UIL */ 0079 /* source. */ 0080 #define sym_k_widget_entry 3 0081 /* A widget entry represents a widget declaration. It points off to */ 0082 /* the arguments, callbacks, and controls lists for the widget. */ 0083 #define sym_k_control_entry 4 0084 /* A control entry hangs off a list entry and identifes an object */ 0085 /* (widget or gadget) that is controlled. It also contains the */ 0086 /* managed/unmanaged information. */ 0087 #define sym_k_forward_ref_entry 5 0088 /* forward reference entries are a linked listed of objects */ 0089 /* (widgets/gadgets) that were not defined at the time of the */ 0090 /* reference. After all objects have been seen, then this list is */ 0091 /* traversed and all objects in it should now be defined and the */ 0092 /* specified pointers can be filled-in. */ 0093 #define sym_k_external_def_entry 6 0094 /* An external definition entry identifies a name that has been */ 0095 /* imported and thus in not declared within this source module. */ 0096 #define sym_k_argument_entry 7 0097 /* An argument entry hangs off a list entry and identifies an object */ 0098 /* argument. It contains informtation about the argument name and */ 0099 /* argument value. */ 0100 #define sym_k_callback_entry 8 0101 /* An calllback entry hangs off a list entry and identifies an object */ 0102 /* callback. It contains informtation about the callback name, */ 0103 /* callback procedure, and callback tag. */ 0104 #define sym_k_module_entry 9 0105 /* A module entry contains information specified on the module */ 0106 /* statement. */ 0107 #define sym_k_proc_def_entry 10 0108 /* A procedure definition entry is created for each procedure listed */ 0109 /* in a procedure section. I contains informaion on the number and */ 0110 /* types of the arguments. */ 0111 0112 #define sym_k_proc_ref_entry 11 0113 /* A procedure reference entry contains information about a the use of */ 0114 /* a procedure (e.g. as a callback). It also stores the tag to be */ 0115 /* passed to the procedure. */ 0116 #define sym_k_list_entry 12 0117 /* A list entry is a typed list of other symbol table entries. It */ 0118 /* contains a count and a pointer to the next entry on the list via */ 0119 /* the obj_header.az_next field. */ 0120 #define sym_k_child_entry 13 0121 /* A child entry represents a declaration for an */ 0122 /* automatically created child. It points off to */ 0123 /* the arguments, callbacks, and controls lists for the child. Since */ 0124 /* the structures for widget and child are the same, the */ 0125 /* datastructure for children is really a sym_k_widget_entry_type. */ 0126 #define sym_k_identifier_entry 14 0127 /* identifier entry tag is used for diagnostic messages only */ 0128 #define sym_k_color_item_entry 15 0129 /* entry describing a color. */ 0130 #define sym_k_gadget_entry 16 0131 /* A gadget entry represents a gadget declaration. It points off to */ 0132 /* the arguments, callbacks, and controls lists for the gadget. Since */ 0133 /* the structures for widget and gadgets are the same, the */ 0134 /* datastructure for gadgets is really a sym_k_widget_entry_type. */ 0135 #define sym_k_root_entry 17 0136 /* An entry used to group all the other entries together. It is */ 0137 /* returned in the parse_tree_root field of the compilation descriptor */ 0138 /* when using the callable interface. */ 0139 #define sym_k_parent_list_entry 18 0140 /* This is a list of parents of a widget. It is used to check for */ 0141 /* constraints provided by the parent that may be used on this widget. */ 0142 #define sym_k_nested_list_entry 19 0143 /* This entry occurs as a list entry for a nested list. It occupies */ 0144 /* the correct position in the list for the reference to a list, and */ 0145 /* points to the actual list entry. */ 0146 #define sym_k_include_file_entry 20 0147 /* An include file entry is used to describe the contents of an */ 0148 /* include file. It is needed only maintain information about the */ 0149 /* source file from which this parse tree was generated. It is not */ 0150 /* used by UIL directly. */ 0151 #define sym_k_section_entry 21 0152 /* A section entry is used to describe the contents of an source file. */ 0153 /* It is needed only maintain information about the structure of */ 0154 /* source file from which this parse tree was generated. It is not */ 0155 /* used by UIL directly. */ 0156 /* */ 0157 #define sym_k_def_obj_entry 22 0158 /* This entry corresponds to the default object clause on the module */ 0159 /* declaration it is used to store source information about the file */ 0160 /* from which this parse tree was generated. It is not used by UIL */ 0161 /* directly. */ 0162 #define sym_k_UNUSED23_entry 23 0163 #define sym_k_val_forward_ref_entry 24 0164 /* val forward reference entries are a linked listed of values */ 0165 /* that were not defined at the time of the */ 0166 /* reference. After all values have been seen, then this list is */ 0167 /* traversed and all values in it should now be defined and the */ 0168 /* specified pointers can be filled-in. */ 0169 #define sym_k_max_entry 24 0170 /* this is the largest possible value for an entry constant. */ 0171 0172 0173 /* 0174 ** Common attribute masks -- These values are used in the b_flags field of 0175 ** the object_header. 0176 */ 0177 0178 #define sym_m_private (1 << 0) 0179 /* This item is private to this source module and thus need not be */ 0180 /* output into the UID file. */ 0181 #define sym_m_exported (1 << 1) 0182 /* This is an exported definition and must be put in the UID file. */ 0183 #define sym_m_imported (1 << 2) 0184 /* This item is a reference external to this source module and thus */ 0185 /* will be resolved at runtime by searching the resourec hierarchy. */ 0186 #define sym_m_reference (1 << 3) 0187 #define sym_m_builtin (1 << 4) 0188 /* This item is builtin as oppose to a userdefined item. */ 0189 #define sym_m_obj_is_gadget (1 << 5) 0190 /* This object is a gadget as oppose to a widget. */ 0191 0192 0193 /* 0194 ** Output states - order is important 0195 */ 0196 0197 #define sym_k_not_processed 0 0198 #define sym_k_queued 1 0199 #define sym_k_emitted 2 0200 0201 0202 0203 /* 0204 ** Constants to define compiler-recognized data types. It is 0205 ** important that the names used in .wml language descriptions 0206 ** match these names. These values were once automatically generated 0207 ** by WML. They are now maintained by hand to reduce compiler 0208 ** dependence on WML artifacts. 0209 ** 0210 ** We have also separated the values loosely into two classes: 0211 ** values which can be used to verify operator legality and values 0212 ** which cannot (see UilSemVal.c -- the legal_operand_type table). 0213 ** There is a comment below denoting where the separation is. Any 0214 ** values above the comment may be used for validation of an operator 0215 ** while any values below may not. 0216 ** 0217 ** The order of the values below is unimportant except that the 0218 ** entries in the uil_datatype_names table in UilData.c must be 0219 ** ordered the same way. 0220 */ 0221 #define sym_k_any_value 1 0222 #define sym_k_bool_value 2 0223 #define sym_k_char_8_value 3 0224 #define sym_k_compound_string_value 4 0225 #define sym_k_float_value 5 0226 #define sym_k_integer_value 6 0227 #define sym_k_single_float_value 7 0228 #define sym_k_localized_string_value 8 0229 #define sym_k_wchar_string_value 9 0230 #define sym_k_horizontal_integer_value 10 0231 #define sym_k_vertical_integer_value 11 0232 #define sym_k_horizontal_float_value 12 0233 #define sym_k_vertical_float_value 13 0234 /* Values after here may not be used for operator argument validation */ 0235 #define sym_k_argument_value 14 0236 #define sym_k_asciz_table_value 15 0237 #define sym_k_class_rec_name_value 16 0238 #define sym_k_color_value 17 0239 #define sym_k_color_table_value 18 0240 #define sym_k_font_value 19 0241 #define sym_k_font_table_value 20 0242 #define sym_k_icon_value 21 0243 #define sym_k_identifier_value 22 0244 #define sym_k_integer_table_value 23 0245 #define sym_k_keysym_value 24 0246 #define sym_k_pixmap_value 25 0247 #define sym_k_reason_value 26 0248 #define sym_k_rgb_value 27 0249 #define sym_k_string_table_value 28 0250 #define sym_k_trans_table_value 29 0251 #define sym_k_widget_ref_value 30 0252 #define sym_k_xbitmapfile_value 31 0253 #define sym_k_fontset_value 32 0254 #define sym_k_child_value 33 0255 #define sym_k_max_value 33 0256 #define sym_k_no_value (sym_k_max_value+1) 0257 0258 /* 0259 * Error values for all kind of sym_k_... literal set 0260 */ 0261 #define sym_k_error_value 0 0262 #define sym_k_error_object 0 0263 #define sym_k_error_charset 0 0264 0265 0266 /* 0267 * Literals associated with character sets 0268 * 0269 * Character set character sizes 0270 */ 0271 #define sym_k_onebyte_charsize 1 0272 #define sym_k_twobyte_charsize 2 0273 #define sym_k_mixed1_2byte_charsize 3 0274 0275 /* 0276 * User-defined character set 0277 */ 0278 #define sym_k_userdefined_charset 1 0279 0280 /* 0281 * XmFONTLIST_DEFAULT_TAG 0282 */ 0283 #define sym_k_fontlist_default_tag 0 0284 0285 /* 0286 ** value sets defining expression operators 0287 */ 0288 #define sym_k_unspecified_op 0 0289 #define sym_k_not_op 1 0290 #define sym_k_unary_plus_op 2 0291 #define sym_k_unary_minus_op 3 0292 #define sym_k_comp_str_op 4 0293 #define sym_k_wchar_str_op 5 0294 #define sym_k_last_unary_op 5 0295 0296 #define sym_k_multiply_op 6 0297 #define sym_k_divide_op 7 0298 #define sym_k_add_op 8 0299 #define sym_k_subtract_op 9 0300 #define sym_k_left_shift_op 10 0301 #define sym_k_right_shift_op 11 0302 #define sym_k_and_op 12 0303 #define sym_k_xor_op 13 0304 #define sym_k_or_op 14 0305 #define sym_k_cat_op 15 0306 #define sym_k_last_binary_op 15 0307 #define sym_k_valref_op 16 /* az_exp_op1 points to the value node 0308 whose value is referenced by this 0309 value node. */ 0310 #define sym_k_coerce_op 17 /* az_exp_op1 points to the value node 0311 whose value is to be coerced to the 0312 data type of this node. */ 0313 #define sym_k_last_special_op 17 0314 0315 /* 0316 * Structure of an enumeration set entry 0317 */ 0318 typedef struct 0319 { 0320 short int values_cnt; 0321 /* number of values in the enuemration set descriptor */ 0322 unsigned short int *values; 0323 /* vector of values */ 0324 } UilEnumSetDescDef, *UilEnumSetDescDefPtr; 0325 0326 0327 0328 /********************************************************************** 0329 **************** From UilKeyDef.h ************************************/ 0330 /* 0331 * Token class literals 0332 */ 0333 #define tkn_k_class_argument 1 0334 #define tkn_k_class_charset 2 0335 #define tkn_k_class_color 3 0336 #define tkn_k_class_enumval 4 0337 #define tkn_k_class_font 5 0338 #define tkn_k_class_identifier 6 0339 #define tkn_k_class_keyword 7 0340 #define tkn_k_class_literal 8 0341 #define tkn_k_class_reason 9 0342 #define tkn_k_class_reserved 10 0343 #define tkn_k_class_special 11 0344 #define tkn_k_class_unused 12 0345 #define tkn_k_class_class 13 0346 #define tkn_k_class_child 14 0347 0348 /* 0349 * Keyword table entry structure 0350 */ 0351 typedef struct 0352 { 0353 unsigned char b_class; 0354 unsigned short int b_subclass; 0355 unsigned char b_length; 0356 unsigned char b_token; 0357 char *at_name; 0358 } key_keytable_entry_type; 0359 0360 0361 0362 /************************************************************************* 0363 ************************ New Stuff **************************************/ 0364 0365 /* For COMPOUND_STRING_COMPONENT */ 0366 #define XmStringComponent "XmStringComponent" 0367 0368 /* 0369 * Names of the tables put in the binary database 0370 */ 0371 0372 #define Constraint_Tab 1 0373 #define Key_Table 2 0374 #define Key_Table_Case_Ins 3 0375 #define Allowed_Argument_Table 4 0376 #define Argument_Type_Table_Value 5 0377 #define Charset_Xmstring_Names_Table 6 0378 #define Charset_Wrdirection_Table 7 0379 #define Charset_Parsdirection_Table 8 0380 #define Charset_Charsize_Table 9 0381 #define Charset_Lang_Names_Table 10 0382 #define Charset_Lang_Codes_Table 11 0383 #define Allowed_Control_Table 12 0384 #define Enum_Set_Table 13 0385 #define Argument_Enum_Set_Table 14 0386 #define Enumval_Values_Table 15 0387 #define Uil_Widget_Names 16 0388 #define Uil_Argument_Names 17 0389 #define Uil_Reason_Names 18 0390 #define Uil_Enumval_names 19 0391 #define Uil_Charset_Names 20 0392 #define Related_Argument_Table 21 0393 #define Allowed_Reason_Table 22 0394 #define Uil_Widget_Funcs 23 0395 #define Uil_Gadget_Funcs 24 0396 #define Uil_Urm_Nondialog_Class 25 0397 #define Uil_Urm_Subtree_Resource 26 0398 #define Uil_Argument_Toolkit_Names 27 0399 #define Uil_Reason_Toolkit_Names 28 0400 #define Child_Class_Table 29 0401 #define Allowed_Child_Table 30 0402 #define Uil_Children_Names 31 0403 0404 /* 0405 * Binary Data Base Work 0406 */ 0407 #define DB_Compiled_Version 2 0408 0409 typedef struct _db_globals_struct 0410 { 0411 int version; 0412 int uil_max_arg; 0413 int uil_max_charset; 0414 int charset_lang_table_max; 0415 int uil_max_object; 0416 int uil_max_reason; 0417 int uil_max_enumval; 0418 int uil_max_enumset; 0419 int key_k_keyword_count; 0420 int key_k_keyword_max_length; 0421 int uil_max_child; 0422 } _db_globals; 0423 0424 typedef struct _db_header_struct 0425 { 0426 int table_id; 0427 int num_items; 0428 int table_size; 0429 } _db_header, *_db_header_ptr; 0430 0431 0432 #endif /* UilDBDef_h */ 0433 /* DON'T ADD STUFF AFTER THIS #endif */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |