diff --git a/plugins/utils.h.in b/plugins/utils.h.in
index e910c417b4d18d6864019a2e27437a8e4b105a29..317ec46fba6cbd9ebc625b8b7a15e9129766be18 100644 (file)
--- a/plugins/utils.h.in
+++ b/plugins/utils.h.in
char *my_basename (char *);
void support (void);
char *clean_revstring (const char *revstring);
-void print_revision (char *, const char *);
+void print_revision (const char *, const char *);
void terminate (int result, char *msg, ...);
extern RETSIGTYPE timeout_alarm_handler (int);
int is_option (char *);
/* generalized timer that will do milliseconds if available */
-#ifndef HAVE_GETTIMEOFDAY
+#ifndef HAVE_STRUCT_TIMEVAL
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* microseconds */
};
+#endif
-struct timezone {
- int tz_minuteswest; /* minutes W of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-
-#define gettimeofday (tvp,tz) {\
- tvp->tv_usec=0;\
- tvp->tv_sec=(long)time();\
-}
+#ifndef HAVE_GETTIMEOFDAY
+int gettimeofday(struct timeval *tv, struct timezone *tz);
#endif
+double delta_time (struct timeval tv);
+
/* Handle strings safely */
void strip (char *buffer);
char *strpcpy (char *dest, const char *src, const char *str);
char *strpcat (char *dest, const char *src, const char *str);
-/* Handle comparisions for STATE_* */
-int max_state(int, int);
+int max_state (int a, int b);
-#define max(a,b) ((a)>(b))?(a):(b)
+void usage (char *msg);
+void usage2(char *msg, char *arg);
+void usage3(char *msg, char arg);
-#define usage(msg) {\
- printf(msg);\
- print_usage();\
- exit(STATE_UNKNOWN);\
-}
-#define usage2(msg,arg) {\
- printf("%s: %s - %s\n",PROGNAME,msg,arg);\
- print_usage();\
- exit(STATE_UNKNOWN);\
-}
+#define max(a,b) (((a)>(b))?(a):(b))
#define state_text(a) \
(a)==0?"OK":\
most will or should. Therefore, for consistency, these very common
options should have only these meanings throughout the overall suite */
-#define STD_OPTS "Vvht:c:w:H:F:"
-#define STD_OPTS_LONG \
+#define STD_LONG_OPTS \
{"version",no_argument,0,'V'},\
{"verbose",no_argument,0,'v'},\
{"help",no_argument,0,'h'},\
{"timeout",required_argument,0,'t'},\
{"critical",required_argument,0,'c'},\
{"warning",required_argument,0,'w'},\
-{"hostname",required_argument,0,'H'},\
-{"file",required_argument,0,'F'}
+{"hostname",required_argument,0,'H'}