Code

check_host: Allocate a large-enough buffer for the host table.
[nagiosplug.git] / lib / parse_ini.h
1 #ifndef _PARSE_INI_H_
2 #define _PARSE_INI_H_
4 /*
5  * parse_ini.h: routines for loading nagios-plugin defaults from ini
6  * configuration files.
7  */
9 /* np_arg_list is a linked list of arguments passed between the ini
10  * parser and the argument parser to construct the final array */
11 typedef struct np_arg_el {
12         char *arg;
13         struct np_arg_el *next;
14 } np_arg_list;
16 /* FIXME: This is in plugins/common.c. Should be eventually moved to lib/
17  * (although for this particular one a configure settings should be ideal)
18  */
19 #ifndef MAX_INPUT_BUFFER
20 # define MAX_INPUT_BUFFER 8192
21 #endif /* MAX_INPUT_BUFFER */
23 /* Filenames (see below) */
24 #ifndef NP_DEFAULT_INI_FILENAME1
25 # define NP_DEFAULT_INI_FILENAME1 "plugins.ini"
26 #endif /* NP_DEFAULT_INI_FILENAME1 */
27 #ifndef NP_DEFAULT_INI_FILENAME2
28 # define NP_DEFAULT_INI_FILENAME2 "nagios-plugins.ini"
29 #endif /* NP_DEFAULT_INI_FILENAME2 */
31 /* Config paths ending in nagios (search for NP_DEFAULT_INI_FILENAME1) */
32 #ifndef NP_DEFAULT_INI_NAGIOS_PATH1
33 # define NP_DEFAULT_INI_NAGIOS_PATH1 "/etc/nagios"
34 #endif /* NP_DEFAULT_INI_NAGIOS_PATH1 */
35 #ifndef NP_DEFAULT_INI_NAGIOS_PATH2
36 # define NP_DEFAULT_INI_NAGIOS_PATH2 "/usr/local/nagios/etc"
37 #endif /* NP_DEFAULT_INI_NAGIOS_PATH2 */
38 #ifndef NP_DEFAULT_INI_NAGIOS_PATH3
39 # define NP_DEFAULT_INI_NAGIOS_PATH3 "/usr/local/etc/nagios"
40 #endif /* NP_DEFAULT_INI_NAGIOS_PATH3 */
41 #ifndef NP_DEFAULT_INI_NAGIOS_PATH4
42 # define NP_DEFAULT_INI_NAGIOS_PATH4 "/etc/opt/nagios"
43 #endif /* NP_DEFAULT_INI_NAGIOS_PATH4 */
45 /* Config paths not ending in nagios (search for NP_DEFAULT_INI_FILENAME2) */
46 #ifndef NP_DEFAULT_INI_PATH1
47 # define NP_DEFAULT_INI_PATH1 "/etc"
48 #endif /* NP_DEFAULT_INI_PATH1 */
49 #ifndef NP_DEFAULT_INI_PATH2
50 # define NP_DEFAULT_INI_PATH2 "/usr/local/etc"
51 #endif /* NP_DEFAULT_INI_PATH2 */
52 #ifndef NP_DEFAULT_INI_PATH3
53 # define NP_DEFAULT_INI_PATH3 "/etc/opt"
54 #endif /* NP_DEFAULT_INI_PATH3 */
56 /* np_load_defaults: load the default configuration (if present) for
57  * a plugin from the ini file
58  */
59 np_arg_list* np_get_defaults(const char *locator, const char *default_section);
61 #endif /* _PARSE_INI_H_ */