2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
25 * $XConsortium: abmfP.h /main/3 1995/11/06 18:01:49 rswiston $
27 * @(#)abmfP.h 3.36 30 Apr 1995 cde_app_builder/src/abmf
29 * RESTRICTED CONFIDENTIAL INFORMATION:
31 * The information in this document is subject to special
32 * restrictions in a confidential disclosure agreement between
33 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
34 * document outside HP, IBM, Sun, USL, SCO, or Univel without
35 * Sun's specific written approval. This document and all copies
36 * and derivative works thereof must be returned or destroyed at
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 * abmfP.h - declarations common to all abmf files
47 #ifndef _ABMF_ABMFP_H_
48 #define _ABMF_ABMFP_H_
50 #include <assert.h> /* assert() */
51 #include <stdio.h> /* FILE*, BUFSIZ */
52 #include <sys/param.h> /* MAXPATHLEN, ... */
54 #include <X11/Intrinsic.h>
55 #include <ab_private/obj.h>
56 #include <ab_private/trav.h>
57 #include <ab_private/strlist.h>
63 #define STD_BUF_SIZE (BUFSIZ)
64 #define MAX_PATH_SIZE (MAXPATHLEN+1)
65 #define MAX_NAME_SIZE (MAX_PATH_SIZE)
67 #define CGenFlagsNone ((CGenFlags)0x0000)
68 #define CGenFlagCompFieldsUnique ((CGenFlags)0x0001)
69 #define CGenFlagSubstructObjValid ((CGenFlags)0x0002)
70 #define CGenFlagStructObjValid ((CGenFlags)0x0004)
71 #define CGenFlagIsStructObjValid ((CGenFlags)0x0008)
72 #define CGenFlagIsStructObj ((CGenFlags)0x0010)
73 #define CGenFlagIsSubstructObjValid ((CGenFlags)0x0020)
74 #define CGenFlagIsSubstructObj ((CGenFlags)0x0040)
75 #define CGenFlagWriteDefToProjFile ((CGenFlags)0x0080)
76 #define CGenFlagIsDuplicateDef ((CGenFlags)0x0100)
77 #define CGenFlagLoadMe ((CGenFlags)0x0200)
78 #define CGenFlagIsReferenced ((CGenFlags)0x0400)
79 #define CGenFlagTreatAsAppShell ((CGenFlags)0x0800)
81 /* specify what type of cgen data is attached to obj */
82 #define CGenFlagDataIsModule ((CGenFlags)0x2000)
83 #define CGenFlagDataIsObj ((CGenFlags)0x4000)
84 #define CGenFlagDataIsProj ((CGenFlags)0x8000)
86 typedef FILE *File; /* convenience */
94 } CGenObjDataRec, *CGenObjData;
100 StringList callbacks;
101 CGenAnyData children_data;
106 } CGenProjDataRec, *CGenProjData;
112 StringList callbacks;
113 CGenAnyData children_data;
114 } CGenModuleDataRec, *CGenModuleData;
117 typedef struct CGEN_ANY_DATA_REC /* name must match obj.h! */
122 int num_auto_callbacks;
126 CGenModuleData module;
129 typedef CGenAnyDataRec CGenDataRec;
130 typedef CGenAnyData CGenData;
132 #define return_if_err(_return_code, _return_value) \
133 if ((_return_code) < 0) \
135 return_value= (_return_value); \
139 #define return_code(_return_code) \
140 {return_value= (_return_code); goto epilogue;}
143 #define mfobj_flags(obj) ((obj)->cgen_flags)
145 #define mfobj_set_flags(obj, _flags) \
146 ((obj)->cgen_flags |= ((CGenFlags)(_flags)))
148 #define mfobj_clear_flags(obj, _flags) \
149 (mfobj_flags(obj) &= ~((CGenFlags)(_flags)))
151 #define mfobj_has_flags(obj, _flags) \
152 ((mfobj_flags(obj) & ((CGenFlags)(_flags))) != 0)
155 * Get the various types of data from the object
157 #define mfobj_has_data(obj) \
158 ((obj)->cgen_data != NULL)
160 #define mfobj_data(obj) \
163 #define mfobj_set_proj_data(_obj,_data) \
164 ( mfobj_set_flags(_obj, CGenFlagDataIsProj), \
165 ((int)(mfobj_data(_obj)->info.proj = (_data))) \
168 #define mfobj_get_proj_data(obj) \
169 (mfobj_has_flags(obj, CGenFlagDataIsProj)? \
170 (mfobj_data(obj)->info.proj) \
172 ((CGenProjData)NULL) \
175 #define mfobj_set_module_data(_obj,_data) \
176 ( mfobj_set_flags(_obj, CGenFlagDataIsModule), \
177 ((int)(mfobj_data(_obj)->info.module = (_data))) \
180 #define mfobj_get_module_data(obj) \
181 (mfobj_has_flags(obj, CGenFlagDataIsModule)? \
182 (mfobj_data(obj)->info.module) \
184 ((CGenModuleData)NULL) \
187 /* Internationalization defines and references */
188 extern nl_catd Dtb_project_catd;
190 #endif /* _ABMF_ABMFP_H_ */