|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 38864 (0x97d0) Types: TextFile Notes: UNIX file Names: »UilSymDef.h«
└─⟦a85bd4a7c⟧ Bits:30004636/disk2.imd INTERACTIVE Motif Environment Development System └─⟦a85bd4a7c⟧ UNIX Filesystem └─⟦this⟧ »xt/new/usr/include/uil/UilSymDef.h«
#ifdef REV_INFO #ifndef lint static char SCCSID[] = "OSF/Motif: @(#)UilSymDef.h 1.1 - 89/08/30 - 11:39:07"; #endif /* lint */ #endif /* REV_INFO */ /****************************************************************************** ******************************************************************************* * * (c) Copyright 1989, OPEN SOFTWARE FOUNDATION, INC. * (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. * ALL RIGHTS RESERVED * * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED * AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND * WITH THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR * ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE * AVAILABLE TO ANY OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE * SOFTWARE IS HEREBY TRANSFERRED. * * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT * NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY OPEN SOFTWARE * FOUNDATION, INC. OR ITS THIRD PARTY SUPPLIERS * * OPEN SOFTWARE FOUNDATION, INC. AND ITS THIRD PARTY SUPPLIERS, * ASSUME NO RESPONSIBILITY FOR THE USE OR INABILITY TO USE ANY OF ITS * SOFTWARE . OSF SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY * KIND, AND OSF EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES, INCLUDING * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. * * Notice: Notwithstanding any other lease or license that may pertain to, * or accompany the delivery of, this computer software, the rights of the * Government regarding its use, reproduction and disclosure are as set * forth in Section 52.227-19 of the FARS Computer Software-Restricted * Rights clause. * * (c) Copyright 1989, Open Software Foundation, Inc. Unpublished - all * rights reserved under the Copyright laws of the United States. * * RESTRICTED RIGHTS NOTICE: Use, duplication, or disclosure by the * Government is subject to the restrictions as set forth in subparagraph * (c)(1)(ii) of the Rights in Technical Data and Computer Software clause * at DFARS 52.227-7013. * * Open Software Foundation, Inc. * 11 Cambridge Center * Cambridge, MA 02142 * (617)621-8700 * * RESTRICTED RIGHTS LEGEND: This computer software is submitted with * "restricted rights." Use, duplication or disclosure is subject to the * restrictions as set forth in NASA FAR SUP 18-52.227-79 (April 1985) * "Commercial Computer Software- Restricted Rights (April 1985)." Open * Software Foundation, Inc., 11 Cambridge Center, Cambridge, MA 02142. If * the contract contains the Clause at 18-52.227-74 "Rights in Data General" * then the "Alternate III" clause applies. * * (c) Copyright 1989, Open Software Foundation, Inc. * ALL RIGHTS RESERVED * * * Open Software Foundation is a trademark of The Open Software Foundation, Inc. * OSF is a trademark of Open Software Foundation, Inc. * OSF/Motif is a trademark of Open Software Foundation, Inc. * Motif is a trademark of Open Software Foundation, Inc. * DEC is a registered trademark of Digital Equipment Corporation * DIGITAL is a registered trademark of Digital Equipment Corporation * X Window System is a trademark of the Massachusetts Institute of Technology * ******************************************************************************* ******************************************************************************/ /* ** Hash table size */ #define sym_k_hash_table_limit 127 /* ** Symbol tags. These values are used in the tag field of every object header ** to identify the type of the entry. */ #define sym_k_error_entry (127) /* An error entry is used when compilation errors are detected in the */ /* source program. Its use reduces cascading errors caused by missing */ /* information and allows the compilation to continue and thus */ /* additional errors may be detected */ #define sym_k_value_entry 1 /* A value entry contains information about a UIL literal value */ /* (integer, string, compound string, xbitmapfile, argument, color, */ /* icon, etc.). The b_type field is used to determine the datatype of */ /* this value. */ #define sym_k_name_entry 2 /* A name entry corresponds to a name (identifier) used in the UIL */ /* source. */ #define sym_k_widget_entry 3 /* A widget entry represents a widget declaration. It points off to */ /* the arguments, callbacks, and controls lists for the widget. */ #define sym_k_control_entry 4 /* A control entry hangs off a list entry and identifes an object */ /* (widget or gadget) that is controlled. It also contains the */ /* managed/unmanaged information. */ #define sym_k_forward_ref_entry 5 /* forward reference entries are a linked listed of objects */ /* (widgets/gadgets) that were not defined at the time of the */ /* reference. After all objects have been seen, then this list is */ /* traversed and all objects in it should now be defined and the */ /* specified pointers can be filled-in. */ #define sym_k_external_def_entry 6 /* An external definition entry identifies a name that has been */ /* imported and thus in not declared within this source module. */ #define sym_k_argument_entry 7 /* An argument entry hangs off a list entry and identifies an object */ /* argument. It contains informtation about the argument name and */ /* argument value. */ #define sym_k_callback_entry 8 /* An calllback entry hangs off a list entry and identifies an object */ /* callback. It contains informtation about the callback name, */ /* callback procedure, and callback tag. */ #define sym_k_module_entry 9 /* A module entry contains information specified on the module */ /* statement. */ #define sym_k_proc_def_entry 10 /* A procedure definition entry is created for each procedure listed */ /* in a procedure section. I contains informaion on the number and */ /* types of the arguments. */ #define sym_k_proc_ref_entry 11 /* A procedure reference entry contains information about a the use of */ /* a procedure (e.g. as a callback). It also stores the tag to be */ /* passed to the procedure. */ #define sym_k_list_entry 12 /* A list entry is a typed list of other symbol table entries. It */ /* contains a count and a pointer to the next entry on the list via */ /* the obj_header.az_next field. */ #define sym_k_free_entry 13 /* Free entries are only used when the symbol table is allocated in */ /* large pages (when the symbol BUFFER_ALLOCATION is TRUE). They */ /* should never occur when using the UIL callable interface. */ #define sym_k_identifier_entry 14 /* identifier entry tag is used for diagnostic messages only */ #define sym_k_color_item_entry 15 /* entry describing a color. */ #define sym_k_gadget_entry 16 /* A gadget entry represents a gadget declaration. It points off to */ /* the arguments, callbacks, and controls lists for the gadget. Since */ /* the structures for widget and gadgets are the same, the */ /* datastructure for gadgets is really a sym_k_widget_entry_type. */ #define sym_k_root_entry 17 /* An entry used to group all the other entries together. It is */ /* returned in the parse_tree_root field of the compilation descriptor */ /* when using the callable interface. */ #define sym_k_parent_list_entry 18 /* This is a list of parents of a widget. It is used to check for */ /* constraints provided by the parent that may be used on this widget. */ #define sym_k_constraint_entry 19 /* A constraint entry is a special type of list entry which contains */ /* pointers to all objects that utilize constraint arguments. This */ /* list is then traversed near the end of compilation to verify that */ /* the widget is really a child of another widget that provides the */ /* requested contraint. */ #define sym_k_include_file_entry 20 /* An include file entry is used to describe the contents of an */ /* include file. It is needed only maintain information about the */ /* source file from which this parse tree was generated. It is not */ /* used by UIL directly. */ #define sym_k_section_entry 21 /* A section entry is used to describe the contents of an source file. */ /* It is needed only maintain information about the structure of */ /* source file from which this parse tree was generated. It is not */ /* used by UIL directly. */ /* */ #define sym_k_def_obj_entry 22 /* This entry corresponds to the default object clause on the module */ /* declaration it is used to store source information about the file */ /* from which this parse tree was generated. It is not used by UIL */ /* directly. */ #define sym_k_comment_entry 23 /* A comment entry is used only to store source information about the */ /* file that generated this parse tree. It is not used by UIL */ /* directly. */ #define sym_k_max_entry 23 /* this is the largest possible value for an entry constant. */ /* ** Common attribute masks -- These values are used in the b_flags field of ** the object_header. */ #define sym_m_private (1 << 0) /* This item is private to this source module and thus need not be */ /* output into the UID file. */ #define sym_m_exported (1 << 1) /* This is an exported definition and must be put in the UID file. */ #define sym_m_imported (1 << 2) /* This item is a reference external to this source module and thus */ /* will be resolved at runtime by searching the resourec hierarchy. */ #define sym_m_reference (1 << 3) #define sym_m_builtin (1 << 4) /* This item is builtin as oppose to a userdefined item. */ #define sym_m_obj_is_gadget (1 << 5) /* This object is a gadget as oppose to a widget. */ /* ** Output states - order is important */ #define sym_k_not_processed 0 #define sym_k_queued 1 #define sym_k_emitted 2 \f /* ** Header for each symbol entry */ typedef struct { char b_tag; /* type of entry The values of this field ia a sym_k_XXX_entry as */ /* defined above. */ char b_type; /* generic subtype field usage depends on value of b_tag field */ /* above (sym_k_value_entry -> b_type is a sym_k_XXX_value as */ /* defined in UilSymGen.h, sym_k_list_entry -> b_type is a */ /* sym_k_XXX_list as defined below, sym_k_widget_entry -> b_type */ /* is a sym_k_XXX_object as defined in UilSymGen.h, */ /* sym_k_section_entry -> b_type is a sym_k_XXX_section as defined */ /* below). */ /* */ unsigned short w_node_size; /* size of the node in longwords */ int user_data; /* not used directly by the compiler. It is for use by */ /* applications making use of callable UIL only. */ /* ** Fields to save source information about the symbol: We currently save ** five things. The source record where the symbol "begins" (begins is in ** quotes because this may point to just white space before the actual ** symbol), the position (character) within that record where the symbol ** begins, the source record where the symbol ends, the position within ** that record that symbol really begins (i.e. no white space or anything), ** and the position where the symbol definition ends. */ struct _src_source_record_type *az_begin_rec; /* Source record where symbol starts */ struct _src_source_record_type *az_end_rec; /* Source record where symbol ends */ unsigned char b_begin_pos; /* Starting position within the start record */ unsigned char b_src_pos; /* Starting position within the end record */ unsigned char b_end_pos; /* Ending position within the end record */ unsigned char b_modified; /* This node has been modified */ unsigned char b_child_mod; /* A child of this node has been modified */ /* ** The following two field create a linked list of all entries in the UIL ** symbol table. This chain of entries hangs off the sym_root_entry_type. */ struct _sym_entry_header_type *next_entry; struct _sym_entry_header_type *prev_entry; } sym_entry_header_type; \f /* ** Common view of a symbol entry */ typedef struct { sym_entry_header_type header; /* common part of all symbol entries. */ char b_value[ 1 ]; /* information specific to each different entry type. */ } sym_entry_type; \f /* ** Free entry, when an entry is on the free node list. */ typedef struct _sym_free_entry_type { sym_entry_header_type header; /* common header */ sym_entry_type * az_next; /* next free entry */ } sym_free_entry_type; #define sym_k_free_entry_size (sizeof(sym_free_entry_type)) \f /* ** Name entry */ /* Flags for name entries */ #define sym_m_referenced (1 << 0) /* Used in the b_flags field of a name entry. Set if this name is */ /* reference elsewhere in this UIL source module. */ typedef struct _sym_name_entry_type { sym_entry_header_type header; /* common header */ sym_entry_type *az_object; /* pointer to the object entry with this name */ struct _sym_name_entry_type *az_next_name_entry; /* next name on hash chain */ struct _sym_name_entry_type *az_prev_name_entry; /* prev name on hash chain */ unsigned char b_flags; /* flags (possible value is sym_m_referenced as declared above) */ char c_text[ 1 ]; /* text of the name */ } sym_name_entry_type; /* ** Size of the fixed part of a name entry */ #define sym_k_name_entry_size (sizeof( sym_name_entry_type)- \ sizeof( char[ 1 ]) ) \f /* ** Value entry */ /* ** Types of values are included in UilSymGen.h */ /* ** Charsets supported by UIL -- These values are used in the b_charset field ** of the a value_entry. The values match codes in dec std 169. */ #define sym_k_charset_dec_mcs 0 #define sym_k_charset_iso_latin1 1 #define sym_k_charset_iso_latin2 2 #define sym_k_charset_iso_arabic 3 #define sym_k_charset_iso_greek 4 #define sym_k_charset_dec_hebrew 5 #define sym_k_charset_iso_hebrew 6 #define sym_k_charset_jis_katakana 32 #define sym_k_charset_dec_tech 33 #define sym_k_charset_dec_kanji 64 #define sym_k_charset_dec_hanzi 65 #define sym_k_userdefined_charset 127 /* If a value entry (string or compound string) has this value then */ /* the the charset information is stored in the value entry pointed */ /* to by the az_charset_value field of the value_entry. */ #define sym_k_default_charset sym_k_charset_iso_latin1 \f /* ** This structure defines an element in a color table. A color table contains ** an array of such elements. */ typedef struct { unsigned char b_letter; /* letter for this color */ unsigned char b_index; /* index for this color */ unsigned short w_desc_offset; /* descriptor offset at in context */ struct _sym_value_entry_type *az_color; /* pointer to the value entry for this color */ } sym_color_element; /* ** This structure defines the data for an icon. */ typedef struct { unsigned short w_height; /* height in pixels of the icon */ unsigned short w_width; /* width in pixels of the icon */ struct _sym_value_entry_type *az_color_table; /* pointer to the value entry for the color table */ struct _sym_value_entry_type *az_rows; /* pointer to the list of icon rows */ } sym_icon_element; /* ** Auxiliary flags for values stored in b_aux_flags field */ #define sym_m_table_entry (1 << 0) /* This item is a component of table */ #define sym_m_right_to_left (1 << 1) /* right to left character string */ #define sym_m_separate (1 << 2) /* add CDA separator to end of string */ #define sym_m_sixteen_bit sym_m_separate /* character set is 16-bit */ /* ** Types of colors - stored in b_arg_type */ #define sym_k_unspecified_color 0 #define sym_k_background_color 1 /* This color should displayed in the background on a monochrome */ /* display. */ #define sym_k_foreground_color 2 /* This color should displayed in the foreground on a monochrome */ /* display. */ typedef struct _sym_value_entry_type { sym_entry_header_type header; /* common header */ unsigned char b_type; /* b_type distinguishes usage. Possible values are sym_k_XXX_value */ /* as defined in UilSymGen.h */ unsigned char b_flags; /* b_flags holds private and immediate information */ unsigned short w_length; /* length for variable length types */ char output_state; /* output_state (only byte is needed) */ unsigned char b_table_count; /* number of strings in table, colors in a color table, or fonts in */ /* a font table. */ #define b_data_offset b_table_count /* offset of bits in context for an icon. */ unsigned char b_aux_flags; /* auxiliary flags */ unsigned char b_arg_type; /* type of argument value or monochrome treatment of a color */ #define b_charset b_arg_type /* character set of a string (overlays b_arg_type). */ #define b_max_index b_arg_type /* max index in a color table (overlays b_arg_type). */ #define b_pixel_type b_arg_type /* pixel size encoding in an icon (overlays b_arg_type). */ struct _sym_value_entry_type * az_charset_value; /* pointer to the value entry describing a userddfined charset. */ /* This field is only valid when the b_charset field has the value */ /* of sym_k_userdefined_charset. */ long int resource_id; /* resource id for private values. */ struct _sym_value_entry_type * az_next_table_value; /* next element for tables. */ sym_name_entry_type *az_name; /* pointer to the name entry for the value. */ union _sym_value_entry_value_union { int l_integer; /* value if an integer. */ double d_real; /* value if a double float. */ char c_value[ 1 ]; /* value of string. */ struct _sym_value_entry_type *az_first_table_value; /* pointer to first table entry (font, string, etc.) if value */ /* is a table. */ sym_color_element z_color[ 1 ]; /* value if color table. */ sym_icon_element z_icon; /* value if icon */ }value; } sym_value_entry_type; /* ** Define the fixed size of the value entry structure */ #define sym_k_value_entry_size (sizeof(sym_value_entry_type) - \ sizeof(union _sym_value_entry_value_union) ) \f /* ** Comment entry */ typedef struct _sym_comment_entry_type { sym_entry_header_type header; /* common entry header. */ char c_text[ 1 ]; /* text of the comment. */ } sym_comment_entry_type; /* ** Size of the fixed part of a comment entry */ #define sym_k_comment_entry_size (sizeof( sym_comment_entry_type)- \ sizeof( char[ 1 ]) ) \f /* ** Common header for each "object" entry. This header is shared by all ** widget, gadget, list, argument, callback, and control node types. It ** always appears immediately following the standard entry header field. Also ** defined here is a prototype node for these types of "object" entries. */ typedef struct { sym_name_entry_type * az_name; /* pointer to the name entry that holds the object name. */ sym_entry_type * az_reference; /* pointer to the entry that references this object. */ sym_entry_type * az_next; /* pointer to next entry in a list, if this entry is linked under a */ /* list entry. */ sym_entry_type * az_child; /* pointer to child entry in a list (if this is a nested list). */ sym_entry_type * az_nest_list; /* nested lists get merged so we need to save some info here. */ sym_entry_type * az_merge_skip; /* we skip over the merged entries when recreating the source. */ sym_comment_entry_type * az_comment; /* pointer to comment entry associated with this object. */ sym_entry_type * az_back; /* back pointer to "parent" of this object object */ unsigned short b_flags; /* object flags. */ unsigned char v_filler [2]; /* longword alignment */ } sym_obj_header_type; typedef struct { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ } sym_obj_entry_type; \f /* ** List entry */ /* ** The types of lists, values for the header.b_type field of a list entry. */ #define sym_k_error_list sym_k_error_entry #define sym_k_callback_list sym_k_callback_entry #define sym_k_argument_list sym_k_argument_entry #define sym_k_control_list sym_k_control_entry #define sym_k_proc_ref_list sym_k_proc_ref_entry typedef struct _sym_list_entry_type { sym_entry_header_type header; /* common header */ sym_obj_header_type obj_header; /* common header for objects */ unsigned short w_count; /* number of elements in the list. */ unsigned short w_gadget_count; /* number of gadgets in the list. */ } sym_list_entry_type; /* ** Define the size of the list structure */ #define sym_k_list_entry_size (sizeof(sym_list_entry_type)) \f /* ** Argument entry */ typedef struct _sym_argument_entry_type { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ sym_value_entry_type * az_arg_name; /* pointer to the value entry containing the argument name. */ sym_value_entry_type * az_arg_value; /* pointer to the value entry containing the argument value. */ } sym_argument_entry_type; #define sym_k_argument_entry_size (sizeof(sym_argument_entry_type)) \f /* ** Procedure Definition Entry */ typedef struct { sym_entry_header_type header; /* common header. */ sym_name_entry_type *az_name; /* pointer to the name entry of the procedure. */ unsigned char v_arg_checking; /* should argument type be checked. */ unsigned char b_arg_count; /* number of arguments. */ unsigned char b_arg_type; /* The type of single argument (tag) for this procedure. It should */ /* be a sym_k_XXX_value as defined in UilSymGen.h. */ unsigned char b_flags; /* class of procedure (only private is supported for now). */ } sym_proc_def_entry_type; #define sym_k_proc_def_entry_size (sizeof( sym_proc_def_entry_type)) \f /* ** Procedure Reference Entry */ typedef struct { sym_entry_header_type header; /* common header. */ sym_obj_header_type obj_header; /* common object header. */ sym_proc_def_entry_type *az_proc_def; /* pointer to the procedure definition entry for the procedure to */ /* be called. */ sym_value_entry_type *az_arg_value; /* pointer to the value entry for the argument to be passed as the */ /* callback tag to the procedure. */ } sym_proc_ref_entry_type; #define sym_k_proc_ref_entry_size (sizeof( sym_proc_ref_entry_type)) /* ** These values are passed from the grammar to the semantic action routines ** (SAR) to identify how the procedure is used. */ #define sym_k_callback_proc 1 /* The procedure was used as a callback routine. */ #define sym_k_object_proc 2 /* The procedure was used as a creation routine for a user defined */ /* widget, */ \f /* ** Callback entry */ typedef struct _sym_callback_entry_type { sym_entry_header_type header; /* common entry header. */ sym_obj_header_type obj_header; /* common object header. */ sym_value_entry_type * az_call_reason_name; /* pointer to the value entry containing the reason (callback) name */ sym_proc_ref_entry_type * az_call_proc_ref; /* pointer to the procedure reference to be invoked for this */ /* callback reason. */ sym_list_entry_type * az_call_proc_ref_list; /* list entry of procedure references when multiple callbacks are */ /* used for the callback. */ } sym_callback_entry_type; #define sym_k_callback_entry_size (sizeof(sym_callback_entry_type)) \f /* ** Parent list for widgets and gadgets ** ** This list contains pointers to each of the widgets and gadgets that ** reference the current widget in their control list. This information is ** required in order to check constraint arguments. */ typedef struct _sym_parent_list_type { sym_entry_header_type header; /* common entry header */ struct _sym_widget_entry_type * parent; /* pointer to a widget entry that references the originating widget */ /* in its controls list. */ struct _sym_parent_list_type * next; /* pointer to next parent list entry. */ } sym_parent_list_type; #define sym_k_parent_list_size (sizeof(sym_parent_list_type)) \f /* ** Widget entry and Gadget entry ** ** Gadgets have the same form as a widget. They are distinguished ** simply by the setting of sym_m_obj_is_gadget in obj_header.b_flags . */ /* Include the literal definitions for widgets. */ #include "UilSymGen.h" /* widget and gadget node structure. */ typedef struct _sym_widget_entry_type { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ sym_list_entry_type * az_callbacks; /* pointer to a list entry of type sym_k_callback_list which */ /* contains the callbacks for this widget. */ sym_list_entry_type * az_arguments; /* pointer to a list entry of type sym_k_argument_list which */ /* contains the arguments for this widget. */ sym_list_entry_type * az_controls; /* pointer to a list entry of type sym_k_controls_list which */ /* contains the widgets that are children (are controlled by) this */ /* widget. */ sym_proc_ref_entry_type * az_create_proc; /* for user_defined widgets this points to the procedure reference */ /* entry that specifies the creation routine for the widget. */ sym_parent_list_type * parent_list; /* pointer to a parent list entry that links all objects which */ /* reference this object in there controls lists. It is used to */ /* traverse through the parents to verify that all contraint */ /* arguments specified on this widget are really inherited from one */ /* of its parents. */ int output_state; /* Used when generating the UID file. Possible values: */ /* sym_k_queued, sym_k_emitted, sym_k_not_processed. (only a byte */ /* is needed). */ long int resource_id; /* The resource id if the object is private. This is used when */ /* generating the UID file. */ } sym_widget_entry_type; #define sym_k_widget_entry_size (sizeof(sym_widget_entry_type)) \f /* ** Control entry */ /* ** Control flags -- These are additional values that may occur in the b_flags ** field for control entries. NOTE: Must not overlap common flags defined ** above. */ #define sym_m_def_in_progress (1 << 6) /* used in all lists. */ #define sym_m_managed (1 << 7) /* This bit is set when the controlled object is to be managed. */ #define sym_m_obj_is_reference (1 << 8) /* Control node structure. */ typedef struct _sym_control_entry_type { sym_entry_header_type header; /* common entry header */ sym_obj_header_type obj_header; /* common object header */ sym_widget_entry_type * az_con_obj; /* pointer to the widget entry that is controlled by this widget. */ } sym_control_entry_type; #define sym_k_control_entry_size (sizeof(sym_control_entry_type)) \f /* ** External Definition Entry */ typedef struct _sym_external_def_entry_type { sym_entry_header_type header; /* common header */ struct _sym_external_def_entry_type *az_next_object; /* pointer next external definition entry. */ sym_name_entry_type *az_name; /* pointer to the name entry for the external object. */ } sym_external_def_entry_type; #define sym_k_external_def_entry_size (sizeof( sym_external_def_entry_type)) \f /* ** Forward Reference Entry */ typedef struct _sym_forward_ref_entry_type { sym_entry_header_type header; /* common header. The b_type field holds the object type. */ struct _sym_forward_ref_entry_type *az_next_ref; /* pointer to the next forward reference entry. */ char *a_update_location; /* address of the longword field in the referencing entry that */ /* needs to be updated with the address of the widget entry that */ /* this forward reference entry was created for. When this forward */ /* reference entry is processed in UilP2Reslv.c, then the widget */ /* named in the az_name field will be defined and it can be */ /* assigned directly into the a_update_location. */ sym_name_entry_type *az_name; /* pointer to the name entry for the widget being referenced before */ /* it has been defined. */ sym_widget_entry_type *parent; /* pointer to the widget entry of the parent of the forward */ /* referenced object. */ } sym_forward_ref_entry_type; #define sym_k_forward_ref_entry_size (sizeof( sym_forward_ref_entry_type)) \f /* ** Constraint list entry. List contains pointers to widgets which reference ** constraint arguments. Constraints are checked at end of compilation to ** insure that all references to widgets with constraint args have been seen. */ typedef struct _sym_constraint_entry_type { sym_entry_header_type header; /* common header */ sym_widget_entry_type * widget_entry; /* pointer to a widget entry that has referenced constraint */ /* arguments. */ struct _sym_constraint_entry_type * next; /* pointer to the next contraint entry. */ } sym_constraint_entry_type; #define sym_k_constraint_entry_size (sizeof( sym_constraint_entry_type)) \f /* ** Default object entry. Pointed to from the module entry. The first one in ** the list contains source information for the "OBJECTS = " text. The 'next' ** field is a pointer to a list which contains the data on the actual clauses. */ typedef struct _sym_def_obj_entry_type { sym_entry_header_type header; /* common header */ struct _sym_def_obj_entry_type *next; /* pointer to next default object entry in the list. */ char b_object_info; char b_variant_info; } sym_def_obj_entry_type; #define sym_k_def_obj_entry_size (sizeof( sym_def_obj_entry_type)) \f /* ** Module entry (only 1 per compilation) */ typedef struct _sym_module_entry_type { sym_entry_header_type header; /* common header */ sym_name_entry_type *az_name; /* pointer to the name entry containing the module name. */ sym_value_entry_type *az_version; /* pointer to the value entry containing version string for the */ /* module (version clause). */ sym_value_entry_type *az_character_set; /* pointer to the value entry containing the default character set */ /* information for the module (character set clause). */ sym_value_entry_type *az_case_sense; /* pointer to the value entry containing the value of the module */ /* case sensitivity clause. */ sym_def_obj_entry_type *az_def_obj; /* pointer to the default object type specified in the module */ /* default object variant clause. */ } sym_module_entry_type; #define sym_k_module_entry_size (sizeof( sym_module_entry_type)) \f /* ** Section entry */ /* ** Posiblilities for header.b_type when header.b_tag is sym_k_section_entry. */ #define sym_k_list_section 1 /* list section */ #define sym_k_procedure_section 2 /* procedure section */ #define sym_k_value_section 3 /* value section */ #define sym_k_identifier_section 4 /* identifier section */ #define sym_k_object_section 5 /* widget/gadget section */ #define sym_k_include_section 6 /* include directive */ #define sym_k_section_tail 7 /* This section has no corresponding UIL construct and exists only */ /* to aid in saving source information */ typedef struct _sym_section_entry_type { sym_entry_header_type header; /* common header */ struct _sym_section_entry_type *prev_section; /* previous section "LIST". */ sym_entry_type *next; /* pointer to the entry for the next section _OR_ next child. */ sym_entry_type *entries; /* points to entries in the section _OR_ the entry in the symbol */ /* table for this child. */ } sym_section_entry_type; #define sym_k_section_entry_size (sizeof (sym_section_entry_type)) \f /* ** Include file entry */ typedef struct _sym_include_file_entry_type { sym_entry_header_type header; /* common header */ sym_section_entry_type *sections; /* pointer to a section list; this list is all of the sections that */ /* exist in this include file. */ char file_name[255]; /* the file name as specified in the include statement in the UIL */ /* source. */ char full_file_name[255]; /* the expanded name for the include file actually opened. */ } sym_include_file_entry_type; #define sym_k_include_file_entry_size (sizeof( sym_include_file_entry_type)) \f /* ** Symbol table root entry (root of symbol table tree) */ typedef struct _sym_root_entry_type { sym_entry_header_type header; /* common header */ struct _src_source_record_type *src_record_list; /* pointer to a list of source records. */ char file_name[255]; /* the main UIL file name as specified on the command line. */ char full_file_name[255]; /* the expanded name for the main UIL file that was actually */ /* opened. */ sym_section_entry_type *sections; /* pointer to section list entry. */ sym_module_entry_type *module_hdr; /* pointer to module header entry. */ sym_entry_header_type module_tail; /* pointer to a header entry that contains source information for */ /* the remainder of the module (module tail). */ sym_entry_type *az_entry_list_header; /* this is the root pointer to a doubly linked list which contains */ /* all entries in the symbol table. */ } sym_root_entry_type; #define sym_k_root_entry_size (sizeof( sym_root_entry_type)) \f /* ** Color Item Entry */ typedef struct _sym_color_item_entry_type { sym_entry_header_type header; /* common header */ struct _sym_color_item_entry_type *az_next; /* next item */ unsigned char b_letter; /* letter used for color */ unsigned char b_index; /* color table index */ unsigned char b_spare1; sym_value_entry_type *az_color; /* name or value entry for the color. */ } sym_color_item_entry_type; #define sym_k_color_item_entry_size (sizeof( sym_color_item_entry_type)) \f sym_name_entry_type *sym_insert_name(); sym_name_entry_type *sym_find_name(); void sym_make_external_def(); /* ** _sym_allocate_entry ** ** If BUFFER_ALLOCATION is defined, then allocation is done in large ** blocks and we divide it up as needed. Otherwise we use XtMalloc so ** that each allocation is individually freeable. */ #ifdef BUFFER_ALLOCATION #define _sym_allocate_entry( __tag, __size, __ptr ) \ { \ int __long_size; \ sym_entry_type *__entry_ptr, **__entry_ptr_ptr; \ external char *sym_al_next_avail_location; \ external char *sym_al_last_location; \ \ __long_size = ((__size) + 3) >> 2; \ __entry_ptr = (sym_entry_type *) sym_al_next_avail_location; \ sym_al_next_avail_location += __long_size << 2; \ if (sym_al_next_avail_location > sym_al_last_location) \ __entry_ptr = sym_allocate_buffer( __long_size ); \ \ __entry_ptr->header.b_tag = (__tag); \ __entry_ptr->header.w_node_size = __long_size; \ __entry_ptr_ptr = (sym_entry_type * *) & (__ptr); \ (* __entry_ptr_ptr) = __entry_ptr; \ } #else #define _sym_allocate_entry( __tag, __size, __ptr ) \ { \ sym_entry_type *__entry_ptr, **__entry_ptr_ptr; \ external sym_entry_type *sym_az_entry_list_header; \ char *__clr_ptr; \ __entry_ptr = (sym_entry_type *)_get_memory(__size); \ for (__clr_ptr = ((char *) __entry_ptr) + (__size) - 1; \ __clr_ptr >= (char *) __entry_ptr; \ __clr_ptr--) \ *__clr_ptr = 0; \ __entry_ptr->header.b_tag = (__tag); \ __entry_ptr->header.w_node_size = (__size); \ __entry_ptr_ptr = (sym_entry_type * *) & (__ptr); \ (* __entry_ptr_ptr) = __entry_ptr; \ \ if (sym_az_entry_list_header != NULL) { \ (sym_entry_type *)sym_az_entry_list_header->header.prev_entry = __entry_ptr; \ } \ \ (sym_entry_type *)__entry_ptr->header.next_entry = sym_az_entry_list_header; \ (sym_entry_type *)__entry_ptr->header.prev_entry = NULL; \ sym_az_entry_list_header = __entry_ptr; \ } #endif /* ** This macro copies the contents of one entry to another without disturbing ** the the linked list of entries used to connect all symbol table entries. */ #define _sym_copy_entry(__dest, __src, __size) \ { \ sym_entry_type *__dest_entry = (sym_entry_type *)__dest; \ sym_entry_type *__src_entry = (sym_entry_type *)__src; \ sym_entry_type *__save_next = (sym_entry_type *)__dest_entry->header.next_entry; \ sym_entry_type *__save_prev = (sym_entry_type *)__dest_entry->header.next_entry; \ _move (__dest, __src, __size); \ (sym_entry_type *)__dest_entry->header.next_entry = __save_next; \ (sym_entry_type *)__dest_entry->header.prev_entry = __save_prev; \ } sym_entry_type *sym_allocate_buffer();