From b48cb1f130cda9818d06aaf74cdc7d2aef13bf42 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 10 Sep 2013 22:29:46 +0200 Subject: Fix GCC's -Wimplicit-function-declaration warnings Fix the issues found by GCC when the -Wimplicit-function-declaration flag is specified. diff --git a/lib/utils_base.c b/lib/utils_base.c index 8685e6f..54463e9 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c @@ -27,6 +27,7 @@ #include "common.h" #include #include "utils_base.h" +#include #include #include @@ -34,6 +35,8 @@ nagios_plugin *this_nagios_plugin=NULL; +int _np_state_read_file(FILE *); + void np_init( char *plugin_name, int argc, char **argv ) { if (this_nagios_plugin==NULL) { this_nagios_plugin = calloc(1, sizeof(nagios_plugin)); diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c index ee6bf7b..0a8009a 100644 --- a/plugins/check_ide_smart.c +++ b/plugins/check_ide_smart.c @@ -164,8 +164,14 @@ enum SmartCommand SMART_CMD_AUTO_OFFLINE }; -void print_values (values_t * p, thresholds_t * t); -int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error); +char *get_offline_text (int); +int smart_read_values (int, values_t *); +int values_not_passed (values_t *, thresholds_t *); +int nagios (values_t *, thresholds_t *); +void print_value (value_t *, threshold_t *); +void print_values (values_t *, thresholds_t *); +int smart_cmd_simple (int, enum SmartCommand, __u8, char); +int smart_read_thresholds (int, thresholds_t *); int main (int argc, char *argv[]) diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index b024821..9e62638 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -32,6 +32,8 @@ char *progname; const char *copyright = "1999-2008"; const char *email = "nagiosplug-devel@lists.sourceforge.net"; +#include + #include "common.h" #include "netutils.h" #include "utils.h" diff --git a/plugins/negate.c b/plugins/negate.c index 493988e..ef7d4e0 100644 --- a/plugins/negate.c +++ b/plugins/negate.c @@ -35,6 +35,8 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; #define DEFAULT_TIMEOUT 11 +#include + #include "common.h" #include "utils.h" #include "utils_cmd.h" @@ -43,6 +45,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; static const char **process_arguments (int, char **); int validate_arguments (char **); +int translate_state (char *); void print_help (void); void print_usage (void); int subst_text = FALSE; diff --git a/plugins/runcmd.h b/plugins/runcmd.h index 5957562..fe66067 100644 --- a/plugins/runcmd.h +++ b/plugins/runcmd.h @@ -25,17 +25,7 @@ #define NAGIOSPLUG_RUNCMD_H #include "common.h" - -/** 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; +#include "utils_cmd.h" /* for the "output" type */ /** prototypes **/ int np_runcmd(const char *, output *, output *, int); -- cgit v0.10-9-g596f