pacemaker
2.1.0-7c3f660
Scalable High-Availability cluster resource manager
|
ISO_8601 Date handling. More...
#include <time.h>
#include <ctype.h>
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | crm_time_period_s |
Macros | |
#define | crm_time_log(level, prefix, dt, flags) crm_time_log_alias(level, __FILE__, __func__, __LINE__, prefix, dt, flags) |
#define | crm_time_log_date 0x001 |
#define | crm_time_log_timeofday 0x002 |
#define | crm_time_log_with_timezone 0x004 |
#define | crm_time_log_duration 0x008 |
#define | crm_time_ordinal 0x010 |
#define | crm_time_weeks 0x020 |
#define | crm_time_seconds 0x100 |
#define | crm_time_epoch 0x200 |
Typedefs | |
typedef struct crm_time_s | crm_time_t |
typedef struct crm_time_period_s | crm_time_period_t |
Functions | |
crm_time_t * | crm_time_new (const char *string) |
crm_time_t * | crm_time_new_undefined (void) |
Allocate memory for an uninitialized time object. More... | |
void | crm_time_free (crm_time_t *dt) |
bool | crm_time_is_defined (const crm_time_t *t) |
Check whether a time object has been initialized yet. More... | |
char * | crm_time_as_string (crm_time_t *dt, int flags) |
void | crm_time_log_alias (int log_level, const char *file, const char *function, int line, const char *prefix, crm_time_t *date_time, int flags) |
crm_time_t * | crm_time_parse_duration (const char *duration_str) |
Parse a time duration from an ISO 8601 duration specification. More... | |
crm_time_t * | crm_time_calculate_duration (crm_time_t *dt, crm_time_t *value) |
crm_time_period_t * | crm_time_parse_period (const char *period_str) |
Parse a time period from an ISO 8601 interval specification. More... | |
void | crm_time_free_period (crm_time_period_t *period) |
Free a dynamically allocated time period object. More... | |
int | crm_time_compare (crm_time_t *dt, crm_time_t *rhs) |
int | crm_time_get_timeofday (crm_time_t *dt, uint32_t *h, uint32_t *m, uint32_t *s) |
int | crm_time_get_timezone (crm_time_t *dt, uint32_t *h, uint32_t *m) |
int | crm_time_get_gregorian (crm_time_t *dt, uint32_t *y, uint32_t *m, uint32_t *d) |
int | crm_time_get_ordinal (crm_time_t *dt, uint32_t *y, uint32_t *d) |
int | crm_time_get_isoweek (crm_time_t *dt, uint32_t *y, uint32_t *w, uint32_t *d) |
long long int | crm_time_get_seconds (crm_time_t *dt) |
long long int | crm_time_get_seconds_since_epoch (crm_time_t *dt) |
void | crm_time_set (crm_time_t *target, crm_time_t *source) |
void | crm_time_set_timet (crm_time_t *target, time_t *source) |
crm_time_t * | pcmk_copy_time (crm_time_t *source) |
crm_time_t * | crm_time_add (crm_time_t *dt, crm_time_t *value) |
crm_time_t * | crm_time_subtract (crm_time_t *dt, crm_time_t *value) |
void | crm_time_add_seconds (crm_time_t *dt, int value) |
Add a given number of seconds to a date/time or duration. More... | |
void | crm_time_add_minutes (crm_time_t *dt, int value) |
void | crm_time_add_hours (crm_time_t *dt, int value) |
void | crm_time_add_days (crm_time_t *dt, int value) |
void | crm_time_add_weeks (crm_time_t *dt, int value) |
void | crm_time_add_months (crm_time_t *dt, int value) |
void | crm_time_add_years (crm_time_t *dt, int value) |
int | crm_time_january1_weekday (int year) |
int | crm_time_weeks_in_year (int year) |
int | crm_time_days_in_month (int month, int year) |
Return number of days in given month of given year. More... | |
bool | crm_time_leapyear (int year) |
bool | crm_time_check (crm_time_t *dt) |
Check whether a time object represents a sensible date/time. More... | |
ISO_8601 Date handling.
Definition in file iso8601.h.
#define crm_time_log | ( | level, | |
prefix, | |||
dt, | |||
flags | |||
) | crm_time_log_alias(level, __FILE__, __func__, __LINE__, prefix, dt, flags) |
typedef struct crm_time_period_s crm_time_period_t |
typedef struct crm_time_s crm_time_t |
crm_time_t* crm_time_add | ( | crm_time_t * | dt, |
crm_time_t * | value | ||
) |
void crm_time_add_days | ( | crm_time_t * | dt, |
int | value | ||
) |
void crm_time_add_hours | ( | crm_time_t * | dt, |
int | value | ||
) |
void crm_time_add_minutes | ( | crm_time_t * | dt, |
int | value | ||
) |
void crm_time_add_months | ( | crm_time_t * | dt, |
int | value | ||
) |
void crm_time_add_seconds | ( | crm_time_t * | a_time, |
int | extra | ||
) |
void crm_time_add_weeks | ( | crm_time_t * | dt, |
int | value | ||
) |
void crm_time_add_years | ( | crm_time_t * | dt, |
int | value | ||
) |
char* crm_time_as_string | ( | crm_time_t * | dt, |
int | flags | ||
) |
crm_time_t* crm_time_calculate_duration | ( | crm_time_t * | dt, |
crm_time_t * | value | ||
) |
bool crm_time_check | ( | crm_time_t * | dt | ) |
int crm_time_compare | ( | crm_time_t * | dt, |
crm_time_t * | rhs | ||
) |
int crm_time_days_in_month | ( | int | month, |
int | year | ||
) |
void crm_time_free | ( | crm_time_t * | dt | ) |
void crm_time_free_period | ( | crm_time_period_t * | period | ) |
int crm_time_get_gregorian | ( | crm_time_t * | dt, |
uint32_t * | y, | ||
uint32_t * | m, | ||
uint32_t * | d | ||
) |
int crm_time_get_isoweek | ( | crm_time_t * | dt, |
uint32_t * | y, | ||
uint32_t * | w, | ||
uint32_t * | d | ||
) |
int crm_time_get_ordinal | ( | crm_time_t * | dt, |
uint32_t * | y, | ||
uint32_t * | d | ||
) |
long long int crm_time_get_seconds | ( | crm_time_t * | dt | ) |
long long int crm_time_get_seconds_since_epoch | ( | crm_time_t * | dt | ) |
int crm_time_get_timeofday | ( | crm_time_t * | dt, |
uint32_t * | h, | ||
uint32_t * | m, | ||
uint32_t * | s | ||
) |
int crm_time_get_timezone | ( | crm_time_t * | dt, |
uint32_t * | h, | ||
uint32_t * | m | ||
) |
bool crm_time_is_defined | ( | const crm_time_t * | t | ) |
void crm_time_log_alias | ( | int | log_level, |
const char * | file, | ||
const char * | function, | ||
int | line, | ||
const char * | prefix, | ||
crm_time_t * | date_time, | ||
int | flags | ||
) |
crm_time_t* crm_time_new | ( | const char * | string | ) |
crm_time_t* crm_time_new_undefined | ( | void | ) |
Allocate memory for an uninitialized time object.
crm_time_t* crm_time_parse_duration | ( | const char * | period_s | ) |
Parse a time duration from an ISO 8601 duration specification.
[in] | period_s | ISO 8601 duration specification (optionally followed by whitespace, after which the rest of the string will be ignored) |
crm_time_period_t* crm_time_parse_period | ( | const char * | period_str | ) |
Parse a time period from an ISO 8601 interval specification.
[in] | period_str | ISO 8601 interval specification (start/end, start/duration, or duration/end) |
void crm_time_set | ( | crm_time_t * | target, |
crm_time_t * | source | ||
) |
void crm_time_set_timet | ( | crm_time_t * | target, |
time_t * | source | ||
) |
crm_time_t* crm_time_subtract | ( | crm_time_t * | dt, |
crm_time_t * | value | ||
) |
crm_time_t* pcmk_copy_time | ( | crm_time_t * | source | ) |