Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XrmOptionKind(3X11) — NEWS-os 4.1C

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XrmGetResource(3X11)

XrmMergeDatabases(3X11)

XrmPutResource(3X11)

XrmUniqueQuark(3X11)

XrmInitialize(3X11)  —  NEWS-OS Programmer’s Manual

名称

XrmInitialize, XrmParseCommand, XrmValue, XrmOptionKind, XrmOptionDescRec − リソースマネジャを初期化し、コマンド行をパーズする, リソースマネジャ構造体

形式

void XrmInitialize(); void XrmParseCommand(database, table, table_count, name, argc_in_out, argv_in_out,)
      XrmDatabase ∗database;
      XrmOptionDescList table;
      int table_count;
      char ∗name;
      int ∗argc_in_out;
      char ∗∗argv_in_out;

引数

argc_in_out引数の数を指定し、残りの引数の数を返します。

argv_in_outコマンド行 (command line) 引数を指すポインタを指定し、 残りの引数を返します。

databaseリソースデータベースを指すポインタを指定します。

nameアプリケーション名を指定します。

tableパーズするコマンド行 (command line) 引数のテーブルを指定します。

table_countテーブルのエントリ数を指定します。

解説

XrmInitialize 関数は、リソースマネージャを初期化します。 XrmParseCommand 関数は、指定されたオプションテーブルに従って (argc, argv) ペアを パーズし、認識されたオプションを指定されたデータベースに “String” タイプでロードし、 (argc, argv) ペアを変更し、認識されたすべての オプションを削除します。 指定されたテーブルを使用し、コマンド行をパーズします。 テーブルの認識されたエントリは argv から削除され、 指定されたリソースデータベースに入力されます。 テーブルエントリには、オプション文字列、オプション名、オプションの スタイルおよびオプションの種類が XrmoptionNoArg か否かを指定する情報が含まれます。 argc 引数は argv の引数の数を指定し、 パーズされなかった残りの引数の数に設定されます。 name 引数は、データベースエントリの構築にあたって使用するための アプリケーションの名前です。 name 引数は、指定をストアする前に、オプションテーブルの resourceName の前に付されます。 いかなる区切り文字も挿入されません。 テーブルには、各 resourceName エントリの最初の文字としてピリオド (.) またはアスタリスク (∗) がなければなりません。 完全修飾リソース名を指定するため、 resourceName エントリに複数の構成要素を含めることができます。

構造体

XrmValue, XrmOptionKind, XrmOptionDescRec の構造体を以下に示します。

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 ∗/
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 (sans application name)    ∗/
XrmOptionKind argKind;/∗ Which style of option it is      ∗/
caddr_t value;/∗ Value to provide if XrmoptionNoArg or
   XrmoptionSkipNArgs   ∗/
} XrmOptionDescRec, ∗XrmOptionDescList;

関連事項

XrmGetResource(3X11), XrmMergeDatabases(3X11), XrmPutResource(3X11), XrmUniqueQuark(3X11)
Xlib − C Language X Interface

NEWS-OSRelease 4.1C

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