From 6004d95868fcd9badbc0f026980a4a3597eb22db Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Sat, 15 Mar 2008 04:51:45 +0000 Subject: 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 --- lib/parse_ini.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/parse_ini.h') diff --git a/lib/parse_ini.h b/lib/parse_ini.h index 1c28c7de..fea745c5 100644 --- a/lib/parse_ini.h +++ b/lib/parse_ini.h @@ -6,6 +6,13 @@ * configuration files. */ +/* np_arg_list is a linked list of arguments passed between the ini + * parser and the argument parser to construct the final array */ +typedef struct np_arg_el { + char *arg; + struct np_arg_el *next; +} np_arg_list; + /* NP_DEFAULT_INI_PATH: compile-time default location for ini file */ #ifndef NP_DEFAULT_INI_PATH # define NP_DEFAULT_INI_PATH "/etc/nagios-plugins/plugins.ini" @@ -14,6 +21,6 @@ /* np_load_defaults: load the default configuration (if present) for * a plugin from the ini file */ -char* np_get_defaults(const char *locator, const char *default_section); +np_arg_list* np_get_defaults(const char *locator, const char *default_section); #endif /* _PARSE_INI_H_ */ -- cgit v1.2.3