From 924f5ea83e48277e014ebf0d19a27187cb93e2f7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 3 Jun 2024 15:39:28 +0200 Subject: Adding upstream version 2.1.8~rc1. Signed-off-by: Daniel Baumann --- include/crm/common/util.h | 56 ++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 30 deletions(-) (limited to 'include/crm/common/util.h') 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 // gid_t, mode_t, size_t, time_t, uid_t -# include -# include -# include // uint32_t -# include -# include -# include - -# include -# include -# include -# include +#define PCMK__CRM_COMMON_UTIL__H + +#include // gid_t, mode_t, size_t, time_t, uid_t +#include +#include +#include // uint32_t +#include +#include +#include + +#include +#include +#include +#include +#include +#include #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); -- cgit v1.2.3