summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-02 18:22:51 (GMT)
committerKarl DeBisschop <kdebisschop@users.sourceforge.net>2003-08-02 18:22:51 (GMT)
commit3c48edf660facd4bd93181333b48960afd83934b (patch)
treeb6f4399575f3029580888e4e798b6cb9b94bbe13 /plugins/utils.c
parent743a44e936edbb649e67f99fdf7712e1c60eee39 (diff)
downloadmonitoring-plugins-3c48edf660facd4bd93181333b48960afd83934b.tar.gz
ifdef so utils.h can be header for utils.c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@633 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 128052d..5f770a1 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -11,49 +11,19 @@
11 * $Date$ 11 * $Date$
12 ****************************************************************************/ 12 ****************************************************************************/
13 13
14#define LOCAL_TIMEOUT_ALARM_HANDLER
15
14#include "config.h" 16#include "config.h"
15#include "common.h" 17#include "common.h"
18#include "utils.h"
16#include <stdarg.h> 19#include <stdarg.h>
17#include <limits.h> 20#include <limits.h>
18 21
19#include <arpa/inet.h> 22#include <arpa/inet.h>
20 23
21extern void print_usage (void); 24extern void print_usage (void);
22extern int timeout_interval;
23extern const char *progname; 25extern const char *progname;
24 26
25void support (void);
26char *clean_revstring (const char *);
27void print_revision (const char *, const char *);
28void die (int result, const char *fmt, ...);
29void terminate (int result, const char *fmt, ...);
30RETSIGTYPE timeout_alarm_handler (int);
31
32int is_integer (char *);
33int is_intpos (char *);
34int is_intneg (char *);
35int is_intnonneg (char *);
36int is_intpercent (char *);
37
38int is_numeric (char *);
39int is_positive (char *);
40int is_negative (char *);
41int is_nonnegative (char *);
42int is_percentage (char *);
43
44int is_option (char *str);
45
46double delta_time (struct timeval tv);
47
48void strip (char *);
49char *strscpy (char *dest, const char *src);
50char *strscat (char *dest, char *src);
51char *strnl (char *str);
52char *strpcpy (char *dest, const char *src, const char *str);
53char *strpcat (char *dest, const char *src, const char *str);
54
55char *state_text (int result);
56
57#define STRLEN 64 27#define STRLEN 64
58#define TXTBLK 128 28#define TXTBLK 128
59 29
@@ -65,8 +35,6 @@ char *state_text (int result);
65 * Note that numerically the above does not hold 35 * Note that numerically the above does not hold
66 ****************************************************************************/ 36 ****************************************************************************/
67 37
68#define max(a,b) (((a)>(b))?(a):(b))
69
70int 38int
71max_state (int a, int b) 39max_state (int a, int b)
72{ 40{
@@ -398,7 +366,7 @@ strscpy (char *dest, const char *src)
398 *****************************************************************************/ 366 *****************************************************************************/
399 367
400char * 368char *
401strscat (char *dest, char *src) 369strscat (char *dest, const char *src)
402{ 370{
403 371
404 if (dest == NULL) 372 if (dest == NULL)