home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xrmparsecommand.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  5.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4. XrmInitialize(3X11)      XLIB FUNCTIONS      XrmInitialize(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XrmInitialize, XrmParseCommand, XrmValue, XrmOptionKind,
  9.        XrmOptionDescRec - initialize the Resource Manager,
  10.        Resource Manager structures, and parse the command line
  11.  
  12. SSYYNNTTAAXX
  13.        void XrmInitialize();
  14.  
  15.        void XrmParseCommand(_d_a_t_a_b_a_s_e, _t_a_b_l_e, _t_a_b_l_e___c_o_u_n_t, _n_a_m_e,
  16.        _a_r_g_c___i_n___o_u_t, _a_r_g_v___i_n___o_u_t)
  17.          XrmDatabase *_d_a_t_a_b_a_s_e;
  18.          XrmOptionDescList _t_a_b_l_e;
  19.          int _t_a_b_l_e___c_o_u_n_t;
  20.          char *_n_a_m_e;
  21.          int *_a_r_g_c___i_n___o_u_t;
  22.          char **_a_r_g_v___i_n___o_u_t;
  23.  
  24. AARRGGUUMMEENNTTSS
  25.        _a_r_g_c___i_n___o_u_t
  26.          Specifies the number of arguments and returns
  27.          the number of remaining arguments.
  28.  
  29.        _a_r_g_v___i_n___o_u_t
  30.          Specifies the command line arguments and returns
  31.          the remaining arguments.
  32.  
  33.        _d_a_t_a_b_a_s_e     Specifies the resource database.
  34.  
  35.        _n_a_m_e     Specifies the application name.
  36.  
  37.        _t_a_b_l_e     Specifies the table of command line arguments to
  38.          be parsed.
  39.  
  40.        _t_a_b_l_e___c_o_u_n_t
  41.          Specifies the number of entries in the table.
  42.  
  43. DDEESSCCRRIIPPTTIIOONN
  44.        The _X_r_m_I_n_i_t_i_a_l_i_z_e function initialize the resource man-
  45.        ager.  It must be called before any other Xrm functions
  46.        are used.
  47.  
  48.        The _X_r_m_P_a_r_s_e_C_o_m_m_a_n_d function parses an (argc, argv) pair
  49.        according to the specified option table, loads recognized
  50.        options into the specified database with type ``String,''
  51.        and modifies the (argc, argv) pair to remove all recog-
  52.        nized options.  If database contains NULL, _X_r_m_P_a_r_s_e_C_o_m_m_a_n_d
  53.        creates a new database and returns a pointer to it.  Oth-
  54.        erwise, entries are added to the database specified.  If a
  55.        database is created, it is created in the current locale.
  56.  
  57.        The specified table is used to parse the command line.
  58.        Recognized options in the table are removed from argv, and
  59.        entries are added to the specified resource database in
  60.        the order they occur in argv.  The table entries contain
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XrmInitialize(3X11)      XLIB FUNCTIONS      XrmInitialize(3X11)
  71.  
  72.  
  73.        information on the option string, the option name, the
  74.        style of option, and a value to provide if the option kind
  75.        is _X_r_m_o_p_t_i_o_n_N_o_A_r_g.  The option names are compared byte-
  76.        for-byte to arguments in argv, independent of any locale.
  77.        The resource values given in the table are stored in the
  78.        resource database without modification.    All resource
  79.        database entries are created using a ``String'' represen-
  80.        tation type.  The argc argument specifies the number of
  81.        arguments in argv and is set on return to the remaining
  82.        number of arguments that were not parsed.  The name argu-
  83.        ment should be the name of your application for use in
  84.        building the database entry.  The name argument is pre-
  85.        fixed to the resourceName in the option table before stor-
  86.        ing a database entry.  The name argument is treated as a
  87.        single component, even if it has embedded periods.  No
  88.        separating (binding) character is inserted, so the table
  89.        must contain either a period (.) or an asterisk (*) as the
  90.        first character in each resourceName entry.  To specify a
  91.        more completely qualified resource name, the resourceName
  92.        entry can contain multiple components.  If the name argu-
  93.        ment and the resourceNames are not in the Host Portable
  94.        Character Encoding, the result is implementation-
  95.        dependent.
  96.  
  97. SSTTRRUUCCTTUURREESS
  98.        The _X_r_m_V_a_l_u_e, _X_r_m_O_p_t_i_o_n_K_i_n_d, and _X_r_m_O_p_t_i_o_n_D_e_s_c_R_e_c struc-
  99.        tures contain:
  100.  
  101.        typedef struct {
  102.         unsigned int size;
  103.         XPointer addr;
  104.        } XrmValue, *XrmValuePtr;
  105.  
  106.        typedef enum {
  107.         XrmoptionNoArg,    /* Value is specified in XrmOptionDescRec.value */
  108.         XrmoptionIsArg,    /* Value is the option string itself */
  109.         XrmoptionStickyArg, /* Value is characters immediately following option */
  110.         XrmoptionSepArg,    /* Value is next argument in argv */
  111.         XrmoptionResArg,    /* Resource and value in next argument in argv */
  112.         XrmoptionSkipArg,    /* Ignore this option and the next argument in argv */
  113.         XrmoptionSkipLine,    /* Ignore this option and the rest of argv */
  114.         XrmoptionSkipNArgs    /* Ignore this option and the next
  115.                    XrmOptionDescRec.value arguments in argv */
  116.        } XrmOptionKind;
  117.  
  118.        typedef struct {
  119.         char *option;    /* Option specification string in argv      */
  120.         char *specifier;    /* Binding and resource name (sans application name)    */
  121.         XrmOptionKind argKind;/* Which style of option it is    */
  122.         XPointer value;    /* Value to provide if XrmoptionNoArg or
  123.                    XrmoptionSkipNArgs    */
  124.        } XrmOptionDescRec, *XrmOptionDescList;
  125.  
  126.  
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XrmInitialize(3X11)      XLIB FUNCTIONS      XrmInitialize(3X11)
  137.  
  138.  
  139. SSEEEE AALLSSOO
  140.        XrmGetResource(3X11), XrmMergeDatabases(3X11), XrmPutRe-
  141.        source(3X11), XrmUniqueQuark(3X11)
  142.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.