File: confget.h

package info (click to toggle)
confget 5.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 740 kB
  • sloc: python: 1,017; ansic: 893; sh: 770; makefile: 142
file content (44 lines) | stat: -rw-r--r-- 1,068 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
#ifndef __INCLUDED_CONFGET_H
#define __INCLUDED_CONFGET_H

/*-
 * SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net>
 * SPDX-License-Identifier: BSD-2-Clause
 */

#ifndef __unused
#ifdef __GNUC__
#define __unused __attribute__((unused))
#else  /* __GNUC__ */
#define __unused
#endif /* __GNUC__ */
#endif /* __unused */

#define VERSION_STRING	"5.1.2"

typedef struct {
	const char	* const name;
	void		(* const openfile)(void);
	void		(* const readfile)(void);
	void		(* const closefile)(void);
} confget_backend;

/* The currently processed input file */
extern FILE		*conffile;

/* The configuration filename specified by the user. */
extern const char	*filename;
/* The configuration section specified by the user. */
extern const char	*section;

/* Should section variables override default ones? */
extern bool		 override;
/* Query the section names? */
extern bool		 qsections;

void			 foundvar(const char * const _sec,
				const char * const _name,
				const char * const _value);
void			 foundsection(const char * const _sec);

#endif /* _INCLUDED */