#ifdef REV_INFO #ifndef lint static char SCCSID[] = "OSF/Motif: %W% %E%"; #endif /* lint */ #endif /* REV_INFO */ /* ******************************************************************************** ** ** (c) Copyright 2004 Hewlett-Packard Development Company, L.P. ** ** Proprietary computer software. Valid license from HP required for ** possession, use or copying. Consistent with FAR 12.211 and 12.212, ** Commercial Computer Software, Computer Software Documentation, and ** Technical Data for Commercial Items are licensed to the U.S. Government ** under vendor's standard commercial license. ** ******************************************************************************** */ /****************************************************************************** ******************************************************************************* * * (c) Copyright 1989, 1990, 2004 OPEN SOFTWARE FOUNDATION, INC. * * Motif is a registered trademark and The Open Group is a trademark * of The Open Group in the United States and/or other countries. * * 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, 1990, 2004 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, 1990, 2004 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. * X Window System is a trademark of the Massachusetts Institute of Technology * ******************************************************************************* ******************************************************************************/ /* * This is the program creates binary databases from WML output. */ #include #include /* verified for ia64 port - Gerry Gladu */ #ifdef VAX #include #include #include #else #include #include #include #endif #ifdef DEC_MOTIF_EXTENSION /* verified for ia64 port - Gerry Gladu */ #ifdef VAX #include #include #include #include #include #else #include #include #include #include #include #endif #endif /* * User supplied widget public.h and/or private.h files are to be added here */ #ifdef DGIT #include "DGITGobe.h" #include "DGITNeted.h" #endif /* * End of User supplied widget files */ #ifdef VMS #include "DECw$Include:UilDBDef.h" #include "DECw$Include:UilLexPars.h" #else #include "UilDBDef.h" #include "UilLexPars.h" #endif #include "UilSymGen.h" /* from WML */ #include "UilSymArTy.h" /* from WML */ #include "UilSymRArg.h" /* from WML */ #include "UilSymArTa.h" /* from WML */ #include "UilSymReas.h" /* from WML */ #include "UilSymCtl.h" /* from WML */ #include "UilConst.h" /* from WML */ #include "UilSymNam.h" /* from WML */ #include "UilSymEnum.h" /* from WML */ #include "UilSymCSet.h" /* from WML */ #include "UilUrmClas.h" /* from WML */ #include "UilKeyTab.h" /* from WML */ FILE *bfile, *afile; int DEBUG=FALSE; char outfilename[80]; char debugfilename[80]; main(argc, argv) int argc; char **argv; { _db_header header; #ifdef VMS strcpy(outfilename, "DECW$UIL_DXM_MOTIF.WMD"); strcpy(debugfilename, "DECW$UIL_DXM_MOTIF.DBG"); #else strcpy(outfilename, "motif.wmd"); strcpy(debugfilename, "motif.dbg"); #endif for (argc--, argv++; argc; argc--, argv++) { if (strcmp("-debug", *argv) == 0) { DEBUG=TRUE; } else if ((strcmp("-o", *argv) == 0)) { strcpy(outfilename, argv[1]); } } bfile = fopen(outfilename, "w"); if (DEBUG) afile = fopen(debugfilename, "w"); emit_globals(); /* * UilConst * UilSymArty * UilSymCset - parts of it */ emit_chars(Constraint_Tab); emit_chars(Argument_Type_Table_Value); emit_chars(Charset_Wrdirection_Table); emit_chars(Charset_Parsdirection_Table); emit_chars(Charset_Charsize_Table); /* * UilKeyTab */ emit_ints_and_string (Key_Table); emit_ints_and_string (Key_Table_Case_Ins); /* * UilSymArTa * UilSymCtl * UilSymReas */ emit_char_table (Allowed_Argument_Table); emit_char_table (Allowed_Control_Table); emit_char_table (Allowed_Reason_Table); /* * UilSymCset * UilSymNam * UilUrmClas */ emit_length_and_string (Charset_Xmstring_Names_Table); emit_length_and_string (Charset_Lang_Names_Table); emit_length_and_string (Uil_Widget_Names); emit_length_and_string (Uil_Argument_Names); emit_length_and_string (Uil_Reason_Names); emit_length_and_string (Uil_Enumval_names); emit_length_and_string (Uil_Charset_Names); emit_length_and_string (Uil_Widget_Funcs); emit_length_and_string (Uil_Argument_Toolkit_Names); emit_length_and_string (Uil_Reason_Toolkit_Names); /* * UilSymCset * UilSymEnum * UilSymRArg * UilUrmClas */ emit_shorts (Charset_Lang_Codes_Table); emit_shorts (Argument_Enum_Set_Table); emit_shorts (Related_Argument_Table); emit_shorts (Uil_Gadget_Funcs); emit_shorts (Uil_Urm_Nondialog_Class); emit_shorts (Uil_Urm_Subtree_Resource); /* * UilSymEnum */ emit_int_and_table_shorts(Enum_Set_Table); /* * UilSymEnum */ emit_ints (Enumval_Values_Table); #ifndef VMS exit (0); #endif } emit_globals() { _db_globals globals; globals.version = DB_Compiled_Version; globals.uil_max_arg = uil_max_arg; globals.uil_max_charset = uil_max_charset; globals.charset_lang_table_max = charset_lang_table_max; globals.uil_max_object = uil_max_object; globals.uil_max_reason = uil_max_reason; globals.uil_max_enumval = uil_max_enumval; globals.uil_max_enumset = uil_max_enumset; globals.key_k_keyword_count = key_k_keyword_count; globals.key_k_keyword_max_length = key_k_keyword_max_length; globals.uil_max_child = uil_max_child; fwrite (&globals, sizeof (_db_globals), 1, bfile); if (DEBUG) fprintf(afile, "%d %d %d %d %d %d %d %d %d %d ", globals.version, globals.uil_max_arg, globals.uil_max_charset, globals.charset_lang_table_max, globals.uil_max_object, globals.uil_max_reason, globals.uil_max_enumval, globals.uil_max_enumset, globals.key_k_keyword_count, globals.key_k_keyword_max_length); } emit_header(header) _db_header_ptr header; { fwrite (header, sizeof(_db_header), 1, bfile); if (DEBUG) fprintf(afile, "\n\nTableId=%d, NumEntries=%d, TableSize=%d \n", header->table_id, header->num_items, header->table_size); } emit_chars(table_id) int table_id; { _db_header header; unsigned char *ptr; int i; switch (table_id) { case Constraint_Tab: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(constraint_tab_vec); header.num_items = header.table_size; header.table_id = Constraint_Tab; ptr = constraint_tab; break; case Argument_Type_Table_Value: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(argument_type_table_vec); header.num_items = header.table_size; header.table_id = Argument_Type_Table_Value; ptr = argument_type_table; break; case Charset_Wrdirection_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_wrdirection_table_vec); header.num_items = header.table_size; header.table_id = Charset_Wrdirection_Table; ptr = charset_writing_direction_table; break; case Charset_Parsdirection_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_parsdirection_table_vec); header.num_items = header.table_size; header.table_id = Charset_Parsdirection_Table; ptr = charset_parsing_direction_table; break; case Charset_Charsize_Table: /* * NOTE: The first entry is not used but we copy it anyway */ header.table_size = sizeof(charset_charsize_table_vec); header.num_items = header.table_size; header.table_id = Charset_Charsize_Table; ptr = charset_character_size_table; break; } emit_header(&header); fwrite (ptr, header.table_size, 1, bfile); if (DEBUG) { for (i=0; i<=header.num_items; i++) { fprintf(afile, "%d ", ptr[i]); } } } emit_ints_and_string(table_id) int table_id; { _db_header header; key_keytable_entry_type *table; int i; switch (table_id) { /* * All tables are zero based unless otherwise noted */ case Key_Table: header.table_size = sizeof(key_table_vec); header.num_items = key_k_keyword_count; header.table_id = Key_Table; table = key_table; break; case Key_Table_Case_Ins: header.table_size = sizeof(key_table_case_ins_vec); header.num_items = key_k_keyword_count; header.table_id = Key_Table_Case_Ins; table = key_table_case_ins; break; } emit_header(&header); fwrite (table, header.table_size, 1, bfile); for (i=0; i