summaryrefslogtreecommitdiffstats
path: root/plugins/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/utils.h')
-rw-r--r--plugins/utils.h71
1 files changed, 36 insertions, 35 deletions
diff --git a/plugins/utils.h b/plugins/utils.h
index 4fc1305..bdf1ee1 100644
--- a/plugins/utils.h
+++ b/plugins/utils.h
@@ -16,9 +16,9 @@ suite of plugins. */
16/* $Id$ */ 16/* $Id$ */
17 17
18void support (void); 18void support (void);
19char *clean_revstring (const char *revstring); 19char *clean_revstring (const char *);
20void print_revision (const char *, const char *); 20void print_revision (const char *, const char *);
21void die (int result, const char *fmt, ...) __attribute__((noreturn,format(printf, 2, 3))); 21void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));
22 22
23/* Handle timeouts */ 23/* Handle timeouts */
24 24
@@ -57,7 +57,7 @@ struct timeval {
57#endif 57#endif
58 58
59#ifndef HAVE_GETTIMEOFDAY 59#ifndef HAVE_GETTIMEOFDAY
60int gettimeofday(struct timeval *tv, struct timezone *tz); 60int gettimeofday(struct timeval *, struct timezone *);
61#endif 61#endif
62 62
63double delta_time (struct timeval tv); 63double delta_time (struct timeval tv);
@@ -65,46 +65,47 @@ long deltime (struct timeval tv);
65 65
66/* Handle strings safely */ 66/* Handle strings safely */
67 67
68void strip (char *buffer); 68void strip (char *);
69char *strscpy (char *dest, const char *src); 69char *strscpy (char *, const char *);
70char *strnl (char *str); 70char *strnl (char *);
71char *strpcpy (char *dest, const char *src, const char *str); 71char *strpcpy (char *, const char *, const char *);
72char *strpcat (char *dest, const char *src, const char *str); 72char *strpcat (char *, const char *, const char *);
73 73
74int max_state (int a, int b); 74int max_state (int a, int b);
75 75
76void usage (const char *msg) __attribute__((noreturn)); 76void usage (const char *) __attribute__((noreturn));
77void usage2(const char *msg, const char *arg) __attribute__((noreturn)); 77void usage2(const char *, const char *) __attribute__((noreturn));
78void usage3(const char *msg, int arg) __attribute__((noreturn)); 78void usage3(const char *, int) __attribute__((noreturn));
79void usage4(const char *);
79 80
80const char *state_text (int result); 81const char *state_text (int);
81 82
82#define max(a,b) (((a)>(b))?(a):(b)) 83#define max(a,b) (((a)>(b))?(a):(b))
83#define min(a,b) (((a)<(b))?(a):(b)) 84#define min(a,b) (((a)<(b))?(a):(b))
84 85
85char *perfdata (const char *label, 86char *perfdata (const char *,
86 long int val, 87 long int,
87 const char *uom, 88 const char *,
88 int warnp, 89 int,
89 long int warn, 90 long int,
90 int critp, 91 int,
91 long int crit, 92 long int,
92 int minp, 93 int,
93 long int minv, 94 long int,
94 int maxp, 95 int,
95 long int maxv); 96 long int);
96 97
97char *fperfdata (const char *label, 98char *fperfdata (const char *,
98 double val, 99 double,
99 const char *uom, 100 const char *,
100 int warnp, 101 int,
101 double warn, 102 double,
102 int critp, 103 int,
103 double crit, 104 double,
104 int minp, 105 int,
105 double minv, 106 double,
106 int maxp, 107 int,
107 double maxv); 108 double);
108 109
109/* The idea here is that, although not every plugin will use all of these, 110/* The idea here is that, although not every plugin will use all of these,
110 most will or should. Therefore, for consistency, these very common 111 most will or should. Therefore, for consistency, these very common