| version 1.12, 2003/03/10 22:13:03 |
version 1.13, 2003/03/13 19:11:05 |
|
|
| <!-- $Platon: libcfg+/doc/sgml/usage.options-set.sgml,v 1.11 2002/10/07 10:54:40 rajo Exp $ --> |
<!-- $Platon: libcfg+/doc/sgml/usage.options-set.sgml,v 1.12 2003/03/10 22:13:03 nepto Exp $ --> |
| |
|
| <!-- MAN: |
<!-- MAN: |
| <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ |
| Line 63 be <constant>NULL</constant>, what means |
|
| Line 63 be <constant>NULL</constant>, what means |
|
| Note that, any whitespace you will use in |
Note that, any whitespace you will use in |
| <structfield>cmdline_long_name</structfield> or |
<structfield>cmdline_long_name</structfield> or |
| <structfield>cfgfile_name</structfield> will match any non-zero amount of |
<structfield>cfgfile_name</structfield> will match any non-zero amount of |
| whitespaces during parsing. For example if separator is one space, also tab will |
whitespace during parsing. For example if separator is one space, also tab will |
| match, two or more spaces too, etc. This is feature for icreasing simplicity of |
match, two or more spaces too, etc. This feature is to simplify configuration of |
| your application confiration, because users must not pay attention to number of |
your application for your user, as she doesn't have to pay attention to number |
| spaces used in configurarion option. In example "debug level", "debug\tlevel" |
of spaces used in configurarion option. For example "debug level", "debug\tlevel" |
| and "debug \tlevel" will match the same configuration option. |
and "debug \tlevel" will match the same configuration option. |
| |
|
| </para> |
</para> |
| <para> |
<para> |
| |
|
| Next structure member <structfield>type</structfield> defines an option type |
Next structure member, <structfield>type</structfield>, defines an option type |
| with option type flags. They are summarized in the <xref |
with option type flags. They are summarized in tables <xref |
| linkend="usage.option-types.table" endterm="usage.option-types.table.title"> and |
linkend="usage.option-types.table" endterm="usage.option-types.table.title"> and |
| <xref linkend="usage.option-type-flags.table" |
<xref linkend="usage.option-type-flags.table" |
| endterm="usage.option-type-flags.table.title"> tables. |
endterm="usage.option-type-flags.table.title">. |
| |
|
| </para> |
</para> |
| <para> |
<para> |
| Line 84 endterm="usage.option-type-flags.table.t |
|
| Line 84 endterm="usage.option-type-flags.table.t |
|
| The <structfield>value</structfield> member tells the address where option |
The <structfield>value</structfield> member tells the address where option |
| argument or arguments will be stored. It should be address of appropriate |
argument or arguments will be stored. It should be address of appropriate |
| datatype defined in <structfield>type</structfield> field. Note that |
datatype defined in <structfield>type</structfield> field. Note that |
| <constant>NULL</constant> can be also used, but than option argument would not |
<constant>NULL</constant> can be also used, but then option argument will not |
| be stored. Last field in <structname>cfg_option</structname> structure is |
be stored. Last field of <structname>cfg_option</structname> structure is |
| <structfield>val</structfield>, which defines exit code from parsing functions |
<structfield>val</structfield>, which defines exit code from parsing functions |
| when option is found. <constant>0</constant> means not to return. It is good |
when option is found. <constant>0</constant> means no return. It is good |
| idea to keep these values positive to prevent mismatch with |
idea to keep these values positive to prevent mismatch with |
| <structname>cfg_error</structname> exit codes. |
<structname>cfg_error</structname> exit codes. |
| |
|
| Line 209 dynamically allocated using <function>ma |
|
| Line 209 dynamically allocated using <function>ma |
|
| (address) to this string is stored. In this case, don't forget to free allocated |
(address) to this string is stored. In this case, don't forget to free allocated |
| memory using <function>free()</function> function. When using |
memory using <function>free()</function> function. When using |
| <constant>CFG_MULTI_ARRAY</constant> or <constant>CFG_MULTI_SEPARATED</constant> |
<constant>CFG_MULTI_ARRAY</constant> or <constant>CFG_MULTI_SEPARATED</constant> |
| type flag, pointer to NULL terminated array of defined datatype is allways |
type flag, pointer to NULL terminated array of defined datatype is always |
| stored. This array can be freed using <function>strdyn_free()</function> |
stored. This array can be freed using <function>strdyn_free()</function> |
| function. |
function. |
| |
|
|
|
| <para> |
<para> |
| |
|
| One of the constants <constant>CFG_END_OPTION</constant> and |
One of the constants <constant>CFG_END_OPTION</constant> and |
| <constant>CFG_END_OF_LIST</constant> is used as a mark of end of options set. |
<constant>CFG_END_OF_LIST</constant> is used to mark end of an options set. |
| They have set all pointer values to <constant>NULL</constant> and all arithmetic |
They have set all pointer values to <constant>NULL</constant> and all arithmetic |
| values to <constant>0</constant>. |
values to <constant>0</constant>. |
| |
|