[ Manpage overview ] [ To start of mcntp pages ]
Table of Contents

Name

config_open, config_read, config_close - routines to read configuration items from the MCNTP master file.

Synopsis

#include <read_conf.h>

int
config_open(void)

int
config_set_dir(char *dir)

int
config_read(char *section, char *item, int mode)

char *
config_read_global(char *section, char *item, int mode)

int
config_close(void)

Description

These functions implement reading of configuration data from the MCNTP master configuration file.

config_open
Opens the config file $MCNTP_CONF_DIR/mcntp.conf for further reading by config_read(). Returns 0 on success, -1 otherwise.

config_set_dir
Sets the directory, where the config file mcntp.conf can be found to dir instead of the default $MCNTP_CONF_DIR/mcntp.conf. config_set_dir() only has an effect on following config_open() calls. Returns 0 on suc- cess, -1 otherwise.

config_read,

config_read_global
Returns the value found for Item item of section section of the config- uration file as newly allocated character array. The caller is respon- sible for freeing up this memory area. If mode is set to 0, then the config file is assumed to be already opened by a call to config_open(), which speeds up repeated calls to config_read(). If mode is set to 1, then config_read() opens and closes the config file for each it that is read.

In addition to searching the section specified by section, config_read_global() also looks for the item int the global section mcntp".

config_close
Closes the config file previously opened by config_open(). Returns 0 on success, -1 otherwise.

See Also

mcntp.conf(5) , rctest(1)

History

The config_* routines appeared first after MCNTP moved to SourceForge

Author

Heiko W.Rupp (hwr@pilhuhn.de)

Bugs

None known yet. If you find any, then please report them on the respec- tive tracker at http://sourceforge.net/projects/mcntp/


Table of Contents

$Id: read_conf.3.html,v 1.5 2001/11/22 10:24:37 pilhuhn Exp $