libdshconfig-0.20.13/libdshconfig.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "libdshconfig.h"
#include "config.h"

Defines

#define _GNU_SOURCE

Functions

static void * rpl_malloc (size_t n)
 A GNU-compatible malloc, Code to work with autoconf AC_FUNC_MALLOC.
const char * dshconfig_searchdata (const dshconfig *d, const char *index)
 Function to search member.
dshconfig_internaldshconfig_splitline (const char *original, char delimiter)
 The function used to split a line.
static
dshconfig_internal
read_oneline (FILE *f, int delimiter)
 The ugly function to do the config file reading.
dshconfigopen_dshconfig (FILE *file, char delimiter)
 reads a dsh config file, and load it up in memory
void free_dshconfig_internal (dshconfig_internal *i)
 Frees up memory for dshconfig_internal.
void free_dshconfig (dshconfig *d)
 Frees up memory allocated by open_dshconfig.

Define Documentation

#define _GNU_SOURCE


Function Documentation

const char* dshconfig_searchdata ( const dshconfig d,
const char *  index 
)

Function to search member.

dshconfig_internal* dshconfig_splitline ( const char *  original,
char  delimiter 
)

The function used to split a line.

Returns:
NULL on failure.

void free_dshconfig ( dshconfig d  ) 

Frees up memory allocated by open_dshconfig.

void free_dshconfig_internal ( dshconfig_internal i  ) 

Frees up memory for dshconfig_internal.

It is allocated by dshconfig_splitline.

soname 1 adds this feature

dshconfig* open_dshconfig ( FILE *  file,
char  delimiter 
)

reads a dsh config file, and load it up in memory

Returns:
NULL when error.

static dshconfig_internal* read_oneline ( FILE *  f,
int  delimiter 
) [static]

The ugly function to do the config file reading.

It will read one non-commentline and return to the caller.

Return value of NULL indicates termination and/or error.

static void * rpl_malloc ( size_t  n  )  [static]

A GNU-compatible malloc, Code to work with autoconf AC_FUNC_MALLOC.


Generated on Wed Aug 15 00:09:47 2007 for dshconfig API Reference by  doxygen 1.5.3