00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 #ifndef __VOBJECT_H__
00079 #define __VOBJECT_H__ 1
00080
00081
00082 #include "port.h"
00083 #include <stdlib.h>
00084 #include <stdio.h>
00085
00086 #if defined(__CPLUSPLUS__) || defined(__cplusplus)
00087 extern "C" {
00088 #endif
00089
00090
00091 #define VC7bitProp "7BIT"
00092 #define VC8bitProp "8BIT"
00093 #define VCAAlarmProp "AALARM"
00094 #define VCAdditionalNamesProp "ADDN"
00095 #define VCAdrProp "ADR"
00096 #define VCAgentProp "AGENT"
00097 #define VCAIFFProp "AIFF"
00098 #define VCAOLProp "AOL"
00099 #define VCAppleLinkProp "APPLELINK"
00100 #define VCAttachProp "ATTACH"
00101 #define VCAttendeeProp "ATTENDEE"
00102 #define VCATTMailProp "ATTMAIL"
00103 #define VCAudioContentProp "AUDIOCONTENT"
00104 #define VCAVIProp "AVI"
00105 #define VCBase64Prop "BASE64"
00106 #define VCBBSProp "BBS"
00107 #define VCBirthDateProp "BDAY"
00108 #define VCBMPProp "BMP"
00109 #define VCBodyProp "BODY"
00110 #define VCBusinessRoleProp "ROLE"
00111 #define VCCalProp "VCALENDAR"
00112 #define VCCaptionProp "CAP"
00113 #define VCCardProp "VCARD"
00114 #define VCCarProp "CAR"
00115 #define VCCategoriesProp "CATEGORIES"
00116 #define VCCellularProp "CELL"
00117 #define VCCGMProp "CGM"
00118 #define VCCharSetProp "CS"
00119 #define VCCIDProp "CID"
00120 #define VCCISProp "CIS"
00121 #define VCCityProp "L"
00122 #define VCClassProp "CLASS"
00123 #define VCCommentProp "NOTE"
00124 #define VCCompletedProp "COMPLETED"
00125 #define VCContentIDProp "CONTENT-ID"
00126 #define VCCountryNameProp "C"
00127 #define VCDAlarmProp "DALARM"
00128 #define VCDataSizeProp "DATASIZE"
00129 #define VCDayLightProp "DAYLIGHT"
00130 #define VCDCreatedProp "DCREATED"
00131 #define VCDeliveryLabelProp "LABEL"
00132 #define VCDescriptionProp "DESCRIPTION"
00133 #define VCDIBProp "DIB"
00134 #define VCDisplayStringProp "DISPLAYSTRING"
00135 #define VCDomesticProp "DOM"
00136 #define VCDTendProp "DTEND"
00137 #define VCDTstartProp "DTSTART"
00138 #define VCDueProp "DUE"
00139 #define VCEmailAddressProp "EMAIL"
00140 #define VCEncodingProp "ENCODING"
00141 #define VCEndProp "END"
00142 #define VCEventProp "VEVENT"
00143 #define VCEWorldProp "EWORLD"
00144 #define VCExNumProp "EXNUM"
00145 #define VCExDateProp "EXDATE"
00146 #define VCExpectProp "EXPECT"
00147 #define VCExtAddressProp "EXT ADD"
00148 #define VCFamilyNameProp "F"
00149 #define VCFaxProp "FAX"
00150 #define VCFullNameProp "FN"
00151 #define VCGeoProp "GEO"
00152 #define VCGeoLocationProp "GEO"
00153 #define VCGIFProp "GIF"
00154 #define VCGivenNameProp "G"
00155 #define VCGroupingProp "Grouping"
00156 #define VCHomeProp "HOME"
00157 #define VCIBMMailProp "IBMMail"
00158 #define VCInlineProp "INLINE"
00159 #define VCInternationalProp "INTL"
00160 #define VCInternetProp "INTERNET"
00161 #define VCISDNProp "ISDN"
00162 #define VCJPEGProp "JPEG"
00163 #define VCLanguageProp "LANG"
00164 #define VCLastModifiedProp "LAST-MODIFIED"
00165 #define VCLastRevisedProp "REV"
00166 #define VCLocationProp "LOCATION"
00167 #define VCLogoProp "LOGO"
00168 #define VCMailerProp "MAILER"
00169 #define VCMAlarmProp "MALARM"
00170 #define VCMCIMailProp "MCIMAIL"
00171 #define VCMessageProp "MSG"
00172 #define VCMETProp "MET"
00173 #define VCModemProp "MODEM"
00174 #define VCMPEG2Prop "MPEG2"
00175 #define VCMPEGProp "MPEG"
00176 #define VCMSNProp "MSN"
00177 #define VCNamePrefixesProp "NPRE"
00178 #define VCNameProp "N"
00179 #define VCNameSuffixesProp "NSUF"
00180 #define VCNoteProp "NOTE"
00181 #define VCOrgNameProp "ORGNAME"
00182 #define VCOrgProp "ORG"
00183 #define VCOrgUnit2Prop "OUN2"
00184 #define VCOrgUnit3Prop "OUN3"
00185 #define VCOrgUnit4Prop "OUN4"
00186 #define VCOrgUnitProp "OUN"
00187 #define VCPagerProp "PAGER"
00188 #define VCPAlarmProp "PALARM"
00189 #define VCParcelProp "PARCEL"
00190 #define VCPartProp "PART"
00191 #define VCPCMProp "PCM"
00192 #define VCPDFProp "PDF"
00193 #define VCPGPProp "PGP"
00194 #define VCPhotoProp "PHOTO"
00195 #define VCPICTProp "PICT"
00196 #define VCPMBProp "PMB"
00197 #define VCPostalBoxProp "BOX"
00198 #define VCPostalCodeProp "PC"
00199 #define VCPostalProp "POSTAL"
00200 #define VCPowerShareProp "POWERSHARE"
00201 #define VCPreferredProp "PREF"
00202 #define VCPriorityProp "PRIORITY"
00203 #define VCProcedureNameProp "PROCEDURENAME"
00204 #define VCProdIdProp "PRODID"
00205 #define VCProdigyProp "PRODIGY"
00206 #define VCPronunciationProp "SOUND"
00207 #define VCPSProp "PS"
00208 #define VCPublicKeyProp "KEY"
00209 #define VCQPProp "QP"
00210 #define VCQuickTimeProp "QTIME"
00211 #define VCQuotedPrintableProp "QUOTED-PRINTABLE"
00212 #define VCRDateProp "RDATE"
00213 #define VCRegionProp "R"
00214 #define VCRelatedToProp "RELATED-TO"
00215 #define VCRepeatCountProp "REPEATCOUNT"
00216 #define VCResourcesProp "RESOURCES"
00217 #define VCRNumProp "RNUM"
00218 #define VCRoleProp "ROLE"
00219 #define VCRRuleProp "RRULE"
00220 #define VCRSVPProp "RSVP"
00221 #define VCRunTimeProp "RUNTIME"
00222 #define VCSequenceProp "SEQUENCE"
00223 #define VCSnoozeTimeProp "SNOOZETIME"
00224 #define VCStartProp "START"
00225 #define VCStatusProp "STATUS"
00226 #define VCStreetAddressProp "STREET"
00227 #define VCSubTypeProp "SUBTYPE"
00228 #define VCSummaryProp "SUMMARY"
00229 #define VCTelephoneProp "TEL"
00230 #define VCTIFFProp "TIFF"
00231 #define VCTimeZoneProp "TZ"
00232 #define VCTitleProp "TITLE"
00233 #define VCTLXProp "TLX"
00234 #define VCTodoProp "VTODO"
00235 #define VCTranspProp "TRANSP"
00236 #define VCUniqueStringProp "UID"
00237 #define VCURLProp "URL"
00238 #define VCURLValueProp "URLVAL"
00239 #define VCValueProp "VALUE"
00240 #define VCVersionProp "VERSION"
00241 #define VCVideoProp "VIDEO"
00242 #define VCVoiceProp "VOICE"
00243 #define VCWAVEProp "WAVE"
00244 #define VCWMFProp "WMF"
00245 #define VCWorkProp "WORK"
00246 #define VCX400Prop "X400"
00247 #define VCX509Prop "X509"
00248 #define VCXRuleProp "XRULE"
00249
00250
00251 #define KPilotIdProp "X-PILOTID"
00252 #define KPilotStatusProp "X-PILOTSTAT"
00253
00254
00255 #define ICOrganizerProp "X-ORGANIZER"
00256 #define ICMethodProp "X-METHOD"
00257 #define ICRequestStatusProp "X-REQUEST-STATUS"
00258
00259 typedef struct VObject VObject;
00260
00261 typedef union ValueItem {
00262 const char *strs;
00263 const wchar_t *ustrs;
00264 unsigned int i;
00265 unsigned long l;
00266 void *any;
00267 VObject *vobj;
00268 } ValueItem;
00269
00270 struct VObject {
00271 VObject *next;
00272 const char *id;
00273 VObject *prop;
00274 unsigned short valType;
00275 ValueItem val;
00276 };
00277
00278 typedef struct StrItem StrItem;
00279
00280 struct StrItem {
00281 StrItem *next;
00282 const char *s;
00283 unsigned int refCnt;
00284 };
00285
00286 typedef struct VObjectIterator {
00287 VObject* start;
00288 VObject* next;
00289 } VObjectIterator;
00290
00291 extern VObject* newVObject(const char *id);
00292 extern void deleteVObject(VObject *p);
00293 extern char* dupStr(const char *s, unsigned int size);
00294 extern void deleteStr(const char *p);
00295 extern void unUseStr(const char *s);
00296
00297 extern void setVObjectName(VObject *o, const char* id);
00298 extern void setVObjectStringZValue(VObject *o, const char *s);
00299 extern void setVObjectStringZValue_(VObject *o, const char *s);
00300 extern void setVObjectUStringZValue(VObject *o, const wchar_t *s);
00301 extern void setVObjectUStringZValue_(VObject *o, const wchar_t *s);
00302 extern void setVObjectIntegerValue(VObject *o, unsigned int i);
00303 extern void setVObjectLongValue(VObject *o, unsigned long l);
00304 extern void setVObjectAnyValue(VObject *o, void *t);
00305 extern VObject* setValueWithSize(VObject *prop, void *val, unsigned int size);
00306 extern VObject* setValueWithSize_(VObject *prop, void *val, unsigned int size);
00307
00308 extern const char* vObjectName(VObject *o);
00309 extern const char* vObjectStringZValue(VObject *o);
00310 extern const wchar_t* vObjectUStringZValue(VObject *o);
00311 extern unsigned int vObjectIntegerValue(VObject *o);
00312 extern unsigned long vObjectLongValue(VObject *o);
00313 extern void* vObjectAnyValue(VObject *o);
00314 extern VObject* vObjectVObjectValue(VObject *o);
00315 extern void setVObjectVObjectValue(VObject *o, VObject *p);
00316
00317 extern VObject* addVObjectProp(VObject *o, VObject *p);
00318 extern VObject* addProp(VObject *o, const char *id);
00319 extern VObject* addProp_(VObject *o, const char *id);
00320 extern VObject* addPropValue(VObject *o, const char *p, const char *v);
00321 extern VObject* addPropSizedValue_(VObject *o, const char *p, const char *v, unsigned int size);
00322 extern VObject* addPropSizedValue(VObject *o, const char *p, const char *v, unsigned int size);
00323 extern VObject* addGroup(VObject *o, const char *g);
00324 extern void addList(VObject **o, VObject *p);
00325
00326 extern VObject* isAPropertyOf(VObject *o, const char *id);
00327
00328 extern VObject* nextVObjectInList(VObject *o);
00329 extern void initPropIterator(VObjectIterator *i, VObject *o);
00330 extern int moreIteration(VObjectIterator *i);
00331 extern VObject* nextVObject(VObjectIterator *i);
00332
00333 extern char* writeMemVObject(char *s, int *len, VObject *o);
00334 extern char* writeMemVObjects(char *s, int *len, VObject *list);
00335
00336 extern const char* lookupStr(const char *s);
00337 extern void cleanStrTbl();
00338
00339 extern void cleanVObject(VObject *o);
00340 extern void cleanVObjects(VObject *list);
00341
00342 extern const char* lookupProp(const char* str);
00343 extern const char* lookupProp_(const char* str);
00344
00345 extern wchar_t* fakeUnicode(const char *ps, int *bytes);
00346 extern int uStrLen(const wchar_t *u);
00347 extern char* fakeCString(const wchar_t *u);
00348
00349 extern void printVObjectToFile(char *fname,VObject *o);
00350 extern void printVObjectsToFile(char *fname,VObject *list);
00351 extern void writeVObjectToFile(char *fname, VObject *o);
00352 extern void writeVObjectsToFile(char *fname, VObject *list);
00353
00354 extern int vObjectValueType(VObject *o);
00355
00356
00357 #define VCVT_NOVALUE 0
00358
00359 #define VCVT_STRINGZ 1
00360
00361 #define VCVT_USTRINGZ 2
00362
00363 #define VCVT_UINT 3
00364
00365 #define VCVT_ULONG 4
00366
00367 #define VCVT_RAW 5
00368
00369 #define VCVT_VOBJECT 6
00370
00371
00372 extern const char** fieldedProp;
00373
00374 extern void printVObject(FILE *fp,VObject *o);
00375 extern void writeVObject(FILE *fp, VObject *o);
00376
00377
00378 #if defined(__CPLUSPLUS__) || defined(__cplusplus)
00379 }
00380 #endif
00381
00382 #endif
00383
00384