~ubuntu-branches/ubuntu/quantal/openmotif/quantal

« back to all changes in this revision

Viewing changes to lib/Mrm/Mrm.h

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bauer
  • Date: 2010-06-23 12:12:31 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100623121231-u89gxdp51sg9wjj2
Tags: 2.3.0-1
* New Maintainer (Closes: #379258) 
* Acknowledge NMU changes
* New upstream release (Closes: #494375)
* Get rid of security patches as they are already part of new upstream
  release (00-xpmvuln.openmotif.patch, 342092-CVE-2005-3964.patch)
* Bump Standards to 3.8.4
* Added {misc:Depends} to make the package lintian cleaner
* Fix weak-library-dev-dependency by adding ${binary:Version}) for the
  -dev Package of openmotif
* Let package depend on autotools-dev to use newer autotools-helper-files
* Work around an autoconf-bug (Gentoo-Bug #1475)
* Added Client-side anti-aliased fonts support via XFT
* Added UTF-8 and UTF8_STRING atom support
* Ability to show text and pixmaps in Label, LabelGadget and all
  derived widgets
* Support of PNG/JPEG image formats in the same way as XPM is supported
* Increase FILE_OFFSET_BITS to 64 to show files >2GB in file-selector
  Idea taken from Magne Oestlyngen (Closes: #288537)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 *  @OPENGROUP_COPYRIGHT@
 
3
 *  COPYRIGHT NOTICE
 
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.
 
8
 *  
 
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.
 
14
 *  
 
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
 
18
 *  this agreement.
 
19
 *  
 
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
 
25
 *  
 
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.
 
35
*/ 
 
36
/* 
 
37
 * HISTORY
 
38
*/ 
 
39
/*   $TOG: Mrm.h /main/23 1999/05/25 16:55:58 mgreess $ */
 
40
/*                                                                      *
 
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.                                          *
 
48
 */
 
49
#ifndef Mrm_H
 
50
#define Mrm_H
 
51
 
 
52
#define urm_h   1
 
53
#include <Mrm/MrmPublic.h>
 
54
#include <Xm/Xm.h>                      /* XmString definition and _NO_PROTO */
 
55
#include <Xm/XmosP.h>
 
56
 
 
57
 
 
58
/*
 
59
 * This is the internal file used throughout URM for literal and
 
60
 * struct definitions. It defines everything not found in public
 
61
 * files.
 
62
 */
 
63
 
 
64
#ifndef MIN
 
65
#define MIN(x,y)        ((x) < (y) ? (x) : (y))
 
66
#endif
 
67
#ifndef MAX
 
68
#define MAX(x,y)        ((x) > (y) ? (x) : (y))
 
69
#endif
 
70
 
 
71
#ifndef XmConst
 
72
#if defined(__STDC__) || !defined( NO_CONST )
 
73
#define XmConst const
 
74
#else
 
75
#define XmConst
 
76
#endif /* __STDC__ */
 
77
#endif /* XmConst */
 
78
 
 
79
 
 
80
/*
 
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.  
 
84
 */
 
85
#define _sl sizeof(long)
 
86
#define _slm (sizeof(long) - 1)
 
87
#define _FULLWORD(exp) (_sl * (((exp) + _slm) / _sl))   /* (4*(((exp)+3)/4)) */
 
88
 
 
89
/*
 
90
 *  Swap the byte order of 4- and 2- byte quantities.
 
91
 *  "tp +=" lines are needed on Cray (CARD32 is actually 64 bits).
 
92
 */
 
93
 
 
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;\
 
100
        l = t;\
 
101
}
 
102
 
 
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;\
 
108
        s = t;\
 
109
}
 
110
 
 
111
#define swapbytes(v) {\
 
112
        if (sizeof(v) == 2) \
 
113
          swap2bytes(v) \
 
114
        else if (sizeof(v) == 4) \
 
115
          swap4bytes(v); \
 
116
}
 
117
 
 
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;\
 
124
        d = dt;\
 
125
}
 
126
 
 
127
 
 
128
/* 
 
129
 * When a resource record is referenced but not yet fetched, logical or
 
130
 * the convert type with this value as a flag.
 
131
 */
 
132
#define MrmResourceUnswapped (unsigned char)128
 
133
 
 
134
 
 
135
/*
 
136
 * URM-wide constants
 
137
 */
 
138
 
 
139
#define URMversion              "URM 1.2"
 
140
#define URM1_1version           "URM 1.1"
 
141
 
 
142
/*
 
143
 * The indexes of the self-encoding compression tables in a UID file. They
 
144
 * intentionally include characters which are illegal in UIL identifiers.
 
145
 */
 
146
#define UilMrmClassTableIndex           ">ClassTable"
 
147
#define UilMrmResourceTableIndex        ">ResourceTable"
 
148
 
 
149
 
 
150
/*
 
151
 * Resource classes and types
 
152
 */
 
153
#define URMgNul         0
 
154
#define URMgWidget      1
 
155
#define URMgLiteral     2               /* types in MrmRtype... */
 
156
#define URMgResourceSet 3               /* type in URMrs... */
 
157
/*                      4               unused */
 
158
#define URMgMessage     5
 
159
 
 
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 */
 
163
 
 
164
/*
 
165
 * The null resource type
 
166
 */
 
167
#define URMtNul         0
 
168
 
 
169
 
 
170
/*
 
171
 * Access types
 
172
 */
 
173
#define URMaPublic      1
 
174
#define URMaPrivate     2
 
175
 
 
176
/*
 
177
 * Index types. Immediate is included for the convenience of the UIL compiler
 
178
 */
 
179
#define URMrIndex       1
 
180
#define URMrRID         2
 
181
#define URMrImmediate   3
 
182
 
 
183
/*
 
184
 * Maximum number of characters in an index
 
185
 */
 
186
#define URMMaxIndexLen  31
 
187
#define URMMaxIndexLen1 (URMMaxIndexLen + 1)    /* to size vectors */
 
188
 
 
189
 
 
190
/*
 
191
 * File open access types
 
192
 */
 
193
#define URMReadAccess   1
 
194
#define URMWriteAccess  2
 
195
 
 
196
/*
 
197
 * Standard date string length
 
198
 */
 
199
#define URMhsDate               29              /* any date string */
 
200
 
 
201
 
 
202
/*
 
203
 * Types of resource sets.
 
204
 */
 
205
#define URMrsInterfaceModule    1       /* Interface module */
 
206
 
 
207
 
 
208
/*
 
209
 * Values for the manage flag in memory only -- the manage field in RGMChildDesc
 
210
 * is just a Boolean.
 
211
 */
 
212
typedef enum {
 
213
MrmManageUnmanage,
 
214
MrmManageManage,
 
215
MrmManageDefault
 
216
} MrmManageFlag;
 
217
 
 
218
 
 
219
/*
 
220
 * Urm typedefs
 
221
 */
 
222
 
 
223
/*
 
224
 * The maximum number of arguments allowed in an arglist or children in
 
225
 * a child list. A number intended to catch gross errors.
 
226
 */
 
227
#define RGMListSizeMax          32767
 
228
 
 
229
 
 
230
/*
 
231
 * URM pointer list
 
232
 *
 
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.
 
237
 */
 
238
 
 
239
typedef struct {
 
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 ;
 
244
 
 
245
 
 
246
/*
 
247
 * Accessors for the list or a pointer in the list
 
248
 */
 
249
#define UrmPlistPtrList(list) ((list)->ptr_vec)
 
250
#define UrmPlistNum(list) ((list)->num_ptrs)
 
251
#define UrmPlistPtrN(list,ndx) ((list)->ptr_vec[ndx])
 
252
 
 
253
 
 
254
 
 
255
/*
 
256
 * URM Resource context
 
257
 *
 
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
 
263
 */
 
264
#define URMResourceContextValid 232570204
 
265
typedef struct {
 
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 ;
 
279
 
 
280
 
 
281
/*
 
282
 * Validation macro, returns TRUE/FALSE
 
283
 */
 
284
#define UrmRCValid(context) ((context)->validation==URMResourceContextValid)
 
285
 
 
286
 
 
287
/*
 
288
 * The following are accessor macros for a resource context
 
289
 */
 
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)
 
298
 
 
299
 
 
300
/*
 
301
 * The following are modifiers for a resource context
 
302
 */
 
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);}
 
310
 
 
311
 
 
312
/*
 
313
 * Error reporting states
 
314
 */
 
315
#define URMRCErrorDefault       1       /* default - report on line */
 
316
#define URMRCErrorSave          2       /* save error, don't report */
 
317
 
 
318
/*
 
319
 * Error reporting destinations
 
320
 */
 
321
#define URMErrOutMemory 1       /* Save error messages in memory, no print */
 
322
#define URMErrOutStdout 2       /* print error messages to stdout */
 
323
 
 
324
 
 
325
 
 
326
/*
 
327
 * IDB definitions in common use. The principal one is IDBFile; others
 
328
 * are included to make that definition valid.
 
329
 */
 
330
 
 
331
/*
 
332
 * Record type definitions - IDBrt...
 
333
 */
 
334
#define IDBrtMin                1
 
335
#define IDBrtHeader             1
 
336
#define IDBrtIndexLeaf          2
 
337
#define IDBrtIndexNode          3
 
338
#define IDBrtRIDMap             4
 
339
#define IDBrtData               5
 
340
#define IDBrtMax                5
 
341
#define IDBrtVecSize            6
 
342
 
 
343
 
 
344
/*
 
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.
 
348
 * IDBhs...
 
349
 */
 
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)
 
358
 
 
359
 
 
360
/*
 
361
 * Record number. 65k should be enough...
 
362
 */
 
363
typedef short int       IDBRecordNumber ;
 
364
 
 
365
 
 
366
/*
 
367
 * A resource ID consists of the resource map index and the ID index
 
368
 * in the given resource map.
 
369
 */
 
370
typedef short int       IDBResourceIndex ;
 
371
typedef union {
 
372
        unsigned                external_id ;   /* Looks like a fullword */
 
373
        struct {
 
374
            IDBRecordNumber     map_rec B32 ;    /* resource map record */
 
375
            IDBResourceIndex    res_index B32 ;  /* resource index into map */
 
376
        }       internal_id ;                   /* 2 fields internally */
 
377
} IDBridDesc ;
 
378
 
 
379
/*
 
380
 * A resource ID passed by value in a fullword.
 
381
 */
 
382
typedef unsigned        IDBResource ;           /* a declaration for RIDs
 
383
                                                   passed by value */
 
384
 
 
385
 
 
386
 
 
387
 
 
388
/*
 
389
 * Class descriptor.
 
390
 *
 
391
 * This descriptor contains the information URM requires about a toolkit
 
392
 * class.
 
393
 */
 
394
#define URMWCIClassDescValid    39963371
 
395
#define UrmWCIClassDescValid(classdesc) \
 
396
    ((classdesc)->validation==URMWCIClassDescValid)
 
397
 
 
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
 
404
                                           widget classes. */
 
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 */
 
409
        void            (*cleanup) () ;
 
410
                                        /* low-level destructor routine.
 
411
                                           Used to clean up after creation
 
412
                                           routines that leave dangling
 
413
                                           memory (i.e. XmRendition,
 
414
                                           XmRenderTable) */
 
415
} WCIClassDesc, *WCIClassDescPtr ;
 
416
 
 
417
 
 
418
/*
 
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.
 
422
 *
 
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.
 
428
 * 
 
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
 
432
 *        pointers required.
 
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.
 
435
 */
 
436
#define UidCompressionTableValid        317938336
 
437
#define UilMrmUnknownCode               1
 
438
#define UilMrmMinValidCode              2
 
439
#define UilMrmReservedCodeCount         2
 
440
 
 
441
typedef union
 
442
    {
 
443
    MrmOffset           stoffset;               /* offset of string in
 
444
                                                   heap (in file) */
 
445
    char                *cstring;               /* compressed string as
 
446
                                                 a memory pointer */
 
447
    WCIClassDescPtr     cldesc;                 /* class descriptor for
 
448
                                                   class table */
 
449
    } UidCTableEntry;
 
450
 
 
451
typedef struct
 
452
    {
 
453
    unsigned            validation;             /* validation code =
 
454
                                                   UIDCompressionTableValid */
 
455
    MrmCount            num_entries;            /* number of table entries */
 
456
    UidCTableEntry      entry[1];               /* first entry */
 
457
    } UidCompressionTable, *UidCompressionTablePtr;
 
458
 
 
459
 
 
460
 
 
461
/*
 
462
 * Hash table entry
 
463
 */
 
464
#define k_hash_table_size       (127)
 
465
 
 
466
typedef struct _URMHashTableEntry
 
467
{
 
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;
 
473
 
 
474
 
 
475
 
 
476
/*
 
477
 * Low level file information.
 
478
 *
 
479
 * This structure is pointed to in the IDBOpenFile structure and blindly
 
480
 * passed to the low level routines.
 
481
 */
 
482
typedef struct {
 
483
        unsigned        rab;            /* Record Access Block  */
 
484
        int             file_desc;      /* File Descriptor */
 
485
        char            *name;          /* The file name                */
 
486
} IDBLowLevelFile, *IDBLowLevelFilePtr;
 
487
 
 
488
/*
 
489
 * IDB open file information
 
490
 *
 
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.
 
494
 */
 
495
 
 
496
#define IDBOpenFileValid        421642674
 
497
typedef struct {
 
498
        unsigned        validation ;            /* validation code =
 
499
                                                   IDBOpenFileValid */
 
500
        int             get_count ;             /* # get operations on file */
 
501
        int             put_count ;             /* # put operations on file */
 
502
        MrmCode         access ;                /* URMReadAccess or
 
503
                                                   URMWriteAccess */
 
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
 
515
                                                   by resource group */
 
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] ;
 
526
                                                /* creation date */
 
527
        char            module[IDBhsModule1] ;  /* module id */
 
528
        char            module_version[IDBhsVersion1] ;
 
529
                                                /* module version */
 
530
        UidCompressionTablePtr
 
531
                        class_ctable;           /* compression table for
 
532
                                                   class info */
 
533
        UidCompressionTablePtr
 
534
                        resource_ctable;        /* compression table for
 
535
                                                   resource info */
 
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 ;
 
543
 
 
544
 
 
545
 
 
546
/*
 
547
 * Open hierarchy struct
 
548
 *
 
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.
 
554
 */
 
555
 
 
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
 
562
                                                   resource group */
 
563
        IDBFile         *grp_ids[URMgVecSize] ; /* vectors of file ids by
 
564
                                                   resource group */
 
565
        URMHashTableEntryPtr
 
566
                        *name_registry;         /* to register names */
 
567
} MrmHierarchyDesc;
 
568
 
 
569
 
 
570
/*
 
571
 * Validation macro
 
572
 */
 
573
#define MrmHierarchyValid(hierarchy)            \
 
574
    ((hierarchy)->validation==MrmHIERARCHY_VALID)
 
575
 
 
576
 
 
577
 
 
578
/*
 
579
 * RGM widget record typedefs
 
580
 */
 
581
 
 
582
/*
 
583
 * RGM Widget record. All offset are relative to the beginning of the record
 
584
 */
 
585
#define URMWidgetRecordValid    373946338
 
586
 
 
587
/* Variety codes. */
 
588
#define UilMrmWidgetVariety     0
 
589
#define UilMrmAutoChildVariety  1
 
590
 
 
591
typedef struct {
 
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
 
604
                                           widgets. */
 
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
 
613
                                           for this widget */
 
614
        unsigned long           variety;/* Regular widget or auto child. */
 
615
        unsigned long           annex;  /* annex allows compatible growth */
 
616
} RGMWidgetRecord, *RGMWidgetRecordPtr ;
 
617
 
 
618
/*
 
619
 * Size of the header part of the record
 
620
 */
 
621
#define RGMWidgetRecordHdrSize  sizeof(RGMWidgetRecord)
 
622
 
 
623
/*
 
624
 * Macro to access the widget record in a context
 
625
 */
 
626
#define UrmWRWidgetRec(context) \
 
627
        ((RGMWidgetRecordPtr) UrmRCBuffer(context))
 
628
 
 
629
 
 
630
/*
 
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.
 
634
 */
 
635
#define UrmWRValid(widgetrec)   \
 
636
    ((widgetrec)->validation==URMWidgetRecordValid)
 
637
 
 
638
/*
 
639
 * Accessor macros for the widget record header
 
640
 */
 
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)
 
645
 
 
646
 
 
647
 
 
648
/*
 
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.
 
652
 */
 
653
typedef struct {
 
654
        MrmType         rep_type;       /* representation type from
 
655
                                           RGMrType... */
 
656
        union {
 
657
          int           ival;           /* integer, boolean, compressed */
 
658
          MrmOffset     offset ;        /* offset for all others */
 
659
        } datum ;                       /* immediate value or offset */
 
660
} RGMArgValue, *RGMArgValuePtr ;
 
661
 
 
662
 
 
663
/*
 
664
 * RGM widget record argument descriptor
 
665
 */
 
666
typedef struct {
 
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 */
 
672
        union
 
673
            {
 
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 */
 
678
            } stg_or_relcode;
 
679
        RGMArgValue     arg_val ;       /* argument value */
 
680
} RGMArgument, *RGMArgumentPtr ;
 
681
 
 
682
 
 
683
/*
 
684
 * RGM widget record arglist descriptor
 
685
 */
 
686
typedef struct {
 
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 ;
 
692
 
 
693
 
 
694
 
 
695
/*
 
696
 * RGM widget record text vector item (text vector literal)
 
697
 *
 
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.
 
704
 *
 
705
 * Offsets are interpreted as follows:
 
706
 *      text vector as immediate in widget record - offset from beginning
 
707
 *              of record buffer.
 
708
 *      text vector as UID literal - offset from beginning of resource buffer
 
709
 */
 
710
typedef union {
 
711
          XtPointer     pointer ;       /* for use as memory pointer */
 
712
          struct {
 
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 ;
 
717
 
 
718
/*
 
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.
 
722
 */
 
723
#define URMTextVectorValid      34966592
 
724
typedef struct {
 
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]
 
729
                                           always = NULL */
 
730
} RGMTextVector, *RGMTextVectorPtr ;
 
731
 
 
732
 
 
733
/*
 
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. 
 
736
 */
 
737
#define URMIntegerVectorValid   34966593
 
738
typedef struct {
 
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 ;
 
744
 
 
745
 
 
746
/*
 
747
 * RGM widget record callback item
 
748
 *
 
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
 
752
 * an imported value.
 
753
 *
 
754
 * This structure is intended to be over-written with memory pointers
 
755
 * and thus function as an arglist value.
 
756
 */
 
757
typedef union 
 
758
{
 
759
  int           ival;           /* integer, boolean, compressed */
 
760
  MrmOffset     offset;         /* offset for all others */
 
761
} RGMdatum;                     /* immediate value, offset, widget */
 
762
 
 
763
 
 
764
typedef union {
 
765
  struct {
 
766
    XtCallbackRec       callback ;      /* item as Xt callback */
 
767
    MrmFlag             resolved;       /* Item resolved to XtCallbackRec */
 
768
    String              wname;          /* Name of widget reference */
 
769
  }     runtime;
 
770
    
 
771
  struct {
 
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 ;
 
779
 
 
780
/*
 
781
 * RGM widget record callback argument descriptor. This list has
 
782
 * count + 1 entries so that this structure may be overwritten
 
783
 */
 
784
#define URMCallbackDescriptorValid      107397480
 
785
typedef struct {
 
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 ;
 
794
 
 
795
/*
 
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.
 
798
 */
 
799
typedef union {
 
800
        XtCallbackRec   runtime ;       /* item as Xt callback */
 
801
        struct {
 
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 ;
 
809
 
 
810
typedef struct {
 
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 ;
 
817
 
 
818
/* BEGIN OSF Fix CR 4859 */
 
819
 
 
820
/*
 
821
 * Wide character uid form
 
822
 *
 
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.
 
826
 */
 
827
typedef union {
 
828
    XtPointer   pointer;                          /* for use as memory pointer */
 
829
    struct {
 
830
      MrmCount  count;                            /* # of bytes */
 
831
      char bytes[1];                              /* vector of bytes */
 
832
    } wchar_item;
 
833
} RGMWCharEntry, *RGMWCharEntryPtr;
 
834
 
 
835
/* END OSF Fix CR 4859 */
 
836
 
 
837
/*
 
838
 * Font literal
 
839
 *
 
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.
 
843
 * data structure.
 
844
 */
 
845
typedef struct {
 
846
    union
 
847
        {
 
848
        /*XmStringCharset*/char*        charset; /* character set (resolved) */
 
849
        MrmOffset       cs_offs;        /* character set in buffer */
 
850
 
 
851
        } cset;
 
852
    union
 
853
        {
 
854
        String          font;           /* string naming font */
 
855
        MrmOffset       font_offs;      /* font name in buffer */
 
856
        } font;
 
857
    MrmCode             type;
 
858
} RGMFontItem, *RGMFontItemPtr ;
 
859
 
 
860
 
 
861
/*
 
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.
 
870
 */
 
871
#define URMFontListValid        74149235
 
872
typedef struct {
 
873
        unsigned                validation;     /* URMFontListValid */
 
874
        MrmCount                count;          /* # of font items in list */
 
875
        RGMFontItem             item[1] ;       /* vector of RGMFontItems */
 
876
} RGMFontList, *RGMFontListPtr ;
 
877
 
 
878
/*
 
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.
 
881
 */
 
882
typedef struct {
 
883
    union
 
884
        {
 
885
        /*XmStringCharset*/char*        charset;        /* character set (resolved) */
 
886
        MrmOffset       cs_offs;        /* character set in buffer */
 
887
        } cset;
 
888
    union
 
889
        {
 
890
        String          font;           /* string naming font */
 
891
        MrmOffset       font_offs;      /* font name in buffer */
 
892
        } font;
 
893
} OldRGMFontItem, *OldRGMFontItemPtr ;
 
894
 
 
895
typedef struct {
 
896
        unsigned                validation ;    /* URMFontListValid */
 
897
        MrmCount                count ;         /* # of font items in list */
 
898
        OldRGMFontItem          item[1] ;       /* vector of RGMFontItems */
 
899
} OldRGMFontList, *OldRGMFontListPtr ;
 
900
 
 
901
 
 
902
/*
 
903
 * RGM widget record child descriptor
 
904
 */
 
905
typedef struct {
 
906
        MrmFlag         manage ;        /* true if child is managed by parent
 
907
                                           at initialization */
 
908
        MrmSCode        access ;        /* URMaPublic or URMaPrivate */
 
909
        MrmSCode        unused1 ;       /* formerly class, unused anywhere */
 
910
        MrmSCode        type ;          /* specifier type - URMrIndex or
 
911
                                           URMrRID */
 
912
        unsigned long   annex1;         /* annex allows compatible growth */
 
913
        union {
 
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 ;
 
918
 
 
919
 
 
920
/*
 
921
 * RGM widget record children list descriptor
 
922
 */
 
923
typedef struct {
 
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 ;
 
930
 
 
931
 
 
932
/*
 
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
 
937
 * when read.
 
938
 */
 
939
typedef struct {
 
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 */
 
950
 
 
951
        union {
 
952
          char          index[1] ;      /* index for URMrIndex resource
 
953
                                           (nul teminated) */
 
954
          MrmResource_id        id ;    /* resource id */
 
955
        } key ;                         /* key to resource by index or id */
 
956
} RGMResourceDesc, *RGMResourceDescPtr ;
 
957
 
 
958
/*
 
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.
 
961
 */
 
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 */
 
967
 
 
968
 
 
969
 
 
970
/*
 
971
 * Interface module descriptor
 
972
 *
 
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).
 
976
 */
 
977
 
 
978
/*
 
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.
 
983
 *
 
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
 
987
 * required.
 
988
 */
 
989
typedef struct {
 
990
        char            index[URMMaxIndexLen1] ;
 
991
                                        /* Index (name) of widget */
 
992
} RGMTopmostDesc, *RGMTopmostDescPtr ;
 
993
 
 
994
 
 
995
#define URMInterfaceModuleValid 408427447
 
996
typedef struct {
 
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 ;
 
1004
 
 
1005
 
 
1006
/*
 
1007
 * Validation macro
 
1008
 */
 
1009
#define UrmInterfaceModuleValid(module)         \
 
1010
    ((module)->validation==URMInterfaceModuleValid)
 
1011
 
 
1012
 
 
1013
 
 
1014
/*
 
1015
 * Representations for URM color descriptor (MrmRtypeColor) and
 
1016
 * color table (MrmRtypeColorTable).
 
1017
 */
 
1018
 
 
1019
/*
 
1020
 * RGB color data structure
 
1021
 */
 
1022
 
 
1023
typedef struct {
 
1024
        unsigned short  red;            /* RGB colors */
 
1025
        unsigned short  green;          /* RGB colors */
 
1026
        unsigned short  blue;           /* RGB colors */
 
1027
}RGBColor, *RGBColorPtr;
 
1028
 
 
1029
/*
 
1030
 * URM color descriptor. This is a color name plus a fallback
 
1031
 * designator specifying the color as foreground or background.
 
1032
 */
 
1033
typedef struct {
 
1034
        MrmSCode        mono_state ;    /* monochrome treatment, from
 
1035
                                           URMColorMonochrome... */
 
1036
        MrmSCode        desc_type;      /* color desc_type from
 
1037
                                           URMColorDescType... */
 
1038
        union {
 
1039
            char        name[1] ;       /* color name */
 
1040
            RGBColor    rgb ;           /* RGB Color */
 
1041
            } desc;
 
1042
} RGMColorDesc, *RGMColorDescPtr ;
 
1043
 
 
1044
/*
 
1045
 * Monochrome treatments
 
1046
 */
 
1047
#define URMColorMonochromeUnspecified   1
 
1048
#define URMColorMonochromeForeground    2
 
1049
#define URMColorMonochromeBackground    3
 
1050
 
 
1051
 
 
1052
/*
 
1053
 * Color descriptor types
 
1054
 */
 
1055
#define URMColorDescTypeName    1
 
1056
#define URMColorDescTypeRGB     2
 
1057
 
 
1058
/*
 
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.
 
1061
 */
 
1062
#define RGMColorDescNameMinSize (sizeof (RGMColorDesc)\
 
1063
                                 - sizeof (RGBColor)\
 
1064
                                 + sizeof (char))
 
1065
 
 
1066
/*
 
1067
 * URM color table item. This is a pointer to a color descriptor, plus
 
1068
 * a Pixel for the runtime conversion of the color.
 
1069
 */
 
1070
typedef struct {
 
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 */
 
1077
        
 
1078
        union {
 
1079
          RGMColorDescPtr       cptr ;  /* in-memory color descriptor */
 
1080
          MrmOffset             coffs;  /* descriptor/resource in record */
 
1081
        } color_item ;                  /* pointer or offset */
 
1082
} RGMColorTableEntry, *RGMColorTableEntryPtr ;
 
1083
 
 
1084
 
 
1085
/*
 
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.
 
1092
 *
 
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.
 
1097
 */
 
1098
#define URMColorTableValid      9424574
 
1099
typedef struct {
 
1100
        unsigned                validation ;    /* URMColorTableValid */
 
1101
        MrmCount                count ;         /* # entries in table */
 
1102
        RGMColorTableEntry      item[1] ;       /* 1st entry in table */
 
1103
} RGMColorTable, *RGMColorTablePtr ;
 
1104
 
 
1105
/*
 
1106
 * Predefined entries, first accessible user-defined entry
 
1107
 */
 
1108
#define URMColorTableBG         0
 
1109
#define URMColorTableFG         1
 
1110
#define URMColorTableUserMin    2
 
1111
 
 
1112
        
 
1113
 
 
1114
/*
 
1115
 * Definitions to a support a URM icon; the representation for
 
1116
 * MrmRtypeIconImage objects.
 
1117
 *
 
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.
 
1122
 *
 
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.
 
1128
 *
 
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.
 
1133
 *
 
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.
 
1138
 */
 
1139
 
 
1140
#define URMIconImageValid       160003640
 
1141
typedef struct {
 
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
 
1148
                                                   table in record.
 
1149
                                                   MrmRtypeResource for
 
1150
                                                   separate resource ref. */
 
1151
        unsigned long           annex1;         /* annex allows growth */
 
1152
        union {
 
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 */
 
1157
        union {
 
1158
          char                  *pdptr ;        /* pixel data in memory */
 
1159
          MrmOffset             pdoff;          /* pixel data record offset */
 
1160
        } pixel_data ;
 
1161
} RGMIconImage, *RGMIconImagePtr ;
 
1162
 
 
1163
 
 
1164
/*
 
1165
 * Pixel sizes. These are limited and specified with literals.
 
1166
 */
 
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 */
 
1171
 
 
1172
 
 
1173
 
 
1174
/*
 
1175
 * Definitions of the data structures used to store units information for
 
1176
 * dimensional values.
 
1177
 */
 
1178
typedef struct {
 
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 ;
 
1183
 
 
1184
typedef struct {
 
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 ;
 
1189
 
 
1190
 
 
1191
/*
 
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).
 
1202
 */
 
1203
typedef struct {
 
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 */
 
1211
        union {
 
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 ;
 
1217
 
 
1218
/*
 
1219
 * SetValues descriptor types
 
1220
 */
 
1221
#define URMsvWidgetRef          1       /* widget reference */
 
1222
#define URMsvIconImage          2       /* icon image */
 
1223
#define URMsvCallBackList       3       /* list of callbacks */
 
1224
 
 
1225
 
 
1226
/*
 
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.
 
1234
 */
 
1235
 
 
1236
/*
 
1237
 * Single element in the fixed-length vector
 
1238
 */
 
1239
typedef struct {
 
1240
    Widget              w_id;                   /* widget id */
 
1241
    MrmOffset           w_name_offs;            /* name offset in heap */
 
1242
} URMWRef, URMWRefPtr;
 
1243
 
 
1244
/*
 
1245
 * Header for the structure
 
1246
 */
 
1247
typedef struct {
 
1248
    MrmCount            num_refs;               /* # entries defined */
 
1249
    MrmCount            heap_size;              /* # bytes used in heap */
 
1250
    URMWRef             refs[1];                /* beginning of vector */
 
1251
} URMWRefStruct, *URMWRefStructPtr;
 
1252
 
 
1253
 
 
1254
/*
 
1255
 * size and access macros
 
1256
 */
 
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))
 
1265
 
 
1266
 
 
1267
 
 
1268
/*
 
1269
 * Function prototypes for URM routines
 
1270
 */
 
1271
#ifndef _ARGUMENTS
 
1272
#define _ARGUMENTS(arglist) arglist
 
1273
#endif
 
1274
 
 
1275
#include "IDB.h"                        /* needed for prototype definitions */
 
1276
 
 
1277
/* mrmcontext.c */
 
1278
extern Cardinal UrmGetResourceContext  _ARGUMENTS(( char *((*alloc_func )()), 
 
1279
                                                    void (*free_func )(), 
 
1280
                                                    MrmSize size , 
 
1281
                                                    URMResourceContextPtr *context_id_return ));
 
1282
extern Cardinal UrmResizeResourceContext  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1283
                                                    int size ));
 
1284
extern Cardinal UrmFreeResourceContext  _ARGUMENTS(( URMResourceContextPtr context_id ));
 
1285
 
 
1286
/* mrmerror.c */
 
1287
extern Cardinal Urm__UT_Error  _ARGUMENTS(( char *module , 
 
1288
                                            char *error , 
 
1289
                                            IDBFile file_id , 
 
1290
                                            URMResourceContextPtr context_id , 
 
1291
                                            Cardinal status ));
 
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 ));
 
1296
 
 
1297
/* mrmhier.c */
 
1298
extern Cardinal Urm__OpenHierarchy  _ARGUMENTS(( MrmCount num_files , 
 
1299
                                                 String *name_list , 
 
1300
                                                 MrmOsOpenParamPtr *os_ext_list , 
 
1301
                                                 MrmHierarchy *hierarchy_id_return,
 
1302
                                                 MrmFlag in_memory, 
 
1303
                                                 unsigned char *uid_buffer));
 
1304
extern Cardinal Urm__CloseHierarchy  _ARGUMENTS(( MrmHierarchy hierarchy_id ));
 
1305
extern Cardinal UrmHGetIndexedResource  _ARGUMENTS(( MrmHierarchy hierarchy_id , 
 
1306
                                                String index , 
 
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 , 
 
1312
                                                            String *names , 
 
1313
                                                            XtPointer *values , 
 
1314
                                                            MrmCount num_cb ));
 
1315
extern Cardinal Urm__LookupNameInHierarchy  _ARGUMENTS(( MrmHierarchy hierarchy_id , 
 
1316
                                                        String name , 
 
1317
                                                        XtPointer *value_return ));
 
1318
 
 
1319
/* mrmibuffer.c */
 
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 , 
 
1330
                                                MrmType type , 
 
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 ));
 
1336
 
 
1337
/* mrmicon.c */
 
1338
extern Cardinal UrmCreatePixmap  _ARGUMENTS(( RGMIconImagePtr icon , 
 
1339
                                            Screen *screen , 
 
1340
                                            Display *display , 
 
1341
                                            Pixel fgpix , 
 
1342
                                            Pixel bgpix , 
 
1343
                                            Pixel *pixmap ,
 
1344
                                            Widget parent ));
 
1345
extern Cardinal UrmCreateBitmap _ARGUMENTS(( RGMIconImagePtr icon , 
 
1346
                                            Screen *screen , 
 
1347
                                            Display *display , 
 
1348
                                            Pixel *pixmap ));
 
1349
extern Cardinal Urm__CW_ReadBitmapFile  _ARGUMENTS(( String filename , 
 
1350
                                                    Screen *screen , 
 
1351
                                                    Pixel fgint , 
 
1352
                                                    Pixel bgint , 
 
1353
                                                    Pixmap *pixmap ,
 
1354
                                                    Widget parent ));
 
1355
extern Cardinal Urm__MapIconBitmap  _ARGUMENTS(( RGMIconImagePtr icon , 
 
1356
                                                int srcpix , 
 
1357
                                                RGMColorTablePtr ctable , 
 
1358
                                                Screen *screen , 
 
1359
                                                Display *display , 
 
1360
                                                Pixmap *pixmap ));
 
1361
extern Cardinal Urm__MapIconBitmapDepth1  _ARGUMENTS(( RGMIconImagePtr icon , 
 
1362
                                                int srcpix , 
 
1363
                                                Screen *screen , 
 
1364
                                                Display *display , 
 
1365
                                                Pixmap *pixmap ));
 
1366
extern Cardinal Urm__MapIconReplace  _ARGUMENTS(( RGMIconImagePtr icon , 
 
1367
                                                int srcpix , 
 
1368
                                                RGMColorTablePtr ctable , 
 
1369
                                                Screen *screen ,    
 
1370
                                                Display *display , 
 
1371
                                                Pixmap *pixmap ,
 
1372
                                                Widget parent ));
 
1373
extern Cardinal Urm__MapIconAllocate  _ARGUMENTS(( RGMIconImagePtr icon ,
 
1374
                                                int srcpix , 
 
1375
                                                int dstpix , 
 
1376
                                                RGMColorTablePtr ctable , 
 
1377
                                                Screen *screen , 
 
1378
                                                Display *display , 
 
1379
                                                Pixmap *pixmap ,
 
1380
                                                Widget parent ));
 
1381
extern Cardinal Urm__RealizeColorTable  _ARGUMENTS(( Screen *screen , 
 
1382
                                                Display *display , 
 
1383
                                                Pixel fgpix , 
 
1384
                                                Pixel bgpix , 
 
1385
                                                RGMColorTablePtr ctable ,
 
1386
                                                Widget parent ));
 
1387
extern RGMIconImagePtr UrmCopyAllocatedIconImage  _ARGUMENTS(( RGMIconImagePtr dst_icon , 
 
1388
                                                            RGMIconImagePtr src_icon ));
 
1389
extern Cardinal Urm__UT_GetNamedColorPixel  _ARGUMENTS(( Display *display , 
 
1390
                                                        Colormap cmap , 
 
1391
                                                        RGMColorDescPtr colorptr , 
 
1392
                                                        Pixel *pixel_return ,
 
1393
                                                        Pixel fallback));
 
1394
extern Cardinal Urm__UT_GetColorPixel  _ARGUMENTS(( Display *display , 
 
1395
                                                    Colormap cmap , 
 
1396
                                                    RGMColorDescPtr colorptr , 
 
1397
                                                    Pixel *pixel_return,
 
1398
                                                    Pixel fallback));
 
1399
extern Cardinal UrmIconImageSize  _ARGUMENTS(( RGMIconImagePtr icon ));
 
1400
extern Cardinal UrmColorTableSize  _ARGUMENTS(( RGMColorTablePtr ctable ));
 
1401
 
 
1402
/* mrmientry.c */
 
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 ));
 
1413
 
 
1414
/* mrmifile.c */
 
1415
extern Cardinal Idb__FU_OpenFile  _ARGUMENTS(( char *name , 
 
1416
                                                MrmCode access , 
 
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,
 
1422
                                             char               *buffer)) ;
 
1423
extern Cardinal Idb__FU_CloseFile _ARGUMENTS((IDBLowLevelFile   *file_id,
 
1424
                                   int                  del)) ;
 
1425
extern Cardinal Idb__FU_GetBlock  _ARGUMENTS(( IDBLowLevelFile *file_id , 
 
1426
                                                IDBRecordNumber block_num , 
 
1427
                                                char *buffer ));
 
1428
 
 
1429
/* mrmiheader.c */
 
1430
extern Cardinal Idb__HDR_GetHeader  _ARGUMENTS(( IDBFile file_id ));
 
1431
extern Cardinal Idb__HDR_InitHeader  _ARGUMENTS(( IDBFile file_id , 
 
1432
                                                String creator , 
 
1433
                                                String creator_version , 
 
1434
                                                String module , 
 
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 ));
 
1458
 
 
1459
/* mrmiindex.c */
 
1460
extern Cardinal Idb__INX_ReturnItem  _ARGUMENTS(( IDBFile file_id , 
 
1461
                                                    char *index , 
 
1462
                                                    IDBDataHandle *data_entry ));
 
1463
extern Cardinal Idb__INX_FindIndex  _ARGUMENTS(( IDBFile file_id , 
 
1464
                                                    char *index , 
 
1465
                                                    IDBRecordBufferPtr *buffer_return , 
 
1466
                                                    MrmCount *index_return ));
 
1467
extern Cardinal Idb__INX_SearchIndex  _ARGUMENTS(( IDBFile file_id , 
 
1468
                                                    char *index , 
 
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 , 
 
1474
                                                        Cardinal order ));
 
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 ));
 
1480
 
 
1481
/* mrmiindexw.c */
 
1482
extern Cardinal Idb__INX_EnterItem  _ARGUMENTS(( IDBFile file_id , 
 
1483
                                                    char *index , 
 
1484
                                                    IDBDataHandle data_entry ));
 
1485
extern Cardinal Idb__INX_EnterLeafIndex  _ARGUMENTS(( IDBFile file_id , 
 
1486
                                                        IDBRecordBufferPtr buffer , 
 
1487
                                                        char *index , 
 
1488
                                                        IDBDataHandle data_entry , 
 
1489
                                                        MrmCount entry_index , 
 
1490
                                                        Cardinal order ));
 
1491
extern Cardinal Idb__INX_EnterNodeIndex  _ARGUMENTS(( IDBFile file_id , 
 
1492
                                                        IDBRecordBufferPtr buffer , 
 
1493
                                                        char *index , 
 
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 , 
 
1505
                                                            char *index , 
 
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 , 
 
1514
                                                        MrmCount start , 
 
1515
                                                        MrmCount end ));
 
1516
extern void Idb__INX_CollapseNodeRecord  _ARGUMENTS(( IDBIndexNodeRecordPtr recptr , 
 
1517
                                                        MrmCount start , 
 
1518
                                                        MrmCount end ));
 
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 ));
 
1526
 
 
1527
/* mrmirid.c */
 
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 ));
 
1538
 
 
1539
/* mrmitop.c */
 
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 , 
 
1549
                                                        String index , 
 
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 ));
 
1565
 
 
1566
/* mrmitopw.c */
 
1567
extern Cardinal UrmIdbOpenFileWrite  _ARGUMENTS(( String name , 
 
1568
                                                    MrmOsOpenParamPtr os_ext , 
 
1569
                                                    String creator , 
 
1570
                                                    String creator_version , 
 
1571
                                                    String module , 
 
1572
                                                    String module_version , 
 
1573
                                                    IDBFile *file_id_return , 
 
1574
                                                    char *fname_return ));
 
1575
extern Cardinal UrmIdbPutIndexedResource  _ARGUMENTS(( IDBFile file_id , 
 
1576
                                                    String index , 
 
1577
                                                    URMResourceContextPtr context_id ));
 
1578
extern Cardinal UrmIdbPutRIDResource  _ARGUMENTS(( IDBFile file_id , 
 
1579
                                                    MrmResource_id resource_id , 
 
1580
                                                    URMResourceContextPtr context_id ));
 
1581
 
 
1582
/* mrmlread.c */
 
1583
extern Cardinal Urm__FetchLiteral  _ARGUMENTS(( MrmHierarchy hierarchy_id , 
 
1584
                                                    String index , 
 
1585
                                                    URMResourceContextPtr context_id , 
 
1586
                                                    URMPointerListPtr *ctxlist ));
 
1587
extern Cardinal UrmGetIndexedLiteral  _ARGUMENTS(( IDBFile file_id , 
 
1588
                                                    String index , 
 
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 , 
 
1594
                                                        String index , 
 
1595
                                                        URMResourceContextPtr context_id , 
 
1596
                                                        IDBFile *file_id_return ));
 
1597
extern Cardinal UrmHGetIndexedLiteral  _ARGUMENTS(( MrmHierarchy hierarchy_id , 
 
1598
                                                        String index , 
 
1599
                                                        URMResourceContextPtr context_id ));
 
1600
 
 
1601
/* mrmlwrite.c */
 
1602
extern Cardinal UrmPutIndexedLiteral  _ARGUMENTS(( IDBFile file_id , 
 
1603
                                                    String index , 
 
1604
                                                    URMResourceContextPtr context_id ));
 
1605
extern Cardinal UrmPutRIDLiteral  _ARGUMENTS(( IDBFile file_id , 
 
1606
                                                    MrmResource_id resource_id , 
 
1607
                                                    URMResourceContextPtr context_id ));
 
1608
 
 
1609
/* mrmmodule.c */
 
1610
extern Cardinal UrmIFMInitModule  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1611
                                                MrmCount num_widget , 
 
1612
                                                MrmCode access , 
 
1613
                                                MrmCode lock ));
 
1614
extern Cardinal UrmIFMSetTopmost  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1615
                                                Cardinal topmost_ndx , 
 
1616
                                                String index ));
 
1617
extern Cardinal UrmIFMPutModule  _ARGUMENTS(( IDBFile file_id , 
 
1618
                                                String index , 
 
1619
                                                URMResourceContextPtr context_id ));
 
1620
extern Cardinal UrmIFMHGetModule  _ARGUMENTS(( MrmHierarchy hierarchy_id , 
 
1621
                                                String index , 
 
1622
                                                URMResourceContextPtr context_id , 
 
1623
                                                IDBFile *file_id_return ));
 
1624
extern Cardinal UrmIFMGetModule  _ARGUMENTS(( IDBFile file_id , 
 
1625
                                                String index , 
 
1626
                                                URMResourceContextPtr context_id ));
 
1627
 
 
1628
/* mrmptrlist.c */
 
1629
extern Cardinal UrmPlistInit  _ARGUMENTS(( int size ,
 
1630
                                            URMPointerListPtr *list_id_return ));
 
1631
extern Cardinal UrmPlistResize  _ARGUMENTS(( URMPointerListPtr list_id ,
 
1632
                                                int size ));
 
1633
extern Cardinal UrmPlistFree  _ARGUMENTS(( URMPointerListPtr list_id ));
 
1634
extern Cardinal UrmPlistFreeContents  _ARGUMENTS(( URMPointerListPtr list_id ));
 
1635
extern Cardinal UrmPlistAppendPointer  _ARGUMENTS(( URMPointerListPtr list_id , 
 
1636
                                                    XtPointer ptr ));
 
1637
extern Cardinal UrmPlistAppendString  _ARGUMENTS(( URMPointerListPtr list_id , 
 
1638
                                                    String stg ));
 
1639
extern MrmCount UrmPlistFindString  _ARGUMENTS(( URMPointerListPtr list_id , 
 
1640
                                                    String stg ));
 
1641
 
 
1642
/* mrmtable.c */
 
1643
extern Cardinal Urm__FixupCompressionTable  _ARGUMENTS(( UidCompressionTablePtr ctable , 
 
1644
                                                            Boolean qfindcldesc,                                                            Boolean byte_swapped ));
 
1645
extern Cardinal Urm__FindClassDescriptor  _ARGUMENTS(( IDBFile cfile , 
 
1646
                                                        MrmCode code , 
 
1647
                                                        char *name , 
 
1648
                                                        WCIClassDescPtr *class_return ));
 
1649
extern Cardinal Urm__UncompressCode  _ARGUMENTS(( IDBFile cfile , 
 
1650
                                                    MrmCode code , 
 
1651
                                                    String *stg_return ));
 
1652
extern Boolean Urm__IsSubtreeResource  _ARGUMENTS(( IDBFile cfile , 
 
1653
                                                    MrmCode code ));
 
1654
 
 
1655
/* mrmtime.c */
 
1656
extern void Urm__UT_Time  _ARGUMENTS(( char *time_stg ));
 
1657
 
 
1658
/* mrmvm.c */
 
1659
extern String Urm__UT_AllocString  _ARGUMENTS(( String stg ));
 
1660
 
 
1661
/* mrmwci.c */
 
1662
extern Cardinal Urm__WCI_RegisterNames  _ARGUMENTS(( String *names , 
 
1663
                                                        XtPointer *values , 
 
1664
                                                        MrmCount num_cb ));
 
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 , 
 
1674
                                                            char *c_text ));
 
1675
extern URMHashTableEntryPtr hash_insert_name  _ARGUMENTS(( URMHashTableEntryPtr *htable , 
 
1676
                                                            char *c_text ));
 
1677
extern URMHashTableEntryPtr hash_delete_name  _ARGUMENTS(( URMHashTableEntryPtr *htable , 
 
1678
                                                            char *c_text ));
 
1679
 
 
1680
/* mrmwcrw.c */
 
1681
extern Cardinal UrmCreateWidgetTree 
 
1682
                               _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1683
                                            Widget parent , 
 
1684
                                            MrmHierarchy hierarchy_id , 
 
1685
                                            IDBFile file_id , 
 
1686
                                            String ov_name , 
 
1687
                                            ArgList ov_args , 
 
1688
                                            Cardinal ov_num_args , 
 
1689
                                            MrmCode keytype , 
 
1690
                                            String kindex , 
 
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 , 
 
1698
                                           Widget parent , 
 
1699
                                           MrmHierarchy hierarchy_id , 
 
1700
                                           IDBFile file_id , 
 
1701
                                           String ov_name , 
 
1702
                                           ArgList ov_args , 
 
1703
                                           Cardinal ov_num_args , 
 
1704
                                           MrmCode keytype , 
 
1705
                                           String kindex , 
 
1706
                                           MrmResource_id krid ,
 
1707
                                           MrmManageFlag manage,
 
1708
                                           URMPointerListPtr *svlist , 
 
1709
                                           URMResourceContextPtr wref_id , 
 
1710
                                           Widget *w_return,
 
1711
                                           char **w_name));
 
1712
extern Cardinal UrmCreateOrSetWidgetInstance  
 
1713
                               _ARGUMENTS((URMResourceContextPtr context_id , 
 
1714
                                           Widget parent , 
 
1715
                                           MrmHierarchy hierarchy_id , 
 
1716
                                           IDBFile file_id , 
 
1717
                                           String ov_name , 
 
1718
                                           ArgList ov_args , 
 
1719
                                           Cardinal ov_num_args , 
 
1720
                                           MrmCode keytype , 
 
1721
                                           String kindex , 
 
1722
                                           MrmResource_id krid , 
 
1723
                                           MrmManageFlag manage ,
 
1724
                                           URMPointerListPtr *svlist , 
 
1725
                                           URMResourceContextPtr wref_id , 
 
1726
                                           Widget *w_return,
 
1727
                                           char **w_name));
 
1728
extern Cardinal UrmSetWidgetInstance  
 
1729
                               _ARGUMENTS((URMResourceContextPtr context_id , 
 
1730
                                           Widget parent , 
 
1731
                                           MrmHierarchy hierarchy_id , 
 
1732
                                           IDBFile file_id , 
 
1733
                                           ArgList ov_args , 
 
1734
                                           Cardinal ov_num_args , 
 
1735
                                           MrmCode keytype , 
 
1736
                                           String kindex , 
 
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 , 
 
1749
                                                IDBFile file_id , 
 
1750
                                                ArgList args , 
 
1751
                                                URMPointerListPtr *svlist , 
 
1752
                                                URMResourceContextPtr wref_id , 
 
1753
                                                Cardinal *num_used ));
 
1754
extern long Urm__CW_EvaluateValOrOffset  _ARGUMENTS(( MrmType reptype , 
 
1755
                                                XtPointer bufptr , 
 
1756
                                                long ival , 
 
1757
                                                MrmOffset offset ));
 
1758
extern Cardinal Urm__CW_FixupValue  _ARGUMENTS(( long val , 
 
1759
                                                 MrmType reptype , 
 
1760
                                                 XtPointer bufptr ,
 
1761
                                                 IDBFile file_id ,
 
1762
                                                 Boolean *swap_needed));
 
1763
extern String Urm__CW_DisplayToString _ARGUMENTS(( char *val ,
 
1764
                                                    String add_string ,
 
1765
                                                    int add_string_size ));
 
1766
extern Cardinal Urm__CW_ConvertValue  _ARGUMENTS((  Widget parent,
 
1767
                                                    long *val , 
 
1768
                                                    MrmType reptype , 
 
1769
                                                    MrmType cvttype , 
 
1770
                                                    Display *display , 
 
1771
                                                    MrmHierarchy hierarchy_id , 
 
1772
                                                    URMPointerListPtr ftllist ));
 
1773
extern void Urm__CW_SafeCopyValue  _ARGUMENTS(( long *val , 
 
1774
                                                MrmType reptype , 
 
1775
                                                URMPointerListPtr cblist,
 
1776
                                                int vec_count ,
 
1777
                                                int vec_size ));
 
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 , 
 
1783
                                                  IDBFile file_id , 
 
1784
                                                  URMPointerListPtr ctxlist , 
 
1785
                                                  MrmType *type , 
 
1786
                                                  long *val , 
 
1787
                                                  int *vec_count , 
 
1788
                                                  IDBFile *act_file_id ,
 
1789
                                                  int *vec_size ));
 
1790
extern Cardinal Urm__CW_LoadIconImage  _ARGUMENTS(( RGMIconImagePtr iconptr , 
 
1791
                                                    XtPointer bufptr , 
 
1792
                                                    MrmHierarchy hierarchy_id , 
 
1793
                                                    IDBFile file_id , 
 
1794
                                                    URMPointerListPtr ctxlist ));
 
1795
extern Cardinal Urm__CW_FixupCallback  _ARGUMENTS(( Widget parent , 
 
1796
                                                    XtPointer bufptr , 
 
1797
                                                    RGMCallbackDescPtr cbdesc , 
 
1798
                                                    URMPointerListPtr ctxlist , 
 
1799
                                                    URMPointerListPtr cblist , 
 
1800
                                                    MrmHierarchy hierarchy_id , 
 
1801
                                                    IDBFile file_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 , 
 
1808
                                                    IDBFile file_id , 
 
1809
                                                    URMPointerListPtr *svlist , 
 
1810
                                                    URMResourceContextPtr wref_id , 
 
1811
                                                    long *val ));
 
1812
extern void Urm__CW_GetPixmapParms  _ARGUMENTS(( Widget w , 
 
1813
                                                    Screen **screen , 
 
1814
                                                    Display **display , 
 
1815
                                                    Pixel *fgint , 
 
1816
                                                    Pixel *bgint ));
 
1817
extern RGMCallbackDescPtr 
 
1818
  Urm__CW_TranslateOldCallback _ARGUMENTS(( OldRGMCallbackDescPtr oldptr));
 
1819
 
 
1820
/* mrmwcrwr.c */
 
1821
extern Cardinal UrmCWRInit  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1822
                                            String name , 
 
1823
                                            MrmCode access , 
 
1824
                                            MrmCode lock ));
 
1825
extern Cardinal UrmCWRSetClass  _ARGUMENTS(( URMResourceContextPtr context_id, 
 
1826
                                             MrmCode type, 
 
1827
                                             String urm_class,
 
1828
                                             unsigned long variety ));
 
1829
extern Cardinal UrmCWRInitArglist  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1830
                                                Cardinal nargs ));
 
1831
extern Cardinal UrmCWRSetCompressedArgTag  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1832
                                                        Cardinal arg_ndx , 
 
1833
                                                        MrmCode tag , 
 
1834
                                                        MrmCode related_tag ));
 
1835
extern Cardinal UrmCWRSetUncompressedArgTag  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1836
                                                            Cardinal arg_ndx , 
 
1837
                                                            String tag ));
 
1838
extern Cardinal UrmCWRSetArgValue  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1839
                                                Cardinal arg_ndx , 
 
1840
                                                MrmCode type , 
 
1841
                                                unsigned long arg_val ));
 
1842
extern Cardinal UrmCWRSetArgResourceRef  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1843
                                                        Cardinal arg_ndx , 
 
1844
                                                        MrmCode access , 
 
1845
                                                        MrmGroup group , 
 
1846
                                                        MrmCode type , 
 
1847
                                                        MrmCode key_type , 
 
1848
                                                        String index , 
 
1849
                                                        MrmResource_id resource_id ));
 
1850
extern Cardinal UrmCWRSetArgChar8Vec  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1851
                                                    Cardinal arg_ndx , 
 
1852
                                                    String *stg_vec , 
 
1853
                                                    MrmCount num_stg ));
 
1854
extern Cardinal UrmCWRSetArgCStringVec  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1855
                                                        Cardinal arg_ndx , 
 
1856
                                                        XmString *cstg_vec , 
 
1857
                                                        MrmCount num_cstg ));
 
1858
extern Cardinal UrmCWRSetArgCallback  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1859
                                                    Cardinal arg_ndx , 
 
1860
                                                    Cardinal nitems , 
 
1861
                                                    MrmOffset *cb_offs_return ));
 
1862
extern Cardinal UrmCWRSetCallbackItem  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1863
                                                    MrmOffset cb_offs , 
 
1864
                                                    Cardinal item_ndx , 
 
1865
                                                    String routine , 
 
1866
                                                    MrmCode type , 
 
1867
                                                    unsigned long itm_val ));
 
1868
extern Cardinal UrmCWRSetCallbackItemRes  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1869
                                                        MrmOffset cb_offs , 
 
1870
                                                        Cardinal item_ndx , 
 
1871
                                                        String routine , 
 
1872
                                                        MrmGroup group , 
 
1873
                                                        MrmCode access , 
 
1874
                                                        MrmCode type , 
 
1875
                                                        MrmCode key_type , 
 
1876
                                                        String index , 
 
1877
                                                        MrmResource_id resource_id ));
 
1878
extern Cardinal UrmCWRSetExtraArgs  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1879
                                                    Cardinal nextra ));
 
1880
extern Cardinal UrmCWRInitChildren  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1881
                                                    Cardinal nchildren ));
 
1882
extern Cardinal UrmCWRSetChild  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1883
                                                Cardinal child_ndx , 
 
1884
                                                Boolean manage , 
 
1885
                                                MrmCode access , 
 
1886
                                                MrmCode key_type , 
 
1887
                                                String index , 
 
1888
                                                MrmResource_id resource_id ));
 
1889
extern Cardinal UrmCWRSetComment  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1890
                                                String comment ));
 
1891
extern Cardinal UrmCWRSetCreationCallback  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1892
                                                        Cardinal nitems , 
 
1893
                                                        MrmOffset *cb_offs_return ));
 
1894
extern Cardinal UrmCWR__AppendString  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1895
                                                    String stg , 
 
1896
                                                    MrmOffset *offset ));
 
1897
extern Cardinal UrmCWR__AppendCString  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1898
                                                    XmString cstg , 
 
1899
                                                    MrmOffset *offset ));
 
1900
extern Cardinal UrmCWR__AppendWcharString  
 
1901
                               _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1902
                                            wchar_t *wcs , 
 
1903
                                            MrmOffset *offset ));
 
1904
extern Cardinal UrmCWR__GuaranteeSpace  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1905
                                                        MrmSize delta , 
 
1906
                                                        MrmOffset *offset , 
 
1907
                                                        char **addr ));
 
1908
extern Cardinal UrmCWR__AppendResource  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1909
                                                        MrmCode access , 
 
1910
                                                        MrmCode group , 
 
1911
                                                        MrmCode type , 
 
1912
                                                        MrmCode key_type , 
 
1913
                                                        String index , 
 
1914
                                                        MrmResource_id resource_id , 
 
1915
                                                        MrmOffset *offset ));
 
1916
extern Cardinal UrmCWR__ValidateContext  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1917
                                                        String routine));
 
1918
extern Cardinal UrmCWR__BindArgPtrs  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1919
                                                    String routine , 
 
1920
                                                    Cardinal argndx , 
 
1921
                                                    RGMArgListDescPtr *descptr , 
 
1922
                                                    RGMArgumentPtr *argptr ));
 
1923
extern Cardinal UrmCWR__BindCallbackPtrs  _ARGUMENTS(( URMResourceContextPtr context_id , 
 
1924
                                                        String routine , 
 
1925
                                                        MrmOffset descoffs , 
 
1926
                                                        Cardinal itemndx , 
 
1927
                                                        RGMCallbackDescPtr *descptr , 
 
1928
                                                        RGMCallbackItemPtr *itmptr ));
 
1929
 
 
1930
/* mrmwread.c */
 
1931
extern Cardinal UrmHGetWidget  _ARGUMENTS(( MrmHierarchy hierarchy_id , 
 
1932
                                                String index , 
 
1933
                                                URMResourceContextPtr context_id , 
 
1934
                                                IDBFile *file_id_return ));
 
1935
extern Cardinal UrmGetIndexedWidget  _ARGUMENTS(( IDBFile file_id , 
 
1936
                                                    String index , 
 
1937
                                                    URMResourceContextPtr context_id ));
 
1938
extern Cardinal UrmGetRIDWidget  _ARGUMENTS(( IDBFile file_id , 
 
1939
                                                MrmResource_id resource_id , 
 
1940
                                                URMResourceContextPtr context_id ));
 
1941
 
 
1942
/* mrmwrefs.c */
 
1943
extern Cardinal Urm__CW_InitWRef  _ARGUMENTS(( URMResourceContextPtr *wref_id ));
 
1944
extern Cardinal Urm__CW_AddWRef  _ARGUMENTS(( URMResourceContextPtr wref_id , 
 
1945
                                                String w_name , 
 
1946
                                                Widget w_id ));
 
1947
extern Cardinal Urm__CW_FindWRef  _ARGUMENTS(( URMResourceContextPtr wref_id , 
 
1948
                                                String w_name , 
 
1949
                                                Widget *w_id_return ));
 
1950
extern void Urm__CW_AppendSVWidgetRef  _ARGUMENTS(( IDBFile file_id , 
 
1951
                                                    URMPointerListPtr *svlist , 
 
1952
                                                    String w_name , 
 
1953
                                                    MrmCode argtag , 
 
1954
                                                    String argname ));
 
1955
extern void Urm__CW_AppendCBSVWidgetRef _ARGUMENTS((IDBFile file_id, 
 
1956
                                                    URMPointerListPtr *svlist,
 
1957
                                                    RGMCallbackDescPtr cbptr, 
 
1958
                                                    MrmCode argtag, 
 
1959
                                                    String argname));
 
1960
extern void Urm__CW_UpdateSVWidgetRef  _ARGUMENTS(( URMPointerListPtr *svlist , 
 
1961
                                                    Widget cur_id ));
 
1962
extern void Urm__CW_ResolveSVWidgetRef  _ARGUMENTS(( URMPointerListPtr *svlist , 
 
1963
                                                    String cur_name , 
 
1964
                                                    Widget cur_id ));
 
1965
 
 
1966
extern void Urm__CW_FreeSetValuesDesc _ARGUMENTS((URMSetValuesDescPtr svdesc));
 
1967
     
 
1968
 
 
1969
/* mrmwvalues.c */
 
1970
extern Cardinal UrmFetchSetValues  _ARGUMENTS(( MrmHierarchy hierarchy_id , 
 
1971
                                                Widget w , 
 
1972
                                                ArgList args , 
 
1973
                                                Cardinal num_args ));
 
1974
 
 
1975
/* mrmwwrite.c */
 
1976
extern Cardinal UrmPutIndexedWidget  _ARGUMENTS(( IDBFile file_id , 
 
1977
                                                    String index , 
 
1978
                                                    URMResourceContextPtr context_id ));
 
1979
extern Cardinal UrmPutRIDWidget  _ARGUMENTS(( IDBFile file_id , 
 
1980
                                                MrmResource_id resource_id , 
 
1981
                                                URMResourceContextPtr context_id ));
 
1982
 
 
1983
/* mrmiswap.c */
 
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 ));
 
1990
 
 
1991
 
 
1992
 
 
1993
/*
 
1994
 * string copy macro
 
1995
 */
 
1996
 
 
1997
/* If the alignment characteristics of your machine are right, these may be
 
1998
   faster */
 
1999
 
 
2000
#ifdef UNALIGNED
 
2001
 
 
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));              \
 
2011
    else                                                    \
 
2012
        memmove((char *) (dst), (char *) (src), (int) (size));
 
2013
 
 
2014
#else
 
2015
 
 
2016
#define UrmBCopy(src, dst, size)                \
 
2017
        memmove((char *) (dst), (char *) (src), (int) (size));
 
2018
 
 
2019
#endif /* UNALIGNED */
 
2020
 
 
2021
/********    Conditionally defined macros for thread_safe DtTerm ******/
 
2022
#ifdef XTHREADS
 
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 */
 
2039
 
 
2040
#endif /* Mrm_H */
 
2041
/* DON'T ADD STUFF AFTER THIS #endif */