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)
int __cfg_process_currents (const CFG_CONTEXT con, int *ret_val, int *arg_used)
int __cfg_cmdline_set_currents (const CFG_CONTEXT con)
int __cfg_cfgfile_set_currents (const CFG_CONTEXT con, char *buf)


Detailed Description

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

Author:
Ondrej Jombik <nepto@pobox.sk>
Version:
$Id: shared.h,v 1.4 2002/04/21 10:08:40 jombik9 Exp $
Date:
2001-2002

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_ERR_* on error


Generated on Wed Jun 12 00:51:17 2002 for libcfg+ by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001