| version 1.2, 2002/05/20 16:10:24 |
version 1.3, 2002/05/21 15:37:22 |
|
|
| <title id="usage.special-properties.title">Special properties</title> |
<title id="usage.special-properties.title">Special properties</title> |
| <para> |
<para> |
| |
|
| no content |
In this chapter are functions for manipulating with special &name; properties |
| |
described. They all use the same function synopsis as other API functions |
| |
mentioned in previous chapters. This chapter starts with functions, which affect |
| |
command line and configuration file special properties in one call. Chapter |
| |
continues with command line related functions and at the end are configuration |
| |
file related functions described. |
| |
|
| </para> |
</para> |
| </sect1> |
<para> |
| |
|
| |
For changing multi values separators use these functions. Affects both, command |
| |
line and configuration file. Multi values separators are strings used for |
| |
separation option values initialized with one argument. Option must have |
| |
<constant>CFG_MULTI_SEPARATED</constant> flag set. By default are space, |
| |
<constant>,</constant> and <constant>;</constant> initialized. |
| |
|
| |
<funcsynopsis> |
| |
<!-- <funcsynopsisinfo><![CDATA[#include <cfg+.h>]]></funcsynopsisinfo> --> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing option argument separator use these functions. Affects both, |
| |
command line and configuration file. Option argument separators are strings used |
| |
to separate option and its argument. By default is <constant>=</constant> |
| |
character used for both, command line and config file. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
Following functions are used for changing quoting prefix and postfix. They |
| |
affect both, command line and configuration file. By default are quotes |
| |
(<constant>"</constant> with <constant>"</constant>) and apostrophes |
| |
(<constant>'</constant> with <constant>'</constant>) initialized. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_quote_strings</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_quote_strings</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>prefix</parameter></paramdef> |
| |
<paramdef>char *<parameter>postfix</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_quote_strings</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>prefix</parameter></paramdef> |
| |
<paramdef>char *<parameter>postfix</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
|
| |
<sect2 id="usage.special-properties.cmdline"> |
| |
<title id="usage.special-properties.cmdline.title">Command line related</title> |
| |
<para> |
| |
|
| |
On following line are described functions, which affect only special properties |
| |
related to command line. |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
For changing command line stop string use these functions. Set this property if |
| |
you want to stop parsing on specified string which occurs on command line. Error |
| |
code <constant>CFG_ERROR_STOP_STR_FOUND</constant> is returned from parsing |
| |
function to determine this event. By default is <constant>--</constant> |
| |
initialized. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cmdline_stop_string</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cmdline_stop_string</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cmdline_stop_string</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing command line short option prefix use these functions. Default value |
| |
is of course single dash (<constant>-</constant>), because it is most offten |
| |
used in applications. You will probably don't need to redefine this property. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cmdline_short_option_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cmdline_short_option_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cmdline_short_option_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing command line long option prefix use these functions. Default value |
| |
is of course double dash (<constant>--</constant>), because it is most offten |
| |
used in applications. You will probably don't need to redefine this property. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cmdline_long_option_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cmdline_long_option_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cmdline_long_option_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing command line multi values separators use these functions. Multi |
| |
values separators are strings used for separation option values initialized with |
| |
one argument. For example if separator is comma, one command line argument will |
| |
be similar to this: <command>--multi=val1,val2,val3</command>. Option must have |
| |
<constant>CFG_MULTI_SEPARATED</constant> flag set. By default are space, |
| |
<constant>,</constant> and <constant>;</constant> initialized. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cmdline_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cmdline_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cmdline_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing command line option argument separator use these functions. Option |
| |
argument separators are strings used to separate option and its argument. By |
| |
default is <constant>=</constant> character used. For example |
| |
<command>--option=argument</command>. Note that on command line argument can be |
| |
initialized also as following string with no need of separator usage (like this: |
| |
<command>--option argument</command>). |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cmdline_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cmdline_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cmdline_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
|
| |
</sect2> |
| |
|
| |
<sect2 id="usage.special-properties.cfgfile"> |
| |
<title id="usage.special-properties.cfgfile.title">Configuration file related</title> |
| |
<para> |
| |
|
| |
On following line are described functions, which affect only special properties |
| |
related to configuration file. |
| |
|
| |
</para> |
| |
<para> |
| |
|
| |
For changing configuration file stop string use these functions. Set this |
| |
property if you want to stop parsing on specified string which occurs on |
| |
configration file line. Error code <constant>CFG_ERROR_STOP_STR_FOUND</constant> |
| |
is returned from parsing function to determine this event. By default is |
| |
<constant>[</constant> initialized (to stop parsing on section header). |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cfgfile_stop_string</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cfgfile_stop_string</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cfgfile_stop_string</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing configuration comment prefix use these functions. Lines started |
| |
with one of these prefixes are skipped. By default are <constant>#</constant>, |
| |
<constant>;</constant> and <constant>//</constant> initialized. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cfgfile_comment_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cfgfile_comment_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cfgfile_comment_prefix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing configuration file multi line postfix use these functions. Multi |
| |
line postfixes are strings used to determine situation, that line continues on |
| |
next line. Multi lines are are concatenated to one and that is parsed. Multui |
| |
line postfixes are removed from concatenated line. By deault is backslash |
| |
(<constant>\</constant>) initialized. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cfgfile_multi_line_postfix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cfgfile_multi_line_postfix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cfgfile_multi_line_postfix</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing configuration file multi values separators use these functions. |
| |
Multi values separators are strings used for separation option values |
| |
initialized with one argument. For example if separator is comma one line in |
| |
configuration fill will be similar to this: <command>multi = |
| |
val1,val2,val2</command>. Option must have |
| |
<constant>CFG_MULTI_SEPARATED</constant> flag set. By default are space, |
| |
<constant>,</constant> and <constant>;</constant> initialized. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cfgfile_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cfgfile_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cfgfile_multi_vals_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
<para> |
| |
|
| |
For changing configuration file option argument separator use these functions. |
| |
Option argument separators are strings used to separate option and its argument. |
| |
By default is <constant>=</constant> character used. For example <command>option |
| |
= argument</command>. |
| |
|
| |
<funcsynopsis> |
| |
<funcprototype> |
| |
<funcdef>void <function>cfg_clear_cfgfile_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_add_cfgfile_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
<funcprototype> |
| |
<funcdef>int <function>cfg_remove_cfgfile_option_arg_separator</function></funcdef> |
| |
<paramdef>CFG_CONTEXT <parameter>con</parameter></paramdef> |
| |
<paramdef>char *<parameter>str</parameter></paramdef> |
| |
</funcprototype> |
| |
</funcsynopsis> |
| |
</para> |
| |
|
| |
</sect2> |
| |
|
| |
</sect1> |
| |
|