Nilorea Library
C utilities for networking, threading, graphics
n_config_file.h File Reference

Config file reading and writing. More...

#include "n_hash.h"
#include "n_str.h"
#include "n_log.h"
+ Include dependency graph for n_config_file.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CONFIG_FILE
 Structure of a config file. More...
 
struct  CONFIG_FILE_SECTION
 Structure of a config section. More...
 

Macros

#define config_endfor
 Foreach elements of CONFIG_FILE macro END. More...
 
#define config_foreach(__config, __section_name, __key, __val)
 Foreach elements of CONFIG_FILE macro, i.e config_foreach( config , section , key , val ); config_endfor;. More...
 
#define CONFIG_SECTION_HASH_TABLE_LEN   16
 size of the hash table of config sections entries More...
 
#define MAX_CONFIG_LINE_LEN   1024
 maximum length of a single config line More...
 

Functions

int destroy_config_file (CONFIG_FILE **cfg_file)
 Destroy a loaded config file. More...
 
char * get_config_section_value (CONFIG_FILE *cfg_file, char *section_name, int section_position, char *entry, int entry_position)
 Function to parse sections and get entries values. More...
 
int get_nb_config_file_sections (CONFIG_FILE *cfg_file, char *section_name)
 Get the number of config file with section_name. More...
 
int get_nb_config_file_sections_entries (CONFIG_FILE *cfg_file, char *section_name, int section_position, char *entry)
 Get the number of config file with section_name. More...
 
CONFIG_FILEload_config_file (char *filename, int *errors)
 load a config file More...
 
int write_config_file (CONFIG_FILE *cfg_file, char *filename)
 write a config file More...
 

Detailed Description

Config file reading and writing.

Author
Castagnier Mickael
Version
1.0
Date
24/03/05

Definition in file n_config_file.h.