|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 21930 (0x55aa) Types: TextFile Notes: UNIX file Names: »MrmPublic.h«
└─⟦d3dcb20dd⟧ Bits:30004636/disk4.imd INTERACTIVE Motif Environment Development System └─⟦d3dcb20dd⟧ UNIX Filesystem └─⟦this⟧ »xt/new/usr/include/Mrm/MrmPublic.h«
#ifdef REV_INFO #ifndef lint static char SCCSID[] = "OSF/Motif: @(#)MrmPublic.h 1.1 - 89/08/30 - 12:19:46"; #endif /* lint */ #endif /* REV_INFO */ /****************************************************************************** ******************************************************************************* * * (c) Copyright 1989, OPEN SOFTWARE FOUNDATION, INC. * (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. * ALL RIGHTS RESERVED * * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED * AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND * WITH THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR * ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE * AVAILABLE TO ANY OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE * SOFTWARE IS HEREBY TRANSFERRED. * * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT * NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY OPEN SOFTWARE * FOUNDATION, INC. OR ITS THIRD PARTY SUPPLIERS * * OPEN SOFTWARE FOUNDATION, INC. AND ITS THIRD PARTY SUPPLIERS, * ASSUME NO RESPONSIBILITY FOR THE USE OR INABILITY TO USE ANY OF ITS * SOFTWARE . OSF SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY * KIND, AND OSF EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES, INCLUDING * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE. * * Notice: Notwithstanding any other lease or license that may pertain to, * or accompany the delivery of, this computer software, the rights of the * Government regarding its use, reproduction and disclosure are as set * forth in Section 52.227-19 of the FARS Computer Software-Restricted * Rights clause. * * (c) Copyright 1989, Open Software Foundation, Inc. Unpublished - all * rights reserved under the Copyright laws of the United States. * * RESTRICTED RIGHTS NOTICE: Use, duplication, or disclosure by the * Government is subject to the restrictions as set forth in subparagraph * (c)(1)(ii) of the Rights in Technical Data and Computer Software clause * at DFARS 52.227-7013. * * Open Software Foundation, Inc. * 11 Cambridge Center * Cambridge, MA 02142 * (617)621-8700 * * RESTRICTED RIGHTS LEGEND: This computer software is submitted with * "restricted rights." Use, duplication or disclosure is subject to the * restrictions as set forth in NASA FAR SUP 18-52.227-79 (April 1985) * "Commercial Computer Software- Restricted Rights (April 1985)." Open * Software Foundation, Inc., 11 Cambridge Center, Cambridge, MA 02142. If * the contract contains the Clause at 18-52.227-74 "Rights in Data General" * then the "Alternate III" clause applies. * * (c) Copyright 1989, Open Software Foundation, Inc. * ALL RIGHTS RESERVED * * * Open Software Foundation is a trademark of The Open Software Foundation, Inc. * OSF is a trademark of Open Software Foundation, Inc. * OSF/Motif is a trademark of Open Software Foundation, Inc. * Motif is a trademark of Open Software Foundation, Inc. * DEC is a registered trademark of Digital Equipment Corporation * DIGITAL is a registered trademark of Digital Equipment Corporation * X Window System is a trademark of the Massachusetts Institute of Technology * ******************************************************************************* ******************************************************************************/ #ifndef MrmPublic #define MrmPublic /* * Success or other non-error return codes */ #define MrmSUCCESS 1 #define MrmCREATE_NEW 3 #define MrmINDEX_RETRY 5 /* Retry on entering index required */ #define MrmINDEX_GT 7 /* Index orders greater-than entry */ #define MrmINDEX_LT 9 /* Index orders less-than entry */ /* * Failure return codes */ #define MrmFAILURE 0 #define MrmNOT_FOUND 2 #define MrmEXISTS 4 #define MrmNUL_GROUP 6 #define MrmNUL_TYPE 8 #define MrmWRONG_GROUP 10 #define MrmWRONG_TYPE 12 #define MrmOUT_OF_RANGE 14 /* Record number too big */ #define MrmBAD_RECORD 16 /* Record number wrong type */ #define MrmNULL_DATA 18 /* No data for entry */ #define MrmBAD_DATA_INDEX 20 /* Data index in RID out of range */ #define MrmBAD_ORDER 22 /* Bad ordering specifier */ #define MrmBAD_CONTEXT 24 /* Invalid MRM context */ #define MrmNOT_VALID 26 /* Validation failure */ #define MrmBAD_B_TREE 28 /* GT/LT pointer error in BTree */ #define MrmBAD_WIDGET 30 /* Validation failure on widget record */ #define MrmBAD_CLASS 32 /* Class type not a valid MRMwc... value */ #define MrmNO_CLASS_NAME 34 /* User class name is null */ #define MrmTOO_MANY 36 /* Too many entries requested in some list */ #define MrmBAD_IF_MODULE 38 /* invalid interface module */ #define MrmNULL_DESC 40 /* Arglist or children descriptor null */ #define MrmOUT_OF_BOUNDS 42 /* Argument index out of arglist bounds */ #define MrmBAD_COMPRESS 44 /* Invalid compression code */ #define MrmBAD_ARG_TYPE 46 /* Invalid type, not in RGMrType... */ #define MrmNOT_IMP 48 /* Not yet implemented */ #define MrmNULL_INDEX 50 /* empty index string */ #define MrmBAD_KEY_TYPE 52 /* key must be MRMrIndex or MRMrRID */ #define MrmBAD_CALLBACK 54 /* Invalid callback descriptor */ #define MrmNULL_ROUTINE 56 /* Empty callback routine name string */ #define MrmVEC_TOO_BIG 58 /* too many elements in vector */ #define MrmBAD_HIERARCHY 60 /* invalid MRM file hierarchy */ #define MrmBAD_CLASS_CODE 62 /* Class code not found in MRMwc... */ /* * Resource classes and types */ #define MRMgNul 0 #define MRMgWidget 1 /* types in MRMwc... */ #define MRMgLiteral 2 /* types in RGMrType... */ #define MRMgResourceSet 3 /* type in MRMrs... */ /* 4 unused */ #define MRMgMessage 5 #define MRMgMin 1 /* lowest legal group value */ #define MRMgMax 5 /* highest legal group value */ #define MRMgVecSize MRMgMax+1 /* To size any vectors */ /* * The null resource type */ #define MRMtNul 0 /* * Access types */ #define MRMaPublic 1 #define MRMaPrivate 2 /* * Index types. Immediate is included for the convenience of the UIL compiler */ #define MRMrIndex 1 #define MRMrRID 2 #define MRMrImmediate 3 /* * Maximum number of characters in an index */ #define MRMMaxIndexLen 31 #define MRMMaxIndexLen1 (MRMMaxIndexLen + 1) /* to size vectors */ /* * File open access types */ #define MRMReadAccess 1 #define MRMWriteAccess 2 /* * Standard date string length */ #define MRMhsDate 29 /* any date string */ \f /* * Definitions associated with widget representations */ /* * Code for unknown (user-defined) classes. All Digital classes are * privately defined elsewhere. */ #define MRMwcUnknown 1 /* * The following define the representation type in widget arglist * arguments, i.e. specify the actual representation of values * in an argument. A subset of these is used to define literal types * for RGMgLiteral resources. */ #define RGMrTypeMin 1 #define RGMrTypeInteger 1 /* int */ #define RGMrTypeBoolean 2 #define RGMrTypeChar8 3 /* a nul-terminated string */ #define RGMrTypeChar8Vector 4 /* a vector of char_8 strings */ #define RGMrTypeCString 5 /* a compound string (DDIS) */ #define RGMrTypeCStringVector 6 /* a vector of compound strings */ #define RGMrTypeFloat 7 /* 8 = TypeCompressed now unused */ #define RGMrTypeCallback 9 /* code for a callback descriptor */ #define RGMrTypePixmapImage 10 /* Pixmap in image form */ #define RGMrTypePixmapDDIF 11 /* Pixmap in DDIF form */ #define RGMrTypeResource 12 /* MRM resource descriptor */ #define RGMrTypeNull 13 /* no value given */ #define RGMrTypeAddrName 14 /* nul-terminated string to be interpreted as runtime address */ #define RGMrTypeIconImage 15 /* UIL/DWICS/MRM icon image */ #define RGMrTypeFont 16 /* MRM font structure */ #define RGMrTypeFontList 17 /* MRM font list */ #define RGMrTypeColor 18 /* MRM color descriptor */ #define RGMrTypeColorTable 19 /* MRM color table */ #define RGMrTypeAny 20 /* Any is allowed in UID file */ #define RGMrTypeTransTable 21 /* Translation table (ASCIZ string) */ #define RGMrTypeClassRecName 22 /* class record name (ASCIZ string) */ #define RGMrTypeIntegerVector 23 /* a vector of integers */ #define RGMrTypeXBitmapFile 24 /* X bitmap file to make pixmap with */ #define RGMrTypeCountedVector 25 /* vector with associated count */ #define RGMrTypeMax 25 /* * Types of resource sets. */ #define MRMrsInterfaceModule 1 /* Interface module */ \f /* * MRM typedefs */ /* * MRM primitive types */ typedef short int MrmCode ; /* Used for codes, e.g. MRMcr... */ typedef char MrmSCode ; /* Short code for small ranges */ typedef short int MrmOffset ; /* Used for offsets in records */ typedef short int MrmType ; /* Used for types, e.g. MRMrType... */ typedef short int MrmSize ; /* For size fields */ typedef short int MrmCount ; /* For counter fields */ typedef unsigned char MrmFlag ; /* flag fields */ typedef long int MrmResource_id ; /* Resource id in IDB files */ typedef short int MrmGroup ; /* For MRM resource groups */ \f /* * MRM Resource context * * The following context structure is provided by MRM to cover all memory * management of in-memory resources. This mechanism provides: * o improved memory management efficiency through buffer re-use * o collection of resource attributes in one place * o support for non-standard allocation routines */ #define MRMResourceContextValid 232570204 typedef struct { unsigned validation ; /* validation code = MRMResourceContextValid */ char *data_buffer ; /* pointer to data buffer in memory */ MrmSize buffer_size ; /* number of bytes in buffer */ MrmSize resource_size ; /* number of bytes used by resource */ MrmGroup group ; /* resource group */ MrmType type ; /* resource type */ MrmCode access ; /* MRMaPrivate or MRMaPublic */ MrmCode lock ; /* resource locking code */ char *((*alloc_func) ()) ; /* memory allocation func */ void (*free_func) () ; /* deallocation func */ } MRMResourceContext, *MRMResourceContextPtr ; /* * Validation macro, returns TRUE/FALSE */ #define XmMrmRCValid(context) ((context)->validation==MRMResourceContextValid) /* * The following are accessor macros for a resource context */ #define MrmRCBuffer(context) ((context)->data_buffer) #define XmMrmRCBufSize(context) ((context)->buffer_size) #define MrmRCSize(context) ((context)->resource_size) #define XmMrmRCGroup(context) ((context)->group) #define MrmRCType(context) ((context)->type) #define XmMrmRCAccess(context) ((context)->access) #define XmMrmRCLock(context) ((context)->lock) /* * The following are modifiers for a resource context */ #define XmMrmRCSetSize(context,sizval) {(context)->resource_size=(sizval);} #define XmMrmRCSetGroup(context,grpval) {(context)->group=(grpval);} #define MrmRCSetType(context,typval) {(context)->type=(typval);} #define XmMrmRCSetAccess(context,accval) {(context)->access=(accval);} #define XmMrmRCSetLock(context,lckval) {(context)->lock=(lckval);} /* * Error reporting states */ #define MRMRCErrorDefault 1 /* default - report on line */ #define MRMRCErrorSave 2 /* save error, don't report */ /* * Error reporting destinations */ #define MRMErrOutMemory 1 /* Save error messages in memory, no print */ #define MRMErrOutStdout 2 /* print error messages to stdout */ \f /* * IDB definitions in common use. The principal one is IDBFile; others * are included to make that definition valid. */ /* * Record type definitions - IDBrt... */ #define IDBrtMin 1 #define IDBrtHeader 1 #define IDBrtIndexLeaf 2 #define IDBrtIndexNode 3 #define IDBrtRIDMap 4 #define IDBrtData 5 #define IDBrtMax 5 #define IDBrtVecSize 6 /* * Sizes of fixed-length strings in the file header. Definitions are * provided for both the number of characters in the string and the * constant which gives the string length including the terminating nul. * IDBhs... */ #define IDBhsVersion 9 /* Any version string */ #define IDBhsVersion1 (IDBhsVersion + 1) #define IDBhsCreator 29 /* Creator id */ #define IDBhsCreator1 (IDBhsCreator + 1) #define IDBhsDate MRMhsDate /* Any date string */ #define IDBhsDate1 (IDBhsDate + 1) #define IDBhsModule 29 /* Module id */ #define IDBhsModule1 (IDBhsModule + 1) /* * Record number. 65k should be enough... */ typedef short int IDBRecordNumber ; /* * A resource ID consists of the resource map index and the ID index * in the given resource map. */ typedef short int IDBResourceIndex ; typedef union { unsigned external_id ; /* Looks like a fullword */ struct { IDBResourceIndex map_index ; /* resource map index */ IDBResourceIndex res_index ; /* resource index into map */ } internal_id ; /* 2 fields internally */ } IDBridDesc ; /* * A resource ID passed by value in a fullword. */ typedef unsigned IDBResource ; /* a declaration for RIDs passed by value */ \f /* * IDB open file information * * The following is the information retained by IDB for an open file. * Much of this information matches that found in the file header, * and is the source of for that info when the header is updated. */ #define IDBOpenFileValid 421642674 typedef struct { unsigned validation ; /* validation code = IDBOpenFileValid */ int get_count ; /* # get operations on file */ int put_count ; /* # put operations on file */ MrmCode access ; /* MRMReadAccess or MRMWriteAccess */ unsigned int lowlevel_id ; /* open file id returned by low-level routines */ IDBRecordNumber index_root ; /* index root pointer */ MrmCount num_indexed ; /* # entries in index */ MrmCount num_RID ; /* # RID entries in file */ IDBridDesc next_RID ; /* next available RID */ IDBRecordNumber last_record ; /* last record used in file */ IDBRecordNumber last_data_record ; /* last data record in file. NULL if no records yet */ MrmCount RID_maps_count ; /* number of entry in RID_maps vector */ IDBRecordNumber *RID_maps ; /* Pointer to vector of RID index map records */ MrmCount group_counts[MRMgVecSize] ; /* vector of record counts by resource group */ MrmCount rt_counts[IDBrtVecSize] ; /* vector of record counts by record type (statistics) */ unsigned long timer ; /* for statistics */ char db_version[IDBhsVersion1] ; /* database version */ char creator[IDBhsCreator1] ; /* creator id */ char creator_version[IDBhsVersion1] ; /* creator version */ char creation_date[IDBhsDate1] ; /* creation date */ char module[IDBhsModule1] ; /* module id */ char module_version[IDBhsVersion1] ; /* module version */ int user1 ; /* for caller use */ int user2 ; /* for caller use */ } IDBOpenFile, *IDBFile ; \f /* * Operating System specific parameter struct. Passed to low level * file OPEN. */ #define MrmOsOpenParamVersion 1 typedef struct { /* * The version of this structure. Set to MrmOsOpenParamVersion */ Cardinal version; /* * The default name, to be placed in FAB$L_DNA for RMS use. */ char *default_fname; /* * The related name, to be placed in NAM$L_RLF for RMS use. * Flag for file clobber (1 means OK to clobber) */ union { unsigned long related_nam; Boolean clobber_flg; } nam_flg; } MrmOsOpenParam, *MrmOsOpenParamPtr ; \f /* * Open hierarchy struct * * The following structure represents an open Mrm.hierarchy. A hierarchy * is principally a list of open IDB files in search order. As an aid to * efficient searching, a list of files by resource group is also kept. * Each entry in the list is the subset of the files in the hierarchy * which contains resources in the corresponding group. */ #define MrmHIERARCHY_VALID 102214835 typedef struct { unsigned validation ; /* MrmHierarchyValid */ MrmCount num_file ; /* number of files open */ IDBFile *file_list ; /* list of open files */ MrmCount grp_num[MRMgVecSize] ; /* vector of file counts by resource group */ IDBFile *grp_ids[MRMgVecSize] ; /* vectors of file ids by resource group */ } MrmHierarchyDesc, *MrmHierarchy ; /* * Validation macro */ #define MrmHierarchyValid(hierarchy) \ ((hierarchy)->validation==MrmHIERARCHY_VALID) \f /* * Structure used to pass name/value pairs to DwtRegisterMRMNames */ typedef struct { String name ; /* case-sensitive name */ caddr_t value ; /* value/address associated with name */ } MRMRegisterArg, *MrmRegisterArglist ; \f /* * RGM widget record text vector item (text vector literal) * * The following represents vectors of either ASCIZ or compound strings. * each member of the vector is type-tagged so that mixed vectors are possible. * This descriptor is a union so that a vector of these items can be over- * written to become an in-memory list of pointers. This avoids some * allocation problems at widget instantiation. Char8 items are String, * CString items are DwtCompString. * * Offsets are interpreted as follows: * text vector as immediate in widget record - offset from beginning * of record buffer. * text vector as UID literal - offset from beginning of resource buffer */ typedef union { caddr_t pointer ; /* for use as memory pointer */ struct { MrmType rep_type ; /* RGMrTypeChar8 or RGMrTypeCString */ MrmOffset offset ; /* offset of item in record */ } text_item ; /* for use as item type & offset */ } RGMTextEntry, *RGMTextEntryPtr ; /* * The text Vector. This is designed to allow the vector of text entries * to be over-written into an in-memory vector of pointers. Thus this list * has one extra entry to provide a terminating null. */ #define MRMTextVectorValid 34966592 typedef struct { unsigned validation ; /* MRMTextVectorValid */ MrmCount count ; /* Number of text items in vector */ RGMTextEntry item[1] ; /* first text item in a vector of n = .count+1 items. item[.count] always = NULL */ } RGMTextVector, *RGMTextVectorPtr ; /* * The integer Vector. This is designed to allow the vector of integers * to be over-written into an in-memory vector of pointers. Thus this list * has one extra entry to provide a terminating null. */ #define MRMIntegerVectorValid 34966593 typedef struct { unsigned validation ; /* MRMIntegerVectorValid */ MrmCount count ; /* Number of integer items in vector */ int item[1] ; /* first integer item in a vector */ /* of n = .count+1 items. */ /* item[.count] always = NULL */ } RGMIntegerVector, *RGMIntegerVectorPtr ; /*********** What used to be in URMPublic.h ************/ /* * Resource classes and types */ #define URMgNul MRMgNul #define URMgWidget MRMgWidget #define URMgLiteral MRMgLiteral #define URMgResourceSet MRMgResourceSet #define URMgMessage MRMgMessage #define URMgMin MRMgMin #define URMgMax MRMgMax #define URMgVecSize MRMgVecSize /* * The null resource type */ #define URMtNul MRMtNul /* * Access types */ #define URMaPublic MRMaPublic #define URMaPrivate MRMaPrivate /* * Index types. Immediate is included for the convenience of the UIL compiler */ #define URMrIndex MRMrIndex #define URMrRID MRMrRID #define URMrImmediate MRMrImmediate /* * Maximum number of characters in an index */ #define URMMaxIndexLen MRMMaxIndexLen #define URMMaxIndexLen1 MRMMaxIndexLen1 /* * File open access types */ #define URMReadAccess MRMReadAccess #define URMWriteAccess MRMWriteAccess /* * Standard date string length */ #define URMhsDate MRMhsDate /* * Code for unknown (user-defined) classes. */ #define URMwcUnknown MRMwcUnknown /* * Types of resource sets. */ #define URMrsInterfaceModule MRMrsInterfaceModule /* * URM Resource context * * The following context structure is provided by URM to cover all memory * management of in-memory resources. This mechanism provides: * o improved memory management efficiency through buffer re-use * o collection of resource attributes in one place * o support for non-standard allocation routines */ #define URMResourceContextValid MRMResourceContextValid #define URMResourceContext MRMResourceContext #define URMResourceContextPtr MRMResourceContextPtr /* * Validation macro, returns TRUE/FALSE */ #define UrmRCValid(context) ((context)->validation==URMResourceContextValid) /* * The following are accessor macros for a resource context */ #define UrmRCBuffer(context) ((context)->data_buffer) #define UrmRCBufSize(context) ((context)->buffer_size) #define UrmRCSize(context) ((context)->resource_size) #define UrmRCGroup(context) ((context)->group) #define UrmRCType(context) ((context)->type) #define UrmRCAccess(context) ((context)->access) #define UrmRCLock(context) ((context)->lock) /* * The following are modifiers for a resource context */ #define UrmRCSetSize(context,sizval) {(context)->resource_size=(sizval);} #define UrmRCSetGroup(context,grpval) {(context)->group=(grpval);} #define UrmRCSetType(context,typval) {(context)->type=(typval);} #define UrmRCSetAccess(context,accval) {(context)->access=(accval);} #define UrmRCSetLock(context,lckval) {(context)->lock=(lckval);} /* * Error reporting states */ #define URMRCErrorDefault MRMRCErrorDefault #define URMRCErrorSave MRMRCErrorSave /* * Error reporting destinations */ #define URMErrOutMemory MRMErrOutMemory #define URMErrOutStdout MRMErrOutStdout \f /* * Open hierarchy struct * * is principally a list of open IDB files in search order. As an aid to * efficient searching, a list of files by resource group is also kept. * Each entry in the list is the subset of the files in the hierarchy * which contains resources in the corresponding group. */ #define URMRegisterArg MRMRegisterArg #define URMTextVectorValid MRMTextVectorValid #define URMIntegerVectorValid MRMIntegerVectorValid /* * Declarations of MRM public entry points */ #include <Mrm/MrmDecls.h> #endif /* MrmPublic */ /* DON'T ADD STUFF AFTER THIS #endif */