Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/dependencies/all/iniparser/iniparser.h
774 views
1
/*-------------------------------------------------------------------------*/
2
/**
3
@file iniparser.h
4
@author N. Devillard
5
@brief Parser for ini files.
6
*/
7
/*--------------------------------------------------------------------------*/
8
9
#ifndef _INIPARSER_H_
10
#define _INIPARSER_H_
11
12
/*---------------------------------------------------------------------------
13
Includes
14
---------------------------------------------------------------------------*/
15
16
#include <stdio.h>
17
#include <stdlib.h>
18
#include <string.h>
19
20
/*
21
* The following #include is necessary on many Unixes but not Linux.
22
* It is not needed for Windows platforms.
23
* Uncomment it if needed.
24
*/
25
/* #include <unistd.h> */
26
27
#include "dictionary.h"
28
29
#ifdef __cplusplus
30
extern "C" {
31
#endif
32
33
/*-------------------------------------------------------------------------*/
34
/**
35
@brief Configure a function to receive the error messages.
36
@param errback Function to call.
37
38
By default, the error will be printed on stderr. If a null pointer is passed
39
as errback the error callback will be switched back to default.
40
*/
41
/*--------------------------------------------------------------------------*/
42
43
void iniparser_set_error_callback(int (*errback)(const char *, ...));
44
45
46
47
int iniparser_getnsec(const dictionary * d);
48
49
50
51
52
const char * iniparser_getsecname(const dictionary * d, int n);
53
54
55
56
57
void iniparser_dump_ini(const dictionary * d, FILE * f);
58
59
60
void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f);
61
62
63
void iniparser_dump(const dictionary * d, FILE * f);
64
65
int iniparser_getsecnkeys(const dictionary * d, const char * s);
66
67
68
const char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys);
69
70
71
const char * iniparser_getstring(const dictionary * d, const char * key, const char * def);
72
73
int iniparser_getint(const dictionary * d, const char * key, int notfound);
74
75
long int iniparser_getlongint(const dictionary * d, const char * key, long int notfound);
76
77
double iniparser_getdouble(const dictionary * d, const char * key, double notfound);
78
79
int iniparser_getboolean(const dictionary * d, const char * key, int notfound);
80
81
82
int iniparser_set(dictionary * ini, const char * entry, const char * val);
83
84
85
void iniparser_unset(dictionary * ini, const char * entry);
86
87
88
89
int iniparser_find_entry(const dictionary * ini, const char * entry) ;
90
91
92
dictionary * iniparser_load(const char * ininame);
93
94
void iniparser_freedict(dictionary * d);
95
96
#ifdef __cplusplus
97
}
98
#endif
99
100
#endif
101