summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.krazy2
-rw-r--r--src/libical/astime.h36
-rw-r--r--src/libical/icalarray.h18
-rw-r--r--src/libical/icalattach.h50
-rw-r--r--src/libical/icalcomponent.h261
-rw-r--r--src/libical/icalenums.h42
-rw-r--r--src/libical/icalerror.h108
-rw-r--r--src/libical/icallangbind.h48
-rw-r--r--src/libical/icalmime.h9
-rw-r--r--src/libical/icalparameter.h63
-rw-r--r--src/libical/icalparser.h43
-rw-r--r--src/libical/icalperiod.h17
-rw-r--r--src/libical/icalrecur.h122
-rw-r--r--src/libical/icalrestriction.h31
-rw-r--r--src/libical/icaltime.h113
-rw-r--r--src/libical/icaltimezone.h76
-rw-r--r--src/libical/icaltypes.h56
-rw-r--r--src/libical/icaltz-util.h7
-rw-r--r--src/libical/icalvalue.h40
-rw-r--r--src/libical/pvl.c25
-rw-r--r--src/libical/pvl.h74
-rw-r--r--src/libical/sspm.h43
-rw-r--r--src/libicalss/icalbdbset.h175
-rw-r--r--src/libicalss/icalcalendar.h21
-rw-r--r--src/libicalss/icalclassify.h16
-rw-r--r--src/libicalss/icalcluster.h43
-rw-r--r--src/libicalss/icaldirset.h67
-rw-r--r--src/libicalss/icalfileset.h78
-rw-r--r--src/libicalss/icalgauge.h17
-rw-r--r--src/libicalss/icalmessage.h67
-rw-r--r--src/libicalss/icalset.h124
-rw-r--r--src/libicalss/icalspanlist.h28
-rw-r--r--src/libicalvcal/CMakeLists.txt3
-rw-r--r--src/libicalvcal/icalvcal.h11
-rw-r--r--src/libicalvcal/port.h88
-rw-r--r--src/libicalvcal/vcaltmp.c20
-rw-r--r--src/libicalvcal/vcaltmp.h121
-rw-r--r--src/libicalvcal/vcc.c35
-rw-r--r--src/libicalvcal/vcc.h17
-rw-r--r--src/libicalvcal/vcc.y1139
-rw-r--r--src/libicalvcal/vobject.c136
-rw-r--r--src/libicalvcal/vobject.h169
42 files changed, 1832 insertions, 1827 deletions
diff --git a/.krazy b/.krazy
index 8a90fd4b..74a8898f 100644
--- a/.krazy
+++ b/.krazy
@@ -1,6 +1,6 @@
CHECKSETS foss,c++
-EXTRA crud,camelcase,defines
+EXTRA crud,camelcase
#EXTRA style
#Skip ancient Apple files
diff --git a/src/libical/astime.h b/src/libical/astime.h
index bb41a6fd..444ba06b 100644
--- a/src/libical/astime.h
+++ b/src/libical/astime.h
@@ -42,24 +42,28 @@
#ifndef ICAL_astime_h
#define ICAL_astime_h
-typedef struct ut_instant {
- double j_date; /**< julian decimal date, 0 = 01 Jan 4713 BC 12 HR UT */
- long year; /**< year, valid range [-4,713, +2,147,483,647] */
- int month; /**< [1-12] */
- int day; /**< [1-31] */
- int i_hour; /**< [0-23] */
- int i_minute; /**< [0-59] */
- int i_second; /**< [0-59] */
- double d_hour; /**< [0.0-23.9999] includes minute and second */
- double d_minute; /**< [0.0-59.9999] includes second */
- double d_second; /**< [0.0-59.9999] */
- int weekday; /**< [0-6] */
- int day_of_year; /**< [1-366] */
-} UTinstant, * UTinstantPtr;
+#include "libical_ical_export.h"
+
+typedef struct ut_instant
+{
+ double j_date; /**< julian decimal date, 0 = 01 Jan 4713 BC 12 HR UT */
+ long year; /**< year, valid range [-4,713, +2,147,483,647] */
+ int month; /**< [1-12] */
+ int day; /**< [1-31] */
+ int i_hour; /**< [0-23] */
+ int i_minute; /**< [0-59] */
+ int i_second; /**< [0-59] */
+ double d_hour; /**< [0.0-23.9999] includes minute and second */
+ double d_minute; /**< [0.0-59.9999] includes second */
+ double d_second; /**< [0.0-59.9999] */
+ int weekday; /**< [0-6] */
+ int day_of_year; /**< [1-366] */
+} UTinstant, *UTinstantPtr;
/* Functions in caldate.c */
-long caldat( UTinstantPtr ); /** converts julian date to year,mo,da */
-double juldat( UTinstantPtr ); /** returns julian day from year,mo,da */
+LIBICAL_ICAL_EXPORT long caldat(UTinstantPtr); /** converts julian date to year,mo,da */
+
+LIBICAL_ICAL_EXPORT double juldat(UTinstantPtr); /** returns julian day from year,mo,da */
#endif
diff --git a/src/libical/icalarray.h b/src/libical/icalarray.h
index e82cfea6..104630af 100644
--- a/src/libical/icalarray.h
+++ b/src/libical/icalarray.h
@@ -28,7 +28,8 @@
#include "libical_ical_export.h"
typedef struct _icalarray icalarray;
-struct _icalarray {
+struct _icalarray
+{
size_t element_size;
size_t increment_size;
size_t num_elements;
@@ -36,18 +37,19 @@ struct _icalarray {
void **chunks;
};
-icalarray *icalarray_new(size_t element_size, size_t increment_size);
+LIBICAL_ICAL_EXPORT icalarray *icalarray_new(size_t element_size, size_t increment_size);
-icalarray *icalarray_copy(icalarray *array);
+LIBICAL_ICAL_EXPORT icalarray *icalarray_copy(icalarray * array);
-void icalarray_free(icalarray *array);
+LIBICAL_ICAL_EXPORT void icalarray_free(icalarray * array);
-void icalarray_append(icalarray *array, const void *element);
+LIBICAL_ICAL_EXPORT void icalarray_append(icalarray * array, const void *element);
-void icalarray_remove_element_at(icalarray *array, size_t position);
+LIBICAL_ICAL_EXPORT void icalarray_remove_element_at(icalarray * array, size_t position);
-LIBICAL_ICAL_EXPORT void *icalarray_element_at(icalarray *array, size_t position);
+LIBICAL_ICAL_EXPORT void *icalarray_element_at(icalarray * array, size_t position);
-void icalarray_sort(icalarray *array, int (*compare)(const void *, const void *));
+LIBICAL_ICAL_EXPORT void icalarray_sort(icalarray * array,
+ int (*compare) (const void *, const void *));
#endif /* ICALARRAY_H */
diff --git a/src/libical/icalattach.h b/src/libical/icalattach.h
index 23562e91..95b228c0 100644
--- a/src/libical/icalattach.h
+++ b/src/libical/icalattach.h
@@ -23,32 +23,42 @@
typedef struct icalattach_impl icalattach;
-typedef void (* icalattach_free_fn_t) (unsigned char *data, void *user_data);
+typedef void (*icalattach_free_fn_t) (unsigned char *data, void *user_data);
-LIBICAL_ICAL_EXPORT icalattach *icalattach_new_from_url (const char *url);
-icalattach *icalattach_new_from_data (const char *data,
- icalattach_free_fn_t free_fn, void *free_fn_data);
+LIBICAL_ICAL_EXPORT icalattach *icalattach_new_from_url(const char *url);
-void icalattach_ref (icalattach *attach);
-LIBICAL_ICAL_EXPORT void icalattach_unref (icalattach *attach);
+LIBICAL_ICAL_EXPORT icalattach *icalattach_new_from_data(const char *data,
+ icalattach_free_fn_t free_fn,
+ void *free_fn_data);
-int icalattach_get_is_url (icalattach *attach);
-LIBICAL_ICAL_EXPORT const char *icalattach_get_url (icalattach *attach);
-LIBICAL_ICAL_EXPORT unsigned char *icalattach_get_data (icalattach *attach);
+LIBICAL_ICAL_EXPORT void icalattach_ref(icalattach * attach);
-struct icalattachtype* icalattachtype_new(void);
-void icalattachtype_add_reference(struct icalattachtype* v);
-void icalattachtype_free(struct icalattachtype* v);
+LIBICAL_ICAL_EXPORT void icalattach_unref(icalattach * attach);
-void icalattachtype_set_url(struct icalattachtype* v, char* url);
-char* icalattachtype_get_url(struct icalattachtype* v);
+LIBICAL_ICAL_EXPORT int icalattach_get_is_url(icalattach * attach);
-void icalattachtype_set_base64(struct icalattachtype* v, char* base64,
- int owns);
-char* icalattachtype_get_base64(struct icalattachtype* v);
+LIBICAL_ICAL_EXPORT const char *icalattach_get_url(icalattach * attach);
-void icalattachtype_set_binary(struct icalattachtype* v, char* binary,
- int owns);
-void* icalattachtype_get_binary(struct icalattachtype* v);
+LIBICAL_ICAL_EXPORT unsigned char *icalattach_get_data(icalattach * attach);
+
+LIBICAL_ICAL_EXPORT struct icalattachtype *icalattachtype_new(void);
+
+LIBICAL_ICAL_EXPORT void icalattachtype_add_reference(struct icalattachtype *v);
+
+LIBICAL_ICAL_EXPORT void icalattachtype_free(struct icalattachtype *v);
+
+LIBICAL_ICAL_EXPORT void icalattachtype_set_url(struct icalattachtype *v, char *url);
+
+LIBICAL_ICAL_EXPORT char *icalattachtype_get_url(struct icalattachtype *v);
+
+LIBICAL_ICAL_EXPORT void icalattachtype_set_base64(struct icalattachtype *v,
+ char *base64, int owns);
+
+LIBICAL_ICAL_EXPORT char *icalattachtype_get_base64(struct icalattachtype *v);
+
+LIBICAL_ICAL_EXPORT void icalattachtype_set_binary(struct icalattachtype *v,
+ char *binary, int owns);
+
+LIBICAL_ICAL_EXPORT void *icalattachtype_get_binary(struct icalattachtype *v);
#endif /* !ICALATTACH_H */
diff --git a/src/libical/icalcomponent.h b/src/libical/icalcomponent.h
index 2a7814ac..63f11a93 100644
--- a/src/libical/icalcomponent.h
+++ b/src/libical/icalcomponent.h
@@ -21,7 +21,7 @@
#define ICALCOMPONENT_H
#include "libical_ical_export.h"
-#include "icalenums.h" /* defines icalcomponent_kind */
+#include "icalenums.h" /* defines icalcomponent_kind */
#include "icalproperty.h"
#include "pvl.h"
@@ -31,130 +31,132 @@ typedef struct icalcomponent_impl icalcomponent;
deallocate iterators. Pretend that you can't see it. */
typedef struct icalcompiter
{
- icalcomponent_kind kind;
- pvl_elem iter;
+ icalcomponent_kind kind;
+ pvl_elem iter;
} icalcompiter;
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new(icalcomponent_kind kind);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_clone(icalcomponent* component);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_from_string(const char* str);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_vanew(icalcomponent_kind kind, ...);
-icalcomponent* icalcomponent_new_x(const char* x_name);
-LIBICAL_ICAL_EXPORT void icalcomponent_free(icalcomponent* component);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new(icalcomponent_kind kind);
-LIBICAL_ICAL_EXPORT char* icalcomponent_as_ical_string(icalcomponent* component);
-LIBICAL_ICAL_EXPORT char* icalcomponent_as_ical_string_r(icalcomponent* component);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_clone(icalcomponent * component);
-LIBICAL_ICAL_EXPORT int icalcomponent_is_valid(icalcomponent* component);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_from_string(const char *str);
-LIBICAL_ICAL_EXPORT icalcomponent_kind icalcomponent_isa(const icalcomponent* component);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_vanew(icalcomponent_kind kind, ...);
-LIBICAL_ICAL_EXPORT int icalcomponent_isa_component (void* component);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_x(const char *x_name);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_free(icalcomponent * component);
+
+LIBICAL_ICAL_EXPORT char *icalcomponent_as_ical_string(icalcomponent * component);
+
+LIBICAL_ICAL_EXPORT char *icalcomponent_as_ical_string_r(icalcomponent * component);
+
+LIBICAL_ICAL_EXPORT int icalcomponent_is_valid(icalcomponent * component);
+
+LIBICAL_ICAL_EXPORT icalcomponent_kind icalcomponent_isa(const icalcomponent * component);
+
+LIBICAL_ICAL_EXPORT int icalcomponent_isa_component(void *component);
/*
* Working with properties
*/
-LIBICAL_ICAL_EXPORT void icalcomponent_add_property(icalcomponent* component,
- icalproperty* property);
+LIBICAL_ICAL_EXPORT void icalcomponent_add_property(icalcomponent * component,
+ icalproperty * property);
-LIBICAL_ICAL_EXPORT void icalcomponent_remove_property(icalcomponent* component,
- icalproperty* property);
+LIBICAL_ICAL_EXPORT void icalcomponent_remove_property(icalcomponent * component,
+ icalproperty * property);
-LIBICAL_ICAL_EXPORT int icalcomponent_count_properties(icalcomponent* component,
+LIBICAL_ICAL_EXPORT int icalcomponent_count_properties(icalcomponent * component,
icalproperty_kind kind);
/* Iterate through the properties */
-LIBICAL_ICAL_EXPORT icalproperty* icalcomponent_get_current_property(icalcomponent* component);
+LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_current_property(icalcomponent * component);
-LIBICAL_ICAL_EXPORT icalproperty* icalcomponent_get_first_property(icalcomponent* component,
+LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_first_property(icalcomponent * component,
icalproperty_kind kind);
-LIBICAL_ICAL_EXPORT icalproperty* icalcomponent_get_next_property(icalcomponent* component,
+LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_next_property(icalcomponent * component,
icalproperty_kind kind);
-
/*
* Working with components
*/
-
/* Return the first VEVENT, VTODO or VJOURNAL sub-component of cop, or
comp if it is one of those types */
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_get_inner(icalcomponent* comp);
-
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_inner(icalcomponent * comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_add_component(icalcomponent* parent,
- icalcomponent* child);
+LIBICAL_ICAL_EXPORT void icalcomponent_add_component(icalcomponent * parent, icalcomponent * child);
-LIBICAL_ICAL_EXPORT void icalcomponent_remove_component(icalcomponent* parent,
- icalcomponent* child);
+LIBICAL_ICAL_EXPORT void icalcomponent_remove_component(icalcomponent * parent,
+ icalcomponent * child);
-LIBICAL_ICAL_EXPORT int icalcomponent_count_components(icalcomponent* component,
+LIBICAL_ICAL_EXPORT int icalcomponent_count_components(icalcomponent * component,
icalcomponent_kind kind);
/**
This takes 2 VCALENDAR components and merges the second one into the first,
resolving any problems with conflicting TZIDs. comp_to_merge will no
longer exist after calling this function. */
-void icalcomponent_merge_component(icalcomponent* comp,
- icalcomponent* comp_to_merge);
-
+LIBICAL_ICAL_EXPORT void icalcomponent_merge_component(icalcomponent * comp,
+ icalcomponent * comp_to_merge);
/* Iteration Routines. There are two forms of iterators, internal and
external. The internal ones came first, and are almost completely
sufficient, but they fail badly when you want to construct a loop that
removes components from the container.*/
-
/* Iterate through components */
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_get_current_component (icalcomponent* component);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_current_component(icalcomponent * component);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_get_first_component(icalcomponent* component,
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_first_component(icalcomponent * component,
icalcomponent_kind kind);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_get_next_component(icalcomponent* component,
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_next_component(icalcomponent * component,
icalcomponent_kind kind);
/* Using external iterators */
-LIBICAL_ICAL_EXPORT icalcompiter icalcomponent_begin_component(icalcomponent* component,
+LIBICAL_ICAL_EXPORT icalcompiter icalcomponent_begin_component(icalcomponent * component,
icalcomponent_kind kind);
-LIBICAL_ICAL_EXPORT icalcompiter icalcomponent_end_component(icalcomponent* component,
+
+LIBICAL_ICAL_EXPORT icalcompiter icalcomponent_end_component(icalcomponent * component,
icalcomponent_kind kind);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcompiter_next(icalcompiter* i);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcompiter_prior(icalcompiter* i);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcompiter_deref(icalcompiter* i);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_next(icalcompiter * i);
-/* Working with embedded error properties */
+LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_prior(icalcompiter * i);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_deref(icalcompiter * i);
+/* Working with embedded error properties */
/* Check the component against itip rules and insert error properties*/
/* Working with embedded error properties */
-LIBICAL_ICAL_EXPORT int icalcomponent_check_restrictions(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT int icalcomponent_check_restrictions(icalcomponent * comp);
/** Count embedded errors. */
-LIBICAL_ICAL_EXPORT int icalcomponent_count_errors(icalcomponent* component);
+LIBICAL_ICAL_EXPORT int icalcomponent_count_errors(icalcomponent * component);
/** Remove all X-LIC-ERROR properties*/
-LIBICAL_ICAL_EXPORT void icalcomponent_strip_errors(icalcomponent* component);
+LIBICAL_ICAL_EXPORT void icalcomponent_strip_errors(icalcomponent * component);
/** Convert some X-LIC-ERROR properties into RETURN-STATUS properties*/
-LIBICAL_ICAL_EXPORT void icalcomponent_convert_errors(icalcomponent* component);
+LIBICAL_ICAL_EXPORT void icalcomponent_convert_errors(icalcomponent * component);
/* Internal operations. They are private, and you should not be using them. */
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_get_parent(icalcomponent* component);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_parent(icalcomponent* component,
- icalcomponent* parent);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_parent(icalcomponent * component);
-/* Kind conversion routines */
+LIBICAL_ICAL_EXPORT void icalcomponent_set_parent(icalcomponent * component,
+ icalcomponent * parent);
-int icalcomponent_kind_is_valid(const icalcomponent_kind kind);
+/* Kind conversion routines */
-LIBICAL_ICAL_EXPORT icalcomponent_kind icalcomponent_string_to_kind(const char* string);
+LIBICAL_ICAL_EXPORT int icalcomponent_kind_is_valid(const icalcomponent_kind kind);
-LIBICAL_ICAL_EXPORT const char* icalcomponent_kind_to_string(icalcomponent_kind kind);
+LIBICAL_ICAL_EXPORT icalcomponent_kind icalcomponent_string_to_kind(const char *string);
+LIBICAL_ICAL_EXPORT const char *icalcomponent_kind_to_string(icalcomponent_kind kind);
/************* Derived class methods. ****************************
@@ -164,17 +166,16 @@ wrong component subtypes. */
/** For VCOMPONENT: Return a reference to the first VEVENT, VTODO or
VJOURNAL */
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_first_real_component(icalcomponent * c);
/** For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end
times of an event in UTC */
-LIBICAL_ICAL_EXPORT struct icaltime_span icalcomponent_get_span(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT struct icaltime_span icalcomponent_get_span(icalcomponent * comp);
/******************** Convienience routines **********************/
-LIBICAL_ICAL_EXPORT void icalcomponent_set_dtstart(icalcomponent* comp,
- struct icaltimetype v);
-LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtstart(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT void icalcomponent_set_dtstart(icalcomponent * comp, struct icaltimetype v);
+LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtstart(icalcomponent * comp);
/* For the icalcomponent routines only, dtend and duration are tied
together. If you call the set routine for one and the other exists,
@@ -185,96 +186,120 @@ LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtstart(icalcomponent*
the return value. If you call a set routine and neither exists, the
routine will create the apcompriate comperty */
+LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtend(icalcomponent * comp);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_set_dtend(icalcomponent * comp, struct icaltimetype v);
-LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtend(icalcomponent* comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_dtend(icalcomponent* comp, struct icaltimetype v);
+LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_due(icalcomponent * comp);
-LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_due(icalcomponent* comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_due(icalcomponent* comp, struct icaltimetype v);
+LIBICAL_ICAL_EXPORT void icalcomponent_set_due(icalcomponent * comp, struct icaltimetype v);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_duration(icalcomponent* comp,
+LIBICAL_ICAL_EXPORT void icalcomponent_set_duration(icalcomponent * comp,
struct icaldurationtype v);
-LIBICAL_ICAL_EXPORT struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_method(icalcomponent* comp,
- icalproperty_method method);
-LIBICAL_ICAL_EXPORT icalproperty_method icalcomponent_get_method(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT struct icaldurationtype icalcomponent_get_duration(icalcomponent * comp);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_set_method(icalcomponent * comp, icalproperty_method method);
+
+LIBICAL_ICAL_EXPORT icalproperty_method icalcomponent_get_method(icalcomponent * comp);
+
+LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtstamp(icalcomponent * comp);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_set_dtstamp(icalcomponent * comp, struct icaltimetype v);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_set_summary(icalcomponent * comp, const char *v);
-LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_dtstamp(icalcomponent* comp,
- struct icaltimetype v);
+LIBICAL_ICAL_EXPORT const char *icalcomponent_get_summary(icalcomponent * comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_summary(icalcomponent* comp, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalcomponent_get_summary(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT void icalcomponent_set_comment(icalcomponent * comp, const char *v);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_comment(icalcomponent* comp, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalcomponent_get_comment(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT const char *icalcomponent_get_comment(icalcomponent * comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_uid(icalcomponent* comp, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalcomponent_get_uid(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT void icalcomponent_set_uid(icalcomponent * comp, const char *v);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_relcalid(icalcomponent* comp, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalcomponent_get_relcalid(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT const char *icalcomponent_get_uid(icalcomponent * comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_recurrenceid(icalcomponent* comp,
+LIBICAL_ICAL_EXPORT void icalcomponent_set_relcalid(icalcomponent * comp, const char *v);
+
+LIBICAL_ICAL_EXPORT const char *icalcomponent_get_relcalid(icalcomponent * comp);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_set_recurrenceid(icalcomponent * comp,
struct icaltimetype v);
-LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent* comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_description(icalcomponent* comp, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalcomponent_get_description(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent * comp);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_set_description(icalcomponent * comp, const char *v);
+
+LIBICAL_ICAL_EXPORT const char *icalcomponent_get_description(icalcomponent * comp);
+
+LIBICAL_ICAL_EXPORT void icalcomponent_set_location(icalcomponent * comp, const char *v);
+
+LIBICAL_ICAL_EXPORT const char *icalcomponent_get_location(icalcomponent * comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_location(icalcomponent* comp, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalcomponent_get_location(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT void icalcomponent_set_sequence(icalcomponent * comp, int v);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_sequence(icalcomponent* comp, int v);
-LIBICAL_ICAL_EXPORT int icalcomponent_get_sequence(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT int icalcomponent_get_sequence(icalcomponent * comp);
-LIBICAL_ICAL_EXPORT void icalcomponent_set_status(icalcomponent* comp,
- enum icalproperty_status v);
-LIBICAL_ICAL_EXPORT enum icalproperty_status icalcomponent_get_status(icalcomponent* comp);
+LIBICAL_ICAL_EXPORT void icalcomponent_set_status(icalcomponent * comp, enum icalproperty_status v);
+LIBICAL_ICAL_EXPORT enum icalproperty_status icalcomponent_get_status(icalcomponent * comp);
/** Calls the given function for each TZID parameter found in the
component, and any subcomponents. */
-void icalcomponent_foreach_tzid(icalcomponent* comp,
- void (*callback)(icalparameter *param, void *data),
- void *callback_data);
+LIBICAL_ICAL_EXPORT void icalcomponent_foreach_tzid(icalcomponent * comp,
+ void (*callback) (icalparameter * param,
+ void *data),
+ void *callback_data);
/** Returns the icaltimezone in the component corresponding to the
TZID, or NULL if it can't be found. */
-icaltimezone* icalcomponent_get_timezone(icalcomponent* comp,
- const char *tzid);
+LIBICAL_ICAL_EXPORT icaltimezone *icalcomponent_get_timezone(icalcomponent * comp,
+ const char *tzid);
-LIBICAL_ICAL_EXPORT int icalproperty_recurrence_is_excluded(icalcomponent *comp,
+LIBICAL_ICAL_EXPORT int icalproperty_recurrence_is_excluded(icalcomponent * comp,
struct icaltimetype *dtstart,
struct icaltimetype *recurtime);
-LIBICAL_ICAL_EXPORT void icalcomponent_foreach_recurrence(icalcomponent* comp,
+LIBICAL_ICAL_EXPORT void icalcomponent_foreach_recurrence(icalcomponent * comp,
struct icaltimetype start,
struct icaltimetype end,
- void (*callback)(icalcomponent *comp,
- struct icaltime_span *span,
- void *data),
+ void (*callback) (icalcomponent * comp,
+ struct icaltime_span *
+ span, void *data),
void *callback_data);
-
/*************** Type Specific routines ***************/
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vcalendar(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vevent(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vtodo(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vjournal(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_valarm(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vfreebusy(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vtimezone(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_xstandard(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_xdaylight(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vagenda(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalcomponent_new_vquery(void);
-icalcomponent* icalcomponent_new_vavailability(void);
-icalcomponent* icalcomponent_new_xavailable(void);
-icalcomponent* icalcomponent_new_vpoll(void);
-icalcomponent* icalcomponent_new_vvoter(void);
-icalcomponent* icalcomponent_new_xvote(void);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vcalendar(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vevent(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vtodo(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vjournal(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_valarm(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vfreebusy(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vtimezone(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xstandard(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xdaylight(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vagenda(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vquery(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vavailability(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xavailable(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vpoll(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_vvoter(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_xvote(void);
#endif /* !ICALCOMPONENT_H */
diff --git a/src/libical/icalenums.h b/src/libical/icalenums.h
index b00c7ab0..4cb76bad 100644
--- a/src/libical/icalenums.h
+++ b/src/libical/icalenums.h
@@ -1,10 +1,6 @@
-
-/* -*- Mode: C -*-*/
/*======================================================================
FILE: icalenums.h
-
-
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
@@ -14,16 +10,13 @@
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
- Or:
+ Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
- The original code is icalenums.h
-
- Contributions from:
- Graham Davison <g.m.davison@computer.org>
-
+ Contributions from:
+ Graham Davison <g.m.davison@computer.org>
======================================================================*/
#ifndef ICALENUMS_H
@@ -35,9 +28,10 @@
* Component enumerations
**********************************************************************/
-typedef enum icalcomponent_kind {
+typedef enum icalcomponent_kind
+{
ICAL_NO_COMPONENT,
- ICAL_ANY_COMPONENT, /* Used to select all components*/
+ ICAL_ANY_COMPONENT, /* Used to select all components */
ICAL_XROOT_COMPONENT,
ICAL_XATTACH_COMPONENT, /* MIME attached data, returned by parser. */
ICAL_VEVENT_COMPONENT,
@@ -62,22 +56,20 @@ typedef enum icalcomponent_kind {
ICAL_VCOMMAND_COMPONENT,
ICAL_XLICINVALID_COMPONENT,
ICAL_XLICMIMEPART_COMPONENT, /* a non-stardard component that mirrors
- structure of MIME data */
+ structure of MIME data */
ICAL_VAVAILABILITY_COMPONENT,
ICAL_XAVAILABLE_COMPONENT,
ICAL_VPOLL_COMPONENT,
ICAL_VVOTER_COMPONENT,
ICAL_XVOTE_COMPONENT
-
} icalcomponent_kind;
-
-
/***********************************************************************
* Request Status codes
**********************************************************************/
-typedef enum icalrequeststatus {
+typedef enum icalrequeststatus
+{
ICAL_UNKNOWN_STATUS,
ICAL_2_0_SUCCESS_STATUS,
ICAL_2_1_FALLBACK_STATUS,
@@ -116,26 +108,29 @@ typedef enum icalrequeststatus {
ICAL_5_2_NOSERVICE_STATUS,
ICAL_5_3_NOSCHED_STATUS,
ICAL_6_1_CONTAINER_NOT_FOUND,
- ICAL_9_0_UNRECOGNIZED_COMMAND
+ ICAL_9_0_UNRECOGNIZED_COMMAND
} icalrequeststatus;
+LIBICAL_ICAL_EXPORT const char *icalenum_reqstat_desc(icalrequeststatus stat);
-LIBICAL_ICAL_EXPORT const char* icalenum_reqstat_desc(icalrequeststatus stat);
LIBICAL_ICAL_EXPORT short icalenum_reqstat_major(icalrequeststatus stat);
+
LIBICAL_ICAL_EXPORT short icalenum_reqstat_minor(icalrequeststatus stat);
+
LIBICAL_ICAL_EXPORT icalrequeststatus icalenum_num_to_reqstat(short major, short minor);
-char* icalenum_reqstat_code(icalrequeststatus stat);
-LIBICAL_ICAL_EXPORT char* icalenum_reqstat_code_r(icalrequeststatus stat);
+
+LIBICAL_ICAL_EXPORT char *icalenum_reqstat_code(icalrequeststatus stat);
+
+LIBICAL_ICAL_EXPORT char *icalenum_reqstat_code_r(icalrequeststatus stat);
/***********************************************************************
* Conversion functions
**********************************************************************/
-
/* Thse routines used to be in icalenums.c, but were moved into the
icalproperty, icalparameter, icalvalue, or icalcomponent modules. */
-/* const char* icalproperty_kind_to_string(icalproperty_kind kind);*/
+/*const char* icalproperty_kind_to_string(icalproperty_kind kind);*/
#define icalenum_property_kind_to_string(x) icalproperty_kind_to_string(x)
/*icalproperty_kind icalproperty_string_to_kind(const char* string)*/
@@ -168,5 +163,4 @@ LIBICAL_ICAL_EXPORT char* icalenum_reqstat_code_r(icalrequeststatus stat);
/*icalcomponent_kind icalenum_string_to_component_kind(const char* string);*/
#define icalenum_string_to_component_kind(x) icalcomponent_string_to_kind(x)
-
#endif /* !ICALENUMS_H */
diff --git a/src/libical/icalerror.h b/src/libical/icalerror.h
index 947bc4a6..bb5ffaeb 100644
--- a/src/libical/icalerror.h
+++ b/src/libical/icalerror.h
@@ -28,15 +28,15 @@
#define ICAL_SETERROR_ISFUNC
-/** This routine is called before any error is triggered. It is called
- by icalerror_set_errno, so it does not appear in all of the macros
- below */
+/** This routine is called before any error is triggered. It is called by
+ icalerror_set_errno, so it does not appear in all of the macros below */
LIBICAL_ICAL_EXPORT void icalerror_stop_here(void);
-void icalerror_crash_here(void);
+LIBICAL_ICAL_EXPORT void icalerror_crash_here(void);
-typedef enum icalerrorenum {
- ICAL_NO_ERROR, /* icalerrno may not be initialized - put it first so and pray that the compiler initialize things to zero */
+typedef enum icalerrorenum
+{
+ ICAL_NO_ERROR = 0,
ICAL_BADARG_ERROR,
ICAL_NEWFAILED_ERROR,
ICAL_ALLOCATION_ERROR,
@@ -46,11 +46,11 @@ typedef enum icalerrorenum {
ICAL_FILE_ERROR,
ICAL_USAGE_ERROR,
ICAL_UNIMPLEMENTED_ERROR,
- ICAL_UNKNOWN_ERROR /* Used for problems in input to icalerror_strerror()*/
-
+ ICAL_UNKNOWN_ERROR /* Used for problems in input to icalerror_strerror() */
} icalerrorenum;
-LIBICAL_ICAL_EXPORT icalerrorenum * icalerrno_return(void);
+LIBICAL_ICAL_EXPORT icalerrorenum *icalerrno_return(void);
+
#define icalerrno (*(icalerrno_return()))
/** If true, libicu aborts after a call to icalerror_set_error
@@ -66,34 +66,37 @@ LIBICAL_ICAL_EXPORT int icalerror_errors_are_fatal;
/* Warning messages */
#ifdef __GNUC__ca
-#define icalerror_warn(message) {fprintf(stderr,"%s(), %s:%d: %s\n",__FUNCTION__,__FILE__,__LINE__,message);}
+#define icalerror_warn(message) \
+{fprintf(stderr, "%s(), %s:%d: %s\n", __FUNCTION__, __FILE__, __LINE__, message);}
#else /* __GNU_C__ */
-#define icalerror_warn(message) {fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);}
+#define icalerror_warn(message) \
+{fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, message);}
#endif /* __GNU_C__ */
LIBICAL_ICAL_EXPORT void icalerror_clear_errno(void);
-void _icalerror_set_errno(icalerrorenum);
+LIBICAL_ICAL_EXPORT void _icalerror_set_errno(icalerrorenum);
/* Make an individual error fatal or non-fatal. */
-typedef enum icalerrorstate {
- ICAL_ERROR_FATAL, /* Not fata */
- ICAL_ERROR_NONFATAL, /* Fatal */
- ICAL_ERROR_DEFAULT, /* Use the value of icalerror_errors_are_fatal*/
- ICAL_ERROR_UNKNOWN /* Asked state for an unknown error type */
-} icalerrorstate ;
-
-LIBICAL_ICAL_EXPORT const char* icalerror_strerror(icalerrorenum e);
-const char* icalerror_perror(void);
-void ical_bt(void);
-LIBICAL_ICAL_EXPORT void icalerror_set_error_state( icalerrorenum error, icalerrorstate);
-LIBICAL_ICAL_EXPORT icalerrorstate icalerror_get_error_state( icalerrorenum error);
+typedef enum icalerrorstate
+{
+ ICAL_ERROR_FATAL, /* Not fata */
+ ICAL_ERROR_NONFATAL, /* Fatal */
+ ICAL_ERROR_DEFAULT, /* Use the value of icalerror_errors_are_fatal */
+ ICAL_ERROR_UNKNOWN /* Asked state for an unknown error type */
+} icalerrorstate;
+
+LIBICAL_ICAL_EXPORT const char *icalerror_strerror(icalerrorenum e);
+LIBICAL_ICAL_EXPORT const char *icalerror_perror(void);
+LIBICAL_ICAL_EXPORT void ical_bt(void);
+LIBICAL_ICAL_EXPORT void icalerror_set_error_state(icalerrorenum error, icalerrorstate);
+LIBICAL_ICAL_EXPORT icalerrorstate icalerror_get_error_state(icalerrorenum error);
#ifndef ICAL_SETERROR_ISFUNC
#define icalerror_set_errno(x) \
icalerrno = x; \
-if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || \
- (icalerror_get_error_state(x)==ICAL_ERROR_DEFAULT && \
- icalerror_errors_are_fatal == 1 )){ \
+if(icalerror_get_error_state(x) == ICAL_ERROR_FATAL || \
+ (icalerror_get_error_state(x) == ICAL_ERROR_DEFAULT && \
+ icalerror_errors_are_fatal == 1)){ \
icalerror_warn(icalerror_strerror(x)); \
ical_bt(); \
assert(0); \
@@ -119,9 +122,17 @@ LIBICAL_ICAL_EXPORT void icalerror_set_errno(icalerrorenum x);
#if ICAL_ERRORS_ARE_FATAL == 1
#ifdef __GNUC__
-#define icalerror_assert(test,message) if(!(test)){fprintf(stderr,"%s(), %s:%d: %s\n",__FUNCTION__,__FILE__,__LINE__,message);icalerror_stop_here(); abort();}
+#define icalerror_assert(test,message) \
+if (!(test)) { \
+ fprintf(stderr, "%s(), %s:%d: %s\n", __FUNCTION__, __FILE__, __LINE__, message); \
+ icalerror_stop_here(); \
+ abort();}
#else /*__GNUC__*/
-#define icalerror_assert(test,message) if(!(test)){fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);icalerror_stop_here(); abort();}
+#define icalerror_assert(test,message) \
+if (!(test)) { \
+ fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, message); \
+ icalerror_stop_here(); \
+ abort();}
#endif /*__GNUC__*/
#else /* ICAL_ERRORS_ARE_FATAL */
@@ -129,27 +140,44 @@ LIBICAL_ICAL_EXPORT void icalerror_set_errno(icalerrorenum x);
#endif /* ICAL_ERRORS_ARE_FATAL */
/* Check & abort if check fails */
-#define icalerror_check_arg(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); }
+#define icalerror_check_arg(test,arg) \
+if (!(test)) { \
+ icalerror_set_errno(ICAL_BADARG_ERROR); \
+}
/* Check & return void if check fails*/
-#define icalerror_check_arg_rv(test,arg) if(!(test)) {icalerror_set_errno(ICAL_BADARG_ERROR); return; }
+#define icalerror_check_arg_rv(test,arg) \
+if (!(test)) { \
+ icalerror_set_errno(ICAL_BADARG_ERROR); \
+ return; \
+}
/* Check & return 0 if check fails*/
-#define icalerror_check_arg_rz(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return 0;}
+#define icalerror_check_arg_rz(test,arg) \
+if (!(test)) { \
+ icalerror_set_errno(ICAL_BADARG_ERROR); \
+ return 0; \
+}
/* Check & return an error if check fails*/
-#define icalerror_check_arg_re(test,arg,error) if(!(test)) { icalerror_stop_here(); assert(0); return error;}
+#define icalerror_check_arg_re(test,arg,error) \
+if (!(test)) { \
+ icalerror_stop_here(); \
+ assert(0); \
+ return error; \
+}
/* Check & return something*/
-#define icalerror_check_arg_rx(test,arg,x) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return x;}
-
-
+#define icalerror_check_arg_rx(test,arg,x) \
+if (!(test)) { \
+ icalerror_set_errno(ICAL_BADARG_ERROR); \
+ return x; \
+}
-/* String interfaces to set an error to NONFATAL and restore it to its
- original value */
+/* String interfaces to set an error to NONFATAL and restore it to its original value */
-icalerrorstate icalerror_supress(const char* error);
-void icalerror_restore(const char* error, icalerrorstate es);
+LIBICAL_ICAL_EXPORT icalerrorstate icalerror_supress(const char *error);
+LIBICAL_ICAL_EXPORT void icalerror_restore(const char *error, icalerrorstate es);
#endif /* !ICALERROR_H */
diff --git a/src/libical/icallangbind.h b/src/libical/icallangbind.h
index 6ac579bc..ee47f99c 100644
--- a/src/libical/icallangbind.h
+++ b/src/libical/icallangbind.h
@@ -24,33 +24,45 @@
#include "icalcomponent.h"
#include "icalproperty.h"
-int* icallangbind_new_array(int size);
-void icallangbind_free_array(int* array);
-int icallangbind_access_array(int* array, int index);
-icalproperty* icallangbind_get_property(icalcomponent *c, int n, const char* prop);
-const char* icallangbind_get_property_val(icalproperty* p);
-const char* icallangbind_get_parameter(icalproperty *p, const char* parameter);
-icalcomponent* icallangbind_get_component(icalcomponent *c, const char* comp);
+LIBICAL_ICAL_EXPORT int *icallangbind_new_array(int size);
-LIBICAL_ICAL_EXPORT icalproperty* icallangbind_get_first_property(icalcomponent *c, const char* prop);
+LIBICAL_ICAL_EXPORT void icallangbind_free_array(int *array);
-LIBICAL_ICAL_EXPORT icalproperty* icallangbind_get_next_property(icalcomponent *c, const char* prop);
+LIBICAL_ICAL_EXPORT int icallangbind_access_array(int *array, int index);
-icalcomponent* icallangbind_get_first_component(icalcomponent *c, const char* comp);
+LIBICAL_ICAL_EXPORT icalproperty *icallangbind_get_property(icalcomponent * c,
+ int n, const char *prop);
-icalcomponent* icallangbind_get_next_component(icalcomponent *c, const char* comp);
+LIBICAL_ICAL_EXPORT const char *icallangbind_get_property_val(icalproperty * p);
-icalparameter* icallangbind_get_first_parameter(icalproperty *prop);
+LIBICAL_ICAL_EXPORT const char *icallangbind_get_parameter(icalproperty * p, const char *parameter);
-icalparameter* icallangbind_get_next_parameter(icalproperty *prop);
+LIBICAL_ICAL_EXPORT icalcomponent *icallangbind_get_component(icalcomponent * c, const char *comp);
-LIBICAL_ICAL_EXPORT const char* icallangbind_property_eval_string(icalproperty* prop, char* sep);
-char* icallangbind_property_eval_string_r(icalproperty* prop, char* sep);
+LIBICAL_ICAL_EXPORT icalproperty *icallangbind_get_first_property(icalcomponent * c,
+ const char *prop);
+LIBICAL_ICAL_EXPORT icalproperty *icallangbind_get_next_property(icalcomponent * c,
+ const char *prop);
-int icallangbind_string_to_open_flag(const char* str);
+LIBICAL_ICAL_EXPORT icalcomponent *icallangbind_get_first_component(icalcomponent * c,
+ const char *comp);
-const char* icallangbind_quote_as_ical(const char* str);
-char* callangbind_quote_as_ical_r(const char* str);
+LIBICAL_ICAL_EXPORT icalcomponent *icallangbind_get_next_component(icalcomponent * c,
+ const char *comp);
+
+LIBICAL_ICAL_EXPORT icalparameter *icallangbind_get_first_parameter(icalproperty * prop);
+
+LIBICAL_ICAL_EXPORT icalparameter *icallangbind_get_next_parameter(icalproperty * prop);
+
+LIBICAL_ICAL_EXPORT const char *icallangbind_property_eval_string(icalproperty * prop, char *sep);
+
+LIBICAL_ICAL_EXPORT char *icallangbind_property_eval_string_r(icalproperty * prop, char *sep);
+
+LIBICAL_ICAL_EXPORT int icallangbind_string_to_open_flag(const char *str);
+
+LIBICAL_ICAL_EXPORT const char *icallangbind_quote_as_ical(const char *str);
+
+LIBICAL_ICAL_EXPORT char *callangbind_quote_as_ical_r(const char *str);
#endif
diff --git a/src/libical/icalmime.h b/src/libical/icalmime.h
index 06a10cf5..fd2dd4ba 100644
--- a/src/libical/icalmime.h
+++ b/src/libical/icalmime.h
@@ -23,12 +23,11 @@
#include "libical_ical_export.h"
#include "icalcomponent.h"
-LIBICAL_ICAL_EXPORT icalcomponent* icalmime_parse(char* (*line_gen_func)(char *s,
- size_t size,
- void *d),
- void *data);
+LIBICAL_ICAL_EXPORT icalcomponent *icalmime_parse(char *(*line_gen_func) (char *s,
+ size_t size,
+ void *d), void *data);
/* The inverse of icalmime_parse, not implemented yet. Use sspm.h directly. */
-char* icalmime_as_mime_string(char* component);
+LIBICAL_ICAL_EXPORT char *icalmime_as_mime_string(char *component);
#endif /* !ICALMIME_H */
diff --git a/src/libical/icalparameter.h b/src/libical/icalparameter.h
index b4453ae9..43253cb6 100644
--- a/src/libical/icalparameter.h
+++ b/src/libical/icalparameter.h
@@ -2,10 +2,6 @@
FILE: icalparam.h
CREATOR: eric 20 March 1999
-
-
-
-
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
@@ -15,14 +11,11 @@
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
- Or:
+ Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
-
- The original code is icalparam.h
-
- ======================================================================*/
+======================================================================*/
#ifndef ICALPARAMETER_H
#define ICALPARAMETER_H
@@ -33,46 +26,54 @@
/* Declared in icalderivedparameter.h */
/*typedef struct icalparameter_impl icalparameter;*/
-LIBICAL_ICAL_EXPORT icalparameter* icalparameter_new(icalparameter_kind kind);
-LIBICAL_ICAL_EXPORT icalparameter* icalparameter_new_clone(icalparameter* p);
+LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new(icalparameter_kind kind);
+
+LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new_clone(icalparameter * p);
/* Create from string of form "PARAMNAME=VALUE" */
-LIBICAL_ICAL_EXPORT icalparameter* icalparameter_new_from_string(const char* value);
+LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new_from_string(const char *value);
/* Create from just the value, the part after the "=" */
-LIBICAL_ICAL_EXPORT icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind, const char* value);
+LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new_from_value_string(icalparameter_kind kind,
+ const char *value);
+
+LIBICAL_ICAL_EXPORT void icalparameter_free(icalparameter * parameter);
-LIBICAL_ICAL_EXPORT void icalparameter_free(icalparameter* parameter);
+LIBICAL_ICAL_EXPORT char *icalparameter_as_ical_string(icalparameter * parameter);
-LIBICAL_ICAL_EXPORT char* icalparameter_as_ical_string(icalparameter* parameter);
-char* icalparameter_as_ical_string_r(icalparameter* parameter);
+LIBICAL_ICAL_EXPORT char *icalparameter_as_ical_string_r(icalparameter * parameter);
-int icalparameter_is_valid(icalparameter* parameter);
+LIBICAL_ICAL_EXPORT int icalparameter_is_valid(icalparameter * parameter);
-LIBICAL_ICAL_EXPORT icalparameter_kind icalparameter_isa(icalparameter* parameter);
+LIBICAL_ICAL_EXPORT icalparameter_kind icalparameter_isa(icalparameter * parameter);
-LIBICAL_ICAL_EXPORT int icalparameter_isa_parameter(void* param);
+LIBICAL_ICAL_EXPORT int icalparameter_isa_parameter(void *param);
/* Access the name of an X parameter */
-LIBICAL_ICAL_EXPORT void icalparameter_set_xname (icalparameter* param, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalparameter_get_xname(icalparameter* param);
-LIBICAL_ICAL_EXPORT void icalparameter_set_xvalue (icalparameter* param, const char* v);
-LIBICAL_ICAL_EXPORT const char* icalparameter_get_xvalue(icalparameter* param);
+LIBICAL_ICAL_EXPORT void icalparameter_set_xname(icalparameter * param, const char *v);
+
+LIBICAL_ICAL_EXPORT const char *icalparameter_get_xname(icalparameter * param);
+
+LIBICAL_ICAL_EXPORT void icalparameter_set_xvalue(icalparameter * param, const char *v);
+
+LIBICAL_ICAL_EXPORT const char *icalparameter_get_xvalue(icalparameter * param);
/* Access the name of an IANA parameter */
-void icalparameter_set_iana_name (icalparameter* param, const char* v);
-const char* icalparameter_get_iana_name(icalparameter* param);
-void icalparameter_set_iana_value (icalparameter* param, const char* v);
-const char* icalparameter_get_iana_value(icalparameter* param);
+LIBICAL_ICAL_EXPORT void icalparameter_set_iana_name(icalparameter * param, const char *v);
+
+LIBICAL_ICAL_EXPORT const char *icalparameter_get_iana_name(icalparameter * param);
+
+LIBICAL_ICAL_EXPORT void icalparameter_set_iana_value(icalparameter * param, const char *v);
+
+LIBICAL_ICAL_EXPORT const char *icalparameter_get_iana_value(icalparameter * param);
/* returns 1 if parameters have same name in ICAL, otherwise 0 */
-int icalparameter_has_same_name(icalparameter* param1, icalparameter* param2);
+LIBICAL_ICAL_EXPORT int icalparameter_has_same_name(icalparameter * param1, icalparameter * param2);
/* Convert enumerations */
-LIBICAL_ICAL_EXPORT const char* icalparameter_kind_to_string(icalparameter_kind kind);
-LIBICAL_ICAL_EXPORT icalparameter_kind icalparameter_string_to_kind(const char* string);
-
+LIBICAL_ICAL_EXPORT const char *icalparameter_kind_to_string(icalparameter_kind kind);
+LIBICAL_ICAL_EXPORT icalparameter_kind icalparameter_string_to_kind(const char *string);
#endif
diff --git a/src/libical/icalparser.h b/src/libical/icalparser.h
index 66eb306b..6c800269 100644
--- a/src/libical/icalparser.h
+++ b/src/libical/icalparser.h
@@ -36,7 +36,8 @@ typedef struct icalparser_impl icalparser;
* non-zero when it has finished with a component.
*/
-typedef enum icalparser_state {
+typedef enum icalparser_state
+{
ICALPARSER_ERROR,
ICALPARSER_SUCCESS,
ICALPARSER_BEGIN_COMP,
@@ -44,12 +45,15 @@ typedef enum icalparser_state {
ICALPARSER_IN_PROGRESS
} icalparser_state;
-LIBICAL_ICAL_EXPORT icalparser* icalparser_new(void);
-LIBICAL_ICAL_EXPORT icalcomponent* icalparser_add_line(icalparser* parser, char* str );
-LIBICAL_ICAL_EXPORT icalcomponent* icalparser_clean(icalparser* parser);
-LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(icalparser* parser);
-LIBICAL_ICAL_EXPORT void icalparser_free(icalparser* parser);
+LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
+LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser * parser, char *str);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser * parser);
+
+LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(icalparser * parser);
+
+LIBICAL_ICAL_EXPORT void icalparser_free(icalparser * parser);
/**
* Message oriented parsing. icalparser_parse takes a string that
@@ -58,36 +62,31 @@ LIBICAL_ICAL_EXPORT void icalparser_free(icalparser* parser);
* pointer to a function that returns one content line per invocation
*/
-LIBICAL_ICAL_EXPORT icalcomponent* icalparser_parse(icalparser *parser,
- char* (*line_gen_func)(char *s,
- size_t size,
- void *d));
+LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser * parser,
+ char *(*line_gen_func) (char *s,
+ size_t size, void *d));
/**
Set the data that icalparser_parse will give to the line_gen_func
as the parameter 'd'
*/
-LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser* parser, void* data);
-
-
-LIBICAL_ICAL_EXPORT icalcomponent* icalparser_parse_string(const char* str);
+LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser * parser, void *data);
+LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
/***********************************************************************
* Parser support functions
***********************************************************************/
/** Use the flex/bison parser to turn a string into a value type */
-LIBICAL_ICAL_EXPORT icalvalue* icalparser_parse_value(icalvalue_kind kind,
- const char* str,
- icalcomponent** errors);
+LIBICAL_ICAL_EXPORT icalvalue *icalparser_parse_value(icalvalue_kind kind,
+ const char *str, icalcomponent ** errors);
/** Given a line generator function, return a single iCal content line.*/
-LIBICAL_ICAL_EXPORT char* icalparser_get_line(icalparser* parser,
- char* (*line_gen_func)(char *s,
- size_t size,
- void *d));
+LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser * parser,
+ char *(*line_gen_func) (char *s,
+ size_t size, void *d));
-LIBICAL_ICAL_EXPORT char* icalparser_string_line_generator(char *out, size_t buf_size, void *d);
+LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
#endif /* !ICALPARSE_H */
diff --git a/src/libical/icalperiod.h b/src/libical/icalperiod.h
index a06c49de..789bfebb 100644
--- a/src/libical/icalperiod.h
+++ b/src/libical/icalperiod.h
@@ -29,20 +29,21 @@
struct icalperiodtype
{
- struct icaltimetype start;
- struct icaltimetype end;
- struct icaldurationtype duration;
+ struct icaltimetype start;
+ struct icaltimetype end;
+ struct icaldurationtype duration;
};
-LIBICAL_ICAL_EXPORT struct icalperiodtype icalperiodtype_from_string (const char* str);
+LIBICAL_ICAL_EXPORT struct icalperiodtype icalperiodtype_from_string(const char *str);
-LIBICAL_ICAL_EXPORT const char* icalperiodtype_as_ical_string(struct icalperiodtype p);
-char* icalperiodtype_as_ical_string_r(struct icalperiodtype p);
+LIBICAL_ICAL_EXPORT const char *icalperiodtype_as_ical_string(struct icalperiodtype p);
+
+LIBICAL_ICAL_EXPORT char *icalperiodtype_as_ical_string_r(struct icalperiodtype p);
LIBICAL_ICAL_EXPORT struct icalperiodtype icalperiodtype_null_period(void);
-int icalperiodtype_is_null_period(struct icalperiodtype p);
+LIBICAL_ICAL_EXPORT int icalperiodtype_is_null_period(struct icalperiodtype p);
-int icalperiodtype_is_valid_period(struct icalperiodtype p);
+LIBICAL_ICAL_EXPORT int icalperiodtype_is_valid_period(struct icalperiodtype p);
#endif /* !ICALTIME_H */
diff --git a/src/libical/icalrecur.h b/src/libical/icalrecur.h
index be6a6035..630989d0 100644
--- a/src/libical/icalrecur.h
+++ b/src/libical/icalrecur.h
@@ -80,15 +80,14 @@ typedef enum icalrecurrencetype_frequency
/* These enums are used to index an array, so don't change the
order or the integers */
- ICAL_SECONDLY_RECURRENCE=0,
- ICAL_MINUTELY_RECURRENCE=1,
- ICAL_HOURLY_RECURRENCE=2,
- ICAL_DAILY_RECURRENCE=3,
- ICAL_WEEKLY_RECURRENCE=4,
- ICAL_MONTHLY_RECURRENCE=5,
- ICAL_YEARLY_RECURRENCE=6,
- ICAL_NO_RECURRENCE=7
-
+ ICAL_SECONDLY_RECURRENCE = 0,
+ ICAL_MINUTELY_RECURRENCE = 1,
+ ICAL_HOURLY_RECURRENCE = 2,
+ ICAL_DAILY_RECURRENCE = 3,
+ ICAL_WEEKLY_RECURRENCE = 4,
+ ICAL_MONTHLY_RECURRENCE = 5,
+ ICAL_YEARLY_RECURRENCE = 6,
+ ICAL_NO_RECURRENCE = 7
} icalrecurrencetype_frequency;
typedef enum icalrecurrencetype_weekday
@@ -110,13 +109,12 @@ typedef enum icalrecurrencetype_skip
ICAL_SKIP_OMIT
} icalrecurrencetype_skip;
-enum {
+enum icalrecurrence_array_max_values
+{
ICAL_RECURRENCE_ARRAY_MAX = 0x7f7f,
ICAL_RECURRENCE_ARRAY_MAX_BYTE = 0x7f
};
-
-
/**
* Recurrence type routines
*/
@@ -139,44 +137,43 @@ enum {
/** Main struct for holding digested recurrence rules */
struct icalrecurrencetype
{
- icalrecurrencetype_frequency freq;
-
-
- /* until and count are mutually exclusive. */
- struct icaltimetype until;
- int count;
-
- short interval;
-
- icalrecurrencetype_weekday week_start;
-
- /* The BY* parameters can each take a list of values. Here I
- * assume that the list of values will not be larger than the
- * range of the value -- that is, the client will not name a
- * value more than once.
-
- * Each of the lists is terminated with the value
- * ICAL_RECURRENCE_ARRAY_MAX unless the list is full.
- */
-
- short by_second[ICAL_BY_SECOND_SIZE];
- short by_minute[ICAL_BY_MINUTE_SIZE];
- short by_hour[ICAL_BY_HOUR_SIZE];
- short by_day[ICAL_BY_DAY_SIZE]; /* Encoded value, see below */
- short by_month_day[ICAL_BY_MONTHDAY_SIZE];
- short by_year_day[ ICAL_BY_YEARDAY_SIZE];
- short by_week_no[ICAL_BY_WEEKNO_SIZE];
- short by_month[ICAL_BY_MONTH_SIZE];
- short by_set_pos[ICAL_BY_SETPOS_SIZE];
-
- /* For RSCALE extension (RFC 7529) */
- char *rscale;
- icalrecurrencetype_skip skip;
+ icalrecurrencetype_frequency freq;
+
+ /* until and count are mutually exclusive. */
+ struct icaltimetype until;
+ int count;
+
+ short interval;
+
+ icalrecurrencetype_weekday week_start;
+
+ /* The BY* parameters can each take a list of values. Here I
+ * assume that the list of values will not be larger than the
+ * range of the value -- that is, the client will not name a
+ * value more than once.
+
+ * Each of the lists is terminated with the value
+ * ICAL_RECURRENCE_ARRAY_MAX unless the list is full.
+ */
+
+ short by_second[ICAL_BY_SECOND_SIZE];
+ short by_minute[ICAL_BY_MINUTE_SIZE];
+ short by_hour[ICAL_BY_HOUR_SIZE];
+ short by_day[ICAL_BY_DAY_SIZE]; /* Encoded value, see below */
+ short by_month_day[ICAL_BY_MONTHDAY_SIZE];
+ short by_year_day[ICAL_BY_YEARDAY_SIZE];
+ short by_week_no[ICAL_BY_WEEKNO_SIZE];
+ short by_month[ICAL_BY_MONTH_SIZE];
+ short by_set_pos[ICAL_BY_SETPOS_SIZE];
+
+ /* For RSCALE extension (RFC 7529) */
+ char *rscale;
+ icalrecurrencetype_skip skip;
};
-
LIBICAL_ICAL_EXPORT int icalrecurrencetype_rscale_is_supported(void);
-LIBICAL_ICAL_EXPORT icalarray* icalrecurrencetype_rscale_supported_calendars(void);
+
+LIBICAL_ICAL_EXPORT icalarray *icalrecurrencetype_rscale_supported_calendars(void);
LIBICAL_ICAL_EXPORT void icalrecurrencetype_clear(struct icalrecurrencetype *r);
@@ -190,12 +187,12 @@ LIBICAL_ICAL_EXPORT void icalrecurrencetype_clear(struct icalrecurrencetype *r);
*/
/** 1 == Monday, etc. */
-enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day);
+LIBICAL_ICAL_EXPORT enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day);
/** 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc */
-int icalrecurrencetype_day_position(short day);
+LIBICAL_ICAL_EXPORT int icalrecurrencetype_day_position(short day);
-icalrecurrencetype_weekday icalrecur_string_to_weekday(const char* str);
+LIBICAL_ICAL_EXPORT icalrecurrencetype_weekday icalrecur_string_to_weekday(const char *str);
/**
* The 'month' element of the by_month array is encoded to allow
@@ -203,37 +200,38 @@ icalrecurrencetype_weekday icalrecur_string_to_weekday(const char* str);
* These routines decode the month values.
*/
-int icalrecurrencetype_month_is_leap(short month);
-int icalrecurrencetype_month_month(short month);
+LIBICAL_ICAL_EXPORT int icalrecurrencetype_month_is_leap(short month);
+
+LIBICAL_ICAL_EXPORT int icalrecurrencetype_month_month(short month);
/** Recurrance rule parser */
/** Convert between strings and recurrencetype structures. */
-LIBICAL_ICAL_EXPORT struct icalrecurrencetype icalrecurrencetype_from_string(const char* str);
-LIBICAL_ICAL_EXPORT char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur);
-char* icalrecurrencetype_as_string_r(struct icalrecurrencetype *recur);
+LIBICAL_ICAL_EXPORT struct icalrecurrencetype icalrecurrencetype_from_string(const char *str);
+LIBICAL_ICAL_EXPORT char *icalrecurrencetype_as_string(struct icalrecurrencetype *recur);
+
+LIBICAL_ICAL_EXPORT char *icalrecurrencetype_as_string_r(struct icalrecurrencetype *recur);
/** Recurrence iteration routines */
-typedef struct icalrecur_iterator_impl icalrecur_iterator;
+typedef struct icalrecur_iterator_impl icalrecur_iterator;
/** Create a new recurrence rule iterator */
-LIBICAL_ICAL_EXPORT icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
+LIBICAL_ICAL_EXPORT icalrecur_iterator *icalrecur_iterator_new(struct icalrecurrencetype rule,
struct icaltimetype dtstart);
/** Get the next occurrence from an iterator */
-LIBICAL_ICAL_EXPORT struct icaltimetype icalrecur_iterator_next(icalrecur_iterator*);
+LIBICAL_ICAL_EXPORT struct icaltimetype icalrecur_iterator_next(icalrecur_iterator *);
/** Free the iterator */
-LIBICAL_ICAL_EXPORT void icalrecur_iterator_free(icalrecur_iterator*);
+LIBICAL_ICAL_EXPORT void icalrecur_iterator_free(icalrecur_iterator *);
/**
* Fills array up with at most 'count' time_t values, each
* representing an occurrence time in seconds past the POSIX epoch
*/
-LIBICAL_ICAL_EXPORT int icalrecur_expand_recurrence(char* rule, time_t start,
- int count, time_t* array);
-
+LIBICAL_ICAL_EXPORT int icalrecur_expand_recurrence(char *rule, time_t start,
+ int count, time_t * array);
#endif
diff --git a/src/libical/icalrestriction.h b/src/libical/icalrestriction.h
index c3ed2654..36b2e7b9 100644
--- a/src/libical/icalrestriction.h
+++ b/src/libical/icalrestriction.h
@@ -30,25 +30,24 @@
#include "icalproperty.h"
/* These must stay in this order for icalrestriction_compare to work */
-typedef enum icalrestriction_kind {
- ICAL_RESTRICTION_NONE=0, /* 0 */
- ICAL_RESTRICTION_ZERO, /* 1 */
- ICAL_RESTRICTION_ONE, /* 2 */
- ICAL_RESTRICTION_ZEROPLUS, /* 3 */
- ICAL_RESTRICTION_ONEPLUS, /* 4 */
- ICAL_RESTRICTION_ZEROORONE, /* 5 */
- ICAL_RESTRICTION_ONEEXCLUSIVE, /* 6 */
- ICAL_RESTRICTION_ONEMUTUAL, /* 7 */
- ICAL_RESTRICTION_UNKNOWN /* 8 */
+typedef enum icalrestriction_kind
+{
+ ICAL_RESTRICTION_NONE = 0, /* 0 */
+ ICAL_RESTRICTION_ZERO, /* 1 */
+ ICAL_RESTRICTION_ONE, /* 2 */
+ ICAL_RESTRICTION_ZEROPLUS, /* 3 */
+ ICAL_RESTRICTION_ONEPLUS, /* 4 */
+ ICAL_RESTRICTION_ZEROORONE, /* 5 */
+ ICAL_RESTRICTION_ONEEXCLUSIVE, /* 6 */
+ ICAL_RESTRICTION_ONEMUTUAL, /* 7 */
+ ICAL_RESTRICTION_UNKNOWN /* 8 */
} icalrestriction_kind;
-int icalrestriction_compare(icalrestriction_kind restr, int count);
+LIBICAL_ICAL_EXPORT int icalrestriction_compare(icalrestriction_kind restr, int count);
+LIBICAL_ICAL_EXPORT int icalrestriction_is_parameter_allowed(icalproperty_kind property,
+ icalparameter_kind parameter);
-int icalrestriction_is_parameter_allowed(icalproperty_kind property,
- icalparameter_kind parameter);
-
-LIBICAL_ICAL_EXPORT int icalrestriction_check(icalcomponent* comp);
-
+LIBICAL_ICAL_EXPORT int icalrestriction_check(icalcomponent * comp);
#endif /* !ICALRESTRICTION_H */
diff --git a/src/libical/icaltime.h b/src/libical/icaltime.h
index d7dce3cb..74f67774 100644
--- a/src/libical/icaltime.h
+++ b/src/libical/icaltime.h
@@ -41,7 +41,7 @@
* - icaltime_from_timet_with_zone(time_t tm, int is_date,
* icaltimezone *zone)
* - icaltime_from_string_with_zone(const char* str, icaltimezone *zone)
- * - icaltime_from_day_of_year(int doy, int year)
+ * - icaltime_from_day_of_year(int doy, int year)
* - icaltime_from_week_number(int week_number, int year)
*
* italtimetype objects can be converted to different formats:
@@ -92,14 +92,15 @@
a circular dependancy. */
#ifndef ICALTIMEZONE_DEFINED
#define ICALTIMEZONE_DEFINED
-typedef struct _icaltimezone icaltimezone;
+typedef struct _icaltimezone icaltimezone;
#endif
/** icaltime_span is returned by icalcomponent_get_span() */
-struct icaltime_span {
- time_t start; /**< in UTC */
- time_t end; /**< in UTC */
- int is_busy; /**< 1->busy time, 0-> free time */
+struct icaltime_span
+{
+ time_t start; /**< in UTC */
+ time_t end; /**< in UTC */
+ int is_busy; /**< 1->busy time, 0-> free time */
};
typedef struct icaltime_span icaltime_span;
@@ -112,20 +113,20 @@ typedef struct icaltime_span icaltime_span;
*/
struct icaltimetype
{
- int year; /**< Actual year, e.g. 2001. */
- int month; /**< 1 (Jan) to 12 (Dec). */
- int day;
- int hour;
- int minute;
- int second;
+ int year; /**< Actual year, e.g. 2001. */
+ int month; /**< 1 (Jan) to 12 (Dec). */
+ int day;
+ int hour;
+ int minute;
+ int second;
- int is_utc; /**< 1-> time is in UTC timezone */
+ int is_utc; /**< 1-> time is in UTC timezone */
- int is_date; /**< 1 -> interpret this as date. */
+ int is_date; /**< 1 -> interpret this as date. */
- int is_daylight; /**< 1 -> time is in daylight savings time. */
+ int is_daylight; /**< 1 -> time is in daylight savings time. */
- const icaltimezone *zone; /**< timezone */
+ const icaltimezone *zone; /**< timezone */
};
typedef struct icaltimetype icaltimetype;
@@ -135,59 +136,58 @@ typedef struct icaltimetype icaltimetype;
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_null_time(void);
/** Return a null date */
-struct icaltimetype icaltime_null_date(void);
+LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_null_date(void);
/** Returns the current time in the given timezone, as an icaltimetype. */
-struct icaltimetype icaltime_current_time_with_zone(const icaltimezone *zone);
+LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_current_time_with_zone(const icaltimezone * zone);
/** Returns the current day as an icaltimetype, with is_date set. */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_today(void);
/** Convert seconds past UNIX epoch to a timetype*/
-LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_timet(const time_t v,
- const int is_date);
+LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_timet(const time_t v, const int is_date);
/** Convert seconds past UNIX epoch to a timetype, using timezones. */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_timet_with_zone(const time_t tm,
const int is_date,
- const icaltimezone *zone);
+ const icaltimezone * zone);
/** create a time from an ISO format string */
-LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_string(const char* str);
+LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_string(const char *str);
/** create a time from an ISO format string */
-struct icaltimetype icaltime_from_string_with_zone(const char* str,
- const icaltimezone *zone);
+LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_string_with_zone(const char *str,
+ const icaltimezone * zone);
/** Create a new time, given a day of year and a year. */
-LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_day_of_year(const int doy,
- const int year);
+LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_day_of_year(const int doy, const int year);
/** @brief Contructor (TODO).
* Create a new time from a weeknumber and a year. */
-struct icaltimetype icaltime_from_week_number(const int week_number,
- const int year);
+LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_week_number(const int week_number,
+ const int year);
/** Return the time as seconds past the UNIX epoch */
LIBICAL_ICAL_EXPORT time_t icaltime_as_timet(const struct icaltimetype);
/** Return the time as seconds past the UNIX epoch, using timezones. */
LIBICAL_ICAL_EXPORT time_t icaltime_as_timet_with_zone(const struct icaltimetype tt,
- const icaltimezone *zone);
+ const icaltimezone * zone);
/** Return a string represention of the time, in RFC2445 format. */
-LIBICAL_ICAL_EXPORT const char* icaltime_as_ical_string(const struct icaltimetype tt);
-char* icaltime_as_ical_string_r(const struct icaltimetype tt);
+LIBICAL_ICAL_EXPORT const char *icaltime_as_ical_string(const struct icaltimetype tt);
+
+LIBICAL_ICAL_EXPORT char *icaltime_as_ical_string_r(const struct icaltimetype tt);
/** @brief Return the timezone */
-const icaltimezone *icaltime_get_timezone(const struct icaltimetype t);
+LIBICAL_ICAL_EXPORT const icaltimezone *icaltime_get_timezone(const struct icaltimetype t);
/** @brief Return the tzid, or NULL for a floating time */
-const char *icaltime_get_tzid(const struct icaltimetype t);
+LIBICAL_ICAL_EXPORT const char *icaltime_get_tzid(const struct icaltimetype t);
/** @brief Set the timezone */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_set_timezone(struct icaltimetype *t,
- const icaltimezone *zone);
+ const icaltimezone * zone);
/** Return the day of the year of the given time */
LIBICAL_ICAL_EXPORT int icaltime_day_of_year(const struct icaltimetype t);
@@ -204,7 +204,7 @@ LIBICAL_ICAL_EXPORT int icaltime_start_doy_of_week(const struct icaltimetype t);
LIBICAL_ICAL_EXPORT int icaltime_start_doy_week(const struct icaltimetype t, int fdow);
/** Return the week number for the week the given time is within */
-int icaltime_week_number(const struct icaltimetype t);
+LIBICAL_ICAL_EXPORT int icaltime_week_number(const struct icaltimetype t);
/** Return true of the time is null. */
LIBICAL_ICAL_EXPORT int icaltime_is_null_time(const struct icaltimetype t);
@@ -212,33 +212,34 @@ LIBICAL_ICAL_EXPORT int icaltime_is_null_time(const struct icaltimetype t);
/** Returns false if the time is clearly invalid, but is not null. This
is usually the result of creating a new time type buy not clearing
it, or setting one of the flags to an illegal value. */
-int icaltime_is_valid_time(const struct icaltimetype t);
+LIBICAL_ICAL_EXPORT int icaltime_is_valid_time(const struct icaltimetype t);
/** @brief Returns true if time is of DATE type, false if DATE-TIME */
-int icaltime_is_date(const struct icaltimetype t);
+LIBICAL_ICAL_EXPORT int icaltime_is_date(const struct icaltimetype t);
/** @brief Returns true if time is relative to UTC zone */
LIBICAL_ICAL_EXPORT int icaltime_is_utc(const struct icaltimetype t);
/** Return -1, 0, or 1 to indicate that a<b, a==b or a>b */
-int icaltime_compare_with_zone(const struct icaltimetype a,
- const struct icaltimetype b);
+LIBICAL_ICAL_EXPORT int icaltime_compare_with_zone(const struct icaltimetype a,
+ const struct icaltimetype b);
/** Return -1, 0, or 1 to indicate that a<b, a==b or a>b */
-LIBICAL_ICAL_EXPORT int icaltime_compare(const struct icaltimetype a,
- const struct icaltimetype b);
+LIBICAL_ICAL_EXPORT int icaltime_compare(const struct icaltimetype a, const struct icaltimetype b);
/** like icaltime_compare, but only use the date parts. */
-int icaltime_compare_date_only(const struct icaltimetype a,
- const struct icaltimetype b);
+LIBICAL_ICAL_EXPORT int icaltime_compare_date_only(const struct icaltimetype a,
+ const struct icaltimetype b);
/** like icaltime_compare, but only use the date parts. */
-int icaltime_compare_date_only_tz(const struct icaltimetype a,
- const struct icaltimetype b, icaltimezone *tz);
+LIBICAL_ICAL_EXPORT int icaltime_compare_date_only_tz(const struct icaltimetype a,
+ const struct icaltimetype b,
+ icaltimezone * tz);
/** Adds or subtracts a number of days, hours, minutes and seconds. */
-void icaltime_adjust(struct icaltimetype *tt, const int days,
- const int hours, const int minutes, const int seconds);
+LIBICAL_ICAL_EXPORT void icaltime_adjust(struct icaltimetype *tt,
+ const int days, const int hours,
+ const int minutes, const int seconds);
/** Normalize the icaltime, so that all fields are within the normal range. */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_normalize(const struct icaltimetype t);
@@ -246,31 +247,27 @@ LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_normalize(const struct icaltime
/** convert tt, of timezone tzid, into a utc time. Does nothing if the
time is already UTC. */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_convert_to_zone(const struct icaltimetype tt,
- icaltimezone *zone);
+ icaltimezone * zone);
/** Return the number of days in the given month */
-int icaltime_days_in_month(const int month, const int year);
+LIBICAL_ICAL_EXPORT int icaltime_days_in_month(const int month, const int year);
/** Return whether you've specified a leapyear or not. */
LIBICAL_ICAL_EXPORT int icaltime_is_leap_year(const int year);
/** Return the number of days in this year */
-int icaltime_days_in_year (const int year);
+LIBICAL_ICAL_EXPORT int icaltime_days_in_year(const int year);
/** @brief calculate an icaltimespan given a start and end time. */
-struct icaltime_span icaltime_span_new(struct icaltimetype dtstart,
- struct icaltimetype dtend,
- int is_busy);
+LIBICAL_ICAL_EXPORT struct icaltime_span icaltime_span_new(struct icaltimetype dtstart,
+ struct icaltimetype dtend, int is_busy);
/** @brief Returns true if the two spans overlap **/
-int icaltime_span_overlaps(icaltime_span *s1,
- icaltime_span *s2);
+LIBICAL_ICAL_EXPORT int icaltime_span_overlaps(icaltime_span * s1, icaltime_span * s2);
/** @brief Returns true if the span is totally within the containing
* span
*/
-int icaltime_span_contains(icaltime_span *s,
- icaltime_span *container);
-
+LIBICAL_ICAL_EXPORT int icaltime_span_contains(icaltime_span * s, icaltime_span * container);
#endif /* !ICALTIME_H */
diff --git a/src/libical/icaltimezone.h b/src/libical/icaltimezone.h
index 1528b997..bd9b93af 100644
--- a/src/libical/icaltimezone.h
+++ b/src/libical/icaltimezone.h
@@ -33,7 +33,7 @@
/** @brief An opaque struct representing a timezone.
* We declare this here to avoid a circular dependancy.
*/
-typedef struct _icaltimezone icaltimezone;
+typedef struct _icaltimezone icaltimezone;
#endif
/**
@@ -41,13 +41,13 @@ typedef struct _icaltimezone icaltimezone;
*/
/** Creates a new icaltimezone. */
-icaltimezone *icaltimezone_new (void);
-icaltimezone *icaltimezone_copy (icaltimezone *originalzone);
+LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_new(void);
+
+LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_copy(icaltimezone * originalzone);
/** Frees all memory used for the icaltimezone. Set free_struct to free the
icaltimezone struct as well. */
-void icaltimezone_free (icaltimezone *zone,
- int free_struct);
+LIBICAL_ICAL_EXPORT void icaltimezone_free(icaltimezone * zone, int free_struct);
/** Sets the prefix to be used for tzid's generated from system tzdata.
Must be globally unique (such as a domain name owned by the developer
@@ -64,57 +64,56 @@ LIBICAL_ICAL_EXPORT void icaltimezone_set_tzid_prefix(const char *new_prefix);
LIBICAL_ICAL_EXPORT void icaltimezone_free_builtin_timezones(void);
/** Returns the array of builtin icaltimezones. */
-LIBICAL_ICAL_EXPORT icalarray* icaltimezone_get_builtin_timezones(void);
+LIBICAL_ICAL_EXPORT icalarray *icaltimezone_get_builtin_timezones(void);
/** Returns a single builtin timezone, given its Olson city name. */
-LIBICAL_ICAL_EXPORT icaltimezone* icaltimezone_get_builtin_timezone (const char *location);
+LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_builtin_timezone(const char *location);
/** Returns a single builtin timezone, given its offset. */
-icaltimezone* icaltimezone_get_builtin_timezone_from_offset (int offset, const char *tzname);
+LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_builtin_timezone_from_offset(int offset,
+ const char *tzname);
/** Returns a single builtin timezone, given its TZID. */
-icaltimezone* icaltimezone_get_builtin_timezone_from_tzid (const char *tzid);
+LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_builtin_timezone_from_tzid(const char *tzid);
/** Returns the UTC timezone. */
-LIBICAL_ICAL_EXPORT icaltimezone* icaltimezone_get_utc_timezone(void);
+LIBICAL_ICAL_EXPORT icaltimezone *icaltimezone_get_utc_timezone(void);
/** Returns the TZID of a timezone. */
-LIBICAL_ICAL_EXPORT const char* icaltimezone_get_tzid(icaltimezone *zone);
+LIBICAL_ICAL_EXPORT const char *icaltimezone_get_tzid(icaltimezone * zone);
/** Returns the city name of a timezone. */
-LIBICAL_ICAL_EXPORT const char* icaltimezone_get_location(icaltimezone *zone);
+LIBICAL_ICAL_EXPORT const char *icaltimezone_get_location(icaltimezone * zone);
/** Returns the TZNAME properties used in the latest STANDARD and DAYLIGHT
components. If they are the same it will return just one, e.g. "LMT".
If they are different it will format them like "EST/EDT". Note that this
may also return NULL. */
-const char* icaltimezone_get_tznames(icaltimezone *zone);
+LIBICAL_ICAL_EXPORT const char *icaltimezone_get_tznames(icaltimezone * zone);
/** Returns the latitude of a builtin timezone. */
-double icaltimezone_get_latitude(icaltimezone *zone);
+LIBICAL_ICAL_EXPORT double icaltimezone_get_latitude(icaltimezone * zone);
/** Returns the longitude of a builtin timezone. */
-double icaltimezone_get_longitude(icaltimezone *zone);
+LIBICAL_ICAL_EXPORT double icaltimezone_get_longitude(icaltimezone * zone);
/** Returns the VTIMEZONE component of a timezone. */
-LIBICAL_ICAL_EXPORT icalcomponent* icaltimezone_get_component(icaltimezone *zone);
+LIBICAL_ICAL_EXPORT icalcomponent *icaltimezone_get_component(icaltimezone * zone);
/** Sets the VTIMEZONE component of an icaltimezone, initializing the tzid,
location & tzname fields. It returns 1 on success or 0 on failure, i.e.
no TZID was found. */
-int icaltimezone_set_component (icaltimezone *zone,
- icalcomponent *comp);
+LIBICAL_ICAL_EXPORT int icaltimezone_set_component(icaltimezone * zone, icalcomponent * comp);
-const char* icaltimezone_get_display_name (icaltimezone *zone);
+LIBICAL_ICAL_EXPORT const char *icaltimezone_get_display_name(icaltimezone * zone);
/**
* @par Converting times between timezones.
*/
-LIBICAL_ICAL_EXPORT void icaltimezone_convert_time (struct icaltimetype *tt,
- icaltimezone *from_zone,
- icaltimezone *to_zone);
-
+LIBICAL_ICAL_EXPORT void icaltimezone_convert_time(struct icaltimetype *tt,
+ icaltimezone * from_zone,
+ icaltimezone * to_zone);
/**
* @par Getting offsets from UTC.
@@ -124,27 +123,26 @@ LIBICAL_ICAL_EXPORT void icaltimezone_convert_time (struct icaltimetype *tt,
timezone. It is the number of seconds to add to UTC to get local
time. The is_daylight flag is set to 1 if the time is in
daylight-savings time. */
-int icaltimezone_get_utc_offset (icaltimezone *zone,
- struct icaltimetype *tt,
- int *is_daylight);
+LIBICAL_ICAL_EXPORT int icaltimezone_get_utc_offset(icaltimezone * zone,
+ struct icaltimetype *tt, int *is_daylight);
/** Calculates the UTC offset of a given UTC time in the given
timezone. It is the number of seconds to add to UTC to get local
time. The is_daylight flag is set to 1 if the time is in
daylight-savings time. */
-LIBICAL_ICAL_EXPORT int icaltimezone_get_utc_offset_of_utc_time (icaltimezone *zone,
- struct icaltimetype *tt,
- int *is_daylight);
+LIBICAL_ICAL_EXPORT int icaltimezone_get_utc_offset_of_utc_time(icaltimezone * zone,
+ struct icaltimetype *tt,
+ int *is_daylight);
/*
* Handling arrays of timezones. Mainly for internal use.
*/
-icalarray* icaltimezone_array_new (void);
+LIBICAL_ICAL_EXPORT icalarray *icaltimezone_array_new(void);
-void icaltimezone_array_append_from_vtimezone (icalarray *timezones,
- icalcomponent *child);
-void icaltimezone_array_free (icalarray *timezones);
+LIBICAL_ICAL_EXPORT void icaltimezone_array_append_from_vtimezone(icalarray * timezones,
+ icalcomponent * child);
+LIBICAL_ICAL_EXPORT void icaltimezone_array_free(icalarray * timezones);
/*
* @par Handling the default location the timezone files
@@ -155,13 +153,15 @@ LIBICAL_ICAL_EXPORT void set_zone_directory(char *path);
/** Free memory dedicated to the zonefile directory */
LIBICAL_ICAL_EXPORT void free_zone_directory(void);
-void icaltimezone_release_zone_tab(void);
+
+LIBICAL_ICAL_EXPORT void icaltimezone_release_zone_tab(void);
/*
* @par Handling whether to use builtin timezone files
*/
-void icaltimezone_set_builtin_tzdata(int set);
-int icaltimezone_get_builtin_tzdata(void);
+LIBICAL_ICAL_EXPORT void icaltimezone_set_builtin_tzdata(int set);
+
+LIBICAL_ICAL_EXPORT int icaltimezone_get_builtin_tzdata(void);
/*
* @par Debugging Output.
@@ -169,8 +169,6 @@ int icaltimezone_get_builtin_tzdata(void);
/** Dumps information about changes in the timezone up to and including
max_year. */
-int icaltimezone_dump_changes (icaltimezone *zone,
- int max_year,
- FILE *fp);
+LIBICAL_ICAL_EXPORT int icaltimezone_dump_changes(icaltimezone * zone, int max_year, FILE * fp);
#endif /* ICALTIMEZONE_H */
diff --git a/src/libical/icaltypes.h b/src/libical/icaltypes.h
index ca8c6566..4ad408f8 100644
--- a/src/libical/icaltypes.h
+++ b/src/libical/icaltypes.h
@@ -43,11 +43,13 @@ struct icaltriggertype
struct icaldurationtype duration;
};
-struct icaltriggertype icaltriggertype_from_int(const int reltime);
-struct icaltriggertype icaltriggertype_from_string(const char* str);
+LIBICAL_ICAL_EXPORT struct icaltriggertype icaltriggertype_from_int(const int reltime);
-int icaltriggertype_is_null_trigger(struct icaltriggertype tr);
-int icaltriggertype_is_bad_trigger(struct icaltriggertype tr);
+LIBICAL_ICAL_EXPORT struct icaltriggertype icaltriggertype_from_string(const char *str);
+
+LIBICAL_ICAL_EXPORT int icaltriggertype_is_null_trigger(struct icaltriggertype tr);
+
+LIBICAL_ICAL_EXPORT int icaltriggertype_is_bad_trigger(struct icaltriggertype tr);
/* struct icalreqstattype. This struct contains two string pointers,
but don't try to free either of them. The "desc" string is a pointer
@@ -60,54 +62,58 @@ BTW, you would get that original string from
*icalproperty_get_requeststatus() or icalvalue_get_text(), when
operating on the value of a request_status property. */
-struct icalreqstattype {
-
- icalrequeststatus code;
- const char* desc;
- const char* debug;
+struct icalreqstattype
+{
+ icalrequeststatus code;
+ const char *desc;
+ const char *debug;
};
-LIBICAL_ICAL_EXPORT struct icalreqstattype icalreqstattype_from_string(const char* str);
-LIBICAL_ICAL_EXPORT const char* icalreqstattype_as_string(struct icalreqstattype);
-char* icalreqstattype_as_string_r(struct icalreqstattype);
+LIBICAL_ICAL_EXPORT struct icalreqstattype icalreqstattype_from_string(const char *str);
+LIBICAL_ICAL_EXPORT const char *icalreqstattype_as_string(struct icalreqstattype);
+LIBICAL_ICAL_EXPORT char *icalreqstattype_as_string_r(struct icalreqstattype);
-struct icaltimezonephase {
- const char* tzname;
- int is_stdandard; /* 1 = standard tme, 0 = daylight savings time */
+struct icaltimezonephase
+{
+ const char *tzname;
+ int is_stdandard; /* 1 = standard tme, 0 = daylight savings time */
struct icaltimetype dtstart;
int offsetto;
int tzoffsetfrom;
- const char* comment;
+ const char *comment;
struct icaldatetimeperiodtype rdate;
- const char* rrule;
+ const char *rrule;
};
-
-struct icaltimezonetype {
- const char* tzid;
+struct icaltimezonetype
+{
+ const char *tzid;
struct icaltimetype last_mod;
- const char* tzurl;
+ const char *tzurl;
/* Array of phases. The end of the array is a phase with tzname == 0 */
struct icaltimezonephase *phases;
};
-void icaltimezonetype_free(struct icaltimezonetype tzt);
+LIBICAL_ICAL_EXPORT void icaltimezonetype_free(struct icaltimezonetype tzt);
/* ical_unknown_token_handling :
* How should the ICAL library handle components, properties and parameters with
* unknown names?
* FIXME: Currently only affects parameters. Extend to components and properties.
*/
-typedef enum ical_unknown_token_handling {
+typedef enum ical_unknown_token_handling
+{
ICAL_ASSUME_IANA_TOKEN = 1,
ICAL_DISCARD_TOKEN = 2,
ICAL_TREAT_AS_ERROR = 3
} ical_unknown_token_handling;
-ical_unknown_token_handling ical_get_unknown_token_handling_setting(void);
-void ical_set_unknown_token_handling_setting(ical_unknown_token_handling newSetting);
+LIBICAL_ICAL_EXPORT ical_unknown_token_handling ical_get_unknown_token_handling_setting(void);
+
+LIBICAL_ICAL_EXPORT void ical_set_unknown_token_handling_setting(
+ ical_unknown_token_handling newSetting);
#endif /* !ICALTYPES_H */
diff --git a/src/libical/icaltz-util.h b/src/libical/icaltz-util.h
index 7e1c2c4d..2a9b3d89 100644
--- a/src/libical/icaltz-util.h
+++ b/src/libical/icaltz-util.h
@@ -1,4 +1,3 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Authors :
* Chenthill Palanisamy <pchenthill@novell.com>
@@ -23,6 +22,7 @@
#ifndef ICALTZUTIL_H
#define ICALTZUTIL_H
+#include "libical_ical_export.h"
#include "icalcomponent.h"
#if defined(sun) && defined(__SVR4)
@@ -31,7 +31,8 @@
#define ZONES_TAB_SYSTEM_FILENAME "zone.tab"
#endif
-const char *icaltzutil_get_zone_directory (void);
-icalcomponent *icaltzutil_fetch_timezone (const char *location);
+LIBICAL_ICAL_EXPORT const char *icaltzutil_get_zone_directory(void);
+
+LIBICAL_ICAL_EXPORT icalcomponent *icaltzutil_fetch_timezone(const char *location);
#endif
diff --git a/src/libical/icalvalue.h b/src/libical/icalvalue.h
index 1a0ca324..601b1f7e 100644
--- a/src/libical/icalvalue.h
+++ b/src/libical/icalvalue.h
@@ -23,25 +23,26 @@
#include "libical_ical_export.h"
#include "icalvalueimpl.h"
-LIBICAL_ICAL_EXPORT icalvalue* icalvalue_new(icalvalue_kind kind);
+LIBICAL_ICAL_EXPORT icalvalue *icalvalue_new(icalvalue_kind kind);
-LIBICAL_ICAL_EXPORT icalvalue* icalvalue_new_clone(const icalvalue* value);
+LIBICAL_ICAL_EXPORT icalvalue *icalvalue_new_clone(const icalvalue * value);
-LIBICAL_ICAL_EXPORT icalvalue* icalvalue_new_from_string(icalvalue_kind kind, const char* str);
+LIBICAL_ICAL_EXPORT icalvalue *icalvalue_new_from_string(icalvalue_kind kind, const char *str);
-LIBICAL_ICAL_EXPORT void icalvalue_free(icalvalue* value);
+LIBICAL_ICAL_EXPORT void icalvalue_free(icalvalue * value);
-LIBICAL_ICAL_EXPORT int icalvalue_is_valid(const icalvalue* value);
+LIBICAL_ICAL_EXPORT int icalvalue_is_valid(const icalvalue * value);
-LIBICAL_ICAL_EXPORT const char* icalvalue_as_ical_string(const icalvalue* value);
-LIBICAL_ICAL_EXPORT char* icalvalue_as_ical_string_r(const icalvalue* value);
+LIBICAL_ICAL_EXPORT const char *icalvalue_as_ical_string(const icalvalue * value);
-LIBICAL_ICAL_EXPORT icalvalue_kind icalvalue_isa(const icalvalue* value);
+LIBICAL_ICAL_EXPORT char *icalvalue_as_ical_string_r(const icalvalue * value);
-LIBICAL_ICAL_EXPORT int icalvalue_isa_value(void*);
+LIBICAL_ICAL_EXPORT icalvalue_kind icalvalue_isa(const icalvalue * value);
-LIBICAL_ICAL_EXPORT icalparameter_xliccomparetype icalvalue_compare(const icalvalue* a,
- const icalvalue *b);
+LIBICAL_ICAL_EXPORT int icalvalue_isa_value(void *);
+
+LIBICAL_ICAL_EXPORT icalparameter_xliccomparetype icalvalue_compare(const icalvalue * a,
+ const icalvalue * b);
/* Special, non autogenerated value accessors */
@@ -55,22 +56,25 @@ LIBICAL_ICAL_EXPORT icalparameter_xliccomparetype icalvalue_compare(const icalva
/* struct icaltriggertype icalvalue_get_trigger(const icalvalue* value); */
/* icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v); */
-/* void icalvalue_set_datetimeperiod(icalvalue* value, */
+/* void icalvalue_set_datetimeperiod(icalvalue* value, */
/* struct icaldatetimeperiodtype v); */
/* struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(const icalvalue* value); */
/* Convert enumerations */
-LIBICAL_ICAL_EXPORT icalvalue_kind icalvalue_string_to_kind(const char* str);
-LIBICAL_ICAL_EXPORT const char* icalvalue_kind_to_string(const icalvalue_kind kind);
+LIBICAL_ICAL_EXPORT icalvalue_kind icalvalue_string_to_kind(const char *str);
+
+LIBICAL_ICAL_EXPORT const char *icalvalue_kind_to_string(const icalvalue_kind kind);
/** Check validity of a specific icalvalue_kind **/
-int icalvalue_kind_is_valid(const icalvalue_kind kind);
+LIBICAL_ICAL_EXPORT int icalvalue_kind_is_valid(const icalvalue_kind kind);
/** Encode a character string in ical format, esacpe certain characters, etc. */
-int icalvalue_encode_ical_string(const char *szText, char *szEncText, int MaxBufferLen);
+LIBICAL_ICAL_EXPORT int icalvalue_encode_ical_string(const char *szText,
+ char *szEncText, int MaxBufferLen);
/** Extract the original character string encoded by the above function **/
-int icalvalue_decode_ical_string(const char *szText, char *szDecText, int nMaxBufferLen);
+LIBICAL_ICAL_EXPORT int icalvalue_decode_ical_string(const char *szText,
+ char *szDecText, int nMaxBufferLen);
-#endif /*ICALVALUE_H*/
+#endif /*ICALVALUE_H */
diff --git a/src/libical/pvl.c b/src/libical/pvl.c
index cbab7161..4e9bb2c1 100644
--- a/src/libical/pvl.c
+++ b/src/libical/pvl.c
@@ -2,7 +2,6 @@
FILE: pvl.c
CREATOR: eric November, 1995
-
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
@@ -10,13 +9,12 @@
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
- 2.1, available at: http://www.fsf.org/copyleft/lesser.html
+ 2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
- Or:
+ Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
-
======================================================================*/
#ifdef HAVE_CONFIG_H
@@ -30,6 +28,13 @@
#include <stdlib.h>
/**
+ * Globals incremented for each call to pvl_new_element(); each list gets a unique id.
+ */
+
+static int pvl_elem_count = 0;
+static int pvl_list_count = 0;
+
+/**
struct pvl_list_t
The list structure. This is the hanlde for the entire list
@@ -47,18 +52,6 @@ typedef struct pvl_list_t
struct pvl_elem_t *p; /**< Pointer used for iterators */
} pvl_list_t;
-
-
-
-/**
- * This global is incremented for each call to pvl_new_element(); it gives each
- * list a unique identifer
- */
-
-int pvl_elem_count = 0;
-int pvl_list_count = 0;
-
-
/**
* @brief Creates a new list, clears the pointers and assigns a magic number
*
diff --git a/src/libical/pvl.h b/src/libical/pvl.h
index ed22c372..b77c74b8 100644
--- a/src/libical/pvl.h
+++ b/src/libical/pvl.h
@@ -22,8 +22,8 @@
#include "libical_ical_export.h"
-typedef struct pvl_list_t* pvl_list;
-typedef struct pvl_elem_t* pvl_elem;
+typedef struct pvl_list_t *pvl_list;
+typedef struct pvl_elem_t *pvl_elem;
/**
* This type is private. Always use pvl_elem instead. The struct would
@@ -33,72 +33,74 @@ typedef struct pvl_elem_t* pvl_elem;
typedef struct pvl_elem_t
{
- int MAGIC; /**< Magic Identifier */
- void *d; /**< Pointer to data user is storing */
- struct pvl_elem_t *next; /**< Next element */
- struct pvl_elem_t *prior; /**< Prior element */
+ int MAGIC; /**< Magic Identifier */
+ void *d; /**< Pointer to data user is storing */
+ struct pvl_elem_t *next; /**< Next element */
+ struct pvl_elem_t *prior; /**< Prior element */
} pvl_elem_t;
-
-
-/**
- * This global is incremented for each call to pvl_new_element(); it gives each
- * list a unique identifer
- */
-
-extern int pvl_elem_count;
-extern int pvl_list_count;
-
/* Create new lists or elements */
-pvl_elem pvl_new_element(void* d, pvl_elem next,pvl_elem prior);
+LIBICAL_ICAL_EXPORT pvl_elem pvl_new_element(void *d, pvl_elem next, pvl_elem prior);
+
LIBICAL_ICAL_EXPORT pvl_list pvl_newlist(void);
+
LIBICAL_ICAL_EXPORT void pvl_free(pvl_list);
/* Add, remove, or get the head of the list */
-void pvl_unshift(pvl_list l,void *d);
-void* pvl_shift(pvl_list l);
+LIBICAL_ICAL_EXPORT void pvl_unshift(pvl_list l, void *d);
+
+LIBICAL_ICAL_EXPORT void *pvl_shift(pvl_list l);
+
LIBICAL_ICAL_EXPORT pvl_elem pvl_head(pvl_list);
/* Add, remove or get the tail of the list */
-LIBICAL_ICAL_EXPORT void pvl_push(pvl_list l,void *d);
-LIBICAL_ICAL_EXPORT void* pvl_pop(pvl_list l);
+LIBICAL_ICAL_EXPORT void pvl_push(pvl_list l, void *d);
+
+LIBICAL_ICAL_EXPORT void *pvl_pop(pvl_list l);
+
LIBICAL_ICAL_EXPORT pvl_elem pvl_tail(pvl_list);
/* Insert elements in random places */
-typedef int (*pvl_comparef)(void* a, void* b); /* a, b are of the data type*/
-LIBICAL_ICAL_EXPORT void pvl_insert_ordered(pvl_list l,pvl_comparef f,void *d);
-void pvl_insert_after(pvl_list l,pvl_elem e,void *d);
-void pvl_insert_before(pvl_list l,pvl_elem e,void *d);
+typedef int (*pvl_comparef) (void *a, void *b); /* a, b are of the data type */
+
+LIBICAL_ICAL_EXPORT void pvl_insert_ordered(pvl_list l, pvl_comparef f, void *d);
+
+LIBICAL_ICAL_EXPORT void pvl_insert_after(pvl_list l, pvl_elem e, void *d);
+
+LIBICAL_ICAL_EXPORT void pvl_insert_before(pvl_list l, pvl_elem e, void *d);
/* Remove an element, or clear the entire list */
-void* pvl_remove(pvl_list,pvl_elem); /* Remove element, return data */
-void pvl_clear(pvl_list); /* Remove all elements, de-allocate all data */
+LIBICAL_ICAL_EXPORT void *pvl_remove(pvl_list, pvl_elem); /* Remove element, return data */
-int pvl_count(pvl_list);
+LIBICAL_ICAL_EXPORT void pvl_clear(pvl_list); /* Remove all elements, de-allocate all data */
+
+LIBICAL_ICAL_EXPORT int pvl_count(pvl_list);
/* Navagate the list */
LIBICAL_ICAL_EXPORT pvl_elem pvl_next(pvl_elem e);
-pvl_elem pvl_prior(pvl_elem e);
+
+LIBICAL_ICAL_EXPORT pvl_elem pvl_prior(pvl_elem e);
/* get the data in the list */
#ifndef PVL_USE_MACROS
-LIBICAL_ICAL_EXPORT void* pvl_data(pvl_elem);
+LIBICAL_ICAL_EXPORT void *pvl_data(pvl_elem);
#else
#define pvl_data(x) x==0 ? 0 : ((struct pvl_elem_t *)x)->d;
#endif
-
/* Find an element for which a function returns true */
-typedef int (*pvl_findf)(void* a, void* b); /*a is list elem, b is other data*/
-pvl_elem pvl_find(pvl_list l,pvl_findf f,void* v);
-pvl_elem pvl_find_next(pvl_list l,pvl_findf f,void* v);
+typedef int (*pvl_findf) (void *a, void *b); /*a is list elem, b is other data */
+
+LIBICAL_ICAL_EXPORT pvl_elem pvl_find(pvl_list l, pvl_findf f, void *v);
+
+LIBICAL_ICAL_EXPORT pvl_elem pvl_find_next(pvl_list l, pvl_findf f, void *v);
/**
* Pass each element in the list to a function
* a is list elem, b is other data
*/
-typedef void (*pvl_applyf)(void* a, void* b);
-void pvl_apply(pvl_list l,pvl_applyf f, void *v);
+typedef void (*pvl_applyf) (void *a, void *b);
+LIBICAL_ICAL_EXPORT void pvl_apply(pvl_list l, pvl_applyf f, void *v);
#endif /* ICAL_PVL_H */
diff --git a/src/libical/sspm.h b/src/libical/sspm.h
index 24098cec..0545f806 100644
--- a/src/libical/sspm.h
+++ b/src/libical/sspm.h
@@ -34,7 +34,8 @@
#include "libical_ical_export.h"
-enum sspm_major_type {
+enum sspm_major_type
+{
SSPM_NO_MAJOR_TYPE,
SSPM_TEXT_MAJOR_TYPE,
SSPM_IMAGE_MAJOR_TYPE,
@@ -46,7 +47,8 @@ enum sspm_major_type {
SSPM_UNKNOWN_MAJOR_TYPE
};
-enum sspm_minor_type {
+enum sspm_minor_type
+{
SSPM_NO_MINOR_TYPE,
SSPM_ANY_MINOR_TYPE,
SSPM_PLAIN_MINOR_TYPE,
@@ -60,7 +62,8 @@ enum sspm_minor_type {
SSPM_UNKNOWN_MINOR_TYPE
};
-enum sspm_encoding {
+enum sspm_encoding
+{
SSPM_NO_ENCODING,
SSPM_QUOTED_PRINTABLE_ENCODING,
SSPM_8BIT_ENCODING,
@@ -70,7 +73,8 @@ enum sspm_encoding {
SSPM_UNKNOWN_ENCODING
};
-enum sspm_error {
+enum sspm_error
+{
SSPM_NO_ERROR,
SSPM_UNEXPECTED_BOUNDARY_ERROR,
SSPM_WRONG_BOUNDARY_ERROR,
@@ -79,7 +83,8 @@ enum sspm_error {
SSPM_MALFORMED_HEADER_ERROR
};
-struct sspm_header {
+struct sspm_header
+{
int def;
char *boundary;
enum sspm_major_type major;
@@ -94,21 +99,22 @@ struct sspm_header {
char *error_text;
};
-struct sspm_part {
+struct sspm_part
+{
struct sspm_header header;
int level;
size_t data_size;
void *data;
};
-struct sspm_action_map {
+struct sspm_action_map
+{
enum sspm_major_type major;
enum sspm_minor_type minor;
- void *(*new_part)(void);
- void (*add_line)(void *part, struct sspm_header *header,
- const char *line, size_t size);
- void *(*end_part)(void *part);
- void (*free_part)(void *part);
+ void *(*new_part) (void);
+ void (*add_line) (void *part, struct sspm_header * header, const char *line, size_t size);
+ void *(*end_part) (void *part);
+ void (*free_part) (void *part);
};
LIBICAL_ICAL_EXPORT const char *sspm_major_type_string(enum sspm_major_type type);
@@ -120,19 +126,14 @@ LIBICAL_ICAL_EXPORT const char *sspm_encoding_string(enum sspm_encoding type);
LIBICAL_ICAL_EXPORT int sspm_parse_mime(struct sspm_part *parts,
size_t max_parts,
const struct sspm_action_map *actions,
- char *(*get_string)(char *s, size_t size, void *data),
- void *get_string_data,
- struct sspm_header *first_header);
+ char *(*get_string) (char *s, size_t size, void *data),
+ void *get_string_data, struct sspm_header *first_header);
LIBICAL_ICAL_EXPORT void sspm_free_parts(struct sspm_part *parts, size_t max_parts);
-LIBICAL_ICAL_EXPORT char *decode_quoted_printable(char *dest,
- char *src,
- size_t *size);
+LIBICAL_ICAL_EXPORT char *decode_quoted_printable(char *dest, char *src, size_t * size);
-LIBICAL_ICAL_EXPORT char *decode_base64(char *dest,
- char *src,
- size_t *size);
+LIBICAL_ICAL_EXPORT char *decode_base64(char *dest, char *src, size_t * size);
LIBICAL_ICAL_EXPORT int sspm_write_mime(struct sspm_part *parts, size_t num_parts,
char **output_string, const char *header);
diff --git a/src/libicalss/icalbdbset.h b/src/libicalss/icalbdbset.h
index 66da0bed..0a9708c2 100644
--- a/src/libicalss/icalbdbset.h
+++ b/src/libicalss/icalbdbset.h
@@ -18,130 +18,159 @@
#ifndef ICALBDBSET_H
#define ICALBDBSET_H
+#include "libical_icalss_export.h"
#include "icalset.h"
#include <db.h>
typedef struct icalbdbset_impl icalbdbset;
-enum icalbdbset_subdb_type {ICALBDB_CALENDARS, ICALBDB_EVENTS, ICALBDB_TODOS, ICALBDB_REMINDERS};
+enum icalbdbset_subdb_type
+{ ICALBDB_CALENDARS, ICALBDB_EVENTS, ICALBDB_TODOS, ICALBDB_REMINDERS };
typedef enum icalbdbset_subdb_type icalbdbset_subdb_type;
/** sets up the db environment, should be done in parent thread.. */
-int icalbdbset_init_dbenv(char *db_env_dir, void (*logDbFunc)(const DB_ENV *, const char *, const char *));
+LIBICAL_ICALSS_EXPORT int icalbdbset_init_dbenv(char *db_env_dir,
+ void (*logDbFunc) (const DB_ENV *,
+ const char *, const char *));
-icalset *icalbdbset_init(icalset *set, const char *dsn, void *options);
-int icalbdbset_cleanup(void);
-void icalbdbset_checkpoint(void);
-void icalbdbset_rmdbLog(void);
+LIBICAL_ICALSS_EXPORT icalset *icalbdbset_init(icalset * set, const char *dsn, void *options);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_cleanup(void);
+
+LIBICAL_ICALSS_EXPORT void icalbdbset_checkpoint(void);
+
+LIBICAL_ICALSS_EXPORT void icalbdbset_rmdbLog(void);
/** Creates a component handle. flags allows caller to
specify if database is internally a BTREE or HASH */
-icalset *icalbdbset_new(const char *database_filename,
- icalbdbset_subdb_type subdb_type,
- int dbtype, u_int32_t flag);
+LIBICAL_ICALSS_EXPORT icalset *icalbdbset_new(const char *database_filename,
+ icalbdbset_subdb_type subdb_type,
+ int dbtype, u_int32_t flag);
-DB *icalbdbset_bdb_open_secondary(DB *dbp,
- const char *subdb,
- const char *sindex,
- int (*callback)(DB *db,
- const DBT *dbt1,
- const DBT *dbt2,
- DBT *dbt3),
- int type);
+LIBICAL_ICALSS_EXPORT DB *icalbdbset_bdb_open_secondary(DB * dbp,
+ const char *subdb,
+ const char *sindex,
+ int (*callback) (DB * db,
+ const DBT * dbt1,
+ const DBT * dbt2,
+ DBT * dbt3), int type);
-char *icalbdbset_parse_data(DBT *dbt, char *(*pfunc)(const DBT *dbt));
+LIBICAL_ICALSS_EXPORT char *icalbdbset_parse_data(DBT * dbt, char *(*pfunc) (const DBT * dbt));
-void icalbdbset_free(icalset *set);
+LIBICAL_ICALSS_EXPORT void icalbdbset_free(icalset * set);
/* cursor operations */
-int icalbdbset_acquire_cursor(DB *dbp, DB_TXN *tid, DBC **rdbcp);
-int icalbdbset_cget(DBC *dbcp, DBT *key, DBT *data, u_int32_t access_method);
-int icalbdbset_cput(DBC *dbcp, DBT *key, DBT *data, u_int32_t access_method);
+LIBICAL_ICALSS_EXPORT int icalbdbset_acquire_cursor(DB * dbp, DB_TXN * tid, DBC ** rdbcp);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_cget(DBC * dbcp, DBT * key, DBT * data,
+ u_int32_t access_method);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_cput(DBC * dbcp, DBT * key, DBT * data,
+ u_int32_t access_method);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_get_first(DBC * dbcp, DBT * key, DBT * data);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_get_next(DBC * dbcp, DBT * key, DBT * data);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_get_last(DBC * dbcp, DBT * key, DBT * data);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_get_key(DBC * dbcp, DBT * key, DBT * data);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_delete(DB * dbp, DBT * key);
+
+LIBICAL_ICALSS_EXPORT int icalbdbset_put(DB * dbp, DBT * key, DBT * data, u_int32_t access_method);
-int icalbdbset_get_first(DBC *dbcp, DBT *key, DBT *data);
-int icalbdbset_get_next(DBC *dbcp, DBT *key, DBT *data);
-int icalbdbset_get_last(DBC *dbcp, DBT *key, DBT *data);
-int icalbdbset_get_key(DBC *dbcp, DBT *key, DBT *data);
-int icalbdbset_delete(DB *dbp, DBT *key);
-int icalbdbset_put(DB *dbp, DBT *key, DBT *data, u_int32_t access_method);
-int icalbdbset_get(DB *dbp, DB_TXN *tid, DBT *key, DBT *data, u_int32_t flags);
+LIBICAL_ICALSS_EXPORT int icalbdbset_get(DB * dbp, DB_TXN * tid, DBT * key, DBT * data,
+ u_int32_t flags);
-const char *icalbdbset_path(icalset *set);
-const char *icalbdbset_subdb(icalset *set);
+LIBICAL_ICALSS_EXPORT const char *icalbdbset_path(icalset * set);
+
+LIBICAL_ICALSS_EXPORT const char *icalbdbset_subdb(icalset * set);
/* Mark the set as changed, so it will be written to disk when it
is freed. Commit writes to disk immediately. */
-void icalbdbset_mark(icalset *set);
-icalerrorenum icalbdbset_commit(icalset *set);
+LIBICAL_ICALSS_EXPORT void icalbdbset_mark(icalset * set);
+
+LIBICAL_ICALSS_EXPORT icalerrorenum icalbdbset_commit(icalset * set);
-icalerrorenum icalbdbset_add_component(icalset *set,
- icalcomponent *child);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalbdbset_add_component(icalset * set, icalcomponent * child);
-icalerrorenum icalbdbset_remove_component(icalset *set,
- icalcomponent *child);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalbdbset_remove_component(icalset * set,
+ icalcomponent * child);
-int icalbdbset_count_components(icalset *set,
- icalcomponent_kind kind);
+LIBICAL_ICALSS_EXPORT int icalbdbset_count_components(icalset * set, icalcomponent_kind kind);
/* Restrict the component returned by icalbdbset_first, _next to those
that pass the gauge. _clear removes the gauge */
-icalerrorenum icalbdbset_select(icalset *store, icalgauge *gauge);
-void icalbdbset_clear(icalset *store);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalbdbset_select(icalset * store, icalgauge * gauge);
+
+LIBICAL_ICALSS_EXPORT void icalbdbset_clear(icalset * store);
/* Get and search for a component by uid */
-icalcomponent *icalbdbset_fetch(icalset *set, icalcomponent_kind kind, const char *uid);
-int icalbdbset_has_uid(icalset *set, const char *uid);
-icalcomponent *icalbdbset_fetch_match(icalset *set, icalcomponent *c);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_fetch(icalset * set,
+ icalcomponent_kind kind, const char *uid);
-icalerrorenum icalbdbset_modify(icalset *set, icalcomponent *old,
- icalcomponent *newc);
+LIBICAL_ICALSS_EXPORT int icalbdbset_has_uid(icalset * set, const char *uid);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_fetch_match(icalset * set, icalcomponent * c);
+
+LIBICAL_ICALSS_EXPORT icalerrorenum icalbdbset_modify(icalset * set, icalcomponent * old,
+ icalcomponent * newc);
/* cluster management functions */
-icalerrorenum icalbdbset_set_cluster(icalset *set, icalcomponent *cluster);
-icalerrorenum icalbdbset_free_cluster(icalset *set);
-icalcomponent *icalbdbset_get_cluster(icalset *set);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalbdbset_set_cluster(icalset * set, icalcomponent * cluster);
+
+LIBICAL_ICALSS_EXPORT icalerrorenum icalbdbset_free_cluster(icalset * set);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_get_cluster(icalset * set);
/* Iterate through components. If a gauge has been defined, these
will skip over components that do not pass the gauge */
-icalcomponent *icalbdbset_get_current_component(icalset *set);
-icalcomponent *icalbdbset_get_first_component(icalset *set);
-icalcomponent *icalbdbset_get_next_component(icalset *set);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_get_current_component(icalset * set);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_get_first_component(icalset * set);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_get_next_component(icalset * set);
/* External iterator for thread safety */
-icalsetiter icalbdbset_begin_component(icalset *set, icalcomponent_kind kind, icalgauge *gauge, const char *tzid);
+LIBICAL_ICALSS_EXPORT icalsetiter icalbdbset_begin_component(icalset * set,
+ icalcomponent_kind kind,
+ icalgauge * gauge, const char *tzid);
-icalcomponent *icalbdbset_form_a_matched_recurrence_component(icalsetiter *itr);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_form_a_matched_recurrence_component(icalsetiter *
+ itr);
-icalcomponent *icalbdbsetiter_to_next(icalset *set, icalsetiter *i);
-icalcomponent *icalbdbsetiter_to_prior(icalset *set, icalsetiter *i);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbsetiter_to_next(icalset * set, icalsetiter * i);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbsetiter_to_prior(icalset * set, icalsetiter * i);
/* Return a reference to the internal component. You probably should
not be using this. */
-icalcomponent *icalbdbset_get_component(icalset *set);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalbdbset_get_component(icalset * set);
+
+LIBICAL_ICALSS_EXPORT DB_ENV *icalbdbset_get_env(void);
-DB_ENV *icalbdbset_get_env(void);
+LIBICAL_ICALSS_EXPORT int icalbdbset_begin_transaction(DB_TXN * parent_id, DB_TXN ** txnid);
-int icalbdbset_begin_transaction(DB_TXN *parent_id, DB_TXN **txnid);
-int icalbdbset_commit_transaction(DB_TXN *txnid);
+LIBICAL_ICALSS_EXPORT int icalbdbset_commit_transaction(DB_TXN * txnid);
-DB *icalbdbset_bdb_open(const char *path,
- const char *subdb,
- int type,
- int mode, u_int32_t flag);
+LIBICAL_ICALSS_EXPORT DB *icalbdbset_bdb_open(const char *path,
+ const char *subdb,
+ int type, int mode, u_int32_t flag);
-typedef struct icalbdbset_options {
+typedef struct icalbdbset_options
+{
icalbdbset_subdb_type subdb; /**< the subdatabase to open */
- int dbtype; /**< db_open type: DB_HASH | DB_BTREE */
- int mode; /**< file mode */
- u_int32_t flag; /**< DB->set_flags(): DB_DUP | DB_DUPSORT */
- char *(*pfunc)(const DBT *dbt); /**< parsing function */
- int (*callback)(DB *db, /**< callback for secondary db open */
- const DBT *dbt1,
- const DBT *dbt2,
- DBT *dbt3);
+ int dbtype; /**< db_open type: DB_HASH | DB_BTREE */
+ int mode; /**< file mode */
+ u_int32_t flag; /**< DB->set_flags(): DB_DUP | DB_DUPSORT */
+ char *(*pfunc) (const DBT * dbt);/**< parsing function */
+ int (*callback) (DB * db,
+ /**< callback for secondary db open */
+ const DBT * dbt1, const DBT * dbt2, DBT * dbt3);
} icalbdbset_options;
#endif /* !ICALBDBSET_H */
diff --git a/src/libicalss/icalcalendar.h b/src/libicalss/icalcalendar.h
index 371db10d..42cdf3f4 100644
--- a/src/libicalss/icalcalendar.h
+++ b/src/libicalss/icalcalendar.h
@@ -33,25 +33,24 @@
typedef struct icalcalendar_impl icalcalendar;
-LIBICAL_ICALSS_EXPORT icalcalendar* icalcalendar_new(char* dir);
+LIBICAL_ICALSS_EXPORT icalcalendar *icalcalendar_new(char *dir);
-LIBICAL_ICALSS_EXPORT void icalcalendar_free(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT void icalcalendar_free(icalcalendar * calendar);
-int icalcalendar_lock(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT int icalcalendar_lock(icalcalendar * calendar);
-int icalcalendar_unlock(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT int icalcalendar_unlock(icalcalendar * calendar);
-int icalcalendar_islocked(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT int icalcalendar_islocked(icalcalendar * calendar);
-int icalcalendar_ownlock(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT int icalcalendar_ownlock(icalcalendar * calendar);
-LIBICAL_ICALSS_EXPORT icalset* icalcalendar_get_booked(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_booked(icalcalendar * calendar);
-icalset* icalcalendar_get_incoming(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_incoming(icalcalendar * calendar);
-LIBICAL_ICALSS_EXPORT icalset* icalcalendar_get_properties(icalcalendar* calendar);
-
-icalset* icalcalendar_get_freebusy(icalcalendar* calendar);
+LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_properties(icalcalendar * calendar);
+LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_freebusy(icalcalendar * calendar);
#endif /* !ICALCALENDAR_H */
diff --git a/src/libicalss/icalclassify.h b/src/libicalss/icalclassify.h
index a04fd349..3395469d 100644
--- a/src/libicalss/icalclassify.h
+++ b/src/libicalss/icalclassify.h
@@ -2,8 +2,6 @@
FILE: icalclassify.h
CREATOR: eric 21 Aug 2000
-
-
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
@@ -18,7 +16,6 @@
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
-
=========================================================================*/
#ifndef ICALCLASSIFY_H
@@ -28,13 +25,12 @@
#include "icalset.h"
#include "icalcomponent.h"
-LIBICAL_ICALSS_EXPORT icalproperty_xlicclass icalclassify(icalcomponent* c,
- icalcomponent* match,
- const char* user);
-
-LIBICAL_ICALSS_EXPORT icalcomponent* icalclassify_find_overlaps(icalset* set, icalcomponent* comp);
+LIBICAL_ICALSS_EXPORT icalproperty_xlicclass icalclassify(icalcomponent * c,
+ icalcomponent * match, const char *user);
-char* icalclassify_class_to_string(icalproperty_xlicclass c);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalclassify_find_overlaps(icalset * set,
+ icalcomponent * comp);
+LIBICAL_ICALSS_EXPORT char *icalclassify_class_to_string(icalproperty_xlicclass c);
-#endif /* ICALCLASSIFY_H*/
+#endif /* ICALCLASSIFY_H */
diff --git a/src/libicalss/icalcluster.h b/src/libicalss/icalcluster.h
index 1604e84e..f19476d8 100644
--- a/src/libicalss/icalcluster.h
+++ b/src/libicalss/icalcluster.h
@@ -19,30 +19,41 @@
#ifndef ICALCLUSTER_H
#define ICALCLUSTER_H
+#include "libical_icalss_export.h"
#include "icalcomponent.h"
#include "icalerror.h"
typedef struct icalcluster_impl icalcluster;
-icalcluster* icalcluster_new(const char *key, icalcomponent *data);
-icalcluster* icalcluster_new_clone(const icalcluster *cluster);
+LIBICAL_ICALSS_EXPORT icalcluster *icalcluster_new(const char *key, icalcomponent * data);
-void icalcluster_free(icalcluster *cluster);
+LIBICAL_ICALSS_EXPORT icalcluster *icalcluster_new_clone(const icalcluster * cluster);
-const char* icalcluster_key(icalcluster *cluster);
-int icalcluster_is_changed(icalcluster *cluster);
-void icalcluster_mark(icalcluster *cluster);
-void icalcluster_commit(icalcluster *cluster);
+LIBICAL_ICALSS_EXPORT void icalcluster_free(icalcluster * cluster);
-icalcomponent* icalcluster_get_component(icalcluster* cluster);
-int icalcluster_count_components(icalcluster *cluster, icalcomponent_kind kind);
-icalerrorenum icalcluster_add_component(icalcluster* cluster,
- icalcomponent* child);
-icalerrorenum icalcluster_remove_component(icalcluster* cluster,
- icalcomponent* child);
+LIBICAL_ICALSS_EXPORT const char *icalcluster_key(icalcluster * cluster);
-icalcomponent* icalcluster_get_current_component(icalcluster* cluster);
-icalcomponent* icalcluster_get_first_component(icalcluster* cluster);
-icalcomponent* icalcluster_get_next_component(icalcluster* cluster);
+LIBICAL_ICALSS_EXPORT int icalcluster_is_changed(icalcluster * cluster);
+
+LIBICAL_ICALSS_EXPORT void icalcluster_mark(icalcluster * cluster);
+
+LIBICAL_ICALSS_EXPORT void icalcluster_commit(icalcluster * cluster);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_component(icalcluster * cluster);
+
+LIBICAL_ICALSS_EXPORT int icalcluster_count_components(icalcluster * cluster,
+ icalcomponent_kind kind);
+
+LIBICAL_ICALSS_EXPORT icalerrorenum icalcluster_add_component(icalcluster * cluster,
+ icalcomponent * child);
+
+LIBICAL_ICALSS_EXPORT icalerrorenum icalcluster_remove_component(icalcluster * cluster,
+ icalcomponent * child);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_current_component(icalcluster * cluster);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_first_component(icalcluster * cluster);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_next_component(icalcluster * cluster);
#endif /* !ICALCLUSTER_H */
diff --git a/src/libicalss/icaldirset.h b/src/libicalss/icaldirset.h
index 846ad0f6..d50e8c24 100644
--- a/src/libicalss/icaldirset.h
+++ b/src/libicalss/icaldirset.h
@@ -23,6 +23,7 @@
#ifndef ICALDIRSET_H
#define ICALDIRSET_H
+#include "libical_icalss_export.h"
#include "icalset.h"
/* icaldirset Routines for storing, fetching, and searching for ical
@@ -32,55 +33,67 @@ typedef struct icaldirset_impl icaldirset;
LIBICAL_ICALSS_EXPORT icalset *icaldirset_new(const char *path);
-icalset *icaldirset_new_reader(const char *path);
-icalset *icaldirset_new_writer(const char *path);
+LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_reader(const char *path);
-icalset *icaldirset_init(icalset *set, const char *dsn, void *options);
-void icaldirset_free(icalset *set);
+LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_writer(const char *path);
-const char *icaldirset_path(icalset *set);
+LIBICAL_ICALSS_EXPORT icalset *icaldirset_init(icalset * set, const char *dsn, void *options);
+
+LIBICAL_ICALSS_EXPORT void icaldirset_free(icalset * set);
+
+LIBICAL_ICALSS_EXPORT const char *icaldirset_path(icalset * set);
/* Mark the cluster as changed, so it will be written to disk when it
is freed. Commit writes to disk immediately*/
-void icaldirset_mark(icalset *set);
-icalerrorenum icaldirset_commit(icalset *set);
+LIBICAL_ICALSS_EXPORT void icaldirset_mark(icalset * set);
+
+LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_commit(icalset * set);
-LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_add_component(icalset *store,
- icalcomponent *comp);
-LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_remove_component(icalset *store,
- icalcomponent *comp);
+LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_add_component(icalset * store, icalcomponent * comp);
+LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_remove_component(icalset * store,
+ icalcomponent * comp);
-int icaldirset_count_components(icalset *store,
- icalcomponent_kind kind);
+LIBICAL_ICALSS_EXPORT int icaldirset_count_components(icalset * store, icalcomponent_kind kind);
/* Restrict the component returned by icaldirset_first, _next to those
that pass the gauge. _clear removes the gauge. */
-LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_select(icalset *store, icalgauge *gauge);
-void icaldirset_clear(icalset *store);
+LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_select(icalset * store, icalgauge * gauge);
+
+LIBICAL_ICALSS_EXPORT void icaldirset_clear(icalset * store);
/* Get a component by uid */
-icalcomponent *icaldirset_fetch(icalset *store, icalcomponent_kind kind, const char *uid);
-int icaldirset_has_uid(icalset *store, const char *uid);
-icalcomponent *icaldirset_fetch_match(icalset *set, icalcomponent *c);
+LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch(icalset * store,
+ icalcomponent_kind kind, const char *uid);
+
+LIBICAL_ICALSS_EXPORT int icaldirset_has_uid(icalset * store, const char *uid);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch_match(icalset * set, icalcomponent * c);
/* Modify components according to the MODIFY method of CAP. Works on
the currently selected components. */
-icalerrorenum icaldirset_modify(icalset *store, icalcomponent *oldc,
- icalcomponent *newc);
+LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_modify(icalset * store,
+ icalcomponent * oldc, icalcomponent * newc);
/* Iterate through the components. If a gauge has been defined, these
will skip over components that do not pass the gauge */
-LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_current_component(icalset *store);
-LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_first_component(icalset *store);
-LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_next_component(icalset *store);
+LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_current_component(icalset * store);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_first_component(icalset * store);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_next_component(icalset * store);
/* External iterator for thread safety */
-icalsetiter icaldirset_begin_component(icalset *set, icalcomponent_kind kind, icalgauge *gauge, const char *tzid);
-icalcomponent *icaldirsetiter_to_next(icalset *set, icalsetiter *i);
-icalcomponent *icaldirsetiter_to_prior(icalset *set, icalsetiter *i);
+LIBICAL_ICALSS_EXPORT icalsetiter icaldirset_begin_component(icalset * set,
+ icalcomponent_kind kind,
+ icalgauge * gauge, const char *tzid);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_next(icalset * set, icalsetiter * i);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_prior(icalset * set, icalsetiter * i);
-typedef struct icaldirset_options {
+typedef struct icaldirset_options
+{
int flags; /**< flags corresponding to the open() system call O_RDWR, etc. */
} icaldirset_options;
diff --git a/src/libicalss/icalfileset.h b/src/libicalss/icalfileset.h
index 4ddd408d..f868402d 100644
--- a/src/libicalss/icalfileset.h
+++ b/src/libicalss/icalfileset.h
@@ -29,84 +29,83 @@
typedef struct icalfileset_impl icalfileset;
LIBICAL_ICALSS_EXPORT icalset *icalfileset_new(const char *path);
+
LIBICAL_ICALSS_EXPORT icalset *icalfileset_new_reader(const char *path);
+
LIBICAL_ICALSS_EXPORT icalset *icalfileset_new_writer(const char *path);
-LIBICAL_ICALSS_EXPORT icalset *icalfileset_init(icalset *set,
- const char *dsn,
- void *options);
+LIBICAL_ICALSS_EXPORT icalset *icalfileset_init(icalset * set, const char *dsn, void *options);
LIBICAL_ICALSS_EXPORT icalfileset *icalfileset_new_from_cluster(const char *path,
- icalcluster *cluster);
+ icalcluster * cluster);
LIBICAL_ICALSS_EXPORT icalcluster *icalfileset_produce_icalcluster(const char *path);
-LIBICAL_ICALSS_EXPORT void icalfileset_free(icalset *cluster);
+LIBICAL_ICALSS_EXPORT void icalfileset_free(icalset * cluster);
-LIBICAL_ICALSS_EXPORT const char *icalfileset_path(icalset *cluster);
+LIBICAL_ICALSS_EXPORT const char *icalfileset_path(icalset * cluster);
/* Mark the cluster as changed, so it will be written to disk when it
is freed. Commit writes to disk immediately. */
-LIBICAL_ICALSS_EXPORT void icalfileset_mark(icalset *set);
-LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_commit(icalset *set);
+LIBICAL_ICALSS_EXPORT void icalfileset_mark(icalset * set);
+
+LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_commit(icalset * set);
-LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_add_component(icalset *set,
- icalcomponent *child);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_add_component(icalset * set, icalcomponent * child);
-LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_remove_component(icalset *set,
- icalcomponent *child);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_remove_component(icalset * set,
+ icalcomponent * child);
-LIBICAL_ICALSS_EXPORT int icalfileset_count_components(icalset *set,
- icalcomponent_kind kind);
+LIBICAL_ICALSS_EXPORT int icalfileset_count_components(icalset * set, icalcomponent_kind kind);
/**
* Restrict the component returned by icalfileset_first, _next to those
* that pass the gauge. _clear removes the gauge
*/
-LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_select(icalset *set, icalgauge *gauge);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_select(icalset * set, icalgauge * gauge);
/** clear the gauge **/
-LIBICAL_ICALSS_EXPORT void icalfileset_clear(icalset *set);
+LIBICAL_ICALSS_EXPORT void icalfileset_clear(icalset * set);
/** Get and search for a component by uid **/
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_fetch(icalset *set,
- icalcomponent_kind kind,
- const char *uid);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_fetch(icalset * set,
+ icalcomponent_kind kind, const char *uid);
-LIBICAL_ICALSS_EXPORT int icalfileset_has_uid(icalset *set, const char *uid);
+LIBICAL_ICALSS_EXPORT int icalfileset_has_uid(icalset * set, const char *uid);
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_fetch_match(icalset *set, icalcomponent *c);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_fetch_match(icalset * set, icalcomponent * c);
/**
* Modify components according to the MODIFY method of CAP. Works on the
* currently selected components.
*/
-LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_modify(icalset *set,
- icalcomponent *oldcomp,
- icalcomponent *newcomp);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalfileset_modify(icalset * set,
+ icalcomponent * oldcomp,
+ icalcomponent * newcomp);
/* Iterate through components. If a gauge has been defined, these
will skip over components that do not pass the gauge */
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_current_component(icalset *cluster);
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_first_component(icalset *cluster);
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_next_component(icalset *cluster);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_current_component(icalset * cluster);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_first_component(icalset * cluster);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_next_component(icalset * cluster);
/* External iterator for thread safety */
-LIBICAL_ICALSS_EXPORT icalsetiter icalfileset_begin_component(icalset *set,
+LIBICAL_ICALSS_EXPORT icalsetiter icalfileset_begin_component(icalset * set,
icalcomponent_kind kind,
- icalgauge *gauge,
- const char *tzid);
+ icalgauge * gauge, const char *tzid);
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfilesetiter_to_next(icalset *set,
- icalsetiter *iter);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfilesetiter_to_next(icalset * set, icalsetiter * iter);
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_form_a_matched_recurrence_component(icalsetiter *itr);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_form_a_matched_recurrence_component(icalsetiter *
+ itr);
/** Return a reference to the internal component. You probably should
not be using this. */
-LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_component(icalset *cluster);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_component(icalset * cluster);
/**
* @brief options for opening an icalfileset.
@@ -114,11 +113,12 @@ LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_component(icalset *cluster)
* These options should be passed to the icalset_new() function
*/
-typedef struct icalfileset_options {
- int flags; /**< flags for open() O_RDONLY, etc */
- int mode; /**< file mode */
- int safe_saves; /**< to lock or not */
- icalcluster *cluster; /**< use this cluster to initialize data */
+typedef struct icalfileset_options
+{
+ int flags; /**< flags for open() O_RDONLY, etc */
+ int mode; /**< file mode */
+ int safe_saves; /**< to lock or not */
+ icalcluster *cluster; /**< use this cluster to initialize data */
} icalfileset_options;
extern icalfileset_options icalfileset_options_default;
diff --git a/src/libicalss/icalgauge.h b/src/libicalss/icalgauge.h
index c53fcead..e3cb7b65 100644
--- a/src/libicalss/icalgauge.h
+++ b/src/libicalss/icalgauge.h
@@ -32,16 +32,15 @@
typedef struct icalgauge_impl icalgauge;
-LIBICAL_ICALSS_EXPORT icalgauge* icalgauge_new_from_sql(char* sql, int expand);
+LIBICAL_ICALSS_EXPORT icalgauge *icalgauge_new_from_sql(char *sql, int expand);
-int icalgauge_get_expand(icalgauge* gauge);
+LIBICAL_ICALSS_EXPORT int icalgauge_get_expand(icalgauge * gauge);
-LIBICAL_ICALSS_EXPORT void icalgauge_free(icalgauge* gauge);
+LIBICAL_ICALSS_EXPORT void icalgauge_free(icalgauge * gauge);
-char* icalgauge_as_sql(icalcomponent* gauge);
-
-LIBICAL_ICALSS_EXPORT void icalgauge_dump(icalgauge* gauge);
+LIBICAL_ICALSS_EXPORT char *icalgauge_as_sql(icalcomponent * gauge);
+LIBICAL_ICALSS_EXPORT void icalgauge_dump(icalgauge * gauge);
/** @brief Return true if comp matches the gauge.
*
@@ -49,10 +48,10 @@ LIBICAL_ICALSS_EXPORT void icalgauge_dump(icalgauge* gauge);
* cannonical form -- a VCALENDAR with one VEVENT, VTODO or VJOURNAL
* sub component
*/
-LIBICAL_ICALSS_EXPORT int icalgauge_compare(icalgauge* g, icalcomponent* comp);
+LIBICAL_ICALSS_EXPORT int icalgauge_compare(icalgauge * g, icalcomponent * comp);
/** Clone the component, but only return the properties
* specified in the gauge */
-icalcomponent* icalgauge_new_clone(icalgauge* g, icalcomponent* comp);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalgauge_new_clone(icalgauge * g, icalcomponent * comp);
-#endif /* ICALGAUGE_H*/
+#endif /* ICALGAUGE_H */
diff --git a/src/libicalss/icalmessage.h b/src/libicalss/icalmessage.h
index 228108dc..db6f10b3 100644
--- a/src/libicalss/icalmessage.h
+++ b/src/libicalss/icalmessage.h
@@ -22,43 +22,40 @@
#include "libical_icalss_export.h"
#include "icalcomponent.h"
-LIBICAL_ICALSS_EXPORT icalcomponent* icalmessage_new_accept_reply(icalcomponent* c,
- const char* user,
- const char* msg);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_accept_reply(icalcomponent * c,
+ const char *user,
+ const char *msg);
-LIBICAL_ICALSS_EXPORT icalcomponent* icalmessage_new_decline_reply(icalcomponent* c,
- const char* user,
- const char* msg);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_decline_reply(icalcomponent * c,
+ const char *user,
+ const char *msg);
/* New is modified version of old */
-LIBICAL_ICALSS_EXPORT icalcomponent* icalmessage_new_counterpropose_reply(icalcomponent* oldc,
- icalcomponent* newc,
- const char* user,
- const char* msg);
-
-
-LIBICAL_ICALSS_EXPORT icalcomponent* icalmessage_new_delegate_reply(icalcomponent* c,
- const char* user,
- const char* delegatee,
- const char* msg);
-
-
-icalcomponent* icalmessage_new_cancel_event(icalcomponent* c,
- const char* user,
- const char* msg);
-icalcomponent* icalmessage_new_cancel_instance(icalcomponent* c,
- const char* user,
- const char* msg);
-icalcomponent* icalmessage_new_cancel_all(icalcomponent* c,
- const char* user,
- const char* msg);
-
-
-LIBICAL_ICALSS_EXPORT icalcomponent* icalmessage_new_error_reply(icalcomponent* c,
- const char* user,
- const char* msg,
- const char* debug,
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_counterpropose_reply(icalcomponent * oldc,
+ icalcomponent * newc,
+ const char *user,
+ const char *msg);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_delegate_reply(icalcomponent * c,
+ const char *user,
+ const char *delegatee,
+ const char *msg);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_cancel_event(icalcomponent * c,
+ const char *user,
+ const char *msg);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_cancel_instance(icalcomponent * c,
+ const char *user,
+ const char *msg);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_cancel_all(icalcomponent * c,
+ const char *user, const char *msg);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalmessage_new_error_reply(icalcomponent * c,
+ const char *user,
+ const char *msg,
+ const char *debug,
icalrequeststatus rs);
-
-#endif /* ICALMESSAGE_H*/
+#endif /* ICALMESSAGE_H */
diff --git a/src/libicalss/icalset.h b/src/libicalss/icalset.h
index c849e020..9d57ca02 100644
--- a/src/libicalss/icalset.h
+++ b/src/libicalss/icalset.h
@@ -41,125 +41,137 @@
typedef struct icalset_impl icalset;
-typedef enum icalset_kind {
+typedef enum icalset_kind
+{
ICAL_FILE_SET,
ICAL_DIR_SET,
ICAL_BDB_SET
} icalset_kind;
-typedef struct icalsetiter {
- icalcompiter iter; /* icalcomponent_kind, pvl_elem iter */
+typedef struct icalsetiter
+{
+ icalcompiter iter; /* icalcomponent_kind, pvl_elem iter */
icalgauge *gauge;
- icalrecur_iterator *ritr; /*the last iterator*/
- icalcomponent *last_component; /*the pending recurring component to be processed */
- const char *tzid; /* the calendar's timezone id */
+ icalrecur_iterator *ritr; /*the last iterator */
+ icalcomponent *last_component; /*the pending recurring component to be processed */
+ const char *tzid; /* the calendar's timezone id */
} icalsetiter;
-struct icalset_impl {
+struct icalset_impl
+{
icalset_kind kind;
size_t size;
char *dsn;
- icalset *(*init)(icalset *set, const char *dsn, void *options);
- void (*free)(icalset *set);
- const char *(*path)(icalset *set);
- void (*mark)(icalset *set);
- icalerrorenum(*commit)(icalset *set);
- icalerrorenum(*add_component)(icalset *set, icalcomponent *comp);
- icalerrorenum(*remove_component)(icalset *set, icalcomponent *comp);
- int (*count_components)(icalset *set,
- icalcomponent_kind kind);
- icalerrorenum(*select)(icalset *set, icalgauge *gauge);
- void (*clear)(icalset *set);
- icalcomponent *(*fetch)(icalset *set, icalcomponent_kind kind, const char *uid);
- icalcomponent *(*fetch_match)(icalset *set, icalcomponent *comp);
- int (*has_uid)(icalset *set, const char *uid);
- icalerrorenum(*modify)(icalset *set, icalcomponent *old,
- icalcomponent *newc);
- icalcomponent *(*get_current_component)(icalset *set);
- icalcomponent *(*get_first_component)(icalset *set);
- icalcomponent *(*get_next_component)(icalset *set);
- icalsetiter (*icalset_begin_component)(icalset *set,
- icalcomponent_kind kind, icalgauge *gauge, const char *tzid);
- icalcomponent *(*icalsetiter_to_next)(icalset *set, icalsetiter *i);
- icalcomponent *(*icalsetiter_to_prior)(icalset *set, icalsetiter *i);
+ icalset *(*init) (icalset *set, const char *dsn, void *options);
+ void (*free) (icalset *set);
+ const char *(*path) (icalset *set);
+ void (*mark) (icalset *set);
+ icalerrorenum(*commit) (icalset *set);
+ icalerrorenum(*add_component) (icalset *set, icalcomponent *comp);
+ icalerrorenum(*remove_component) (icalset *set, icalcomponent *comp);
+ int (*count_components) (icalset *set, icalcomponent_kind kind);
+ icalerrorenum(*select) (icalset *set, icalgauge *gauge);
+ void (*clear) (icalset *set);
+ icalcomponent *(*fetch) (icalset *set, icalcomponent_kind kind, const char *uid);
+ icalcomponent *(*fetch_match) (icalset *set, icalcomponent *comp);
+ int (*has_uid) (icalset *set, const char *uid);
+ icalerrorenum(*modify) (icalset *set, icalcomponent *old, icalcomponent *newc);
+ icalcomponent *(*get_current_component) (icalset *set);
+ icalcomponent *(*get_first_component) (icalset *set);
+ icalcomponent *(*get_next_component) (icalset *set);
+ icalsetiter(*icalset_begin_component) (icalset *set,
+ icalcomponent_kind kind, icalgauge *gauge,
+ const char *tzid);
+ icalcomponent *(*icalsetiter_to_next) (icalset *set, icalsetiter *i);
+ icalcomponent *(*icalsetiter_to_prior) (icalset *set, icalsetiter *i);
};
/** @brief Register a new derived class */
-int icalset_register_class(icalset *set);
+LIBICAL_ICALSS_EXPORT int icalset_register_class(icalset *set);
/** @brief Generic icalset constructor
*
- * @param kind The type of icalset to create
- * @param dsn Data Source Name - usually a pathname or DB handle
- * @param options Any implementation specific options
+ * @param kind The type of icalset to create
+ * @param dsn Data Source Name - usually a pathname or DB handle
+ * @param options Any implementation specific options
*
- * @return A valid icalset reference or NULL if error.
+ * @return A valid icalset reference or NULL if error.
*
- * This creates any of the icalset types available.
+ * This creates any of the icalset types available.
*/
LIBICAL_ICALSS_EXPORT icalset *icalset_new(icalset_kind kind, const char *dsn, void *options);
LIBICAL_ICALSS_EXPORT icalset *icalset_new_file(const char *path);
-icalset *icalset_new_file_reader(const char *path);
-icalset *icalset_new_file_writer(const char *path);
+
+LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_reader(const char *path);
+
+LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_writer(const char *path);
+
LIBICAL_ICALSS_EXPORT icalset *icalset_new_dir(const char *path);
LIBICAL_ICALSS_EXPORT void icalset_free(icalset *set);
-const char *icalset_path(icalset *set);
+LIBICAL_ICALSS_EXPORT const char *icalset_path(icalset *set);
/** Mark the cluster as changed, so it will be written to disk when it
is freed. **/
-void icalset_mark(icalset *set);
+LIBICAL_ICALSS_EXPORT void icalset_mark(icalset *set);
/** Write changes to disk immediately */
-icalerrorenum icalset_commit(icalset *set);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalset_commit(icalset *set);
LIBICAL_ICALSS_EXPORT icalerrorenum icalset_add_component(icalset *set, icalcomponent *comp);
-icalerrorenum icalset_remove_component(icalset *set, icalcomponent *comp);
-int icalset_count_components(icalset *set,
- icalcomponent_kind kind);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalset_remove_component(icalset *set, icalcomponent *comp);
+
+LIBICAL_ICALSS_EXPORT int icalset_count_components(icalset *set, icalcomponent_kind kind);
/** Restrict the component returned by icalset_first, _next to those
that pass the gauge. */
-icalerrorenum icalset_select(icalset *set, icalgauge *gauge);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalset_select(icalset *set, icalgauge *gauge);
/** Clears the gauge defined by icalset_select() */
-void icalset_clear_select(icalset *set);
+LIBICAL_ICALSS_EXPORT void icalset_clear_select(icalset *set);
/** Get a component by uid */
LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch(icalset *set, const char *uid);
-int icalset_has_uid(icalset *set, const char *uid);
+LIBICAL_ICALSS_EXPORT int icalset_has_uid(icalset *set, const char *uid);
+
LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch_match(icalset *set, icalcomponent *c);
/** Modify components according to the MODIFY method of CAP. Works on
the currently selected components. */
-icalerrorenum icalset_modify(icalset *set, icalcomponent *oldc,
- icalcomponent *newc);
+LIBICAL_ICALSS_EXPORT icalerrorenum icalset_modify(icalset *set,
+ icalcomponent *oldc, icalcomponent *newc);
/** Iterate through the components. If a guage has been defined, these
will skip over components that do not pass the gauge */
-icalcomponent *icalset_get_current_component(icalset *set);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_current_component(icalset *set);
+
LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_first_component(icalset *set);
+
LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_next_component(icalset *set);
/** External Iterator with gauge - for thread safety */
-extern icalsetiter icalsetiter_null;
+LIBICAL_ICALSS_EXPORT extern icalsetiter icalsetiter_null;
-icalsetiter icalset_begin_component(icalset *set,
- icalcomponent_kind kind, icalgauge *gauge, const char *tzid);
+LIBICAL_ICALSS_EXPORT icalsetiter icalset_begin_component(icalset *set,
+ icalcomponent_kind kind,
+ icalgauge *gauge, const char *tzid);
/** Default _next, _prior, _deref for subclasses that use single cluster */
LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_next(icalsetiter *i);
-icalcomponent *icalsetiter_prior(icalsetiter *i);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_prior(icalsetiter *i);
+
LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_deref(icalsetiter *i);
/** for subclasses that use multiple clusters that require specialized cluster traversal */
-icalcomponent *icalsetiter_to_next(icalset *set, icalsetiter *i);
-icalcomponent *icalsetiter_to_prior(icalset *set, icalsetiter *i);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_next(icalset *set, icalsetiter *i);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_prior(icalset *set, icalsetiter *i);
#endif /* !ICALSET_H */
diff --git a/src/libicalss/icalspanlist.h b/src/libicalss/icalspanlist.h
index 066ceca2..e21b6f05 100644
--- a/src/libicalss/icalspanlist.h
+++ b/src/libicalss/icalspanlist.h
@@ -28,42 +28,42 @@
typedef struct icalspanlist_impl icalspanlist;
-
/** @brief Constructor
* Make a free list from a set of component. Start and end should be in UTC
*/
-LIBICAL_ICALSS_EXPORT icalspanlist* icalspanlist_new(icalset *set,
+LIBICAL_ICALSS_EXPORT icalspanlist *icalspanlist_new(icalset * set,
struct icaltimetype start,
struct icaltimetype end);
/** @brief Destructor
*/
-LIBICAL_ICALSS_EXPORT void icalspanlist_free(icalspanlist* spl);
+LIBICAL_ICALSS_EXPORT void icalspanlist_free(icalspanlist * spl);
/* Unimplemented functions */
-icalcomponent* icalspanlist_make_free_list(icalspanlist* sl);
-icalcomponent* icalspanlist_make_busy_list(icalspanlist* sl);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_make_free_list(icalspanlist * sl);
+
+LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_make_busy_list(icalspanlist * sl);
/** Get first next free time after time t. all times are in UTC. */
-LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_free_time(icalspanlist* sl,
+LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_free_time(icalspanlist * sl,
struct icaltimetype t);
/** Get first next busy time after time t. all times are in UTC. */
-struct icalperiodtype icalspanlist_next_busy_time(icalspanlist* sl,
- struct icaltimetype t);
+LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_busy_time(icalspanlist * sl,
+ struct icaltimetype t);
-LIBICAL_ICALSS_EXPORT void icalspanlist_dump(icalspanlist* s);
+LIBICAL_ICALSS_EXPORT void icalspanlist_dump(icalspanlist * s);
/** @brief Return a valid VFREEBUSY component for this span */
-LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_as_vfreebusy(icalspanlist* s_in,
- const char* organizer,
- const char* attendee);
+LIBICAL_ICALSS_EXPORT icalcomponent *icalspanlist_as_vfreebusy(icalspanlist * s_in,
+ const char *organizer,
+ const char *attendee);
/** @brief Return an integer matrix of total events per delta_t timespan */
-LIBICAL_ICALSS_EXPORT int *icalspanlist_as_freebusy_matrix(icalspanlist* span, int delta_t);
+LIBICAL_ICALSS_EXPORT int *icalspanlist_as_freebusy_matrix(icalspanlist * span, int delta_t);
/** @brief Construct an icalspanlist from a VFREEBUSY component */
-LIBICAL_ICALSS_EXPORT icalspanlist *icalspanlist_from_vfreebusy(icalcomponent* c);
+LIBICAL_ICALSS_EXPORT icalspanlist *icalspanlist_from_vfreebusy(icalcomponent * c);
#endif
diff --git a/src/libicalvcal/CMakeLists.txt b/src/libicalvcal/CMakeLists.txt
index c228c726..256ef610 100644
--- a/src/libicalvcal/CMakeLists.txt
+++ b/src/libicalvcal/CMakeLists.txt
@@ -17,7 +17,6 @@ set(icalvcal_LIB_SRCS
libical_vcal_export.h
icalvcal.h
icalvcal.c
- port.h
vcc.h
vobject.h
vobject.c
@@ -73,7 +72,7 @@ endif()
########### install files ###############
install(FILES
- icalvcal.h port.h vcc.h vobject.h vcaltmp.h
+ icalvcal.h vcc.h vobject.h vcaltmp.h
DESTINATION
${INCLUDE_INSTALL_DIR}/libical
)
diff --git a/src/libicalvcal/icalvcal.h b/src/libicalvcal/icalvcal.h
index fe4ef124..d2209857 100644
--- a/src/libicalvcal/icalvcal.h
+++ b/src/libicalvcal/icalvcal.h
@@ -28,19 +28,18 @@
file. Gnome Calendar, for example, does not save the URL of the audio alarm,
so we have to add a value here to make a valid iCalendar object. */
typedef struct _icalvcal_defaults icalvcal_defaults;
-struct _icalvcal_defaults {
+struct _icalvcal_defaults
+{
char *alarm_audio_url;
char *alarm_audio_fmttype;
char *alarm_description;
};
-
/* Convert a vObject into an icalcomponent */
-LIBICAL_VCAL_EXPORT icalcomponent* icalvcal_convert(VObject *object);
-
+LIBICAL_VCAL_EXPORT icalcomponent *icalvcal_convert(VObject * object);
-icalcomponent* icalvcal_convert_with_defaults (VObject *object,
- icalvcal_defaults *defaults);
+LIBICAL_VCAL_EXPORT icalcomponent *icalvcal_convert_with_defaults(VObject * object,
+ icalvcal_defaults * defaults);
#endif /* !ICALVCAL_H */
diff --git a/src/libicalvcal/port.h b/src/libicalvcal/port.h
deleted file mode 100644
index 1768beeb..00000000
--- a/src/libicalvcal/port.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
-(C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International
-Business Machines Corporation and Siemens Rolm Communications Inc.
-
-For purposes of this license notice, the term Licensors shall mean,
-collectively, Apple Computer, Inc., AT&T Corp., International
-Business Machines Corporation and Siemens Rolm Communications Inc.
-The term Licensor shall mean any of the Licensors.
-
-Subject to acceptance of the following conditions, permission is hereby
-granted by Licensors without the need for written agreement and without
-license or royalty fees, to use, copy, modify and distribute this
-software for any purpose.
-
-The above copyright notice and the following four paragraphs must be
-reproduced in all copies of this software and any software including
-this software.
-
-THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE
-ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR
-MODIFICATIONS.
-
-IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT,
-INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
-OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
-EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.
-
-The software is provided with RESTRICTED RIGHTS. Use, duplication, or
-disclosure by the government are subject to restrictions set forth in
-DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
-
-***************************************************************************/
-
-#ifndef __PORT_H__
-#define __PORT_H__ 1
-
-
-#if defined(__CPLUSPLUS__) || defined(__cplusplus)
-extern "C" {
-#endif
-
-/* some of these #defines are commented out because */
-/* Visual C++ sets them on the compiler command line instead */
-
-/* #define _DEBUG */
-/* #define WIN32 */
-/* #define WIN16 */
-/* #define _WINDOWS */
-/* #define __MWERKS__ */
-/* #define INCLUDEMFC */
-
-#define vCardClipboardFormat "+//ISBN 1-887687-00-9::versit::PDI//vCard"
-#define vCalendarClipboardFormat "+//ISBN 1-887687-00-9::versit::PDI//vCalendar"
-
-/* The above strings vCardClipboardFormat and vCalendarClipboardFormat
-are globally unique IDs which can be used to generate clipboard format
-ID's as per the requirements of a specific platform. For example, in
-Windows they are used as the parameter in a call to RegisterClipboardFormat.
-For example:
-
- CLIPFORMAT foo = RegisterClipboardFormat(vCardClipboardFormat);
-
-*/
-
-#define vCardMimeType "text/x-vCard"
-#define vCalendarMimeType "text/x-vCalendar"
-
-#define DLLEXPORT(t) t
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#define stricmp strcasecmp
-
-#if defined(__CPLUSPLUS__) || defined(__cplusplus)
-}
-#endif
-
-#endif /* __PORT_H__ */
diff --git a/src/libicalvcal/vcaltmp.c b/src/libicalvcal/vcaltmp.c
index 740feeb2..93ba184d 100644
--- a/src/libicalvcal/vcaltmp.c
+++ b/src/libicalvcal/vcaltmp.c
@@ -51,11 +51,13 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
***************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "vcaltmp.h"
-#include <stdio.h>
-#include <string.h>
-DLLEXPORT(VObject*) vcsCreateVCal(
+VObject* vcsCreateVCal(
char *date_created,
char *location,
char *product_id,
@@ -75,7 +77,7 @@ DLLEXPORT(VObject*) vcsCreateVCal(
}
-DLLEXPORT(VObject*) vcsAddEvent(
+VObject* vcsAddEvent(
VObject *vcal,
char *start_date_time,
char *end_date_time,
@@ -110,7 +112,7 @@ DLLEXPORT(VObject*) vcsAddEvent(
}
-DLLEXPORT(VObject*) vcsAddTodo(
+VObject* vcsAddTodo(
VObject *vcal,
char *start_date_time,
char *due_date_time,
@@ -145,7 +147,7 @@ DLLEXPORT(VObject*) vcsAddTodo(
}
-DLLEXPORT(VObject*) vcsAddAAlarm(
+VObject* vcsAddAAlarm(
VObject *vevent,
char *run_time,
char *snooze_time,
@@ -164,7 +166,7 @@ DLLEXPORT(VObject*) vcsAddAAlarm(
}
-DLLEXPORT(VObject*) vcsAddMAlarm(
+VObject* vcsAddMAlarm(
VObject *vevent,
char *run_time,
char *snooze_time,
@@ -185,7 +187,7 @@ DLLEXPORT(VObject*) vcsAddMAlarm(
}
-DLLEXPORT(VObject*) vcsAddDAlarm(
+VObject* vcsAddDAlarm(
VObject *vevent,
char *run_time,
char *snooze_time,
@@ -204,7 +206,7 @@ DLLEXPORT(VObject*) vcsAddDAlarm(
}
-DLLEXPORT(VObject*) vcsAddPAlarm(
+VObject* vcsAddPAlarm(
VObject *vevent,
char *run_time,
char *snooze_time,
diff --git a/src/libicalvcal/vcaltmp.h b/src/libicalvcal/vcaltmp.h
index af965c10..0943f092 100644
--- a/src/libicalvcal/vcaltmp.h
+++ b/src/libicalvcal/vcaltmp.h
@@ -39,88 +39,61 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
#ifndef VCALTMP_H
#define VCALTMP_H
+#include "libical_vcal_export.h"
#include "vcc.h"
#if defined(__CPLUSPLUS__) || defined(__cplusplus)
-extern "C" {
+extern "C"
+{
#endif
-extern DLLEXPORT(VObject*) vcsCreateVCal(
- char *date_created,
- char *location,
- char *product_id,
- char *time_zone,
- char *version
- );
-
-extern DLLEXPORT(VObject*) vcsAddEvent(
- VObject *vcal,
- char *start_date_time,
- char *end_date_time,
- char *description,
- char *summary,
- char *categories,
- char *classification,
- char *status,
- char *transparency,
- char *uid,
- char *url
- );
-
-
-extern DLLEXPORT(VObject*) vcsAddTodo(
- VObject *vcal,
- char *start_date_time,
- char *due_date_time,
- char *date_time_complete,
- char *description,
- char *summary,
- char *priority,
- char *classification,
- char *status,
- char *uid,
- char *url
- );
-
-
-extern DLLEXPORT(VObject*) vcsAddAAlarm(
- VObject *vevent,
- char *run_time,
- char *snooze_time,
- char *repeat_count,
- char *audio_content
- );
-
-
-extern DLLEXPORT(VObject*) vcsAddMAlarm(
- VObject *vevent,
- char *run_time,
- char *snooze_time,
- char *repeat_count,
- char *email_address,
- char *note
- );
-
-
-extern DLLEXPORT(VObject*) vcsAddDAlarm(
- VObject *vevent,
- char *run_time,
- char *snooze_time,
- char *repeat_count,
- char *display_string
- );
-
-
-extern DLLEXPORT(VObject*) vcsAddPAlarm(
- VObject *vevent,
- char *run_time,
- char *snooze_time,
- char *repeat_count,
- char *procedure_name
- );
+ LIBICAL_VCAL_EXPORT VObject *vcsCreateVCal(char *date_created,
+ char *location,
+ char *product_id, char *time_zone, char *version);
+
+ LIBICAL_VCAL_EXPORT VObject *vcsAddEvent(VObject * vcal,
+ char *start_date_time,
+ char *end_date_time,
+ char *description,
+ char *summary,
+ char *categories,
+ char *classification,
+ char *status, char *transparency, char *uid,
+ char *url);
+
+ LIBICAL_VCAL_EXPORT VObject *vcsAddTodo(VObject * vcal,
+ char *start_date_time,
+ char *due_date_time,
+ char *date_time_complete,
+ char *description,
+ char *summary,
+ char *priority,
+ char *classification, char *status, char *uid,
+ char *url);
+
+ LIBICAL_VCAL_EXPORT VObject *vcsAddAAlarm(VObject * vevent,
+ char *run_time,
+ char *snooze_time,
+ char *repeat_count, char *audio_content);
+
+ LIBICAL_VCAL_EXPORT VObject *vcsAddMAlarm(VObject * vevent,
+ char *run_time,
+ char *snooze_time,
+ char *repeat_count, char *email_address, char *note);
+
+ LIBICAL_VCAL_EXPORT VObject *vcsAddDAlarm(VObject * vevent,
+ char *run_time,
+ char *snooze_time,
+ char *repeat_count, char *display_string);
+
+ LIBICAL_VCAL_EXPORT VObject *vcsAddPAlarm(VObject * vevent,
+ char *run_time,
+ char *snooze_time,
+ char *repeat_count, char *procedure_name);
#if defined(__CPLUSPLUS__) || defined(__cplusplus)
}
+
#endif
#endif /* VCALTMP_H */
diff --git a/src/libicalvcal/vcc.c b/src/libicalvcal/vcc.c
index 55618a3a..48ee2490 100644
--- a/src/libicalvcal/vcc.c
+++ b/src/libicalvcal/vcc.c
@@ -72,11 +72,6 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
#define DBG_(x)
#endif
-#if defined(_MSC_VER)
-#define snprintf _snprintf
-#define strcasecmp stricmp
-#endif
-
/**** External Functions ****/
/* assign local name to parser variables and functions so that
@@ -433,7 +428,7 @@ static int pushVObject(const char *prop)
{
VObject *newObj;
if (ObjStackTop == MAXLEVEL)
- return FALSE;
+ return 0; /*FALSE*/
ObjStack[++ObjStackTop] = curObj;
@@ -444,7 +439,7 @@ static int pushVObject(const char *prop)
else
curObj = newVObject(prop);
- return TRUE;
+ return 1; /*TRUE*/
}
@@ -516,10 +511,10 @@ static void enterAttr(const char *s1, const char *s2)
}
else
addProp(curProp,p1);
- if (stricmp(p1,VCBase64Prop) == 0 || (p2 && stricmp(p2,VCBase64Prop)==0))
+ if (strcasecmp(p1,VCBase64Prop) == 0 || (p2 && strcasecmp(p2,VCBase64Prop)==0))
lexPushMode(L_BASE64);
- else if (stricmp(p1,VCQuotedPrintableProp) == 0
- || (p2 && stricmp(p2,VCQuotedPrintableProp)==0))
+ else if (strcasecmp(p1,VCQuotedPrintableProp) == 0
+ || (p2 && strcasecmp(p2,VCQuotedPrintableProp)==0))
lexPushMode(L_QUOTED_PRINTABLE);
deleteStr(s1); deleteStr(s2);
}
@@ -819,10 +814,10 @@ static int match_begin_name(int end) {
char *n = lexLookaheadWord();
int token = ID;
if (n) {
- if (!stricmp(n,"vcard")) token = end?END_VCARD:BEGIN_VCARD;
- else if (!stricmp(n,"vcalendar")) token = end?END_VCAL:BEGIN_VCAL;
- else if (!stricmp(n,"vevent")) token = end?END_VEVENT:BEGIN_VEVENT;
- else if (!stricmp(n,"vtodo")) token = end?END_VTODO:BEGIN_VTODO;
+ if (!strcasecmp(n,"vcard")) token = end?END_VCARD:BEGIN_VCARD;
+ else if (!strcasecmp(n,"vcalendar")) token = end?END_VCAL:BEGIN_VCAL;
+ else if (!strcasecmp(n,"vevent")) token = end?END_VEVENT:BEGIN_VEVENT;
+ else if (!strcasecmp(n,"vtodo")) token = end?END_VTODO:BEGIN_VTODO;
deleteStr(n);
return token;
}
@@ -1131,10 +1126,10 @@ int yylex() {
if (isalpha(c)) {
char *t = lexGetWord();
yylval.str = t;
- if (!stricmp(t, "begin")) {
+ if (!strcasecmp(t, "begin")) {
return match_begin_end_name(0);
}
- else if (!stricmp(t,"end")) {
+ else if (!strcasecmp(t,"end")) {
return match_begin_end_name(1);
}
else {
@@ -1174,7 +1169,7 @@ static VObject* Parse_MIMEHelper()
return vObjList;
}
-DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len)
+VObject* Parse_MIME(const char *input, unsigned long len)
{
initLex(input, len, 0);
return Parse_MIMEHelper();
@@ -1183,7 +1178,7 @@ DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len)
#ifdef INCLUDEMFC
-DLLEXPORT(VObject*) Parse_MIME_FromFile(CFile *file)
+VObject* Parse_MIME_FromFile(CFile *file)
{
unsigned long startPos;
VObject *result;
@@ -1211,7 +1206,7 @@ VObject* Parse_MIME_FromFile(FILE *file)
return result;
}
-DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname)
+VObject* Parse_MIME_FromFileName(char *fname)
{
FILE *fp = fopen(fname,"r");
if (fp) {
@@ -1232,7 +1227,7 @@ DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname)
static MimeErrorHandler mimeErrorHandler;
-DLLEXPORT(void) registerMimeErrorHandler(MimeErrorHandler me)
+void registerMimeErrorHandler(MimeErrorHandler me)
{
mimeErrorHandler = me;
}
diff --git a/src/libicalvcal/vcc.h b/src/libicalvcal/vcc.h
index 248bed93..91fbbf36 100644
--- a/src/libicalvcal/vcc.h
+++ b/src/libicalvcal/vcc.h
@@ -43,16 +43,17 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
#include "vobject.h"
#if defined(__CPLUSPLUS__) || defined(__cplusplus)
-extern "C" {
+extern "C"
+{
#endif
-typedef void (*MimeErrorHandler)(char *);
+ typedef void (*MimeErrorHandler) (char *);
-extern DLLEXPORT(void) registerMimeErrorHandler(MimeErrorHandler);
+ LIBICAL_VCAL_EXPORT void registerMimeErrorHandler(MimeErrorHandler);
-extern DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len);
-LIBICAL_VCAL_EXPORT VObject *Parse_MIME_FromFileName(char* fname);
+ LIBICAL_VCAL_EXPORT VObject *Parse_MIME(const char *input, unsigned long len);
+ LIBICAL_VCAL_EXPORT VObject *Parse_MIME_FromFileName(char *fname);
/* NOTE regarding Parse_MIME_FromFile
The function above, Parse_MIME_FromFile, comes in two flavors,
@@ -65,15 +66,15 @@ that take a file name. If you use them with the DLL LIB you
will get a link error.
*/
-
#ifdef INCLUDEMFC
-LIBICAL_VCAL_EXPORT VObject* Parse_MIME_FromFile(CFile *file);
+ LIBICAL_VCAL_EXPORT VObject *Parse_MIME_FromFile(CFile * file);
#else
-LIBICAL_VCAL_EXPORT VObject* Parse_MIME_FromFile(FILE *file);
+ LIBICAL_VCAL_EXPORT VObject *Parse_MIME_FromFile(FILE * file);
#endif
#if defined(__CPLUSPLUS__) || defined(__cplusplus)
}
+
#endif
#endif /* VCC_H */
diff --git a/src/libicalvcal/vcc.y b/src/libicalvcal/vcc.y
index f276f726..7436b813 100644
--- a/src/libicalvcal/vcc.y
+++ b/src/libicalvcal/vcc.y
@@ -121,11 +121,11 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
/**** Types, Constants ****/
-#define YYDEBUG 1 /* 1 to compile in some debugging code */
-#define MAXTOKEN 256 /* maximum token (line) length */
-#define YYSTACKSIZE 50 /* ~unref ? */
-#define MAXLEVEL 10 /* max # of nested objects parseable */
- /* (includes outermost) */
+#define YYDEBUG 1 /* 1 to compile in some debugging code */
+#define MAXTOKEN 256 /* maximum token (line) length */
+#define YYSTACKSIZE 50 /* ~unref ? */
+#define MAXLEVEL 10 /* max # of nested objects parseable */
+ /* (includes outermost) */
/**** Global Variables ****/
@@ -153,15 +153,15 @@ int yylex(void);
int yyparse(void);
enum LexMode {
- L_NORMAL,
- L_VCARD,
- L_VCAL,
- L_VEVENT,
- L_VTODO,
- L_VALUES,
- L_BASE64,
- L_QUOTED_PRINTABLE
- };
+ L_NORMAL,
+ L_VCARD,
+ L_VCAL,
+ L_VEVENT,
+ L_VTODO,
+ L_VALUES,
+ L_BASE64,
+ L_QUOTED_PRINTABLE
+ };
/**** Private Forward Declarations ****/
static void lexClearToken(void);
@@ -202,10 +202,10 @@ static int pushVObject(const char *prop);
}
%token
- EQ COLON DOT SEMICOLON SPACE HTAB LINESEP NEWLINE
- BEGIN_VCARD END_VCARD BEGIN_VCAL END_VCAL
- BEGIN_VEVENT END_VEVENT BEGIN_VTODO END_VTODO
- ID
+ EQ COLON DOT SEMICOLON SPACE HTAB LINESEP NEWLINE
+ BEGIN_VCARD END_VCARD BEGIN_VCAL END_VCAL
+ BEGIN_VEVENT END_VEVENT BEGIN_VTODO END_VTODO
+ ID
/*
* NEWLINE is the token that would occur outside a vCard,
@@ -213,7 +213,7 @@ static int pushVObject(const char *prop);
*/
%token <str>
- STRING ID
+ STRING ID
%type <str> name value
@@ -225,187 +225,187 @@ static int pushVObject(const char *prop);
mime: vobjects
- ;
+ ;
vobjects: vobject
- { addList(&vObjList, $1); curObj = 0; }
- vobjects
- | vobject
- { addList(&vObjList, $1); curObj = 0; }
- ;
+ { addList(&vObjList, $1); curObj = 0; }
+ vobjects
+ | vobject
+ { addList(&vObjList, $1); curObj = 0; }
+ ;
vobject: vcard
- | vcal
- ;
+ | vcal
+ ;
vcard:
- BEGIN_VCARD
- {
- lexPushMode(L_VCARD);
- if (!pushVObject(VCCardProp)) YYERROR;
- }
- items END_VCARD
- {
- lexPopMode(0);
- $$ = popVObject();
- }
- | BEGIN_VCARD
- {
- lexPushMode(L_VCARD);
- if (!pushVObject(VCCardProp)) YYERROR;
- }
- END_VCARD
- {
- lexPopMode(0);
- $$ = popVObject();
- }
- ;
+ BEGIN_VCARD
+ {
+ lexPushMode(L_VCARD);
+ if (!pushVObject(VCCardProp)) YYERROR;
+ }
+ items END_VCARD
+ {
+ lexPopMode(0);
+ $$ = popVObject();
+ }
+ | BEGIN_VCARD
+ {
+ lexPushMode(L_VCARD);
+ if (!pushVObject(VCCardProp)) YYERROR;
+ }
+ END_VCARD
+ {
+ lexPopMode(0);
+ $$ = popVObject();
+ }
+ ;
items: item items
- | item
- ;
+ | item
+ ;
item: prop COLON
- {
- lexPushMode(L_VALUES);
- }
- values LINESEP
- {
- if (lexWithinMode(L_BASE64) || lexWithinMode(L_QUOTED_PRINTABLE))
- lexPopMode(0);
- lexPopMode(0);
- }
- | error
- ;
+ {
+ lexPushMode(L_VALUES);
+ }
+ values LINESEP
+ {
+ if (lexWithinMode(L_BASE64) || lexWithinMode(L_QUOTED_PRINTABLE))
+ lexPopMode(0);
+ lexPopMode(0);
+ }
+ | error
+ ;
prop: name
- {
- enterProps($1);
- }
- attr_params
- | name
- {
- enterProps($1);
- }
- ;
+ {
+ enterProps($1);
+ }
+ attr_params
+ | name
+ {
+ enterProps($1);
+ }
+ ;
attr_params: attr_param attr_params
- | attr_param
- ;
+ | attr_param
+ ;
attr_param: SEMICOLON attr
- ;
+ ;
attr: name
- {
- enterAttr($1,0);
- }
- | name EQ name
- {
- enterAttr($1,$3);
+ {
+ enterAttr($1,0);
+ }
+ | name EQ name
+ {
+ enterAttr($1,$3);
- }
- ;
+ }
+ ;
name: ID
- ;
+ ;
values: value SEMICOLON { enterValues($1); } values
- | value
- { enterValues($1); }
- ;
+ | value
+ { enterValues($1); }
+ ;
value: STRING
- | { $$ = 0; }
- ;
+ | { $$ = 0; }
+ ;
vcal:
- BEGIN_VCAL
- { if (!pushVObject(VCCalProp)) YYERROR; }
- calitems
- END_VCAL
- { $$ = popVObject(); }
- | BEGIN_VCAL
- { if (!pushVObject(VCCalProp)) YYERROR; }
- END_VCAL
- { $$ = popVObject(); }
- ;
+ BEGIN_VCAL
+ { if (!pushVObject(VCCalProp)) YYERROR; }
+ calitems
+ END_VCAL
+ { $$ = popVObject(); }
+ | BEGIN_VCAL
+ { if (!pushVObject(VCCalProp)) YYERROR; }
+ END_VCAL
+ { $$ = popVObject(); }
+ ;
calitems: calitem calitems
- | calitem
- ;
+ | calitem
+ ;
calitem:
- eventitem
- | todoitem
- | items
- ;
+ eventitem
+ | todoitem
+ | items
+ ;
eventitem:
- BEGIN_VEVENT
- {
- lexPushMode(L_VEVENT);
- if (!pushVObject(VCEventProp)) YYERROR;
- }
- items
- END_VEVENT
- {
- lexPopMode(0);
- popVObject();
- }
- | BEGIN_VEVENT
- {
- lexPushMode(L_VEVENT);
- if (!pushVObject(VCEventProp)) YYERROR;
- }
- END_VEVENT
- {
- lexPopMode(0);
- popVObject();
- }
- ;
+ BEGIN_VEVENT
+ {
+ lexPushMode(L_VEVENT);
+ if (!pushVObject(VCEventProp)) YYERROR;
+ }
+ items
+ END_VEVENT
+ {
+ lexPopMode(0);
+ popVObject();
+ }
+ | BEGIN_VEVENT
+ {
+ lexPushMode(L_VEVENT);
+ if (!pushVObject(VCEventProp)) YYERROR;
+ }
+ END_VEVENT
+ {
+ lexPopMode(0);
+ popVObject();
+ }
+ ;
todoitem:
- BEGIN_VTODO
- {
- lexPushMode(L_VTODO);
- if (!pushVObject(VCTodoProp)) YYERROR;
- }
- items
- END_VTODO
- {
- lexPopMode(0);
- popVObject();
- }
- | BEGIN_VTODO
- {
- lexPushMode(L_VTODO);
- if (!pushVObject(VCTodoProp)) YYERROR;
- }
- END_VTODO
- {
- lexPopMode(0);
- popVObject();
- }
- ;
+ BEGIN_VTODO
+ {
+ lexPushMode(L_VTODO);
+ if (!pushVObject(VCTodoProp)) YYERROR;
+ }
+ items
+ END_VTODO
+ {
+ lexPopMode(0);
+ popVObject();
+ }
+ | BEGIN_VTODO
+ {
+ lexPushMode(L_VTODO);
+ if (!pushVObject(VCTodoProp)) YYERROR;
+ }
+ END_VTODO
+ {
+ lexPopMode(0);
+ popVObject();
+ }
+ ;
%%
static int pushVObject(const char *prop)
{
VObject *newObj;
if (ObjStackTop == MAXLEVEL)
- return FALSE;
+ return 0; /*FALSE*/
ObjStack[++ObjStackTop] = curObj;
if (curObj) {
newObj = addProp(curObj,prop);
curObj = newObj;
- }
+ }
else
- curObj = newVObject(prop);
+ curObj = newVObject(prop);
- return TRUE;
+ return 1; /*TRUE*/
}
@@ -414,9 +414,9 @@ static VObject* popVObject()
{
VObject *oldObj;
if (ObjStackTop < 0) {
- yyerror("pop on empty Object Stack\n");
- return 0;
- }
+ yyerror("pop on empty Object Stack\n");
+ return 0;
+ }
oldObj = curObj;
curObj = ObjStack[ObjStackTop--];
@@ -427,34 +427,34 @@ static VObject* popVObject()
static void enterValues(const char *value)
{
if (fieldedProp && *fieldedProp) {
- if (value) {
- addPropValue(curProp,*fieldedProp,value);
- }
- /* else this field is empty, advance to next field */
- fieldedProp++;
- }
+ if (value) {
+ addPropValue(curProp,*fieldedProp,value);
+ }
+ /* else this field is empty, advance to next field */
+ fieldedProp++;
+ }
else {
- if (value) {
- char *p1, *p2;
- wchar_t *p3;
- int i;
-
- /* If the property already has a string value, we append this one,
- using ';' to separate the values. */
- if (vObjectUStringZValue(curProp)) {
- p1 = fakeCString(vObjectUStringZValue(curProp));
- i = strlen(p1)+strlen(value)+2;
- p2 = malloc(i);
- snprintf(p2,i,"%s;%s",p1,value);
- deleteStr(p1);
- p3 = (wchar_t *) vObjectUStringZValue(curProp);
- free(p3);
- setVObjectUStringZValue_(curProp,fakeUnicode(p2,0));
- deleteStr(p2);
- } else {
- setVObjectUStringZValue_(curProp,fakeUnicode(value,0));
- }
- }
+ if (value) {
+ char *p1, *p2;
+ wchar_t *p3;
+ int i;
+
+ /* If the property already has a string value, we append this one,
+ using ';' to separate the values. */
+ if (vObjectUStringZValue(curProp)) {
+ p1 = fakeCString(vObjectUStringZValue(curProp));
+ i = strlen(p1)+strlen(value)+2;
+ p2 = malloc(i);
+ snprintf(p2,i,"%s;%s",p1,value);
+ deleteStr(p1);
+ p3 = (wchar_t *) vObjectUStringZValue(curProp);
+ free(p3);
+ setVObjectUStringZValue_(curProp,fakeUnicode(p2,0));
+ deleteStr(p2);
+ } else {
+ setVObjectUStringZValue_(curProp,fakeUnicode(value,0));
+ }
+ }
}
deleteStr(value);
}
@@ -470,18 +470,18 @@ static void enterAttr(const char *s1, const char *s2)
const char *p1, *p2 = NULL;
p1 = lookupProp_(s1);
if (s2) {
- VObject *a;
- p2 = lookupProp_(s2);
- a = addProp(curProp,p1);
- setVObjectStringZValue(a,p2);
- }
+ VObject *a;
+ p2 = lookupProp_(s2);
+ a = addProp(curProp,p1);
+ setVObjectStringZValue(a,p2);
+ }
else
- addProp(curProp,p1);
+ addProp(curProp,p1);
if (stricmp(p1,VCBase64Prop) == 0 || (s2 && stricmp(p2,VCBase64Prop)==0))
- lexPushMode(L_BASE64);
+ lexPushMode(L_BASE64);
else if (stricmp(p1,VCQuotedPrintableProp) == 0
- || (s2 && stricmp(p2,VCQuotedPrintableProp)==0))
- lexPushMode(L_QUOTED_PRINTABLE);
+ || (s2 && stricmp(p2,VCQuotedPrintableProp)==0))
+ lexPushMode(L_QUOTED_PRINTABLE);
deleteStr(s1); deleteStr(s2);
}
@@ -492,7 +492,7 @@ static void enterAttr(const char *s1, const char *s2)
#define LEXMODE() (lexBuf.lexModeStack[lexBuf.lexModeStackTop])
struct LexBuf {
- /* input */
+ /* input */
#ifdef INCLUDEMFC
CFile *inputFile;
#else
@@ -501,17 +501,17 @@ struct LexBuf {
char *inputString;
unsigned long curPos;
unsigned long inputLen;
- /* lookahead buffer */
- /* -- lookahead buffer is short instead of char so that EOF
- / can be represented correctly.
- */
+ /* lookahead buffer */
+ /* -- lookahead buffer is short instead of char so that EOF
+ / can be represented correctly.
+ */
unsigned long len;
short buf[MAX_LEX_LOOKAHEAD];
unsigned long getPtr;
- /* context stack */
+ /* context stack */
unsigned long lexModeStackTop;
enum LexMode lexModeStack[MAX_LEX_MODE_STACK_SIZE];
- /* token buffer */
+ /* token buffer */
unsigned long maxToken;
char *strs;
unsigned long strsLen;
@@ -520,26 +520,26 @@ struct LexBuf {
static void lexPushMode(enum LexMode mode)
{
if (lexBuf.lexModeStackTop == (MAX_LEX_MODE_STACK_SIZE-1))
- yyerror("lexical context stack overflow");
+ yyerror("lexical context stack overflow");
else {
- lexBuf.lexModeStack[++lexBuf.lexModeStackTop] = mode;
- }
+ lexBuf.lexModeStack[++lexBuf.lexModeStackTop] = mode;
+ }
}
static void lexPopMode(int top)
{
/* special case of pop for ease of error recovery -- this
- version will never underflow */
+ version will never underflow */
if (top)
- lexBuf.lexModeStackTop = 0;
+ lexBuf.lexModeStackTop = 0;
else
- if (lexBuf.lexModeStackTop > 0) lexBuf.lexModeStackTop--;
+ if (lexBuf.lexModeStackTop > 0) lexBuf.lexModeStackTop--;
}
static int lexWithinMode(enum LexMode mode) {
unsigned long i;
for (i=0;i<lexBuf.lexModeStackTop;i++)
- if (mode == lexBuf.lexModeStack[i]) return 1;
+ if (mode == lexBuf.lexModeStack[i]) return 1;
return 0;
}
@@ -547,17 +547,17 @@ static char lexGetc_()
{
/* get next char from input, no buffering. */
if (lexBuf.curPos == lexBuf.inputLen)
- return EOF;
+ return EOF;
else if (lexBuf.inputString)
- return *(lexBuf.inputString + lexBuf.curPos++);
+ return *(lexBuf.inputString + lexBuf.curPos++);
else {
#ifdef INCLUDEMFC
- char result;
- return lexBuf.inputFile->Read(&result, 1) == 1 ? result : EOF;
+ char result;
+ return lexBuf.inputFile->Read(&result, 1) == 1 ? result : EOF;
#else
- return fgetc(lexBuf.inputFile);
+ return fgetc(lexBuf.inputFile);
#endif
- }
+ }
}
static int lexGeta()
@@ -574,53 +574,53 @@ static int lexGeta_(int i)
static void lexSkipLookahead() {
if (lexBuf.len > 0 && lexBuf.buf[lexBuf.getPtr]!=EOF) {
- /* don't skip EOF. */
+ /* don't skip EOF. */
lexBuf.getPtr = (lexBuf.getPtr + 1) % MAX_LEX_LOOKAHEAD;
- lexBuf.len--;
+ lexBuf.len--;
}
}
static int lexLookahead() {
int c = (lexBuf.len)?
- lexBuf.buf[lexBuf.getPtr]:
- lexGeta();
+ lexBuf.buf[lexBuf.getPtr]:
+ lexGeta();
/* do the \r\n -> \n or \r -> \n translation here */
if (c == '\r') {
- int a = (lexBuf.len>1)?
- lexBuf.buf[(lexBuf.getPtr+1)%MAX_LEX_LOOKAHEAD]:
- lexGeta_(1);
- if (a == '\n') {
- lexSkipLookahead();
- }
- lexBuf.buf[lexBuf.getPtr] = c = '\n';
- }
+ int a = (lexBuf.len>1)?
+ lexBuf.buf[(lexBuf.getPtr+1)%MAX_LEX_LOOKAHEAD]:
+ lexGeta_(1);
+ if (a == '\n') {
+ lexSkipLookahead();
+ }
+ lexBuf.buf[lexBuf.getPtr] = c = '\n';
+ }
else if (c == '\n') {
- int a = (lexBuf.len>1)?
- lexBuf.buf[lexBuf.getPtr+1]:
- lexGeta_(1);
- if (a == '\r') {
- lexSkipLookahead();
- }
- lexBuf.buf[lexBuf.getPtr] = '\n';
- }
+ int a = (lexBuf.len>1)?
+ lexBuf.buf[lexBuf.getPtr+1]:
+ lexGeta_(1);
+ if (a == '\r') {
+ lexSkipLookahead();
+ }
+ lexBuf.buf[lexBuf.getPtr] = '\n';
+ }
return c;
}
static int lexGetc() {
int c = lexLookahead();
if (lexBuf.len > 0 && lexBuf.buf[lexBuf.getPtr]!=EOF) {
- /* EOF will remain in lookahead buffer */
+ /* EOF will remain in lookahead buffer */
lexBuf.getPtr = (lexBuf.getPtr + 1) % MAX_LEX_LOOKAHEAD;
- lexBuf.len--;
+ lexBuf.len--;
}
return c;
}
static void lexSkipLookaheadWord() {
if (lexBuf.strsLen <= lexBuf.len) {
- lexBuf.len -= lexBuf.strsLen;
- lexBuf.getPtr = (lexBuf.getPtr + lexBuf.strsLen) % MAX_LEX_LOOKAHEAD;
- }
+ lexBuf.len -= lexBuf.strsLen;
+ lexBuf.getPtr = (lexBuf.getPtr + lexBuf.strsLen) % MAX_LEX_LOOKAHEAD;
+ }
}
static void lexClearToken()
@@ -635,10 +635,10 @@ static void lexAppendc(int c)
if (c == 0) return;
lexBuf.strsLen++;
if (lexBuf.strsLen >= lexBuf.maxToken) {
- /* double the token string size */
- lexBuf.maxToken <<= 1;
- lexBuf.strs = (char*) realloc(lexBuf.strs,(size_t)lexBuf.maxToken);
- }
+ /* double the token string size */
+ lexBuf.maxToken <<= 1;
+ lexBuf.strs = (char*) realloc(lexBuf.strs,(size_t)lexBuf.maxToken);
+ }
}
static char* lexStr() {
@@ -648,9 +648,9 @@ static char* lexStr() {
static void lexSkipWhite() {
int c = lexLookahead();
while (c == ' ' || c == '\t') {
- lexSkipLookahead();
- c = lexLookahead();
- }
+ lexSkipLookahead();
+ c = lexLookahead();
+ }
}
static char* lexGetWord() {
@@ -659,10 +659,10 @@ static char* lexGetWord() {
lexClearToken();
c = lexLookahead();
while (c != EOF && !strchr("\t\n ;:=",c)) {
- lexAppendc(c);
- lexSkipLookahead();
- c = lexLookahead();
- }
+ lexAppendc(c);
+ lexSkipLookahead();
+ c = lexLookahead();
+ }
lexAppendc(0);
return lexStr();
}
@@ -688,21 +688,21 @@ static char* lexLookaheadWord() {
int curgetptr = 0;
lexSkipWhite();
lexClearToken();
- curgetptr = (int)lexBuf.getPtr; /* remember! */
+ curgetptr = (int)lexBuf.getPtr; /* remember! */
while (len < (MAX_LEX_LOOKAHEAD_0)) {
- c = lexGetc();
- len++;
- if (c == EOF || strchr("\t\n ;:=", c)) {
- lexAppendc(0);
- /* restore lookahead buf. */
- lexBuf.len += len;
- lexBuf.getPtr = curgetptr;
- return lexStr();
- }
+ c = lexGetc();
+ len++;
+ if (c == EOF || strchr("\t\n ;:=", c)) {
+ lexAppendc(0);
+ /* restore lookahead buf. */
+ lexBuf.len += len;
+ lexBuf.getPtr = curgetptr;
+ return lexStr();
+ }
else
- lexAppendc(c);
- }
- lexBuf.len += len; /* char that has been moved to lookahead buffer */
+ lexAppendc(c);
+ }
+ lexBuf.len += len; /* char that has been moved to lookahead buffer */
lexBuf.getPtr = curgetptr;
return 0;
}
@@ -710,38 +710,38 @@ static char* lexLookaheadWord() {
#ifdef _SUPPORT_LINE_FOLDING
static void handleMoreRFC822LineBreak(int c) {
/* suport RFC 822 line break in cases like
- * ADR: foo;
+ * ADR: foo;
* morefoo;
* more foo;
*/
if (c == ';') {
- int a;
- lexSkipLookahead();
- /* skip white spaces */
- a = lexLookahead();
- while (a == ' ' || a == '\t') {
- lexSkipLookahead();
- a = lexLookahead();
- }
- if (a == '\n') {
- lexSkipLookahead();
- a = lexLookahead();
- if (a == ' ' || a == '\t') {
- /* continuation, throw away all the \n and spaces read so
- * far
- */
- lexSkipWhite();
- lexPushLookaheadc(';');
- }
- else {
- lexPushLookaheadc('\n');
- lexPushLookaheadc(';');
- }
- }
- else {
- lexPushLookaheadc(';');
- }
- }
+ int a;
+ lexSkipLookahead();
+ /* skip white spaces */
+ a = lexLookahead();
+ while (a == ' ' || a == '\t') {
+ lexSkipLookahead();
+ a = lexLookahead();
+ }
+ if (a == '\n') {
+ lexSkipLookahead();
+ a = lexLookahead();
+ if (a == ' ' || a == '\t') {
+ /* continuation, throw away all the \n and spaces read so
+ * far
+ */
+ lexSkipWhite();
+ lexPushLookaheadc(';');
+ }
+ else {
+ lexPushLookaheadc('\n');
+ lexPushLookaheadc(';');
+ }
+ }
+ else {
+ lexPushLookaheadc(';');
+ }
+ }
}
static char* lexGet1Value() {
@@ -750,25 +750,25 @@ static char* lexGet1Value() {
c = lexLookahead();
lexClearToken();
while (c != EOF && c != ';') {
- if (c == '\n') {
- int a;
- lexSkipLookahead();
- a = lexLookahead();
- if (a == ' ' || a == '\t') {
- lexAppendc(' ');
- lexSkipLookahead();
- }
- else {
- lexPushLookaheadc('\n');
- break;
- }
- }
- else {
- lexAppendc(c);
- lexSkipLookahead();
- }
- c = lexLookahead();
- }
+ if (c == '\n') {
+ int a;
+ lexSkipLookahead();
+ a = lexLookahead();
+ if (a == ' ' || a == '\t') {
+ lexAppendc(' ');
+ lexSkipLookahead();
+ }
+ else {
+ lexPushLookaheadc('\n');
+ break;
+ }
+ }
+ else {
+ lexAppendc(c);
+ lexSkipLookahead();
+ }
+ c = lexLookahead();
+ }
lexAppendc(0);
handleMoreRFC822LineBreak(c);
return c==EOF?0:lexStr();
@@ -780,13 +780,13 @@ static int match_begin_name(int end) {
char *n = lexLookaheadWord();
int token = ID;
if (n) {
- if (!stricmp(n,"vcard")) token = end?END_VCARD:BEGIN_VCARD;
- else if (!stricmp(n,"vcalendar")) token = end?END_VCAL:BEGIN_VCAL;
- else if (!stricmp(n,"vevent")) token = end?END_VEVENT:BEGIN_VEVENT;
- else if (!stricmp(n,"vtodo")) token = end?END_VTODO:BEGIN_VTODO;
- deleteStr(n);
- return token;
- }
+ if (!stricmp(n,"vcard")) token = end?END_VCARD:BEGIN_VCARD;
+ else if (!stricmp(n,"vcalendar")) token = end?END_VCAL:BEGIN_VCAL;
+ else if (!stricmp(n,"vevent")) token = end?END_VEVENT:BEGIN_VEVENT;
+ else if (!stricmp(n,"vtodo")) token = end?END_VTODO:BEGIN_VTODO;
+ deleteStr(n);
+ return token;
+ }
return 0;
}
@@ -835,92 +835,92 @@ static char * lexGetDataFromBase64()
DBG_(("db: lexGetDataFromBase64\n"));
while (1) {
- c = lexGetc();
- if (c == '\n') {
- ++mime_lineNum;
- if (lexLookahead() == '\n') {
- /* a '\n' character by itself means end of data */
- break;
- }
- else continue; /* ignore '\n' */
- }
- else {
- if ((c >= 'A') && (c <= 'Z'))
- b = (unsigned char)(c - 'A');
- else if ((c >= 'a') && (c <= 'z'))
- b = (unsigned char)(c - 'a') + 26;
- else if ((c >= '0') && (c <= '9'))
- b = (unsigned char)(c - '0') + 52;
- else if (c == '+')
- b = 62;
- else if (c == '/')
- b = 63;
- else if (c == '=') {
- b = 0;
- pad++;
- } else if ((c == ' ') || (c == '\t')) {
- continue;
- } else { /* error condition */
- if (bytes) free(bytes);
- else if (oldBytes) free(oldBytes);
- /* error recovery: skip until 2 adjacent newlines. */
- DBG_(("db: invalid character 0x%x '%c'\n", c,c));
- if (c != EOF) {
- c = lexGetc();
- while (c != EOF) {
- if (c == '\n' && lexLookahead() == '\n') {
- ++mime_lineNum;
- break;
- }
- c = lexGetc();
- }
- }
- return NULL;
- }
- trip = (trip << 6) | b;
- if (++quadIx == 4) {
- unsigned char outBytes[3];
- int numOut;
- int i;
- for (i = 0; i < 3; i++) {
- outBytes[2-i] = (unsigned char)(trip & 0xFF);
- trip >>= 8;
- }
- numOut = 3 - pad;
- if (bytesLen + numOut > bytesMax) {
- if (!bytes) {
- bytesMax = 1024;
- bytes = (unsigned char*)malloc((size_t)bytesMax);
- }
- else {
- bytesMax <<= 2;
- oldBytes = bytes;
- bytes = (unsigned char*)realloc(bytes,(size_t)bytesMax);
- }
- if (bytes == 0) {
- mime_error("out of memory while processing BASE64 data\n");
- }
- }
- if (bytes) {
- memcpy(bytes + bytesLen, outBytes, numOut);
- bytesLen += numOut;
- }
- trip = 0;
- quadIx = 0;
- }
- }
- } /* while */
+ c = lexGetc();
+ if (c == '\n') {
+ ++mime_lineNum;
+ if (lexLookahead() == '\n') {
+ /* a '\n' character by itself means end of data */
+ break;
+ }
+ else continue; /* ignore '\n' */
+ }
+ else {
+ if ((c >= 'A') && (c <= 'Z'))
+ b = (unsigned char)(c - 'A');
+ else if ((c >= 'a') && (c <= 'z'))
+ b = (unsigned char)(c - 'a') + 26;
+ else if ((c >= '0') && (c <= '9'))
+ b = (unsigned char)(c - '0') + 52;
+ else if (c == '+')
+ b = 62;
+ else if (c == '/')
+ b = 63;
+ else if (c == '=') {
+ b = 0;
+ pad++;
+ } else if ((c == ' ') || (c == '\t')) {
+ continue;
+ } else { /* error condition */
+ if (bytes) free(bytes);
+ else if (oldBytes) free(oldBytes);
+ /* error recovery: skip until 2 adjacent newlines. */
+ DBG_(("db: invalid character 0x%x '%c'\n", c,c));
+ if (c != EOF) {
+ c = lexGetc();
+ while (c != EOF) {
+ if (c == '\n' && lexLookahead() == '\n') {
+ ++mime_lineNum;
+ break;
+ }
+ c = lexGetc();
+ }
+ }
+ return NULL;
+ }
+ trip = (trip << 6) | b;
+ if (++quadIx == 4) {
+ unsigned char outBytes[3];
+ int numOut;
+ int i;
+ for (i = 0; i < 3; i++) {
+ outBytes[2-i] = (unsigned char)(trip & 0xFF);
+ trip >>= 8;
+ }
+ numOut = 3 - pad;
+ if (bytesLen + numOut > bytesMax) {
+ if (!bytes) {
+ bytesMax = 1024;
+ bytes = (unsigned char*)malloc((size_t)bytesMax);
+ }
+ else {
+ bytesMax <<= 2;
+ oldBytes = bytes;
+ bytes = (unsigned char*)realloc(bytes,(size_t)bytesMax);
+ }
+ if (bytes == 0) {
+ mime_error("out of memory while processing BASE64 data\n");
+ }
+ }
+ if (bytes) {
+ memcpy(bytes + bytesLen, outBytes, numOut);
+ bytesLen += numOut;
+ }
+ trip = 0;
+ quadIx = 0;
+ }
+ }
+ } /* while */
DBG_(("db: bytesLen = %d\n", bytesLen));
/* kludge: all this won't be necessary if we have tree form
- representation */
+ representation */
if (bytes) {
- setValueWithSize(curProp,bytes,(unsigned int)bytesLen);
- free(bytes);
- }
+ setValueWithSize(curProp,bytes,(unsigned int)bytesLen);
+ free(bytes);
+ }
else if (oldBytes) {
- setValueWithSize(curProp,oldBytes,(unsigned int)bytesLen);
- free(oldBytes);
- }
+ setValueWithSize(curProp,oldBytes,(unsigned int)bytesLen);
+ free(oldBytes);
+ }
return 0;
}
@@ -932,16 +932,16 @@ static int match_begin_end_name(int end) {
lexSkipWhite();
token = match_begin_name(end);
if (token == ID) {
- lexPushLookaheadc(':');
- DBG_(("db: ID '%s'\n", yylval.str));
- return ID;
- }
+ lexPushLookaheadc(':');
+ DBG_(("db: ID '%s'\n", yylval.str));
+ return ID;
+ }
else if (token != 0) {
- lexSkipLookaheadWord();
- deleteStr(yylval.str);
- DBG_(("db: begin/end %d\n", token));
- return token;
- }
+ lexSkipLookaheadWord();
+ deleteStr(yylval.str);
+ DBG_(("db: begin/end %d\n", token));
+ return token;
+ }
return 0;
}
@@ -951,51 +951,51 @@ static char* lexGetQuotedPrintable()
lexClearToken();
do {
- cur = lexGetc();
- switch (cur) {
- case '=': {
- int c = 0;
- int next[2];
- int i;
- for (i = 0; i < 2; i++) {
- next[i] = lexGetc();
- if (next[i] >= '0' && next[i] <= '9')
- c = c * 16 + next[i] - '0';
- else if (next[i] >= 'A' && next[i] <= 'F')
- c = c * 16 + next[i] - 'A' + 10;
- else
- break;
- }
- if (i == 0) {
- /* single '=' follow by LINESEP is continuation sign? */
- if (next[0] == '\n') {
- ++mime_lineNum;
- }
- else {
- lexPushLookaheadc('=');
- goto EndString;
- }
- }
- else if (i == 1) {
- lexPushLookaheadc(next[1]);
- lexPushLookaheadc(next[0]);
- lexAppendc('=');
- } else {
- lexAppendc(c);
- }
- break;
- } /* '=' */
- case '\n': {
- lexPushLookaheadc('\n');
- goto EndString;
- }
- case (char)EOF:
- break;
- default:
- lexAppendc(cur);
- break;
- } /* switch */
- } while (cur != (char)EOF);
+ cur = lexGetc();
+ switch (cur) {
+ case '=': {
+ int c = 0;
+ int next[2];
+ int i;
+ for (i = 0; i < 2; i++) {
+ next[i] = lexGetc();
+ if (next[i] >= '0' && next[i] <= '9')
+ c = c * 16 + next[i] - '0';
+ else if (next[i] >= 'A' && next[i] <= 'F')
+ c = c * 16 + next[i] - 'A' + 10;
+ else
+ break;
+ }
+ if (i == 0) {
+ /* single '=' follow by LINESEP is continuation sign? */
+ if (next[0] == '\n') {
+ ++mime_lineNum;
+ }
+ else {
+ lexPushLookaheadc('=');
+ goto EndString;
+ }
+ }
+ else if (i == 1) {
+ lexPushLookaheadc(next[1]);
+ lexPushLookaheadc(next[0]);
+ lexAppendc('=');
+ } else {
+ lexAppendc(c);
+ }
+ break;
+ } /* '=' */
+ case '\n': {
+ lexPushLookaheadc('\n');
+ goto EndString;
+ }
+ case (char)EOF:
+ break;
+ default:
+ lexAppendc(cur);
+ break;
+ } /* switch */
+ } while (cur != (char)EOF);
EndString:
lexAppendc(0);
@@ -1006,118 +1006,118 @@ int yylex() {
int lexmode = LEXMODE();
if (lexmode == L_VALUES) {
- int c = lexGetc();
- if (c == ';') {
- DBG_(("db: SEMICOLON\n"));
- lexPushLookaheadc(c);
+ int c = lexGetc();
+ if (c == ';') {
+ DBG_(("db: SEMICOLON\n"));
+ lexPushLookaheadc(c);
#ifdef _SUPPORT_LINE_FOLDING
- handleMoreRFC822LineBreak(c);
+ handleMoreRFC822LineBreak(c);
#endif
- lexSkipLookahead();
- return SEMICOLON;
- }
- else if (strchr("\n",c)) {
- ++mime_lineNum;
- /* consume all line separator(s) adjacent to each other */
- c = lexLookahead();
- while (strchr("\n",c)) {
- lexSkipLookahead();
- c = lexLookahead();
- ++mime_lineNum;
- }
- DBG_(("db: LINESEP\n"));
- return LINESEP;
- }
- else {
- char *p = 0;
- lexPushLookaheadc(c);
- if (lexWithinMode(L_BASE64)) {
- /* get each char and convert to bin on the fly... */
- p = lexGetDataFromBase64();
- yylval.str = p;
- return STRING;
- }
- else if (lexWithinMode(L_QUOTED_PRINTABLE)) {
- p = lexGetQuotedPrintable();
- }
- else {
+ lexSkipLookahead();
+ return SEMICOLON;
+ }
+ else if (strchr("\n",c)) {
+ ++mime_lineNum;
+ /* consume all line separator(s) adjacent to each other */
+ c = lexLookahead();
+ while (strchr("\n",c)) {
+ lexSkipLookahead();
+ c = lexLookahead();
+ ++mime_lineNum;
+ }
+ DBG_(("db: LINESEP\n"));
+ return LINESEP;
+ }
+ else {
+ char *p = 0;
+ lexPushLookaheadc(c);
+ if (lexWithinMode(L_BASE64)) {
+ /* get each char and convert to bin on the fly... */
+ p = lexGetDataFromBase64();
+ yylval.str = p;
+ return STRING;
+ }
+ else if (lexWithinMode(L_QUOTED_PRINTABLE)) {
+ p = lexGetQuotedPrintable();
+ }
+ else {
#ifdef _SUPPORT_LINE_FOLDING
- p = lexGet1Value();
+ p = lexGet1Value();
#else
- p = lexGetStrUntil(";\n");
+ p = lexGetStrUntil(";\n");
#endif
- }
- if (p) {
- DBG_(("db: STRING: '%s'\n", p));
- yylval.str = p;
- return STRING;
- }
- else return 0;
- }
- }
+ }
+ if (p) {
+ DBG_(("db: STRING: '%s'\n", p));
+ yylval.str = p;
+ return STRING;
+ }
+ else return 0;
+ }
+ }
else {
- /* normal mode */
- while (1) {
- int c = lexGetc();
- switch(c) {
- case ':': {
- /* consume all line separator(s) adjacent to each other */
- /* ignoring linesep immediately after colon. */
-/* c = lexLookahead();
- while (strchr("\n",c)) {
- lexSkipLookahead();
- c = lexLookahead();
- ++mime_lineNum;
- }*/
- DBG_(("db: COLON\n"));
- return COLON;
- }
- case ';':
- DBG_(("db: SEMICOLON\n"));
- return SEMICOLON;
- case '=':
- DBG_(("db: EQ\n"));
- return EQ;
- /* ignore whitespace in this mode */
- case '\t':
- case ' ': continue;
- case '\n': {
- ++mime_lineNum;
- continue;
- }
- case EOF: return 0;
- break;
- default: {
- lexPushLookaheadc(c);
- if (isalpha(c)) {
- char *t = lexGetWord();
- yylval.str = t;
- if (!stricmp(t, "begin")) {
- return match_begin_end_name(0);
- }
- else if (!stricmp(t,"end")) {
- return match_begin_end_name(1);
- }
- else {
- DBG_(("db: ID '%s'\n", t));
- return ID;
- }
- }
- else {
- /* unknow token */
- return 0;
- }
- break;
- }
- }
- }
- }
+ /* normal mode */
+ while (1) {
+ int c = lexGetc();
+ switch(c) {
+ case ':': {
+ /* consume all line separator(s) adjacent to each other */
+ /* ignoring linesep immediately after colon. */
+/* c = lexLookahead();
+ while (strchr("\n",c)) {
+ lexSkipLookahead();
+ c = lexLookahead();
+ ++mime_lineNum;
+ }*/
+ DBG_(("db: COLON\n"));
+ return COLON;
+ }
+ case ';':
+ DBG_(("db: SEMICOLON\n"));
+ return SEMICOLON;
+ case '=':
+ DBG_(("db: EQ\n"));
+ return EQ;
+ /* ignore whitespace in this mode */
+ case '\t':
+ case ' ': continue;
+ case '\n': {
+ ++mime_lineNum;
+ continue;
+ }
+ case EOF: return 0;
+ break;
+ default: {
+ lexPushLookaheadc(c);
+ if (isalpha(c)) {
+ char *t = lexGetWord();
+ yylval.str = t;
+ if (!stricmp(t, "begin")) {
+ return match_begin_end_name(0);
+ }
+ else if (!stricmp(t,"end")) {
+ return match_begin_end_name(1);
+ }
+ else {
+ DBG_(("db: ID '%s'\n", t));
+ return ID;
+ }
+ }
+ else {
+ /* unknow token */
+ return 0;
+ }
+ break;
+ }
+ }
+ }
+ }
return 0;
}
/***************************************************************************/
-/*** Public Functions ****/
+/*** Public Functions ****/
/***************************************************************************/
static VObject* Parse_MIMEHelper()
@@ -1129,7 +1129,7 @@ static VObject* Parse_MIMEHelper()
curObj = 0;
if (yyparse() != 0)
- return 0;
+ return 0;
finiLex();
return vObjList;
@@ -1152,7 +1152,7 @@ DLLEXPORT(VObject*) Parse_MIME_FromFile(CFile *file)
initLex(0,-1,file);
startPos = file->GetPosition();
if (!(result = Parse_MIMEHelper()))
- file->Seek(startPos, CFile::begin);
+ file->Seek(startPos, CFile::begin);
return result;
}
@@ -1166,9 +1166,9 @@ VObject* Parse_MIME_FromFile(FILE *file)
initLex(0,(unsigned long)-1,file);
startPos = ftell(file);
if (!(result = Parse_MIMEHelper())) {
- if (startPos >= 0)
- fseek(file,startPos,SEEK_SET);
- }
+ if (startPos >= 0)
+ fseek(file,startPos,SEEK_SET);
+ }
return result;
}
@@ -1176,16 +1176,16 @@ DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname)
{
FILE *fp = fopen(fname,"r");
if (fp) {
- VObject* o = Parse_MIME_FromFile(fp);
- fclose(fp);
- return o;
- }
+ VObject* o = Parse_MIME_FromFile(fp);
+ fclose(fp);
+ return o;
+ }
else {
- char msg[256];
- snprintf(msg, sizeof(msg), "can't open file '%s' for reading\n", fname);
- mime_error_(msg);
- return 0;
- }
+ char msg[256];
+ snprintf(msg, sizeof(msg), "can't open file '%s' for reading\n", fname);
+ mime_error_(msg);
+ return 0;
+ }
}
#endif
@@ -1202,15 +1202,14 @@ static void mime_error(char *s)
{
char msg[256];
if (mimeErrorHandler) {
- snprintf(msg,sizeof(msg),"%s at line %d", s, mime_lineNum);
- mimeErrorHandler(msg);
- }
+ snprintf(msg,sizeof(msg),"%s at line %d", s, mime_lineNum);
+ mimeErrorHandler(msg);
+ }
}
static void mime_error_(char *s)
{
if (mimeErrorHandler) {
- mimeErrorHandler(s);
- }
+ mimeErrorHandler(s);
+ }
}
-
diff --git a/src/libicalvcal/vobject.c b/src/libicalvcal/vobject.c
index 415e9e3e..07e8d737 100644
--- a/src/libicalvcal/vobject.c
+++ b/src/libicalvcal/vobject.c
@@ -41,16 +41,12 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.
* doc: vobject and APIs to construct vobject, APIs pretty print
* vobject, and convert a vobject into its textual representation.
*/
-#if defined(_MSC_VER)
-#define snprintf _snprintf
-#define strcasecmp stricmp
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
#endif
#include "vobject.h"
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
#define NAME_OF(o) o->id
#define VALUE_TYPE(o) o->valType
@@ -100,7 +96,7 @@ const char** fieldedProp;
deleteStrItem
----------------------------------------------------------------------*/
-DLLEXPORT(VObject*) newVObject_(const char *id)
+VObject* newVObject_(const char *id)
{
VObject *p = (VObject*)malloc(sizeof(VObject));
p->next = 0;
@@ -111,18 +107,18 @@ DLLEXPORT(VObject*) newVObject_(const char *id)
return p;
}
-DLLEXPORT(VObject*) newVObject(const char *id)
+VObject* newVObject(const char *id)
{
return newVObject_(lookupStr(id));
}
-DLLEXPORT(void) deleteVObject(VObject *p)
+void deleteVObject(VObject *p)
{
unUseStr(p->id);
free(p);
}
-DLLEXPORT(char*) dupStr(const char *s, size_t size)
+char* dupStr(const char *s, size_t size)
{
char *t;
if (size == 0) {
@@ -139,7 +135,7 @@ DLLEXPORT(char*) dupStr(const char *s, size_t size)
}
}
-DLLEXPORT(void) deleteStr(const char *p)
+void deleteStr(const char *p)
{
if (p) free((void*)p);
}
@@ -164,95 +160,95 @@ static void deleteStrItem(StrItem *p)
The following function provide accesses to VObject's value.
----------------------------------------------------------------------*/
-DLLEXPORT(const char*) vObjectName(VObject *o)
+const char* vObjectName(VObject *o)
{
return NAME_OF(o);
}
-DLLEXPORT(void) setVObjectName(VObject *o, const char* id)
+void setVObjectName(VObject *o, const char* id)
{
NAME_OF(o) = id;
}
-DLLEXPORT(const char*) vObjectStringZValue(VObject *o)
+const char* vObjectStringZValue(VObject *o)
{
return STRINGZ_VALUE_OF(o);
}
-DLLEXPORT(void) setVObjectStringZValue(VObject *o, const char *s)
+void setVObjectStringZValue(VObject *o, const char *s)
{
STRINGZ_VALUE_OF(o) = dupStr(s,0);
VALUE_TYPE(o) = VCVT_STRINGZ;
}
-DLLEXPORT(void) setVObjectStringZValue_(VObject *o, const char *s)
+void setVObjectStringZValue_(VObject *o, const char *s)
{
STRINGZ_VALUE_OF(o) = s;
VALUE_TYPE(o) = VCVT_STRINGZ;
}
-DLLEXPORT(const wchar_t*) vObjectUStringZValue(VObject *o)
+const wchar_t* vObjectUStringZValue(VObject *o)
{
return USTRINGZ_VALUE_OF(o);
}
-DLLEXPORT(void) setVObjectUStringZValue(VObject *o, const wchar_t *s)
+void setVObjectUStringZValue(VObject *o, const wchar_t *s)
{
USTRINGZ_VALUE_OF(o) = (wchar_t*) dupStr((char*)s,(uStrLen(s)+1)*2);
VALUE_TYPE(o) = VCVT_USTRINGZ;
}
-DLLEXPORT(void) setVObjectUStringZValue_(VObject *o, const wchar_t *s)
+void setVObjectUStringZValue_(VObject *o, const wchar_t *s)
{
USTRINGZ_VALUE_OF(o) = s;
VALUE_TYPE(o) = VCVT_USTRINGZ;
}
-DLLEXPORT(unsigned int) vObjectIntegerValue(VObject *o)
+unsigned int vObjectIntegerValue(VObject *o)
{
return INTEGER_VALUE_OF(o);
}
-DLLEXPORT(void) setVObjectIntegerValue(VObject *o, unsigned int i)
+void setVObjectIntegerValue(VObject *o, unsigned int i)
{
INTEGER_VALUE_OF(o) = i;
VALUE_TYPE(o) = VCVT_UINT;
}
-DLLEXPORT(unsigned long) vObjectLongValue(VObject *o)
+unsigned long vObjectLongValue(VObject *o)
{
return LONG_VALUE_OF(o);
}
-DLLEXPORT(void) setVObjectLongValue(VObject *o, unsigned long l)
+void setVObjectLongValue(VObject *o, unsigned long l)
{
LONG_VALUE_OF(o) = l;
VALUE_TYPE(o) = VCVT_ULONG;
}
-DLLEXPORT(void*) vObjectAnyValue(VObject *o)
+void* vObjectAnyValue(VObject *o)
{
return ANY_VALUE_OF(o);
}
-DLLEXPORT(void) setVObjectAnyValue(VObject *o, void *t)
+void setVObjectAnyValue(VObject *o, void *t)
{
ANY_VALUE_OF(o) = t;
VALUE_TYPE(o) = VCVT_RAW;
}
-DLLEXPORT(VObject*) vObjectVObjectValue(VObject *o)
+VObject* vObjectVObjectValue(VObject *o)
{
return VOBJECT_VALUE_OF(o);
}
-DLLEXPORT(void) setVObjectVObjectValue(VObject *o, VObject *p)
+void setVObjectVObjectValue(VObject *o, VObject *p)
{
VOBJECT_VALUE_OF(o) = p;
VALUE_TYPE(o) = VCVT_VOBJECT;
}
-DLLEXPORT(int) vObjectValueType(VObject *o)
+int vObjectValueType(VObject *o)
{
return VALUE_TYPE(o);
}
@@ -262,7 +258,7 @@ DLLEXPORT(int) vObjectValueType(VObject *o)
The following functions can be used to build VObject.
----------------------------------------------------------------------*/
-DLLEXPORT(VObject*) addVObjectProp(VObject *o, VObject *p)
+VObject* addVObjectProp(VObject *o, VObject *p)
{
/* circular link list pointed to tail */
/*
@@ -297,17 +293,17 @@ DLLEXPORT(VObject*) addVObjectProp(VObject *o, VObject *p)
return p;
}
-DLLEXPORT(VObject*) addProp(VObject *o, const char *id)
+VObject* addProp(VObject *o, const char *id)
{
return addVObjectProp(o,newVObject(id));
}
-DLLEXPORT(VObject*) addProp_(VObject *o, const char *id)
+VObject* addProp_(VObject *o, const char *id)
{
return addVObjectProp(o,newVObject_(id));
}
-DLLEXPORT(void) addList(VObject **o, VObject *p)
+void addList(VObject **o, VObject *p)
{
p->next = 0;
if (*o == 0) {
@@ -322,12 +318,12 @@ DLLEXPORT(void) addList(VObject **o, VObject *p)
}
}
-DLLEXPORT(VObject*) nextVObjectInList(VObject *o)
+VObject* nextVObjectInList(VObject *o)
{
return o->next;
}
-DLLEXPORT(VObject*) setValueWithSize_(VObject *prop, void *val, unsigned int size)
+VObject* setValueWithSize_(VObject *prop, void *val, unsigned int size)
{
VObject *sizeProp;
setVObjectAnyValue(prop, val);
@@ -336,30 +332,30 @@ DLLEXPORT(VObject*) setValueWithSize_(VObject *prop, void *val, unsigned int siz
return prop;
}
-DLLEXPORT(VObject*) setValueWithSize(VObject *prop, void *val, unsigned int size)
+VObject* setValueWithSize(VObject *prop, void *val, unsigned int size)
{
void *p = dupStr((const char *)val,size);
return setValueWithSize_(prop,p,p?size:0);
}
-DLLEXPORT(void) initPropIterator(VObjectIterator *i, VObject *o)
+void initPropIterator(VObjectIterator *i, VObject *o)
{
i->start = o->prop;
i->next = 0;
}
-DLLEXPORT(void) initVObjectIterator(VObjectIterator *i, VObject *o)
+void initVObjectIterator(VObjectIterator *i, VObject *o)
{
i->start = o->next;
i->next = 0;
}
-DLLEXPORT(int) moreIteration(VObjectIterator *i)
+int moreIteration(VObjectIterator *i)
{
return (i->start && (i->next==0 || i->next!=i->start));
}
-DLLEXPORT(VObject*) nextVObject(VObjectIterator *i)
+VObject* nextVObject(VObjectIterator *i)
{
if (i->start && i->next != i->start) {
if (i->next == 0) {
@@ -374,19 +370,19 @@ DLLEXPORT(VObject*) nextVObject(VObjectIterator *i)
else return (VObject*)0;
}
-DLLEXPORT(VObject*) isAPropertyOf(VObject *o, const char *id)
+VObject* isAPropertyOf(VObject *o, const char *id)
{
VObjectIterator i;
initPropIterator(&i,o);
while (moreIteration(&i)) {
VObject *each = nextVObject(&i);
- if (!stricmp(id,each->id))
+ if (!strcasecmp(id,each->id))
return each;
}
return (VObject*)0;
}
-DLLEXPORT(VObject*) addGroup(VObject *o, const char *g)
+VObject* addGroup(VObject *o, const char *g)
{
/*
a.b.c
@@ -427,7 +423,7 @@ DLLEXPORT(VObject*) addGroup(VObject *o, const char *g)
return addProp_(o,lookupProp(g));
}
-DLLEXPORT(VObject*) addPropValue(VObject *o, const char *p, const char *v)
+VObject* addPropValue(VObject *o, const char *p, const char *v)
{
VObject *prop;
prop = addProp(o,p);
@@ -435,7 +431,7 @@ DLLEXPORT(VObject*) addPropValue(VObject *o, const char *p, const char *v)
return prop;
}
-DLLEXPORT(VObject*) addPropSizedValue_(VObject *o, const char *p, const char *v,
+VObject* addPropSizedValue_(VObject *o, const char *p, const char *v,
unsigned int size)
{
VObject *prop;
@@ -444,7 +440,7 @@ DLLEXPORT(VObject*) addPropSizedValue_(VObject *o, const char *p, const char *v,
return prop;
}
-DLLEXPORT(VObject*) addPropSizedValue(VObject *o, const char *p, const char *v,
+VObject* addPropSizedValue(VObject *o, const char *p, const char *v,
unsigned int size)
{
return addPropSizedValue_(o,p,dupStr(v,size),size);
@@ -545,7 +541,7 @@ void printVObject(FILE *fp,VObject *o)
printVObject_(fp,o,0);
}
-DLLEXPORT(void) printVObjectToFile(char *fname,VObject *o)
+void printVObjectToFile(char *fname,VObject *o)
{
FILE *fp = fopen(fname,"w");
if (fp) {
@@ -554,7 +550,7 @@ DLLEXPORT(void) printVObjectToFile(char *fname,VObject *o)
}
}
-DLLEXPORT(void) printVObjectsToFile(char *fname,VObject *list)
+void printVObjectsToFile(char *fname,VObject *list)
{
FILE *fp = fopen(fname,"w");
if (fp) {
@@ -566,7 +562,7 @@ DLLEXPORT(void) printVObjectsToFile(char *fname,VObject *list)
}
}
-DLLEXPORT(void) cleanVObject(VObject *o)
+void cleanVObject(VObject *o)
{
if (o == 0) return;
if (o->prop) {
@@ -600,7 +596,7 @@ DLLEXPORT(void) cleanVObject(VObject *o)
deleteVObject(o);
}
-DLLEXPORT(void) cleanVObjects(VObject *list)
+void cleanVObjects(VObject *list)
{
while (list) {
VObject *t = list;
@@ -627,13 +623,13 @@ static unsigned int hashStr(const char *s)
return h % STRTBLSIZE;
}
-DLLEXPORT(const char*) lookupStr(const char *s)
+const char* lookupStr(const char *s)
{
StrItem *t;
unsigned int h = hashStr(s);
if ((t = strTbl[h]) != 0) {
do {
- if (stricmp(t->s,s) == 0) {
+ if (strcasecmp(t->s,s) == 0) {
t->refCnt++;
return t->s;
}
@@ -645,14 +641,14 @@ DLLEXPORT(const char*) lookupStr(const char *s)
return s;
}
-DLLEXPORT(void) unUseStr(const char *s)
+void unUseStr(const char *s)
{
StrItem *t, *p;
unsigned int h = hashStr(s);
if ((t = strTbl[h]) != 0) {
p = t;
do {
- if (stricmp(t->s,s) == 0) {
+ if (strcasecmp(t->s,s) == 0) {
t->refCnt--;
if (t->refCnt == 0) {
if (p == strTbl[h]) {
@@ -672,7 +668,7 @@ DLLEXPORT(void) unUseStr(const char *s)
}
}
-DLLEXPORT(void) cleanStrTbl()
+void cleanStrTbl()
{
int i;
for (i=0; i<STRTBLSIZE;i++) {
@@ -934,7 +930,7 @@ static const struct PreDefProp* lookupPropInfo(const char* str)
int i;
for (i = 0; propNames[i].name; i++)
- if (stricmp(str, propNames[i].name) == 0) {
+ if (strcasecmp(str, propNames[i].name) == 0) {
return &propNames[i];
}
@@ -942,12 +938,12 @@ static const struct PreDefProp* lookupPropInfo(const char* str)
}
-DLLEXPORT(const char*) lookupProp_(const char* str)
+const char* lookupProp_(const char* str)
{
int i;
for (i = 0; propNames[i].name; i++)
- if (stricmp(str, propNames[i].name) == 0) {
+ if (strcasecmp(str, propNames[i].name) == 0) {
const char* s;
s = propNames[i].alias?propNames[i].alias:propNames[i].name;
return lookupStr(s);
@@ -956,12 +952,12 @@ DLLEXPORT(const char*) lookupProp_(const char* str)
}
-DLLEXPORT(const char*) lookupProp(const char* str)
+const char* lookupProp(const char* str)
{
int i;
for (i = 0; propNames[i].name; i++)
- if (stricmp(str, propNames[i].name) == 0) {
+ if (strcasecmp(str, propNames[i].name) == 0) {
const char *s;
fieldedProp = propNames[i].fields;
s = propNames[i].alias?propNames[i].alias:propNames[i].name;
@@ -1262,7 +1258,7 @@ static int inList(const char **list, const char *s)
{
if (list == 0) return 0;
while (*list) {
- if (stricmp(*list,s) == 0) return 1;
+ if (strcasecmp(*list,s) == 0) return 1;
list++;
}
return 0;
@@ -1290,9 +1286,9 @@ static void writeProp(OFile *fp, VObject *o)
const char *s;
VObject *eachProp = nextVObject(&t);
s = NAME_OF(eachProp);
- if (stricmp(VCGroupingProp,s) && !inList(fields_,s))
+ if (strcasecmp(VCGroupingProp,s) && !inList(fields_,s))
writeAttrValue(fp,eachProp);
- if (stricmp(VCQPProp,s)==0 || stricmp(VCQuotedPrintableProp,s)==0)
+ if (strcasecmp(VCQPProp,s)==0 || strcasecmp(VCQuotedPrintableProp,s)==0)
isQuoted=1;
}
if (fields_) {
@@ -1357,7 +1353,7 @@ void writeVObject(FILE *fp, VObject *o)
writeVObject_(&ofp,o);
}
-DLLEXPORT(void) writeVObjectToFile(char *fname, VObject *o)
+void writeVObjectToFile(char *fname, VObject *o)
{
FILE *fp = fopen(fname,"w");
if (fp) {
@@ -1366,7 +1362,7 @@ DLLEXPORT(void) writeVObjectToFile(char *fname, VObject *o)
}
}
-DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list)
+void writeVObjectsToFile(char *fname, VObject *list)
{
FILE *fp = fopen(fname,"w");
if (fp) {
@@ -1378,7 +1374,7 @@ DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list)
}
}
-DLLEXPORT(char*) writeMemVObject(char *s, int *len, VObject *o)
+char* writeMemVObject(char *s, int *len, VObject *o)
{
OFile ofp;
initMemOFile(&ofp,s,len?*len:0);
@@ -1388,7 +1384,7 @@ DLLEXPORT(char*) writeMemVObject(char *s, int *len, VObject *o)
return ofp.s;
}
-DLLEXPORT(char*) writeMemVObjects(char *s, int *len, VObject *list)
+char* writeMemVObjects(char *s, int *len, VObject *list)
{
OFile ofp;
initMemOFile(&ofp,s,len?*len:0);
@@ -1404,7 +1400,7 @@ DLLEXPORT(char*) writeMemVObjects(char *s, int *len, VObject *list)
/*----------------------------------------------------------------------
APIs to do fake Unicode stuff.
----------------------------------------------------------------------*/
-DLLEXPORT(wchar_t*) fakeUnicode(const char *ps, size_t *bytes)
+wchar_t* fakeUnicode(const char *ps, size_t *bytes)
{
wchar_t *r, *pw;
size_t len = strlen(ps)+1;
@@ -1427,14 +1423,14 @@ DLLEXPORT(wchar_t*) fakeUnicode(const char *ps, size_t *bytes)
return r;
}
-DLLEXPORT(int) uStrLen(const wchar_t *u)
+int uStrLen(const wchar_t *u)
{
int i = 0;
while (*u != (wchar_t)0) { u++; i++; }
return i;
}
-DLLEXPORT(char*) fakeCString(const wchar_t *u)
+char* fakeCString(const wchar_t *u)
{
char *s, *t;
int len = uStrLen(u) + 1;
diff --git a/src/libicalvcal/vobject.h b/src/libicalvcal/vobject.h
index 8c76825b..34a23136 100644
--- a/src/libicalvcal/vobject.h
+++ b/src/libicalvcal/vobject.h
@@ -47,8 +47,6 @@ implements the core parser
vobject.c implements an API that insulates the caller from
the parser and changes in the vCard/vCalendar BNF
-port.h defines compilation environment dependent stuff
-
vcc.h and vobject.h are header files for their .c counterparts
vcaltmp.h and vcaltmp.c implement vCalendar "macro" functions
@@ -74,20 +72,18 @@ which accompanied this distribution.
*/
-
#ifndef VOBJECT_H
#define VOBJECT_H
#include "libical_vcal_export.h"
-#include "port.h"
#include <stdlib.h>
#include <stdio.h>
#if defined(__CPLUSPLUS__) || defined(__cplusplus)
-extern "C" {
+extern "C"
+{
#endif
-
#define VC7bitProp "7BIT"
#define VC8bitProp "8BIT"
#define VCAAlarmProp "AALARM"
@@ -252,95 +248,98 @@ extern "C" {
#define XPilotIdProp "X-PILOTID"
#define XPilotStatusProp "X-PILOTSTAT"
-typedef struct VObject VObject;
+ typedef struct VObject VObject;
-typedef struct VObjectIterator {
- VObject* start;
- VObject* next;
+ typedef struct VObjectIterator
+ {
+ VObject *start;
+ VObject *next;
} VObjectIterator;
-extern DLLEXPORT(VObject*) newVObject(const char *id);
-LIBICAL_VCAL_EXPORT void deleteVObject(VObject *p);
-extern DLLEXPORT(char*) dupStr(const char *s, size_t size);
-extern DLLEXPORT(void) deleteStr(const char *p);
-extern DLLEXPORT(void) unUseStr(const char *s);
-
-extern DLLEXPORT(void) setVObjectName(VObject *o, const char* id);
-extern DLLEXPORT(void) setVObjectStringZValue(VObject *o, const char *s);
-extern DLLEXPORT(void) setVObjectStringZValue_(VObject *o, const char *s);
-extern DLLEXPORT(void) setVObjectUStringZValue(VObject *o, const wchar_t *s);
-extern DLLEXPORT(void) setVObjectUStringZValue_(VObject *o, const wchar_t *s);
-extern DLLEXPORT(void) setVObjectIntegerValue(VObject *o, unsigned int i);
-extern DLLEXPORT(void) setVObjectLongValue(VObject *o, unsigned long l);
-extern DLLEXPORT(void) setVObjectAnyValue(VObject *o, void *t);
-extern DLLEXPORT(VObject*) setValueWithSize(VObject *prop, void *val, unsigned int size);
-extern DLLEXPORT(VObject*) setValueWithSize_(VObject *prop, void *val, unsigned int size);
-
-extern DLLEXPORT(const char*) vObjectName(VObject *o);
-extern DLLEXPORT(const char*) vObjectStringZValue(VObject *o);
-extern DLLEXPORT(const wchar_t*) vObjectUStringZValue(VObject *o);
-extern DLLEXPORT(unsigned int) vObjectIntegerValue(VObject *o);
-extern DLLEXPORT(unsigned long) vObjectLongValue(VObject *o);
-extern DLLEXPORT(void*) vObjectAnyValue(VObject *o);
-extern DLLEXPORT(VObject*) vObjectVObjectValue(VObject *o);
-extern DLLEXPORT(void) setVObjectVObjectValue(VObject *o, VObject *p);
-
-extern DLLEXPORT(VObject*) addVObjectProp(VObject *o, VObject *p);
-extern DLLEXPORT(VObject*) addProp(VObject *o, const char *id);
-extern DLLEXPORT(VObject*) addProp_(VObject *o, const char *id);
-extern DLLEXPORT(VObject*) addPropValue(VObject *o, const char *p, const char *v);
-extern DLLEXPORT(VObject*) addPropSizedValue_(VObject *o, const char *p, const char *v, unsigned int size);
-extern DLLEXPORT(VObject*) addPropSizedValue(VObject *o, const char *p, const char *v, unsigned int size);
-extern DLLEXPORT(VObject*) addGroup(VObject *o, const char *g);
-extern DLLEXPORT(void) addList(VObject **o, VObject *p);
-
-extern DLLEXPORT(VObject*) isAPropertyOf(VObject *o, const char *id);
-
-extern DLLEXPORT(VObject*) nextVObjectInList(VObject *o);
-extern DLLEXPORT(void) initPropIterator(VObjectIterator *i, VObject *o);
-extern DLLEXPORT(int) moreIteration(VObjectIterator *i);
-extern DLLEXPORT(VObject*) nextVObject(VObjectIterator *i);
-
-extern DLLEXPORT(char*) writeMemVObject(char *s, int *len, VObject *o);
-extern DLLEXPORT(char*) writeMemVObjects(char *s, int *len, VObject *list);
-
-extern DLLEXPORT(const char*) lookupStr(const char *s);
-extern DLLEXPORT(void) cleanStrTbl();
-
-extern DLLEXPORT(void) cleanVObject(VObject *o);
-extern DLLEXPORT(void) cleanVObjects(VObject *list);
-
-extern DLLEXPORT(const char*) lookupProp(const char* str);
-extern DLLEXPORT(const char*) lookupProp_(const char* str);
-
-extern DLLEXPORT(wchar_t*) fakeUnicode(const char *ps, size_t *bytes);
-extern DLLEXPORT(int) uStrLen(const wchar_t *u);
-extern DLLEXPORT(char*) fakeCString(const wchar_t *u);
-
-extern DLLEXPORT(void) printVObjectToFile(char *fname,VObject *o);
-extern DLLEXPORT(void) printVObjectsToFile(char *fname,VObject *list);
-extern DLLEXPORT(void) writeVObjectToFile(char *fname, VObject *o);
-extern DLLEXPORT(void) writeVObjectsToFile(char *fname, VObject *list);
-
-extern DLLEXPORT(int) vObjectValueType(VObject *o);
+ LIBICAL_VCAL_EXPORT VObject *newVObject(const char *id);
+ LIBICAL_VCAL_EXPORT void deleteVObject(VObject * p);
+ LIBICAL_VCAL_EXPORT char *dupStr(const char *s, size_t size);
+ LIBICAL_VCAL_EXPORT void deleteStr(const char *p);
+ LIBICAL_VCAL_EXPORT void unUseStr(const char *s);
+
+ LIBICAL_VCAL_EXPORT void setVObjectName(VObject * o, const char *id);
+ LIBICAL_VCAL_EXPORT void setVObjectStringZValue(VObject * o, const char *s);
+ LIBICAL_VCAL_EXPORT void setVObjectStringZValue_(VObject * o, const char *s);
+ LIBICAL_VCAL_EXPORT void setVObjectUStringZValue(VObject * o, const wchar_t * s);
+ LIBICAL_VCAL_EXPORT void setVObjectUStringZValue_(VObject * o, const wchar_t * s);
+ LIBICAL_VCAL_EXPORT void setVObjectIntegerValue(VObject * o, unsigned int i);
+ LIBICAL_VCAL_EXPORT void setVObjectLongValue(VObject * o, unsigned long l);
+ LIBICAL_VCAL_EXPORT void setVObjectAnyValue(VObject * o, void *t);
+ LIBICAL_VCAL_EXPORT VObject *setValueWithSize(VObject * prop, void *val, unsigned int size);
+ LIBICAL_VCAL_EXPORT VObject *setValueWithSize_(VObject * prop, void *val, unsigned int size);
+
+ LIBICAL_VCAL_EXPORT const char *vObjectName(VObject * o);
+ LIBICAL_VCAL_EXPORT const char *vObjectStringZValue(VObject * o);
+ LIBICAL_VCAL_EXPORT const wchar_t *vObjectUStringZValue(VObject * o);
+ LIBICAL_VCAL_EXPORT unsigned int vObjectIntegerValue(VObject * o);
+ LIBICAL_VCAL_EXPORT unsigned long vObjectLongValue(VObject * o);
+ LIBICAL_VCAL_EXPORT void *vObjectAnyValue(VObject * o);
+ LIBICAL_VCAL_EXPORT VObject *vObjectVObjectValue(VObject * o);
+ LIBICAL_VCAL_EXPORT void setVObjectVObjectValue(VObject * o, VObject * p);
+
+ LIBICAL_VCAL_EXPORT VObject *addVObjectProp(VObject * o, VObject * p);
+ LIBICAL_VCAL_EXPORT VObject *addProp(VObject * o, const char *id);
+ LIBICAL_VCAL_EXPORT VObject *addProp_(VObject * o, const char *id);
+ LIBICAL_VCAL_EXPORT VObject *addPropValue(VObject * o, const char *p, const char *v);
+ LIBICAL_VCAL_EXPORT VObject *addPropSizedValue_(VObject * o, const char *p, const char *v,
+ unsigned int size);
+ LIBICAL_VCAL_EXPORT VObject *addPropSizedValue(VObject * o, const char *p, const char *v,
+ unsigned int size);
+ LIBICAL_VCAL_EXPORT VObject *addGroup(VObject * o, const char *g);
+ LIBICAL_VCAL_EXPORT void addList(VObject ** o, VObject * p);
+
+ LIBICAL_VCAL_EXPORT VObject *isAPropertyOf(VObject * o, const char *id);
+
+ LIBICAL_VCAL_EXPORT VObject *nextVObjectInList(VObject * o);
+ LIBICAL_VCAL_EXPORT void initPropIterator(VObjectIterator * i, VObject * o);
+ LIBICAL_VCAL_EXPORT int moreIteration(VObjectIterator * i);
+ LIBICAL_VCAL_EXPORT VObject *nextVObject(VObjectIterator * i);
+
+ LIBICAL_VCAL_EXPORT char *writeMemVObject(char *s, int *len, VObject * o);
+ LIBICAL_VCAL_EXPORT char *writeMemVObjects(char *s, int *len, VObject * list);
+
+ LIBICAL_VCAL_EXPORT const char *lookupStr(const char *s);
+ LIBICAL_VCAL_EXPORT void cleanStrTbl();
+
+ LIBICAL_VCAL_EXPORT void cleanVObject(VObject * o);
+ LIBICAL_VCAL_EXPORT void cleanVObjects(VObject * list);
+
+ LIBICAL_VCAL_EXPORT const char *lookupProp(const char *str);
+ LIBICAL_VCAL_EXPORT const char *lookupProp_(const char *str);
+
+ LIBICAL_VCAL_EXPORT wchar_t *fakeUnicode(const char *ps, size_t * bytes);
+ LIBICAL_VCAL_EXPORT int uStrLen(const wchar_t * u);
+ LIBICAL_VCAL_EXPORT char *fakeCString(const wchar_t * u);
+
+ LIBICAL_VCAL_EXPORT void printVObjectToFile(char *fname, VObject * o);
+ LIBICAL_VCAL_EXPORT void printVObjectsToFile(char *fname, VObject * list);
+ LIBICAL_VCAL_EXPORT void writeVObjectToFile(char *fname, VObject * o);
+ LIBICAL_VCAL_EXPORT void writeVObjectsToFile(char *fname, VObject * list);
+
+ LIBICAL_VCAL_EXPORT int vObjectValueType(VObject * o);
/* return type of vObjectValueType: */
#define VCVT_NOVALUE 0
- /* if the VObject has no value associated with it. */
+ /* if the VObject has no value associated with it. */
#define VCVT_STRINGZ 1
- /* if the VObject has value set by setVObjectStringZValue. */
+ /* if the VObject has value set by setVObjectStringZValue. */
#define VCVT_USTRINGZ 2
- /* if the VObject has value set by setVObjectUStringZValue. */
+ /* if the VObject has value set by setVObjectUStringZValue. */
#define VCVT_UINT 3
- /* if the VObject has value set by setVObjectIntegerValue. */
+ /* if the VObject has value set by setVObjectIntegerValue. */
#define VCVT_ULONG 4
- /* if the VObject has value set by setVObjectLongValue. */
+ /* if the VObject has value set by setVObjectLongValue. */
#define VCVT_RAW 5
- /* if the VObject has value set by setVObjectAnyValue. */
+ /* if the VObject has value set by setVObjectAnyValue. */
#define VCVT_VOBJECT 6
- /* if the VObject has value set by setVObjectVObjectValue. */
+ /* if the VObject has value set by setVObjectVObjectValue. */
-extern const char** fieldedProp;
+ extern const char **fieldedProp;
/* NOTE regarding printVObject and writeVObject
@@ -353,12 +352,12 @@ your build directly then you may find them a more convenient API
and you can go ahead and use them. If you try to use them with
the DLL LIB you will get a link error.
*/
-extern void printVObject(FILE *fp,VObject *o);
-extern void writeVObject(FILE *fp, VObject *o);
-
+ extern void printVObject(FILE * fp, VObject * o);
+ extern void writeVObject(FILE * fp, VObject * o);
#if defined(__CPLUSPLUS__) || defined(__cplusplus)
}
+
#endif
#endif /* VOBJECT_H */