Code

Fix for regex input of '|', being output causing problems with Nagios' parsing of
[nagiosplug.git] / lib / utils_cmd.h
1 #ifndef _UTILS_CMD_
2 #define _UTILS_CMD_
4 /* 
5  * Header file for nagios plugins utils_cmd.c
6  * 
7  * 
8  */
10 /** types **/
11 struct output
12 {
13         char *buf;     /* output buffer */
14         size_t buflen; /* output buffer content length */
15         char **line;   /* array of lines (points to buf) */
16         size_t *lens;  /* string lengths */
17         size_t lines;  /* lines of output */
18 };
20 typedef struct output output;
22 /** prototypes **/
23 int cmd_run (const char *, output *, output *, int);
24 int cmd_run_array (char *const *, output *, output *, int);
25 int cmd_file_read (char *, output *, int);
27 /* only multi-threaded plugins need to bother with this */
28 void cmd_init (void);
29 #define CMD_INIT cmd_init()
31 /* possible flags for cmd_run()'s fourth argument */
32 #define CMD_NO_ARRAYS 0x01   /* don't populate arrays at all */
33 #define CMD_NO_ASSOC 0x02    /* output.line won't point to buf */
35 #endif /* _UTILS_CMD_ */