| verzia 1.51, 2002/09/03 19:53:03 |
verzia 1.52, 2002/09/05 19:08:25 |
|
|
| * ____________________________________________________________ |
* ____________________________________________________________ |
| * |
* |
| * Developed by Ondrej Jombik <nepto@pobox.sk> |
* Developed by Ondrej Jombik <nepto@pobox.sk> |
| * and Lubomir Host <rajo@host.sk> |
* and Lubomir Host <rajo@host.sk> |
| * Copyright (c) 2001-2002 Platon SDG, http://www.platon.sk/ |
* Copyright (c) 2001-2002 Platon SDG, http://www.platon.sk/ |
| * All rights reserved. |
* All rights reserved. |
| * |
* |
| Riadok 237 enum cfg_option_type { /* {{{ */ |
|
| Riadok 237 enum cfg_option_type { /* {{{ */ |
|
| }; /* }}} */ /*@}*/ |
}; /* }}} */ /*@}*/ |
| |
|
| /** |
/** |
| * @name Special properties types |
* @name Property types |
| */ |
*/ |
| /*@{*/ |
/*@{*/ |
| enum cfg_property_type { /* {{{ */ |
enum cfg_property_type { /* {{{ */ |
| |
|
| /** |
/** |
| * @name Special properties codes |
* @name Property codes |
| */ |
*/ |
| /*@{*/ |
/*@{*/ |
| |
|
| /** Array of strings which forces to stop command line parsing. */ |
/** Array of strings which forces to stop command line parsing. |
| |
By default it is empty. */ |
| CFG_LINE_STOP_STRING = 0, |
CFG_LINE_STOP_STRING = 0, |
| |
|
| /** Command line short option prefix (default: "-") */ |
/** Command line short option prefix. |
| |
By default is "-" initilized. */ |
| CFG_LINE_SHORT_OPTION_PREFIX = 1, |
CFG_LINE_SHORT_OPTION_PREFIX = 1, |
| |
|
| /** Command line long option prefix (default: "--") */ |
/** Command line long option prefix. |
| |
By default is "--" iitialized. */ |
| CFG_LINE_LONG_OPTION_PREFIX = 2, |
CFG_LINE_LONG_OPTION_PREFIX = 2, |
| |
|
| /** Command line option argument separator (default: "=") */ |
/** Command line option argument separator. |
| |
By default is "=" initialized. */ |
| CFG_LINE_OPTION_ARG_SEPARATOR = 3, |
CFG_LINE_OPTION_ARG_SEPARATOR = 3, |
| |
|
| /** Command line multi values separator. */ |
/** Command line multi values separator. |
| |
By default are "," and ";" initialized. */ |
| CFG_LINE_NORMAL_MULTI_VALS_SEPARATOR = 4, |
CFG_LINE_NORMAL_MULTI_VALS_SEPARATOR = 4, |
| |
|
| /** Command line multi values leftover arguments separator */ |
/** Command line multi values leftover arguments separator. |
| |
By default it is empty. */ |
| CFG_LINE_LEFTOVER_MULTI_VALS_SEPARATOR = 5, |
CFG_LINE_LEFTOVER_MULTI_VALS_SEPARATOR = 5, |
| |
|
| /** Command line quote prefix & postfix */ |
/** Command line quote prefix & postfix. |
| |
By default are apostrophes (') and quotations (") initlized for both.*/ |
| CFG_LINE_QUOTE_PREFIX = 6, |
CFG_LINE_QUOTE_PREFIX = 6, |
| CFG_LINE_QUOTE_POSTFIX = 7, |
CFG_LINE_QUOTE_POSTFIX = 7, |
| |
|
| /** Array of strings prefixes which forces to stop config file parsing. |
/** Array of strings prefixes which forces to stop config file parsing. |
| * default: "[" |
By default it is empty. */ |
| */ |
|
| CFG_FILE_STOP_PREFIX = 8, |
CFG_FILE_STOP_PREFIX = 8, |
| |
|
| /** Array of string prefixes which mark comment line. |
/** Array of string prefixes which mark comment line. |
| * defaults: "#", ";" |
By default are "#" and ";" initialized. */ |
| */ |
|
| CFG_FILE_COMMENT_PREFIX = 9, |
CFG_FILE_COMMENT_PREFIX = 9, |
| |
|
| /** Array of string postfixes to determine multi lines. */ |
/** Array of string postfixes to determine multi lines. |
| |
By default is "\\" initialized. */ |
| CFG_FILE_MULTI_LINE_POSTFIX = 10, |
CFG_FILE_MULTI_LINE_POSTFIX = 10, |
| |
|
| /** Config file option argument separator (default: "=") */ |
/** Config file option argument separator. |
| |
By default is "=" initialized. */ |
| CFG_FILE_OPTION_ARG_SEPARATOR = 11, |
CFG_FILE_OPTION_ARG_SEPARATOR = 11, |
| |
|
| /** Config file multi values separator. */ |
/** Config file multi values separator. |
| |
By default are ",", ";" and " " initialized. */ |
| CFG_FILE_NORMAL_MULTI_VALS_SEPARATOR = 12, |
CFG_FILE_NORMAL_MULTI_VALS_SEPARATOR = 12, |
| |
|
| /** Command line multi values leftover arguments separator */ |
/** Command line multi values leftover arguments separator. |
| |
By default is " " initialized. */ |
| CFG_FILE_LEFTOVER_MULTI_VALS_SEPARATOR = 13, |
CFG_FILE_LEFTOVER_MULTI_VALS_SEPARATOR = 13, |
| |
|
| /** Config file quote prefix & postfix */ |
/** Config file quote prefix & postfix. |
| |
By default are apostrophes (') and quotations (\") initlized for both.*/ |
| CFG_FILE_QUOTE_PREFIX = 14, |
CFG_FILE_QUOTE_PREFIX = 14, |
| CFG_FILE_QUOTE_POSTFIX = 15, |
CFG_FILE_QUOTE_POSTFIX = 15, |
| |
|
| /*@}*/ |
/*@}*/ |
| |
|
| /** |
/** |
| * @name Numbers of normal properties |
* @name Count of normal properties |
| */ |
*/ |
| /*@{*/ |
/*@{*/ |
| /** Special properties count */ |
/** Special properties count */ |
| Riadok 306 enum cfg_property_type { /* {{{ */ |
|
| Riadok 316 enum cfg_property_type { /* {{{ */ |
|
| /*@}*/ |
/*@}*/ |
| |
|
| /** |
/** |
| * @name Virtual properties codes |
* @name Virtual property codes |
| */ |
*/ |
| /*@{*/ |
/*@{*/ |
| |
|
| Riadok 325 enum cfg_property_type { /* {{{ */ |
|
| Riadok 335 enum cfg_property_type { /* {{{ */ |
|
| CFG_LEFTOVER_MULTI_VALS_SEPARATOR = 59, |
CFG_LEFTOVER_MULTI_VALS_SEPARATOR = 59, |
| |
|
| /** Option argument separator */ |
/** Option argument separator */ |
| CFG_OPTION_ARG_SEPARATOR = 60, |
CFG_OPTION_ARG_SEPARATOR = 60 |
| |
|
| /* TODO: virtual properties */ |
|
| CFG_VIRTUAL_SPECIAL_PROPERTY = 99 |
|
| /*@}*/ |
/*@}*/ |
| }; /* }}} */ |
}; /* }}} */ |
| /* |
|
| * terminator of variable number of parameters in functions |
/** |
| * cfg_add_properties(), cfg_set_properties(), cfg_get_properties() |
* Terminators of variable number arguments in functions cfg_add_properties(), |
| |
* cfg_set_properties(), cfg_get_properties() and similar. |
| */ |
*/ |
| #define CFG_EOF CFG_N_PROPS |
#define CFG_EOT CFG_N_PROPS |
| |
#define CFG_END_TYPE CFG_N_PROPS |
| |
|
| /*@}*/ |
/*@}*/ |
| |
|
|
|
| * Add multiple strings to particular properties |
* Add multiple strings to particular properties |
| * |
* |
| * @param con initialized context |
* @param con initialized context |
| * @param type property type |
* @param type property type(s) |
| * @param str string for addition |
* @param str string(s) for addition |
| * @return 1 on success, 0 on not enough memory error |
* @return 1 on success, 0 on not enough memory error |
| * @see cfg_property_type |
* @see cfg_property_type |
| * |
* |
| * argument list must be termited with typeN = CFG_EOF or strN = NULL |
* Argument list must be terminated with typeN = CFG_EOT or strN = NULL. |
| * cfg_add_properties(con, type1, str1, type2, str2, type3=CFG_EOF) |
* Use constructions like this:<br> |
| * construction allowed |
* cfg_add_properties(con, type1, str1, type2, str2, type3=CFG_EOT) |
| */ |
*/ |
| int cfg_add_properties( |
int cfg_add_properties( |
| const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
| |
|
| /** |
/** |
| * Add string to multiple properties |
* Add string to multiple properties |
|
|
| * @return 1 on success, 0 on not enough memory error |
* @return 1 on success, 0 on not enough memory error |
| * @see cfg_property_type |
* @see cfg_property_type |
| * |
* |
| * argument list must be termited with typeN = CFG_EOF; use constructions |
* Argument list must be terminated with typeN = CFG_EOT. Use constructions |
| * like this: cfg_add_properties(con, str, type1, type2, type3=CFG_EOF) |
* like this:<br> |
| |
* cfg_add_properties(con, str, type1, type2, type3=CFG_EOT) |
| */ |
*/ |
| int cfg_add_properties_str( |
int cfg_add_properties_str( |
| const CFG_CONTEXT con, char *str, enum cfg_property_type type, ...); |
const CFG_CONTEXT con, char *str, enum cfg_property_type type, ...); |
|
|
| * @return 1 on success, 0 on not enough memory error |
* @return 1 on success, 0 on not enough memory error |
| * @see cfg_property_type |
* @see cfg_property_type |
| * |
* |
| * argument list must be termited with NULL; use constructions |
* Argument list must be terminated with strN = NULL. Use constructions |
| * like this: cfg_add_properties(con, type, str1, str2, str3=NULL) |
* like this:<br> |
| |
* cfg_add_properties(con, type, str1, str2, str3=NULL) |
| */ |
*/ |
| int cfg_add_properties_type( |
int cfg_add_properties_type( |
| const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
|
|
| * |
* |
| * @param con initialized context |
* @param con initialized context |
| * @param type property type |
* @param type property type |
| * @param str string for removing |
* @param str string for removal |
| * @return 1 on success, 0 on not enough memory error |
* @return 1 on success, 0 on not enough memory error |
| * @see cfg_property_type |
* @see cfg_property_type |
| */ |
*/ |
|
|
| const CFG_CONTEXT con, enum cfg_property_type type, char *str); |
const CFG_CONTEXT con, enum cfg_property_type type, char *str); |
| |
|
| /** |
/** |
| * Remove multiple strings from property |
* Remove multiple strings from particular properties |
| * |
* |
| * @param con initialized context |
* @param con initialized context |
| * @param type property type |
* @param type property type(s) |
| * @param str string for addition |
* @param str string(s) for removal |
| * @return 1 on success, 0 on not enough memory error |
* @return 1 on success, 0 on not enough memory error |
| * @see cfg_property_type |
* @see cfg_property_type |
| * |
* |
| * argument list must be terminated with typeN = CFG_EOF or |
* Argument list must be terminated with typeN = CFG_EOT or strN = NULL. |
| * strN = NULL |
* Use constructions like this:<br> |
| * cfg_add_properties(con, type1, str1, type2, str2, type3=CFG_EOF) construction allowed |
* cfg_remove_properties(con, type1, str1, type2, str2, type3=CFG_EOT) |
| */ |
*/ |
| int cfg_remove_properties( |
int cfg_remove_properties( |
| const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
| |
|
| /** |
/** |
| * TODO: spravit help |
* Remove string from multiple properties |
| |
* |
| |
* @param con initialized context |
| |
* @param str string for removal |
| |
* @param type property type(s) |
| |
* @return 1 on success, 0 on not enough memory error |
| |
* @see cfg_property_type |
| |
* |
| |
* Argument list must be terminated with typeN = CFG_EOT. Use constructions |
| |
* like this:<br> |
| |
* cfg_remove_properties(con, str, type1, type2, type3=CFG_EOT) |
| */ |
*/ |
| int cfg_remove_properties_str( |
int cfg_remove_properties_str( |
| const CFG_CONTEXT con, char *str, enum cfg_property_type type, ...); |
const CFG_CONTEXT con, char *str, enum cfg_property_type type, ...); |
| |
|
| |
/** |
| |
* Remove multiple strings from one property |
| |
* |
| |
* @param con initialized context |
| |
* @param type property type |
| |
* @param str string(s) for removal |
| |
* @return 1 on success, 0 on not enough memory error |
| |
* @see cfg_property_type |
| |
* |
| |
* Argument list must be terminated with strN = NULL. Use constructions |
| |
* like this:<br> |
| |
* cfg_add_properties(con, type, str1, str2, str3=NULL) |
| |
*/ |
| int cfg_remove_properties_type( |
int cfg_remove_properties_type( |
| const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
const CFG_CONTEXT con, enum cfg_property_type type, char *str, ...); |
| |
|