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.13 2004/01/12 06:03:09 nepto Exp $

Date:
  2001-2004

## 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: CFG_OK on success, CFG_ERR_NOMEM on not enough memory error

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: CFG_OK on success, CFG_ERR_NOMEM on not enough memory error

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