forked from dunst-project/dunst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathini.h
35 lines (29 loc) · 923 Bytes
/
ini.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* copyright 2013 Sascha Kruse and contributors (see LICENSE for licensing information) */
#ifndef DUNST_INI_H
#define DUNST_INI_H
#include <stdbool.h>
#include <stdio.h>
struct entry {
char *key;
char *value;
};
struct section {
char *name;
int entry_count;
struct entry *entries;
};
struct ini {
int section_count;
struct section *sections;
};
/* returns the next known section.
* if section == NULL returns first section.
* returns NULL if no more sections are available
*/
const char *next_section(const struct ini *ini,const char *section);
const char *section_get_value(struct ini *ini, const struct section *s, const char *key);
const char *get_value(struct ini *ini, const char *section, const char *key);
struct ini *load_ini_file(FILE *fp);
void finish_ini(struct ini *ini);
#endif
/* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */