summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c
index c9f0912..fb44240 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -28,6 +28,8 @@
28#include <stdarg.h> 28#include <stdarg.h>
29#include "utils_base.h" 29#include "utils_base.h"
30 30
31#define np_free(ptr) { if(ptr) { free(ptr); ptr = NULL; } }
32
31void 33void
32die (int result, const char *fmt, ...) 34die (int result, const char *fmt, ...)
33{ 35{
@@ -315,7 +317,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) {
315 * hopefully a unique key per service/plugin invocation. Use the extra-opts 317 * hopefully a unique key per service/plugin invocation. Use the extra-opts
316 * parse of argv, so that uniqueness in parameters are reflected there. 318 * parse of argv, so that uniqueness in parameters are reflected there.
317 */ 319 */
318char *np_state_generate_key(const char **argv) { 320char *np_state_generate_key(char **argv) {
319 return "Ahash"; 321 return "Ahash";
320} 322}
321 323
@@ -352,6 +354,9 @@ state_key *np_state_init(char *plugin_name, char *keyname, int expected_data_ver
352state_data *np_state_read(state_key *my_state_key) { 354state_data *np_state_read(state_key *my_state_key) {
353 state_data *this_state_data=NULL; 355 state_data *this_state_data=NULL;
354 my_state_key->state_data = this_state_data; 356 my_state_key->state_data = this_state_data;
357
358 /* Open file */
359
355 return this_state_data; 360 return this_state_data;
356} 361}
357 362
@@ -362,12 +367,14 @@ state_data *np_state_read(state_key *my_state_key) {
362 * two things writing to same key at same time. 367 * two things writing to same key at same time.
363 * Will die with UNKNOWN if errors 368 * Will die with UNKNOWN if errors
364 */ 369 */
365void np_state_write_string(state_key *my_state_key, time_t data_time, char *data_string) { 370void np_state_write_string(state_key *my_state_key, time_t *data_time, char *data_string) {
366} 371}
367 372
368/* 373/*
369 * Cleanup 374 * Cleanup
370 */ 375 */
371void np_state_cleanup(state_key *my_state_key) { 376void np_state_cleanup(state_key *my_state_key) {
377 free(my_state_key);
378 my_state_key=NULL;
372} 379}
373 380