summaryrefslogtreecommitdiffstats
path: root/lib/parse_ini.h
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-03-15 04:51:45 (GMT)
committerThomas Guyot-Sionnest <dermoth@users.sourceforge.net>2008-03-15 04:51:45 (GMT)
commit6004d95868fcd9badbc0f026980a4a3597eb22db (patch)
treebe1a47aeb9e08632f74bc7bd155504b0221367e2 /lib/parse_ini.h
parent118e57b78972c4fbbcd4f45d84af546d7346141d (diff)
downloadmonitoring-plugins-6004d95868fcd9badbc0f026980a4a3597eb22db.tar.gz
This commit consist of two changes:
1. Make np_get_defaults return a linked list instead of a string. It will then be easy to convert the linked list back to an argument array. 2. Fix tests 3-4 of test_ini.c. A test_ini.t was added too. parse_ini and test_ini aren't included yet in the build makefiles. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1945 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'lib/parse_ini.h')
-rw-r--r--lib/parse_ini.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/parse_ini.h b/lib/parse_ini.h
index 1c28c7d..fea745c 100644
--- a/lib/parse_ini.h
+++ b/lib/parse_ini.h
@@ -6,6 +6,13 @@
6 * configuration files. 6 * configuration files.
7 */ 7 */
8 8
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 */
11typedef struct np_arg_el {
12 char *arg;
13 struct np_arg_el *next;
14} np_arg_list;
15
9/* NP_DEFAULT_INI_PATH: compile-time default location for ini file */ 16/* NP_DEFAULT_INI_PATH: compile-time default location for ini file */
10#ifndef NP_DEFAULT_INI_PATH 17#ifndef NP_DEFAULT_INI_PATH
11# define NP_DEFAULT_INI_PATH "/etc/nagios-plugins/plugins.ini" 18# define NP_DEFAULT_INI_PATH "/etc/nagios-plugins/plugins.ini"
@@ -14,6 +21,6 @@
14/* np_load_defaults: load the default configuration (if present) for 21/* np_load_defaults: load the default configuration (if present) for
15 * a plugin from the ini file 22 * a plugin from the ini file
16 */ 23 */
17char* np_get_defaults(const char *locator, const char *default_section); 24np_arg_list* np_get_defaults(const char *locator, const char *default_section);
18 25
19#endif /* _PARSE_INI_H_ */ 26#endif /* _PARSE_INI_H_ */