Libical API Documentation
4.0 STABLE VERSION
[Visit the v3.0 documentation]
Toggle main menu visibility
Loading...
Searching...
No Matches
src
libicalvcard
vcardtime.h
Go to the documentation of this file.
1
/*======================================================================
2
FILE: vcardtime.h
3
CREATOR: Ken Murchison 24 Aug 2022
4
5
SPDX-FileCopyrightText: 2022, Fastmail Pty. Ltd. (https://fastmail.com)
6
SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7
======================================================================*/
8
13
14
#ifndef VCARDTIME_H
15
#define VCARDTIME_H
16
17
#include "libical_vcard_export.h"
18
19
#include <stdbool.h>
20
21
typedef
struct
vcardtimetype
{
22
int
year
;
/* 0000-9999 */
23
int
month
;
/* 01 (Jan) to 12 (Dec). */
24
int
day
;
/* 01-28/29/30/31 depending on month and leap year */
25
int
hour
;
/* 00-23 */
26
int
minute
;
/* 00-59 */
27
int
second
;
/* 00-58/59/60 depending on leap second */
28
/* vCard v3 allows fractional sec, but v4 does not. We parse and ignore */
29
int
utcoffset
;
/* -720 to +840 minutes (-12:00 to +14:00) */
30
}
vcardtimetype
;
31
32
#define vcardtime_null_date() vcardtime_null_datetime()
33
#define vcardtime_null_time() vcardtime_null_datetime()
34
#define vcardtime_null_timestamp() vcardtime_null_datetime()
35
36
LIBICAL_VCARD_EXPORT
vcardtimetype
vcardtime_null_datetime
(
void
);
37
LIBICAL_VCARD_EXPORT
vcardtimetype
vcardtime_current_utc_time
(
void
);
38
39
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_null_datetime
(
const
vcardtimetype
t);
40
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_time
(
const
vcardtimetype
t);
41
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_date
(
const
vcardtimetype
t);
42
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_datetime
(
const
vcardtimetype
t);
43
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_timestamp
(
const
vcardtimetype
t);
44
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_utc
(
const
vcardtimetype
t);
45
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_leap_year
(
const
int
year);
46
LIBICAL_VCARD_EXPORT
bool
vcardtime_is_valid_time
(
const
struct
vcardtimetype
t);
47
48
#define VCARDTIME_BARE_TIME (0x1)
/* 'T' not needed for TIME */
49
#define VCARDTIME_AS_V4 (0x2)
/* allow partial date and/or time */
50
51
LIBICAL_VCARD_EXPORT
const
char
*
vcardtime_as_vcard_string
(
const
vcardtimetype
t,
52
unsigned
flags);
53
LIBICAL_VCARD_EXPORT
char
*
vcardtime_as_vcard_string_r
(
const
vcardtimetype
t,
54
unsigned
flags);
55
56
LIBICAL_VCARD_EXPORT
vcardtimetype
vcardtime_from_string
(
const
char
*str,
57
int
is_bare_time);
58
59
#endif
/* VCARDTIME_H */
vcardtimetype
Definition
vcardtime.h:21
vcardtimetype::minute
int minute
Definition
vcardtime.h:26
vcardtimetype::day
int day
Definition
vcardtime.h:24
vcardtimetype::year
int year
Definition
vcardtime.h:22
vcardtimetype::utcoffset
int utcoffset
Definition
vcardtime.h:29
vcardtimetype::hour
int hour
Definition
vcardtime.h:25
vcardtimetype::second
int second
Definition
vcardtime.h:27
vcardtimetype::month
int month
Definition
vcardtime.h:23
vcardtime_current_utc_time
vcardtimetype vcardtime_current_utc_time(void)
Definition
vcardtime.c:37
vcardtime_is_timestamp
bool vcardtime_is_timestamp(const vcardtimetype t)
Definition
vcardtime.c:79
vcardtime_is_date
bool vcardtime_is_date(const vcardtimetype t)
Definition
vcardtime.c:64
vcardtime_from_string
vcardtimetype vcardtime_from_string(const char *str, int is_bare_time)
Definition
vcardtime.c:490
vcardtime_is_valid_time
bool vcardtime_is_valid_time(const struct vcardtimetype t)
Definition
vcardtime.c:105
vcardtime_is_null_datetime
bool vcardtime_is_null_datetime(const vcardtimetype t)
Definition
vcardtime.c:69
vcardtime_as_vcard_string
const char * vcardtime_as_vcard_string(const vcardtimetype t, unsigned flags)
Definition
vcardtime.c:285
vcardtime_is_time
bool vcardtime_is_time(const vcardtimetype t)
Definition
vcardtime.c:59
vcardtime_null_datetime
vcardtimetype vcardtime_null_datetime(void)
Definition
vcardtime.c:30
vcardtime_is_datetime
bool vcardtime_is_datetime(const vcardtimetype t)
Definition
vcardtime.c:74
vcardtime_as_vcard_string_r
char * vcardtime_as_vcard_string_r(const vcardtimetype t, unsigned flags)
Definition
vcardtime.c:266
vcardtime_is_utc
bool vcardtime_is_utc(const vcardtimetype t)
Definition
vcardtime.c:86
vcardtime_is_leap_year
bool vcardtime_is_leap_year(const int year)
Definition
vcardtime.c:91
Generated on
for Libical API Documentation by
1.18.0