g_type_init() was deprecated in glib 2.36, so made it conditional.
[opensync/evolution2-cdf.git] / src / evolution2_sync.h
blobd59847ed292e1266d5defd3d041cca22ebdba853
1 #ifndef EVO2_SYNC_H
2 #define EVO2_SYNC_H
4 //
5 // Some versions of libical use a ring buffer for the following
6 // functions, for which the library manages memory. Somewhere along
7 // the line, this was fixed so that the application was responsible
8 // for freeing the strings returned by these functions. A warning
9 // was added to the header that would display if HANDLE_LIBICAL_MEMORY
10 // was not defined.
12 // Even newer versions of evolution-data-server, which this plugin
13 // depends on, get rid of some of these functions, while newer
14 // versions of libical add _r variants that implement the
15 // application-free functinality.
17 // Since this plugin does not use these functions, we disable the
18 // warning by defining HANDLE_LIBICAL_MEMORY, then include the
19 // headers, and then purposely break the troublesome functions
20 // so that if a programmer tries to use them later on, he'll know
21 // to handle them with care.
23 #define HANDLE_LIBICAL_MEMORY 1
25 #include <opensync/opensync.h>
27 #include <libecal/e-cal.h>
28 #include <libebook/e-book.h>
29 #include <libedataserver/e-data-server-util.h>
31 #define icalreqstattype_as_string() See_evolution2_sync_h_for_note
32 #define icalproperty_as_ical_string() See_evolution2_sync_h_for_note
33 #define icalproperty_get_parameter_as_string() See_evolution2_sync_h_for_note
34 #define icalproperty_get_value_as_string() See_evolution2_sync_h_for_note
35 #define icallangbind_property_eval_string() See_evolution2_sync_h_for_note
36 #define icalperiodtype_as_ical_string() See_evolution2_sync_h_for_note
37 #define icaltime_as_ical_string() See_evolution2_sync_h_for_note
38 #define icalvalue_as_ical_string() See_evolution2_sync_h_for_note
39 #define icalcomponent_as_ical_string() See_evolution2_sync_h_for_note
40 #define e_cal_component_get_recurid_as_string() See_evolution2_sync_h_for_note
43 #define STR_URI_KEY "uri_"
46 typedef struct OSyncEvoCalendar {
47 char *uri_key;
48 const char *uri;
49 const char *objtype;
50 const char *change_id;
51 ECalSourceType source_type;
52 icalcomponent_kind ical_component;
53 ECal *calendar;
54 OSyncObjTypeSink *sink;
55 OSyncObjFormat *format;
56 } OSyncEvoCalendar;
58 typedef struct OSyncEvoEnv {
59 char *change_id;
61 const char *addressbook_path;
62 EBook *addressbook;
63 OSyncObjTypeSink *contact_sink;
64 OSyncObjFormat *contact_format;
66 GList *calendars;
68 OSyncPluginInfo *pluginInfo;
69 } OSyncEvoEnv;
71 ESource *evo2_find_source(ESourceList *list, const char *uri);
73 #endif