Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

shared.h File Reference

shared stuff for command line and config file parsing header file More...

Go to the source code of this file.

Functions

void __cfg_free_currents (const CFG_CONTEXT con)
 Free current variables (cur_opt, cur_arg) in context and sets cur_opt_type to CFG_NONE_OPTION.

int __cfg_process_currents (const CFG_CONTEXT con, int *ret_val, int *arg_used)
 Process current option and argument.

int __cfg_cmdline_set_currents (const CFG_CONTEXT con)
 Allocate and initialize variables cur_opt and cur_arg in initialized command line context according to con->argv[con->cur_idx].

int __cfg_cfgfile_set_currents (const CFG_CONTEXT con, char *buf)
 Allocate and initialize variables cur_opt and cur_arg in initialized config file context according to input string (parameter buf).


Detailed Description

shared stuff for command line and config file parsing header file

Author:
Ondrej Jombik <nepto@platon.sk>

Lubomir Host <rajo@platon.sk>

Version:
$Platon: libcfg+/src/shared.h,v 1.10 2003/02/17 17:12:07 nepto Exp $
Date:
2001-2003

Function Documentation

int __cfg_cfgfile_set_currents const CFG_CONTEXT    con,
char *    buf
 

Allocate and initialize variables cur_opt and cur_arg in initialized config file context according to input string (parameter buf).

Parameters:
con initialized command line context
buf input string
Returns:
1 on success, 0 on error (not enough memory is only possible)

int __cfg_cmdline_set_currents const CFG_CONTEXT    con
 

Allocate and initialize variables cur_opt and cur_arg in initialized command line context according to con->argv[con->cur_idx].

Parameters:
con initialized command line context
Returns:
1 on success, 0 on error (not enough memory is only possible)

void __cfg_free_currents const CFG_CONTEXT    con
 

Free current variables (cur_opt, cur_arg) in context and sets cur_opt_type to CFG_NONE_OPTION.

Parameters:
con initialized context with initialized current variables
Returns:
void

int __cfg_process_currents const CFG_CONTEXT    con,
int *    ret_val,
int *    arg_used
 

Process current option and argument.

It suppose that in context con are cur_opt, cur_arg and cur_type set.

Parameters:
con initialized context
ret_val option return value (val)
See also:
cfg_context
Parameters:
arg_used if option argument was used
Returns:
CFG_OK on success, CFG_ERROR_* on error


libcfg+ developer documentation generated by Doxygen