diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
commit | 924f5ea83e48277e014ebf0d19a27187cb93e2f7 (patch) | |
tree | 75920a275bba045f6d108204562c218a9a26ea15 /include/crm/common/util.h | |
parent | Adding upstream version 2.1.7. (diff) | |
download | pacemaker-upstream.tar.xz pacemaker-upstream.zip |
Adding upstream version 2.1.8~rc1.upstream/2.1.8_rc1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/crm/common/util.h')
-rw-r--r-- | include/crm/common/util.h | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/include/crm/common/util.h b/include/crm/common/util.h index c75a55e..2ae3f8e 100644 --- a/include/crm/common/util.h +++ b/include/crm/common/util.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2023 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -8,20 +8,22 @@ */ #ifndef PCMK__CRM_COMMON_UTIL__H -# define PCMK__CRM_COMMON_UTIL__H - -# include <sys/types.h> // gid_t, mode_t, size_t, time_t, uid_t -# include <stdlib.h> -# include <stdbool.h> -# include <stdint.h> // uint32_t -# include <limits.h> -# include <signal.h> -# include <glib.h> - -# include <crm/common/acl.h> -# include <crm/common/actions.h> -# include <crm/common/agents.h> -# include <crm/common/results.h> +#define PCMK__CRM_COMMON_UTIL__H + +#include <sys/types.h> // gid_t, mode_t, size_t, time_t, uid_t +#include <stdlib.h> +#include <stdbool.h> +#include <stdint.h> // uint32_t +#include <limits.h> +#include <signal.h> +#include <glib.h> + +#include <crm/common/acl.h> +#include <crm/common/actions.h> +#include <crm/common/agents.h> +#include <crm/common/results.h> +#include <crm/common/scores.h> +#include <crm/common/nvpair.h> #ifdef __cplusplus extern "C" { @@ -33,29 +35,28 @@ extern "C" { * \ingroup core */ - -# define ONLINESTATUS "online" // Status of an online client -# define OFFLINESTATUS "offline" // Status of an offline client - /* public node attribute functions (from attrd_client.c) */ char *pcmk_promotion_score_name(const char *rsc_id); /* public Pacemaker Remote functions (from remote.c) */ int crm_default_remote_port(void); -/* public score-related functions (from scores.c) */ -const char *pcmk_readable_score(int score); -int char2score(const char *score); -int pcmk__add_scores(int score1, int score2); - /* public string functions (from strings.c) */ + +// NOTE: sbd (as of at least 1.5.2) uses this gboolean crm_is_true(const char *s); + int crm_str_to_boolean(const char *s, int *ret); + +// NOTE: sbd (as of at least 1.5.2) uses this long long crm_get_msec(const char *input); + char * crm_strip_trailing_newline(char *str); + +// NOTE: sbd (as of at least 1.5.2) uses this char *crm_strdup_printf(char const *format, ...) G_GNUC_PRINTF(1, 2); -guint crm_parse_interval_spec(const char *input); +int pcmk_parse_interval_spec(const char *input, guint *result_ms); int compare_version(const char *version1, const char *version2); @@ -98,9 +99,6 @@ pcmk_all_flags_set(uint64_t flag_group, uint64_t flags_to_check) */ #define pcmk_is_set(g, f) pcmk_all_flags_set((g), (f)) -char *crm_meta_name(const char *field); -const char *crm_meta_value(GHashTable * hash, const char *field); - char *crm_md5sum(const char *buffer); char *crm_generate_uuid(void); @@ -115,8 +113,6 @@ int pcmk_daemon_user(uid_t *uid, gid_t *gid); void crm_gnutls_global_init(void); #endif -char *pcmk_hostname(void); - bool pcmk_str_is_infinity(const char *s); bool pcmk_str_is_minus_infinity(const char *s); |