pacemaker  1.1.16-94ff4df
Scalable High-Availability cluster resource manager
Macros | Functions | Variables
iso8601.c File Reference
#include <crm_internal.h>
#include <crm/crm.h>
#include <time.h>
#include <ctype.h>
#include <crm/common/iso8601.h>
Include dependency graph for iso8601.c:

Go to the source code of this file.

Macros

#define GMTOFF(tm)   (-timezone+daylight)
 
#define EPOCH_SECONDS   62135596800ULL /* Calculated using crm_time_get_seconds() */
 
#define do_cmp_field(l, r, field)
 

Functions

char * crm_time_as_string (crm_time_t *date_time, int flags)
 
crm_time_tparse_date (const char *date_str)
 
gboolean check_for_ordinal (const char *str)
 
crm_time_tcrm_time_new (const char *date_time)
 
void crm_time_free (crm_time_t *dt)
 
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)
 
bool crm_time_leapyear (int year)
 
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)
 
int crm_time_get_timeofday (crm_time_t *dt, uint *h, uint *m, uint *s)
 
int crm_time_get_timezone (crm_time_t *dt, uint *h, uint *m)
 
long long crm_time_get_seconds (crm_time_t *dt)
 
long long crm_time_get_seconds_since_epoch (crm_time_t *dt)
 
int crm_time_get_gregorian (crm_time_t *dt, uint *y, uint *m, uint *d)
 
int crm_time_get_ordinal (crm_time_t *dt, uint *y, uint *d)
 
int crm_time_get_isoweek (crm_time_t *dt, uint *y, uint *w, uint *d)
 
crm_time_tcrm_time_parse_duration (const char *interval_str)
 
crm_time_period_tcrm_time_parse_period (const char *period_str)
 
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_tcrm_time_add (crm_time_t *dt, crm_time_t *value)
 
crm_time_tcrm_time_calculate_duration (crm_time_t *dt, crm_time_t *value)
 
crm_time_tcrm_time_subtract (crm_time_t *dt, crm_time_t *value)
 
bool crm_time_check (crm_time_t *dt)
 
int crm_time_compare (crm_time_t *a, crm_time_t *b)
 
void crm_time_add_seconds (crm_time_t *a_time, int extra)
 
void crm_time_add_days (crm_time_t *a_time, int extra)
 
void crm_time_add_months (crm_time_t *a_time, int extra)
 
void crm_time_add_minutes (crm_time_t *a_time, int extra)
 
void crm_time_add_hours (crm_time_t *a_time, int extra)
 
void crm_time_add_weeks (crm_time_t *a_time, int extra)
 
void crm_time_add_years (crm_time_t *a_time, int extra)
 

Variables

int month_days [14] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 29 }
 

Macro Definition Documentation

#define do_cmp_field (   l,
  r,
  field 
)
Value:
if(rc == 0) { \
if(l->field > r->field) { \
crm_trace("%s: %d > %d", \
#field, l->field, r->field); \
rc = 1; \
} else if(l->field < r->field) { \
crm_trace("%s: %d < %d", \
#field, l->field, r->field); \
rc = -1; \
} \
}
#define crm_trace(fmt, args...)
Definition: logging.h:254

Definition at line 1133 of file iso8601.c.

#define EPOCH_SECONDS   62135596800ULL /* Calculated using crm_time_get_seconds() */

Definition at line 303 of file iso8601.c.

#define GMTOFF (   tm)    (-timezone+daylight)

Definition at line 56 of file iso8601.c.

Function Documentation

gboolean check_for_ordinal ( const char *  str)
crm_time_t* crm_time_add ( crm_time_t dt,
crm_time_t value 
)

Definition at line 1048 of file iso8601.c.

void crm_time_add_days ( crm_time_t a_time,
int  extra 
)

Definition at line 1195 of file iso8601.c.

void crm_time_add_hours ( crm_time_t a_time,
int  extra 
)

Definition at line 1268 of file iso8601.c.

void crm_time_add_minutes ( crm_time_t a_time,
int  extra 
)

Definition at line 1262 of file iso8601.c.

void crm_time_add_months ( crm_time_t a_time,
int  extra 
)

Definition at line 1220 of file iso8601.c.

void crm_time_add_seconds ( crm_time_t a_time,
int  extra 
)

Definition at line 1174 of file iso8601.c.

void crm_time_add_weeks ( crm_time_t a_time,
int  extra 
)

Definition at line 1274 of file iso8601.c.

void crm_time_add_years ( crm_time_t a_time,
int  extra 
)

Definition at line 1280 of file iso8601.c.

char* crm_time_as_string ( crm_time_t date_time,
int  flags 
)

Definition at line 405 of file iso8601.c.

crm_time_t* crm_time_calculate_duration ( crm_time_t dt,
crm_time_t value 
)

Definition at line 1070 of file iso8601.c.

bool crm_time_check ( crm_time_t dt)

Definition at line 1115 of file iso8601.c.

int crm_time_compare ( crm_time_t a,
crm_time_t b 
)

Definition at line 1147 of file iso8601.c.

int crm_time_days_in_month ( int  month,
int  year 
)

Definition at line 178 of file iso8601.c.

void crm_time_free ( crm_time_t dt)

Definition at line 115 of file iso8601.c.

int crm_time_get_gregorian ( crm_time_t dt,
uint *  y,
uint *  m,
uint *  d 
)

Definition at line 311 of file iso8601.c.

int crm_time_get_isoweek ( crm_time_t dt,
uint *  y,
uint *  w,
uint *  d 
)

Definition at line 351 of file iso8601.c.

int crm_time_get_ordinal ( crm_time_t dt,
uint *  y,
uint *  d 
)

Definition at line 343 of file iso8601.c.

long long crm_time_get_seconds ( crm_time_t dt)

Definition at line 269 of file iso8601.c.

long long crm_time_get_seconds_since_epoch ( crm_time_t dt)

Definition at line 305 of file iso8601.c.

int crm_time_get_timeofday ( crm_time_t dt,
uint *  h,
uint *  m,
uint *  s 
)

Definition at line 255 of file iso8601.c.

int crm_time_get_timezone ( crm_time_t dt,
uint *  h,
uint *  m 
)

Definition at line 261 of file iso8601.c.

int crm_time_january1_weekday ( int  year)

Definition at line 143 of file iso8601.c.

bool crm_time_leapyear ( int  year)

Definition at line 187 of file iso8601.c.

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 
)

Definition at line 212 of file iso8601.c.

crm_time_t* crm_time_new ( const char *  date_time)

Definition at line 98 of file iso8601.c.

crm_time_t* crm_time_parse_duration ( const char *  interval_str)

Definition at line 830 of file iso8601.c.

crm_time_period_t* crm_time_parse_period ( const char *  period_str)

Definition at line 902 of file iso8601.c.

void crm_time_set ( crm_time_t target,
crm_time_t source 
)

Definition at line 980 of file iso8601.c.

void crm_time_set_timet ( crm_time_t target,
time_t *  source 
)

Definition at line 1042 of file iso8601.c.

crm_time_t* crm_time_subtract ( crm_time_t dt,
crm_time_t value 
)

Definition at line 1093 of file iso8601.c.

int crm_time_weeks_in_year ( int  year)

Definition at line 156 of file iso8601.c.

crm_time_t * parse_date ( const char *  date_str)

Definition at line 648 of file iso8601.c.

Variable Documentation

int month_days[14] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 29 }

Definition at line 175 of file iso8601.c.