1
2/*-------------------------------------------------------------------------*/
3/**
4   @file    iniparser.h
5   @author  N. Devillard
6   @date    Sep 2007
7   @version 3.0
8   @brief   Parser for ini files.
9*/
10/*--------------------------------------------------------------------------*/
11
12/*
13*/
14
15#ifndef _INIPARSER_H_
16#define _INIPARSER_H_
17
18/*---------------------------------------------------------------------------
19   								Includes
20 ---------------------------------------------------------------------------*/
21
22#include <stdio.h>
23#include <stdlib.h>
24#include <string.h>
25
26/*
27 * The following #include is necessary on many Unixes but not Linux.
28 * It is not needed for Windows platforms.
29 * Uncomment it if needed.
30 */
31/* #include <unistd.h> */
32
33#include "dictionary.h"
34
35int        atalk_iniparser_getnsec(const dictionary * d);
36const char *atalk_iniparser_getsecname(const dictionary * d, int n);
37void       atalk_iniparser_dump_ini(const dictionary * d, FILE * f);
38void       atalk_iniparser_dump(const dictionary * d, FILE * f);
39const char *atalk_iniparser_getstring(const dictionary * d, const char *section, const char * key, const char * def);
40char       *atalk_iniparser_getstrdup(const dictionary * d, const char *section, const char * key, const char * def);
41int        atalk_iniparser_getint(const dictionary * d, const char *section, const char * key, int notfound);
42double     atalk_iniparser_getdouble(const dictionary * d, const char *section, const char * key, double notfound);
43int        atalk_iniparser_getboolean(const dictionary * d, const char *section, const char * key, int notfound);
44int        atalk_iniparser_set(dictionary * ini, char *section, char * key, char * val);
45void       atalk_iniparser_unset(dictionary * ini, char *section, char * key);
46int        atalk_iniparser_find_entry(const dictionary * ini, const char * entry) ;
47dictionary *atalk_iniparser_load(const char * ininame);
48void       atalk_iniparser_freedict(dictionary * d);
49
50#endif
51