Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/utils/ini.h
1476 views
1
/*
2
* Copyright (c) 2018 naehrwert
3
* Copyright (c) 2018 CTCaer
4
*
5
* This program is free software; you can redistribute it and/or modify it
6
* under the terms and conditions of the GNU General Public License,
7
* version 2, as published by the Free Software Foundation.
8
*
9
* This program is distributed in the hope it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
* more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
#ifndef _INI_H_
19
#define _INI_H_
20
21
#include <utils/types.h>
22
#include <utils/list.h>
23
24
#define INI_CHOICE 3
25
#define INI_CAPTION 5
26
#define INI_CHGLINE 6
27
#define INI_NEWLINE 0xFE
28
#define INI_COMMENT 0xFF
29
30
typedef struct _ini_kv_t
31
{
32
char *key;
33
char *val;
34
link_t link;
35
} ini_kv_t;
36
37
typedef struct _ini_sec_t
38
{
39
char *name;
40
link_t kvs;
41
link_t link;
42
u32 type;
43
u32 color;
44
} ini_sec_t;
45
46
int ini_parse(link_t *dst, const char *ini_path, bool is_dir);
47
char *ini_check_special_section(ini_sec_t *cfg);
48
void ini_free(link_t *src);
49
50
#endif
51
52
53