Tizen 2.0 Release
[external/libgnutls26.git] / src / cfg / shared.h
1 /*
2  * libcfg+ - precise command line & config file parsing library
3  *
4  * shared.h - shared stuff for command line and config file
5  *            parsing header file
6  * ____________________________________________________________
7  *
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.
12  *
13  * See README file for more information about this software.
14  * See COPYING file for license information.
15  *
16  * Download the latest version from
17  * http://platon.sk/projects/libcfg+/
18  */
19
20 /* $Platon: libcfg+/src/shared.h,v 1.13 2004/01/12 06:03:09 nepto Exp $ */
21
22 /**
23  * @file        shared.h
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 $
28  * @date        2001-2004
29  */
30
31 #ifndef _PLATON_CFG_SHARED_H
32 #define _PLATON_CFG_SHARED_H
33
34 /**
35  * Free current variables (cur_opt, cur_arg) in context
36  * and sets cur_opt_type to CFG_NONE_OPTION.
37  *
38  * @param con   initialized context with initialized current variables
39  * @return              void
40  */
41 void __cfg_free_currents(const CFG_CONTEXT con);
42
43 /**
44  * Process current option and argument. It suppose that in context con
45  * are cur_opt, cur_arg and cur_type set.
46  *
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
51  */
52 int  __cfg_process_currents(const CFG_CONTEXT con, int *ret_val, int *arg_used);
53
54 /**
55  * Allocate and initialize variables cur_opt and cur_arg in initialized
56  * command line context according to con->argv[con->cur_idx].
57  *
58  * @param con   initialized command line context
59  * @return              CFG_OK on success, CFG_ERR_NOMEM on not enough memory error
60  */
61 int  __cfg_cmdline_set_currents(const CFG_CONTEXT con);
62
63 /**
64  * Allocate and initialize variables cur_opt and cur_arg in initialized
65  * config file context according to input string (parameter buf).
66  *
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
70  */
71 int  __cfg_cfgfile_set_currents(const CFG_CONTEXT con, char *buf);
72
73 #endif /* #ifndef _PLATON_CFG_SHARED_H */
74