From 8a39526e1b8754a8b8fbb50f7f6806af4def7baa Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Fri, 21 Sep 2007 23:01:28 +0000 Subject: Stop double expansion of parameters for negate - works like time command now git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1784 f882894a-f735-0410-b71e-b25c423dba1c --- lib/utils_cmd.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/utils_cmd.h (limited to 'lib/utils_cmd.h') diff --git a/lib/utils_cmd.h b/lib/utils_cmd.h new file mode 100644 index 00000000..d54b2b4d --- /dev/null +++ b/lib/utils_cmd.h @@ -0,0 +1,34 @@ +#ifndef _UTILS_CMD_ +#define _UTILS_CMD_ + +/* + * Header file for nagios plugins utils_cmd.c + * + * + */ + +/** types **/ +struct output +{ + char *buf; /* output buffer */ + size_t buflen; /* output buffer content length */ + char **line; /* array of lines (points to buf) */ + size_t *lens; /* string lengths */ + size_t lines; /* lines of output */ +}; + +typedef struct output output; + +/** prototypes **/ +int cmd_run (const char *, output *, output *, int); +int cmd_run_array (char *const *, output *, output *, int); + +/* only multi-threaded plugins need to bother with this */ +void cmd_init (void); +#define CMD_INIT cmd_init() + +/* possible flags for cmd_run()'s fourth argument */ +#define CMD_NO_ARRAYS 0x01 /* don't populate arrays at all */ +#define CMD_NO_ASSOC 0x02 /* output.line won't point to buf */ + +#endif /* _UTILS_CMD_ */ -- cgit v1.2.3-74-g34f1