Main Page   Data Structures   File List   Data Fields   Globals   Examples  

config.h File Reference

Some routines to ease the configuration file access. More...

#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  config_t
 A configuration file handle. More...


Functions

config_tnm_config_open (const char *fn)
 Open the specified configuration file.

void nm_config_close (config_t *c)
 Close a configuration file oject.

const char * nm_config_get (config_t *c, const char *entry, const char *def)
 Request a specific configuration key from the configuration file.

int nm_config_get_int (config_t *c, const char *entry, int def)
 Same as nm_config_get() but requests an integer.

int nm_config_get_bool (config_t *c, const char *entry, int def)
 Same as nm_config_get() but requests a boolean.


Detailed Description

Some routines to ease the configuration file access.

This is only used by the plugins, not by applications linking to libnewmail.

Definition in file config.h.


Function Documentation

void nm_config_close config_t   c
 

Close a configuration file oject.

Parameters:
c  The configuration file object to be freed

const char* nm_config_get config_t   c,
const char *    entry,
const char *    def
 

Request a specific configuration key from the configuration file.

Parameters:
c  The configuration file object
entry  The configuration file key
def  The default value, when the key is not found. May be NULL
Returns:
A pointer to a statically allocated string containing the value read or def.

int nm_config_get_bool config_t   c,
const char *    entry,
int    def
 

Same as nm_config_get() but requests a boolean.

Parameters:
c  The configuration file object
entry  The configuration file key
def  The default value, when the key is not found.
Returns:
The value read or def

int nm_config_get_int config_t   c,
const char *    entry,
int    def
 

Same as nm_config_get() but requests an integer.

Parameters:
c  The configuration file object
entry  The configuration file key
def  The default value, when the key is not found.
Returns:
The value read or def

config_t* nm_config_open const char *    fn
 

Open the specified configuration file.

Parameters:
fn  Path to configuration file
Returns:
A handle to the configuration file object


Generated on Thu Oct 23 01:52:10 2003 for libnewmail by doxygen1.2.18