File: scfg.h

package info (click to toggle)
libscfg 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 108 kB
  • sloc: ansic: 653; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 589 bytes parent folder | download
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
#ifndef SCFG_H
#define SCFG_H

#include <stddef.h>
#include <stdio.h>

struct scfg_block {
	struct scfg_directive *directives;
	size_t directives_len;
};

struct scfg_directive {
	char *name;

	char **params;
	size_t params_len;

	struct scfg_block children;

	int lineno;
};

int scfg_load_file(struct scfg_block *block, const char *path);
int scfg_store_file(const struct scfg_block *block, const char *path);
int scfg_parse_file(struct scfg_block *block, FILE *f);
int scfg_format_file(const struct scfg_block *block, FILE *f);
void scfg_block_finish(struct scfg_block *block);

#endif