2
* @OPENGROUP_COPYRIGHT@
4
* Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
5
* Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
6
* ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
7
* the full copyright text.
9
* This software is subject to an open license. It may only be
10
* used on, with or for operating systems which are themselves open
11
* source systems. You must contact The Open Group for a license
12
* allowing distribution and sublicensing of this software on, with,
13
* or for operating systems which are not Open Source programs.
15
* See http://www.opengroup.org/openmotif/license for full
16
* details of the license agreement. Any use, reproduction, or
17
* distribution of the program constitutes recipient's acceptance of
20
* EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
21
* PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22
* KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
23
* WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
24
* OR FITNESS FOR A PARTICULAR PURPOSE
26
* EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
27
* NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
28
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
* DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
30
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32
* ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
33
* EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGES.
39
/* $TOG: Mrm.h /main/23 1999/05/25 16:55:58 mgreess $ */
41
* (c) Copyright 1996 Hewlett-Packard Company *
42
* (c) Copyright 1996 International Business Machines Corp. *
43
* (c) Copyright 1996 Sun Microsystems, Inc. *
44
* (c) Copyright 1996 Novell, Inc. *
45
* (c) Copyright 1989, 1990, 1996 Digital Equipment Corporation. *
46
* (c) Copyright 1996 FUJITSU LIMITED. *
47
* (c) Copyright 1996 Hitachi. *
53
#include <Mrm/MrmPublic.h>
54
#include <Xm/Xm.h> /* XmString definition and _NO_PROTO */
59
* This is the internal file used throughout URM for literal and
60
* struct definitions. It defines everything not found in public
65
#define MIN(x,y) ((x) < (y) ? (x) : (y))
68
#define MAX(x,y) ((x) > (y) ? (x) : (y))
72
#if defined(__STDC__) || !defined( NO_CONST )
81
* The following macro is used to round the size of memory allocation requests
82
* up to eight bytes. This is done to help satisfy alignment
83
* request for MIPS, CRAY, Alpah, HP9000 (for doubles) and similar machines.
85
#define _sl sizeof(long)
86
#define _slm (sizeof(long) - 1)
87
#define _FULLWORD(exp) (_sl * (((exp) + _slm) / _sl)) /* (4*(((exp)+3)/4)) */
90
* Swap the byte order of 4- and 2- byte quantities.
91
* "tp +=" lines are needed on Cray (CARD32 is actually 64 bits).
94
#define swap4bytes(l) {\
95
CARD32 t = (CARD32) l;\
96
char n, *tp = (char *) &t;\
97
tp += sizeof(CARD32) - 4;\
98
n = tp[0]; tp[0] = tp[3]; tp[3] = n;\
99
n = tp[1]; tp[1] = tp[2]; tp[2] = n;\
103
#define swap2bytes(s) {\
104
CARD16 t = (CARD16) s;\
105
char n, *tp = (char *) &t;\
106
tp += sizeof(CARD16) - 2;\
107
n = tp[0]; tp[0] = tp[1]; tp[1] = n;\
111
#define swapbytes(v) {\
112
if (sizeof(v) == 2) \
114
else if (sizeof(v) == 4) \
118
#define swapdouble(d) {\
119
double dt = (double) d;\
120
unsigned m, *dp = (unsigned *) &dt;\
121
swap4bytes( dp[0] );\
122
swap4bytes( dp[1] );\
123
m = dp[0]; dp[0] = dp[1]; dp[1] = m;\
129
* When a resource record is referenced but not yet fetched, logical or
130
* the convert type with this value as a flag.
132
#define MrmResourceUnswapped (unsigned char)128
139
#define URMversion "URM 1.2"
140
#define URM1_1version "URM 1.1"
143
* The indexes of the self-encoding compression tables in a UID file. They
144
* intentionally include characters which are illegal in UIL identifiers.
146
#define UilMrmClassTableIndex ">ClassTable"
147
#define UilMrmResourceTableIndex ">ResourceTable"
151
* Resource classes and types
155
#define URMgLiteral 2 /* types in MrmRtype... */
156
#define URMgResourceSet 3 /* type in URMrs... */
158
#define URMgMessage 5
160
#define URMgMin 1 /* lowest legal group value */
161
#define URMgMax 5 /* highest legal group value */
162
#define URMgVecSize URMgMax+1 /* To size any vectors */
165
* The null resource type
174
#define URMaPrivate 2
177
* Index types. Immediate is included for the convenience of the UIL compiler
181
#define URMrImmediate 3
184
* Maximum number of characters in an index
186
#define URMMaxIndexLen 31
187
#define URMMaxIndexLen1 (URMMaxIndexLen + 1) /* to size vectors */
191
* File open access types
193
#define URMReadAccess 1
194
#define URMWriteAccess 2
197
* Standard date string length
199
#define URMhsDate 29 /* any date string */
203
* Types of resource sets.
205
#define URMrsInterfaceModule 1 /* Interface module */
209
* Values for the manage flag in memory only -- the manage field in RGMChildDesc
224
* The maximum number of arguments allowed in an arglist or children in
225
* a child list. A number intended to catch gross errors.
227
#define RGMListSizeMax 32767
233
* The following structure is inspired by resource contexts, but is used
234
* to store lists of pointers. Its supporting routines automatically manage
235
* space in the same the context routines do. Since this is used only
236
* internally, no validation is provided.
240
int num_slots ; /* number of available pointer slots */
241
int num_ptrs ; /* number of slots actually used */
242
XtPointer *ptr_vec ; /* pointer slot vector */
243
} URMPointerList, *URMPointerListPtr ;
247
* Accessors for the list or a pointer in the list
249
#define UrmPlistPtrList(list) ((list)->ptr_vec)
250
#define UrmPlistNum(list) ((list)->num_ptrs)
251
#define UrmPlistPtrN(list,ndx) ((list)->ptr_vec[ndx])
256
* URM Resource context
258
* The following context structure is provided by URM to cover all memory
259
* management of in-memory resources. This mechanism provides:
260
* o improved memory management efficiency through buffer re-use
261
* o collection of resource attributes in one place
262
* o support for non-standard allocation routines
264
#define URMResourceContextValid 232570204
266
unsigned validation ; /* validation code =
267
URMResourceContextValid */
268
char *data_buffer ; /* pointer to data buffer in memory */
269
MrmSize buffer_size ; /* number of bytes in buffer */
270
MrmSize resource_size ; /* number of bytes used by resource */
271
MrmGroup group ; /* resource group */
272
MrmType type ; /* resource type */
273
MrmCode access ; /* URMaPrivate or URMaPublic */
274
MrmCode lock ; /* resource locking code */
275
char *((*alloc_func) ()) ; /* memory allocation func */
276
void (*free_func) () ; /* deallocation func */
277
MrmFlag byte_swapped ; /* resource is byte_swapped */
278
} URMResourceContext, *URMResourceContextPtr ;
282
* Validation macro, returns TRUE/FALSE
284
#define UrmRCValid(context) ((context)->validation==URMResourceContextValid)
288
* The following are accessor macros for a resource context
290
#define UrmRCBuffer(context) ((context)->data_buffer)
291
#define UrmRCBufSize(context) ((context)->buffer_size)
292
#define UrmRCSize(context) ((context)->resource_size)
293
#define UrmRCGroup(context) ((context)->group)
294
#define UrmRCType(context) ((context)->type)
295
#define UrmRCAccess(context) ((context)->access)
296
#define UrmRCLock(context) ((context)->lock)
297
#define UrmRCByteSwap(context) ((context)->byte_swapped)
301
* The following are modifiers for a resource context
303
#define UrmRCSetBuffer(context,bufadr) {(context)->data_buffer=(bufadr);}
304
#define UrmRCSetSize(context,sizval) {(context)->resource_size=(sizval);}
305
#define UrmRCSetGroup(context,grpval) {(context)->group=(grpval);}
306
#define UrmRCSetType(context,typval) {(context)->type=(typval);}
307
#define UrmRCSetAccess(context,accval) {(context)->access=(accval);}
308
#define UrmRCSetLock(context,lckval) {(context)->lock=(lckval);}
309
#define UrmRCSetByteSwap(context,swapval) {(context)->byte_swapped=(swapval);}
313
* Error reporting states
315
#define URMRCErrorDefault 1 /* default - report on line */
316
#define URMRCErrorSave 2 /* save error, don't report */
319
* Error reporting destinations
321
#define URMErrOutMemory 1 /* Save error messages in memory, no print */
322
#define URMErrOutStdout 2 /* print error messages to stdout */
327
* IDB definitions in common use. The principal one is IDBFile; others
328
* are included to make that definition valid.
332
* Record type definitions - IDBrt...
335
#define IDBrtHeader 1
336
#define IDBrtIndexLeaf 2
337
#define IDBrtIndexNode 3
338
#define IDBrtRIDMap 4
341
#define IDBrtVecSize 6
345
* Sizes of fixed-length strings in the file header. Definitions are
346
* provided for both the number of characters in the string and the
347
* constant which gives the string length including the terminating nul.
350
#define IDBhsVersion 9 /* Any version string */
351
#define IDBhsVersion1 (IDBhsVersion + 1)
352
#define IDBhsCreator 29 /* Creator id */
353
#define IDBhsCreator1 (IDBhsCreator + 1)
354
#define IDBhsDate URMhsDate /* Any date string */
355
#define IDBhsDate1 (IDBhsDate + 1)
356
#define IDBhsModule 29 /* Module id */
357
#define IDBhsModule1 (IDBhsModule + 1)
361
* Record number. 65k should be enough...
363
typedef short int IDBRecordNumber ;
367
* A resource ID consists of the resource map index and the ID index
368
* in the given resource map.
370
typedef short int IDBResourceIndex ;
372
unsigned external_id ; /* Looks like a fullword */
374
IDBRecordNumber map_rec B32 ; /* resource map record */
375
IDBResourceIndex res_index B32 ; /* resource index into map */
376
} internal_id ; /* 2 fields internally */
380
* A resource ID passed by value in a fullword.
382
typedef unsigned IDBResource ; /* a declaration for RIDs
391
* This descriptor contains the information URM requires about a toolkit
394
#define URMWCIClassDescValid 39963371
395
#define UrmWCIClassDescValid(classdesc) \
396
((classdesc)->validation==URMWCIClassDescValid)
398
typedef struct _WCIClassDesc {
399
unsigned validation ; /* URMWCIClassDescValid */
400
struct _WCIClassDesc *next_desc ;
401
/* next descriptor in chain */
402
String creator_name ; /* create routine name. This is also
403
the accessor key for non-toolkit
405
Widget (*creator) () ; /* low-level create routine. This is
406
also the class identifier (name)
407
used to match user classes. */
408
WidgetClass class_record ; /* Pointer to toolkit class record */
410
/* low-level destructor routine.
411
Used to clean up after creation
412
routines that leave dangling
413
memory (i.e. XmRendition,
415
} WCIClassDesc, *WCIClassDescPtr ;
419
* Table used to uncompress compression codes in a self-encoding UID file.
420
* Table entries can be overlaid with function pointers for tables which
421
* encode convenience functions.
423
* The table is accessed by the compression code. Code 0 is unused by
424
* convention, and code 1 is unused because it is the marker for an
425
* unknown (user defined) entry, which is specified by an explicit string.
426
* Thus the valid entries begin at 2 (UilMrmMinValidCode). Any code
427
* < UilMrmMinValidCode or > num_entries is invalid.
429
* When stored in a UID file, a table is a block of memory with the
430
* following properties:
431
* o The table is allocated with enough space for all the decompression
433
* o The table is followed by the strings in the table. They are allocated
434
* in a heap built from contiguous memory following table itself.
436
#define UidCompressionTableValid 317938336
437
#define UilMrmUnknownCode 1
438
#define UilMrmMinValidCode 2
439
#define UilMrmReservedCodeCount 2
443
MrmOffset stoffset; /* offset of string in
445
char *cstring; /* compressed string as
447
WCIClassDescPtr cldesc; /* class descriptor for
453
unsigned validation; /* validation code =
454
UIDCompressionTableValid */
455
MrmCount num_entries; /* number of table entries */
456
UidCTableEntry entry[1]; /* first entry */
457
} UidCompressionTable, *UidCompressionTablePtr;
464
#define k_hash_table_size (127)
466
typedef struct _URMHashTableEntry
468
char *az_value; /* value associated with this name */
469
struct _URMHashTableEntry
470
*az_next_entry; /* next entry on hash chain */
471
char c_text[1]; /* text of the name */
472
} URMHashTableEntry, *URMHashTableEntryPtr;
477
* Low level file information.
479
* This structure is pointed to in the IDBOpenFile structure and blindly
480
* passed to the low level routines.
483
unsigned rab; /* Record Access Block */
484
int file_desc; /* File Descriptor */
485
char *name; /* The file name */
486
} IDBLowLevelFile, *IDBLowLevelFilePtr;
489
* IDB open file information
491
* The following is the information retained by IDB for an open file.
492
* Much of this information matches that found in the file header,
493
* and is the source of for that info when the header is updated.
496
#define IDBOpenFileValid 421642674
498
unsigned validation ; /* validation code =
500
int get_count ; /* # get operations on file */
501
int put_count ; /* # put operations on file */
502
MrmCode access ; /* URMReadAccess or
504
IDBLowLevelFilePtr lowlevel_id ; /* open file id returned
505
by low-level routines */
506
IDBRecordNumber index_root ; /* index root pointer */
507
MrmCount num_indexed ; /* # entries in index */
508
MrmCount num_RID ; /* # RID entries in file */
509
IDBridDesc next_RID ; /* next available RID */
510
IDBRecordNumber last_record ; /* last record used in file */
511
IDBRecordNumber last_data_record ; /* last data record in file.
512
NULL if no records yet */
513
MrmCount group_counts[URMgVecSize] ;
514
/* vector of record counts
516
MrmCount rt_counts[IDBrtVecSize] ;
517
/* vector of record counts by
518
record type (statistics) */
519
unsigned long timer ; /* for statistics */
520
char db_version[IDBhsVersion1] ;
521
/* database version */
522
char creator[IDBhsCreator1] ; /* creator id */
523
char creator_version[IDBhsVersion1] ;
524
/* creator version */
525
char creation_date[IDBhsDate1] ;
527
char module[IDBhsModule1] ; /* module id */
528
char module_version[IDBhsVersion1] ;
530
UidCompressionTablePtr
531
class_ctable; /* compression table for
533
UidCompressionTablePtr
534
resource_ctable; /* compression table for
536
int user1 ; /* for caller use */
537
int user2 ; /* for caller use */
538
MrmFlag byte_swapped ; /* indicates uid file created on
539
opposite-endian machine */
540
MrmFlag in_memory ; /* for memory mapped files */
541
unsigned char *uid_buffer ; /* pointer to memory buffer */
542
} IDBOpenFile, *IDBFile ;
547
* Open hierarchy struct
549
* The following structure represents an open hierarchy. A hierarchy
550
* is principally a list of open IDB files in search order. As an aid to
551
* efficient searching, a list of files by resource group is also kept.
552
* Each entry in the list is the subset of the files in the hierarchy
553
* which contains resources in the corresponding group.
556
#define MrmHIERARCHY_VALID 102214835
557
typedef struct MrmHierarchyDescStruct {
558
unsigned validation ; /* MrmHIERARCHY_VALID */
559
MrmCount num_file ; /* number of files open */
560
IDBFile *file_list ; /* list of open files */
561
MrmCount grp_num[URMgVecSize] ; /* vector of file counts by
563
IDBFile *grp_ids[URMgVecSize] ; /* vectors of file ids by
566
*name_registry; /* to register names */
573
#define MrmHierarchyValid(hierarchy) \
574
((hierarchy)->validation==MrmHIERARCHY_VALID)
579
* RGM widget record typedefs
583
* RGM Widget record. All offset are relative to the beginning of the record
585
#define URMWidgetRecordValid 373946338
588
#define UilMrmWidgetVariety 0
589
#define UilMrmAutoChildVariety 1
592
unsigned validation; /* validation code =
593
URMWidgetRecordValid */
594
MrmSize size; /* Total number of bytes for record */
595
MrmCode access; /* URMaPublic or URMaPrivate */
596
MrmCode lock; /* locking code */
597
MrmType type; /* widget type, equates to class
598
for toolkit widgets. (Unknown or
599
a uid-based compression code). */
600
MrmOffset name_offs; /* Offset of widget name. Locates a
601
String. Empty string is illegal */
602
MrmOffset class_offs; /* Offset of class name. The class name
603
is required for application-defined
605
MrmOffset arglist_offs; /* Offset of arglist descriptor.
606
Locates a RGMArgListDesc struct */
607
MrmOffset children_offs; /* Offset of children descriptor.
608
Locates a RGMChildrenDesc struct */
609
MrmOffset comment_offs; /* Offset of comment string for
610
this widget. (URM extension) */
611
MrmOffset creation_offs; /* Offset of RGMCallnackDesc struct
612
specifying URM creation callback
614
unsigned long variety;/* Regular widget or auto child. */
615
unsigned long annex; /* annex allows compatible growth */
616
} RGMWidgetRecord, *RGMWidgetRecordPtr ;
619
* Size of the header part of the record
621
#define RGMWidgetRecordHdrSize sizeof(RGMWidgetRecord)
624
* Macro to access the widget record in a context
626
#define UrmWRWidgetRec(context) \
627
((RGMWidgetRecordPtr) UrmRCBuffer(context))
631
* All validation, accessor, and setting macros access a widget record in
632
* a context. They all take a pointer to the widget record, which is
633
* the context buffer CAST to RGMWidgetRecordptr.
635
#define UrmWRValid(widgetrec) \
636
((widgetrec)->validation==URMWidgetRecordValid)
639
* Accessor macros for the widget record header
641
#define UrmWRPSize(context) (UrmWRWidgetRec(context)->size)
642
#define UrmWRPAccess(context) (UrmWRWidgetRec(context)->access)
643
#define UrmWRPLock(context) (UrmWRWidgetRec(context)->lock)
644
#define UrmWRPType(context) (UrmWRWidgetRec(context)->type)
649
* value descriptor. This consists of a representation type, followed
650
* by a union of either an immediate value or an offset, depending
651
* on the representation type.
654
MrmType rep_type; /* representation type from
657
int ival; /* integer, boolean, compressed */
658
MrmOffset offset ; /* offset for all others */
659
} datum ; /* immediate value or offset */
660
} RGMArgValue, *RGMArgValuePtr ;
664
* RGM widget record argument descriptor
667
MrmCode tag_code; /* Either the compressed code for
668
the argument tag from URMc...,
669
or UilMrmUnknownCode to indicate no
670
known string. If UilMrmUnknownCode, then
671
the offset is in tag_off */
674
MrmOffset tag_offs; /* offset to tag string if needed */
675
MrmCode related_code; /* related argument code for case
676
where tag_code is valid and a
677
related argument is to be set */
679
RGMArgValue arg_val ; /* argument value */
680
} RGMArgument, *RGMArgumentPtr ;
684
* RGM widget record arglist descriptor
687
MrmCount count; /* number of arguments in list */
688
MrmCount extra; /* # extra runtime args needed */
689
unsigned long annex1 ; /* annex allows compatible growth */
690
RGMArgument args[1] ; /* first of the argument descriptors */
691
} RGMArgListDesc, *RGMArgListDescPtr ;
696
* RGM widget record text vector item (text vector literal)
698
* The following represents vectors of either ASCIZ or compound strings.
699
* each member of the vector is type-tagged so that mixed vectors are possible.
700
* This descriptor is a union so that a vector of these items can be over-
701
* written to become an in-memory list of pointers. This avoids some
702
* allocation problems at widget instantiation. Char8 items are String,
703
* CString items are XmString.
705
* Offsets are interpreted as follows:
706
* text vector as immediate in widget record - offset from beginning
708
* text vector as UID literal - offset from beginning of resource buffer
711
XtPointer pointer ; /* for use as memory pointer */
713
MrmType rep_type B32; /* MrmRtypeChar8 or MrmRtypeCString */
714
MrmOffset offset B32; /* offset of item in record */
715
} text_item ; /* for use as item type & offset */
716
} RGMTextEntry, *RGMTextEntryPtr ;
719
* The text Vector. This is designed to allow the vector of text entries
720
* to be over-written into an in-memory vector of pointers. Thus this list
721
* has one extra entry to provide a terminating null.
723
#define URMTextVectorValid 34966592
725
unsigned validation; /* URMTextVectorValid */
726
MrmCount count; /* Number of text items in vector */
727
RGMTextEntry item[1] ; /* first text item in a vector of
728
n = .count+1 items. item[.count]
730
} RGMTextVector, *RGMTextVectorPtr ;
734
* The integer Vector. This is designed to allow the vector of integers
735
* to be over-written into an in-memory vector of pointers.
737
#define URMIntegerVectorValid 34966593
739
unsigned validation; /* URMIntegerVectorValid */
740
MrmCount count; /* Number of integer items in vector */
741
int item[1] ; /* first integer item in a vector */
742
/* of n = .count+1 items. */
743
} RGMIntegerVector, *RGMIntegerVectorPtr ;
747
* RGM widget record callback item
749
* A callback item is the offset of a routine name (which must be a
750
* non-imported string), and the routine tag value, which is encoded
751
* as a value. The tag value can evaluate to almost anything, including
754
* This structure is intended to be over-written with memory pointers
755
* and thus function as an arglist value.
759
int ival; /* integer, boolean, compressed */
760
MrmOffset offset; /* offset for all others */
761
} RGMdatum; /* immediate value, offset, widget */
766
XtCallbackRec callback ; /* item as Xt callback */
767
MrmFlag resolved; /* Item resolved to XtCallbackRec */
768
String wname; /* Name of widget reference */
772
MrmOffset routine B32; /* offset to routine name string */
773
/* duplicate RGMArgValue, avoiding
774
union alignment hassles */
775
MrmType rep_type B32; /* from RGMrType... */
776
RGMdatum datum ; /* immediate value, offset, widget */
777
} cb_item ; /* callback item in record */
778
} RGMCallbackItem, *RGMCallbackItemPtr ;
781
* RGM widget record callback argument descriptor. This list has
782
* count + 1 entries so that this structure may be overwritten
784
#define URMCallbackDescriptorValid 107397480
786
unsigned validation; /* URMCallbackDescriptorValid */
787
MrmCount count; /* Number of callback items */
788
MrmCount annex; /* annex allows growth */
789
MrmCount unres_ref_count; /* # of unresolved widget refs
790
in the RGMCallbackItems */
791
RGMCallbackItem item[1] ; /* First callback item in a list
792
of n = .count+1 items */
793
} RGMCallbackDesc, *RGMCallbackDescPtr ;
796
* We need to have the 1.1 versions of RGMCallbackItem and RGMCallbackDesc
797
* so that backwards compatibility can be maintained between 1.1 and 1.2.
800
XtCallbackRec runtime ; /* item as Xt callback */
802
MrmOffset routine ; /* offset to routine name string */
803
/* duplicate RGMArgValue, avoiding
804
union alignment hassles */
805
MrmType rep_type ; /* from RGMrType... */
806
RGMdatum datum ; /* immediate value or offset */
807
} cb_item ; /* callback item in record */
808
} OldRGMCallbackItem, *OldRGMCallbackItemPtr ;
811
unsigned validation ; /* URMCallbackDescriptorValid */
812
MrmCount count ; /* Number of callback items */
813
unsigned long annex1 ; /* annex allows compatible growth */
814
OldRGMCallbackItem item[1] ; /* First callback item in a list
815
of n = .count+1 items */
816
} OldRGMCallbackDesc, *OldRGMCallbackDescPtr ;
818
/* BEGIN OSF Fix CR 4859 */
821
* Wide character uid form
823
* The following represents a multi-byte string which needs to be converted
824
* to a wide-character string when it is retrieved.
825
* The structure contains a byte count followed by the bytes.
828
XtPointer pointer; /* for use as memory pointer */
830
MrmCount count; /* # of bytes */
831
char bytes[1]; /* vector of bytes */
833
} RGMWCharEntry, *RGMWCharEntryPtr;
835
/* END OSF Fix CR 4859 */
840
* The following represents a MrmRtypeFont literal. Since it contains two
841
* strings, the same offset mechanism is used to store both, and this
842
* is a fixed-length data structure.
848
/*XmStringCharset*/char* charset; /* character set (resolved) */
849
MrmOffset cs_offs; /* character set in buffer */
854
String font; /* string naming font */
855
MrmOffset font_offs; /* font name in buffer */
858
} RGMFontItem, *RGMFontItemPtr ;
862
* A font list, which is a vector of font items. The font items are
863
* treated as a heap store following the fixed length list (similar
864
* to text vectors). Font lists in widget records have offsets from
865
* the beginning of the record; font list literals in a UID file have
866
* offsets from the beginning of the list itself (just like text
867
* vectors). Font items in a font list are a union of a pointer and
868
* an offset, so that (as in text vectors) they can be converted in
869
* place to an in-memory pointer list.
871
#define URMFontListValid 74149235
873
unsigned validation; /* URMFontListValid */
874
MrmCount count; /* # of font items in list */
875
RGMFontItem item[1] ; /* vector of RGMFontItems */
876
} RGMFontList, *RGMFontListPtr ;
879
* We need to have the 1.1 versions of RGMFontItem and RGMFontList
880
* so that backwards compatibility can be maintained between 1.1 and 1.2.
885
/*XmStringCharset*/char* charset; /* character set (resolved) */
886
MrmOffset cs_offs; /* character set in buffer */
890
String font; /* string naming font */
891
MrmOffset font_offs; /* font name in buffer */
893
} OldRGMFontItem, *OldRGMFontItemPtr ;
896
unsigned validation ; /* URMFontListValid */
897
MrmCount count ; /* # of font items in list */
898
OldRGMFontItem item[1] ; /* vector of RGMFontItems */
899
} OldRGMFontList, *OldRGMFontListPtr ;
903
* RGM widget record child descriptor
906
MrmFlag manage ; /* true if child is managed by parent
908
MrmSCode access ; /* URMaPublic or URMaPrivate */
909
MrmSCode unused1 ; /* formerly class, unused anywhere */
910
MrmSCode type ; /* specifier type - URMrIndex or
912
unsigned long annex1; /* annex allows compatible growth */
914
int index_offs; /* index string offset (URMrIndex) */
915
MrmResource_id id; /* IDB resource id (URMrRID) */
916
} key ; /* key to widget by index or id */
917
} RGMChildDesc, *RGMChildDescPtr ;
921
* RGM widget record children list descriptor
924
MrmCount count; /* number of children */
925
MrmCode unused1; /* formerly access, unused anywhere */
926
unsigned long annex1; /* annex allows compatible growth */
927
RGMChildDesc child[1] ; /* First child descriptor in a list of
928
n = .count descriptors. */
929
} RGMChildrenDesc, *RGMChildrenDescPtr ;
933
* RGM widget record URM resource descriptor. This is commonly used as the
934
* value of an argument which is a discrete resource. In this case, the
935
* resource specifies the data type required for the argument (from
936
* RGMrType...) to allow conversion if the literal is a different type
940
MrmSize size; /* number of bytes in structure */
941
MrmFlag access ; /* Public/private - URMaPublic or
942
URMaPrivate for this resource */
943
MrmSCode type ; /* URMrIndex or URMrRID */
944
MrmSCode res_group ; /* resource group */
945
MrmSCode cvt_type ; /* RGMrType... to which the resource
946
needs to be converted when used
947
as an argument value. RGMwrType
948
for widget references. */
949
unsigned long annex1 ; /* annex allows compatible growth */
952
char index[1] ; /* index for URMrIndex resource
954
MrmResource_id id ; /* resource id */
955
} key ; /* key to resource by index or id */
956
} RGMResourceDesc, *RGMResourceDescPtr ;
959
* When a resource descriptor names a widget, the cvt_type is used to
960
* indicate the type of reference, which indicates the processing required.
962
#define RGMwrTypeReference 233 /* Reference a widget defined by
963
a CreateInstance elsewhere */
964
#define RGMwrTypeSubTree 234 /* Subtree reference. The subtree
965
must be instantiated as part of
966
the current operation */
971
* Interface module descriptor
973
* An interface module is currently the only type of resource set defined.
974
* It defines the topmost widgets for some application (there is no
975
* requirement that there be only one interface module for an application).
979
* A topmost widget descriptor. These are currently required to be
980
* accessed by index only, and the index is currently the only information
981
* saved. The index is stored as a fixed-length entry to simplify the
982
* layout of an interface module.
984
* The widgets referenced in an interface module are those who have
985
* no parent in the interface definition. Commonly these will have
986
* the top-level widget as their parent at runtime, but this is not
990
char index[URMMaxIndexLen1] ;
991
/* Index (name) of widget */
992
} RGMTopmostDesc, *RGMTopmostDescPtr ;
995
#define URMInterfaceModuleValid 408427447
997
unsigned validation; /* URMInterfaceModuleValid */
998
MrmCount count; /* number of topmost widgets */
999
unsigned long annex1; /* annex allows compatible growth */
1000
unsigned long annex2; /* annex allows compatible growth */
1001
RGMTopmostDesc topmost[1] ; /* First topmost descriptor in a
1002
list of n= .count descriptors */
1003
} RGMModuleDesc, *RGMModuleDescPtr ;
1009
#define UrmInterfaceModuleValid(module) \
1010
((module)->validation==URMInterfaceModuleValid)
1015
* Representations for URM color descriptor (MrmRtypeColor) and
1016
* color table (MrmRtypeColorTable).
1020
* RGB color data structure
1024
unsigned short red; /* RGB colors */
1025
unsigned short green; /* RGB colors */
1026
unsigned short blue; /* RGB colors */
1027
}RGBColor, *RGBColorPtr;
1030
* URM color descriptor. This is a color name plus a fallback
1031
* designator specifying the color as foreground or background.
1034
MrmSCode mono_state ; /* monochrome treatment, from
1035
URMColorMonochrome... */
1036
MrmSCode desc_type; /* color desc_type from
1037
URMColorDescType... */
1039
char name[1] ; /* color name */
1040
RGBColor rgb ; /* RGB Color */
1042
} RGMColorDesc, *RGMColorDescPtr ;
1045
* Monochrome treatments
1047
#define URMColorMonochromeUnspecified 1
1048
#define URMColorMonochromeForeground 2
1049
#define URMColorMonochromeBackground 3
1053
* Color descriptor types
1055
#define URMColorDescTypeName 1
1056
#define URMColorDescTypeRGB 2
1059
* Use this Min size plus the size of the color name string to determine the
1060
* exact size that the RGMColorDesc will need to allocate.
1062
#define RGMColorDescNameMinSize (sizeof (RGMColorDesc)\
1063
- sizeof (RGBColor)\
1067
* URM color table item. This is a pointer to a color descriptor, plus
1068
* a Pixel for the runtime conversion of the color.
1071
Pixel color_pixel ; /* runtime translation */
1072
MrmType type; /* descriptor reference type,
1073
either MrmRtypeColor, or
1074
or MrmRtypeResource if
1075
coffs locates a resource */
1076
unsigned long annex1; /* annex allows growth */
1079
RGMColorDescPtr cptr ; /* in-memory color descriptor */
1080
MrmOffset coffs; /* descriptor/resource in record */
1081
} color_item ; /* pointer or offset */
1082
} RGMColorTableEntry, *RGMColorTableEntryPtr ;
1086
* A color table. This is a vector of color items. Items 0 and 1 are
1087
* reserved for "background"(0) and "foreground"(1) in all color tables;
1088
* user-specified colors begin at entry 2. The color count always
1089
* includes these predefined colors, so the minimum count is 2. No
1090
* color descriptor is required or used for the predefined entries;
1091
* only the color_pixel field in the table item is ever used.
1093
* Color descriptor offsets are valid only in a widget record. All
1094
* other instances of a color table, including those which are
1095
* are parameters to the widget record creation routines, must have
1096
* valid memory pointers.
1098
#define URMColorTableValid 9424574
1100
unsigned validation ; /* URMColorTableValid */
1101
MrmCount count ; /* # entries in table */
1102
RGMColorTableEntry item[1] ; /* 1st entry in table */
1103
} RGMColorTable, *RGMColorTablePtr ;
1106
* Predefined entries, first accessible user-defined entry
1108
#define URMColorTableBG 0
1109
#define URMColorTableFG 1
1110
#define URMColorTableUserMin 2
1115
* Definitions to a support a URM icon; the representation for
1116
* MrmRtypeIconImage objects.
1118
* A URM icon supports a pixmap of arbitrary size and with, and with support
1119
* for up to 256 colors including foreground and background. The
1120
* icon pixels are stored using either 1, 4, or 8 bits, depending on
1121
* how much information is required to index the icon's color map.
1123
* The pixel array is stored in row-major order. Each row begins on a byte
1124
* boundary no matter what the pixel size is. URM uses the ZPixmap
1125
* representation for the image data at runtime, and attempts to avoid
1126
* allocating memory for the pixel array by overwriting the pixel data
1127
* array with Pixel values if the number of bits per pixel is sufficient.
1129
* The color table design is intended to support eventual creation of
1130
* color tables as discrete resources, possibly accessible as resource
1131
* references. Currently, the color table must be allocated and managed
1132
* as part of the icon image.
1134
* Icon image offsets are valid only in a widget record. All
1135
* other instances of an icon image, including those which are
1136
* are parameters to the widget record creation routines, must have
1137
* valid memory pointers.
1140
#define URMIconImageValid 160003640
1142
unsigned validation; /* URMIconImageValid */
1143
MrmSCode pixel_size ; /* from URMIconPixelSize... */
1144
MrmCount width; /* # pixels wide */
1145
MrmCount height; /* # pixels high */
1146
MrmCount hot_x, hot_y ; /* hot spot location */
1147
MrmType ct_type; /* MrmRtypeColorTable for
1149
MrmRtypeResource for
1150
separate resource ref. */
1151
unsigned long annex1; /* annex allows growth */
1153
RGMColorTablePtr ctptr ; /* in-memory color table */
1154
MrmOffset ctoff; /* color table or resource
1155
desc offset in record */
1156
} color_table ; /* memory/record color table */
1158
char *pdptr ; /* pixel data in memory */
1159
MrmOffset pdoff; /* pixel data record offset */
1161
} RGMIconImage, *RGMIconImagePtr ;
1165
* Pixel sizes. These are limited and specified with literals.
1167
#define URMPixelSize1Bit 1 /* 1 bit (bitmap) */
1168
#define URMPixelSize2Bit 2 /* 2 bits */
1169
#define URMPixelSize4Bit 3 /* 4 bits */
1170
#define URMPixelSize8Bit 4 /* 8 bits */
1175
* Definitions of the data structures used to store units information for
1176
* dimensional values.
1179
unsigned value; /* the actual integer value */
1180
unsigned units; /* the units designation of the value. Matches
1181
the Xm units values in Xm.h */
1182
} RGMUnitsInteger, *RGMUnitsIntegerPtr ;
1185
unsigned long value[2]; /* the actual floating point value */
1186
unsigned units; /* the units designation of the value. Matches
1187
the Xm units values in Xm.h */
1188
} RGMUnitsFloat, *RGMUnitsFloatPtr ;
1192
* Definition of the data structure used during widget creation to retain
1193
* and provide the information required to resolve widget arguments which
1194
* must be SetValue rather than create. The layout and use of
1195
* the descriptor depends on the type argument:
1196
* URMsvWidgetRef - widget resource forward reference. Resolved
1197
* when the widget is defined, applied when all the
1198
* widgets in a tree are instantiated.
1199
* URMsvIconImage - Icon image which is SetValued immediately
1200
* after the widget create (when foreground/backgound
1201
* info is available).
1204
Widget setw ; /* widget to be modified */
1205
MrmCode type ; /* from URMsv... */
1206
MrmCode tagcode ; /* code of argument to be set */
1207
String tagname ; /* string name of argument. If
1208
the tag code is UilMrmUnknownCode,
1209
this must be freed. */
1210
MrmFlag done ; /* set TRUE when SetValues done */
1212
String wname ; /* arg widget index */
1213
RGMIconImagePtr icon ; /* icon pointer only */
1214
RGMCallbackDescPtr callbacks; /* callback list */
1215
} sv ; /* some SetValues descriptor */
1216
} URMSetValuesDesc, *URMSetValuesDescPtr ;
1219
* SetValues descriptor types
1221
#define URMsvWidgetRef 1 /* widget reference */
1222
#define URMsvIconImage 2 /* icon image */
1223
#define URMsvCallBackList 3 /* list of callbacks */
1227
* The following data structures support resolving references to widgets
1228
* found during creation of a widget tree. The data structure retains
1229
* an ordered list of the widget name/id pairs instantiated during
1230
* tree creation. The data structure is maintained in a resource context
1231
* which allows for expansion. The top part of the data structure retains
1232
* fixed-length information, while the bottom part of the buffer is
1233
* used as a string heap.
1237
* Single element in the fixed-length vector
1240
Widget w_id; /* widget id */
1241
MrmOffset w_name_offs; /* name offset in heap */
1242
} URMWRef, URMWRefPtr;
1245
* Header for the structure
1248
MrmCount num_refs; /* # entries defined */
1249
MrmCount heap_size; /* # bytes used in heap */
1250
URMWRef refs[1]; /* beginning of vector */
1251
} URMWRefStruct, *URMWRefStructPtr;
1255
* size and access macros
1257
#define UrmWRefHeaderBytes(ref_id) \
1258
(sizeof(URMWRefStruct)+((ref_id)->num_refs-1)*sizeof(URMWRef))
1259
#define UrmWRefBytesUsed(ref_id) \
1260
(UrmWRefHeaderBytes((ref_id))+(ref_id)->heap_size)
1261
#define UrmWRefIdN(ref_id,ndx) \
1262
((ref_id)->refs[(ndx)].w_id)
1263
#define UrmWRefNameN(ref_id,ndx) \
1264
((String)((String)(ref_id)+(ref_id)->refs[(ndx)].w_name_offs))
1269
* Function prototypes for URM routines
1272
#define _ARGUMENTS(arglist) arglist
1275
#include "IDB.h" /* needed for prototype definitions */
1278
extern Cardinal UrmGetResourceContext _ARGUMENTS(( char *((*alloc_func )()),
1279
void (*free_func )(),
1281
URMResourceContextPtr *context_id_return ));
1282
extern Cardinal UrmResizeResourceContext _ARGUMENTS(( URMResourceContextPtr context_id ,
1284
extern Cardinal UrmFreeResourceContext _ARGUMENTS(( URMResourceContextPtr context_id ));
1287
extern Cardinal Urm__UT_Error _ARGUMENTS(( char *module ,
1290
URMResourceContextPtr context_id ,
1292
extern Cardinal Urm__UT_SetErrorReport _ARGUMENTS(( MrmCode report_type ));
1293
extern MrmCode Urm__UT_LatestErrorCode _ARGUMENTS(( void ));
1294
extern String Urm__UT_LatestErrorMessage _ARGUMENTS(( void ));
1295
extern String Urm__UT_UrmCodeString _ARGUMENTS(( MrmCode cod ));
1298
extern Cardinal Urm__OpenHierarchy _ARGUMENTS(( MrmCount num_files ,
1300
MrmOsOpenParamPtr *os_ext_list ,
1301
MrmHierarchy *hierarchy_id_return,
1303
unsigned char *uid_buffer));
1304
extern Cardinal Urm__CloseHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id ));
1305
extern Cardinal UrmHGetIndexedResource _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1307
MrmGroup group_filter ,
1308
MrmType type_filter ,
1309
URMResourceContextPtr context_id ,
1310
IDBFile *file_id_return ));
1311
extern Cardinal Urm__RegisterNamesInHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1315
extern Cardinal Urm__LookupNameInHierarchy _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1317
XtPointer *value_return ));
1320
extern Cardinal Idb__BM_InitBufferVector _ARGUMENTS(( void ));
1321
extern Cardinal Idb__BM_GetBuffer _ARGUMENTS(( IDBFile file_id ,
1322
IDBRecordBufferPtr *buffer_return ));
1323
extern Cardinal Idb__BM_MarkActivity _ARGUMENTS(( IDBRecordBufferPtr buffer ));
1324
extern Cardinal Idb__BM_MarkModified _ARGUMENTS(( IDBRecordBufferPtr buffer ));
1325
extern Cardinal Idb__BM_GetRecord _ARGUMENTS(( IDBFile file_id ,
1326
IDBRecordNumber record ,
1327
IDBRecordBufferPtr *buffer_return ));
1328
extern Cardinal Idb__BM_InitRecord _ARGUMENTS(( IDBFile file_id ,
1329
IDBRecordNumber record ,
1331
IDBRecordBufferPtr *buffer_return ));
1332
extern Cardinal Idb__BM_InitDataRecord _ARGUMENTS(( IDBFile file_id ,
1333
IDBRecordBufferPtr *buffer_return ));
1334
extern Cardinal Idb__BM_Decommit _ARGUMENTS(( IDBRecordBufferPtr buffer ));
1335
extern Cardinal Idb__BM_DecommitAll _ARGUMENTS(( IDBFile file_id ));
1338
extern Cardinal UrmCreatePixmap _ARGUMENTS(( RGMIconImagePtr icon ,
1345
extern Cardinal UrmCreateBitmap _ARGUMENTS(( RGMIconImagePtr icon ,
1349
extern Cardinal Urm__CW_ReadBitmapFile _ARGUMENTS(( String filename ,
1355
extern Cardinal Urm__MapIconBitmap _ARGUMENTS(( RGMIconImagePtr icon ,
1357
RGMColorTablePtr ctable ,
1361
extern Cardinal Urm__MapIconBitmapDepth1 _ARGUMENTS(( RGMIconImagePtr icon ,
1366
extern Cardinal Urm__MapIconReplace _ARGUMENTS(( RGMIconImagePtr icon ,
1368
RGMColorTablePtr ctable ,
1373
extern Cardinal Urm__MapIconAllocate _ARGUMENTS(( RGMIconImagePtr icon ,
1376
RGMColorTablePtr ctable ,
1381
extern Cardinal Urm__RealizeColorTable _ARGUMENTS(( Screen *screen ,
1385
RGMColorTablePtr ctable ,
1387
extern RGMIconImagePtr UrmCopyAllocatedIconImage _ARGUMENTS(( RGMIconImagePtr dst_icon ,
1388
RGMIconImagePtr src_icon ));
1389
extern Cardinal Urm__UT_GetNamedColorPixel _ARGUMENTS(( Display *display ,
1391
RGMColorDescPtr colorptr ,
1392
Pixel *pixel_return ,
1394
extern Cardinal Urm__UT_GetColorPixel _ARGUMENTS(( Display *display ,
1396
RGMColorDescPtr colorptr ,
1397
Pixel *pixel_return,
1399
extern Cardinal UrmIconImageSize _ARGUMENTS(( RGMIconImagePtr icon ));
1400
extern Cardinal UrmColorTableSize _ARGUMENTS(( RGMColorTablePtr ctable ));
1403
extern Cardinal Idb__DB_GetDataEntry _ARGUMENTS(( IDBFile file_id ,
1404
IDBDataHandle data_entry ,
1405
URMResourceContextPtr context_id ));
1406
extern Cardinal Idb__DB_PutDataEntry _ARGUMENTS(( IDBFile file_id ,
1407
URMResourceContextPtr context_id ,
1408
IDBDataHandle *data_entry ));
1409
extern Boolean Idb__DB_MatchFilter _ARGUMENTS(( IDBFile file_id ,
1410
IDBDataHandle data_entry ,
1411
MrmCode group_filter ,
1412
MrmCode type_filter ));
1415
extern Cardinal Idb__FU_OpenFile _ARGUMENTS(( char *name ,
1417
MrmOsOpenParamPtr os_ext ,
1418
IDBLowLevelFilePtr *file_id ,
1419
char *returned_fname ));
1420
extern Cardinal Idb__FU_PutBlock _ARGUMENTS((IDBLowLevelFile *file_id,
1421
IDBRecordNumber block_num,
1423
extern Cardinal Idb__FU_CloseFile _ARGUMENTS((IDBLowLevelFile *file_id,
1425
extern Cardinal Idb__FU_GetBlock _ARGUMENTS(( IDBLowLevelFile *file_id ,
1426
IDBRecordNumber block_num ,
1430
extern Cardinal Idb__HDR_GetHeader _ARGUMENTS(( IDBFile file_id ));
1431
extern Cardinal Idb__HDR_InitHeader _ARGUMENTS(( IDBFile file_id ,
1433
String creator_version ,
1435
String module_version ));
1436
extern Cardinal Idb__HDR_PutHeader _ARGUMENTS(( IDBFile file_id ));
1437
extern Cardinal Idb__HDR_UpdateHeader _ARGUMENTS(( IDBFile file_id ,
1438
IDBRecordBufferPtr *buffer ));
1439
extern Cardinal Idb__HDR_EnterItem _ARGUMENTS(( IDBFile file_id ,
1440
IDBResource resource_id ,
1441
IDBDataHandle data_entry ));
1442
extern Cardinal Idb__HDR_ReturnItem _ARGUMENTS(( IDBFile file_id ,
1443
IDBResource resource_id ,
1444
Boolean signal_null ,
1445
IDBDataHandle *entry_return ));
1446
extern Cardinal Idb__HDR_NextRID _ARGUMENTS(( IDBFile file_id ,
1447
IDBResource *res_id_return ));
1448
extern Cardinal Idb__HDR_GetDataEntry _ARGUMENTS(( IDBFile file_id ,
1449
IDBDataHandle data_entry ,
1450
URMResourceContextPtr context_id ));
1451
extern Cardinal Idb__HDR_PutDataEntry _ARGUMENTS(( IDBFile file_id ,
1452
URMResourceContextPtr context_id ,
1453
IDBDataHandle *data_entry ));
1454
extern Boolean Idb__HDR_MatchFilter _ARGUMENTS(( IDBFile file_id ,
1455
IDBDataHandle data_entry ,
1456
MrmCode group_filter ,
1457
MrmCode type_filter ));
1460
extern Cardinal Idb__INX_ReturnItem _ARGUMENTS(( IDBFile file_id ,
1462
IDBDataHandle *data_entry ));
1463
extern Cardinal Idb__INX_FindIndex _ARGUMENTS(( IDBFile file_id ,
1465
IDBRecordBufferPtr *buffer_return ,
1466
MrmCount *index_return ));
1467
extern Cardinal Idb__INX_SearchIndex _ARGUMENTS(( IDBFile file_id ,
1469
IDBRecordBufferPtr buffer ,
1470
MrmCount *index_return ));
1471
extern Cardinal Idb__INX_GetBtreeRecord _ARGUMENTS(( IDBFile file_id ,
1472
IDBRecordBufferPtr *buffer_return ,
1473
MrmCount entry_index ,
1475
extern Cardinal Idb__INX_FindResources _ARGUMENTS(( IDBFile file_id ,
1476
IDBRecordNumber recno ,
1477
MrmGroup group_filter ,
1478
MrmType type_filter ,
1479
URMPointerListPtr index_list ));
1482
extern Cardinal Idb__INX_EnterItem _ARGUMENTS(( IDBFile file_id ,
1484
IDBDataHandle data_entry ));
1485
extern Cardinal Idb__INX_EnterLeafIndex _ARGUMENTS(( IDBFile file_id ,
1486
IDBRecordBufferPtr buffer ,
1488
IDBDataHandle data_entry ,
1489
MrmCount entry_index ,
1491
extern Cardinal Idb__INX_EnterNodeIndex _ARGUMENTS(( IDBFile file_id ,
1492
IDBRecordBufferPtr buffer ,
1494
IDBDataHandle data_entry ,
1495
IDBRecordNumber lt_record ,
1496
IDBRecordNumber gt_record ));
1497
extern Cardinal Idb__INX_SplitLeafRecord _ARGUMENTS(( IDBFile file_id ,
1498
IDBRecordBufferPtr gt_buffer ));
1499
extern Cardinal Idb__INX_SplitNodeRecord _ARGUMENTS(( IDBFile file_id ,
1500
IDBRecordBufferPtr gt_buffer ));
1501
extern Cardinal Idb__INX_InitRootLeafRecord _ARGUMENTS(( IDBFile file_id ,
1502
IDBRecordBufferPtr *buffer_return ));
1503
extern Cardinal Idb__INX_InitRootNodeRecord _ARGUMENTS(( IDBFile file_id ,
1504
IDBRecordBufferPtr *buffer_return ,
1506
IDBDataHandle data_entry ,
1507
IDBRecordNumber lt_record ,
1508
IDBRecordNumber gt_record ));
1509
extern void Idb__INX_CopyLeafRecord _ARGUMENTS(( IDBIndexLeafRecordPtr dst_recptr ,
1510
IDBIndexLeafRecordPtr src_recptr ));
1511
extern void Idb__INX_CopyNodeRecord _ARGUMENTS(( IDBIndexNodeRecordPtr dst_recptr ,
1512
IDBIndexNodeRecordPtr src_recptr ));
1513
extern void Idb__INX_CollapseLeafRecord _ARGUMENTS(( IDBIndexLeafRecordPtr recptr ,
1516
extern void Idb__INX_CollapseNodeRecord _ARGUMENTS(( IDBIndexNodeRecordPtr recptr ,
1519
extern Cardinal Idb__INX_ConfirmNodeSpace _ARGUMENTS(( IDBFile file_id ,
1520
IDBRecordBufferPtr buffer ));
1521
extern Cardinal Idb__INX_SetParent _ARGUMENTS(( IDBFile file_id ,
1522
IDBRecordNumber parent_record ,
1523
IDBRecordNumber child_record ));
1524
extern Cardinal Idb__INX_FixNodeChildren _ARGUMENTS(( IDBFile file_id ,
1525
IDBRecordNumber p_record ));
1528
extern Cardinal Idb__RID_EnterItem _ARGUMENTS(( IDBFile file_id ,
1529
IDBResource resource_id ,
1530
IDBDataHandle data_entry ));
1531
extern Cardinal Idb__RID_ReturnItem _ARGUMENTS(( IDBFile file_id ,
1532
IDBResource resource_id ,
1533
Boolean signal_null ,
1534
IDBDataHandle *entry_return ));
1535
extern Cardinal Idb__RID_NextRID _ARGUMENTS(( IDBFile file_id ,
1536
IDBResource *res_id_return ));
1537
extern Cardinal Idb__RID_AddRecord _ARGUMENTS(( IDBFile file_id ));
1540
extern Cardinal UrmIdbOpenFileRead _ARGUMENTS(( String name ,
1541
MrmOsOpenParamPtr os_ext ,
1542
IDBFile *file_id_return ,
1543
char *fname_return ));
1544
extern Cardinal UrmIdbOpenBuffer _ARGUMENTS(( unsigned char *uid_buffer ,
1545
IDBFile *file_id_return ));
1546
extern Cardinal UrmIdbCloseFile _ARGUMENTS(( IDBFile file_id ,
1547
Boolean keep_new_file ));
1548
extern Cardinal UrmIdbGetIndexedResource _ARGUMENTS(( IDBFile file_id ,
1550
MrmGroup group_filter ,
1551
MrmType type_filter ,
1552
URMResourceContextPtr context_id ));
1553
extern Cardinal UrmIdbFindIndexedResource _ARGUMENTS(( IDBFile file_id ,
1554
MrmGroup group_filter ,
1555
MrmType type_filter ,
1556
URMPointerListPtr index_list ));
1557
extern Cardinal UrmIdbGetRIDResource _ARGUMENTS(( IDBFile file_id ,
1558
MrmResource_id resource_id ,
1559
MrmGroup group_filter ,
1560
MrmType type_filter ,
1561
URMResourceContextPtr context_id ));
1562
extern Cardinal UrmIdbGetResourceId _ARGUMENTS(( IDBFile file_id ,
1563
MrmResource_id *resource_id_return ));
1564
extern Cardinal Idb__FIL_Valid _ARGUMENTS(( IDBFile file_id ));
1567
extern Cardinal UrmIdbOpenFileWrite _ARGUMENTS(( String name ,
1568
MrmOsOpenParamPtr os_ext ,
1570
String creator_version ,
1572
String module_version ,
1573
IDBFile *file_id_return ,
1574
char *fname_return ));
1575
extern Cardinal UrmIdbPutIndexedResource _ARGUMENTS(( IDBFile file_id ,
1577
URMResourceContextPtr context_id ));
1578
extern Cardinal UrmIdbPutRIDResource _ARGUMENTS(( IDBFile file_id ,
1579
MrmResource_id resource_id ,
1580
URMResourceContextPtr context_id ));
1583
extern Cardinal Urm__FetchLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1585
URMResourceContextPtr context_id ,
1586
URMPointerListPtr *ctxlist ));
1587
extern Cardinal UrmGetIndexedLiteral _ARGUMENTS(( IDBFile file_id ,
1589
URMResourceContextPtr context_id ));
1590
extern Cardinal UrmGetRIDLiteral _ARGUMENTS(( IDBFile file_id ,
1591
MrmResource_id resource_id ,
1592
URMResourceContextPtr context_id ));
1593
extern Cardinal Urm__HGetIndexedLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1595
URMResourceContextPtr context_id ,
1596
IDBFile *file_id_return ));
1597
extern Cardinal UrmHGetIndexedLiteral _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1599
URMResourceContextPtr context_id ));
1602
extern Cardinal UrmPutIndexedLiteral _ARGUMENTS(( IDBFile file_id ,
1604
URMResourceContextPtr context_id ));
1605
extern Cardinal UrmPutRIDLiteral _ARGUMENTS(( IDBFile file_id ,
1606
MrmResource_id resource_id ,
1607
URMResourceContextPtr context_id ));
1610
extern Cardinal UrmIFMInitModule _ARGUMENTS(( URMResourceContextPtr context_id ,
1611
MrmCount num_widget ,
1614
extern Cardinal UrmIFMSetTopmost _ARGUMENTS(( URMResourceContextPtr context_id ,
1615
Cardinal topmost_ndx ,
1617
extern Cardinal UrmIFMPutModule _ARGUMENTS(( IDBFile file_id ,
1619
URMResourceContextPtr context_id ));
1620
extern Cardinal UrmIFMHGetModule _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1622
URMResourceContextPtr context_id ,
1623
IDBFile *file_id_return ));
1624
extern Cardinal UrmIFMGetModule _ARGUMENTS(( IDBFile file_id ,
1626
URMResourceContextPtr context_id ));
1629
extern Cardinal UrmPlistInit _ARGUMENTS(( int size ,
1630
URMPointerListPtr *list_id_return ));
1631
extern Cardinal UrmPlistResize _ARGUMENTS(( URMPointerListPtr list_id ,
1633
extern Cardinal UrmPlistFree _ARGUMENTS(( URMPointerListPtr list_id ));
1634
extern Cardinal UrmPlistFreeContents _ARGUMENTS(( URMPointerListPtr list_id ));
1635
extern Cardinal UrmPlistAppendPointer _ARGUMENTS(( URMPointerListPtr list_id ,
1637
extern Cardinal UrmPlistAppendString _ARGUMENTS(( URMPointerListPtr list_id ,
1639
extern MrmCount UrmPlistFindString _ARGUMENTS(( URMPointerListPtr list_id ,
1643
extern Cardinal Urm__FixupCompressionTable _ARGUMENTS(( UidCompressionTablePtr ctable ,
1644
Boolean qfindcldesc, Boolean byte_swapped ));
1645
extern Cardinal Urm__FindClassDescriptor _ARGUMENTS(( IDBFile cfile ,
1648
WCIClassDescPtr *class_return ));
1649
extern Cardinal Urm__UncompressCode _ARGUMENTS(( IDBFile cfile ,
1651
String *stg_return ));
1652
extern Boolean Urm__IsSubtreeResource _ARGUMENTS(( IDBFile cfile ,
1656
extern void Urm__UT_Time _ARGUMENTS(( char *time_stg ));
1659
extern String Urm__UT_AllocString _ARGUMENTS(( String stg ));
1662
extern Cardinal Urm__WCI_RegisterNames _ARGUMENTS(( String *names ,
1665
extern Cardinal Urm__WCI_UnregisterName _ARGUMENTS(( String name ));
1666
extern Cardinal Urm__WCI_LookupClassDescriptor _ARGUMENTS(( String class_name ,
1667
WCIClassDescPtr *class_return ));
1668
extern WidgetClass Urm__WCI_GetClRecOfName _ARGUMENTS(( String clname ));
1669
extern Cardinal Urm__WCI_LookupRegisteredName _ARGUMENTS(( String name ,
1670
XtPointer *value_return ));
1671
extern void hash_initialize _ARGUMENTS(( URMHashTableEntryPtr *htable ,
1672
Boolean *initflag ));
1673
extern URMHashTableEntryPtr hash_find_name _ARGUMENTS(( URMHashTableEntryPtr *htable ,
1675
extern URMHashTableEntryPtr hash_insert_name _ARGUMENTS(( URMHashTableEntryPtr *htable ,
1677
extern URMHashTableEntryPtr hash_delete_name _ARGUMENTS(( URMHashTableEntryPtr *htable ,
1681
extern Cardinal UrmCreateWidgetTree
1682
_ARGUMENTS(( URMResourceContextPtr context_id ,
1684
MrmHierarchy hierarchy_id ,
1688
Cardinal ov_num_args ,
1691
MrmResource_id krid ,
1692
MrmManageFlag manage ,
1693
URMPointerListPtr *svlist ,
1694
URMResourceContextPtr wref_id ,
1695
Widget *w_return ));
1696
extern Cardinal UrmCreateWidgetInstance
1697
_ARGUMENTS((URMResourceContextPtr context_id ,
1699
MrmHierarchy hierarchy_id ,
1703
Cardinal ov_num_args ,
1706
MrmResource_id krid ,
1707
MrmManageFlag manage,
1708
URMPointerListPtr *svlist ,
1709
URMResourceContextPtr wref_id ,
1712
extern Cardinal UrmCreateOrSetWidgetInstance
1713
_ARGUMENTS((URMResourceContextPtr context_id ,
1715
MrmHierarchy hierarchy_id ,
1719
Cardinal ov_num_args ,
1722
MrmResource_id krid ,
1723
MrmManageFlag manage ,
1724
URMPointerListPtr *svlist ,
1725
URMResourceContextPtr wref_id ,
1728
extern Cardinal UrmSetWidgetInstance
1729
_ARGUMENTS((URMResourceContextPtr context_id ,
1731
MrmHierarchy hierarchy_id ,
1734
Cardinal ov_num_args ,
1737
MrmResource_id krid ,
1738
MrmManageFlag manage ,
1739
URMPointerListPtr *svlist ,
1740
URMResourceContextPtr wref_id ,
1741
Widget *w_return ));
1742
extern void Urm__CW_CreateArglist _ARGUMENTS(( Widget parent ,
1743
RGMWidgetRecordPtr widgetrec ,
1744
RGMArgListDescPtr argdesc ,
1745
URMPointerListPtr ctxlist ,
1746
URMPointerListPtr cblist,
1747
URMPointerListPtr ftllist ,
1748
MrmHierarchy hierarchy_id ,
1751
URMPointerListPtr *svlist ,
1752
URMResourceContextPtr wref_id ,
1753
Cardinal *num_used ));
1754
extern long Urm__CW_EvaluateValOrOffset _ARGUMENTS(( MrmType reptype ,
1757
MrmOffset offset ));
1758
extern Cardinal Urm__CW_FixupValue _ARGUMENTS(( long val ,
1762
Boolean *swap_needed));
1763
extern String Urm__CW_DisplayToString _ARGUMENTS(( char *val ,
1765
int add_string_size ));
1766
extern Cardinal Urm__CW_ConvertValue _ARGUMENTS(( Widget parent,
1771
MrmHierarchy hierarchy_id ,
1772
URMPointerListPtr ftllist ));
1773
extern void Urm__CW_SafeCopyValue _ARGUMENTS(( long *val ,
1775
URMPointerListPtr cblist,
1778
extern void UrmDestroyCallback _ARGUMENTS((Widget w ,
1779
URMPointerListPtr list_id ,
1780
XmAnyCallbackStruct *reason));
1781
extern Cardinal Urm__CW_ReadLiteral _ARGUMENTS(( RGMResourceDescPtr resptr ,
1782
MrmHierarchy hierarchy_id ,
1784
URMPointerListPtr ctxlist ,
1788
IDBFile *act_file_id ,
1790
extern Cardinal Urm__CW_LoadIconImage _ARGUMENTS(( RGMIconImagePtr iconptr ,
1792
MrmHierarchy hierarchy_id ,
1794
URMPointerListPtr ctxlist ));
1795
extern Cardinal Urm__CW_FixupCallback _ARGUMENTS(( Widget parent ,
1797
RGMCallbackDescPtr cbdesc ,
1798
URMPointerListPtr ctxlist ,
1799
URMPointerListPtr cblist ,
1800
MrmHierarchy hierarchy_id ,
1802
URMResourceContextPtr wref_id));
1803
extern Cardinal Urm__CW_LoadWidgetResource _ARGUMENTS(( Widget parent ,
1804
RGMWidgetRecordPtr widgetrec ,
1805
RGMResourceDescPtr resptr ,
1806
URMPointerListPtr ctxlist ,
1807
MrmHierarchy hierarchy_id ,
1809
URMPointerListPtr *svlist ,
1810
URMResourceContextPtr wref_id ,
1812
extern void Urm__CW_GetPixmapParms _ARGUMENTS(( Widget w ,
1817
extern RGMCallbackDescPtr
1818
Urm__CW_TranslateOldCallback _ARGUMENTS(( OldRGMCallbackDescPtr oldptr));
1821
extern Cardinal UrmCWRInit _ARGUMENTS(( URMResourceContextPtr context_id ,
1825
extern Cardinal UrmCWRSetClass _ARGUMENTS(( URMResourceContextPtr context_id,
1828
unsigned long variety ));
1829
extern Cardinal UrmCWRInitArglist _ARGUMENTS(( URMResourceContextPtr context_id ,
1831
extern Cardinal UrmCWRSetCompressedArgTag _ARGUMENTS(( URMResourceContextPtr context_id ,
1834
MrmCode related_tag ));
1835
extern Cardinal UrmCWRSetUncompressedArgTag _ARGUMENTS(( URMResourceContextPtr context_id ,
1838
extern Cardinal UrmCWRSetArgValue _ARGUMENTS(( URMResourceContextPtr context_id ,
1841
unsigned long arg_val ));
1842
extern Cardinal UrmCWRSetArgResourceRef _ARGUMENTS(( URMResourceContextPtr context_id ,
1849
MrmResource_id resource_id ));
1850
extern Cardinal UrmCWRSetArgChar8Vec _ARGUMENTS(( URMResourceContextPtr context_id ,
1853
MrmCount num_stg ));
1854
extern Cardinal UrmCWRSetArgCStringVec _ARGUMENTS(( URMResourceContextPtr context_id ,
1856
XmString *cstg_vec ,
1857
MrmCount num_cstg ));
1858
extern Cardinal UrmCWRSetArgCallback _ARGUMENTS(( URMResourceContextPtr context_id ,
1861
MrmOffset *cb_offs_return ));
1862
extern Cardinal UrmCWRSetCallbackItem _ARGUMENTS(( URMResourceContextPtr context_id ,
1867
unsigned long itm_val ));
1868
extern Cardinal UrmCWRSetCallbackItemRes _ARGUMENTS(( URMResourceContextPtr context_id ,
1877
MrmResource_id resource_id ));
1878
extern Cardinal UrmCWRSetExtraArgs _ARGUMENTS(( URMResourceContextPtr context_id ,
1880
extern Cardinal UrmCWRInitChildren _ARGUMENTS(( URMResourceContextPtr context_id ,
1881
Cardinal nchildren ));
1882
extern Cardinal UrmCWRSetChild _ARGUMENTS(( URMResourceContextPtr context_id ,
1883
Cardinal child_ndx ,
1888
MrmResource_id resource_id ));
1889
extern Cardinal UrmCWRSetComment _ARGUMENTS(( URMResourceContextPtr context_id ,
1891
extern Cardinal UrmCWRSetCreationCallback _ARGUMENTS(( URMResourceContextPtr context_id ,
1893
MrmOffset *cb_offs_return ));
1894
extern Cardinal UrmCWR__AppendString _ARGUMENTS(( URMResourceContextPtr context_id ,
1896
MrmOffset *offset ));
1897
extern Cardinal UrmCWR__AppendCString _ARGUMENTS(( URMResourceContextPtr context_id ,
1899
MrmOffset *offset ));
1900
extern Cardinal UrmCWR__AppendWcharString
1901
_ARGUMENTS(( URMResourceContextPtr context_id ,
1903
MrmOffset *offset ));
1904
extern Cardinal UrmCWR__GuaranteeSpace _ARGUMENTS(( URMResourceContextPtr context_id ,
1908
extern Cardinal UrmCWR__AppendResource _ARGUMENTS(( URMResourceContextPtr context_id ,
1914
MrmResource_id resource_id ,
1915
MrmOffset *offset ));
1916
extern Cardinal UrmCWR__ValidateContext _ARGUMENTS(( URMResourceContextPtr context_id ,
1918
extern Cardinal UrmCWR__BindArgPtrs _ARGUMENTS(( URMResourceContextPtr context_id ,
1921
RGMArgListDescPtr *descptr ,
1922
RGMArgumentPtr *argptr ));
1923
extern Cardinal UrmCWR__BindCallbackPtrs _ARGUMENTS(( URMResourceContextPtr context_id ,
1925
MrmOffset descoffs ,
1927
RGMCallbackDescPtr *descptr ,
1928
RGMCallbackItemPtr *itmptr ));
1931
extern Cardinal UrmHGetWidget _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1933
URMResourceContextPtr context_id ,
1934
IDBFile *file_id_return ));
1935
extern Cardinal UrmGetIndexedWidget _ARGUMENTS(( IDBFile file_id ,
1937
URMResourceContextPtr context_id ));
1938
extern Cardinal UrmGetRIDWidget _ARGUMENTS(( IDBFile file_id ,
1939
MrmResource_id resource_id ,
1940
URMResourceContextPtr context_id ));
1943
extern Cardinal Urm__CW_InitWRef _ARGUMENTS(( URMResourceContextPtr *wref_id ));
1944
extern Cardinal Urm__CW_AddWRef _ARGUMENTS(( URMResourceContextPtr wref_id ,
1947
extern Cardinal Urm__CW_FindWRef _ARGUMENTS(( URMResourceContextPtr wref_id ,
1949
Widget *w_id_return ));
1950
extern void Urm__CW_AppendSVWidgetRef _ARGUMENTS(( IDBFile file_id ,
1951
URMPointerListPtr *svlist ,
1955
extern void Urm__CW_AppendCBSVWidgetRef _ARGUMENTS((IDBFile file_id,
1956
URMPointerListPtr *svlist,
1957
RGMCallbackDescPtr cbptr,
1960
extern void Urm__CW_UpdateSVWidgetRef _ARGUMENTS(( URMPointerListPtr *svlist ,
1962
extern void Urm__CW_ResolveSVWidgetRef _ARGUMENTS(( URMPointerListPtr *svlist ,
1966
extern void Urm__CW_FreeSetValuesDesc _ARGUMENTS((URMSetValuesDescPtr svdesc));
1970
extern Cardinal UrmFetchSetValues _ARGUMENTS(( MrmHierarchy hierarchy_id ,
1973
Cardinal num_args ));
1976
extern Cardinal UrmPutIndexedWidget _ARGUMENTS(( IDBFile file_id ,
1978
URMResourceContextPtr context_id ));
1979
extern Cardinal UrmPutRIDWidget _ARGUMENTS(( IDBFile file_id ,
1980
MrmResource_id resource_id ,
1981
URMResourceContextPtr context_id ));
1984
extern Cardinal Idb__BM_SwapRecordBytes _ARGUMENTS(( IDBRecordBufferPtr buffer ));
1985
extern unsigned Urm__SwapValidation _ARGUMENTS(( unsigned validation ));
1986
extern Cardinal Urm__SwapRGMResourceDesc _ARGUMENTS(( RGMResourceDescPtr res_desc ));
1987
extern Cardinal Urm__SwapRGMCallbackDesc _ARGUMENTS(( RGMCallbackDescPtr callb_desc,
1988
RGMWidgetRecordPtr widget_rec ));
1989
extern Cardinal Urm__SwapRGMWidgetRecord _ARGUMENTS(( RGMWidgetRecordPtr widget_rec ));
1997
/* If the alignment characteristics of your machine are right, these may be
2002
#define UrmBCopy(src, dst, size) \
2003
if (size == sizeof(long)) \
2004
*((long *) (dst)) = *((long *) (src)); \
2005
else if (size == sizeof(int)) \
2006
*((int *) (dst)) = *((int *) (src)); \
2007
else if (size == sizeof(short)) \
2008
*((short *) (dst)) = *((short *) (src)); \
2009
else if (size == sizeof(char)) \
2010
*((char *) (dst)) = *((char *) (src)); \
2012
memmove((char *) (dst), (char *) (src), (int) (size));
2016
#define UrmBCopy(src, dst, size) \
2017
memmove((char *) (dst), (char *) (src), (int) (size));
2019
#endif /* UNALIGNED */
2021
/******** Conditionally defined macros for thread_safe DtTerm ******/
2023
#define _MrmWidgetToAppContext(w) \
2024
XtAppContext app = XtWidgetToApplicationContext(w)
2025
#define _MrmDisplayToAppContext(d) \
2026
XtAppContext app = XtDisplayToApplicationContext(d)
2027
#define _MrmAppLock(app) XtAppLock(app)
2028
#define _MrmAppUnlock(app) XtAppUnlock(app)
2029
#define _MrmProcessLock() XtProcessLock()
2030
#define _MrmProcessUnlock() XtProcessUnlock()
2031
#else /* XTHREADS */
2032
#define _MrmWidgetToAppContext(w)
2033
#define _MrmDisplayToAppContext(d)
2034
#define _MrmAppLock(app)
2035
#define _MrmAppUnlock(app)
2036
#define _MrmProcessLock()
2037
#define _MrmProcessUnlock()
2038
#endif /* XTHREADS */
2041
/* DON'T ADD STUFF AFTER THIS #endif */