2
* libcfg+ - precise command line & config file parsing library
4
* shared.h - shared stuff for command line and config file
6
* ____________________________________________________________
8
* Developed by Ondrej Jombik <nepto@platon.sk>
9
* and Lubomir Host <rajo@platon.sk>
10
* Copyright (c) 2001-2004 Platon SDG, http://platon.sk/
11
* All rights reserved.
13
* See README file for more information about this software.
14
* See COPYING file for license information.
16
* Download the latest version from
17
* http://platon.sk/projects/libcfg+/
20
/* $Platon: libcfg+/src/shared.h,v 1.13 2004/01/12 06:03:09 nepto Exp $ */
24
* @brief shared stuff for command line and config file parsing header file
25
* @author Ondrej Jombik <nepto@platon.sk>
26
* @author Lubomir Host <rajo@platon.sk>
27
* @version \$Platon: libcfg+/src/shared.h,v 1.13 2004/01/12 06:03:09 nepto Exp $
31
#ifndef _PLATON_CFG_SHARED_H
32
#define _PLATON_CFG_SHARED_H
35
* Free current variables (cur_opt, cur_arg) in context
36
* and sets cur_opt_type to CFG_NONE_OPTION.
38
* @param con initialized context with initialized current variables
41
void __cfg_free_currents(const CFG_CONTEXT con);
44
* Process current option and argument. It suppose that in context con
45
* are cur_opt, cur_arg and cur_type set.
47
* @param con initialized context
48
* @param ret_val option return value (val) @see cfg_context
49
* @param arg_used if option argument was used
50
* @return CFG_OK on success, CFG_ERROR_* on error
52
int __cfg_process_currents(const CFG_CONTEXT con, int *ret_val, int *arg_used);
55
* Allocate and initialize variables cur_opt and cur_arg in initialized
56
* command line context according to con->argv[con->cur_idx].
58
* @param con initialized command line context
59
* @return CFG_OK on success, CFG_ERR_NOMEM on not enough memory error
61
int __cfg_cmdline_set_currents(const CFG_CONTEXT con);
64
* Allocate and initialize variables cur_opt and cur_arg in initialized
65
* config file context according to input string (parameter buf).
67
* @param con initialized command line context
68
* @param buf input string
69
* @return CFG_OK on success, CFG_ERR_NOMEM on not enough memory error
71
int __cfg_cfgfile_set_currents(const CFG_CONTEXT con, char *buf);
73
#endif /* #ifndef _PLATON_CFG_SHARED_H */