From 802e46f8ea36c344f112d7e1dd8d64d17a4cc939 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 15 Sep 2025 12:59:37 +0200 Subject: Run clang-format again --- plugins/common.h | 175 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 88 insertions(+), 87 deletions(-) (limited to 'plugins/common.h') diff --git a/plugins/common.h b/plugins/common.h index 35d1e549..ef888d08 100644 --- a/plugins/common.h +++ b/plugins/common.h @@ -1,32 +1,32 @@ /***************************************************************************** -* -* Monitoring Plugins common include file -* -* License: GPL -* Copyright (c) 1999 Ethan Galstad (nagios@nagios.org) -* Copyright (c) 2003-2007 Monitoring Plugins Development Team -* -* Description: -* -* This file contains common include files and defines used in many of -* the plugins. -* -* -* This program is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -* -*****************************************************************************/ + * + * Monitoring Plugins common include file + * + * License: GPL + * Copyright (c) 1999 Ethan Galstad (nagios@nagios.org) + * Copyright (c) 2003-2007 Monitoring Plugins Development Team + * + * Description: + * + * This file contains common include files and defines used in many of + * the plugins. + * + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + *****************************************************************************/ #ifndef _COMMON_H_ #define _COMMON_H_ @@ -35,77 +35,78 @@ #include "../lib/monitoringplug.h" #ifdef HAVE_FEATURES_H -#include +# include #endif -#include /* obligatory includes */ +#include /* obligatory includes */ #include #include -/* This block provides uintmax_t - should be reported to coreutils that this should be added to fsuage.h */ +/* This block provides uintmax_t - should be reported to coreutils that this should be added to + * fsuage.h */ #if HAVE_INTTYPES_H -# include +# include #endif #if HAVE_STDINT_H -# include +# include #endif #include #ifndef UINTMAX_MAX -# define UINTMAX_MAX ((uintmax_t) -1) +# define UINTMAX_MAX ((uintmax_t) - 1) #endif -#include /* This is assumed true, because coreutils assume it too */ +#include /* This is assumed true, because coreutils assume it too */ #ifdef HAVE_MATH_H -#include +# include #endif #ifdef _AIX -#ifdef HAVE_MP_H -#include -#endif +# ifdef HAVE_MP_H +# include +# endif #endif #ifdef HAVE_STRINGS_H -#include +# include #endif #ifdef HAVE_STRING_H -#include +# include #endif #ifdef HAVE_UNISTD_H -#include +# include #endif -/* GET_NUMBER_OF_CPUS is a macro to return +/* GET_NUMBER_OF_CPUS is a macro to return number of CPUs, if we can get that data. Use configure.in to test for various OS ways of getting that data Will return -1 if cannot get data */ #if defined(HAVE_SYSCONF__SC_NPROCESSORS_ONLN) -# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_ONLN) -#elif defined (HAVE_SYSCONF__SC_NPROCESSORS_CONF) -# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF) +# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_ONLN) +#elif defined(HAVE_SYSCONF__SC_NPROCESSORS_CONF) +# define GET_NUMBER_OF_CPUS() sysconf(_SC_NPROCESSORS_CONF) #else -# define GET_NUMBER_OF_CPUS() -1 +# define GET_NUMBER_OF_CPUS() -1 #endif #ifdef HAVE_SYS_TIME_H -# include +# include #endif #include #ifdef HAVE_SYS_TYPES_H -#include +# include #endif #ifdef HAVE_SYS_SOCKET_H -#include +# include #endif #ifdef HAVE_SIGNAL_H -#include +# include #endif /* GNU Libraries */ @@ -115,7 +116,7 @@ #include #ifdef HAVE_SYS_POLL_H -# include "sys/poll.h" +# include "sys/poll.h" #endif /* @@ -125,42 +126,42 @@ */ #ifndef HAVE_STRTOL -# define strtol(a,b,c) atol((a)) +# define strtol(a, b, c) atol((a)) #endif #ifndef HAVE_STRTOUL -# define strtoul(a,b,c) (unsigned long)atol((a)) +# define strtoul(a, b, c) (unsigned long)atol((a)) #endif /* SSL implementations */ #ifdef HAVE_GNUTLS_OPENSSL_H -# include +# include #else -# define OPENSSL_LOAD_CONF /* See the OPENSSL_config(3) man page. */ -# ifdef HAVE_SSL_H -# include -# include -# include -# include -# include -# include -# else -# ifdef HAVE_OPENSSL_SSL_H -# include -# include -# include -# include -# include -# include -# endif -# endif +# define OPENSSL_LOAD_CONF /* See the OPENSSL_config(3) man page. */ +# ifdef HAVE_SSL_H +# include +# include +# include +# include +# include +# include +# else +# ifdef HAVE_OPENSSL_SSL_H +# include +# include +# include +# include +# include +# include +# endif +# endif #endif /* openssl 1.1 does not set OPENSSL_NO_SSL2 by default but ships without ssl2 */ #ifdef OPENSSL_VERSION_NUMBER -# if OPENSSL_VERSION_NUMBER >= 0x10100000 -# define OPENSSL_NO_SSL2 -# endif +# if OPENSSL_VERSION_NUMBER >= 0x10100000 +# define OPENSSL_NO_SSL2 +# endif #endif /* @@ -171,7 +172,7 @@ /* MariaDB 10.2 client does not set MYSQL_PORT */ #ifndef MYSQL_PORT -# define MYSQL_PORT 3306 +# define MYSQL_PORT 3306 #endif enum { @@ -180,9 +181,9 @@ enum { }; enum { - DEFAULT_SOCKET_TIMEOUT = 10, /* timeout after 10 seconds */ - MAX_INPUT_BUFFER = 8192, /* max size of most buffers we use */ - MAX_HOST_ADDRESS_LENGTH = 256 /* max size of a host address */ + DEFAULT_SOCKET_TIMEOUT = 10, /* timeout after 10 seconds */ + MAX_INPUT_BUFFER = 8192, /* max size of most buffers we use */ + MAX_HOST_ADDRESS_LENGTH = 256 /* max size of a host address */ }; /* @@ -191,17 +192,17 @@ enum { * */ #include "../gl/gettext.h" -#define _(String) gettext (String) -#if ! ENABLE_NLS -# undef textdomain -# define textdomain(Domainname) /* empty */ -# undef bindtextdomain -# define bindtextdomain(Domainname, Dirname) /* empty */ +#define _(String) gettext(String) +#if !ENABLE_NLS +# undef textdomain +# define textdomain(Domainname) /* empty */ +# undef bindtextdomain +# define bindtextdomain(Domainname, Dirname) /* empty */ #endif /* For non-GNU compilers to ignore __attribute__ */ #ifndef __GNUC__ -# define __attribute__(x) /* do nothing */ +# define __attribute__(x) /* do nothing */ #endif #endif /* _COMMON_H_ */ -- cgit v1.2.3-74-g34f1