diff options
author | Federico Mena Quintero <federico@src.gnome.org> | 2000-12-12 07:01:26 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2000-12-12 07:01:26 +0800 |
commit | 26eee7328031f78b063ab71265ef4fddc8619c72 (patch) | |
tree | 65334073d42b48a4c23f2d7d20a6813c2113f57c /libical/src | |
parent | 5ccacd6a5bbeb2d91aea706f37cc5f96ee3144fb (diff) | |
download | gsoc2013-evolution-26eee7328031f78b063ab71265ef4fddc8619c72.tar gsoc2013-evolution-26eee7328031f78b063ab71265ef4fddc8619c72.tar.gz gsoc2013-evolution-26eee7328031f78b063ab71265ef4fddc8619c72.tar.bz2 gsoc2013-evolution-26eee7328031f78b063ab71265ef4fddc8619c72.tar.lz gsoc2013-evolution-26eee7328031f78b063ab71265ef4fddc8619c72.tar.xz gsoc2013-evolution-26eee7328031f78b063ab71265ef4fddc8619c72.tar.zst gsoc2013-evolution-26eee7328031f78b063ab71265ef4fddc8619c72.zip |
Fix fucking CVS conflicts because fucking CVS is a fucking big doofus - Federico
svn path=/trunk/; revision=6920
Diffstat (limited to 'libical/src')
40 files changed, 5634 insertions, 1653 deletions
diff --git a/libical/src/libical/Makefile.am b/libical/src/libical/Makefile.am index 35a08effc7..ee87c992e1 100644 --- a/libical/src/libical/Makefile.am +++ b/libical/src/libical/Makefile.am @@ -1,106 +1,175 @@ - -#AUTOMAKE_OPTIONS = no-dependencies - -#noinst_LTLIBRARIES = libical.la -lib_LIBRARIES = libical.a - -YFLAGS =-d -v -t - -libical_a_SOURCES = \ - ical.h \ - icalcomponent.c \ - icalcomponent.h \ - icalenums.c \ - icalenums.h \ - icalerror.c \ - icalerror.h \ - icalyacc.y \ - icallexer.l \ - icalmemory.c \ - icalmemory.h \ - icalparameter.c \ - icalparameter.h \ - icalparser.c \ - icalparser.h \ - icalproperty.c \ - icalproperty.h \ - icalrestriction.c \ - icalrestriction.h \ - icaltypes.c \ - icaltypes.h \ - icalvalue.c \ - icalvalue.h \ - icalrecur.c \ - icalrecur.h \ - icaltime.h \ - icaltime.c \ - pvl.c \ - pvl.h \ - sspm.c \ - sspm.h \ - icalmime.c \ - icalmime.h - -include_HEADERS=\ - ical.h \ - icalcomponent.h \ - icalenums.h \ - icalerror.h \ - icalmemory.h \ - icalparameter.h \ - icalparser.h \ - icalproperty.h \ - icalrestriction.h \ - icaltypes.h \ - icalvalue.h \ - icalrecur.h \ - icalversion.h \ - icaltime.h \ - pvl.h \ - sspm.h \ - icalmime.h - - -# -# static convenience library for use in conduits -# - -noinst_LTLIBRARIES = libical-static.la -libical_static_la_SOURCES = $(libical_a_SOURCES) -libical_static_la_LDFLAGS = --all-static - -EXTRA_DIST = icallexer.c icalyacc.c icalyacc.h - -CONFIG_CLEAN_FILES = y.output *~ - -DESIGNDATA = ../../design-data -ICALSCRIPTS = ../../scripts -derived: icalproperty icalparameter icalvalue icalrestriction - -icalproperty: - $(ICALSCRIPTS)/mkderivedproperties.pl -i icalproperty.h -h $(DESIGNDATA)/prop-to-value.txt ${DESIGNDATA}/value-c-types.txt > icalproperty.newh - mv icalproperty.newh icalproperty.h - - $(ICALSCRIPTS)/mkderivedproperties.pl -i icalproperty.c -c $(DESIGNDATA)/prop-to-value.txt ${DESIGNDATA}/value-c-types.txt > icalproperty.newc - mv icalproperty.newc icalproperty.c - - -icalparameter: - $(ICALSCRIPTS)/mkderivedparameters.pl -i icalparameter.h -h $(DESIGNDATA)/param-c-types.txt > icalparameter.newh - mv icalparameter.newh icalparameter.h - - $(ICALSCRIPTS)/mkderivedparameters.pl -i icalparameter.c -c $(DESIGNDATA)/param-c-types.txt > icalparameter.newc - mv icalparameter.newc icalparameter.c - -icalvalue: - $(ICALSCRIPTS)/mkderivedvalues.pl -i icalvalue.h -h $(DESIGNDATA)/value-c-types.txt > icalvalue.newh - mv icalvalue.newh icalvalue.h - - $(ICALSCRIPTS)/mkderivedvalues.pl -i icalvalue.c -c $(DESIGNDATA)/value-c-types.txt > icalvalue.newc - mv icalvalue.newc icalvalue.c - -icalrestriction: - $(ICALSCRIPTS)/mkrestrictiontable.pl -i icalrestriction.c $(DESIGNDATA)/restrictions.csv > icalrestriction.newc - mv icalrestriction.newc icalrestriction.c - - +DESIGNDATA = $(top_srcdir)/design-data +ICALSCRIPTS = $(top_srcdir)/scripts + +lib_LTLIBRARIES = libical.la + +YFLAGS = -d -v -t -pical_yy +LFLAGS = -Pical_yy +LEX_OUTPUT_ROOT = lex.ical_yy + +all: ical.h + +INCLUDES = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src \ + -I$(srcdir) + +libical_la_LDFLAGS = -version-info 0:0:0 + +libical_la_SOURCES = \ + icalcomponent.c \ + icalcomponent.h \ + icalenums.c \ + icalenums.h \ + icalerror.c \ + icalerror.h \ + icallexer.l \ + icalmemory.c \ + icalmemory.h \ + icalmime.c \ + icalmime.h \ + icalparameter.c \ + icalparameter.h \ + icalparser.c \ + icalparser.h \ + icalproperty.c \ + icalproperty.h \ + icalrecur.c \ + icalrecur.h \ + icalrestriction.c \ + icalrestriction.h \ + icaltime.c \ + icaltime.h \ + icaltypes.c \ + icaltypes.h \ + icalvalue.c \ + icalvalue.h \ + icalyacc.h \ + icalyacc.y \ + pvl.c \ + pvl.h \ + sspm.c \ + sspm.h + +libicalincludedir = $(includedir) + +libicalinclude_HEADERS = ical.h + +# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It +# is required to make the combined header ical.h properly +COMBINEDHEADERS = \ + $(top_builddir)/src/libical/icalversion.h \ + $(top_srcdir)/src/libical/icaltime.h \ + $(top_srcdir)/src/libical/icalenums.h \ + $(top_srcdir)/src/libical/icaltypes.h \ + $(top_srcdir)/src/libical/icalrecur.h \ + $(top_srcdir)/src/libical/icalvalue.h \ + $(top_srcdir)/src/libical/icalparameter.h \ + $(top_srcdir)/src/libical/icalproperty.h \ + $(top_srcdir)/src/libical/pvl.h \ + $(top_srcdir)/src/libical/icalcomponent.h \ + $(top_srcdir)/src/libical/icalparser.h \ + $(top_srcdir)/src/libical/icalmemory.h \ + $(top_srcdir)/src/libical/icalerror.h \ + $(top_srcdir)/src/libical/icalrestriction.h \ + $(top_srcdir)/src/libical/sspm.h \ + $(top_srcdir)/src/libical/icalmime.h + +BUILT_SOURCES = \ + icalparameter.c \ + icalparameter.h \ + icalproperty.c \ + icalproperty.h \ + icalrestriction.c \ + icalvalue.c \ + icalvalue.h + +ical.h: $(COMBINEDHEADERS) $(BUILT_SOURCES) + cat $(COMBINEDHEADERS) \ + | egrep -v "#include.*\"ical" \ + | egrep -v "#include.*\"pvl\.h\"" > ical.h + +icallexer.c : icalyacc.h + + +# parameters + +PARAMETERDEPS = \ + $(ICALSCRIPTS)/mkderivedparameters.pl \ + $(DESIGNDATA)/param-c-types.txt \ + icalparameter.c.in \ + icalparameter.h.in + +icalparameter.h: $(PARAMETERDEPS) + $(PERL) $(ICALSCRIPTS)/mkderivedparameters.pl -i icalparameter.h.in -h $(DESIGNDATA)/param-c-types.txt > icalparameter.newh \ + && mv icalparameter.newh icalparameter.h + +icalparameter.c: $(PARAMETERDEPS) icalparameter.h + $(PERL) $(ICALSCRIPTS)/mkderivedparameters.pl -i icalparameter.c.in -c $(DESIGNDATA)/param-c-types.txt > icalparameter.newc \ + && mv icalparameter.newc icalparameter.c + +# properties + +PROPERTYDEPS = \ + $(ICALSCRIPTS)/mkderivedproperties.pl \ + $(DESIGNDATA)/prop-to-value.txt \ + $(DESIGNDATA)/value-c-types.txt \ + icalproperty.c.in \ + icalproperty.h.in + + +icalproperty.h: $(PROPERTYDEPS) + $(PERL) $(ICALSCRIPTS)/mkderivedproperties.pl -i icalproperty.h.in -h \ + $(DESIGNDATA)/prop-to-value.txt \ + ${DESIGNDATA}/value-c-types.txt > icalproperty.h + +icalproperty.c: $(PROPERTYDEPS) icalproperty.h + $(PERL) $(ICALSCRIPTS)/mkderivedproperties.pl -i icalproperty.c.in -c \ + $(DESIGNDATA)/prop-to-value.txt \ + ${DESIGNDATA}/value-c-types.txt > icalproperty.c + +# restrictions + +RESTRICTIONDEPS = \ + $(ICALSCRIPTS)/mkrestrictiontable.pl \ + $(DESIGNDATA)/restrictions.csv \ + icalrestriction.c.in + +icalrestriction.c: $(RESTRICTIONDEPS) + $(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl -i icalrestriction.c.in \ + $(DESIGNDATA)/restrictions.csv > icalrestriction.c + +# values + +VALUEDEPS = \ + $(ICALSCRIPTS)/mkderivedvalues.pl \ + $(DESIGNDATA)/value-c-types.txt \ + icalvalue.c.in \ + icalvalue.h.in + +icalvalue.h: $(VALUEDEPS) + $(PERL) $(ICALSCRIPTS)/mkderivedvalues.pl -i icalvalue.h.in -h \ + $(DESIGNDATA)/value-c-types.txt > icalvalue.h + +icalvalue.c: $(VALUEDEPS) icalvalue.h + $(PERL) $(ICALSCRIPTS)/mkderivedvalues.pl -i icalvalue.c.in -c \ + $(DESIGNDATA)/value-c-types.txt > icalvalue.c + + + +# housekeeping +CONFIG_CLEAN_FILES = y.output + +EXTRA_DIST = \ + icalparameter.c.in \ + icalparameter.h.in \ + icalproperty.c.in \ + icalproperty.h.in \ + icalrestriction.c.in \ + icalvalue.c.in \ + icalvalue.h.in \ + icalversion.h.in \ + $(BUILT_SOURCES) \ + icallexer.c \ + icalyacc.c diff --git a/libical/src/libical/ical.h b/libical/src/libical/ical.h index 05e7ca82bc..506d69a6db 100644 --- a/libical/src/libical/ical.h +++ b/libical/src/libical/ical.h @@ -1,6 +1,596 @@ +#ifndef ICAL_VERSION_H +#define ICAL_VERSION_H + +#define ICAL_PACKAGE "libical" +#define ICAL_VERSION "0.21a" + +#endif +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icaltime.h + CREATOR: eric 02 June 2000 + + + $Id$ + $Locker$ + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The Original Code is eric. The Initial Developer of the Original + Code is Eric Busboom + + +======================================================================*/ + +#ifndef ICALTIME_H +#define ICALTIME_H + +#include <time.h> + +/* icaltime_span is returned by icalcomponent_get_span() */ +struct icaltime_span { + time_t start; /* in UTC */ + time_t end; /* in UTC */ + int is_busy; /* 1->busy time, 0-> free time */ +}; + +struct icaltimetype +{ + int year; + int month; + int day; + int hour; + int minute; + int second; + + int is_utc; /* 1-> time is in UTC timezone */ + + int is_date; /* 1 -> interpret this as date. */ +}; + +struct icaltimetype icaltime_null_time(void); + +int icaltime_is_null_time(struct icaltimetype t); + +struct icaltimetype icaltime_normalize(struct icaltimetype t); + +short icaltime_day_of_year(struct icaltimetype t); +struct icaltimetype icaltime_from_day_of_year(short doy, short year); + +short icaltime_day_of_week(struct icaltimetype t); +short icaltime_start_doy_of_week(struct icaltimetype t); + +struct icaltimetype icaltime_from_timet(time_t v, int is_date, int is_utc); +struct icaltimetype icaltime_from_string(const char* str); +time_t icaltime_as_timet(struct icaltimetype); +char* icaltime_as_ctime(struct icaltimetype); + +short icaltime_week_number(short day_of_month, short month, short year); + +struct icaltimetype icaltime_from_week_number(short week_number, short year); + +int icaltime_compare(struct icaltimetype a,struct icaltimetype b); + +int icaltime_compare_date_only(struct icaltimetype a, struct icaltimetype b); + + +short icaltime_days_in_month(short month,short year); + +/* Routines for handling timezones */ + +/* Return the offset of the named zone as seconds. tt is a time + indicating the date for which you want the offset */ +time_t icaltime_utc_offset(struct icaltimetype tt, const char* tzid); + +time_t icaltime_local_utc_offset(); + + +/* convert tt, of timezone tzid, into a utc time */ +struct icaltimetype icaltime_as_utc(struct icaltimetype tt,const char* tzid); + +/* convert tt, a time in UTC, into a time in timezone tzid */ +struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid); + + + +struct icaldurationtype +{ + int is_neg; + unsigned int days; + unsigned int weeks; + unsigned int hours; + unsigned int minutes; + unsigned int seconds; +}; + +struct icaldurationtype icaldurationtype_from_timet(time_t t); +struct icaldurationtype icaldurationtype_from_string(const char*); +time_t icaldurationtype_as_timet(struct icaldurationtype duration); + + +struct icalperiodtype +{ + struct icaltimetype start; /* Must be absolute */ + struct icaltimetype end; /* Must be absolute */ + struct icaldurationtype duration; +}; + +time_t icalperiodtype_duration(struct icalperiodtype period); +time_t icalperiodtype_end(struct icalperiodtype period); + + + +struct icaltimetype icaltime_add(struct icaltimetype t, + struct icaldurationtype d); + +struct icaldurationtype icaltime_subtract(struct icaltimetype t1, + struct icaltimetype t2); + + +#endif /* !ICALTIME_H */ + + + + +/* -*- Mode: C -*-*/ +/*====================================================================== + FILE: icalenums.h + + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The original code is icalenums.h + + Contributions from: + Graham Davison (g.m.davison@computer.org) + +======================================================================*/ + +#ifndef ICALENUMS_H +#define ICALENUMS_H + + + +/*********************************************************************** + * Component enumerations +**********************************************************************/ + +typedef enum icalcomponent_kind { + ICAL_NO_COMPONENT, + ICAL_ANY_COMPONENT, /* Used to select all components*/ + ICAL_XROOT_COMPONENT, + ICAL_XATTACH_COMPONENT, /* MIME attached data, returned by parser. */ + ICAL_VEVENT_COMPONENT, + ICAL_VTODO_COMPONENT, + ICAL_VJOURNAL_COMPONENT, + ICAL_VCALENDAR_COMPONENT, + ICAL_VFREEBUSY_COMPONENT, + ICAL_VALARM_COMPONENT, + ICAL_XAUDIOALARM_COMPONENT, + ICAL_XDISPLAYALARM_COMPONENT, + ICAL_XEMAILALARM_COMPONENT, + ICAL_XPROCEDUREALARM_COMPONENT, + ICAL_VTIMEZONE_COMPONENT, + ICAL_XSTANDARD_COMPONENT, + ICAL_XDAYLIGHT_COMPONENT, + ICAL_X_COMPONENT, + ICAL_VSCHEDULE_COMPONENT, + ICAL_VQUERY_COMPONENT, + ICAL_VCAR_COMPONENT, + ICAL_VCOMMAND_COMPONENT, + ICAL_XLICINVALID_COMPONENT, + ICAL_XLICMIMEPART_COMPONENT /* a non-stardard component that mirrors + structure of MIME data */ + +} icalcomponent_kind; + +/*********************************************************************** + * Property Enumerations +**********************************************************************/ + +typedef enum icalproperty_kind { + ICAL_ANY_PROPERTY = 0, /* This must be the first enum, for iteration */ + ICAL_CALSCALE_PROPERTY, + ICAL_METHOD_PROPERTY, + ICAL_PRODID_PROPERTY, + ICAL_VERSION_PROPERTY, + ICAL_ATTACH_PROPERTY, + ICAL_CATEGORIES_PROPERTY, + ICAL_CLASS_PROPERTY, + ICAL_COMMENT_PROPERTY, + ICAL_DESCRIPTION_PROPERTY, + ICAL_GEO_PROPERTY, + ICAL_LOCATION_PROPERTY, + ICAL_PERCENTCOMPLETE_PROPERTY, + ICAL_PRIORITY_PROPERTY, + ICAL_RESOURCES_PROPERTY, + ICAL_STATUS_PROPERTY, + ICAL_SUMMARY_PROPERTY, + ICAL_COMPLETED_PROPERTY, + ICAL_DTEND_PROPERTY, + ICAL_DUE_PROPERTY, + ICAL_DTSTART_PROPERTY, + ICAL_DURATION_PROPERTY, + ICAL_FREEBUSY_PROPERTY, + ICAL_TRANSP_PROPERTY, + ICAL_TZID_PROPERTY, + ICAL_TZNAME_PROPERTY, + ICAL_TZOFFSETFROM_PROPERTY, + ICAL_TZOFFSETTO_PROPERTY, + ICAL_TZURL_PROPERTY, + ICAL_ATTENDEE_PROPERTY, + ICAL_CONTACT_PROPERTY, + ICAL_ORGANIZER_PROPERTY, + ICAL_RECURRENCEID_PROPERTY, + ICAL_RELATEDTO_PROPERTY, + ICAL_URL_PROPERTY, + ICAL_UID_PROPERTY, + ICAL_EXDATE_PROPERTY, + ICAL_EXRULE_PROPERTY, + ICAL_RDATE_PROPERTY, + ICAL_RRULE_PROPERTY, + ICAL_ACTION_PROPERTY, + ICAL_REPEAT_PROPERTY, + ICAL_TRIGGER_PROPERTY, + ICAL_CREATED_PROPERTY, + ICAL_DTSTAMP_PROPERTY, + ICAL_LASTMODIFIED_PROPERTY, + ICAL_SEQUENCE_PROPERTY, + ICAL_REQUESTSTATUS_PROPERTY, + ICAL_X_PROPERTY, + + /* CAP Properties */ + ICAL_SCOPE_PROPERTY, + ICAL_MAXRESULTS_PROPERTY, + ICAL_MAXRESULTSSIZE_PROPERTY, + ICAL_QUERY_PROPERTY, + ICAL_QUERYNAME_PROPERTY, + ICAL_TARGET_PROPERTY, + + /* libical private properties */ + ICAL_XLICERROR_PROPERTY, + ICAL_XLICCLUSTERCOUNT_PROPERTY, + ICAL_XLICMIMECONTENTTYPE_PROPERTY, + ICAL_XLICMIMEENCODING_PROPERTY, + ICAL_XLICMIMECID_PROPERTY, + ICAL_XLICMIMEFILENAME_PROPERTY, + ICAL_XLICMIMECHARSET_PROPERTY, + ICAL_XLICMIMEOPTINFO_PROPERTY, + + ICAL_NO_PROPERTY /* This must be the last enum, for iteration */ + +} icalproperty_kind; + +/*********************************************************************** + * Enumerations for the values of properties + ***********************************************************************/ + +typedef enum icalproperty_method { + ICAL_METHOD_PUBLISH, + ICAL_METHOD_REQUEST, + ICAL_METHOD_REPLY, + ICAL_METHOD_ADD, + ICAL_METHOD_CANCEL, + ICAL_METHOD_REFRESH, + ICAL_METHOD_COUNTER, + ICAL_METHOD_DECLINECOUNTER, + /* CAP Methods */ + ICAL_METHOD_CREATE, + ICAL_METHOD_READ, + ICAL_METHOD_RESPONSE, + ICAL_METHOD_MOVE, + ICAL_METHOD_MODIFY, + ICAL_METHOD_GENERATEUID, + ICAL_METHOD_DELETE, + ICAL_METHOD_NONE +} icalproperty_method ; + +typedef enum icalproperty_transp { + ICAL_TRANSP_OPAQUE, + ICAL_TRANS_TRANSPARENT +} icalproperty_trans; + +typedef enum icalproperty_calscale { + ICAL_CALSCALE_GREGORIAN +} icalproperty_calscale ; + + +typedef enum icalproperty_class { + ICAL_CLASS_PUBLIC, + ICAL_CLASS_PRIVATE, + ICAL_CLASS_CONFIDENTIAL, + ICAL_CLASS_XNAME +} icalproperty_class; + + +typedef enum icalproperty_status { + ICAL_STATUS_NONE, + ICAL_STATUS_TENTATIVE, + ICAL_STATUS_CONFIRMED, + ICAL_STATUS_CANCELLED, /* CANCELED? SIC from RFC*/ + ICAL_STATUS_NEEDSACTION, + ICAL_STATUS_COMPLETED, + ICAL_STATUS_INPROCESS, + ICAL_STATUS_DRAFT, + ICAL_STATUS_FINAL +} icalproperty_status; + +typedef enum icalproperty_action { + ICAL_ACTION_AUDIO, + ICAL_ACTION_DISPLAY, + ICAL_ACTION_EMAIL, + ICAL_ACTION_PROCEDURE, + ICAL_ACTION_XNAME +} icalproperty_action; + +/*********************************************************************** + * Value enumerations +**********************************************************************/ + +typedef enum icalvalue_kind { + ICAL_NO_VALUE, + ICAL_ATTACH_VALUE, /* Non-Standard*/ + ICAL_BINARY_VALUE, + ICAL_BOOLEAN_VALUE, + ICAL_CALADDRESS_VALUE, + ICAL_DATE_VALUE, + ICAL_DATETIME_VALUE, + ICAL_DATETIMEDATE_VALUE, /* Non-Standard */ + ICAL_DATETIMEPERIOD_VALUE, /* Non-Standard */ + ICAL_DURATION_VALUE, + ICAL_FLOAT_VALUE, + ICAL_GEO_VALUE, /* Non-Standard */ + ICAL_INTEGER_VALUE, + ICAL_METHOD_VALUE, /* Non-Standard */ + ICAL_STATUS_VALUE, /* Non-Standard */ + ICAL_PERIOD_VALUE, + ICAL_RECUR_VALUE, + ICAL_STRING_VALUE, /* Non-Standard */ + ICAL_TEXT_VALUE, + ICAL_TIME_VALUE, + ICAL_TRIGGER_VALUE, /* Non-Standard */ + ICAL_URI_VALUE, + ICAL_UTCOFFSET_VALUE, + ICAL_QUERY_VALUE, + ICAL_XNAME_VALUE +} icalvalue_kind; + + +/*********************************************************************** + * Parameter Enumerations + **********************************************************************/ + + +typedef enum icalparameter_kind { + ICAL_NO_PARAMETER, + ICAL_ANY_PARAMETER, + ICAL_ALTREP_PARAMETER, /* DQUOTE uri DQUOTE */ + ICAL_CN_PARAMETER, /* text */ + ICAL_CUTYPE_PARAMETER, /*INDIVIDUAL, GROUP, RESOURCE,ROOM,UNKNOWN, x-name*/ + ICAL_DELEGATEDFROM_PARAMETER, /* *("," DQUOTE cal-address DQUOTE) */ + ICAL_DELEGATEDTO_PARAMETER, /* *("," DQUOTE cal-address DQUOTE) */ + ICAL_DIR_PARAMETER, /* DQUOTE uri DQUOTE */ + ICAL_ENCODING_PARAMETER, /* *BIT, BASE64, x-name */ + ICAL_FMTTYPE_PARAMETER, /* registered MINE content type */ + ICAL_FBTYPE_PARAMETER, /* FREE, BUSY, BUSY-UNAVAILABLE, BUSY-TENTATIVE,x-name */ + ICAL_LANGUAGE_PARAMETER, /* text from RFC 1766 */ + ICAL_MEMBER_PARAMETER, /* DQUOTE cal-address DQUOTE */ + ICAL_PARTSTAT_PARAMETER, /* NEEDS-ACTION, ACCEPTED, DECLINED, TENTATIVE, DELEGATED, x-name */ + ICAL_RANGE_PARAMETER, /* THISANDPRIOR, THISANDFUTURE */ + ICAL_RELATED_PARAMETER, /* START, END */ + ICAL_RELTYPE_PARAMETER, /* PARENT, CHILD, SIBLING,x-name */ + ICAL_ROLE_PARAMETER, /* CHAIR, REQ_PARTICIPANT, OPT_PARTICIPANT, NON_PARTICIPANT, x-name */ + ICAL_RSVP_PARAMETER, /* TRUE. FALSE */ + ICAL_SENTBY_PARAMETER, /* DQUOTE uri DQUOTE */ + ICAL_TZID_PARAMETER, /* [tzidprefix] paramtext CRLF */ + ICAL_VALUE_PARAMETER, /* BINARY, BOOLEAN, CAL_ADDRESS, DATE, DATE-TIME, DURATION, FLOAT, INTEGER, PERIOD, RECUR, TEXT, TIME, UTC_OFFSET, x-name */ + ICAL_XLICERRORTYPE_PARAMETER, /*ICAL_XLICERROR_PARSE_ERROR,ICAL_XLICERROR_INVALID_ITIP*/ + ICAL_XLICCOMPARETYPE_PARAMETER, /**/ + ICAL_X_PARAMETER /* text */ +} icalparameter_kind; + +typedef enum icalparameter_cutype { + ICAL_CUTYPE_INDIVIDUAL, + ICAL_CUTYPE_GROUP, + ICAL_CUTYPE_RESOURCE, + ICAL_CUTYPE_ROOM, + ICAL_CUTYPE_UNKNOWN, + ICAL_CUTYPE_XNAME +} icalparameter_cutype; + + +typedef enum icalparameter_encoding { + ICAL_ENCODING_8BIT, + ICAL_ENCODING_BASE64, + ICAL_ENCODING_XNAME +} icalparameter_encoding; + +typedef enum icalparameter_fbtype { + ICAL_FBTYPE_FREE, + ICAL_FBTYPE_BUSY, + ICAL_FBTYPE_BUSYUNAVAILABLE, + ICAL_FBTYPE_BUSYTENTATIVE, + ICAL_FBTYPE_XNAME +} icalparameter_fbtype; + +typedef enum icalparameter_partstat { + ICAL_PARTSTAT_NEEDSACTION, + ICAL_PARTSTAT_ACCEPTED, + ICAL_PARTSTAT_DECLINED, + ICAL_PARTSTAT_TENTATIVE, + ICAL_PARTSTAT_DELEGATED, + ICAL_PARTSTAT_COMPLETED, + ICAL_PARTSTAT_INPROCESS, + ICAL_PARTSTAT_XNAME, + ICAL_PARTSTAT_NONE +} icalparameter_partstat; + +typedef enum icalparameter_range { + ICAL_RANGE_THISANDPRIOR, + ICAL_RANGE_THISANDFUTURE +} icalparameter_range; + +typedef enum icalparameter_related { + ICAL_RELATED_START, + ICAL_RELATED_END +} icalparameter_related; + +typedef enum icalparameter_reltype { + ICAL_RELTYPE_PARENT, + ICAL_RELTYPE_CHILD, + ICAL_RELTYPE_SIBLING, + ICAL_RELTYPE_XNAME +} icalparameter_reltype; + +typedef enum icalparameter_role { + ICAL_ROLE_CHAIR, + ICAL_ROLE_REQPARTICIPANT, + ICAL_ROLE_OPTPARTICIPANT, + ICAL_ROLE_NONPARTICIPANT, + ICAL_ROLE_XNAME +} icalparameter_role; + +typedef enum icalparameter_xlicerrortype { + ICAL_XLICERRORTYPE_COMPONENTPARSEERROR, + ICAL_XLICERRORTYPE_PARAMETERVALUEPARSEERROR, + ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR, + ICAL_XLICERRORTYPE_PROPERTYPARSEERROR, + ICAL_XLICERRORTYPE_VALUEPARSEERROR, + ICAL_XLICERRORTYPE_UNKVCALPROP, + ICAL_XLICERRORTYPE_INVALIDITIP, + ICAL_XLICERRORTYPE_MIMEPARSEERROR +} icalparameter_xlicerrortype; + +typedef enum icalparameter_xliccomparetype { + ICAL_XLICCOMPARETYPE_EQUAL=0, + ICAL_XLICCOMPARETYPE_LESS=-1, + ICAL_XLICCOMPARETYPE_LESSEQUAL=2, + ICAL_XLICCOMPARETYPE_GREATER=1, + ICAL_XLICCOMPARETYPE_GREATEREQUAL=3, + ICAL_XLICCOMPARETYPE_NOTEQUAL=4, + ICAL_XLICCOMPARETYPE_REGEX=5 +} icalparameter_xliccomparetype; + +typedef enum icalparameter_value { + ICAL_VALUE_XNAME = ICAL_XNAME_VALUE, + ICAL_VALUE_BINARY = ICAL_BINARY_VALUE, + ICAL_VALUE_BOOLEAN = ICAL_BOOLEAN_VALUE, + ICAL_VALUE_CALADDRESS = ICAL_CALADDRESS_VALUE, + ICAL_VALUE_DATE = ICAL_DATE_VALUE, + ICAL_VALUE_DATETIME = ICAL_DATETIME_VALUE, + ICAL_VALUE_DURATION = ICAL_DURATION_VALUE, + ICAL_VALUE_FLOAT = ICAL_FLOAT_VALUE, + ICAL_VALUE_INTEGER = ICAL_INTEGER_VALUE, + ICAL_VALUE_PERIOD = ICAL_PERIOD_VALUE, + ICAL_VALUE_RECUR = ICAL_RECUR_VALUE, + ICAL_VALUE_TEXT = ICAL_TEXT_VALUE, + ICAL_VALUE_TIME = ICAL_TIME_VALUE, + ICAL_VALUE_UTCOFFSET = ICAL_UTCOFFSET_VALUE, + ICAL_VALUE_URI = ICAL_URI_VALUE, + ICAL_VALUE_ERROR = ICAL_NO_VALUE +} icalparameter_value; + + +/*********************************************************************** + * Request Status codes + **********************************************************************/ + +typedef enum icalrequeststatus { + ICAL_UNKNOWN_STATUS, + ICAL_2_0_SUCCESS_STATUS, + ICAL_2_1_FALLBACK_STATUS, + ICAL_2_2_IGPROP_STATUS, + ICAL_2_3_IGPARAM_STATUS, + ICAL_2_4_IGXPROP_STATUS, + ICAL_2_5_IGXPARAM_STATUS, + ICAL_2_6_IGCOMP_STATUS, + ICAL_2_7_FORWARD_STATUS, + ICAL_2_8_ONEEVENT_STATUS, + ICAL_2_9_TRUNC_STATUS, + ICAL_2_10_ONETODO_STATUS, + ICAL_2_11_TRUNCRRULE_STATUS, + ICAL_3_0_INVPROPNAME_STATUS, + ICAL_3_1_INVPROPVAL_STATUS, + ICAL_3_2_INVPARAM_STATUS, + ICAL_3_3_INVPARAMVAL_STATUS, + ICAL_3_4_INVCOMP_STATUS, + ICAL_3_5_INVTIME_STATUS, + ICAL_3_6_INVRULE_STATUS, + ICAL_3_7_INVCU_STATUS, + ICAL_3_8_NOAUTH_STATUS, + ICAL_3_9_BADVERSION_STATUS, + ICAL_3_10_TOOBIG_STATUS, + ICAL_3_11_MISSREQCOMP_STATUS, + ICAL_3_12_UNKCOMP_STATUS, + ICAL_3_13_BADCOMP_STATUS, + ICAL_3_14_NOCAP_STATUS, + ICAL_4_0_BUSY_STATUS, + ICAL_5_0_MAYBE_STATUS, + ICAL_5_1_UNAVAIL_STATUS, + ICAL_5_2_NOSERVICE_STATUS, + ICAL_5_3_NOSCHED_STATUS +} icalrequeststatus; + + +const char* icalenum_reqstat_desc(icalrequeststatus stat); +short icalenum_reqstat_major(icalrequeststatus stat); +short icalenum_reqstat_minor(icalrequeststatus stat); +icalrequeststatus icalenum_num_to_reqstat(short major, short minor); + +/*********************************************************************** + * Conversion functions +**********************************************************************/ + +const char* icalenum_property_kind_to_string(icalproperty_kind kind); +icalproperty_kind icalenum_string_to_property_kind(char* string); + +const char* icalenum_value_kind_to_string(icalvalue_kind kind); +icalvalue_kind icalenum_value_kind_by_prop(icalproperty_kind kind); + +const char* icalenum_parameter_kind_to_string(icalparameter_kind kind); +icalparameter_kind icalenum_string_to_parameter_kind(char* string); + +const char* icalenum_component_kind_to_string(icalcomponent_kind kind); +icalcomponent_kind icalenum_string_to_component_kind(char* string); + +icalvalue_kind icalenum_property_kind_to_value_kind(icalproperty_kind kind); + +const char* icalenum_method_to_string(icalproperty_method); +icalproperty_method icalenum_string_to_method(const char* string); + +const char* icalenum_status_to_string(icalproperty_status); +icalproperty_status icalenum_string_to_status(const char* string); + +#endif /* !ICALENUMS_H */ + + + /* -*- Mode: C -*- */ /*====================================================================== - FILE: ical.h + FILE: icaltypes.h CREATOR: eric 20 March 1999 @@ -17,34 +607,1836 @@ The Mozilla Public License Version 1.0. You may obtain a copy of the License at http://www.mozilla.org/MPL/ - The original code is ical.h + The original code is icaltypes.h ======================================================================*/ -#ifndef ICAL_H -#define ICAL_H +#ifndef ICALTYPES_H +#define ICALTYPES_H + +#include <time.h> + +/* This type type should probably be an opaque type... */ +struct icalattachtype +{ + void* binary; + int owns_binary; + + char* base64; + int owns_base64; + + char* url; + + int refcount; + +}; + +/* converts base64 to binary, fetches url and stores as binary, or + just returns data */ + +struct icalattachtype* icalattachtype_new(void); +void icalattachtype_add_reference(struct icalattachtype* v); +void icalattachtype_free(struct icalattachtype* v); + +void icalattachtype_set_url(struct icalattachtype* v, char* url); +char* icalattachtype_get_url(struct icalattachtype* v); + +void icalattachtype_set_base64(struct icalattachtype* v, char* base64, + int owns); +char* icalattachtype_get_base64(struct icalattachtype* v); + +void icalattachtype_set_binary(struct icalattachtype* v, char* binary, + int owns); +void* icalattachtype_get_binary(struct icalattachtype* v); + +struct icalgeotype +{ + float lat; + float lon; +}; + + + +union icaltriggertype +{ + struct icaltimetype time; + struct icaldurationtype duration; +}; + + + +/* struct icalreqstattype. This struct contains two string pointers, +but don't try to free either of them. The "desc" string is a pointer +to a static table inside the library. Don't try to free it. The +"debug" string is a pointer into the string that the called passed +into to icalreqstattype_from_string. Don't try to free it either, and +don't use it after the original string has been freed. + +BTW, you would get that original string from +*icalproperty_get_requeststatus() or icalvalue_get_text(), when +operating on a the value of a request_status property. */ + +struct icalreqstattype { + + icalrequeststatus code; + const char* desc; + const char* debug; +}; + +struct icalreqstattype icalreqstattype_from_string(char* str); +char* icalreqstattype_as_string(struct icalreqstattype); + +#endif /* !ICALTYPES_H */ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalrecur.h + CREATOR: eric 20 March 2000 + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + +======================================================================*/ + +#ifndef ICALRECUR_H +#define ICALRECUR_H + +#include <time.h> + + +/*********************************************************************** + * Recurrance enumerations +**********************************************************************/ + +typedef enum icalrecurrencetype_frequency +{ + /* These enums are used to index an array, so don't change the + order or the integers */ + + ICAL_SECONDLY_RECURRENCE=0, + ICAL_MINUTELY_RECURRENCE=1, + ICAL_HOURLY_RECURRENCE=2, + ICAL_DAILY_RECURRENCE=3, + ICAL_WEEKLY_RECURRENCE=4, + ICAL_MONTHLY_RECURRENCE=5, + ICAL_YEARLY_RECURRENCE=6, + ICAL_NO_RECURRENCE=7 + +} icalrecurrencetype_frequency; + +typedef enum icalrecurrencetype_weekday +{ + ICAL_NO_WEEKDAY, + ICAL_SUNDAY_WEEKDAY, + ICAL_MONDAY_WEEKDAY, + ICAL_TUESDAY_WEEKDAY, + ICAL_WEDNESDAY_WEEKDAY, + ICAL_THURSDAY_WEEKDAY, + ICAL_FRIDAY_WEEKDAY, + ICAL_SATURDAY_WEEKDAY +} icalrecurrencetype_weekday; + +enum { + ICAL_RECURRENCE_ARRAY_MAX = 0x7f7f, + ICAL_RECURRENCE_ARRAY_MAX_BYTE = 0x7f +}; + +const char* icalrecur_recurrence_to_string(icalrecurrencetype_frequency kind); +const char* icalrecur_weekday_to_string(icalrecurrencetype_weekday kind); + + +/********************** Recurrence type routines **************/ + +/* See RFC 2445 Section 4.3.10, RECUR Value, for an explaination of + the values and fields in struct icalrecurrencetype */ + + +struct icalrecurrencetype +{ + icalrecurrencetype_frequency freq; + + + /* until and count are mutually exclusive. */ + struct icaltimetype until; /* Hack. Must be time_t for general use */ + int count; + + short interval; + + icalrecurrencetype_weekday week_start; + + /* The BY* parameters can each take a list of values. Here I + * assume that the list of values will not be larger than the + * range of the value -- that is, the client will not name a + * value more than once. + + * Each of the lists is terminated with the value + * ICALRECURRENCE_ARRAY_MAX unless the the list is full. + */ + + short by_second[61]; + short by_minute[61]; + short by_hour[25]; + short by_day[8]; /* Encoded value, see below */ + short by_month_day[32]; + short by_year_day[367]; + short by_week_no[54]; + short by_month[13]; + short by_set_pos[367]; +}; + + +void icalrecurrencetype_clear(struct icalrecurrencetype *r); + +/* The 'day' element of icalrecurrencetype_weekday is encoded to allow +representation of both the day of the week ( Monday, Tueday), but also +the Nth day of the week ( First tuesday of the month, last thursday of +the year) These routines decode the day values */ + +/* 1 == Monday, etc. */ +enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day); + +/* 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc */ +short icalrecurrencetype_day_position(short day); + +/* Return the next occurance of 'r' after the time specified by 'after' */ +struct icaltimetype icalrecurrencetype_next_occurance( + struct icalrecurrencetype *r, + struct icaltimetype *after); + + + +typedef void icalrecur_iterator; +void icalrecurrencetype_test(); + + +/********** recurrence routines ********************/ + +icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule, struct icaltimetype dtstart); + +struct icaltimetype icalrecur_iterator_next(icalrecur_iterator*); + +int icalrecur_iterator_count(icalrecur_iterator*); + +void icalrecur_iterator_free(icalrecur_iterator*); -#include "icalversion.h" -#include "icalenums.h" -#include "icalvalue.h" -#include "icalparameter.h" -#include "icalproperty.h" -#include "icalcomponent.h" -#include "icaltypes.h" -#include "icalparser.h" -#include "icalmemory.h" -#include "icalerror.h" -#include "icalrestriction.h" -#include "icaltime.h" -#include "icalrecur.h" -#ifdef DMALLOC -#include "dmalloc.h" #endif +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalvalue.h + CREATOR: eric 20 March 1999 + + + $Id$ + $Locker$ + + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The original code is icalvalue.h + + ======================================================================*/ + +#ifndef ICALVALUE_H +#define ICALVALUE_H + +#include <time.h> + +typedef void icalvalue; + +icalvalue* icalvalue_new(icalvalue_kind kind); + +icalvalue* icalvalue_new_clone(icalvalue* value); + +icalvalue* icalvalue_new_from_string(icalvalue_kind kind, const char* str); + +void icalvalue_free(icalvalue* value); + +int icalvalue_is_valid(icalvalue* value); + +const char* icalvalue_as_ical_string(icalvalue* value); + +icalvalue_kind icalvalue_isa(icalvalue* value); + +int icalvalue_isa_value(void*); + +icalparameter_xliccomparetype +icalvalue_compare(icalvalue* a, icalvalue *b); + +/* Everything below this line is machine generated. Do not edit. */ +/* ATTACH # Non-std */ +icalvalue* icalvalue_new_attach(struct icalattachtype v); +struct icalattachtype icalvalue_get_attach(icalvalue* value); +void icalvalue_set_attach(icalvalue* value, struct icalattachtype v); + +/* BINARY */ +icalvalue* icalvalue_new_binary(const char* v); +const char* icalvalue_get_binary(icalvalue* value); +void icalvalue_set_binary(icalvalue* value, const char* v); + +/* BOOLEAN */ +icalvalue* icalvalue_new_boolean(int v); +int icalvalue_get_boolean(icalvalue* value); +void icalvalue_set_boolean(icalvalue* value, int v); + +/* CAL-ADDRESS */ +icalvalue* icalvalue_new_caladdress(const char* v); +const char* icalvalue_get_caladdress(icalvalue* value); +void icalvalue_set_caladdress(icalvalue* value, const char* v); + +/* DATE */ +icalvalue* icalvalue_new_date(struct icaltimetype v); +struct icaltimetype icalvalue_get_date(icalvalue* value); +void icalvalue_set_date(icalvalue* value, struct icaltimetype v); + +/* DATE-TIME */ +icalvalue* icalvalue_new_datetime(struct icaltimetype v); +struct icaltimetype icalvalue_get_datetime(icalvalue* value); +void icalvalue_set_datetime(icalvalue* value, struct icaltimetype v); + +/* DATE-TIME-DATE # Non-std */ +icalvalue* icalvalue_new_datetimedate(struct icaltimetype v); +struct icaltimetype icalvalue_get_datetimedate(icalvalue* value); +void icalvalue_set_datetimedate(icalvalue* value, struct icaltimetype v); + +/* DATE-TIME-PERIOD # Non-std */ +icalvalue* icalvalue_new_datetimeperiod(struct icalperiodtype v); +struct icalperiodtype icalvalue_get_datetimeperiod(icalvalue* value); +void icalvalue_set_datetimeperiod(icalvalue* value, struct icalperiodtype v); + +/* DURATION */ +icalvalue* icalvalue_new_duration(struct icaldurationtype v); +struct icaldurationtype icalvalue_get_duration(icalvalue* value); +void icalvalue_set_duration(icalvalue* value, struct icaldurationtype v); + +/* FLOAT */ +icalvalue* icalvalue_new_float(float v); +float icalvalue_get_float(icalvalue* value); +void icalvalue_set_float(icalvalue* value, float v); + +/* GEO # Non-std */ +icalvalue* icalvalue_new_geo(struct icalgeotype v); +struct icalgeotype icalvalue_get_geo(icalvalue* value); +void icalvalue_set_geo(icalvalue* value, struct icalgeotype v); + +/* INTEGER */ +icalvalue* icalvalue_new_integer(int v); +int icalvalue_get_integer(icalvalue* value); +void icalvalue_set_integer(icalvalue* value, int v); + +/* METHOD # Non-std */ +icalvalue* icalvalue_new_method(icalproperty_method v); +icalproperty_method icalvalue_get_method(icalvalue* value); +void icalvalue_set_method(icalvalue* value, icalproperty_method v); + +/* PERIOD */ +icalvalue* icalvalue_new_period(struct icalperiodtype v); +struct icalperiodtype icalvalue_get_period(icalvalue* value); +void icalvalue_set_period(icalvalue* value, struct icalperiodtype v); + +/* RECUR */ +icalvalue* icalvalue_new_recur(struct icalrecurrencetype v); +struct icalrecurrencetype icalvalue_get_recur(icalvalue* value); +void icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v); + +/* STRING # Non-std */ +icalvalue* icalvalue_new_string(const char* v); +const char* icalvalue_get_string(icalvalue* value); +void icalvalue_set_string(icalvalue* value, const char* v); + +/* TEXT */ +icalvalue* icalvalue_new_text(const char* v); +const char* icalvalue_get_text(icalvalue* value); +void icalvalue_set_text(icalvalue* value, const char* v); + +/* TIME */ +icalvalue* icalvalue_new_time(struct icaltimetype v); +struct icaltimetype icalvalue_get_time(icalvalue* value); +void icalvalue_set_time(icalvalue* value, struct icaltimetype v); + +/* TRIGGER # Non-std */ +icalvalue* icalvalue_new_trigger(union icaltriggertype v); +union icaltriggertype icalvalue_get_trigger(icalvalue* value); +void icalvalue_set_trigger(icalvalue* value, union icaltriggertype v); + +/* URI */ +icalvalue* icalvalue_new_uri(const char* v); +const char* icalvalue_get_uri(icalvalue* value); +void icalvalue_set_uri(icalvalue* value, const char* v); + +/* UTC-OFFSET */ +icalvalue* icalvalue_new_utcoffset(int v); +int icalvalue_get_utcoffset(icalvalue* value); +void icalvalue_set_utcoffset(icalvalue* value, int v); + +/* QUERY */ +icalvalue* icalvalue_new_query(const char* v); +const char* icalvalue_get_query(icalvalue* value); +void icalvalue_set_query(icalvalue* value, const char* v); + +/* STATUS #Non-st */ +icalvalue* icalvalue_new_status(icalproperty_status v); +icalproperty_status icalvalue_get_status(icalvalue* value); +void icalvalue_set_status(icalvalue* value, icalproperty_status v); + +#endif /*ICALVALUE_H*/ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalparam.h + CREATOR: eric 20 March 1999 + + + $Id$ + $Locker$ + + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The original code is icalparam.h + + ======================================================================*/ + +#ifndef ICALPARAM_H +#define ICALPARAM_H + + +typedef void icalparameter; + +icalparameter* icalparameter_new(icalparameter_kind kind); +icalparameter* icalparameter_new_clone(icalparameter* p); +icalparameter* icalparameter_new_from_string(icalparameter_kind kind, char* value); + +void icalparameter_free(icalparameter* parameter); + +char* icalparameter_as_ical_string(icalparameter* parameter); + +int icalparameter_is_valid(icalparameter* parameter); + +icalparameter_kind icalparameter_isa(icalparameter* parameter); + +int icalparameter_isa_parameter(void* param); + +/* Acess the name of an X parameer */ +void icalparameter_set_xname (icalparameter* param, const char* v); +const char* icalparameter_get_xname(icalparameter* param); +void icalparameter_set_xvalue (icalparameter* param, const char* v); +const char* icalparameter_get_xvalue(icalparameter* param); + + +/* Everything below this line is machine generated. Do not edit. */ +/* ALTREP */ +icalparameter* icalparameter_new_altrep(const char* v); +const char* icalparameter_get_altrep(icalparameter* value); +void icalparameter_set_altrep(icalparameter* value, const char* v); + +/* CN */ +icalparameter* icalparameter_new_cn(const char* v); +const char* icalparameter_get_cn(icalparameter* value); +void icalparameter_set_cn(icalparameter* value, const char* v); + +/* CUTYPE */ +icalparameter* icalparameter_new_cutype(icalparameter_cutype v); +icalparameter_cutype icalparameter_get_cutype(icalparameter* value); +void icalparameter_set_cutype(icalparameter* value, icalparameter_cutype v); + +/* DELEGATED-FROM */ +icalparameter* icalparameter_new_delegatedfrom(const char* v); +const char* icalparameter_get_delegatedfrom(icalparameter* value); +void icalparameter_set_delegatedfrom(icalparameter* value, const char* v); + +/* DELEGATED-TO */ +icalparameter* icalparameter_new_delegatedto(const char* v); +const char* icalparameter_get_delegatedto(icalparameter* value); +void icalparameter_set_delegatedto(icalparameter* value, const char* v); + +/* DIR */ +icalparameter* icalparameter_new_dir(const char* v); +const char* icalparameter_get_dir(icalparameter* value); +void icalparameter_set_dir(icalparameter* value, const char* v); + +/* ENCODING */ +icalparameter* icalparameter_new_encoding(icalparameter_encoding v); +icalparameter_encoding icalparameter_get_encoding(icalparameter* value); +void icalparameter_set_encoding(icalparameter* value, icalparameter_encoding v); + +/* FBTYPE */ +icalparameter* icalparameter_new_fbtype(icalparameter_fbtype v); +icalparameter_fbtype icalparameter_get_fbtype(icalparameter* value); +void icalparameter_set_fbtype(icalparameter* value, icalparameter_fbtype v); + +/* FMTTYPE */ +icalparameter* icalparameter_new_fmttype(const char* v); +const char* icalparameter_get_fmttype(icalparameter* value); +void icalparameter_set_fmttype(icalparameter* value, const char* v); + +/* LANGUAGE */ +icalparameter* icalparameter_new_language(const char* v); +const char* icalparameter_get_language(icalparameter* value); +void icalparameter_set_language(icalparameter* value, const char* v); + +/* MEMBER */ +icalparameter* icalparameter_new_member(const char* v); +const char* icalparameter_get_member(icalparameter* value); +void icalparameter_set_member(icalparameter* value, const char* v); + +/* PARTSTAT */ +icalparameter* icalparameter_new_partstat(icalparameter_partstat v); +icalparameter_partstat icalparameter_get_partstat(icalparameter* value); +void icalparameter_set_partstat(icalparameter* value, icalparameter_partstat v); + +/* RANGE */ +icalparameter* icalparameter_new_range(icalparameter_range v); +icalparameter_range icalparameter_get_range(icalparameter* value); +void icalparameter_set_range(icalparameter* value, icalparameter_range v); + +/* RELATED */ +icalparameter* icalparameter_new_related(icalparameter_related v); +icalparameter_related icalparameter_get_related(icalparameter* value); +void icalparameter_set_related(icalparameter* value, icalparameter_related v); + +/* RELTYPE */ +icalparameter* icalparameter_new_reltype(icalparameter_reltype v); +icalparameter_reltype icalparameter_get_reltype(icalparameter* value); +void icalparameter_set_reltype(icalparameter* value, icalparameter_reltype v); + +/* ROLE */ +icalparameter* icalparameter_new_role(icalparameter_role v); +icalparameter_role icalparameter_get_role(icalparameter* value); +void icalparameter_set_role(icalparameter* value, icalparameter_role v); + +/* RSVP */ +icalparameter* icalparameter_new_rsvp(int v); +int icalparameter_get_rsvp(icalparameter* value); +void icalparameter_set_rsvp(icalparameter* value, int v); + +/* SENT-BY */ +icalparameter* icalparameter_new_sentby(const char* v); +const char* icalparameter_get_sentby(icalparameter* value); +void icalparameter_set_sentby(icalparameter* value, const char* v); + +/* TZID */ +icalparameter* icalparameter_new_tzid(const char* v); +const char* icalparameter_get_tzid(icalparameter* value); +void icalparameter_set_tzid(icalparameter* value, const char* v); + +/* VALUE */ +icalparameter* icalparameter_new_value(icalparameter_value v); +icalparameter_value icalparameter_get_value(icalparameter* value); +void icalparameter_set_value(icalparameter* value, icalparameter_value v); + +/* X */ +icalparameter* icalparameter_new_x(const char* v); +const char* icalparameter_get_x(icalparameter* value); +void icalparameter_set_x(icalparameter* value, const char* v); + +/* X-LIC-ERRORTYPE */ +icalparameter* icalparameter_new_xlicerrortype(icalparameter_xlicerrortype v); +icalparameter_xlicerrortype icalparameter_get_xlicerrortype(icalparameter* value); +void icalparameter_set_xlicerrortype(icalparameter* value, icalparameter_xlicerrortype v); + +/* X-LIC-COMPARETYPE */ +icalparameter* icalparameter_new_xliccomparetype(icalparameter_xliccomparetype v); +icalparameter_xliccomparetype icalparameter_get_xliccomparetype(icalparameter* value); +void icalparameter_set_xliccomparetype(icalparameter* value, icalparameter_xliccomparetype v); + +#endif /*ICALPARAMETER_H*/ +/* -*- Mode: C -*- + ====================================================================== + FILE: icalderivedproperties.{c,h} + CREATOR: eric 09 May 1999 + + $Id$ + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + ======================================================================*/ + + +#ifndef ICALPROPERTY_H +#define ICALPROPERTY_H + +#include <time.h> + +typedef void icalproperty; + +icalproperty* icalproperty_new(icalproperty_kind kind); + +icalproperty* icalproperty_new_clone(icalproperty * prop); + +icalproperty* icalproperty_new_from_string(char* str); + +char* icalproperty_as_ical_string(icalproperty* prop); + +void icalproperty_free(icalproperty* prop); + +icalproperty_kind icalproperty_isa(icalproperty* property); +int icalproperty_isa_property(void* property); + +void icalproperty_add_parameter(icalproperty* prop,icalparameter* parameter); +void icalproperty_set_parameter(icalproperty* prop,icalparameter* parameter); + +void icalproperty_remove_parameter(icalproperty* prop, + icalparameter_kind kind); + +int icalproperty_count_parameters(icalproperty* prop); + +/* Iterate through the parameters */ +icalparameter* icalproperty_get_first_parameter(icalproperty* prop, + icalparameter_kind kind); +icalparameter* icalproperty_get_next_parameter(icalproperty* prop, + icalparameter_kind kind); +/* Access the value of the property */ +void icalproperty_set_value(icalproperty* prop, icalvalue* value); +icalvalue* icalproperty_get_value(icalproperty* prop); + +/* Deal with X properties */ + +void icalproperty_set_x_name(icalproperty* prop, char* name); +char* icalproperty_get_x_name(icalproperty* prop); + +/* Everything below this line is machine generated. Do not edit. */ + +/* METHOD */ +icalproperty* icalproperty_new_method(icalproperty_method v); +icalproperty* icalproperty_vanew_method(icalproperty_method v, ...); +void icalproperty_set_method(icalproperty* prop, icalproperty_method v); +icalproperty_method icalproperty_get_method(icalproperty* prop); + +/* X-LIC-MIMECID */ +icalproperty* icalproperty_new_xlicmimecid(const char* v); +icalproperty* icalproperty_vanew_xlicmimecid(const char* v, ...); +void icalproperty_set_xlicmimecid(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimecid(icalproperty* prop); + +/* LAST-MODIFIED */ +icalproperty* icalproperty_new_lastmodified(struct icaltimetype v); +icalproperty* icalproperty_vanew_lastmodified(struct icaltimetype v, ...); +void icalproperty_set_lastmodified(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_lastmodified(icalproperty* prop); + +/* UID */ +icalproperty* icalproperty_new_uid(const char* v); +icalproperty* icalproperty_vanew_uid(const char* v, ...); +void icalproperty_set_uid(icalproperty* prop, const char* v); +const char* icalproperty_get_uid(icalproperty* prop); + +/* PRODID */ +icalproperty* icalproperty_new_prodid(const char* v); +icalproperty* icalproperty_vanew_prodid(const char* v, ...); +void icalproperty_set_prodid(icalproperty* prop, const char* v); +const char* icalproperty_get_prodid(icalproperty* prop); + +/* STATUS */ +icalproperty* icalproperty_new_status(icalproperty_status v); +icalproperty* icalproperty_vanew_status(icalproperty_status v, ...); +void icalproperty_set_status(icalproperty* prop, icalproperty_status v); +icalproperty_status icalproperty_get_status(icalproperty* prop); + +/* DESCRIPTION */ +icalproperty* icalproperty_new_description(const char* v); +icalproperty* icalproperty_vanew_description(const char* v, ...); +void icalproperty_set_description(icalproperty* prop, const char* v); +const char* icalproperty_get_description(icalproperty* prop); + +/* DURATION */ +icalproperty* icalproperty_new_duration(struct icaldurationtype v); +icalproperty* icalproperty_vanew_duration(struct icaldurationtype v, ...); +void icalproperty_set_duration(icalproperty* prop, struct icaldurationtype v); +struct icaldurationtype icalproperty_get_duration(icalproperty* prop); + +/* CATEGORIES */ +icalproperty* icalproperty_new_categories(const char* v); +icalproperty* icalproperty_vanew_categories(const char* v, ...); +void icalproperty_set_categories(icalproperty* prop, const char* v); +const char* icalproperty_get_categories(icalproperty* prop); + +/* VERSION */ +icalproperty* icalproperty_new_version(const char* v); +icalproperty* icalproperty_vanew_version(const char* v, ...); +void icalproperty_set_version(icalproperty* prop, const char* v); +const char* icalproperty_get_version(icalproperty* prop); + +/* TZOFFSETFROM */ +icalproperty* icalproperty_new_tzoffsetfrom(int v); +icalproperty* icalproperty_vanew_tzoffsetfrom(int v, ...); +void icalproperty_set_tzoffsetfrom(icalproperty* prop, int v); +int icalproperty_get_tzoffsetfrom(icalproperty* prop); + +/* RRULE */ +icalproperty* icalproperty_new_rrule(struct icalrecurrencetype v); +icalproperty* icalproperty_vanew_rrule(struct icalrecurrencetype v, ...); +void icalproperty_set_rrule(icalproperty* prop, struct icalrecurrencetype v); +struct icalrecurrencetype icalproperty_get_rrule(icalproperty* prop); + +/* ATTENDEE */ +icalproperty* icalproperty_new_attendee(const char* v); +icalproperty* icalproperty_vanew_attendee(const char* v, ...); +void icalproperty_set_attendee(icalproperty* prop, const char* v); +const char* icalproperty_get_attendee(icalproperty* prop); + +/* CONTACT */ +icalproperty* icalproperty_new_contact(const char* v); +icalproperty* icalproperty_vanew_contact(const char* v, ...); +void icalproperty_set_contact(icalproperty* prop, const char* v); +const char* icalproperty_get_contact(icalproperty* prop); + +/* X-LIC-MIMECONTENTTYPE */ +icalproperty* icalproperty_new_xlicmimecontenttype(const char* v); +icalproperty* icalproperty_vanew_xlicmimecontenttype(const char* v, ...); +void icalproperty_set_xlicmimecontenttype(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimecontenttype(icalproperty* prop); + +/* X-LIC-MIMEOPTINFO */ +icalproperty* icalproperty_new_xlicmimeoptinfo(const char* v); +icalproperty* icalproperty_vanew_xlicmimeoptinfo(const char* v, ...); +void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop); + +/* RELATED-TO */ +icalproperty* icalproperty_new_relatedto(const char* v); +icalproperty* icalproperty_vanew_relatedto(const char* v, ...); +void icalproperty_set_relatedto(icalproperty* prop, const char* v); +const char* icalproperty_get_relatedto(icalproperty* prop); + +/* ORGANIZER */ +icalproperty* icalproperty_new_organizer(const char* v); +icalproperty* icalproperty_vanew_organizer(const char* v, ...); +void icalproperty_set_organizer(icalproperty* prop, const char* v); +const char* icalproperty_get_organizer(icalproperty* prop); + +/* COMMENT */ +icalproperty* icalproperty_new_comment(const char* v); +icalproperty* icalproperty_vanew_comment(const char* v, ...); +void icalproperty_set_comment(icalproperty* prop, const char* v); +const char* icalproperty_get_comment(icalproperty* prop); + +/* X-LIC-ERROR */ +icalproperty* icalproperty_new_xlicerror(const char* v); +icalproperty* icalproperty_vanew_xlicerror(const char* v, ...); +void icalproperty_set_xlicerror(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicerror(icalproperty* prop); + +/* TRIGGER */ +icalproperty* icalproperty_new_trigger(union icaltriggertype v); +icalproperty* icalproperty_vanew_trigger(union icaltriggertype v, ...); +void icalproperty_set_trigger(icalproperty* prop, union icaltriggertype v); +union icaltriggertype icalproperty_get_trigger(icalproperty* prop); + +/* CLASS */ +icalproperty* icalproperty_new_class(const char* v); +icalproperty* icalproperty_vanew_class(const char* v, ...); +void icalproperty_set_class(icalproperty* prop, const char* v); +const char* icalproperty_get_class(icalproperty* prop); + +/* X */ +icalproperty* icalproperty_new_x(const char* v); +icalproperty* icalproperty_vanew_x(const char* v, ...); +void icalproperty_set_x(icalproperty* prop, const char* v); +const char* icalproperty_get_x(icalproperty* prop); + +/* TZOFFSETTO */ +icalproperty* icalproperty_new_tzoffsetto(int v); +icalproperty* icalproperty_vanew_tzoffsetto(int v, ...); +void icalproperty_set_tzoffsetto(icalproperty* prop, int v); +int icalproperty_get_tzoffsetto(icalproperty* prop); + +/* TRANSP */ +icalproperty* icalproperty_new_transp(const char* v); +icalproperty* icalproperty_vanew_transp(const char* v, ...); +void icalproperty_set_transp(icalproperty* prop, const char* v); +const char* icalproperty_get_transp(icalproperty* prop); + +/* X-LIC-MIMEENCODING */ +icalproperty* icalproperty_new_xlicmimeencoding(const char* v); +icalproperty* icalproperty_vanew_xlicmimeencoding(const char* v, ...); +void icalproperty_set_xlicmimeencoding(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimeencoding(icalproperty* prop); + +/* SEQUENCE */ +icalproperty* icalproperty_new_sequence(int v); +icalproperty* icalproperty_vanew_sequence(int v, ...); +void icalproperty_set_sequence(icalproperty* prop, int v); +int icalproperty_get_sequence(icalproperty* prop); + +/* LOCATION */ +icalproperty* icalproperty_new_location(const char* v); +icalproperty* icalproperty_vanew_location(const char* v, ...); +void icalproperty_set_location(icalproperty* prop, const char* v); +const char* icalproperty_get_location(icalproperty* prop); + +/* REQUEST-STATUS */ +icalproperty* icalproperty_new_requeststatus(const char* v); +icalproperty* icalproperty_vanew_requeststatus(const char* v, ...); +void icalproperty_set_requeststatus(icalproperty* prop, const char* v); +const char* icalproperty_get_requeststatus(icalproperty* prop); + +/* EXDATE */ +icalproperty* icalproperty_new_exdate(struct icaltimetype v); +icalproperty* icalproperty_vanew_exdate(struct icaltimetype v, ...); +void icalproperty_set_exdate(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_exdate(icalproperty* prop); + +/* TZID */ +icalproperty* icalproperty_new_tzid(const char* v); +icalproperty* icalproperty_vanew_tzid(const char* v, ...); +void icalproperty_set_tzid(icalproperty* prop, const char* v); +const char* icalproperty_get_tzid(icalproperty* prop); + +/* RESOURCES */ +icalproperty* icalproperty_new_resources(const char* v); +icalproperty* icalproperty_vanew_resources(const char* v, ...); +void icalproperty_set_resources(icalproperty* prop, const char* v); +const char* icalproperty_get_resources(icalproperty* prop); + +/* TZURL */ +icalproperty* icalproperty_new_tzurl(const char* v); +icalproperty* icalproperty_vanew_tzurl(const char* v, ...); +void icalproperty_set_tzurl(icalproperty* prop, const char* v); +const char* icalproperty_get_tzurl(icalproperty* prop); + +/* REPEAT */ +icalproperty* icalproperty_new_repeat(int v); +icalproperty* icalproperty_vanew_repeat(int v, ...); +void icalproperty_set_repeat(icalproperty* prop, int v); +int icalproperty_get_repeat(icalproperty* prop); + +/* PRIORITY */ +icalproperty* icalproperty_new_priority(int v); +icalproperty* icalproperty_vanew_priority(int v, ...); +void icalproperty_set_priority(icalproperty* prop, int v); +int icalproperty_get_priority(icalproperty* prop); + +/* FREEBUSY */ +icalproperty* icalproperty_new_freebusy(struct icalperiodtype v); +icalproperty* icalproperty_vanew_freebusy(struct icalperiodtype v, ...); +void icalproperty_set_freebusy(icalproperty* prop, struct icalperiodtype v); +struct icalperiodtype icalproperty_get_freebusy(icalproperty* prop); + +/* DTSTART */ +icalproperty* icalproperty_new_dtstart(struct icaltimetype v); +icalproperty* icalproperty_vanew_dtstart(struct icaltimetype v, ...); +void icalproperty_set_dtstart(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_dtstart(icalproperty* prop); + +/* RECURRENCE-ID */ +icalproperty* icalproperty_new_recurrenceid(struct icaltimetype v); +icalproperty* icalproperty_vanew_recurrenceid(struct icaltimetype v, ...); +void icalproperty_set_recurrenceid(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_recurrenceid(icalproperty* prop); + +/* SUMMARY */ +icalproperty* icalproperty_new_summary(const char* v); +icalproperty* icalproperty_vanew_summary(const char* v, ...); +void icalproperty_set_summary(icalproperty* prop, const char* v); +const char* icalproperty_get_summary(icalproperty* prop); + +/* DTEND */ +icalproperty* icalproperty_new_dtend(struct icaltimetype v); +icalproperty* icalproperty_vanew_dtend(struct icaltimetype v, ...); +void icalproperty_set_dtend(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_dtend(icalproperty* prop); + +/* TZNAME */ +icalproperty* icalproperty_new_tzname(const char* v); +icalproperty* icalproperty_vanew_tzname(const char* v, ...); +void icalproperty_set_tzname(icalproperty* prop, const char* v); +const char* icalproperty_get_tzname(icalproperty* prop); + +/* RDATE */ +icalproperty* icalproperty_new_rdate(struct icalperiodtype v); +icalproperty* icalproperty_vanew_rdate(struct icalperiodtype v, ...); +void icalproperty_set_rdate(icalproperty* prop, struct icalperiodtype v); +struct icalperiodtype icalproperty_get_rdate(icalproperty* prop); + +/* X-LIC-MIMEFILENAME */ +icalproperty* icalproperty_new_xlicmimefilename(const char* v); +icalproperty* icalproperty_vanew_xlicmimefilename(const char* v, ...); +void icalproperty_set_xlicmimefilename(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimefilename(icalproperty* prop); + +/* URL */ +icalproperty* icalproperty_new_url(const char* v); +icalproperty* icalproperty_vanew_url(const char* v, ...); +void icalproperty_set_url(icalproperty* prop, const char* v); +const char* icalproperty_get_url(icalproperty* prop); + +/* X-LIC-CLUSTERCOUNT */ +icalproperty* icalproperty_new_xlicclustercount(int v); +icalproperty* icalproperty_vanew_xlicclustercount(int v, ...); +void icalproperty_set_xlicclustercount(icalproperty* prop, int v); +int icalproperty_get_xlicclustercount(icalproperty* prop); + +/* ATTACH */ +icalproperty* icalproperty_new_attach(struct icalattachtype v); +icalproperty* icalproperty_vanew_attach(struct icalattachtype v, ...); +void icalproperty_set_attach(icalproperty* prop, struct icalattachtype v); +struct icalattachtype icalproperty_get_attach(icalproperty* prop); + +/* EXRULE */ +icalproperty* icalproperty_new_exrule(struct icalrecurrencetype v); +icalproperty* icalproperty_vanew_exrule(struct icalrecurrencetype v, ...); +void icalproperty_set_exrule(icalproperty* prop, struct icalrecurrencetype v); +struct icalrecurrencetype icalproperty_get_exrule(icalproperty* prop); + +/* QUERY */ +icalproperty* icalproperty_new_query(const char* v); +icalproperty* icalproperty_vanew_query(const char* v, ...); +void icalproperty_set_query(icalproperty* prop, const char* v); +const char* icalproperty_get_query(icalproperty* prop); + +/* PERCENT-COMPLETE */ +icalproperty* icalproperty_new_percentcomplete(int v); +icalproperty* icalproperty_vanew_percentcomplete(int v, ...); +void icalproperty_set_percentcomplete(icalproperty* prop, int v); +int icalproperty_get_percentcomplete(icalproperty* prop); + +/* CALSCALE */ +icalproperty* icalproperty_new_calscale(const char* v); +icalproperty* icalproperty_vanew_calscale(const char* v, ...); +void icalproperty_set_calscale(icalproperty* prop, const char* v); +const char* icalproperty_get_calscale(icalproperty* prop); + +/* CREATED */ +icalproperty* icalproperty_new_created(struct icaltimetype v); +icalproperty* icalproperty_vanew_created(struct icaltimetype v, ...); +void icalproperty_set_created(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_created(icalproperty* prop); + +/* GEO */ +icalproperty* icalproperty_new_geo(struct icalgeotype v); +icalproperty* icalproperty_vanew_geo(struct icalgeotype v, ...); +void icalproperty_set_geo(icalproperty* prop, struct icalgeotype v); +struct icalgeotype icalproperty_get_geo(icalproperty* prop); + +/* X-LIC-MIMECHARSET */ +icalproperty* icalproperty_new_xlicmimecharset(const char* v); +icalproperty* icalproperty_vanew_xlicmimecharset(const char* v, ...); +void icalproperty_set_xlicmimecharset(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimecharset(icalproperty* prop); + +/* COMPLETED */ +icalproperty* icalproperty_new_completed(struct icaltimetype v); +icalproperty* icalproperty_vanew_completed(struct icaltimetype v, ...); +void icalproperty_set_completed(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_completed(icalproperty* prop); + +/* DTSTAMP */ +icalproperty* icalproperty_new_dtstamp(struct icaltimetype v); +icalproperty* icalproperty_vanew_dtstamp(struct icaltimetype v, ...); +void icalproperty_set_dtstamp(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_dtstamp(icalproperty* prop); + +/* DUE */ +icalproperty* icalproperty_new_due(struct icaltimetype v); +icalproperty* icalproperty_vanew_due(struct icaltimetype v, ...); +void icalproperty_set_due(icalproperty* prop, struct icaltimetype v); +struct icaltimetype icalproperty_get_due(icalproperty* prop); + +/* ACTION */ +icalproperty* icalproperty_new_action(const char* v); +icalproperty* icalproperty_vanew_action(const char* v, ...); +void icalproperty_set_action(icalproperty* prop, const char* v); +const char* icalproperty_get_action(icalproperty* prop); +#endif /*ICALPROPERTY_H*/ +/*====================================================================== + FILE: pvl.h + CREATOR: eric November, 1995 + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org +======================================================================*/ + + +#ifndef __PVL_H__ +#define __PVL_H__ + +typedef void* pvl_list; +typedef void* pvl_elem; + +/* + struct pvl_elem_t + + This type is private. Always use pvl_elem instead. The struct would + not even appear in this header except to make code in the USE_MACROS + blocks work + + */ +typedef struct pvl_elem_t +{ + int MAGIC; /* Magic Identifier */ + void *d; /* Pointer to data user is storing */ + struct pvl_elem_t *next; /* Next element */ + struct pvl_elem_t *prior; /* prior element */ +} pvl_elem_t; + + + +/* This global is incremented for each call to pvl_new_element(); it gives each + * list a unique identifer */ + +extern int pvl_elem_count; +extern int pvl_list_count; + +/* Create new lists or elements */ +pvl_elem pvl_new_element(void* d, pvl_elem next,pvl_elem prior); +pvl_list pvl_newlist(void); +void pvl_free(pvl_list); + +/* Add, remove, or get the head of the list */ +void pvl_unshift(pvl_list l,void *d); +void* pvl_shift(pvl_list l); +pvl_elem pvl_head(pvl_list); + +/* Add, remove or get the tail of the list */ +void pvl_push(pvl_list l,void *d); +void* pvl_pop(pvl_list l); +pvl_elem pvl_tail(pvl_list); + +/* Insert elements in random places */ +typedef int (*pvl_comparef)(void* a, void* b); /* a, b are of the data type*/ +void pvl_insert_ordered(pvl_list l,pvl_comparef f,void *d); +void pvl_insert_after(pvl_list l,pvl_elem e,void *d); +void pvl_insert_before(pvl_list l,pvl_elem e,void *d); + +/* Remove an element, or clear the entire list */ +void* pvl_remove(pvl_list,pvl_elem); /* Remove element, return data */ +void pvl_clear(pvl_list); /* Remove all elements, de-allocate all data */ + +int pvl_count(pvl_list); + +/* Navagate the list */ +pvl_elem pvl_next(pvl_elem e); +pvl_elem pvl_prior(pvl_elem e); + +/* get the data in the list */ +#ifndef PVL_USE_MACROS +void* pvl_data(pvl_elem); +#else +#define pvl_data(x) x==0 ? 0 : ((struct pvl_elem_t *)x)->d; +#endif + + +/* Find an element for which a function returns true */ +typedef int (*pvl_findf)(void* a, void* b); /*a is list elem, b is other data*/ +pvl_elem pvl_find(pvl_list l,pvl_findf f,void* v); +pvl_elem pvl_find_next(pvl_list l,pvl_findf f,void* v); + +/* Pass each element in the list to a function */ +typedef void (*pvl_applyf)(void* a, void* b); /*a is list elem, b is other data*/ +void pvl_apply(pvl_list l,pvl_applyf f, void *v); + + +#endif /* __PVL_H__ */ + + + + + +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalcomponent.h + CREATOR: eric 20 March 1999 + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The original code is icalcomponent.h + +======================================================================*/ + +#ifndef ICALCOMPONENT_H +#define ICALCOMPONENT_H + + +typedef void icalcomponent; + +/* This is exposed so that callers will not have to allocate and + deallocate iterators. Pretend that you can't see it. */ +typedef struct icalcompiter +{ + icalcomponent_kind kind; + pvl_elem iter; + +} icalcompiter; + +icalcomponent* icalcomponent_new(icalcomponent_kind kind); +icalcomponent* icalcomponent_new_clone(icalcomponent* component); +icalcomponent* icalcomponent_new_from_string(char* str); +icalcomponent* icalcomponent_vanew(icalcomponent_kind kind, ...); +void icalcomponent_free(icalcomponent* component); + +char* icalcomponent_as_ical_string(icalcomponent* component); + +int icalcomponent_is_valid(icalcomponent* component); + +icalcomponent_kind icalcomponent_isa(icalcomponent* component); + +int icalcomponent_isa_component (void* component); + +/* + * Working with properties + */ + +void icalcomponent_add_property(icalcomponent* component, + icalproperty* property); + +void icalcomponent_remove_property(icalcomponent* component, + icalproperty* property); + +int icalcomponent_count_properties(icalcomponent* component, + icalproperty_kind kind); + +/* Iterate through the properties */ +icalproperty* icalcomponent_get_current_property(icalcomponent* component); + +icalproperty* icalcomponent_get_first_property(icalcomponent* component, + icalproperty_kind kind); +icalproperty* icalcomponent_get_next_property(icalcomponent* component, + icalproperty_kind kind); + +/* Return a null-terminated array of icalproperties*/ + +icalproperty** icalcomponent_get_properties(icalcomponent* component, + icalproperty_kind kind); + + +/* + * Working with components + */ + + +void icalcomponent_add_component(icalcomponent* parent, + icalcomponent* child); + +void icalcomponent_remove_component(icalcomponent* parent, + icalcomponent* child); + +int icalcomponent_count_components(icalcomponent* component, + icalcomponent_kind kind); + +/* Iteration Routines. There are two forms of iterators, internal and +external. The internal ones came first, and are almost completely +sufficient, but they fail badly when you want to construct a loop that +removes components from the container. + +The internal iterators are deprecated. */ + +/* Using external iterators */ +icalcompiter icalcomponent_begin_component(icalcomponent* component, + icalcomponent_kind kind); + +icalcompiter icalcomponent_end_component(icalcomponent* component, + icalcomponent_kind kind); + +/* Iterate through components */ +icalcomponent* icalcomponent_get_current_component (icalcomponent* component); + +icalcomponent* icalcomponent_get_first_component(icalcomponent* component, + icalcomponent_kind kind); +icalcomponent* icalcomponent_get_next_component(icalcomponent* component, + icalcomponent_kind kind); + + + + +/* Working with embedded error properties */ + +int icalcomponent_count_errors(icalcomponent* component); + +/* Remove all X-LIC-ERROR properties*/ +void icalcomponent_strip_errors(icalcomponent* component); + +/* Convert some X-LIC-ERROR properties into RETURN-STATUS properties*/ +void icalcomponent_convert_errors(icalcomponent* component); + +/* Internal operations. You don't see these... */ +icalcomponent* icalcomponent_get_parent(icalcomponent* component); +void icalcomponent_set_parent(icalcomponent* component, + icalcomponent* parent); +/* External component iterator */ +icalcomponent* icalcompiter_next(icalcompiter* i); +icalcomponent* icalcompiter_prior(icalcompiter* i); +icalcomponent* icalcompiter_deref(icalcompiter* i); + +/************* Derived class methods. **************************** + +If the code was in an OO language, the remaining routines would be +members of classes derived from icalcomponent. Don't call them on the +wrong component subtypes. */ + +/* For VCOMPONENT: Return a reference to the first VEVENT, VTODO or + VJOURNAL */ +icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c); + +/* For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end + times of an event in UTC */ +struct icaltime_span icalcomponent_get_span(icalcomponent* comp); + +/******************** Convienience routines **********************/ + +void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v); +struct icaltimetype icalcomponent_get_dtstart(icalcomponent* comp); + +/* For the icalcomponent routines only, dtend and duration are tied + together. If you call the set routine for one and the other exists, + the routine will calculate the change to the other. That is, if + there is a DTEND and you call set_duration, the routine will modify + DTEND to be the sum of DTSTART and the duration. If you call a get + routine for one and the other exists, the routine will calculate + the return value. If you call a set routine and neither exists, the + routine will create the apcompriate comperty */ + + +struct icaltimetype icalcomponent_get_dtend(icalcomponent* comp); +void icalcomponent_set_dtend(icalcomponent* comp, struct icaltimetype v); + +void icalcomponent_set_duration(icalcomponent* comp, + struct icaldurationtype v); +struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp); + +void icalcomponent_set_method(icalcomponent* comp, icalproperty_method method); +icalproperty_method icalcomponent_get_method(icalcomponent* comp); + +struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp); +void icalcomponent_set_dtstamp(icalcomponent* comp, struct icaltimetype v); + + +void icalcomponent_set_summary(icalcomponent* comp, const char* v); +const char* icalcomponent_get_summary(icalcomponent* comp); + +void icalcomponent_set_comment(icalcomponent* comp, const char* v); +const char* icalcomponent_get_comment(icalcomponent* comp); + +void icalcomponent_set_organizer(icalcomponent* comp, const char* v); +const char* icalcomponent_get_organizer(icalcomponent* comp); + +void icalcomponent_set_uid(icalcomponent* comp, const char* v); +const char* icalcomponent_get_uid(icalcomponent* comp); + +void icalcomponent_set_recurrenceid(icalcomponent* comp, + struct icaltimetype v); +struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent* comp); + +/*************** Type Specific routines ***************/ + +icalcomponent* icalcomponent_new_vcalendar(); +icalcomponent* icalcomponent_new_vevent(); +icalcomponent* icalcomponent_new_vtodo(); +icalcomponent* icalcomponent_new_vjournal(); +icalcomponent* icalcomponent_new_vfreebusy(); +icalcomponent* icalcomponent_new_vtimezone(); +icalcomponent* icalcomponent_new_xstandard(); +icalcomponent* icalcomponent_new_xdaylight(); + + + +#endif /* !ICALCOMPONENT_H */ + + + +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalparser.h + CREATOR: eric 20 April 1999 + + $Id$ + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The original code is icalparser.h + +======================================================================*/ + + +#ifndef ICALPARSER_H +#define ICALPARSER_H + + +#include <stdio.h> /* For FILE* */ + +typedef void* icalparser; + + +/*********************************************************************** + * Line-oriented parsing. + * + * Create a new parser via icalparse_new_parser, then add ines one at + * a time with icalparse_add_line(). icalparser_add_line() will return + * non-zero when it has finished with a component. + ***********************************************************************/ + +typedef enum icalparser_state { + ICALPARSER_ERROR, + ICALPARSER_SUCCESS, + ICALPARSER_BEGIN_COMP, + ICALPARSER_END_COMP, + ICALPARSER_IN_PROGRESS +} icalparser_state; + +icalparser* icalparser_new(void); +icalcomponent* icalparser_add_line(icalparser* parser, char* str ); +icalcomponent* icalparser_claim(icalparser* parser); +icalcomponent* icalparser_clean(icalparser* parser); +icalparser_state icalparser_get_state(icalparser* parser); +void icalparser_free(icalparser* parser); + + +/*********************************************************************** + * Message oriented parsing. icalparser_parse takes a string that + * holds the text ( in RFC 2445 format ) and returns a pointer to an + * icalcomponent. The caller owns the memory. line_gen_func is a + * pointer to a function that returns one content line per invocation + **********************************************************************/ + +icalcomponent* icalparser_parse(icalparser *parser, + char* (*line_gen_func)(char *s, size_t size, void *d)); + +/* Set the data that icalparser_parse will give to the line_gen_func + as the parameter 'd'*/ +void icalparser_set_gen_data(icalparser* parser, void* data); + + +icalcomponent* icalparser_parse_string(char* str); + + +/*********************************************************************** + * Parser support functions + ***********************************************************************/ + +/* Use the flex/bison parser to turn a string into a value type */ +icalvalue* icalparser_parse_value(icalvalue_kind kind, + const char* str, icalcomponent** errors); + +/* Given a line generator function, return a single iCal content line.*/ +char* icalparser_get_line(icalparser* parser, char* (*line_gen_func)(char *s, size_t size, void *d)); + +char* string_line_generator(char *out, size_t buf_size, void *d); + +#endif /* !ICALPARSE_H */ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalmemory.h + CREATOR: eric 30 June 1999 + + + $Id$ + $Locker$ + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The Initial Developer of the Original Code is Eric Busboom + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org +======================================================================*/ + +#ifndef ICALMEMORY_H +#define ICALMEMORY_H + +#include <sys/types.h> /* for size_t */ + + +/* Tmp buffers are managed by ical. References can be returned to the + caller, although the caller will not own the memory. */ + +void* icalmemory_tmp_buffer(size_t size); +char* icalmemory_tmp_copy(const char* str); + +/* Add an externally allocated buffer to the ring. */ +void icalmemory_add_tmp_buffer(void*); + + +/* Free all memory used in the ring */ +void icalmemory_free_ring(void); + +/* Non-tmp buffers must be freed. These are mostly wrappers around + * malloc, etc, but are used so the caller can change the memory + * allocators in a future version of the library */ + +void* icalmemory_new_buffer(size_t size); +void* icalmemory_resize_buffer(void* buf, size_t size); +void icalmemory_free_buffer(void* buf); + +/* icalmemory_append_string will copy the string 'string' to the + buffer 'buf' starting at position 'pos', reallocing 'buf' if it is + too small. 'buf_size' is the size of 'buf' and will be changed if + 'buf' is reallocated. 'pos' will point to the last byte of the new + string in 'buf', usually a '\0' */ + +/* THESE ROUTINES CAN NOT BE USED ON TMP BUFFERS. Only use them on + normally allocated memory, or on buffers created from + icalmemory_new_buffer, never with buffers created by + icalmemory_tmp_buffer. If icalmemory_append_string has to resize a + buffer on the ring, the ring will loose track of it an you will + have memory problems. */ + +void icalmemory_append_string(char** buf, char** pos, size_t* buf_size, + const char* string); + +/* icalmemory_append_char is similar, but is appends a character instead of a string */ +void icalmemory_append_char(char** buf, char** pos, size_t* buf_size, + char ch); + +/* A wrapper around strdup */ +char* icalmemory_strdup(const char *s); + +#endif /* !ICALMEMORY_H */ + + + +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalerror.h + CREATOR: eric 09 May 1999 + + $Id$ + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The original code is icalerror.h + +======================================================================*/ + + +#ifndef ICALERROR_H +#define ICALERROR_H + +#include <assert.h> +#include <stdio.h> /* For icalerror_warn() */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + +/* This routine is called before any error is triggered. It is called + by icalerror_set_errno, so it does not appear in all of the macros + below */ +void icalerror_stop_here(void); + +void icalerror_crash_here(void); + +#ifdef ICAL_ERRORS_ARE_FATAL +#undef NDEBUG +#endif + +#define icalerror_check_value_type(value,type); +#define icalerror_check_property_type(value,type); +#define icalerror_check_parameter_type(value,type); +#define icalerror_check_component_type(value,type); + +/* Assert with a message */ +#ifdef ICAL_ERRORS_ARE_FATAL + +#ifdef __GNUC__ +#define icalerror_assert(test,message) if(!(test)){fprintf(stderr,"%s(), %s:%d: %s\n",__FUNCTION__,__FILE__,__LINE__,message);icalerror_stop_here(); abort();} +#else /*__GNUC__*/ +#define icalerror_assert(test,message) if(!(test)){fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);icalerror_stop_here(); abort();} +#endif /*__GNUC__*/ +#else +#define icalerror_assert(test,message) +#endif + +/* Check & abort if check fails */ +#ifdef ICAL_ERRORS_ARE_FATAL +#define icalerror_check_arg(test,arg) icalerror_stop_here();assert(test) +#else +#define icalerror_check_arg(test,arg) +#endif +/* Check & return void if check fails*/ + +#ifdef ICAL_ERRORS_ARE_FATAL +#define icalerror_check_arg_rv(test,arg) icalerror_stop_here();assert(test); +#else +#define icalerror_check_arg_rv(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return; } +#endif + +/* Check & return 0 if check fails*/ +#ifdef ICAL_ERRORS_ARE_FATAL +#define icalerror_check_arg_rz(test,arg) icalerror_stop_here();assert(test); +#else +#define icalerror_check_arg_rz(test,arg) if(!(test)) {icalerror_set_errno(ICAL_BADARG_ERROR); return 0;} +#endif + + +/* Check & return an error if check fails*/ +#ifdef ICAL_ERRORS_ARE_FATAL +#define icalerror_check_arg_re(test,arg,error) icalerror_stop_here();assert(test); +#else +#define icalerror_check_arg_re(test,arg,error) if(!(test)) {icalerror_stop_here(); return error;} +#endif + + +/* Warning messages */ + +#ifdef ICAL_ERRORS_ARE_FATAL + +#ifdef __GNUC__ +#define icalerror_warn(message) {fprintf(stderr,"%s(), %s:%d: %s\n",__FUNCTION__,__FILE__,__LINE__,message); abort();} +#else /* __GNU_C__ */ +#define icalerror_warn(message) {fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message); abort();} +#endif /* __GNU_C__ */ + +#else /*ICAL_ERRORS_ARE_FATAL */ + +#ifdef __GNUC__ +#define icalerror_warn(message) {fprintf(stderr,"%s(), %s:%d: %s\n",__FUNCTION__,__FILE__,__LINE__,message);} +#else /* __GNU_C__ */ +#define icalerror_warn(message) {fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);} +#endif /* __GNU_C__ */ + +#endif /*ICAL_ERRORS_ARE_FATAL*/ + +typedef enum icalerrorenum { + + ICAL_BADARG_ERROR, + ICAL_NEWFAILED_ERROR, + ICAL_MALFORMEDDATA_ERROR, + ICAL_PARSE_ERROR, + ICAL_INTERNAL_ERROR, /* Like assert --internal consist. prob */ + ICAL_FILE_ERROR, + ICAL_ALLOCATION_ERROR, + ICAL_USAGE_ERROR, + ICAL_NO_ERROR, + ICAL_MULTIPLEINCLUSION_ERROR, + ICAL_TIMEDOUT_ERROR, + ICAL_UNKNOWN_ERROR /* Used for problems in input to icalerror_strerror()*/ + +} icalerrorenum; + +extern icalerrorenum icalerrno; + + +void icalerror_clear_errno(void); +void icalerror_set_errno(icalerrorenum); + +char* icalerror_strerror(icalerrorenum e); + + +#endif /* !ICALERROR_H */ + + + +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalrestriction.h + CREATOR: eric 24 April 1999 + + $Id$ + + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The original code is icalrestriction.h + + Contributions from: + Graham Davison (g.m.davison@computer.org) + + +======================================================================*/ + + +#ifndef ICALRESTRICTION_H +#define ICALRESTRICTION_H + +/* These must stay in this order for icalrestriction_compare to work */ +typedef enum icalrestriction_kind { + ICAL_RESTRICTION_NONE=0, /* 0 */ + ICAL_RESTRICTION_ZERO, /* 1 */ + ICAL_RESTRICTION_ONE, /* 2 */ + ICAL_RESTRICTION_ZEROPLUS, /* 3 */ + ICAL_RESTRICTION_ONEPLUS, /* 4 */ + ICAL_RESTRICTION_ZEROORONE, /* 5 */ + ICAL_RESTRICTION_ONEEXCLUSIVE, /* 6 */ + ICAL_RESTRICTION_ONEMUTUAL, /* 7 */ + ICAL_RESTRICTION_UNKNOWN /* 8 */ +} icalrestriction_kind; + +int +icalrestriction_compare(icalrestriction_kind restr, int count); + + +int +icalrestriction_is_parameter_allowed(icalproperty_kind property, + icalparameter_kind parameter); + +int icalrestriction_check(icalcomponent* comp); + + +#endif /* !ICALRESTRICTION_H */ + + + +/* -*- Mode: C -*- + ====================================================================== + FILE: sspm.h Mime Parser + CREATOR: eric 25 June 2000 + + $Id$ + $Locker$ + + The contents of this file are subject to the Mozilla Public License + Version 1.0 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and + limitations under the License. + + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + The Initial Developer of the Original Code is Eric Busboom + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + ======================================================================*/ + +#ifndef SSPM_H +#define SSPM_H + +enum sspm_major_type { + SSPM_NO_MAJOR_TYPE, + SSPM_TEXT_MAJOR_TYPE, + SSPM_IMAGE_MAJOR_TYPE, + SSPM_AUDIO_MAJOR_TYPE, + SSPM_VIDEO_MAJOR_TYPE, + SSPM_APPLICATION_MAJOR_TYPE, + SSPM_MULTIPART_MAJOR_TYPE, + SSPM_MESSAGE_MAJOR_TYPE, + SSPM_UNKNOWN_MAJOR_TYPE +}; + +enum sspm_minor_type { + SSPM_NO_MINOR_TYPE, + SSPM_ANY_MINOR_TYPE, + SSPM_PLAIN_MINOR_TYPE, + SSPM_RFC822_MINOR_TYPE, + SSPM_DIGEST_MINOR_TYPE, + SSPM_CALENDAR_MINOR_TYPE, + SSPM_MIXED_MINOR_TYPE, + SSPM_RELATED_MINOR_TYPE, + SSPM_ALTERNATIVE_MINOR_TYPE, + SSPM_PARALLEL_MINOR_TYPE, + SSPM_UNKNOWN_MINOR_TYPE +}; + +enum sspm_encoding { + SSPM_NO_ENCODING, + SSPM_QUOTED_PRINTABLE_ENCODING, + SSPM_8BIT_ENCODING, + SSPM_7BIT_ENCODING, + SSPM_BINARY_ENCODING, + SSPM_BASE64_ENCODING, + SSPM_UNKNOWN_ENCODING +}; + +enum sspm_error{ + SSPM_NO_ERROR, + SSPM_UNEXPECTED_BOUNDARY_ERROR, + SSPM_WRONG_BOUNDARY_ERROR, + SSPM_NO_BOUNDARY_ERROR, + SSPM_NO_HEADER_ERROR, + SSPM_MALFORMED_HEADER_ERROR +}; + + +struct sspm_header +{ + int def; + char* boundary; + enum sspm_major_type major; + enum sspm_minor_type minor; + char *minor_text; + char ** content_type_params; + char* charset; + enum sspm_encoding encoding; + char* filename; + char* content_id; + enum sspm_error error; + char* error_text; +}; + +struct sspm_part { + struct sspm_header header; + int level; + size_t data_size; + void *data; +}; + +struct sspm_action_map { + enum sspm_major_type major; + enum sspm_minor_type minor; + void* (*new_part)(); + void (*add_line)(void *part, struct sspm_header *header, + char* line, size_t size); + void* (*end_part)(void* part); + void (*free_part)(void *part); +}; + +char* sspm_major_type_string(enum sspm_major_type type); +char* sspm_minor_type_string(enum sspm_major_type type); +char* sspm_encoding_string(enum sspm_encoding type); + +int sspm_parse_mime(struct sspm_part *parts, + size_t max_parts, + struct sspm_action_map *actions, + char* (*get_string)(char *s, size_t size, void* data), + void *get_string_data, + struct sspm_header *first_header + ); + +void sspm_free_parts(struct sspm_part *parts, size_t max_parts); + +char *decode_quoted_printable(char *dest, + char *src, + size_t *size); +char *decode_base64(char *dest, + char *src, + size_t *size); + + +int sspm_write_mime(struct sspm_part *parts,size_t num_parts, + char **output_string, char* header); + +#endif /*SSPM_H*/ +/* -*- Mode: C -*- */ +/*====================================================================== + FILE: icalmime.h + CREATOR: eric 26 July 2000 + + + $Id$ + $Locker$ + + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org + + This program is free software; you can redistribute it and/or modify + it under the terms of either: + + The LGPL as published by the Free Software Foundation, version + 2.1, available at: http://www.fsf.org/copyleft/lesser.html + + Or: + + The Mozilla Public License Version 1.0. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + +======================================================================*/ + +#ifndef ICALMIME_H +#define ICALMIME_H + + +icalcomponent* icalmime_parse( char* (*line_gen_func)(char *s, size_t size, + void *d), + void *data); + +/* The inverse of icalmime_parse, not implemented yet. Use sspm.h directly. */ +char* icalmime_as_mime_string(char* component); -#endif /* !ICAL_H */ +#endif /* !ICALMIME_H */ diff --git a/libical/src/libical/icalcomponent.c b/libical/src/libical/icalcomponent.c index 65d1d55e36..2b8ddb5137 100644 --- a/libical/src/libical/icalcomponent.c +++ b/libical/src/libical/icalcomponent.c @@ -26,28 +26,21 @@ #include "config.h" #endif -#include "ical.h" +#include "icalcomponent.h" #include "pvl.h" /* "Pointer-to-void list" */ +#include "icalerror.h" +#include "icalmemory.h" +#include "icalenums.h" +#include "icaltime.h" + #include <stdlib.h> /* for malloc */ #include <stdarg.h> /* for va_list, etc */ #include <errno.h> -#include "icalerror.h" #include <assert.h> #include <stdio.h> /* for fprintf */ -#include "icalmemory.h" -#include "icalenums.h" #define MAX_TMP 1024 - -/* icalproperty functions that only components get to use */ -void icalproperty_set_parent(icalproperty* property, - icalcomponent* component); - -icalcomponent* icalproperty_get_parent(icalproperty* property); - - - struct icalcomponent_impl { char id[5]; @@ -60,6 +53,15 @@ struct icalcomponent_impl icalcomponent* parent; }; +/* icalproperty functions that only components get to use */ +void icalproperty_set_parent(icalproperty* property, + icalcomponent* component); +icalcomponent* icalproperty_get_parent(icalproperty* property); +void icalcomponent_add_children(struct icalcomponent_impl *impl,va_list args); +icalcomponent* icalcomponent_new_impl (icalcomponent_kind kind); +int icalcomponent_property_sorter(void *a, void *b); + + void icalcomponent_add_children(struct icalcomponent_impl *impl,va_list args) { void* vp; @@ -255,7 +257,7 @@ icalcomponent_as_ical_string (icalcomponent* component) icalproperty *p; icalcomponent_kind kind = icalcomponent_isa(component); - char* kind_string; + const char* kind_string; buf = icalmemory_new_buffer(buf_size); buf_ptr = buf; @@ -359,7 +361,7 @@ icalcomponent_isa_component (void* component) int icalcomponent_property_sorter(void *a, void *b) { icalproperty_kind kinda, kindb; - char *ksa, *ksb; + const char *ksa, *ksb; kinda = icalproperty_isa((icalproperty*)a); kindb = icalproperty_isa((icalproperty*)b); @@ -530,7 +532,7 @@ icalcomponent_add_component (icalcomponent* parent, icalcomponent* child) impl = (struct icalcomponent_impl*)parent; cimpl = (struct icalcomponent_impl*)child; - icalerror_assert( (cimpl->parent ==0),"The child component has already been added to a parent component. Remove the component with icalcomponent_remove_componenet before calling icalcomponent_add_component"); + icalerror_assert( (cimpl->parent ==0),"The child component has already been added to a parent component. Remove the component with icalcomponent_remove_component before calling icalcomponent_add_component"); cimpl->parent = parent; @@ -580,8 +582,7 @@ icalcomponent_count_components (icalcomponent* component, { int count=0; pvl_elem itr; - struct icalcomponent_impl *impl = - (struct icalcomponent_impl*)component; + struct icalcomponent_impl *impl = (struct icalcomponent_impl*)component; icalerror_check_arg_rz( (component!=0), "component"); @@ -662,9 +663,186 @@ icalcomponent_get_next_component (icalcomponent* component, icalcomponent_kind k return 0; } +icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c) +{ + icalcomponent *comp; -icalproperty** -icalcomponent_get_component (icalcomponent* component, icalproperty_kind kind); + for(comp = icalcomponent_get_first_component(c,ICAL_ANY_COMPONENT); + comp != 0; + comp = icalcomponent_get_next_component(c,ICAL_ANY_COMPONENT)){ + + icalcomponent_kind kind = icalcomponent_isa(comp); + + if(kind == ICAL_VEVENT_COMPONENT || + kind == ICAL_VTODO_COMPONENT || + kind == ICAL_VJOURNAL_COMPONENT ){ + return comp; + } + } + return 0; +} + +time_t icalcomponent_convert_time(icalproperty *p) +{ + struct icaltimetype sict; + time_t convt; + icalproperty *tzp; + + + /* Though it says _dtstart, it will work for dtend too */ + sict = icalproperty_get_dtstart(p); + + tzp = icalproperty_get_first_parameter(p,ICAL_TZID_PARAMETER); + + if (sict.is_utc == 1 && tzp != 0){ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + icalerror_warn("icalcomponent_get_span: component has a UTC DTSTART with a timezone specified "); + return 0; + } + + if(sict.is_utc == 1){ + /* _as_timet will use gmtime() to do the conversion */ + convt = icaltime_as_timet(sict); + +#ifdef TEST_CONVERT_TIME + printf("convert time: use as_timet:\n %s\n %s", + icalproperty_as_ical_string(p), ctime(&convt)); +#endif + + } else if (sict.is_utc == 0 && tzp == 0 ) { + time_t offset; + + /* _as_timet will use localtime() to do the conversion */ + convt = icaltime_as_timet(sict); + offset = icaltime_local_utc_offset(); + convt += offset; + +#ifdef TEST_CONVERT_TIME + printf("convert time: use as_timet and adjust:\n %s\n %s", + icalproperty_as_ical_string(p), ctime(&convt)); +#endif + } else { + /* Convert the time to UTC for the named timezone*/ + const char* timezone = icalparameter_get_tzid(tzp); + convt = icaltime_as_timet(icaltime_as_utc(sict,timezone)); + +#ifdef TEST_CONVERT_TIME + printf("convert time: use _as_utc:\n %s\n %s", + icalproperty_as_ical_string(p), ctime(&convt)); +#endif + } + + return convt; +} +struct icaltime_span icalcomponent_get_span(icalcomponent* comp) +{ + icalcomponent *inner; + icalproperty *p, *duration; + icalcomponent_kind kind; + struct icaltime_span span; + struct icaltimetype start; + + span.start = 0; + span.end = 0; + span.is_busy= 1; + + /* initial Error checking */ + +/* icalerror_check_arg_rz( (comp!=0),"comp");*/ + + kind = icalcomponent_isa(comp); + + if(kind == ICAL_VCALENDAR_COMPONENT){ + inner = icalcomponent_get_first_real_component(comp); + + /* Maybe there is a VTIMEZONE in there */ + if (inner == 0){ + inner = icalcomponent_get_first_component(comp, + ICAL_VTIMEZONE_COMPONENT); + } + + } else { + inner = comp; + } + + if (inner == 0){ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + /*icalerror_warn("icalcomponent_get_span: no component specified, or empty VCALENDAR component");*/ + return span; + } + + kind = icalcomponent_isa(inner); + + if( !( kind == ICAL_VEVENT_COMPONENT || + kind == ICAL_VJOURNAL_COMPONENT || + kind == ICAL_VTODO_COMPONENT || + kind == ICAL_VFREEBUSY_COMPONENT )) { + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + /*icalerror_warn("icalcomponent_get_span: no component specified, or empty VCALENDAR component");*/ + return span; + + } + + + + /* Get to work. starting with DTSTART */ + + p = icalcomponent_get_first_property(inner, ICAL_DTSTART_PROPERTY); + + if (p ==0 ) { + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + /*icalerror_warn("icalcomponent_get_span: component has no DTSTART time");*/ + return span; + } + + + start = icalproperty_get_dtstart(p); + + icalerror_clear_errno(); + + span.start = icalcomponent_convert_time(p); + +#ifdef TEST_CONVERT_TIME + printf("convert time:\n %s %s", + icalproperty_as_ical_string(p), ctime(&span.start)); +#endif + + if(icalerrno != ICAL_NO_ERROR){ + span.start = 0; + return span; + } + + /* The end time could be specified as either a DTEND or a DURATION */ + p = icalcomponent_get_first_property(inner, ICAL_DTEND_PROPERTY); + duration = icalcomponent_get_first_property(inner, ICAL_DURATION_PROPERTY); + + if (p==0 && duration == 0 && start.is_date != 1) { + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + /*icalerror_warn("icalcomponent_get_span: component has neither DTEND nor DURATION time");*/ + span.start = 0; + return span; + } + + if (p!=0){ + span.end = icalcomponent_convert_time(p); + } else if (start.is_date == 1) { + /* Duration is all day */ + span.end = span.start + 60*60*24; + } else { + /* Use the duration */ + struct icaldurationtype dur; + time_t durt; + + + dur = icalproperty_get_duration(duration); + + durt = icaldurationtype_as_timet(dur); + span.end = span.start+durt; + } + + return span; + +} int icalcomponent_count_errors(icalcomponent* component) @@ -840,7 +1018,7 @@ icalcomponent_begin_component(icalcomponent* component,icalcomponent_kind kind) } } - return icalcompiter_null;; + return icalcompiter_null; } icalcompiter @@ -876,6 +1054,8 @@ icalcomponent* icalcompiter_next(icalcompiter* i) return 0; } + icalerror_check_arg_rz( (i!=0),"i"); + for( i->iter = pvl_next(i->iter); i->iter != 0; i->iter = pvl_next(i->iter)) { @@ -923,3 +1103,298 @@ icalcomponent* icalcompiter_deref(icalcompiter* i) return pvl_data(i->iter); } + +icalcomponent* icalcomponent_get_inner(icalcomponent* comp) +{ + if (icalcomponent_isa(comp) == ICAL_VCALENDAR_COMPONENT){ + return icalcomponent_get_first_real_component(comp); + } else { + return comp; + } +} + + +void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v) +{ + + icalcomponent *inner = icalcomponent_get_inner(comp); + icalproperty *prop + = icalcomponent_get_first_property(inner, ICAL_DTSTART_PROPERTY); + + + if (prop == 0){ + prop = icalproperty_new_dtstart(v); + icalcomponent_add_property(inner, prop); + } + + icalproperty_set_dtstart(prop,v); + +} + + +struct icaltimetype icalcomponent_get_dtstart(icalcomponent* comp) +{ + icalcomponent *inner = icalcomponent_get_inner(comp); + icalproperty *prop + = icalcomponent_get_first_property(inner,ICAL_DTSTART_PROPERTY); + + if (prop == 0){ + return icaltime_null_time(); + } + + return icalproperty_get_dtstart(prop); +} + + +struct icaltimetype icalcomponent_get_dtend(icalcomponent* comp) +{ + icalcomponent *inner = icalcomponent_get_inner(comp); + + icalproperty *end_prop + = icalcomponent_get_first_property(inner,ICAL_DTEND_PROPERTY); + + icalproperty *dur_prop + = icalcomponent_get_first_property(inner, ICAL_DURATION_PROPERTY); + + + if( end_prop == 0 && dur_prop == 0){ + return icaltime_null_time(); + } else if ( end_prop != 0) { + return icalproperty_get_dtend(end_prop); + } else if ( dur_prop != 0) { + struct icaltimetype start = + icalcomponent_get_dtstart(inner); + time_t startt = icaltime_as_timet(start); + struct icaldurationtype duration = + icalproperty_get_duration(dur_prop); + time_t durt = icaldurationtype_as_timet(duration); + + return icaltime_from_timet(startt+durt,start.is_date,start.is_utc); + } else { + /* Error, both duration and dtend have been specified */ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + return icaltime_null_time(); + + } + +} + + +void icalcomponent_set_dtend(icalcomponent* comp, struct icaltimetype v) +{ + icalcomponent *inner = icalcomponent_get_inner(comp); + + icalproperty *end_prop + = icalcomponent_get_first_property(inner,ICAL_DTEND_PROPERTY); + + icalproperty *dur_prop + = icalcomponent_get_first_property(inner,ICAL_DURATION_PROPERTY); + + + if( end_prop == 0 && dur_prop == 0){ + end_prop = icalproperty_new_dtend(v); + icalcomponent_add_property(inner,end_prop); + } else if ( end_prop != 0) { + icalproperty_set_dtend(end_prop,v); + } else if ( dur_prop != 0) { + struct icaltimetype start = + icalcomponent_get_dtstart(inner); + time_t startt = icaltime_as_timet(start); + + struct icaltimetype end = + icalcomponent_get_dtend(inner); + time_t endt = icaltime_as_timet(end); + + struct icaldurationtype dur + = icaldurationtype_from_timet(endt-startt); + + icalproperty_set_duration(dur_prop,dur); + + } else { + /* Error, both duration and dtend have been specified */ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + } +} + +void icalcomponent_set_duration(icalcomponent* comp, + struct icaldurationtype v) +{ + icalcomponent *inner = icalcomponent_get_inner(comp); + + icalproperty *end_prop + = icalcomponent_get_first_property(inner,ICAL_DTEND_PROPERTY); + + icalproperty *dur_prop + = icalcomponent_get_first_property(inner,ICAL_DURATION_PROPERTY); + + + if( end_prop == 0 && dur_prop == 0){ + dur_prop = icalproperty_new_duration(v); + icalcomponent_add_property(inner, dur_prop); + } else if ( end_prop != 0) { + struct icaltimetype start = + icalcomponent_get_dtstart(inner); + time_t startt = icaltime_as_timet(start); + + time_t durt = icaldurationtype_as_timet(v); + + struct icaltimetype new_end + = icaltime_from_timet(startt+durt,start.is_date,start.is_utc); + + icalproperty_set_dtend(end_prop,new_end); + + } else if ( dur_prop != 0) { + icalproperty_set_duration(end_prop,v); + } else { + /* Error, both duration and dtend have been specified */ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + } +} + +struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp) +{ + icalcomponent *inner = icalcomponent_get_inner(comp); + + icalproperty *end_prop + = icalcomponent_get_first_property(inner,ICAL_DTEND_PROPERTY); + + icalproperty *dur_prop + = icalcomponent_get_first_property(inner,ICAL_DURATION_PROPERTY); + + struct icaldurationtype null_duration; + memset(&null_duration,0,sizeof(struct icaldurationtype)); + + + if( end_prop == 0 && dur_prop == 0){ + return null_duration; + } else if ( end_prop != 0) { + struct icaltimetype start = + icalcomponent_get_dtstart(inner); + time_t startt = icaltime_as_timet(start); + + struct icaltimetype end = + icalcomponent_get_dtend(inner); + time_t endt = icaltime_as_timet(end); + + return icaldurationtype_from_timet(endt-startt); + } else if ( dur_prop != 0) { + return icalproperty_get_duration(dur_prop); + } else { + /* Error, both duration and dtend have been specified */ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + return null_duration; + } +} + + + +void icalcomponent_set_method(icalcomponent* comp, icalproperty_method method) +{ + icalproperty *prop + = icalcomponent_get_first_property(comp, ICAL_METHOD_PROPERTY); + + + if (prop == 0){ + prop = icalproperty_new_method(method); + icalcomponent_add_property(comp, prop); + } + + icalproperty_set_method(prop,method); + +} + +icalproperty_method icalcomponent_get_method(icalcomponent* comp) +{ + icalproperty *prop + = icalcomponent_get_first_property(comp,ICAL_METHOD_PROPERTY); + + if (prop == 0){ + return ICAL_METHOD_NONE; + } + + return icalproperty_get_method(prop); +} + +void icalcomponent_set_dtstamp(icalcomponent* comp, struct icaltimetype v) +{ + + icalcomponent *inner = icalcomponent_get_inner(comp); + icalproperty *prop + = icalcomponent_get_first_property(inner, ICAL_DTSTAMP_PROPERTY); + + + if (prop == 0){ + prop = icalproperty_new_dtstamp(v); + icalcomponent_add_property(inner, prop); + } + + icalproperty_set_dtstamp(prop,v); + +} + + +struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp) +{ + icalcomponent *inner = icalcomponent_get_inner(comp); + icalproperty *prop + = icalcomponent_get_first_property(inner,ICAL_DTSTAMP_PROPERTY); + + if (prop == 0){ + return icaltime_null_time(); + } + + return icalproperty_get_dtstamp(prop); +} + + +void icalcomponent_set_summary(icalcomponent* comp, const char* v); +const char* icalcomponent_get_summary(icalcomponent* comp); + +void icalcomponent_set_comment(icalcomponent* comp, const char* v); +const char* icalcomponent_get_comment(icalcomponent* comp); + +void icalcomponent_set_organizer(icalcomponent* comp, const char* v); +const char* icalcomponent_get_organizer(icalcomponent* comp); + +void icalcomponent_set_uid(icalcomponent* comp, const char* v); +const char* icalcomponent_get_uid(icalcomponent* comp); + +void icalcomponent_set_recurrenceid(icalcomponent* comp, + struct icaltimetype v); +struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent* comp); + + + + +icalcomponent* icalcomponent_new_vcalendar() +{ + return icalcomponent_new(ICAL_VCALENDAR_COMPONENT); +} +icalcomponent* icalcomponent_new_vevent() +{ + return icalcomponent_new(ICAL_VEVENT_COMPONENT); +} +icalcomponent* icalcomponent_new_vtodo() +{ + return icalcomponent_new(ICAL_VTODO_COMPONENT); +} +icalcomponent* icalcomponent_new_vjournal() +{ + return icalcomponent_new(ICAL_VJOURNAL_COMPONENT); +} +icalcomponent* icalcomponent_new_vfreebusy() +{ + return icalcomponent_new(ICAL_VFREEBUSY_COMPONENT); +} +icalcomponent* icalcomponent_new_vtimezone() +{ + return icalcomponent_new(ICAL_VTIMEZONE_COMPONENT); +} +icalcomponent* icalcomponent_new_xstandard() +{ + return icalcomponent_new(ICAL_XSTANDARD_COMPONENT); +} +icalcomponent* icalcomponent_new_xdaylight() +{ + return icalcomponent_new(ICAL_XDAYLIGHT_COMPONENT); +} diff --git a/libical/src/libical/icalcomponent.h b/libical/src/libical/icalcomponent.h index b0d1e33630..b08d488db3 100644 --- a/libical/src/libical/icalcomponent.h +++ b/libical/src/libical/icalcomponent.h @@ -119,9 +119,6 @@ icalcomponent* icalcomponent_get_next_component(icalcomponent* component, -/* Return a null-terminated array of icalproperties*/ -icalproperty** icalcomponent_get_component(icalcomponent* component, - icalproperty_kind kind); /* Working with embedded error properties */ @@ -137,14 +134,82 @@ void icalcomponent_convert_errors(icalcomponent* component); icalcomponent* icalcomponent_get_parent(icalcomponent* component); void icalcomponent_set_parent(icalcomponent* component, icalcomponent* parent); - - - /* External component iterator */ icalcomponent* icalcompiter_next(icalcompiter* i); icalcomponent* icalcompiter_prior(icalcompiter* i); icalcomponent* icalcompiter_deref(icalcompiter* i); +/************* Derived class methods. **************************** + +If the code was in an OO language, the remaining routines would be +members of classes derived from icalcomponent. Don't call them on the +wrong component subtypes. */ + +/* For VCOMPONENT: Return a reference to the first VEVENT, VTODO or + VJOURNAL */ +icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c); + +/* For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end + times of an event in UTC */ +struct icaltime_span icalcomponent_get_span(icalcomponent* comp); + +/******************** Convienience routines **********************/ + +void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v); +struct icaltimetype icalcomponent_get_dtstart(icalcomponent* comp); + +/* For the icalcomponent routines only, dtend and duration are tied + together. If you call the set routine for one and the other exists, + the routine will calculate the change to the other. That is, if + there is a DTEND and you call set_duration, the routine will modify + DTEND to be the sum of DTSTART and the duration. If you call a get + routine for one and the other exists, the routine will calculate + the return value. If you call a set routine and neither exists, the + routine will create the apcompriate comperty */ + + +struct icaltimetype icalcomponent_get_dtend(icalcomponent* comp); +void icalcomponent_set_dtend(icalcomponent* comp, struct icaltimetype v); + +void icalcomponent_set_duration(icalcomponent* comp, + struct icaldurationtype v); +struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp); + +void icalcomponent_set_method(icalcomponent* comp, icalproperty_method method); +icalproperty_method icalcomponent_get_method(icalcomponent* comp); + +struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp); +void icalcomponent_set_dtstamp(icalcomponent* comp, struct icaltimetype v); + + +void icalcomponent_set_summary(icalcomponent* comp, const char* v); +const char* icalcomponent_get_summary(icalcomponent* comp); + +void icalcomponent_set_comment(icalcomponent* comp, const char* v); +const char* icalcomponent_get_comment(icalcomponent* comp); + +void icalcomponent_set_organizer(icalcomponent* comp, const char* v); +const char* icalcomponent_get_organizer(icalcomponent* comp); + +void icalcomponent_set_uid(icalcomponent* comp, const char* v); +const char* icalcomponent_get_uid(icalcomponent* comp); + +void icalcomponent_set_recurrenceid(icalcomponent* comp, + struct icaltimetype v); +struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent* comp); + +/*************** Type Specific routines ***************/ + +icalcomponent* icalcomponent_new_vcalendar(); +icalcomponent* icalcomponent_new_vevent(); +icalcomponent* icalcomponent_new_vtodo(); +icalcomponent* icalcomponent_new_vjournal(); +icalcomponent* icalcomponent_new_vfreebusy(); +icalcomponent* icalcomponent_new_vtimezone(); +icalcomponent* icalcomponent_new_xstandard(); +icalcomponent* icalcomponent_new_xdaylight(); + + #endif /* !ICALCOMPONENT_H */ diff --git a/libical/src/libical/icalenums.c b/libical/src/libical/icalenums.c index 50d23c8d41..2e04214739 100644 --- a/libical/src/libical/icalenums.c +++ b/libical/src/libical/icalenums.c @@ -5,6 +5,7 @@ $Id$ + (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org This program is free software; you can redistribute it and/or modify @@ -29,9 +30,13 @@ #include "icalenums.h" +#include <stdio.h> /* For fprintf */ +#include <stdio.h> /* For stderr */ +#include <assert.h> + struct icalproperty_kind_map { icalproperty_kind kind; - char *name; + const char *name; }; static struct icalproperty_kind_map property_map[] = @@ -107,7 +112,7 @@ static struct icalproperty_kind_map property_map[] = }; -char* icalenum_property_kind_to_string(icalproperty_kind kind) +const char* icalenum_property_kind_to_string(icalproperty_kind kind) { int i; @@ -179,7 +184,7 @@ static struct icalparameter_kind_map parameter_map[] = { ICAL_NO_PARAMETER, ""} }; -char* icalenum_parameter_kind_to_string(icalparameter_kind kind) +const char* icalenum_parameter_kind_to_string(icalparameter_kind kind) { int i; @@ -232,6 +237,7 @@ static struct icalvalue_kind_map value_map[] = { ICAL_URI_VALUE, "URI"}, { ICAL_UTCOFFSET_VALUE, "UTC-OFFSET"}, { ICAL_METHOD_VALUE, "METHOD"}, /* Not an RFC2445 type */ + { ICAL_STATUS_VALUE, "STATUS"}, /* Not an RFC2445 type */ { ICAL_GEO_VALUE, "FLOAT"}, /* Not an RFC2445 type */ { ICAL_ATTACH_VALUE, "XATTACH"}, /* Not an RFC2445 type */ { ICAL_DATETIMEDATE_VALUE, "XDATETIMEDATE"}, /* Not an RFC2445 type */ @@ -240,7 +246,7 @@ static struct icalvalue_kind_map value_map[] = { ICAL_NO_VALUE, ""}, }; -char* icalenum_value_kind_to_string(icalvalue_kind kind) +const char* icalenum_value_kind_to_string(icalvalue_kind kind) { int i; @@ -256,7 +262,9 @@ char* icalenum_value_kind_to_string(icalvalue_kind kind) icalvalue_kind icalenum_value_kind_by_prop(icalproperty_kind kind) { - + fprintf(stderr,"icalenum_value_kind_by_prop is not implemented\n"); + assert(0) ; + kind = ICAL_NO_VALUE; return ICAL_NO_VALUE; } @@ -297,7 +305,7 @@ static struct icalcomponent_kind_map component_map[] = { ICAL_NO_COMPONENT, "" }, }; -char* icalenum_component_kind_to_string(icalcomponent_kind kind) +const char* icalenum_component_kind_to_string(icalcomponent_kind kind) { int i; @@ -347,7 +355,7 @@ static struct icalproperty_kind_value_map propval_map[] = { ICAL_PERCENTCOMPLETE_PROPERTY, ICAL_INTEGER_VALUE }, { ICAL_PRIORITY_PROPERTY, ICAL_INTEGER_VALUE }, { ICAL_RESOURCES_PROPERTY, ICAL_TEXT_VALUE }, - { ICAL_STATUS_PROPERTY, ICAL_TEXT_VALUE }, + { ICAL_STATUS_PROPERTY, ICAL_STATUS_VALUE }, { ICAL_SUMMARY_PROPERTY, ICAL_TEXT_VALUE }, { ICAL_COMPLETED_PROPERTY, ICAL_DATETIME_VALUE }, { ICAL_FREEBUSY_PROPERTY, ICAL_PERIOD_VALUE }, @@ -416,65 +424,13 @@ icalvalue_kind icalenum_property_kind_to_value_kind(icalproperty_kind kind) return ICAL_NO_VALUE; } -struct {icalrecurrencetype_weekday wd; char * str; } -wd_map[] = { - {ICAL_SUNDAY_WEEKDAY,"SU"}, - {ICAL_MONDAY_WEEKDAY,"MO"}, - {ICAL_TUESDAY_WEEKDAY,"TU"}, - {ICAL_WEDNESDAY_WEEKDAY,"WE"}, - {ICAL_THURSDAY_WEEKDAY,"TH"}, - {ICAL_FRIDAY_WEEKDAY,"FR"}, - {ICAL_SATURDAY_WEEKDAY,"SA"}, - {ICAL_NO_WEEKDAY,0} -}; - -char* icalenum_weekday_to_string(icalrecurrencetype_weekday kind) -{ - int i; - - for (i=0; wd_map[i].wd != ICAL_NO_WEEKDAY; i++) { - if ( wd_map[i].wd == kind) { - return wd_map[i].str; - } - } - - return 0; -} - - -struct { - icalrecurrencetype_frequency kind; - char* str; -} freq_map[] = { - {ICAL_SECONDLY_RECURRENCE,"SECONDLY"}, - {ICAL_MINUTELY_RECURRENCE,"MINUTELY"}, - {ICAL_HOURLY_RECURRENCE,"HOURLY"}, - {ICAL_DAILY_RECURRENCE,"DAILY"}, - {ICAL_WEEKLY_RECURRENCE,"WEEKLY"}, - {ICAL_MONTHLY_RECURRENCE,"MONTHLY"}, - {ICAL_YEARLY_RECURRENCE,"YEARLY"}, - {ICAL_NO_RECURRENCE,0} -}; - -char* icalenum_recurrence_to_string(icalrecurrencetype_frequency kind) -{ - int i; - - for (i=0; freq_map[i].kind != ICAL_NO_RECURRENCE ; i++) { - if ( freq_map[i].kind == kind ) { - return freq_map[i].str; - } - } - return 0; -} - struct { - icalrecurrencetype_frequency kind; + enum icalrequeststatus kind; int major; int minor; - char* str; -} status_map[] = { + const char* str; +} request_status_map[] = { {ICAL_2_0_SUCCESS_STATUS, 2,0,"Success."}, {ICAL_2_1_FALLBACK_STATUS, 2,1,"Success but fallback taken on one or more property values."}, {ICAL_2_2_IGPROP_STATUS, 2,2,"Success, invalid property ignored."}, @@ -511,14 +467,14 @@ struct { }; -char* icalenum_reqstat_desc(icalrequeststatus stat) +const char* icalenum_reqstat_desc(icalrequeststatus stat) { int i; - for (i=0; status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { - if ( status_map[i].kind == stat) { - return status_map[i].str; + for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { + if ( request_status_map[i].kind == stat) { + return request_status_map[i].str; } } @@ -530,9 +486,9 @@ short icalenum_reqstat_major(icalrequeststatus stat) { int i; - for (i=0; status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { - if ( status_map[i].kind == stat) { - return status_map[i].major; + for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { + if ( request_status_map[i].kind == stat) { + return request_status_map[i].major; } } return -1; @@ -542,9 +498,9 @@ short icalenum_reqstat_minor(icalrequeststatus stat) { int i; - for (i=0; status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { - if ( status_map[i].kind == stat) { - return status_map[i].minor; + for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { + if ( request_status_map[i].kind == stat) { + return request_status_map[i].minor; } } return -1; @@ -555,9 +511,9 @@ icalrequeststatus icalenum_num_to_reqstat(short major, short minor) { int i; - for (i=0; status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { - if ( status_map[i].major == major && status_map[i].minor == minor) { - return status_map[i].kind; + for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) { + if ( request_status_map[i].major == major && request_status_map[i].minor == minor) { + return request_status_map[i].kind; } } return 0; @@ -565,7 +521,7 @@ icalrequeststatus icalenum_num_to_reqstat(short major, short minor) -struct {icalproperty_method method; char* str;} method_map[] = { +struct {icalproperty_method method; const char* str;} method_map[] = { {ICAL_METHOD_PUBLISH,"PUBLISH"}, {ICAL_METHOD_REQUEST,"REQUEST"}, {ICAL_METHOD_REPLY,"REPLY"}, @@ -586,7 +542,7 @@ struct {icalproperty_method method; char* str;} method_map[] = { }; -char* icalenum_method_to_string(icalproperty_method method) +const char* icalenum_method_to_string(icalproperty_method method) { int i; @@ -599,7 +555,7 @@ char* icalenum_method_to_string(icalproperty_method method) return method_map[i].str; /* should be ICAL_METHOD_NONE */ } -icalproperty_method icalenum_string_to_method(char* str) +icalproperty_method icalenum_string_to_method(const char* str) { int i; @@ -616,3 +572,46 @@ icalproperty_method icalenum_string_to_method(char* str) return ICAL_METHOD_NONE; } + + +struct {icalproperty_status status; const char* str;} status_map[] = { + {ICAL_STATUS_TENTATIVE,"TENTATIVE"}, + {ICAL_STATUS_CONFIRMED,"CONFIRMED"}, + {ICAL_STATUS_NEEDSACTION,"NEEDS-ACTION"}, + {ICAL_STATUS_COMPLETED,"COMPLETED"}, + {ICAL_STATUS_INPROCESS,"IN-PROCESS"}, + {ICAL_STATUS_DRAFT,"DRAFT"}, + {ICAL_STATUS_FINAL,"FINAL"}, + {ICAL_STATUS_NONE,"NONE"} +}; + +const char* icalenum_status_to_string(icalproperty_status status) +{ + int i; + + for (i=0; status_map[i].status != ICAL_STATUS_NONE; i++) { + if ( status_map[i].status == status) { + return status_map[i].str; + } + } + + return status_map[i].str; /* should be ICAL_STATUS_NONE */ +} + +icalproperty_status icalenum_string_to_status(const char* str) +{ + int i; + + while(*str == ' '){ + str++; + } + + + for (i=0; status_map[i].status != ICAL_STATUS_NONE; i++) { + if ( strcmp(status_map[i].str, str) == 0) { + return status_map[i].status; + } + } + + return ICAL_STATUS_NONE; +} diff --git a/libical/src/libical/icalenums.h b/libical/src/libical/icalenums.h index ba3137803e..ab25532cf6 100644 --- a/libical/src/libical/icalenums.h +++ b/libical/src/libical/icalenums.h @@ -183,9 +183,10 @@ typedef enum icalproperty_class { typedef enum icalproperty_status { + ICAL_STATUS_NONE, ICAL_STATUS_TENTATIVE, ICAL_STATUS_CONFIRMED, - ICAL_STATUS_CANCELLED, /* CANCELED? SIC */ + ICAL_STATUS_CANCELLED, /* CANCELED? SIC from RFC*/ ICAL_STATUS_NEEDSACTION, ICAL_STATUS_COMPLETED, ICAL_STATUS_INPROCESS, @@ -220,6 +221,7 @@ typedef enum icalvalue_kind { ICAL_GEO_VALUE, /* Non-Standard */ ICAL_INTEGER_VALUE, ICAL_METHOD_VALUE, /* Non-Standard */ + ICAL_STATUS_VALUE, /* Non-Standard */ ICAL_PERIOD_VALUE, ICAL_RECUR_VALUE, ICAL_STRING_VALUE, /* Non-Standard */ @@ -298,7 +300,8 @@ typedef enum icalparameter_partstat { ICAL_PARTSTAT_DELEGATED, ICAL_PARTSTAT_COMPLETED, ICAL_PARTSTAT_INPROCESS, - ICAL_PARTSTAT_XNAME + ICAL_PARTSTAT_XNAME, + ICAL_PARTSTAT_NONE } icalparameter_partstat; typedef enum icalparameter_range { @@ -334,7 +337,7 @@ typedef enum icalparameter_xlicerrortype { ICAL_XLICERRORTYPE_VALUEPARSEERROR, ICAL_XLICERRORTYPE_UNKVCALPROP, ICAL_XLICERRORTYPE_INVALIDITIP, - ICAL_XLICERRORTYPE_MIMEPARSEERROR, + ICAL_XLICERRORTYPE_MIMEPARSEERROR } icalparameter_xlicerrortype; typedef enum icalparameter_xliccomparetype { @@ -366,46 +369,6 @@ typedef enum icalparameter_value { ICAL_VALUE_ERROR = ICAL_NO_VALUE } icalparameter_value; -/*********************************************************************** - * Recurrances -**********************************************************************/ - -typedef enum icalrecurrencetype_frequency -{ - /* These enums are used to index an array, so don't change the - order or the integers */ - - ICAL_SECONDLY_RECURRENCE=0, - ICAL_MINUTELY_RECURRENCE=1, - ICAL_HOURLY_RECURRENCE=2, - ICAL_DAILY_RECURRENCE=3, - ICAL_WEEKLY_RECURRENCE=4, - ICAL_MONTHLY_RECURRENCE=5, - ICAL_YEARLY_RECURRENCE=6, - ICAL_NO_RECURRENCE=7 - -} icalrecurrencetype_frequency; - -typedef enum icalrecurrencetype_weekday -{ - ICAL_NO_WEEKDAY, - ICAL_SUNDAY_WEEKDAY, - ICAL_MONDAY_WEEKDAY, - ICAL_TUESDAY_WEEKDAY, - ICAL_WEDNESDAY_WEEKDAY, - ICAL_THURSDAY_WEEKDAY, - ICAL_FRIDAY_WEEKDAY, - ICAL_SATURDAY_WEEKDAY -} icalrecurrencetype_weekday; - -enum { - ICAL_RECURRENCE_ARRAY_MAX = 0x7f7f, - ICAL_RECURRENCE_ARRAY_MAX_BYTE = 0x7f -}; - - -char* icalenum_recurrence_to_string(icalrecurrencetype_frequency kind); -char* icalenum_weekday_to_string(icalrecurrencetype_weekday kind); /*********************************************************************** * Request Status codes @@ -448,7 +411,7 @@ typedef enum icalrequeststatus { } icalrequeststatus; -char* icalenum_reqstat_desc(icalrequeststatus stat); +const char* icalenum_reqstat_desc(icalrequeststatus stat); short icalenum_reqstat_major(icalrequeststatus stat); short icalenum_reqstat_minor(icalrequeststatus stat); icalrequeststatus icalenum_num_to_reqstat(short major, short minor); @@ -457,22 +420,25 @@ icalrequeststatus icalenum_num_to_reqstat(short major, short minor); * Conversion functions **********************************************************************/ -char* icalenum_property_kind_to_string(icalproperty_kind kind); +const char* icalenum_property_kind_to_string(icalproperty_kind kind); icalproperty_kind icalenum_string_to_property_kind(char* string); -char* icalenum_value_kind_to_string(icalvalue_kind kind); +const char* icalenum_value_kind_to_string(icalvalue_kind kind); icalvalue_kind icalenum_value_kind_by_prop(icalproperty_kind kind); -char* icalenum_parameter_kind_to_string(icalparameter_kind kind); +const char* icalenum_parameter_kind_to_string(icalparameter_kind kind); icalparameter_kind icalenum_string_to_parameter_kind(char* string); -char* icalenum_component_kind_to_string(icalcomponent_kind kind); +const char* icalenum_component_kind_to_string(icalcomponent_kind kind); icalcomponent_kind icalenum_string_to_component_kind(char* string); icalvalue_kind icalenum_property_kind_to_value_kind(icalproperty_kind kind); -char* icalenum_method_to_string(icalproperty_method); -icalproperty_method icalenum_string_to_method(char* string); +const char* icalenum_method_to_string(icalproperty_method); +icalproperty_method icalenum_string_to_method(const char* string); + +const char* icalenum_status_to_string(icalproperty_status); +icalproperty_status icalenum_string_to_status(const char* string); #endif /* !ICALENUMS_H */ diff --git a/libical/src/libical/icalerror.c b/libical/src/libical/icalerror.c index c7641da504..de9ea4392b 100644 --- a/libical/src/libical/icalerror.c +++ b/libical/src/libical/icalerror.c @@ -5,9 +5,6 @@ $Id$ - $Locker$ - - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org This program is free software; you can redistribute it and/or modify @@ -56,6 +53,11 @@ void icalerror_clear_errno() { void icalerror_set_errno(icalerrorenum e) { +#ifdef ICAL_ERRORS_ARE_FATAL + fprintf(stderr,"libical: icalerrno_set_error: %s",icalerror_strerror(e)); + icalerror_crash_here(); +#endif + icalerror_stop_here(); icalerrno = e; } @@ -68,9 +70,9 @@ struct icalerror_string_map { static struct icalerror_string_map string_map[] = { - {ICAL_BADARG_ERROR,"Bad argumnet to function"}, + {ICAL_BADARG_ERROR,"Bad argument to function"}, {ICAL_NEWFAILED_ERROR,"Failed to create a new object via a *_new() routine"}, - {ICAL_MALFORMEDDATA_ERROR,"An input string was not correctly formed"}, + {ICAL_MALFORMEDDATA_ERROR,"An input string was not correctly formed or a component has missing or extra properties"}, {ICAL_PARSE_ERROR,"Failed to parse a part of an iCal componet"}, {ICAL_INTERNAL_ERROR,"Random internal error. This indicates an error in the library code, not an error in use"}, {ICAL_FILE_ERROR,"An operation on a file failed. Check errno for more detail."}, diff --git a/libical/src/libical/icalerror.h b/libical/src/libical/icalerror.h index fbf6076dd6..d954b4d7f3 100644 --- a/libical/src/libical/icalerror.h +++ b/libical/src/libical/icalerror.h @@ -30,6 +30,12 @@ #include <assert.h> #include <stdio.h> /* For icalerror_warn() */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + /* This routine is called before any error is triggered. It is called by icalerror_set_errno, so it does not appear in all of the macros below */ @@ -58,14 +64,13 @@ void icalerror_crash_here(void); #define icalerror_assert(test,message) #endif - /* Check & abort if check fails */ #ifdef ICAL_ERRORS_ARE_FATAL #define icalerror_check_arg(test,arg) icalerror_stop_here();assert(test) #else #define icalerror_check_arg(test,arg) #endif -/* Check & return void if check failes*/ +/* Check & return void if check fails*/ #ifdef ICAL_ERRORS_ARE_FATAL #define icalerror_check_arg_rv(test,arg) icalerror_stop_here();assert(test); @@ -73,7 +78,7 @@ void icalerror_crash_here(void); #define icalerror_check_arg_rv(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return; } #endif -/* Check & return 0 if check failes*/ +/* Check & return 0 if check fails*/ #ifdef ICAL_ERRORS_ARE_FATAL #define icalerror_check_arg_rz(test,arg) icalerror_stop_here();assert(test); #else @@ -81,7 +86,7 @@ void icalerror_crash_here(void); #endif -/* Check & return an error if check failes*/ +/* Check & return an error if check fails*/ #ifdef ICAL_ERRORS_ARE_FATAL #define icalerror_check_arg_re(test,arg,error) icalerror_stop_here();assert(test); #else @@ -113,7 +118,7 @@ typedef enum icalerrorenum { ICAL_BADARG_ERROR, ICAL_NEWFAILED_ERROR, - ICAL_MALFORMEDDATA_ERROR, + ICAL_MALFORMEDDATA_ERROR, ICAL_PARSE_ERROR, ICAL_INTERNAL_ERROR, /* Like assert --internal consist. prob */ ICAL_FILE_ERROR, @@ -129,7 +134,7 @@ typedef enum icalerrorenum { extern icalerrorenum icalerrno; -void icalerror_clear_errno(); +void icalerror_clear_errno(void); void icalerror_set_errno(icalerrorenum); char* icalerror_strerror(icalerrorenum e); diff --git a/libical/src/libical/icallexer.l b/libical/src/libical/icallexer.l index 8a6db2f93b..6f922ae428 100644 --- a/libical/src/libical/icallexer.l +++ b/libical/src/libical/icallexer.l @@ -6,8 +6,7 @@ DESCRIPTION: - $Id: icallexer.l,v 1.4 2000/06/06 22:48:09 alves Exp $ - $Locker: $ + $Id: icallexer.l,v 1.5 2000/12/11 23:01:19 federico Exp $ (C) COPYRIGHT 1999 Eric Busboom http://www.softwarestudio.org @@ -28,16 +27,16 @@ ======================================================================*/ -#include "icalyacc.h" #include "icalparser.h" #include "icalenums.h" #include "icalmemory.h" #include "assert.h" +#include "icalyacc.h" #include <string.h> /* For strdup() */ int icalparser_flex_input(char* buf, int max_size); -void icalparser_clear_flex_input(); +void icalparser_clear_flex_input(void); #define ICAL_MAX_STR_CONST 1024 @@ -47,15 +46,15 @@ void icalparser_clear_flex_input(); #undef yywrap #undef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yyerror(msg) +#define YY_FATAL_ERROR(msg) ical_yyerror(msg) icalvalue_kind value_kind=ICAL_NO_VALUE; -void set_parser_value_state(); +void set_parser_value_state(icalvalue_kind kind); extern int yydebug; -void yyerror(char *s); +void ical_yyerror(char *s); -void init_str_buf(); +void init_str_buf(void); int last_state; @@ -63,6 +62,11 @@ char *str_buf; char *str_buf_p; size_t buf_sz; /* = ICAL_MAX_STR_CONST;*/ +/* Define routines that were not propertly defined because of the +renaming hack applied in icalyacc.y */ +YY_BUFFER_STATE ical_yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE ical_yy_scan_string ( yyconst char *yy_str ); +YY_BUFFER_STATE ical_yy_scan_bytes ( yyconst char *bytes, int len ); %} @@ -96,7 +100,7 @@ digit [0-9] <binary_value>{ -.* { yylval.v_string= icalmemory_tmp_copy(yytext); +.* { ical_yylval.v_string= icalmemory_tmp_copy(yytext); return STRING;} {crlf} { return EOL;} @@ -109,7 +113,7 @@ digit [0-9] } <uri_value>{ -.* { yylval.v_string= icalmemory_tmp_copy(yytext); +.* { ical_yylval.v_string= icalmemory_tmp_copy(yytext); return STRING;} {crlf} { return EOL;} @@ -117,7 +121,7 @@ digit [0-9] <time_value>{ -{digit}* { yylval.v_string= icalmemory_tmp_copy(yytext); +{digit}* { ical_yylval.v_string= icalmemory_tmp_copy(yytext); return DIGITS; } T { return TIME_CHAR; } Z { return UTC_CHAR; } @@ -127,7 +131,7 @@ Z { return UTC_CHAR; } } <duration_value>{ -{digit}+ { yylval.v_string =icalmemory_tmp_copy(yytext); +{digit}+ { ical_yylval.v_string =icalmemory_tmp_copy(yytext); return DIGITS; } T { return TIME_CHAR; } [\+\-PTWHMSD] { return yytext[0]; } @@ -136,14 +140,14 @@ T { return TIME_CHAR; } } <number_value>{ -[\+\-\.0-9]+ { yylval.v_int=atoi(yytext); return INTNUMBER; } +[\+\-\.0-9]+ { ical_yylval.v_int=atoi(yytext); return INTNUMBER; } {crlf} { return EOL;} . { return CHARACTER; } } <period_value>{ -{digit}+ { yylval.v_string =icalmemory_tmp_copy(yytext) ; +{digit}+ { ical_yylval.v_string =icalmemory_tmp_copy(yytext) ; return DIGITS; } T { return TIME_CHAR; } Z { return UTC_CHAR; } @@ -184,7 +188,8 @@ FR { return FR; } = { return EQUALS; } , { return COMMA; } ; { return SEMICOLON; } -[\-\+0-9]+ { yylval.v_string= icalmemory_tmp_copy(yytext); +- { return MINUS; } +[\+0-9]+ { ical_yylval.v_string= icalmemory_tmp_copy(yytext); return DIGITS; } T { return TIME_CHAR; } Z { return UTC_CHAR; } @@ -194,7 +199,7 @@ Z { return UTC_CHAR; } <utcoffset_value>{ {crlf} { return EOL;} \-|\+ { return yytext[0]; } -{digit}{digit} { yylval.v_int=atoi(yytext); return INTNUMBER; } +{digit}{digit} { ical_yylval.v_int=atoi(yytext); return INTNUMBER; } } @@ -275,7 +280,7 @@ void set_parser_value_state(icalvalue_kind kind) } } -void init_str_buf() +void init_str_buf(void) { str_buf = icalmemory_tmp_buffer(ICAL_MAX_STR_CONST); str_buf_p = str_buf; diff --git a/libical/src/libical/icalmemory.c b/libical/src/libical/icalmemory.c index e13c2c42ca..97cefe65c6 100644 --- a/libical/src/libical/icalmemory.c +++ b/libical/src/libical/icalmemory.c @@ -4,8 +4,6 @@ CREATOR: eric 30 June 1999 $Id$ - - $Locker$ The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in @@ -31,20 +29,6 @@ The Original Code is icalmemory.h - This program is free software; you can redistribute it and/or modify - it under the terms of either: - - The LGPL as published by the Free Software Foundation, version - 2.1, available at: http://www.fsf.org/copyleft/lesser.html - - Or: - - The Mozilla Public License Version 1.0. You may obtain a copy of - the License at http://www.mozilla.org/MPL/ - - The Initial Developer of the Original Code is Eric Busboom - - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org ======================================================================*/ /* libical often passes strings back to the caller. To make these @@ -73,11 +57,14 @@ #include <stdio.h> /* for printf (debugging) */ #include <stdlib.h> /* for malloc, realloc */ -#include <string.h> /* for memset() */ +#include <string.h> /* for memset(), strdup */ #define BUFFER_RING_SIZE 25 #define MIN_BUFFER_SIZE 200 +void icalmemory_free_tmp_buffer (void* buf); + + /* HACK. Not threadsafe */ void* buffer_ring[BUFFER_RING_SIZE]; int buffer_pos = -1; @@ -155,7 +142,7 @@ void icalmemory_free_ring() /* Like strdup, but the buffer is on the ring. */ char* -icalmemory_tmp_copy(char* str) +icalmemory_tmp_copy(const char* str) { char* b = icalmemory_tmp_buffer(strlen(str)+1); @@ -218,7 +205,7 @@ void icalmemory_free_buffer(void* buf) void icalmemory_append_string(char** buf, char** pos, size_t* buf_size, - char* string) + const char* string) { char *new_buf; char *new_pos; diff --git a/libical/src/libical/icalmemory.h b/libical/src/libical/icalmemory.h index 6c974cdc95..678f018b52 100644 --- a/libical/src/libical/icalmemory.h +++ b/libical/src/libical/icalmemory.h @@ -3,33 +3,7 @@ FILE: icalmemory.h CREATOR: eric 30 June 1999 - $Id$ - $Locker$ - - The contents of this file are subject to the Mozilla Public License - Version 1.0 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and - limitations under the License. - - - This program is free software; you can redistribute it and/or modify - it under the terms of either: - - The LGPL as published by the Free Software Foundation, version - 2.1, available at: http://www.fsf.org/copyleft/lesser.html - - Or: - - The Mozilla Public License Version 1.0. You may obtain a copy of - the License at http://www.mozilla.org/MPL/ - - The Original Code is icalmemory.h This program is free software; you can redistribute it and/or modify it under the terms of either: @@ -52,18 +26,19 @@ #include <sys/types.h> /* for size_t */ + /* Tmp buffers are managed by ical. References can be returned to the caller, although the caller will not own the memory. */ void* icalmemory_tmp_buffer(size_t size); -char* icalmemory_tmp_copy(char* str); +char* icalmemory_tmp_copy(const char* str); /* Add an externally allocated buffer to the ring. */ void icalmemory_add_tmp_buffer(void*); /* Free all memory used in the ring */ -void icalmemory_free_ring(); +void icalmemory_free_ring(void); /* Non-tmp buffers must be freed. These are mostly wrappers around * malloc, etc, but are used so the caller can change the memory @@ -87,7 +62,7 @@ void icalmemory_free_buffer(void* buf); have memory problems. */ void icalmemory_append_string(char** buf, char** pos, size_t* buf_size, - char* string); + const char* string); /* icalmemory_append_char is similar, but is appends a character instead of a string */ void icalmemory_append_char(char** buf, char** pos, size_t* buf_size, diff --git a/libical/src/libical/icalparameter.c b/libical/src/libical/icalparameter.c index 5bbaff68ef..cee4259099 100644 --- a/libical/src/libical/icalparameter.c +++ b/libical/src/libical/icalparameter.c @@ -5,9 +5,6 @@ $Id$ - $Locker$ - - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org This program is free software; you can redistribute it and/or modify @@ -27,42 +24,47 @@ Graham Davison (g.m.davison@computer.org) ======================================================================*/ - +#line 29 "icalparameter.c.in" #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif -#include "ical.h" + +#include "icalparameter.h" +#include "icalproperty.h" #include "icalerror.h" +#include "icalmemory.h" + #include <stdlib.h> /* for malloc() */ #include <errno.h> #include <string.h> /* for memset() */ -#include "icalmemory.h" + +union icalparameter_impl_data { + int v_int; + int v_rsvp; + icalparameter_cutype v_cutype; + icalparameter_encoding v_encoding; + icalparameter_fbtype v_fbtype; + icalparameter_partstat v_partstat; + icalparameter_range v_range; + icalparameter_related v_related; + icalparameter_reltype v_reltype; + icalparameter_role v_role; + icalparameter_value v_value; + icalparameter_xlicerrortype v_xlicerrortype; + icalparameter_xliccomparetype v_xliccomparetype; +} data; struct icalparameter_impl { icalparameter_kind kind; char id[5]; int size; - char* string; - char* x_name; + const char* string; + const char* x_name; icalproperty* parent; - union data { - int v_int; - int v_rsvp; - icalparameter_cutype v_cutype; - icalparameter_encoding v_encoding; - icalparameter_fbtype v_fbtype; - icalparameter_partstat v_partstat; - icalparameter_range v_range; - icalparameter_related v_related; - icalparameter_reltype v_reltype; - icalparameter_role v_role; - icalparameter_value v_value; - icalparameter_xlicerrortype v_xlicerrortype; - icalparameter_xliccomparetype v_xliccomparetype; - } data; + union icalparameter_impl_data data; }; struct icalparameter_impl* icalparameter_new_impl(icalparameter_kind kind) @@ -134,10 +136,16 @@ icalparameter_new_clone(icalparameter* param) #if 0 +<<<<<<< icalparameter.c +======= +#if 1 +/* The following code is meant to replace most of the case-switch + statements, but it is still a work in progress */ +>>>>>>> 1.1.1.5 struct param_string_map { icalparameter_kind kind; int val; /* Actually, union of several types of enums */ - char* str; + const char* str; } param_string_map[] = { {ICAL_CUTYPE_PARAMETER,ICAL_CUTYPE_INDIVIDUAL,"INDIVIDUAL"}, @@ -164,6 +172,9 @@ struct param_string_map { {ICAL_RELTYPE_PARAMETER,ICAL_RELTYPE_CHILD,"CHILD"}, {ICAL_RELTYPE_PARAMETER,ICAL_RELTYPE_SIBLING,"SIBLING"}, {ICAL_ROLE_PARAMETER,ICAL_ROLE_CHAIR,"CHAIR"}, + {ICAL_ROLE_PARAMETER,ICAL_ROLE_REQPARTICIPANT,"REQ-PARTICIPANT"}, + {ICAL_ROLE_PARAMETER,ICAL_ROLE_OPTPARTICIPANT,"OPT-PARTICIPANT"}, + {ICAL_ROLE_PARAMETER,ICAL_ROLE_NONPARTICIPANT,"NON-PARTICIPANT"}, {ICAL_RSVP_PARAMETER,ICAL_RSVP_PARAMETER,"TRUE"}, {ICAL_RSVP_PARAMETER,ICAL_RSVP_PARAMETER,"FALSE"}, {ICAL_VALUE_PARAMETER,ICAL_VALUE_BINARY,"BINARY"}, @@ -197,8 +208,39 @@ struct param_string_map { }; +void icalparameter_set_impl_data(icalparameter_kind kind, + union icalparameter_impl_data *data, + int value) +{ -icalparameter* icalparameter_new_from_string(icalparameter_kind kind, char* val) + switch (kind){ + case ICAL_CUTYPE_PARAMETER: + data->v_cutype=value; break; + case ICAL_FBTYPE_PARAMETER: + data->v_fbtype=value; break; + case ICAL_PARTSTAT_PARAMETER: + data->v_partstat=value; break; + case ICAL_RANGE_PARAMETER: + data->v_range=value; break; + case ICAL_RELATED_PARAMETER: + data->v_related=value; break; + case ICAL_RELTYPE_PARAMETER: + data->v_reltype=value; break; + case ICAL_ROLE_PARAMETER: + data->v_role=value; break; + case ICAL_RSVP_PARAMETER: + data->v_rsvp=value; break; + case ICAL_VALUE_PARAMETER: + data->v_value=value; break; + case ICAL_XLICERRORTYPE_PARAMETER: + data->v_xlicerrortype=value; break; + case ICAL_XLICCOMPARETYPE_PARAMETER: + data->v_xliccomparetype=value; break; + default: + } +} + +icalparameter* icalparameter_new_from_string_test(icalparameter_kind kind, char* val) { int i =0; icalparameter* param=0; @@ -206,6 +248,8 @@ icalparameter* icalparameter_new_from_string(icalparameter_kind kind, char* val) icalerror_check_arg_rz((val!=0),"val"); switch(kind){ + + /* These are all string values parameters */ case ICAL_SENTBY_PARAMETER: case ICAL_TZID_PARAMETER: case ICAL_X_PARAMETER: @@ -218,9 +262,15 @@ icalparameter* icalparameter_new_from_string(icalparameter_kind kind, char* val) case ICAL_ALTREP_PARAMETER: case ICAL_CN_PARAMETER: { - if (impl->string == 0){ return no_parameter;} - strcpy(tend,impl->string);break; - break; + struct icalparameter_impl *impl = icalparameter_new_impl(kind); + if (impl == 0) { + return 0; + } + ((struct icalparameter_impl*)param)->string = + icalmemory_strdup(val); + + return (icalparameter*) impl; + } case ICAL_NO_PARAMETER: @@ -229,18 +279,41 @@ icalparameter* icalparameter_new_from_string(icalparameter_kind kind, char* val) } default: { + int found = 0; /* All other types are enumerated */ - for(i = 0; param_string_map[i].kind != ICAL_NO_PARAMETER){ + for(i = 0; param_string_map[i].kind != ICAL_NO_PARAMETER; i++){ + if(kind == param_string_map[i].kind && - strcmp(val,param_string_map[i].str) == 0){ - - - } + strcmp(val,param_string_map[i].str) == 0){ + + struct icalparameter_impl *impl = + icalparameter_new_impl(kind); + found = 1; + + icalparameter_set_impl_data(kind,&impl->data, + param_string_map[i].val); + + return (icalparameter*)impl; + } } + + /* Didn't find the standard enumerated type, so it must be + an X parameter */ + if (found ==0) { + icalparameter *param = icalparameter_new(kind); + + icalparameter_set_xvalue(param,val); + + return param; + + } } + } + + return 0; } - -#endif + +#endif icalparameter* icalparameter_new_from_string(icalparameter_kind kind, char* val) @@ -616,11 +689,11 @@ icalparameter_free (icalparameter* parameter) if (impl->string != 0){ - free (impl->string); + free ((void*)impl->string); } if (impl->x_name != 0){ - free (impl->x_name); + free ((void*)impl->x_name); } memset(impl,0,sizeof(impl)); @@ -640,7 +713,7 @@ icalparameter_as_ical_string (icalparameter* parameter) char* buf; char* buf_ptr; char *out_buf; - char *kind_string; + const char *kind_string; char tend[1024]; /* HACK . Should be using memory buffer ring */ @@ -1085,14 +1158,14 @@ icalparameter_isa_parameter (void* parameter) void -icalparameter_set_xname (icalparameter* param, char* v) +icalparameter_set_xname (icalparameter* param, const char* v) { struct icalparameter_impl *impl = (struct icalparameter_impl*)param; icalerror_check_arg_rv( (param!=0),"param"); icalerror_check_arg_rv( (v!=0),"v"); if (impl->x_name != 0){ - free(impl->x_name); + free((void*)impl->x_name); } impl->x_name = icalmemory_strdup(v); @@ -1103,7 +1176,7 @@ icalparameter_set_xname (icalparameter* param, char* v) } -char* +const char* icalparameter_get_xname (icalparameter* param) { struct icalparameter_impl *impl = (struct icalparameter_impl*)param; @@ -1113,7 +1186,7 @@ icalparameter_get_xname (icalparameter* param) } void -icalparameter_set_xvalue (icalparameter* param, char* v) +icalparameter_set_xvalue (icalparameter* param, const char* v) { struct icalparameter_impl *impl = (struct icalparameter_impl*)param; @@ -1121,7 +1194,7 @@ icalparameter_set_xvalue (icalparameter* param, char* v) icalerror_check_arg_rv( (v!=0),"v"); if (impl->string != 0){ - free(impl->string); + free((void*)impl->string); } impl->string = icalmemory_strdup(v); @@ -1132,7 +1205,7 @@ icalparameter_set_xvalue (icalparameter* param, char* v) } -char* +const char* icalparameter_get_xvalue (icalparameter* param) { struct icalparameter_impl *impl = (struct icalparameter_impl*)param; @@ -1165,7 +1238,7 @@ icalproperty* icalparameter_get_parent(icalparameter* param) /* Everything below this line is machine generated. Do not edit. */ /* ALTREP */ -icalparameter* icalparameter_new_altrep(char* v) +icalparameter* icalparameter_new_altrep(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1184,24 +1257,24 @@ icalparameter* icalparameter_new_altrep(char* v) return (icalparameter*) impl; } -char* icalparameter_get_altrep(icalparameter* param) +const char* icalparameter_get_altrep(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_altrep(icalparameter* param, char* v) +void icalparameter_set_altrep(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* CN */ -icalparameter* icalparameter_new_cn(char* v) +icalparameter* icalparameter_new_cn(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1220,20 +1293,20 @@ icalparameter* icalparameter_new_cn(char* v) return (icalparameter*) impl; } -char* icalparameter_get_cn(icalparameter* param) +const char* icalparameter_get_cn(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_cn(icalparameter* param, char* v) +void icalparameter_set_cn(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* CUTYPE */ @@ -1278,7 +1351,7 @@ void icalparameter_set_cutype(icalparameter* param, icalparameter_cutype v) } /* DELEGATED-FROM */ -icalparameter* icalparameter_new_delegatedfrom(char* v) +icalparameter* icalparameter_new_delegatedfrom(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1297,24 +1370,24 @@ icalparameter* icalparameter_new_delegatedfrom(char* v) return (icalparameter*) impl; } -char* icalparameter_get_delegatedfrom(icalparameter* param) +const char* icalparameter_get_delegatedfrom(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_delegatedfrom(icalparameter* param, char* v) +void icalparameter_set_delegatedfrom(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* DELEGATED-TO */ -icalparameter* icalparameter_new_delegatedto(char* v) +icalparameter* icalparameter_new_delegatedto(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1333,24 +1406,24 @@ icalparameter* icalparameter_new_delegatedto(char* v) return (icalparameter*) impl; } -char* icalparameter_get_delegatedto(icalparameter* param) +const char* icalparameter_get_delegatedto(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_delegatedto(icalparameter* param, char* v) +void icalparameter_set_delegatedto(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* DIR */ -icalparameter* icalparameter_new_dir(char* v) +icalparameter* icalparameter_new_dir(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1369,20 +1442,20 @@ icalparameter* icalparameter_new_dir(char* v) return (icalparameter*) impl; } -char* icalparameter_get_dir(icalparameter* param) +const char* icalparameter_get_dir(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_dir(icalparameter* param, char* v) +void icalparameter_set_dir(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* ENCODING */ @@ -1468,7 +1541,7 @@ void icalparameter_set_fbtype(icalparameter* param, icalparameter_fbtype v) } /* FMTTYPE */ -icalparameter* icalparameter_new_fmttype(char* v) +icalparameter* icalparameter_new_fmttype(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1487,24 +1560,24 @@ icalparameter* icalparameter_new_fmttype(char* v) return (icalparameter*) impl; } -char* icalparameter_get_fmttype(icalparameter* param) +const char* icalparameter_get_fmttype(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_fmttype(icalparameter* param, char* v) +void icalparameter_set_fmttype(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* LANGUAGE */ -icalparameter* icalparameter_new_language(char* v) +icalparameter* icalparameter_new_language(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1523,24 +1596,24 @@ icalparameter* icalparameter_new_language(char* v) return (icalparameter*) impl; } -char* icalparameter_get_language(icalparameter* param) +const char* icalparameter_get_language(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_language(icalparameter* param, char* v) +void icalparameter_set_language(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* MEMBER */ -icalparameter* icalparameter_new_member(char* v) +icalparameter* icalparameter_new_member(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1559,20 +1632,20 @@ icalparameter* icalparameter_new_member(char* v) return (icalparameter*) impl; } -char* icalparameter_get_member(icalparameter* param) +const char* icalparameter_get_member(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_member(icalparameter* param, char* v) +void icalparameter_set_member(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* PARTSTAT */ @@ -1813,7 +1886,7 @@ void icalparameter_set_rsvp(icalparameter* param, int v) } /* SENT-BY */ -icalparameter* icalparameter_new_sentby(char* v) +icalparameter* icalparameter_new_sentby(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1832,24 +1905,24 @@ icalparameter* icalparameter_new_sentby(char* v) return (icalparameter*) impl; } -char* icalparameter_get_sentby(icalparameter* param) +const char* icalparameter_get_sentby(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_sentby(icalparameter* param, char* v) +void icalparameter_set_sentby(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* TZID */ -icalparameter* icalparameter_new_tzid(char* v) +icalparameter* icalparameter_new_tzid(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1868,20 +1941,20 @@ icalparameter* icalparameter_new_tzid(char* v) return (icalparameter*) impl; } -char* icalparameter_get_tzid(icalparameter* param) +const char* icalparameter_get_tzid(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_tzid(icalparameter* param, char* v) +void icalparameter_set_tzid(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* VALUE */ @@ -1926,7 +1999,7 @@ void icalparameter_set_value(icalparameter* param, icalparameter_value v) } /* X */ -icalparameter* icalparameter_new_x(char* v) +icalparameter* icalparameter_new_x(const char* v) { struct icalparameter_impl *impl; icalerror_clear_errno(); @@ -1945,20 +2018,20 @@ icalparameter* icalparameter_new_x(char* v) return (icalparameter*) impl; } -char* icalparameter_get_x(icalparameter* param) +const char* icalparameter_get_x(icalparameter* param) { icalerror_clear_errno(); icalerror_check_arg_rz( (param!=0), "param"); return ((struct icalparameter_impl*)param)->string; } -void icalparameter_set_x(icalparameter* param, char* v) +void icalparameter_set_x(icalparameter* param, const char* v) { icalerror_check_arg_rv( (v!=0),"v"); icalerror_check_arg_rv( (param!=0), "param"); icalerror_clear_errno(); - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v); + ((struct icalparameter_impl*)param)->string = strdup(v); } /* X-LIC-ERRORTYPE */ diff --git a/libical/src/libical/icalparameter.h b/libical/src/libical/icalparameter.h index ad97f34e58..7e1da4e1fe 100644 --- a/libical/src/libical/icalparameter.h +++ b/libical/src/libical/icalparameter.h @@ -5,8 +5,6 @@ $Id$ - $Locker$ - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -29,7 +27,7 @@ #ifndef ICALPARAM_H #define ICALPARAM_H -#include "icalenums.h" /* defined icalparameter_kind and other enums */ +#include "icalenums.h" typedef void icalparameter; @@ -48,22 +46,22 @@ icalparameter_kind icalparameter_isa(icalparameter* parameter); int icalparameter_isa_parameter(void* param); /* Acess the name of an X parameer */ -void icalparameter_set_xname (icalparameter* param, char* v); -char* icalparameter_get_xname(icalparameter* param); -void icalparameter_set_xvalue (icalparameter* param, char* v); -char* icalparameter_get_xvalue(icalparameter* param); +void icalparameter_set_xname (icalparameter* param, const char* v); +const char* icalparameter_get_xname(icalparameter* param); +void icalparameter_set_xvalue (icalparameter* param, const char* v); +const char* icalparameter_get_xvalue(icalparameter* param); /* Everything below this line is machine generated. Do not edit. */ /* ALTREP */ -icalparameter* icalparameter_new_altrep(char* v); -char* icalparameter_get_altrep(icalparameter* value); -void icalparameter_set_altrep(icalparameter* value, char* v); +icalparameter* icalparameter_new_altrep(const char* v); +const char* icalparameter_get_altrep(icalparameter* value); +void icalparameter_set_altrep(icalparameter* value, const char* v); /* CN */ -icalparameter* icalparameter_new_cn(char* v); -char* icalparameter_get_cn(icalparameter* value); -void icalparameter_set_cn(icalparameter* value, char* v); +icalparameter* icalparameter_new_cn(const char* v); +const char* icalparameter_get_cn(icalparameter* value); +void icalparameter_set_cn(icalparameter* value, const char* v); /* CUTYPE */ icalparameter* icalparameter_new_cutype(icalparameter_cutype v); @@ -71,19 +69,19 @@ icalparameter_cutype icalparameter_get_cutype(icalparameter* value); void icalparameter_set_cutype(icalparameter* value, icalparameter_cutype v); /* DELEGATED-FROM */ -icalparameter* icalparameter_new_delegatedfrom(char* v); -char* icalparameter_get_delegatedfrom(icalparameter* value); -void icalparameter_set_delegatedfrom(icalparameter* value, char* v); +icalparameter* icalparameter_new_delegatedfrom(const char* v); +const char* icalparameter_get_delegatedfrom(icalparameter* value); +void icalparameter_set_delegatedfrom(icalparameter* value, const char* v); /* DELEGATED-TO */ -icalparameter* icalparameter_new_delegatedto(char* v); -char* icalparameter_get_delegatedto(icalparameter* value); -void icalparameter_set_delegatedto(icalparameter* value, char* v); +icalparameter* icalparameter_new_delegatedto(const char* v); +const char* icalparameter_get_delegatedto(icalparameter* value); +void icalparameter_set_delegatedto(icalparameter* value, const char* v); /* DIR */ -icalparameter* icalparameter_new_dir(char* v); -char* icalparameter_get_dir(icalparameter* value); -void icalparameter_set_dir(icalparameter* value, char* v); +icalparameter* icalparameter_new_dir(const char* v); +const char* icalparameter_get_dir(icalparameter* value); +void icalparameter_set_dir(icalparameter* value, const char* v); /* ENCODING */ icalparameter* icalparameter_new_encoding(icalparameter_encoding v); @@ -96,19 +94,19 @@ icalparameter_fbtype icalparameter_get_fbtype(icalparameter* value); void icalparameter_set_fbtype(icalparameter* value, icalparameter_fbtype v); /* FMTTYPE */ -icalparameter* icalparameter_new_fmttype(char* v); -char* icalparameter_get_fmttype(icalparameter* value); -void icalparameter_set_fmttype(icalparameter* value, char* v); +icalparameter* icalparameter_new_fmttype(const char* v); +const char* icalparameter_get_fmttype(icalparameter* value); +void icalparameter_set_fmttype(icalparameter* value, const char* v); /* LANGUAGE */ -icalparameter* icalparameter_new_language(char* v); -char* icalparameter_get_language(icalparameter* value); -void icalparameter_set_language(icalparameter* value, char* v); +icalparameter* icalparameter_new_language(const char* v); +const char* icalparameter_get_language(icalparameter* value); +void icalparameter_set_language(icalparameter* value, const char* v); /* MEMBER */ -icalparameter* icalparameter_new_member(char* v); -char* icalparameter_get_member(icalparameter* value); -void icalparameter_set_member(icalparameter* value, char* v); +icalparameter* icalparameter_new_member(const char* v); +const char* icalparameter_get_member(icalparameter* value); +void icalparameter_set_member(icalparameter* value, const char* v); /* PARTSTAT */ icalparameter* icalparameter_new_partstat(icalparameter_partstat v); @@ -141,14 +139,14 @@ int icalparameter_get_rsvp(icalparameter* value); void icalparameter_set_rsvp(icalparameter* value, int v); /* SENT-BY */ -icalparameter* icalparameter_new_sentby(char* v); -char* icalparameter_get_sentby(icalparameter* value); -void icalparameter_set_sentby(icalparameter* value, char* v); +icalparameter* icalparameter_new_sentby(const char* v); +const char* icalparameter_get_sentby(icalparameter* value); +void icalparameter_set_sentby(icalparameter* value, const char* v); /* TZID */ -icalparameter* icalparameter_new_tzid(char* v); -char* icalparameter_get_tzid(icalparameter* value); -void icalparameter_set_tzid(icalparameter* value, char* v); +icalparameter* icalparameter_new_tzid(const char* v); +const char* icalparameter_get_tzid(icalparameter* value); +void icalparameter_set_tzid(icalparameter* value, const char* v); /* VALUE */ icalparameter* icalparameter_new_value(icalparameter_value v); @@ -156,9 +154,9 @@ icalparameter_value icalparameter_get_value(icalparameter* value); void icalparameter_set_value(icalparameter* value, icalparameter_value v); /* X */ -icalparameter* icalparameter_new_x(char* v); -char* icalparameter_get_x(icalparameter* value); -void icalparameter_set_x(icalparameter* value, char* v); +icalparameter* icalparameter_new_x(const char* v); +const char* icalparameter_get_x(icalparameter* value); +void icalparameter_set_x(icalparameter* value, const char* v); /* X-LIC-ERRORTYPE */ icalparameter* icalparameter_new_xlicerrortype(icalparameter_xlicerrortype v); @@ -170,4 +168,4 @@ icalparameter* icalparameter_new_xliccomparetype(icalparameter_xliccomparetype v icalparameter_xliccomparetype icalparameter_get_xliccomparetype(icalparameter* value); void icalparameter_set_xliccomparetype(icalparameter* value, icalparameter_xliccomparetype v); -#endif ICALPARAMETER_H +#endif /*ICALPARAMETER_H*/ diff --git a/libical/src/libical/icalparser.c b/libical/src/libical/icalparser.c index 11a505244f..1de5945e7b 100644 --- a/libical/src/libical/icalparser.c +++ b/libical/src/libical/icalparser.c @@ -4,8 +4,6 @@ CREATOR: eric 04 August 1999 $Id$ - - $Locker$ The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in @@ -39,10 +37,15 @@ #endif -#include "ical.h" -#include "pvl.h" #include "icalparser.h" +#include "pvl.h" #include "icalmemory.h" +#include "icalerror.h" +#include "icalvalue.h" +#include "icalparameter.h" +#include "icalproperty.h" +#include "icalcomponent.h" + #include <string.h> /* For strncpy & size_t */ #include <stdio.h> /* For FILE and fgets and sprintf */ #include <stdlib.h> /* for free */ @@ -50,7 +53,7 @@ extern icalvalue* icalparser_yy_value; void set_parser_value_state(icalvalue_kind kind); -int ical_yy_parse(void); +int ical_yyparse(void); char* icalparser_get_next_char(char c, char *str); char* icalparser_get_next_parameter(char* line,char** end); @@ -78,10 +81,9 @@ struct icalparser_impl }; -icalparser* icalparser_new() +icalparser* icalparser_new(void) { struct icalparser_impl* impl = 0; - if ( ( impl = (struct icalparser_impl*) malloc(sizeof(struct icalparser_impl))) == 0) { icalerror_set_errno(ICAL_NEWFAILED_ERROR); @@ -178,8 +180,8 @@ char* make_segment(char* start, char* end) } -char* input_buffer; -char* input_buffer_p; +const char* input_buffer; +const char* input_buffer_p; #define min(a,b) ((a) < (b) ? (a) : (b)) int icalparser_flex_input(char* buf, int max_size) @@ -195,7 +197,7 @@ int icalparser_flex_input(char* buf, int max_size) } } -void icalparser_clear_flex_input() +void icalparser_clear_flex_input(void) { input_buffer_p = input_buffer+strlen(input_buffer); } @@ -203,7 +205,7 @@ void icalparser_clear_flex_input() /* Cal the flex parser to parse a complex value */ icalvalue* icalparser_parse_value(icalvalue_kind kind, - char* str, icalproperty** error) + const char* str, icalproperty** error) { int r; input_buffer_p = input_buffer = str; @@ -211,7 +213,7 @@ icalvalue* icalparser_parse_value(icalvalue_kind kind, set_parser_value_state(kind); icalparser_yy_value = 0; - r = ical_yy_parse(); + r = ical_yyparse(); /* Error. Parse failed */ if( icalparser_yy_value == 0 || r != 0){ diff --git a/libical/src/libical/icalparser.h b/libical/src/libical/icalparser.h index 161127379f..7940bc8cca 100644 --- a/libical/src/libical/icalparser.h +++ b/libical/src/libical/icalparser.h @@ -5,7 +5,6 @@ $Id$ - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org This program is free software; you can redistribute it and/or modify @@ -27,7 +26,10 @@ #ifndef ICALPARSER_H #define ICALPARSER_H -#include "ical.h" +#include "icalenums.h" +#include "icaltypes.h" +#include"icalcomponent.h" + #include <stdio.h> /* For FILE* */ typedef void* icalparser; @@ -49,7 +51,7 @@ typedef enum icalparser_state { ICALPARSER_IN_PROGRESS } icalparser_state; -icalparser* icalparser_new(); +icalparser* icalparser_new(void); icalcomponent* icalparser_add_line(icalparser* parser, char* str ); icalcomponent* icalparser_claim(icalparser* parser); icalcomponent* icalparser_clean(icalparser* parser); @@ -80,7 +82,8 @@ icalcomponent* icalparser_parse_string(char* str); ***********************************************************************/ /* Use the flex/bison parser to turn a string into a value type */ -icalvalue* icalparser_parse_value(icalvalue_kind kind, char* str, icalcomponent** errors); +icalvalue* icalparser_parse_value(icalvalue_kind kind, + const char* str, icalcomponent** errors); /* Given a line generator function, return a single iCal content line.*/ char* icalparser_get_line(icalparser* parser, char* (*line_gen_func)(char *s, size_t size, void *d)); diff --git a/libical/src/libical/icalproperty.c b/libical/src/libical/icalproperty.c index b63c8a960a..84d6605160 100644 --- a/libical/src/libical/icalproperty.c +++ b/libical/src/libical/icalproperty.c @@ -6,7 +6,6 @@ $Id$ - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org This program is free software; you can redistribute it and/or modify @@ -23,24 +22,26 @@ The original code is icalproperty.c ======================================================================*/ +#line 27 "icalproperty.c.in" #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif -#include <string.h> /* For icalmemory_strdup, rindex */ -#include <assert.h> -#include <stdlib.h> -#include <errno.h> -#include <stdio.h> /* for printf */ -#include <stdarg.h> /* for va_list, va_start, etc. */ - -#include "ical.h" +#include "icalproperty.h" +#include "icalcomponent.h" #include "pvl.h" #include "icalenums.h" #include "icalerror.h" #include "icalmemory.h" +#include <string.h> /* For icalmemory_strdup, rindex */ +#include <assert.h> +#include <stdlib.h> +#include <errno.h> +#include <stdio.h> /* for printf */ +#include <stdarg.h> /* for va_list, va_start, etc. */ + #define TMP_BUF_SIZE 1024 /* Private routines for icalproperty */ @@ -87,6 +88,7 @@ void icalproperty_add_parameters(struct icalproperty_impl *impl,va_list args) } + struct icalproperty_impl* icalproperty_new_impl (icalproperty_kind kind) { @@ -251,18 +253,14 @@ icalproperty_as_ical_string (icalproperty* prop) by libical, so it can be given to the caller without fear of the caller forgetting to free it */ - char* property_name = 0; + const char* property_name = 0; size_t buf_size = 1024; char* buf = icalmemory_new_buffer(buf_size); char* buf_ptr = buf; icalvalue* value; char *out_buf; -#ifdef ICAL_UNIX_NEWLINE char newline[] = "\n"; -#else - char newline[] = "\r\n"; -#endif struct icalproperty_impl *impl = (struct icalproperty_impl*)prop; @@ -315,7 +313,7 @@ icalproperty_as_ical_string (icalproperty* prop) value = icalproperty_get_value(prop); if (value != 0){ - char *str = icalvalue_as_ical_string(value); + const char *str = icalvalue_as_ical_string(value); icalerror_assert((str !=0),"Could not get string representation of a value"); icalmemory_append_string(&buf, &buf_ptr, &buf_size, str); } else { @@ -378,14 +376,32 @@ icalproperty_add_parameter (icalproperty* prop,icalparameter* parameter) } +void +icalproperty_set_parameter (icalproperty* prop,icalparameter* parameter) +{ + icalproperty_kind kind; + + kind = icalparameter_isa(parameter); + + icalproperty_remove_parameter(prop,kind); + + icalproperty_add_parameter(prop,parameter); +} + void icalproperty_remove_parameter (icalproperty* prop, icalparameter_kind kind) { +<<<<<<< icalproperty.c struct icalproperty_impl *p = (struct icalproperty_impl*)prop; icalparameter *param; pvl_elem elem; +======= + pvl_elem p; + struct icalproperty_impl *impl = (struct icalproperty_impl*)prop; +>>>>>>> 1.1.1.5 +<<<<<<< icalproperty.c icalerror_check_arg_rv((prop!=0),"prop"); /* This routine is now implemented, so disregard the following @@ -402,6 +418,18 @@ icalproperty_remove_parameter (icalproperty* prop, icalparameter_kind kind) } elem = pvl_next (elem); } +======= + icalerror_check_arg_rv((prop!=0),"prop"); + + for(p=pvl_head(impl->parameters);p != 0; p = pvl_next(p)){ + icalparameter* param = (icalparameter *)pvl_data (p); + if (icalparameter_isa(param) == kind) { + pvl_remove (impl->parameters, p); + icalparameter_free (param); + break; + } + } +>>>>>>> 1.1.1.5 } @@ -432,27 +460,45 @@ icalproperty_get_first_parameter (icalproperty* prop, icalparameter_kind kind) return 0; } - return (icalparameter*) pvl_data(p->parameter_iterator); + for( p->parameter_iterator = pvl_head(p->parameters); + p->parameter_iterator !=0; + p->parameter_iterator = pvl_next(p->parameter_iterator)){ + + icalparameter *param = (icalparameter*)pvl_data(p->parameter_iterator); + + if(icalparameter_isa(param) == kind || kind == ICAL_ANY_PARAMETER){ + return param; + } + } + + return 0; } icalparameter* icalproperty_get_next_parameter (icalproperty* prop, icalparameter_kind kind) { - struct icalproperty_impl *p = (struct icalproperty_impl*)prop; - icalerror_check_arg_rz( (prop!=0),"prop"); - - if (p->parameter_iterator == 0 ) { - return 0; - } - - p->parameter_iterator = pvl_next(p->parameter_iterator); - - if (p->parameter_iterator == 0 ) { - return 0; - } + struct icalproperty_impl *p = (struct icalproperty_impl*)prop; + + icalerror_check_arg_rz( (prop!=0),"prop"); + + if (p->parameter_iterator == 0) { + return 0; + } + + for( p->parameter_iterator = pvl_next(p->parameter_iterator); + p->parameter_iterator !=0; + p->parameter_iterator = pvl_next(p->parameter_iterator)){ + + icalparameter *param = (icalparameter*)pvl_data(p->parameter_iterator); + + if(icalparameter_isa(param) == kind || kind == ICAL_ANY_PARAMETER){ + return param; + } + } + + return 0; - return (icalparameter*) pvl_data(p->parameter_iterator); } void @@ -589,7 +635,7 @@ icalproperty_method icalproperty_get_method(icalproperty* prop) /* X-LIC-MIMECID */ -icalproperty* icalproperty_new_xlicmimecid(char* v) +icalproperty* icalproperty_new_xlicmimecid(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -600,7 +646,7 @@ icalproperty* icalproperty_new_xlicmimecid(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_xlicmimecid(char* v, ...) +icalproperty* icalproperty_vanew_xlicmimecid(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECID_PROPERTY); @@ -616,7 +662,7 @@ icalproperty* icalproperty_vanew_xlicmimecid(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_xlicmimecid(icalproperty* prop, char* v) +void icalproperty_set_xlicmimecid(icalproperty* prop, const char* v) { icalvalue *value; @@ -630,7 +676,7 @@ void icalproperty_set_xlicmimecid(icalproperty* prop, char* v) } -char* icalproperty_get_xlicmimecid(icalproperty* prop) +const char* icalproperty_get_xlicmimecid(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -692,7 +738,7 @@ struct icaltimetype icalproperty_get_lastmodified(icalproperty* prop) /* UID */ -icalproperty* icalproperty_new_uid(char* v) +icalproperty* icalproperty_new_uid(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_UID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -703,7 +749,7 @@ icalproperty* icalproperty_new_uid(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_uid(char* v, ...) +icalproperty* icalproperty_vanew_uid(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_UID_PROPERTY); @@ -719,7 +765,7 @@ icalproperty* icalproperty_vanew_uid(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_uid(icalproperty* prop, char* v) +void icalproperty_set_uid(icalproperty* prop, const char* v) { icalvalue *value; @@ -733,7 +779,7 @@ void icalproperty_set_uid(icalproperty* prop, char* v) } -char* icalproperty_get_uid(icalproperty* prop) +const char* icalproperty_get_uid(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -745,7 +791,7 @@ char* icalproperty_get_uid(icalproperty* prop) /* PRODID */ -icalproperty* icalproperty_new_prodid(char* v) +icalproperty* icalproperty_new_prodid(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PRODID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -756,7 +802,7 @@ icalproperty* icalproperty_new_prodid(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_prodid(char* v, ...) +icalproperty* icalproperty_vanew_prodid(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PRODID_PROPERTY); @@ -772,7 +818,7 @@ icalproperty* icalproperty_vanew_prodid(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_prodid(icalproperty* prop, char* v) +void icalproperty_set_prodid(icalproperty* prop, const char* v) { icalvalue *value; @@ -786,7 +832,7 @@ void icalproperty_set_prodid(icalproperty* prop, char* v) } -char* icalproperty_get_prodid(icalproperty* prop) +const char* icalproperty_get_prodid(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -798,23 +844,21 @@ char* icalproperty_get_prodid(icalproperty* prop) /* STATUS */ -icalproperty* icalproperty_new_status(char* v) +icalproperty* icalproperty_new_status(icalproperty_status v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_STATUS_PROPERTY); - icalerror_check_arg_rz( (v!=0),"v"); - + icalproperty_set_status((icalproperty*)impl,v); return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_status(char* v, ...) +icalproperty* icalproperty_vanew_status(icalproperty_status v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_STATUS_PROPERTY); - icalerror_check_arg_rz( (v!=0),"v"); - + icalproperty_set_status((icalproperty*)impl,v); @@ -825,33 +869,32 @@ icalproperty* icalproperty_vanew_status(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_status(icalproperty* prop, char* v) +void icalproperty_set_status(icalproperty* prop, icalproperty_status v) { icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - + icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); + value = icalvalue_new_status(v); icalproperty_set_value(prop,value); } -char* icalproperty_get_status(icalproperty* prop) +icalproperty_status icalproperty_get_status(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); value = icalproperty_get_value(prop); - return icalvalue_get_text(value); + return icalvalue_get_status(value); } /* DESCRIPTION */ -icalproperty* icalproperty_new_description(char* v) +icalproperty* icalproperty_new_description(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DESCRIPTION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -862,7 +905,7 @@ icalproperty* icalproperty_new_description(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_description(char* v, ...) +icalproperty* icalproperty_vanew_description(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DESCRIPTION_PROPERTY); @@ -878,7 +921,7 @@ icalproperty* icalproperty_vanew_description(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_description(icalproperty* prop, char* v) +void icalproperty_set_description(icalproperty* prop, const char* v) { icalvalue *value; @@ -892,7 +935,7 @@ void icalproperty_set_description(icalproperty* prop, char* v) } -char* icalproperty_get_description(icalproperty* prop) +const char* icalproperty_get_description(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -954,7 +997,7 @@ struct icaldurationtype icalproperty_get_duration(icalproperty* prop) /* CATEGORIES */ -icalproperty* icalproperty_new_categories(char* v) +icalproperty* icalproperty_new_categories(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CATEGORIES_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -965,7 +1008,7 @@ icalproperty* icalproperty_new_categories(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_categories(char* v, ...) +icalproperty* icalproperty_vanew_categories(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CATEGORIES_PROPERTY); @@ -981,7 +1024,7 @@ icalproperty* icalproperty_vanew_categories(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_categories(icalproperty* prop, char* v) +void icalproperty_set_categories(icalproperty* prop, const char* v) { icalvalue *value; @@ -995,7 +1038,7 @@ void icalproperty_set_categories(icalproperty* prop, char* v) } -char* icalproperty_get_categories(icalproperty* prop) +const char* icalproperty_get_categories(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1007,7 +1050,7 @@ char* icalproperty_get_categories(icalproperty* prop) /* VERSION */ -icalproperty* icalproperty_new_version(char* v) +icalproperty* icalproperty_new_version(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_VERSION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1018,7 +1061,7 @@ icalproperty* icalproperty_new_version(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_version(char* v, ...) +icalproperty* icalproperty_vanew_version(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_VERSION_PROPERTY); @@ -1034,7 +1077,7 @@ icalproperty* icalproperty_vanew_version(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_version(icalproperty* prop, char* v) +void icalproperty_set_version(icalproperty* prop, const char* v) { icalvalue *value; @@ -1048,7 +1091,7 @@ void icalproperty_set_version(icalproperty* prop, char* v) } -char* icalproperty_get_version(icalproperty* prop) +const char* icalproperty_get_version(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1160,7 +1203,7 @@ struct icalrecurrencetype icalproperty_get_rrule(icalproperty* prop) /* ATTENDEE */ -icalproperty* icalproperty_new_attendee(char* v) +icalproperty* icalproperty_new_attendee(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ATTENDEE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1171,7 +1214,7 @@ icalproperty* icalproperty_new_attendee(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_attendee(char* v, ...) +icalproperty* icalproperty_vanew_attendee(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ATTENDEE_PROPERTY); @@ -1187,7 +1230,7 @@ icalproperty* icalproperty_vanew_attendee(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_attendee(icalproperty* prop, char* v) +void icalproperty_set_attendee(icalproperty* prop, const char* v) { icalvalue *value; @@ -1201,7 +1244,7 @@ void icalproperty_set_attendee(icalproperty* prop, char* v) } -char* icalproperty_get_attendee(icalproperty* prop) +const char* icalproperty_get_attendee(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1213,7 +1256,7 @@ char* icalproperty_get_attendee(icalproperty* prop) /* CONTACT */ -icalproperty* icalproperty_new_contact(char* v) +icalproperty* icalproperty_new_contact(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CONTACT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1224,7 +1267,7 @@ icalproperty* icalproperty_new_contact(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_contact(char* v, ...) +icalproperty* icalproperty_vanew_contact(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CONTACT_PROPERTY); @@ -1240,7 +1283,7 @@ icalproperty* icalproperty_vanew_contact(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_contact(icalproperty* prop, char* v) +void icalproperty_set_contact(icalproperty* prop, const char* v) { icalvalue *value; @@ -1254,7 +1297,7 @@ void icalproperty_set_contact(icalproperty* prop, char* v) } -char* icalproperty_get_contact(icalproperty* prop) +const char* icalproperty_get_contact(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1266,7 +1309,7 @@ char* icalproperty_get_contact(icalproperty* prop) /* X-LIC-MIMECONTENTTYPE */ -icalproperty* icalproperty_new_xlicmimecontenttype(char* v) +icalproperty* icalproperty_new_xlicmimecontenttype(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECONTENTTYPE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1277,7 +1320,7 @@ icalproperty* icalproperty_new_xlicmimecontenttype(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_xlicmimecontenttype(char* v, ...) +icalproperty* icalproperty_vanew_xlicmimecontenttype(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECONTENTTYPE_PROPERTY); @@ -1293,7 +1336,7 @@ icalproperty* icalproperty_vanew_xlicmimecontenttype(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_xlicmimecontenttype(icalproperty* prop, char* v) +void icalproperty_set_xlicmimecontenttype(icalproperty* prop, const char* v) { icalvalue *value; @@ -1307,7 +1350,7 @@ void icalproperty_set_xlicmimecontenttype(icalproperty* prop, char* v) } -char* icalproperty_get_xlicmimecontenttype(icalproperty* prop) +const char* icalproperty_get_xlicmimecontenttype(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1319,7 +1362,7 @@ char* icalproperty_get_xlicmimecontenttype(icalproperty* prop) /* X-LIC-MIMEOPTINFO */ -icalproperty* icalproperty_new_xlicmimeoptinfo(char* v) +icalproperty* icalproperty_new_xlicmimeoptinfo(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEOPTINFO_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1330,7 +1373,7 @@ icalproperty* icalproperty_new_xlicmimeoptinfo(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_xlicmimeoptinfo(char* v, ...) +icalproperty* icalproperty_vanew_xlicmimeoptinfo(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEOPTINFO_PROPERTY); @@ -1346,7 +1389,7 @@ icalproperty* icalproperty_vanew_xlicmimeoptinfo(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, char* v) +void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, const char* v) { icalvalue *value; @@ -1360,7 +1403,7 @@ void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, char* v) } -char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop) +const char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1372,7 +1415,7 @@ char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop) /* RELATED-TO */ -icalproperty* icalproperty_new_relatedto(char* v) +icalproperty* icalproperty_new_relatedto(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RELATEDTO_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1383,7 +1426,7 @@ icalproperty* icalproperty_new_relatedto(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_relatedto(char* v, ...) +icalproperty* icalproperty_vanew_relatedto(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RELATEDTO_PROPERTY); @@ -1399,7 +1442,7 @@ icalproperty* icalproperty_vanew_relatedto(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_relatedto(icalproperty* prop, char* v) +void icalproperty_set_relatedto(icalproperty* prop, const char* v) { icalvalue *value; @@ -1413,7 +1456,7 @@ void icalproperty_set_relatedto(icalproperty* prop, char* v) } -char* icalproperty_get_relatedto(icalproperty* prop) +const char* icalproperty_get_relatedto(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1425,7 +1468,7 @@ char* icalproperty_get_relatedto(icalproperty* prop) /* ORGANIZER */ -icalproperty* icalproperty_new_organizer(char* v) +icalproperty* icalproperty_new_organizer(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ORGANIZER_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1436,7 +1479,7 @@ icalproperty* icalproperty_new_organizer(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_organizer(char* v, ...) +icalproperty* icalproperty_vanew_organizer(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ORGANIZER_PROPERTY); @@ -1452,7 +1495,7 @@ icalproperty* icalproperty_vanew_organizer(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_organizer(icalproperty* prop, char* v) +void icalproperty_set_organizer(icalproperty* prop, const char* v) { icalvalue *value; @@ -1466,7 +1509,7 @@ void icalproperty_set_organizer(icalproperty* prop, char* v) } -char* icalproperty_get_organizer(icalproperty* prop) +const char* icalproperty_get_organizer(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1478,7 +1521,7 @@ char* icalproperty_get_organizer(icalproperty* prop) /* COMMENT */ -icalproperty* icalproperty_new_comment(char* v) +icalproperty* icalproperty_new_comment(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_COMMENT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1489,7 +1532,7 @@ icalproperty* icalproperty_new_comment(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_comment(char* v, ...) +icalproperty* icalproperty_vanew_comment(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_COMMENT_PROPERTY); @@ -1505,7 +1548,7 @@ icalproperty* icalproperty_vanew_comment(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_comment(icalproperty* prop, char* v) +void icalproperty_set_comment(icalproperty* prop, const char* v) { icalvalue *value; @@ -1519,7 +1562,7 @@ void icalproperty_set_comment(icalproperty* prop, char* v) } -char* icalproperty_get_comment(icalproperty* prop) +const char* icalproperty_get_comment(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1531,7 +1574,7 @@ char* icalproperty_get_comment(icalproperty* prop) /* X-LIC-ERROR */ -icalproperty* icalproperty_new_xlicerror(char* v) +icalproperty* icalproperty_new_xlicerror(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICERROR_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1542,7 +1585,7 @@ icalproperty* icalproperty_new_xlicerror(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_xlicerror(char* v, ...) +icalproperty* icalproperty_vanew_xlicerror(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICERROR_PROPERTY); @@ -1558,7 +1601,7 @@ icalproperty* icalproperty_vanew_xlicerror(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_xlicerror(icalproperty* prop, char* v) +void icalproperty_set_xlicerror(icalproperty* prop, const char* v) { icalvalue *value; @@ -1572,7 +1615,7 @@ void icalproperty_set_xlicerror(icalproperty* prop, char* v) } -char* icalproperty_get_xlicerror(icalproperty* prop) +const char* icalproperty_get_xlicerror(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1634,7 +1677,7 @@ union icaltriggertype icalproperty_get_trigger(icalproperty* prop) /* CLASS */ -icalproperty* icalproperty_new_class(char* v) +icalproperty* icalproperty_new_class(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CLASS_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1645,7 +1688,7 @@ icalproperty* icalproperty_new_class(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_class(char* v, ...) +icalproperty* icalproperty_vanew_class(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CLASS_PROPERTY); @@ -1661,7 +1704,7 @@ icalproperty* icalproperty_vanew_class(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_class(icalproperty* prop, char* v) +void icalproperty_set_class(icalproperty* prop, const char* v) { icalvalue *value; @@ -1675,7 +1718,7 @@ void icalproperty_set_class(icalproperty* prop, char* v) } -char* icalproperty_get_class(icalproperty* prop) +const char* icalproperty_get_class(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1687,7 +1730,7 @@ char* icalproperty_get_class(icalproperty* prop) /* X */ -icalproperty* icalproperty_new_x(char* v) +icalproperty* icalproperty_new_x(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_X_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1698,7 +1741,7 @@ icalproperty* icalproperty_new_x(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_x(char* v, ...) +icalproperty* icalproperty_vanew_x(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_X_PROPERTY); @@ -1714,7 +1757,7 @@ icalproperty* icalproperty_vanew_x(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_x(icalproperty* prop, char* v) +void icalproperty_set_x(icalproperty* prop, const char* v) { icalvalue *value; @@ -1728,7 +1771,7 @@ void icalproperty_set_x(icalproperty* prop, char* v) } -char* icalproperty_get_x(icalproperty* prop) +const char* icalproperty_get_x(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1790,7 +1833,7 @@ int icalproperty_get_tzoffsetto(icalproperty* prop) /* TRANSP */ -icalproperty* icalproperty_new_transp(char* v) +icalproperty* icalproperty_new_transp(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TRANSP_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1801,7 +1844,7 @@ icalproperty* icalproperty_new_transp(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_transp(char* v, ...) +icalproperty* icalproperty_vanew_transp(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TRANSP_PROPERTY); @@ -1817,7 +1860,7 @@ icalproperty* icalproperty_vanew_transp(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_transp(icalproperty* prop, char* v) +void icalproperty_set_transp(icalproperty* prop, const char* v) { icalvalue *value; @@ -1831,7 +1874,7 @@ void icalproperty_set_transp(icalproperty* prop, char* v) } -char* icalproperty_get_transp(icalproperty* prop) +const char* icalproperty_get_transp(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1843,7 +1886,7 @@ char* icalproperty_get_transp(icalproperty* prop) /* X-LIC-MIMEENCODING */ -icalproperty* icalproperty_new_xlicmimeencoding(char* v) +icalproperty* icalproperty_new_xlicmimeencoding(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEENCODING_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1854,7 +1897,7 @@ icalproperty* icalproperty_new_xlicmimeencoding(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_xlicmimeencoding(char* v, ...) +icalproperty* icalproperty_vanew_xlicmimeencoding(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEENCODING_PROPERTY); @@ -1870,7 +1913,7 @@ icalproperty* icalproperty_vanew_xlicmimeencoding(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_xlicmimeencoding(icalproperty* prop, char* v) +void icalproperty_set_xlicmimeencoding(icalproperty* prop, const char* v) { icalvalue *value; @@ -1884,7 +1927,7 @@ void icalproperty_set_xlicmimeencoding(icalproperty* prop, char* v) } -char* icalproperty_get_xlicmimeencoding(icalproperty* prop) +const char* icalproperty_get_xlicmimeencoding(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1946,7 +1989,7 @@ int icalproperty_get_sequence(icalproperty* prop) /* LOCATION */ -icalproperty* icalproperty_new_location(char* v) +icalproperty* icalproperty_new_location(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_LOCATION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -1957,7 +2000,7 @@ icalproperty* icalproperty_new_location(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_location(char* v, ...) +icalproperty* icalproperty_vanew_location(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_LOCATION_PROPERTY); @@ -1973,7 +2016,7 @@ icalproperty* icalproperty_vanew_location(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_location(icalproperty* prop, char* v) +void icalproperty_set_location(icalproperty* prop, const char* v) { icalvalue *value; @@ -1987,7 +2030,7 @@ void icalproperty_set_location(icalproperty* prop, char* v) } -char* icalproperty_get_location(icalproperty* prop) +const char* icalproperty_get_location(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -1999,7 +2042,7 @@ char* icalproperty_get_location(icalproperty* prop) /* REQUEST-STATUS */ -icalproperty* icalproperty_new_requeststatus(char* v) +icalproperty* icalproperty_new_requeststatus(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_REQUESTSTATUS_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2010,7 +2053,7 @@ icalproperty* icalproperty_new_requeststatus(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_requeststatus(char* v, ...) +icalproperty* icalproperty_vanew_requeststatus(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_REQUESTSTATUS_PROPERTY); @@ -2026,7 +2069,7 @@ icalproperty* icalproperty_vanew_requeststatus(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_requeststatus(icalproperty* prop, char* v) +void icalproperty_set_requeststatus(icalproperty* prop, const char* v) { icalvalue *value; @@ -2040,7 +2083,7 @@ void icalproperty_set_requeststatus(icalproperty* prop, char* v) } -char* icalproperty_get_requeststatus(icalproperty* prop) +const char* icalproperty_get_requeststatus(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2102,7 +2145,7 @@ struct icaltimetype icalproperty_get_exdate(icalproperty* prop) /* TZID */ -icalproperty* icalproperty_new_tzid(char* v) +icalproperty* icalproperty_new_tzid(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2113,7 +2156,7 @@ icalproperty* icalproperty_new_tzid(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_tzid(char* v, ...) +icalproperty* icalproperty_vanew_tzid(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZID_PROPERTY); @@ -2129,7 +2172,7 @@ icalproperty* icalproperty_vanew_tzid(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_tzid(icalproperty* prop, char* v) +void icalproperty_set_tzid(icalproperty* prop, const char* v) { icalvalue *value; @@ -2143,7 +2186,7 @@ void icalproperty_set_tzid(icalproperty* prop, char* v) } -char* icalproperty_get_tzid(icalproperty* prop) +const char* icalproperty_get_tzid(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2155,7 +2198,7 @@ char* icalproperty_get_tzid(icalproperty* prop) /* RESOURCES */ -icalproperty* icalproperty_new_resources(char* v) +icalproperty* icalproperty_new_resources(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RESOURCES_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2166,7 +2209,7 @@ icalproperty* icalproperty_new_resources(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_resources(char* v, ...) +icalproperty* icalproperty_vanew_resources(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RESOURCES_PROPERTY); @@ -2182,7 +2225,7 @@ icalproperty* icalproperty_vanew_resources(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_resources(icalproperty* prop, char* v) +void icalproperty_set_resources(icalproperty* prop, const char* v) { icalvalue *value; @@ -2196,7 +2239,7 @@ void icalproperty_set_resources(icalproperty* prop, char* v) } -char* icalproperty_get_resources(icalproperty* prop) +const char* icalproperty_get_resources(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2208,7 +2251,7 @@ char* icalproperty_get_resources(icalproperty* prop) /* TZURL */ -icalproperty* icalproperty_new_tzurl(char* v) +icalproperty* icalproperty_new_tzurl(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZURL_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2219,7 +2262,7 @@ icalproperty* icalproperty_new_tzurl(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_tzurl(char* v, ...) +icalproperty* icalproperty_vanew_tzurl(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZURL_PROPERTY); @@ -2235,7 +2278,7 @@ icalproperty* icalproperty_vanew_tzurl(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_tzurl(icalproperty* prop, char* v) +void icalproperty_set_tzurl(icalproperty* prop, const char* v) { icalvalue *value; @@ -2249,7 +2292,7 @@ void icalproperty_set_tzurl(icalproperty* prop, char* v) } -char* icalproperty_get_tzurl(icalproperty* prop) +const char* icalproperty_get_tzurl(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2511,7 +2554,7 @@ struct icaltimetype icalproperty_get_recurrenceid(icalproperty* prop) /* SUMMARY */ -icalproperty* icalproperty_new_summary(char* v) +icalproperty* icalproperty_new_summary(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SUMMARY_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2522,7 +2565,7 @@ icalproperty* icalproperty_new_summary(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_summary(char* v, ...) +icalproperty* icalproperty_vanew_summary(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SUMMARY_PROPERTY); @@ -2538,7 +2581,7 @@ icalproperty* icalproperty_vanew_summary(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_summary(icalproperty* prop, char* v) +void icalproperty_set_summary(icalproperty* prop, const char* v) { icalvalue *value; @@ -2552,7 +2595,7 @@ void icalproperty_set_summary(icalproperty* prop, char* v) } -char* icalproperty_get_summary(icalproperty* prop) +const char* icalproperty_get_summary(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2614,7 +2657,7 @@ struct icaltimetype icalproperty_get_dtend(icalproperty* prop) /* TZNAME */ -icalproperty* icalproperty_new_tzname(char* v) +icalproperty* icalproperty_new_tzname(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZNAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2625,7 +2668,7 @@ icalproperty* icalproperty_new_tzname(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_tzname(char* v, ...) +icalproperty* icalproperty_vanew_tzname(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZNAME_PROPERTY); @@ -2641,7 +2684,7 @@ icalproperty* icalproperty_vanew_tzname(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_tzname(icalproperty* prop, char* v) +void icalproperty_set_tzname(icalproperty* prop, const char* v) { icalvalue *value; @@ -2655,7 +2698,7 @@ void icalproperty_set_tzname(icalproperty* prop, char* v) } -char* icalproperty_get_tzname(icalproperty* prop) +const char* icalproperty_get_tzname(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2717,7 +2760,7 @@ struct icalperiodtype icalproperty_get_rdate(icalproperty* prop) /* X-LIC-MIMEFILENAME */ -icalproperty* icalproperty_new_xlicmimefilename(char* v) +icalproperty* icalproperty_new_xlicmimefilename(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEFILENAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2728,7 +2771,7 @@ icalproperty* icalproperty_new_xlicmimefilename(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_xlicmimefilename(char* v, ...) +icalproperty* icalproperty_vanew_xlicmimefilename(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEFILENAME_PROPERTY); @@ -2744,7 +2787,7 @@ icalproperty* icalproperty_vanew_xlicmimefilename(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_xlicmimefilename(icalproperty* prop, char* v) +void icalproperty_set_xlicmimefilename(icalproperty* prop, const char* v) { icalvalue *value; @@ -2758,7 +2801,7 @@ void icalproperty_set_xlicmimefilename(icalproperty* prop, char* v) } -char* icalproperty_get_xlicmimefilename(icalproperty* prop) +const char* icalproperty_get_xlicmimefilename(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2770,7 +2813,7 @@ char* icalproperty_get_xlicmimefilename(icalproperty* prop) /* URL */ -icalproperty* icalproperty_new_url(char* v) +icalproperty* icalproperty_new_url(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_URL_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2781,7 +2824,7 @@ icalproperty* icalproperty_new_url(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_url(char* v, ...) +icalproperty* icalproperty_vanew_url(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_URL_PROPERTY); @@ -2797,7 +2840,7 @@ icalproperty* icalproperty_vanew_url(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_url(icalproperty* prop, char* v) +void icalproperty_set_url(icalproperty* prop, const char* v) { icalvalue *value; @@ -2811,7 +2854,7 @@ void icalproperty_set_url(icalproperty* prop, char* v) } -char* icalproperty_get_url(icalproperty* prop) +const char* icalproperty_get_url(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -2973,7 +3016,7 @@ struct icalrecurrencetype icalproperty_get_exrule(icalproperty* prop) /* QUERY */ -icalproperty* icalproperty_new_query(char* v) +icalproperty* icalproperty_new_query(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_QUERY_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -2984,7 +3027,7 @@ icalproperty* icalproperty_new_query(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_query(char* v, ...) +icalproperty* icalproperty_vanew_query(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_QUERY_PROPERTY); @@ -3000,7 +3043,7 @@ icalproperty* icalproperty_vanew_query(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_query(icalproperty* prop, char* v) +void icalproperty_set_query(icalproperty* prop, const char* v) { icalvalue *value; @@ -3014,7 +3057,7 @@ void icalproperty_set_query(icalproperty* prop, char* v) } -char* icalproperty_get_query(icalproperty* prop) +const char* icalproperty_get_query(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -3076,7 +3119,7 @@ int icalproperty_get_percentcomplete(icalproperty* prop) /* CALSCALE */ -icalproperty* icalproperty_new_calscale(char* v) +icalproperty* icalproperty_new_calscale(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CALSCALE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -3087,7 +3130,7 @@ icalproperty* icalproperty_new_calscale(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_calscale(char* v, ...) +icalproperty* icalproperty_vanew_calscale(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CALSCALE_PROPERTY); @@ -3103,7 +3146,7 @@ icalproperty* icalproperty_vanew_calscale(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_calscale(icalproperty* prop, char* v) +void icalproperty_set_calscale(icalproperty* prop, const char* v) { icalvalue *value; @@ -3117,7 +3160,7 @@ void icalproperty_set_calscale(icalproperty* prop, char* v) } -char* icalproperty_get_calscale(icalproperty* prop) +const char* icalproperty_get_calscale(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -3229,7 +3272,7 @@ struct icalgeotype icalproperty_get_geo(icalproperty* prop) /* X-LIC-MIMECHARSET */ -icalproperty* icalproperty_new_xlicmimecharset(char* v) +icalproperty* icalproperty_new_xlicmimecharset(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECHARSET_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -3240,7 +3283,7 @@ icalproperty* icalproperty_new_xlicmimecharset(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_xlicmimecharset(char* v, ...) +icalproperty* icalproperty_vanew_xlicmimecharset(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECHARSET_PROPERTY); @@ -3256,7 +3299,7 @@ icalproperty* icalproperty_vanew_xlicmimecharset(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_xlicmimecharset(icalproperty* prop, char* v) +void icalproperty_set_xlicmimecharset(icalproperty* prop, const char* v) { icalvalue *value; @@ -3270,7 +3313,7 @@ void icalproperty_set_xlicmimecharset(icalproperty* prop, char* v) } -char* icalproperty_get_xlicmimecharset(icalproperty* prop) +const char* icalproperty_get_xlicmimecharset(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); @@ -3432,7 +3475,7 @@ struct icaltimetype icalproperty_get_due(icalproperty* prop) /* ACTION */ -icalproperty* icalproperty_new_action(char* v) +icalproperty* icalproperty_new_action(const char* v) { struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ACTION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); @@ -3443,7 +3486,7 @@ icalproperty* icalproperty_new_action(char* v) return (icalproperty*)impl; } -icalproperty* icalproperty_vanew_action(char* v, ...) +icalproperty* icalproperty_vanew_action(const char* v, ...) { va_list args; struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ACTION_PROPERTY); @@ -3459,7 +3502,7 @@ icalproperty* icalproperty_vanew_action(char* v, ...) return (icalproperty*)impl; } -void icalproperty_set_action(icalproperty* prop, char* v) +void icalproperty_set_action(icalproperty* prop, const char* v) { icalvalue *value; @@ -3473,7 +3516,7 @@ void icalproperty_set_action(icalproperty* prop, char* v) } -char* icalproperty_get_action(icalproperty* prop) +const char* icalproperty_get_action(icalproperty* prop) { icalvalue *value; icalerror_check_arg( (prop!=0),"prop"); diff --git a/libical/src/libical/icalproperty.h b/libical/src/libical/icalproperty.h index 278c4d533f..633a48f148 100644 --- a/libical/src/libical/icalproperty.h +++ b/libical/src/libical/icalproperty.h @@ -13,6 +13,9 @@ #define ICALPROPERTY_H #include <time.h> +#include "icalparameter.h" +#include "icalvalue.h" +#include "icalrecur.h" typedef void icalproperty; @@ -30,6 +33,7 @@ icalproperty_kind icalproperty_isa(icalproperty* property); int icalproperty_isa_property(void* property); void icalproperty_add_parameter(icalproperty* prop,icalparameter* parameter); +void icalproperty_set_parameter(icalproperty* prop,icalparameter* parameter); void icalproperty_remove_parameter(icalproperty* prop, icalparameter_kind kind); @@ -59,10 +63,10 @@ void icalproperty_set_method(icalproperty* prop, icalproperty_method v); icalproperty_method icalproperty_get_method(icalproperty* prop); /* X-LIC-MIMECID */ -icalproperty* icalproperty_new_xlicmimecid(char* v); -icalproperty* icalproperty_vanew_xlicmimecid(char* v, ...); -void icalproperty_set_xlicmimecid(icalproperty* prop, char* v); -char* icalproperty_get_xlicmimecid(icalproperty* prop); +icalproperty* icalproperty_new_xlicmimecid(const char* v); +icalproperty* icalproperty_vanew_xlicmimecid(const char* v, ...); +void icalproperty_set_xlicmimecid(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimecid(icalproperty* prop); /* LAST-MODIFIED */ icalproperty* icalproperty_new_lastmodified(struct icaltimetype v); @@ -71,28 +75,28 @@ void icalproperty_set_lastmodified(icalproperty* prop, struct icaltimetype v); struct icaltimetype icalproperty_get_lastmodified(icalproperty* prop); /* UID */ -icalproperty* icalproperty_new_uid(char* v); -icalproperty* icalproperty_vanew_uid(char* v, ...); -void icalproperty_set_uid(icalproperty* prop, char* v); -char* icalproperty_get_uid(icalproperty* prop); +icalproperty* icalproperty_new_uid(const char* v); +icalproperty* icalproperty_vanew_uid(const char* v, ...); +void icalproperty_set_uid(icalproperty* prop, const char* v); +const char* icalproperty_get_uid(icalproperty* prop); /* PRODID */ -icalproperty* icalproperty_new_prodid(char* v); -icalproperty* icalproperty_vanew_prodid(char* v, ...); -void icalproperty_set_prodid(icalproperty* prop, char* v); -char* icalproperty_get_prodid(icalproperty* prop); +icalproperty* icalproperty_new_prodid(const char* v); +icalproperty* icalproperty_vanew_prodid(const char* v, ...); +void icalproperty_set_prodid(icalproperty* prop, const char* v); +const char* icalproperty_get_prodid(icalproperty* prop); /* STATUS */ -icalproperty* icalproperty_new_status(char* v); -icalproperty* icalproperty_vanew_status(char* v, ...); -void icalproperty_set_status(icalproperty* prop, char* v); -char* icalproperty_get_status(icalproperty* prop); +icalproperty* icalproperty_new_status(icalproperty_status v); +icalproperty* icalproperty_vanew_status(icalproperty_status v, ...); +void icalproperty_set_status(icalproperty* prop, icalproperty_status v); +icalproperty_status icalproperty_get_status(icalproperty* prop); /* DESCRIPTION */ -icalproperty* icalproperty_new_description(char* v); -icalproperty* icalproperty_vanew_description(char* v, ...); -void icalproperty_set_description(icalproperty* prop, char* v); -char* icalproperty_get_description(icalproperty* prop); +icalproperty* icalproperty_new_description(const char* v); +icalproperty* icalproperty_vanew_description(const char* v, ...); +void icalproperty_set_description(icalproperty* prop, const char* v); +const char* icalproperty_get_description(icalproperty* prop); /* DURATION */ icalproperty* icalproperty_new_duration(struct icaldurationtype v); @@ -101,16 +105,16 @@ void icalproperty_set_duration(icalproperty* prop, struct icaldurationtype v); struct icaldurationtype icalproperty_get_duration(icalproperty* prop); /* CATEGORIES */ -icalproperty* icalproperty_new_categories(char* v); -icalproperty* icalproperty_vanew_categories(char* v, ...); -void icalproperty_set_categories(icalproperty* prop, char* v); -char* icalproperty_get_categories(icalproperty* prop); +icalproperty* icalproperty_new_categories(const char* v); +icalproperty* icalproperty_vanew_categories(const char* v, ...); +void icalproperty_set_categories(icalproperty* prop, const char* v); +const char* icalproperty_get_categories(icalproperty* prop); /* VERSION */ -icalproperty* icalproperty_new_version(char* v); -icalproperty* icalproperty_vanew_version(char* v, ...); -void icalproperty_set_version(icalproperty* prop, char* v); -char* icalproperty_get_version(icalproperty* prop); +icalproperty* icalproperty_new_version(const char* v); +icalproperty* icalproperty_vanew_version(const char* v, ...); +void icalproperty_set_version(icalproperty* prop, const char* v); +const char* icalproperty_get_version(icalproperty* prop); /* TZOFFSETFROM */ icalproperty* icalproperty_new_tzoffsetfrom(int v); @@ -125,52 +129,52 @@ void icalproperty_set_rrule(icalproperty* prop, struct icalrecurrencetype v); struct icalrecurrencetype icalproperty_get_rrule(icalproperty* prop); /* ATTENDEE */ -icalproperty* icalproperty_new_attendee(char* v); -icalproperty* icalproperty_vanew_attendee(char* v, ...); -void icalproperty_set_attendee(icalproperty* prop, char* v); -char* icalproperty_get_attendee(icalproperty* prop); +icalproperty* icalproperty_new_attendee(const char* v); +icalproperty* icalproperty_vanew_attendee(const char* v, ...); +void icalproperty_set_attendee(icalproperty* prop, const char* v); +const char* icalproperty_get_attendee(icalproperty* prop); /* CONTACT */ -icalproperty* icalproperty_new_contact(char* v); -icalproperty* icalproperty_vanew_contact(char* v, ...); -void icalproperty_set_contact(icalproperty* prop, char* v); -char* icalproperty_get_contact(icalproperty* prop); +icalproperty* icalproperty_new_contact(const char* v); +icalproperty* icalproperty_vanew_contact(const char* v, ...); +void icalproperty_set_contact(icalproperty* prop, const char* v); +const char* icalproperty_get_contact(icalproperty* prop); /* X-LIC-MIMECONTENTTYPE */ -icalproperty* icalproperty_new_xlicmimecontenttype(char* v); -icalproperty* icalproperty_vanew_xlicmimecontenttype(char* v, ...); -void icalproperty_set_xlicmimecontenttype(icalproperty* prop, char* v); -char* icalproperty_get_xlicmimecontenttype(icalproperty* prop); +icalproperty* icalproperty_new_xlicmimecontenttype(const char* v); +icalproperty* icalproperty_vanew_xlicmimecontenttype(const char* v, ...); +void icalproperty_set_xlicmimecontenttype(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimecontenttype(icalproperty* prop); /* X-LIC-MIMEOPTINFO */ -icalproperty* icalproperty_new_xlicmimeoptinfo(char* v); -icalproperty* icalproperty_vanew_xlicmimeoptinfo(char* v, ...); -void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, char* v); -char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop); +icalproperty* icalproperty_new_xlicmimeoptinfo(const char* v); +icalproperty* icalproperty_vanew_xlicmimeoptinfo(const char* v, ...); +void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop); /* RELATED-TO */ -icalproperty* icalproperty_new_relatedto(char* v); -icalproperty* icalproperty_vanew_relatedto(char* v, ...); -void icalproperty_set_relatedto(icalproperty* prop, char* v); -char* icalproperty_get_relatedto(icalproperty* prop); +icalproperty* icalproperty_new_relatedto(const char* v); +icalproperty* icalproperty_vanew_relatedto(const char* v, ...); +void icalproperty_set_relatedto(icalproperty* prop, const char* v); +const char* icalproperty_get_relatedto(icalproperty* prop); /* ORGANIZER */ -icalproperty* icalproperty_new_organizer(char* v); -icalproperty* icalproperty_vanew_organizer(char* v, ...); -void icalproperty_set_organizer(icalproperty* prop, char* v); -char* icalproperty_get_organizer(icalproperty* prop); +icalproperty* icalproperty_new_organizer(const char* v); +icalproperty* icalproperty_vanew_organizer(const char* v, ...); +void icalproperty_set_organizer(icalproperty* prop, const char* v); +const char* icalproperty_get_organizer(icalproperty* prop); /* COMMENT */ -icalproperty* icalproperty_new_comment(char* v); -icalproperty* icalproperty_vanew_comment(char* v, ...); -void icalproperty_set_comment(icalproperty* prop, char* v); -char* icalproperty_get_comment(icalproperty* prop); +icalproperty* icalproperty_new_comment(const char* v); +icalproperty* icalproperty_vanew_comment(const char* v, ...); +void icalproperty_set_comment(icalproperty* prop, const char* v); +const char* icalproperty_get_comment(icalproperty* prop); /* X-LIC-ERROR */ -icalproperty* icalproperty_new_xlicerror(char* v); -icalproperty* icalproperty_vanew_xlicerror(char* v, ...); -void icalproperty_set_xlicerror(icalproperty* prop, char* v); -char* icalproperty_get_xlicerror(icalproperty* prop); +icalproperty* icalproperty_new_xlicerror(const char* v); +icalproperty* icalproperty_vanew_xlicerror(const char* v, ...); +void icalproperty_set_xlicerror(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicerror(icalproperty* prop); /* TRIGGER */ icalproperty* icalproperty_new_trigger(union icaltriggertype v); @@ -179,16 +183,16 @@ void icalproperty_set_trigger(icalproperty* prop, union icaltriggertype v); union icaltriggertype icalproperty_get_trigger(icalproperty* prop); /* CLASS */ -icalproperty* icalproperty_new_class(char* v); -icalproperty* icalproperty_vanew_class(char* v, ...); -void icalproperty_set_class(icalproperty* prop, char* v); -char* icalproperty_get_class(icalproperty* prop); +icalproperty* icalproperty_new_class(const char* v); +icalproperty* icalproperty_vanew_class(const char* v, ...); +void icalproperty_set_class(icalproperty* prop, const char* v); +const char* icalproperty_get_class(icalproperty* prop); /* X */ -icalproperty* icalproperty_new_x(char* v); -icalproperty* icalproperty_vanew_x(char* v, ...); -void icalproperty_set_x(icalproperty* prop, char* v); -char* icalproperty_get_x(icalproperty* prop); +icalproperty* icalproperty_new_x(const char* v); +icalproperty* icalproperty_vanew_x(const char* v, ...); +void icalproperty_set_x(icalproperty* prop, const char* v); +const char* icalproperty_get_x(icalproperty* prop); /* TZOFFSETTO */ icalproperty* icalproperty_new_tzoffsetto(int v); @@ -197,16 +201,16 @@ void icalproperty_set_tzoffsetto(icalproperty* prop, int v); int icalproperty_get_tzoffsetto(icalproperty* prop); /* TRANSP */ -icalproperty* icalproperty_new_transp(char* v); -icalproperty* icalproperty_vanew_transp(char* v, ...); -void icalproperty_set_transp(icalproperty* prop, char* v); -char* icalproperty_get_transp(icalproperty* prop); +icalproperty* icalproperty_new_transp(const char* v); +icalproperty* icalproperty_vanew_transp(const char* v, ...); +void icalproperty_set_transp(icalproperty* prop, const char* v); +const char* icalproperty_get_transp(icalproperty* prop); /* X-LIC-MIMEENCODING */ -icalproperty* icalproperty_new_xlicmimeencoding(char* v); -icalproperty* icalproperty_vanew_xlicmimeencoding(char* v, ...); -void icalproperty_set_xlicmimeencoding(icalproperty* prop, char* v); -char* icalproperty_get_xlicmimeencoding(icalproperty* prop); +icalproperty* icalproperty_new_xlicmimeencoding(const char* v); +icalproperty* icalproperty_vanew_xlicmimeencoding(const char* v, ...); +void icalproperty_set_xlicmimeencoding(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimeencoding(icalproperty* prop); /* SEQUENCE */ icalproperty* icalproperty_new_sequence(int v); @@ -215,16 +219,16 @@ void icalproperty_set_sequence(icalproperty* prop, int v); int icalproperty_get_sequence(icalproperty* prop); /* LOCATION */ -icalproperty* icalproperty_new_location(char* v); -icalproperty* icalproperty_vanew_location(char* v, ...); -void icalproperty_set_location(icalproperty* prop, char* v); -char* icalproperty_get_location(icalproperty* prop); +icalproperty* icalproperty_new_location(const char* v); +icalproperty* icalproperty_vanew_location(const char* v, ...); +void icalproperty_set_location(icalproperty* prop, const char* v); +const char* icalproperty_get_location(icalproperty* prop); /* REQUEST-STATUS */ -icalproperty* icalproperty_new_requeststatus(char* v); -icalproperty* icalproperty_vanew_requeststatus(char* v, ...); -void icalproperty_set_requeststatus(icalproperty* prop, char* v); -char* icalproperty_get_requeststatus(icalproperty* prop); +icalproperty* icalproperty_new_requeststatus(const char* v); +icalproperty* icalproperty_vanew_requeststatus(const char* v, ...); +void icalproperty_set_requeststatus(icalproperty* prop, const char* v); +const char* icalproperty_get_requeststatus(icalproperty* prop); /* EXDATE */ icalproperty* icalproperty_new_exdate(struct icaltimetype v); @@ -233,22 +237,22 @@ void icalproperty_set_exdate(icalproperty* prop, struct icaltimetype v); struct icaltimetype icalproperty_get_exdate(icalproperty* prop); /* TZID */ -icalproperty* icalproperty_new_tzid(char* v); -icalproperty* icalproperty_vanew_tzid(char* v, ...); -void icalproperty_set_tzid(icalproperty* prop, char* v); -char* icalproperty_get_tzid(icalproperty* prop); +icalproperty* icalproperty_new_tzid(const char* v); +icalproperty* icalproperty_vanew_tzid(const char* v, ...); +void icalproperty_set_tzid(icalproperty* prop, const char* v); +const char* icalproperty_get_tzid(icalproperty* prop); /* RESOURCES */ -icalproperty* icalproperty_new_resources(char* v); -icalproperty* icalproperty_vanew_resources(char* v, ...); -void icalproperty_set_resources(icalproperty* prop, char* v); -char* icalproperty_get_resources(icalproperty* prop); +icalproperty* icalproperty_new_resources(const char* v); +icalproperty* icalproperty_vanew_resources(const char* v, ...); +void icalproperty_set_resources(icalproperty* prop, const char* v); +const char* icalproperty_get_resources(icalproperty* prop); /* TZURL */ -icalproperty* icalproperty_new_tzurl(char* v); -icalproperty* icalproperty_vanew_tzurl(char* v, ...); -void icalproperty_set_tzurl(icalproperty* prop, char* v); -char* icalproperty_get_tzurl(icalproperty* prop); +icalproperty* icalproperty_new_tzurl(const char* v); +icalproperty* icalproperty_vanew_tzurl(const char* v, ...); +void icalproperty_set_tzurl(icalproperty* prop, const char* v); +const char* icalproperty_get_tzurl(icalproperty* prop); /* REPEAT */ icalproperty* icalproperty_new_repeat(int v); @@ -281,10 +285,10 @@ void icalproperty_set_recurrenceid(icalproperty* prop, struct icaltimetype v); struct icaltimetype icalproperty_get_recurrenceid(icalproperty* prop); /* SUMMARY */ -icalproperty* icalproperty_new_summary(char* v); -icalproperty* icalproperty_vanew_summary(char* v, ...); -void icalproperty_set_summary(icalproperty* prop, char* v); -char* icalproperty_get_summary(icalproperty* prop); +icalproperty* icalproperty_new_summary(const char* v); +icalproperty* icalproperty_vanew_summary(const char* v, ...); +void icalproperty_set_summary(icalproperty* prop, const char* v); +const char* icalproperty_get_summary(icalproperty* prop); /* DTEND */ icalproperty* icalproperty_new_dtend(struct icaltimetype v); @@ -293,10 +297,10 @@ void icalproperty_set_dtend(icalproperty* prop, struct icaltimetype v); struct icaltimetype icalproperty_get_dtend(icalproperty* prop); /* TZNAME */ -icalproperty* icalproperty_new_tzname(char* v); -icalproperty* icalproperty_vanew_tzname(char* v, ...); -void icalproperty_set_tzname(icalproperty* prop, char* v); -char* icalproperty_get_tzname(icalproperty* prop); +icalproperty* icalproperty_new_tzname(const char* v); +icalproperty* icalproperty_vanew_tzname(const char* v, ...); +void icalproperty_set_tzname(icalproperty* prop, const char* v); +const char* icalproperty_get_tzname(icalproperty* prop); /* RDATE */ icalproperty* icalproperty_new_rdate(struct icalperiodtype v); @@ -305,16 +309,16 @@ void icalproperty_set_rdate(icalproperty* prop, struct icalperiodtype v); struct icalperiodtype icalproperty_get_rdate(icalproperty* prop); /* X-LIC-MIMEFILENAME */ -icalproperty* icalproperty_new_xlicmimefilename(char* v); -icalproperty* icalproperty_vanew_xlicmimefilename(char* v, ...); -void icalproperty_set_xlicmimefilename(icalproperty* prop, char* v); -char* icalproperty_get_xlicmimefilename(icalproperty* prop); +icalproperty* icalproperty_new_xlicmimefilename(const char* v); +icalproperty* icalproperty_vanew_xlicmimefilename(const char* v, ...); +void icalproperty_set_xlicmimefilename(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimefilename(icalproperty* prop); /* URL */ -icalproperty* icalproperty_new_url(char* v); -icalproperty* icalproperty_vanew_url(char* v, ...); -void icalproperty_set_url(icalproperty* prop, char* v); -char* icalproperty_get_url(icalproperty* prop); +icalproperty* icalproperty_new_url(const char* v); +icalproperty* icalproperty_vanew_url(const char* v, ...); +void icalproperty_set_url(icalproperty* prop, const char* v); +const char* icalproperty_get_url(icalproperty* prop); /* X-LIC-CLUSTERCOUNT */ icalproperty* icalproperty_new_xlicclustercount(int v); @@ -335,10 +339,10 @@ void icalproperty_set_exrule(icalproperty* prop, struct icalrecurrencetype v); struct icalrecurrencetype icalproperty_get_exrule(icalproperty* prop); /* QUERY */ -icalproperty* icalproperty_new_query(char* v); -icalproperty* icalproperty_vanew_query(char* v, ...); -void icalproperty_set_query(icalproperty* prop, char* v); -char* icalproperty_get_query(icalproperty* prop); +icalproperty* icalproperty_new_query(const char* v); +icalproperty* icalproperty_vanew_query(const char* v, ...); +void icalproperty_set_query(icalproperty* prop, const char* v); +const char* icalproperty_get_query(icalproperty* prop); /* PERCENT-COMPLETE */ icalproperty* icalproperty_new_percentcomplete(int v); @@ -347,10 +351,10 @@ void icalproperty_set_percentcomplete(icalproperty* prop, int v); int icalproperty_get_percentcomplete(icalproperty* prop); /* CALSCALE */ -icalproperty* icalproperty_new_calscale(char* v); -icalproperty* icalproperty_vanew_calscale(char* v, ...); -void icalproperty_set_calscale(icalproperty* prop, char* v); -char* icalproperty_get_calscale(icalproperty* prop); +icalproperty* icalproperty_new_calscale(const char* v); +icalproperty* icalproperty_vanew_calscale(const char* v, ...); +void icalproperty_set_calscale(icalproperty* prop, const char* v); +const char* icalproperty_get_calscale(icalproperty* prop); /* CREATED */ icalproperty* icalproperty_new_created(struct icaltimetype v); @@ -365,10 +369,10 @@ void icalproperty_set_geo(icalproperty* prop, struct icalgeotype v); struct icalgeotype icalproperty_get_geo(icalproperty* prop); /* X-LIC-MIMECHARSET */ -icalproperty* icalproperty_new_xlicmimecharset(char* v); -icalproperty* icalproperty_vanew_xlicmimecharset(char* v, ...); -void icalproperty_set_xlicmimecharset(icalproperty* prop, char* v); -char* icalproperty_get_xlicmimecharset(icalproperty* prop); +icalproperty* icalproperty_new_xlicmimecharset(const char* v); +icalproperty* icalproperty_vanew_xlicmimecharset(const char* v, ...); +void icalproperty_set_xlicmimecharset(icalproperty* prop, const char* v); +const char* icalproperty_get_xlicmimecharset(icalproperty* prop); /* COMPLETED */ icalproperty* icalproperty_new_completed(struct icaltimetype v); @@ -389,8 +393,8 @@ void icalproperty_set_due(icalproperty* prop, struct icaltimetype v); struct icaltimetype icalproperty_get_due(icalproperty* prop); /* ACTION */ -icalproperty* icalproperty_new_action(char* v); -icalproperty* icalproperty_vanew_action(char* v, ...); -void icalproperty_set_action(icalproperty* prop, char* v); -char* icalproperty_get_action(icalproperty* prop); -#endif ICALPROPERTY_H +icalproperty* icalproperty_new_action(const char* v); +icalproperty* icalproperty_vanew_action(const char* v, ...); +void icalproperty_set_action(icalproperty* prop, const char* v); +const char* icalproperty_get_action(icalproperty* prop); +#endif /*ICALPROPERTY_H*/ diff --git a/libical/src/libical/icalrestriction.c b/libical/src/libical/icalrestriction.c index be0e292d28..8607c3adab 100644 --- a/libical/src/libical/icalrestriction.c +++ b/libical/src/libical/icalrestriction.c @@ -4,20 +4,29 @@ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org ======================================================================*/ +/*#line 7 "icalrestriction.c.in"*/ #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif -#include "icalenums.h" #include "icalrestriction.h" +#include "icalenums.h" +#include "icalerror.h" + +#include <assert.h> +#include <stdio.h> /* For snprintf */ #define TMP_BUF_SIZE 1024 + /* Define the structs for the restrictions. these data are filled out in machine generated code below */ -typedef int (*restriction_func)(icalcomponent* comp); +struct icalrestriction_property_record; + +typedef char* (*restriction_func)(struct icalrestriction_property_record* rec,icalcomponent* comp,icalproperty* prop); + typedef struct icalrestriction_property_record { icalproperty_method method; @@ -36,9 +45,22 @@ typedef struct icalrestriction_component_record { restriction_func function; } icalrestriction_component_record; +icalrestriction_property_record* +icalrestriction_get_property_restriction(icalproperty_method method, + icalcomponent_kind component, + icalproperty_kind property); +icalrestriction_component_record* +icalrestriction_get_component_restriction(icalproperty_method method, + icalcomponent_kind component, + icalcomponent_kind subcomponent); + icalrestriction_component_record icalrestriction_component_records[]; icalrestriction_property_record icalrestriction_property_records[]; +icalrestriction_property_record null_prop_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_UNKNOWN,0}; +icalrestriction_component_record null_comp_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_UNKNOWN,0}; + + /* The each row gives the result of comparing a restriction against a count. The columns in each row represent 0,1,2+. '-1' indicates 'invalid, 'don't care' or 'needs more analysis' So, for @@ -86,22 +108,173 @@ icalrestriction_compare(icalrestriction_kind restr, int count){ } -int icalrestriction_check_mutual(icalcomponent *comp){ - /* HACK. This function does nothing */ - return 1; +/* Special case routines */ + +char* icalrestriction_may_be_draft_final_canceled( + icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop) +{ + + icalproperty_status stat = icalproperty_get_status(prop); + + if( !( stat == ICAL_STATUS_DRAFT || + stat == ICAL_STATUS_FINAL || + stat == ICAL_STATUS_CANCELLED )){ + + return "Failed iTIP restrictions for STATUS property. Value must be one of DRAFT, FINAL, or CANCELED"; + + } + + return 0; } -int icalrestriction_check_exclusive(icalcomponent *comp){ - /* HACK. This function does nothing */ - return 1; +char* icalrestriction_may_be_comp_need_process( + icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop) +{ + icalproperty_status stat = icalproperty_get_status(prop); + + if( !( stat == ICAL_STATUS_COMPLETED || + stat == ICAL_STATUS_NEEDSACTION || + stat == ICAL_STATUS_INPROCESS )){ + + return "Failed iTIP restrictions for STATUS property. Value must be one of COMPLETED, NEEDS-ACTION or IN-PROCESS"; + + } + + return 0; +} +char* icalrestriction_may_be_tent_conf(icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop){ + icalproperty_status stat = icalproperty_get_status(prop); + + if( !( stat == ICAL_STATUS_TENTATIVE || + stat == ICAL_STATUS_CONFIRMED )){ + + return "Failed iTIP restrictions for STATUS property. Value must be one of TENTATIVE or CONFIRMED"; + + } + + return 0; +} +char* icalrestriction_may_be_tent_conf_cancel( + icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop) +{ + icalproperty_status stat = icalproperty_get_status(prop); + + if( !( stat == ICAL_STATUS_TENTATIVE || + stat == ICAL_STATUS_CONFIRMED || + stat == ICAL_STATUS_CANCELLED )){ + + return "Failed iTIP restrictions for STATUS property. Value must be one of TENTATIVE, CONFIRMED or CANCELED"; + + } + + return 0; +} + +char* icalrestriction_must_be_cancel_if_present( + icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop) +{ + /* This routine will not be called if prop == 0 */ + icalproperty_status stat = icalproperty_get_status(prop); + + if( stat != ICAL_STATUS_CANCELLED) + { + return "Failed iTIP restrictions for STATUS property. Value must be CANCELLED"; + + } + + + return 0; } +char* icalrestriction_must_be_canceled_no_attendee( + icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop) +{ + + /* Hack. see rfc2446, 3.2.5 CANCEL for porperty STATUS. I don't + understand the note */ + + return 0; +} +char* icalrestriction_must_be_recurring(icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop){ + /* Hack */ + return 0; +} +char* icalrestriction_must_have_duration(icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop){ + + if( !icalcomponent_get_first_property(comp,ICAL_DURATION_PROPERTY)){ + + return "Failed iTIP restrictions for STATUS property. This component must have a DURATION property"; + + } + + return 0; +} +char* icalrestriction_must_have_repeat(icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop){ + if( !icalcomponent_get_first_property(comp,ICAL_REPEAT_PROPERTY)){ + + return "Failed iTIP restrictions for STATUS property. This component must have a REPEAT property"; + + } + + return 0; +} +char* icalrestriction_must_if_tz_ref(icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop){ + + /* Hack */ + return 0; +} +char* icalrestriction_no_dtend(icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop){ + + if( icalcomponent_get_first_property(comp,ICAL_DTEND_PROPERTY)){ + + return "Failed iTIP restrictions for DTEND property. The component must not have both DURATION and DTEND"; + + } + + return 0; +} +char* icalrestriction_no_duration(icalrestriction_property_record *rec, + icalcomponent* comp, + icalproperty* prop){ + + /* _no_dtend takes care of this one */ + return 0; +} + + int icalrestriction_check_component(icalproperty_method method, icalcomponent* comp) { icalproperty_kind kind; icalcomponent_kind comp_kind; icalrestriction_kind restr; + icalrestriction_property_record *prop_record; + icalrestriction_component_record *comp_record; + char* funcr = 0; + icalproperty *prop; + int count; int compare; int valid = 1; @@ -113,30 +286,30 @@ int icalrestriction_check_component(icalproperty_method method, for(kind = ICAL_ANY_PROPERTY+1; kind != ICAL_NO_PROPERTY; kind++){ count = icalcomponent_count_properties(comp, kind); - restr = icalrestriction_get_property_restriction(method, + prop_record = icalrestriction_get_property_restriction(method, comp_kind, kind); + restr = prop_record->restriction; - if(restr == ICAL_RESTRICTION_ONEEXCLUSIVE ) { - /* HACK. Treat this as a 0/1 restriction */ - restr = ICAL_RESTRICTION_ZEROORONE; - compare = icalrestriction_compare(restr,count); - } else if (restr == ICAL_RESTRICTION_ONEMUTUAL ) { - /* HACK. Treat this as a 0/1 restriction */ + if(restr == ICAL_RESTRICTION_ONEEXCLUSIVE || + restr == ICAL_RESTRICTION_ONEMUTUAL) { + + /* First treat is as a 0/1 restriction */ restr = ICAL_RESTRICTION_ZEROORONE; compare = icalrestriction_compare(restr,count); + } else { + compare = icalrestriction_compare(restr,count); } assert(compare != -1); - if (compare == 0){ char temp[TMP_BUF_SIZE]; - snprintf(temp, TMP_BUF_SIZE,"Failed iTIP restrictions for property %s. Expected %s instances of the property and got %d", + snprintf(temp, TMP_BUF_SIZE,"Failed iTIP restrictions for %s property. Expected %s instances of the property and got %d", icalenum_property_kind_to_string(kind), restr_string_map[restr], count); @@ -149,6 +322,25 @@ int icalrestriction_check_component(icalproperty_method method, } + prop = icalcomponent_get_first_property(comp, kind); + + if (prop != 0 && prop_record->function !=0 ){ + funcr = prop_record->function(prop_record,comp,prop); + } + + if(funcr !=0){ + icalcomponent_add_property + (comp, + icalproperty_vanew_xlicerror( + funcr, + icalparameter_new_xlicerrortype( + ICAL_XLICERRORTYPE_INVALIDITIP), + 0)); + + compare = 0; + funcr = 0; + } + valid = valid && compare; } @@ -210,7 +402,7 @@ int icalrestriction_check(icalcomponent* outer_comp) } -icalrestriction_kind +icalrestriction_property_record* icalrestriction_get_property_restriction(icalproperty_method method, icalcomponent_kind component, icalproperty_kind property) @@ -224,19 +416,20 @@ icalrestriction_get_property_restriction(icalproperty_method method, if (method == icalrestriction_property_records[i].method && component == icalrestriction_property_records[i].component && property == icalrestriction_property_records[i].property ){ - return icalrestriction_property_records[i].restriction; + return &icalrestriction_property_records[i]; } } - return ICAL_RESTRICTION_UNKNOWN; + return &null_prop_record; } -icalrestriction_kind + +icalrestriction_component_record* icalrestriction_get_component_restriction(icalproperty_method method, icalcomponent_kind component, icalcomponent_kind subcomponent) { - + int i; for(i = 0; @@ -246,11 +439,11 @@ icalrestriction_get_component_restriction(icalproperty_method method, if (method == icalrestriction_component_records[i].method && component == icalrestriction_component_records[i].component && subcomponent == icalrestriction_component_records[i].subcomponent ){ - return icalrestriction_component_records[i].restriction; + return &icalrestriction_component_records[i]; } } - return ICAL_RESTRICTION_UNKNOWN; + return &null_comp_record; } /* Everything below this line is machine generated. Do not edit. */ @@ -260,7 +453,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_ORGANIZER_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_SUMMARY_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_UID_PROPERTY,ICAL_RESTRICTION_ONE,0}, - {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_SEQUENCE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_ATTACH_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_CATEGORIES_PROPERTY,ICAL_RESTRICTION_ZEROPLUS ,0}, @@ -281,7 +474,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_tent_conf_cancel}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_TRANSP_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -301,8 +494,8 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_CONTACT_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_CREATED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_DESCRIPTION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_check_exclusive}, - {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_check_exclusive}, + {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, + {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_dtend}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_GEO_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -310,19 +503,19 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_LOCATION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_tent_conf}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_TRANSP_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_ATTENDEE_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_ORGANIZER_PROPERTY,ICAL_RESTRICTION_ONE,0}, - {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_UID_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_SEQUENCE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_ATTACH_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -332,9 +525,9 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_CONTACT_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_CREATED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_DESCRIPTION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_check_exclusive}, + {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_DTSTART_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_check_exclusive}, + {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_dtend}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_GEO_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -365,8 +558,8 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_CONTACT_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_CREATED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_DESCRIPTION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, - {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, + {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, + {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_GEO_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -377,11 +570,11 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_tent_conf}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_TRANSP_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZERO,0}, + {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZERO,icalrestriction_must_be_recurring}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_ATTENDEE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ONE,0}, @@ -395,9 +588,9 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_CONTACT_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_CREATED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_DESCRIPTION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, + {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE ,icalrestriction_no_duration}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_DTSTART_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, + {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_GEO_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -405,11 +598,11 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_LOCATION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_canceled_no_attendee}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_SUMMARY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_TRANSP_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -420,7 +613,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_ORGANIZER_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_UID_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_COMMENT_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_ATTACH_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_CATEGORIES_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -461,8 +654,8 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_CONTACT_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_CREATED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_DESCRIPTION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, - {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, + {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, + {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_GEO_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -470,12 +663,12 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_LOCATION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_tent_conf_cancel}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_TRANSP_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -483,7 +676,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_ORGANIZER_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_UID_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_COMMENT_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_SEQUENCE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -574,7 +767,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_LOCATION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_PERCENTCOMPLETE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VTODO_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -607,11 +800,11 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_LOCATION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_PERCENTCOMPLETE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_comp_need_process}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VTODO_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -641,7 +834,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_SEQUENCE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_REPLY,ICAL_VTODO_COMPONENT,ICAL_SUMMARY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -674,10 +867,10 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_comp_need_process}, {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZERO,0}, + {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZERO,icalrestriction_must_be_recurring}, {ICAL_METHOD_ADD,ICAL_VTODO_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_ATTENDEE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_UID_PROPERTY,ICAL_RESTRICTION_ONE,0}, @@ -701,19 +894,19 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_LOCATION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_PERCENTCOMPLETE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_canceled_no_attendee}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VTODO_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_ATTENDEE_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ONE,0}, {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_UID_PROPERTY,ICAL_RESTRICTION_ONE,0}, - {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_ATTACH_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REFRESH,ICAL_VTODO_COMPONENT,ICAL_CATEGORIES_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -764,13 +957,13 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_LOCATION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_PERCENTCOMPLETE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_SEQUENCE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_comp_need_process}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_COUNTER,ICAL_VTODO_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_ATTENDEE_PROPERTY,ICAL_RESTRICTION_ONEPLUS,0}, @@ -796,7 +989,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_PERCENTCOMPLETE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VTODO_COMPONENT,ICAL_RESOURCES_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, @@ -819,11 +1012,11 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_LASTMODIFIED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_SEQUENCE_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_may_be_draft_final_canceled}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_SUMMARY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_PUBLISH,ICAL_VJOURNAL_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -869,10 +1062,10 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_LASTMODIFIED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_RRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_STATUS_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_cancel_if_present}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_SUMMARY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -936,11 +1129,11 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_CONTACT_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_CREATED_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DESCRIPTION_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, - {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, + {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DTEND_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DTSTART_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DUE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE, icalrestriction_check_exclusive}, + {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEEXCLUSIVE,icalrestriction_no_duration}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_FREEBUSY_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -953,7 +1146,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_PRODID_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_VEVENT_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -1001,7 +1194,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_PRODID_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_VTODO_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -1049,7 +1242,7 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_PRIORITY_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_PRODID_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_RDATE_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_RECURRENCEID_PROPERTY,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_be_recurring}, {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_RELATEDTO_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_VJOURNAL_COMPONENT,ICAL_REQUESTSTATUS_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, @@ -1276,8 +1469,8 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_DTSTART_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_DUE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, - {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, + {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_repeat}, + {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_duration}, {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XAUDIOALARM_COMPONENT,ICAL_FREEBUSY_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -1324,8 +1517,8 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_DTSTART_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_DUE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, - {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, + {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_repeat}, + {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_duration}, {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XDISPLAYALARM_COMPONENT,ICAL_FREEBUSY_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -1372,8 +1565,8 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_DTSTART_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_DUE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, - {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, + {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_repeat}, + {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_duration}, {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XEMAILALARM_COMPONENT,ICAL_FREEBUSY_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -1420,8 +1613,8 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_DTSTAMP_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_DTSTART_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_DUE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, - {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_check_mutual}, + {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_DURATION_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_repeat}, + {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_REPEAT_PROPERTY,ICAL_RESTRICTION_ONEMUTUAL,icalrestriction_must_have_duration}, {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_EXDATE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_EXRULE_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_FREEBUSY_PROPERTY,ICAL_RESTRICTION_ZERO,0}, @@ -1453,34 +1646,34 @@ icalrestriction_property_record icalrestriction_property_records[] = { {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_URL_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_VERSION_PROPERTY,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_NONE,ICAL_XPROCEDUREALARM_COMPONENT,ICAL_X_PROPERTY,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE,0} + {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE} }; icalrestriction_component_record icalrestriction_component_records[] = { {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_VFREEBUSY_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, + {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_PUBLISH,ICAL_VEVENT_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, + {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_VFREEBUSY_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REQUEST,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROORONE,0}, + {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROORONE,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_VFREEBUSY_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REPLY,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, + {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_VFREEBUSY_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_ADD,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, + {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_CANCEL,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, @@ -1490,10 +1683,10 @@ icalrestriction_component_record icalrestriction_component_records[] = { {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_VFREEBUSY_COMPONENT,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZERO,0}, + {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZERO,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_REFRESH,ICAL_VEVENT_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, - {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, + {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_COUNTER,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, @@ -1502,13 +1695,13 @@ icalrestriction_component_record icalrestriction_component_records[] = { {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_VFREEBUSY_COMPONENT,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZERO,0}, + {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZERO,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_DECLINECOUNTER,ICAL_VEVENT_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_PUBLISH,ICAL_VFREEBUSY_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_PUBLISH,ICAL_VFREEBUSY_COMPONENT,ICAL_VEVENT_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_PUBLISH,ICAL_VFREEBUSY_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_PUBLISH,ICAL_VFREEBUSY_COMPONENT,ICAL_VJOURNAL_COMPONENT,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_PUBLISH,ICAL_VFREEBUSY_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZERO,0}, + {ICAL_METHOD_PUBLISH,ICAL_VFREEBUSY_COMPONENT,ICAL_VTIMEZONE_COMPONENT,ICAL_RESTRICTION_ZERO,icalrestriction_must_if_tz_ref}, {ICAL_METHOD_PUBLISH,ICAL_VFREEBUSY_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_REQUEST,ICAL_VFREEBUSY_COMPONENT,ICAL_X_COMPONENT,ICAL_RESTRICTION_ZEROPLUS,0}, {ICAL_METHOD_REQUEST,ICAL_VFREEBUSY_COMPONENT,ICAL_VALARM_COMPONENT,ICAL_RESTRICTION_ZERO,0}, @@ -1583,5 +1776,5 @@ icalrestriction_component_record icalrestriction_component_records[] = { {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_VEVENT_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_VFREEBUSY_COMPONENT,ICAL_RESTRICTION_ZERO,0}, {ICAL_METHOD_CANCEL,ICAL_VJOURNAL_COMPONENT,ICAL_VTODO_COMPONENT,ICAL_RESTRICTION_ZERO,0}, - {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE,0} + {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE} }; diff --git a/libical/src/libical/icalrestriction.h b/libical/src/libical/icalrestriction.h index 12421d0f32..409334cf28 100644 --- a/libical/src/libical/icalrestriction.h +++ b/libical/src/libical/icalrestriction.h @@ -27,7 +27,8 @@ ======================================================================*/ -#include "ical.h" +#include "icalproperty.h" +#include "icalcomponent.h" #ifndef ICALRESTRICTION_H #define ICALRESTRICTION_H @@ -48,15 +49,6 @@ typedef enum icalrestriction_kind { int icalrestriction_compare(icalrestriction_kind restr, int count); -icalrestriction_kind -icalrestriction_get_property_restriction(icalproperty_method method, - icalcomponent_kind component, - icalproperty_kind property); - -icalrestriction_kind -icalrestriction_get_component_restriction(icalproperty_method method, - icalcomponent_kind component, - icalcomponent_kind subcomponent); int icalrestriction_is_parameter_allowed(icalproperty_kind property, diff --git a/libical/src/libical/icaltime.c b/libical/src/libical/icaltime.c index 6d651922d5..2fc965e1a8 100644 --- a/libical/src/libical/icaltime.c +++ b/libical/src/libical/icaltime.c @@ -4,7 +4,6 @@ CREATOR: eric 02 June 2000 $Id$ - $Locker$ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -26,7 +25,12 @@ ======================================================================*/ #include "icaltime.h" +#include "icalvalue.h" #include <assert.h> +#include <string.h> +#include <stdlib.h> +#include <stdio.h> + struct icaltimetype icaltime_from_timet(time_t tm, int is_date, int is_utc) @@ -34,11 +38,12 @@ icaltime_from_timet(time_t tm, int is_date, int is_utc) struct icaltimetype tt; struct tm t; - if(is_utc == 1){ - t = *(gmtime(&tm)); - } else { - t = *(localtime(&tm)); + if(is_utc == 0){ + tm += icaltime_local_utc_offset(); } + + t = *(localtime(&tm)); + tt.second = t.tm_sec; tt.minute = t.tm_min; tt.hour = t.tm_hour; @@ -52,6 +57,7 @@ icaltime_from_timet(time_t tm, int is_date, int is_utc) return tt; } +/* Always returns time in UTC */ time_t icaltime_as_timet(struct icaltimetype tt) { struct tm stm; @@ -68,11 +74,47 @@ time_t icaltime_as_timet(struct icaltimetype tt) stm.tm_isdst = -1; /* prevents mktime from changing hour based on daylight savings */ + if(tt.is_utc == 0){ + stm.tm_sec -= icaltime_local_utc_offset(); + } + tut = mktime(&stm); return tut; } + + +struct icaltimetype icaltime_from_string(const char* str) +{ + struct icaltimetype tt; + icalvalue *v = icalvalue_new_from_string(ICAL_DATETIME_VALUE,str); + + if (v == 0){ + return icaltime_null_time(); + } + + tt = icalvalue_get_datetime(v); + + icalvalue_free(v); + + return tt; + +} + +char ctime_str[20]; +char* icaltime_as_ctime(struct icaltimetype t) +{ + time_t tt = icaltime_as_timet(t); + + sprintf(ctime_str,"%s",ctime(&tt)); + + ctime_str[strlen(ctime_str)-1] = 0; + + return ctime_str; +} + + short days_in_month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; short icaltime_days_in_month(short month,short year) @@ -180,20 +222,187 @@ int icaltime_compare(struct icaltimetype a,struct icaltimetype b) } } - -int icaltime_compare_date_only(struct icaltimetype a, struct icaltimetype b) +int +icaltime_compare_date_only (struct icaltimetype a, struct icaltimetype b) { - time_t t1 = icaltime_as_timet(a); - time_t t2 = icaltime_as_timet(b); + time_t t1; + time_t t2; - if (a.year == b.year && a.month == b.month && a.day == b.day) { + if (a.year == b.year && a.month == b.month && a.day == b.day) return 0; - } - if (t1 > t2) { + t1 = icaltime_as_timet (a); + t2 = icaltime_as_timet (b); + + if (t1 > t2) return 1; - } else if (t1 < t2) { + else if (t1 < t2) return -1; + else { + /* not reached */ + assert (0); + return 0; + } +} + +/* convert tt, of timezone tzid, into a utc time */ +struct icaltimetype icaltime_as_utc(struct icaltimetype tt,const char* tzid) +{ + time_t offset, tm; + struct icaltimetype utc; + + offset = icaltime_utc_offset(tt,tzid); + tm = icaltime_as_timet(tt); + + tm += offset; + + utc = icaltime_from_timet(tm,0,0); + + return utc; +} + +/* convert tt, a time in UTC, into a time in timezone tzid */ +struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid) +{ + time_t offset, tm; + struct icaltimetype zone; + + offset = icaltime_utc_offset(tt,tzid); + tm = icaltime_as_timet(tt); + + tm -= offset; + + zone = icaltime_from_timet(tm,0,0); + + return zone; + +} + +/* Return the offset of the named zone as seconds. tt is a time + indicating the date for which you want the offset */ +time_t icaltime_utc_offset(struct icaltimetype tt, const char* tzid) +{ + extern long int timezone; + time_t now; + struct tm *stm; + + char *tzstr = 0; + char *tmp; + + /* Put the new time zone into the environment */ + if(getenv("TZ") != 0){ + tzstr = (char*)strdup(getenv("TZ")); + } + + tmp = (char*)malloc(1024); + snprintf(tmp,1024,"TZ=%s",tzid); + + putenv(tmp); + + /* Get the offset */ + + now = icaltime_as_timet(tt); + + stm = localtime(&now); /* This sets 'timezone'*/ + + /* restore the original environment */ + + if(tzstr!=0){ + putenv(tzstr); + } else { + putenv("TZ"); /* Delete from environment */ + } + + return timezone; +} + +time_t icaltime_local_utc_offset() +{ + time_t now; + struct tm *stm; + + stm = localtime(&now); /* This sets 'timezone'*/ + + return timezone; + +} + + + + + + +time_t +icalperiodtype_duration (struct icalperiodtype period); + + +time_t +icalperiodtype_end (struct icalperiodtype period); + + +/* From Russel Steinthal */ +time_t icaldurationtype_as_timet(struct icaldurationtype dur) +{ + return (time_t) (dur.seconds + + (60 * dur.minutes) + + (60 * 60 * dur.hours) + + (60 * 60 * 24 * dur.days) + + (60 * 60 * 24 * 7 * dur.weeks)); +} + +/* From Seth Alves, <alves@hungry.com> */ +struct icaldurationtype icaldurationtype_from_timet(time_t t) +{ + struct icaldurationtype dur; + time_t used = 0; + + dur.weeks = (t - used) / (60 * 60 * 24 * 7); + used += dur.weeks * (60 * 60 * 24 * 7); + dur.days = (t - used) / (60 * 60 * 24); + used += dur.days * (60 * 60 * 24); + dur.hours = (t - used) / (60 * 60); + used += dur.hours * (60 * 60); + dur.minutes = (t - used) / (60); + used += dur.minutes * (60); + dur.seconds = (t - used); + + return dur; +} + +struct icaldurationtype icaldurationtype_from_string(const char* str) +{ + + icalvalue *v = icalvalue_new_from_string(ICAL_DURATION_VALUE,str); + + if( v !=0){ + return icalvalue_get_duration(v); + } else { + struct icaldurationtype dur; + memset(&dur,0,sizeof(struct icaldurationtype)); + return dur; } + } + +struct icaltimetype icaltime_add(struct icaltimetype t, + struct icaldurationtype d) +{ + time_t tt = icaltime_as_timet(t); + time_t dt = icaldurationtype_as_timet(d); + + return icaltime_from_timet(tt + dt, t.is_date, t.is_utc); + +} + +struct icaldurationtype icaltime_subtract(struct icaltimetype t1, + struct icaltimetype t2) +{ + + time_t t1t = icaltime_as_timet(t1); + time_t t2t = icaltime_as_timet(t2); + + return icaldurationtype_from_timet(t1t-t2t); + + +} diff --git a/libical/src/libical/icaltime.h b/libical/src/libical/icaltime.h index 6c5b653c23..1402f65d4e 100644 --- a/libical/src/libical/icaltime.h +++ b/libical/src/libical/icaltime.h @@ -1,11 +1,9 @@ -// -*- Mode: C -*- +/* -*- Mode: C -*- */ /*====================================================================== FILE: icaltime.h CREATOR: eric 02 June 2000 - $Id$ - $Locker$ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -31,6 +29,13 @@ #include <time.h> +/* icaltime_span is returned by icalcomponent_get_span() */ +struct icaltime_span { + time_t start; /* in UTC */ + time_t end; /* in UTC */ + int is_busy; /* 1->busy time, 0-> free time */ +}; + struct icaltimetype { int year; @@ -45,7 +50,7 @@ struct icaltimetype int is_date; /* 1 -> interpret this as date. */ }; -struct icaltimetype icaltime_null_time(); +struct icaltimetype icaltime_null_time(void); int icaltime_is_null_time(struct icaltimetype t); @@ -58,17 +63,71 @@ short icaltime_day_of_week(struct icaltimetype t); short icaltime_start_doy_of_week(struct icaltimetype t); struct icaltimetype icaltime_from_timet(time_t v, int is_date, int is_utc); +struct icaltimetype icaltime_from_string(const char* str); time_t icaltime_as_timet(struct icaltimetype); +char* icaltime_as_ctime(struct icaltimetype); short icaltime_week_number(short day_of_month, short month, short year); struct icaltimetype icaltime_from_week_number(short week_number, short year); int icaltime_compare(struct icaltimetype a,struct icaltimetype b); + int icaltime_compare_date_only(struct icaltimetype a, struct icaltimetype b); short icaltime_days_in_month(short month,short year); +/* Routines for handling timezones */ + +/* Return the offset of the named zone as seconds. tt is a time + indicating the date for which you want the offset */ +time_t icaltime_utc_offset(struct icaltimetype tt, const char* tzid); + +time_t icaltime_local_utc_offset(); + + +/* convert tt, of timezone tzid, into a utc time */ +struct icaltimetype icaltime_as_utc(struct icaltimetype tt,const char* tzid); + +/* convert tt, a time in UTC, into a time in timezone tzid */ +struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid); + + + +struct icaldurationtype +{ + int is_neg; + unsigned int days; + unsigned int weeks; + unsigned int hours; + unsigned int minutes; + unsigned int seconds; +}; + +struct icaldurationtype icaldurationtype_from_timet(time_t t); +struct icaldurationtype icaldurationtype_from_string(const char*); +time_t icaldurationtype_as_timet(struct icaldurationtype duration); + + +struct icalperiodtype +{ + struct icaltimetype start; /* Must be absolute */ + struct icaltimetype end; /* Must be absolute */ + struct icaldurationtype duration; +}; + +time_t icalperiodtype_duration(struct icalperiodtype period); +time_t icalperiodtype_end(struct icalperiodtype period); + + + +struct icaltimetype icaltime_add(struct icaltimetype t, + struct icaldurationtype d); + +struct icaldurationtype icaltime_subtract(struct icaltimetype t1, + struct icaltimetype t2); + + #endif /* !ICALTIME_H */ diff --git a/libical/src/libical/icaltypes.c b/libical/src/libical/icaltypes.c index c7017eb2af..dedde8d866 100644 --- a/libical/src/libical/icaltypes.c +++ b/libical/src/libical/icaltypes.c @@ -4,7 +4,6 @@ CREATOR: eric 16 May 1999 $Id$ - $Locker$ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -34,7 +33,6 @@ #include <errno.h> /* for errno */ #include <string.h> /* for icalmemory_strdup */ #include <assert.h> -#include <limits.h> /* for SHRT_MAX */ #define TEMP_MAX 1024 @@ -151,75 +149,6 @@ void* icalattachtype_get_binary(struct icalattachtype* v) -time_t -icalperiodtype_duration (struct icalperiodtype period); - - -time_t -icalperiodtype_end (struct icalperiodtype period); - - -/* From Russel Steinthal */ -time_t icaldurationtype_as_timet(struct icaldurationtype dur) -{ - return (time_t) (dur.seconds + - (60 * dur.minutes) + - (60 * 60 * dur.hours) + - (60 * 60 * 24 * dur.days) + - (60 * 60 * 24 * 7 * dur.weeks)); -} - -/* From Seth Alves, <alves@hungry.com> */ -struct icaldurationtype icaldurationtype_from_timet(time_t t) -{ - struct icaldurationtype dur; - time_t used = 0; - - dur.weeks = (t - used) / (60 * 60 * 24 * 7); - used += dur.weeks * (60 * 60 * 24 * 7); - dur.days = (t - used) / (60 * 60 * 24); - used += dur.days * (60 * 60 * 24); - dur.hours = (t - used) / (60 * 60); - used += dur.hours * (60 * 60); - dur.minutes = (t - used) / (60); - used += dur.minutes * (60); - dur.seconds = (t - used); - - return dur; -} - -void icalrecurrencetype_clear(struct icalrecurrencetype *recur) -{ - memset(recur,ICAL_RECURRENCE_ARRAY_MAX_BYTE, - sizeof(struct icalrecurrencetype)); - - recur->week_start = ICAL_NO_WEEKDAY; - recur->freq = ICAL_NO_RECURRENCE; - recur->interval = 1; - memset(&(recur->until),0,sizeof(struct icaltimetype)); - recur->count = 0; -} - -/* The 'day' element of icalrecurrencetype_weekday is encoded to allow -reporesentation of both the day of the week ( Monday, Tueday), but -also the Nth day of the week ( First tuesday of the month, last -thursday of the year) These routines decode the day values. - -The day's position in the period ( Nth-ness) and the numerical value -of the day are encoded together as: pos*7 + dow - */ - -enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day) -{ - return abs(day)%8; -} - -short icalrecurrencetype_day_position(short day) -{ - return (day-icalrecurrencetype_day_day_of_week(day))/8; -} - - struct icalreqstattype icalreqstattype_from_string(char* str) { char *p1,*p2; diff --git a/libical/src/libical/icaltypes.h b/libical/src/libical/icaltypes.h index 1130ab2457..d2a106883b 100644 --- a/libical/src/libical/icaltypes.h +++ b/libical/src/libical/icaltypes.h @@ -46,7 +46,7 @@ struct icalattachtype /* converts base64 to binary, fetches url and stores as binary, or just returns data */ -struct icalattachtype* icalattachtype_new(); +struct icalattachtype* icalattachtype_new(void); void icalattachtype_add_reference(struct icalattachtype* v); void icalattachtype_free(struct icalattachtype* v); @@ -69,84 +69,6 @@ struct icalgeotype -/* See RFC 2445 Section 4.3.10, RECUR Value, for an explaination of - the values and fields in struct icalrecurrencetype */ - - -struct icalrecurrencetype -{ - icalrecurrencetype_frequency freq; - - - /* until and count are mutually exclusive. */ - struct icaltimetype until; - int count; - - short interval; - - icalrecurrencetype_weekday week_start; - - /* The BY* parameters can each take a list of values. Here I - * assume that the list of values will not be larger than the - * range of the value -- that is, the client will not name a - * value more than once. - - * Each of the lists is terminated with the value SHRT_MAX - * unless the the list is full. */ - - short by_second[61]; - short by_minute[61]; - short by_hour[25]; - short by_day[8]; /* Encoded value, see below */ - short by_month_day[32]; - short by_year_day[367]; - short by_week_no[54]; - short by_month[13]; - short by_set_pos[367]; -}; - - -void icalrecurrencetype_clear(struct icalrecurrencetype *r); - -/* The 'day' element of icalrecurrencetype_weekday is encoded to allow -reporesentation of both the day of the week ( Monday, Tueday), but -also the Nth day of the week ( First tuesday of the month, last -thursday of the year) These routines decode the day values */ - -/* 1 == Monday, etc. */ -enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day); - -/* 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc */ -short icalrecurrencetype_day_position(short day); - -struct icaldurationtype -{ - unsigned int days; - unsigned int weeks; - unsigned int hours; - unsigned int minutes; - unsigned int seconds; -}; - -struct icaldurationtype icaldurationtype_from_timet(time_t t); -time_t icaldurationtype_as_timet(struct icaldurationtype duration); - -/* Return the next occurance of 'r' after the time specified by 'after' */ -struct icaltimetype icalrecurrencetype_next_occurance( - struct icalrecurrencetype *r, - struct icaltimetype *after); - - -struct icalperiodtype -{ - struct icaltimetype start; /* Must be absolute */ - struct icaltimetype end; /* Must be absolute */ - struct icaldurationtype duration; -}; - -time_t icalperiodtype_duration(struct icalperiodtype period); -time_t icalperiodtype_end(struct icalperiodtype period); - union icaltriggertype { struct icaltimetype time; @@ -154,6 +76,7 @@ union icaltriggertype }; + /* struct icalreqstattype. This struct contains two string pointers, but don't try to free either of them. The "desc" string is a pointer to a static table inside the library. Don't try to free it. The @@ -168,8 +91,8 @@ operating on a the value of a request_status property. */ struct icalreqstattype { icalrequeststatus code; - char* desc; - char* debug; + const char* desc; + const char* debug; }; struct icalreqstattype icalreqstattype_from_string(char* str); diff --git a/libical/src/libical/icalvalue.c b/libical/src/libical/icalvalue.c index 7c988a4d16..a1ebb64e30 100644 --- a/libical/src/libical/icalvalue.c +++ b/libical/src/libical/icalvalue.c @@ -27,11 +27,9 @@ ======================================================================*/ #ifdef HAVE_CONFIG_H -#include "config.h" +#include <config.h> #endif - -#include "ical.h" #include "icalerror.h" #include "icalmemory.h" #include "icalparser.h" @@ -44,7 +42,6 @@ #include <errno.h> #include <time.h> /* for mktime */ #include <stdlib.h> /* for atoi and atof */ -#include <limits.h> /* for SHRT_MAX */ #if _MAC_OS_ #include "icalmemory_strdup.h" @@ -66,7 +63,7 @@ struct icalvalue_impl { union data { struct icalattachtype v_attach; /* void *v_binary; */ /* use v_attach */ - char *v_string; + const char *v_string; /*char *v_text;*/ /*char *v_caladdress;*/ /*char *v_uri;*/ @@ -94,6 +91,7 @@ struct icalvalue_impl { struct icalrecurrencetype *v_recur; union icaltriggertype v_trigger; icalproperty_method v_method; + icalproperty_status v_status; } data; }; @@ -195,7 +193,7 @@ icalvalue* icalvalue_new_clone(icalvalue* value){ return new; } -char* icalmemory_strdup_and_dequote(char* str) +char* icalmemory_strdup_and_dequote(const char* str) { char* p; char* out = (char*)malloc(sizeof(char) * strlen(str) +1); @@ -253,7 +251,7 @@ char* icalmemory_strdup_and_dequote(char* str) return out; } -icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,char* str,icalproperty** error) +icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char* str,icalproperty** error) { icalvalue *value = 0; @@ -381,6 +379,21 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,char* str,ic break; } + + + case ICAL_STATUS_VALUE: + { + icalproperty_status status = icalenum_string_to_status(str); + + if(status == ICAL_STATUS_NONE){ + value = 0; + } else { + value = icalvalue_new_status(status); + } + + break; + + } case ICAL_GEO_VALUE: { value = 0; @@ -453,7 +466,7 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,char* str,ic } -icalvalue* icalvalue_new_from_string(icalvalue_kind kind,char* str) +icalvalue* icalvalue_new_from_string(icalvalue_kind kind,const char* str) { return icalvalue_new_from_string_with_error(kind,str,(icalproperty*)0); } @@ -487,7 +500,7 @@ icalvalue_free (icalvalue* value) case ICAL_URI_VALUE: { if (v->data.v_string != 0) { - free(v->data.v_string); + free((void*)v->data.v_string); v->data.v_string = 0; } break; @@ -495,7 +508,7 @@ icalvalue_free (icalvalue* value) case ICAL_RECUR_VALUE: { if(v->data.v_recur != 0){ - free(v->data.v_recur); + free((void*)v->data.v_recur); v->data.v_recur = 0; } break; @@ -529,7 +542,7 @@ icalvalue_is_valid (icalvalue* value) char* icalvalue_binary_as_ical_string(icalvalue* value) { - char* data; + const char* data; char* str; icalerror_check_arg_rz( (value!=0),"value"); data = icalvalue_get_binary(value); @@ -578,7 +591,7 @@ char* icalvalue_utcoffset_as_ical_string(icalvalue* value) char* icalvalue_string_as_ical_string(icalvalue* value) { - char* data; + const char* data; char* str = 0; icalerror_check_arg_rz( (value!=0),"value"); data = ((struct icalvalue_impl*)value)->data.v_string; @@ -628,7 +641,7 @@ char* icalvalue_recur_as_ical_string(icalvalue* value) icalmemory_append_string(&str,&str_p,&buf_sz,"FREQ="); icalmemory_append_string(&str,&str_p,&buf_sz, - icalenum_recurrence_to_string(recur->freq)); + icalrecur_recurrence_to_string(recur->freq)); if(recur->until.year != 0){ @@ -665,14 +678,14 @@ char* icalvalue_recur_as_ical_string(icalvalue* value) if (j == 3) { /* BYDAY */ short pos = icalrecurrencetype_day_position(array[i]); short dow = icalrecurrencetype_day_day_of_week(array[i]); - char *daystr = icalenum_weekday_to_string(dow); - + const char *daystr = icalrecur_weekday_to_string(dow); + if (pos == 0) icalmemory_append_string(&str,&str_p,&buf_sz,daystr); else { sprintf(temp,"%d%s",pos,daystr); icalmemory_append_string(&str,&str_p,&buf_sz,temp); - } + } } else { sprintf(temp,"%d",array[i]); icalmemory_append_string(&str,&str_p,&buf_sz, temp); @@ -694,7 +707,7 @@ char* icalvalue_text_as_ical_string(icalvalue* value) { char *str; char *str_p; char *rtrn; - char *p; + const char *p; size_t buf_sz; int line_length; @@ -1078,7 +1091,7 @@ char* icalvalue_trigger_as_ical_string(icalvalue* value) { return str; } -char* +const char* icalvalue_as_ical_string (icalvalue* value) { struct icalvalue_impl* v = (struct icalvalue_impl*)value; @@ -1143,6 +1156,10 @@ icalvalue_as_ical_string (icalvalue* value) case ICAL_METHOD_VALUE: return icalenum_method_to_string(v->data.v_method); + case ICAL_STATUS_VALUE: + return icalenum_status_to_string(v->data.v_status); + + case ICAL_NO_VALUE: default: { @@ -1267,6 +1284,17 @@ icalvalue_compare(icalvalue* a, icalvalue *b) } } + + case ICAL_STATUS_VALUE: + { + if (icalvalue_get_status(a) == icalvalue_get_status(b)){ + return ICAL_XLICCOMPARETYPE_EQUAL; + } else { + return ICAL_XLICCOMPARETYPE_NOTEQUAL; + } + + } + case ICAL_PERIOD_VALUE: case ICAL_GEO_VALUE: case ICAL_RECUR_VALUE: @@ -1392,7 +1420,7 @@ icalvalue_get_attach(icalvalue* value) icalvalue* -icalvalue_new_binary (char* v) +icalvalue_new_binary (const char* v) { struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_BINARY_VALUE); @@ -1404,7 +1432,7 @@ icalvalue_new_binary (char* v) } void -icalvalue_set_binary(icalvalue* value, char* v) +icalvalue_set_binary(icalvalue* value, const char* v) { struct icalvalue_impl* impl; @@ -1414,7 +1442,7 @@ icalvalue_set_binary(icalvalue* value, char* v) icalerror_check_value_type(value, ICAL_BINARY_VALUE); impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free(impl->data.v_string);} + if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} impl->data.v_string = strdup(v); @@ -1424,7 +1452,7 @@ icalvalue_set_binary(icalvalue* value, char* v) } -char* +const char* icalvalue_get_binary(icalvalue* value) { icalerror_check_arg( (value!=0),"value"); @@ -1470,7 +1498,7 @@ icalvalue_get_boolean(icalvalue* value) icalvalue* -icalvalue_new_caladdress (char* v) +icalvalue_new_caladdress (const char* v) { struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_CALADDRESS_VALUE); @@ -1482,7 +1510,7 @@ icalvalue_new_caladdress (char* v) } void -icalvalue_set_caladdress(icalvalue* value, char* v) +icalvalue_set_caladdress(icalvalue* value, const char* v) { struct icalvalue_impl* impl; @@ -1492,7 +1520,7 @@ icalvalue_set_caladdress(icalvalue* value, char* v) icalerror_check_value_type(value, ICAL_CALADDRESS_VALUE); impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free(impl->data.v_string);} + if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} impl->data.v_string = strdup(v); @@ -1502,7 +1530,7 @@ icalvalue_set_caladdress(icalvalue* value, char* v) } -char* +const char* icalvalue_get_caladdress(icalvalue* value) { icalerror_check_arg( (value!=0),"value"); @@ -1861,8 +1889,9 @@ icalvalue_get_period(icalvalue* value) return ((struct icalvalue_impl*)value)->data.v_period; } + icalvalue* -icalvalue_new_string (char* v) +icalvalue_new_string (const char* v) { struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_STRING_VALUE); @@ -1874,7 +1903,7 @@ icalvalue_new_string (char* v) } void -icalvalue_set_string(icalvalue* value, char* v) +icalvalue_set_string(icalvalue* value, const char* v) { struct icalvalue_impl* impl; @@ -1884,7 +1913,7 @@ icalvalue_set_string(icalvalue* value, char* v) icalerror_check_value_type(value, ICAL_STRING_VALUE); impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free(impl->data.v_string);} + if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} impl->data.v_string = strdup(v); @@ -1894,7 +1923,7 @@ icalvalue_set_string(icalvalue* value, char* v) } -char* +const char* icalvalue_get_string(icalvalue* value) { icalerror_check_arg( (value!=0),"value"); @@ -1905,7 +1934,7 @@ icalvalue_get_string(icalvalue* value) icalvalue* -icalvalue_new_text (char* v) +icalvalue_new_text (const char* v) { struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TEXT_VALUE); @@ -1917,7 +1946,7 @@ icalvalue_new_text (char* v) } void -icalvalue_set_text(icalvalue* value, char* v) +icalvalue_set_text(icalvalue* value, const char* v) { struct icalvalue_impl* impl; @@ -1927,7 +1956,7 @@ icalvalue_set_text(icalvalue* value, char* v) icalerror_check_value_type(value, ICAL_TEXT_VALUE); impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free(impl->data.v_string);} + if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} impl->data.v_string = strdup(v); @@ -1937,7 +1966,7 @@ icalvalue_set_text(icalvalue* value, char* v) } -char* +const char* icalvalue_get_text(icalvalue* value) { icalerror_check_arg( (value!=0),"value"); @@ -2018,7 +2047,7 @@ icalvalue_get_trigger(icalvalue* value) icalvalue* -icalvalue_new_uri (char* v) +icalvalue_new_uri (const char* v) { struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_URI_VALUE); @@ -2030,7 +2059,7 @@ icalvalue_new_uri (char* v) } void -icalvalue_set_uri(icalvalue* value, char* v) +icalvalue_set_uri(icalvalue* value, const char* v) { struct icalvalue_impl* impl; @@ -2040,7 +2069,7 @@ icalvalue_set_uri(icalvalue* value, char* v) icalerror_check_value_type(value, ICAL_URI_VALUE); impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free(impl->data.v_string);} + if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} impl->data.v_string = strdup(v); @@ -2050,7 +2079,7 @@ icalvalue_set_uri(icalvalue* value, char* v) } -char* +const char* icalvalue_get_uri(icalvalue* value) { icalerror_check_arg( (value!=0),"value"); @@ -2096,7 +2125,7 @@ icalvalue_get_utcoffset(icalvalue* value) icalvalue* -icalvalue_new_query (char* v) +icalvalue_new_query (const char* v) { struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_QUERY_VALUE); @@ -2108,7 +2137,7 @@ icalvalue_new_query (char* v) } void -icalvalue_set_query(icalvalue* value, char* v) +icalvalue_set_query(icalvalue* value, const char* v) { struct icalvalue_impl* impl; @@ -2118,7 +2147,7 @@ icalvalue_set_query(icalvalue* value, char* v) icalerror_check_value_type(value, ICAL_QUERY_VALUE); impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free(impl->data.v_string);} + if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} impl->data.v_string = strdup(v); @@ -2128,7 +2157,7 @@ icalvalue_set_query(icalvalue* value, char* v) } -char* +const char* icalvalue_get_query(icalvalue* value) { icalerror_check_arg( (value!=0),"value"); @@ -2137,3 +2166,38 @@ icalvalue_get_query(icalvalue* value) return ((struct icalvalue_impl*)value)->data.v_string; } + +icalvalue* +icalvalue_new_status (icalproperty_status v) +{ + struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_STATUS_VALUE); + + + icalvalue_set_status((icalvalue*)impl,v); + + return (icalvalue*)impl; +} + +void +icalvalue_set_status(icalvalue* value, icalproperty_status v) +{ + struct icalvalue_impl* impl; + + icalerror_check_arg_rv( (value!=0),"value"); + + icalerror_check_value_type(value, ICAL_STATUS_VALUE); + + impl = (struct icalvalue_impl*)value; + + impl->data.v_status = v; +} + +icalproperty_status +icalvalue_get_status(icalvalue* value) +{ + icalerror_check_arg( (value!=0),"value"); + icalerror_check_value_type(value, ICAL_STATUS_VALUE); + + return ((struct icalvalue_impl*)value)->data.v_status; +} + diff --git a/libical/src/libical/icalvalue.h b/libical/src/libical/icalvalue.h index 18c15abaf4..828e0c7ff5 100644 --- a/libical/src/libical/icalvalue.h +++ b/libical/src/libical/icalvalue.h @@ -5,8 +5,6 @@ $Id$ - $Locker$ - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -32,20 +30,21 @@ #include <time.h> #include "icalenums.h" #include "icaltypes.h" - +#include "icalrecur.h" + typedef void icalvalue; icalvalue* icalvalue_new(icalvalue_kind kind); icalvalue* icalvalue_new_clone(icalvalue* value); -icalvalue* icalvalue_new_from_string(icalvalue_kind kind, char* str); +icalvalue* icalvalue_new_from_string(icalvalue_kind kind, const char* str); void icalvalue_free(icalvalue* value); int icalvalue_is_valid(icalvalue* value); -char* icalvalue_as_ical_string(icalvalue* value); +const char* icalvalue_as_ical_string(icalvalue* value); icalvalue_kind icalvalue_isa(icalvalue* value); @@ -61,9 +60,9 @@ struct icalattachtype icalvalue_get_attach(icalvalue* value); void icalvalue_set_attach(icalvalue* value, struct icalattachtype v); /* BINARY */ -icalvalue* icalvalue_new_binary(char* v); -char* icalvalue_get_binary(icalvalue* value); -void icalvalue_set_binary(icalvalue* value, char* v); +icalvalue* icalvalue_new_binary(const char* v); +const char* icalvalue_get_binary(icalvalue* value); +void icalvalue_set_binary(icalvalue* value, const char* v); /* BOOLEAN */ icalvalue* icalvalue_new_boolean(int v); @@ -71,9 +70,9 @@ int icalvalue_get_boolean(icalvalue* value); void icalvalue_set_boolean(icalvalue* value, int v); /* CAL-ADDRESS */ -icalvalue* icalvalue_new_caladdress(char* v); -char* icalvalue_get_caladdress(icalvalue* value); -void icalvalue_set_caladdress(icalvalue* value, char* v); +icalvalue* icalvalue_new_caladdress(const char* v); +const char* icalvalue_get_caladdress(icalvalue* value); +void icalvalue_set_caladdress(icalvalue* value, const char* v); /* DATE */ icalvalue* icalvalue_new_date(struct icaltimetype v); @@ -131,14 +130,14 @@ struct icalrecurrencetype icalvalue_get_recur(icalvalue* value); void icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v); /* STRING # Non-std */ -icalvalue* icalvalue_new_string(char* v); -char* icalvalue_get_string(icalvalue* value); -void icalvalue_set_string(icalvalue* value, char* v); +icalvalue* icalvalue_new_string(const char* v); +const char* icalvalue_get_string(icalvalue* value); +void icalvalue_set_string(icalvalue* value, const char* v); /* TEXT */ -icalvalue* icalvalue_new_text(char* v); -char* icalvalue_get_text(icalvalue* value); -void icalvalue_set_text(icalvalue* value, char* v); +icalvalue* icalvalue_new_text(const char* v); +const char* icalvalue_get_text(icalvalue* value); +void icalvalue_set_text(icalvalue* value, const char* v); /* TIME */ icalvalue* icalvalue_new_time(struct icaltimetype v); @@ -151,9 +150,9 @@ union icaltriggertype icalvalue_get_trigger(icalvalue* value); void icalvalue_set_trigger(icalvalue* value, union icaltriggertype v); /* URI */ -icalvalue* icalvalue_new_uri(char* v); -char* icalvalue_get_uri(icalvalue* value); -void icalvalue_set_uri(icalvalue* value, char* v); +icalvalue* icalvalue_new_uri(const char* v); +const char* icalvalue_get_uri(icalvalue* value); +void icalvalue_set_uri(icalvalue* value, const char* v); /* UTC-OFFSET */ icalvalue* icalvalue_new_utcoffset(int v); @@ -161,8 +160,13 @@ int icalvalue_get_utcoffset(icalvalue* value); void icalvalue_set_utcoffset(icalvalue* value, int v); /* QUERY */ -icalvalue* icalvalue_new_query(char* v); -char* icalvalue_get_query(icalvalue* value); -void icalvalue_set_query(icalvalue* value, char* v); +icalvalue* icalvalue_new_query(const char* v); +const char* icalvalue_get_query(icalvalue* value); +void icalvalue_set_query(icalvalue* value, const char* v); + +/* STATUS #Non-st */ +icalvalue* icalvalue_new_status(icalproperty_status v); +icalproperty_status icalvalue_get_status(icalvalue* value); +void icalvalue_set_status(icalvalue* value, icalproperty_status v); -#endif ICALVALUE_H +#endif /*ICALVALUE_H*/ diff --git a/libical/src/libical/icalversion.h.in b/libical/src/libical/icalversion.h.in index aaeeed6666..5d213693e5 100644 --- a/libical/src/libical/icalversion.h.in +++ b/libical/src/libical/icalversion.h.in @@ -1,3 +1,7 @@ +#ifndef ICAL_VERSION_H +#define ICAL_VERSION_H #define ICAL_PACKAGE "@PACKAGE@" #define ICAL_VERSION "@VERSION@" + +#endif diff --git a/libical/src/libical/icalyacc.c b/libical/src/libical/icalyacc.c index c93fcc3df1..8cfd94693f 100644 --- a/libical/src/libical/icalyacc.c +++ b/libical/src/libical/icalyacc.c @@ -4,6 +4,13 @@ #define YYBISON 1 /* Identify Bison output. */ +#define yyparse ical_yyparse +#define yylex ical_yylex +#define yyerror ical_yyerror +#define yylval ical_yylval +#define yychar ical_yychar +#define yydebug ical_yydebug +#define yynerrs ical_yynerrs #define DIGITS 257 #define INTNUMBER 258 #define FLOATNUMBER 259 @@ -164,20 +171,19 @@ - ================================b======================================*/ + =======================================================================*/ #include <stdlib.h> #include <string.h> /* for strdup() */ -#include <limits.h> /* for SHRT_MAX*/ #include "icalparser.h" -#include "ical.h" #include "pvl.h" -#define YYERROR_VERBOSE -#define YYDEBUG 1 - icalvalue *icalparser_yy_value; /* Current Value */ +void ical_yyerror(char* s); +void icalparser_clear_flex_input(); +int ical_yy_lex(void); + /* Globals for UTCOFFSET values */ int utc; int utc_b; @@ -201,7 +207,7 @@ void set_value_type(icalvalue_kind kind); void set_parser_value_state(); struct icaltimetype fill_datetime(char* d, char* t); void ical_yy_error(char *s); /* Don't know why I need this.... */ -/*int yylex(void); /* Or this. */ +int yylex(void); /* Or this. */ @@ -209,58 +215,11 @@ void ical_yy_error(char *s); /* Don't know why I need this.... */ VALUEs, that is, ) correctly. */ -#line 76 "icalyacc.y" +#line 75 "icalyacc.y" typedef union { float v_float; int v_int; char* v_string; - - /* Renaming hack */ -#define yymaxdepth ical_yy_maxdepth -#define yyparse ical_yy_parse -#define yylex ical_yy_lex -#define yyerror ical_yy_error -#define yylval ical_yy_lval -#define yychar ical_yy_char -#define yydebug ical_yy_debug -#define yypact ical_yy_pact -#define yyr1 ical_yy_r1 -#define yyr2 ical_yy_r2 -#define yydef ical_yy_def -#define yychk ical_yy_chk -#define yypgo ical_yy_pgo -#define yyact ical_yy_act -#define yyexca ical_yy_exca -#define yyerrflag ical_yy_errflag -#define yynerrs ical_yy_nerrs -#define yyps ical_yy_ps -#define yypv ical_yy_pv -#define yys ical_yy_s -#define yy_yys ical_yy_yys -#define yystate ical_yy_state -#define yytmp ical_yy_tmp -#define yyv ical_yy_v -#define yy_yyv ical_yy_yyv -#define yyval ical_yy_val -#define yylloc ical_yy_lloc -#define yyreds ical_yy_reds -#define yytoks ical_yy_toks -#define yylhs ical_yy_yylhs -#define yylen ical_yy_yylen -#define yydefred ical_yy_yydefred -#define yydgoto ical_yy_yydgoto -#define yydefred ical_yy_yydefred -#define yydgoto ical_yy_yydgoto -#define yysindex ical_yy_yysindex -#define yyrindex ical_yy_yyrindex -#define yygindex ical_yy_yygindex -#define yytable ical_yy_yytable -#define yycheck ical_yy_yycheck -#define yyname ical_yy_yyname -#define yyrule ical_yy_yyrule - - - } YYSTYPE; #ifndef YYDEBUG #define YYDEBUG 1 @@ -372,15 +331,15 @@ static const short yyrhs[] = { 143, #if YYDEBUG != 0 static const short yyrline[] = { 0, - 159, 161, 162, 163, 164, 165, 166, 167, 168, 174, - 176, 179, 182, 197, 199, 202, 204, 206, 222, 223, - 225, 230, 233, 236, 240, 244, 249, 253, 258, 263, - 268, 271, 274, 278, 283, 288, 297, 318, 350, 352, - 353, 354, 355, 356, 357, 361, 363, 364, 365, 366, - 367, 368, 373, 375, 377, 379, 380, 382, 387, 389, - 392, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 413, 416, - 420, 422, 424, 432, 433, 435, 441 + 181, 183, 184, 185, 186, 187, 188, 189, 190, 196, + 198, 201, 204, 219, 221, 224, 226, 228, 244, 245, + 247, 252, 255, 258, 262, 266, 271, 275, 280, 285, + 290, 294, 298, 303, 308, 313, 322, 343, 375, 377, + 378, 379, 380, 381, 382, 386, 388, 389, 390, 391, + 392, 393, 398, 400, 402, 404, 405, 407, 411, 413, + 416, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 437, 440, + 444, 446, 448, 456, 457, 459, 465 }; #endif @@ -1067,7 +1026,7 @@ yyreduce: switch (yyn) { case 9: -#line 168 "icalyacc.y" +#line 190 "icalyacc.y" { icalparser_yy_value = 0; icalparser_clear_flex_input(); @@ -1075,15 +1034,15 @@ case 9: ; break;} case 11: -#line 178 "icalyacc.y" +#line 200 "icalyacc.y" { icalparser_yy_value = icalvalue_new_boolean(1); ; break;} case 12: -#line 180 "icalyacc.y" +#line 202 "icalyacc.y" { icalparser_yy_value = icalvalue_new_boolean(0); ; break;} case 13: -#line 183 "icalyacc.y" +#line 205 "icalyacc.y" { struct icaltimetype stm; @@ -1099,23 +1058,23 @@ case 13: ; break;} case 14: -#line 198 "icalyacc.y" +#line 220 "icalyacc.y" {utc = 0;; break;} case 15: -#line 199 "icalyacc.y" +#line 221 "icalyacc.y" {utc = 1;; break;} case 16: -#line 203 "icalyacc.y" +#line 225 "icalyacc.y" {utc_b = 0;; break;} case 17: -#line 204 "icalyacc.y" +#line 226 "icalyacc.y" {utc_b = 1;; break;} case 18: -#line 208 "icalyacc.y" +#line 230 "icalyacc.y" { struct icaltimetype stm; stm = fill_datetime(yyvsp[-3].v_string, yyvsp[-1].v_string); @@ -1127,100 +1086,103 @@ case 18: ; break;} case 21: -#line 226 "icalyacc.y" +#line 248 "icalyacc.y" { duration.weeks = atoi(yyvsp[-1].v_string); ; break;} case 22: -#line 231 "icalyacc.y" +#line 253 "icalyacc.y" { ; break;} case 23: -#line 234 "icalyacc.y" +#line 256 "icalyacc.y" { ; break;} case 24: -#line 237 "icalyacc.y" +#line 259 "icalyacc.y" { ; break;} case 25: -#line 241 "icalyacc.y" +#line 263 "icalyacc.y" { duration.hours = atoi(yyvsp[-1].v_string); ; break;} case 26: -#line 245 "icalyacc.y" +#line 267 "icalyacc.y" { duration.hours = atoi(yyvsp[-2].v_string); ; break;} case 27: -#line 250 "icalyacc.y" +#line 272 "icalyacc.y" { duration.minutes = atoi(yyvsp[-1].v_string); ; break;} case 28: -#line 254 "icalyacc.y" +#line 276 "icalyacc.y" { duration.minutes = atoi(yyvsp[-2].v_string); ; break;} case 29: -#line 259 "icalyacc.y" +#line 281 "icalyacc.y" { duration.seconds = atoi(yyvsp[-1].v_string); ; break;} case 30: -#line 264 "icalyacc.y" +#line 286 "icalyacc.y" { duration.days = atoi(yyvsp[-1].v_string); ; break;} case 31: -#line 269 "icalyacc.y" +#line 291 "icalyacc.y" { + duration.is_neg = 0; ; break;} case 32: -#line 272 "icalyacc.y" +#line 295 "icalyacc.y" { + duration.is_neg = 0; ; break;} case 33: -#line 275 "icalyacc.y" -{ +#line 299 "icalyacc.y" +{ + duration.is_neg = 1; ; break;} case 34: -#line 279 "icalyacc.y" +#line 304 "icalyacc.y" { icalparser_yy_value = icalvalue_new_duration(duration); memset(&duration,0, sizeof(duration)); ; break;} case 35: -#line 284 "icalyacc.y" +#line 309 "icalyacc.y" { icalparser_yy_value = icalvalue_new_duration(duration); memset(&duration,0, sizeof(duration)); ; break;} case 36: -#line 289 "icalyacc.y" +#line 314 "icalyacc.y" { icalparser_yy_value = icalvalue_new_duration(duration); memset(&duration,0, sizeof(duration)); ; break;} case 37: -#line 298 "icalyacc.y" +#line 323 "icalyacc.y" { struct icalperiodtype p; @@ -1243,7 +1205,7 @@ case 37: ; break;} case 38: -#line 319 "icalyacc.y" +#line 344 "icalyacc.y" { struct icalperiodtype p; @@ -1272,199 +1234,199 @@ case 38: ; break;} case 39: -#line 351 "icalyacc.y" +#line 376 "icalyacc.y" {clear_recur();recur.freq = ICAL_SECONDLY_RECURRENCE;; break;} case 40: -#line 352 "icalyacc.y" +#line 377 "icalyacc.y" {clear_recur();recur.freq = ICAL_MINUTELY_RECURRENCE;; break;} case 41: -#line 353 "icalyacc.y" +#line 378 "icalyacc.y" {clear_recur();recur.freq = ICAL_HOURLY_RECURRENCE;; break;} case 42: -#line 354 "icalyacc.y" +#line 379 "icalyacc.y" {clear_recur();recur.freq = ICAL_DAILY_RECURRENCE;; break;} case 43: -#line 355 "icalyacc.y" +#line 380 "icalyacc.y" {clear_recur();recur.freq = ICAL_WEEKLY_RECURRENCE;; break;} case 44: -#line 356 "icalyacc.y" +#line 381 "icalyacc.y" {clear_recur();recur.freq = ICAL_MONTHLY_RECURRENCE;; break;} case 45: -#line 357 "icalyacc.y" +#line 382 "icalyacc.y" {clear_recur();recur.freq = ICAL_YEARLY_RECURRENCE;; break;} case 46: -#line 362 "icalyacc.y" +#line 387 "icalyacc.y" { skiplist[skippos]=ICAL_SUNDAY_WEEKDAY; ; break;} case 47: -#line 363 "icalyacc.y" +#line 388 "icalyacc.y" { skiplist[skippos]=ICAL_MONDAY_WEEKDAY; ; break;} case 48: -#line 364 "icalyacc.y" +#line 389 "icalyacc.y" { skiplist[skippos]=ICAL_TUESDAY_WEEKDAY; ; break;} case 49: -#line 365 "icalyacc.y" +#line 390 "icalyacc.y" { skiplist[skippos]=ICAL_WEDNESDAY_WEEKDAY; ; break;} case 50: -#line 366 "icalyacc.y" +#line 391 "icalyacc.y" { skiplist[skippos]=ICAL_THURSDAY_WEEKDAY; ; break;} case 51: -#line 367 "icalyacc.y" +#line 392 "icalyacc.y" { skiplist[skippos]=ICAL_FRIDAY_WEEKDAY; ; break;} case 52: -#line 368 "icalyacc.y" +#line 393 "icalyacc.y" { skiplist[skippos]=ICAL_SATURDAY_WEEKDAY; ; break;} case 53: -#line 374 "icalyacc.y" +#line 399 "icalyacc.y" {if( skippos<8) skippos++;; break;} case 54: -#line 375 "icalyacc.y" +#line 400 "icalyacc.y" { dow_pos = atoi(yyvsp[-1].v_string); skiplist[skippos] += 8*dow_pos; if( skippos<8) skippos++; ; break;} case 55: -#line 377 "icalyacc.y" +#line 402 "icalyacc.y" { dow_pos = atoi(yyvsp[-1].v_string); skiplist[skippos] -= 8*dow_pos; if( skippos<8) skippos++; ; break;} case 56: -#line 379 "icalyacc.y" +#line 404 "icalyacc.y" {if( skippos<8) skippos++;; break;} case 57: -#line 380 "icalyacc.y" +#line 405 "icalyacc.y" { dow_pos = atoi(yyvsp[-1].v_string); skiplist[skippos] += 8*dow_pos;if( skippos<8) skippos++;; break;} case 58: -#line 382 "icalyacc.y" +#line 407 "icalyacc.y" { dow_pos = atoi(yyvsp[-1].v_string); skiplist[skippos] -= 8*dow_pos;if( skippos<8) skippos++;; break;} case 59: -#line 388 "icalyacc.y" +#line 412 "icalyacc.y" { skiplist[skippos] = atoi(yyvsp[0].v_string); skippos++;; break;} case 60: -#line 389 "icalyacc.y" +#line 413 "icalyacc.y" { skiplist[skippos] = atoi(yyvsp[0].v_string); if (skippos<367) skippos++;; break;} case 61: -#line 393 "icalyacc.y" +#line 417 "icalyacc.y" {recur.interval = atoi(yyvsp[0].v_string);; break;} case 62: -#line 394 "icalyacc.y" +#line 418 "icalyacc.y" {recur.week_start = ICAL_SUNDAY_WEEKDAY;; break;} case 63: -#line 395 "icalyacc.y" +#line 419 "icalyacc.y" {recur.week_start = ICAL_MONDAY_WEEKDAY;; break;} case 64: -#line 396 "icalyacc.y" +#line 420 "icalyacc.y" {recur.week_start = ICAL_TUESDAY_WEEKDAY;; break;} case 65: -#line 397 "icalyacc.y" +#line 421 "icalyacc.y" {recur.week_start = ICAL_WEDNESDAY_WEEKDAY;; break;} case 66: -#line 398 "icalyacc.y" +#line 422 "icalyacc.y" {recur.week_start = ICAL_THURSDAY_WEEKDAY;; break;} case 67: -#line 399 "icalyacc.y" +#line 423 "icalyacc.y" {recur.week_start = ICAL_FRIDAY_WEEKDAY;; break;} case 68: -#line 400 "icalyacc.y" +#line 424 "icalyacc.y" {recur.week_start = ICAL_SATURDAY_WEEKDAY;; break;} case 69: -#line 401 "icalyacc.y" +#line 425 "icalyacc.y" {copy_list(recur.by_second,60);; break;} case 70: -#line 402 "icalyacc.y" +#line 426 "icalyacc.y" {copy_list(recur.by_minute,60);; break;} case 71: -#line 403 "icalyacc.y" +#line 427 "icalyacc.y" {copy_list(recur.by_hour,24);; break;} case 72: -#line 404 "icalyacc.y" +#line 428 "icalyacc.y" {copy_list(recur.by_day,7);; break;} case 73: -#line 405 "icalyacc.y" +#line 429 "icalyacc.y" {copy_list(recur.by_month,12);; break;} case 74: -#line 406 "icalyacc.y" +#line 430 "icalyacc.y" {copy_list(recur.by_month_day,31);; break;} case 75: -#line 407 "icalyacc.y" +#line 431 "icalyacc.y" {copy_list(recur.by_year_day,366);; break;} case 76: -#line 408 "icalyacc.y" +#line 432 "icalyacc.y" {copy_list(recur.by_week_no,53);; break;} case 77: -#line 409 "icalyacc.y" +#line 433 "icalyacc.y" {copy_list(recur.by_set_pos,366);; break;} case 78: -#line 411 "icalyacc.y" +#line 435 "icalyacc.y" { recur.until = icalvalue_get_datetime(icalparser_yy_value); icalvalue_free(icalparser_yy_value); icalparser_yy_value=0;; break;} case 79: -#line 414 "icalyacc.y" +#line 438 "icalyacc.y" { recur.until = icalvalue_get_date(icalparser_yy_value); icalvalue_free(icalparser_yy_value); icalparser_yy_value=0;; break;} case 80: -#line 417 "icalyacc.y" +#line 441 "icalyacc.y" { recur.count = atoi(yyvsp[0].v_string); ; break;} case 83: -#line 426 "icalyacc.y" +#line 450 "icalyacc.y" { icalparser_yy_value = icalvalue_new_recur(recur); ; break;} case 84: -#line 432 "icalyacc.y" +#line 456 "icalyacc.y" { utcsign = 1; ; break;} case 85: -#line 433 "icalyacc.y" +#line 457 "icalyacc.y" { utcsign = -1; ; break;} case 86: -#line 437 "icalyacc.y" +#line 461 "icalyacc.y" { icalparser_yy_value = icalvalue_new_utcoffset( utcsign * (yyvsp[-1].v_int*3600) + (yyvsp[0].v_int*60) ); ; break;} case 87: -#line 442 "icalyacc.y" +#line 466 "icalyacc.y" { icalparser_yy_value = icalvalue_new_utcoffset(utcsign * (yyvsp[-2].v_int*3600) + (yyvsp[-1].v_int*60) +(yyvsp[0].v_int)); ; @@ -1691,7 +1653,7 @@ yyerrhandle: } return 1; } -#line 448 "icalyacc.y" +#line 472 "icalyacc.y" @@ -1701,7 +1663,6 @@ void clear_recur() skippos = 0; icalrecurrencetype_clear(&recur); - recur.week_start = ICAL_MONDAY_WEEKDAY; } void copy_list(short* array, size_t size) @@ -1731,7 +1692,7 @@ struct icaltimetype fill_datetime(char* datestr, char* timestr) } -void yyerror(char* s) +void ical_yyerror(char* s) { /*fprintf(stderr,"Parse error \'%s\'\n", s);*/ } diff --git a/libical/src/libical/icalyacc.y b/libical/src/libical/icalyacc.y index ac1705bc52..d4d7c94b51 100644 --- a/libical/src/libical/icalyacc.y +++ b/libical/src/libical/icalyacc.y @@ -6,7 +6,7 @@ DESCRIPTION: - $Id: icalyacc.y,v 1.8 2000/11/22 05:11:26 federico Exp $ + $Id: icalyacc.y,v 1.9 2000/12/11 23:01:22 federico Exp $ $Locker: $ (C) COPYRIGHT 1999 Eric Busboom @@ -27,20 +27,19 @@ - ================================b======================================*/ + =======================================================================*/ #include <stdlib.h> #include <string.h> /* for strdup() */ -#include <limits.h> /* for SHRT_MAX*/ #include "icalparser.h" -#include "ical.h" #include "pvl.h" -#define YYERROR_VERBOSE -#define YYDEBUG 1 - icalvalue *icalparser_yy_value; /* Current Value */ +void ical_yyerror(char* s); +void icalparser_clear_flex_input(); +int ical_yy_lex(void); + /* Globals for UTCOFFSET values */ int utc; int utc_b; @@ -64,7 +63,7 @@ void set_value_type(icalvalue_kind kind); void set_parser_value_state(); struct icaltimetype fill_datetime(char* d, char* t); void ical_yy_error(char *s); /* Don't know why I need this.... */ -/*int yylex(void); /* Or this. */ +int yylex(void); /* Or this. */ @@ -77,11 +76,14 @@ void ical_yy_error(char *s); /* Don't know why I need this.... */ float v_float; int v_int; char* v_string; +} + /* Renaming hack */ + +/* #define yymaxdepth ical_yy_maxdepth #define yyparse ical_yy_parse -#define yylex ical_yy_lex #define yyerror ical_yy_error #define yylval ical_yy_lval #define yychar ical_yy_char @@ -121,11 +123,31 @@ void ical_yy_error(char *s); /* Don't know why I need this.... */ #define yycheck ical_yy_yycheck #define yyname ical_yy_yyname #define yyrule ical_yy_yyrule +#define yy_scan_bytes ical_yy_scan_bytes +#define yy_scan_string ical_yy_scan_string +#define yy_scan_buffer ical_yy_scan_buffer +*/ + +/* These are redefined with the -P option to flex */ +/* +#define yy_create_buffer ical_yy_create_buffer +#define yy_delete_buffer ical_yy_delete_buffer +#define yy_flex_debug ical_yy_flex_debug +#define yy_init_buffer ical_yy_init_buffer +#define yy_flush_buffer ical_yy_flush_buffer +#define yy_load_buffer_state ical_yy_load_buffer_state +#define yy_switch_to_buffer ical_yy_switch_to_buffer +#define yyin ical_yyin +#define yyleng ical_yyleng +#define yylex ical_yylex +#define yylineno ical_yylineno +#define yyout ical_yyout +#define yyrestart ical_yyrestart +#define yytext ical_yytext +#define yywrap ical_yywrap +*/ - -} - %token <v_string> DIGITS %token <v_int> INTNUMBER %token <v_float> FLOATNUMBER @@ -267,12 +289,15 @@ dur_day: DIGITS 'D' dur_prefix: /* empty */ { + duration.is_neg = 0; } | '+' { + duration.is_neg = 0; } | '-' - { + { + duration.is_neg = 1; } duration_value: dur_prefix 'P' dur_date @@ -366,7 +391,7 @@ weekday: | TH { skiplist[skippos]=ICAL_THURSDAY_WEEKDAY; } | FR { skiplist[skippos]=ICAL_FRIDAY_WEEKDAY; } | SA { skiplist[skippos]=ICAL_SATURDAY_WEEKDAY; } - ; + ; /* HACK. The skippos has only 8 positions, but the spec permits any number */ @@ -381,7 +406,6 @@ weekday_list: skiplist[skippos] += 8*dow_pos;if( skippos<8) skippos++;} | weekday_list COMMA MINUS DIGITS weekday { dow_pos = atoi($4); skiplist[skippos] -= 8*dow_pos;if( skippos<8) skippos++;} - ; recur_list: @@ -454,7 +478,6 @@ void clear_recur() skippos = 0; icalrecurrencetype_clear(&recur); - recur.week_start = ICAL_MONDAY_WEEKDAY; } void copy_list(short* array, size_t size) @@ -484,7 +507,7 @@ struct icaltimetype fill_datetime(char* datestr, char* timestr) } -void yyerror(char* s) +void ical_yyerror(char* s) { /*fprintf(stderr,"Parse error \'%s\'\n", s);*/ } diff --git a/libical/src/libical/pvl.c b/libical/src/libical/pvl.c index 94eaeac874..2a733e8aa9 100644 --- a/libical/src/libical/pvl.c +++ b/libical/src/libical/pvl.c @@ -309,14 +309,14 @@ pvl_insert_ordered(pvl_list l,pvl_comparef f,void *d) /* smaller than head, add to head */ - if ( ((*f)(d,L->head->d)) < 0) + if ( ((*f)(d,L->head->d)) <= 0) { pvl_unshift(l,d); return; } /* larger than tail, add to tail */ - if ( (*f)(d,L->tail->d) > 0) + if ( (*f)(d,L->tail->d) >= 0) { pvl_push(l,d); return; @@ -324,10 +324,10 @@ pvl_insert_ordered(pvl_list l,pvl_comparef f,void *d) /* Search for the first element that is smaller, and add before it */ - + for (P=L->head; P != 0; P = P->next) { - if ( (*f)(P->d,d) > 0) + if ( (*f)(P->d,d) >= 0) { pvl_insert_before(l,P,d); return; diff --git a/libical/src/libical/pvl.h b/libical/src/libical/pvl.h index 40ca516e9f..14a15a15eb 100644 --- a/libical/src/libical/pvl.h +++ b/libical/src/libical/pvl.h @@ -39,7 +39,7 @@ extern int pvl_list_count; /* Create new lists or elements */ pvl_elem pvl_new_element(void* d, pvl_elem next,pvl_elem prior); -pvl_list pvl_newlist(); +pvl_list pvl_newlist(void); void pvl_free(pvl_list); /* Add, remove, or get the head of the list */ diff --git a/libical/src/libicalss/Makefile.am b/libical/src/libicalss/Makefile.am index e4431cb492..0cbecbedea 100644 --- a/libical/src/libicalss/Makefile.am +++ b/libical/src/libicalss/Makefile.am @@ -1,36 +1,59 @@ +lib_LTLIBRARIES = libicalss.la +YFLAGS =-d -v -p ss +LFLAGS = -Pss +LEX_OUTPUT_ROOT = lex.ss -#noinst_LTLIBRARIES = libicalss.la -lib_LIBRARIES = libicalss.a - -libicalss_a_SOURCES =\ - icalcalendar.c \ - icalcalendar.h \ - icalset.h \ - icalset.c \ - icalfileset.c \ - icalfileset.h \ - icalfilesetimpl.h \ - icaldirset.c \ - icaldirset.h \ - icalcsdb.h \ - icalcstp.h \ - icalgauge.h \ - icalgauge.c - -include_HEADERS =\ - icalcalendar.h \ - icalset.h - icalfileset.h \ - icalfilesetimpl.h \ - icaldirset.h \ - icalcsdb.h \ - icalcstp.h \ - icalgauge.h - -INCLUDES = \ - -I ../libical/ \ - -I $(srcdir)/../libical/ \ - -I .. \ - -I$(srcdir)/.. +all: icalss.h +INCLUDES = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src \ + -I$(top_builddir)/src \ + -I$(top_srcdir)/src/libical \ + -I$(srcdir)/libical + +libicalss_la_LDFLAGS = -version-info 0:0:0 + +libicalss_la_SOURCES = \ + icalclassify.c \ + icaldirset.c \ + icaldirsetimpl.h \ + icalfileset.c \ + icalfilesetimpl.h \ + icalgauge.c \ + icalgaugeimpl.h \ + icalset.c \ + icalsslexer.l \ + icalssutil.c \ + icalssyacc.h \ + icalssyacc.y \ + icalspanlist.c \ + icalmessage.c \ + icalcstp.c + +libicalssincludedir = $(includedir) + +COMBINEDHEADERS = \ + icalset.h \ + icalfileset.h \ + icaldirset.h \ + icalcalendar.h \ + icalgauge.h \ + icalssutil.h \ + icalclassify.h \ + icalspanlist.h \ + icalmessage.h \ + icalcstp.h + +icalss.h: $(COMBINEDHEADERS) + cat $(COMBINEDHEADERS) | egrep -v "#include.*\"ical" \ + | egrep -v "#include.*\"pvl\.h\"" > icalss.h + + +libicalssinclude_HEADERS = icalss.h + +CONFIG_CLEAN_FILES = y.output + +EXTRA_DIST = \ + $(COMBINEDHEADERS) \ diff --git a/libical/src/libicalss/icalcstp.h b/libical/src/libicalss/icalcstp.h index fea6c89616..63f5af913f 100644 --- a/libical/src/libicalss/icalcstp.h +++ b/libical/src/libicalss/icalcstp.h @@ -29,43 +29,15 @@ #include "ical.h" -typedef void* icalcstp; - -typedef struct icalcstp_stubs; - -icalcstp* icalcstp_new(icalcstp_stubs* stubs, - int incoming, int outgoing); - -void* icalcstp_free(icalcstp* cstp); - -/* Send or recieve data directly to/from the network. These calls are - needed for the AUTHENTICATE command and possibly others */ -ssize_t icalcstp_send(icalcstp* cstp, char* msg); -ssize_t icalcstp_recieve(icalcstp* cstp, char* msg); - -int icalcstp_set_timeout(icalcstp* cstp, int sec); - -typedef struct icalcstp_response { - icalrequeststatus code - char *arg; /* These strings are owned by libical */ - char *debug_text; - char *more_text; - void* result; -} icalcstp_response; - /********************** Server (Reciever) Interfaces *************************/ /* On the server side, the caller will recieve data from the incoming - socket and pass it to icalcstp_process_incoming. The caller then - takes the return from _process_incoming and sends it out through - the socket. This gives the caller a point of control. If the cstp - code connected to the socket itself, it would be hard for the - caller to do anything else after the cstp code was started. - - However, some commands will use the sockets directly, though the - _send and _recieve routines. Example is Authenticate and Starttls, - which need several exchanges of data + socket and pass it to icalcstps_next_input. The caller then takes + the return from icalcstps_next_outpu and sends it out through the + socket. This gives the caller a point of control. If the cstp code + connected to the socket itself, it would be hard for the caller to + do anything else after the cstp code was started. All of the server abd client command routines will generate response codes. On the server side, these responses will be turned @@ -73,63 +45,117 @@ typedef struct icalcstp_response { is the one sent from the server. Since each command can return multiple responses, the responses are - stored in the icalcstp object and are accesses by - icalcstp_first_response() and icalcstp_next_response() + stored in the icalcstps object and are accesses by + icalcstps_first_response() and icalcstps_next_response() + + How to use: + + 1) Construct a new icalcstps, bound to your code via stubs + 2) Repeat forever: + 2a) Get string from client & give to icalcstps_next_input() + 2b) Call icalcstps_next_output. Send string to client. */ - -/* Process a single line of incomming data */ -char* icalcstp_process_incoming(icalcstp* cstp, char* string); + +typedef void icalcstps; /* Er, they aren't really stubs, but pointers to the rountines that - icalcstp_process_incoming will call when it recognizes a CSTP + icalcstps_process_incoming will call when it recognizes a CSTP command in the data. BTW, the CONTINUE command is named 'cont' because 'continue' is a C keyword */ - -struct icalcstp_server_stubs { - icalerrorenum (*abort)(icalcstp* cstp); - icalerrorenum (*authenticate)(icalcstp* cstp, char* mechanism, +struct icalcstps_stubs { + icalerrorenum (*abort)(icalcstps* cstp); + icalerrorenum (*authenticate)(icalcstps* cstp, char* mechanism, char* data); - icalerrorenum (*calidexpand)(icalcstp* cstp, char* calid); - icalerrorenum (*capability)(icalcstp* cstp); - icalerrorenum (*cont)(icalcstp* cstp, unsigned int time); - icalerrorenum (*identify)(icalcstp* cstp, char* id); - icalerrorenum (*disconnect)(icalcstp* cstp); - icalerrorenum (*sendata)(icalcstp* cstp, unsigned int time, + icalerrorenum (*calidexpand)(icalcstps* cstp, char* calid); + icalerrorenum (*capability)(icalcstps* cstp); + icalerrorenum (*cont)(icalcstps* cstp, unsigned int time); + icalerrorenum (*identify)(icalcstps* cstp, char* id); + icalerrorenum (*disconnect)(icalcstps* cstp); + icalerrorenum (*sendata)(icalcstps* cstp, unsigned int time, icalcomponent *comp); - icalerrorenum (*starttls)(icalcstp* cstp, char* command, + icalerrorenum (*starttls)(icalcstps* cstp, char* command, char* data); - icalerrorenum (*upnexpand)(icalcstp* cstp, char* upn); - icalerrorenum (*unknown)(icalcstp* cstp, char* command, char* data); -} + icalerrorenum (*upnexpand)(icalcstps* cstp, char* upn); + icalerrorenum (*unknown)(icalcstps* cstp, char* command, char* data); +}; + + +icalcstps* icalcstps_new(struct icalcstps_stubs stubs); + +void icalcstps_free(icalcstps* cstp); + +int icalcstps_set_timeout(icalcstps* cstp, int sec); + +/* Get the next string to send to the client */ +char* icalcstps_next_output(icalcstps* cstp); + +/* process the next string from the client */ +int icalcstps_next_input(icalcstps* cstp); + /********************** Client (Sender) Interfaces **************************/ -/* On the client side, the cstp code is connected directly to the - socket, because the callers point of control is at the interfaces - below. */ - -icalerrorenum icalcstp_abort(icalcstp* cstp); -icalerrorenum icalcstp_authenticate(icalcstp* cstp, char* mechanism, - char* data); -icalerrorenum icalcstp_capability(icalcstp* cstp); -icalerrorenum icalcstp_calidexpand(icalcstp* cstp,char* calid); -icalerrorenum icalcstp_continue(icalcstp* cstp, unsigned int time); -icalerrorenum icalcstp_disconnect(icalcstp* cstp); -icalerrorenum icalcstp_identify(icalcstp* cstp, char* id); -icalerrorenum icalcstp_starttls(icalcstp* cstp, char* command, - char* data); -icalerrorenum icalcstp_senddata(icalcstp* cstp, unsigned int time, - icalcomponent *comp); -icalerrorenum icalcstp_upnexpand(icalcstp* cstp,char* calid); -icalerrorenum icalcstp_sendata(icalcstp* cstp, unsigned int time, - icalcomponent *comp); +/* How to use: + + 1) Construct a new icalcstpc + 2) Issue a command + 3) Repeat until both call icalcstpc_next_output and + icalcstpc_next_input return 0: + 3a) Call icalcstpc_next_output. Send string to server. + 3b) Get string from server, & give to icalcstp_next_input() + 4) Iterate with icalcstpc_first_response & icalcstp_next_response to + get the servers responses + 5) Repeat at #2 +*/ -icalcstp_response icalcstp_first_response(icalcstp* cstp); -icalcstp_response icalcstp_next_response(icalcstp* cstp); +typedef void* icalcstpc; +/* Response code sent by the server. */ +typedef struct icalcstpc_response { + icalrequeststatus code; + char *arg; /* These strings are owned by libical */ + char *debug_text; + char *more_text; + void* result; +} icalcstpc_response; + +icalcstps* icalcstpc_new(); + +void* icalcstpc_free(icalcstpc* cstpc); + +int icalcstpc_set_timeout(icalcstpc* cstp, int sec); + + +/* Get the next string to send to the server */ +char* icalcstpc_next_output(icalcstpc* cstp); + +/* process the next string from the server */ +int icalcstpc_next_input(icalcstpc* cstp); + +/* After icalcstpc_next_input returns a 0, there are responses + ready. use these to get them */ +icalcstpc_response icalcstpc_first_response(icalcstpc* cstp); +icalcstpc_response icalcstpc_next_response(icalcstpc* cstp); + +/* Issue a command */ +icalerrorenum icalcstpc_abort(icalcstpc* cstp); +icalerrorenum icalcstpc_authenticate(icalcstpc* cstp, char* mechanism, + char* init_data, char* f(char*) ); +icalerrorenum icalcstpc_capability(icalcstpc* cstp); +icalerrorenum icalcstpc_calidexpand(icalcstpc* cstp,char* calid); +icalerrorenum icalcstpc_continue(icalcstpc* cstp, unsigned int time); +icalerrorenum icalcstpc_disconnect(icalcstpc* cstp); +icalerrorenum icalcstpc_identify(icalcstpc* cstp, char* id); +icalerrorenum icalcstpc_starttls(icalcstpc* cstp, char* command, + char* init_data, char* f(char*)); +icalerrorenum icalcstpc_senddata(icalcstpc* cstp, unsigned int time, + icalcomponent *comp); +icalerrorenum icalcstpc_upnexpand(icalcstpc* cstp,char* calid); +icalerrorenum icalcstpc_sendata(icalcstpc* cstp, unsigned int time, + icalcomponent *comp); #endif /* !ICALCSTP_H */ diff --git a/libical/src/libicalvcal/Makefile.am b/libical/src/libicalvcal/Makefile.am index 862d77bcea..a4e9bba887 100644 --- a/libical/src/libicalvcal/Makefile.am +++ b/libical/src/libicalvcal/Makefile.am @@ -1,17 +1,29 @@ +lib_LTLIBRARIES = libicalvcal.la -lib_LIBRARIES = libicalvcal.a +INCLUDES = \ + -I$(top_builddir) \ + -I$(top_srcdir)/src/libical \ + -I$(top_srcdir)/src/libicalss \ + -I$(srcdir) -libicalvcal_a_SOURCES = \ - vcc.y \ - vcc.h \ - vobject.c \ - vobject.h \ - port.h \ - vcaltmp.c \ - vcaltmp.h \ - icalvcal.c \ - icalvcal.h +libicalvcal_la_LDFLAGS = -version-info 0:0:0 -EXTRA_DIST = README.TXT vcaltest.c vctest.c +libicalvcal_la_SOURCES = \ + icalvcal.c \ + vcc.y \ + vobject.c \ + vcaltmp.c -INCLUDES = -I ../libical -I $(srcdir)/../libical
\ No newline at end of file +libicalvcalincludedir = $(includedir)/libicalvcal + +libicalvcalinclude_HEADERS = \ + icalvcal.h \ + port.h \ + vcc.h \ + vobject.h \ + vcaltmp.h + +EXTRA_DIST = \ + README.TXT \ + vcaltest.c \ + vctest.c diff --git a/libical/src/libicalvcal/vcc.c b/libical/src/libicalvcal/vcc.c index cb57b6ed58..5c34395b83 100644 --- a/libical/src/libicalvcal/vcc.c +++ b/libical/src/libicalvcal/vcc.c @@ -187,7 +187,6 @@ enum LexMode { /**** Private Forward Declarations ****/ static int pushVObject(const char *prop); static VObject* popVObject(); -static char* lexDataFromBase64(); static void lexPopMode(int top); static int lexWithinMode(enum LexMode mode); static void lexPushMode(enum LexMode mode); @@ -197,7 +196,7 @@ static void enterValues(const char *value); static void mime_error_(char *s); -#line 179 "vcc.y" +#line 178 "vcc.y" typedef union { char *str; VObject *vobj; @@ -277,11 +276,11 @@ static const short yyrhs[] = { 22, #if YYDEBUG != 0 static const short yyrline[] = { 0, - 207, 210, 213, 213, 217, 218, 221, 227, 232, 238, - 244, 245, 248, 252, 258, 261, 266, 266, 272, 273, - 276, 279, 283, 290, 293, 294, 294, 298, 299, 302, - 306, 308, 311, 314, 315, 318, 320, 321, 324, 331, - 336, 342, 348, 355, 360, 366 + 206, 209, 212, 212, 216, 217, 220, 226, 231, 237, + 243, 244, 247, 251, 257, 260, 265, 265, 271, 272, + 275, 278, 282, 289, 292, 293, 293, 297, 298, 301, + 305, 307, 310, 313, 314, 317, 319, 320, 323, 330, + 335, 341, 347, 354, 359, 365 }; #endif @@ -368,7 +367,7 @@ static const short yycheck[] = { 7, 41, 11, 57, 23 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/pkg/share/bison.simple" +#line 3 "/usr/lib/bison.simple" /* This file comes from bison-1.28. */ /* Skeleton output parser for bison, @@ -582,7 +581,7 @@ __yy_memcpy (char *to, char *from, unsigned int count) #endif #endif -#line 217 "/usr/pkg/share/bison.simple" +#line 217 "/usr/lib/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -911,49 +910,49 @@ yyreduce: switch (yyn) { case 2: -#line 211 "vcc.y" +#line 210 "vcc.y" { addList(&vObjList, yyvsp[0].vobj); curObj = 0; ; break;} case 4: -#line 214 "vcc.y" +#line 213 "vcc.y" { addList(&vObjList, yyvsp[0].vobj); curObj = 0; ; break;} case 7: -#line 223 "vcc.y" +#line 222 "vcc.y" { lexPushMode(L_VCARD); if (!pushVObject(VCCardProp)) YYERROR; ; break;} case 8: -#line 228 "vcc.y" +#line 227 "vcc.y" { lexPopMode(0); yyval.vobj = popVObject(); ; break;} case 9: -#line 233 "vcc.y" +#line 232 "vcc.y" { lexPushMode(L_VCARD); if (!pushVObject(VCCardProp)) YYERROR; ; break;} case 10: -#line 238 "vcc.y" +#line 237 "vcc.y" { lexPopMode(0); yyval.vobj = popVObject(); ; break;} case 13: -#line 249 "vcc.y" +#line 248 "vcc.y" { lexPushMode(L_VALUES); ; break;} case 14: -#line 253 "vcc.y" +#line 252 "vcc.y" { if (lexWithinMode(L_BASE64) || lexWithinMode(L_QUOTED_PRINTABLE)) lexPopMode(0); @@ -961,109 +960,109 @@ case 14: ; break;} case 16: -#line 262 "vcc.y" +#line 261 "vcc.y" { enterProps(yyvsp[0].str); ; break;} case 18: -#line 267 "vcc.y" +#line 266 "vcc.y" { enterProps(yyvsp[0].str); ; break;} case 22: -#line 280 "vcc.y" +#line 279 "vcc.y" { enterAttr(yyvsp[0].str,0); ; break;} case 23: -#line 284 "vcc.y" +#line 283 "vcc.y" { enterAttr(yyvsp[-2].str,yyvsp[0].str); ; break;} case 25: -#line 293 "vcc.y" +#line 292 "vcc.y" { enterValues(yyvsp[-1].str); ; break;} case 27: -#line 295 "vcc.y" +#line 294 "vcc.y" { enterValues(yyvsp[0].str); ; break;} case 29: -#line 299 "vcc.y" +#line 298 "vcc.y" { yyval.str = 0; ; break;} case 30: -#line 304 "vcc.y" +#line 303 "vcc.y" { if (!pushVObject(VCCalProp)) YYERROR; ; break;} case 31: -#line 307 "vcc.y" +#line 306 "vcc.y" { yyval.vobj = popVObject(); ; break;} case 32: -#line 309 "vcc.y" +#line 308 "vcc.y" { if (!pushVObject(VCCalProp)) YYERROR; ; break;} case 33: -#line 311 "vcc.y" +#line 310 "vcc.y" { yyval.vobj = popVObject(); ; break;} case 39: -#line 326 "vcc.y" +#line 325 "vcc.y" { lexPushMode(L_VEVENT); if (!pushVObject(VCEventProp)) YYERROR; ; break;} case 40: -#line 332 "vcc.y" +#line 331 "vcc.y" { lexPopMode(0); popVObject(); ; break;} case 41: -#line 337 "vcc.y" +#line 336 "vcc.y" { lexPushMode(L_VEVENT); if (!pushVObject(VCEventProp)) YYERROR; ; break;} case 42: -#line 342 "vcc.y" +#line 341 "vcc.y" { lexPopMode(0); popVObject(); ; break;} case 43: -#line 350 "vcc.y" +#line 349 "vcc.y" { lexPushMode(L_VTODO); if (!pushVObject(VCTodoProp)) YYERROR; ; break;} case 44: -#line 356 "vcc.y" +#line 355 "vcc.y" { lexPopMode(0); popVObject(); ; break;} case 45: -#line 361 "vcc.y" +#line 360 "vcc.y" { lexPushMode(L_VTODO); if (!pushVObject(VCTodoProp)) YYERROR; ; break;} case 46: -#line 366 "vcc.y" +#line 365 "vcc.y" { lexPopMode(0); popVObject(); @@ -1071,7 +1070,7 @@ case 46: break;} } /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/pkg/share/bison.simple" +#line 543 "/usr/lib/bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -1291,9 +1290,8 @@ yyerrhandle: } return 1; } -#line 372 "vcc.y" +#line 371 "vcc.y" -/*/////////////////////////////////////////////////////////////////////////*/ static int pushVObject(const char *prop) { VObject *newObj; @@ -1313,7 +1311,6 @@ static int pushVObject(const char *prop) } -/*/////////////////////////////////////////////////////////////////////////*/ /* This pops the recently built vCard off the stack and returns it. */ static VObject* popVObject() { @@ -1554,22 +1551,6 @@ static char* lexGetWord() { return lexStr(); } -static void lexPushLookahead(char *s, int len) { - int putptr; - if (len == 0) len = strlen(s); - putptr = (int)lexBuf.getPtr - len; - /* this function assumes that length of word to push back - / is not greater than MAX_LEX_LOOKAHEAD. - */ - if (putptr < 0) putptr += MAX_LEX_LOOKAHEAD; - lexBuf.getPtr = putptr; - while (*s) { - lexBuf.buf[putptr] = *s++; - putptr = (putptr + 1) % MAX_LEX_LOOKAHEAD; - } - lexBuf.len += len; - } - static void lexPushLookaheadc(int c) { int putptr; /* can't putback EOF, because it never leaves lookahead buffer */ @@ -1648,7 +1629,6 @@ static void handleMoreRFC822LineBreak(int c) { } static char* lexGet1Value() { - int size = 0; int c; lexSkipWhite(); c = lexLookahead(); @@ -1679,18 +1659,6 @@ static char* lexGet1Value() { } #endif -static char* lexGetStrUntil(char *termset) { - int size = 0; - int c = lexLookahead(); - lexClearToken(); - while (c != EOF && !strchr(termset,c)) { - lexAppendc(c); - lexSkipLookahead(); - c = lexLookahead(); - } - lexAppendc(0); - return c==EOF?0:lexStr(); - } static int match_begin_name(int end) { char *n = lexLookaheadWord(); @@ -1736,7 +1704,6 @@ static void finiLex() { } -/*/////////////////////////////////////////////////////////////////////////*/ /* This parses and converts the base64 format for binary encoding into * a decoded buffer (allocated with new). See RFC 1521. */ @@ -1865,7 +1832,6 @@ static int match_begin_end_name(int end) { static char* lexGetQuotedPrintable() { char cur; - unsigned long len = 0; lexClearToken(); do { @@ -1921,7 +1887,6 @@ EndString: } /* LexQuotedPrintable */ int yylex() { - int token = 0; int lexmode = LEXMODE(); if (lexmode == L_VALUES) { @@ -2054,7 +2019,6 @@ static VObject* Parse_MIMEHelper() return vObjList; } -/*/////////////////////////////////////////////////////////////////////////*/ DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len) { initLex(input, len, 0); @@ -2109,12 +2073,6 @@ DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname) #endif -/*/////////////////////////////////////////////////////////////////////////*/ -static void YYDebug(const char *s) -{ -/* Parse_Debug(s); */ -} - static MimeErrorHandler mimeErrorHandler; diff --git a/libical/src/libicalvcal/vcc.y b/libical/src/libicalvcal/vcc.y index 1c800990c4..70feefab57 100644 --- a/libical/src/libicalvcal/vcc.y +++ b/libical/src/libicalvcal/vcc.y @@ -161,7 +161,6 @@ enum LexMode { /**** Private Forward Declarations ****/ static int pushVObject(const char *prop); static VObject* popVObject(); -static char* lexDataFromBase64(); static void lexPopMode(int top); static int lexWithinMode(enum LexMode mode); static void lexPushMode(enum LexMode mode); @@ -370,7 +369,6 @@ todoitem: ; %% -/*/////////////////////////////////////////////////////////////////////////*/ static int pushVObject(const char *prop) { VObject *newObj; @@ -390,7 +388,6 @@ static int pushVObject(const char *prop) } -/*/////////////////////////////////////////////////////////////////////////*/ /* This pops the recently built vCard off the stack and returns it. */ static VObject* popVObject() { @@ -631,22 +628,6 @@ static char* lexGetWord() { return lexStr(); } -static void lexPushLookahead(char *s, int len) { - int putptr; - if (len == 0) len = strlen(s); - putptr = (int)lexBuf.getPtr - len; - /* this function assumes that length of word to push back - / is not greater than MAX_LEX_LOOKAHEAD. - */ - if (putptr < 0) putptr += MAX_LEX_LOOKAHEAD; - lexBuf.getPtr = putptr; - while (*s) { - lexBuf.buf[putptr] = *s++; - putptr = (putptr + 1) % MAX_LEX_LOOKAHEAD; - } - lexBuf.len += len; - } - static void lexPushLookaheadc(int c) { int putptr; /* can't putback EOF, because it never leaves lookahead buffer */ @@ -725,7 +706,6 @@ static void handleMoreRFC822LineBreak(int c) { } static char* lexGet1Value() { - int size = 0; int c; lexSkipWhite(); c = lexLookahead(); @@ -756,18 +736,6 @@ static char* lexGet1Value() { } #endif -static char* lexGetStrUntil(char *termset) { - int size = 0; - int c = lexLookahead(); - lexClearToken(); - while (c != EOF && !strchr(termset,c)) { - lexAppendc(c); - lexSkipLookahead(); - c = lexLookahead(); - } - lexAppendc(0); - return c==EOF?0:lexStr(); - } static int match_begin_name(int end) { char *n = lexLookaheadWord(); @@ -813,7 +781,6 @@ static void finiLex() { } -/*/////////////////////////////////////////////////////////////////////////*/ /* This parses and converts the base64 format for binary encoding into * a decoded buffer (allocated with new). See RFC 1521. */ @@ -942,7 +909,6 @@ static int match_begin_end_name(int end) { static char* lexGetQuotedPrintable() { char cur; - unsigned long len = 0; lexClearToken(); do { @@ -998,7 +964,6 @@ EndString: } /* LexQuotedPrintable */ int yylex() { - int token = 0; int lexmode = LEXMODE(); if (lexmode == L_VALUES) { @@ -1131,7 +1096,6 @@ static VObject* Parse_MIMEHelper() return vObjList; } -/*/////////////////////////////////////////////////////////////////////////*/ DLLEXPORT(VObject*) Parse_MIME(const char *input, unsigned long len) { initLex(input, len, 0); @@ -1186,12 +1150,6 @@ DLLEXPORT(VObject*) Parse_MIME_FromFileName(char *fname) #endif -/*/////////////////////////////////////////////////////////////////////////*/ -static void YYDebug(const char *s) -{ -/* Parse_Debug(s); */ -} - static MimeErrorHandler mimeErrorHandler; diff --git a/libical/src/test/Makefile.am b/libical/src/test/Makefile.am index 7fc594ee84..a2ebea7610 100644 --- a/libical/src/test/Makefile.am +++ b/libical/src/test/Makefile.am @@ -1,18 +1,18 @@ -noinst_PROGRAMS = copycluster regression parser findobj storage stow recur testmime testvcal +noinst_PROGRAMS = copycluster regression parser storage stow recur testmime testvcal process testclassify + +LDADD = ../libicalss/libicalss.la ../libicalvcal/libicalvcal.la ../libical/libical.la -LDADD = ../libical/libical.a ../libicalss/libicalss.a ../libicalvcal/libicalvcal.a INCLUDES = \ - -I . \ - -I../libicalvcal \ - -I $(srcdir)/../libicalvcal \ - -I $(srcdir) \ - -I../libical \ - -I $(srcdir)/../libical \ - -I../libicalss \ - -I $(srcdir)/../libicalss + -I . \ + -I../libicalvcal \ + -I $(srcdir)/../libicalvcal \ + -I $(srcdir) \ + -I../libical \ + -I $(srcdir)/../libical \ + -I../libicalss \ + -I $(srcdir)/../libicalss -findobj_SOURCES = findobj.c copycluster_SOURCES = copycluster.c regression_SOURCES = regression.c parser_SOURCES = icaltestparser.c @@ -20,4 +20,6 @@ storage_SOURCES = storage.c stow_SOURCES = stow.c testvcal_SOURCES = testvcal.c recur_SOURCES = recur.c -test_mime = testmime.c +testmime_SOURCES = testmime.c +process_SOURCES = process.c +testclassify_SOURCES = testclassify.c diff --git a/libical/src/test/copycluster.c b/libical/src/test/copycluster.c index 11bd94c62d..0d6722fc94 100644 --- a/libical/src/test/copycluster.c +++ b/libical/src/test/copycluster.c @@ -4,7 +4,6 @@ CREATOR: eric 15 January 2000 $Id$ - $Locker$ (C) COPYRIGHT 2000 Eric Busboom http://www.softwarestudio.org @@ -27,6 +26,7 @@ #include <stdio.h> /* for printf */ #include "ical.h" +#include "icalss.h" #include "icalfileset.h" #include <errno.h> #include <string.h> /* For strerror */ @@ -72,11 +72,9 @@ int main(int c, char *argv[]){ } - for (itr = icalfileset_get_first_component(clusterin, - ICAL_ANY_COMPONENT); + for (itr = icalset_get_first_component(clusterin); itr != 0; - itr = icalfileset_get_next_component(clusterin, - ICAL_ANY_COMPONENT)){ + itr = icalset_get_next_component(clusterin)){ icalrestriction_check(itr); @@ -108,6 +106,7 @@ int main(int c, char *argv[]){ icalfileset_free(clusterout); } - return 0; + return 0; } + diff --git a/libical/src/test/regression.c b/libical/src/test/regression.c index dc6a5301f1..1d66ee4fc5 100644 --- a/libical/src/test/regression.c +++ b/libical/src/test/regression.c @@ -1,12 +1,11 @@ /* -*- Mode: C -*- ====================================================================== - FILE: usecases.c + FILE: regression.c CREATOR: eric 03 April 1999 DESCRIPTION: $Id$ - $Locker$ (C) COPYRIGHT 1999 Eric Busboom http://www.softwarestudio.org @@ -22,24 +21,20 @@ limitations under the License. The original author is Eric Busboom - The original code is usecases.c + The original code is regression.c ======================================================================*/ #include "ical.h" +#include "icalss.h" + #include <assert.h> #include <string.h> /* for strdup */ #include <stdlib.h> /* for malloc */ #include <stdio.h> /* for printf */ #include <time.h> /* for time() */ -#include "icalmemory.h" -#include "icalerror.h" -#include "icalrestriction.h" -#include "icalcalendar.h" -#include "icalgauge.h" -#include "icaldirset.h" -#include "icalfileset.h" + /* This example creates and minipulates the ical object that appears * in rfc 2445, page 137 */ @@ -829,11 +824,9 @@ int test_store() rtime.end = rtime.start; rtime.end.hour++; - for (itr = icalfileset_get_first_component(cluster, - ICAL_ANY_COMPONENT); + for (itr = icalfileset_get_first_component(cluster); itr != 0; - itr = icalfileset_get_next_component(cluster, - ICAL_ANY_COMPONENT)){ + itr = icalfileset_get_next_component(cluster)){ icalcomponent *clone; icalproperty *p; @@ -929,11 +922,11 @@ int test_store() #endif - for(c = icaldirset_get_first_component(s,ICAL_ANY_COMPONENT); + for(c = icaldirset_get_first_component(s); c != 0; c = next){ - next = icaldirset_get_next_component(s,ICAL_ANY_COMPONENT); + next = icaldirset_get_next_component(s); if (c != 0){ /*icaldirset_remove_component(s,c);*/ @@ -1023,34 +1016,6 @@ void test_restriction() rtime.end = icaltime_from_timet( time(0),0,0); rtime.end.hour++; - - - /* Property restrictions */ - assert(icalrestriction_get_property_restriction( - ICAL_METHOD_PUBLISH, - ICAL_VEVENT_COMPONENT, - ICAL_SEQUENCE_PROPERTY) == 5); /* ZEROORONE -> 5 */ - - assert(icalrestriction_get_property_restriction( - ICAL_METHOD_PUBLISH, - ICAL_VEVENT_COMPONENT, - ICAL_ATTACH_PROPERTY)==3); /* ZEROPLUS -> 3 */ - - assert(icalrestriction_get_property_restriction( - ICAL_METHOD_DECLINECOUNTER, - ICAL_VEVENT_COMPONENT, - ICAL_SEQUENCE_PROPERTY)==1); /* ZERO -> 1 */ - - /* Component restrictions */ - assert(icalrestriction_get_component_restriction( - ICAL_METHOD_PUBLISH, - ICAL_VJOURNAL_COMPONENT, - ICAL_X_COMPONENT) == 3); /* ZEROPLUS */ - - assert(icalrestriction_get_component_restriction( - ICAL_METHOD_CANCEL, - ICAL_VJOURNAL_COMPONENT, - ICAL_VEVENT_COMPONENT) == 1); /* ZERO */ comp = icalcomponent_vanew( @@ -1124,6 +1089,7 @@ void test_restriction() } +#if 0 void test_calendar() { icalcomponent *comp; @@ -1168,6 +1134,9 @@ void test_calendar() icalcalendar_free(calendar); } +#endif + +void test_increment(void); void test_recur() { @@ -1198,6 +1167,64 @@ void test_recur() printf("%s\n",icalvalue_as_ical_string(v)); + test_increment(); + +} + + +enum byrule { + NO_CONTRACTION = -1, + BY_SECOND = 0, + BY_MINUTE = 1, + BY_HOUR = 2, + BY_DAY = 3, + BY_MONTH_DAY = 4, + BY_YEAR_DAY = 5, + BY_WEEK_NO = 6, + BY_MONTH = 7, + BY_SET_POS +}; + +struct icalrecur_iterator_impl { + + struct icaltimetype dtstart; + struct icaltimetype last; /* last time return from _iterator_next*/ + int occurrence_no; /* number of step made on this iterator */ + struct icalrecurrencetype rule; + + short days[366]; + short days_index; + + enum byrule byrule; + short by_indices[9]; + + + short *by_ptrs[9]; /* Pointers into the by_* array elements of the rule */ +}; + +void icalrecurrencetype_test() +{ + icalvalue *v = icalvalue_new_from_string( + ICAL_RECUR_VALUE, + "FREQ=YEARLY;UNTIL=20060101T000000;INTERVAL=2;BYDAY=SU,WE;BYSECOND=15,30; BYMONTH=1,6,11"); + + struct icalrecurrencetype r = icalvalue_get_recur(v); + struct icaltimetype t = icaltime_from_timet( time(0), 0, 0); + struct icaltimetype next; + time_t tt; + + struct icalrecur_iterator_impl* itr + = (struct icalrecur_iterator_impl*) icalrecur_iterator_new(r,t); + + do { + + next = icalrecur_iterator_next(itr); + tt = icaltime_as_timet(next); + + printf("%s",ctime(&tt )); + + } while( ! icaltime_is_null_time(next)); + } void test_recur_expansion() @@ -1213,6 +1240,83 @@ void test_recur_expansion() icalrecurrencetype_test(); } +static const char test_icalcomp_str[] = +"BEGIN:VEVENT\r\n" +"UID\r\n" +" :20001121T203327-22955-2183-22933-0@guanabana.helixcode.com\r\n" +"DTSTAMP\r\n" +" :20001121T203327\r\n" +"DTSTART\r\n" +" :20001121T170000\r\n" +"DTEND\r\n" +" :20001121T180000\r\n" +"SUMMARY\r\n" +" :recur on the second Friday every month\\, forever\r\n" +"SEQUENCE\r\n" +" :3\r\n" +"CLASS\r\n" +" :PRIVATE\r\n" +"RRULE\r\n" +" :FREQ=MONTHLY;INTERVAL=1;BYDAY=-2WE,2FR,3SA,-2WE\n" +"END:VEVENT\r\n"; + +void test_recur_bug() +{ + icalcomponent *icalcomp; + char *str; + icalproperty *prop; + struct icalrecurrencetype r; + + /* Print the original stuff */ + + puts ("The original component is:\n\n"); + puts (test_icalcomp_str); + + /* Parse the component */ + + icalcomp = icalparser_parse_string ((char *) test_icalcomp_str); + + if (!icalcomp) { + fprintf (stderr, "main(): Could not parse the stuff\n"); + exit (EXIT_FAILURE); + } + + if (icalcomponent_isa (icalcomp) != ICAL_VEVENT_COMPONENT) { + fprintf (stderr, "main(): This is not the test data I want\n"); + exit (EXIT_FAILURE); + } + + /* Watch the property */ + + prop = icalcomponent_get_first_property (icalcomp, ICAL_RRULE_PROPERTY); + if (!prop) { + fprintf (stderr, "main(): This is not the test data I want\n"); + exit (EXIT_FAILURE); + } + + r = icalproperty_get_rrule (prop); + printf ("\nThe first BYDAY element is %d\n", r.by_day[0]); + + printf ("Position is %d, weekday is %d\n", + icalrecurrencetype_day_position (r.by_day[0]), + (int) icalrecurrencetype_day_day_of_week (r.by_day[0])); + + /* Re-stringify */ + + puts ("\nThe component looks like this after re-stringification:\n\n"); + + str = icalcomponent_as_ical_string (icalcomp); + if (!str) { + fprintf (stderr, "main(): Could not stringify the component\n"); + exit (EXIT_FAILURE); + } + + puts (str); + puts ("\n"); + +} + + void test_duration() { @@ -1223,6 +1327,12 @@ void test_duration() printf("%s\n",icalvalue_as_ical_string(v)); + + v = icalvalue_new_from_string(ICAL_DURATION_VALUE, + "-PT8H30M"); + + printf("%s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); v = icalvalue_new_from_string(ICAL_PERIOD_VALUE, "19971015T050000Z/PT8H30M"); @@ -1320,18 +1430,29 @@ void test_requeststat() } +char ictt_str[1024]; +char* ictt_as_string(struct icaltimetype t) +{ + + sprintf(ictt_str,"%02d-%02d-%02d %02d:%02d:%02d %c",t.year,t.month,t.day, + t.hour,t.minute,t.second,t.is_utc?'Z':' '); + + return ictt_str; +} void test_time() { - struct icaltimetype ictt; + struct icaltimetype ictt, icttutc, icttny,icttphoenix; time_t tt,tt2; icalvalue *v; short day_of_week,start_day_of_week, day_of_year; - tt = time(0); + tt = 973276230; /* Fri Nov 3 10:30:30 PST 2000 in UTC */ + + printf("\n Convert to and from lib c \n"); - printf("System time is: %s\n",ctime(&tt)); + printf("System time is: %s",ctime(&tt)); ictt = icaltime_from_timet(tt,0,0); @@ -1340,8 +1461,9 @@ void test_time() printf("System time from libical: %s\n",icalvalue_as_ical_string(v)); tt2 = icaltime_as_timet(ictt); - printf("Converted back to libc: %s\n",ctime(&tt2)); + printf("Converted back to libc: %s",ctime(&tt2)); + printf("\n Incrementing time \n"); ictt.year++; tt2 = icaltime_as_timet(ictt); @@ -1349,14 +1471,15 @@ void test_time() ictt.month+=13; tt2 = icaltime_as_timet(ictt); - printf("Add 13 months: %s\n",ctime(&tt2)); + printf("Add 13 months: %s",ctime(&tt2)); ictt.second+=90; tt2 = icaltime_as_timet(ictt); - printf("Add 90 seconds: %s\n",ctime(&tt2)); + printf("Add 90 seconds: %s",ctime(&tt2)); ictt = icaltime_from_timet(tt,0,0); + printf("\n Day Of week \n"); day_of_week = icaltime_day_of_week(ictt); start_day_of_week = icaltime_start_doy_of_week(ictt); @@ -1365,6 +1488,30 @@ void test_time() printf("Today is day of week %d, day of year %d\n",day_of_week,day_of_year); printf("Week started n doy of %d\n",start_day_of_week); + printf("\n To and From UTC\n"); + + ictt = icaltime_from_timet(tt,0,1); + printf("As utc : %s\n", ictt_as_string(ictt)); + ictt = icaltime_from_timet(tt,0,0); + printf("As local : %s\n", ictt_as_string(ictt)); + + + + printf("\n TimeZone Conversions \n"); + + ictt = icaltime_from_timet(tt,0,1); + + icttutc = icaltime_as_utc(ictt,"America/Los_Angeles"); + + icttny = icaltime_as_zone(icttutc,"America/New_York"); + + icttphoenix = icaltime_as_zone(icttutc,"America/Phoenix"); + + printf("Orig : %s", ctime(&tt) ); + printf("UTC : %s\n", ictt_as_string(icttutc)); + printf("Los Angeles: %s\n", ictt_as_string(ictt)); + printf("Phoenix : %s\n", ictt_as_string(icttphoenix)); + printf("New York : %s\n", ictt_as_string(icttny)); } @@ -1408,7 +1555,7 @@ void test_iterators() icalproperty *p = icalcomponent_get_first_property(this, ICAL_VERSION_PROPERTY); - char* s = icalproperty_get_version(p); + const char* s = icalproperty_get_version(p); printf("%s ",s); @@ -1452,7 +1599,7 @@ void test_iterators() icalproperty *p = icalcomponent_get_first_property(inner,ICAL_VERSION_PROPERTY); - char* s = icalproperty_get_version(p); + const char* s = icalproperty_get_version(p); printf("%s ",s); } @@ -1467,7 +1614,7 @@ void test_iterators() icalcomponent *this; icalproperty *p; - char* s; + const char* s; next = icalcomponent_get_next_component(c,ICAL_ANY_COMPONENT); p=icalcomponent_get_first_property(inner,ICAL_VERSION_PROPERTY); @@ -1498,7 +1645,7 @@ void test_iterators() icalproperty *p = icalcomponent_get_first_property(inner,ICAL_VERSION_PROPERTY); - char* s = icalproperty_get_version(p); + const char* s = icalproperty_get_version(p); printf("%s ",s); } @@ -1506,22 +1653,450 @@ void test_iterators() printf("\n"); } -int main(int argc, char *argv[]) + +void test_icalset() { + icalcomponent *c; - printf("\n------------Test Memory---------------\n"); - test_memory(); + icalset* f = icalset_new_file("2446.ics"); + icalset* d = icalset_new_dir("outdir"); -exit(0); + assert(f!=0); + assert(d!=0); + for(c = icalset_get_first_component(f); + c != 0; + c = icalset_get_next_component(f)){ - printf("\n------------Test Iterators-----------\n"); - test_iterators(); + icalcomponent *clone; + + clone = icalcomponent_new_clone(c); + + icalset_add_component(d,clone); + + printf(" class %d\n",icalclassify(c,0,"user")); + + } +} + +void test_classify() +{ + icalcomponent *c,*match; + + icalset* f = icalset_new_file("../../test-data/classify.ics"); + + assert(f!=0); + + c = icalset_get_first_component(f); + match = icalset_get_next_component(f); + + printf("Class %d\n",icalclassify(c,match,"A@example.com")); + + +} + +void print_span(int c, struct icaltime_span span ){ + + printf("#%02d start: %s",c,ctime(&span.start)); + printf(" end : %s",ctime(&span.end)); + +} + +void test_span() +{ + time_t tm1 = 973378800; /*Sat Nov 4 23:00:00 UTC 2000, + Sat Nov 4 15:00:00 PST 2000 */ + time_t tm2 = 973382400; /*Sat Nov 5 00:00:00 UTC 2000 + Sat Nov 4 16:00:00 PST 2000 */ + struct icaldurationtype dur; + struct icaltime_span span; + icalcomponent *c; + + memset(&dur,0,sizeof(dur)); + dur.minutes = 30; + + span.start = tm1; + span.end = tm2; + print_span(0,span); + + /* Specify save timezone as in commend above */ + c = + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1,0,0), + icalparameter_new_tzid("US/Pacific"),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2,0,0), + icalparameter_new_tzid("US/Pacific"),0), + 0 + ); + + printf("%s\n",icalcomponent_as_ical_string(c)); + + span = icalcomponent_get_span(c); + + print_span(1,span); + + /* Use machine's local timezone. Same as above if run in US/Pacific */ + c = + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1,0,0),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2,0,0),0), + 0 + ); + + span = icalcomponent_get_span(c); + + print_span(2,span); + + /* Specify different timezone */ + c = + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1,0,0), + icalparameter_new_tzid("US/Eastern"),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2,0,0), + icalparameter_new_tzid("US/Eastern"),0), + 0 + ); + span = icalcomponent_get_span(c); + print_span(3,span); + + /* Specify different timezone for start and end*/ + c = + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1,0,0), + icalparameter_new_tzid("US/Eastern"),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2,0,0), + icalparameter_new_tzid("US/Pacific"),0), + 0 + ); + span = icalcomponent_get_span(c); + print_span(4,span); + + + /* Use Duration */ + c = + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1,0,0), + icalparameter_new_tzid("US/Pacific"),0), + icalproperty_new_duration(dur), + + 0 + ); + span = icalcomponent_get_span(c); + print_span(5,span); + +#ifndef ICAL_ERRORS_ARE_FATAL + /* Both UTC and Timezone -- an error */ + icalerror_clear_errno(); + c = + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1,0,1), + icalparameter_new_tzid("US/Eastern"),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2,0,1), + icalparameter_new_tzid("US/Eastern"),0), + 0 + ); + + span = icalcomponent_get_span(c); + assert(icalerrno != ICAL_NO_ERROR); +#endif /*ICAL_ERRORS_ARE_FATAL*/ + +} + +icalcomponent* icalclassify_find_overlaps(icalset* set, icalcomponent* comp); + +void test_overlaps() +{ + icalcomponent *cset,*c; + icalset *set; + time_t tm1 = 973378800; /*Sat Nov 4 23:00:00 UTC 2000, + Sat Nov 4 15:00:00 PST 2000 */ + time_t tm2 = 973382400; /*Sat Nov 5 00:00:00 UTC 2000 + Sat Nov 4 16:00:00 PST 2000 */ + + time_t hh = 1800; /* one half hour */ + + set = icalset_new_file("../../test-data/overlaps.ics"); + + printf("-- 1 -- \n"); + c = icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1-hh,0,1),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2-hh,0,1),0), + 0 + ); + + cset = icalclassify_find_overlaps(set,c); + + printf("%s\n",icalcomponent_as_ical_string(cset)); + + printf("-- 2 -- \n"); + c = icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1-hh,0,1),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2,0,1),0), + 0 + ); + + cset = icalclassify_find_overlaps(set,c); + printf("%s\n",icalcomponent_as_ical_string(cset)); + + printf("-- 3 -- \n"); + c = icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_vanew_dtstart(icaltime_from_timet(tm1+5*hh,0,1),0), + icalproperty_vanew_dtend(icaltime_from_timet(tm2+5*hh,0,1),0), + 0 + ); + + cset = icalclassify_find_overlaps(set,c); + + printf("%s\n",icalcomponent_as_ical_string(cset)); + +} + +void test_fblist() +{ + icalspanlist *sl; + icalset* set = icalset_new_file("../../test-data/spanlist.ics"); + struct icalperiodtype period; + + sl = icalspanlist_new(set, + icaltime_from_string("19970324T1200Z"), + icaltime_from_string("19990424T020000Z")); + + printf("Restricted spanlist\n"); + icalspanlist_dump(sl); + + period= icalspanlist_next_free_time(sl, + icaltime_from_string("19970801T1200Z")); + + + printf("Next Free time: %s\n",icaltime_as_ctime(period.start)); + printf(" %s\n",icaltime_as_ctime(period.end)); + + + icalspanlist_free(sl); + + printf("Unrestricted spanlist\n"); + + sl = icalspanlist_new(set, + icaltime_from_string("19970324T1200Z"), + icaltime_null_time()); + + printf("Restricted spanlist\n"); + + icalspanlist_dump(sl); + + period= icalspanlist_next_free_time(sl, + icaltime_from_string("19970801T1200Z")); + + + printf("Next Free time: %s\n",icaltime_as_ctime(period.start)); + printf(" %s\n",icaltime_as_ctime(period.end)); + + + icalspanlist_free(sl); + + +} + +void test_convenience(){ + + icalcomponent *c; + int duration; + + c = icalcomponent_vanew( + ICAL_VCALENDAR_COMPONENT, + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_new_dtstart(icaltime_from_string("19970801T1200")), + icalproperty_new_dtend(icaltime_from_string("19970801T1300")), + 0 + ), + 0); + + printf("** 1 DTSTART and DTEND **\n%s\n\n", + icalcomponent_as_ical_string(c)); + + duration = icaldurationtype_as_timet(icalcomponent_get_duration(c))/60; + + printf("Start: %s\n",ictt_as_string(icalcomponent_get_dtstart(c))); + printf("End: %s\n",ictt_as_string(icalcomponent_get_dtend(c))); + printf("Dur: %d m\n",duration); + + icalcomponent_free(c); + + c = icalcomponent_vanew( + ICAL_VCALENDAR_COMPONENT, + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_new_dtstart(icaltime_from_string("19970801T1200Z")), + icalproperty_new_duration(icaldurationtype_from_string("PT1H30M")), + 0 + ), + 0); + + printf("\n** 2 DTSTART and DURATION **\n%s\n\n", + icalcomponent_as_ical_string(c)); + + duration = icaldurationtype_as_timet(icalcomponent_get_duration(c))/60; + + printf("Start: %s\n",ictt_as_string(icalcomponent_get_dtstart(c))); + printf("End: %s\n",ictt_as_string(icalcomponent_get_dtend(c))); + printf("Dur: %d m\n",duration); + + icalcomponent_free(c); + + c = icalcomponent_vanew( + ICAL_VCALENDAR_COMPONENT, + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_new_dtstart(icaltime_from_string("19970801T1200")), + icalproperty_new_dtend(icaltime_from_string("19970801T1300")), + 0 + ), + 0); + + icalcomponent_set_duration(c,icaldurationtype_from_string("PT1H30M")); + + printf("** 3 DTSTART and DTEND, Set DURATION **\n%s\n\n", + icalcomponent_as_ical_string(c)); + + duration = icaldurationtype_as_timet(icalcomponent_get_duration(c))/60; + + printf("Start: %s\n",ictt_as_string(icalcomponent_get_dtstart(c))); + printf("End: %s\n",ictt_as_string(icalcomponent_get_dtend(c))); + printf("Dur: %d m\n",duration); + + icalcomponent_free(c); + + c = icalcomponent_vanew( + ICAL_VCALENDAR_COMPONENT, + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + icalproperty_new_dtstart(icaltime_from_string("19970801T1200Z")), + icalproperty_new_duration(icaldurationtype_from_string("PT1H30M")), + 0 + ), + 0); + + icalcomponent_set_dtend(c,icaltime_from_string("19970801T1330Z")); + + printf("\n** 4 DTSTART and DURATION, set DTEND **\n%s\n\n", + icalcomponent_as_ical_string(c)); + + duration = icaldurationtype_as_timet(icalcomponent_get_duration(c))/60; + + printf("Start: %s\n",ictt_as_string(icalcomponent_get_dtstart(c))); + printf("End: %s\n",ictt_as_string(icalcomponent_get_dtend(c))); + printf("Dur: %d m\n",duration); + + icalcomponent_free(c); + + c = icalcomponent_vanew( + ICAL_VCALENDAR_COMPONENT, + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + 0 + ), + 0); + + icalcomponent_set_dtstart(c,icaltime_from_string("19970801T1200Z")); + icalcomponent_set_dtend(c,icaltime_from_string("19970801T1330Z")); + + printf("\n** 5 Set DTSTART and DTEND **\n%s\n\n", + icalcomponent_as_ical_string(c)); + + + duration = icaldurationtype_as_timet(icalcomponent_get_duration(c))/60; + + printf("Start: %s\n",ictt_as_string(icalcomponent_get_dtstart(c))); + printf("End: %s\n",ictt_as_string(icalcomponent_get_dtend(c))); + printf("Dur: %d m\n",duration); + + icalcomponent_free(c); + + c = icalcomponent_vanew( + ICAL_VCALENDAR_COMPONENT, + icalcomponent_vanew( + ICAL_VEVENT_COMPONENT, + 0 + ), + 0); + + + icalcomponent_set_dtstart(c,icaltime_from_string("19970801T1200Z")); + icalcomponent_set_duration(c,icaldurationtype_from_string("PT1H30M")); + + printf("\n** 6 Set DTSTART and DURATION **\n%s\n\n", + icalcomponent_as_ical_string(c)); + + + duration = icaldurationtype_as_timet(icalcomponent_get_duration(c))/60; + + printf("Start: %s\n",ictt_as_string(icalcomponent_get_dtstart(c))); + printf("End: %s\n",ictt_as_string(icalcomponent_get_dtend(c))); + printf("Dur: %d m\n",duration); + + icalcomponent_free(c); + +} + +int main(int argc, char *argv[]) +{ + + printf("\n------------Test recur bug ----------\n"); + test_recur_bug(); + + exit(0); + + printf("\n------------Test recur---------------\n"); + test_recur(); + + printf("\n------------Test FBlist------------\n"); + test_fblist(); printf("\n------------Test time----------------\n"); test_time(); + + printf("\n------------Test Overlaps------------\n"); + test_overlaps(); + + + printf("\n------------Test Span----------------\n"); + test_span(); + + + printf("\n------------Test duration---------------\n"); + test_duration(); + + exit(0); + + + + printf("\n------------Test Convenience ------------\n"); + test_convenience(); + + + + printf("\n------------Test classify ---------------\n"); + test_classify(); + + printf("\n------------Test Memory---------------\n"); + test_memory(); + + + printf("\n------------Test Iterators-----------\n"); + test_iterators(); + printf("\n------------Test Restriction---------------\n"); test_restriction(); @@ -1531,12 +2106,6 @@ exit(0); printf("\n------------Test strings---------------\n"); test_strings(); - printf("\n------------Test recur---------------\n"); - test_recur(); - - printf("\n------------Test duration---------------\n"); - test_duration(); - printf("\n------------Test Compare---------------\n"); test_compare(); @@ -1559,9 +2128,13 @@ exit(0); create_new_component_with_va_args(); + return 0; + + printf("\n------------Test icalset ---------------\n"); + test_icalset(); + - return 0; } diff --git a/libical/src/test/storage.c b/libical/src/test/storage.c index d53001b574..b8eb48c30f 100644 --- a/libical/src/test/storage.c +++ b/libical/src/test/storage.c @@ -6,7 +6,6 @@ DESCRIPTION: $Id$ - $Locker$ (C) COPYRIGHT 1999 Eric Busboom http://www.softwarestudio.org @@ -162,11 +161,9 @@ void test_fileset() cout = icalfileset_new(OUTPUT_FILE); assert(cout != 0); - for (itr = icalfileset_get_first_component(cout, - ICAL_ANY_COMPONENT); + for (itr = icalfileset_get_first_component(cout); itr != 0; - itr = icalfileset_get_next_component(cout, - ICAL_ANY_COMPONENT)){ + itr = icalfileset_get_next_component(cout)){ icalcomponent *event; icalproperty *dtstart, *dtend; @@ -190,11 +187,9 @@ void test_fileset() cout = icalfileset_new(OUTPUT_FILE); assert(cout != 0); - for (itr = icalfileset_get_first_component(cout, - ICAL_ANY_COMPONENT); + for (itr = icalfileset_get_first_component(cout); itr != 0; - itr = icalfileset_get_next_component(cout, - ICAL_ANY_COMPONENT)){ + itr = icalfileset_get_next_component(cout)){ icalfileset_remove_component(cout, itr); @@ -209,11 +204,9 @@ void test_fileset() assert(cout != 0); count =0; - for (itr = icalfileset_get_first_component(cout, - ICAL_ANY_COMPONENT); + for (itr = icalfileset_get_first_component(cout); itr != 0; - itr = icalfileset_get_next_component(cout, - ICAL_ANY_COMPONENT)){ + itr = icalfileset_get_next_component(cout)){ icalcomponent *event; icalproperty *dtstart, *dtend; @@ -269,11 +262,9 @@ int test_dirset() rtime.end = rtime.start; rtime.end.hour++; - for (itr = icalfileset_get_first_component(cluster, - ICAL_ANY_COMPONENT); + for (itr = icalfileset_get_first_component(cluster); itr != 0; - itr = icalfileset_get_next_component(cluster, - ICAL_ANY_COMPONENT)){ + itr = icalfileset_get_next_component(cluster)){ icalcomponent *clone, *inner; icalproperty *p; @@ -370,9 +361,9 @@ int test_dirset() #endif - for(c = icaldirset_get_first_component(s,ICAL_ANY_COMPONENT); + for(c = icaldirset_get_first_component(s); c != 0; - c = icaldirset_get_next_component(s,ICAL_ANY_COMPONENT)){ + c = icaldirset_get_next_component(s)){ if (c != 0){ printf("%s", icalcomponent_as_ical_string(c));; @@ -395,6 +386,7 @@ int test_dirset() return 0; } +#if 0 void test_calendar() { icalcomponent *comp; @@ -439,6 +431,7 @@ void test_calendar() icalcalendar_free(calendar); } +#endif int main(int argc, char *argv[]) diff --git a/libical/src/test/stow.c b/libical/src/test/stow.c index f742b417a5..6c285afc77 100644 --- a/libical/src/test/stow.c +++ b/libical/src/test/stow.c @@ -4,7 +4,6 @@ CREATOR: eric 29 April 2000 $Id$ - $Locker$ (C) COPYRIGHT 2000 Eric Busboom http://www.softwarestudio.org @@ -47,6 +46,9 @@ char* program_name; #define TMPSIZE 2048 #define SENDMAIL "/usr/lib/sendmail -t" +void usage(char *message); + + enum options { STORE_IN_FILE, STORE_IN_DB, @@ -113,7 +115,7 @@ enum file_type test_file(char *path) return type; } -char* lowercase(char* str) +char* lowercase(const char* str) { char* p = 0; char* new = strdup(str); @@ -152,11 +154,6 @@ char* get_local_attendee(struct options_struct *opt) } #endif -void usage(char *message) -{ - fprintf(stderr,"Usage: %s [-emdcn] [-i inputfile] [-o outputfile] [-u calid]\n",program_name); - -} icalcomponent* get_first_real_component(icalcomponent *comp) { @@ -178,8 +175,9 @@ icalcomponent* get_first_real_component(icalcomponent *comp) -char* make_mime(char* to, char* from, char* subject, - char* text_message, char* method, char* ical_message) +char* make_mime(char* to, const char* from, const char* subject, + const char* text_message, const char* method, + const char* ical_message) { size_t size = strlen(to)+strlen(from)+strlen(subject)+ strlen(text_message)+ strlen(ical_message)+TMPSIZE; @@ -226,8 +224,8 @@ Content-Type: multipart/mixed; boundary=\"%s\"\n\ \n\ This is a multimedia message in MIME format\n\ \n\ ---%s -%s +--%s\n\ +%s\n\ ", to,from,subject,content_id,boundary,boundary, mime_part_1); @@ -251,7 +249,7 @@ void return_failure(icalcomponent* comp, char* message, icalcomponent *inner = get_first_real_component(comp); icalproperty *organizer_prop = icalcomponent_get_first_property(inner,ICAL_ORGANIZER_PROPERTY); - char *organizer = icalproperty_get_organizer(organizer_prop); + const char *organizer = icalproperty_get_organizer(organizer_prop); organizer += 7; @@ -347,7 +345,7 @@ icalcomponent* make_reply(icalcomponent *comp, icalproperty *return_status, } int check_attendee(icalproperty *p, struct options_struct *opt){ - char* s = icalproperty_get_attendee(p); + const char* s = icalproperty_get_attendee(p); char* lower_attendee = lowercase(s); char* local_attendee = opt->calid; @@ -481,6 +479,21 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, } +void usage(char *message) +{ + fprintf(stderr,"Usage: %s [-emdcn] [-i inputfile] [-o outputfile] [-u calid]\n",program_name); + fprintf(stderr,"-e\tInput data is encapsulated in a MIME Message \n\ +-m\tInput is raw iCal \n\ +-i\tSpecify input file. Otherwise, input comed from stdin\n\ +-o\tSpecify file to save incoming message to\n\ +-d\tSpecify database to send data to\n\ +-u\tSet the calid to store the data to\n\ +-n\tSend errors to stdout instead of organizer\n\ +"); + +} + + void get_options(int argc, char* argv[], struct options_struct *opt) { int c; |