From c2e1263462c84bfae59a3f296758296ac3a10a67 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 21 Feb 2000 13:19:28 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r1879, which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=1880 --- libical/CHANGES | 12 ++++++-- libical/TODO | 14 +++++---- libical/design-data/status.txt | 36 +++++++++++----------- libical/src/libical/ical.h | 2 ++ libical/src/libical/icalitip.y | 4 +-- libical/src/libical/icalparameter.c | 4 +++ libical/src/libical/icalproperty.c | 1 + libical/src/libical/icalvalue.c | 60 +++++++++++++++++++++++++++++++++++-- libical/src/libicalss/icalcluster.c | 1 - libical/src/libicalss/icalstore.c | 6 ++-- libical/src/test/regression.c | 40 ++++++++++++++++++++----- 11 files changed, 141 insertions(+), 39 deletions(-) diff --git a/libical/CHANGES b/libical/CHANGES index 953514a9e4..c4e550cb9e 100644 --- a/libical/CHANGES +++ b/libical/CHANGES @@ -1,6 +1,14 @@ +Version 0.15a 17 Feb 00 +--------------------- + +Fixed icalvalue_set_text to convert escaped characters into the proper +values. + +Other minor code tweaks. -Version 0.15 ------------- + +Version 0.15 7 Feb 00 +--------------------- Split the storage classess ( icalstore, icalcluster, icalcalendar ) into a seperate library, libicalss diff --git a/libical/TODO b/libical/TODO index 07fee66d39..feb723d244 100644 --- a/libical/TODO +++ b/libical/TODO @@ -1,5 +1,5 @@ -TODOs for libical-0.14 +TODOs for libical-0.16 --------------------- libical treats properties with multiple values incorrecty -- it always @@ -10,9 +10,6 @@ Some TEXT valued properties, like METHOD, have a limited set of valid values. The code should check that the values of these properites are valid. ( Although METHOD now uses enums, and is not really TEXT valued ) -For TEXT values properties with limited set of valid values, add -routines to use enums to set the values. - Finish implementing values ATTACH/BINARY content_type @@ -25,4 +22,11 @@ Error Handling Dates and times: the parser will accept many illegal date time values -RECUR values ignore integers in BYDAY clauses \ No newline at end of file +RECUR values ignore integers in BYDAY clauses, ie 'FREQ=MONTHLY;BYDAY=-1SU' + +REQUEST-STATUS propery is broken. The parser treats the value as +normal text, backslashing the ';' seperators. + +Some of the X-LIC-ERROR types overlap with REQUEST-STATUS +values. There should be a routine to turn property, parameter and +value parse errors into REQUEST-STATUS diff --git a/libical/design-data/status.txt b/libical/design-data/status.txt index c3a4c2580d..d3f2f1864d 100644 --- a/libical/design-data/status.txt +++ b/libical/design-data/status.txt @@ -1,32 +1,32 @@ 2.0 Success. -2.1 Success but fallback taken on one or more property values. -2.2 Success, invalid property ignored. -2.3 Success, invalid property parameter ignored. -2.4 Success, unknown non- standard property ignored. -2.5 Success, unknown non standard property value ignored. -2.6 Success, invalid calendar component ignored. -2.7 Success, request forwarded to Calendar User. -2.8 Success, repeating event ignored. Scheduled as a single component. -2.9 Success, truncated end date time to date boundary. -2.10 Success, repeating VTODO ignored. Scheduled as a single VTODO. -2.11 Success, unbounded RRULE clipped at some finite number of instances +2.1 Success but fallback taken on one or more property values. +2.2 Success, invalid property ignored. +2.3 Success, invalid property parameter ignored. +2.4 Success, unknown non-standard property ignored. +2.5 Success, unknown non-standard property value ignored. +2.6 Success, invalid calendar component ignored. +2.7 Success, request forwarded to Calendar User. +2.8 Success, repeating event ignored. Scheduled as a single component. +2.9 Success, truncated end date time to date boundary. +2.10 Success, repeating VTODO ignored. Scheduled as a single VTODO. +2.11 Success, unbounded RRULE clipped at some finite number of instances 3.0 Invalid property name. 3.1 Invalid property value. 3.2 Invalid property parameter. -3.3 Invalid property parameter value. -3.4 Invalid calendar component sequence. +3.3 Invalid property parameter value. +3.4 Invalid calendar component sequence. 3.5 Invalid date or time. 3.6 Invalid rule. 3.7 Invalid Calendar User. 3.8 No authority. 3.9 Unsupported version. 3.10 Request entity too large. -3.11 Required component or property missing. -3.12 Unknown component or property found -3.13 Unsupported component or property found +3.11 Required component or property missing. +3.12 Unknown component or property found +3.13 Unsupported component or property found 3.14 Unsupported capability -4.0 Event conflict. Date/time is busy. +4.0 Event conflict. Date/time is busy. 5.0 Request MAY supported. 5.1 Service unavailable. 5.2 Invalid calendar service. -5.3 No scheduling support for user. +5.3 No scheduling support for user. diff --git a/libical/src/libical/ical.h b/libical/src/libical/ical.h index a90bb551ed..cd5ca31dd5 100644 --- a/libical/src/libical/ical.h +++ b/libical/src/libical/ical.h @@ -34,6 +34,8 @@ #include "icalparser.h" #include "icalmemory.h" #include "icalerror.h" +#include "icalrestriction.h" + #endif /* !ICAL_H */ diff --git a/libical/src/libical/icalitip.y b/libical/src/libical/icalitip.y index 7415fe2676..8e4f16b553 100644 --- a/libical/src/libical/icalitip.y +++ b/libical/src/libical/icalitip.y @@ -6,7 +6,7 @@ DESCRIPTION: - $Id: icalitip.y,v 1.1 2000/02/17 18:02:27 alves Exp $ + $Id: icalitip.y,v 1.1.1.2 2000/02/21 13:19:26 alves Exp $ $Locker: $ (C) COPYRIGHT 1999 Eric Busboom @@ -393,7 +393,7 @@ utcoffset_value: void clear_recur() -{ +{ memset(&skiplist, ICAL_RECURRENCE_ARRAY_MAX_BYTE, sizeof(skiplist)); skippos = 0; diff --git a/libical/src/libical/icalparameter.c b/libical/src/libical/icalparameter.c index ab984722d5..ff9c76f79c 100644 --- a/libical/src/libical/icalparameter.c +++ b/libical/src/libical/icalparameter.c @@ -756,6 +756,9 @@ icalparameter_as_ical_string (icalparameter* parameter) case ICAL_VALUE_TIME: { strcpy(tend,"TIME");break; } + case ICAL_VALUE_URI: { + strcpy(tend,"URI");break; + } case ICAL_VALUE_UTCOFFSET: { strcpy(tend,"UTC-OFFSET");break; } @@ -764,6 +767,7 @@ icalparameter_as_ical_string (icalparameter* parameter) strcpy(tend,impl->string);break; } default:{ + strcpy(tend,"ERROR");break; icalerror_set_errno(ICAL_BADARG_ERROR);break; } } diff --git a/libical/src/libical/icalproperty.c b/libical/src/libical/icalproperty.c index 7eb7c81111..3dd761b1f8 100644 --- a/libical/src/libical/icalproperty.c +++ b/libical/src/libical/icalproperty.c @@ -1,4 +1,5 @@ /* -*- Mode: C -*- */ + /*====================================================================== FILE: icalproperty.c CREATOR: eric 28 April 1999 diff --git a/libical/src/libical/icalvalue.c b/libical/src/libical/icalvalue.c index 81352dd247..1ed83a0c6e 100644 --- a/libical/src/libical/icalvalue.c +++ b/libical/src/libical/icalvalue.c @@ -1777,18 +1777,74 @@ void icalvalue_set_text(icalvalue* value, char* v) { struct icalvalue_impl* impl; - + char *p,*d; + icalerror_check_arg_rv( (value!=0),"value"); icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_value_type(value, ICAL_TEXT_VALUE); impl = (struct icalvalue_impl*)value; - impl->data.v_string = strdup(v); + impl->data.v_string = malloc(strlen(v)+1); if (impl->data.v_string == 0){ errno = ENOMEM; + return; + } + + for(d=impl->data.v_string,p=v; *p!=0; p++){ + + if (*p == '\\') { + p++; + + if (p == 0){ + break; + } + + switch(*p){ + case 'n': { + *d='\n';d++; + break; + } + + case '\\': { + *d='\\';d++; + break; + } + + case 't': { + *d='\n';d++; + break; + } + case 'r': { + *d='\r';d++; + break; + } + case 'b': { + *d='\b';d++; + break; + } + case 'f': { + *d='\f';d++; + break; + } + + case ';': + case ',':{ + *d=*p;d++; + break; + } + + case '"':{ + *d='\"';d++; + break; + } + } + } else { + *d=*p;d++; + } } + *d='\0'; } diff --git a/libical/src/libicalss/icalcluster.c b/libical/src/libicalss/icalcluster.c index 00e7ef0365..c0160cc6c3 100644 --- a/libical/src/libicalss/icalcluster.c +++ b/libical/src/libicalss/icalcluster.c @@ -67,7 +67,6 @@ icalerrorenum icalcluster_create_cluster(char *path) f = fopen(path,"w"); if (f == 0){ - fclose(f); icalerror_set_errno(ICAL_FILE_ERROR); return ICAL_FILE_ERROR; } diff --git a/libical/src/libicalss/icalstore.c b/libical/src/libicalss/icalstore.c index 014c9ed19b..5d1546f3b2 100644 --- a/libical/src/libicalss/icalstore.c +++ b/libical/src/libicalss/icalstore.c @@ -206,11 +206,13 @@ void icalstore_free(icalstore* s) icalcluster_free(impl->cluster); } - while( (str=pvl_pop(impl->directory)) != 0){ + while(impl->directory !=0 && (str=pvl_pop(impl->directory)) != 0){ free(str); } - pvl_free(impl->directory); + if(impl->directory != 0){ + pvl_free(impl->directory); + } impl->directory = 0; impl->directory_iterator = 0; diff --git a/libical/src/test/regression.c b/libical/src/test/regression.c index 822de6b22c..a969022d98 100644 --- a/libical/src/test/regression.c +++ b/libical/src/test/regression.c @@ -1237,15 +1237,38 @@ void test_duration() printf("%s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); v = icalvalue_new_from_string(ICAL_PERIOD_VALUE, "19971015T050000Z/PT8H30M"); printf("%s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); v = icalvalue_new_from_string(ICAL_PERIOD_VALUE, "19971015T050000Z/19971015T060000Z"); printf("%s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); + + +} + + +void test_strings(){ + + icalvalue *v; + + v = icalvalue_new_text("foo;bar;bats"); + + printf("%s\n",icalvalue_as_ical_string(v)); + + icalvalue_free(v); + + v = icalvalue_new_text("foo\\;b\nar\\;ba\tts"); + + printf("%s\n",icalvalue_as_ical_string(v)); + + icalvalue_free(v); } @@ -1253,25 +1276,28 @@ void test_duration() int main(int argc, char *argv[]) { + + printf("\n------------Test strings---------------\n"); + test_strings(); + +exit(0); + + printf("\n------------Test recur---------------\n"); + test_recur(); + #if 0 printf("\n------------Test Calendar---------------\n"); test_calendar(); printf("\n------------Test Store---------------\n"); test_store(); +#endif printf("\n------------Test duration---------------\n"); test_duration(); -#endif - - printf("\n------------Test recur---------------\n"); - test_recur(); - -exit(0); - printf("\n------------Test Restriction---------------\n"); test_restriction(); -- cgit v1.2.3