libcfg+: shared.h File Reference

libcfg+ 0.7.0

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

Functions
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. More...
int | __cfg_process_currents (const CFG_CONTEXT con, int *ret_val, int *arg_used)
| Process current option and argument. More...
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]. More...
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). More...

## Detailed Description

shared stuff for command line and config file parsing header file

Author
  Ondrej Jombik nepto.nosp@m.@pla.nosp@m.ton.s.nosp@m.k
  Lubomir Host rajo@.nosp@m.plat.nosp@m.on.sk

Version
  $Platon: libcfg+/src/shared.h,v 1.14 2015/09/12 04:04:50 nepto Exp $

Date
  2001-2015

## 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