pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
iso8601.h File Reference

ISO_8601 Date handling. More...

#include <time.h>
#include <ctype.h>
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for iso8601.h:
This graph shows which files directly or indirectly include this file:

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__, __FUNCTION__, __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_tcrm_time_new (const char *string)
 
void crm_time_free (crm_time_t *dt)
 
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_tcrm_time_parse_duration (const char *duration_str)
 
crm_time_tcrm_time_calculate_duration (crm_time_t *dt, crm_time_t *value)
 
crm_time_period_tcrm_time_parse_period (const char *period_str)
 
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_tcrm_time_add (crm_time_t *dt, crm_time_t *value)
 
crm_time_tcrm_time_subtract (crm_time_t *dt, crm_time_t *value)
 
void crm_time_add_seconds (crm_time_t *dt, int value)
 
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)
 
bool crm_time_leapyear (int year)
 
bool crm_time_check (crm_time_t *dt)
 

Detailed Description

ISO_8601 Date handling.

Definition in file iso8601.h.

Macro Definition Documentation

#define crm_time_epoch   0x200

Definition at line 70 of file iso8601.h.

#define crm_time_log (   level,
  prefix,
  dt,
  flags 
)    crm_time_log_alias(level, __FILE__, __FUNCTION__, __LINE__, prefix, dt, flags)

Definition at line 58 of file iso8601.h.

#define crm_time_log_date   0x001

Definition at line 62 of file iso8601.h.

#define crm_time_log_duration   0x008

Definition at line 65 of file iso8601.h.

#define crm_time_log_timeofday   0x002

Definition at line 63 of file iso8601.h.

#define crm_time_log_with_timezone   0x004

Definition at line 64 of file iso8601.h.

#define crm_time_ordinal   0x010

Definition at line 67 of file iso8601.h.

#define crm_time_seconds   0x100

Definition at line 69 of file iso8601.h.

#define crm_time_weeks   0x020

Definition at line 68 of file iso8601.h.

Typedef Documentation

typedef struct crm_time_s crm_time_t

Definition at line 32 of file iso8601.h.

Function Documentation

crm_time_t* crm_time_add ( crm_time_t dt,
crm_time_t value 
)

Definition at line 1034 of file iso8601.c.

void crm_time_add_days ( crm_time_t dt,
int  value 
)

Definition at line 1181 of file iso8601.c.

void crm_time_add_hours ( crm_time_t dt,
int  value 
)

Definition at line 1254 of file iso8601.c.

void crm_time_add_minutes ( crm_time_t dt,
int  value 
)

Definition at line 1248 of file iso8601.c.

void crm_time_add_months ( crm_time_t dt,
int  value 
)

Definition at line 1206 of file iso8601.c.

void crm_time_add_seconds ( crm_time_t dt,
int  value 
)

Definition at line 1160 of file iso8601.c.

void crm_time_add_weeks ( crm_time_t dt,
int  value 
)

Definition at line 1260 of file iso8601.c.

void crm_time_add_years ( crm_time_t dt,
int  value 
)

Definition at line 1266 of file iso8601.c.

char * crm_time_as_string ( crm_time_t dt,
int  flags 
)

Definition at line 393 of file iso8601.c.

crm_time_t* crm_time_calculate_duration ( crm_time_t dt,
crm_time_t value 
)

Definition at line 1056 of file iso8601.c.

bool crm_time_check ( crm_time_t dt)

Definition at line 1101 of file iso8601.c.

int crm_time_compare ( crm_time_t dt,
crm_time_t rhs 
)

Definition at line 1133 of file iso8601.c.

int crm_time_days_in_month ( int  month,
int  year 
)

Definition at line 164 of file iso8601.c.

void crm_time_free ( crm_time_t dt)

Definition at line 101 of file iso8601.c.

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)

Definition at line 255 of file iso8601.c.

long long int crm_time_get_seconds_since_epoch ( crm_time_t dt)

Definition at line 291 of file iso8601.c.

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_january1_weekday ( int  year)

Definition at line 129 of file iso8601.c.

bool crm_time_leapyear ( int  year)

Definition at line 173 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 198 of file iso8601.c.

crm_time_t* crm_time_new ( const char *  string)

Definition at line 84 of file iso8601.c.

crm_time_t* crm_time_parse_duration ( const char *  duration_str)

Definition at line 816 of file iso8601.c.

crm_time_period_t* crm_time_parse_period ( const char *  period_str)

Definition at line 888 of file iso8601.c.

void crm_time_set ( crm_time_t target,
crm_time_t source 
)

Definition at line 966 of file iso8601.c.

void crm_time_set_timet ( crm_time_t target,
time_t *  source 
)

Definition at line 1028 of file iso8601.c.

crm_time_t* crm_time_subtract ( crm_time_t dt,
crm_time_t value 
)

Definition at line 1079 of file iso8601.c.

int crm_time_weeks_in_year ( int  year)

Definition at line 142 of file iso8601.c.