From 301599a4eca67e214ef79bd609843a9e1e710b3a Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 17 Jun 2010 10:57:59 +0100 Subject: Add skeleton tests --- lib/utils_base.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/utils_base.c') diff --git a/lib/utils_base.c b/lib/utils_base.c index c9f0912a..fb442400 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -28,6 +28,8 @@ #include #include "utils_base.h" +#define np_free(ptr) { if(ptr) { free(ptr); ptr = NULL; } } + void die (int result, const char *fmt, ...) { @@ -315,7 +317,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) { * hopefully a unique key per service/plugin invocation. Use the extra-opts * parse of argv, so that uniqueness in parameters are reflected there. */ -char *np_state_generate_key(const char **argv) { +char *np_state_generate_key(char **argv) { return "Ahash"; } @@ -352,6 +354,9 @@ state_key *np_state_init(char *plugin_name, char *keyname, int expected_data_ver state_data *np_state_read(state_key *my_state_key) { state_data *this_state_data=NULL; my_state_key->state_data = this_state_data; + + /* Open file */ + return this_state_data; } @@ -362,12 +367,14 @@ state_data *np_state_read(state_key *my_state_key) { * two things writing to same key at same time. * Will die with UNKNOWN if errors */ -void np_state_write_string(state_key *my_state_key, time_t data_time, char *data_string) { +void np_state_write_string(state_key *my_state_key, time_t *data_time, char *data_string) { } /* * Cleanup */ void np_state_cleanup(state_key *my_state_key) { + free(my_state_key); + my_state_key=NULL; } -- cgit v1.2.3-74-g34f1