Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
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.
 
#define config_foreach(__config, __section_name, __key, __val)
 Foreach elements of CONFIG_FILE macro, i.e config_foreach( config , section , key , val ); config_endfor;.
 
#define CONFIG_SECTION_HASH_TABLE_LEN   16
 size of the hash table of config sections entries
 
#define MAX_CONFIG_LINE_LEN   1024
 maximum length of a single config line
 

Functions

int destroy_config_file (CONFIG_FILE **cfg_file)
 Destroy a loaded config file.
 
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.
 
int get_nb_config_file_sections (CONFIG_FILE *cfg_file, char *section_name)
 Get the number of config file with section_name.
 
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.
 
CONFIG_FILEload_config_file (char *filename, int *errors)
 load a config file
 
int write_config_file (CONFIG_FILE *cfg_file, char *filename)
 write a config file
 

Detailed Description

Config file reading and writing.

Author
Castagnier Mickael
Version
1.0
Date
24/03/05

Definition in file n_config_file.h.