diff options
Diffstat (limited to 'libical/src/libicalvcal')
-rw-r--r-- | libical/src/libicalvcal/.cvsignore | 15 | ||||
-rw-r--r-- | libical/src/libicalvcal/Makefile.am | 15 | ||||
-rw-r--r-- | libical/src/libicalvcal/icalvcal.c | 67 | ||||
-rw-r--r-- | libical/src/libicalvcal/icalvcal.h | 2 | ||||
-rw-r--r-- | libical/src/libicalvcal/vcc.y | 9 | ||||
-rw-r--r-- | libical/src/libicalvcal/vobject.c | 12 |
6 files changed, 53 insertions, 67 deletions
diff --git a/libical/src/libicalvcal/.cvsignore b/libical/src/libicalvcal/.cvsignore index bbc8ba00d1..533caa2f3d 100644 --- a/libical/src/libicalvcal/.cvsignore +++ b/libical/src/libicalvcal/.cvsignore @@ -1,5 +1,12 @@ -Makefile -.deps -.libs -*.lo *.la +*.lo +.libs +.deps +Makefile +Makefile.in +libtool +ltconfig +ltmain.sh +stamp-h +stamp-h.in +vcc.c
\ No newline at end of file diff --git a/libical/src/libicalvcal/Makefile.am b/libical/src/libicalvcal/Makefile.am index 414265181c..f9d8dd39d9 100644 --- a/libical/src/libicalvcal/Makefile.am +++ b/libical/src/libicalvcal/Makefile.am @@ -8,27 +8,20 @@ INCLUDES = \ libicalvcal_evolution_la_LDFLAGS = -version-info 0:0:0 -if DEV -libicalvcal_evolution_la_DEVSOURCES = vcc.y -else -libicalvcal_evolution_la_DEVSOURCES = vcc.c -endif - - libicalvcal_evolution_la_SOURCES = \ icalvcal.h \ icalvcal.c \ port.h \ vcc.h \ + vcc.y \ vobject.h \ vobject.c \ vcaltmp.h \ - vcaltmp.c \ - $(libicalvcal_evolution_la_DEVSOURCES) + vcaltmp.c -libicalvcal_evolutionincludedir = $(privincludedir)/libical +#libicalvcalincludedir = $(privincludedir)/libicalvcal -#libicalvcal_evolutioninclude_HEADERS = \ +#libicalvcalinclude_HEADERS = \ # icalvcal.h \ # port.h \ # vcc.h \ diff --git a/libical/src/libicalvcal/icalvcal.c b/libical/src/libicalvcal/icalvcal.c index f5d417cb6d..9ab3fa899e 100644 --- a/libical/src/libicalvcal/icalvcal.c +++ b/libical/src/libicalvcal/icalvcal.c @@ -42,11 +42,6 @@ #include "icalvcal.h" #include <string.h> -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif - enum datatype { COMPONENT, PROPERTY, @@ -67,7 +62,6 @@ int weekday_codes[] = { ICAL_SATURDAY_WEEKDAY }; - struct conversion_table_struct { char* vcalname; enum datatype type; @@ -155,10 +149,10 @@ static void convert_floating_time_to_utc (struct icaltimetype *itt) } -static void icalvcal_traverse_objects(VObject *object, - icalcomponent* last_comp, - icalproperty* last_prop, - icalvcal_defaults *defaults) +static int icalvcal_traverse_objects(VObject *object, + icalcomponent* last_comp, + icalproperty* last_prop, + icalvcal_defaults *defaults) { VObjectIterator iterator; char* name = "[No Name]"; @@ -167,8 +161,7 @@ static void icalvcal_traverse_objects(VObject *object, if ( vObjectName(object)== 0){ printf("ERROR, object has no name"); - assert(0); - return; + return 0; } name = (char*)vObjectName(object); @@ -191,8 +184,7 @@ static void icalvcal_traverse_objects(VObject *object, icalproperty_set_x_name(prop,name); icalcomponent_add_property(last_comp,prop); } else { - assert(0); - return; + return 0; } } else { @@ -211,8 +203,9 @@ static void icalvcal_traverse_objects(VObject *object, object, last_comp, defaults)); if (subc) { - icalcomponent_add_component(last_comp,subc); - } + icalcomponent_add_component(last_comp,subc); + } + break; } @@ -227,7 +220,7 @@ static void icalvcal_traverse_objects(VObject *object, object, last_comp, defaults)); if (prop) - icalcomponent_add_property(last_comp,prop); + icalcomponent_add_property(last_comp,prop); last_prop = prop; @@ -267,7 +260,6 @@ static void icalvcal_traverse_objects(VObject *object, /* Do Nothing. */ break; } - } } @@ -282,12 +274,16 @@ static void icalvcal_traverse_objects(VObject *object, should use it as the 'last_comp' */ if(subc!=0){ - icalvcal_traverse_objects(eachProp,subc,last_prop,defaults); + if (!icalvcal_traverse_objects(eachProp,subc,last_prop,defaults)) + return 0; } else { - icalvcal_traverse_objects(eachProp,last_comp,last_prop,defaults); + if (!icalvcal_traverse_objects(eachProp,last_comp,last_prop,defaults)) + return 0; } } + + return 1; } icalcomponent* icalvcal_convert_with_defaults (VObject *object, @@ -313,7 +309,8 @@ icalcomponent* icalvcal_convert_with_defaults (VObject *object, printf ("===========================================\n"); #endif - icalvcal_traverse_objects(object,container,0,defaults); + if (!icalvcal_traverse_objects(object,container,0,defaults)) + return 0; /* HACK. I am using the extra 'container' component because I am lazy. I know there is a way to get rid of it, but I did not care @@ -449,7 +446,7 @@ static int get_alarm_properties (icalcomponent *comp, VObject *object, icalcomponent_add_property (comp, trigger_prop); } - + } else if (!strcmp (name, VCSnoozeTimeProp)) { struct icaldurationtype d; @@ -458,7 +455,7 @@ static int get_alarm_properties (icalcomponent *comp, VObject *object, which we don't handle at present. Though it is unlikely they will be used as a snooze time between repeated alarms! */ d = icaldurationtype_from_string (s); - + duration_prop = icalproperty_new_duration (d); icalcomponent_add_property (comp, duration_prop); @@ -534,7 +531,7 @@ static int get_alarm_properties (icalcomponent *comp, VObject *object, if (!summary_prop) { summary_prop = icalproperty_new_summary (s); icalcomponent_add_property (comp, summary_prop); - } + } } if (free_string) @@ -695,23 +692,23 @@ void* alarm_comp(int icaltype, VObject *o, icalcomponent *comp, int is_valid_alarm; icalcomponent* c = icalcomponent_new(ICAL_VALARM_COMPONENT); - + is_valid_alarm = get_alarm_properties (c, o, icaltype, defaults); if (is_valid_alarm) { - return (void*)c; + return (void*)c; } else { icalcomponent_free (c); return NULL; } } - /* These #defines indicate conversion routines that are not defined yet. */ #define parameter 0 #define rsvp_parameter 0 + void* transp_prop(int icaltype, VObject *object, icalcomponent *comp, icalvcal_defaults *defaults) { @@ -721,12 +718,11 @@ void* transp_prop(int icaltype, VObject *object, icalcomponent *comp, s = get_string_value (object, &free_string); - /* In vCalendar "0" means opaque, "1" means transparent, and >1 is implementation-specific. So we just check for "1" and output TRANSPARENT. For anything else, the default OPAQUE will be used. */ if (!strcmp (s, "1")) { - prop = icalproperty_new_transp (ICAL_TRANSP_TRANSPARENT); + prop = icalproperty_new_transp ("TRANSPARENT"); } if (free_string) @@ -735,6 +731,7 @@ void* transp_prop(int icaltype, VObject *object, icalcomponent *comp, return (void*)prop; } + void* sequence_prop(int icaltype, VObject *object, icalcomponent *comp, icalvcal_defaults *defaults) { @@ -1016,8 +1013,8 @@ static char* rrule_parse_weekly_days (char *s, e = s + 2; if (*e == ' ' || *e == '\t' || *e == '\0') { found_day = day; - break; - } + break; + } } } @@ -1070,8 +1067,8 @@ static char* rrule_parse_monthly_days (char *s, } else if (*e == '-') { e++; month_day = -month_day; + } } - } /* Check the next char is whitespace or the end of the string. */ if (*e != ' ' && *e != '\t' && *e != '\0') @@ -1391,10 +1388,9 @@ void* dc_prop(int icaltype, VObject *object, icalcomponent *comp, icalproperty *prop; icalvalue *value; icalvalue_kind value_kind; - char *s,*t=0; + char *s; int free_string; - prop = icalproperty_new(kind); value_kind = icalenum_property_kind_to_value_kind (icalproperty_isa(prop)); @@ -1422,6 +1418,7 @@ struct conversion_table_struct conversion_table[] = {VCCalProp, COMPONENT, comp, ICAL_VCALENDAR_COMPONENT}, {VCTodoProp, COMPONENT, comp, ICAL_VTODO_COMPONENT}, {VCEventProp, COMPONENT, comp, ICAL_VEVENT_COMPONENT}, + {VCAAlarmProp, COMPONENT, alarm_comp, ICAL_XAUDIOALARM_COMPONENT}, {VCDAlarmProp, COMPONENT, alarm_comp, ICAL_XDISPLAYALARM_COMPONENT}, {VCMAlarmProp, COMPONENT, alarm_comp, ICAL_XEMAILALARM_COMPONENT}, @@ -1481,6 +1478,7 @@ struct conversion_table_struct conversion_table[] = {VCSnoozeTimeProp, IGNORE,0, 0}, {VCRepeatCountProp, IGNORE,0, 0}, {VCValueProp, IGNORE,0, 0}, +{VCAudioContentProp, IGNORE,0, 0}, {VCProcedureNameProp, IGNORE,0, 0}, {VCDisplayStringProp, IGNORE,0, 0}, {VCEmailAddressProp, IGNORE,0, 0}, @@ -1497,7 +1495,6 @@ struct conversion_table_struct conversion_table[] = {VCAppleLinkProp, UNSUPPORTED,0, 0}, {VCAttachProp, UNSUPPORTED,0, 0}, {VCATTMailProp, UNSUPPORTED,0, 0}, -{VCAudioContentProp, UNSUPPORTED,0, 0}, {VCAVIProp, UNSUPPORTED,0, 0}, {VCBase64Prop, UNSUPPORTED,0, 0}, {VCBBSProp, UNSUPPORTED,0, 0}, diff --git a/libical/src/libicalvcal/icalvcal.h b/libical/src/libicalvcal/icalvcal.h index 67119ce042..96e94b9f2e 100644 --- a/libical/src/libicalvcal/icalvcal.h +++ b/libical/src/libicalvcal/icalvcal.h @@ -44,10 +44,10 @@ struct _icalvcal_defaults { icalcomponent* icalvcal_convert(VObject *object); - icalcomponent* icalvcal_convert_with_defaults (VObject *object, icalvcal_defaults *defaults); + #endif /* !ICALVCAL_H */ diff --git a/libical/src/libicalvcal/vcc.y b/libical/src/libicalvcal/vcc.y index 245774f37e..5338f563a6 100644 --- a/libical/src/libicalvcal/vcc.y +++ b/libical/src/libicalvcal/vcc.y @@ -56,11 +56,6 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. #define DBG_(x) #endif -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif - /**** External Functions ****/ /* assign local name to parser variables and functions so that @@ -424,7 +419,7 @@ static void enterValues(const char *value) using ';' to separate the values. */ if (vObjectUStringZValue(curProp)) { p1 = fakeCString(vObjectUStringZValue(curProp)); - p2 = malloc((strlen(p1)+strlen(value)+1)); + p2 = malloc((strlen(p1)+strlen(value)+2)); strcpy(p2, p1); deleteStr(p1); @@ -437,7 +432,7 @@ static void enterValues(const char *value) setVObjectUStringZValue_(curProp,fakeUnicode(p2,0)); deleteStr(p2); } else { - setVObjectUStringZValue_(curProp,fakeUnicode(value,0)); + setVObjectUStringZValue_(curProp,fakeUnicode(value,0)); } } } diff --git a/libical/src/libicalvcal/vobject.c b/libical/src/libicalvcal/vobject.c index 616581ffa8..b17830eb72 100644 --- a/libical/src/libicalvcal/vobject.c +++ b/libical/src/libicalvcal/vobject.c @@ -42,11 +42,6 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. * vobject, and convert a vobject into its textual representation. */ -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif - #include "vobject.h" #include <stdlib.h> #include <string.h> @@ -1249,10 +1244,9 @@ static void writeGroup(OFile *fp, VObject *o) char buf2[256]; strcpy(buf1,NAME_OF(o)); while ((o=isAPropertyOf(o,VCGroupingProp)) != 0) { - strncpy(buf2,STRINGZ_VALUE_OF(o),sizeof(buf2)); - buf2[sizeof(buf2)-1] = '\0'; - strncat(buf2,".",sizeof(buf2)-strlen(buf2)-1); - strncat(buf2,buf1,sizeof(buf2)-strlen(buf2)-1); + strcpy(buf2,STRINGZ_VALUE_OF(o)); + strcat(buf2,"."); + strcat(buf2,buf1); strcpy(buf1,buf2); } appendsOFile(fp,buf1); |