summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 743a44e)
raw | patch | inline | side by side (parent: 743a44e)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sat, 2 Aug 2003 18:22:51 +0000 (18:22 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sat, 2 Aug 2003 18:22:51 +0000 (18:22 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@633 f882894a-f735-0410-b71e-b25c423dba1c
plugins/utils.c | patch | blob | history | |
plugins/utils.h | patch | blob | history |
diff --git a/plugins/utils.c b/plugins/utils.c
index 128052d01325939e67ba89ebeb5db91d58c27c80..5f770a1f5a508c339238f45209bc829a36452131 100644 (file)
--- a/plugins/utils.c
+++ b/plugins/utils.c
* $Date$
****************************************************************************/
+#define LOCAL_TIMEOUT_ALARM_HANDLER
+
#include "config.h"
#include "common.h"
+#include "utils.h"
#include <stdarg.h>
#include <limits.h>
#include <arpa/inet.h>
extern void print_usage (void);
-extern int timeout_interval;
extern const char *progname;
-void support (void);
-char *clean_revstring (const char *);
-void print_revision (const char *, const char *);
-void die (int result, const char *fmt, ...);
-void terminate (int result, const char *fmt, ...);
-RETSIGTYPE timeout_alarm_handler (int);
-
-int is_integer (char *);
-int is_intpos (char *);
-int is_intneg (char *);
-int is_intnonneg (char *);
-int is_intpercent (char *);
-
-int is_numeric (char *);
-int is_positive (char *);
-int is_negative (char *);
-int is_nonnegative (char *);
-int is_percentage (char *);
-
-int is_option (char *str);
-
-double delta_time (struct timeval tv);
-
-void strip (char *);
-char *strscpy (char *dest, const char *src);
-char *strscat (char *dest, char *src);
-char *strnl (char *str);
-char *strpcpy (char *dest, const char *src, const char *str);
-char *strpcat (char *dest, const char *src, const char *str);
-
-char *state_text (int result);
-
#define STRLEN 64
#define TXTBLK 128
* Note that numerically the above does not hold
****************************************************************************/
-#define max(a,b) (((a)>(b))?(a):(b))
-
int
max_state (int a, int b)
{
*****************************************************************************/
char *
-strscat (char *dest, char *src)
+strscat (char *dest, const char *src)
{
if (dest == NULL)
diff --git a/plugins/utils.h b/plugins/utils.h
index b10f0e5af75f5c65254b0e0baaf36dd934c6df36..e581afaa5e6ff5fcbec89a4662d791f91ec4f037 100644 (file)
--- a/plugins/utils.h
+++ b/plugins/utils.h
/* Standardize version information, termination */
-char *my_basename (char *);
void support (void);
char *clean_revstring (const char *revstring);
void print_revision (const char *, const char *);
void die (int result, const char *fmt, ...);
-void terminate (int result, char *msg, ...);
-extern RETSIGTYPE timeout_alarm_handler (int);
+void terminate (int result, const char *msg, ...);
/* Handle timeouts */
-time_t start_time, end_time;
+#ifdef LOCAL_TIMEOUT_ALARM_HANDLER
+extern int timeout_interval;
+RETSIGTYPE timeout_alarm_handler (int);
+#else
int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
+extern RETSIGTYPE timeout_alarm_handler (int);
+#endif
+
+time_t start_time, end_time;
/* Test input types */
/* Handle strings safely */
void strip (char *buffer);
-char *strscpy (char *dest, char *src);
-char *strscat (char *dest, char *src);
+char *strscpy (char *dest, const char *src);
+char *strscat (char *dest, const char *src);
char *strnl (char *str);
char *ssprintf (char *str, const char *fmt, ...); /* deprecate for asprintf */
char *strpcpy (char *dest, const char *src, const char *str);
#define UT_TIMEOUT "\
-t, --timeout=INTEGER\n\
Seconds before connection times out (default: %d)\n"
+
+#define UT_SUPPORT "\n\
+Send email to nagios-users@lists.sourceforge.net if you have questions\n\
+regarding use of this software. To submit patches or suggest improvements,\n\
+send email to nagiosplug-devel@lists.sourceforge.net\n"
+
+#define UT_NOWARRANTY "\
+The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute\n\
+copies of the plugins under the terms of the GNU General Public License.\n\
+For more information about these matters, see the file named COPYING.\n"