Back to index

nagios-plugins  1.4.16
utils_cmd.h
Go to the documentation of this file.
00001 #ifndef _UTILS_CMD_
00002 #define _UTILS_CMD_
00003 
00004 /* 
00005  * Header file for nagios plugins utils_cmd.c
00006  * 
00007  * 
00008  */
00009 
00011 struct output
00012 {
00013        char *buf;     /* output buffer */
00014        size_t buflen; /* output buffer content length */
00015        char **line;   /* array of lines (points to buf) */
00016        size_t *lens;  /* string lengths */
00017        size_t lines;  /* lines of output */
00018 };
00019 
00020 typedef struct output output;
00021 
00023 int cmd_run (const char *, output *, output *, int);
00024 int cmd_run_array (char *const *, output *, output *, int);
00025 int cmd_file_read (char *, output *, int);
00026 
00027 /* only multi-threaded plugins need to bother with this */
00028 void cmd_init (void);
00029 #define CMD_INIT cmd_init()
00030 
00031 /* possible flags for cmd_run()'s fourth argument */
00032 #define CMD_NO_ARRAYS 0x01   /* don't populate arrays at all */
00033 #define CMD_NO_ASSOC 0x02    /* output.line won't point to buf */
00034 
00035 #endif /* _UTILS_CMD_ */