Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
63c955c
API: libcrmcommon: Deprecate crm_time_calculate_duration()
nrwahl2 Apr 30, 2026
90d276e
Refactor: libcrmcommon: New pcmk__time_parse_duration()
nrwahl2 Apr 30, 2026
ab7373c
API: libcrmcommon: Deprecate crm_time_parse_duration()
nrwahl2 Apr 30, 2026
cc4b6ca
Refactor: libcrmcommon: Clean up includes in scheduler.h
nrwahl2 May 1, 2026
9f3d7bd
Refactor: various: Drop crm_time_new_undefined() internally
nrwahl2 May 1, 2026
75e562a
API: libcrmcommon: Deprecate crm_time_new_undefined()
nrwahl2 May 1, 2026
0e6d29a
Refactor: libcrmcommon: New pcmk__time_is_initialized()
nrwahl2 May 1, 2026
49f1248
API: libcrmcommon: Deprecate crm_time_is_defined()
nrwahl2 May 1, 2026
49f1583
Refactor: libcrmcommon: New pcmk__time_text()
nrwahl2 May 1, 2026
996311c
API: libcrmcommon: Deprecate crm_time_as_string()
nrwahl2 May 1, 2026
45a0716
Refactor: libcrmcommon: New pcmk__time_fmt_date flag
nrwahl2 May 1, 2026
b846a9b
API: libcrmcommon: Deprecate crm_time_log_date
nrwahl2 May 1, 2026
660c7fb
Refactor: libcrmcommon: New pcmk__time_fmt_time
nrwahl2 May 1, 2026
aa5bc31
API: libcrmcommon: Deprecate crm_time_log_timeofday
nrwahl2 May 1, 2026
eb5476d
Refactor: libcrmcommon: New pcmk__time_fmt_timezone
nrwahl2 May 1, 2026
2e5f99d
API: libcrmcommon: Deprecate crm_time_log_with_timezone
nrwahl2 May 1, 2026
4adca87
Refactor: libcrmcommon: New pcmk__time_fmt_duration
nrwahl2 May 1, 2026
e0e9729
API: libcrmcommon: Deprecate crm_time_log_duration
nrwahl2 May 1, 2026
f5ddcce
Refactor: libcrmcommon: New pcmk__time_fmt_ordinal
nrwahl2 May 1, 2026
04a95fe
API: libcrmcommon: Deprecate crm_time_ordinal
nrwahl2 May 1, 2026
6777325
Refactor: libcrmcommon: New pcmk__time_fmt_weeks
nrwahl2 May 1, 2026
801c759
API: libcrmcommon: Deprecate crm_time_weeks
nrwahl2 May 1, 2026
afef1dd
Refactor: libcrmcommon: New pcmk__time_fmt_seconds
nrwahl2 May 1, 2026
a8a5b3c
API: libcrmcommon: Deprecate crm_time_seconds
nrwahl2 May 1, 2026
6fccffc
Refactor: libcrmcommon: New pcmk__time_fmt_epoch
nrwahl2 May 1, 2026
f31267f
API: libcrmcommon: Deprecate crm_time_epoch
nrwahl2 May 1, 2026
3044398
Refactor: libcrmcommon: New pcmk__time_fmt_usecs
nrwahl2 May 1, 2026
fcd69e7
API: libcrmcommon: Deprecate crm_time_usecs
nrwahl2 May 1, 2026
ec89873
Refactor: libcrmcommon: New pcmk__time_compare()
nrwahl2 May 1, 2026
c000874
API: libcrmcommon: Deprecate crm_time_compare()
nrwahl2 May 1, 2026
d0b6ca9
Refactor: libcrmcommon: Ignore crm_time_get_timeofday() return value
nrwahl2 May 1, 2026
065d54c
Refactor: libcrmcommon: New pcmk__time_get_timeofday()
nrwahl2 May 1, 2026
6525503
API: libcrmcommon: Deprecate crm_time_get_timeofday()
nrwahl2 May 1, 2026
8fd90a7
Refactor: libcrmcommon: Ignore crm_time_get_gregorian() return value
nrwahl2 May 1, 2026
d62dbe4
Refactor: libcrmcommon: New pcmk__time_get_ymd()
nrwahl2 May 1, 2026
6be3545
API: libcrmcommon: Deprecate crm_time_get_gregorian()
nrwahl2 May 1, 2026
4a92af5
Refactor: libcrmcommon: Drop crm_time_get_ordinal() internally
nrwahl2 May 1, 2026
6ae822b
API: libcrmcommon: Deprecate crm_time_get_ordinal()
nrwahl2 May 1, 2026
30df7dc
Refactor: libcrmcommon: New pcmk__time_get_seconds()
nrwahl2 May 1, 2026
9629516
API: libcrmcommon: Deprecate crm_time_get_seconds()
nrwahl2 May 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cts/cli/regression.dates.exp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ iso8601: Invalid interval specified: P1Y/2019-02-29 00:00:00Z
=#=#=#= End test: Invalid period - [P1Y/2019-02-29 00:00:00Z] - Invalid parameter (2) =#=#=#=
* Passed: iso8601 - Invalid period - [P1Y/2019-02-29 00:00:00Z]
=#=#=#= Begin test: Invalid period - [2019-01-01 00:00:00Z/P] =#=#=#=
crm_time_parse_duration error: 'P' is not a valid ISO 8601 time duration because nothing follows 'P'
pcmk__time_parse_duration error: 'P' is not a valid ISO 8601 time duration because nothing follows 'P'
iso8601: Invalid interval specified: 2019-01-01 00:00:00Z/P
=#=#=#= End test: Invalid period - [2019-01-01 00:00:00Z/P] - Invalid parameter (2) =#=#=#=
* Passed: iso8601 - Invalid period - [2019-01-01 00:00:00Z/P]
Expand Down
1 change: 0 additions & 1 deletion cts/cts-cli.in
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def sanitize_output(s):
(r'(<cib.*) cib-last-written="[^"]*"', r'\1'),
(r'crm_feature_set="[^"]*" ', r''),
(r'@crm_feature_set=[0-9.]+, ', r''),
(r'\(crm_time_parse_duration@.*\.c:[0-9]+\)', r'crm_time_parse_duration'),
(r'\(parse_hms@.*\.c:[0-9]+\)', r'parse_hms'),
(re.escape(cts_cli_data), r'CTS_CLI_DATA'),
(r' default="[^"]*"', r' default=""'),
Expand Down
8 changes: 0 additions & 8 deletions include/crm/common/iso8601.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ typedef struct crm_time_s crm_time_t;
* A timezone of 'Z' denotes UTC time
*/
crm_time_t *crm_time_new(const char *string);
crm_time_t *crm_time_new_undefined(void);
void crm_time_free(crm_time_t * dt);

bool crm_time_is_defined(const crm_time_t *t);
char *crm_time_as_string(const crm_time_t *dt, int flags);

#define crm_time_log_date 0x001
#define crm_time_log_timeofday 0x002
#define crm_time_log_with_timezone 0x004
Expand All @@ -69,10 +65,6 @@ char *crm_time_as_string(const crm_time_t *dt, int flags);
#define crm_time_epoch 0x200
#define crm_time_usecs 0x400

crm_time_t *crm_time_parse_duration(const char *duration_str);
crm_time_t *crm_time_calculate_duration(const crm_time_t *dt,
const crm_time_t *value);

int crm_time_compare(const crm_time_t *a, const crm_time_t *b);

int crm_time_get_timeofday(const crm_time_t *dt, uint32_t *h, uint32_t *m,
Expand Down
16 changes: 16 additions & 0 deletions include/crm/common/iso8601_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ void crm_time_free_period(crm_time_period_t *period);
//! \deprecated Do not use
crm_time_period_t *crm_time_parse_period(const char *period_str);

//! \deprecated Do not use
crm_time_t *crm_time_calculate_duration(const crm_time_t *dt,
const crm_time_t *value);

//! \deprecated Do not use
crm_time_t *crm_time_parse_duration(const char *duration_str);

//! \deprecated Do not use
crm_time_t *crm_time_new_undefined(void);

//! \deprecated Do not use
bool crm_time_is_defined(const crm_time_t *t);

//! \deprecated Do not use
char *crm_time_as_string(const crm_time_t *dt, int flags);

#ifdef __cplusplus
}
#endif
Expand Down
11 changes: 11 additions & 0 deletions include/crm/common/iso8601_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,24 @@
extern "C" {
#endif

/* @COMPAT These must be kept in line with the deprecated crm_time_* flags until
* those are removed
*/
enum pcmk__time_fmt_flags {
pcmk__time_fmt_date = (UINT32_C(1) << 0),
Comment thread
nrwahl2 marked this conversation as resolved.
};
Comment thread
nrwahl2 marked this conversation as resolved.

bool pcmk__time_valid_year(int year);
bool pcmk__time_is_initialized(const crm_time_t *dt);
void pcmk__time_get_ywd(const crm_time_t *dt, uint32_t *y, uint32_t *w,
uint32_t *d);
char *pcmk__time_text(const crm_time_t *dt, int flags);
char *pcmk__time_format_hr(const char *format, const crm_time_t *dt, int usec);
char *pcmk__epoch2str(const time_t *source, uint32_t flags);
char *pcmk__timespec2str(const struct timespec *ts, uint32_t flags);
const char *pcmk__readable_interval(unsigned int interval_ms);

crm_time_t *pcmk__time_parse_duration(const char *period_s);
crm_time_t *pcmk__copy_timet(time_t source_sec);

void pcmk__time_log_as(const char *file, const char *function, int line,
Expand Down
16 changes: 5 additions & 11 deletions include/crm/common/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@
#ifndef PCMK__CRM_COMMON_SCHEDULER__H
#define PCMK__CRM_COMMON_SCHEDULER__H

#include <stdbool.h>
#include <sys/types.h> // time_t
#include <libxml/tree.h> // xmlNode
#include <glib.h> // GList, GHashTable
#include <stdbool.h> // bool
#include <stdint.h> // uint64_t

#include <crm/common/iso8601.h> // crm_time_t
#include <glib.h> // GList
#include <libxml/tree.h> // xmlNode

#include <crm/common/actions.h>
#include <crm/common/nodes.h>
#include <crm/common/resources.h>
#include <crm/common/roles.h>
#include <crm/common/rules.h>
#include <crm/common/scheduler_types.h>
#include <crm/common/scheduler_types.h> // pcmk_node_t, pcmk_scheduler_t

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions include/crm/pengine/status.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2025 the Pacemaker project contributors
* Copyright 2004-2026 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
Expand All @@ -12,7 +12,7 @@

# include <glib.h> // gboolean
# include <stdbool.h> // bool
# include <crm/common/iso8601.h>
# include <crm/common/resources.h> // pe_find
# include <crm/pengine/pe_types.h> // pcmk_node_t, pcmk_resource_t, etc.
# include <crm/pengine/complex.h>

Expand Down
1 change: 1 addition & 0 deletions include/pacemaker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# include <glib.h>
# include <libxml/tree.h>

# include <crm/common/iso8601.h> // crm_time_t
# include <crm/common/scheduler.h>
# include <crm/cib/cib_types.h>

Expand Down
Loading