19#include "icalerror_p.h"
23#define TMP_BUF_SIZE 1024
26#if ICAL_SYNC_MODE == ICAL_SYNC_MODE_PTHREAD
28static pthread_mutex_t unk_token_mutex = PTHREAD_MUTEX_INITIALIZER;
101 const char *s, *p1, *p2;
103 short major = 0, minor = 0;
105 icalerror_check_arg((str != 0),
"str");
114 while (*s && isprint((
unsigned char)*s)) {
124 sscanf(str,
"%hd.%hd", &major, &minor);
126 if (major <= 0 || minor < 0) {
138 p1 = strchr(str,
';');
148 p2 = strchr(p1 + 1,
';');
149 if (p2 != 0 && *(p2 + 1) != 0) {
173 if (stat.
desc == 0) {
177 if (stat.
debug != 0) {
192#if ICAL_SYNC_MODE == ICAL_SYNC_MODE_PTHREAD
193 pthread_mutex_lock(&unk_token_mutex);
196 myHandling = unknownTokenHandling;
198#if ICAL_SYNC_MODE == ICAL_SYNC_MODE_PTHREAD
199 pthread_mutex_unlock(&unk_token_mutex);
207#if ICAL_SYNC_MODE == ICAL_SYNC_MODE_PTHREAD
208 pthread_mutex_lock(&unk_token_mutex);
211 unknownTokenHandling = newSetting;
213#if ICAL_SYNC_MODE == ICAL_SYNC_MODE_PTHREAD
214 pthread_mutex_unlock(&unk_token_mutex);
bool icaldurationtype_is_bad_duration(struct icaldurationtype d)
Checks if a duration is a bad duration.
struct icaldurationtype icaldurationtype_from_seconds(int seconds)
Creates a new icaldurationtype from a duration in seconds.
struct icaldurationtype icaldurationtype_from_string(const char *str)
Creates a new icaldurationtype from a duration given as a string.
bool icaldurationtype_is_null_duration(struct icaldurationtype d)
Checks if a duration is a null duration.
const char * icalenum_reqstat_desc(icalrequeststatus stat)
short icalenum_reqstat_major(icalrequeststatus stat)
icalrequeststatus icalenum_num_to_reqstat(short major, short minor)
short icalenum_reqstat_minor(icalrequeststatus stat)
void icalerror_set_errno(icalerrorenum x)
Sets the icalerrno to a given error.
icalerrorstate
Determine if an error is fatal or non-fatal.
icalerrorstate icalerror_get_error_state(icalerrorenum error)
Gets the error state (severity) for a given error.
icalerrorenum
Represents the different types of errors that can be triggered in libical.
@ ICAL_MALFORMEDDATA_ERROR
void icalerror_set_error_state(icalerrorenum error, icalerrorstate state)
Sets the icalerrorstate for a given icalerrorenum error.
#define icalerrno
Access the current icalerrno value.
void * icalmemory_new_buffer(size_t size)
Creates new buffer with the specified size.
char * icalmemory_tmp_copy(const char *str)
Creates a copy of the given string, stored on the ring buffer, and returns it.
void icalmemory_add_tmp_buffer(void *buf)
Adds an externally allocated buffer to the ring.
Common memory management routines.
struct icaltimetype icaltime_from_string(const char *str)
bool icaltime_is_null_time(const struct icaltimetype t)
struct icaltimetype icaltime_null_time(void)
void ical_set_unknown_token_handling_setting(ical_unknown_token_handling newSetting)
struct icaltriggertype icaltriggertype_from_string(const char *str)
const char * icalreqstattype_as_string(struct icalreqstattype stat)
struct icaltriggertype icaltriggertype_from_seconds(const int reltime)
ical_unknown_token_handling ical_get_unknown_token_handling_setting(void)
bool icaltriggertype_is_null_trigger(struct icaltriggertype tr)
bool icaltriggertype_is_bad_trigger(struct icaltriggertype tr)
struct icalreqstattype icalreqstattype_from_string(const char *str)
char * icalreqstattype_as_string_r(struct icalreqstattype stat)
Define internal types and provide functions to manipulate them.
ical_unknown_token_handling
struct icaldurationtype duration