Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XrmGetResource(3X)

XrmMergeDatabases(3X)

XrmPutResource(3X)

XrmUniqueQuark(3X)




XrmInitialize(3X) XrmInitialize(3X)
NAME XrmInitialize, XrmParseCommand - initialize the Resource Manager, parse the command line, and manipulate the XrmValue, XrmOptionKind and XrmOptionDescRec structures SYNOPSIS void XrmInitialize (); void XrmParseCommand (db, table, table-count, name, argc-return, argv-return) XrmDatabase* db; XrmOptionDescList table; int table-count; char* name; int* argc-return; char** argv-return; DESCRIPTION The XrmInitialize function initializes the Resource Manager. The XrmParseCommand function parses an (arc, argv) pair ac- cording to the specified option table, loads recognized op- tions into the specified database with type ``String'', and modifies the (arc, argv) pair to remove all recognized op- tions. The specified table is used to parse the command line. Recognized entries in the table are removed from argv, and entries are made in the specified resource database. The table entries contain information on the option string, the option name, the style of option, and a value to provide if the option kind is XrmoptionNoArg. The argc argument specifies the number of arguments in argv and is set to the remaining number of ar- guments that are not parsed. The name argument should be the name of your application for use in building the data- base entry. The name argument is prefixed to the resour- ceName in the option table before storing the specification. No separating (binding) character is inserted. The table must contain either a period (.) or an asterisk (*) as the first character in each resourceName entry. To specify a more completely qualified resource name, the resourceName entry can contain multiple components. Arguments These functions accept the following arguments: argc-return Before the call, this argument contains the number of arguments. After the call, this argument con- tains the number of remaining arguments. November, 1990 1



XrmInitialize(3X) XrmInitialize(3X)
argv-return Before the call, this argument points to the command line arguments. After the call, this argument points to the remaining arguments. db Specifies a pointer to the resource database. If db is null, a new resource database is created and db points to the new database. name Specifies the application name. table Specifies the table of command line arguments to be parsed. table-count Specifies the number of entries in the table. Structures The XrmValue, XrmOptionKind, and XrmOptionDescRec structures are defined as follows. typedef struct { unsigned int size; caddr_t addr; } XrmValue, *XrmValuePtr; typedef enum { XrmoptionNoArg, /* Value is specified in */ /* XrmOptionDescRec.value */ XrmoptionIsArg, /* Value is the option */ /* string itself */ XrmoptionStickyArg, /* Value is characters */ /* immediately following */ /* option */ XrmoptionSepArg, /* Value is next */ /* argument in argv */ XrmoptionResArg, /* Resource and value */ /* in next argument in argv */ XrmoptionSkipArg, /* Ignore this option and */ /* the next argument in argv */ XrmoptionSkipLine, /* Ignore this option and */ /* the rest of argv */ XrmoptionSkipNArgs /* Ignore this option and */ /* the next */ /* XrmOptionDescRec.value */ /* arguments in argv */ } XrmOptionKind; typedef struct { char *option; /* Option specification */ /* string in argv */ char *specifier; /* Binding and resource name */ 2 November, 1990



XrmInitialize(3X) XrmInitialize(3X)
/* (sans application name) */ XrmOptionKind argKind; /* Which style of option */ /* it is */ caddr_t value; /* Value to provide if */ /* XrmoptionNoArg or */ /* XrmoptionSkipNArgs */ } XrmOptionDescRec, *XrmOptionDescList; SEE ALSO XrmGetResource(3X), XrmMergeDatabases(3X), XrmPutResource(3X), XrmUniqueQuark(3X)
Xlib - C Language Interface
November, 1990 3

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026