Skip to content

Commit c7ef9b7

Browse files
committed
API: libcrmcommon: Deprecate crm_time_add_years()
External callers have no need to add years to a crm_time_t object. Pacemaker should not be used for general-purpose date/time manipulation. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
1 parent d7aca01 commit c7ef9b7

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

include/crm/common/iso8601.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ typedef struct crm_time_s crm_time_t;
5353
*/
5454
crm_time_t *crm_time_new(const char *string);
5555

56-
/* All crm_time_add_... functions support negative values */
57-
void crm_time_add_years(crm_time_t * dt, int value);
58-
5956
#ifdef __cplusplus
6057
}
6158
#endif

include/crm/common/iso8601_compat.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ void crm_time_add_weeks(crm_time_t *dt, int value);
172172
//! \deprecated Do not use
173173
void crm_time_add_months(crm_time_t *dt, int value);
174174

175+
//! \deprecated Do not use
176+
void crm_time_add_years(crm_time_t *dt, int value);
177+
175178
#ifdef __cplusplus
176179
}
177180
#endif

lib/common/iso8601.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,12 +1781,6 @@ pcmk__time_compare(const crm_time_t *a, const crm_time_t *b)
17811781
return rc;
17821782
}
17831783

1784-
void
1785-
crm_time_add_years(crm_time_t *dt, int value)
1786-
{
1787-
pcmk__time_add_years(dt, value);
1788-
}
1789-
17901784
static void
17911785
ha_get_tm_time(struct tm *target, const crm_time_t *source)
17921786
{
@@ -2518,5 +2512,11 @@ crm_time_add_months(crm_time_t *dt, int value)
25182512
add_months(dt, value);
25192513
}
25202514

2515+
void
2516+
crm_time_add_years(crm_time_t *dt, int value)
2517+
{
2518+
pcmk__time_add_years(dt, value);
2519+
}
2520+
25212521
// LCOV_EXCL_STOP
25222522
// End deprecated API

0 commit comments

Comments
 (0)