pacemaker  2.0.2-debe490
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iso8601_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2017 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This software is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef CRM_COMMON_ISO8601_INTERNAL
22 # define CRM_COMMON_ISO8601_INTERNAL
23 #include <time.h>
24 #include <sys/time.h>
25 #include <ctype.h>
26 #include <crm/common/iso8601.h>
27 
28 typedef struct crm_time_us crm_time_hr_t;
30 void crm_time_set_hr_dt(crm_time_t *target, crm_time_hr_t *hr_dt);
32  struct timeval *tv);
33 crm_time_hr_t *crm_time_hr_new(const char *date_time);
34 void crm_time_hr_free(crm_time_hr_t * hr_dt);
35 char *crm_time_format_hr(const char *format, crm_time_hr_t * hr_dt);
36 
37 crm_time_t *parse_date(const char *date_str); /* in iso8601.c global but
38  not in header */
39 
40 struct crm_time_us {
41  int years;
42  int months; /* Only for durations */
43  int days;
44  int seconds;
45  int offset; /* Seconds */
46  bool duration;
47  int useconds;
48 };
49 #endif
struct crm_time_s crm_time_t
Definition: iso8601.h:32
char * crm_time_format_hr(const char *format, crm_time_hr_t *hr_dt)
Definition: iso8601.c:1366
crm_time_t * parse_date(const char *date_str)
Definition: iso8601.c:636
crm_time_hr_t * crm_time_hr_new(const char *date_time)
Definition: iso8601.c:1340
ISO_8601 Date handling.
void crm_time_hr_free(crm_time_hr_t *hr_dt)
Definition: iso8601.c:1360
void crm_time_set_hr_dt(crm_time_t *target, crm_time_hr_t *hr_dt)
Definition: iso8601.c:1312
crm_time_hr_t * crm_time_hr_convert(crm_time_hr_t *target, crm_time_t *dt)
Definition: iso8601.c:1290
crm_time_hr_t * crm_time_timeval_hr_convert(crm_time_hr_t *target, struct timeval *tv)
Definition: iso8601.c:1326