diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2026-01-09 14:57:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-09 14:57:57 +0100 |
| commit | da4fb28fca51b180d50608b0c847b1c0927cd8c5 (patch) | |
| tree | d20769e0a61ac2ba76920190050d3e0a3e7c85b7 /lib/utils_cmd.h | |
| parent | b09a8b530df8a23610889d0b89b148f22db3568a (diff) | |
| parent | f694f4cd4dfead0da6feab04d92335d9bbe185b6 (diff) | |
| download | monitoring-plugins-da4fb28fca51b180d50608b0c847b1c0927cd8c5.tar.gz | |
Merge branch 'master' into refactor/check_ide_smart
Diffstat (limited to 'lib/utils_cmd.h')
| -rw-r--r-- | lib/utils_cmd.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/utils_cmd.h b/lib/utils_cmd.h index d00069c9..04a624b8 100644 --- a/lib/utils_cmd.h +++ b/lib/utils_cmd.h | |||
| @@ -5,22 +5,30 @@ | |||
| 5 | * Header file for Monitoring Plugins utils_cmd.c | 5 | * Header file for Monitoring Plugins utils_cmd.c |
| 6 | * | 6 | * |
| 7 | */ | 7 | */ |
| 8 | #include "../config.h" | ||
| 9 | #include <stddef.h> | ||
| 8 | 10 | ||
| 9 | /** types **/ | 11 | /** types **/ |
| 10 | struct output { | 12 | typedef struct { |
| 11 | char *buf; /* output buffer */ | 13 | char *buf; /* output buffer */ |
| 12 | size_t buflen; /* output buffer content length */ | 14 | size_t buflen; /* output buffer content length */ |
| 13 | char **line; /* array of lines (points to buf) */ | 15 | char **line; /* array of lines (points to buf) */ |
| 14 | size_t *lens; /* string lengths */ | ||
| 15 | size_t lines; /* lines of output */ | 16 | size_t lines; /* lines of output */ |
| 16 | }; | 17 | } output; |
| 17 | |||
| 18 | typedef struct output output; | ||
| 19 | 18 | ||
| 20 | /** prototypes **/ | 19 | /** prototypes **/ |
| 21 | int cmd_run(const char *, output *, output *, int); | 20 | int cmd_run(const char *, output *, output *, int); |
| 22 | int cmd_run_array(char *const *, output *, output *, int); | 21 | int cmd_run_array(char *const *, output *, output *, int); |
| 23 | int cmd_file_read(char *, output *, int); | 22 | int cmd_file_read(const char *, output *, int); |
| 23 | |||
| 24 | typedef struct { | ||
| 25 | int error_code; | ||
| 26 | int cmd_error_code; | ||
| 27 | output out; | ||
| 28 | output err; | ||
| 29 | } cmd_run_result; | ||
| 30 | cmd_run_result cmd_run2(const char *cmd, int flags); | ||
| 31 | cmd_run_result cmd_run_array2(char * const *cmd, int flags); | ||
| 24 | 32 | ||
| 25 | /* only multi-threaded plugins need to bother with this */ | 33 | /* only multi-threaded plugins need to bother with this */ |
| 26 | void cmd_init(void); | 34 | void cmd_init(void); |
