summaryrefslogtreecommitdiffabout
path: root/libkcal/versit/vobject.h
Side-by-side diff
Diffstat (limited to 'libkcal/versit/vobject.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/versit/vobject.h173
1 files changed, 79 insertions, 94 deletions
diff --git a/libkcal/versit/vobject.h b/libkcal/versit/vobject.h
index 0ec8b31..85c299e 100644
--- a/libkcal/versit/vobject.h
+++ b/libkcal/versit/vobject.h
@@ -142,7 +142,7 @@ extern "C" {
#define VCEventProp "VEVENT"
#define VCEWorldProp "EWORLD"
#define VCExNumProp "EXNUM"
-#define VCExDateProp "EXDATE"
+#define VCExpDateProp "EXDATE"
#define VCExpectProp "EXPECT"
#define VCExtAddressProp "EXT ADD"
#define VCFamilyNameProp "F"
@@ -247,111 +247,85 @@ extern "C" {
#define VCX509Prop "X509"
#define VCXRuleProp "XRULE"
-/* extensions for KOrganizer / KPilot */
-#define KPilotIdProp "X-PILOTID"
-#define KPilotStatusProp "X-PILOTSTAT"
+/* Extensions */
+#define XPilotIdProp "X-PILOTID"
+#define XPilotStatusProp "X-PILOTSTAT"
/* extensions for iMIP / iTIP */
#define ICOrganizerProp "X-ORGANIZER"
#define ICMethodProp "X-METHOD"
#define ICRequestStatusProp "X-REQUEST-STATUS"
-
typedef struct VObject VObject;
-typedef union ValueItem {
- const char *strs;
- const wchar_t *ustrs;
- unsigned int i;
- unsigned long l;
- void *any;
- VObject *vobj;
- } ValueItem;
-
-struct VObject {
- VObject *next;
- const char *id;
- VObject *prop;
- unsigned short valType;
- ValueItem val;
- };
-
-typedef struct StrItem StrItem;
-
-struct StrItem {
- StrItem *next;
- const char *s;
- unsigned int refCnt;
- };
-
typedef struct VObjectIterator {
VObject* start;
VObject* next;
} VObjectIterator;
-extern VObject* newVObject(const char *id);
-extern void deleteVObject(VObject *p);
-extern char* dupStr(const char *s, unsigned int size);
-extern void deleteStr(const char *p);
-extern void unUseStr(const char *s);
-
-extern void setVObjectName(VObject *o, const char* id);
-extern void setVObjectStringZValue(VObject *o, const char *s);
-extern void setVObjectStringZValue_(VObject *o, const char *s);
-extern void setVObjectUStringZValue(VObject *o, const wchar_t *s);
-extern void setVObjectUStringZValue_(VObject *o, const wchar_t *s);
-extern void setVObjectIntegerValue(VObject *o, unsigned int i);
-extern void setVObjectLongValue(VObject *o, unsigned long l);
-extern void setVObjectAnyValue(VObject *o, void *t);
-extern VObject* setValueWithSize(VObject *prop, void *val, unsigned int size);
-extern VObject* setValueWithSize_(VObject *prop, void *val, unsigned int size);
-
-extern const char* vObjectName(VObject *o);
-extern const char* vObjectStringZValue(VObject *o);
-extern const wchar_t* vObjectUStringZValue(VObject *o);
-extern unsigned int vObjectIntegerValue(VObject *o);
-extern unsigned long vObjectLongValue(VObject *o);
-extern void* vObjectAnyValue(VObject *o);
-extern VObject* vObjectVObjectValue(VObject *o);
-extern void setVObjectVObjectValue(VObject *o, VObject *p);
-
-extern VObject* addVObjectProp(VObject *o, VObject *p);
-extern VObject* addProp(VObject *o, const char *id);
-extern VObject* addProp_(VObject *o, const char *id);
-extern VObject* addPropValue(VObject *o, const char *p, const char *v);
-extern VObject* addPropSizedValue_(VObject *o, const char *p, const char *v, unsigned int size);
-extern VObject* addPropSizedValue(VObject *o, const char *p, const char *v, unsigned int size);
-extern VObject* addGroup(VObject *o, const char *g);
-extern void addList(VObject **o, VObject *p);
-
-extern VObject* isAPropertyOf(VObject *o, const char *id);
-
-extern VObject* nextVObjectInList(VObject *o);
-extern void initPropIterator(VObjectIterator *i, VObject *o);
-extern int moreIteration(VObjectIterator *i);
-extern VObject* nextVObject(VObjectIterator *i);
-
-extern char* writeMemVObject(char *s, int *len, VObject *o);
-extern char* writeMemVObjects(char *s, int *len, VObject *list);
-
-extern const char* lookupStr(const char *s);
-extern void cleanStrTbl();
-
-extern void cleanVObject(VObject *o);
-extern void cleanVObjects(VObject *list);
-
-extern const char* lookupProp(const char* str);
-extern const char* lookupProp_(const char* str);
-
-extern wchar_t* fakeUnicode(const char *ps, int *bytes);
-extern int uStrLen(const wchar_t *u);
-extern char* fakeCString(const wchar_t *u);
-
-extern void printVObjectToFile(char *fname,VObject *o);
-extern void printVObjectsToFile(char *fname,VObject *list);
-extern void writeVObjectToFile(char *fname, VObject *o);
-extern void writeVObjectsToFile(char *fname, VObject *list);
-
-extern int vObjectValueType(VObject *o);
+extern DLLEXPORT(VObject*) newVObject(const char *id);
+extern DLLEXPORT(void) deleteVObject(VObject *p);
+extern DLLEXPORT(char*) dupStr(const char *s, unsigned int 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, int *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);
/* return type of vObjectValueType: */
#define VCVT_NOVALUE 0
@@ -371,6 +345,17 @@ extern int vObjectValueType(VObject *o);
extern const char** fieldedProp;
+/* NOTE regarding printVObject and writeVObject
+
+The functions below are not exported from the DLL because they
+take a FILE* as a parameter, which cannot be passed across a DLL
+interface (at least that is my experience). Instead you can use
+their companion functions which take file names or pointers
+to memory. However, if you are linking this code into
+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);