From 45860f878df1fea0f6e50d14100a5b3fb8209d4c Mon Sep 17 00:00:00 2001 From: "mikep%oeone.com" Date: Fri, 21 Dec 2001 18:57:01 +0000 Subject: [PATCH] Modified files, and removing other files. --- other-licenses/libical/AUTHORS | 1 - other-licenses/libical/ChangeLog | 505 --- other-licenses/libical/Makefile.am | 9 - other-licenses/libical/Makefile.in | 0 other-licenses/libical/README | 100 - other-licenses/libical/THANKS | 54 - other-licenses/libical/acconfig.h | 20 - other-licenses/libical/aclocal.m4 | 0 other-licenses/libical/config.guess | 0 other-licenses/libical/config.h.in | 0 other-licenses/libical/config.sub | 0 other-licenses/libical/configure | 0 other-licenses/libical/configure.in | 9 +- .../libical/design-data/Makefile.in | 0 .../libical/design-data/parameters.csv | 2 +- .../libical/design-data/properties.csv | 5 +- .../libical/design-data/value-types.csv | 31 - other-licenses/libical/doc/Makefile.in | 0 other-licenses/libical/doc/UsingLibical.lyx | 2578 ------------ other-licenses/libical/examples/Makefile.in | 0 .../libical/examples/access_components.c | 319 -- other-licenses/libical/install-sh | 0 other-licenses/libical/ltconfig | 0 other-licenses/libical/ltmain.sh | 0 other-licenses/libical/missing | 0 other-licenses/libical/mkinstalldirs | 40 - other-licenses/libical/scripts/Makefile.in | 0 .../libical/scripts/mkderivedcomponents.pl | 170 - .../libical/scripts/mkderivedparameters.pl | 2 +- .../libical/scripts/mkderivedproperties.pl | 55 +- .../libical/scripts/mkderivedvalues.pl | 4 +- .../libical/scripts/mkrestrictionrecords.pl | 109 - .../libical/scripts/mkrestrictiontable.pl | 98 - other-licenses/libical/src/Makefile.am | 7 - other-licenses/libical/src/Makefile.in | 0 .../libical/src/libical/Makefile.am | 63 +- .../libical/src/libical/Makefile.in | 565 --- other-licenses/libical/src/libical/ical.h | 2999 -------------- .../libical/src/libical/icalcomponent.c | 748 +++- .../libical/src/libical/icalcomponent.h | 32 +- .../src/libical/icalderivedparameter.c | 1207 ------ .../src/libical/icalderivedparameter.h | 308 -- .../libical/src/libical/icalderivedproperty.c | 2200 ---------- .../libical/src/libical/icalderivedproperty.h | 403 -- .../libical/src/libical/icalderivedvalue.c | 928 ----- .../libical/src/libical/icalderivedvalue.h | 290 -- .../libical/src/libical/icalderivedvalue.h.in | 4 +- .../libical/src/libical/icalerror.c | 16 +- .../libical/src/libical/icalerror.h | 10 +- .../libical/src/libical/icallangbind.c | 16 +- .../libical/src/libical/icallexer.c | 1764 -------- .../libical/src/libical/icallexer.l | 8 +- .../libical/src/libical/icalmemory.c | 4 +- .../libical/src/libical/icalmemory.h | 2 +- other-licenses/libical/src/libical/icalmime.c | 13 +- .../libical/src/libical/icalparameter.c | 12 +- .../libical/src/libical/icalparser.c | 91 +- .../libical/src/libical/icalperiod.c | 10 +- .../libical/src/libical/icalproperty.c | 26 +- .../libical/src/libical/icalproperty.h | 12 +- .../libical/src/libical/icalrecur.c | 426 +- .../libical/src/libical/icalrestriction.c | 0 .../libical/src/libical/icalrestriction.c.in | 5 + other-licenses/libical/src/libical/icaltime.c | 837 ++-- other-licenses/libical/src/libical/icaltime.h | 41 +- .../libical/src/libical/icaltypes.c | 45 +- .../libical/src/libical/icaltypes.h | 136 - .../libical/src/libical/icalvalue.c | 212 +- .../libical/src/libical/icalvalueimpl.h | 4 +- other-licenses/libical/src/libical/icalyacc.c | 1432 ------- other-licenses/libical/src/libical/icalyacc.h | 137 - other-licenses/libical/src/libical/icalyacc.y | 6 +- .../libical/src/libical/libical.dep | 0 .../libical/src/libical/makefile.win | 358 +- other-licenses/libical/src/libical/sspm.c | 17 +- .../libical/src/libical/vsnprintf.c | 15 +- .../libical/src/libicalss/Makefile.am | 64 - .../libical/src/libicalss/Makefile.in | 0 .../libical/src/libicalss/icalclassify.c | 165 +- .../libical/src/libicalss/icalclassify.h | 38 +- .../libical/src/libicalss/icalcstp.c | 6 +- .../libical/src/libicalss/icalcstpclient.c | 6 +- .../libical/src/libicalss/icalcstpserver.c | 6 +- .../libical/src/libicalss/icaldirset.c | 119 +- .../libical/src/libicalss/icalfileset.c | 68 +- .../libical/src/libicalss/icalfileset.h | 6 +- .../libical/src/libicalss/icalgauge.c | 55 +- .../libical/src/libicalss/icalgauge.h | 4 +- .../libical/src/libicalss/icalmessage.c | 7 +- .../libical/src/libicalss/icalset.c | 5 +- .../libical/src/libicalss/icalspanlist.c | 7 +- other-licenses/libical/src/libicalss/icalss.h | 61 +- .../libical/src/libicalss/icalsslexer.c | 175 +- .../libical/src/libicalss/icalsslexer.l | 13 +- .../libical/src/libicalss/icalssyacc.c | 6 +- .../libical/src/libicalss/icalssyacc.y | 6 +- .../libical/src/libicalss/libicalss.dep | 0 .../libical/src/libicalss/makefile.win | 214 +- .../libical/src/libicalvcal/Makefile.am | 4 +- .../libical/src/libicalvcal/Makefile.in | 0 .../libical/src/libicalvcal/icalvcal.c | 11 +- .../libical/src/libicalvcal/libicalvcal.dep | 0 .../libical/src/libicalvcal/makefile.win | 200 +- other-licenses/libical/src/libicalvcal/port.h | 93 - other-licenses/libical/src/libicalvcal/vcc.c | 5 + .../libical/src/libicalvcal/vobject.c | 5 + other-licenses/libical/src/makefile.win | 56 +- other-licenses/libical/src/python/ChangeLog | 109 - .../libical/src/python/Component.py | 194 +- .../libical/src/python/DerivedProperties.py | 104 +- other-licenses/libical/src/python/Libical.py | 18 +- .../libical/src/python/LibicalWrap.c | 3576 ----------------- .../libical/src/python/LibicalWrap.i | 352 -- other-licenses/libical/src/python/Makefile.am | 43 - other-licenses/libical/src/python/Makefile.in | 0 other-licenses/libical/src/python/Property.py | 619 +-- other-licenses/libical/src/python/test.py | 92 +- other-licenses/libical/src/test/Makefile.am | 25 - other-licenses/libical/src/test/Makefile.in | 0 other-licenses/libical/src/test/copycluster.c | 15 +- other-licenses/libical/src/test/makefile.win | 0 other-licenses/libical/src/test/process.c | 111 +- other-licenses/libical/src/test/recur.c | 26 +- other-licenses/libical/src/test/regression.c | 726 +++- .../libical/src/test/regression.dep | 0 other-licenses/libical/src/test/stow.c | 106 +- .../libical/src/test/testclassify.c | 160 +- other-licenses/libical/stamp-h.in | 0 other-licenses/libical/test-data/Makefile.in | 0 other-licenses/libical/test-data/calendar.ics | 47 - other-licenses/libical/test-data/incoming.ics | 168 - other-licenses/libical/test-data/recur.txt | 69 + .../libical/test-data/simple-mime.txt | 26 - 133 files changed, 3981 insertions(+), 23530 deletions(-) delete mode 100644 other-licenses/libical/Makefile.in delete mode 100644 other-licenses/libical/aclocal.m4 delete mode 100755 other-licenses/libical/config.guess delete mode 100644 other-licenses/libical/config.h.in delete mode 100755 other-licenses/libical/config.sub delete mode 100755 other-licenses/libical/configure delete mode 100644 other-licenses/libical/design-data/Makefile.in delete mode 100644 other-licenses/libical/doc/Makefile.in delete mode 100644 other-licenses/libical/examples/Makefile.in delete mode 100755 other-licenses/libical/install-sh delete mode 100755 other-licenses/libical/ltconfig delete mode 100644 other-licenses/libical/ltmain.sh delete mode 100755 other-licenses/libical/missing delete mode 100755 other-licenses/libical/mkinstalldirs delete mode 100644 other-licenses/libical/scripts/Makefile.in delete mode 100644 other-licenses/libical/src/Makefile.in delete mode 100644 other-licenses/libical/src/libical/Makefile.in delete mode 100644 other-licenses/libical/src/libical/ical.h delete mode 100644 other-licenses/libical/src/libical/icalderivedparameter.c delete mode 100644 other-licenses/libical/src/libical/icalderivedparameter.h delete mode 100644 other-licenses/libical/src/libical/icalderivedproperty.c delete mode 100644 other-licenses/libical/src/libical/icalderivedproperty.h delete mode 100644 other-licenses/libical/src/libical/icalderivedvalue.c delete mode 100644 other-licenses/libical/src/libical/icalderivedvalue.h delete mode 100644 other-licenses/libical/src/libical/icallexer.c delete mode 100644 other-licenses/libical/src/libical/icalrestriction.c delete mode 100644 other-licenses/libical/src/libical/icalyacc.c delete mode 100644 other-licenses/libical/src/libical/icalyacc.h delete mode 100644 other-licenses/libical/src/libical/libical.dep delete mode 100644 other-licenses/libical/src/libicalss/Makefile.in delete mode 100644 other-licenses/libical/src/libicalss/libicalss.dep delete mode 100644 other-licenses/libical/src/libicalvcal/Makefile.in delete mode 100644 other-licenses/libical/src/libicalvcal/libicalvcal.dep delete mode 100644 other-licenses/libical/src/python/LibicalWrap.c delete mode 100644 other-licenses/libical/src/python/Makefile.in delete mode 100644 other-licenses/libical/src/test/Makefile.in delete mode 100644 other-licenses/libical/src/test/makefile.win delete mode 100644 other-licenses/libical/src/test/regression.dep delete mode 100644 other-licenses/libical/stamp-h.in delete mode 100644 other-licenses/libical/test-data/Makefile.in diff --git a/other-licenses/libical/AUTHORS b/other-licenses/libical/AUTHORS index 659288c31dd..e69de29bb2d 100644 --- a/other-licenses/libical/AUTHORS +++ b/other-licenses/libical/AUTHORS @@ -1 +0,0 @@ -Eric Busboom diff --git a/other-licenses/libical/ChangeLog b/other-licenses/libical/ChangeLog index 2da464fc543..e69de29bb2d 100644 --- a/other-licenses/libical/ChangeLog +++ b/other-licenses/libical/ChangeLog @@ -1,505 +0,0 @@ -2001-04-01 Eric Busboom - - * icalcomponent.h Changed meaning of - icalcomponent_new_from_string. It used to create a new component - given the text name of the component type to create. Now it calls - icalparser_parse_string to create a new component from the - complete iCalendar text representation of the component. - -2001-03-31 Eric Busboom - - * icalvalue Changed ACTION properties to take an ACTION value - instead of TEXT. The ACTION value is enumerated. - -2001-03-26 Eric Busboom - - * icalparameter.h icalparameter_rsvp_* routines now take, return - ICAL_RSVP_TRUE and ICAL_RSVP_FALSE, not 0 and 1 - -2001-03-25 Eric Busboom - - * icalrecur.c Many changes to get YEARLY rules working and fix - other errors. Recurrences are stil broken, but more types of rue - now work. - -2001-03-16 Eric Busboom - - * icalparameter.c Changed icalparameter_new_from_string() to - icalparameter_new_from_value_string(). Created new - icalparameter_new_from_string() that takes strings of - form"PARAMNAME=PARAMVALUE" - - * *_XNAME changes all _XNAME enumerations to _X - - * derived props, values, parameters. Seperated out derived - proeprties, parameters and values into their own files. This makes - it easier to auto generate all of the enumerations for values, - parameters and proeprties. - - * icalenum.h Major changes to icalenum. Movel all of the - icalenum_* values to other modules, and changed the names. Look - for #defines in icalenum.h tying the old name to the new - name. Also moved all of the enumerations into other files. - - - -2001-02-26 Eric Busboom - - * src/libical/icalproperty.c Added - icalproperty_set_parameter_from_string and - icalproperty_set_value_from_string to aid in binding to Python - -2001-02-15 Eric Busboom - - * design-data/prop-to-value.txt Made a new CSV file, - properties.cvs That collects property-to-value and default value - information - - * src/libical/icalproperty.{c,h}.in Moved auto generated code into - icalderivedproperty.{c,h} and created icalderivedproperty.{c,h}.in - - - -2001-02-14 JP Rosevear - - * src/libical/Makefile.am: Sigh, automake is dumber than i thought - -2001-02-12 JP Rosevear - - * src/test/Makefile.am: link with the static versions - - * src/python/Makefile.am: use include dir discovered in configure checks - - * src/python/.cvsignore: shush - - * src/libical/icalrestriction.c: remove autogenerated file - - * src/libical/Makefile.am: the generated files are now disted so - look for them in the source dir rather than the build dir - - * src/Makefile.am: Only build the python dir if all the configure - stuff checked out - - * configure.in: Remove shared library disabling and add a python - check and allow for the python bindings to not be built - -2001-02-11 Eric Busboom - - * src/python/Makefile.am Tweaked makefile to use automake more, - but it stil isn't quie right. - -2001-02-09 JP Rosevear - - * Shush cvs - -2001-02-09 JP Rosevear - - * src/libical/Makefile.am: Slightly over zealous during the merge - -2001-02-09 JP Rosevear - - * src/libical/Makefile.am: Correct typo - - * Removal of more auto generated files - -2001-02-09 JP Rosevear - - * Removal of various auto generated files - -2001-02-09 JP Rosevear - - * src/libical/icalparameter.c.in (icalparameter_new_from_string): - its NEEDS-ACTION rather than NEEDSACTION - (icalparameter_as_ical_string): ditto - -2001-02-09 Eric Busboom - - * python Added src/python directory. Inserted SWIG wrapper files, - and a simple interface to Component, Time, Duration, Period and - Store. - - * icallangbind.c More experimental work - - * icalduration.{c,h}, icalperiod.{c,h} Broke out period and - duration types into their own files - -2001-02-06 Christopher James Lahey - - * src/libical/icallangbind.c: Added a missing #include here. - - * src/libical/icalrecur.c (icalrecur_add_bydayrules): Copy the - passed in const vals since we change it. - -2001-02-06 Eric Busboom - - * icaltime.c Changed icaltime_from_day_of_year to run mktime in - the UTC timezone. This fixed a bug where it would return one day - eariler for some timezones. - -2001-02-05 Ettore Perazzoli - - * src/libical/Makefile.am (COMBINEDHEADERS): `icalvalue.h', - `icalparameter.h', `icalproperty.h' and `icalrestriction.h' are - created in the builddir so they shouldn't be prefixed with - `$(top_builddir)/src/libical'. - -2001-01-26 Eric Busboom - - * icalproperty.c.in Improved icalproperty_as_ical_string() to - eliminate the possibility of having a VALUE parameter that does - not match the actual kind of value. - - * icalvalue.c.in made icalvalue_*_trigger() and - icalvalue_*_datetimeperiod non-autogenerated. These routines were - for combined value type -- non standard values that can have more - than on standard value type. These non-standard types now delegate - to stadard types. - -2001-01-24 Eric Busboom - - * icalfileset.c fixed icalfileset_read-from_file so it will handle - lines longer than 80 char properly. - -2001-01-23 JP Rosevear - - * configure.in: Don't AC_INIT on an autogenerated file that does not - exist beforehand - -2001-01-23 Eric Busboom - - * icltime.c Removed all of the _local_ routines and simplified - icaltime_utc_offset and icaltime_as_timet - - * regression.c Added tests for triggers and improvements to icaltime.c - - * icaltypes.c Addedd icaltriggertype_from_string and changed - icaltriggertype to be a struct - -2001-01-22 Eric Busboom - - * icaltime.c implemented icaldurationtype_from_string to parse the - string it self, rather than use lex/yacc - -2001-01-15 Eric Busboom - - * icalfileset.c Many improvements. File locking now works, and so - does searching with icalfileset_select() - -2001-01-08 Eric Busboom - - * Makefile.am Remove spaces after -I in several - Makefile.am routines. - - * icalset.c removed return statements from some void functions. - - * icalparameter.c.in Added break to default: case that had no - body. Compilers on Solaris and Tru64 UNIX complained. - -2001-01-02 Eric Busboom - - * icaltime.c Changed icaldurationtype_from_time and _as_timet to - _from_int and _as_int. This is a change interface that may break - some code. - - * icalgauge.c icalgaugeimpl.h, icalgauge.h., Rewrote gauge code to - use pvl-lists directly, instead of trying to reuse icalcomponent. - -2000-12-13 Ettore Perazzoli - - * src/libicalvcal/Makefile.am (INCLUDES): Add - `$(top_builddir)/src/libical' to the include directory list. - - * src/libical/Makefile.am (icalparameter.h): Use `$(srcdir)'. - (icalparameter.c): Likewise. - (icalproperty.h): Likewise. - (icalproperty.c): Likewise. - (icalvalue.h): Likewise. - (icalvalue.c): Likewise. - (icalrestriction.c): Likewise. - (COMBINEDHEADERS): `icalvalue.h', `icalparameter.h' and - `icalproperty.h' are in builddir, not srcdir, so fix the list to - use `$(top_builddir)' instead of `$(top_srcdir)'. - (all): Removed. - (BUILT_SOURCES): Move `ical.h' here instead. - (ical.h): Don't depend on `(BUILT_SOURCES)'; this a built source - itself. - -2000-12-12 Eric Busboom - - * icalparser.c Addedd support for x-parameters. - - * icalenum.c Fixed icalenum_parameter_type_to_string and - icalenum_property_type_to_string to property identify X- parameers - and properties. - - * icalparameter.c Fixed icalparameter_as_ical_string to property - write out X-Parameters. - - -2000-12-11 Eric Busboom - - * icalcstp.c added empty bodies to prep_* routines so that shared - libraries would build. - -2000-12-11 JP Rosevear - - * src/libical/icaltime.c (icaltime_compare_date_only): New - function that compares only the dates, not the times as well. - - * src/libical/icaltime.h: Add prototype for the function above. - - * src/libical/icalrecur.h (struct icalrecurrencetype): Correct - header documentation. - - * src/libical/icaltypes.c: No longer include . - - * src/libical/icalrecur.c: Likewise. - - * src/libical/icalvalue.c: Likewise. - - * src/libical/icalyacc.y: Likewise. - -2000-12-11 Federico Mena Quintero - - * configure.in (AC_OUTPUT): Fixed order of generated files to make - "make distcheck" work. Turn on AM_MAINTAINER_MODE. - - * src/libical/Makefile.am (EXTRA_DIST): Add icalversion.h.in. - (COMBINEDHEADERS): Added paths to make "make distcheck" work. - (libical_la_SOURCES): Added headers for distribution in our weird - setup. - -2000-12-06 Eric Busboom - - * icaltime.c added icaltime_as_local to convert a UTC time to a - local time - - * icaltime.h icaltime.c Removed is_utc argument from - icaltime_from_timet - - -2000-11-29 Eric Busboom - - * icalrecur.c More testing and bug fixes. Many more of the rules - in recur.txt work correctly. - -2000-11-28 Eric Busboom - - * icalrecur.c Several changes to extract icalrecur.c from - libical. I'd like to make it into a reference impl for recurrence - rules. CHanges include moving all of the recurrence type and - recurrence enums from icalenum and icaltypes into icalrecur, and - adding code to parse recurrence rule strings. - - * icaltime.c Changed icaltime_from_string to parse the string - directly. Now icaltime.c has no dependency on icalvalue.c - -2000-11-21 Eric Busboom - - * icalrecur.c Fixed a bug in the increment_* routines that made - incrementing by more then 1 insensible. Thanks to Martin Neimeier - -2000-11-20 Eric Busboom - - * icalmessage.c Many routines to create new ical messages. - - * icalspanlist.c Code to generate a list of the busy time f the - VEVENTS in a set. Also includes routiens to generate free and busy - lists from the spanlist, and to find the next free time after a - given time. - - * icalvalue.c The STATUS property now has its own value type, - STATUS, which holds the enumeration icalproperty_status. - - * icalrestriction.c Added more restrictions. Now handles mutual - and exclusive consitions, and checks for the reight values in - STATUS properties - - -2000-11-10 Eric Busboom - - * icaltypes.c Added routine to create durationtype from string: - icaldurationtype_from_string - -2000-11-09 Eric Busboom - - * icalcomponet.c Add sever get/set convienience routines to access - and manipulate common component propoerties from the component - interface. This eliminates the need to create a lot of temporary - variables if you just want to change the start time of and event. - -2000-11-06 Eric Busboom - - * icalcomponent.c Added new routines to icalcomponent: - _get_span -- returns the start and end times of the event in UTC - _get_first_real_component -- return ref to VTODO, VEVENT or VJOURNAL - - * icalspanlist.c Added new class, icalspanlist, that generates a - list of alternating busy and free times from an icalset. The class - includes routines to gnerate rfc2445 busy and free lists, and to - get the next avaliable busy or free time after a given time. - -2000-11-06 Federico Mena Quintero - - * src/libical/icalvalue.c (icalvalue_recur_as_ical_string): Handle - both the position and weekday in the by_day field. - -2000-10-20 Eric Busboom - - * Const correctness. Added 'const' all over everywhere. - -2000-10-19 Eric Busboom - - * icalproperty, icalparameter, icalvalue .c, .h Changed most - instances of char* to const char* - - * icalclassify.h Added multiple include protection - - * icalset.h and others, got rid of parameter named "new" - -2000-10-15 Eric Busboom - - * icalcomponent Added convienience functions for constructing - components: icalcomponent_new_vcalendar(), etc. - - * Makefile.am Incorporated build system patch from Federico - Quintero. Misc small fixes and cleanup - - * scripts Incorporated auto-gen patch from Frederico. Generated - code in libical now uses icalproperty.c.in (etc) instead of - editing file icalparoperty.c in place. - - * libical. Changed flex/bison to use the -P/-p options to set - ical_yy as a prefix. Removed prefix redefinition from icalyacc.y - -2000-10-12 Eric Busboom - - * icalproperty.c Fixed icalproperty_get_{first,next}_parameter to - honor the parameter kind argument - - * icalparameter.c Added, but did not complete, a new version of - icalparameters_from_string that does not use the hairy nested - case/switch statements of the previous version - - -2000-10-02 Eric Busboom - - * ical.h ical.h and icalss.h now are concatenations of all of the - public headers for their respective libraries. Thus, only ical.h, - icalss.h and icalvcal.h need to be installed. - -2000-09-11 Eric Busboom - - * icalvcal.c Added more comments - -2000-08-31 JP Rosevear - - * configure.in: Don't list config.h in AC_OUTPUT - -2000-08-26 Ettore Perazzoli - - * examples/Makefile.am (INCLUDES): More `$(srcdir)' loving. - - * src/libicalvcal/Makefile.am (INCLUDES): Add `-I - $(srcdir)/../libical' for builddir != srcdir loving. - -2000-08-25 Christopher James Lahey - - * examples/access_properties_and_parameters.c, - src/libicalvcal/vcc.y: Got rid of some warnings. - - * src/libicalvcal/vcc.c: Checking in generated C file. - -2000-08-25 Christopher James Lahey - - * src/libical/icalcomponent.c: Fixed an incorrect struct name. - -2000-08-25 Peter Williams - - * src/libical/icalcomponent.c (icalcomponent_end_component): Compile fix; - use icalerror_check_arg_re so we can return an valid icalcompiter. - (icalcomponent_begin_component): Same. - -2000-08-24 Federico Mena Quintero - - * src/test/Makefile.am: Make it work. - -2000-08-04 Eric Busboom - - * stow.c Changed stow to write data to a file ( icalfileset) not a - calendar. Also added MIME parsing capability - - * sspm.c Core of the mime processor. Now handles quoted-printable - and base64 encodings - - * icalmime.h New file that parses mime data and returns an - icalcomponent that includes all of the parts. - - -2000-07-26 Eric Busboom - - * icaldirset.h misc bug fixes to get deleting components to work - - * icalcomponent.h Eliminated internal use of _get_first_component - and _get_next_component, since these will reset the interal - iterators. - -2000-07-23 Eric Busboom - - * icalcomponent.h Added external iterators to icalcomponent for - subcomponents: icalcompiter. These are still experimental, but they - seem to work OK and have a nice syntax - -2000-07-18 Eric Busboom - - * icalset This is a new "superclass" for icalstore, icalcluster, - and others. It merges the interfaces of the old icalstore and - icalcluster - - * icalstore.{c,h} CHanged name to icaldirset - - * icalcluster.{c,h} Changed name to icalfileset - - -2000-06-12 Eric Busboom - - * icalstow.c misc improvements and bug fixes to make it useful. - -2000-06-09 Eric Busboom - - * icalrecur.c More extensive code changes for recurrence rule. - - * icalyacc.y Added support for integers in by day lists - -2000-06-01 Eric Busboom - - * icalrecur.c moved recur code into new files - -2000-05-30 Eric Busboom - - * icaltypes.c Extensive work on code to expand recurences - - * icaltypes.h Changed signature icaltimetype_from_timet to include - is_utc flag. - - -2000-03-17 Eric Busboom - - * icalstore.c Vastly improved icalstore_test. - -2000-03-16 Eric Busboom - - * icalcluster.c Added compile flag (ICAL_SAFESAVES) to switch how - icalcluster saves files during commits. When the flag is define, - it will write the data to a temorar file and rename the file to - the target file. - - * storage.c Added seterate test suite for sotage components - - * icalparser.c Created parser object, implemented line-oriented - parsering, and made message oriented parsing work in terms f line - oriented parsing. - - * icalparser.c Fixed icalparser_get_line to remove \r in input. - - diff --git a/other-licenses/libical/Makefile.am b/other-licenses/libical/Makefile.am index e13464d7aa5..e69de29bb2d 100644 --- a/other-licenses/libical/Makefile.am +++ b/other-licenses/libical/Makefile.am @@ -1,9 +0,0 @@ - -EXTRA_DIST = \ - ChangeLog \ - README \ - TEST \ - TODO - -SUBDIRS = design-data doc scripts test-data src examples - diff --git a/other-licenses/libical/Makefile.in b/other-licenses/libical/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/README b/other-licenses/libical/README index 92b2ff6e86f..e69de29bb2d 100644 --- a/other-licenses/libical/README +++ b/other-licenses/libical/README @@ -1,100 +0,0 @@ - -LIBICAL -- An implementation of basic iCAL protocols - -The code and datafiles in this distribution are licensed under the -Mozilla Public License. See http://www.mozilla.org/NPL/MPL-1.0.html -for a copy of the license. Alternately, you may use libical under the -terms of the GNU Library General Public License. See -http://www.fsf.org/copyleft/lesser.html for a copy of the LGPL. - -This dual license ensures that the library can be incorporated into -both proprietary code and GPL'd programs, and will benefit from -improvements made by programmers in both realms. I will only accept -changes into my version of the library if they are similarly -dual-licensed. - -The code in this distribution implements the iCal protocols as -described in RFC2445 and RFC2446. The code is in very early stages of -development. - -Portions of this distribution are (C) Copyright 1996 Apple Computer, -Inc., AT&T Corp., International Business Machines Corporation and -Siemens Rolm Communications Inc. See src/libicalvcal/README.TXT for -details. - -This code is under active development. If you would like to contribute -to the project, you can contact me, Eric Busboom, at -eric@softwarestudio.org. The project has a webpage at - - http://softwarestudio.org/libical/index.html - -and a mailing list that you can join by sending the following mail: - - ------------ - To: minimalist@softwarestudio.org - Subject: subscribe libical - ------------ - - -Building the library --------------------- - -This distribution is developed on Red Hat Linux 6.0 and usually -compiles on SunOS 5.6 and FreeBSD 2.27. I have reports of success of -previous version on MacOS ( with CodeWarrior ) and on UnixWare, but I -don't know about any other systems. - -The library is configured with automake. From the root directory, run - - ./configure - -To build all of the Makefiles for your system. If you will be installing the library, you may want to use the --prefix flag to set the directory where the library and header files will be installed. - - ./configure --prefix=/proj/local/ - -If configure runs fine, run "make" to build the library and -"make install" to install it. - -Although the distribution uses libtool to generate libraries, it has -shared libraries turned off by default. To create and install shared -libraries use: - - ./configure --enable-shared - -The current version of libical focuses on creating and -manipulating iCal objects. With it, you can parse text representations -of iCal components, add and remove sub-components, properties, -parameters and values, and print the components back out as strings. - - -Notes for Libical Developers -------------------- - -If you don't want to use gcc as the compiler, and you got the sources -from CVS, you should set the CC variable to the path to the compiler -and run "automake --include-deps" to keep automake from using -gcc-specific automatic dependancy tracking. - - > CC=/pkg/SUNWspro/bin/cc; export CC - > automake --include-deps - > ./configure --prefix=/proj/local/ - > make - -You will not need to re-run automake unless you got the sources from CVS. - -Using the Library ------------------ - -There is rudimentary, unfinished documentation in the /doc directory, -and annotated examples in /examples. - - -Perl Library ------------- - -There is a perl language binding of this library, LIBICAL. -It is available from http://www.softwarestudio.org/libical - - -Eric Busboom -eric@softwarestudio.org diff --git a/other-licenses/libical/THANKS b/other-licenses/libical/THANKS index a56bca9365e..e69de29bb2d 100644 --- a/other-licenses/libical/THANKS +++ b/other-licenses/libical/THANKS @@ -1,54 +0,0 @@ -Thanks to: - -Allan Clark for testing libical against -UnixWare. - -Graham Davison for MacOS support and -miscelaneous code bits - -Seth Alves for the first cut at the Makefile.am -files and various utility functions. - -Russ Steinthal for several utility functions and -comments. - -Ola Lundqvist for the vCal test data file. - -Colin DuPlantis for new functions in icalparser.c - -Holger Schmidt for all of icalcstp.c, The -CSTP protocol implementation, and modifications to icalcstp.h - -Gisle Hannemyr The decode*() functions in sspm.c -are based on the decode() routine in the mimelite program, Copyright -(c) 1994 Gisle Hannemyr. - -The Evolution team at Helixcode ( Federico Mena Quintero -, JP Rosevear , Ettore -Perazzoli , Christopher James Lahey -, Peter Williams ) for -miscelaneous patches and adjustments to the build system. - -Cornelius Schumacher for many insightful -suggestions and a few patches. - -Mark D. Anderson for discussions and ideas. - -Martin Neimeier for correcting bugs in icalrecur.c - -Tom Leitner For several bug fixes in -compiling on Tru64 UNIX. - -Patrick Lewis for several bug reports and -contributions to the Python bindings - -Larry W. Virden for several bug reports in compiling -on Solaris. - -Bryan Bartone for code changes based on porting -libical to Windows. - -Hubert V for checking and analyzing the output -of the recurrence rule system. - -Jonathan Yue for icalproperty_get_name() diff --git a/other-licenses/libical/acconfig.h b/other-licenses/libical/acconfig.h index f4909b0c46b..e69de29bb2d 100644 --- a/other-licenses/libical/acconfig.h +++ b/other-licenses/libical/acconfig.h @@ -1,20 +0,0 @@ -/* Define to make icalerror_* calls abort instead of internally - signalling an error */ -#undef ICAL_ERRORS_ARE_FATAL - -/* Define to make icalcluster_commit() save to a temp file and mv to - the original file instead of writing to the orig file directly */ -#undef ICAL_SAFESAVES - -/* Define to terminate lines with "\n" instead of "\r\n" */ -#undef ICAL_UNIX_NEWLINE - -/* Define if your libc defines a "timezone" variable */ -#undef HAVE_TIMEZONE - -/* Define if your libc defines a struct tm containing a "tm_gmtoff" member */ -#undef HAVE_TM_GMTOFF - -/* Define to 1 if your compile does not like lines like: struct - something foo[]*/ -#undef ICAL_NO_EMPTY_ARRAY_DECL diff --git a/other-licenses/libical/aclocal.m4 b/other-licenses/libical/aclocal.m4 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/config.guess b/other-licenses/libical/config.guess deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/config.h.in b/other-licenses/libical/config.h.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/config.sub b/other-licenses/libical/config.sub deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/configure b/other-licenses/libical/configure deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/configure.in b/other-licenses/libical/configure.in index 0beaff3f838..0f8c09d3295 100644 --- a/other-licenses/libical/configure.in +++ b/other-licenses/libical/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(src) -AM_INIT_AUTOMAKE(libical,0.23) +AM_INIT_AUTOMAKE(libical,0.23a) AM_CONFIG_HEADER(config.h) dnl Initialize maintainer mode @@ -21,7 +21,13 @@ AC_SUBST(AR) AC_CHECK_PROGS(AR, ar aal, ar) AC_CHECK_PROGS(PERL, perl5 perl) +dnl ************************************************** +dnl test/regression.c (and maybe others) needs this defined +dnl ************************************************** AC_DEFINE(ICAL_ERRORS_ARE_FATAL,1) +AC_DEFINE(NO_WARN_DEPRECATED,1) +AC_DEFINE(NO_WARN_ICAL_MALFORMEDDATA_ERROR_HACK,1) + AC_DEFINE(ICAL_SAFESAVES,1) AC_DEFINE(ICAL_UNIX_NEWLINE,1) dnl AC_DEFINE(ICAL_NO_EMPTY_ARRAY_DECL) @@ -100,5 +106,6 @@ src/libicalvcal/Makefile src/python/Makefile src/test/Makefile test-data/Makefile +zoneinfo/Makefile ]) diff --git a/other-licenses/libical/design-data/Makefile.in b/other-licenses/libical/design-data/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/design-data/parameters.csv b/other-licenses/libical/design-data/parameters.csv index c71eb115eb7..75d4fe5432e 100644 --- a/other-licenses/libical/design-data/parameters.csv +++ b/other-licenses/libical/design-data/parameters.csv @@ -18,7 +18,7 @@ "RSVP","icalparameter_rsvp","TRUE;FALSE" "SENT-BY","const char*", "TZID","const char*", -"VALUE","icalparameter_value","BINARY;BOOLEAN;DATE;DURATION;FLOAT;INTEGER;PERIOD;RECUR;TEXT;TIME;URI;ERROR;DATE-TIME;UTC-OFFSET;CAL-ADDRESS" +"VALUE","icalparameter_value","BINARY;BOOLEAN;DATE;DURATION;FLOAT;INTEGER;PERIOD;RECUR;TEXT;URI;ERROR;DATE-TIME;UTC-OFFSET;CAL-ADDRESS" "X","const char*", "X-LIC-ERRORTYPE","icalparameter_xlicerrortype","COMPONENT-PARSE-ERROR;PROPERTY-PARSE-ERROR;PARAMETER-NAME-PARSE-ERROR;PARAMETER-VALUE-PARSE-ERROR;VALUE-PARSE-ERROR;INVALID-ITIP;UNKNOWN-VCAL-PROP-ERROR;MIME-PARSE-ERROR" "X-LIC-COMPARETYPE","icalparameter_xliccomparetype","EQUAL;NOTEQUAL;LESS;GREATER;LESSEQUAL;GREATEREQUAL;REGEX" diff --git a/other-licenses/libical/design-data/properties.csv b/other-licenses/libical/design-data/properties.csv index dca6810d8fb..855fa722b45 100644 --- a/other-licenses/libical/design-data/properties.csv +++ b/other-licenses/libical/design-data/properties.csv @@ -5,7 +5,7 @@ "ATTENDEE","CAL-ADDRESS","CAL-ADDRESS" "CALSCALE","TEXT","TEXT" "CATEGORIES","TEXT","TEXT" -"CLASS","TEXT","TEXT" +"CLASS","CLASS","CLASS" "COMMENT","TEXT","TEXT" "COMPLETED","DATE-TIME","DATE-TIME" "CONTACT","TEXT","TEXT" @@ -31,7 +31,7 @@ "RECURRENCE-ID","DATE-TIME","DATE-TIME" "RELATED-TO","TEXT","TEXT" "REPEAT","INTEGER","INTEGER" -"REQUEST-STATUS","STRING","STRING" +"REQUEST-STATUS","REQUEST-STATUS","REQUEST-STATUS" "RESOURCES","TEXT","TEXT" "RRULE","RECUR","RECUR" "SEQUENCE","INTEGER","INTEGER" @@ -62,5 +62,6 @@ "X-LIC-MIMEOPTINFO","STRING","STRING" "X-LIC-MIMECID","STRING","STRING" "X-LIC-MIMEFILENAME","STRING","STRING" +"X-LIC-CLASS","X-LIC-CLASS","X-LIC-CLASS" "ANY","NO","NO" "NO","NO","NO" diff --git a/other-licenses/libical/design-data/value-types.csv b/other-licenses/libical/design-data/value-types.csv index cbe6bd9969a..e69de29bb2d 100644 --- a/other-licenses/libical/design-data/value-types.csv +++ b/other-licenses/libical/design-data/value-types.csv @@ -1,31 +0,0 @@ -"#Name","C type& gen flag","Python","Component Values","Enum Values" -"BINARY","(a)const char*","file","unitary", -"BOOLEAN","(a)int","integer","unitary", -"CAL-ADDRESS","(a)const char*","string","unitary", -"DATE","(a)struct icaltimetype","Time","unitary", -"DATE-TIME","(a)struct icaltimetype","Time","unitary", -"DURATION","(a)struct icaldurationtype","Duration","unitary", -"FLOAT","(a)float","float","unitary", -"INTEGER","(a)int","integer","unitary", -"PERIOD","(a)struct icalperiodtype","Period","unitary", -"RECUR","(m)struct icalrecurrencetype","RecurrenceSet","unitary", -"TEXT","(a)const char*","string","unitary", -"TIME","(a)struct icaltimetype","Time","unitary", -"URI","(a)const char*","string","unitary", -"UTC-OFFSET","(a)int","integer","unitary", -"QUERY","(a)const char*","string","unitary", -"#Non-standard multi-valued types",,,, -"ATTACH","(a)struct icalattachtype","none","URI;BINARY", -"DATE-TIME-DATE","(a)struct icaltimetype","none","DATE-TIME;DATE", -"DATE-TIME-PERIOD","(m)struct icaldatetimeperiodtype","none","DATE-TIME;PERIOD", -"TRIGGER","(m)struct icaltriggertype","string","DURATION;DATE-TIME", -"#Non-standard property enumeration types",,,, -"METHOD","(a)enum icalproperty_method","string","unitary","PUBLISH;REQUEST;REPLY;ADD;CANCEL;REFRESH;COUNTER;DECLINECOUNTER;CREATE;READ;RESPONSE;MOVE;MODIFY;GENERATEUID;DELETE" -"ACTION","(a)enum icalproperty_action","string","unitary","AUDIO;DISPLAY;EMAIL;PROCEDURE" -"STATUS","(a)enum icalproperty_status","string","unitary","TENTATIVE;CONFIRMED;COMPLETED;NEEDS-ACTION;CANCELLED;IN-PROCESS;DRAFT;FINAL" -"TRANSP","(a)enum icalproperty_transp","string","unitary","OPAQUE;TRANSPARENT" -"CLASS","(a)enum icalproperty_class","string","unitary","PUBLIC;PRIVATE;CONFIDENTIAL" -"#Other non-standard",,,, -"GEO","(a)struct icalgeotype","tuple","unitary", -"STRING","(a)const char*","string","unitary", -"X","(m)const char*","string","unitary", diff --git a/other-licenses/libical/doc/Makefile.in b/other-licenses/libical/doc/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/doc/UsingLibical.lyx b/other-licenses/libical/doc/UsingLibical.lyx index cef199bea53..e69de29bb2d 100644 --- a/other-licenses/libical/doc/UsingLibical.lyx +++ b/other-licenses/libical/doc/UsingLibical.lyx @@ -1,2578 +0,0 @@ -#LyX 1.1 created this file. For more info see http://www.lyx.org/ -\lyxformat 2.16 -\textclass article -\language default -\inputencoding latin1 -\fontscheme default -\graphics default -\paperfontsize default -\spacing single -\papersize Default -\paperpackage a4 -\use_geometry 0 -\use_amsmath 0 -\paperorientation portrait -\secnumdepth 3 -\tocdepth 3 -\paragraph_separation indent -\defskip medskip -\quotes_language english -\quotes_times 2 -\papercolumns 1 -\papersides 1 -\paperpagestyle default - -\layout Title - -Using Libical -\layout Author - -Eric Busboom (eric@softwarestudio.org) -\layout Date - -January 2001 -\layout Standard - - -\begin_inset LatexCommand \tableofcontents{} - -\end_inset - - -\layout Section - -Introduction -\layout Standard - -Libical is an Open Source implementation of the iCalendar protocols and - protocol data units. - The iCalendar specification describes how calendar clients can communicate - with calendar servers so users can store their calendar data and arrange - meetings with other users. - -\layout Standard - -Libical implements RFC2445, RFC2446 and some of RFC2447 and the CAP draft. - -\layout Standard - -This documentation assumes that you are familiar with the iCalendar standards - RFC2445 and RFC2446. - these specifications are online on the CALSCH webpage at: -\layout LyX-Code - -http://www.imc.org/ietf-calendar/ -\layout Subsection - -The libical project -\layout Standard - -This code is under active development. - If you would like to contribute to the project, you can contact me, Eric - Busboom, at eric@softwarestudio.org. - The project has a webpage at -\layout LyX-Code - -http://softwarestudio.org/libical/index.html -\layout Standard - -and a mailing list that you can join by sending the following mail: -\layout LyX-Code - -To: minimalist@softwarestudio.org -\layout LyX-Code - -Subject: subscribe libical -\layout Subsection - -License -\layout Standard - -The code and datafiles in this distribution are licensed under the Mozilla - Public License. - See http://www.mozilla.org/NPL/MPL-1.0.html for a copy of the license. - Alternately, you may use libical under the terms of the GNU Library General - Public License. - See http://www.fsf.org/copyleft/lesser.html for a copy of the LGPL. -\layout Standard - -This dual license ensures that the library can be incorporated into both - proprietary code and GPL'd programs, and will benefit from improvements - made by programmers in both realms. - I will only accept changes into my version of the library if they are similarly - dual-licensed. -\layout Subsection - -Example Code -\layout Standard - -A lot of the documentation for this library is in the form of example code. - These examples are in the -\begin_inset Quotes eld -\end_inset - -examples -\begin_inset Quotes erd -\end_inset - - directory of the distribution. - Also look in -\begin_inset Quotes eld -\end_inset - -src/test -\begin_inset Quotes erd -\end_inset - - for additional annotated examples. - -\layout Section - -Building nas Installing the Library -\layout Standard - -Libical uses autoconf to generate makefiles. - It should built with no adjustments on Linux, FreeBSD and Solaris under - gcc. - Some version have been successfully been build on MacOS, Solaris, UnixWare, - And Tru64 UNIX without gcc, but you may run into problems with a particular - later version. - -\layout Standard - -For a more complete guide to building the library, see the README file in - the distribution. - -\layout Standard - - -\begin_inset Quotes eld -\end_inset - -make install -\begin_inset Quotes erd -\end_inset - - will install the libraries and header files for three modules: libical, - libicalss. - and libicalvcal. - If you build shared objects, then these files will be installed: -\layout Itemize - -ical.h -\layout Itemize - -libical.a -\layout Itemize - -libical.so -\layout Itemize - -icalss.h -\layout Itemize - -libicalss.a -\layout Itemize - -libicalss.so -\layout Itemize - -icalvcal.h -\layout Itemize - -libicalvcal.a -\layout Itemize - -libicalvcal.so -\layout Standard - -The header files ical.h and icalss.h are combined header files, generated - by concatenating together all of the header files in src/libical and src/libica -lss respectively. - -\layout Section - -Structure -\layout Standard - -The iCal calendar model is based on four types of objects: components, propertie -s, values and parameters. - -\layout Standard - -Properties are the fundamental unit of information in iCal, and they work - a bit like a hash entry, with a constant key and a variable value. - Properties may also have modifiers, called parameters. - In the iCal content line -\layout LyX-Code - -ORGANIZER;ROLE=CHAIR:MAILTO:mrbig@host.com -\layout Standard - -The property name is -\begin_inset Quotes eld -\end_inset - -ORGANIZER, -\begin_inset Quotes erd -\end_inset - - the value of the property is -\begin_inset Quotes eld -\end_inset - -mrbig@host.com -\begin_inset Quotes erd -\end_inset - - and the -\begin_inset Quotes eld -\end_inset - -ROLE -\begin_inset Quotes erd -\end_inset - - parameter specifies that Mr Big is the chair of the meetings associated - with this property. - -\layout Standard - -Components are groups of properties that represent the core objects of a - calendar system, such as events or timezones. - Components are delimited by -\begin_inset Quotes eld -\end_inset - -BEGIN -\begin_inset Quotes erd -\end_inset - - and -\begin_inset Quotes eld -\end_inset - -END -\begin_inset Quotes erd -\end_inset - - tags. - -\layout Standard -\added_space_bottom 0.3cm -When a component is sent across a network, if it is un-encrypted, it will - look something like: -\layout LyX-Code - -BEGIN:VCALENDAR -\layout LyX-Code - -METHOD:REQUEST -\layout LyX-Code - -PRODID: -//hacksw/handcal//NONSGML v1.0//EN -\layout LyX-Code - -BEGIN:VEVENT -\layout LyX-Code - -DTSTAMP:19980309T231000Z -\layout LyX-Code - -UID:guid-1.host1.com -\layout LyX-Code - -ORGANIZER;ROLE=CHAIR:MAILTO:mrbig@host.com -\layout LyX-Code - -ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP: -\layout LyX-Code - - MAILTO:employee-A@host.com -\layout LyX-Code - -DESCRIPTION:Project XYZ Review Meeting -\layout LyX-Code - -CATEGORIES:MEETING -\layout LyX-Code - -CLASS:PUBLIC -\layout LyX-Code - -CREATED:19980309T130000Z -\layout LyX-Code - -SUMMARY:XYZ Project Review -\layout LyX-Code - -DTSTART;TZID=US-Eastern:19980312T083000 -\layout LyX-Code - -DTEND;TZID=US-Eastern:19980312T093000 -\layout LyX-Code - -LOCATION:1CP Conference Room 4350 -\layout LyX-Code - -END:VEVENT -\layout LyX-Code - -END:VCALENDAR -\layout Standard - -Note that components can be nested; this example has both a VCALENDAR and - a VEVENT component, one nested inside the other. - -\layout Standard - -The main goal of Libical is to offer a structured, type-safe to create, - access and manipulate components and their properties, values and parameters. - -\layout Subsection - -Core iCal classes -\layout Standard - -Libical is an object-based, data-oriented library. - There are no real-objects, but the way the routines are named and organized - results in the same sort of encapsulations and abstraction that are major - features of Object-Orieted languages. - Nearly all of the routines in the library are associated with an opaque - data types and perform some operation on that data type. - For instnace, a Property is declared as: -\layout LyX-Code - -icalproperty *prop; -\layout Standard - -Icalproperty is typedef'd to void, so the only way to manipulate it is through - the accessor routines, all of which have a form similar to: -\layout LyX-Code - -char* icalproperty_as_ical_string(icalproperty* prop); -\layout Standard - -That is, the name of the 'class' is the first word in the routine name, - and the first parameter is a pointer to the 'object.' -\layout Standard - -Although the library does not actually have classes, we will use those terms - since the behavior of these associations of data and routines is very similar - to a class. - -\layout Subsubsection - -Properties -\layout LyX-Code - -icalproperty *prop; -\layout Standard - -Properties are represented with the icalproperty class and its many -\begin_inset Quotes eld -\end_inset - -derived -\begin_inset Quotes erd -\end_inset - - classes with on -\begin_inset Quotes eld -\end_inset - -derived -\begin_inset Quotes erd -\end_inset - - class per property type in RFC2445. - Again, there is no actual inheritance relations, but there are clusters - of routines that make this term useful. - A property is a container for a single value and a set of parameters. - -\layout Subsubsection - -Components -\layout LyX-Code - -icalcomponent *comp; -\layout Standard - -In libical, components are represented with the icalcomponent class. - Icalcomponent is a container for a set of other components and properties. -\layout Subsubsection - -Values -\layout LyX-Code - -icalvalue *value; -\layout Standard - -Values are represented in a similar way to properties; a base class and - many -\begin_inset Quotes eld -\end_inset - -derived -\begin_inset Quotes eld -\end_inset - - classes. - A value is essentially a abstract handle on a single fundamental type, - a structure or a union. - You probably will never use a value directly, since for most operations - you can get to its data through the property that holds it. - -\layout Subsubsection - -Parameters -\layout LyX-Code - -icalparameter *param; -\layout Standard - -Parameters are represetned in a similar way to properties, except that they - contain only one value -\layout Subsection - -Other elements of libical -\layout Standard - -In addition to the core iCal classes, libical has many other types, structures, - classes that aid in creating and using iCal components. - -\layout Subsubsection - -Enumerations and types -\layout Standard - -Libical is strongly typed, so every component, property, parameter, and - value type has an enumeration, and some have an associated structure or - union. - -\layout Subsubsection - -The parser -\layout Standard - -The libical parser offers a variety of ways to convert RFC2445 text into - a libical iinsteral component structure. - the parser can parse blocks of text as a string, or it can parse lin-by-line. -\layout Subsubsection - -Error objects -\layout Standard - -Libical has a substantial error reporting system for both programming errors - and component usage errors. - -\layout Subsubsection - -Memory Management -\layout Standard - -Since many of libicals interfaces return strings, the library has its own - memory management system to elimiate the need to free every string returned - from the libraru. - -\layout Subsubsection - -Storage classes -\layout Standard - -The library also offers several classes to store components to flies, memory - or databases. - -\layout Section - -Differences From RFCs -\layout Standard - -Libical has been designed to follow the standards as closely as possible, - so that the key objects in the standards are also key objects in the library. - However, there are a few areas where the specifications are (arguably) - irregular, and following them exactly would result in an unfriendly interface. - These deviations make libical easier to use by maintaining a self-similar - interface. - -\layout Subsection - -Pseudo Components -\layout Standard - -Libical defines components for groups of properties that look and act like - components, but are not defined as components in the specification. - XDAYLIGHT and XSTANDARD are notable examples. - These pseudo components group properties within the VTIMEZONE components. - For instanace, the timezone properties associated with daylight savings - time starts with -\begin_inset Quotes eld -\end_inset - -BEGIN:DAYLIGHT -\begin_inset Quotes erd -\end_inset - - and ends with -\begin_inset Quotes eld -\end_inset - -END:DAYLIGHT, just like other components, but is not defined as a component - in RFC2445. - ( See RFC2445, page 61 ) In Libical,this grouping is represented by the - XDAYLIGHT component. - Standard iCAL components all start with the letter -\begin_inset Quotes eld -\end_inset - -V, -\begin_inset Quotes erd -\end_inset - - while pseudo components start with -\begin_inset Quotes erd -\end_inset - -X. -\begin_inset Quotes erd -\end_inset - - -\layout Standard - -There are also pseudo components that are conceptually derived classes of - VALARM. - RFC2446 defines what properties may be included in each component, and - for VALARM, the set of properties it may have depends on the value of the - ACTION property. - -\layout Standard - -For instance, if a VALARM component has an ACTION property with the value - of -\begin_inset Quotes eld -\end_inset - -AUDIO, -\begin_inset Quotes erd -\end_inset - - the component must also have an -\begin_inset Quotes eld -\end_inset - -ATTACH -\begin_inset Quotes erd -\end_inset - - property. - However, if the ACTION value is -\begin_inset Quotes eld -\end_inset - -DISPLAY, -\begin_inset Quotes erd -\end_inset - - the component must have a DESCRIPTION property. - -\layout Standard - -To handle these various, complex restrictions, libical has pseudo components - for each type of alarm: XAUDIOALARM, XDISPLAYALARM, XEMAILALARM and XPROCEDUREA -LARM. - -\layout Subsection - -Combined Values -\layout Standard - -Many values can take more than one type. - TRIGGER, for instance, can have a value type of with DURATION or of DATE-TIME. - These multiple types make it difficult to create routines to return the - value associated with a property. - -\layout Standard - -It is natural to have interfaces that would return the value of a property, - but it is cumbersome for a single routine to return multiple types. - So, in libical, properties that can have multiple types are given a single - type that is the union of their RFC2445 types. - For instance, in libical, the value of the TRIGGER property resolves to - struct icaltriggertype. - This type is a union of a DURATION and a DATE-TIME. - -\layout Subsection - -Multi-Valued Properties -\layout Standard - -Some properties, such as CATEGORIES have only one value type, but each CATEGORIE -S property can have multiple value instances. - This also results in a cumbersome interface -- CATEGORIES accessors would - have to return a list while all other accessors returned a single value. - In libical, all properties have a single value, and multi-valued properties - are broken down into multiple single valued properties during parsing. - That is, an input line like, -\layout LyX-Code - -CATEGORIES: work, home -\layout Standard - -becomes in libical's internal representation -\layout LyX-Code - -CATEGORIES: work -\layout LyX-Code - -CATEGORIES: home -\layout Standard - -Oddly, RFC2445 allows some multi-valued properties ( like FREEBUSY ) to - exist as both a multi-values property and as multiple single value properties, - while others ( like CATEGORIES ) can only exist as single multi-valued - properties. - This makes the internal representation for CATEGORIES illegal. - However when you convert a component to a string, the library will collect - all of the CATEGORIES properties into one. - -\layout Section - -Using libical -\layout Subsection - -Creating Components -\layout Standard - -There are three ways to create components in Libical: -\layout Itemize - -Create individual components, properties and parameters and assemble them - into structures -\layout Itemize - -Build complete components with nested vaargs calls -\layout Itemize - -Parse bits of text -\layout Itemize - -Parse entire files -\layout Subsubsection - -Constructor Interfaces -\layout Standard - -Using constructor interfaces, you create each of the objects separately - and then assemble them in to components: -\layout LyX-Code - -icalcomponent *event; -\layout LyX-Code - -icalproperty *prop; -\layout LyX-Code - -icalparameter *param; -\layout LyX-Code - -struct icaltimetype atime; -\layout LyX-Code - -\layout LyX-Code - -event = icalcomponent_new(ICAL_VEVENT_COMPONENT); -\layout LyX-Code - -prop = icalproperty_new_dtstamp(atime); -\layout LyX-Code - -icalcomponent_add_property(event, prop); -\layout LyX-Code - -\layout LyX-Code - -prop = icalproperty_new_uid(''guid-1.host1.com'') ); -\layout LyX-Code - -icalcomponent_add_property(event,prop); -\layout LyX-Code - -\layout LyX-Code - -prop=icalproperty_new_organizer(''mrbig@host.com''); -\layout LyX-Code - -param = icalparameter_new_role(ICAL_ROLE_CHAIR) -\layout LyX-Code - -icalproperty_add_parameter(prop, param); -\layout LyX-Code - -\layout LyX-Code - -icalcomponent_add_property(event,prop); -\layout Standard - -Notice that libical uses a semi-object-oriented style of interface. - Most things you work with are objects, that are instantiated with a constructor - that has -\begin_inset Quotes eld -\end_inset - -new -\begin_inset Quotes erd -\end_inset - - in the name. - Also note that, other than the object reference, most structure data is - passed in to libical routines by value. - Libical has some complex but very regular memory handling rules. - These are detailed in section -\begin_inset LatexCommand \ref{sec:memory} - -\end_inset - -. -\layout Standard - -If any of the constructors fail, they will return 0. - If you try to insert 0 into a property or component, or use a zero-valued - object reference, libical will either silently ignore the error or will - abort with an error message. - This behavior is controlled by a compile time flag (ICAL_ERRORS_ARE_FATAL), - and will abort by default. - -\layout Subsubsection - -vaargs Constructors -\layout Standard - -There is another way to create complex components, which is arguably more - elegant, if you are not horrified by varargs. - The varargs constructor interface allows you to create intricate components - in a single block of code. - Here is the previous examples in the vaargs style. - -\layout LyX-Code - - calendar = -\layout LyX-Code - - icalcomponent_vanew( -\layout LyX-Code - - ICAL_VCALENDAR_COMPONENT, -\layout LyX-Code - - icalproperty_new_version(''2.0''), -\layout LyX-Code - - icalproperty_new_prodid( -\layout LyX-Code - - ''-//RDU Software//NONSGML HandCal//EN''), -\layout LyX-Code - - icalcomponent_vanew( -\layout LyX-Code - - ICAL_VEVENT_COMPONENT, -\layout LyX-Code - - icalproperty_new_dtstamp(atime), -\layout LyX-Code - - icalproperty_new_uid(''guid-1.host1.com''), -\layout LyX-Code - - icalproperty_vanew_organizer( -\layout LyX-Code - - ''mrbig@host.com''), -\layout LyX-Code - - icalparameter_new_role(ICAL_ROLE_CHAIR), -\layout LyX-Code - - 0 -\layout LyX-Code - - ), -\layout LyX-Code - - icalproperty_vanew_attendee( -\layout LyX-Code - - ''employee-A@host.com'', -\layout LyX-Code - - icalparameter_new_role( -\layout LyX-Code - - ICAL_ROLE_REQPARTICIPANT), -\layout LyX-Code - - icalparameter_new_rsvp(1), -\layout LyX-Code - - icalparameter_new_cutype(ICAL_CUTYPE_GROUP), -\layout LyX-Code - - 0 -\layout LyX-Code - - ), -\layout LyX-Code - - icalproperty_new_location( -\layout LyX-Code - - "1CP Conference Room 4350"), -\layout LyX-Code - - 0 -\layout LyX-Code - - ), -\layout LyX-Code - - 0 -\layout LyX-Code - - ); -\layout Standard - -This form is similar to the constructor form , except that the constructors - have -\begin_inset Quotes eld -\end_inset - -vanew -\begin_inset Quotes erd -\end_inset - - instead of -\begin_inset Quotes eld -\end_inset - -new -\begin_inset Quotes erd -\end_inset - - in the name. - The arguments are similar too, except that the component constructor can - have a list of properties, and the property constructor can have a list - of parameters. - Be sure to terminate every list with a '0', or your code will crash, if - you are lucky. - -\layout Subsubsection - -Parsing Text -\layout Standard - -Several routines are available for generating objects from text. - For properties, use: -\layout LyX-Code - -icalproperty* p; -\layout LyX-Code - -p = icalproperty_new_from_string("DTSTART:19970101T120000Z -\backslash -n"); -\layout Standard - -For parameters, use: -\layout LyX-Code - -icalparameter *param -\layout LyX-Code - -param = icalparameter_new_from_string("PARTSTAT=ACCEPTED"); -\layout Standard - -The final way to create components will probably be the most common; you - can create components from RFC2445 compliant text. - If you have the string in memory, use -\layout LyX-Code - -icalcomponent* icalcomponent_new_from_string(char* str); -\layout Standard - -If the string contains only one component, the routine will return the component - in libical form. - If the string contains multiple components, the multiple components will - be returned as the children of an ICAL_XROOT_COMPONENT component. - This routine is identical to ( and actually uses ) icalparser_parse_string(char -* str). -\layout Standard - -Parsing a whole string may seem wasteful if you want to pull a large component - off of the network or from a file; you may prefer to parse the component - line by line. - This is possible too by using: -\layout LyX-Code - -icalparser* icalparser_new(); -\layout LyX-Code - -void icalparser_free(icalparser* parser); -\layout LyX-Code - -icalparser_get_line(parser,read_stream); -\layout LyX-Code - -icalparser_add_line(parser,line); -\layout LyX-Code - -icalparser_set_gen_data(parser,stream) -\layout Standard - -These routines will construct a parser object to which you can add lines - of input and retrieve any components that the parser creates from the input. - These routines work by specifing an adaptor routine to get string data - from a source. - For an example: -\layout LyX-Code - -char* read_stream(char *s, size_t size, void *d) -\layout LyX-Code - -{ -\layout LyX-Code - - char *c = fgets(s,size, (FILE*)d); -\layout LyX-Code - - return c; -\layout LyX-Code - -} -\layout LyX-Code - -main() { -\layout LyX-Code - - char* line; -\layout LyX-Code - - icalcomponent *c; -\layout LyX-Code - - icalparser *parser = icalparser_new(); -\layout LyX-Code - - FILE* stream = fopen(argv[1],"r"); -\layout LyX-Code - - icalparser_set_gen_data(parser,stream); -\layout LyX-Code - - do{ -\layout LyX-Code - - line = icalparser_get_line(parser,read_stream); -\layout LyX-Code - - c = icalparser_add_line(parser,line); -\layout LyX-Code - - if (c != 0){ -\layout LyX-Code - - printf("%s",icalcomponent_as_ical_string(c)); -\layout LyX-Code - - icalparser_claim(parser); -\layout LyX-Code - - printf(" -\backslash -n--------------- -\backslash -n"); -\layout LyX-Code - - icalcomponent_free(c); -\layout LyX-Code - - } -\layout LyX-Code - - } while ( line != 0); -\layout LyX-Code - -} -\layout Standard - -The parser object parameterizes the routine used to get input lines with - icalparser_set_gen_data() and -\emph on - -\emph default -icalparser_get_line(). - In this example, the routine read_stream() will fetch the next line from - a stream, with the stream passed in as the void* parameter d. - The parser calls read_stream() from icalparser_get_line(), but it also - needs to know what stream to use. - This is set by the call to icalparser_set_gen_data(). - By using a different routine for read_stream or passing in different data - with icalparser_set_gen_data, you can connect to any data source. - -\layout Standard - -Using the same mechanism, other implementations could read from memory buffers, - sockets or other interfaces. - -\layout Standard - -Since the example code is a very common way to use the parser, there is - a convenience routine; -\layout LyX-Code - -icalcomponent* icalparser_parse(icalparser *parser, -\layout LyX-Code - - char* (*line_gen_func)(char *s, size_t size, void* d)) -\layout Standard - -To use this routine, you still must construct the parser object and pass - in a reference to a line reading routine. - If the parser can create a single component from the input, it will return - a pointer to the newly constructed component. - If the parser can construct multiple components from the input, it will - return a reference to an XROOT component ( of type ICAL_XROOT_COMPONENT.) - This XROOT component will hold all of the components constructed from the - input as children. - -\layout Subsection - -Accessing Components -\layout Standard - -Given a reference to a component, you probably will want to access the propertie -s, parameters and values inside. - Libical interfaces let you find sub-components, add and remove sub-components, - and do the same three operations on properties. - -\layout Subsubsection - -Finding Components -\layout Standard - -To find a sub-component of a component, use: -\layout LyX-Code - -icalcomponent* icalcomponent_get_first_component( -\layout LyX-Code - - icalcomponent* component, -\layout LyX-Code - - icalcomponent_kind kind); -\layout Standard - -This routine will return a reference to the first component of the type - 'kind.' The key kind values, listed in icalenums.h are: -\layout LyX-Code - -ICAL_ANY_COMPONENT -\layout LyX-Code - -ICAL_VEVENT_COMPONENT -\layout LyX-Code - -ICAL_VTODO_COMPONENT -\layout LyX-Code - -ICAL_VJOURNAL_COMPONENT -\layout LyX-Code - -ICAL_VCALENDAR_COMPONENT -\layout LyX-Code - -ICAL_VFREEBUSY_COMPONENT -\layout LyX-Code - -ICAL_VALARM_COMPONENT -\layout Standard - -These are only the most common components; there are many more listed in - icalenums.h. -\layout Standard - -As you might guess, if there is more than one subcomponent of the type you - have chosen, this routine will return only the first. - to get at the others, you need to iterate through the component. - -\layout Subsubsection - -Iterating Through Components -\layout Standard - -Iteration requires a second routine to get the next subcomponent after the - first: -\layout LyX-Code - -icalcomponent* icalcomponent_get_next_component( -\layout LyX-Code - - icalcomponent* component, -\layout LyX-Code - - icalcomponent_kind kind); -\layout Standard - -With the 'first' and 'next' routines, you can create a for loop to iterate - through all of a components subcomponents -\layout LyX-Code - - for(c = icalcomponent_get_first_component(comp,ICAL_ANY_COMPONENT); -\layout LyX-Code - - c != 0; -\layout LyX-Code - - c = icalcomponent_get_next_component(comp,ICAL_ANY_COMPONENT)) -\layout LyX-Code - -{ -\layout LyX-Code - - do_something(c); -\layout LyX-Code - -} -\layout Standard - -This code bit wil iterate through all of the subcomponents in 'comp' but - you can select a specific type of component by changing ICAL_ANY_COMPONENT - to another component type. -\layout Subsubsection - -Using Component Iterators -\layout Standard - -The iteration model in the previous section requires the component to keep - the state of the iteration. - So, you could not use this model to perform a sorting operations, since - you'd need two iterators and there is only space for one. - If you ever call icalcomponent_get_first_component() when an iteration - is in progress, the pointer will be reset to the beginning. - -\layout Standard - -To solve this problem, there are also external iterators for components. - The routines associated with these external iterators are: -\layout LyX-Code - -icalcompiter icalcomponent_begin_component(icalcomponent* component, icalcompone -nt_kind kind); -\layout LyX-Code - -icalcompiter icalcomponent_end_component(icalcomponent* component, icalcomponent -_kind kind); -\layout LyX-Code - -icalcomponent* icalcompiter_next(icalcompiter* i); -\layout LyX-Code - -icalcomponent* icalcompiter_prior(icalcompiter* i); -\layout LyX-Code - -icalcomponent* icalcompiter_deref(icalcompiter* i); -\layout Standard - -The _begin_() and _end_() routines return a new iterator that points to - the beginning and ending of the list of subcomponent for the given component, - and the kind argument works like the kind argument for internal iterators. - -\layout Standard - -After creating an iterators, use _next_() and _prior_() to step forward - and backward through the list and get the component that the iterator points - to, and use _deref() to return the component that the iterator points to - without moving the iterator. - All routines will return 0 when they move to point off the end of the list. - -\layout Standard - -Here is an example of a loop using these routines: -\layout LyX-Code - -for( -\layout LyX-Code - - i = icalcomponent_begin_component(impl->cluster,ICAL_ANY_COMPONENT); - -\layout LyX-Code - - icalcompiter_deref(&i)!= 0; -\layout LyX-Code - - icalcompiter_next(&i) -\layout LyX-Code - -) { -\layout LyX-Code - - icalcomponent *this = icalcompiter_deref(&i); -\layout LyX-Code - -} -\layout Subsubsection - -Removing Components -\layout Standard - -Removing an element from a list while iterating through the list with the - internal iterators can cause problems, since you will probably be removing - the element that the internal iterator points to. - The _remove() routine will keep the iterator valid by moving it to the - next component, but in a normal loop, this will result in two advances - per iteration, and you will remove only every other component. - To avoid the problem, you will need to step the iterator ahead of the - element you are going to remove, like this: -\layout LyX-Code - -for(c = icalcomponent_get_first_component(parent_comp,ICAL_ANY_COMPONENT); - -\layout LyX-Code - - c != 0; -\layout LyX-Code - - c = next -\layout LyX-Code - -{ -\layout LyX-Code - - next = icalcomponent_get_next_component(parent_comp,ICAL_ANY_COMPONENT); -\layout LyX-Code - - icalcomponent_remove_component(parent_comp,c); -\layout LyX-Code - -} -\layout Standard - -Another way to remove components is to rely on the side effect of icalcomponent_ -remove_component: if component iterator in the parent component is pointing - to the child that will be removed, it will move the iterator to the component - after the child. - The following code will exploit this behavior: -\layout LyX-Code - -icalcomponent_get_first_component(parent_comp,ICAL_VEVENT_COMPONENT); -\layout LyX-Code - -while((c=icalcomponent_get_current_component(c)) != 0 ){ -\layout LyX-Code - - if(icalcomponent_isa(c) == ICAL_VEVENT_COMPONENT){ -\layout LyX-Code - - icalcomponent_remove_component(parent_comp,inner); -\layout LyX-Code - - } else { -\layout LyX-Code - - icalcomponent_get_next_component(parent_comp,ICAL_VEVENT_COMPONENT); - -\layout LyX-Code - - } -\layout LyX-Code - -} -\layout Subsubsection - -Working with properties and parameters -\layout Standard - -Finding, iterating and removing properties works the same as it does for - components, using the property-specific or parameter-specific interfaces: - -\layout LyX-Code - -icalproperty* icalcomponent_get_first_property( -\layout LyX-Code - - icalcomponent* component, -\layout LyX-Code - - icalproperty_kind kind); -\layout LyX-Code - -icalproperty* icalcomponent_get_next_property( -\layout LyX-Code - - icalcomponent* component, -\layout LyX-Code - - icalproperty_kind kind); -\layout LyX-Code - -void icalcomponent_add_property( -\layout LyX-Code - - icalcomponent* component, -\layout LyX-Code - - icalproperty* property); -\layout LyX-Code - -void icalcomponent_remove_property( -\layout LyX-Code - - icalcomponent* component, -\layout LyX-Code - - icalproperty* property); -\layout Standard - -For parameters: -\layout LyX-Code - -icalparameter* icalproperty_get_first_parameter( -\layout LyX-Code - - icalproperty* prop, -\layout LyX-Code - - icalparameter_kind kind); -\layout LyX-Code - -icalparameter* icalproperty_get_next_parameter( -\layout LyX-Code - - icalproperty* prop, -\layout LyX-Code - - icalparameter_kind kind); -\layout LyX-Code - -void icalproperty_add_parameter( -\layout LyX-Code - - icalproperty* prop, -\layout LyX-Code - - icalparameter* parameter); -\layout LyX-Code - -void icalproperty_remove_parameter( -\layout LyX-Code - - icalproperty* prop, -\layout LyX-Code - - icalparameter_kind kind); -\layout Standard - -Note that since there should be only one parameter of each type in a property, - you will rarely need to use icalparameter_get_nect_paameter. -\layout Subsubsection - -Working with values -\layout Standard - -Values are typically part of a property, although they can exist on their - own. - You can manipulate them either as part of the property or independently. -\layout Standard - -The most common way to work with values to is to manipulate them from they - properties that contain them. - This involves fewer routine calls and intermediate variables than working - with them independently, and it is type-safe. - -\layout Standard - -For each property, there are a _get_ and a _set_ routine that access the - internal value. - For instanace, for the UID property, the routines are: -\layout LyX-Code - -void icalproperty_set_uid(icalproperty* prop, const char* v) -\layout LyX-Code - -const char* icalproperty_get_uid(icalproperty* prop) -\layout Standard - -For multi-valued properties, like ATTACH, the value type is usually a struct - or union that holds both possible types. - -\layout Standard - -If you want to work with the underlying value object, you can get and set - it with: -\layout LyX-Code - -icalvalue* icalproperty_get_value (icalproperty* prop) -\layout LyX-Code - -void icalproperty_set_value(icalproperty* prop, icalvalue* value); -\layout Standard - -Icalproperty_get_value() will return a reference that you can manipulate - with other icalvalue routines. - Most of the time, you will have to know what the type of the value is. - For instance, if you know that the value is a DATETIME type, you can manipulate - it with: -\layout LyX-Code - -struct icaltimetype icalvalue_get_datetime(icalvalue* value); -\layout LyX-Code - -void icalvalue_set_datetime(icalvalue* value, struct icaltimetype v); -\layout Standard - -When working with an extension property or value (and X-PROPERTY or a property - that has the parameter VALUE=x-name ) the value type is always a string. - To get and set the value, use: -\layout LyX-Code - -void icalproperty_set_x(icalproperty* prop, char* v); -\layout LyX-Code - -char* icalproperty_get_x(icalproperty* prop); -\layout Standard - -All X properties have the type of ICAL_X_PROPERTY, so you will need these - routines to get and set the name of the property: -\layout LyX-Code - -char* icalproperty_get_x_name(icalproperty* prop) -\layout LyX-Code - -void icalproperty_set_x_name(icalproperty* prop, char* name); -\layout Subsubsection - -Checking Component Validity -\layout Standard - -RFC 2446 defines rules for what properties must exist in a component to - be used for transferring scheduling data. - Most of these rules relate to the existence of properties relative to the - METHOD property, which declares what operation a remote receiver should - use to process a component. - For instance, if the METHOD is REQUEST and the component is a VEVENT, the - sender is probably asking the receiver to join in a meeting. - In this case, RFC2446 says that the component must specify a start time - (DTSTART) and list the receiver as an attendee (ATTENDEE). - -\layout Standard - -Libical can check these restrictions with the routine: -\layout LyX-Code - -int icalrestriction_check(icalcomponent* comp); -\layout Standard - -This routine returns 0 if the component does not pass RFC2446 restrictions, - or if the component is malformed. - The component you pass in -\emph on -must -\emph default - be a VCALENDAR, with one or more children, like the examples in RFC2446. - -\layout Standard - -When this routine runs, it will insert new properties into the component - to indicate any errors it finds. - See section 6.5.3, X-LIC-ERROR for more information about these error properties. - -\layout Subsubsection - -Converting Components to Text -\layout Standard - -To create an RFC2445 compliant text representation of an object, use one - of the *_as_ical_string() routines: -\layout LyX-Code - -char* icalcomponent_as_ical_string (icalcomponent* component) -\layout LyX-Code - -char* icalproperty_as_ical_string (icalproperty* property) -\layout LyX-Code - -char* icalparameter_as_ical_string (icalparameter* parameter) -\layout LyX-Code - -char* icalvalue_as_ical_string (icalvalue* value) -\layout Standard - -In most cases, you will only use icalcomponent_as_ical_string (), since - it will cascade and convert all of the parameters, properties and values - that are attached to the root component. -\layout Standard - -Icalproperty_as_ical_string() will terminate each line with the RFC2445 - specified line terminator -\begin_inset Quotes eld -\end_inset - - -\backslash - -\backslash -n -\begin_inset Quotes erd -\end_inset - - However, if you compile with the symbol ICAL_UNIX_NEWLINE undefined, ( - it is defined by default) it will terminate lines with -\begin_inset Quotes eld -\end_inset - - -\backslash - -\backslash -n -\backslash - -\backslash -r -\begin_inset Quotes erd -\end_inset - - -\layout Standard - -Remember that the string returned by these routines is owned by the library, - and will eventually be re-written. - You should copy it if you want to preserve it. - -\layout Subsection - -Time -\layout Subsubsection - -Time structure -\layout Standard - -LIbical defines it's own time structure for storing all dates and times. - It would have been nice to re-use the C library's -\emph on -struct tm, -\emph default -but that structure does not differentiate between dates and times, and between - local time and UTC. - The libical structure is: -\layout LyX-Code - -struct icaltimetype { -\layout LyX-Code - - int year; -\layout LyX-Code - - int month; -\layout LyX-Code - - int day; -\layout LyX-Code - - int hour; -\layout LyX-Code - - int minute; -\layout LyX-Code - - int second; -\layout LyX-Code - - int is_utc; /* 1-> time is in UTC timezone */ -\layout LyX-Code - - int is_date; /* 1 -> interpret this as date. - */ }; -\layout Standard - -The year, month, day, hour, minute and second fields hold the broken-out - time values. - The is_utc field distinguishes between times in UTC and a local time zone. - The is_date field indicates if the time should be interpreted only as a - date. - If it is a date, the hour, minute and second fields are assumed to be zero, - regardless of their actual vaules. - -\layout Subsubsection - -Creating time structures -\layout Standard - -There are several ways to create a new icaltimetype structure: -\layout LyX-Code - -struct icaltimetype icaltime_from_string(const char* str); -\layout LyX-Code - -struct icaltimetype icaltime_from_timet(time_t v, int is_date); -\layout LyX-Code - -\layout Standard - -Icaltime_from_string takes any RFC2445 compliant time string: -\layout LyX-Code - -struct icaltimetype tt = icaltime_from_string("19970101T103000"); -\layout Standard - -Icaltime_from_timet takes a timet value, representing seconds past the POSIX - epoch, and a flag to indicate if the time is a date. - Dates have an identical structure to a time, but the time portion ( hours, - minuts and seconds ) is always 00:00:00. - Dates act differently in sorting an comparision, and they have a different - string representation in RFC2445. - -\layout Subsubsection - -Time manipulating routines -\layout Standard - -The null time value is used to indicate that the data in the structure is - not a valid time. -\layout LyX-Code - -struct icaltimetype icaltime_null_time(void); -\layout LyX-Code - -int icaltime_is_null_time(struct icaltimetype t); -\layout Standard - -It is sensible for the broken-out time fields to contain values that are - not permitted in an ISO compliant time string. - For instance, the seconds field can hold values greater than 59, and the - hours field can hold values larger than 24. - The excessive values will be rolled over into the next larger field when - the structure is normalized. - -\layout LyX-Code - -struct icaltimetype icaltime_normalize(struct icaltimetype t); -\layout Standard - -Normalizing allows you to do arithmetic operations on time values. - -\layout LyX-Code - -struct icaltimetype tt = icaltime_from_string( -\begin_inset Quotes eld -\end_inset - -19970101T103000 -\begin_inset Quotes erd -\end_inset - -); -\layout LyX-Code - -tt.days +=3 -\layout LyX-Code - -tt.second += 70; -\layout LyX-Code - -tt = icaltime_normalize(tt); -\layout Standard - -There are several routines to get the day of the week or month, etc, from - a time structure. -\layout LyX-Code - -short icaltime_day_of_year(struct icaltimetype t); -\layout LyX-Code - -struct icaltimetype icaltime_from_day_of_year(short doy, short year); -\layout LyX-Code - -short icaltime_day_of_week(struct icaltimetype t); -\layout LyX-Code - -short icaltime_start_doy_of_week(struct icaltimetype t); -\layout LyX-Code - -short icaltime_week_number(short day_of_month, short month, short year); -\layout LyX-Code - -struct icaltimetype icaltime_from_week_number(short week_number, short year); -\layout LyX-Code - -short icaltime_days_in_month(short month,short year); -\layout Standard - -Two routines convert time structures to and from the number of seconds since - the POSIX epoch. - The is_date field indicates whether or not the hour, minute and second - fields should be used in the conversion. -\layout LyX-Code - -struct icaltimetype icaltime_from_timet(time_t v, int is_date); -\layout LyX-Code - -time_t icaltime_as_timet(struct icaltimetype); -\layout Standard - -The compare routine works exactly like strcmp, but on time structures. - -\layout LyX-Code - -int icaltime_compare(struct icaltimetype a,struct icaltimetype b); -\layout Standard - -The following routines convert between UTC and a named timezone. - The tzid field must be a timezone name from the Olsen database, such as - -\begin_inset Quotes eld -\end_inset - -America/Los_Angeles. -\begin_inset Quotes erd -\end_inset - - -\layout Standard - -The utc_offset routine returns the offset of the named time zone from UTC, - in seconds. - -\layout Standard - -The tt parameter in the following routines indicates the date on which the - conversion should be made. - The tt parameter is necessary because timezones have many different rules - for when daylight savings time is used, and these rules can change over - time. - So, for a single timezone one year may have daylight savings time on March - 15, but for other years March 15 may be standard time, and some years may - have standard time all year. - -\layout LyX-Code - -int icaltime_utc_offset(struct icaltimetype tt, char* tzid); -\layout LyX-Code - -int icaltime_local_utc_offset(); -\layout LyX-Code - -struct icaltimetype icaltime_as_utc(struct icaltimetype tt,char* tzid); -\layout LyX-Code - -struct icaltimetype icaltime_as_zone(struct icaltimetype tt,char* tzid); -\layout LyX-Code - -struct icaltimetype icaltime_as_local(struct icaltimetype tt); -\layout Subsection - -Storing Objects -\layout Standard - -The libical distribution includes a separate library, libicalss, that allows - you to store iCal component data to disk in a variety of ways. - This library also includes code to implement the CSTP protocol of CAP and - has some routines for deciphering incomming messages. - -\layout Standard - -The file storage routines are organized in an inheritance heirarchy that - is rooted in icalset, with the derived class icalfileset and icaldirset. - Icalfileset stores components to a file, while icaldirset stores components - to multiple files, one per month based on DTSTAMP. - Other storages classess, for storage to a heap or a mysql database are - planned for the future. - -\layout Standard - -All of the icalset derived classes have the same interface: -\layout LyX-Code - -\layout LyX-Code - -icaldirset* icaldirset_new(const char* path); -\layout LyX-Code - -void icaldirset_free(icaldirset* store); -\layout LyX-Code - -const char* icaldirset_path(icaldirset* store); -\layout LyX-Code - -void icaldirset_mark(icaldirset* store); -\layout LyX-Code - -icalerrorenum icaldirset_commit(icaldirset* store); -\layout LyX-Code - -icalerrorenum icaldirset_add_component(icaldirset* store, icalcomponent* - comp); -\layout LyX-Code - -icalerrorenum icaldirset_remove_component(icaldirset* store, icalcomponent* - comp); -\layout LyX-Code - -int icaldirset_count_components(icaldirset* store, icalcomponent_kind kind); -\layout LyX-Code - -icalerrorenum icaldirset_select(icaldirset* store, icalcomponent* gauge); -\layout LyX-Code - -void icaldirset_clear(icaldirset* store); -\layout LyX-Code - -icalcomponent* icaldirset_fetch(icaldirset* store, const char* uid); -\layout LyX-Code - -int icaldirset_has_uid(icaldirset* store, const char* uid); -\layout LyX-Code - -icalcomponent* icaldirset_fetch_match(icaldirset* set, icalcomponent *c); -\layout LyX-Code - -icalerrorenum icaldirset_modify(icaldirset* store, icalcomponent *oldc, - icalcomponent *newc); -\layout LyX-Code - -icalcomponent* icaldirset_get_current_component(icaldirset* store); -\layout LyX-Code - -icalcomponent* icaldirset_get_first_component(icaldirset* store); -\layout LyX-Code - -icalcomponent* icaldirset_get_next_component(icaldirset* store); -\layout Subsubsection - -Creating a new set -\layout Standard - -You can create a new set from either the base class or the direved class. - From the base class use one of: -\layout LyX-Code - -icalset* icalset_new_file(const char* path); -\layout LyX-Code - -icalset* icalset_new_dir(const char* path); -\layout LyX-Code - -icalset* icalset_new_heap(void); -\layout LyX-Code - -icalset* icalset_new_mysql(const char* path); -\layout Standard - -You can also create a new set based on the derived class, For instance, - with icalfileset: -\layout LyX-Code - -icalfileset* icalfileset_new(const char* path); -\layout LyX-Code - -icalfileset* icalfileset_new_open(const char* path, int flags, mode_t mode); -\layout Standard - -Icaset_new_file is identical to icalfileset_new. - BOth routines will open an existing file for readinga and writing, or create - a new file if it does not exist. - Icalfilset_new_open takes the same arguments as the open() system routine - and behaves in the same way. - -\layout Standard - -The icalset and icalfilset objects are somewhat interchangable -- you can - use an icalfileset* as an argument to any of the icalset routines. -\layout Standard - -The following examples will all use icalfileset routines; using the other - icalset derived classess will be similar. - -\layout Subsubsection - -Adding, Finding and Removing Components -\layout Standard - -To add components to a set, use: -\layout LyX-Code - -icalerrorenum icalfileset_add_component(icalfileset* cluster, icalcomponent* - child); -\layout Standard - -The fileset keeps an inmemory copy of the components, and this set must - be written back to the file ocassionally. - There are two routines to manage this: -\layout LyX-Code - -void icalfileset_mark(icalfileset* cluster); -\layout LyX-Code - -icalerrorenum icalfileset_commit(icalfileset* cluster); -\layout Standard - -Icalfileset_mark indicates that the in-memory components have changed. - Calling the _add_component routine will call _mark automatically, but you - may need to call it yourself if you have made a change to an existing component. - The _commit routine writes the data base to disk, but only if it is marked. - The _commit routine is called automatically when the icalfileset is freed. - -\layout Standard - -To iterate through the components in a set, use: -\layout LyX-Code - -icalcomponent* icalfileset_get_first_component(icalfileset* cluster); -\layout LyX-Code - -icalcomponent* icalfileset_get_next_component(icalfileset* cluster); -\layout LyX-Code - -icalcomponent* icalfileset_get_current_component (icalfileset* cluster); - -\layout Standard - -These routines work like the corresponding routines from icalcomponent, - except that their output is filtered through a gauge. - A gauge is a test for the properties within a components; only components - that pass the test are returned. - A gauge can be constructed from a MINSQL string with: -\layout LyX-Code - -icalgauge* icalgauge_new_from_sql(char* sql); -\layout Standard - -Then, you can add the gauge to the set with : -\layout LyX-Code - -icalerrorenum icalfileset_select(icalfileset* store, icalgauge* gauge); -\layout Standard - -Here is an example that puts all of these routines together: -\layout LyX-Code - - -\latex no_latex -void test_fileset() -\layout LyX-Code - - -\latex no_latex -{ -\layout LyX-Code - - -\latex no_latex - icalfileset *fs; -\layout LyX-Code - - -\latex no_latex - icalcomponent *c; -\layout LyX-Code - - -\latex no_latex - int i; -\layout LyX-Code - - -\latex no_latex - char *path = "test_fileset.ics"; -\layout LyX-Code - - -\latex no_latex - icalgauge *g = icalgauge_new_from_sql( -\layout LyX-Code - - -\latex no_latex - "SELECT * FROM VEVENT WHERE DTSTART > '20000103T120000Z' AND DTSTART - <= '20000106T120000Z'"); -\layout LyX-Code - - -\latex no_latex - -\layout LyX-Code - - -\latex no_latex -fs = icalfileset_new(path); -\layout LyX-Code - - -\layout LyX-Code - - -\latex no_latex -for (i = 0; i!= 10; i++){ -\layout LyX-Code - - -\latex no_latex - c = make_component(i); -\latex default - /* Make a new component where DTSTART has month of i */ -\layout LyX-Code - - -\latex no_latex - icalfileset_add_component(fs,c); -\layout LyX-Code - - -\latex no_latex - } -\layout LyX-Code - -\layout LyX-Code - - -\latex no_latex - icalfileset_commit(fs); -\latex default - /* Write to disk */ -\layout LyX-Code - -\layout LyX-Code - - -\latex no_latex - icalfileset_select(fs,g); -\latex default - /* Set the gauge to filter components */ -\layout LyX-Code - - -\latex no_latex - -\layout LyX-Code - - -\latex no_latex - for (c = icalfileset_get_first_component(fs); -\layout LyX-Code - - -\latex no_latex - c != 0; -\layout LyX-Code - - -\latex no_latex - c = icalfileset_get_next_component(fs)){ -\layout LyX-Code - - -\latex no_latex - struct icaltimetype t = icalcomponent_get_dtstart(c); -\layout LyX-Code - - -\latex no_latex - -\layout LyX-Code - - -\latex no_latex - printf("%s -\backslash -n",icaltime_as_ctime(t)); -\layout LyX-Code - - -\latex no_latex - } -\layout LyX-Code - - -\latex no_latex -icalfileset_free(fs); -\layout LyX-Code - - -\latex no_latex -} -\layout Subsubsection - -Other routines -\layout Standard - -There are several other routines in the icalset interface, but they not - fully implemented yet. - -\layout Subsection - - -\begin_inset LatexCommand \label{sec:memory} - -\end_inset - -Memory Management -\layout Standard - -Libical relies heavily on dynamic allocation for both the core objects and - for the strings used to hold values. - Some of this memory the library caller owns and must free, and some of - the memory is managed by the library. - Here is a summary of the memory rules. - -\layout Description - -1) If the function name has "new" in it, the caller gets control of the - memory. - ( such as icalcomponent_new(), or icalproperty_new_clone() ) -\layout Description - -2) If you got the memory from a routine with new in it, you must call the - corresponding *_free routine to free the memory. - ( Use icalcomponent_free() to free objects created with icalcomponent_new()) - -\layout Description - -3) If the function name has "add" in it, the caller is transferring control - of the memory to the routine. - ( icalproperty_add_parameter() ) -\layout Description - -4) If the function name has "remove" in it, the caller passes in a pointer - to an object and after the call returns, the caller owns the object. - So, before you call icalcomponent_remove_property(comp,foo), you do not - own "foo" and after the call returns, you do. - -\layout Description - -5) If the routine returns a string, libical owns the memory and will put - it on a ring buffer to reclaim later. - For example, icalcomponent_as_ical_string(). - You'd better strdup() it if you want to keep it, and you don't have to - delete it. - -\layout Subsection - -Error Handling -\layout Standard - -Libical has several error handling mechanisms for the various types of programmi -ng, semantic and syntactic errors you may encounter. -\layout Subsubsection - -Return values -\layout Standard - -Many library routines signal errors through their return values. - All routines that return a pointer, such as icalcomponent_new(), will return - 0 ( zero ) on a fatal error. - Some routines will return a value of enum icalerrorenum. - -\layout Subsubsection - -icalerrno -\layout Standard - -Most routines will set the global error value icalerrno on errors. - This variable is an enumeration; permissible values can be found in libical/ica -lerror.h. - If the routine returns an enum icalerrorenum, then the return value will - be the same as icalerrno. - You can use icalerror_strerror() to get a string that describes the error. - The enumerations are: -\layout Standard -\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable -multicol5 -12 2 0 0 -1 -1 -1 -1 -1 1 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 0 0 0 -1 1 0 0 -2 1 0 "" "" -2 1 1 "" "" -0 8 1 0 0 0 0 "" "" -0 8 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" - - -\newline - -\newline -ICAL_BADARG_ERROR -\newline -One of the argument to a routine was bad. - Typically for a null pointer. -\newline -ICAL_NEWFAILED_ERROR -\newline -A new() or malloc() failed -\newline -ICAL_MALFORMEDDATA_ERROR -\newline -An input string was not in the correct format -\newline -ICAL_PARSE_ERROR -\newline -the parser failed to parse an incomming component -\newline -ICAL_INTERNAL_ERROR -\newline -Largely equivalent to an assert; it indicates a bug in the libical code -\newline -ICAL_FILE_ERROR -\newline -A file operation failed. - Check errno for more detai -\newline -ICAL_ALLOCATION_ERROR -\newline - -\newline -ICAL_NO_ERROR -\newline -No error has occured -\newline -ICAL_TIMEDOUT_ERROR -\newline -Failed to acquire a lock on a file, or the CSTP protocol timed out. - -\newline -ICAL_MULTIPLEINCLUSION_ERROR -\newline - -\newline -ICAL_UNKNOWN_ERROR -\newline - -\layout Subsubsection - -X-LIC-ERROR and X-LIC-INVALID-COMPONENT -\layout Standard - -The library handles semantic and syntactic errors in components by inserting - errors properties into the components. - If the parser cannot parse incoming text ( a syntactic error ) or if the - icalrestriction_check() routine indicates that the component does not meet - the requirements of RFC2446 ( a semantic error) the library will insert - properties of the type X-LIC-ERROR to describe the error. - Here is an example of the error property: -\layout LyX-Code - -X-LIC-ERROR;X-LIC-ERRORTYPE=INVALID_ITIP :Failed iTIP restrictions for property - DTSTART. - -\layout LyX-Code - -Expected 1 instances of the property and got 0 -\layout Standard - -This error resulted from a call to icalrestriction_check(), which discovered - that the component does not have a DTSTART property, as required by RFC2445. - -\layout Standard - -There are a few routines to manipulate error properties: -\layout Standard -\LyXTable -multicol5 -10 2 0 0 -1 -1 -1 -1 -1 1 0 0 -0 0 0 0 -0 1 1 0 -0 0 0 0 -0 1 1 0 -0 1 0 0 -0 1 1 0 -0 1 0 0 -0 1 1 0 -0 1 1 0 -2 1 1 "" "" -2 1 1 "3in" "" -0 2 1 1 0 0 0 "" "" -0 8 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 1 0 1 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 1 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 1 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 1 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 1 1 0 1 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 1 1 0 1 "" "" -0 2 1 0 0 0 0 "" "" -0 2 1 1 0 0 1 "" "" - -Routine -\newline -Purpose -\newline -void icalrestriction_check() -\newline -Check a component against RFC2446 and insert -\newline - -\newline -error properties to indicate non compliance -\newline -int icalcomponent_count_errors() -\newline -Return the number of error properties -\newline - -\newline -in a component -\newline -void icalcomponent_strip_errors() -\newline -Remove all error properties in as -\newline - -\newline -component -\newline -void icalcomponent_convert_errors() -\newline -Convert some error properties into -\newline - -\newline -REQUESTS-STATUS proprties to indicate the inability to -\newline - -\newline -process the component as an iTIP request. - -\layout Standard - -The types of errors are listed in icalerror.h. - They are: -\layout LyX-Code - -ICAL_XLICERRORTYPE_COMPONENTPARSEERROR -\layout LyX-Code - -ICAL_XLICERRORTYPE_PARAMETERVALUEPARSEERROR -\layout LyX-Code - -ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR -\layout LyX-Code - -ICAL_XLICERRORTYPE_PROPERTYPARSEERROR -\layout LyX-Code - -ICAL_XLICERRORTYPE_VALUEPARSEERROR -\layout LyX-Code - -ICAL_XLICERRORTYPE_UNKVCALPROP -\layout LyX-Code - -ICAL_XLICERRORTYPE_INVALIDITIP -\layout Standard - -The libical parser will generate the error that end in PARSEERROR when it - encounters garbage in the input steam. - ICAL_XLICERRORTYPE_INVALIDITIP is inserted by icalrestriction_check(), - and ICAL_XLICERRORTYPE_UNKVCALPROP is generated by icalvcal_convert() when - it encounters a vCal property that it cannot convert or does not know about. - -\layout Standard - -Icalcomponent_convert_errors() converts some of the error properties in - a component into REQUEST-STATUS properties that indicate a failure. - As of libical version0.18, this routine only convert *PARSEERROR errors - and it always generates a 3.x ( failure ) code. - This makes it more of a good idea than a really useful bit of code. - -\layout Subsubsection - -ICAL_ERRORS_ARE_FATAL and icalerror_errors_are_fatal -\layout Standard - -If the global variable icalerror_errors_are_fatal is set to 1, then any - error condition will cause the program to abort. - The abort occurs in icalerror_set_errno(), and is done with an assert(0) - if NDEBUG is undefined, and with icalerror_crash_here if NDEBUG is defined. - The default value of icalerror_errors_are_fatal is 1 when ICAL_ERRORS_ARE_FATAL - is defined, and 0 otherwise. - Since ICAL_ERRORS_ARE_FATAL is defined by default, icalerror_errors_are_fatal - is also defined by default. - -\layout Subsection - -Naming Standard -\layout Standard - -Structures that you access with the -\begin_inset Quotes eld -\end_inset - -struct -\begin_inset Quotes erd -\end_inset - - keyword, such as -\begin_inset Quotes eld -\end_inset - -struct icaltimetype -\begin_inset Quotes erd -\end_inset - - are things that you are allowed to see inside and poke at. - -\layout Standard - -Structures that you access though a typedef, such as -\begin_inset Quotes eld -\end_inset - -icalcomponent -\begin_inset Quotes erd -\end_inset - - are things where all of the data is hidden. - -\layout Standard - -Component names that start with -\begin_inset Quotes eld -\end_inset - -V -\begin_inset Quotes erd -\end_inset - - are part of RFC 2445 or another iCal standard. - Component names that start with -\begin_inset Quotes eld -\end_inset - -X -\begin_inset Quotes erd -\end_inset - - are also part of the spec, but they are not actually components in the - spec. - However, they look and act like components, so they are components in libical. - Names that start with -\begin_inset Quotes eld -\end_inset - -XLIC -\begin_inset Quotes erd -\end_inset - - or -\begin_inset Quotes eld -\end_inset - -X-LIC -\begin_inset Quotes erd -\end_inset - - are not part of any iCal spec. - They are used internally by libical. - -\layout Standard - -Enums that identify a component, property, value or parameter end with -\begin_inset Quotes eld -\end_inset - -_COMPONENT, -\begin_inset Quotes erd -\end_inset - - -\begin_inset Quotes eld -\end_inset - -_PROPERTY, -\begin_inset Quotes erd -\end_inset - - -\begin_inset Quotes eld -\end_inset - -_VALUE, -\begin_inset Quotes erd -\end_inset - - or -\begin_inset Quotes eld -\end_inset - -_PARAMETER -\begin_inset Quotes erd -\end_inset - -s -\layout Standard - -Enums that identify a parameter value have the name of the parameter as - the second word. - For instance: ICAL_ROLE_REQPARTICIPANT or ICAL_PARTSTAT_ACCEPTED. -\layout Standard - -The enums for the parts of a recurarance rule and request statuses are irregular. - -\layout Section - -Hacks and Bugs -\layout Standard - -There are a lot of hacks in the library -- bits of code that I am not proud - of and should probably be changed. - These are marked with the comment string -\begin_inset Quotes eld -\end_inset - -HACK. -\begin_inset Quotes erd -\end_inset - - -\the_end diff --git a/other-licenses/libical/examples/Makefile.in b/other-licenses/libical/examples/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/examples/access_components.c b/other-licenses/libical/examples/access_components.c index cc5a33d6d25..e69de29bb2d 100644 --- a/other-licenses/libical/examples/access_components.c +++ b/other-licenses/libical/examples/access_components.c @@ -1,319 +0,0 @@ -/* Access_component.c */ - -#include "ical.h" - -#include -#include /* for strdup */ -#include /* for malloc */ -#include /* for printf */ -#include /* for time() */ -#include "icalmemory.h" - -void do_something(icalcomponent *c); - -/* Creating iCal Components - - There are two ways to create new component in libical. You can - build the component from primitive parts, or you can create it - from a string. - - There are two variations of the API for building the component from - primitive parts. In the first variation, you add each parameter and - value to a property, and then add each property to a - component. This results in a long series of function calls. This - style is show in create_new_component() - - The second variation uses vargs lists to nest many primitive part - constructors, resulting in a compact, neatly formated way to create - components. This style is shown in create_new_component_with_va_args() - - - -*/ - -icalcomponent* create_new_component() -{ - - /* variable definitions */ - icalcomponent* calendar; - icalcomponent* event; - struct icaltimetype atime = icaltime_from_timet( time(0),0); - struct icalperiodtype rtime; - icalproperty* property; - - /* Define a time type that will use as data later. */ - rtime.start = icaltime_from_timet( time(0),0); - rtime.end = icaltime_from_timet( time(0),0); - rtime.end.hour++; - - /* Create calendar and add properties */ - - calendar = icalcomponent_new(ICAL_VCALENDAR_COMPONENT); - - /* Nearly every libical function call has the same general - form. The first part of the name defines the 'class' for the - function, and the first argument will be a pointer to a struct - of that class. So, icalcomponent_ functions will all take - icalcomponent* as their first argument. */ - - /* The next call creates a new proeprty and immediately adds it to the - 'calendar' component. */ - - icalcomponent_add_property( - calendar, - icalproperty_new_version("2.0") - ); - - - /* Here is the short version of the memory rules: - - If the routine name has "new" in it: - Caller owns the returned memory. - If you pass in a string, the routine takes the memory. - - If the routine name has "add" in it: - The routine takes control of the component, property, - parameter or value memory. - - If the routine returns a string ( "get" and "as_ical_string" ) - The library owns the returned memory. - - There are more rules, so refer to the documentation for more - details. - - */ - - icalcomponent_add_property( - calendar, - icalproperty_new_prodid("-//RDU Software//NONSGML HandCal//EN") - ); - - /* Add an event */ - - event = icalcomponent_new(ICAL_VEVENT_COMPONENT); - - icalcomponent_add_property( - event, - icalproperty_new_dtstamp(atime) - ); - - /* In the previous call, atime is a struct, and it is passed in by value. - This is how all compound types of values are handled. */ - - icalcomponent_add_property( - event, - icalproperty_new_uid("guid-1.host1.com") - ); - - /* add a property that has parameters */ - property = icalproperty_new_organizer("mailto:mrbig@host.com"); - - icalproperty_add_parameter( - property, - icalparameter_new_role(ICAL_ROLE_CHAIR) - ); - - icalcomponent_add_property(event,property); - - /* In this style of component creation, you need to use an extra - call to add parameters to properties, but the form of this - operation is the same as adding a property to a component */ - - /* add another property that has parameters */ - property = icalproperty_new_attendee("mailto:employee-A@host.com"); - - icalproperty_add_parameter( - property, - icalparameter_new_role(ICAL_ROLE_REQPARTICIPANT) - ); - - icalproperty_add_parameter( - property, - icalparameter_new_rsvp(1) - ); - - icalproperty_add_parameter( - property, - icalparameter_new_cutype(ICAL_CUTYPE_GROUP) - ); - - icalcomponent_add_property(event,property); - - - /* more properties */ - - icalcomponent_add_property( - event, - icalproperty_new_description("Project XYZ Review Meeting") - ); - - icalcomponent_add_property( - event, - icalproperty_new_categories("MEETING") - ); - - icalcomponent_add_property( - event, - icalproperty_new_class("PUBLIC") - ); - - icalcomponent_add_property( - event, - icalproperty_new_created(atime) - ); - - icalcomponent_add_property( - event, - icalproperty_new_summary("XYZ Project Review") - ); - - property = icalproperty_new_dtstart(atime); - - icalproperty_add_parameter( - property, - icalparameter_new_tzid("US-Eastern") - ); - - icalcomponent_add_property(event,property); - - - property = icalproperty_new_dtend(atime); - - icalproperty_add_parameter( - property, - icalparameter_new_tzid("US-Eastern") - ); - - icalcomponent_add_property(event,property); - - icalcomponent_add_property( - event, - icalproperty_new_location("1CP Conference Room 4350") - ); - - icalcomponent_add_component(calendar,event); - - return calendar; -} - - -/* Now, create the same component as in the previous routine, but use -the constructor style. */ - -icalcomponent* create_new_component_with_va_args() -{ - - /* This is a similar set up to the last routine */ - icalcomponent* calendar; - struct icaltimetype atime = icaltime_from_timet( time(0),0); - struct icalperiodtype rtime; - - rtime.start = icaltime_from_timet( time(0),0); - rtime.end = icaltime_from_timet( time(0),0); - rtime.end.hour++; - - /* Some of these routines are the same as those in the previous - routine, but we've also added several 'vanew' routines. These - 'vanew' routines take a list of properties, parameters or - values and add each of them to the parent property or - component. */ - - calendar = - icalcomponent_vanew( - ICAL_VCALENDAR_COMPONENT, - icalproperty_new_version("2.0"), - icalproperty_new_prodid("-//RDU Software//NONSGML HandCal//EN"), - icalcomponent_vanew( - ICAL_VEVENT_COMPONENT, - icalproperty_new_dtstamp(atime), - icalproperty_new_uid("guid-1.host1.com"), - icalproperty_vanew_organizer( - "mailto:mrbig@host.com", - icalparameter_new_role(ICAL_ROLE_CHAIR), - 0 - ), - icalproperty_vanew_attendee( - "mailto:employee-A@host.com", - icalparameter_new_role(ICAL_ROLE_REQPARTICIPANT), - icalparameter_new_rsvp(1), - icalparameter_new_cutype(ICAL_CUTYPE_GROUP), - 0 - ), - icalproperty_new_description("Project XYZ Review Meeting"), - - icalproperty_new_categories("MEETING"), - icalproperty_new_class("PUBLIC"), - icalproperty_new_created(atime), - icalproperty_new_summary("XYZ Project Review"), - icalproperty_vanew_dtstart( - atime, - icalparameter_new_tzid("US-Eastern"), - 0 - ), - icalproperty_vanew_dtend( - atime, - icalparameter_new_tzid("US-Eastern"), - 0 - ), - icalproperty_new_location("1CP Conference Room 4350"), - 0 - ), - 0 - ); - - - /* Note that properties with no parameters can use the regular - 'new' constructor, while those with parameters use the 'vanew' - constructor. And, be sure that the last argument in the 'vanew' - call is a zero. Without, your program will probably crash. */ - - return calendar; -} - - -void find_sub_components(icalcomponent* comp) -{ - icalcomponent *c; - - /* The second parameter to icalcomponent_get_first_component - indicates the type of component to search for. This will - iterate through all sub-components */ - for(c = icalcomponent_get_first_component(comp,ICAL_ANY_COMPONENT); - c != 0; - c = icalcomponent_get_next_component(comp,ICAL_ANY_COMPONENT)){ - - do_something(c); - } - - /* This will iterate only though VEVENT sub-components */ - - for(c = icalcomponent_get_first_component(comp,ICAL_VEVENT_COMPONENT); - c != 0; - c = icalcomponent_get_next_component(comp,ICAL_VEVENT_COMPONENT)){ - - do_something(c); - } - -} - -/* Ical components only have one internal iterator, so removing the - object that the iterator points to can cause problems. Here is the - right way to remove components */ - -void remove_vevent_sub_components(icalcomponent* comp){ - - icalcomponent *c, *next; - - for( c = icalcomponent_get_first_component(comp,ICAL_VEVENT_COMPONENT); - c != 0; - c = next) - { - next = icalcomponent_get_next_component(comp,ICAL_VEVENT_COMPONENT); - - icalcomponent_remove_component(comp,c); - - do_something(c); - } - -} - diff --git a/other-licenses/libical/install-sh b/other-licenses/libical/install-sh deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/ltconfig b/other-licenses/libical/ltconfig deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/ltmain.sh b/other-licenses/libical/ltmain.sh deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/missing b/other-licenses/libical/missing deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/mkinstalldirs b/other-licenses/libical/mkinstalldirs deleted file mode 100755 index 0f3aab2b60e..00000000000 --- a/other-licenses/libical/mkinstalldirs +++ /dev/null @@ -1,40 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -# $Id: mkinstalldirs,v 1.1 2001-11-15 19:26:24 mikep%oeone.com Exp $ - -errstatus=0 - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# mkinstalldirs ends here diff --git a/other-licenses/libical/scripts/Makefile.in b/other-licenses/libical/scripts/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/scripts/mkderivedcomponents.pl b/other-licenses/libical/scripts/mkderivedcomponents.pl index ac4e4722507..e69de29bb2d 100755 --- a/other-licenses/libical/scripts/mkderivedcomponents.pl +++ b/other-licenses/libical/scripts/mkderivedcomponents.pl @@ -1,170 +0,0 @@ -#!/usr/local/bin/perl - -use Getopt::Std; -getopts('chspi:'); - - -# ARG 0 is components.txt -open(PV,"$ARGV[0]") || die "Can't open components file $ARGV[0]:$!"; - -my @components; - -while (){ - - s/#.*//; - - chop; - - push(@components,$_); - -} - -close PV; - -# Write the file inline by copying everything before a demarcation -# line, and putting the generated data after the demarcation - -if ($opt_i) { - - open(IN,$opt_i) || die "Can't open input file \"$opt_i\""; - - while(){ - - if (/Do not edit/){ - last; - } - - print; - - } - - if($opt_i){ - print "# Everything below this line is machine generated. Do not edit. \n"; - } else { - print "/* Everything below this line is machine generated. Do not edit. */\n"; - } - -} - -if ($opt_c or $opt_h and !$opt_i){ - -print < /* for va_arg functions */ - -EOM - -} - -if ($opt_p and !$opt_i){ - -print <data.v_$union_data = $assign \n }\n"; + print "\n\ + impl->data.v_$union_data = $assign \n\ + icalvalue_reset_kind(impl);\n}\n"; print "$type\ icalvalue_get_${lc}(icalvalue* value)\ {\n\ icalerror_check_arg( (value!=0),\"value\");\ diff --git a/other-licenses/libical/scripts/mkrestrictionrecords.pl b/other-licenses/libical/scripts/mkrestrictionrecords.pl index e2c62ae7484..e69de29bb2d 100755 --- a/other-licenses/libical/scripts/mkrestrictionrecords.pl +++ b/other-licenses/libical/scripts/mkrestrictionrecords.pl @@ -1,109 +0,0 @@ -#!/usr/bin/perl - -# Version: 1.0 -# Script last updated: 30May1999 GMD -# Change log: -# - -# usually open restrictions.csv -open(F,"$ARGV[0]") || die "Can't open restriction file $ARGV[0]:$!"; - -print <) -{ - chop; - - # split line at commas - my ($method,$component,$property,$subcomponent,$restriction)=split(/\,/,$_); - - # - #put in code to generate comments here! - # - if ($method ne $last_method) - { - $need_header = 1; - $last_method = $method; - } - if ($component ne $last_component) - { - $need_header = 1; - $last_component = $component; - } - - if ($need_header) - { - print "\n\t/* METHOD: ${method}, COMPONENT: ${component} */\n"; - $need_header = 0; - } - - foreach $item ($component,$property,$subcomponent,$restriction) - { - # handle special cases. - if ($item eq "NONE") - { $item = "NO"; } - else { if (substr($item,0,1) eq "X") - { $item = "X"; }} - - # strip out dashes - $item = join("",split(/-/,$item)); - } - # strip leading V from component names - $component =~ s/^(V?)(\w+?)((SAVINGS)?)((TIME)?)$/$2/; - $subcomponent =~ s/^V(\w+)/$1/; - - print "\t\{ICAL_METHOD_${method},ICAL_${component}_COMPONENT,"; - print "ICAL_${property}_PROPERTY,ICAL_${subcomponent}_COMPONENT,"; - print "ICAL_RESTRICTION_${restriction}\},\n"; - -} - -print <){ - - if (/Do not edit/){ - last; - } - - print; - - } - - print "/* Everything below this line is machine generated. Do not edit. */\n"; - - - close IN; -} - -# First build the property restriction table -print "icalrestriction_property_record icalrestriction_property_records[] = {\n"; - -while() -{ - - chop; - - s/\#.*$//; - - my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_); - - next if !$method; - - if(!$sub) { - $sub = "0"; - } else { - $sub = "icalrestriction_".$sub; - } - - if($prop ne "NONE"){ - print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${prop}_PROPERTY,ICAL_RESTRICTION_${restr},$sub},\n"); - } - -} - - -# Print the terminating line -print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE}\n"; - -print "};\n"; - -print "icalrestriction_component_record icalrestriction_component_records[] = {\n"; - - -# Go back through the entire file and build the component restriction table -close(F); -open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!"; - -while() -{ - - chop; - - s/\#.*$//; - - my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_); - - next if !$method; - - if(!$sub) { - $sub = "0"; - } else { - $sub = "icalrestriction_".$sub; - } - - - if($subcomp ne "NONE"){ - print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${subcomp}_COMPONENT,ICAL_RESTRICTION_${restr},$sub\},\n"); - } - -} - -# print the terminating line -print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}\n"; -print "};\n"; diff --git a/other-licenses/libical/src/Makefile.am b/other-licenses/libical/src/Makefile.am index 108581258da..e69de29bb2d 100644 --- a/other-licenses/libical/src/Makefile.am +++ b/other-licenses/libical/src/Makefile.am @@ -1,7 +0,0 @@ -if WITH_PYTHON -PYTHON_DIR = python -else -PYTHON_DIR = -endif - -SUBDIRS = libical libicalss libicalvcal $(PYTHON_DIR) test diff --git a/other-licenses/libical/src/Makefile.in b/other-licenses/libical/src/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/libical/Makefile.am b/other-licenses/libical/src/libical/Makefile.am index 91409143b49..85197c53fa1 100644 --- a/other-licenses/libical/src/libical/Makefile.am +++ b/other-licenses/libical/src/libical/Makefile.am @@ -2,7 +2,7 @@ # FILE: Makefile.am # CREATOR: eric # -# $Id: Makefile.am,v 1.1 2001-11-15 19:26:49 mikep%oeone.com Exp $ +# $Id: Makefile.am,v 1.2 2001-12-21 18:56:11 mikep%oeone.com Exp $ # # # (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -18,7 +18,7 @@ # 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.c +# # #====================================================================== @@ -28,10 +28,20 @@ ICALSCRIPTS = $(top_srcdir)/scripts lib_LTLIBRARIES = libical.la +noinst_LTLIBRARIES = libical-static.la +libical_static_la_SOURCES = $(libical_la_SOURCES) +libical_static_la_LDFLAGS = --all-static + YFLAGS = -d -v -t -pical_yy LFLAGS = -Pical_yy LEX_OUTPUT_ROOT = lex.ical_yy +CPPFLAGS = -DPACKAGE_DATA_DIR=\""$(datadir)/$(PACKAGE)"\" + +# CFLAGS = -g + +all: ical.h + INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir)/src \ @@ -41,6 +51,9 @@ INCLUDES = \ libical_la_LDFLAGS = -version-info 0:0:0 libical_la_SOURCES = \ + $(BUILT_SOURCES) \ + icalarray.c \ + icalarray.h \ icalattendee.h \ icalattendee.c \ icalcomponent.c \ @@ -57,20 +70,17 @@ libical_la_SOURCES = \ icalparameter.c \ icalparameter.h \ icalparameterimpl.h \ - icalderivedparameter.c \ - icalderivedparameter.h \ icalparser.c \ icalparser.h \ - icalderivedproperty.c \ - icalderivedproperty.h \ icalproperty.c \ icalproperty.h \ icalrecur.c \ icalrecur.h \ - icalrestriction.c \ icalrestriction.h \ icaltime.c \ icaltime.h \ + icaltimezone.c \ + icaltimezone.h \ icalduration.h \ icalduration.c \ icalperiod.h \ @@ -80,8 +90,6 @@ libical_la_SOURCES = \ icalvalue.c \ icalvalue.h \ icalvalueimpl.h \ - icalderivedvalue.c \ - icalderivedvalue.h \ icalyacc.h \ icalyacc.y \ pvl.c \ @@ -99,6 +107,7 @@ 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)/config.h \ $(top_builddir)/src/libical/icalversion.h \ $(top_srcdir)/src/libical/icaltime.h \ $(top_srcdir)/src/libical/icalduration.h \ @@ -108,13 +117,15 @@ COMBINEDHEADERS = \ $(top_srcdir)/src/libical/icalrecur.h \ icalderivedvalue.h \ icalderivedparameter.h \ - icalvalue.h \ - icalparameter.h \ + $(top_srcdir)/src/libical/icalvalue.h \ + $(top_srcdir)/src/libical/icalparameter.h \ icalderivedproperty.h \ - icalproperty.h \ + $(top_srcdir)/src/libical/icalproperty.h \ $(top_srcdir)/src/libical/icalattendee.h \ $(top_srcdir)/src/libical/pvl.h \ + $(top_srcdir)/src/libical/icalarray.h \ $(top_srcdir)/src/libical/icalcomponent.h \ + $(top_srcdir)/src/libical/icaltimezone.h \ $(top_srcdir)/src/libical/icalparser.h \ $(top_srcdir)/src/libical/icalmemory.h \ $(top_srcdir)/src/libical/icalerror.h \ @@ -123,19 +134,22 @@ COMBINEDHEADERS = \ $(top_srcdir)/src/libical/icalmime.h \ $(top_srcdir)/src/libical/icallangbind.h -BUILT_SOURCES = \ - ical.h \ - icalderivedparameter.c \ +BUILT_COMBINEDHEADERS = \ icalderivedparameter.h \ - icalderivedproperty.c \ icalderivedproperty.h \ - icalrestriction.c \ - icalderivedvalue.c \ icalderivedvalue.h +BUILT_SOURCES = \ + $(BUILT_COMBINEDHEADERS)\ + icalderivedparameter.c \ + icalderivedproperty.c \ + icalrestriction.c \ + icalderivedvalue.c + ical.h: $(COMBINEDHEADERS) cat $(COMBINEDHEADERS) \ | egrep -v "#include.*\"ical" \ + | egrep -v "#include.*\"config" \ | egrep -v "#include.*\"pvl\.h\"" > ical.h icallexer.c : icalyacc.h @@ -152,10 +166,9 @@ PARAMETERDEPS = \ icalderivedparameter.h: $(PARAMETERDEPS) $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h -icalderivedparameter.c: $(PARAMETERDEPS) icalparameter.h +icalderivedparameter.c: $(PARAMETERDEPS) $(BUILT_COMBINEDHEADERS) $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.c.in -c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c - # properties PROPERTYDEPS = \ @@ -171,7 +184,7 @@ icalderivedproperty.h: $(PROPERTYDEPS) -i $(srcdir)/icalderivedproperty.h.in -h $(DESIGNDATA)/properties.csv\ ${DESIGNDATA}/value-types.csv > icalderivedproperty.h -icalderivedproperty.c: $(PROPERTYDEPS) icalproperty.h +icalderivedproperty.c: $(PROPERTYDEPS) $(BUILT_COMBINEDHEADERS) $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \ -i $(srcdir)/icalderivedproperty.c.in -c $(DESIGNDATA)/properties.csv \ ${DESIGNDATA}/value-types.csv > icalderivedproperty.c @@ -199,7 +212,7 @@ icalderivedvalue.h: $(VALUEDEPS) $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \ -i $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h -icalderivedvalue.c: $(VALUEDEPS) icalderivedvalue.h +icalderivedvalue.c: $(VALUEDEPS) $(BUILT_COMBINEDHEADERS) $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \ -i $(srcdir)/icalderivedvalue.c.in -c $(DESIGNDATA)/value-types.csv > icalderivedvalue.c @@ -208,7 +221,11 @@ icalderivedvalue.c: $(VALUEDEPS) icalderivedvalue.h # housekeeping CONFIG_CLEAN_FILES = y.output -CLEANFILES += $(BUILT_SOURCES) +CLEANFILES += $(BUILT_SOURCES) $(BUILT_COMBINEDHEADERS) + +dist-hook: + cd $(distdir); rm -f $(BUILT_SOURCES) + cd $(distdir); rm -f ical.h icalversion.h icalyacc.c icalyacc.h icallexer.c EXTRA_DIST = \ icalderivedparameter.c.in \ diff --git a/other-licenses/libical/src/libical/Makefile.in b/other-licenses/libical/src/libical/Makefile.in deleted file mode 100644 index 6df704ab2bc..00000000000 --- a/other-licenses/libical/src/libical/Makefile.in +++ /dev/null @@ -1,565 +0,0 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am - -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -#====================================================================== -# FILE: Makefile.am -# CREATOR: eric -# -# $Id: Makefile.in,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ -# -# -# (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.c -# -#====================================================================== - - -SHELL = @SHELL@ - -srcdir = @srcdir@ -top_srcdir = @top_srcdir@ -VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ - -top_builddir = ../.. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -host_alias = @host_alias@ -host_triplet = @host@ -AR = @AR@ -AS = @AS@ -CC = @CC@ -DLLTOOL = @DLLTOOL@ -LEX = @LEX@ -LIBTOOL = @LIBTOOL@ -LN_S = @LN_S@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -OBJDUMP = @OBJDUMP@ -PACKAGE = @PACKAGE@ -PERL = @PERL@ -PY_CFLAGS = @PY_CFLAGS@ -PY_EXTRA_LIBS = @PY_EXTRA_LIBS@ -PY_LIBS = @PY_LIBS@ -PY_LIB_LOC = @PY_LIB_LOC@ -RANLIB = @RANLIB@ -VERSION = @VERSION@ -YACC = @YACC@ -python_val = @python_val@ - -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 - -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 = icalattendee.h icalattendee.c 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 icalparameterimpl.h icalderivedparameter.c icalderivedparameter.h icalparser.c icalparser.h icalderivedproperty.c icalderivedproperty.h icalproperty.c icalproperty.h icalrecur.c icalrecur.h icalrestriction.c icalrestriction.h icaltime.c icaltime.h icalduration.h icalduration.c icalperiod.h icalperiod.c icaltypes.c icaltypes.h icalvalue.c icalvalue.h icalvalueimpl.h icalderivedvalue.c icalderivedvalue.h icalyacc.h icalyacc.y pvl.c pvl.h sspm.c sspm.h vsnprintf.c icallangbind.h icallangbind.c - - -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/icalduration.h $(top_srcdir)/src/libical/icalperiod.h $(top_srcdir)/src/libical/icalenums.h $(top_srcdir)/src/libical/icaltypes.h $(top_srcdir)/src/libical/icalrecur.h icalderivedvalue.h icalderivedparameter.h icalvalue.h icalparameter.h icalderivedproperty.h icalproperty.h $(top_srcdir)/src/libical/icalattendee.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 $(top_srcdir)/src/libical/icallangbind.h - - -BUILT_SOURCES = ical.h icalderivedparameter.c icalderivedparameter.h icalderivedproperty.c icalderivedproperty.h icalrestriction.c icalderivedvalue.c icalderivedvalue.h - - -# parameters - -PARAMETERDEPS = $(ICALSCRIPTS)/mkderivedparameters.pl $(DESIGNDATA)/parameters.csv icalderivedparameter.c.in icalderivedparameter.h.in - - -# properties - -PROPERTYDEPS = $(ICALSCRIPTS)/mkderivedproperties.pl $(DESIGNDATA)/properties.csv $(DESIGNDATA)/value-types.csv icalderivedproperty.c.in icalderivedproperty.h.in - - -# restrictions - -RESTRICTIONDEPS = $(ICALSCRIPTS)/mkrestrictiontable.pl $(DESIGNDATA)/restrictions.csv icalrestriction.c.in - - -# values - -VALUEDEPS = $(ICALSCRIPTS)/mkderivedvalues.pl $(DESIGNDATA)/value-types.csv icalderivedvalue.c.in icalderivedvalue.h.in - - -# housekeeping -CONFIG_CLEAN_FILES = y.output - -CLEANFILES = $(BUILT_SOURCES) - -EXTRA_DIST = icalderivedparameter.c.in icalderivedparameter.h.in icalderivedproperty.c.in icalderivedproperty.h.in icalrestriction.c.in icalderivedvalue.c.in icalderivedvalue.h.in icalversion.h.in icallexer.c icalyacc.c - -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../config.h -LTLIBRARIES = $(lib_LTLIBRARIES) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../.. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -libical_la_LIBADD = -libical_la_OBJECTS = icalattendee.lo icalcomponent.lo icalenums.lo \ -icalerror.lo icallexer.lo icalmemory.lo icalmime.lo icalparameter.lo \ -icalderivedparameter.lo icalparser.lo icalderivedproperty.lo \ -icalproperty.lo icalrecur.lo icalrestriction.lo icaltime.lo \ -icalduration.lo icalperiod.lo icaltypes.lo icalvalue.lo \ -icalderivedvalue.lo icalyacc.lo pvl.lo sspm.lo vsnprintf.lo \ -icallangbind.lo -LEXLIB = @LEXLIB@ -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -HEADERS = $(libicalinclude_HEADERS) - -DIST_COMMON = Makefile.am Makefile.in icallexer.c icalversion.h.in \ -icalyacc.c - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -SOURCES = $(libical_la_SOURCES) -OBJECTS = $(libical_la_OBJECTS) - -all: all-redirect -.SUFFIXES: -.SUFFIXES: .S .c .l .lo .o .s .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/libical/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -icalversion.h: $(top_builddir)/config.status icalversion.h.in - cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -mostlyclean-libLTLIBRARIES: - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - -distclean-libLTLIBRARIES: - -maintainer-clean-libLTLIBRARIES: - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libdir) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - if test -f $$p; then \ - echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \ - $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \ - else :; fi; \ - done - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \ - done - -.c.o: - $(COMPILE) -c $< - -.s.o: - $(COMPILE) -c $< - -.S.o: - $(COMPILE) -c $< - -mostlyclean-compile: - -rm -f *.o core *.core - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -.c.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.s.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -.S.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -maintainer-clean-libtool: - -libical.la: $(libical_la_OBJECTS) $(libical_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libical_la_LDFLAGS) $(libical_la_OBJECTS) $(libical_la_LIBADD) $(LIBS) -.l.c: - $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ -.y.c: - $(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c - if test -f y.tab.h; then \ - if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \ - else :; fi -icalyacc.h: icalyacc.c - - -install-libicalincludeHEADERS: $(libicalinclude_HEADERS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libicalincludedir) - @list='$(libicalinclude_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libicalincludedir)/$$p"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libicalincludedir)/$$p; \ - done - -uninstall-libicalincludeHEADERS: - @$(NORMAL_UNINSTALL) - list='$(libicalinclude_HEADERS)'; for p in $$list; do \ - rm -f $(DESTDIR)$(libicalincludedir)/$$p; \ - done - -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: - -clean-tags: - -distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = src/libical - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done -icalattendee.lo icalattendee.o : icalattendee.c ../../config.h \ - icalattendee.h icalenums.h icaltime.h icalduration.h \ - icalperiod.h icalderivedparameter.h icalderivedvalue.h \ - icaltypes.h icalrecur.h -icalcomponent.lo icalcomponent.o : icalcomponent.c ../../config.h \ - icalcomponent.h icalproperty.h icalderivedparameter.h \ - icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \ - icalperiod.h icalrecur.h icalderivedproperty.h icalparameter.h \ - icalderivedvalue.h icalattendee.h pvl.h icalerror.h \ - icalmemory.h icalparser.h -icalderivedparameter.lo icalderivedparameter.o : icalderivedparameter.c \ - ../../config.h icalparameter.h icalderivedparameter.h \ - icalparameterimpl.h icalproperty.h icalvalue.h icalenums.h \ - icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \ - icalderivedproperty.h icalderivedvalue.h icalerror.h \ - icalmemory.h -icalderivedproperty.lo icalderivedproperty.o : icalderivedproperty.c \ - ../../config.h icalproperty.h icalderivedparameter.h \ - icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \ - icalperiod.h icalrecur.h icalderivedproperty.h icalparameter.h \ - icalderivedvalue.h icalcomponent.h icalattendee.h pvl.h \ - icalerror.h icalmemory.h icalparser.h -icalderivedvalue.lo icalderivedvalue.o : icalderivedvalue.c \ - ../../config.h icalerror.h icalmemory.h icalparser.h \ - icalenums.h icaltypes.h icaltime.h icalduration.h icalperiod.h \ - icalcomponent.h icalproperty.h icalderivedparameter.h \ - icalvalue.h icalrecur.h icalderivedproperty.h icalparameter.h \ - icalderivedvalue.h icalattendee.h pvl.h icalvalueimpl.h -icalduration.lo icalduration.o : icalduration.c ../../config.h \ - icalduration.h icaltime.h icalerror.h icalmemory.h icalvalue.h \ - icalenums.h icaltypes.h icalperiod.h icalrecur.h \ - icalderivedproperty.h icalparameter.h icalderivedparameter.h \ - icalderivedvalue.h -icalenums.lo icalenums.o : icalenums.c ../../config.h icalenums.h -icalerror.lo icalerror.o : icalerror.c ../../config.h icalerror.h -icallangbind.lo icallangbind.o : icallangbind.c icalcomponent.h \ - icalproperty.h icalderivedparameter.h icalvalue.h icalenums.h \ - icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \ - icalderivedproperty.h icalparameter.h icalderivedvalue.h \ - icalattendee.h pvl.h icalerror.h ../../config.h icalmemory.h -icallexer.lo icallexer.o : icallexer.c icalparser.h icalenums.h \ - icaltypes.h icaltime.h icalduration.h icalperiod.h \ - icalcomponent.h icalproperty.h icalderivedparameter.h \ - icalvalue.h icalrecur.h icalderivedproperty.h icalparameter.h \ - icalderivedvalue.h icalattendee.h pvl.h icalmemory.h icalyacc.h -icalmemory.lo icalmemory.o : icalmemory.c ../../config.h icalmemory.h \ - icalerror.h -icalmime.lo icalmime.o : icalmime.c icalmime.h icalcomponent.h \ - icalproperty.h icalderivedparameter.h icalvalue.h icalenums.h \ - icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \ - icalderivedproperty.h icalparameter.h icalderivedvalue.h \ - icalattendee.h pvl.h icalparser.h icalerror.h ../../config.h \ - icalmemory.h sspm.h -icalparameter.lo icalparameter.o : icalparameter.c ../../config.h \ - icalparameter.h icalderivedparameter.h icalproperty.h \ - icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \ - icalperiod.h icalrecur.h icalderivedproperty.h \ - icalderivedvalue.h icalerror.h icalmemory.h icalparameterimpl.h -icalparser.lo icalparser.o : icalparser.c ../../config.h icalparser.h \ - icalenums.h icaltypes.h icaltime.h icalduration.h icalperiod.h \ - icalcomponent.h icalproperty.h icalderivedparameter.h \ - icalvalue.h icalrecur.h icalderivedproperty.h icalparameter.h \ - icalderivedvalue.h icalattendee.h pvl.h icalmemory.h \ - icalerror.h -icalperiod.lo icalperiod.o : icalperiod.c ../../config.h icalperiod.h \ - icaltime.h icalduration.h icalerror.h icalmemory.h -icalproperty.lo icalproperty.o : icalproperty.c ../../config.h \ - icalproperty.h icalderivedparameter.h icalvalue.h icalenums.h \ - icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \ - icalderivedproperty.h icalparameter.h icalderivedvalue.h \ - icalcomponent.h icalattendee.h pvl.h icalerror.h icalmemory.h \ - icalparser.h -icalrecur.lo icalrecur.o : icalrecur.c ../../config.h icalrecur.h \ - icaltime.h icalerror.h icalmemory.h pvl.h -icalrestriction.lo icalrestriction.o : icalrestriction.c ../../config.h \ - icalrestriction.h icalproperty.h icalderivedparameter.h \ - icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \ - icalperiod.h icalrecur.h icalderivedproperty.h icalparameter.h \ - icalderivedvalue.h icalcomponent.h icalattendee.h pvl.h \ - icalerror.h -icaltime.lo icaltime.o : icaltime.c ../../config.h icaltime.h \ - icalerror.h icalmemory.h icalvalue.h icalenums.h icaltypes.h \ - icalduration.h icalperiod.h icalrecur.h icalderivedproperty.h \ - icalparameter.h icalderivedparameter.h icalderivedvalue.h -icaltypes.lo icaltypes.o : icaltypes.c ../../config.h icaltypes.h \ - icalenums.h icaltime.h icalduration.h icalperiod.h icalerror.h \ - icalmemory.h -icalvalue.lo icalvalue.o : icalvalue.c ../../config.h icalerror.h \ - icalmemory.h icalparser.h icalenums.h icaltypes.h icaltime.h \ - icalduration.h icalperiod.h icalcomponent.h icalproperty.h \ - icalderivedparameter.h icalvalue.h icalrecur.h \ - icalderivedproperty.h icalparameter.h icalderivedvalue.h \ - icalattendee.h pvl.h icalvalueimpl.h -icalyacc.lo icalyacc.o : icalyacc.c icalparser.h icalenums.h icaltypes.h \ - icaltime.h icalduration.h icalperiod.h icalcomponent.h \ - icalproperty.h icalderivedparameter.h icalvalue.h icalrecur.h \ - icalderivedproperty.h icalparameter.h icalderivedvalue.h \ - icalattendee.h pvl.h -pvl.lo pvl.o : pvl.c ../../config.h pvl.h -sspm.lo sspm.o : sspm.c sspm.h -vsnprintf.lo vsnprintf.o : vsnprintf.c - -info-am: -info: info-am -dvi-am: -dvi: dvi-am -check-am: all-am -check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: install-libLTLIBRARIES -install-exec: install-exec-am - -install-data-am: install-libicalincludeHEADERS -install-data: install-data-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-libLTLIBRARIES uninstall-libicalincludeHEADERS -uninstall: uninstall-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(libicalincludedir) - - -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -maintainer-clean-generic: - -test -z "icallexerlicalyacchicalyaccc$(BUILT_SOURCES)" || rm -f icallexerl icalyacch icalyaccc $(BUILT_SOURCES) -mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \ - mostlyclean-libtool mostlyclean-tags \ - mostlyclean-generic - -mostlyclean: mostlyclean-am - -clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ - clean-generic mostlyclean-am - -clean: clean-am - -distclean-am: distclean-libLTLIBRARIES distclean-compile \ - distclean-libtool distclean-tags distclean-generic \ - clean-am - -rm -f libtool - -distclean: distclean-am - -maintainer-clean-am: maintainer-clean-libLTLIBRARIES \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -maintainer-clean: maintainer-clean-am - -.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \ -clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \ -uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \ -distclean-compile clean-compile maintainer-clean-compile \ -mostlyclean-libtool distclean-libtool clean-libtool \ -maintainer-clean-libtool uninstall-libicalincludeHEADERS \ -install-libicalincludeHEADERS tags mostlyclean-tags distclean-tags \ -clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ -check-am installcheck-am installcheck install-exec-am install-exec \ -install-data-am install-data install-am install uninstall-am uninstall \ -all-redirect all-am all installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean - - -ical.h: $(COMBINEDHEADERS) - cat $(COMBINEDHEADERS) \ - | egrep -v "#include.*\"ical" \ - | egrep -v "#include.*\"pvl\.h\"" > ical.h - -icallexer.c : icalyacc.h - -icalderivedparameter.h: $(PARAMETERDEPS) - $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h - -icalderivedparameter.c: $(PARAMETERDEPS) icalparameter.h - $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.c.in -c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c - -icalderivedproperty.h: $(PROPERTYDEPS) - $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \ - -i $(srcdir)/icalderivedproperty.h.in -h $(DESIGNDATA)/properties.csv\ - ${DESIGNDATA}/value-types.csv > icalderivedproperty.h - -icalderivedproperty.c: $(PROPERTYDEPS) icalproperty.h - $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \ - -i $(srcdir)/icalderivedproperty.c.in -c $(DESIGNDATA)/properties.csv \ - ${DESIGNDATA}/value-types.csv > icalderivedproperty.c - -icalrestriction.c: $(RESTRICTIONDEPS) - $(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl -i $(srcdir)/icalrestriction.c.in \ - $(DESIGNDATA)/restrictions.csv > icalrestriction.c - -icalderivedvalue.h: $(VALUEDEPS) - $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \ - -i $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h - -icalderivedvalue.c: $(VALUEDEPS) icalderivedvalue.h - $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \ - -i $(srcdir)/icalderivedvalue.c.in -c $(DESIGNDATA)/value-types.csv > icalderivedvalue.c - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/other-licenses/libical/src/libical/ical.h b/other-licenses/libical/src/libical/ical.h deleted file mode 100644 index 904c107ca43..00000000000 --- a/other-licenses/libical/src/libical/ical.h +++ /dev/null @@ -1,2999 +0,0 @@ -#ifndef ICAL_VERSION_H -#define ICAL_VERSION_H - -#define ICAL_PACKAGE "libical" -#define ICAL_VERSION "0.23" - -#endif -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icaltime.h - CREATOR: eric 02 June 2000 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 - -/* 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. */ - - const char* zone; /*Ptr to Olsen placename. Libical does not own mem*/ -}; - -/* Convert seconds past UNIX epoch to a timetype*/ -struct icaltimetype icaltime_from_timet(time_t v, int is_date); - -/* Return the time as seconds past the UNIX epoch */ -time_t icaltime_as_timet(struct icaltimetype); - -/* Return a string represention of the time, in RFC2445 format. The - string is owned by libical */ -char* icaltime_as_ical_string(struct icaltimetype tt); - -/* Like icaltime_from_timet(), except that the input may be in seconds - past the epoch in floating time. This routine is deprecated */ -struct icaltimetype icaltime_from_int(int v, int is_date, int is_utc); - -/* Like icaltime_as_timet, but in a floating epoch. This routine is deprecated */ -int icaltime_as_int(struct icaltimetype); - -/* create a time from an ISO format string */ -struct icaltimetype icaltime_from_string(const char* str); - -/* 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 */ -int icaltime_utc_offset(struct icaltimetype tt, const char* tzid); - -/* convert tt, of timezone tzid, into a utc time. Does nothing if the - time is already UTC. */ -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); - -/* Return a null time, which indicates no time has been set. This time represent the beginning of the epoch */ -struct icaltimetype icaltime_null_time(void); - -/* Return true of the time is null. */ -int icaltime_is_null_time(struct icaltimetype t); - -/* Returns false if the time is clearly invalid, but is not null. This - is usually the result of creating a new time type buy not clearing - it, or setting one of the flags to an illegal value. */ -int icaltime_is_valid_time(struct icaltimetype t); - -/* Reset all of the time components to be in their normal ranges. For - instance, given a time with minutes=70, the minutes will be reduces - to 10, and the hour incremented. This allows the caller to do - arithmetic on times without worrying about overflow or - underflow. */ -struct icaltimetype icaltime_normalize(struct icaltimetype t); - -/* Return the day of the year of the given time */ -short icaltime_day_of_year(struct icaltimetype t); - -/* Create a new time, given a day of year and a year. */ -struct icaltimetype icaltime_from_day_of_year(short doy, short year); - -/* Return the day of the week of the given time. Sunday is 1 */ -short icaltime_day_of_week(struct icaltimetype t); - -/* Return the day of the year for the Sunday of the week that the - given time is within. */ -short icaltime_start_doy_of_week(struct icaltimetype t); - -/* Return a string with the time represented in the same format as ctime(). THe string is owned by libical */ -char* icaltime_as_ctime(struct icaltimetype); - -/* Return the week number for the week the given time is within */ -short icaltime_week_number(struct icaltimetype t); - -/* Create a new time from a weeknumber and a year. */ -struct icaltimetype icaltime_from_week_number(short week_number, short year); - -/* Return -1, 0, or 1 to indicate that ab */ -int icaltime_compare(struct icaltimetype a,struct icaltimetype b); - -/* like icaltime_compare, but only use the date parts. */ -int icaltime_compare_date_only(struct icaltimetype a, struct icaltimetype b); - -/* Return the number of days in the given month */ -short icaltime_days_in_month(short month,short year); - - -#endif /* !ICALTIME_H */ - - - -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalduration.h - CREATOR: eric 26 Jan 2001 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 ICALDURATION_H -#define ICALDURATION_H - - -struct icaldurationtype -{ - int is_neg; - unsigned int days; - unsigned int weeks; - unsigned int hours; - unsigned int minutes; - unsigned int seconds; -}; - -struct icaldurationtype icaldurationtype_from_int(int t); -struct icaldurationtype icaldurationtype_from_string(const char*); -int icaldurationtype_as_int(struct icaldurationtype duration); -char* icaldurationtype_as_ical_string(struct icaldurationtype d); -struct icaldurationtype icaldurationtype_null_duration(); -int icaldurationtype_is_null_duration(struct icaldurationtype d); - -struct icaltimetype icaltime_add(struct icaltimetype t, - struct icaldurationtype d); - -struct icaldurationtype icaltime_subtract(struct icaltimetype t1, - struct icaltimetype t2); - -#endif /* !ICALDURATION_H */ - - - -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalperiod.h - CREATOR: eric 26 Jan 2001 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 ICALPERIOD_H -#define ICALPERIOD_H - - -struct icalperiodtype -{ - struct icaltimetype start; - struct icaltimetype end; - struct icaldurationtype duration; -}; - -struct icalperiodtype icalperiodtype_from_string (const char* str); - -const char* icalperiodtype_as_ical_string(struct icalperiodtype p); -struct icalperiodtype icalperiodtype_null_period(); -int icalperiodtype_is_null_period(struct icalperiodtype p); -int icalperiodtype_is_valid_period(struct icalperiodtype p); - - - - -#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; - - - -/*********************************************************************** - * 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 -**********************************************************************/ - - -/* Thse routines used to be in icalenums.c, but were moved into the - icalproperty, icalparameter, icalvalue, or icalcomponent modules. */ - -/* const char* icalproperty_kind_to_string(icalproperty_kind kind);*/ -#define icalenum_property_kind_to_string(x) icalproperty_kind_to_string(x) - -/*icalproperty_kind icalproperty_string_to_kind(const char* string)*/ -#define icalenum_string_to_property_kind(x) icalproperty_string_to_kind(x) - -/*icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind);*/ -#define icalenum_property_kind_to_value_kind(x) icalproperty_kind_to_value_kind(x) - -/*const char* icalenum_method_to_string(icalproperty_method);*/ -#define icalenum_method_to_string(x) icalproperty_method_to_string(x) - -/*icalproperty_method icalenum_string_to_method(const char* string);*/ -#define icalenum_string_to_method(x) icalproperty_string_to_method(x) - -/*const char* icalenum_status_to_string(icalproperty_status);*/ -#define icalenum_status_to_string(x) icalproperty_status_to_string(x) - -/*icalproperty_status icalenum_string_to_status(const char* string);*/ -#define icalenum_string_to_status(x) icalproperty_string_to_status(x) - -/*icalvalue_kind icalenum_string_to_value_kind(const char* str);*/ -#define icalenum_string_to_value_kind(x) icalvalue_string_to_kind(x) - -/*const char* icalenum_value_kind_to_string(icalvalue_kind kind);*/ -#define icalenum_value_kind_to_string(x) icalvalue_kind_to_string(x) - -/*const char* icalenum_component_kind_to_string(icalcomponent_kind kind);*/ -#define icalenum_component_kind_to_string(x) icalcomponent_kind_to_string(x) - -/*icalcomponent_kind icalenum_string_to_component_kind(const char* string);*/ -#define icalenum_string_to_component_kind(x) icalcomponent_string_to_kind(x) - - -#endif /* !ICALENUMS_H */ - -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icaltypes.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 icaltypes.h - -======================================================================*/ - -#ifndef ICALTYPES_H -#define ICALTYPES_H - -#include - - -/* 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; -}; - - -struct icaldatetimeperiodtype -{ - struct icaltimetype time; - struct icalperiodtype period; -}; - - -struct icaltriggertype -{ - struct icaltimetype time; - struct icaldurationtype duration; -}; - -struct icaltriggertype icaltriggertype_from_string(const char* str); - -/* 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); - - - -struct icaltimezonephase { - const char* tzname; - int is_stdandard; /* 1 = standard tme, 0 = daylight savings time */ - struct icaltimetype dtstart; - int offsetto; - int tzoffsetfrom; - const char* comment; - struct icaldatetimeperiodtype rdate; - const char* rrule; -}; - - -struct icaltimezonetype { - const char* tzid; - struct icaltimetype last_mod; - const char* tzurl; - - /* Array of phases. The end of the array is a phase with tzname == 0 */ - struct icaltimezonephase *phases; -}; - -void icaltimezonetype_free(struct icaltimezonetype tzt); - - -#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/ - -How to use: - -1) Get a rule and a start time from a component - icalproperty rrule; - struct icalrecurrencetype recur; - struct icaltimetype dtstart; - - rrule = icalcomponent_get_first_property(comp,ICAL_RRULE_PROPERTY); - recur = icalproperty_get_rrule(rrule); - start = icalproperty_get_dtstart(dtstart); - -Or, just make them up: - recur = icalrecurrencetype_from_string("FREQ=YEARLY;BYDAY=SU,WE"); - dtstart = icaltime_from_string("19970101T123000") - -2) Create an iterator - icalrecur_iterator* ritr; - ritr = icalrecur_iterator_new(recur,start); - -3) Iterator over the occurrences - struct icaltimetype next; - while (next = icalrecur_iterator_next(ritr) - && !icaltime_is_null_time(next){ - Do something with next - } - -Note that that the time returned by icalrecur_iterator_next is in -whatever timezone that dtstart is in. - -======================================================================*/ - -#ifndef ICALRECUR_H -#define ICALRECUR_H - -#include - -/*********************************************************************** - * 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 -}; - - - -/********************** Recurrence type routines **************/ - -/* See RFC 2445 Section 4.3.10, RECUR Value, for an explaination of - the values and fields in struct icalrecurrencetype */ - -#define ICAL_BY_SECOND_SIZE 61 -#define ICAL_BY_MINUTE_SIZE 61 -#define ICAL_BY_HOUR_SIZE 25 -#define ICAL_BY_DAY_SIZE 364 /* 7 days * 52 weeks */ -#define ICAL_BY_MONTHDAY_SIZE 32 -#define ICAL_BY_YEARDAY_SIZE 367 -#define ICAL_BY_WEEKNO_SIZE 54 -#define ICAL_BY_MONTH_SIZE 13 -#define ICAL_BY_SETPOS_SIZE 367 - -/* Main struct for holding digested recurrence rules */ -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 - * ICAL_RECURRENCE_ARRAY_MAX unless the the list is full. - */ - - short by_second[ICAL_BY_SECOND_SIZE]; - short by_minute[ICAL_BY_MINUTE_SIZE]; - short by_hour[ICAL_BY_HOUR_SIZE]; - short by_day[ICAL_BY_DAY_SIZE]; /* Encoded value, see below */ - short by_month_day[ICAL_BY_MONTHDAY_SIZE]; - short by_year_day[ ICAL_BY_YEARDAY_SIZE]; - short by_week_no[ICAL_BY_WEEKNO_SIZE]; - short by_month[ICAL_BY_MONTH_SIZE]; - short by_set_pos[ICAL_BY_SETPOS_SIZE]; -}; - - -void icalrecurrencetype_clear(struct icalrecurrencetype *r); - -/* The 'day' element of the by_day array 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); - - -/*********************************************************************** - * Recurrance rule parser -**********************************************************************/ - -/* Convert between strings ans recurrencetype structures. */ -struct icalrecurrencetype icalrecurrencetype_from_string(const char* str); -char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur); - - -/********** recurrence iteration routines ********************/ - -typedef void icalrecur_iterator; - -/* Create a new recurrence rule iterator */ -icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule, - struct icaltimetype dtstart); - -/* Get the next occurrence from an iterator */ -struct icaltimetype icalrecur_iterator_next(icalrecur_iterator*); - -/* Free the iterator */ -void icalrecur_iterator_free(icalrecur_iterator*); - -/* Fills array up with at most 'count' time_t values, each - representing an occurrence time in seconds past the POSIX epoch */ -int icalrecur_expand_recurrence(char* rule, time_t start, - int count, time_t* array); - - -#endif -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalvalue.h - CREATOR: eric 20 March 1999 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 ICALDERIVEDVALUE_H -#define ICALDERIVEDVALUE_H - - -typedef void icalvalue; - - - -void icalvalue_set_x(icalvalue* value, const char* v); -icalvalue* icalvalue_new_x(const char* v); -const char* icalvalue_get_x(icalvalue* value); - -icalvalue* icalvalue_new_recur (struct icalrecurrencetype v); -void icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v); -struct icalrecurrencetype icalvalue_get_recur(icalvalue* value); - -icalvalue* icalvalue_new_trigger (struct icaltriggertype v); -void icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v); -struct icaltriggertype icalvalue_get_trigger(icalvalue* value); - -icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v); -void icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v); -struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(icalvalue* value); - -/* Everything below this line is machine generated. Do not edit. */ -typedef enum icalvalue_kind { - ICAL_ANY_VALUE=5000, - ICAL_BOOLEAN_VALUE=5001, - ICAL_UTCOFFSET_VALUE=5002, - ICAL_RECUR_VALUE=5003, - ICAL_METHOD_VALUE=5004, - ICAL_CALADDRESS_VALUE=5005, - ICAL_PERIOD_VALUE=5006, - ICAL_STATUS_VALUE=5007, - ICAL_BINARY_VALUE=5008, - ICAL_TEXT_VALUE=5009, - ICAL_DATETIMEDATE_VALUE=5010, - ICAL_DURATION_VALUE=5011, - ICAL_DATETIMEPERIOD_VALUE=5012, - ICAL_INTEGER_VALUE=5013, - ICAL_TIME_VALUE=5014, - ICAL_URI_VALUE=5015, - ICAL_TRIGGER_VALUE=5016, - ICAL_ATTACH_VALUE=5017, - ICAL_CLASS_VALUE=5018, - ICAL_FLOAT_VALUE=5019, - ICAL_QUERY_VALUE=5020, - ICAL_STRING_VALUE=5021, - ICAL_TRANSP_VALUE=5022, - ICAL_X_VALUE=5023, - ICAL_DATETIME_VALUE=5024, - ICAL_GEO_VALUE=5025, - ICAL_DATE_VALUE=5026, - ICAL_ACTION_VALUE=5027, - ICAL_NO_VALUE=5028 -} icalvalue_kind ; - -#define ICALPROPERTY_FIRST_ENUM 10000 - -typedef enum icalproperty_action { - ICAL_ACTION_X = 10000, - ICAL_ACTION_AUDIO = 10001, - ICAL_ACTION_DISPLAY = 10002, - ICAL_ACTION_EMAIL = 10003, - ICAL_ACTION_PROCEDURE = 10004, - ICAL_ACTION_NONE = 10005 -} icalproperty_action; - -typedef enum icalproperty_class { - ICAL_CLASS_X = 10006, - ICAL_CLASS_PUBLIC = 10007, - ICAL_CLASS_PRIVATE = 10008, - ICAL_CLASS_CONFIDENTIAL = 10009, - ICAL_CLASS_NONE = 10010 -} icalproperty_class; - -typedef enum icalproperty_method { - ICAL_METHOD_X = 10011, - ICAL_METHOD_PUBLISH = 10012, - ICAL_METHOD_REQUEST = 10013, - ICAL_METHOD_REPLY = 10014, - ICAL_METHOD_ADD = 10015, - ICAL_METHOD_CANCEL = 10016, - ICAL_METHOD_REFRESH = 10017, - ICAL_METHOD_COUNTER = 10018, - ICAL_METHOD_DECLINECOUNTER = 10019, - ICAL_METHOD_CREATE = 10020, - ICAL_METHOD_READ = 10021, - ICAL_METHOD_RESPONSE = 10022, - ICAL_METHOD_MOVE = 10023, - ICAL_METHOD_MODIFY = 10024, - ICAL_METHOD_GENERATEUID = 10025, - ICAL_METHOD_DELETE = 10026, - ICAL_METHOD_NONE = 10027 -} icalproperty_method; - -typedef enum icalproperty_status { - ICAL_STATUS_X = 10028, - ICAL_STATUS_TENTATIVE = 10029, - ICAL_STATUS_CONFIRMED = 10030, - ICAL_STATUS_COMPLETED = 10031, - ICAL_STATUS_NEEDSACTION = 10032, - ICAL_STATUS_CANCELLED = 10033, - ICAL_STATUS_INPROCESS = 10034, - ICAL_STATUS_DRAFT = 10035, - ICAL_STATUS_FINAL = 10036, - ICAL_STATUS_NONE = 10037 -} icalproperty_status; - -typedef enum icalproperty_transp { - ICAL_TRANSP_X = 10038, - ICAL_TRANSP_OPAQUE = 10039, - ICAL_TRANSP_TRANSPARENT = 10040, - ICAL_TRANSP_NONE = 10041 -} icalproperty_transp; - -#define ICALPROPERTY_LAST_ENUM 10042 - - - /* BOOLEAN */ -icalvalue* icalvalue_new_boolean(int v); -int icalvalue_get_boolean(icalvalue* value); -void icalvalue_set_boolean(icalvalue* value, int v); - - - /* UTC-OFFSET */ -icalvalue* icalvalue_new_utcoffset(int v); -int icalvalue_get_utcoffset(icalvalue* value); -void icalvalue_set_utcoffset(icalvalue* value, int v); - - - /* METHOD */ -icalvalue* icalvalue_new_method(enum icalproperty_method v); -enum icalproperty_method icalvalue_get_method(icalvalue* value); -void icalvalue_set_method(icalvalue* value, enum icalproperty_method 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); - - - /* PERIOD */ -icalvalue* icalvalue_new_period(struct icalperiodtype v); -struct icalperiodtype icalvalue_get_period(icalvalue* value); -void icalvalue_set_period(icalvalue* value, struct icalperiodtype v); - - - /* STATUS */ -icalvalue* icalvalue_new_status(enum icalproperty_status v); -enum icalproperty_status icalvalue_get_status(icalvalue* value); -void icalvalue_set_status(icalvalue* value, enum icalproperty_status 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); - - - /* TEXT */ -icalvalue* icalvalue_new_text(const char* v); -const char* icalvalue_get_text(icalvalue* value); -void icalvalue_set_text(icalvalue* value, const char* v); - - - /* DATE-TIME-DATE */ -icalvalue* icalvalue_new_datetimedate(struct icaltimetype v); -struct icaltimetype icalvalue_get_datetimedate(icalvalue* value); -void icalvalue_set_datetimedate(icalvalue* value, struct icaltimetype 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); - - - /* INTEGER */ -icalvalue* icalvalue_new_integer(int v); -int icalvalue_get_integer(icalvalue* value); -void icalvalue_set_integer(icalvalue* value, int 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); - - - /* URI */ -icalvalue* icalvalue_new_uri(const char* v); -const char* icalvalue_get_uri(icalvalue* value); -void icalvalue_set_uri(icalvalue* value, const char* v); - - - /* ATTACH */ -icalvalue* icalvalue_new_attach(struct icalattachtype v); -struct icalattachtype icalvalue_get_attach(icalvalue* value); -void icalvalue_set_attach(icalvalue* value, struct icalattachtype v); - - - /* CLASS */ -icalvalue* icalvalue_new_class(enum icalproperty_class v); -enum icalproperty_class icalvalue_get_class(icalvalue* value); -void icalvalue_set_class(icalvalue* value, enum icalproperty_class v); - - - /* FLOAT */ -icalvalue* icalvalue_new_float(float v); -float icalvalue_get_float(icalvalue* value); -void icalvalue_set_float(icalvalue* value, float 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); - - - /* STRING */ -icalvalue* icalvalue_new_string(const char* v); -const char* icalvalue_get_string(icalvalue* value); -void icalvalue_set_string(icalvalue* value, const char* v); - - - /* TRANSP */ -icalvalue* icalvalue_new_transp(enum icalproperty_transp v); -enum icalproperty_transp icalvalue_get_transp(icalvalue* value); -void icalvalue_set_transp(icalvalue* value, enum icalproperty_transp 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); - - - /* GEO */ -icalvalue* icalvalue_new_geo(struct icalgeotype v); -struct icalgeotype icalvalue_get_geo(icalvalue* value); -void icalvalue_set_geo(icalvalue* value, struct icalgeotype 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); - - - /* ACTION */ -icalvalue* icalvalue_new_action(enum icalproperty_action v); -enum icalproperty_action icalvalue_get_action(icalvalue* value); -void icalvalue_set_action(icalvalue* value, enum icalproperty_action v); - -#endif /*ICALVALUE_H*/ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalparam.h - CREATOR: eric 20 March 1999 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 ICALDERIVEDPARAMETER_H -#define ICALDERIVEDPARAMETER_H - - -typedef void icalparameter; - -const char* icalparameter_enum_to_string(int e); -int icalparameter_string_to_enum(const char* str); - -/* Everything below this line is machine generated. Do not edit. */ -typedef enum icalparameter_kind { - ICAL_ANY_PARAMETER = 0, - ICAL_ALTREP_PARAMETER, - ICAL_CN_PARAMETER, - ICAL_CUTYPE_PARAMETER, - ICAL_DELEGATEDFROM_PARAMETER, - ICAL_DELEGATEDTO_PARAMETER, - ICAL_DIR_PARAMETER, - ICAL_ENCODING_PARAMETER, - ICAL_FBTYPE_PARAMETER, - ICAL_FMTTYPE_PARAMETER, - ICAL_LANGUAGE_PARAMETER, - ICAL_MEMBER_PARAMETER, - ICAL_PARTSTAT_PARAMETER, - ICAL_RANGE_PARAMETER, - ICAL_RELATED_PARAMETER, - ICAL_RELTYPE_PARAMETER, - ICAL_ROLE_PARAMETER, - ICAL_RSVP_PARAMETER, - ICAL_SENTBY_PARAMETER, - ICAL_TZID_PARAMETER, - ICAL_VALUE_PARAMETER, - ICAL_X_PARAMETER, - ICAL_XLICCOMPARETYPE_PARAMETER, - ICAL_XLICERRORTYPE_PARAMETER, - ICAL_NO_PARAMETER -} icalparameter_kind; - -#define ICALPARAMETER_FIRST_ENUM 20000 - -typedef enum icalparameter_cutype { - ICAL_CUTYPE_X = 20000, - ICAL_CUTYPE_INDIVIDUAL = 20001, - ICAL_CUTYPE_GROUP = 20002, - ICAL_CUTYPE_RESOURCE = 20003, - ICAL_CUTYPE_ROOM = 20004, - ICAL_CUTYPE_UNKNOWN = 20005, - ICAL_CUTYPE_NONE = 20006 -} icalparameter_cutype; - -typedef enum icalparameter_encoding { - ICAL_ENCODING_X = 20007, - ICAL_ENCODING_8BIT = 20008, - ICAL_ENCODING_BASE64 = 20009, - ICAL_ENCODING_NONE = 20010 -} icalparameter_encoding; - -typedef enum icalparameter_fbtype { - ICAL_FBTYPE_X = 20011, - ICAL_FBTYPE_FREE = 20012, - ICAL_FBTYPE_BUSY = 20013, - ICAL_FBTYPE_BUSYUNAVAILABLE = 20014, - ICAL_FBTYPE_BUSYTENTATIVE = 20015, - ICAL_FBTYPE_NONE = 20016 -} icalparameter_fbtype; - -typedef enum icalparameter_partstat { - ICAL_PARTSTAT_X = 20017, - ICAL_PARTSTAT_NEEDSACTION = 20018, - ICAL_PARTSTAT_ACCEPTED = 20019, - ICAL_PARTSTAT_DECLINED = 20020, - ICAL_PARTSTAT_TENTATIVE = 20021, - ICAL_PARTSTAT_DELEGATED = 20022, - ICAL_PARTSTAT_COMPLETED = 20023, - ICAL_PARTSTAT_INPROCESS = 20024, - ICAL_PARTSTAT_NONE = 20025 -} icalparameter_partstat; - -typedef enum icalparameter_range { - ICAL_RANGE_X = 20026, - ICAL_RANGE_THISANDPRIOR = 20027, - ICAL_RANGE_THISANDFUTURE = 20028, - ICAL_RANGE_NONE = 20029 -} icalparameter_range; - -typedef enum icalparameter_related { - ICAL_RELATED_X = 20030, - ICAL_RELATED_START = 20031, - ICAL_RELATED_END = 20032, - ICAL_RELATED_NONE = 20033 -} icalparameter_related; - -typedef enum icalparameter_reltype { - ICAL_RELTYPE_X = 20034, - ICAL_RELTYPE_PARENT = 20035, - ICAL_RELTYPE_CHILD = 20036, - ICAL_RELTYPE_SIBLING = 20037, - ICAL_RELTYPE_NONE = 20038 -} icalparameter_reltype; - -typedef enum icalparameter_role { - ICAL_ROLE_X = 20039, - ICAL_ROLE_CHAIR = 20040, - ICAL_ROLE_REQPARTICIPANT = 20041, - ICAL_ROLE_OPTPARTICIPANT = 20042, - ICAL_ROLE_NONPARTICIPANT = 20043, - ICAL_ROLE_NONE = 20044 -} icalparameter_role; - -typedef enum icalparameter_rsvp { - ICAL_RSVP_X = 20045, - ICAL_RSVP_TRUE = 20046, - ICAL_RSVP_FALSE = 20047, - ICAL_RSVP_NONE = 20048 -} icalparameter_rsvp; - -typedef enum icalparameter_value { - ICAL_VALUE_X = 20049, - ICAL_VALUE_BINARY = 20050, - ICAL_VALUE_BOOLEAN = 20051, - ICAL_VALUE_DATE = 20052, - ICAL_VALUE_DURATION = 20053, - ICAL_VALUE_FLOAT = 20054, - ICAL_VALUE_INTEGER = 20055, - ICAL_VALUE_PERIOD = 20056, - ICAL_VALUE_RECUR = 20057, - ICAL_VALUE_TEXT = 20058, - ICAL_VALUE_TIME = 20059, - ICAL_VALUE_URI = 20060, - ICAL_VALUE_ERROR = 20061, - ICAL_VALUE_DATETIME = 20062, - ICAL_VALUE_UTCOFFSET = 20063, - ICAL_VALUE_CALADDRESS = 20064, - ICAL_VALUE_NONE = 20065 -} icalparameter_value; - -typedef enum icalparameter_xliccomparetype { - ICAL_XLICCOMPARETYPE_X = 20066, - ICAL_XLICCOMPARETYPE_EQUAL = 20067, - ICAL_XLICCOMPARETYPE_NOTEQUAL = 20068, - ICAL_XLICCOMPARETYPE_LESS = 20069, - ICAL_XLICCOMPARETYPE_GREATER = 20070, - ICAL_XLICCOMPARETYPE_LESSEQUAL = 20071, - ICAL_XLICCOMPARETYPE_GREATEREQUAL = 20072, - ICAL_XLICCOMPARETYPE_REGEX = 20073, - ICAL_XLICCOMPARETYPE_NONE = 20074 -} icalparameter_xliccomparetype; - -typedef enum icalparameter_xlicerrortype { - ICAL_XLICERRORTYPE_X = 20075, - ICAL_XLICERRORTYPE_COMPONENTPARSEERROR = 20076, - ICAL_XLICERRORTYPE_PROPERTYPARSEERROR = 20077, - ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR = 20078, - ICAL_XLICERRORTYPE_PARAMETERVALUEPARSEERROR = 20079, - ICAL_XLICERRORTYPE_VALUEPARSEERROR = 20080, - ICAL_XLICERRORTYPE_INVALIDITIP = 20081, - ICAL_XLICERRORTYPE_UNKNOWNVCALPROPERROR = 20082, - ICAL_XLICERRORTYPE_MIMEPARSEERROR = 20083, - ICAL_XLICERRORTYPE_NONE = 20084 -} icalparameter_xlicerrortype; - -#define ICALPARAMETER_LAST_ENUM 20085 - -/* 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); - -/* RELATED */ -icalparameter* icalparameter_new_related(icalparameter_related v); -icalparameter_related icalparameter_get_related(icalparameter* value); -void icalparameter_set_related(icalparameter* value, icalparameter_related 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); - -/* LANGUAGE */ -icalparameter* icalparameter_new_language(const char* v); -const char* icalparameter_get_language(icalparameter* value); -void icalparameter_set_language(icalparameter* value, const char* 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); - -/* ENCODING */ -icalparameter* icalparameter_new_encoding(icalparameter_encoding v); -icalparameter_encoding icalparameter_get_encoding(icalparameter* value); -void icalparameter_set_encoding(icalparameter* value, icalparameter_encoding v); - -/* ALTREP */ -icalparameter* icalparameter_new_altrep(const char* v); -const char* icalparameter_get_altrep(icalparameter* value); -void icalparameter_set_altrep(icalparameter* value, const char* 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); - -/* FBTYPE */ -icalparameter* icalparameter_new_fbtype(icalparameter_fbtype v); -icalparameter_fbtype icalparameter_get_fbtype(icalparameter* value); -void icalparameter_set_fbtype(icalparameter* value, icalparameter_fbtype v); - -/* RSVP */ -icalparameter* icalparameter_new_rsvp(icalparameter_rsvp v); -icalparameter_rsvp icalparameter_get_rsvp(icalparameter* value); -void icalparameter_set_rsvp(icalparameter* value, icalparameter_rsvp 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); - -/* 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); - -/* CN */ -icalparameter* icalparameter_new_cn(const char* v); -const char* icalparameter_get_cn(icalparameter* value); -void icalparameter_set_cn(icalparameter* value, const char* 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); - -/* 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); - -/* PARTSTAT */ -icalparameter* icalparameter_new_partstat(icalparameter_partstat v); -icalparameter_partstat icalparameter_get_partstat(icalparameter* value); -void icalparameter_set_partstat(icalparameter* value, icalparameter_partstat 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); - -/* MEMBER */ -icalparameter* icalparameter_new_member(const char* v); -const char* icalparameter_get_member(icalparameter* value); -void icalparameter_set_member(icalparameter* value, const char* 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); - -/* CUTYPE */ -icalparameter* icalparameter_new_cutype(icalparameter_cutype v); -icalparameter_cutype icalparameter_get_cutype(icalparameter* value); -void icalparameter_set_cutype(icalparameter* value, icalparameter_cutype 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); - -/* DIR */ -icalparameter* icalparameter_new_dir(const char* v); -const char* icalparameter_get_dir(icalparameter* value); -void icalparameter_set_dir(icalparameter* value, const char* v); - -#endif /*ICALPARAMETER_H*/ - -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalvalue.h - CREATOR: eric 20 March 1999 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 - -/* Defined in icalderivedvalue.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); - - -/* Special, non autogenerated value accessors */ - -icalvalue* icalvalue_new_recur (struct icalrecurrencetype v); -void icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v); -struct icalrecurrencetype icalvalue_get_recur(icalvalue* value); - -icalvalue* icalvalue_new_trigger (struct icaltriggertype v); -void icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v); -struct icaltriggertype icalvalue_get_trigger(icalvalue* value); - -icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v); -void icalvalue_set_datetimeperiod(icalvalue* value, - struct icaldatetimeperiodtype v); -struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(icalvalue* value); - -/* Convert enumerations */ - -icalvalue_kind icalvalue_string_to_kind(const char* str); -const char* icalvalue_kind_to_string(icalvalue_kind kind); - - -#endif /*ICALVALUE_H*/ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalparam.h - CREATOR: eric 20 March 1999 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 - - -/* Declared in icalderivedparameter.h */ -/*typedef void icalparameter;*/ - -icalparameter* icalparameter_new(icalparameter_kind kind); -icalparameter* icalparameter_new_clone(icalparameter* p); - -/* Create from string of form "PARAMNAME=VALUE" */ -icalparameter* icalparameter_new_from_string(const char* value); - -/* Create from just the value, the part after the "=" */ -icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind, const 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); - -/* Convert enumerations */ - -const char* icalparameter_kind_to_string(icalparameter_kind kind); -icalparameter_kind icalparameter_string_to_kind(const char* string); - - - -#endif -/* -*- Mode: C -*- - ====================================================================== - FILE: icalderivedproperties.{c,h} - CREATOR: eric 09 May 1999 - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org - ======================================================================*/ - - -#ifndef ICALDERIVEDPROPERTY_H -#define ICALDERIVEDPROPERTY_H - -#include - -typedef void icalproperty; - - -/* Everything below this line is machine generated. Do not edit. */ -typedef enum icalproperty_kind { - ICAL_ANY_PROPERTY = 0, - ICAL_ACTION_PROPERTY, - ICAL_ATTACH_PROPERTY, - ICAL_ATTENDEE_PROPERTY, - ICAL_CALSCALE_PROPERTY, - ICAL_CATEGORIES_PROPERTY, - ICAL_CLASS_PROPERTY, - ICAL_COMMENT_PROPERTY, - ICAL_COMPLETED_PROPERTY, - ICAL_CONTACT_PROPERTY, - ICAL_CREATED_PROPERTY, - ICAL_DESCRIPTION_PROPERTY, - ICAL_DTEND_PROPERTY, - ICAL_DTSTAMP_PROPERTY, - ICAL_DTSTART_PROPERTY, - ICAL_DUE_PROPERTY, - ICAL_DURATION_PROPERTY, - ICAL_EXDATE_PROPERTY, - ICAL_EXRULE_PROPERTY, - ICAL_FREEBUSY_PROPERTY, - ICAL_GEO_PROPERTY, - ICAL_LASTMODIFIED_PROPERTY, - ICAL_LOCATION_PROPERTY, - ICAL_MAXRESULTS_PROPERTY, - ICAL_MAXRESULTSSIZE_PROPERTY, - ICAL_METHOD_PROPERTY, - ICAL_ORGANIZER_PROPERTY, - ICAL_PERCENTCOMPLETE_PROPERTY, - ICAL_PRIORITY_PROPERTY, - ICAL_PRODID_PROPERTY, - ICAL_QUERY_PROPERTY, - ICAL_QUERYNAME_PROPERTY, - ICAL_RDATE_PROPERTY, - ICAL_RECURRENCEID_PROPERTY, - ICAL_RELATEDTO_PROPERTY, - ICAL_REPEAT_PROPERTY, - ICAL_REQUESTSTATUS_PROPERTY, - ICAL_RESOURCES_PROPERTY, - ICAL_RRULE_PROPERTY, - ICAL_SCOPE_PROPERTY, - ICAL_SEQUENCE_PROPERTY, - ICAL_STATUS_PROPERTY, - ICAL_SUMMARY_PROPERTY, - ICAL_TARGET_PROPERTY, - ICAL_TRANSP_PROPERTY, - ICAL_TRIGGER_PROPERTY, - ICAL_TZID_PROPERTY, - ICAL_TZNAME_PROPERTY, - ICAL_TZOFFSETFROM_PROPERTY, - ICAL_TZOFFSETTO_PROPERTY, - ICAL_TZURL_PROPERTY, - ICAL_UID_PROPERTY, - ICAL_URL_PROPERTY, - ICAL_VERSION_PROPERTY, - ICAL_X_PROPERTY, - ICAL_XLICCLUSTERCOUNT_PROPERTY, - ICAL_XLICERROR_PROPERTY, - ICAL_XLICMIMECHARSET_PROPERTY, - ICAL_XLICMIMECID_PROPERTY, - ICAL_XLICMIMECONTENTTYPE_PROPERTY, - ICAL_XLICMIMEENCODING_PROPERTY, - ICAL_XLICMIMEFILENAME_PROPERTY, - ICAL_XLICMIMEOPTINFO_PROPERTY, - ICAL_NO_PROPERTY -} icalproperty_kind; - - -/* ACTION */ -icalproperty* icalproperty_new_action(enum icalproperty_action v); -icalproperty* icalproperty_vanew_action(enum icalproperty_action v, ...); -void icalproperty_set_action(icalproperty* prop, enum icalproperty_action v); -enum icalproperty_action icalproperty_get_action(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* MAXRESULTS */ -icalproperty* icalproperty_new_maxresults(int v); -icalproperty* icalproperty_vanew_maxresults(int v, ...); -void icalproperty_set_maxresults(icalproperty* prop, int v); -int icalproperty_get_maxresults(icalproperty* prop); -/* MAXRESULTSSIZE */ -icalproperty* icalproperty_new_maxresultssize(int v); -icalproperty* icalproperty_vanew_maxresultssize(int v, ...); -void icalproperty_set_maxresultssize(icalproperty* prop, int v); -int icalproperty_get_maxresultssize(icalproperty* prop); -/* METHOD */ -icalproperty* icalproperty_new_method(enum icalproperty_method v); -icalproperty* icalproperty_vanew_method(enum icalproperty_method v, ...); -void icalproperty_set_method(icalproperty* prop, enum icalproperty_method v); -enum icalproperty_method icalproperty_get_method(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* QUERYNAME */ -icalproperty* icalproperty_new_queryname(const char* v); -icalproperty* icalproperty_vanew_queryname(const char* v, ...); -void icalproperty_set_queryname(icalproperty* prop, const char* v); -const char* icalproperty_get_queryname(icalproperty* prop); -/* RDATE */ -icalproperty* icalproperty_new_rdate(struct icaldatetimeperiodtype v); -icalproperty* icalproperty_vanew_rdate(struct icaldatetimeperiodtype v, ...); -void icalproperty_set_rdate(icalproperty* prop, struct icaldatetimeperiodtype v); -struct icaldatetimeperiodtype icalproperty_get_rdate(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* SCOPE */ -icalproperty* icalproperty_new_scope(const char* v); -icalproperty* icalproperty_vanew_scope(const char* v, ...); -void icalproperty_set_scope(icalproperty* prop, const char* v); -const char* icalproperty_get_scope(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); -/* STATUS */ -icalproperty* icalproperty_new_status(enum icalproperty_status v); -icalproperty* icalproperty_vanew_status(enum icalproperty_status v, ...); -void icalproperty_set_status(icalproperty* prop, enum icalproperty_status v); -enum icalproperty_status icalproperty_get_status(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); -/* TARGET */ -icalproperty* icalproperty_new_target(const char* v); -icalproperty* icalproperty_vanew_target(const char* v, ...); -void icalproperty_set_target(icalproperty* prop, const char* v); -const char* icalproperty_get_target(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); -/* TRIGGER */ -icalproperty* icalproperty_new_trigger(struct icaltriggertype v); -icalproperty* icalproperty_vanew_trigger(struct icaltriggertype v, ...); -void icalproperty_set_trigger(icalproperty* prop, struct icaltriggertype v); -struct icaltriggertype icalproperty_get_trigger(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* X-LIC-CLUSTERCOUNT */ -icalproperty* icalproperty_new_xlicclustercount(const char* v); -icalproperty* icalproperty_vanew_xlicclustercount(const char* v, ...); -void icalproperty_set_xlicclustercount(icalproperty* prop, const char* v); -const char* icalproperty_get_xlicclustercount(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); -/* 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); -/* 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); -/* 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-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); -/* 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); -/* 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); - -#endif /*ICALPROPERTY_H*/ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalproperty.h - CREATOR: eric 20 March 1999 - - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 ICALPROPERTY_H -#define ICALPROPERTY_H - -#include - - - - -/* Actually in icalderivedproperty.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_set_parameter_from_string(icalproperty* prop, - const char* name, const char* value); -const char* icalproperty_get_parameter_as_string(icalproperty* prop, - const char* name); - -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); -void icalproperty_set_value_from_string(icalproperty* prop,const char* value, const char* kind); - -icalvalue* icalproperty_get_value(icalproperty* prop); -const char* icalproperty_get_value_as_string(icalproperty* prop); - -/* Deal with X properties */ - -void icalproperty_set_x_name(icalproperty* prop, char* name); -char* icalproperty_get_x_name(icalproperty* prop); - -/* Return the name of the property -- the type name converted to a - string, or the value of _get_x_name if the type is and X property */ -char* icalproperty_get_name (icalproperty* prop); - -icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value); - -/* Convert kinds to string and get default value type */ - -icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind); -icalvalue_kind icalproperty_value_kind_to_kind(icalvalue_kind kind); -const char* icalproperty_kind_to_string(icalproperty_kind kind); -icalproperty_kind icalproperty_string_to_kind(const char* string); - -icalproperty_method icalproperty_string_to_method(const char* str); -const char* icalproperty_method_to_string(icalproperty_method method); - - -const char* icalproperty_enum_to_string(int e); -int icalproperty_string_to_enum(const char* str); - -const char* icalproperty_status_to_string(icalproperty_status); -icalproperty_status icalproperty_string_to_status(const char* string); - -int icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e); - - - - -#endif /*ICALPROPERTY_H*/ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalattendee.h - CREATOR: eric 8 Mar 01 - - - (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 icaltypes.h - -======================================================================*/ - -#ifndef ICALATTENDEE_H -#define ICALATTENDEE_H - -#include - -struct icalorganizertype { - const char* value; - const char* common_name; - const char* dir; - const char* sentby; - const char* language; - -}; - -/* Create a copy of the given organizer. Libical will not own the - memory for the strings in the copy; the call must free them */ -struct icalorganizertype icalorganizertype_new_clone(struct icalorganizertype a); - - -struct icalattendeetype { - const char* cuid; /* Cal user id, contents of the property value */ - /*icalparameter_cutype cutype;*/ - const char* member; - /*icalparameter_role role;*/ - int rsvp; - const char* delto; - const char* delfrom; - const char* sentby; - const char* cn; - const char* dir; - const char* language; -}; - -/* Create a copy of the given attendee. Libical will not own the - memory for the strings in the copy; the call must free them */ -struct icalattendeetype icalattendeetype_new_clone(struct icalattendeetype a); - - -#endif /* !ICALATTENDEE_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); - - -/* - * Working with components - */ - - -/* Return the first VEVENT, VTODO or VJOURNAL sub-component of cop, or - comp if it is one of those types */ - -icalcomponent* icalcomponent_get_inner(icalcomponent* comp); - - -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.*/ - - -/* 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); - -/* Using external iterators */ -icalcompiter icalcomponent_begin_component(icalcomponent* component, - icalcomponent_kind kind); -icalcompiter icalcomponent_end_component(icalcomponent* component, - icalcomponent_kind kind); -icalcomponent* icalcompiter_next(icalcompiter* i); -icalcomponent* icalcompiter_prior(icalcompiter* i); -icalcomponent* icalcompiter_deref(icalcompiter* i); - - - - -/* 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. They are private, and you should not be using them. */ -icalcomponent* icalcomponent_get_parent(icalcomponent* component); -void icalcomponent_set_parent(icalcomponent* component, - icalcomponent* parent); - -/* Kind conversion routiens */ - -icalcomponent_kind icalcomponent_string_to_kind(const char* string); - -const char* icalcomponent_kind_to_string(icalcomponent_kind kind); - - -/************* 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_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); - - -void icalcomponent_set_organizer(icalcomponent* comp, - struct icalorganizertype org); - struct icalorganizertype icalcomponent_get_organizer(icalcomponent* comp); - - -void icalcomponent_add_attendee(icalcomponent *comp, - struct icalattendeetype attendee); - -int icalcomponent_remove_attendee(icalcomponent *comp, char* cuid); - -/* Get the Nth attendee. Out of range indices return an attendee - with cuid == 0 */ -struct icalattendeetype icalcomponent_get_attendee(icalcomponent *comp, - int index); - - - - -/*************** Type Specific routines ***************/ - -icalcomponent* icalcomponent_new_vcalendar(); -icalcomponent* icalcomponent_new_vevent(); -icalcomponent* icalcomponent_new_vtodo(); -icalcomponent* icalcomponent_new_vjournal(); -icalcomponent* icalcomponent_new_valarm(); -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: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - - - (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 /* 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_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(const 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: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 /* 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. Partly to trap calls to strdup, partly - because in -ansi, gcc on Red Hat claims that strudup is undeclared */ -char* icalmemory_strdup(const char *s); - -#endif /* !ICALMEMORY_H */ - - - -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalerror.h - CREATOR: eric 09 May 1999 - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - - - (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 -#include /* 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); - -typedef enum icalerrorenum { - - ICAL_BADARG_ERROR, - ICAL_NEWFAILED_ERROR, - ICAL_ALLOCATION_ERROR, - ICAL_MALFORMEDDATA_ERROR, - ICAL_PARSE_ERROR, - ICAL_INTERNAL_ERROR, /* Like assert --internal consist. prob */ - ICAL_FILE_ERROR, - ICAL_USAGE_ERROR, - ICAL_UNIMPLEMENTED_ERROR, - ICAL_UNKNOWN_ERROR, /* Used for problems in input to icalerror_strerror()*/ - ICAL_NO_ERROR - -} icalerrorenum; - -/* The libical error enumeration, like errno*/ -extern icalerrorenum icalerrno; - -/* If true, libicl aborts after a call to icalerror_set_error*/ -extern int icalerror_errors_are_fatal; - -/* Warning messages */ - -#ifdef __GNUC__ca -#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__ */ - - -void icalerror_clear_errno(void); -void _icalerror_set_errno(icalerrorenum); - -/* Make an individual error fatal or non-fatal. */ -typedef enum icalerrorstate { - ICAL_ERROR_FATAL, /* Not fata */ - ICAL_ERROR_NONFATAL, /* Fatal */ - ICAL_ERROR_DEFAULT, /* Use the value of icalerror_errors_are_fatal*/ - ICAL_ERROR_UNKNOWN /* Asked state for an unknown error type */ -} icalerrorstate ; - -char* icalerror_strerror(icalerrorenum e); -char* icalerror_perror(); -void icalerror_set_error_state( icalerrorenum error, icalerrorstate); -icalerrorstate icalerror_get_error_state( icalerrorenum error); - - -#define icalerror_set_errno(x) \ -icalerrno = x; \ -if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || \ - (icalerror_get_error_state(x)==ICAL_ERROR_DEFAULT && \ - icalerror_errors_are_fatal == 1 )){ \ - icalerror_warn(icalerror_strerror(x)); \ - assert(0); \ -} - - -#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 /* ICAL_ERRORS_ARE_FATAL */ -#define icalerror_assert(test,message) -#endif /* ICAL_ERRORS_ARE_FATAL */ - -/* Check & abort if check fails */ -#define icalerror_check_arg(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); } - -/* Check & return void if check fails*/ -#define icalerror_check_arg_rv(test,arg) if(!(test)) {icalerror_set_errno(ICAL_BADARG_ERROR); return; } - -/* Check & return 0 if check fails*/ -#define icalerror_check_arg_rz(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return 0;} - -/* Check & return an error if check fails*/ -#define icalerror_check_arg_re(test,arg,error) if(!(test)) { icalerror_stop_here(); assert(0); return error;} - -/* Check & return something*/ -#define icalerror_check_arg_rx(test,arg,x) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return x;} - - - -/* String interfaces to set an error to NONFATAL and restore it to its - original value */ - -icalerrorstate icalerror_supress(const char* error); -void icalerror_restore(const char* error, icalerrorstate es); - - -#endif /* !ICALERROR_H */ - - - -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalrestriction.h - CREATOR: eric 24 April 1999 - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - - - (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: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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_minor_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: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $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 /* !ICALMIME_H */ - - - -/* -*- Mode: C -*- - ====================================================================== - FILE: icallangbind.h - CREATOR: eric 25 jan 2001 - - DESCRIPTION: - - $Id: ical.h,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $ - $Locker: $ - - (C) COPYRIGHT 1999 Eric Busboom - http://www.softwarestudio.org - - This package is free software and is provided "as is" without - express or implied warranty. It may be used, redistributed and/or - modified under the same terms as perl itself. ( Either the Artistic - License or the GPL. ) - - ======================================================================*/ - -#ifndef __ICALLANGBIND_H__ -#define __ICALLANGBIND_H__ - -int* icallangbind_new_array(int size); -void icallangbind_free_array(int* array); -int icallangbind_access_array(int* array, int index); -icalproperty* icallangbind_get_property(icalcomponent *c, int n, const char* prop); -const char* icallangbind_get_property_val(icalproperty* p); -const char* icallangbind_get_parameter(icalproperty *p, const char* parameter); -icalcomponent* icallangbind_get_component(icalcomponent *c, const char* comp); - -icalproperty* icallangbind_get_first_property(icalcomponent *c, - const char* prop); - -icalproperty* icallangbind_get_next_property(icalcomponent *c, - const char* prop); - -icalcomponent* icallangbind_get_first_component(icalcomponent *c, - const char* comp); - -icalcomponent* icallangbind_get_next_component(icalcomponent *c, - const char* comp); - - -const char* icallangbind_property_eval_string(icalproperty* prop, char* sep); - - -int icallangbind_string_to_open_flag(const char* str); -#endif /*__ICALLANGBIND_H__*/ diff --git a/other-licenses/libical/src/libical/icalcomponent.c b/other-licenses/libical/src/libical/icalcomponent.c index 0abefe2ad8b..3761bf9fe3c 100644 --- a/other-licenses/libical/src/libical/icalcomponent.c +++ b/other-licenses/libical/src/libical/icalcomponent.c @@ -2,7 +2,7 @@ FILE: icalcomponent.c CREATOR: eric 28 April 1999 - $Id: icalcomponent.c,v 1.2 2001-11-22 19:21:47 mikep%oeone.com Exp $ + $Id: icalcomponent.c,v 1.3 2001-12-21 18:56:13 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -33,19 +33,19 @@ #include "icalmemory.h" #include "icalenums.h" #include "icaltime.h" +#include "icalarray.h" +#include "icaltimezone.h" #include "icalduration.h" #include "icalperiod.h" #include "icalparser.h" +#include "icalrestriction.h" #include /* for malloc */ #include /* for va_list, etc */ #include #include #include /* for fprintf */ - -#ifndef win32 -#include -#endif +#include /* for strdup */ #define MAX_TMP 1024 @@ -59,6 +59,13 @@ struct icalcomponent_impl pvl_list components; pvl_elem component_iterator; icalcomponent* parent; + + /* An array of icaltimezone structs. We use this so we can do fast + lookup of timezones using binary searches. timezones_sorted is + set to 0 whenever we add a timezone, so we remember to sort the + array before doing a binary search. */ + icalarray* timezones; + int timezones_sorted; }; /* icalproperty functions that only components get to use */ @@ -69,6 +76,24 @@ 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); +static void icalcomponent_merge_vtimezone (icalcomponent *comp, + icalcomponent *vtimezone, + icalarray *tzids_to_rename); +static void icalcomponent_handle_conflicting_vtimezones (icalcomponent *comp, + icalcomponent *vtimezone, + icalproperty *tzid_prop, + const char *tzid, + icalarray *tzids_to_rename); +static int icalcomponent_get_tzid_prefix_len (const char *tzid); +static void icalcomponent_rename_tzids(icalcomponent* comp, + icalarray* rename_table); +static void icalcomponent_rename_tzids_callback(icalparameter *param, + void *data); +static int icalcomponent_compare_vtimezones (icalcomponent *vtimezone1, + icalcomponent *vtimezone2); +static int icalcomponent_compare_timezone_fn (const void *elem1, + const void *elem2); + void icalcomponent_add_children(struct icalcomponent_impl *impl,va_list args) { @@ -112,6 +137,8 @@ icalcomponent_new_impl (icalcomponent_kind kind) comp->component_iterator = 0; comp->x_name = 0; comp->parent = 0; + comp->timezones = NULL; + comp->timezones_sorted = 1; return comp; } @@ -202,14 +229,17 @@ icalcomponent_free (icalcomponent* component) #endif if(component != 0 ){ - - while( (prop=pvl_pop(c->properties)) != 0){ - assert(prop != 0); - icalproperty_set_parent(prop,0); - icalproperty_free(prop); - } - - pvl_free(c->properties); + + if ( c->properties != 0 ) + { + while( (prop=pvl_pop(c->properties)) != 0){ + assert(prop != 0); + icalproperty_set_parent(prop,0); + icalproperty_free(prop); + } + pvl_free(c->properties); + } + while( (comp=pvl_data(pvl_head(c->components))) != 0){ assert(comp!=0); @@ -223,6 +253,9 @@ icalcomponent_free (icalcomponent* component) free(c->x_name); } + if (c->timezones) + icaltimezone_array_free (c->timezones); + c->kind = ICAL_NO_COMPONENT; c->properties = 0; c->property_iterator = 0; @@ -230,6 +263,7 @@ icalcomponent_free (icalcomponent* component) c->component_iterator = 0; c->x_name = 0; c->id[0] = 'X'; + c->timezones = NULL; free(c); } @@ -263,7 +297,7 @@ icalcomponent_as_ical_string (icalcomponent* component) icalerror_check_arg_rz( (component!=0), "component"); icalerror_check_arg_rz( (kind!=ICAL_NO_COMPONENT), "component kind is ICAL_NO_COMPONENT"); - kind_string = icalenum_component_kind_to_string(kind); + kind_string = icalcomponent_kind_to_string(kind); icalerror_check_arg_rz( (kind_string!=0),"Unknown kind of component"); @@ -300,7 +334,7 @@ icalcomponent_as_ical_string (icalcomponent* component) icalmemory_append_string(&buf, &buf_ptr, &buf_size, "END:"); icalmemory_append_string(&buf, &buf_ptr, &buf_size, - icalenum_component_kind_to_string(kind)); + icalcomponent_kind_to_string(kind)); icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline); out_buf = icalmemory_tmp_copy(buf); @@ -364,8 +398,8 @@ int icalcomponent_property_sorter(void *a, void *b) kinda = icalproperty_isa((icalproperty*)a); kindb = icalproperty_isa((icalproperty*)b); - ksa = icalenum_property_kind_to_string(kinda); - ksb = icalenum_property_kind_to_string(kindb); + ksa = icalproperty_kind_to_string(kinda); + ksb = icalproperty_kind_to_string(kindb); return strcmp(ksa,ksb); } @@ -530,11 +564,26 @@ 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_component before calling icalcomponent_add_component"); + if (cimpl->parent !=0) { + icalerror_set_errno(ICAL_USAGE_ERROR); + } cimpl->parent = parent; pvl_push(impl->components,child); + + /* If the new component is a VTIMEZONE, add it to our array. */ + if (cimpl->kind == ICAL_VTIMEZONE_COMPONENT) { + /* FIXME: Currently we are also creating this array when loading in + a builtin VTIMEZONE, when we don't need it. */ + if (!impl->timezones) + impl->timezones = icaltimezone_array_new (); + + icaltimezone_array_append_from_vtimezone (impl->timezones, child); + + /* Flag that we need to sort it before doing any binary searches. */ + impl->timezones_sorted = 0; + } } @@ -550,6 +599,22 @@ icalcomponent_remove_component (icalcomponent* parent, icalcomponent* child) impl = (struct icalcomponent_impl*)parent; cimpl = (struct icalcomponent_impl*)child; + /* If the component is a VTIMEZONE, remove it from our array as well. */ + if (cimpl->kind == ICAL_VTIMEZONE_COMPONENT) { + icaltimezone *zone; + int i, num_elements; + + num_elements = impl->timezones ? impl->timezones->num_elements : 0; + for (i = 0; i < num_elements; i++) { + zone = icalarray_element_at (impl->timezones, i); + if (icaltimezone_get_component (zone) == child) { + icaltimezone_free (zone, 0); + icalarray_remove_element_at (impl->timezones, i); + break; + } + } + } + for( itr = pvl_head(impl->components); itr != 0; itr = next_itr) @@ -673,12 +738,19 @@ icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c) if(kind == ICAL_VEVENT_COMPONENT || kind == ICAL_VTODO_COMPONENT || - kind == ICAL_VJOURNAL_COMPONENT ){ + kind == ICAL_VJOURNAL_COMPONENT || + kind == ICAL_VFREEBUSY_COMPONENT ){ return comp; } } return 0; } + +#ifndef WIN32 +#define BEN +#endif + +#ifdef BEN time_t icalcomponent_convert_time(icalproperty *p) { @@ -707,12 +779,25 @@ time_t icalcomponent_convert_time(icalproperty *p) icalproperty_as_ical_string(p), ctime(&convt)); #endif - } else if (sict.is_utc == 0 && tzp == 0 ) { + } else if (sict.is_utc == 0 && tzp == 0 ) { /* not utc and no zone info */ time_t offset; /* _as_timet will use localtime() to do the conversion */ convt = icaltime_as_timet(sict); - offset = icaltime_utc_offset(sict,0); + + /* offset = icaltime_utc_offset(sict,0); */ + + /* benjaminlee: this replaces the line above + maybe it can be changed to something better? */ + + { + struct tm *tmp_tm; + time_t t; + + t = time(NULL); + offset = localtime(&t)->tm_gmtoff; + } + convt += offset; #ifdef TEST_CONVERT_TIME @@ -720,9 +805,17 @@ time_t icalcomponent_convert_time(icalproperty *p) 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)); + /* Convert the local time in the timezone (from tzp) to UTC*/ + const char* mytimezone = icalparameter_get_tzid(tzp); + + icaltimezone_convert_time (&sict, + icaltimezone_get_builtin_timezone(mytimezone), + icaltimezone_get_utc_timezone() + ); + + sict.is_utc = 1; + + convt = icaltime_as_timet(sict); #ifdef TEST_CONVERT_TIME printf("convert time: use _as_utc:\n %s\n %s", @@ -732,6 +825,9 @@ time_t icalcomponent_convert_time(icalproperty *p) return convt; } + +#endif + struct icaltime_span icalcomponent_get_span(icalcomponent* comp) { icalcomponent *inner; @@ -798,7 +894,10 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp) icalerror_clear_errno(); + /* FIXME: Needs updating to new icaltimezone functions. */ +#ifdef BEN span.start = icalcomponent_convert_time(p); +#endif #ifdef TEST_CONVERT_TIME printf("convert time:\n %s %s", @@ -806,9 +905,16 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp) #endif if(icalerrno != ICAL_NO_ERROR){ + + if ( icalerrno != ICAL_MALFORMEDDATA_ERROR ) { span.start = 0; return span; } +#ifndef NO_WARN_ICAL_MALFORMEDDATA_ERROR_HACK + fprintf(stderr, "** WARNING ** %s: %d %s\n", __FILE__, __LINE__, icalerror_strerror(icalerrno)); + fprintf(stderr, "** WARNING ** %s: %d %s\n", __FILE__, __LINE__, "HACK around ICAL_MALFORMEDDATA_ERROR"); +#endif + } /* The end time could be specified as either a DTEND or a DURATION */ p = icalcomponent_get_first_property(inner, ICAL_DTEND_PROPERTY); @@ -822,7 +928,10 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp) } if (p!=0){ + /* FIXME: Needs updating to new icaltimezone functions. */ +#ifdef BEN span.end = icalcomponent_convert_time(p); +#endif } else if (start.is_date == 1) { /* Duration is all day */ span.end = span.start + 60*60*24; @@ -842,6 +951,10 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp) } +int icalcomponent_check_restrictions(icalcomponent* comp){ + icalerror_check_arg_rz(comp!=0,"comp"); + return icalrestriction_check(comp); +} int icalcomponent_count_errors(icalcomponent* component) { @@ -958,10 +1071,7 @@ void icalcomponent_convert_errors(icalcomponent* component) rst.debug = icalproperty_get_xlicerror(p); icalcomponent_add_property(component, - icalproperty_new_requeststatus( - icalreqstattype_as_string(rst) - ) - ); + icalproperty_new_requeststatus(rst)); icalcomponent_remove_property(component,p); } @@ -1076,7 +1186,8 @@ icalcomponent_begin_component(icalcomponent* component,icalcomponent_kind kind) icalerror_check_arg_re( (component!=0),"component",icalcompiter_null); - for( i = pvl_head(impl->components); i != 0; i = pvl_next(itr.iter)) { +// for( i = pvl_head(impl->components); i != 0; i = pvl_next(itr.iter)) { + for( i = pvl_head(impl->components); i != 0; i = pvl_next(i)) { icalcomponent *c = (icalcomponent*) pvl_data(i); @@ -1183,14 +1294,49 @@ icalcomponent* icalcomponent_get_inner(icalcomponent* comp) } } +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); +} + +#define ICALSETUPSET(p_kind) \ + icalcomponent *inner; \ + icalproperty *prop; \ + icalerror_check_arg_rv(comp!=0,"comp");\ + inner = icalcomponent_get_inner(comp); \ + if(inner == 0){\ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);\ + return;\ + }\ + prop = icalcomponent_get_first_property(inner, p_kind); + + 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); - + ICALSETUPSET(ICAL_DTSTART_PROPERTY); if (prop == 0){ prop = icalproperty_new_dtstart(v); @@ -1352,40 +1498,10 @@ struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp) } } -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); - + ICALSETUPSET(ICAL_DTSTAMP_PROPERTY); if (prop == 0){ prop = icalproperty_new_dtstamp(v); @@ -1413,10 +1529,8 @@ struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp) void icalcomponent_set_summary(icalcomponent* comp, const char* v) { - icalcomponent *inner = icalcomponent_get_inner(comp); - icalproperty *prop - = icalcomponent_get_first_property(inner, ICAL_SUMMARY_PROPERTY); - + ICALSETUPSET(ICAL_SUMMARY_PROPERTY) + if (prop == 0){ prop = icalproperty_new_summary(v); icalcomponent_add_property(inner, prop); @@ -1428,9 +1542,18 @@ void icalcomponent_set_summary(icalcomponent* comp, const char* v) const char* icalcomponent_get_summary(icalcomponent* comp) { - icalcomponent *inner = icalcomponent_get_inner(comp); - icalproperty *prop - = icalcomponent_get_first_property(inner,ICAL_SUMMARY_PROPERTY); + icalcomponent *inner; + icalproperty *prop; + icalerror_check_arg_rz(comp!=0,"comp"); + + inner = icalcomponent_get_inner(comp); + + if(inner == 0){ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + return 0; + } + + prop= icalcomponent_get_first_property(inner,ICAL_SUMMARY_PROPERTY); if (prop == 0){ return 0; @@ -1440,11 +1563,72 @@ 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_comment(icalcomponent* comp, const char* v) +{ + ICALSETUPSET(ICAL_COMMENT_PROPERTY); + + if (prop == 0){ + prop = icalproperty_new_comment(v); + icalcomponent_add_property(inner, prop); + } + + icalproperty_set_summary(prop,v); + +} +const char* icalcomponent_get_comment(icalcomponent* comp){ + icalcomponent *inner; + icalproperty *prop; + icalerror_check_arg_rz(comp!=0,"comp"); + + inner = icalcomponent_get_inner(comp); + + if(inner == 0){ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + return 0; + } + + prop= icalcomponent_get_first_property(inner,ICAL_COMMENT_PROPERTY); + + if (prop == 0){ + return 0; + } + + return icalproperty_get_comment(prop); +} + +void icalcomponent_set_uid(icalcomponent* comp, const char* v) +{ + ICALSETUPSET(ICAL_UID_PROPERTY); + + if (prop == 0){ + prop = icalproperty_new_comment(v); + icalcomponent_add_property(inner, prop); + } + + icalproperty_set_summary(prop,v); + +} +const char* icalcomponent_get_uid(icalcomponent* comp){ + icalcomponent *inner; + icalproperty *prop; + icalerror_check_arg_rz(comp!=0,"comp"); + + inner = icalcomponent_get_inner(comp); + + if(inner == 0){ + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); + return 0; + } + + prop= icalcomponent_get_first_property(inner,ICAL_UID_PROPERTY); + + if (prop == 0){ + return 0; + } + + return icalproperty_get_uid(prop); +} -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); @@ -1489,3 +1673,415 @@ icalcomponent* icalcomponent_new_xdaylight() { return icalcomponent_new(ICAL_XDAYLIGHT_COMPONENT); } + + +/* + * Timezone stuff. + */ + +/* This takes 2 VCALENDAR components and merges the second one into the first, + resolving any problems with conflicting TZIDs. comp_to_merge will no + longer exist after calling this function. */ +void icalcomponent_merge_component(icalcomponent* comp, + icalcomponent* comp_to_merge) +{ + icalcomponent *subcomp, *next_subcomp; + icalarray *tzids_to_rename; + int i; + + /* Check that both components are VCALENDAR components. */ + assert (icalcomponent_isa(comp) == ICAL_VCALENDAR_COMPONENT); + assert (icalcomponent_isa(comp_to_merge) == ICAL_VCALENDAR_COMPONENT); + + /* Step through each subcomponent of comp_to_merge, looking for VTIMEZONEs. + For each VTIMEZONE found, check if we need to add it to comp and if we + need to rename it and all TZID references to it. */ + tzids_to_rename = icalarray_new (sizeof (char*), 16); + subcomp = icalcomponent_get_first_component (comp_to_merge, + ICAL_VTIMEZONE_COMPONENT); + while (subcomp) { + next_subcomp = icalcomponent_get_next_component (comp_to_merge, + ICAL_VTIMEZONE_COMPONENT); + /* This will add the VTIMEZONE to comp, if necessary, and also update + the array of TZIDs we need to rename. */ + icalcomponent_merge_vtimezone (comp, subcomp, tzids_to_rename); + /* FIXME: Handle possible NEWFAILED error. */ + + subcomp = next_subcomp; + } + + /* If we need to do any renaming of TZIDs, do it now. */ + if (tzids_to_rename->num_elements != 0) { + icalcomponent_rename_tzids (comp_to_merge, tzids_to_rename); + + /* Now free the tzids_to_rename array. */ + for (i = 0; i < tzids_to_rename->num_elements; i++) { + free (icalarray_element_at (tzids_to_rename, i)); + } + icalarray_free (tzids_to_rename); + } + + /* Now move all the components from comp_to_merge to comp, excluding + VTIMEZONE components. */ + subcomp = icalcomponent_get_first_component (comp_to_merge, + ICAL_ANY_COMPONENT); + while (subcomp) { + next_subcomp = icalcomponent_get_next_component (comp_to_merge, + ICAL_ANY_COMPONENT); + if (icalcomponent_isa(subcomp) != ICAL_VTIMEZONE_COMPONENT) { + icalcomponent_remove_component (comp_to_merge, subcomp); + icalcomponent_add_component (comp, subcomp); + } + subcomp = next_subcomp; + } + + /* Free comp_to_merge. We have moved most of the subcomponents over to + comp now. */ + icalcomponent_free (comp_to_merge); +} + + +static void icalcomponent_merge_vtimezone (icalcomponent *comp, + icalcomponent *vtimezone, + icalarray *tzids_to_rename) +{ + icalproperty *tzid_prop; + const char *tzid; + char *tzid_copy; + icaltimezone *existing_vtimezone; + + /* Get the TZID of the VTIMEZONE. */ + tzid_prop = icalcomponent_get_first_property (vtimezone, ICAL_TZID_PROPERTY); + if (!tzid_prop) + return; + + tzid = icalproperty_get_tzid (tzid_prop); + if (!tzid) + return; + + /* See if there is already a VTIMEZONE in comp with the same TZID. */ + existing_vtimezone = icalcomponent_get_timezone (comp, tzid); + + /* If there is no existing VTIMEZONE with the same TZID, we can just move + the VTIMEZONE to comp and return. */ + if (!existing_vtimezone) { + icalcomponent_remove_component (icalcomponent_get_parent (vtimezone), + vtimezone); + icalcomponent_add_component (comp, vtimezone); + return; + } + + /* If the TZID has a '/' prefix, then we don't have to worry about the + clashing TZIDs, as they are supposed to be exactly the same VTIMEZONE. */ + if (tzid[0] == '/') + return; + + /* Now we have two VTIMEZONEs with the same TZID (which isn't a globally + unique one), so we compare the VTIMEZONE components to see if they are + the same. If they are, we don't need to do anything. We make a copy of + the tzid, since the parameter may get modified in these calls. */ + tzid_copy = strdup (tzid); + if (!tzid_copy) { + icalerror_set_errno(ICAL_NEWFAILED_ERROR); + return; + } + + if (!icalcomponent_compare_vtimezones (existing_vtimezone, vtimezone)) { + /* FIXME: Handle possible NEWFAILED error. */ + + /* Now we have two different VTIMEZONEs with the same TZID. */ + icalcomponent_handle_conflicting_vtimezones (comp, vtimezone, tzid_prop, + tzid_copy, tzids_to_rename); + } + free (tzid_copy); +} + + +static void +icalcomponent_handle_conflicting_vtimezones (icalcomponent *comp, + icalcomponent *vtimezone, + icalproperty *tzid_prop, + const char *tzid, + icalarray *tzids_to_rename) +{ + struct icalcomponent_impl *impl = (struct icalcomponent_impl*)comp; + int tzid_len, i, suffix, max_suffix = 0, num_elements; + char *tzid_copy, *new_tzid, suffix_buf[32]; + + /* Find the length of the TZID without any trailing digits. */ + tzid_len = icalcomponent_get_tzid_prefix_len (tzid); + + /* Step through each of the VTIMEZONEs in comp. We may already have the + clashing VTIMEZONE in the calendar, but it may have been renamed + (i.e. a unique number added on the end of the TZID, e.g. 'London2'). + So we compare the new VTIMEZONE with any VTIMEZONEs that have the + same prefix (e.g. 'London'). If it matches any of those, we have to + rename the TZIDs to that TZID, else we rename to a new TZID, using + the biggest numeric suffix found + 1. */ + num_elements = impl->timezones ? impl->timezones->num_elements : 0; + for (i = 0; i < num_elements; i++) { + icaltimezone *zone; + char *existing_tzid, *existing_tzid_copy; + int existing_tzid_len; + + zone = icalarray_element_at (impl->timezones, i); + existing_tzid = icaltimezone_get_tzid (zone); + + /* Find the length of the TZID without any trailing digits. */ + existing_tzid_len = icalcomponent_get_tzid_prefix_len (existing_tzid); + + /* Check if we have the same prefix. */ + if (tzid_len == existing_tzid_len + && !strncmp (tzid, existing_tzid, tzid_len)) { + /* Compare the VTIMEZONEs. */ + if (icalcomponent_compare_vtimezones (icaltimezone_get_component (zone), + vtimezone)) { + /* The VTIMEZONEs match, so we can use the existing VTIMEZONE. But + we have to rename TZIDs to this TZID. */ + tzid_copy = strdup (tzid); + existing_tzid_copy = strdup (existing_tzid); + if (!tzid_copy || !existing_tzid_copy) { + icalerror_set_errno(ICAL_NEWFAILED_ERROR); + } else { + icalarray_append (tzids_to_rename, tzid_copy); + icalarray_append (tzids_to_rename, existing_tzid_copy); + } + return; + } else { + /* FIXME: Handle possible NEWFAILED error. */ + + /* Convert the suffix to an integer and remember the maximum numeric + suffix found. */ + suffix = atoi (existing_tzid + existing_tzid_len); + if (max_suffix < suffix) + max_suffix = suffix; + } + } + } + + /* We didn't find a VTIMEZONE that matched, so we have to rename the TZID, + using the maximum numerical suffix found + 1. */ + tzid_copy = strdup (tzid); + sprintf (suffix_buf, "%i", max_suffix + 1); + new_tzid = malloc (tzid_len + strlen (suffix_buf) + 1); + if (!new_tzid || !tzid_copy) { + icalerror_set_errno(ICAL_NEWFAILED_ERROR); + return; + } + + strncpy (new_tzid, tzid, tzid_len); + strcpy (new_tzid + tzid_len, suffix_buf); + icalarray_append (tzids_to_rename, tzid_copy); + icalarray_append (tzids_to_rename, new_tzid); +} + + +/* Returns the length of the TZID, without any trailing digits. */ +static int icalcomponent_get_tzid_prefix_len (const char *tzid) +{ + int len; + const char *p; + + len = strlen (tzid); + p = tzid + len - 1; + while (len > 0 && *p >= '0' && *p <= '9') { + p--; + len--; + } + + return len; +} + + +/* Renames all references to the given TZIDs to a new name. rename_table + contains pairs of strings - a current TZID, and the new TZID to rename it + to. */ +static void icalcomponent_rename_tzids(icalcomponent* comp, + icalarray* rename_table) +{ + icalcomponent_foreach_tzid (comp, icalcomponent_rename_tzids_callback, + rename_table); +} + + +static void icalcomponent_rename_tzids_callback(icalparameter *param, void *data) +{ + icalarray *rename_table = data; + const char *tzid; + int i; + + tzid = icalparameter_get_tzid (param); + if (!tzid) + return; + + /* Step through the rename table to see if the current TZID matches + any of the ones we want to rename. */ + for (i = 0; i < rename_table->num_elements - 1; i += 2) { + if (!strcmp (tzid, icalarray_element_at (rename_table, i))) { + icalparameter_set_tzid (param, icalarray_element_at (rename_table, i + 1)); + break; + } + } +} + + +/* Calls the given function for each TZID parameter found in the component. */ +void icalcomponent_foreach_tzid(icalcomponent* comp, + void (*callback)(icalparameter *param, void *data), + void *callback_data) +{ + icalproperty *prop; + icalproperty_kind kind; + icalparameter *param; + icalcomponent *subcomp; + + /* First look for any TZID parameters used in this component itself. */ + prop = icalcomponent_get_first_property (comp, ICAL_ANY_PROPERTY); + while (prop) { + kind = icalproperty_isa (prop); + + /* These are the only properties that can have a TZID. Note that + COMPLETED, CREATED, DTSTAMP & LASTMODIFIED must be in UTC. */ + if (kind == ICAL_DTSTART_PROPERTY || kind == ICAL_DTEND_PROPERTY + || kind == ICAL_DUE_PROPERTY || kind == ICAL_EXDATE_PROPERTY + || kind == ICAL_RDATE_PROPERTY) { + param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); + if (param) + (*callback) (param, callback_data); + } + + prop = icalcomponent_get_next_property (comp, ICAL_ANY_PROPERTY); + } + + /* Now recursively check child components. */ + subcomp = icalcomponent_get_first_component (comp, ICAL_ANY_COMPONENT); + while (subcomp) { + icalcomponent_foreach_tzid (subcomp, callback, callback_data); + subcomp = icalcomponent_get_next_component (comp, ICAL_ANY_COMPONENT); + } +} + + + +/* Returns the icaltimezone from the component corresponding to the given + TZID, or NULL if the component does not have a corresponding VTIMEZONE. */ +icaltimezone* icalcomponent_get_timezone(icalcomponent* comp, const char *tzid) +{ + struct icalcomponent_impl *impl; + icaltimezone *zone; + int lower, upper, middle, cmp; + char *zone_tzid; + + impl = (struct icalcomponent_impl*)comp; + + if (!impl->timezones) + return NULL; + + /* Sort the array if necessary (by the TZID string). */ + if (!impl->timezones_sorted) { + icalarray_sort (impl->timezones, icalcomponent_compare_timezone_fn); + impl->timezones_sorted = 1; + } + + /* Do a simple binary search. */ + lower = middle = 0; + upper = impl->timezones->num_elements; + + while (lower < upper) { + middle = (lower + upper) >> 1; + zone = icalarray_element_at (impl->timezones, middle); + zone_tzid = icaltimezone_get_tzid (zone); + cmp = strcmp (tzid, zone_tzid); + if (cmp == 0) + return zone; + else if (cmp < 0) + upper = middle; + else + lower = middle + 1; + } + + return NULL; +} + + +/* A function to compare 2 icaltimezone elements, used for qsort(). */ +static int icalcomponent_compare_timezone_fn (const void *elem1, + const void *elem2) +{ + icaltimezone *zone1, *zone2; + const char *zone1_tzid, *zone2_tzid; + int retval; + + zone1 = (icaltimezone*) elem1; + zone2 = (icaltimezone*) elem2; + + zone1_tzid = icaltimezone_get_tzid (zone1); + zone2_tzid = icaltimezone_get_tzid (zone2); + + return strcmp (zone1_tzid, zone2_tzid); +} + + +/* Compares 2 VTIMEZONE components to see if they match, ignoring their TZIDs. + It returns 1 if they match, 0 if they don't, or -1 on error. */ +static int icalcomponent_compare_vtimezones (icalcomponent *vtimezone1, + icalcomponent *vtimezone2) +{ + icalproperty *prop1, *prop2; + const char *tzid1, *tzid2; + char *tzid2_copy, *string1, *string2; + int cmp; + + /* Get the TZID property of the first VTIMEZONE. */ + prop1 = icalcomponent_get_first_property (vtimezone1, ICAL_TZID_PROPERTY); + if (!prop1) + return -1; + + tzid1 = icalproperty_get_tzid (prop1); + if (!tzid1) + return -1; + + /* Get the TZID property of the second VTIMEZONE. */ + prop2 = icalcomponent_get_first_property (vtimezone2, ICAL_TZID_PROPERTY); + if (!prop2) + return -1; + + tzid2 = icalproperty_get_tzid (prop2); + if (!tzid2) + return -1; + + /* Copy the second TZID, and set the property to the same as the first + TZID, since we don't care if these match of not. */ + tzid2_copy = strdup (tzid2); + if (!tzid2_copy) { + icalerror_set_errno (ICAL_NEWFAILED_ERROR); + return 0; + } + + icalproperty_set_tzid (prop2, tzid1); + + /* Now convert both VTIMEZONEs to strings and compare them. */ + string1 = icalcomponent_as_ical_string (vtimezone1); + if (!string1) { + free (tzid2_copy); + return -1; + } + + string2 = icalcomponent_as_ical_string (vtimezone2); + if (!string2) { + free (string1); + free (tzid2_copy); + return -1; + } + + cmp = strcmp (string1, string2); + + free (string1); + free (string2); + + /* Now reset the second TZID. */ + icalproperty_set_tzid (prop2, tzid2_copy); + free (tzid2_copy); + + return (cmp == 0) ? 1 : 0; +} diff --git a/other-licenses/libical/src/libical/icalcomponent.h b/other-licenses/libical/src/libical/icalcomponent.h index 6046bbee1ec..29c4a127514 100644 --- a/other-licenses/libical/src/libical/icalcomponent.h +++ b/other-licenses/libical/src/libical/icalcomponent.h @@ -32,6 +32,14 @@ typedef void icalcomponent; +/* An opaque struct representing a timezone. We declare this here to avoid + a circular dependancy. */ +#ifndef ICALTIMEONE_DEFINED +#define ICALTIMEONE_DEFINED +typedef struct _icaltimezone icaltimezone; +#endif + + /* This is exposed so that callers will not have to allocate and deallocate iterators. Pretend that you can't see it. */ typedef struct icalcompiter @@ -97,6 +105,13 @@ void icalcomponent_remove_component(icalcomponent* parent, int icalcomponent_count_components(icalcomponent* component, icalcomponent_kind kind); +/* This takes 2 VCALENDAR components and merges the second one into the first, + resolving any problems with conflicting TZIDs. comp_to_merge will no + longer exist after calling this function. */ +void icalcomponent_merge_component(icalcomponent* comp, + icalcomponent* comp_to_merge); + + /* 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 @@ -121,10 +136,14 @@ icalcomponent* icalcompiter_prior(icalcompiter* i); icalcomponent* icalcompiter_deref(icalcompiter* i); - - /* Working with embedded error properties */ + +/* Check the component against itip rules and insert error properties*/ +/* Working with embedded error properties */ +int icalcomponent_check_restrictions(icalcomponent* comp); + +/*Count embedded errors*/ int icalcomponent_count_errors(icalcomponent* component); /* Remove all X-LIC-ERROR properties*/ @@ -217,7 +236,16 @@ int icalcomponent_remove_attendee(icalcomponent *comp, char* cuid); struct icalattendeetype icalcomponent_get_attendee(icalcomponent *comp, int index); +/* Calls the given function for each TZID parameter found in the component, + and any subcomponents. */ +void icalcomponent_foreach_tzid(icalcomponent* comp, + void (*callback)(icalparameter *param, void *data), + void *callback_data); +/* Returns the icaltimezone in the component corresponding to the TZID, or NULL + if it can't be found. */ +icaltimezone* icalcomponent_get_timezone(icalcomponent* comp, + const char *tzid); /*************** Type Specific routines ***************/ diff --git a/other-licenses/libical/src/libical/icalderivedparameter.c b/other-licenses/libical/src/libical/icalderivedparameter.c deleted file mode 100644 index 52970675b2e..00000000000 --- a/other-licenses/libical/src/libical/icalderivedparameter.c +++ /dev/null @@ -1,1207 +0,0 @@ -/* -*- Mode: C -*- - ====================================================================== - FILE: icalderivedparameters.{c,h} - CREATOR: eric 09 May 1999 - - $Id: icalderivedparameter.c,v 1.1 2001-11-15 19:26:53 mikep%oeone.com Exp $ - $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 icalderivedparameters.{c,h} - - Contributions from: - Graham Davison (g.m.davison@computer.org) - - ======================================================================*/ -/*#line 29 "icalparameter.c.in"*/ -#ifdef HAVE_CONFIG_H -#include -#endif - - -#include "icalparameter.h" -#include "icalparameterimpl.h" - -#include "icalproperty.h" -#include "icalerror.h" -#include "icalmemory.h" - -#include /* for malloc() */ -#include -#include /* for memset() */ - -icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value); - -struct icalparameter_impl* icalparameter_new_impl(icalparameter_kind kind); - -/* This map associates each of the parameters with the string - representation of the paramter's name */ -struct icalparameter_kind_map { - icalparameter_kind kind; - char *name; - -}; - -extern struct icalparameter_kind_map parameter_map[]; - - -const char* icalparameter_kind_to_string(icalparameter_kind kind) -{ - int i; - - for (i=0; parameter_map[i].kind != ICAL_NO_PARAMETER; i++) { - if (parameter_map[i].kind == kind) { - return parameter_map[i].name; - } - } - - return 0; - -} - -icalparameter_kind icalparameter_string_to_kind(const char* string) -{ - int i; - - if (string ==0 ) { - return ICAL_NO_PARAMETER; - } - - for (i=0; parameter_map[i].kind != ICAL_NO_PARAMETER; i++) { - - if (strcmp(parameter_map[i].name, string) == 0) { - return parameter_map[i].kind; - } - } - - if(strncmp(string,"X-",2)==0){ - return ICAL_X_PARAMETER; - } - - return ICAL_NO_PARAMETER; -} - -/* This map associates the enumerations for the VALUE parameter with - the kinds of VALUEs. */ - -struct icalparameter_value_kind_map { - icalparameter_value value; - icalvalue_kind kind; -}; - -extern struct icalparameter_value_kind_map value_kind_map[]; - - -icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value) -{ - int i; - - for (i=0; value_kind_map[i].kind != ICAL_NO_VALUE; i++) { - - if (value_kind_map[i].value == value) { - return value_kind_map[i].kind; - } - } - - return ICAL_NO_VALUE; -} - - -/* This map associates the parameter enumerations with a specific parameter and the string representation of the enumeration */ - -struct icalparameter_map { - icalparameter_kind kind; - int enumeration; - const char* str; -}; - - -extern struct icalparameter_map icalparameter_map[]; - - -const char* icalparameter_enum_to_string(int e) -{ - int i; - - icalerror_check_arg_rz(e >= ICALPARAMETER_FIRST_ENUM,"e"); - icalerror_check_arg_rz(e <= ICALPARAMETER_LAST_ENUM,"e"); - - for (i=0; icalparameter_map[i].kind != ICAL_NO_PARAMETER; i++){ - if(e == icalparameter_map[i].enumeration){ - return icalparameter_map[i].str; - } - } - - return 0; -} - -int icalparameter_string_to_enum(const char* str) -{ - int i; - - icalerror_check_arg_rz(str != 0,"str"); - - for (i=0; icalparameter_map[i].kind != ICAL_NO_PARAMETER; i++){ - if(strcmp(str,icalparameter_map[i].str) == 0) { - return icalparameter_map[i].enumeration; - } - } - - return 0; -} - -icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind,const char* val) -{ - - struct icalparameter_impl* param=0; - int found_kind = 0; - int i; - - icalerror_check_arg_rz((val!=0),"val"); - - /* Search through the parameter map to find a matching kind */ - - param = icalparameter_new_impl(kind); - - for (i=0; icalparameter_map[i].kind != ICAL_NO_PARAMETER; i++){ - if(kind == icalparameter_map[i].kind) { - found_kind = 1; - if(strcmp(val,icalparameter_map[i].str) == 0) { - - param->data = (int)icalparameter_map[i].enumeration; - return param; - } - } - } - - if(found_kind == 1){ - /* The kind was in the parameter map, but the string did not - match, so assume that it is an alternate value, like an - X-value.*/ - - icalparameter_set_xvalue(param, val); - - } else { - - /* If the kind was not found, then it must be a string type */ - - ((struct icalparameter_impl*)param)->string = icalmemory_strdup(val); - - } - - return param; -} - - - - -/* Everything below this line is machine generated. Do not edit. */ -struct icalparameter_value_kind_map value_kind_map[] = { - {ICAL_VALUE_BINARY,ICAL_BINARY_VALUE}, - {ICAL_VALUE_BOOLEAN,ICAL_BOOLEAN_VALUE}, - {ICAL_VALUE_DATE,ICAL_DATE_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_URI,ICAL_URI_VALUE}, - {ICAL_VALUE_DATETIME,ICAL_DATETIME_VALUE}, - {ICAL_VALUE_UTCOFFSET,ICAL_UTCOFFSET_VALUE}, - {ICAL_VALUE_CALADDRESS,ICAL_CALADDRESS_VALUE}, - {ICAL_VALUE_X,ICAL_X_VALUE}, - {ICAL_VALUE_NONE,ICAL_NO_VALUE} -}; - -static struct icalparameter_kind_map parameter_map[] = { - {ICAL_ALTREP_PARAMETER,"ALTREP"}, - {ICAL_CN_PARAMETER,"CN"}, - {ICAL_CUTYPE_PARAMETER,"CUTYPE"}, - {ICAL_DELEGATEDFROM_PARAMETER,"DELEGATED-FROM"}, - {ICAL_DELEGATEDTO_PARAMETER,"DELEGATED-TO"}, - {ICAL_DIR_PARAMETER,"DIR"}, - {ICAL_ENCODING_PARAMETER,"ENCODING"}, - {ICAL_FBTYPE_PARAMETER,"FBTYPE"}, - {ICAL_FMTTYPE_PARAMETER,"FMTTYPE"}, - {ICAL_LANGUAGE_PARAMETER,"LANGUAGE"}, - {ICAL_MEMBER_PARAMETER,"MEMBER"}, - {ICAL_PARTSTAT_PARAMETER,"PARTSTAT"}, - {ICAL_RANGE_PARAMETER,"RANGE"}, - {ICAL_RELATED_PARAMETER,"RELATED"}, - {ICAL_RELTYPE_PARAMETER,"RELTYPE"}, - {ICAL_ROLE_PARAMETER,"ROLE"}, - {ICAL_RSVP_PARAMETER,"RSVP"}, - {ICAL_SENTBY_PARAMETER,"SENT-BY"}, - {ICAL_TZID_PARAMETER,"TZID"}, - {ICAL_VALUE_PARAMETER,"VALUE"}, - {ICAL_X_PARAMETER,"X"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,"X-LIC-COMPARETYPE"}, - {ICAL_XLICERRORTYPE_PARAMETER,"X-LIC-ERRORTYPE"}, - { ICAL_NO_PARAMETER, ""} -}; - -static struct icalparameter_map icalparameter_map[] = { -{ICAL_ANY_PARAMETER,0,""}, - {ICAL_CUTYPE_PARAMETER,ICAL_CUTYPE_INDIVIDUAL,"INDIVIDUAL"}, - {ICAL_CUTYPE_PARAMETER,ICAL_CUTYPE_GROUP,"GROUP"}, - {ICAL_CUTYPE_PARAMETER,ICAL_CUTYPE_RESOURCE,"RESOURCE"}, - {ICAL_CUTYPE_PARAMETER,ICAL_CUTYPE_ROOM,"ROOM"}, - {ICAL_CUTYPE_PARAMETER,ICAL_CUTYPE_UNKNOWN,"UNKNOWN"}, - {ICAL_ENCODING_PARAMETER,ICAL_ENCODING_8BIT,"8BIT"}, - {ICAL_ENCODING_PARAMETER,ICAL_ENCODING_BASE64,"BASE64"}, - {ICAL_FBTYPE_PARAMETER,ICAL_FBTYPE_FREE,"FREE"}, - {ICAL_FBTYPE_PARAMETER,ICAL_FBTYPE_BUSY,"BUSY"}, - {ICAL_FBTYPE_PARAMETER,ICAL_FBTYPE_BUSYUNAVAILABLE,"BUSYUNAVAILABLE"}, - {ICAL_FBTYPE_PARAMETER,ICAL_FBTYPE_BUSYTENTATIVE,"BUSYTENTATIVE"}, - {ICAL_PARTSTAT_PARAMETER,ICAL_PARTSTAT_NEEDSACTION,"NEEDS-ACTION"}, - {ICAL_PARTSTAT_PARAMETER,ICAL_PARTSTAT_ACCEPTED,"ACCEPTED"}, - {ICAL_PARTSTAT_PARAMETER,ICAL_PARTSTAT_DECLINED,"DECLINED"}, - {ICAL_PARTSTAT_PARAMETER,ICAL_PARTSTAT_TENTATIVE,"TENTATIVE"}, - {ICAL_PARTSTAT_PARAMETER,ICAL_PARTSTAT_DELEGATED,"DELEGATED"}, - {ICAL_PARTSTAT_PARAMETER,ICAL_PARTSTAT_COMPLETED,"COMPLETED"}, - {ICAL_PARTSTAT_PARAMETER,ICAL_PARTSTAT_INPROCESS,"INPROCESS"}, - {ICAL_RANGE_PARAMETER,ICAL_RANGE_THISANDPRIOR,"THISANDPRIOR"}, - {ICAL_RANGE_PARAMETER,ICAL_RANGE_THISANDFUTURE,"THISANDFUTURE"}, - {ICAL_RELATED_PARAMETER,ICAL_RELATED_START,"START"}, - {ICAL_RELATED_PARAMETER,ICAL_RELATED_END ,"END "}, - {ICAL_RELTYPE_PARAMETER,ICAL_RELTYPE_PARENT,"PARENT"}, - {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_TRUE,"TRUE"}, - {ICAL_RSVP_PARAMETER,ICAL_RSVP_FALSE,"FALSE"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_BINARY,"BINARY"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_BOOLEAN,"BOOLEAN"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_DATE,"DATE"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_DURATION,"DURATION"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_FLOAT,"FLOAT"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_INTEGER,"INTEGER"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_PERIOD,"PERIOD"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_RECUR,"RECUR"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_TEXT,"TEXT"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_TIME,"TIME"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_URI,"URI"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_ERROR,"ERROR"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_DATETIME,"DATE-TIME"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_UTCOFFSET,"UTC-OFFSET"}, - {ICAL_VALUE_PARAMETER,ICAL_VALUE_CALADDRESS,"CAL-ADDRESS"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,ICAL_XLICCOMPARETYPE_EQUAL,"EQUAL"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,ICAL_XLICCOMPARETYPE_NOTEQUAL,"NOTEQUAL"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,ICAL_XLICCOMPARETYPE_LESS,"LESS"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,ICAL_XLICCOMPARETYPE_GREATER,"GREATER"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,ICAL_XLICCOMPARETYPE_LESSEQUAL,"LESSEQUAL"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,ICAL_XLICCOMPARETYPE_GREATEREQUAL,"GREATEREQUAL"}, - {ICAL_XLICCOMPARETYPE_PARAMETER,ICAL_XLICCOMPARETYPE_REGEX,"REGEX"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_COMPONENTPARSEERROR,"COMPONENT-PARSE-ERROR"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_PROPERTYPARSEERROR,"PROPERTY-PARSE-ERROR"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR,"PARAMETER-NAME-PARSE-ERROR"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_PARAMETERVALUEPARSEERROR,"PARAMETER-VALUE-PARSE-ERROR"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_VALUEPARSEERROR,"VALUE-PARSE-ERROR"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_INVALIDITIP,"INVALID-ITIP"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_UNKNOWNVCALPROPERROR,"UNKNOWN-VCAL-PROP-ERROR"}, - {ICAL_XLICERRORTYPE_PARAMETER,ICAL_XLICERRORTYPE_MIMEPARSEERROR,"MIME-PARSE-ERROR"}, - {ICAL_NO_PARAMETER,0,""}}; - -/* DELEGATED-FROM */ -icalparameter* icalparameter_new_delegatedfrom(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_DELEGATEDFROM_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_delegatedfrom((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_delegatedfrom(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* RELATED */ -icalparameter* icalparameter_new_related(icalparameter_related v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_RELATED_X,"v"); - icalerror_check_arg_rz(v < ICAL_RELATED_NONE,"v"); - impl = icalparameter_new_impl(ICAL_RELATED_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_related((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_related icalparameter_get_related(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - -return (icalparameter_related)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_related(icalparameter* param, icalparameter_related v) -{ - icalerror_check_arg_rv(v >= ICAL_RELATED_X,"v"); - icalerror_check_arg_rv(v < ICAL_RELATED_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* SENT-BY */ -icalparameter* icalparameter_new_sentby(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_SENTBY_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_sentby((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_sentby(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* LANGUAGE */ -icalparameter* icalparameter_new_language(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_LANGUAGE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_language((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_language(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* RELTYPE */ -icalparameter* icalparameter_new_reltype(icalparameter_reltype v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_RELTYPE_X,"v"); - icalerror_check_arg_rz(v < ICAL_RELTYPE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_RELTYPE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_reltype((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_reltype icalparameter_get_reltype(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - if ( ((struct icalparameter_impl*)param)->string != 0){ - return ICAL_RELTYPE_X; - } - -return (icalparameter_reltype)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_reltype(icalparameter* param, icalparameter_reltype v) -{ - icalerror_check_arg_rv(v >= ICAL_RELTYPE_X,"v"); - icalerror_check_arg_rv(v < ICAL_RELTYPE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* ENCODING */ -icalparameter* icalparameter_new_encoding(icalparameter_encoding v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_ENCODING_X,"v"); - icalerror_check_arg_rz(v < ICAL_ENCODING_NONE,"v"); - impl = icalparameter_new_impl(ICAL_ENCODING_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_encoding((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_encoding icalparameter_get_encoding(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - if ( ((struct icalparameter_impl*)param)->string != 0){ - return ICAL_ENCODING_X; - } - -return (icalparameter_encoding)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_encoding(icalparameter* param, icalparameter_encoding v) -{ - icalerror_check_arg_rv(v >= ICAL_ENCODING_X,"v"); - icalerror_check_arg_rv(v < ICAL_ENCODING_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* ALTREP */ -icalparameter* icalparameter_new_altrep(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_ALTREP_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_altrep((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_altrep(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* FMTTYPE */ -icalparameter* icalparameter_new_fmttype(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_FMTTYPE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_fmttype((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_fmttype(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* FBTYPE */ -icalparameter* icalparameter_new_fbtype(icalparameter_fbtype v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_FBTYPE_X,"v"); - icalerror_check_arg_rz(v < ICAL_FBTYPE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_FBTYPE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_fbtype((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_fbtype icalparameter_get_fbtype(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - if ( ((struct icalparameter_impl*)param)->string != 0){ - return ICAL_FBTYPE_X; - } - -return (icalparameter_fbtype)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_fbtype(icalparameter* param, icalparameter_fbtype v) -{ - icalerror_check_arg_rv(v >= ICAL_FBTYPE_X,"v"); - icalerror_check_arg_rv(v < ICAL_FBTYPE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* RSVP */ -icalparameter* icalparameter_new_rsvp(icalparameter_rsvp v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_RSVP_X,"v"); - icalerror_check_arg_rz(v < ICAL_RSVP_NONE,"v"); - impl = icalparameter_new_impl(ICAL_RSVP_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_rsvp((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_rsvp icalparameter_get_rsvp(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - -return (icalparameter_rsvp)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_rsvp(icalparameter* param, icalparameter_rsvp v) -{ - icalerror_check_arg_rv(v >= ICAL_RSVP_X,"v"); - icalerror_check_arg_rv(v < ICAL_RSVP_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* RANGE */ -icalparameter* icalparameter_new_range(icalparameter_range v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_RANGE_X,"v"); - icalerror_check_arg_rz(v < ICAL_RANGE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_RANGE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_range((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_range icalparameter_get_range(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - -return (icalparameter_range)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_range(icalparameter* param, icalparameter_range v) -{ - icalerror_check_arg_rv(v >= ICAL_RANGE_X,"v"); - icalerror_check_arg_rv(v < ICAL_RANGE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* DELEGATED-TO */ -icalparameter* icalparameter_new_delegatedto(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_DELEGATEDTO_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_delegatedto((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_delegatedto(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* CN */ -icalparameter* icalparameter_new_cn(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_CN_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_cn((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_cn(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* ROLE */ -icalparameter* icalparameter_new_role(icalparameter_role v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_ROLE_X,"v"); - icalerror_check_arg_rz(v < ICAL_ROLE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_ROLE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_role((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_role icalparameter_get_role(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - if ( ((struct icalparameter_impl*)param)->string != 0){ - return ICAL_ROLE_X; - } - -return (icalparameter_role)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_role(icalparameter* param, icalparameter_role v) -{ - icalerror_check_arg_rv(v >= ICAL_ROLE_X,"v"); - icalerror_check_arg_rv(v < ICAL_ROLE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* X-LIC-COMPARETYPE */ -icalparameter* icalparameter_new_xliccomparetype(icalparameter_xliccomparetype v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_XLICCOMPARETYPE_X,"v"); - icalerror_check_arg_rz(v < ICAL_XLICCOMPARETYPE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_XLICCOMPARETYPE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_xliccomparetype((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_xliccomparetype icalparameter_get_xliccomparetype(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - -return (icalparameter_xliccomparetype)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_xliccomparetype(icalparameter* param, icalparameter_xliccomparetype v) -{ - icalerror_check_arg_rv(v >= ICAL_XLICCOMPARETYPE_X,"v"); - icalerror_check_arg_rv(v < ICAL_XLICCOMPARETYPE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* PARTSTAT */ -icalparameter* icalparameter_new_partstat(icalparameter_partstat v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_PARTSTAT_X,"v"); - icalerror_check_arg_rz(v < ICAL_PARTSTAT_NONE,"v"); - impl = icalparameter_new_impl(ICAL_PARTSTAT_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_partstat((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_partstat icalparameter_get_partstat(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - if ( ((struct icalparameter_impl*)param)->string != 0){ - return ICAL_PARTSTAT_X; - } - -return (icalparameter_partstat)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_partstat(icalparameter* param, icalparameter_partstat v) -{ - icalerror_check_arg_rv(v >= ICAL_PARTSTAT_X,"v"); - icalerror_check_arg_rv(v < ICAL_PARTSTAT_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* X-LIC-ERRORTYPE */ -icalparameter* icalparameter_new_xlicerrortype(icalparameter_xlicerrortype v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_XLICERRORTYPE_X,"v"); - icalerror_check_arg_rz(v < ICAL_XLICERRORTYPE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_XLICERRORTYPE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_xlicerrortype((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_xlicerrortype icalparameter_get_xlicerrortype(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - -return (icalparameter_xlicerrortype)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_xlicerrortype(icalparameter* param, icalparameter_xlicerrortype v) -{ - icalerror_check_arg_rv(v >= ICAL_XLICERRORTYPE_X,"v"); - icalerror_check_arg_rv(v < ICAL_XLICERRORTYPE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* MEMBER */ -icalparameter* icalparameter_new_member(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_MEMBER_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_member((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_member(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* X */ -icalparameter* icalparameter_new_x(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_X_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_x((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_x(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* CUTYPE */ -icalparameter* icalparameter_new_cutype(icalparameter_cutype v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_CUTYPE_X,"v"); - icalerror_check_arg_rz(v < ICAL_CUTYPE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_CUTYPE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_cutype((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_cutype icalparameter_get_cutype(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - if ( ((struct icalparameter_impl*)param)->string != 0){ - return ICAL_CUTYPE_X; - } - -return (icalparameter_cutype)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_cutype(icalparameter* param, icalparameter_cutype v) -{ - icalerror_check_arg_rv(v >= ICAL_CUTYPE_X,"v"); - icalerror_check_arg_rv(v < ICAL_CUTYPE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* TZID */ -icalparameter* icalparameter_new_tzid(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_TZID_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_tzid((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_tzid(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - -/* VALUE */ -icalparameter* icalparameter_new_value(icalparameter_value v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz(v >= ICAL_VALUE_X,"v"); - icalerror_check_arg_rz(v < ICAL_VALUE_NONE,"v"); - impl = icalparameter_new_impl(ICAL_VALUE_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_value((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -icalparameter_value icalparameter_get_value(icalparameter* param) -{ - icalerror_clear_errno(); -icalerror_check_arg( (param!=0), "param"); - if ( ((struct icalparameter_impl*)param)->string != 0){ - return ICAL_VALUE_X; - } - -return (icalparameter_value)((struct icalparameter_impl*)param)->data; -} - -void icalparameter_set_value(icalparameter* param, icalparameter_value v) -{ - icalerror_check_arg_rv(v >= ICAL_VALUE_X,"v"); - icalerror_check_arg_rv(v < ICAL_VALUE_NONE,"v"); - icalerror_check_arg_rv( (param!=0), "param"); - icalerror_clear_errno(); - - ((struct icalparameter_impl*)param)->data = (int)v; -} - -/* DIR */ -icalparameter* icalparameter_new_dir(const char* v) -{ - struct icalparameter_impl *impl; - icalerror_clear_errno(); - icalerror_check_arg_rz( (v!=0),"v"); - impl = icalparameter_new_impl(ICAL_DIR_PARAMETER); - if (impl == 0) { - return 0; - } - - icalparameter_set_dir((icalparameter*) impl,v); - if (icalerrno != ICAL_NO_ERROR) { - icalparameter_free((icalparameter*) impl); - return 0; - } - - return (icalparameter*) impl; -} - -const char* icalparameter_get_dir(icalparameter* param) -{ - icalerror_clear_errno(); - icalerror_check_arg_rz( (param!=0), "param"); - return (const char*)((struct icalparameter_impl*)param)->string; -} - -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); -} - diff --git a/other-licenses/libical/src/libical/icalderivedparameter.h b/other-licenses/libical/src/libical/icalderivedparameter.h deleted file mode 100644 index 8155e5934c2..00000000000 --- a/other-licenses/libical/src/libical/icalderivedparameter.h +++ /dev/null @@ -1,308 +0,0 @@ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalparam.h - CREATOR: eric 20 March 1999 - - - $Id: icalderivedparameter.h,v 1.1 2001-11-15 19:26:53 mikep%oeone.com Exp $ - $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 ICALDERIVEDPARAMETER_H -#define ICALDERIVEDPARAMETER_H - - -typedef void icalparameter; - -const char* icalparameter_enum_to_string(int e); -int icalparameter_string_to_enum(const char* str); - -/* Everything below this line is machine generated. Do not edit. */ -typedef enum icalparameter_kind { - ICAL_ANY_PARAMETER = 0, - ICAL_ALTREP_PARAMETER, - ICAL_CN_PARAMETER, - ICAL_CUTYPE_PARAMETER, - ICAL_DELEGATEDFROM_PARAMETER, - ICAL_DELEGATEDTO_PARAMETER, - ICAL_DIR_PARAMETER, - ICAL_ENCODING_PARAMETER, - ICAL_FBTYPE_PARAMETER, - ICAL_FMTTYPE_PARAMETER, - ICAL_LANGUAGE_PARAMETER, - ICAL_MEMBER_PARAMETER, - ICAL_PARTSTAT_PARAMETER, - ICAL_RANGE_PARAMETER, - ICAL_RELATED_PARAMETER, - ICAL_RELTYPE_PARAMETER, - ICAL_ROLE_PARAMETER, - ICAL_RSVP_PARAMETER, - ICAL_SENTBY_PARAMETER, - ICAL_TZID_PARAMETER, - ICAL_VALUE_PARAMETER, - ICAL_X_PARAMETER, - ICAL_XLICCOMPARETYPE_PARAMETER, - ICAL_XLICERRORTYPE_PARAMETER, - ICAL_NO_PARAMETER -} icalparameter_kind; - -#define ICALPARAMETER_FIRST_ENUM 20000 - -typedef enum icalparameter_cutype { - ICAL_CUTYPE_X = 20000, - ICAL_CUTYPE_INDIVIDUAL = 20001, - ICAL_CUTYPE_GROUP = 20002, - ICAL_CUTYPE_RESOURCE = 20003, - ICAL_CUTYPE_ROOM = 20004, - ICAL_CUTYPE_UNKNOWN = 20005, - ICAL_CUTYPE_NONE = 20006 -} icalparameter_cutype; - -typedef enum icalparameter_encoding { - ICAL_ENCODING_X = 20007, - ICAL_ENCODING_8BIT = 20008, - ICAL_ENCODING_BASE64 = 20009, - ICAL_ENCODING_NONE = 20010 -} icalparameter_encoding; - -typedef enum icalparameter_fbtype { - ICAL_FBTYPE_X = 20011, - ICAL_FBTYPE_FREE = 20012, - ICAL_FBTYPE_BUSY = 20013, - ICAL_FBTYPE_BUSYUNAVAILABLE = 20014, - ICAL_FBTYPE_BUSYTENTATIVE = 20015, - ICAL_FBTYPE_NONE = 20016 -} icalparameter_fbtype; - -typedef enum icalparameter_partstat { - ICAL_PARTSTAT_X = 20017, - ICAL_PARTSTAT_NEEDSACTION = 20018, - ICAL_PARTSTAT_ACCEPTED = 20019, - ICAL_PARTSTAT_DECLINED = 20020, - ICAL_PARTSTAT_TENTATIVE = 20021, - ICAL_PARTSTAT_DELEGATED = 20022, - ICAL_PARTSTAT_COMPLETED = 20023, - ICAL_PARTSTAT_INPROCESS = 20024, - ICAL_PARTSTAT_NONE = 20025 -} icalparameter_partstat; - -typedef enum icalparameter_range { - ICAL_RANGE_X = 20026, - ICAL_RANGE_THISANDPRIOR = 20027, - ICAL_RANGE_THISANDFUTURE = 20028, - ICAL_RANGE_NONE = 20029 -} icalparameter_range; - -typedef enum icalparameter_related { - ICAL_RELATED_X = 20030, - ICAL_RELATED_START = 20031, - ICAL_RELATED_END = 20032, - ICAL_RELATED_NONE = 20033 -} icalparameter_related; - -typedef enum icalparameter_reltype { - ICAL_RELTYPE_X = 20034, - ICAL_RELTYPE_PARENT = 20035, - ICAL_RELTYPE_CHILD = 20036, - ICAL_RELTYPE_SIBLING = 20037, - ICAL_RELTYPE_NONE = 20038 -} icalparameter_reltype; - -typedef enum icalparameter_role { - ICAL_ROLE_X = 20039, - ICAL_ROLE_CHAIR = 20040, - ICAL_ROLE_REQPARTICIPANT = 20041, - ICAL_ROLE_OPTPARTICIPANT = 20042, - ICAL_ROLE_NONPARTICIPANT = 20043, - ICAL_ROLE_NONE = 20044 -} icalparameter_role; - -typedef enum icalparameter_rsvp { - ICAL_RSVP_X = 20045, - ICAL_RSVP_TRUE = 20046, - ICAL_RSVP_FALSE = 20047, - ICAL_RSVP_NONE = 20048 -} icalparameter_rsvp; - -typedef enum icalparameter_value { - ICAL_VALUE_X = 20049, - ICAL_VALUE_BINARY = 20050, - ICAL_VALUE_BOOLEAN = 20051, - ICAL_VALUE_DATE = 20052, - ICAL_VALUE_DURATION = 20053, - ICAL_VALUE_FLOAT = 20054, - ICAL_VALUE_INTEGER = 20055, - ICAL_VALUE_PERIOD = 20056, - ICAL_VALUE_RECUR = 20057, - ICAL_VALUE_TEXT = 20058, - ICAL_VALUE_TIME = 20059, - ICAL_VALUE_URI = 20060, - ICAL_VALUE_ERROR = 20061, - ICAL_VALUE_DATETIME = 20062, - ICAL_VALUE_UTCOFFSET = 20063, - ICAL_VALUE_CALADDRESS = 20064, - ICAL_VALUE_NONE = 20065 -} icalparameter_value; - -typedef enum icalparameter_xliccomparetype { - ICAL_XLICCOMPARETYPE_X = 20066, - ICAL_XLICCOMPARETYPE_EQUAL = 20067, - ICAL_XLICCOMPARETYPE_NOTEQUAL = 20068, - ICAL_XLICCOMPARETYPE_LESS = 20069, - ICAL_XLICCOMPARETYPE_GREATER = 20070, - ICAL_XLICCOMPARETYPE_LESSEQUAL = 20071, - ICAL_XLICCOMPARETYPE_GREATEREQUAL = 20072, - ICAL_XLICCOMPARETYPE_REGEX = 20073, - ICAL_XLICCOMPARETYPE_NONE = 20074 -} icalparameter_xliccomparetype; - -typedef enum icalparameter_xlicerrortype { - ICAL_XLICERRORTYPE_X = 20075, - ICAL_XLICERRORTYPE_COMPONENTPARSEERROR = 20076, - ICAL_XLICERRORTYPE_PROPERTYPARSEERROR = 20077, - ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR = 20078, - ICAL_XLICERRORTYPE_PARAMETERVALUEPARSEERROR = 20079, - ICAL_XLICERRORTYPE_VALUEPARSEERROR = 20080, - ICAL_XLICERRORTYPE_INVALIDITIP = 20081, - ICAL_XLICERRORTYPE_UNKNOWNVCALPROPERROR = 20082, - ICAL_XLICERRORTYPE_MIMEPARSEERROR = 20083, - ICAL_XLICERRORTYPE_NONE = 20084 -} icalparameter_xlicerrortype; - -#define ICALPARAMETER_LAST_ENUM 20085 - -/* 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); - -/* RELATED */ -icalparameter* icalparameter_new_related(icalparameter_related v); -icalparameter_related icalparameter_get_related(icalparameter* value); -void icalparameter_set_related(icalparameter* value, icalparameter_related 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); - -/* LANGUAGE */ -icalparameter* icalparameter_new_language(const char* v); -const char* icalparameter_get_language(icalparameter* value); -void icalparameter_set_language(icalparameter* value, const char* 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); - -/* ENCODING */ -icalparameter* icalparameter_new_encoding(icalparameter_encoding v); -icalparameter_encoding icalparameter_get_encoding(icalparameter* value); -void icalparameter_set_encoding(icalparameter* value, icalparameter_encoding v); - -/* ALTREP */ -icalparameter* icalparameter_new_altrep(const char* v); -const char* icalparameter_get_altrep(icalparameter* value); -void icalparameter_set_altrep(icalparameter* value, const char* 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); - -/* FBTYPE */ -icalparameter* icalparameter_new_fbtype(icalparameter_fbtype v); -icalparameter_fbtype icalparameter_get_fbtype(icalparameter* value); -void icalparameter_set_fbtype(icalparameter* value, icalparameter_fbtype v); - -/* RSVP */ -icalparameter* icalparameter_new_rsvp(icalparameter_rsvp v); -icalparameter_rsvp icalparameter_get_rsvp(icalparameter* value); -void icalparameter_set_rsvp(icalparameter* value, icalparameter_rsvp 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); - -/* 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); - -/* CN */ -icalparameter* icalparameter_new_cn(const char* v); -const char* icalparameter_get_cn(icalparameter* value); -void icalparameter_set_cn(icalparameter* value, const char* 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); - -/* 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); - -/* PARTSTAT */ -icalparameter* icalparameter_new_partstat(icalparameter_partstat v); -icalparameter_partstat icalparameter_get_partstat(icalparameter* value); -void icalparameter_set_partstat(icalparameter* value, icalparameter_partstat 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); - -/* MEMBER */ -icalparameter* icalparameter_new_member(const char* v); -const char* icalparameter_get_member(icalparameter* value); -void icalparameter_set_member(icalparameter* value, const char* 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); - -/* CUTYPE */ -icalparameter* icalparameter_new_cutype(icalparameter_cutype v); -icalparameter_cutype icalparameter_get_cutype(icalparameter* value); -void icalparameter_set_cutype(icalparameter* value, icalparameter_cutype 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); - -/* DIR */ -icalparameter* icalparameter_new_dir(const char* v); -const char* icalparameter_get_dir(icalparameter* value); -void icalparameter_set_dir(icalparameter* value, const char* v); - -#endif /*ICALPARAMETER_H*/ - diff --git a/other-licenses/libical/src/libical/icalderivedproperty.c b/other-licenses/libical/src/libical/icalderivedproperty.c deleted file mode 100644 index 17307eeaf85..00000000000 --- a/other-licenses/libical/src/libical/icalderivedproperty.c +++ /dev/null @@ -1,2200 +0,0 @@ -/* -*- Mode: C -*- */ - -/*====================================================================== - FILE: icalderivedproperty.c - CREATOR: eric 15 Feb 2001 - - $Id: icalderivedproperty.c,v 1.1 2001-11-15 19:26:54 mikep%oeone.com Exp $ - - - (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 icalproperty.c - -======================================================================*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "icalproperty.h" -#include "icalcomponent.h" -#include "pvl.h" -#include "icalenums.h" -#include "icalerror.h" -#include "icalmemory.h" -#include "icalparser.h" - -#include /* For icalmemory_strdup, rindex */ -#include -#include -#include -#include /* for printf */ -#include /* for va_list, va_start, etc. */ - -#define TMP_BUF_SIZE 1024 - -struct icalproperty_impl* -icalproperty_new_impl (icalproperty_kind kind); - -/* This map associates the property kinds with the string - representation of the property name and the kind of VALUE that the - property uses as a default */ - -struct icalproperty_map { - icalproperty_kind kind; - const char *name; - icalvalue_kind value; - -}; - -extern struct icalproperty_map property_map[]; - -const char* icalproperty_kind_to_string(icalproperty_kind kind) -{ - int i; - - for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) { - if (property_map[i].kind == kind) { - return property_map[i].name; - } - } - - return 0; - -} - - -icalproperty_kind icalproperty_string_to_kind(const char* string) -{ - int i; - - if (string ==0 ) { - return ICAL_NO_PROPERTY; - } - - - for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) { - if (strcmp(property_map[i].name, string) == 0) { - return property_map[i].kind; - } - } - - if(strncmp(string,"X-",2)==0){ - return ICAL_X_PROPERTY; - } - - - return ICAL_NO_PROPERTY; -} - - -icalvalue_kind icalproperty_value_kind_to_kind(icalvalue_kind kind) -{ - int i; - - for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) { - if ( property_map[i].value == kind ) { - return property_map[i].kind; - } - } - - return ICAL_NO_VALUE; -} - - - -icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind) -{ - int i; - - for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) { - if ( property_map[i].kind == kind ) { - return property_map[i].value; - } - } - - return ICAL_NO_VALUE; -} - - -/* This map associates the property enumerations with the king of - property that they are used in and the string representation of the - enumeration */ - -struct icalproperty_enum_map { - icalproperty_kind prop; - int prop_enum; - const char* str; -}; - -extern struct icalproperty_enum_map enum_map[]; - - -const char* icalproperty_enum_to_string(int e) -{ - icalerror_check_arg_rz(e >= ICALPROPERTY_FIRST_ENUM,"e"); - icalerror_check_arg_rz(e <= ICALPROPERTY_LAST_ENUM,"e"); - - return enum_map[e-ICALPROPERTY_FIRST_ENUM].str; -} - -int icalproperty_string_to_enum(const char* str) -{ - int i; - - icalerror_check_arg_rz(str!=0,"str") - - while(*str == ' '){ - str++; - } - - for (i=ICALPROPERTY_FIRST_ENUM; i != ICALPROPERTY_LAST_ENUM; i++) { - if ( strcmp(enum_map[i-ICALPROPERTY_FIRST_ENUM].str, str) == 0) { - return enum_map[i-ICALPROPERTY_FIRST_ENUM].prop_enum; - } - } - - return 0; -} - -int icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e) -{ - int i; - - - for (i=ICALPROPERTY_FIRST_ENUM; i != ICALPROPERTY_LAST_ENUM; i++) { - if(enum_map[i-ICALPROPERTY_FIRST_ENUM].prop_enum == e && - enum_map[i-ICALPROPERTY_FIRST_ENUM].prop == kind ){ - return 1; - } - } - - return 0; -} - - -const char* icalproperty_method_to_string(icalproperty_method method) -{ - icalerror_check_arg_rz(method >= ICAL_METHOD_X,"method"); - icalerror_check_arg_rz(method <= ICAL_METHOD_NONE,"method"); - - return enum_map[method-ICALPROPERTY_FIRST_ENUM].str; -} - -icalproperty_method icalproperty_string_to_method(const char* str) -{ - int i; - - icalerror_check_arg_rx(str!=0,"str",ICAL_METHOD_NONE) - - while(*str == ' '){ - str++; - } - - for (i=ICAL_METHOD_X-ICALPROPERTY_FIRST_ENUM; - i != ICAL_METHOD_NONE-ICALPROPERTY_FIRST_ENUM; - i++) { - if ( strcmp(enum_map[i].str, str) == 0) { - return (icalproperty_method)enum_map[i].prop_enum; - } - } - - return ICAL_METHOD_NONE; -} - - -const char* icalenum_status_to_string(icalproperty_status status) -{ - icalerror_check_arg_rz(status >= ICAL_STATUS_X,"status"); - icalerror_check_arg_rz(status <= ICAL_STATUS_NONE,"status"); - - return enum_map[status-ICALPROPERTY_FIRST_ENUM].str; -} - -icalproperty_status icalenum_string_to_status(const char* str) -{ - int i; - - icalerror_check_arg_rx(str!=0,"str",ICAL_STATUS_NONE) - - while(*str == ' '){ - str++; - } - - for (i=ICAL_STATUS_X-ICALPROPERTY_FIRST_ENUM; - i != ICAL_STATUS_NONE-ICALPROPERTY_FIRST_ENUM; - i++) { - if ( strcmp(enum_map[i].str, str) == 0) { - return (icalproperty_method)enum_map[i].prop_enum; - } - } - - return ICAL_STATUS_NONE; - -} - - - -/* Everything below this line is machine generated. Do not edit. */ -static struct icalproperty_map property_map[] = { -{ICAL_ACTION_PROPERTY,"ACTION",ICAL_ACTION_VALUE}, -{ICAL_ANY_PROPERTY,"ANY",ICAL_NO_VALUE}, -{ICAL_ATTACH_PROPERTY,"ATTACH",ICAL_ATTACH_VALUE}, -{ICAL_ATTENDEE_PROPERTY,"ATTENDEE",ICAL_CALADDRESS_VALUE}, -{ICAL_CALSCALE_PROPERTY,"CALSCALE",ICAL_TEXT_VALUE}, -{ICAL_CATEGORIES_PROPERTY,"CATEGORIES",ICAL_TEXT_VALUE}, -{ICAL_CLASS_PROPERTY,"CLASS",ICAL_TEXT_VALUE}, -{ICAL_COMMENT_PROPERTY,"COMMENT",ICAL_TEXT_VALUE}, -{ICAL_COMPLETED_PROPERTY,"COMPLETED",ICAL_DATETIME_VALUE}, -{ICAL_CONTACT_PROPERTY,"CONTACT",ICAL_TEXT_VALUE}, -{ICAL_CREATED_PROPERTY,"CREATED",ICAL_DATETIME_VALUE}, -{ICAL_DESCRIPTION_PROPERTY,"DESCRIPTION",ICAL_TEXT_VALUE}, -{ICAL_DTEND_PROPERTY,"DTEND",ICAL_DATETIME_VALUE}, -{ICAL_DTSTAMP_PROPERTY,"DTSTAMP",ICAL_DATETIME_VALUE}, -{ICAL_DTSTART_PROPERTY,"DTSTART",ICAL_DATETIME_VALUE}, -{ICAL_DUE_PROPERTY,"DUE",ICAL_DATETIME_VALUE}, -{ICAL_DURATION_PROPERTY,"DURATION",ICAL_DURATION_VALUE}, -{ICAL_EXDATE_PROPERTY,"EXDATE",ICAL_DATETIME_VALUE}, -{ICAL_EXRULE_PROPERTY,"EXRULE",ICAL_RECUR_VALUE}, -{ICAL_FREEBUSY_PROPERTY,"FREEBUSY",ICAL_PERIOD_VALUE}, -{ICAL_GEO_PROPERTY,"GEO",ICAL_GEO_VALUE}, -{ICAL_LASTMODIFIED_PROPERTY,"LAST-MODIFIED",ICAL_DATETIME_VALUE}, -{ICAL_LOCATION_PROPERTY,"LOCATION",ICAL_TEXT_VALUE}, -{ICAL_MAXRESULTS_PROPERTY,"MAXRESULTS",ICAL_INTEGER_VALUE}, -{ICAL_MAXRESULTSSIZE_PROPERTY,"MAXRESULTSSIZE",ICAL_INTEGER_VALUE}, -{ICAL_METHOD_PROPERTY,"METHOD",ICAL_METHOD_VALUE}, -{ICAL_ORGANIZER_PROPERTY,"ORGANIZER",ICAL_CALADDRESS_VALUE}, -{ICAL_PERCENTCOMPLETE_PROPERTY,"PERCENT-COMPLETE",ICAL_INTEGER_VALUE}, -{ICAL_PRIORITY_PROPERTY,"PRIORITY",ICAL_INTEGER_VALUE}, -{ICAL_PRODID_PROPERTY,"PRODID",ICAL_TEXT_VALUE}, -{ICAL_QUERY_PROPERTY,"QUERY",ICAL_QUERY_VALUE}, -{ICAL_QUERYNAME_PROPERTY,"QUERYNAME",ICAL_TEXT_VALUE}, -{ICAL_RDATE_PROPERTY,"RDATE",ICAL_DATETIMEPERIOD_VALUE}, -{ICAL_RECURRENCEID_PROPERTY,"RECURRENCE-ID",ICAL_DATETIME_VALUE}, -{ICAL_RELATEDTO_PROPERTY,"RELATED-TO",ICAL_TEXT_VALUE}, -{ICAL_REPEAT_PROPERTY,"REPEAT",ICAL_INTEGER_VALUE}, -{ICAL_REQUESTSTATUS_PROPERTY,"REQUEST-STATUS",ICAL_STRING_VALUE}, -{ICAL_RESOURCES_PROPERTY,"RESOURCES",ICAL_TEXT_VALUE}, -{ICAL_RRULE_PROPERTY,"RRULE",ICAL_RECUR_VALUE}, -{ICAL_SCOPE_PROPERTY,"SCOPE",ICAL_TEXT_VALUE}, -{ICAL_SEQUENCE_PROPERTY,"SEQUENCE",ICAL_INTEGER_VALUE}, -{ICAL_STATUS_PROPERTY,"STATUS",ICAL_STATUS_VALUE}, -{ICAL_SUMMARY_PROPERTY,"SUMMARY",ICAL_TEXT_VALUE}, -{ICAL_TARGET_PROPERTY,"TARGET",ICAL_CALADDRESS_VALUE}, -{ICAL_TRANSP_PROPERTY,"TRANSP",ICAL_TEXT_VALUE}, -{ICAL_TRIGGER_PROPERTY,"TRIGGER",ICAL_TRIGGER_VALUE}, -{ICAL_TZID_PROPERTY,"TZID",ICAL_TEXT_VALUE}, -{ICAL_TZNAME_PROPERTY,"TZNAME",ICAL_TEXT_VALUE}, -{ICAL_TZOFFSETFROM_PROPERTY,"TZOFFSETFROM",ICAL_UTCOFFSET_VALUE}, -{ICAL_TZOFFSETTO_PROPERTY,"TZOFFSETTO",ICAL_UTCOFFSET_VALUE}, -{ICAL_TZURL_PROPERTY,"TZURL",ICAL_URI_VALUE}, -{ICAL_UID_PROPERTY,"UID",ICAL_TEXT_VALUE}, -{ICAL_URL_PROPERTY,"URL",ICAL_URI_VALUE}, -{ICAL_VERSION_PROPERTY,"VERSION",ICAL_TEXT_VALUE}, -{ICAL_X_PROPERTY,"X",ICAL_TEXT_VALUE}, -{ICAL_XLICCLUSTERCOUNT_PROPERTY,"X-LIC-CLUSTERCOUNT",ICAL_STRING_VALUE}, -{ICAL_XLICERROR_PROPERTY,"X-LIC-ERROR",ICAL_TEXT_VALUE}, -{ICAL_XLICMIMECHARSET_PROPERTY,"X-LIC-MIMECHARSET",ICAL_STRING_VALUE}, -{ICAL_XLICMIMECID_PROPERTY,"X-LIC-MIMECID",ICAL_STRING_VALUE}, -{ICAL_XLICMIMECONTENTTYPE_PROPERTY,"X-LIC-MIMECONTENTTYPE",ICAL_STRING_VALUE}, -{ICAL_XLICMIMEENCODING_PROPERTY,"X-LIC-MIMEENCODING",ICAL_STRING_VALUE}, -{ICAL_XLICMIMEFILENAME_PROPERTY,"X-LIC-MIMEFILENAME",ICAL_STRING_VALUE}, -{ICAL_XLICMIMEOPTINFO_PROPERTY,"X-LIC-MIMEOPTINFO",ICAL_STRING_VALUE}, -{ICAL_NO_PROPERTY,"",ICAL_NO_VALUE}}; - -static struct icalproperty_enum_map enum_map[] = { - {ICAL_ACTION_PROPERTY,ICAL_ACTION_X,"" }, /*10000*/ - {ICAL_ACTION_PROPERTY,ICAL_ACTION_AUDIO,"AUDIO" }, /*10001*/ - {ICAL_ACTION_PROPERTY,ICAL_ACTION_DISPLAY,"DISPLAY" }, /*10002*/ - {ICAL_ACTION_PROPERTY,ICAL_ACTION_EMAIL,"EMAIL" }, /*10003*/ - {ICAL_ACTION_PROPERTY,ICAL_ACTION_PROCEDURE,"PROCEDURE" }, /*10004*/ - {ICAL_ACTION_PROPERTY,ICAL_ACTION_NONE,"" }, /*10005*/ - {ICAL_CLASS_PROPERTY,ICAL_CLASS_X,"" }, /*10006*/ - {ICAL_CLASS_PROPERTY,ICAL_CLASS_PUBLIC,"PUBLIC" }, /*10007*/ - {ICAL_CLASS_PROPERTY,ICAL_CLASS_PRIVATE,"PRIVATE" }, /*10008*/ - {ICAL_CLASS_PROPERTY,ICAL_CLASS_CONFIDENTIAL,"CONFIDENTIAL" }, /*10009*/ - {ICAL_CLASS_PROPERTY,ICAL_CLASS_NONE,"" }, /*10010*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_X,"" }, /*10011*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_PUBLISH,"PUBLISH" }, /*10012*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_REQUEST,"REQUEST" }, /*10013*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_REPLY,"REPLY" }, /*10014*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_ADD,"ADD" }, /*10015*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_CANCEL,"CANCEL" }, /*10016*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_REFRESH,"REFRESH" }, /*10017*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_COUNTER,"COUNTER" }, /*10018*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_DECLINECOUNTER,"DECLINECOUNTER" }, /*10019*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_CREATE,"CREATE" }, /*10020*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_READ,"READ" }, /*10021*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_RESPONSE,"RESPONSE" }, /*10022*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_MOVE,"MOVE" }, /*10023*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_MODIFY,"MODIFY" }, /*10024*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_GENERATEUID,"GENERATEUID" }, /*10025*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_DELETE,"DELETE" }, /*10026*/ - {ICAL_METHOD_PROPERTY,ICAL_METHOD_NONE,"" }, /*10027*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_X,"" }, /*10028*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_TENTATIVE,"TENTATIVE" }, /*10029*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_CONFIRMED,"CONFIRMED" }, /*10030*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_COMPLETED,"COMPLETED" }, /*10031*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_NEEDSACTION,"NEEDS-ACTION" }, /*10032*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_CANCELLED,"CANCELLED" }, /*10033*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_INPROCESS,"IN-PROCESS" }, /*10034*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_DRAFT,"DRAFT" }, /*10035*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_FINAL,"FINAL" }, /*10036*/ - {ICAL_STATUS_PROPERTY,ICAL_STATUS_NONE,"" }, /*10037*/ - {ICAL_TRANSP_PROPERTY,ICAL_TRANSP_X,"" }, /*10038*/ - {ICAL_TRANSP_PROPERTY,ICAL_TRANSP_OPAQUE,"OPAQUE" }, /*10039*/ - {ICAL_TRANSP_PROPERTY,ICAL_TRANSP_TRANSPARENT,"TRANSPARENT" }, /*10040*/ - {ICAL_TRANSP_PROPERTY,ICAL_TRANSP_NONE,"" }, /*10041*/ - {ICAL_NO_PROPERTY,0,""} -}; - -/* ACTION */ -icalproperty* icalproperty_new_action(enum icalproperty_action v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ACTION_PROPERTY); - icalproperty_set_action((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_action(enum icalproperty_action v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ACTION_PROPERTY); - icalproperty_set_action((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_action(icalproperty* prop, enum icalproperty_action v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_action(v); - icalproperty_set_value(prop,value); -} -enum icalproperty_action icalproperty_get_action(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_action(value); -} -/* ATTACH */ -icalproperty* icalproperty_new_attach(struct icalattachtype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ATTACH_PROPERTY); - icalproperty_set_attach((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_attach(struct icalattachtype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ATTACH_PROPERTY); - icalproperty_set_attach((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_attach(icalproperty* prop, struct icalattachtype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_attach(v); - icalproperty_set_value(prop,value); -} -struct icalattachtype icalproperty_get_attach(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_attach(value); -} -/* ATTENDEE */ -icalproperty* icalproperty_new_attendee(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ATTENDEE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_attendee((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_attendee(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ATTENDEE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_attendee((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_attendee(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_caladdress(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_attendee(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_caladdress(value); -} -/* CALSCALE */ -icalproperty* icalproperty_new_calscale(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CALSCALE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_calscale((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_calscale(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CALSCALE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_calscale((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_calscale(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_calscale(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* CATEGORIES */ -icalproperty* icalproperty_new_categories(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CATEGORIES_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_categories((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_categories(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CATEGORIES_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_categories((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_categories(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_categories(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* CLASS */ -icalproperty* icalproperty_new_class(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CLASS_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_class((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_class(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CLASS_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_class((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_class(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_class(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* COMMENT */ -icalproperty* icalproperty_new_comment(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_COMMENT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_comment((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_comment(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_COMMENT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_comment((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_comment(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_comment(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* COMPLETED */ -icalproperty* icalproperty_new_completed(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_COMPLETED_PROPERTY); - icalproperty_set_completed((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_completed(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_COMPLETED_PROPERTY); - icalproperty_set_completed((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_completed(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_completed(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* CONTACT */ -icalproperty* icalproperty_new_contact(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CONTACT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_contact((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_contact(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CONTACT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_contact((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_contact(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_contact(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* CREATED */ -icalproperty* icalproperty_new_created(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CREATED_PROPERTY); - icalproperty_set_created((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_created(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_CREATED_PROPERTY); - icalproperty_set_created((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_created(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_created(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* DESCRIPTION */ -icalproperty* icalproperty_new_description(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DESCRIPTION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_description((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_description(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DESCRIPTION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_description((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_description(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_description(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* DTEND */ -icalproperty* icalproperty_new_dtend(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DTEND_PROPERTY); - icalproperty_set_dtend((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_dtend(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DTEND_PROPERTY); - icalproperty_set_dtend((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_dtend(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_dtend(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* DTSTAMP */ -icalproperty* icalproperty_new_dtstamp(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DTSTAMP_PROPERTY); - icalproperty_set_dtstamp((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_dtstamp(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DTSTAMP_PROPERTY); - icalproperty_set_dtstamp((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_dtstamp(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_dtstamp(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* DTSTART */ -icalproperty* icalproperty_new_dtstart(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DTSTART_PROPERTY); - icalproperty_set_dtstart((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_dtstart(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DTSTART_PROPERTY); - icalproperty_set_dtstart((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_dtstart(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_dtstart(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* DUE */ -icalproperty* icalproperty_new_due(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DUE_PROPERTY); - icalproperty_set_due((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_due(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DUE_PROPERTY); - icalproperty_set_due((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_due(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_due(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* DURATION */ -icalproperty* icalproperty_new_duration(struct icaldurationtype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DURATION_PROPERTY); - icalproperty_set_duration((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_duration(struct icaldurationtype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_DURATION_PROPERTY); - icalproperty_set_duration((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_duration(icalproperty* prop, struct icaldurationtype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_duration(v); - icalproperty_set_value(prop,value); -} -struct icaldurationtype icalproperty_get_duration(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_duration(value); -} -/* EXDATE */ -icalproperty* icalproperty_new_exdate(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_EXDATE_PROPERTY); - icalproperty_set_exdate((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_exdate(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_EXDATE_PROPERTY); - icalproperty_set_exdate((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_exdate(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_exdate(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* EXRULE */ -icalproperty* icalproperty_new_exrule(struct icalrecurrencetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_EXRULE_PROPERTY); - icalproperty_set_exrule((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_exrule(struct icalrecurrencetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_EXRULE_PROPERTY); - icalproperty_set_exrule((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_exrule(icalproperty* prop, struct icalrecurrencetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_recur(v); - icalproperty_set_value(prop,value); -} -struct icalrecurrencetype icalproperty_get_exrule(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_recur(value); -} -/* FREEBUSY */ -icalproperty* icalproperty_new_freebusy(struct icalperiodtype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_FREEBUSY_PROPERTY); - icalproperty_set_freebusy((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_freebusy(struct icalperiodtype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_FREEBUSY_PROPERTY); - icalproperty_set_freebusy((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_freebusy(icalproperty* prop, struct icalperiodtype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_period(v); - icalproperty_set_value(prop,value); -} -struct icalperiodtype icalproperty_get_freebusy(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_period(value); -} -/* GEO */ -icalproperty* icalproperty_new_geo(struct icalgeotype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_GEO_PROPERTY); - icalproperty_set_geo((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_geo(struct icalgeotype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_GEO_PROPERTY); - icalproperty_set_geo((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_geo(icalproperty* prop, struct icalgeotype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_geo(v); - icalproperty_set_value(prop,value); -} -struct icalgeotype icalproperty_get_geo(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_geo(value); -} -/* LAST-MODIFIED */ -icalproperty* icalproperty_new_lastmodified(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_LASTMODIFIED_PROPERTY); - icalproperty_set_lastmodified((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_lastmodified(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_LASTMODIFIED_PROPERTY); - icalproperty_set_lastmodified((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_lastmodified(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_lastmodified(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* LOCATION */ -icalproperty* icalproperty_new_location(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_LOCATION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_location((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_location(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_LOCATION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_location((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_location(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_location(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* MAXRESULTS */ -icalproperty* icalproperty_new_maxresults(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_MAXRESULTS_PROPERTY); - icalproperty_set_maxresults((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_maxresults(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_MAXRESULTS_PROPERTY); - icalproperty_set_maxresults((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_maxresults(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_integer(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_maxresults(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_integer(value); -} -/* MAXRESULTSSIZE */ -icalproperty* icalproperty_new_maxresultssize(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_MAXRESULTSSIZE_PROPERTY); - icalproperty_set_maxresultssize((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_maxresultssize(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_MAXRESULTSSIZE_PROPERTY); - icalproperty_set_maxresultssize((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_maxresultssize(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_integer(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_maxresultssize(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_integer(value); -} -/* METHOD */ -icalproperty* icalproperty_new_method(enum icalproperty_method v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_METHOD_PROPERTY); - icalproperty_set_method((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_method(enum icalproperty_method v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_METHOD_PROPERTY); - icalproperty_set_method((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_method(icalproperty* prop, enum icalproperty_method v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_method(v); - icalproperty_set_value(prop,value); -} -enum icalproperty_method icalproperty_get_method(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_method(value); -} -/* ORGANIZER */ -icalproperty* icalproperty_new_organizer(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ORGANIZER_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_organizer((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_organizer(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_ORGANIZER_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_organizer((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_organizer(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_caladdress(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_organizer(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_caladdress(value); -} -/* PERCENT-COMPLETE */ -icalproperty* icalproperty_new_percentcomplete(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PERCENTCOMPLETE_PROPERTY); - icalproperty_set_percentcomplete((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_percentcomplete(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PERCENTCOMPLETE_PROPERTY); - icalproperty_set_percentcomplete((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_percentcomplete(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_integer(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_percentcomplete(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_integer(value); -} -/* PRIORITY */ -icalproperty* icalproperty_new_priority(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PRIORITY_PROPERTY); - icalproperty_set_priority((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_priority(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PRIORITY_PROPERTY); - icalproperty_set_priority((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_priority(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_integer(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_priority(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_integer(value); -} -/* PRODID */ -icalproperty* icalproperty_new_prodid(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PRODID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_prodid((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_prodid(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_PRODID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_prodid((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_prodid(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_prodid(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* QUERY */ -icalproperty* icalproperty_new_query(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_QUERY_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_query((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_query(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_QUERY_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_query((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_query(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_query(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_query(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_query(value); -} -/* QUERYNAME */ -icalproperty* icalproperty_new_queryname(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_QUERYNAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_queryname((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_queryname(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_QUERYNAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_queryname((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_queryname(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_queryname(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* RDATE */ -icalproperty* icalproperty_new_rdate(struct icaldatetimeperiodtype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RDATE_PROPERTY); - icalproperty_set_rdate((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_rdate(struct icaldatetimeperiodtype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RDATE_PROPERTY); - icalproperty_set_rdate((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_rdate(icalproperty* prop, struct icaldatetimeperiodtype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetimeperiod(v); - icalproperty_set_value(prop,value); -} -struct icaldatetimeperiodtype icalproperty_get_rdate(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetimeperiod(value); -} -/* RECURRENCE-ID */ -icalproperty* icalproperty_new_recurrenceid(struct icaltimetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RECURRENCEID_PROPERTY); - icalproperty_set_recurrenceid((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_recurrenceid(struct icaltimetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RECURRENCEID_PROPERTY); - icalproperty_set_recurrenceid((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_recurrenceid(icalproperty* prop, struct icaltimetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_datetime(v); - icalproperty_set_value(prop,value); -} -struct icaltimetype icalproperty_get_recurrenceid(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_datetime(value); -} -/* RELATED-TO */ -icalproperty* icalproperty_new_relatedto(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RELATEDTO_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_relatedto((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_relatedto(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RELATEDTO_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_relatedto((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_relatedto(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_relatedto(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* REPEAT */ -icalproperty* icalproperty_new_repeat(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_REPEAT_PROPERTY); - icalproperty_set_repeat((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_repeat(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_REPEAT_PROPERTY); - icalproperty_set_repeat((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_repeat(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_integer(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_repeat(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_integer(value); -} -/* REQUEST-STATUS */ -icalproperty* icalproperty_new_requeststatus(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_REQUESTSTATUS_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_requeststatus((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_requeststatus(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_REQUESTSTATUS_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_requeststatus((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_requeststatus(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_requeststatus(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} -/* RESOURCES */ -icalproperty* icalproperty_new_resources(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RESOURCES_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_resources((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_resources(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RESOURCES_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_resources((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_resources(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_resources(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* RRULE */ -icalproperty* icalproperty_new_rrule(struct icalrecurrencetype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RRULE_PROPERTY); - icalproperty_set_rrule((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_rrule(struct icalrecurrencetype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_RRULE_PROPERTY); - icalproperty_set_rrule((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_rrule(icalproperty* prop, struct icalrecurrencetype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_recur(v); - icalproperty_set_value(prop,value); -} -struct icalrecurrencetype icalproperty_get_rrule(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_recur(value); -} -/* SCOPE */ -icalproperty* icalproperty_new_scope(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SCOPE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_scope((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_scope(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SCOPE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_scope((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_scope(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_scope(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* SEQUENCE */ -icalproperty* icalproperty_new_sequence(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SEQUENCE_PROPERTY); - icalproperty_set_sequence((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_sequence(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SEQUENCE_PROPERTY); - icalproperty_set_sequence((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_sequence(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_integer(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_sequence(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_integer(value); -} -/* STATUS */ -icalproperty* icalproperty_new_status(enum icalproperty_status v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_STATUS_PROPERTY); - icalproperty_set_status((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_status(enum icalproperty_status v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_STATUS_PROPERTY); - icalproperty_set_status((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_status(icalproperty* prop, enum icalproperty_status v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_status(v); - icalproperty_set_value(prop,value); -} -enum icalproperty_status icalproperty_get_status(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_status(value); -} -/* SUMMARY */ -icalproperty* icalproperty_new_summary(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SUMMARY_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_summary((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_summary(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_SUMMARY_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_summary((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_summary(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_summary(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* TARGET */ -icalproperty* icalproperty_new_target(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TARGET_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_target((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_target(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TARGET_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_target((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_target(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_caladdress(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_target(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_caladdress(value); -} -/* TRANSP */ -icalproperty* icalproperty_new_transp(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TRANSP_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_transp((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_transp(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TRANSP_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_transp((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_transp(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_transp(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* TRIGGER */ -icalproperty* icalproperty_new_trigger(struct icaltriggertype v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TRIGGER_PROPERTY); - icalproperty_set_trigger((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_trigger(struct icaltriggertype v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TRIGGER_PROPERTY); - icalproperty_set_trigger((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_trigger(icalproperty* prop, struct icaltriggertype v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_trigger(v); - icalproperty_set_value(prop,value); -} -struct icaltriggertype icalproperty_get_trigger(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_trigger(value); -} -/* TZID */ -icalproperty* icalproperty_new_tzid(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_tzid((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_tzid(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_tzid((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_tzid(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_tzid(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* TZNAME */ -icalproperty* icalproperty_new_tzname(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZNAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_tzname((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_tzname(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZNAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_tzname((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_tzname(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_tzname(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* TZOFFSETFROM */ -icalproperty* icalproperty_new_tzoffsetfrom(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZOFFSETFROM_PROPERTY); - icalproperty_set_tzoffsetfrom((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_tzoffsetfrom(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZOFFSETFROM_PROPERTY); - icalproperty_set_tzoffsetfrom((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_tzoffsetfrom(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_utcoffset(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_tzoffsetfrom(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_utcoffset(value); -} -/* TZOFFSETTO */ -icalproperty* icalproperty_new_tzoffsetto(int v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZOFFSETTO_PROPERTY); - icalproperty_set_tzoffsetto((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_tzoffsetto(int v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZOFFSETTO_PROPERTY); - icalproperty_set_tzoffsetto((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_tzoffsetto(icalproperty* prop, int v){ - icalvalue *value; - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_utcoffset(v); - icalproperty_set_value(prop,value); -} -int icalproperty_get_tzoffsetto(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_utcoffset(value); -} -/* TZURL */ -icalproperty* icalproperty_new_tzurl(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZURL_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_tzurl((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_tzurl(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_TZURL_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_tzurl((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_tzurl(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_uri(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_tzurl(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_uri(value); -} -/* UID */ -icalproperty* icalproperty_new_uid(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_UID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_uid((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_uid(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_UID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_uid((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_uid(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_uid(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* URL */ -icalproperty* icalproperty_new_url(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_URL_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_url((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_url(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_URL_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_url((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_url(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_uri(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_url(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_uri(value); -} -/* VERSION */ -icalproperty* icalproperty_new_version(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_VERSION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_version((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_version(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_VERSION_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_version((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_version(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_version(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* X */ -icalproperty* icalproperty_new_x(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_X_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_x((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_x(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_X_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_x((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_x(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_x(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* X-LIC-CLUSTERCOUNT */ -icalproperty* icalproperty_new_xlicclustercount(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICCLUSTERCOUNT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicclustercount((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicclustercount(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICCLUSTERCOUNT_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicclustercount((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicclustercount(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicclustercount(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} -/* X-LIC-ERROR */ -icalproperty* icalproperty_new_xlicerror(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICERROR_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicerror((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicerror(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICERROR_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicerror((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicerror(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_text(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicerror(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_text(value); -} -/* X-LIC-MIMECHARSET */ -icalproperty* icalproperty_new_xlicmimecharset(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECHARSET_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimecharset((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicmimecharset(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECHARSET_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimecharset((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicmimecharset(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicmimecharset(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} -/* X-LIC-MIMECID */ -icalproperty* icalproperty_new_xlicmimecid(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimecid((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicmimecid(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECID_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimecid((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicmimecid(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicmimecid(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} -/* X-LIC-MIMECONTENTTYPE */ -icalproperty* icalproperty_new_xlicmimecontenttype(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECONTENTTYPE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimecontenttype((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicmimecontenttype(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMECONTENTTYPE_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimecontenttype((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicmimecontenttype(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicmimecontenttype(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} -/* X-LIC-MIMEENCODING */ -icalproperty* icalproperty_new_xlicmimeencoding(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEENCODING_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimeencoding((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicmimeencoding(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEENCODING_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimeencoding((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicmimeencoding(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicmimeencoding(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} -/* X-LIC-MIMEFILENAME */ -icalproperty* icalproperty_new_xlicmimefilename(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEFILENAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimefilename((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicmimefilename(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEFILENAME_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimefilename((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicmimefilename(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicmimefilename(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} -/* X-LIC-MIMEOPTINFO */ -icalproperty* icalproperty_new_xlicmimeoptinfo(const char* v) { - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEOPTINFO_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimeoptinfo((icalproperty*)impl,v); - return (icalproperty*)impl; -} -icalproperty* icalproperty_vanew_xlicmimeoptinfo(const char* v, ...){ - va_list args; - struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_XLICMIMEOPTINFO_PROPERTY); icalerror_check_arg_rz( (v!=0),"v"); - - icalproperty_set_xlicmimeoptinfo((icalproperty*)impl,v); - va_start(args,v); - icalproperty_add_parameters(impl, args); - va_end(args); - return (icalproperty*)impl; -} -void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, const char* v){ - icalvalue *value; - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_arg_rv( (prop!=0),"prop"); - value = icalvalue_new_string(v); - icalproperty_set_value(prop,value); -} -const char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop){ - icalvalue *value; - icalerror_check_arg( (prop!=0),"prop"); - value = icalproperty_get_value(prop); - return icalvalue_get_string(value); -} diff --git a/other-licenses/libical/src/libical/icalderivedproperty.h b/other-licenses/libical/src/libical/icalderivedproperty.h deleted file mode 100644 index fc9b00502e2..00000000000 --- a/other-licenses/libical/src/libical/icalderivedproperty.h +++ /dev/null @@ -1,403 +0,0 @@ -/* -*- Mode: C -*- - ====================================================================== - FILE: icalderivedproperties.{c,h} - CREATOR: eric 09 May 1999 - - $Id: icalderivedproperty.h,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $ - - (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org - ======================================================================*/ - - -#ifndef ICALDERIVEDPROPERTY_H -#define ICALDERIVEDPROPERTY_H - -#include -#include "icalparameter.h" -#include "icalderivedvalue.h" -#include "icalrecur.h" - -typedef void icalproperty; - - -/* Everything below this line is machine generated. Do not edit. */ -typedef enum icalproperty_kind { - ICAL_ANY_PROPERTY = 0, - ICAL_ACTION_PROPERTY, - ICAL_ATTACH_PROPERTY, - ICAL_ATTENDEE_PROPERTY, - ICAL_CALSCALE_PROPERTY, - ICAL_CATEGORIES_PROPERTY, - ICAL_CLASS_PROPERTY, - ICAL_COMMENT_PROPERTY, - ICAL_COMPLETED_PROPERTY, - ICAL_CONTACT_PROPERTY, - ICAL_CREATED_PROPERTY, - ICAL_DESCRIPTION_PROPERTY, - ICAL_DTEND_PROPERTY, - ICAL_DTSTAMP_PROPERTY, - ICAL_DTSTART_PROPERTY, - ICAL_DUE_PROPERTY, - ICAL_DURATION_PROPERTY, - ICAL_EXDATE_PROPERTY, - ICAL_EXRULE_PROPERTY, - ICAL_FREEBUSY_PROPERTY, - ICAL_GEO_PROPERTY, - ICAL_LASTMODIFIED_PROPERTY, - ICAL_LOCATION_PROPERTY, - ICAL_MAXRESULTS_PROPERTY, - ICAL_MAXRESULTSSIZE_PROPERTY, - ICAL_METHOD_PROPERTY, - ICAL_ORGANIZER_PROPERTY, - ICAL_PERCENTCOMPLETE_PROPERTY, - ICAL_PRIORITY_PROPERTY, - ICAL_PRODID_PROPERTY, - ICAL_QUERY_PROPERTY, - ICAL_QUERYNAME_PROPERTY, - ICAL_RDATE_PROPERTY, - ICAL_RECURRENCEID_PROPERTY, - ICAL_RELATEDTO_PROPERTY, - ICAL_REPEAT_PROPERTY, - ICAL_REQUESTSTATUS_PROPERTY, - ICAL_RESOURCES_PROPERTY, - ICAL_RRULE_PROPERTY, - ICAL_SCOPE_PROPERTY, - ICAL_SEQUENCE_PROPERTY, - ICAL_STATUS_PROPERTY, - ICAL_SUMMARY_PROPERTY, - ICAL_TARGET_PROPERTY, - ICAL_TRANSP_PROPERTY, - ICAL_TRIGGER_PROPERTY, - ICAL_TZID_PROPERTY, - ICAL_TZNAME_PROPERTY, - ICAL_TZOFFSETFROM_PROPERTY, - ICAL_TZOFFSETTO_PROPERTY, - ICAL_TZURL_PROPERTY, - ICAL_UID_PROPERTY, - ICAL_URL_PROPERTY, - ICAL_VERSION_PROPERTY, - ICAL_X_PROPERTY, - ICAL_XLICCLUSTERCOUNT_PROPERTY, - ICAL_XLICERROR_PROPERTY, - ICAL_XLICMIMECHARSET_PROPERTY, - ICAL_XLICMIMECID_PROPERTY, - ICAL_XLICMIMECONTENTTYPE_PROPERTY, - ICAL_XLICMIMEENCODING_PROPERTY, - ICAL_XLICMIMEFILENAME_PROPERTY, - ICAL_XLICMIMEOPTINFO_PROPERTY, - ICAL_NO_PROPERTY -} icalproperty_kind; - - -/* ACTION */ -icalproperty* icalproperty_new_action(enum icalproperty_action v); -icalproperty* icalproperty_vanew_action(enum icalproperty_action v, ...); -void icalproperty_set_action(icalproperty* prop, enum icalproperty_action v); -enum icalproperty_action icalproperty_get_action(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* MAXRESULTS */ -icalproperty* icalproperty_new_maxresults(int v); -icalproperty* icalproperty_vanew_maxresults(int v, ...); -void icalproperty_set_maxresults(icalproperty* prop, int v); -int icalproperty_get_maxresults(icalproperty* prop); -/* MAXRESULTSSIZE */ -icalproperty* icalproperty_new_maxresultssize(int v); -icalproperty* icalproperty_vanew_maxresultssize(int v, ...); -void icalproperty_set_maxresultssize(icalproperty* prop, int v); -int icalproperty_get_maxresultssize(icalproperty* prop); -/* METHOD */ -icalproperty* icalproperty_new_method(enum icalproperty_method v); -icalproperty* icalproperty_vanew_method(enum icalproperty_method v, ...); -void icalproperty_set_method(icalproperty* prop, enum icalproperty_method v); -enum icalproperty_method icalproperty_get_method(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* QUERYNAME */ -icalproperty* icalproperty_new_queryname(const char* v); -icalproperty* icalproperty_vanew_queryname(const char* v, ...); -void icalproperty_set_queryname(icalproperty* prop, const char* v); -const char* icalproperty_get_queryname(icalproperty* prop); -/* RDATE */ -icalproperty* icalproperty_new_rdate(struct icaldatetimeperiodtype v); -icalproperty* icalproperty_vanew_rdate(struct icaldatetimeperiodtype v, ...); -void icalproperty_set_rdate(icalproperty* prop, struct icaldatetimeperiodtype v); -struct icaldatetimeperiodtype icalproperty_get_rdate(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* SCOPE */ -icalproperty* icalproperty_new_scope(const char* v); -icalproperty* icalproperty_vanew_scope(const char* v, ...); -void icalproperty_set_scope(icalproperty* prop, const char* v); -const char* icalproperty_get_scope(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); -/* STATUS */ -icalproperty* icalproperty_new_status(enum icalproperty_status v); -icalproperty* icalproperty_vanew_status(enum icalproperty_status v, ...); -void icalproperty_set_status(icalproperty* prop, enum icalproperty_status v); -enum icalproperty_status icalproperty_get_status(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); -/* TARGET */ -icalproperty* icalproperty_new_target(const char* v); -icalproperty* icalproperty_vanew_target(const char* v, ...); -void icalproperty_set_target(icalproperty* prop, const char* v); -const char* icalproperty_get_target(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); -/* TRIGGER */ -icalproperty* icalproperty_new_trigger(struct icaltriggertype v); -icalproperty* icalproperty_vanew_trigger(struct icaltriggertype v, ...); -void icalproperty_set_trigger(icalproperty* prop, struct icaltriggertype v); -struct icaltriggertype icalproperty_get_trigger(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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* 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); -/* X-LIC-CLUSTERCOUNT */ -icalproperty* icalproperty_new_xlicclustercount(const char* v); -icalproperty* icalproperty_vanew_xlicclustercount(const char* v, ...); -void icalproperty_set_xlicclustercount(icalproperty* prop, const char* v); -const char* icalproperty_get_xlicclustercount(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); -/* 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); -/* 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); -/* 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-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); -/* 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); -/* 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); - -#endif /*ICALPROPERTY_H*/ diff --git a/other-licenses/libical/src/libical/icalderivedvalue.c b/other-licenses/libical/src/libical/icalderivedvalue.c deleted file mode 100644 index bd0ea3684c2..00000000000 --- a/other-licenses/libical/src/libical/icalderivedvalue.c +++ /dev/null @@ -1,928 +0,0 @@ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalvalue.c - CREATOR: eric 02 May 1999 - - $Id: icalderivedvalue.c,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $ - - - (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.c - - Contributions from: - Graham Davison (g.m.davison@computer.org) - - -======================================================================*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "icalerror.h" -#include "icalmemory.h" -#include "icalparser.h" -#include "icalenums.h" - -#include "icalvalueimpl.h" - -#include /* for malloc */ -#include /* for sprintf */ -#include /* For memset, others */ -#include /* For offsetof() macro */ -#include -#include /* for mktime */ -#include /* for atoi and atof */ -#include /* for SHRT_MAX */ - - - -#define TMP_BUF_SIZE 1024 - -struct icalvalue_impl* icalvalue_new_impl(icalvalue_kind kind); - -/* This map associates each of the value types with its string - representation */ -struct icalvalue_kind_map { - icalvalue_kind kind; - char name[20]; -}; - -extern struct icalvalue_kind_map value_map[]; - -const char* icalvalue_kind_to_string(icalvalue_kind kind) -{ - int i; - - for (i=0; value_map[i].kind != ICAL_NO_VALUE; i++) { - if (value_map[i].kind == kind) { - return value_map[i].name; - } - } - - return 0; -} - -icalvalue_kind icalvalue_string_to_kind(const char* str) -{ - int i; - - for (i=0; value_map[i].kind != ICAL_NO_VALUE; i++) { - if (strcmp(value_map[i].name,str) == 0) { - return value_map[i].kind; - } - } - - return value_map[i].kind; - -} - -icalvalue* icalvalue_new_x (const char* v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_X_VALUE); - icalerror_check_arg_rz( (v!=0),"v"); - - icalvalue_set_x((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_x(icalvalue* value, const char* v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_arg_rv( (v!=0),"v"); - - impl = (struct icalvalue_impl*)value; - if(impl->x_value!=0) {free((void*)impl->x_value);} - - impl->x_value = icalmemory_strdup(v); - - if (impl->x_value == 0){ - errno = ENOMEM; - } - - } -const char* icalvalue_get_x(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_X_VALUE); - return ((struct icalvalue_impl*)value)->x_value; -} - -/* Recur is a special case, so it is not auto generated. */ -icalvalue* -icalvalue_new_recur (struct icalrecurrencetype v) -{ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_RECUR_VALUE); - - icalvalue_set_recur((icalvalue*)impl,v); - - return (icalvalue*)impl; -} - -void -icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v) -{ - struct icalvalue_impl* impl; - - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_RECUR_VALUE); - - impl = (struct icalvalue_impl*)value; - - if (impl->data.v_recur != 0){ - free(impl->data.v_recur); - impl->data.v_recur = 0; - } - - impl->data.v_recur = malloc(sizeof(struct icalrecurrencetype)); - - if (impl->data.v_recur == 0){ - icalerror_set_errno(ICAL_NEWFAILED_ERROR); - return; - } else { - memcpy(impl->data.v_recur, &v, sizeof(struct icalrecurrencetype)); - } - -} - -struct icalrecurrencetype -icalvalue_get_recur(icalvalue* value) -{ - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_RECUR_VALUE); - - return *(((struct icalvalue_impl*)value)->data.v_recur); -} - - - - -icalvalue* -icalvalue_new_trigger (struct icaltriggertype v) -{ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TRIGGER_VALUE); - - icalvalue_set_trigger((icalvalue*)impl,v); - - return (icalvalue*)impl; -} - -void -icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v) -{ - struct icalvalue_impl* impl; - - icalerror_check_arg_rv( (value!=0),"value"); - - impl = (struct icalvalue_impl*)value; - - if(!icaltime_is_null_time(v.time)){ - icalvalue_set_datetime((icalvalue*)impl,v.time); - impl->kind = ICAL_DATETIME_VALUE; - } else { - icalvalue_set_duration((icalvalue*)impl,v.duration); - impl->kind = ICAL_DURATION_VALUE; - } - -} - -struct icaltriggertype -icalvalue_get_trigger(icalvalue* value) -{ - struct icalvalue_impl *impl = (struct icalvalue_impl*)value; - struct icaltriggertype tr; - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_arg( (value!=0),"value"); - - if(impl->kind == ICAL_DATETIME_VALUE){ - tr.duration = icaldurationtype_from_int(0); - tr.time = impl->data.v_time; - } else if(impl->kind == ICAL_DURATION_VALUE){ - tr.time = icaltime_null_time(); - tr.duration = impl->data.v_duration; - } else { - tr.duration = icaldurationtype_from_int(0); - tr.time = icaltime_null_time(); - icalerror_set_errno(ICAL_BADARG_ERROR); - } - - return tr; -} - -/* DATE-TIME-PERIOD is a special case, and is not auto generated */ - -icalvalue* -icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v) -{ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATETIMEPERIOD_VALUE); - - icalvalue_set_datetimeperiod((icalvalue*)impl,v); - - return (icalvalue*)impl; -} - -void -icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v) -{ - struct icalvalue_impl* impl = (struct icalvalue_impl*)value; - - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_DATETIMEPERIOD_VALUE); - - if(!icaltime_is_null_time(v.time)){ - if(!icaltime_is_valid_time(v.time)){ - icalerror_set_errno(ICAL_BADARG_ERROR); - return; - } - impl->kind = ICAL_DATETIME_VALUE; - icalvalue_set_datetime(impl,v.time); - } else if (!icalperiodtype_is_null_period(v.period)) { - if(!icalperiodtype_is_valid_period(v.period)){ - icalerror_set_errno(ICAL_BADARG_ERROR); - return; - } - impl->kind = ICAL_PERIOD_VALUE; - icalvalue_set_period(impl,v.period); - } else { - icalerror_set_errno(ICAL_BADARG_ERROR); - } -} - -struct icaldatetimeperiodtype -icalvalue_get_datetimeperiod(icalvalue* value) -{ - struct icaldatetimeperiodtype dtp; - - struct icalvalue_impl* impl = (struct icalvalue_impl*)value; - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_DATETIMEPERIOD_VALUE); - - if(impl->kind == ICAL_DATETIME_VALUE){ - dtp.period = icalperiodtype_null_period(); - dtp.time = impl->data.v_time; - } else if(impl->kind == ICAL_PERIOD_VALUE) { - dtp.period = impl->data.v_period; - dtp.time = icaltime_null_time(); - } else { - dtp.period = icalperiodtype_null_period(); - dtp.time = icaltime_null_time(); - icalerror_set_errno(ICAL_BADARG_ERROR); - } - - return dtp; -} - - - - - - - - - -/* The remaining interfaces are 'new', 'set' and 'get' for each of the value - types */ - - -/* Everything below this line is machine generated. Do not edit. */ -static struct icalvalue_kind_map value_map[]={ - {ICAL_BOOLEAN_VALUE,"BOOLEAN"}, - {ICAL_UTCOFFSET_VALUE,"UTC-OFFSET"}, - {ICAL_RECUR_VALUE,"RECUR"}, - {ICAL_METHOD_VALUE,"METHOD"}, - {ICAL_CALADDRESS_VALUE,"CAL-ADDRESS"}, - {ICAL_PERIOD_VALUE,"PERIOD"}, - {ICAL_STATUS_VALUE,"STATUS"}, - {ICAL_BINARY_VALUE,"BINARY"}, - {ICAL_TEXT_VALUE,"TEXT"}, - {ICAL_DATETIMEDATE_VALUE,"DATE-TIME-DATE"}, - {ICAL_DURATION_VALUE,"DURATION"}, - {ICAL_DATETIMEPERIOD_VALUE,"DATE-TIME-PERIOD"}, - {ICAL_INTEGER_VALUE,"INTEGER"}, - {ICAL_TIME_VALUE,"TIME"}, - {ICAL_URI_VALUE,"URI"}, - {ICAL_TRIGGER_VALUE,"TRIGGER"}, - {ICAL_ATTACH_VALUE,"ATTACH"}, - {ICAL_CLASS_VALUE,"CLASS"}, - {ICAL_FLOAT_VALUE,"FLOAT"}, - {ICAL_QUERY_VALUE,"QUERY"}, - {ICAL_STRING_VALUE,"STRING"}, - {ICAL_TRANSP_VALUE,"TRANSP"}, - {ICAL_X_VALUE,"X"}, - {ICAL_DATETIME_VALUE,"DATE-TIME"}, - {ICAL_GEO_VALUE,"GEO"}, - {ICAL_DATE_VALUE,"DATE"}, - {ICAL_ACTION_VALUE,"ACTION"}, - {ICAL_NO_VALUE,""} -}; - - -icalvalue* icalvalue_new_boolean (int v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_BOOLEAN_VALUE); - - icalvalue_set_boolean((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_boolean(icalvalue* value, int v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_BOOLEAN_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_int = v; - } -int icalvalue_get_boolean(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_BOOLEAN_VALUE); - return ((struct icalvalue_impl*)value)->data.v_int; -} - - - -icalvalue* icalvalue_new_utcoffset (int v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_UTCOFFSET_VALUE); - - icalvalue_set_utcoffset((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_utcoffset(icalvalue* value, int v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_UTCOFFSET_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_int = v; - } -int icalvalue_get_utcoffset(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_UTCOFFSET_VALUE); - return ((struct icalvalue_impl*)value)->data.v_int; -} - - - -icalvalue* icalvalue_new_method (enum icalproperty_method v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_METHOD_VALUE); - - icalvalue_set_method((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_method(icalvalue* value, enum icalproperty_method v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_METHOD_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_enum = v; - } -enum icalproperty_method icalvalue_get_method(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_METHOD_VALUE); - return ((struct icalvalue_impl*)value)->data.v_enum; -} - - - -icalvalue* icalvalue_new_caladdress (const char* v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_CALADDRESS_VALUE); - icalerror_check_arg_rz( (v!=0),"v"); - - icalvalue_set_caladdress((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_caladdress(icalvalue* value, const char* v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_value_type(value, ICAL_CALADDRESS_VALUE); - impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} - - impl->data.v_string = icalmemory_strdup(v); - - if (impl->data.v_string == 0){ - errno = ENOMEM; - } - - } -const char* icalvalue_get_caladdress(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_CALADDRESS_VALUE); - return ((struct icalvalue_impl*)value)->data.v_string; -} - - - -icalvalue* icalvalue_new_period (struct icalperiodtype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_PERIOD_VALUE); - - icalvalue_set_period((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_period(icalvalue* value, struct icalperiodtype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_PERIOD_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_period = v; - } -struct icalperiodtype icalvalue_get_period(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_PERIOD_VALUE); - return ((struct icalvalue_impl*)value)->data.v_period; -} - - - -icalvalue* icalvalue_new_status (enum 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, enum 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_enum = v; - } -enum 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_enum; -} - - - -icalvalue* icalvalue_new_binary (const char* v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_BINARY_VALUE); - icalerror_check_arg_rz( (v!=0),"v"); - - icalvalue_set_binary((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_binary(icalvalue* value, const char* v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_value_type(value, ICAL_BINARY_VALUE); - impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} - - impl->data.v_string = icalmemory_strdup(v); - - if (impl->data.v_string == 0){ - errno = ENOMEM; - } - - } -const char* icalvalue_get_binary(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_BINARY_VALUE); - return ((struct icalvalue_impl*)value)->data.v_string; -} - - - -icalvalue* icalvalue_new_text (const char* v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TEXT_VALUE); - icalerror_check_arg_rz( (v!=0),"v"); - - icalvalue_set_text((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_text(icalvalue* value, const char* v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_value_type(value, ICAL_TEXT_VALUE); - impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} - - impl->data.v_string = icalmemory_strdup(v); - - if (impl->data.v_string == 0){ - errno = ENOMEM; - } - - } -const char* icalvalue_get_text(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_TEXT_VALUE); - return ((struct icalvalue_impl*)value)->data.v_string; -} - - - -icalvalue* icalvalue_new_datetimedate (struct icaltimetype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATETIMEDATE_VALUE); - - icalvalue_set_datetimedate((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_datetimedate(icalvalue* value, struct icaltimetype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_DATETIMEDATE_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_time = v; - } -struct icaltimetype icalvalue_get_datetimedate(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_DATETIMEDATE_VALUE); - return ((struct icalvalue_impl*)value)->data.v_time; -} - - - -icalvalue* icalvalue_new_duration (struct icaldurationtype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DURATION_VALUE); - - icalvalue_set_duration((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_duration(icalvalue* value, struct icaldurationtype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_DURATION_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_duration = v; - } -struct icaldurationtype icalvalue_get_duration(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_DURATION_VALUE); - return ((struct icalvalue_impl*)value)->data.v_duration; -} - - - -icalvalue* icalvalue_new_integer (int v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_INTEGER_VALUE); - - icalvalue_set_integer((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_integer(icalvalue* value, int v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_INTEGER_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_int = v; - } -int icalvalue_get_integer(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_INTEGER_VALUE); - return ((struct icalvalue_impl*)value)->data.v_int; -} - - - -icalvalue* icalvalue_new_time (struct icaltimetype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TIME_VALUE); - - icalvalue_set_time((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_time(icalvalue* value, struct icaltimetype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_TIME_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_time = v; - } -struct icaltimetype icalvalue_get_time(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_TIME_VALUE); - return ((struct icalvalue_impl*)value)->data.v_time; -} - - - -icalvalue* icalvalue_new_uri (const char* v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_URI_VALUE); - icalerror_check_arg_rz( (v!=0),"v"); - - icalvalue_set_uri((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_uri(icalvalue* value, const char* v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_value_type(value, ICAL_URI_VALUE); - impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} - - impl->data.v_string = icalmemory_strdup(v); - - if (impl->data.v_string == 0){ - errno = ENOMEM; - } - - } -const char* icalvalue_get_uri(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_URI_VALUE); - return ((struct icalvalue_impl*)value)->data.v_string; -} - - - -icalvalue* icalvalue_new_attach (struct icalattachtype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_ATTACH_VALUE); - - icalvalue_set_attach((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_attach(icalvalue* value, struct icalattachtype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_ATTACH_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_attach = v; - } -struct icalattachtype icalvalue_get_attach(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_ATTACH_VALUE); - return ((struct icalvalue_impl*)value)->data.v_attach; -} - - - -icalvalue* icalvalue_new_class (enum icalproperty_class v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_CLASS_VALUE); - - icalvalue_set_class((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_class(icalvalue* value, enum icalproperty_class v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_CLASS_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_enum = v; - } -enum icalproperty_class icalvalue_get_class(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_CLASS_VALUE); - return ((struct icalvalue_impl*)value)->data.v_enum; -} - - - -icalvalue* icalvalue_new_float (float v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_FLOAT_VALUE); - - icalvalue_set_float((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_float(icalvalue* value, float v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_FLOAT_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_float = v; - } -float icalvalue_get_float(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_FLOAT_VALUE); - return ((struct icalvalue_impl*)value)->data.v_float; -} - - - -icalvalue* icalvalue_new_query (const char* v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_QUERY_VALUE); - icalerror_check_arg_rz( (v!=0),"v"); - - icalvalue_set_query((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_query(icalvalue* value, const char* v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_value_type(value, ICAL_QUERY_VALUE); - impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} - - impl->data.v_string = icalmemory_strdup(v); - - if (impl->data.v_string == 0){ - errno = ENOMEM; - } - - } -const char* icalvalue_get_query(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_QUERY_VALUE); - return ((struct icalvalue_impl*)value)->data.v_string; -} - - - -icalvalue* icalvalue_new_string (const char* v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_STRING_VALUE); - icalerror_check_arg_rz( (v!=0),"v"); - - icalvalue_set_string((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_string(icalvalue* value, const char* v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - icalerror_check_arg_rv( (v!=0),"v"); - - icalerror_check_value_type(value, ICAL_STRING_VALUE); - impl = (struct icalvalue_impl*)value; - if(impl->data.v_string!=0) {free((void*)impl->data.v_string);} - - impl->data.v_string = icalmemory_strdup(v); - - if (impl->data.v_string == 0){ - errno = ENOMEM; - } - - } -const char* icalvalue_get_string(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_STRING_VALUE); - return ((struct icalvalue_impl*)value)->data.v_string; -} - - - -icalvalue* icalvalue_new_transp (enum icalproperty_transp v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TRANSP_VALUE); - - icalvalue_set_transp((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_transp(icalvalue* value, enum icalproperty_transp v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_TRANSP_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_enum = v; - } -enum icalproperty_transp icalvalue_get_transp(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_TRANSP_VALUE); - return ((struct icalvalue_impl*)value)->data.v_enum; -} - - - -icalvalue* icalvalue_new_datetime (struct icaltimetype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATETIME_VALUE); - - icalvalue_set_datetime((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_datetime(icalvalue* value, struct icaltimetype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_DATETIME_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_time = v; - } -struct icaltimetype icalvalue_get_datetime(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_DATETIME_VALUE); - return ((struct icalvalue_impl*)value)->data.v_time; -} - - - -icalvalue* icalvalue_new_geo (struct icalgeotype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_GEO_VALUE); - - icalvalue_set_geo((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_geo(icalvalue* value, struct icalgeotype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_GEO_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_geo = v; - } -struct icalgeotype icalvalue_get_geo(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_GEO_VALUE); - return ((struct icalvalue_impl*)value)->data.v_geo; -} - - - -icalvalue* icalvalue_new_date (struct icaltimetype v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATE_VALUE); - - icalvalue_set_date((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_date(icalvalue* value, struct icaltimetype v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_DATE_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_time = v; - } -struct icaltimetype icalvalue_get_date(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_DATE_VALUE); - return ((struct icalvalue_impl*)value)->data.v_time; -} - - - -icalvalue* icalvalue_new_action (enum icalproperty_action v){ - struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_ACTION_VALUE); - - icalvalue_set_action((icalvalue*)impl,v); - return (icalvalue*)impl; -} -void icalvalue_set_action(icalvalue* value, enum icalproperty_action v) { - struct icalvalue_impl* impl; - icalerror_check_arg_rv( (value!=0),"value"); - - icalerror_check_value_type(value, ICAL_ACTION_VALUE); - impl = (struct icalvalue_impl*)value; - - impl->data.v_enum = v; - } -enum icalproperty_action icalvalue_get_action(icalvalue* value) { - - icalerror_check_arg( (value!=0),"value"); - icalerror_check_value_type(value, ICAL_ACTION_VALUE); - return ((struct icalvalue_impl*)value)->data.v_enum; -} diff --git a/other-licenses/libical/src/libical/icalderivedvalue.h b/other-licenses/libical/src/libical/icalderivedvalue.h deleted file mode 100644 index 086c4e40c5c..00000000000 --- a/other-licenses/libical/src/libical/icalderivedvalue.h +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icalvalue.h - CREATOR: eric 20 March 1999 - - - $Id: icalderivedvalue.h,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $ - $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 ICALDERIVEDVALUE_H -#define ICALDERIVEDVALUE_H - -#include "icaltypes.h" -#include "icalrecur.h" -#include "icaltime.h" -#include "icalduration.h" -#include "icalperiod.h" - -typedef void icalvalue; - - - -void icalvalue_set_x(icalvalue* value, const char* v); -icalvalue* icalvalue_new_x(const char* v); -const char* icalvalue_get_x(icalvalue* value); - -icalvalue* icalvalue_new_recur (struct icalrecurrencetype v); -void icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v); -struct icalrecurrencetype icalvalue_get_recur(icalvalue* value); - -icalvalue* icalvalue_new_trigger (struct icaltriggertype v); -void icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v); -struct icaltriggertype icalvalue_get_trigger(icalvalue* value); - -icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v); -void icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v); -struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(icalvalue* value); - -/* Everything below this line is machine generated. Do not edit. */ -typedef enum icalvalue_kind { - ICAL_ANY_VALUE=5000, - ICAL_BOOLEAN_VALUE=5001, - ICAL_UTCOFFSET_VALUE=5002, - ICAL_RECUR_VALUE=5003, - ICAL_METHOD_VALUE=5004, - ICAL_CALADDRESS_VALUE=5005, - ICAL_PERIOD_VALUE=5006, - ICAL_STATUS_VALUE=5007, - ICAL_BINARY_VALUE=5008, - ICAL_TEXT_VALUE=5009, - ICAL_DATETIMEDATE_VALUE=5010, - ICAL_DURATION_VALUE=5011, - ICAL_DATETIMEPERIOD_VALUE=5012, - ICAL_INTEGER_VALUE=5013, - ICAL_TIME_VALUE=5014, - ICAL_URI_VALUE=5015, - ICAL_TRIGGER_VALUE=5016, - ICAL_ATTACH_VALUE=5017, - ICAL_CLASS_VALUE=5018, - ICAL_FLOAT_VALUE=5019, - ICAL_QUERY_VALUE=5020, - ICAL_STRING_VALUE=5021, - ICAL_TRANSP_VALUE=5022, - ICAL_X_VALUE=5023, - ICAL_DATETIME_VALUE=5024, - ICAL_GEO_VALUE=5025, - ICAL_DATE_VALUE=5026, - ICAL_ACTION_VALUE=5027, - ICAL_NO_VALUE=5028 -} icalvalue_kind ; - -#define ICALPROPERTY_FIRST_ENUM 10000 - -typedef enum icalproperty_action { - ICAL_ACTION_X = 10000, - ICAL_ACTION_AUDIO = 10001, - ICAL_ACTION_DISPLAY = 10002, - ICAL_ACTION_EMAIL = 10003, - ICAL_ACTION_PROCEDURE = 10004, - ICAL_ACTION_NONE = 10005 -} icalproperty_action; - -typedef enum icalproperty_class { - ICAL_CLASS_X = 10006, - ICAL_CLASS_PUBLIC = 10007, - ICAL_CLASS_PRIVATE = 10008, - ICAL_CLASS_CONFIDENTIAL = 10009, - ICAL_CLASS_NONE = 10010 -} icalproperty_class; - -typedef enum icalproperty_method { - ICAL_METHOD_X = 10011, - ICAL_METHOD_PUBLISH = 10012, - ICAL_METHOD_REQUEST = 10013, - ICAL_METHOD_REPLY = 10014, - ICAL_METHOD_ADD = 10015, - ICAL_METHOD_CANCEL = 10016, - ICAL_METHOD_REFRESH = 10017, - ICAL_METHOD_COUNTER = 10018, - ICAL_METHOD_DECLINECOUNTER = 10019, - ICAL_METHOD_CREATE = 10020, - ICAL_METHOD_READ = 10021, - ICAL_METHOD_RESPONSE = 10022, - ICAL_METHOD_MOVE = 10023, - ICAL_METHOD_MODIFY = 10024, - ICAL_METHOD_GENERATEUID = 10025, - ICAL_METHOD_DELETE = 10026, - ICAL_METHOD_NONE = 10027 -} icalproperty_method; - -typedef enum icalproperty_status { - ICAL_STATUS_X = 10028, - ICAL_STATUS_TENTATIVE = 10029, - ICAL_STATUS_CONFIRMED = 10030, - ICAL_STATUS_COMPLETED = 10031, - ICAL_STATUS_NEEDSACTION = 10032, - ICAL_STATUS_CANCELLED = 10033, - ICAL_STATUS_INPROCESS = 10034, - ICAL_STATUS_DRAFT = 10035, - ICAL_STATUS_FINAL = 10036, - ICAL_STATUS_NONE = 10037 -} icalproperty_status; - -typedef enum icalproperty_transp { - ICAL_TRANSP_X = 10038, - ICAL_TRANSP_OPAQUE = 10039, - ICAL_TRANSP_TRANSPARENT = 10040, - ICAL_TRANSP_NONE = 10041 -} icalproperty_transp; - -#define ICALPROPERTY_LAST_ENUM 10042 - - - /* BOOLEAN */ -icalvalue* icalvalue_new_boolean(int v); -int icalvalue_get_boolean(icalvalue* value); -void icalvalue_set_boolean(icalvalue* value, int v); - - - /* UTC-OFFSET */ -icalvalue* icalvalue_new_utcoffset(int v); -int icalvalue_get_utcoffset(icalvalue* value); -void icalvalue_set_utcoffset(icalvalue* value, int v); - - - /* METHOD */ -icalvalue* icalvalue_new_method(enum icalproperty_method v); -enum icalproperty_method icalvalue_get_method(icalvalue* value); -void icalvalue_set_method(icalvalue* value, enum icalproperty_method 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); - - - /* PERIOD */ -icalvalue* icalvalue_new_period(struct icalperiodtype v); -struct icalperiodtype icalvalue_get_period(icalvalue* value); -void icalvalue_set_period(icalvalue* value, struct icalperiodtype v); - - - /* STATUS */ -icalvalue* icalvalue_new_status(enum icalproperty_status v); -enum icalproperty_status icalvalue_get_status(icalvalue* value); -void icalvalue_set_status(icalvalue* value, enum icalproperty_status 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); - - - /* TEXT */ -icalvalue* icalvalue_new_text(const char* v); -const char* icalvalue_get_text(icalvalue* value); -void icalvalue_set_text(icalvalue* value, const char* v); - - - /* DATE-TIME-DATE */ -icalvalue* icalvalue_new_datetimedate(struct icaltimetype v); -struct icaltimetype icalvalue_get_datetimedate(icalvalue* value); -void icalvalue_set_datetimedate(icalvalue* value, struct icaltimetype 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); - - - /* INTEGER */ -icalvalue* icalvalue_new_integer(int v); -int icalvalue_get_integer(icalvalue* value); -void icalvalue_set_integer(icalvalue* value, int 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); - - - /* URI */ -icalvalue* icalvalue_new_uri(const char* v); -const char* icalvalue_get_uri(icalvalue* value); -void icalvalue_set_uri(icalvalue* value, const char* v); - - - /* ATTACH */ -icalvalue* icalvalue_new_attach(struct icalattachtype v); -struct icalattachtype icalvalue_get_attach(icalvalue* value); -void icalvalue_set_attach(icalvalue* value, struct icalattachtype v); - - - /* CLASS */ -icalvalue* icalvalue_new_class(enum icalproperty_class v); -enum icalproperty_class icalvalue_get_class(icalvalue* value); -void icalvalue_set_class(icalvalue* value, enum icalproperty_class v); - - - /* FLOAT */ -icalvalue* icalvalue_new_float(float v); -float icalvalue_get_float(icalvalue* value); -void icalvalue_set_float(icalvalue* value, float 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); - - - /* STRING */ -icalvalue* icalvalue_new_string(const char* v); -const char* icalvalue_get_string(icalvalue* value); -void icalvalue_set_string(icalvalue* value, const char* v); - - - /* TRANSP */ -icalvalue* icalvalue_new_transp(enum icalproperty_transp v); -enum icalproperty_transp icalvalue_get_transp(icalvalue* value); -void icalvalue_set_transp(icalvalue* value, enum icalproperty_transp 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); - - - /* GEO */ -icalvalue* icalvalue_new_geo(struct icalgeotype v); -struct icalgeotype icalvalue_get_geo(icalvalue* value); -void icalvalue_set_geo(icalvalue* value, struct icalgeotype 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); - - - /* ACTION */ -icalvalue* icalvalue_new_action(enum icalproperty_action v); -enum icalproperty_action icalvalue_get_action(icalvalue* value); -void icalvalue_set_action(icalvalue* value, enum icalproperty_action v); - -#endif /*ICALVALUE_H*/ diff --git a/other-licenses/libical/src/libical/icalderivedvalue.h.in b/other-licenses/libical/src/libical/icalderivedvalue.h.in index 5b663e65204..bcc70a64c8a 100644 --- a/other-licenses/libical/src/libical/icalderivedvalue.h.in +++ b/other-licenses/libical/src/libical/icalderivedvalue.h.in @@ -4,7 +4,7 @@ CREATOR: eric 20 March 1999 - $Id: icalderivedvalue.h.in,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $ + $Id: icalderivedvalue.h.in,v 1.2 2001-12-21 18:56:19 mikep%oeone.com Exp $ $Locker: $ @@ -55,4 +55,6 @@ icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v); void icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v); struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(icalvalue* value); +void icalvalue_reset_kind(icalvalue* value); + /* Everything below this line is machine generated. Do not edit. */ diff --git a/other-licenses/libical/src/libical/icalerror.c b/other-licenses/libical/src/libical/icalerror.c index b3fdaff8b9d..56babf15f80 100644 --- a/other-licenses/libical/src/libical/icalerror.c +++ b/other-licenses/libical/src/libical/icalerror.c @@ -3,7 +3,7 @@ FILE: icalerror.c CREATOR: eric 16 May 1999 - $Id: icalerror.c,v 1.2 2001-11-22 19:21:47 mikep%oeone.com Exp $ + $Id: icalerror.c,v 1.3 2001-12-21 18:56:19 mikep%oeone.com Exp $ $Locker: $ @@ -30,7 +30,6 @@ #endif #include "icalerror.h" -#include icalerrorenum icalerrno; @@ -48,6 +47,19 @@ void icalerror_crash_here(void) assert( *p); } +#ifdef ICAL_SETERROR_ISFUNC +void icalerror_set_errno(icalerrorenum x) +{ + icalerrno = x; + if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || + (icalerror_get_error_state(x)==ICAL_ERROR_DEFAULT && + icalerror_errors_are_fatal == 1 )){ + icalerror_warn(icalerror_strerror(x)); + assert(0); + } + +} +#endif void icalerror_clear_errno() { diff --git a/other-licenses/libical/src/libical/icalerror.h b/other-licenses/libical/src/libical/icalerror.h index 1c870086779..e15bcdea2c2 100644 --- a/other-licenses/libical/src/libical/icalerror.h +++ b/other-licenses/libical/src/libical/icalerror.h @@ -3,7 +3,7 @@ FILE: icalerror.h CREATOR: eric 09 May 1999 - $Id: icalerror.h,v 1.1 2001-11-15 19:26:57 mikep%oeone.com Exp $ + $Id: icalerror.h,v 1.2 2001-12-21 18:56:19 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -35,6 +35,8 @@ #include "config.h" #endif +#define ICAL_SETERROR_ISFUNC + /* 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 @@ -90,7 +92,7 @@ char* icalerror_perror(); void icalerror_set_error_state( icalerrorenum error, icalerrorstate); icalerrorstate icalerror_get_error_state( icalerrorenum error); - +#ifndef ICAL_SETERROR_ISFUNC #define icalerror_set_errno(x) \ icalerrno = x; \ if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || \ @@ -99,7 +101,9 @@ if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || \ icalerror_warn(icalerror_strerror(x)); \ assert(0); \ } - +#else +void icalerror_set_errno(icalerrorenum x); +#endif #ifdef ICAL_ERRORS_ARE_FATAL #undef NDEBUG diff --git a/other-licenses/libical/src/libical/icallangbind.c b/other-licenses/libical/src/libical/icallangbind.c index 93ddea86281..b69fcdebab7 100644 --- a/other-licenses/libical/src/libical/icallangbind.c +++ b/other-licenses/libical/src/libical/icallangbind.c @@ -5,7 +5,7 @@ DESCRIPTION: - $Id: icallangbind.c,v 1.2 2001-11-22 19:21:48 mikep%oeone.com Exp $ + $Id: icallangbind.c,v 1.3 2001-12-21 18:56:21 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 1999 Eric Busboom @@ -24,11 +24,12 @@ #include "icalmemory.h" #include #include + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif int* icallangbind_new_array(int size){ int* p = (int*)malloc(size*sizeof(int)); return p; /* Caller handles failures */ @@ -133,6 +134,7 @@ icalcomponent* icallangbind_get_next_component(icalcomponent *c, #define APPENDC(x) icalmemory_append_char(&buf, &buf_ptr, &buf_size, x); + const char* icallangbind_property_eval_string(icalproperty* prop, char* sep) { char tmp[25]; @@ -154,14 +156,14 @@ const char* icallangbind_property_eval_string(icalproperty* prop, char* sep) APPENDS(" 'name' "); APPENDS(sep); APPENDC('\''); - APPENDS(icalenum_property_kind_to_string(icalproperty_isa(prop))); + APPENDS(icalproperty_kind_to_string(icalproperty_isa(prop))); APPENDC('\''); if(value){ APPENDS(", 'value_type' "); APPENDS(sep); APPENDC('\''); - APPENDS(icalenum_value_kind_to_string(icalvalue_isa(value))); + APPENDS(icalvalue_kind_to_string(icalvalue_isa(value))); APPENDC('\''); } diff --git a/other-licenses/libical/src/libical/icallexer.c b/other-licenses/libical/src/libical/icallexer.c deleted file mode 100644 index 82e4d67936e..00000000000 --- a/other-licenses/libical/src/libical/icallexer.c +++ /dev/null @@ -1,1764 +0,0 @@ -#define yy_create_buffer ical_yy_create_buffer -#define yy_delete_buffer ical_yy_delete_buffer -#define yy_scan_buffer ical_yy_scan_buffer -#define yy_scan_string ical_yy_scan_string -#define yy_scan_bytes ical_yy_scan_bytes -#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 yyout ical_yyout -#define yyrestart ical_yyrestart -#define yytext ical_yytext -#define yywrap ical_yywrap - -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header: /home/jrmuizel/cvs-mirror/mozilla/other-licenses/libical/src/libical/Attic/icallexer.c,v 1.1 2001-11-15 19:26:58 mikep%oeone.com Exp $ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char yytext[]; - - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - if ( yyleng >= YYLMAX ) \ - YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \ - yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 12 -#define YY_END_OF_BUFFER 13 -static yyconst short int yy_accept[67] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 13, 12, 5, 12, 4, 1, - 2, 3, 6, 12, 7, 12, 9, 10, 9, 11, - 5, 1, 6, 8, 10, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 5, 6, 1, 7, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, - 1, 7, 1, 1, 1, 1, 7, 1, 1, 7, - 1, 1, 7, 9, 1, 1, 7, 1, 1, 10, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, - - 1, 1, 1, 7, 1, 1, 1, 1, 7, 1, - 1, 7, 1, 1, 7, 9, 1, 1, 7, 1, - 1, 10, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[11] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 - } ; - -static yyconst short int yy_base[69] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 9, 0, 16, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 25, 24, 0, 0, - 0, 0, 0, 0, 28, 31, 31, 25, 31, 18, - 31, 31, 31, 23, 31, 16, 31, 31, 21, 31, - 31, 14, 31, 31, 31, 31, 15, 13 - } ; - -static yyconst short int yy_def[69] = - { 0, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 66, 11, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 23, 68, 68, 67, 67, 67, 67, - 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66, 66, 66, 66, 66, 0, 66, 66 - } ; - -static yyconst short int yy_nxt[42] = - { 0, - 46, 47, 48, 49, 46, 49, 49, 50, 51, 52, - 53, 54, 55, 57, 55, 46, 56, 58, 59, 58, - 59, 62, 65, 64, 63, 62, 61, 66, 60, 60, - 45, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66 - } ; - -static yyconst short int yy_chk[42] = - { 0, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 23, 23, 23, 68, 23, 67, 23, 25, 25, 26, - 26, 62, 59, 56, 54, 50, 48, 45, 38, 37, - 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, - 66 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#ifndef YYLMAX -#define YYLMAX 8192 -#endif - -char yytext[YYLMAX]; -char *yytext_ptr; -#line 1 "icallexer.l" -#define INITIAL 0 -#line 2 "icallexer.l" -/* -*- Mode: C -*- - ====================================================================== - FILE: icallexer.l - CREATOR: eric 10 June 1999 - - DESCRIPTION: - - $Id: icallexer.c,v 1.1 2001-11-15 19:26:58 mikep%oeone.com Exp $ - $Locker: $ - - (C) COPYRIGHT 1999 Eric Busboom - http://www.softwarestudio.org - - 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. - - The original author is Eric Busboom - The original code is icalitip.y - - - - ======================================================================*/ -#include "icalparser.h" -#include "icalenums.h" -#include "icalmemory.h" -#include "assert.h" -#include "icalyacc.h" - -#include /* For strdup() */ - -int icalparser_flex_input(char* buf, int max_size); -void icalparser_clear_flex_input(void); - - -#define ICAL_MAX_STR_CONST 1024 - -#undef YY_INPUT -#define YY_INPUT(b,r,ms) ( r= icalparser_flex_input(b,ms)) -#undef yywrap - -#undef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) ical_yyerror(msg) - -icalvalue_kind value_kind=ICAL_NO_VALUE; -void set_parser_value_state(icalvalue_kind kind); -extern int yydebug; - -void ical_yyerror(char *s); - -void init_str_buf(void); - -int last_state; - -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 ); - -#define quoted_string 1 - -#define binary_value 2 -#define boolean_value 3 -#define uri_value 4 -#define time_value 5 -#define duration_value 6 -#define number_value 7 -#define period_value 8 -#define recur_value 9 -#define text_value 10 -#define utcoffset_value 11 - -#define enum_param_value 12 -#define string_param_value 13 -#define stringlist_param_value 14 -#define keyword 15 -#define line_start 16 -#define component 17 -#define seperator 18 -#define parameter 19 -#define end_of_value 20 -#define paramtext 21 - -#line 510 "lex.ical_yy.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; - register int yy_act; - -#line 97 "icallexer.l" - - - - - - - -#line 669 "lex.ical_yy.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 67 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 31 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - - -case 1: -YY_RULE_SETUP -#line 105 "icallexer.l" -{ ical_yylval.v_string =icalmemory_tmp_copy(yytext) ; - return DIGITS; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 107 "icallexer.l" -{ return TIME_CHAR; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 108 "icallexer.l" -{ return UTC_CHAR; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 109 "icallexer.l" -{ return yytext[0]; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 110 "icallexer.l" -{ return EOL;} - YY_BREAK - - -case 6: -YY_RULE_SETUP -#line 115 "icallexer.l" -{ return EOL;} - YY_BREAK -case 7: -YY_RULE_SETUP -#line 116 "icallexer.l" -{ return yytext[0]; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 117 "icallexer.l" -{ ical_yylval.v_int=atoi(yytext); return INTNUMBER; } - YY_BREAK - - -case 9: -YY_RULE_SETUP -#line 122 "icallexer.l" -{ return CHARACTER; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 123 "icallexer.l" -{ return EOL;} - YY_BREAK - - -case 11: -YY_RULE_SETUP -#line 128 "icallexer.l" -{ BEGIN(last_state); return COMMA; } - YY_BREAK - -case 12: -YY_RULE_SETUP -#line 132 "icallexer.l" -ECHO; - YY_BREAK -#line 821 "lex.ical_yy.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(quoted_string): -case YY_STATE_EOF(binary_value): -case YY_STATE_EOF(boolean_value): -case YY_STATE_EOF(uri_value): -case YY_STATE_EOF(time_value): -case YY_STATE_EOF(duration_value): -case YY_STATE_EOF(number_value): -case YY_STATE_EOF(period_value): -case YY_STATE_EOF(recur_value): -case YY_STATE_EOF(text_value): -case YY_STATE_EOF(utcoffset_value): -case YY_STATE_EOF(enum_param_value): -case YY_STATE_EOF(string_param_value): -case YY_STATE_EOF(stringlist_param_value): -case YY_STATE_EOF(keyword): -case YY_STATE_EOF(line_start): -case YY_STATE_EOF(component): -case YY_STATE_EOF(seperator): -case YY_STATE_EOF(parameter): -case YY_STATE_EOF(end_of_value): -case YY_STATE_EOF(paramtext): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 67 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 67 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 66); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 132 "icallexer.l" - - -int yywrap() -{ - return 1; -} - - -void set_parser_value_state(icalvalue_kind kind) -{ - - switch (kind){ - - case ICAL_UTCOFFSET_VALUE: - {BEGIN(utcoffset_value);break;} - - case ICAL_DATETIMEPERIOD_VALUE: - case ICAL_DURATION_VALUE: - case ICAL_PERIOD_VALUE: - {BEGIN(time_value);break;} - - default: - { - assert(1==0); - } - } -} - -void init_str_buf(void) -{ - str_buf = icalmemory_tmp_buffer(ICAL_MAX_STR_CONST); - str_buf_p = str_buf; - buf_sz = ICAL_MAX_STR_CONST; - - -} - diff --git a/other-licenses/libical/src/libical/icallexer.l b/other-licenses/libical/src/libical/icallexer.l index 1d80cf7a672..a101a9fb2bb 100644 --- a/other-licenses/libical/src/libical/icallexer.l +++ b/other-licenses/libical/src/libical/icallexer.l @@ -6,7 +6,7 @@ DESCRIPTION: - $Id: icallexer.l,v 1.1 2001-11-15 19:26:58 mikep%oeone.com Exp $ + $Id: icallexer.l,v 1.2 2001-12-21 18:56:22 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 1999 Eric Busboom @@ -63,12 +63,6 @@ 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 ); - %} crlf \x0D?\x0A diff --git a/other-licenses/libical/src/libical/icalmemory.c b/other-licenses/libical/src/libical/icalmemory.c index 3451e64cede..661ab3db728 100644 --- a/other-licenses/libical/src/libical/icalmemory.c +++ b/other-licenses/libical/src/libical/icalmemory.c @@ -3,7 +3,7 @@ FILE: icalmemory.c CREATOR: eric 30 June 1999 - $Id: icalmemory.c,v 1.1 2001-11-15 19:26:58 mikep%oeone.com Exp $ + $Id: icalmemory.c,v 1.2 2001-12-21 18:56:22 mikep%oeone.com Exp $ $Locker: $ The contents of this file are subject to the Mozilla Public License @@ -60,7 +60,7 @@ #include /* for malloc, realloc */ #include /* for memset(), strdup */ -#define BUFFER_RING_SIZE 25 +#define BUFFER_RING_SIZE 2500 #define MIN_BUFFER_SIZE 200 void icalmemory_free_tmp_buffer (void* buf); diff --git a/other-licenses/libical/src/libical/icalmemory.h b/other-licenses/libical/src/libical/icalmemory.h index a3fe985587e..0dd86c7e815 100644 --- a/other-licenses/libical/src/libical/icalmemory.h +++ b/other-licenses/libical/src/libical/icalmemory.h @@ -4,7 +4,7 @@ CREATOR: eric 30 June 1999 - $Id: icalmemory.h,v 1.2 2001-11-22 19:21:48 mikep%oeone.com Exp $ + $Id: icalmemory.h,v 1.3 2001-12-21 18:56:22 mikep%oeone.com Exp $ $Locker: $ This program is free software; you can redistribute it and/or modify diff --git a/other-licenses/libical/src/libical/icalmime.c b/other-licenses/libical/src/libical/icalmime.c index 6a838f8bd85..e779644bf0c 100644 --- a/other-licenses/libical/src/libical/icalmime.c +++ b/other-licenses/libical/src/libical/icalmime.c @@ -4,7 +4,7 @@ CREATOR: eric 26 July 2000 - $Id: icalmime.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $ + $Id: icalmime.c,v 1.3 2001-12-21 18:56:22 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -37,12 +37,11 @@ #ifdef DMALLOC #include "dmalloc.h" #endif - -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif - + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif /* These *_part routines are called by the MIME parser via the local_action_map */ diff --git a/other-licenses/libical/src/libical/icalparameter.c b/other-licenses/libical/src/libical/icalparameter.c index 10989add498..25740b2bca0 100644 --- a/other-licenses/libical/src/libical/icalparameter.c +++ b/other-licenses/libical/src/libical/icalparameter.c @@ -3,7 +3,7 @@ FILE: icalderivedparameters.{c,h} CREATOR: eric 09 May 1999 - $Id: icalparameter.c,v 1.1 2001-11-15 19:27:00 mikep%oeone.com Exp $ + $Id: icalparameter.c,v 1.2 2001-12-21 18:56:22 mikep%oeone.com Exp $ $Locker: $ @@ -245,7 +245,17 @@ icalparameter_as_ical_string (icalparameter* parameter) icalmemory_append_string(&buf, &buf_ptr, &buf_size, "="); if(impl->string !=0){ + int qm = 0; + + /* Encapsulate the property in quotes if necessary */ + if (strchr (impl->string, ';') != 0 || strchr (impl->string, ':') != 0) { + icalmemory_append_char (&buf, &buf_ptr, &buf_size, '"'); + qm = 1; + } icalmemory_append_string(&buf, &buf_ptr, &buf_size, impl->string); + if (qm == 1) { + icalmemory_append_char (&buf, &buf_ptr, &buf_size, '"'); + } } else if (impl->data != 0){ const char* str = icalparameter_enum_to_string(impl->data); icalmemory_append_string(&buf, &buf_ptr, &buf_size, str); diff --git a/other-licenses/libical/src/libical/icalparser.c b/other-licenses/libical/src/libical/icalparser.c index cb766a4b747..d98d84d0190 100644 --- a/other-licenses/libical/src/libical/icalparser.c +++ b/other-licenses/libical/src/libical/icalparser.c @@ -1,9 +1,9 @@ -/* -*- Mode: C -*- +/* -*- Mode: C; tab-width: 4; c-basic-offset: 8; -*- ====================================================================== FILE: icalparser.c CREATOR: eric 04 August 1999 - $Id: icalparser.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $ + $Id: icalparser.c,v 1.3 2001-12-21 18:56:23 mikep%oeone.com Exp $ $Locker: $ The contents of this file are subject to the Mozilla Public License @@ -50,18 +50,20 @@ #include /* For strncpy & size_t */ #include /* For FILE and fgets and sprintf */ -#include /* for free */ +#include /* for free */ +#include + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif extern icalvalue* icalparser_yy_value; void set_parser_value_state(icalvalue_kind kind); int ical_yyparse(void); -char* icalparser_get_next_char(char c, char *str); +char* icalparser_get_next_char(char c, char *str, int qm); char* icalparser_get_next_parameter(char* line,char** end); char* icalparser_get_next_value(char* line, char **end, icalvalue_kind kind); char* icalparser_get_prop_name(char* line, char** end); @@ -101,11 +103,10 @@ icalparser* icalparser_new(void) impl->components = pvl_newlist(); impl->level = 0; impl->state = ICALPARSER_SUCCESS; - impl->tmp_buf_size = TMP_BUF_SIZE; impl->buffer_full = 0; impl->lineno = 0; - + impl->continuation_line = 0; memset(impl->temp,0, TMP_BUF_SIZE); return (icalparser*)impl; @@ -144,14 +145,14 @@ icalvalue* icalvalue_new_From_string_with_error(icalvalue_kind kind, -char* icalparser_get_next_char(char c, char *str) +char* icalparser_get_next_char(char c, char *str, int qm) { int quote_mode = 0; char* p; for(p=str; *p!=0; p++){ - + if (qm == 1) { if ( quote_mode == 0 && *p=='"' && *(p-1) != '\\' ){ quote_mode =1; continue; @@ -161,6 +162,7 @@ char* icalparser_get_next_char(char c, char *str) quote_mode =0; continue; } + } if (quote_mode == 0 && *p== c && *(p-1) != '\\' ){ return p; @@ -174,14 +176,21 @@ char* icalparser_get_next_char(char c, char *str) /* make a new tmp buffer out of a substring */ char* make_segment(char* start, char* end) { - char *buf; + char *buf, *tmp; size_t size = (size_t)end - (size_t)start; buf = icalmemory_tmp_buffer(size+1); strncpy(buf,start,size); - *(buf+size) = 0; + *(buf+size) = 0; + + tmp = (buf+size); + while ( *tmp == '\0' || iswspace(*tmp) ) + { + *tmp = 0; + tmp--; + } return buf; @@ -189,9 +198,7 @@ char* make_segment(char* start, char* end) const char* input_buffer; const char* input_buffer_p; -#ifndef WIN32 #define min(a,b) ((a) < (b) ? (a) : (b)) -#endif int icalparser_flex_input(char* buf, int max_size) { @@ -248,8 +255,8 @@ char* icalparser_get_prop_name(char* line, char** end) char* v; char *str; - p = icalparser_get_next_char(';',line); - v = icalparser_get_next_char(':',line); + p = icalparser_get_next_char(';',line,1); + v = icalparser_get_next_char(':',line,1); if (p== 0 && v == 0) { return 0; } @@ -271,9 +278,10 @@ char* icalparser_get_param_name(char* line, char **end) { char* next; + char* quote; char *str; - next = icalparser_get_next_char('=',line); + next = icalparser_get_next_char('=',line,1); if (next == 0) { return 0; @@ -281,6 +289,16 @@ char* icalparser_get_param_name(char* line, char **end) str = make_segment(line,next); *end = next+1; + if (**end == '"') { + *end = *end+1; + next = icalparser_get_next_char('"',*end,0); + if (next == 0) { + return 0; + } + + *end = make_segment(*end,next); + } + return str; } @@ -291,7 +309,7 @@ char* icalparser_get_next_paramvalue(char* line, char **end) char* next; char *str; - next = icalparser_get_next_char(',',line); + next = icalparser_get_next_char(',',line,1); if (next == 0){ next = (char*)(size_t)line+(size_t)strlen(line);\ @@ -323,7 +341,7 @@ char* icalparser_get_next_value(char* line, char **end, icalvalue_kind kind) p = line; while(1){ - next = icalparser_get_next_char(',',p); + next = icalparser_get_next_char(',',p,1); /* Unforunately, RFC2445 says that for the RECUR value, COMMA can both seperate digits in a list, and it can seperate @@ -384,14 +402,14 @@ char* icalparser_get_next_parameter(char* line,char** end) char *v; char *str; - v = icalparser_get_next_char(':',line); - next = icalparser_get_next_char(';', line); + v = icalparser_get_next_char(':',line,1); + next = icalparser_get_next_char(';', line,1); /* There is no ';' or, it is after the ':' that marks the beginning of the value */ if (next == 0 || next > v) { - next = icalparser_get_next_char(':', line); + next = icalparser_get_next_char(':', line,1); } if (next != 0) { @@ -521,7 +539,13 @@ char* icalparser_get_line(icalparser *parser, } else { *(line_p) = '\0'; - } + } + + while ( *line_p == '\0' || iswspace(*line_p) ) + { + *line_p = '\0'; + line_p--; + } return line; @@ -569,7 +593,8 @@ icalcomponent* icalparser_parse(icalparser *parser, icalcomponent *c=0; icalcomponent *root=0; struct icalparser_impl *impl = (struct icalparser_impl*)parser; - icalerrorstate es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR); + icalerrorstate es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR); + int cont; icalerror_check_arg_rz((parser !=0),"parser"); @@ -609,11 +634,13 @@ icalcomponent* icalparser_parse(icalparser *parser, c = 0; - } + } + cont = 0; if(line != 0){ - free(line); + free(line); + cont = 1; } - } while ( line != 0); + } while ( cont ); icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es); @@ -1094,7 +1121,7 @@ icalcomponent* icalparser_parse_string(const char* str) struct slg_data d; icalparser *p; - icalerrorstate es = icalerror_get_error_state(ICAL_PARSE_ERROR); + icalerrorstate es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR); d.pos = 0; d.str = str; @@ -1102,11 +1129,11 @@ icalcomponent* icalparser_parse_string(const char* str) p = icalparser_new(); icalparser_set_gen_data(p,&d); - icalerror_set_error_state(ICAL_PARSE_ERROR,ICAL_ERROR_NONFATAL); + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL); c = icalparser_parse(p,string_line_generator); - icalerror_set_error_state(ICAL_PARSE_ERROR,es); + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es); icalparser_free(p); diff --git a/other-licenses/libical/src/libical/icalperiod.c b/other-licenses/libical/src/libical/icalperiod.c index 4b579018188..2d454d74808 100644 --- a/other-licenses/libical/src/libical/icalperiod.c +++ b/other-licenses/libical/src/libical/icalperiod.c @@ -3,7 +3,7 @@ FILE: icalperiod.c CREATOR: eric 02 June 2000 - $Id: icalperiod.c,v 1.1 2001-11-15 19:27:04 mikep%oeone.com Exp $ + $Id: icalperiod.c,v 1.2 2001-12-21 18:56:23 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -95,11 +95,14 @@ struct icalperiodtype icalperiodtype_from_string (const char* str) if(icaldurationtype_as_int(p.duration) == 0) goto error; } - icalerrno = e; + icalerrno = e; + + free(s); return p; - error: + error: + free(s); icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); return null_p; } @@ -133,6 +136,7 @@ const char* icalperiodtype_as_ical_string(struct icalperiodtype p) icalmemory_append_string(&buf, &buf_ptr, &buf_size, end); + icalmemory_add_tmp_buffer(buf); return buf; } diff --git a/other-licenses/libical/src/libical/icalproperty.c b/other-licenses/libical/src/libical/icalproperty.c index a1941b469e8..2b016c0aac9 100644 --- a/other-licenses/libical/src/libical/icalproperty.c +++ b/other-licenses/libical/src/libical/icalproperty.c @@ -4,7 +4,7 @@ FILE: icalproperty.c CREATOR: eric 28 April 1999 - $Id: icalproperty.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $ + $Id: icalproperty.c,v 1.3 2001-12-21 18:56:23 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -45,12 +45,12 @@ #include /* for printf */ #include /* for va_list, va_start, etc. */ -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif - #define TMP_BUF_SIZE 1024 + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif /* Private routines for icalproperty */ void icalvalue_set_parent(icalvalue* value, @@ -62,7 +62,7 @@ void icalparameter_set_parent(icalparameter* param, icalproperty* icalparameter_get_parent(icalparameter* value); -void icalproperty_set_x_name(icalproperty* prop, char* name); +void icalproperty_set_x_name(icalproperty* prop, const char* name); struct icalproperty_impl { @@ -90,7 +90,7 @@ void icalproperty_add_parameters(struct icalproperty_impl *prop,va_list args) icalproperty_add_parameter((icalproperty*)impl, (icalparameter*)vp); } else { - assert(0); + icalerror_set_errno(ICAL_BADARG_ERROR); } } @@ -177,7 +177,7 @@ icalproperty_new_clone(icalproperty* prop) } -icalproperty* icalproperty_new_from_string(char* str) +icalproperty* icalproperty_new_from_string(const char* str) { size_t buf_size = 1024; @@ -268,7 +268,7 @@ icalproperty_free (icalproperty* prop) } -char* +const char* icalproperty_as_ical_string (icalproperty* prop) { icalparameter *param; @@ -717,7 +717,7 @@ const char* icalproperty_get_value_as_string(icalproperty* prop) } -void icalproperty_set_x_name(icalproperty* prop, char* name) +void icalproperty_set_x_name(icalproperty* prop, const char* name) { struct icalproperty_impl *impl = (struct icalproperty_impl*)prop; @@ -736,7 +736,7 @@ void icalproperty_set_x_name(icalproperty* prop, char* name) } -char* icalproperty_get_x_name(icalproperty* prop){ +const char* icalproperty_get_x_name(icalproperty* prop){ struct icalproperty_impl *impl = (struct icalproperty_impl*)prop; @@ -747,7 +747,7 @@ char* icalproperty_get_x_name(icalproperty* prop){ /* From Jonathan Yue */ -char* icalproperty_get_name (icalproperty* prop) +const char* icalproperty_get_name (icalproperty* prop) { const char* property_name = 0; diff --git a/other-licenses/libical/src/libical/icalproperty.h b/other-licenses/libical/src/libical/icalproperty.h index 51405e70d9f..4f8264210d1 100644 --- a/other-licenses/libical/src/libical/icalproperty.h +++ b/other-licenses/libical/src/libical/icalproperty.h @@ -4,7 +4,7 @@ CREATOR: eric 20 March 1999 - $Id: icalproperty.h,v 1.1 2001-11-15 19:27:08 mikep%oeone.com Exp $ + $Id: icalproperty.h,v 1.2 2001-12-21 18:56:23 mikep%oeone.com Exp $ $Locker: $ @@ -47,9 +47,9 @@ icalproperty* icalproperty_new(icalproperty_kind kind); icalproperty* icalproperty_new_clone(icalproperty * prop); -icalproperty* icalproperty_new_from_string(char* str); +icalproperty* icalproperty_new_from_string(const char* str); -char* icalproperty_as_ical_string(icalproperty* prop); +const char* icalproperty_as_ical_string(icalproperty* prop); void icalproperty_free(icalproperty* prop); @@ -82,12 +82,12 @@ const char* icalproperty_get_value_as_string(icalproperty* prop); /* Deal with X properties */ -void icalproperty_set_x_name(icalproperty* prop, char* name); -char* icalproperty_get_x_name(icalproperty* prop); +void icalproperty_set_x_name(icalproperty* prop, const char* name); +const char* icalproperty_get_x_name(icalproperty* prop); /* Return the name of the property -- the type name converted to a string, or the value of _get_x_name if the type is and X property */ -char* icalproperty_get_name (icalproperty* prop); +const char* icalproperty_get_name (icalproperty* prop); icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value); diff --git a/other-licenses/libical/src/libical/icalrecur.c b/other-licenses/libical/src/libical/icalrecur.c index 06f47a38c20..2d12e0ab94f 100644 --- a/other-licenses/libical/src/libical/icalrecur.c +++ b/other-licenses/libical/src/libical/icalrecur.c @@ -3,7 +3,7 @@ FILE: icalrecur.c CREATOR: eric 16 May 2000 - $Id: icalrecur.c,v 1.1 2001-11-15 19:27:09 mikep%oeone.com Exp $ + $Id: icalrecur.c,v 1.2 2001-12-21 18:56:23 mikep%oeone.com Exp $ $Locker: $ @@ -170,7 +170,6 @@ const char* icalrecur_weekday_to_string(icalrecurrencetype_weekday kind); icalrecurrencetype_weekday icalrecur_string_to_weekday(const char* str); - /*********************** Rule parsing routines ************************/ struct icalrecur_parser { @@ -280,6 +279,8 @@ void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array, } else if (*t == '+'){ sign = 1; t++; + } else { + sign = 1; } v = atoi(t) * sign ; @@ -386,7 +387,8 @@ struct icalrecurrencetype icalrecurrencetype_from_string(const char* str) if(name == 0){ icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); - icalrecurrencetype_clear(&parser.rt); + icalrecurrencetype_clear(&parser.rt); + free(parser.copy); return parser.rt; } @@ -429,6 +431,7 @@ struct icalrecurrencetype icalrecurrencetype_from_string(const char* str) } else { icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); icalrecurrencetype_clear(&parser.rt); + free(parser.copy); return parser.rt; } @@ -457,6 +460,7 @@ struct { char* str;size_t offset; short limit; } recurmap[] = }; /* A private routine in icalvalue.c */ +void print_date_to_string(char* str, struct icaltimetype *data); void print_datetime_to_string(char* str, struct icaltimetype *data); char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur) @@ -481,6 +485,9 @@ char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur) if(recur->until.year != 0){ temp[0] = 0; + if (recur->until.is_date) + print_date_to_string(temp,&(recur->until)); + else print_datetime_to_string(temp,&(recur->until)); icalmemory_append_string(&str,&str_p,&buf_sz,";UNTIL="); @@ -580,6 +587,8 @@ struct icalrecur_iterator_impl { }; +void increment_year(struct icalrecur_iterator_impl* impl, int inc); + int icalrecur_iterator_sizeof_byarray(short* byarray) { int array_itr; @@ -636,7 +645,7 @@ int icalrecur_two_byrule(struct icalrecur_iterator_impl* impl, enum byrule itr; int passes = 0; - memset(test_array,0,9); + memset(test_array,0,9*sizeof(short)); test_array[one] = 1; test_array[two] = 1; @@ -901,10 +910,24 @@ icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule, } - /* For YEARLY rule, begin by setting up the year days array */ + /* For YEARLY rule, begin by setting up the year days array . THey + YEARLY rules work by expanding one year at a time. */ if(impl->rule.freq == ICAL_YEARLY_RECURRENCE){ - expand_year_days(impl,impl->last.year); + struct icaltimetype next; + + for (;;) { + expand_year_days(impl,impl->last.year); + if (impl->days[0] != ICAL_RECURRENCE_ARRAY_MAX) + break; + increment_year(impl,impl->rule.interval); + } + + /* Copy the first day into last. */ + next = icaltime_from_day_of_year(impl->days[0], impl->last.year); + + impl->last.day = next.day; + impl->last.month = next.month; } @@ -979,7 +1002,6 @@ void icalrecur_iterator_free(icalrecur_iterator* i) } - void increment_year(struct icalrecur_iterator_impl* impl, int inc) { impl->last.year+=inc; @@ -1329,56 +1351,9 @@ int next_yearday(struct icalrecur_iterator_impl* impl) } -/* This routine is only called by next_week. It is certain that BY_DAY -has data */ -int next_weekday_by_week(struct icalrecur_iterator_impl* impl) -{ - - short end_of_data = 0; - short start_of_week, dow; - struct icaltimetype next; - - if (next_hour(impl) == 0){ - return 0; - } - - assert( impl->by_ptrs[BY_DAY][0]!=ICAL_RECURRENCE_ARRAY_MAX); - - while(1) { - - impl->by_indices[BY_DAY]++; /* Look at next elem in BYDAY array */ - - /* Are we at the end of the BYDAY array? */ - if (impl->by_ptrs[BY_DAY][impl->by_indices[BY_DAY]] - ==ICAL_RECURRENCE_ARRAY_MAX){ - - impl->by_indices[BY_DAY] = 0; /* Reset to 0 */ - end_of_data = 1; /* Signal that we're at the end */ - } - - /* Add the day of week offset to to the start of this week, and use - that to get the next day */ - dow = impl->by_ptrs[BY_DAY][impl->by_indices[BY_DAY]]; - start_of_week = icaltime_start_doy_of_week(impl->last); - - dow--; /*Sun is 1, not 0 */ - - if(dow+start_of_week <1 && !end_of_data){ - /* The selected date is in the previous year. */ - continue; - } - - next = icaltime_from_day_of_year(start_of_week + dow,impl->last.year); - - impl->last.day = next.day; - impl->last.month = next.month; - impl->last.year = next.year; - - return end_of_data; - } - -} +/* Returns the day of the month for the current month of t that is the + pos'th instance of the day-of-week dow */ int nth_weekday(short dow, short pos, struct icaltimetype t){ @@ -1428,6 +1403,23 @@ int nth_weekday(short dow, short pos, struct icaltimetype t){ return wd; } +int is_day_in_byday(struct icalrecur_iterator_impl* impl,struct icaltimetype tt){ + + int idx; + + for(idx = 0; BYDAYPTR[idx] != ICAL_RECURRENCE_ARRAY_MAX; idx++){ + short dow = icalrecurrencetype_day_day_of_week(BYDAYPTR[idx]); + short pos = icalrecurrencetype_day_position(BYDAYPTR[idx]); + short this_dow = icaltime_day_of_week(tt); + + if( (pos == 0 && dow == this_dow ) || /* Just a dow, like "TU" or "FR" */ + (nth_weekday(dow,pos,tt) == tt.day)){ /*pos+wod: "3FR" or -1TU" */ + return 1; + } + } + + return 0; +} int next_month(struct icalrecur_iterator_impl* impl) { @@ -1445,12 +1437,15 @@ int next_month(struct icalrecur_iterator_impl* impl) return data_valid; /* Signal that the data is valid */ } - /* Now iterate through the occurrences within a month -- by days, weeks or weekdays. */ + + /* + * Case 1: + * Rules Like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYMONTHDAY=13 + */ if(has_by_data(impl,BY_DAY) && has_by_data(impl,BY_MONTH_DAY)){ - /* Cases like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYMONTHDAY=13 */ short day, idx,j; short days_in_month = icaltime_days_in_month(impl->last.month, impl->last.year); @@ -1488,50 +1483,56 @@ int next_month(struct icalrecur_iterator_impl* impl) data_valid = 0; /* signal that impl->last is invalid */ } - + + /* + * Case 2: + * Rules Like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR + */ + } else if(has_by_data(impl,BY_DAY)){ - /* Cases like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR */ /* For this case, the weekdays are relative to the month. BYDAY=FR -> First Friday in month, etc. */ - short day, idx; + /* This code iterates through the remaining days in the month + and checks if each day is listed in the BY_DAY array. This + seems very inneficient, but I think it is the simplest way to + account for both BYDAY=1FR (First friday in month) and + BYDAY=FR ( every friday in month ) */ + + short day; short days_in_month = icaltime_days_in_month(impl->last.month, impl->last.year); - assert( BYDAYPTR[0]!=ICAL_RECURRENCE_ARRAY_MAX); - /* Iterate through the remaining days in the month and check if - each day is listed in the BY_DAY array. This seems very - inneficient, but I think it is the simplest way to account - for both BYDAY=1FR (First friday in month) and BYDAY=FR ( - every friday in month ) */ - for(day = impl->last.day+1; day <= days_in_month; day++){ - for(idx = 0; BYDAYPTR[idx] != ICAL_RECURRENCE_ARRAY_MAX; idx++){ - short dow = icalrecurrencetype_day_day_of_week(BYDAYPTR[idx]); - short pos = icalrecurrencetype_day_position(BYDAYPTR[idx]); - short this_dow; - - impl->last.day = day; - this_dow = icaltime_day_of_week(impl->last); - - if( (pos == 0 && dow == this_dow ) || - (nth_weekday(dow,pos,impl->last) == day)){ - goto DEND; - } + impl->last.day = day; + if(is_day_in_byday(impl,impl->last)){ + data_valid = 1; + break; } } - DEND: - if ( day > days_in_month){ impl->last.day = 1; increment_month(impl); - data_valid = 0; /* signal that impl->last is invalid */ + + /* Did moving to the next month put us on a valid date? if + so, note that the new data is valid, if, not, mark it + invalid */ + + if(is_day_in_byday(impl,impl->last)){ + data_valid = 1; + } else { + data_valid = 0; /* signal that impl->last is invalid */ + } } + /* + * Case 3 + * Rules Like: FREQ=MONTHLY;COUNT=10;BYMONTHDAY=-3 + */ + } else if (has_by_data(impl,BY_MONTH_DAY)) { - /* Cases like: FREQ=MONTHLY;COUNT=10;BYMONTHDAY=-3 */ short day; assert( BYMDPTR[0]!=ICAL_RECURRENCE_ARRAY_MAX); @@ -1558,18 +1559,70 @@ int next_month(struct icalrecur_iterator_impl* impl) increment_month(impl); } - return data_valid; /* Signal that the data is valid */ + return data_valid; } +int next_weekday_by_week(struct icalrecur_iterator_impl* impl) +{ + + short end_of_data = 0; + short start_of_week, dow; + struct icaltimetype next; + + if (next_hour(impl) == 0){ + return 0; + } + + assert(has_by_data(impl,BY_DAY)); + + /* If we get here, we need to step to tne next day */ + + while(1) { + struct icaltimetype tt = icaltime_null_time(); + BYDAYIDX++; /* Look at next elem in BYDAY array */ + + /* Are we at the end of the BYDAY array? */ + if (BYDAYPTR[BYDAYIDX]==ICAL_RECURRENCE_ARRAY_MAX){ + BYDAYIDX = 0; /* Reset to 0 */ + end_of_data = 1; /* Signal that we're at the end */ + } + + /* Add the day of week offset to to the start of this week, and use + that to get the next day */ + /* ignore position of dow ("4FR"), only use dow ("FR")*/ + dow = icalrecurrencetype_day_day_of_week(BYDAYPTR[BYDAYIDX]); + tt.year = impl->last.year; + tt.day = impl->last.day; + tt.month = impl->last.month; + + start_of_week = icaltime_start_doy_of_week(tt); + + dow--; /* Set Sunday to be 0 */ + + if(dow+start_of_week <1){ + /* The selected date is in the previous year. */ + if(!end_of_data){ + continue; + } + } + + next = icaltime_from_day_of_year(start_of_week + dow,impl->last.year); + + impl->last.day = next.day; + impl->last.month = next.month; + impl->last.year = next.year; + + return end_of_data; + } + +} int next_week(struct icalrecur_iterator_impl* impl) { - short has_by_data = (impl->by_ptrs[BY_WEEK_NO][0]!=ICAL_RECURRENCE_ARRAY_MAX); - short this_frequency = (impl->rule.freq == ICAL_WEEKLY_RECURRENCE); short end_of_data = 0; - /* Increment to the next week day */ + /* Increment to the next week day, if there is data at a level less than a week */ if (next_weekday_by_week(impl) == 0){ return 0; /* Have not reached end of week yet */ } @@ -1577,8 +1630,8 @@ int next_week(struct icalrecur_iterator_impl* impl) /* If we get here, we have incremented through the entire week, and can increment to the next week */ - - if( has_by_data){ + if( has_by_data(impl,BY_WEEK_NO)){ + /*FREQ=WEEKLY;BYWEEK=20*/ /* Use the Week Number byrule data */ int week_no; struct icaltimetype t; @@ -1602,13 +1655,12 @@ int next_week(struct icalrecur_iterator_impl* impl) impl->last = icaltime_normalize(impl->last); - } else if( !has_by_data && this_frequency ){ - /* If there is no BY_WEEK_NO data, just jump forward 7 days. */ + } else { + /* Jump to the next week */ increment_monthday(impl,7*impl->rule.interval); } - - if(has_by_data && end_of_data && this_frequency ){ + if( has_by_data(impl,BY_WEEK_NO) && end_of_data){ increment_year(impl,1); } @@ -1616,14 +1668,14 @@ int next_week(struct icalrecur_iterator_impl* impl) } - +/* Expand the BYDAY rule part and return a pointer to a newly allocated list of days. */ pvl_list expand_by_day(struct icalrecur_iterator_impl* impl,short year) { /* Try to calculate each of the occurrences. */ int i; pvl_list days_list = pvl_newlist(); - short start_dow, end_dow, end_year_day, start_doy; + short start_dow, end_dow, end_year_day; struct icaltimetype tmp = impl->last; tmp.year= year; @@ -1631,35 +1683,34 @@ pvl_list expand_by_day(struct icalrecur_iterator_impl* impl,short year) tmp.day = 1; tmp.is_date = 1; + /* Find the day that 1st Jan falls on, 1 (Sun) to 7 (Sat). */ start_dow = icaltime_day_of_week(tmp); - start_doy = icaltime_start_doy_of_week(tmp); /* Get the last day of the year*/ - tmp.year++; - tmp = icaltime_normalize(tmp); - tmp.day--; - tmp = icaltime_normalize(tmp); + tmp.year= year; + tmp.month = 12; + tmp.day = 31; + tmp.is_date = 1; end_dow = icaltime_day_of_week(tmp); end_year_day = icaltime_day_of_year(tmp); for(i = 0; BYDAYPTR[i] != ICAL_RECURRENCE_ARRAY_MAX; i++){ + /* This is 1 (Sun) to 7 (Sat). */ short dow = icalrecurrencetype_day_day_of_week(BYDAYPTR[i]); short pos = icalrecurrencetype_day_position(BYDAYPTR[i]); if(pos == 0){ - /* add all of the days of the year with this day-of-week*/ - int week; - for(week = 0; week < 52 ; week ++){ - short doy = start_doy + (week * 7) + dow-1; + /* The day was specified without a position -- it is just + a bare day of the week ( BYDAY=SU) so add all of the + days of the year with this day-of-week*/ + int doy, tmp_start_doy; - if(doy > end_year_day){ - break; - } else { + tmp_start_doy = ((dow + 7 - start_dow) % 7) + 1; + + for (doy = tmp_start_doy; doy <= end_year_day; doy += 7) pvl_push(days_list,(void*)(int)doy); - } - } } else if ( pos > 0) { int first; @@ -1669,14 +1720,24 @@ pvl_list expand_by_day(struct icalrecur_iterator_impl* impl,short year) } else { first = dow - start_dow + 8; } - + + /* Then just multiple the position times 7 to get the pos'th day in the year */ pvl_push(days_list,(void*)(first+ (pos-1) * 7)); } else { /* pos < 0 */ - assert(0); + int last; + pos = -pos; + + /* last occurrence of dow in year */ + if( dow <= end_dow) { + last = end_year_day - end_dow + dow; + } else { + last = end_year_day - end_dow + dow - 7; + } + + pvl_push(days_list,(void*)(last - (pos-1) * 7)); } } - return days_list; } @@ -1692,6 +1753,8 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year) struct icaltimetype t; int flags; + t = icaltime_null_time(); + #define HBD(x) has_by_data(impl,x) t.is_date = 1; /* Needed to make day_of_year routines work property */ @@ -1699,18 +1762,26 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year) memset(&t,0,sizeof(t)); memset(impl->days,ICAL_RECURRENCE_ARRAY_MAX_BYTE,sizeof(impl->days)); + /* The flags and the following switch statement select which code + to use to expand the yers days, based on which BY-rules are + present. */ + flags = (HBD(BY_DAY) ? 1<dtstart; + t.year = impl->last.year; + + impl->days[days_index++] = icaltime_day_of_year(t); + break; } case 1<by_ptrs[BY_MONTH_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++) + { + short month_day = impl->by_ptrs[BY_MONTH_DAY][k]; + short doy; + + t = impl->dtstart; + t.day = month_day; + t.year = year; + t.is_date = 1; + + doy = icaltime_day_of_year(t); + + impl->days[days_index++] = doy; + + } break; } @@ -1778,13 +1863,15 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year) dow = icaltime_day_of_week(t); /* HACK Not finished */ + + icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR); break; } case (1<days[days_index++] = day; } + pvl_free(days); + break; } @@ -1810,38 +1899,86 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year) for(j=0;impl->by_ptrs[BY_MONTH][j]!=ICAL_RECURRENCE_ARRAY_MAX;j++){ short month = impl->by_ptrs[BY_MONTH][j]; short days_in_month = icaltime_days_in_month(month,year); - + short first_dow, last_dow, doy_offset; + struct icaltimetype t; memset(&t,0,sizeof(struct icaltimetype)); - t.day = 1; t.year = year; t.month = month; + t.day = 1; t.is_date = 1; - - for(t.day = 1; t.day <=days_in_month; t.day++){ - - short current_dow = icaltime_day_of_week(t); - - for(k=0;impl->by_ptrs[BY_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++){ - - enum icalrecurrencetype_weekday dow = - icalrecurrencetype_day_day_of_week(impl->by_ptrs[BY_DAY][k]); - - if(current_dow == dow){ - short doy = icaltime_day_of_year(t); - /* HACK, incomplete Nth day of week handling */ - impl->days[days_index++] = doy; - - } + + first_dow = icaltime_day_of_week(t); + + /* This holds the day offset used to calculate the day of the year + from the month day. Just add the month day to this. */ + doy_offset = icaltime_day_of_year(t) - 1; + + t.day = days_in_month; + last_dow = icaltime_day_of_week(t); + + for(k=0;impl->by_ptrs[BY_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++){ + short day_coded = impl->by_ptrs[BY_DAY][k]; + enum icalrecurrencetype_weekday dow = + icalrecurrencetype_day_day_of_week(day_coded); + short pos = icalrecurrencetype_day_position(day_coded); + short first_matching_day, last_matching_day, day, month_day; + + /* Calculate the first day in the month with the given weekday, + and the last day. */ + first_matching_day = ((dow + 7 - first_dow) % 7) + 1; + last_matching_day = days_in_month - ((last_dow + 7 - dow) % 7); + + if (pos == 0) { + /* Add all of instances of the weekday within the month. */ + for (day = first_matching_day; day <= days_in_month; day += 7) + impl->days[days_index++] = doy_offset + day; + + } else if (pos > 0) { + /* Add the nth instance of the weekday within the month. */ + month_day = first_matching_day + (pos - 1) * 7; + + if (month_day <= days_in_month) + impl->days[days_index++] = doy_offset + month_day; + + } else { + /* Add the -nth instance of the weekday within the month.*/ + month_day = last_matching_day + (pos + 1) * 7; + + if (month_day > 0) + impl->days[days_index++] = doy_offset + month_day; } - } + } } break; } case (1<days[days_index++] = day; + } + } + + } + + pvl_free(days); + break; } @@ -1872,6 +2009,8 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year) } + pvl_free(days); + break; } @@ -1899,12 +2038,14 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year) } } + + pvl_free(days); break; } case (1<days[++impl->days_index] == ICAL_RECURRENCE_ARRAY_MAX){ impl->days_index = 0; + + for (;;) { increment_year(impl,impl->rule.interval); expand_year_days(impl,impl->last.year); + if (impl->days[0] != ICAL_RECURRENCE_ARRAY_MAX) + break; + } } next = icaltime_from_day_of_year(impl->days[impl->days_index],impl->last.year); diff --git a/other-licenses/libical/src/libical/icalrestriction.c b/other-licenses/libical/src/libical/icalrestriction.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/libical/icalrestriction.c.in b/other-licenses/libical/src/libical/icalrestriction.c.in index 454442531ff..8a1aedc4ee0 100644 --- a/other-licenses/libical/src/libical/icalrestriction.c.in +++ b/other-licenses/libical/src/libical/icalrestriction.c.in @@ -18,6 +18,11 @@ #include /* For snprintf */ #define TMP_BUF_SIZE 1024 + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif /* Define the structs for the restrictions. these data are filled out diff --git a/other-licenses/libical/src/libical/icaltime.c b/other-licenses/libical/src/libical/icaltime.c index c2337824c97..9ff8e143c70 100644 --- a/other-licenses/libical/src/libical/icaltime.c +++ b/other-licenses/libical/src/libical/icaltime.c @@ -3,7 +3,7 @@ FILE: icaltime.c CREATOR: eric 02 June 2000 - $Id: icaltime.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $ + $Id: icaltime.c,v 1.3 2001-12-21 18:56:27 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -26,7 +26,7 @@ ======================================================================*/ #ifdef HAVE_CONFIG_H -#include +#include "config.h" #endif #include "icaltime.h" @@ -35,22 +35,245 @@ #include #include +/* #ifdef ICAL_NO_LIBICAL #define icalerror_set_errno(x) #define icalerror_check_arg_rv(x,y) #define icalerror_check_arg_re(x,y,z) -#else +#endif +*/ + #include "icalerror.h" #include "icalmemory.h" -#endif +#include "icaltimezone.h" #ifdef WIN32 -#include -#define snprintf _snprintf -#define strcasecmp stricmp +#include + +#define snprintf _snprintf +#define strcasecmp stricmp #endif + +/********************************************************************** + * Deprecated TIme functions + * The following four routines are required under UNIX systems to account for the lack + * of two time routines, a version of mktime() that operates in UTC ( the inverse of + * gmtime() ), and a routine to get the UTC offset for a particular timezone. + ***********************************************************************/ + + +/* Structure used by set_tz to hold an old value of TZ, and the new + value, which is in memory we will have to free in unset_tz */ +struct set_tz_save {char* orig_tzid; char* new_env_str;}; + +/* Structure used by set_tz to hold an old value of TZ, and the new + value, which is in memory we will have to free in unset_tz */ +/* This will hold the last "TZ=XXX" string we used with putenv(). After we + call putenv() again to set a new TZ string, we can free the previous one. + As far as I know, no libc implementations actually free the memory used in + the environment variables (how could they know if it is a static string or + a malloc'ed string?), so we have to free it ourselves. */ + +struct set_tz_save saved_tz; + + +/* Temporarily change the TZ environmental variable. */ +struct set_tz_save set_tz(const char* tzid) +{ + + char *orig_tzid = 0; + char *new_env_str; + struct set_tz_save savetz; + size_t tmp_sz; + + savetz.orig_tzid = 0; + savetz.new_env_str = 0; + + if(getenv("TZ") != 0){ + orig_tzid = (char*)icalmemory_strdup(getenv("TZ")); + + if(orig_tzid == 0){ + icalerror_set_errno(ICAL_NEWFAILED_ERROR); + free(orig_tzid); + return savetz; + } + } + + tmp_sz =strlen(tzid)+4; + new_env_str = (char*)malloc(tmp_sz); + + if(new_env_str == 0){ + icalerror_set_errno(ICAL_NEWFAILED_ERROR); + return savetz; + } + + /* Copy the TZid into a string with the form that putenv expects. */ + strcpy(new_env_str,"TZ="); + strcpy(new_env_str+3,tzid); + + putenv(new_env_str); + + /* Old value of TZ and the string we will have to free later */ + savetz.orig_tzid = orig_tzid; + savetz.new_env_str = new_env_str; + + return savetz; +} + +void unset_tz(struct set_tz_save savetz) +{ + /* restore the original TZ environment */ + + char* orig_tzid = savetz.orig_tzid; + + if(orig_tzid!=0){ + size_t tmp_sz =strlen(orig_tzid)+4; + char* orig_env_str = (char*)icalmemory_tmp_buffer(tmp_sz); + + if(orig_env_str == 0){ + icalerror_set_errno(ICAL_NEWFAILED_ERROR); + return; + } + + strcpy(orig_env_str,"TZ="); + strcpy(orig_env_str+3,orig_tzid); + + putenv(orig_env_str); + + free(orig_tzid); + } else { + putenv("TZ="); /* Delete from environment */ + } + + if(savetz.new_env_str != 0){ + free(savetz.new_env_str); + } +} + +/* A UTC version of mktime() */ +time_t icaltimegm(struct tm* stm) +{ + + time_t t; +#ifndef WIN32 + struct set_tz_save old_tz = set_tz("UTC"); + t = mktime(stm); + unset_tz(old_tz); + return t; +#else + TIME_ZONE_INFORMATION tz; + char * szZone; + icaltimezone* zone; + int offset_tt; + + t = mktime(stm); + + GetTimeZoneInformation(&tz); + + t -= tz.Bias*60; + + return t; +#endif + + +} + +/* Get the offset for a named timezone. */ +int icaltime_utc_offset(struct icaltimetype ictt, const char* tzid) +{ + icaltimezone *utc_zone, *local_zone; + struct tm gtm; + struct set_tz_save old_tz; + + time_t tt = icaltime_as_timet(ictt); + time_t offset_tt; + + local_zone = icaltimezone_get_builtin_timezone(tzid); + utc_zone = icaltimezone_get_utc_timezone (); + + icaltimezone_get_utc_offset(local_zone, &ictt, ictt.is_daylight); + + +#ifndef NO_WARN_DEPRECATED + fprintf(stderr, "%s: %d: WARNING: icaltime_utc_offset is deprecated\n", __FILE__, __LINE__); +#endif + /* This function, combined with the set_tz/unset_tz calls in regression.c + makes for very convoluted behaviour (due to the setting of the tz environment variable) + arrghgh, at least this is what I think: benjaminlee */ + + if(tzid != 0){ + old_tz = set_tz(tzid); + } + + /* Mis-interpret a UTC broken out time as local time */ + gtm = *(gmtime(&tt)); + gtm.tm_isdst = localtime(&tt)->tm_isdst; + offset_tt = mktime(>m); + + if(tzid != 0){ + unset_tz(old_tz); + } + +#if 0 +#ifndef NO_WARN_DEPRECATED + fprintf(stderr, "%s: %d: WARNING: offset %d tt-offset_tt %d\n", __FILE__, __LINE__, offset, tt-offset_tt); +#endif + assert(offset == tt-offset_tt); +#endif + return tt-offset_tt; +} + +/***********************************************************************/ + + +/*********************************************************************** + * Old conversion routines that use a string to represent the timezone + ***********************************************************************/ + +/* convert tt, of timezone tzid, into a utc time */ +struct icaltimetype icaltime_as_utc(struct icaltimetype tt,const char* tzid) +{ + int tzid_offset; + + if(tt.is_utc == 1 || tt.is_date == 1){ + return tt; + } + + tzid_offset = icaltime_utc_offset(tt,tzid); + + tt.second -= tzid_offset; + + tt.is_utc = 1; + +#ifndef NO_WARN_DEPRECATED + fprintf(stderr, "%s: %d: WARNING: icaltime_as_utc is deprecated: '%s'\n", __FILE__, __LINE__, tzid); +#endif + return icaltime_normalize(tt); +} + +/* convert tt, a time in UTC, into a time in timezone tzid */ +struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid) +{ + int tzid_offset; + + tzid_offset = icaltime_utc_offset(tt,tzid); + + tt.second += tzid_offset; + + tt.is_utc = 0; + +#ifndef NO_WARN_DEPRECATED + fprintf(stderr, "%s: %d: WARNING: icaltime_as_zone is deprecated: '%s'\n", __FILE__, __LINE__, tzid); +#endif + return icaltime_normalize(tt); + +} + +/* **********************************************************************/ + + struct icaltimetype icaltime_from_timet(time_t tm, int is_date) { @@ -77,87 +300,55 @@ icaltime_from_timet(time_t tm, int is_date) return tt; } -/* Structure used by set_tz to hold an old value of TZ, and the new - value, which is in memory we will have to free in unset_tz */ -struct set_tz_save {char* orig_tzid; char* new_env_str;}; - -/* Temporarily change the TZ environmental variable. */ -struct set_tz_save set_tz(const char* tzid) +struct icaltimetype +icaltime_from_timet_with_zone(time_t tm, int is_date, icaltimezone *zone) { + struct icaltimetype tt; + struct tm t; + icaltimezone *utc_zone; - char *orig_tzid = 0; - char *new_env_str; - struct set_tz_save savetz; - size_t tmp_sz; + utc_zone = icaltimezone_get_utc_timezone (); - savetz.orig_tzid = 0; - savetz.new_env_str = 0; + /* Convert the time_t to a struct tm in UTC time. We can trust gmtime + for this. */ + t = *(gmtime(&tm)); + + tt.year = t.tm_year + 1900; + tt.month = t.tm_mon + 1; + tt.day = t.tm_mday; - if(getenv("TZ") != 0){ - orig_tzid = (char*)icalmemory_strdup(getenv("TZ")); + tt.is_utc = (zone == utc_zone) ? 1 : 0; + tt.is_date = is_date; + tt.is_daylight = 0; + tt.zone = NULL; - if(orig_tzid == 0){ - icalerror_set_errno(ICAL_NEWFAILED_ERROR); - return savetz; - } + if (is_date) { + /* We don't convert DATE values between timezones. */ + tt.hour = 0; + tt.minute = 0; + tt.second = 0; + } else { + tt.hour = t.tm_hour; + tt.minute = t.tm_min; + tt.second = t.tm_sec; + + /* Use our timezone functions to convert to the required timezone. */ + icaltimezone_convert_time (&tt, utc_zone, zone); } - tmp_sz =strlen(tzid)+4; - new_env_str = (char*)malloc(tmp_sz); - - if(new_env_str == 0){ - icalerror_set_errno(ICAL_NEWFAILED_ERROR); - return savetz; - } - - /* Copy the TZid into a string with the form that putenv expects. */ - strcpy(new_env_str,"TZ="); - strcpy(new_env_str+3,tzid); - - putenv(new_env_str); - - /* Old value of TZ and the string we will have to free later */ - savetz.orig_tzid = orig_tzid; - savetz.new_env_str = new_env_str; -#ifdef WIN32 - _tzset(); -#endif - - return savetz; + return tt; } -void unset_tz(struct set_tz_save savetz) +/* Returns the current time in the given timezone, as an icaltimetype. */ +struct icaltimetype icaltime_current_time_with_zone(icaltimezone *zone) { - /* restore the original TZ environment */ + return icaltime_from_timet_with_zone (time (NULL), 0, zone); +} - char* orig_tzid = savetz.orig_tzid; - - if(orig_tzid!=0){ - size_t tmp_sz =strlen(orig_tzid)+4; - char* orig_env_str = (char*)malloc(tmp_sz); - - if(orig_env_str == 0){ - icalerror_set_errno(ICAL_NEWFAILED_ERROR); - return; - } - - strcpy(orig_env_str,"TZ="); - strcpy(orig_env_str+3,orig_tzid); - - putenv(orig_env_str); - - free(orig_tzid); - } else { - putenv("TZ"); /* Delete from environment */ - } - -#ifdef WIN32 - _tzset(); -#endif - - if(savetz.new_env_str != 0){ - free(savetz.new_env_str); - } +/* Returns the current day as an icaltimetype, with is_date set. */ +struct icaltimetype icaltime_today(void) +{ + return icaltime_from_timet_with_zone (time (NULL), 1, NULL); } @@ -165,7 +356,12 @@ time_t icaltime_as_timet(struct icaltimetype tt) { struct tm stm; time_t t; - +#ifdef WIN32 + TIME_ZONE_INFORMATION tz; + char * szZone; + icaltimezone* zone; + int offset_tt; +#endif memset(&stm,0,sizeof( struct tm)); if(icaltime_is_null_time(tt)) { @@ -181,23 +377,63 @@ time_t icaltime_as_timet(struct icaltimetype tt) stm.tm_isdst = -1; if(tt.is_utc == 1 || tt.is_date == 1){ -#ifndef WIN32 - struct set_tz_save old_tz = set_tz("UTC"); + t = icaltimegm(&stm); + } else { t = mktime(&stm); - unset_tz(old_tz); -#else - t = mktime(&stm); - _tzset(); - t -= _timezone; +#ifdef WIN32 + /* Arg, mktime on Win32 always returns the time is localtime + zone, so we'll figure out what time we are looking for and adjust it */ + + szZone = getenv("TZ"); + if ( szZone != NULL && strlen(szZone) != 0 ){ + GetTimeZoneInformation(&tz); + zone = icaltimezone_get_builtin_timezone(szZone); + offset_tt = icaltimezone_get_utc_offset_of_utc_time (zone, + &tt, + NULL); + t += -offset_tt - tz.Bias*60; + } + #endif - } else { - t = mktime(&stm); } return t; } +time_t icaltime_as_timet_with_zone(struct icaltimetype tt, icaltimezone *zone) +{ + icaltimezone *utc_zone; + struct tm stm; + time_t t; + + utc_zone = icaltimezone_get_utc_timezone (); + + /* If the time is the special null time, return 0. */ + if (icaltime_is_null_time(tt)) { + return 0; + } + + /* Use our timezone functions to convert to UTC. */ + if (!tt.is_date) + icaltimezone_convert_time (&tt, zone, utc_zone); + + /* Copy the icaltimetype to a struct tm. */ + memset (&stm, 0, sizeof (struct tm)); + + stm.tm_sec = tt.second; + stm.tm_min = tt.minute; + stm.tm_hour = tt.hour; + stm.tm_mday = tt.day; + stm.tm_mon = tt.month-1; + stm.tm_year = tt.year-1900; + stm.tm_isdst = -1; + + t = icaltimegm(&stm); + + return t; +} + char* icaltime_as_ical_string(struct icaltimetype tt) { size_t size = 17; @@ -222,110 +458,11 @@ char* icaltime_as_ical_string(struct icaltimetype tt) } - -/* convert tt, of timezone tzid, into a utc time */ -struct icaltimetype icaltime_as_utc(struct icaltimetype tt,const char* tzid) -{ - int tzid_offset; - - if(tt.is_utc == 1 || tt.is_date == 1){ - return tt; - } - - tzid_offset = icaltime_utc_offset(tt,tzid); - - tt.second -= tzid_offset; - - tt.is_utc = 1; - - return icaltime_normalize(tt); -} - -/* convert tt, a time in UTC, into a time in timezone tzid */ -struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid) -{ - int tzid_offset; - - tzid_offset = icaltime_utc_offset(tt,tzid); - - tt.second += tzid_offset; - - tt.is_utc = 0; - - return icaltime_normalize(tt); - -} - - -/* Return the offset of the named zone as seconds. tt is a time - indicating the date for which you want the offset */ -int icaltime_utc_offset(struct icaltimetype ictt, const char* tzid) -{ - - time_t tt = icaltime_as_timet(ictt); - time_t offset_tt; - struct tm gtm; - struct set_tz_save old_tz; - - if(tzid != 0){ - old_tz = set_tz(tzid); - } - -#ifndef WIN32 - /* Mis-interpret a UTC broken out time as local time */ - gtm = *(gmtime(&tt)); - gtm.tm_isdst = localtime(&tt)->tm_isdst; - offset_tt = mktime(>m); -#else - _tzset(); - offset_tt = _timezone; - if ( localtime(&tt)->tm_isdst ) - offset_tt -= 3600; -#endif - if(tzid != 0){ - unset_tz(old_tz); - } - -#ifndef WIN32 - return tt-offset_tt; -#else - return -offset_tt; -#endif -} - - - -/* Normalize by converting from localtime to utc and back to local - time. This uses localtime because localtime and mktime are inverses - of each other */ +/* Normalize the icaltime, so that all fields are within the normal range. */ struct icaltimetype icaltime_normalize(struct icaltimetype tt) { - struct tm stm; - time_t tut; - - memset(&stm,0,sizeof( struct tm)); - - stm.tm_sec = tt.second; - stm.tm_min = tt.minute; - stm.tm_hour = tt.hour; - stm.tm_mday = tt.day; - stm.tm_mon = tt.month-1; - stm.tm_year = tt.year-1900; - stm.tm_isdst = -1; /* prevents mktime from changing hour based on - daylight savings */ - - tut = mktime(&stm); - - stm = *(localtime(&tut)); - - tt.second = stm.tm_sec; - tt.minute = stm.tm_min; - tt.hour = stm.tm_hour; - tt.day = stm.tm_mday; - tt.month = stm.tm_mon +1; - tt.year = stm.tm_year+1900; - + icaltime_adjust (&tt, 0, 0, 0, 0); return tt; } @@ -393,25 +530,30 @@ char* icaltime_as_ctime(struct icaltimetype t) return ctime_str; } +/* Returns whether the specified year is a leap year. Year is the normal year, + e.g. 2001. */ +int +icaltime_is_leap_year (int year) +{ + + if (year <= 1752) + return (year % 4 == 0); + else + return ( (year % 4==0) && (year % 100 !=0 )) || (year % 400 == 0); +} 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) { - int is_leap =0; int days = days_in_month[month]; assert(month > 0); assert(month <= 12); - if( (year % 4 == 0 && year % 100 != 0) || - year % 400 == 0){ - is_leap =1; - } - if( month == 2){ - days += is_leap; + days += icaltime_is_leap_year(year); } return days; @@ -419,102 +561,131 @@ short icaltime_days_in_month(short month,short year) /* 1-> Sunday, 7->Saturday */ short icaltime_day_of_week(struct icaltimetype t){ + struct tm stm; - time_t tt = icaltime_as_timet(t); - struct tm *tm; + stm.tm_year = t.year - 1900; + stm.tm_mon = t.month - 1; + stm.tm_mday = t.day; + stm.tm_hour = 0; + stm.tm_min = 0; + stm.tm_sec = 0; + stm.tm_isdst = -1; - if(t.is_utc == 1){ - tm = gmtime(&tt); - } else { - tm = localtime(&tt); - } + mktime (&stm); - return tm->tm_wday+1; + return stm.tm_wday + 1; } -/* Day of the year that the first day of the week (Sunday) is on */ +/* Day of the year that the first day of the week (Sunday) is on. + FIXME: Doesn't take into account different week start days. */ short icaltime_start_doy_of_week(struct icaltimetype t){ - time_t tt = icaltime_as_timet(t); - time_t start_tt; - struct tm *stm; - int syear; + struct tm stm; + int start; - stm = gmtime(&tt); - syear = stm->tm_year; + stm.tm_year = t.year - 1900; + stm.tm_mon = t.month - 1; + stm.tm_mday = t.day; + stm.tm_hour = 0; + stm.tm_min = 0; + stm.tm_sec = 0; + stm.tm_isdst = -1; - start_tt = tt - stm->tm_wday*(60*60*24); + mktime (&stm); - stm = gmtime(&start_tt); + /* Move back to the start of the week. */ + stm.tm_mday -= stm.tm_wday; - if(syear == stm->tm_year){ - return stm->tm_yday+1; + mktime (&stm); + + + /* If we are still in the same year as the original date, we just return + the day of the year. */ + if (t.year - 1900 == stm.tm_year){ + start = stm.tm_yday+1; } else { /* return negative to indicate that start of week is in previous year. */ - int is_leap = 0; - int year = stm->tm_year; - if( (year % 4 == 0 && year % 100 != 0) || - year % 400 == 0){ - is_leap =1; - } + int is_leap = icaltime_is_leap_year(stm.tm_year+1900); - return (stm->tm_yday+1)-(365+is_leap); + start = (stm.tm_yday+1)-(365+is_leap); } - + + return start; } +/* FIXME: Doesn't take into account the start day of the week. strftime assumes + that weeks start on Monday. */ short icaltime_week_number(struct icaltimetype ictt) { - char str[5]; - time_t t = icaltime_as_timet(ictt); + struct tm stm; int week_no; + char str[8]; - strftime(str,5,"%V", gmtime(&t)); + stm.tm_year = ictt.year - 1900; + stm.tm_mon = ictt.month - 1; + stm.tm_mday = ictt.day; + stm.tm_hour = 0; + stm.tm_min = 0; + stm.tm_sec = 0; + stm.tm_isdst = -1; + + mktime (&stm); + + strftime(str,5,"%V", &stm); week_no = atoi(str); return week_no; - } +/* The first array is for non-leap years, the seoncd for leap years*/ +static const short days_in_year[2][13] = +{ /* jan feb mar apr may jun jul aug sep oct nov dec */ + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } +}; +/* Returns the day of the year, counting from 1 (Jan 1st). */ short icaltime_day_of_year(struct icaltimetype t){ - time_t tt = icaltime_as_timet(t); - struct tm *stm; + int is_leap = icaltime_is_leap_year (t.year); - if(t.is_utc==1){ - stm = gmtime(&tt); - } else { - stm = localtime(&tt); - } - - return stm->tm_yday+1; - + return days_in_year[is_leap][t.month - 1] + t.day; } /* Jan 1 is day #1, not 0 */ struct icaltimetype icaltime_from_day_of_year(short doy, short year) { - struct tm stm; - time_t tt; - struct set_tz_save old_tz = set_tz("UTC"); + struct icaltimetype tt={0}; + int is_leap; + int month; - /* Get the time of january 1 of this year*/ - memset(&stm,0,sizeof(struct tm)); - stm.tm_year = year-1900; - stm.tm_mday = 1; + is_leap = icaltime_is_leap_year(year); - tt = mktime(&stm); - unset_tz(old_tz); + /* Zero and neg numbers represent days of the previous year */ + if(doy <1){ + year--; + is_leap = icaltime_is_leap_year(year); + doy += days_in_year[is_leap][12]; + } else if(doy > days_in_year[is_leap][12]){ + /* Move on to the next year*/ + is_leap = icaltime_is_leap_year(year); + doy -= days_in_year[is_leap][12]; + year++; + } + tt.year = year; - /* Now add in the days */ + for (month = 11; month >= 0; month--) { + if (doy > days_in_year[is_leap][month]) { + tt.month = month + 1; + tt.day = doy - days_in_year[is_leap][month]; + return tt; + } + } - doy--; - tt += doy *60*60*24; - - return icaltime_from_timet(tt, 1); + /* Shouldn't reach here. */ + assert (0); } struct icaltimetype icaltime_null_time() @@ -547,45 +718,72 @@ int icaltime_is_null_time(struct icaltimetype t) } -int icaltime_compare(struct icaltimetype a,struct icaltimetype b) +int icaltime_compare(struct icaltimetype a, struct icaltimetype b) { - time_t t1 = icaltime_as_timet(a); - time_t t2 = icaltime_as_timet(b); + int retval; - if (t1 > t2) { - return 1; - } else if (t1 < t2) { - return -1; - } else { - return 0; - } + if (a.year > b.year) + retval = 1; + else if (a.year < b.year) + retval = -1; + else if (a.month > b.month) + retval = 1; + else if (a.month < b.month) + retval = -1; + + else if (a.day > b.day) + retval = 1; + else if (a.day < b.day) + retval = -1; + + else if (a.hour > b.hour) + retval = 1; + else if (a.hour < b.hour) + retval = -1; + + else if (a.minute > b.minute) + retval = 1; + else if (a.minute < b.minute) + retval = -1; + + else if (a.second > b.second) + retval = 1; + else if (a.second < b.second) + retval = -1; + + else + retval = 0; + + return retval; } int icaltime_compare_date_only (struct icaltimetype a, struct icaltimetype b) { - time_t t1; - time_t t2; + int retval; - if (a.year == b.year && a.month == b.month && a.day == b.day) - return 0; + if (a.year > b.year) + retval = 1; + else if (a.year < b.year) + retval = -1; - t1 = icaltime_as_timet (a); - t2 = icaltime_as_timet (b); + else if (a.month > b.month) + retval = 1; + else if (a.month < b.month) + retval = -1; - if (t1 > t2) - return 1; - else if (t1 < t2) - return -1; - else { - /* not reached */ - assert (0); - return 0; - } + else if (a.day > b.day) + retval = 1; + else if (a.day < b.day) + retval = -1; + + else + retval = 0; + + return retval; } - /* These are defined in icalduration.c: struct icaltimetype icaltime_add(struct icaltimetype t, struct icaldurationtype d) @@ -593,3 +791,90 @@ struct icaldurationtype icaltime_subtract(struct icaltimetype t1, struct icaltimetype t2) */ + + +/* Adds (or subtracts) a time from a icaltimetype. + NOTE: This function is exactly the same as icaltimezone_adjust_change() + except for the type of the first parameter. */ +void +icaltime_adjust (struct icaltimetype *tt, + int days, + int hours, + int minutes, + int seconds) +{ + int second, minute, hour, day; + int minutes_overflow, hours_overflow, days_overflow, years_overflow; + int days_in_month; + + /* Add on the seconds. */ + second = tt->second + seconds; + tt->second = second % 60; + minutes_overflow = second / 60; + if (tt->second < 0) { + tt->second += 60; + minutes_overflow--; + } + + /* Add on the minutes. */ + minute = tt->minute + minutes + minutes_overflow; + tt->minute = minute % 60; + hours_overflow = minute / 60; + if (tt->minute < 0) { + tt->minute += 60; + hours_overflow--; + } + + /* Add on the hours. */ + hour = tt->hour + hours + hours_overflow; + tt->hour = hour % 24; + days_overflow = hour / 24; + if (tt->hour < 0) { + tt->hour += 24; + days_overflow--; + } + + /* Normalize the month. We do this before handling the day since we may + need to know what month it is to get the number of days in it. + Note that months are 1 to 12, so we have to be a bit careful. */ + if (tt->month >= 13) { + years_overflow = (tt->month - 1) / 12; + tt->year += years_overflow; + tt->month -= years_overflow * 12; + } else if (tt->month <= 0) { + /* 0 to -11 is -1 year out, -12 to -23 is -2 years. */ + years_overflow = (tt->month / 12) - 1; + tt->year += years_overflow; + tt->month -= years_overflow * 12; + } + + /* Add on the days. */ + day = tt->day + days + days_overflow; + if (day > 0) { + for (;;) { + days_in_month = icaltime_days_in_month (tt->month, tt->year); + if (day <= days_in_month) + break; + + tt->month++; + if (tt->month >= 13) { + tt->year++; + tt->month = 1; + } + + day -= days_in_month; + } + } else { + while (day <= 0) { + if (tt->month == 1) { + tt->year--; + tt->month = 12; + } else { + tt->month--; + } + + day += icaltime_days_in_month (tt->month, tt->year); + } + } + tt->day = day; +} diff --git a/other-licenses/libical/src/libical/icaltime.h b/other-licenses/libical/src/libical/icaltime.h index 8ab42170ce0..e4202bd877c 100644 --- a/other-licenses/libical/src/libical/icaltime.h +++ b/other-licenses/libical/src/libical/icaltime.h @@ -4,7 +4,7 @@ CREATOR: eric 02 June 2000 - $Id: icaltime.h,v 1.1 2001-11-15 19:27:10 mikep%oeone.com Exp $ + $Id: icaltime.h,v 1.2 2001-12-21 18:56:27 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -31,6 +31,13 @@ #include +/* An opaque struct representing a timezone. We declare this here to avoid + a circular dependancy. */ +#ifndef ICALTIMEONE_DEFINED +#define ICALTIMEONE_DEFINED +typedef struct _icaltimezone icaltimezone; +#endif + /* icaltime_span is returned by icalcomponent_get_span() */ struct icaltime_span { time_t start; /* in UTC */ @@ -41,8 +48,8 @@ struct icaltime_span { struct icaltimetype { - int year; - int month; + int year; /* Actual year, e.g. 2001. */ + int month; /* 1 (Jan) to 12 (Dec). */ int day; int hour; int minute; @@ -52,15 +59,30 @@ struct icaltimetype int is_date; /* 1 -> interpret this as date. */ + int is_daylight; /* 1 -> time is in daylight savings time. */ + const char* zone; /*Ptr to Olsen placename. Libical does not own mem*/ }; /* Convert seconds past UNIX epoch to a timetype*/ struct icaltimetype icaltime_from_timet(time_t v, int is_date); +/* Newer version of above, using timezones. */ +struct icaltimetype icaltime_from_timet_with_zone(time_t tm, int is_date, + icaltimezone *zone); + +/* Returns the current time in the given timezone, as an icaltimetype. */ +struct icaltimetype icaltime_current_time_with_zone(icaltimezone *zone); + +/* Returns the current day as an icaltimetype, with is_date set. */ +struct icaltimetype icaltime_today(void); + /* Return the time as seconds past the UNIX epoch */ time_t icaltime_as_timet(struct icaltimetype); +/* Newer version of above, using timezones. */ +time_t icaltime_as_timet_with_zone(struct icaltimetype tt, icaltimezone *zone); + /* Return a string represention of the time, in RFC2445 format. The string is owned by libical */ char* icaltime_as_ical_string(struct icaltimetype tt); @@ -75,6 +97,11 @@ int icaltime_as_int(struct icaltimetype); /* create a time from an ISO format string */ struct icaltimetype icaltime_from_string(const char* str); + +/* begin WARNING !! DEPRECATED !! functions ***** +use new icaltimezone functions, see icaltimezone.h + */ + /* 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 */ @@ -89,6 +116,11 @@ struct icaltimetype icaltime_as_utc(struct icaltimetype tt, struct icaltimetype icaltime_as_zone(struct icaltimetype tt, const char* tzid); +/* end WARNING !! DEPRECATED !! functions ***** + */ + + + /* Return a null time, which indicates no time has been set. This time represent the beginning of the epoch */ struct icaltimetype icaltime_null_time(void); @@ -138,6 +170,9 @@ int icaltime_compare_date_only(struct icaltimetype a, struct icaltimetype b); /* Return the number of days in the given month */ short icaltime_days_in_month(short month,short year); +/* Adds or subtracts a number of days, hours, minutes and seconds. */ +void icaltime_adjust(struct icaltimetype *tt, int days, int hours, + int minutes, int seconds); #endif /* !ICALTIME_H */ diff --git a/other-licenses/libical/src/libical/icaltypes.c b/other-licenses/libical/src/libical/icaltypes.c index 10fa78b5add..e3aa3ae1ffa 100644 --- a/other-licenses/libical/src/libical/icaltypes.c +++ b/other-licenses/libical/src/libical/icaltypes.c @@ -3,7 +3,7 @@ FILE: icaltypes.c CREATOR: eric 16 May 1999 - $Id: icaltypes.c,v 1.2 2001-11-22 19:21:50 mikep%oeone.com Exp $ + $Id: icaltypes.c,v 1.3 2001-12-21 18:56:27 mikep%oeone.com Exp $ $Locker: $ @@ -34,10 +34,11 @@ #include /* for errno */ #include /* for icalmemory_strdup */ #include -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif #define TEMP_MAX 1024 @@ -152,13 +153,23 @@ void* icalattachtype_get_binary(struct icalattachtype* v) return v->binary; } +int icaltriggertype_is_null_trigger(struct icaltriggertype tr) +{ + if(icaltime_is_null_time(tr.time) && + icaldurationtype_is_null_duration(tr.duration)){ + return 1; + } + return 0; +} + struct icaltriggertype icaltriggertype_from_string(const char* str) { struct icaltriggertype tr, null_tr; - int old_ieaf = icalerror_errors_are_fatal; + icalerrorstate es; + icalerrorenum e; tr.time= icaltime_null_time(); tr.duration = icaldurationtype_from_int(0); @@ -167,13 +178,14 @@ struct icaltriggertype icaltriggertype_from_string(const char* str) if(str == 0) goto error; - - icalerror_errors_are_fatal = 0; + /* Surpress errors so a failure in icaltime_from_string() does not cause an abort */ + es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR); + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL); + e = icalerrno; + icalerror_set_errno(ICAL_NO_ERROR); tr.time = icaltime_from_string(str); - icalerror_errors_are_fatal = old_ieaf; - if (icaltime_is_null_time(tr.time)){ tr.duration = icaldurationtype_from_string(str); @@ -181,18 +193,21 @@ struct icaltriggertype icaltriggertype_from_string(const char* str) if(icaldurationtype_as_int(tr.duration) == 0) goto error; } + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es); + icalerror_set_errno(e); return tr; error: + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es); icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); return null_tr; } -struct icalreqstattype icalreqstattype_from_string(char* str) +struct icalreqstattype icalreqstattype_from_string(const char* str) { - char *p1,*p2; + const char *p1,*p2; struct icalreqstattype stat; int major, minor; @@ -207,14 +222,14 @@ struct icalreqstattype icalreqstattype_from_string(char* str) sscanf(str, "%d.%d",&major, &minor); if (major <= 0 || minor < 0){ - icalerror_set_errno(ICAL_BADARG_ERROR); + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); return stat; } stat.code = icalenum_num_to_reqstat(major, minor); if (stat.code == ICAL_UNKNOWN_STATUS){ - icalerror_set_errno(ICAL_BADARG_ERROR); + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); return stat; } @@ -240,7 +255,7 @@ struct icalreqstattype icalreqstattype_from_string(char* str) } -char* icalreqstattype_as_string(struct icalreqstattype stat) +const char* icalreqstattype_as_string(struct icalreqstattype stat) { char *temp; diff --git a/other-licenses/libical/src/libical/icaltypes.h b/other-licenses/libical/src/libical/icaltypes.h index 04e04c9dc31..e69de29bb2d 100644 --- a/other-licenses/libical/src/libical/icaltypes.h +++ b/other-licenses/libical/src/libical/icaltypes.h @@ -1,136 +0,0 @@ -/* -*- Mode: C -*- */ -/*====================================================================== - FILE: icaltypes.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 icaltypes.h - -======================================================================*/ - -#ifndef ICALTYPES_H -#define ICALTYPES_H - -#include -#include "icalenums.h" -#include "icaltime.h" -#include "icalduration.h" -#include "icalperiod.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; -}; - - -struct icaldatetimeperiodtype -{ - struct icaltimetype time; - struct icalperiodtype period; -}; - - -struct icaltriggertype -{ - struct icaltimetype time; - struct icaldurationtype duration; -}; - -struct icaltriggertype icaltriggertype_from_string(const char* str); - -/* 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); - - - -struct icaltimezonephase { - const char* tzname; - int is_stdandard; /* 1 = standard tme, 0 = daylight savings time */ - struct icaltimetype dtstart; - int offsetto; - int tzoffsetfrom; - const char* comment; - struct icaldatetimeperiodtype rdate; - const char* rrule; -}; - - -struct icaltimezonetype { - const char* tzid; - struct icaltimetype last_mod; - const char* tzurl; - - /* Array of phases. The end of the array is a phase with tzname == 0 */ - struct icaltimezonephase *phases; -}; - -void icaltimezonetype_free(struct icaltimezonetype tzt); - - -#endif /* !ICALTYPES_H */ diff --git a/other-licenses/libical/src/libical/icalvalue.c b/other-licenses/libical/src/libical/icalvalue.c index fd0af3d9ee4..e90bbed2b3c 100644 --- a/other-licenses/libical/src/libical/icalvalue.c +++ b/other-licenses/libical/src/libical/icalvalue.c @@ -3,7 +3,7 @@ FILE: icalvalue.c CREATOR: eric 02 May 1999 - $Id: icalvalue.c,v 1.2 2001-11-22 19:21:50 mikep%oeone.com Exp $ + $Id: icalvalue.c,v 1.3 2001-12-21 18:56:28 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -45,10 +45,11 @@ #include /* for mktime */ #include /* for atoi and atof */ #include /* for SHRT_MAX */ -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif #if _MAC_OS_ #include "icalmemory_strdup.h" @@ -185,18 +186,39 @@ char* icalmemory_strdup_and_dequote(const char* str) } case 'n': - { - *pout = '\n'; - break; - } case 'N': { *pout = '\n'; break; } - case '\\': - case ',': + case 't': + case 'T': + { + *pout = '\t'; + break; + } + case 'r': + case 'R': + { + *pout = '\r'; + break; + } + case 'b': + case 'B': + { + *pout = '\b'; + break; + } + case 'f': + case 'F': + { + *pout = '\f'; + break; + } case ';': + case ',': + case '"': + case '\\': { *pout = *p; break; @@ -336,7 +358,7 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char* break; } - + case ICAL_GEO_VALUE: { value = 0; @@ -346,56 +368,59 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char* char temp[TMP_BUF_SIZE]; sprintf(temp,"GEO Values are not implemented"); *error = icalproperty_vanew_xlicerror( - temp, - icalparameter_new_xlicerrortype( - ICAL_XLICERRORTYPE_VALUEPARSEERROR), - 0); + temp, + icalparameter_new_xlicerrortype( + ICAL_XLICERRORTYPE_VALUEPARSEERROR), + 0); } - + /*icalerror_warn("Parsing GEO properties is unimplmeneted");*/ - + break; } - - case ICAL_RECUR_VALUE: + + case ICAL_RECUR_VALUE: { struct icalrecurrencetype rt; rt = icalrecurrencetype_from_string(str); - value = icalvalue_new_recur(rt); + if(rt.freq != ICAL_NO_RECURRENCE){ + value = icalvalue_new_recur(rt); + } break; } - - case ICAL_TIME_VALUE: - case ICAL_DATE_VALUE: - case ICAL_DATETIME_VALUE: - case ICAL_DATETIMEDATE_VALUE: + + case ICAL_DATE_VALUE: + case ICAL_DATETIME_VALUE: { struct icaltimetype tt; + tt = icaltime_from_string(str); if(!icaltime_is_null_time(tt)){ value = icalvalue_new_impl(kind); value->data.v_time = tt; + + icalvalue_reset_kind(value); } break; } - - case ICAL_DATETIMEPERIOD_VALUE: + + case ICAL_DATETIMEPERIOD_VALUE: { struct icaltimetype tt; struct icalperiodtype p; tt = icaltime_from_string(str); p = icalperiodtype_from_string(str); - + if(!icaltime_is_null_time(tt)){ value = icalvalue_new_datetime(tt); } else if (!icalperiodtype_is_null_period(p)){ value = icalvalue_new_period(p); } - + break; } - - case ICAL_DURATION_VALUE: + + case ICAL_DURATION_VALUE: { struct icaldurationtype dur = icaldurationtype_from_string(str); @@ -404,34 +429,45 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char* } else { value = icalvalue_new_duration(dur); } - + break; } - - case ICAL_PERIOD_VALUE: + + case ICAL_PERIOD_VALUE: { - struct icalperiodtype p; - p = icalperiodtype_from_string(str); - - if(!icalperiodtype_is_null_period(p)){ - value = icalvalue_new_period(p); - } - break; + struct icalperiodtype p; + p = icalperiodtype_from_string(str); + + if(!icalperiodtype_is_null_period(p)){ + value = icalvalue_new_period(p); + } + break; } - case ICAL_TRIGGER_VALUE: + case ICAL_TRIGGER_VALUE: { struct icaltriggertype tr = icaltriggertype_from_string(str); - value = icalvalue_new_trigger(tr); + if (!icaltriggertype_is_null_trigger(tr)){ + value = icalvalue_new_trigger(tr); + } break; } + + case ICAL_REQUESTSTATUS_VALUE: + { + struct icalreqstattype rst = icalreqstattype_from_string(str); + if(rst.code != ICAL_UNKNOWN_STATUS){ + value = icalvalue_new_requeststatus(rst); + } + break; - default: - { - - if (error != 0 ){ + } + default: + { + + if (error != 0 ){ char temp[TMP_BUF_SIZE]; - + snprintf(temp,TMP_BUF_SIZE,"Unknown type for \'%s\'",str); *error = icalproperty_vanew_xlicerror( @@ -668,6 +704,8 @@ char* icalvalue_text_as_ical_string(icalvalue* value) { break; } +/* case '\\': + case '"': */ case ';': case ',':{ icalmemory_append_char(&str,&str_p,&buf_sz,'\\'); @@ -676,13 +714,6 @@ char* icalvalue_text_as_ical_string(icalvalue* value) { break; } - case '"':{ - icalmemory_append_char(&str,&str_p,&buf_sz,'\\'); - icalmemory_append_char(&str,&str_p,&buf_sz,*p); - line_length+=3; - break; - } - default: { icalmemory_append_char(&str,&str_p,&buf_sz,*p); line_length++; @@ -735,7 +766,7 @@ char* icalvalue_attach_as_ical_string(icalvalue* value) { } else if (a.url != 0){ return icalvalue_string_as_ical_string(value); } else { - icalerrno = ICAL_MALFORMEDDATA_ERROR; + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); return 0; } } @@ -765,21 +796,6 @@ void print_time_to_string(char* str, struct icaltimetype *data) } -char* icalvalue_time_as_ical_string(icalvalue* value) { - - struct icaltimetype data; - char* str; - icalerror_check_arg_rz( (value!=0),"value"); - data = icalvalue_get_time(value); - - str = (char*)icalmemory_tmp_buffer(8); - - str[0] = 0; - print_time_to_string(str,&data); - - return str; -} - void print_date_to_string(char* str, struct icaltimetype *data) { char temp[20]; @@ -821,10 +837,7 @@ const char* icalvalue_datetime_as_ical_string(icalvalue* value) { icalerror_check_arg_rz( (value!=0),"value"); - if( !(kind == ICAL_DATETIMEDATE_VALUE || - kind == ICAL_DATE_VALUE || - kind == ICAL_DATETIME_VALUE || - kind == ICAL_TIME_VALUE)) + if( !(kind == ICAL_DATE_VALUE || kind == ICAL_DATETIME_VALUE )) { icalerror_set_errno(ICAL_BADARG_ERROR); return 0; @@ -842,21 +855,6 @@ const char* icalvalue_datetime_as_ical_string(icalvalue* value) { } - -const char* icalvalue_datetimedate_as_ical_string(icalvalue* value) { - - struct icaltimetype data; - icalerror_check_arg_rz( (value!=0),"value"); - data = icalvalue_get_datetime(value); - - if (data.is_date == 1){ - return icalvalue_date_as_ical_string(value); - } else { - return icalvalue_datetime_as_ical_string(value); - } -} - - char* icalvalue_float_as_ical_string(icalvalue* value) { float data; @@ -960,12 +958,8 @@ icalvalue_as_ical_string (icalvalue* value) return icalvalue_date_as_ical_string(value); case ICAL_DATETIME_VALUE: return icalvalue_datetime_as_ical_string(value); - case ICAL_DATETIMEDATE_VALUE: - return icalvalue_datetimedate_as_ical_string(value); case ICAL_DURATION_VALUE: return icalvalue_duration_as_ical_string(value); - case ICAL_TIME_VALUE: - return icalvalue_time_as_ical_string(value); case ICAL_PERIOD_VALUE: return icalvalue_period_as_ical_string(value); @@ -983,6 +977,9 @@ icalvalue_as_ical_string (icalvalue* value) case ICAL_TRIGGER_VALUE: return icalvalue_trigger_as_ical_string(value); + + case ICAL_REQUESTSTATUS_VALUE: + return icalreqstattype_as_string(v->data.v_requeststatus); case ICAL_ACTION_VALUE: case ICAL_METHOD_VALUE: @@ -1038,10 +1035,8 @@ icalvalue_isa_value (void* value) int icalvalue_is_time(icalvalue* a) { icalvalue_kind kind = icalvalue_isa(a); - if(kind == ICAL_DATETIMEDATE_VALUE || - kind == ICAL_DATETIME_VALUE || - kind == ICAL_DATE_VALUE || - kind == ICAL_TIME_VALUE ){ + if(kind == ICAL_DATETIME_VALUE || + kind == ICAL_DATE_VALUE ){ return 1; } @@ -1122,8 +1117,6 @@ icalvalue_compare(icalvalue* a, icalvalue *b) case ICAL_TRIGGER_VALUE: case ICAL_DATE_VALUE: case ICAL_DATETIME_VALUE: - case ICAL_DATETIMEDATE_VALUE: - case ICAL_TIME_VALUE: case ICAL_DATETIMEPERIOD_VALUE: { int r; @@ -1175,6 +1168,23 @@ icalvalue_compare(icalvalue* a, icalvalue *b) } +/* Examine the value and possiby chage the kind to agree with the value */ +void icalvalue_reset_kind(icalvalue* value) +{ + struct icalvalue_impl* impl = (struct icalvalue_impl*)value; + + if( (impl->kind==ICAL_DATETIME_VALUE || impl->kind==ICAL_DATE_VALUE )&& + !icaltime_is_null_time(impl->data.v_time) ) { + + if( impl->data.v_time.is_date == 1){ + impl->kind = ICAL_DATE_VALUE; + } else { + impl->kind = ICAL_DATETIME_VALUE; + } + } + +} + void icalvalue_set_parent(icalvalue* value, icalproperty* property) { diff --git a/other-licenses/libical/src/libical/icalvalueimpl.h b/other-licenses/libical/src/libical/icalvalueimpl.h index 428cbe26ecc..70c7d6b17cc 100644 --- a/other-licenses/libical/src/libical/icalvalueimpl.h +++ b/other-licenses/libical/src/libical/icalvalueimpl.h @@ -3,7 +3,7 @@ FILE: icalvalue.c CREATOR: eric 02 May 1999 - $Id: icalvalueimpl.h,v 1.1 2001-11-15 19:27:11 mikep%oeone.com Exp $ + $Id: icalvalueimpl.h,v 1.2 2001-12-21 18:56:28 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -68,6 +68,8 @@ struct icalvalue_impl { /*struct icaltimetype v_datetime;*/ /*struct icaltimetype v_datetimedate;*/ + struct icalreqstattype v_requeststatus; + /* struct icalrecurrencetype was once included directly ( not referenced ) in this union, but it contributes 2000 bytes to every value, so now it is diff --git a/other-licenses/libical/src/libical/icalyacc.c b/other-licenses/libical/src/libical/icalyacc.c deleted file mode 100644 index c0f8dd08e75..00000000000 --- a/other-licenses/libical/src/libical/icalyacc.c +++ /dev/null @@ -1,1432 +0,0 @@ - -/* A Bison parser, made from icalyacc.y - by GNU Bison version 1.28 */ - -#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 -#define STRING 260 -#define EOL 261 -#define EQUALS 262 -#define CHARACTER 263 -#define COLON 264 -#define COMMA 265 -#define SEMICOLON 266 -#define MINUS 267 -#define TIMESEPERATOR 268 -#define TRUE 269 -#define FALSE 270 -#define FREQ 271 -#define BYDAY 272 -#define BYHOUR 273 -#define BYMINUTE 274 -#define BYMONTH 275 -#define BYMONTHDAY 276 -#define BYSECOND 277 -#define BYSETPOS 278 -#define BYWEEKNO 279 -#define BYYEARDAY 280 -#define DAILY 281 -#define MINUTELY 282 -#define MONTHLY 283 -#define SECONDLY 284 -#define WEEKLY 285 -#define HOURLY 286 -#define YEARLY 287 -#define INTERVAL 288 -#define COUNT 289 -#define UNTIL 290 -#define WKST 291 -#define MO 292 -#define SA 293 -#define SU 294 -#define TU 295 -#define WE 296 -#define TH 297 -#define FR 298 -#define BIT8 299 -#define ACCEPTED 300 -#define ADD 301 -#define AUDIO 302 -#define BASE64 303 -#define BINARY 304 -#define BOOLEAN 305 -#define BUSY 306 -#define BUSYTENTATIVE 307 -#define BUSYUNAVAILABLE 308 -#define CALADDRESS 309 -#define CANCEL 310 -#define CANCELLED 311 -#define CHAIR 312 -#define CHILD 313 -#define COMPLETED 314 -#define CONFIDENTIAL 315 -#define CONFIRMED 316 -#define COUNTER 317 -#define DATE 318 -#define DATETIME 319 -#define DECLINECOUNTER 320 -#define DECLINED 321 -#define DELEGATED 322 -#define DISPLAY 323 -#define DRAFT 324 -#define DURATION 325 -#define EMAIL 326 -#define END 327 -#define FINAL 328 -#define FLOAT 329 -#define FREE 330 -#define GREGORIAN 331 -#define GROUP 332 -#define INDIVIDUAL 333 -#define INPROCESS 334 -#define INTEGER 335 -#define NEEDSACTION 336 -#define NONPARTICIPANT 337 -#define OPAQUE 338 -#define OPTPARTICIPANT 339 -#define PARENT 340 -#define PERIOD 341 -#define PRIVATE 342 -#define PROCEDURE 343 -#define PUBLIC 344 -#define PUBLISH 345 -#define RECUR 346 -#define REFRESH 347 -#define REPLY 348 -#define REQPARTICIPANT 349 -#define REQUEST 350 -#define RESOURCE 351 -#define ROOM 352 -#define SIBLING 353 -#define START 354 -#define TENTATIVE 355 -#define TEXT 356 -#define THISANDFUTURE 357 -#define THISANDPRIOR 358 -#define TIME 359 -#define TRANSPAENT 360 -#define UNKNOWN 361 -#define UTCOFFSET 362 -#define XNAME 363 -#define ALTREP 364 -#define CN 365 -#define CUTYPE 366 -#define DAYLIGHT 367 -#define DIR 368 -#define ENCODING 369 -#define EVENT 370 -#define FBTYPE 371 -#define FMTTYPE 372 -#define LANGUAGE 373 -#define MEMBER 374 -#define PARTSTAT 375 -#define RANGE 376 -#define RELATED 377 -#define RELTYPE 378 -#define ROLE 379 -#define RSVP 380 -#define SENTBY 381 -#define STANDARD 382 -#define URI 383 -#define TIME_CHAR 384 -#define UTC_CHAR 385 - -#line 1 "icalyacc.y" - -/* -*- Mode: C -*- - ====================================================================== - FILE: icalitip.y - CREATOR: eric 10 June 1999 - - DESCRIPTION: - - $Id: icalyacc.c,v 1.2 2001-11-22 19:21:51 mikep%oeone.com Exp $ - $Locker: $ - - (C) COPYRIGHT 1999 Eric Busboom - http://www.softwarestudio.org - - 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. - - The original author is Eric Busboom - The original code is icalitip.y - - - - =======================================================================*/ - -#include -#include /* for strdup() */ -#include "icalparser.h" -#include "pvl.h" - -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; -int utcsign; - -/* Globals for DURATION values */ -struct icaldurationtype duration; - -/* Globals for TRIGGER values */ -struct icaltriggertype trigger; - -void copy_list(short* array, size_t size); -void add_prop(icalproperty_kind); -void icalparser_fill_date(struct tm* t, char* dstr); -void icalparser_fill_time(struct tm* t, char* tstr); -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. */ - - - -/* Set the state of the lexer so it will interpret values ( iCAL - VALUEs, that is, ) correctly. */ - - -#line 71 "icalyacc.y" -typedef union { - float v_float; - int v_int; - char* v_string; -} YYSTYPE; -#ifndef YYDEBUG -#define YYDEBUG 1 -#endif - -#include - -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif -#endif - - - -#define YYFINAL 51 -#define YYFLAG -32768 -#define YYNTBASE 141 - -#define YYTRANSLATE(x) ((unsigned)(x) <= 385 ? yytranslate[x] : 158) - -static const short yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 137, 2, 138, 2, 140, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 136, 2, 2, - 2, 133, 2, 2, 2, 2, 134, 2, 2, 139, - 2, 2, 135, 2, 2, 2, 132, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131 -}; - -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 6, 8, 10, 12, 14, 15, 17, - 18, 20, 25, 27, 30, 33, 36, 39, 42, 45, - 49, 52, 56, 59, 62, 63, 65, 67, 71, 75, - 79, 89, 96, 97, 99, 101, 105 -}; - -static const short yyrhs[] = { 142, - 0, 145, 0, 154, 0, 155, 0, 157, 0, 1, - 0, 3, 0, 0, 131, 0, 0, 131, 0, 3, - 130, 3, 143, 0, 152, 0, 152, 148, 0, 3, - 132, 0, 130, 149, 0, 130, 150, 0, 130, 151, - 0, 3, 133, 0, 3, 133, 150, 0, 3, 134, - 0, 3, 134, 151, 0, 3, 135, 0, 3, 136, - 0, 0, 137, 0, 138, 0, 153, 139, 146, 0, - 153, 139, 148, 0, 153, 139, 147, 0, 3, 130, - 3, 143, 140, 3, 130, 3, 144, 0, 3, 130, - 3, 143, 140, 154, 0, 0, 137, 0, 138, 0, - 156, 4, 4, 0, 156, 4, 4, 4, 0 -}; - -#endif - -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 177, 179, 180, 181, 182, 183, 190, 205, 207, 210, - 212, 214, 230, 231, 233, 238, 241, 244, 248, 252, - 257, 261, 266, 271, 276, 280, 284, 289, 294, 299, - 308, 329, 358, 364, 365, 367, 373 -}; -#endif - - -#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) - -static const char * const yytname[] = { "$","error","$undefined.","DIGITS", -"INTNUMBER","FLOATNUMBER","STRING","EOL","EQUALS","CHARACTER","COLON","COMMA", -"SEMICOLON","MINUS","TIMESEPERATOR","TRUE","FALSE","FREQ","BYDAY","BYHOUR","BYMINUTE", -"BYMONTH","BYMONTHDAY","BYSECOND","BYSETPOS","BYWEEKNO","BYYEARDAY","DAILY", -"MINUTELY","MONTHLY","SECONDLY","WEEKLY","HOURLY","YEARLY","INTERVAL","COUNT", -"UNTIL","WKST","MO","SA","SU","TU","WE","TH","FR","BIT8","ACCEPTED","ADD","AUDIO", -"BASE64","BINARY","BOOLEAN","BUSY","BUSYTENTATIVE","BUSYUNAVAILABLE","CALADDRESS", -"CANCEL","CANCELLED","CHAIR","CHILD","COMPLETED","CONFIDENTIAL","CONFIRMED", -"COUNTER","DATE","DATETIME","DECLINECOUNTER","DECLINED","DELEGATED","DISPLAY", -"DRAFT","DURATION","EMAIL","END","FINAL","FLOAT","FREE","GREGORIAN","GROUP", -"INDIVIDUAL","INPROCESS","INTEGER","NEEDSACTION","NONPARTICIPANT","OPAQUE","OPTPARTICIPANT", -"PARENT","PERIOD","PRIVATE","PROCEDURE","PUBLIC","PUBLISH","RECUR","REFRESH", -"REPLY","REQPARTICIPANT","REQUEST","RESOURCE","ROOM","SIBLING","START","TENTATIVE", -"TEXT","THISANDFUTURE","THISANDPRIOR","TIME","TRANSPAENT","UNKNOWN","UTCOFFSET", -"XNAME","ALTREP","CN","CUTYPE","DAYLIGHT","DIR","ENCODING","EVENT","FBTYPE", -"FMTTYPE","LANGUAGE","MEMBER","PARTSTAT","RANGE","RELATED","RELTYPE","ROLE", -"RSVP","SENTBY","STANDARD","URI","TIME_CHAR","UTC_CHAR","'W'","'H'","'M'","'S'", -"'D'","'+'","'-'","'P'","'/'","value","date_value","utc_char","utc_char_b","datetime_value", -"dur_date","dur_week","dur_time","dur_hour","dur_minute","dur_second","dur_day", -"dur_prefix","duration_value","period_value","plusminus","utcoffset_value", NULL -}; -#endif - -static const short yyr1[] = { 0, - 141, 141, 141, 141, 141, 141, 142, 143, 143, 144, - 144, 145, 146, 146, 147, 148, 148, 148, 149, 149, - 150, 150, 151, 152, 153, 153, 153, 154, 154, 154, - 155, 155, -1, 156, 156, 157, 157 -}; - -static const short yyr2[] = { 0, - 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, - 1, 4, 1, 2, 2, 2, 2, 2, 2, 3, - 2, 3, 2, 2, 0, 1, 1, 3, 3, 3, - 9, 6, 0, 1, 1, 3, 4 -}; - -static const short yydefact[] = { 0, - 6, 7, 26, 27, 1, 2, 0, 3, 4, 0, - 5, 0, 0, 0, 8, 0, 0, 28, 30, 29, - 13, 36, 9, 12, 15, 24, 0, 16, 17, 18, - 14, 37, 25, 19, 21, 23, 0, 26, 27, 32, - 0, 20, 0, 22, 0, 10, 11, 31, 0, 0, - 0 -}; - -static const short yydefgoto[] = { 49, - 5, 24, 48, 6, 18, 19, 20, 28, 29, 30, - 21, 7, 8, 9, 10, 11 -}; - -static const short yypact[] = { -1, --32768, -126, 7, 8,-32768,-32768, -133,-32768,-32768, 9, --32768, 11, -2, 12, -116, -129, 14,-32768,-32768,-32768, - -112, 15,-32768, -120,-32768,-32768, -125,-32768,-32768,-32768, --32768,-32768, 2, 18, 19,-32768, -107,-32768,-32768,-32768, - -110,-32768, -109,-32768, 22, -104,-32768,-32768, 28, 29, --32768 -}; - -static const short yypgoto[] = {-32768, --32768,-32768,-32768,-32768,-32768,-32768, 10,-32768, -4, -3, --32768,-32768, 0,-32768,-32768,-32768 -}; - - -#define YYLAST 140 - - -static const short yytable[] = { 1, - 16, 2, 25, 12, 37, 13, 26, 34, 35, 36, - -34, -35, 14, 15, 23, 22, 27, 17, 32, 33, - 41, 43, 45, 35, 46, 36, 47, 50, 51, 42, - 31, 44, 40, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, - 0, 0, 0, 0, 0, 3, 4, -25, 38, 39 -}; - -static const short yycheck[] = { 1, - 3, 3, 132, 130, 3, 139, 136, 133, 134, 135, - 4, 4, 4, 3, 131, 4, 3, 130, 4, 140, - 3, 3, 130, 134, 3, 135, 131, 0, 0, 34, - 21, 35, 33, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 130, -1, -1, - -1, -1, -1, -1, -1, 137, 138, 139, 137, 138 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/lib/bison.simple" -/* This file comes from bison-1.28. */ - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -#ifndef YYSTACK_USE_ALLOCA -#ifdef alloca -#define YYSTACK_USE_ALLOCA -#else /* alloca not defined */ -#ifdef __GNUC__ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) -#define YYSTACK_USE_ALLOCA -#include -#else /* not sparc */ -/* We think this test detects Watcom and Microsoft C. */ -/* This used to test MSDOS, but that is a bad idea - since that symbol is in the user namespace. */ -#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) -#if 0 /* No need for malloc.h, which pollutes the namespace; - instead, just don't use alloca. */ -#include -#endif -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -/* I don't know what this was needed for, but it pollutes the namespace. - So I turned it off. rms, 2 May 1997. */ -/* #include */ - #pragma alloca -#define YYSTACK_USE_ALLOCA -#else /* not MSDOS, or __TURBOC__, or _AIX */ -#if 0 -#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, - and on HPUX 10. Eventually we can turn this on. */ -#define YYSTACK_USE_ALLOCA -#define alloca __builtin_alloca -#endif /* __hpux */ -#endif -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc */ -#endif /* not GNU C */ -#endif /* alloca not defined */ -#endif /* YYSTACK_USE_ALLOCA not defined */ - -#ifdef YYSTACK_USE_ALLOCA -#define YYSTACK_ALLOC alloca -#else -#define YYSTACK_ALLOC malloc -#endif - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab -#define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) - -#define YYTERROR 1 -#define YYERRCODE 256 - -#ifndef YYPURE -#define YYLEX yylex() -#endif - -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ -#endif - -/* If nonreentrant, generate the variables here */ - -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif - -#ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 -#endif - -/* Define __yy_memcpy. Note that the size argument - should be passed with type unsigned int, because that is what the non-GCC - definitions require. With GCC, __builtin_memcpy takes an arg - of type size_t, but it can handle unsigned int. */ - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (to, from, count) - char *to; - char *from; - unsigned int count; -{ - register char *f = from; - register char *t = to; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#else /* __cplusplus */ - -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *to, char *from, unsigned int count) -{ - register char *t = to; - register char *f = from; - register int i = count; - - while (i-- > 0) - *t++ = *f++; -} - -#endif -#endif - -#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 *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ - -#ifdef YYPARSE_PARAM -#ifdef __cplusplus -#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#else /* not __cplusplus */ -#define YYPARSE_PARAM_ARG YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#endif /* not __cplusplus */ -#else /* not YYPARSE_PARAM */ -#define YYPARSE_PARAM_ARG -#define YYPARSE_PARAM_DECL -#endif /* not YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -#ifdef YYPARSE_PARAM -int yyparse (void *); -#else -int yyparse (void); -#endif -#endif - -int -yyparse(YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ - - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ - -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) -#endif - - int yystacksize = YYINITDEPTH; - int yyfree_stacks = 0; - -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif - - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ - - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - - yyssp = yyss - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ -yynewstate: - - *++yyssp = yystate; - - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif - - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); -#else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif - - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ - /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 2; - } - yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; -#ifndef YYSTACK_USE_ALLOCA - yyfree_stacks = 1; -#endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, - size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, - size * (unsigned int) sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, - size * (unsigned int) sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ - - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif - - if (yyssp >= yyss + yystacksize - 1) - YYABORT; - } - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif - - goto yybackup; - yybackup: - -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - - if (yychar == YYEMPTY) - { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; - } - - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ - { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif - } - else - { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif - } - - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) - goto yydefault; - - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrlab; - - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; - - yystate = yyn; - goto yynewstate; - -/* Do the default action for the current state. */ -yydefault: - - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - -/* Do a reduction. yyn is the number of a rule to reduce with. */ -yyreduce: - yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ - -#if YYDEBUG != 0 - if (yydebug) - { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 6: -#line 183 "icalyacc.y" -{ - icalparser_yy_value = 0; - icalparser_clear_flex_input(); - yyclearin; - ; - break;} -case 7: -#line 191 "icalyacc.y" -{ - struct icaltimetype stm; - - stm = fill_datetime(yyvsp[0].v_string,0); - - stm.hour = -1; - stm.minute = -1; - stm.second = -1; - stm.is_utc = 0; - stm.is_date = 1; - - icalparser_yy_value = icalvalue_new_date(stm); - ; - break;} -case 8: -#line 206 "icalyacc.y" -{utc = 0;; - break;} -case 9: -#line 207 "icalyacc.y" -{utc = 1;; - break;} -case 10: -#line 211 "icalyacc.y" -{utc_b = 0;; - break;} -case 11: -#line 212 "icalyacc.y" -{utc_b = 1;; - break;} -case 12: -#line 216 "icalyacc.y" -{ - struct icaltimetype stm; - stm = fill_datetime(yyvsp[-3].v_string, yyvsp[-1].v_string); - stm.is_utc = utc; - stm.is_date = 0; - - icalparser_yy_value = - icalvalue_new_datetime(stm); - ; - break;} -case 15: -#line 234 "icalyacc.y" -{ - duration.weeks = atoi(yyvsp[-1].v_string); - ; - break;} -case 16: -#line 239 "icalyacc.y" -{ - ; - break;} -case 17: -#line 242 "icalyacc.y" -{ - ; - break;} -case 18: -#line 245 "icalyacc.y" -{ - ; - break;} -case 19: -#line 249 "icalyacc.y" -{ - duration.hours = atoi(yyvsp[-1].v_string); - ; - break;} -case 20: -#line 253 "icalyacc.y" -{ - duration.hours = atoi(yyvsp[-2].v_string); - ; - break;} -case 21: -#line 258 "icalyacc.y" -{ - duration.minutes = atoi(yyvsp[-1].v_string); - ; - break;} -case 22: -#line 262 "icalyacc.y" -{ - duration.minutes = atoi(yyvsp[-2].v_string); - ; - break;} -case 23: -#line 267 "icalyacc.y" -{ - duration.seconds = atoi(yyvsp[-1].v_string); - ; - break;} -case 24: -#line 272 "icalyacc.y" -{ - duration.days = atoi(yyvsp[-1].v_string); - ; - break;} -case 25: -#line 277 "icalyacc.y" -{ - duration.is_neg = 0; - ; - break;} -case 26: -#line 281 "icalyacc.y" -{ - duration.is_neg = 0; - ; - break;} -case 27: -#line 285 "icalyacc.y" -{ - duration.is_neg = 1; - ; - break;} -case 28: -#line 290 "icalyacc.y" -{ - icalparser_yy_value = icalvalue_new_duration(duration); - memset(&duration,0, sizeof(duration)); - ; - break;} -case 29: -#line 295 "icalyacc.y" -{ - icalparser_yy_value = icalvalue_new_duration(duration); - memset(&duration,0, sizeof(duration)); - ; - break;} -case 30: -#line 300 "icalyacc.y" -{ - icalparser_yy_value = icalvalue_new_duration(duration); - memset(&duration,0, sizeof(duration)); - ; - break;} -case 31: -#line 309 "icalyacc.y" -{ - struct icalperiodtype p; - - p.start = fill_datetime(yyvsp[-8].v_string,yyvsp[-6].v_string); - p.start.is_utc = utc; - p.start.is_date = 0; - - - p.end = fill_datetime(yyvsp[-3].v_string,yyvsp[-1].v_string); - p.end.is_utc = utc_b; - p.end.is_date = 0; - - p.duration.days = -1; - p.duration.weeks = -1; - p.duration.hours = -1; - p.duration.minutes = -1; - p.duration.seconds = -1; - - icalparser_yy_value = icalvalue_new_period(p); - ; - break;} -case 32: -#line 330 "icalyacc.y" -{ - struct icalperiodtype p; - - p.start = fill_datetime(yyvsp[-5].v_string,yyvsp[-3].v_string); - p.start.is_utc = utc; - p.start.is_date = 0; - - p.end.year = -1; - p.end.month = -1; - p.end.day = -1; - p.end.hour = -1; - p.end.minute = -1; - p.end.second = -1; - - /* The duration_value rule setes the global 'duration' - variable, but it also creates a new value in - icalparser_yy_value. So, free that, then copy - 'duration' into the icalperiodtype struct. */ - - p.duration = icalvalue_get_duration(icalparser_yy_value); - icalvalue_free(icalparser_yy_value); - icalparser_yy_value = 0; - - icalparser_yy_value = icalvalue_new_period(p); - - ; - break;} -case 34: -#line 364 "icalyacc.y" -{ utcsign = 1; ; - break;} -case 35: -#line 365 "icalyacc.y" -{ utcsign = -1; ; - break;} -case 36: -#line 369 "icalyacc.y" -{ - icalparser_yy_value = icalvalue_new_utcoffset( utcsign * (yyvsp[-1].v_int*3600) + (yyvsp[0].v_int*60) ); - ; - break;} -case 37: -#line 374 "icalyacc.y" -{ - icalparser_yy_value = icalvalue_new_utcoffset(utcsign * (yyvsp[-2].v_int*3600) + (yyvsp[-1].v_int*60) +(yyvsp[0].v_int)); - ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 543 "/usr/lib/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - - *++yyvsp = yyval; - -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; - - goto yynewstate; - -yyerrlab: /* here on detecting error */ - - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ - { - ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); - } - - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ - - if (yyerrstatus == 3) - { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ - - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; - } - - /* Else will try to reuse lookahead token - after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; - -yyerrdefault: /* current state does not do anything special for the error token. */ - -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif - -yyerrpop: /* pop the current state because it cannot handle the error token */ - - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); - } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - yystate = yyn; - goto yynewstate; - - yyacceptlab: - /* YYACCEPT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 0; - - yyabortlab: - /* YYABORT comes here. */ - if (yyfree_stacks) - { - free (yyss); - free (yyvs); -#ifdef YYLSP_NEEDED - free (yyls); -#endif - } - return 1; -} -#line 378 "icalyacc.y" - - -struct icaltimetype fill_datetime(char* datestr, char* timestr) -{ - struct icaltimetype stm; - - memset(&stm,0,sizeof(stm)); - - if (datestr != 0){ - sscanf(datestr,"%4d%2d%2d",&(stm.year), &(stm.month), - &(stm.day)); - } - - if (timestr != 0){ - sscanf(timestr,"%2d%2d%2d", &(stm.hour), &(stm.minute), - &(stm.second)); - } - - return stm; - -} - -void ical_yyerror(char* s) -{ - /*fprintf(stderr,"Parse error \'%s\'\n", s);*/ -} - diff --git a/other-licenses/libical/src/libical/icalyacc.h b/other-licenses/libical/src/libical/icalyacc.h deleted file mode 100644 index f6d66bc5261..00000000000 --- a/other-licenses/libical/src/libical/icalyacc.h +++ /dev/null @@ -1,137 +0,0 @@ -typedef union { - float v_float; - int v_int; - char* v_string; -} YYSTYPE; -#define DIGITS 257 -#define INTNUMBER 258 -#define FLOATNUMBER 259 -#define STRING 260 -#define EOL 261 -#define EQUALS 262 -#define CHARACTER 263 -#define COLON 264 -#define COMMA 265 -#define SEMICOLON 266 -#define MINUS 267 -#define TIMESEPERATOR 268 -#define TRUE 269 -#define FALSE 270 -#define FREQ 271 -#define BYDAY 272 -#define BYHOUR 273 -#define BYMINUTE 274 -#define BYMONTH 275 -#define BYMONTHDAY 276 -#define BYSECOND 277 -#define BYSETPOS 278 -#define BYWEEKNO 279 -#define BYYEARDAY 280 -#define DAILY 281 -#define MINUTELY 282 -#define MONTHLY 283 -#define SECONDLY 284 -#define WEEKLY 285 -#define HOURLY 286 -#define YEARLY 287 -#define INTERVAL 288 -#define COUNT 289 -#define UNTIL 290 -#define WKST 291 -#define MO 292 -#define SA 293 -#define SU 294 -#define TU 295 -#define WE 296 -#define TH 297 -#define FR 298 -#define BIT8 299 -#define ACCEPTED 300 -#define ADD 301 -#define AUDIO 302 -#define BASE64 303 -#define BINARY 304 -#define BOOLEAN 305 -#define BUSY 306 -#define BUSYTENTATIVE 307 -#define BUSYUNAVAILABLE 308 -#define CALADDRESS 309 -#define CANCEL 310 -#define CANCELLED 311 -#define CHAIR 312 -#define CHILD 313 -#define COMPLETED 314 -#define CONFIDENTIAL 315 -#define CONFIRMED 316 -#define COUNTER 317 -#define DATE 318 -#define DATETIME 319 -#define DECLINECOUNTER 320 -#define DECLINED 321 -#define DELEGATED 322 -#define DISPLAY 323 -#define DRAFT 324 -#define DURATION 325 -#define EMAIL 326 -#define END 327 -#define FINAL 328 -#define FLOAT 329 -#define FREE 330 -#define GREGORIAN 331 -#define GROUP 332 -#define INDIVIDUAL 333 -#define INPROCESS 334 -#define INTEGER 335 -#define NEEDSACTION 336 -#define NONPARTICIPANT 337 -#define OPAQUE 338 -#define OPTPARTICIPANT 339 -#define PARENT 340 -#define PERIOD 341 -#define PRIVATE 342 -#define PROCEDURE 343 -#define PUBLIC 344 -#define PUBLISH 345 -#define RECUR 346 -#define REFRESH 347 -#define REPLY 348 -#define REQPARTICIPANT 349 -#define REQUEST 350 -#define RESOURCE 351 -#define ROOM 352 -#define SIBLING 353 -#define START 354 -#define TENTATIVE 355 -#define TEXT 356 -#define THISANDFUTURE 357 -#define THISANDPRIOR 358 -#define TIME 359 -#define TRANSPAENT 360 -#define UNKNOWN 361 -#define UTCOFFSET 362 -#define XNAME 363 -#define ALTREP 364 -#define CN 365 -#define CUTYPE 366 -#define DAYLIGHT 367 -#define DIR 368 -#define ENCODING 369 -#define EVENT 370 -#define FBTYPE 371 -#define FMTTYPE 372 -#define LANGUAGE 373 -#define MEMBER 374 -#define PARTSTAT 375 -#define RANGE 376 -#define RELATED 377 -#define RELTYPE 378 -#define ROLE 379 -#define RSVP 380 -#define SENTBY 381 -#define STANDARD 382 -#define URI 383 -#define TIME_CHAR 384 -#define UTC_CHAR 385 - - -extern YYSTYPE ical_yylval; diff --git a/other-licenses/libical/src/libical/icalyacc.y b/other-licenses/libical/src/libical/icalyacc.y index 221579a6064..6d46f65da84 100644 --- a/other-licenses/libical/src/libical/icalyacc.y +++ b/other-licenses/libical/src/libical/icalyacc.y @@ -6,7 +6,7 @@ DESCRIPTION: - $Id: icalyacc.y,v 1.1 2001-11-15 19:27:13 mikep%oeone.com Exp $ + $Id: icalyacc.y,v 1.2 2001-12-21 18:56:30 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 1999 Eric Busboom @@ -367,12 +367,12 @@ plusminus: '+' { utcsign = 1; } utcoffset_value: plusminus INTNUMBER INTNUMBER { - icalparser_yy_value = icalvalue_new_utcoffset( utcsign * ($2*3600) + ($3*60) ); + icalparser_yy_value = icalvalue_new_utcoffset( utcsign * (($2*3600) + ($3*60)) ); } | plusminus INTNUMBER INTNUMBER INTNUMBER { - icalparser_yy_value = icalvalue_new_utcoffset(utcsign * ($2*3600) + ($3*60) +($4)); + icalparser_yy_value = icalvalue_new_utcoffset(utcsign * (($2*3600) + ($3*60) +($4))); } %% diff --git a/other-licenses/libical/src/libical/libical.dep b/other-licenses/libical/src/libical/libical.dep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/libical/makefile.win b/other-licenses/libical/src/libical/makefile.win index fb4f77c1c9f..3085726cb70 100644 --- a/other-licenses/libical/src/libical/makefile.win +++ b/other-licenses/libical/src/libical/makefile.win @@ -1,120 +1,238 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public -# License Version 1.1 (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/NPL/ -# -# 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. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): - -# - - - -MODULE = libical -EXPORTS = ical.h - -#//------------------------------------------------------------------------ -#// -#// Makefile to build SUN-JAVA/JPEG Library (NEW) -#// -#//------------------------------------------------------------------------ - - -#//------------------------------------------------------------------------ -#// -#// Specify the depth of the current directory relative to the -#// root of NS -#// -#//------------------------------------------------------------------------ -DEPTH= ..\..\..\.. - -#//------------------------------------------------------------------------ -#// -#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...) -#// -#//------------------------------------------------------------------------ -EXPORT_LIBRARY=1 -LIBRARY_NAME=libical$(MOZ_BITS)$(VERSION_NUMBER) -PDBFILE=$(LIBRARY_NAME).pdb -MAPFILE=$(LIBRARY_NAME).map -!if "$(MOZ_BITS)" == "16" -DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def -!endif - -#//------------------------------------------------------------------------ -#// -#// Define any local options for the make tools -#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS) -#// -Zi -GM needed to compile mmx functions in assembly. -LCFLAGS = -Zi -GM -LINCS = -I$(XPDIST)\include - -#//------------------------------------------------------------------------ -#// -#// Define the files necessary to build the target (ie. OBJS) -#// -#//------------------------------------------------------------------------ -LIBICAL_OBJS= .\$(OBJDIR)\icalattendee.obj \ - .\$(OBJDIR)\icalcomponent.obj \ - .\$(OBJDIR)\icalderivedparameter.obj \ - .\$(OBJDIR)\icalderivedproperty.obj \ - .\$(OBJDIR)\icalderivedvalue.obj \ - .\$(OBJDIR)\icalduration.obj \ - .\$(OBJDIR)\icalenums.obj \ - .\$(OBJDIR)\icalerror.obj \ - .\$(OBJDIR)\icallangbind.obj \ - .\$(OBJDIR)\icallexer.obj \ - .\$(OBJDIR)\icalmemory.obj \ - .\$(OBJDIR)\icalmime.obj \ - .\$(OBJDIR)\icalparameter.obj \ - .\$(OBJDIR)\icalparser.obj \ - .\$(OBJDIR)\icalperiod.obj \ - .\$(OBJDIR)\icalproperty.obj \ - .\$(OBJDIR)\icalrecur.obj \ - .\$(OBJDIR)\icalrestriction.obj \ - .\$(OBJDIR)\icaltime.obj \ - .\$(OBJDIR)\icaltypes.obj \ - .\$(OBJDIR)\icalvalue.obj \ - .\$(OBJDIR)\icalyacc.obj \ - .\$(OBJDIR)\pvl.obj \ - .\$(OBJDIR)\sspm.obj \ - .\$(OBJDIR)\vsnprintf.obj \ - $(NULL) - - - -OBJS= \ - $(LIBICAL_OBJS) \ - $(NULL) - - -#//------------------------------------------------------------------------ -#// -#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...) -#// (these must be defined before the common makefiles are included) -#// -#//------------------------------------------------------------------------ -LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib -MAPFILE= $(DLLNAME).map - - - -#//------------------------------------------------------------------------ -#// -#// Include the common makefile rules -#// -#//------------------------------------------------------------------------ -include <$(DEPTH)/config/rules.mak> +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (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/NPL/ +# +# 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. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): + +# + + + +MODULE = libical +EXPORTS = ical.h + +#//------------------------------------------------------------------------ +#// +#// Makefile to build SUN-JAVA/JPEG Library (NEW) +#// +#//------------------------------------------------------------------------ + + +#//------------------------------------------------------------------------ +#// +#// Specify the depth of the current directory relative to the +#// root of NS +#// +#//------------------------------------------------------------------------ +DEPTH= ..\..\..\.. + +#//------------------------------------------------------------------------ +#// +#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...) +#// +#//------------------------------------------------------------------------ +include <$(DEPTH)\config\config.mak> +EXPORT_LIBRARY=1 +LIBRARY_NAME=libical$(MOZ_BITS)$(VERSION_NUMBER) +PDBFILE=$(LIBRARY_NAME).pdb +MAPFILE=$(LIBRARY_NAME).map +!if "$(MOZ_BITS)" == "16" +DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def +!endif +DESIGNDATA = ..\..\design-data +ICALSCRIPTS = ..\..\scripts + +#//------------------------------------------------------------------------ +#// +#// Generate files that are automatically generated (*.h.in and *.c.in) +#// +#//------------------------------------------------------------------------ +# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It +# is required to make the combined header ical.h properly +COMBINEDHEADERS = \ + ..\..\config.h \ + icalversion.h \ + icaltime.h \ + icalduration.h \ + icalperiod.h \ + icalenums.h \ + icaltypes.h \ + icalrecur.h \ + icalderivedvalue.h \ + icalderivedparameter.h \ + icalvalue.h \ + icalparameter.h \ + icalderivedproperty.h \ + icalproperty.h \ + icalattendee.h \ + pvl.h \ + icalarray.h \ + icalcomponent.h \ + icaltimezone.h \ + icalparser.h \ + icalmemory.h \ + icalerror.h \ + icalrestriction.h \ + sspm.h \ + icalmime.h \ + icallangbind.h + +BUILT_COMBINEDHEADERS = \ + icalderivedparameter.h \ + icalderivedproperty.h \ + icalderivedvalue.h + +BUILT_SOURCES = \ + $(BUILT_COMBINEDHEADERS)\ + icalderivedparameter.c \ + icalderivedproperty.c \ + icalrestriction.c \ + icalderivedvalue.c + +ical.h: $(COMBINEDHEADERS) + cat $(COMBINEDHEADERS) \ + | egrep -v "#include.*ical" \ + | egrep -v "#include.*config" \ + | egrep -v "#include.*pvl\.h" > ical.h + +# parameters + +PARAMETERDEPS = \ + $(ICALSCRIPTS)\mkderivedparameters.pl \ + $(DESIGNDATA)\parameters.csv \ + icalderivedparameter.c.in \ + icalderivedparameter.h.in + +icalderivedparameter.h: $(PARAMETERDEPS) + $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedparameters.pl -i icalderivedparameter.h.in -h $(DESIGNDATA)\parameters.csv > icalderivedparameter.h + +icalderivedparameter.c: $(PARAMETERDEPS) $(BUILT_COMBINEDHEADERS) + $(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedparameters.pl -i icalderivedparameter.c.in -c $(DESIGNDATA)\parameters.csv > icalderivedparameter.c + +# properties + +PROPERTYDEPS = \ + $(ICALSCRIPTS)\mkderivedproperties.pl \ + $(DESIGNDATA)\properties.csv \ + $(DESIGNDATA)\value-types.csv \ + icalderivedproperty.c.in \ + icalderivedproperty.h.in + + +icalderivedproperty.h: $(PROPERTYDEPS) + $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedproperties.pl \ + -i icalderivedproperty.h.in -h $(DESIGNDATA)\properties.csv \ + $(DESIGNDATA)\value-types.csv > icalderivedproperty.h + +icalderivedproperty.c: $(PROPERTYDEPS) $(BUILT_COMBINEDHEADERS) + $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedproperties.pl \ + -i icalderivedproperty.c.in -c $(DESIGNDATA)\properties.csv \ + $(DESIGNDATA)\value-types.csv > icalderivedproperty.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-types.csv \ + icalderivedvalue.c.in \ + icalderivedvalue.h.in + +icalderivedvalue.h: $(VALUEDEPS) + $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedvalues.pl \ + -i icalderivedvalue.h.in -h $(DESIGNDATA)\value-types.csv > icalderivedvalue.h + +icalderivedvalue.c: $(VALUEDEPS) $(BUILT_COMBINEDHEADERS) + $(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedvalues.pl \ + -i icalderivedvalue.c.in -c $(DESIGNDATA)\value-types.csv > icalderivedvalue.c + +#//------------------------------------------------------------------------ +#// +#// Define any local options for the make tools +#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS) +#// -Zi -GM needed to compile mmx functions in assembly. +LCFLAGS = -Zi -GM +LINCS = -I$(XPDIST)\include + +#//------------------------------------------------------------------------ +#// +#// Define the files necessary to build the target (ie. OBJS) +#// +#//------------------------------------------------------------------------ +LIBICAL_OBJS= .\$(OBJDIR)\icalarray.obj \ + .\$(OBJDIR)\icalattendee.obj \ + .\$(OBJDIR)\icalcomponent.obj \ + .\$(OBJDIR)\icalderivedparameter.obj \ + .\$(OBJDIR)\icalderivedproperty.obj \ + .\$(OBJDIR)\icalderivedvalue.obj \ + .\$(OBJDIR)\icalduration.obj \ + .\$(OBJDIR)\icalenums.obj \ + .\$(OBJDIR)\icalerror.obj \ + .\$(OBJDIR)\icallangbind.obj \ + .\$(OBJDIR)\icallexer.obj \ + .\$(OBJDIR)\icalmemory.obj \ + .\$(OBJDIR)\icalmime.obj \ + .\$(OBJDIR)\icalparameter.obj \ + .\$(OBJDIR)\icalparser.obj \ + .\$(OBJDIR)\icalperiod.obj \ + .\$(OBJDIR)\icalproperty.obj \ + .\$(OBJDIR)\icalrecur.obj \ + .\$(OBJDIR)\icalrestriction.obj \ + .\$(OBJDIR)\icaltime.obj \ + .\$(OBJDIR)\icaltimezone.obj \ + .\$(OBJDIR)\icaltypes.obj \ + .\$(OBJDIR)\icalvalue.obj \ + .\$(OBJDIR)\icalyacc.obj \ + .\$(OBJDIR)\pvl.obj \ + .\$(OBJDIR)\sspm.obj \ + $(NULL) + + + +OBJS= \ + $(LIBICAL_OBJS) \ + $(NULL) + + +#//------------------------------------------------------------------------ +#// +#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...) +#// (these must be defined before the common makefiles are included) +#// +#//------------------------------------------------------------------------ +LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib +MAPFILE= $(DLLNAME).map + + + +#//------------------------------------------------------------------------ +#// +#// Include the common makefile rules +#// +#//------------------------------------------------------------------------ +include <$(DEPTH)/config/rules.mak> diff --git a/other-licenses/libical/src/libical/sspm.c b/other-licenses/libical/src/libical/sspm.c index b13fdc420d5..ac7ac2d1d5f 100644 --- a/other-licenses/libical/src/libical/sspm.c +++ b/other-licenses/libical/src/libical/sspm.c @@ -3,7 +3,7 @@ FILE: sspm.c Parse Mime CREATOR: eric 25 June 2000 - $Id: sspm.c,v 1.2 2001-11-22 19:21:51 mikep%oeone.com Exp $ + $Id: sspm.c,v 1.3 2001-12-21 18:56:30 mikep%oeone.com Exp $ $Locker: $ The contents of this file are subject to the Mozilla Public License @@ -40,14 +40,15 @@ #include /* for tolower */ #include /* for malloc, free */ #include /* for strcasecmp */ -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif #ifdef DMALLOC #include "dmalloc.h" #endif + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif #define TMP_BUF_SIZE 1024 @@ -282,12 +283,8 @@ int sspm_is_mime_header(char *line) } for(i = 0; mime_headers[i] != 0; i++){ -#ifndef WIN32 if(strcasecmp(name, mime_headers[i]) == 0) -#else - if(stricmp(name, mime_headers[i]) == 0) -#endif - return 1; + return 1; } return 0; diff --git a/other-licenses/libical/src/libical/vsnprintf.c b/other-licenses/libical/src/libical/vsnprintf.c index 6339183dd4b..216ed22bb8a 100644 --- a/other-licenses/libical/src/libical/vsnprintf.c +++ b/other-licenses/libical/src/libical/vsnprintf.c @@ -1,4 +1,7 @@ -#ifdef __osf__ +#ifndef WIN32 +#include "config.h" +#endif +#ifndef HAVE_SNPRINTF /* * Revision 12: http://theos.com/~deraadt/snprintf.c * @@ -24,13 +27,15 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#include + +#ifndef WIN32 +#include +#include +#include +#endif #include -#include #include #include -#include #include #if __STDC__ #include diff --git a/other-licenses/libical/src/libicalss/Makefile.am b/other-licenses/libical/src/libicalss/Makefile.am index ae999b205ad..e69de29bb2d 100644 --- a/other-licenses/libical/src/libicalss/Makefile.am +++ b/other-licenses/libical/src/libicalss/Makefile.am @@ -1,64 +0,0 @@ -lib_LTLIBRARIES = libicalss.la - -YFLAGS =-d -v -p ss -LFLAGS = -Pss -LEX_OUTPUT_ROOT = lex.ss - -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 \ - icalgauge.c \ - icalgaugeimpl.h \ - icaldirset.c \ - icaldirsetimpl.h \ - icalfileset.c \ - icalfilesetimpl.h \ - icalset.c \ - icalsslexer.l \ - icalssyacc.h \ - icalssyacc.y \ - icalspanlist.c \ - icalmessage.c \ - icalcstpclient.c \ - icalcstpclient.h \ - icalcstpserver.c \ - icalcstpserver.h \ - icalcstp.c - -libicalssincludedir = $(includedir) - -COMBINEDHEADERS = \ - icalgauge.h \ - icalset.h \ - icalfileset.h \ - icaldirset.h \ - icalcalendar.h \ - icalclassify.h \ - icalspanlist.h \ - icalmessage.h \ - icalcstp.h \ - icalcstpclient.h \ - icalcstpserver.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/other-licenses/libical/src/libicalss/Makefile.in b/other-licenses/libical/src/libicalss/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/libicalss/icalclassify.c b/other-licenses/libical/src/libicalss/icalclassify.c index 98b1f099680..28781f12246 100644 --- a/other-licenses/libical/src/libicalss/icalclassify.c +++ b/other-licenses/libical/src/libicalss/icalclassify.c @@ -3,7 +3,7 @@ FILE: icalclassify.c CREATOR: ebusboom 23 aug 2000 - $Id: icalclassify.c,v 1.1 2001-11-15 19:27:19 mikep%oeone.com Exp $ + $Id: icalclassify.c,v 1.2 2001-12-21 18:56:34 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -36,15 +36,16 @@ struct icalclassify_parts { - icalcomponent *c; - icalproperty_method method; - char* organizer; - icalparameter_partstat reply_partstat; - char* reply_attendee; - char* uid; - int sequence; - struct icaltimetype dtstamp; - struct icaltimetype recurrence_id; + icalcomponent *c; + icalcomponent_kind inner_kind; + icalproperty_method method; + char* organizer; + icalparameter_partstat reply_partstat; + char* reply_attendee; + char* uid; + int sequence; + struct icaltimetype dtstamp; + struct icaltimetype recurrence_id; }; @@ -121,9 +122,24 @@ icalproperty* icalclassify_find_attendee(icalcomponent *c, const char* attendee) { icalproperty *p; - char* lattendee = icalclassify_lowercase(attendee); - char* upn = strchr(lattendee,':'); - icalcomponent *inner = icalcomponent_get_first_real_component(c); + icalcomponent* inner; + char* lattendee; + char* upn; + + if(attendee == 0){ + return 0; + } + + lattendee = icalclassify_lowercase(attendee); + upn = strchr(lattendee,':'); + + if (upn== 0){ + upn = lattendee; + } else { + upn++; /* skip the ";"*/ + } + + inner = icalcomponent_get_first_real_component(c); for(p = icalcomponent_get_first_property(inner,ICAL_ATTENDEE_PROPERTY); p != 0; @@ -135,13 +151,19 @@ icalproperty* icalclassify_find_attendee(icalcomponent *c, if(this_upn == 0){ continue; - } + } else { + this_upn++; + } - if(strcmp(this_upn,upn)==0){ + if(strcmp(this_upn,upn)==0){ + free(lattendee); + free(this_attendee); return p; } - + + free(this_attendee); } + free(lattendee); return 0; @@ -191,6 +213,8 @@ void icalssutil_get_parts(icalcomponent* c, inner = icalcomponent_get_first_real_component(c); + parts->inner_kind = icalcomponent_isa(inner); + p = icalcomponent_get_first_property(inner,ICAL_ORGANIZER_PROPERTY); if(p!=0){ parts->organizer = strdup(icalproperty_get_organizer(p)); @@ -263,7 +287,7 @@ int icalssutil_is_rescheduled(icalcomponent* a,icalcomponent* b) p1 = icalcomponent_get_first_property(i1,kind_array[i]); p2 = icalcomponent_get_first_property(i2,kind_array[i]); - if( (p1!=0)^(p1!=0) ){ + if( (p1!=0)^(p2!=0) ){ /* Return true if the property exists in one component and not the other */ return 1; @@ -293,7 +317,7 @@ int icalclassify_publish_new(struct icalclassify_parts *comp, icalclassify_pre; if(comp->method == ICAL_METHOD_PUBLISH && - match == 0){ + match == 0 && comp->inner_kind != ICAL_VFREEBUSY_COMPONENT){ rtrn = 1; } @@ -308,7 +332,7 @@ int icalclassify_publish_update(struct icalclassify_parts *comp, icalclassify_pre; if(comp->method == ICAL_METHOD_PUBLISH && - match !=0 ){ + match !=0 && comp->inner_kind != ICAL_VFREEBUSY_COMPONENT){ rtrn = 1; } @@ -323,7 +347,7 @@ int icalclassify_publish_freebusy(struct icalclassify_parts *comp, icalclassify_pre; if(comp->method == ICAL_METHOD_PUBLISH && - match == 0){ + comp->inner_kind == ICAL_VFREEBUSY_COMPONENT){ rtrn = 1; } @@ -392,11 +416,19 @@ int icalclassify_request_delegate( struct icalclassify_parts *match, const char* user) { - icalclassify_pre + icalproperty* attendee; + icalparameter* param; + icalclassify_pre; - if (match->c != 0 && - comp->sequence > match->sequence && - icalssutil_is_rescheduled(comp->c,match->c)){ + attendee = icalclassify_find_attendee(comp->c,user); + + if(attendee == 0){ + return 0; + } + + param = icalproperty_get_first_parameter(attendee,ICAL_DELEGATEDFROM_PARAMETER); + + if (param != 0){ rtrn = 1; } @@ -411,7 +443,7 @@ int icalclassify_request_new_organizer( { /* Organizer has changed between match and component */ icalclassify_pre - + icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR); icalclassify_post } @@ -422,6 +454,7 @@ int icalclassify_request_status( const char* user) { icalclassify_pre + icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR); icalclassify_post } @@ -431,6 +464,7 @@ int icalclassify_request_forward( const char* user) { icalclassify_pre + icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR); icalclassify_post } @@ -440,6 +474,7 @@ int icalclassify_request_freebusy( const char* user) { icalclassify_pre + icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR); icalclassify_post } @@ -477,6 +512,22 @@ int icalclassify_reply_decline( } icalclassify_post } +int icalclassify_reply_delegate( + struct icalclassify_parts *comp, + struct icalclassify_parts *match, + const char* user) +{ + icalproperty* attendee; + icalclassify_pre; + + attendee = icalclassify_find_attendee(match->c,comp->reply_attendee); + + if( attendee != 0 && + comp->reply_partstat == ICAL_PARTSTAT_DELEGATED){ + rtrn = 1; + } + icalclassify_post +} int icalclassify_reply_crasher_accept( struct icalclassify_parts *comp, struct icalclassify_parts *match, @@ -498,7 +549,6 @@ int icalclassify_reply_crasher_decline( struct icalclassify_parts *match, const char* user) { - icalparameter_partstat partstat; icalproperty* attendee; icalclassify_pre; @@ -594,45 +644,47 @@ int icalclassify_delinecounter( struct icalclassify_map { icalproperty_method method; int (*fn)(struct icalclassify_parts *comp,struct icalclassify_parts *match, const char* user); - ical_class class; + icalproperty_xlicclass class; } icalclassify_map[] = -{ {ICAL_METHOD_PUBLISH,icalclassify_publish_new,ICAL_PUBLISH_NEW_CLASS}, - {ICAL_METHOD_PUBLISH,icalclassify_publish_update,ICAL_PUBLISH_UPDATE_CLASS}, - {ICAL_METHOD_PUBLISH,icalclassify_publish_freebusy,ICAL_PUBLISH_FREEBUSY_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_new,ICAL_REQUEST_NEW_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_update,ICAL_REQUEST_UPDATE_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_reschedule,ICAL_REQUEST_RESCHEDULE_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_delegate,ICAL_REQUEST_DELEGATE_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_new_organizer,ICAL_REQUEST_NEW_ORGANIZER_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_forward,ICAL_REQUEST_FORWARD_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_status,ICAL_REQUEST_STATUS_CLASS}, - {ICAL_METHOD_REQUEST,icalclassify_request_freebusy,ICAL_REQUEST_FREEBUSY_CLASS}, +{ {ICAL_METHOD_PUBLISH,icalclassify_publish_new,ICAL_XLICCLASS_PUBLISHNEW}, + {ICAL_METHOD_PUBLISH,icalclassify_publish_update,ICAL_XLICCLASS_PUBLISHUPDATE}, + {ICAL_METHOD_PUBLISH,icalclassify_publish_freebusy,ICAL_XLICCLASS_PUBLISHFREEBUSY}, + {ICAL_METHOD_REQUEST,icalclassify_request_delegate,ICAL_XLICCLASS_REQUESTDELEGATE}, + {ICAL_METHOD_REQUEST,icalclassify_request_new,ICAL_XLICCLASS_REQUESTNEW}, + {ICAL_METHOD_REQUEST,icalclassify_request_update,ICAL_XLICCLASS_REQUESTUPDATE}, + {ICAL_METHOD_REQUEST,icalclassify_request_reschedule,ICAL_XLICCLASS_REQUESTRESCHEDULE}, - {ICAL_METHOD_REPLY,icalclassify_reply_accept,ICAL_REPLY_ACCEPT_CLASS}, - {ICAL_METHOD_REPLY,icalclassify_reply_decline,ICAL_REPLY_DECLINE_CLASS}, - {ICAL_METHOD_REPLY,icalclassify_reply_crasher_accept,ICAL_REPLY_CRASHER_ACCEPT_CLASS}, - {ICAL_METHOD_REPLY,icalclassify_reply_crasher_decline,ICAL_REPLY_CRASHER_DECLINE_CLASS}, + {ICAL_METHOD_REQUEST,icalclassify_request_new_organizer,ICAL_XLICCLASS_REQUESTNEWORGANIZER}, + {ICAL_METHOD_REQUEST,icalclassify_request_forward,ICAL_XLICCLASS_REQUESTFORWARD}, + {ICAL_METHOD_REQUEST,icalclassify_request_status,ICAL_XLICCLASS_REQUESTSTATUS}, + {ICAL_METHOD_REQUEST,icalclassify_request_freebusy,ICAL_XLICCLASS_REQUESTFREEBUSY}, - {ICAL_METHOD_ADD,icalclassify_add_instance,ICAL_ADD_INSTANCE_CLASS}, + {ICAL_METHOD_REPLY,icalclassify_reply_accept,ICAL_XLICCLASS_REPLYACCEPT}, + {ICAL_METHOD_REPLY,icalclassify_reply_decline,ICAL_XLICCLASS_REPLYDECLINE}, + {ICAL_METHOD_REPLY,icalclassify_reply_delegate,ICAL_XLICCLASS_REPLYDELEGATE}, + {ICAL_METHOD_REPLY,icalclassify_reply_crasher_accept,ICAL_XLICCLASS_REPLYCRASHERACCEPT}, + {ICAL_METHOD_REPLY,icalclassify_reply_crasher_decline,ICAL_XLICCLASS_REPLYCRASHERDECLINE}, - {ICAL_METHOD_CANCEL,icalclassify_cancel_event,ICAL_CANCEL_EVENT_CLASS}, - {ICAL_METHOD_CANCEL,icalclassify_cancel_instance,ICAL_CANCEL_INSTANCE_CLASS}, - {ICAL_METHOD_CANCEL,icalclassify_cancel_all,ICAL_CANCEL_ALL_CLASS}, + {ICAL_METHOD_ADD,icalclassify_add_instance,ICAL_XLICCLASS_ADDINSTANCE}, - {ICAL_METHOD_REFRESH,icalclassify_refesh,ICAL_REFRESH_CLASS}, - {ICAL_METHOD_COUNTER,icalclassify_counter,ICAL_COUNTER_CLASS}, - {ICAL_METHOD_DECLINECOUNTER,icalclassify_delinecounter,ICAL_DECLINECOUNTER_CLASS}, - {ICAL_METHOD_NONE,0,ICAL_NO_CLASS} + {ICAL_METHOD_CANCEL,icalclassify_cancel_event,ICAL_XLICCLASS_CANCELEVENT}, + {ICAL_METHOD_CANCEL,icalclassify_cancel_instance,ICAL_XLICCLASS_CANCELINSTANCE}, + {ICAL_METHOD_CANCEL,icalclassify_cancel_all,ICAL_XLICCLASS_CANCELALL}, + + {ICAL_METHOD_REFRESH,icalclassify_refesh,ICAL_XLICCLASS_REFRESH}, + {ICAL_METHOD_COUNTER,icalclassify_counter,ICAL_XLICCLASS_COUNTER}, + {ICAL_METHOD_DECLINECOUNTER,icalclassify_delinecounter,ICAL_XLICCLASS_DECLINECOUNTER}, + {ICAL_METHOD_NONE,0,ICAL_XLICCLASS_NONE} }; -ical_class icalclassify(icalcomponent* c,icalcomponent* match, +icalproperty_xlicclass icalclassify(icalcomponent* c,icalcomponent* match, const char* user) { icalcomponent *inner; icalproperty *p; icalproperty_method method; - ical_class class = ICAL_UNKNOWN_CLASS; + icalproperty_xlicclass class = ICAL_XLICCLASS_UNKNOWN; int i; @@ -642,7 +694,7 @@ ical_class icalclassify(icalcomponent* c,icalcomponent* match, inner = icalcomponent_get_first_real_component(c); if (inner == 0) { - return ICAL_NO_CLASS; + return ICAL_XLICCLASS_NONE; } icalssutil_get_parts(c,&comp_parts); @@ -659,7 +711,7 @@ ical_class icalclassify(icalcomponent* c,icalcomponent* match, icaltime_compare(comp_parts.dtstamp,match_parts.dtstamp)>0) { /* comp has a smaller sequence and a later DTSTAMP */ - return ICAL_MISSEQUENCED_CLASS; + return ICAL_XLICCLASS_MISSEQUENCED; } if( (comp_parts.sequence /* For send(), others */ -#ifndef WIN32 +#ifndef WIN32 #include /* For send(), others. */ #include /* For alarm */ -#endif +#endif #include #include /* for malloc */ #include diff --git a/other-licenses/libical/src/libicalss/icalcstpclient.c b/other-licenses/libical/src/libicalss/icalcstpclient.c index a3c4fa66010..569ea59279d 100644 --- a/other-licenses/libical/src/libicalss/icalcstpclient.c +++ b/other-licenses/libical/src/libicalss/icalcstpclient.c @@ -3,7 +3,7 @@ FILE: icalcstps.c CREATOR: ebusboom 23 Jun 2000 - $Id: icalcstpclient.c,v 1.2 2001-11-22 19:21:53 mikep%oeone.com Exp $ + $Id: icalcstpclient.c,v 1.3 2001-12-21 18:56:35 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -32,9 +32,9 @@ #include "pvl.h" #include /* For send(), others */ -#ifndef WIN32 +#ifndef WIN32 #include /* For send(), others. */ -#include /* For alarm */ +#include /* For alarm */ #endif #include #include /* for malloc */ diff --git a/other-licenses/libical/src/libicalss/icalcstpserver.c b/other-licenses/libical/src/libicalss/icalcstpserver.c index 7504fb68c60..52273d197fd 100644 --- a/other-licenses/libical/src/libicalss/icalcstpserver.c +++ b/other-licenses/libical/src/libicalss/icalcstpserver.c @@ -3,7 +3,7 @@ FILE: icalcstpserver.c CREATOR: ebusboom 13 Feb 01 - $Id: icalcstpserver.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $ + $Id: icalcstpserver.c,v 1.3 2001-12-21 18:56:35 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -32,9 +32,9 @@ #include "pvl.h" #include /* For send(), others */ -#ifndef WIN32 +#ifndef WIN32 #include /* For send(), others. */ -#include /* For alarm */ +#include /* For alarm */ #endif #include #include /* for malloc */ diff --git a/other-licenses/libical/src/libicalss/icaldirset.c b/other-licenses/libical/src/libicalss/icaldirset.c index 5a52f067f94..3d044557243 100644 --- a/other-licenses/libical/src/libicalss/icaldirset.c +++ b/other-licenses/libical/src/libicalss/icaldirset.c @@ -3,7 +3,7 @@ FILE: icaldirset.c CREATOR: eric 28 November 1999 - $Id: icaldirset.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $ + $Id: icaldirset.c,v 1.3 2001-12-21 18:56:36 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -65,13 +65,14 @@ #include "icalfilesetimpl.h" #include "icalgauge.h" -#include /* For PATH_MAX */ +#include /* For PATH_MAX */ #ifndef WIN32 -#include /* for opendir() */ -#include /* for stat, getpid */ -#include /* for uname */ -#else -#include +#include /* for opendir() */ +#include /* for stat, getpid */ +#include /* for uname */ +#else +#include +#include #endif #include #include /* for opendir() */ @@ -81,16 +82,16 @@ #include /* for strdup */ #include "icaldirsetimpl.h" -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp - -#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) - -#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR) -#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG) -#endif - + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp + +#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) + +#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR) +#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG) +#endif struct icaldirset_impl* icaldirset_new_impl() { @@ -143,8 +144,8 @@ void icaldirset_unlock(const char* dir) /* Load the contents of the store directory into the store's internal directory list*/ icalerrorenum icaldirset_read_directory(struct icaldirset_impl* impl) { - char *str; -#ifndef WIN32 + char *str; +#ifndef WIN32 struct dirent *de; DIR* dp; @@ -175,39 +176,39 @@ icalerrorenum icaldirset_read_directory(struct icaldirset_impl* impl) } closedir(dp); -#else - struct _finddata_t c_file; - long hFile; - - /* Find first .c file in current directory */ - if( (hFile = _findfirst( "*", &c_file )) == -1L ) - { - icalerror_set_errno(ICAL_FILE_ERROR); - return ICAL_FILE_ERROR; - } - else - { - while((str = pvl_pop(impl->directory))){ - free(str); - } - - /* load all of the cluster names in the directory list */ - do - { - /* Remove known directory names '.' and '..'*/ - if (strcmp(c_file.name,".") == 0 || - strcmp(c_file.name,"..") == 0 ){ - continue; - } - - pvl_push(impl->directory, (void*)strdup(c_file.name)); - } - while ( _findnext( hFile, &c_file ) == 0 ); - - _findclose( hFile ); - } - -#endif +#else + struct _finddata_t c_file; + long hFile; + + /* Find first .c file in current directory */ + if( (hFile = _findfirst( "*", &c_file )) == -1L ) + { + icalerror_set_errno(ICAL_FILE_ERROR); + return ICAL_FILE_ERROR; + } + else + { + while((str = pvl_pop(impl->directory))){ + free(str); + } + + /* load all of the cluster names in the directory list */ + do + { + /* Remove known directory names '.' and '..'*/ + if (strcmp(c_file.name,".") == 0 || + strcmp(c_file.name,"..") == 0 ){ + continue; + } + + pvl_push(impl->directory, (void*)strdup(c_file.name)); + } + while ( _findnext( hFile, &c_file ) == 0 ); + + _findclose( hFile ); + } + +#endif return ICAL_NO_ERROR; } @@ -382,23 +383,25 @@ void icaldirset_add_uid(icaldirset* store, icaldirset* comp) { char uidstring[ICAL_PATH_MAX]; icalproperty *uid; -#ifndef WIN32 +#ifndef WIN32 struct utsname unamebuf; -#endif +#endif + icalerror_check_arg_rv( (store!=0), "store"); icalerror_check_arg_rv( (comp!=0), "comp"); uid = icalcomponent_get_first_property(comp,ICAL_UID_PROPERTY); if (uid == 0) { -#ifndef WIN32 + +#ifndef WIN32 uname(&unamebuf); sprintf(uidstring,"%d-%s",(int)getpid(),unamebuf.nodename); +#else + sprintf(uidstring,"%d-%s",(int)getpid(),"WINDOWS"); /* FIX: There must be an easy get the system name */ +#endif -#else - sprintf(uidstring,"%d-%s",(int)getpid(),"WINDOWS"); /* FIX: There must be an easy get the system name */ -#endif uid = icalproperty_new_uid(uidstring); icalcomponent_add_property(comp,uid); } else { diff --git a/other-licenses/libical/src/libicalss/icalfileset.c b/other-licenses/libical/src/libicalss/icalfileset.c index 16df4254553..6dd716f7bc1 100644 --- a/other-licenses/libical/src/libicalss/icalfileset.c +++ b/other-licenses/libical/src/libicalss/icalfileset.c @@ -3,7 +3,7 @@ FILE: icalfileset.c CREATOR: eric 23 December 1999 - $Id: icalfileset.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $ + $Id: icalfileset.c,v 1.3 2001-12-21 18:56:36 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -34,26 +34,26 @@ #include "icalgauge.h" #include #include /* for stat */ -#ifndef WIN32 -#include /* for stat, getpid */ -#else -#include -#include -#endif +#ifndef WIN32 +#include /* for stat, getpid */ +#else +#include +#include +#endif #include #include #include /* for fcntl */ #include "icalfilesetimpl.h" - -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp - -#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) - -#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR) -#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG) -#endif + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp + +#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) + +#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR) +#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG) +#endif extern int errno; @@ -113,20 +113,21 @@ icalfileset* icalfileset_new_open(const char* path, int flags, mode_t mode) } #ifndef WIN32 - impl->fd = open(impl->path,flags, mode); -#else - impl->fd = sopen(impl->path,flags, _SH_DENYWR, _S_IREAD | _S_IWRITE); -#endif + impl->fd = open(impl->path,flags, mode); +#else + impl->fd = sopen(impl->path,flags, _SH_DENYWR, _S_IREAD | _S_IWRITE); +#endif + if (impl->fd < 0){ icalerror_set_errno(ICAL_FILE_ERROR); icalfileset_free(impl); return 0; } -#ifndef WIN32 // We need this under win32, we'd open'd and lock'd in one operation - icalfileset_lock(impl); - +#ifndef WIN32 + icalfileset_lock(impl); #endif + if(cluster_file_size > 0 ){ icalerrorenum error; if((error = icalfileset_read_file(impl,mode))!= ICAL_NO_ERROR){ @@ -269,7 +270,7 @@ const char* icalfileset_path(icalfileset* cluster) int icalfileset_lock(icalfileset *cluster) -{ +{ #ifndef WIN32 struct icalfileset_impl *impl = (struct icalfileset_impl*)cluster; struct flock lock; @@ -284,14 +285,14 @@ int icalfileset_lock(icalfileset *cluster) rtrn = fcntl(impl->fd, F_SETLKW, &lock); - return rtrn; -#else - return 0; + return rtrn; +#else + return 0; #endif } int icalfileset_unlock(icalfileset *cluster) -{ +{ #ifndef WIN32 struct icalfileset_impl *impl = (struct icalfileset_impl*)cluster; struct flock lock; @@ -303,9 +304,8 @@ int icalfileset_unlock(icalfileset *cluster) lock.l_len = 0; /* #bytes (0 means to EOF) */ return (fcntl(impl->fd, F_UNLCK, &lock)); - -#else - return 0; +#else + return 0; #endif } @@ -366,11 +366,11 @@ icalerrorenum icalfileset_commit(icalfileset* cluster) } impl->changed = 0; - + #ifndef WIN32 if(ftruncate(impl->fd,write_size) < 0){ return ICAL_FILE_ERROR; - } + } #endif return ICAL_NO_ERROR; diff --git a/other-licenses/libical/src/libicalss/icalfileset.h b/other-licenses/libical/src/libicalss/icalfileset.h index eca83a82b84..9eb249f702e 100644 --- a/other-licenses/libical/src/libicalss/icalfileset.h +++ b/other-licenses/libical/src/libicalss/icalfileset.h @@ -4,7 +4,7 @@ CREATOR: eric 23 December 1999 - $Id: icalfileset.h,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $ + $Id: icalfileset.h,v 1.3 2001-12-21 18:56:36 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -32,11 +32,11 @@ #include "ical.h" #include "icalset.h" #include "icalgauge.h" -#ifndef WIN32 #include /* For open() flags and mode */ #include /* For open() flags and mode */ #include /* For open() flags and mode */ -#else + +#ifdef WIN32 #define mode_t int #endif diff --git a/other-licenses/libical/src/libicalss/icalgauge.c b/other-licenses/libical/src/libicalss/icalgauge.c index a6b50817be8..b7c22ab5f90 100644 --- a/other-licenses/libical/src/libicalss/icalgauge.c +++ b/other-licenses/libical/src/libicalss/icalgauge.c @@ -4,7 +4,7 @@ CREATOR: eric 23 December 1999 - $Id: icalgauge.c,v 1.1 2001-11-15 19:27:25 mikep%oeone.com Exp $ + $Id: icalgauge.c,v 1.2 2001-12-21 18:56:37 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -94,47 +94,12 @@ void icalgauge_free(icalgauge* gauge) if(impl->from){ pvl_free(impl->from); - } + } + + free(impl); } -/* Convert a VQUERY component into a gauge */ -icalcomponent* icalgauge_make_gauge(icalcomponent* query); - -/* icaldirset_test compares a component against a gauge, and returns - true if the component passes the test - - The gauge is a VCALENDAR component that specifies how to test the - target components. The guage holds a collection of VEVENT, VTODO or - VJOURNAL sub-components. Each of the sub-components has a - collection of properties that are compared to corresponding - properties in the target component, according to the - X-LIC-COMPARETYPE parameters to the gauge's properties. - - When a gauge has several sub-components, the results of testing the - target against each of them is ORed together - the target - component will pass if it matches any of the sub-components in the - gauge. However, the results of matching the properties in a - sub-component are ANDed -- the target must match every property in - a gauge sub-component to match the sub-component. - - Here is an example: - - BEGIN:XROOT - DTSTART;X-LIC-COMPARETYPE=LESS:19981025T020000 - ORGANIZER;X-LIC-COMPARETYPE=EQUAL:mrbig@host.com - END:XROOT - BEGIN:XROOT - LOCATION;X-LIC-COMPARETYPE=EQUAL:McNary's Pub - END:XROOT - - This gauge has two sub-components; one which will match a VEVENT - based on start time, and organizer, and another that matches based - on LOCATION. A target component will pass the test if it matched - either of the sub-components. - - */ - int icalgauge_compare_recurse(icalcomponent* comp, icalcomponent* gauge) { @@ -264,8 +229,7 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp) inner = icalcomponent_get_first_real_component(comp); if(inner == 0){ - icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); - return 0; + inner = comp; } @@ -301,7 +265,7 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp) vk = icalenum_property_kind_to_value_kind(w->prop); if(vk == ICAL_NO_VALUE){ - icalerror_set_errno(ICAL_INTERNAL_ERROR); + icalerror_set_errno(ICAL_INTERNAL_ERROR); return 0; } @@ -354,7 +318,7 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp) local_pass = 0; } } - + this_clause = local_pass > 0 ? 1 : 0; /* Now look at the logic operator for this clause to see how @@ -362,12 +326,15 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp) if(w->logic == ICALGAUGELOGIC_AND){ last_clause = this_clause && last_clause; - } else if(w->logic == ICALGAUGELOGIC_AND) { + } else if(w->logic == ICALGAUGELOGIC_OR) { last_clause = this_clause || last_clause; } else { last_clause = this_clause; } + + icalvalue_free(v); } + return last_clause; diff --git a/other-licenses/libical/src/libicalss/icalgauge.h b/other-licenses/libical/src/libicalss/icalgauge.h index 088ee92f898..673c4d82ba0 100644 --- a/other-licenses/libical/src/libicalss/icalgauge.h +++ b/other-licenses/libical/src/libicalss/icalgauge.h @@ -4,7 +4,7 @@ CREATOR: eric 23 December 1999 - $Id: icalgauge.h,v 1.1 2001-11-15 19:27:25 mikep%oeone.com Exp $ + $Id: icalgauge.h,v 1.2 2001-12-21 18:56:37 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -39,7 +39,7 @@ char* icalgauge_as_sql(icalcomponent* gauge); void icalgauge_dump(icalcomponent* gauge); -/* Return true is comp matches the gauge. The component must be in +/* Return true if comp matches the gauge. The component must be in cannonical form -- a VCALENDAR with one VEVENT, VTODO or VJOURNAL sub component */ int icalgauge_compare(icalgauge* g, icalcomponent* comp); diff --git a/other-licenses/libical/src/libicalss/icalmessage.c b/other-licenses/libical/src/libicalss/icalmessage.c index 0c082ca0a41..e3eb0be6259 100644 --- a/other-licenses/libical/src/libicalss/icalmessage.c +++ b/other-licenses/libical/src/libicalss/icalmessage.c @@ -3,7 +3,7 @@ FILE: icalmessage.c CREATOR: ebusboom 07 Nov 2000 - $Id: icalmessage.c,v 1.1 2001-11-15 19:27:25 mikep%oeone.com Exp $ + $Id: icalmessage.c,v 1.2 2001-12-21 18:56:38 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -353,10 +353,7 @@ icalcomponent* icalmessage_new_error_reply(icalcomponent* c, rs.debug = debug; icalcomponent_add_property(inner, - icalproperty_new_requeststatus( - icalreqstattype_as_string(rs) - ) - ); + icalproperty_new_requeststatus(rs)); } else { /* code == ICAL_UNKNOWN_STATUS */ /* Copy all of the request status properties */ diff --git a/other-licenses/libical/src/libicalss/icalset.c b/other-licenses/libical/src/libicalss/icalset.c index 1a79d253ea6..28fc959f674 100644 --- a/other-licenses/libical/src/libicalss/icalset.c +++ b/other-licenses/libical/src/libicalss/icalset.c @@ -12,7 +12,7 @@ icalheapset Store components on the heap icalmysqlset Store components in a mysql database. - $Id: icalset.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $ + $Id: icalset.c,v 1.3 2001-12-21 18:56:38 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -43,7 +43,6 @@ #include /*#include "icalheapset.h"*/ /*#include "icalmysqlset.h"*/ -#include #define ICALSET_ID "set " @@ -266,7 +265,7 @@ void icalset_free(icalset* set) struct icalset_impl impl = icalset_get_impl(set); (*(impl.fp->free))(impl.derived_impl); - if(strcmp((char*)set,ICALSET_ID)) { + if(!strcmp((char*)set,ICALSET_ID)) { free(set); } } diff --git a/other-licenses/libical/src/libicalss/icalspanlist.c b/other-licenses/libical/src/libicalss/icalspanlist.c index 9ef829fbe6e..b66b242e2fb 100644 --- a/other-licenses/libical/src/libicalss/icalspanlist.c +++ b/other-licenses/libical/src/libicalss/icalspanlist.c @@ -3,7 +3,7 @@ FILE: icalspanlist.c CREATOR: ebusboom 23 aug 2000 - $Id: icalspanlist.c,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalspanlist.c,v 1.3 2001-12-21 18:56:38 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -30,7 +30,6 @@ #include "icalspanlist.h" #include "pvl.h" #include /* for free and malloc */ -#include struct icalspanlist_impl { pvl_list spans; @@ -212,7 +211,9 @@ void icalspanlist_free(icalspanlist* s) pvl_free(impl->spans); - impl->spans = 0; + impl->spans = 0; + + free(impl); } diff --git a/other-licenses/libical/src/libicalss/icalss.h b/other-licenses/libical/src/libicalss/icalss.h index 11cccd6b507..82f87f0e346 100644 --- a/other-licenses/libical/src/libicalss/icalss.h +++ b/other-licenses/libical/src/libicalss/icalss.h @@ -4,7 +4,7 @@ CREATOR: eric 23 December 1999 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -28,6 +28,7 @@ #ifndef ICALGAUGE_H #define ICALGAUGE_H + #ifdef WIN32 #define mode_t int #endif @@ -42,7 +43,7 @@ char* icalgauge_as_sql(icalcomponent* gauge); void icalgauge_dump(icalcomponent* gauge); -/* Return true is comp matches the gauge. The component must be in +/* Return true if comp matches the gauge. The component must be in cannonical form -- a VCALENDAR with one VEVENT, VTODO or VJOURNAL sub component */ int icalgauge_compare(icalgauge* g, icalcomponent* comp); @@ -66,7 +67,7 @@ icalcomponent* icalgauge_new_clone(icalgauge* g, icalcomponent* comp); icalheapset Store components on the heap icalmysqlset Store components in a mysql database. - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -167,7 +168,7 @@ icalcomponent* icalset_get_next_component(icalset* set); CREATOR: eric 23 December 1999 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -269,7 +270,7 @@ icalcomponent* icalfileset_get_component(icalfileset* cluster); CREATOR: eric 28 November 1999 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -350,7 +351,7 @@ icalcomponent* icaldirset_get_next_component(icaldirset* store); CREATOR: eric 23 December 1999 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -415,7 +416,7 @@ icalset* icalcalendar_get_freebusy(icalcalendar* calendar); CREATOR: eric 21 Aug 2000 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -438,42 +439,14 @@ icalset* icalcalendar_get_freebusy(icalcalendar* calendar); #define ICALCLASSIFY_H - -typedef enum icalclass { - ICAL_NO_CLASS, - ICAL_PUBLISH_NEW_CLASS, - ICAL_PUBLISH_UPDATE_CLASS, - ICAL_PUBLISH_FREEBUSY_CLASS, - ICAL_REQUEST_NEW_CLASS, - ICAL_REQUEST_UPDATE_CLASS, - ICAL_REQUEST_RESCHEDULE_CLASS, - ICAL_REQUEST_DELEGATE_CLASS, - ICAL_REQUEST_NEW_ORGANIZER_CLASS, - ICAL_REQUEST_FORWARD_CLASS, - ICAL_REQUEST_STATUS_CLASS, - ICAL_REQUEST_FREEBUSY_CLASS, - ICAL_REPLY_ACCEPT_CLASS, - ICAL_REPLY_DECLINE_CLASS, - ICAL_REPLY_CRASHER_ACCEPT_CLASS, - ICAL_REPLY_CRASHER_DECLINE_CLASS, - ICAL_ADD_INSTANCE_CLASS, - ICAL_CANCEL_EVENT_CLASS, - ICAL_CANCEL_INSTANCE_CLASS, - ICAL_CANCEL_ALL_CLASS, - ICAL_REFRESH_CLASS, - ICAL_COUNTER_CLASS, - ICAL_DECLINECOUNTER_CLASS, - ICAL_MALFORMED_CLASS, - ICAL_OBSOLETE_CLASS, /* 21 */ - ICAL_MISSEQUENCED_CLASS, /* 22 */ - ICAL_UNKNOWN_CLASS /* 23 */ -} ical_class; - -ical_class icalclassify(icalcomponent* c,icalcomponent* match, +icalproperty_xlicclass icalclassify(icalcomponent* c,icalcomponent* match, const char* user); icalcomponent* icalclassify_find_overlaps(icalset* set, icalcomponent* comp); +char* icalclassify_class_to_string(icalproperty_xlicclass c); + + #endif /* ICALCLASSIFY_H*/ @@ -486,7 +459,7 @@ icalcomponent* icalclassify_find_overlaps(icalset* set, icalcomponent* comp); CREATOR: eric 21 Aug 2000 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -538,7 +511,7 @@ void icalspanlist_dump(icalspanlist* s); CREATOR: eric 07 Nov 2000 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -607,7 +580,7 @@ icalcomponent* icalmessage_new_error_reply(icalcomponent* c, FILE: icalcstp.h CREATOR: eric 20 April 1999 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -685,7 +658,7 @@ icalcstp_command icalcstp_string_to_command(const char* str); FILE: icalcstpclient.h CREATOR: eric 4 Feb 01 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -783,7 +756,7 @@ icalerrorenum icalcstpc_sendata(icalcstpc* cstp, unsigned int time, FILE: icalcstpserver.h CREATOR: eric 13 Feb 01 - $Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $ + $Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org diff --git a/other-licenses/libical/src/libicalss/icalsslexer.c b/other-licenses/libical/src/libicalss/icalsslexer.c index 9b3197f0467..a35ec4c12c3 100644 --- a/other-licenses/libical/src/libicalss/icalsslexer.c +++ b/other-licenses/libical/src/libicalss/icalsslexer.c @@ -19,7 +19,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /home/jrmuizel/cvs-mirror/mozilla/other-licenses/libical/src/libicalss/Attic/icalsslexer.c,v 1.2 2001-11-22 19:21:56 mikep%oeone.com Exp $ + * $Header: /home/jrmuizel/cvs-mirror/mozilla/other-licenses/libical/src/libicalss/Attic/icalsslexer.c,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ */ #define FLEX_SCANNER @@ -27,10 +27,11 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#ifndef WIN32 -#include +#ifndef WIN32 +#include #endif + /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus @@ -304,15 +305,15 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 19 -#define YY_END_OF_BUFFER 20 -static yyconst short int yy_accept[47] = +#define YY_NUM_RULES 20 +#define YY_END_OF_BUFFER 21 +static yyconst short int yy_accept[48] = { 0, - 0, 0, 0, 0, 0, 0, 20, 18, 14, 14, - 18, 13, 17, 4, 15, 7, 5, 8, 17, 17, - 17, 17, 17, 14, 6, 0, 17, 9, 10, 17, - 17, 12, 17, 17, 16, 11, 17, 17, 17, 2, - 17, 17, 17, 3, 1, 0 + 0, 0, 0, 0, 0, 0, 21, 19, 15, 15, + 19, 14, 18, 4, 16, 8, 5, 9, 18, 18, + 18, 18, 18, 15, 7, 0, 18, 10, 6, 11, + 18, 18, 13, 18, 18, 17, 12, 18, 18, 18, + 2, 18, 18, 18, 3, 1, 0 } ; static yyconst int yy_ec[256] = @@ -320,17 +321,17 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 1, 1, 1, 1, 1, 5, 1, - 1, 6, 1, 7, 6, 6, 1, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 1, 8, 9, - 10, 11, 1, 1, 12, 6, 13, 14, 15, 16, - 6, 17, 6, 6, 6, 18, 19, 20, 21, 6, - 6, 22, 23, 24, 6, 6, 25, 6, 6, 6, - 1, 1, 1, 1, 1, 1, 12, 6, 13, 14, + 1, 4, 5, 1, 1, 1, 1, 1, 6, 1, + 1, 7, 1, 8, 7, 7, 1, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 1, 9, 10, + 11, 12, 1, 1, 13, 7, 14, 15, 16, 17, + 7, 18, 7, 7, 7, 19, 20, 21, 22, 7, + 7, 23, 24, 25, 7, 7, 26, 7, 7, 7, + 1, 1, 1, 1, 1, 1, 13, 7, 14, 15, - 15, 16, 6, 17, 6, 6, 6, 18, 19, 20, - 21, 6, 6, 22, 23, 24, 6, 6, 25, 6, - 6, 6, 1, 1, 1, 1, 1, 1, 1, 1, + 16, 17, 7, 18, 7, 7, 7, 19, 20, 21, + 22, 7, 7, 23, 24, 25, 7, 7, 26, 7, + 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -347,53 +348,55 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[26] = +static yyconst int yy_meta[27] = { 0, - 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2 + 1, 1, 1, 2, 1, 1, 3, 1, 1, 1, + 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3 } ; -static yyconst short int yy_base[49] = +static yyconst short int yy_base[50] = { 0, - 0, 0, 0, 0, 0, 0, 53, 54, 24, 26, - 42, 0, 0, 54, 54, 41, 54, 40, 29, 26, - 25, 31, 28, 28, 54, 39, 0, 54, 54, 29, - 21, 0, 23, 25, 54, 0, 20, 23, 15, 0, - 23, 20, 10, 0, 0, 54, 31, 30 + 0, 0, 0, 0, 0, 0, 59, 60, 25, 28, + 47, 0, 0, 60, 60, 46, 45, 44, 33, 30, + 29, 35, 32, 31, 60, 43, 0, 60, 60, 60, + 33, 25, 0, 27, 29, 60, 0, 24, 27, 19, + 0, 27, 24, 14, 0, 0, 60, 34, 35 } ; -static yyconst short int yy_def[49] = +static yyconst short int yy_def[50] = { 0, - 46, 1, 1, 1, 1, 1, 46, 46, 46, 46, - 46, 47, 48, 46, 46, 46, 46, 46, 48, 48, - 48, 48, 48, 46, 46, 47, 48, 46, 46, 48, - 48, 48, 48, 48, 46, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 0, 46, 46 + 47, 1, 1, 1, 1, 1, 47, 47, 47, 47, + 47, 48, 49, 47, 47, 47, 47, 47, 49, 49, + 49, 49, 49, 47, 47, 48, 49, 47, 47, 47, + 49, 49, 49, 49, 49, 47, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 0, 47, 47 } ; -static yyconst short int yy_nxt[80] = +static yyconst short int yy_nxt[87] = { 0, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 13, 13, 13, 20, 13, 13, 13, 13, - 21, 13, 22, 13, 23, 24, 24, 24, 24, 24, - 24, 27, 26, 45, 44, 43, 42, 41, 40, 39, - 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, - 28, 25, 46, 7, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46 + 8, 9, 10, 9, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 13, 13, 13, 20, 13, 13, 13, + 13, 21, 13, 22, 13, 23, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 26, 26, 27, 46, 45, + 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, + 34, 33, 32, 31, 30, 29, 28, 25, 47, 7, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47 } ; -static yyconst short int yy_chk[80] = +static yyconst short int yy_chk[87] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 9, 9, 10, 10, 24, - 24, 48, 47, 43, 42, 41, 39, 38, 37, 34, - 33, 31, 30, 26, 23, 22, 21, 20, 19, 18, - 16, 11, 7, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46 + 1, 1, 1, 1, 1, 1, 9, 9, 9, 10, + 10, 10, 24, 24, 24, 48, 48, 49, 44, 43, + 42, 40, 39, 38, 35, 34, 32, 31, 26, 23, + 22, 21, 20, 19, 18, 17, 16, 11, 7, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47 } ; static yy_state_type yy_last_accepting_state; @@ -422,7 +425,7 @@ char *yytext_ptr; DESCRIPTION: - $Id: icalsslexer.c,v 1.2 2001-11-22 19:21:56 mikep%oeone.com Exp $ + $Id: icalsslexer.c,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -462,7 +465,7 @@ void icalparser_clear_flex_input(); #define sql 1 #define string_value 2 -#line 465 "lex.ss.c" +#line 467 "lex.ss.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -620,7 +623,7 @@ YY_DECL -#line 623 "lex.ss.c" +#line 625 "lex.ss.c" if ( yy_init ) { @@ -671,13 +674,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 47 ) + if ( yy_current_state >= 48 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 54 ); + while ( yy_base[yy_current_state] != 60 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -731,56 +734,61 @@ YY_RULE_SETUP case 6: YY_RULE_SETUP #line 80 "icalsslexer.l" -{ return NOTEQUALS; } +{ return EQUALS; } YY_BREAK case 7: YY_RULE_SETUP #line 81 "icalsslexer.l" -{ return LESS; } +{ return NOTEQUALS; } YY_BREAK case 8: YY_RULE_SETUP #line 82 "icalsslexer.l" -{ return GREATER; } +{ return LESS; } YY_BREAK case 9: YY_RULE_SETUP #line 83 "icalsslexer.l" -{ return LESSEQUALS; } +{ return GREATER; } YY_BREAK case 10: YY_RULE_SETUP #line 84 "icalsslexer.l" -{ return GREATEREQUALS; } +{ return LESSEQUALS; } YY_BREAK case 11: YY_RULE_SETUP #line 85 "icalsslexer.l" -{ return AND; } +{ return GREATEREQUALS; } YY_BREAK case 12: YY_RULE_SETUP #line 86 "icalsslexer.l" -{ return OR; } +{ return AND; } YY_BREAK case 13: YY_RULE_SETUP #line 87 "icalsslexer.l" -{ return QUOTE; } +{ return OR; } YY_BREAK case 14: YY_RULE_SETUP #line 88 "icalsslexer.l" -; +{ return QUOTE; } YY_BREAK case 15: YY_RULE_SETUP #line 89 "icalsslexer.l" -{ return EOL; } +; YY_BREAK case 16: YY_RULE_SETUP #line 90 "icalsslexer.l" +{ return EOL; } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 92 "icalsslexer.l" { int c = input(); unput(c); @@ -792,23 +800,26 @@ YY_RULE_SETUP } } YY_BREAK -case 17: -YY_RULE_SETUP -#line 101 "icalsslexer.l" -{ sslval.v_string= icalmemory_tmp_copy(sstext); - return STRING; } - YY_BREAK case 18: YY_RULE_SETUP -#line 105 "icalsslexer.l" -{ return yytext[0]; } +#line 103 "icalsslexer.l" +{ + + sslval.v_string= icalmemory_tmp_copy(sstext); + return STRING; +} YY_BREAK case 19: YY_RULE_SETUP -#line 107 "icalsslexer.l" +#line 110 "icalsslexer.l" +{ return yytext[0]; } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 112 "icalsslexer.l" ECHO; YY_BREAK -#line 811 "lex.ss.c" +#line 821 "lex.ss.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(sql): case YY_STATE_EOF(string_value): @@ -1102,7 +1113,7 @@ static yy_state_type yy_get_previous_state() while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 47 ) + if ( yy_current_state >= 48 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1137,11 +1148,11 @@ yy_state_type yy_current_state; while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 47 ) + if ( yy_current_state >= 48 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 46); + yy_is_jam = (yy_current_state == 47); return yy_is_jam ? 0 : yy_current_state; } @@ -1691,7 +1702,7 @@ int main() return 0; } #endif -#line 107 "icalsslexer.l" +#line 112 "icalsslexer.l" int sswrap() diff --git a/other-licenses/libical/src/libicalss/icalsslexer.l b/other-licenses/libical/src/libicalss/icalsslexer.l index 1e572855990..80163d30a05 100644 --- a/other-licenses/libical/src/libicalss/icalsslexer.l +++ b/other-licenses/libical/src/libicalss/icalsslexer.l @@ -6,7 +6,7 @@ DESCRIPTION: - $Id: icalsslexer.l,v 1.1 2001-11-15 19:27:31 mikep%oeone.com Exp $ + $Id: icalsslexer.l,v 1.2 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -77,6 +77,7 @@ FROM { return FROM; } WHERE { return WHERE; } , { return COMMA; } "=" { return EQUALS; } +"==" { return EQUALS; } "!=" { return NOTEQUALS; } "<" { return LESS; } ">" { return GREATER; } @@ -87,7 +88,8 @@ OR { return OR; } \' { return QUOTE; } [ \t\n\r]+ ; ; { return EOL; } -\'[\*A-Za-z0-9\-\.]+\' { + +\'[\*A-Za-z0-9\-\. ]+\' { int c = input(); unput(c); if(c!='\''){ @@ -98,8 +100,11 @@ OR { return OR; } } } -[\*A-Za-z0-9\-\.]+ { sslval.v_string= icalmemory_tmp_copy(sstext); - return STRING; } +[\*A-Za-z0-9\-\.]+ { + + sslval.v_string= icalmemory_tmp_copy(sstext); + return STRING; +} . { return yytext[0]; } diff --git a/other-licenses/libical/src/libicalss/icalssyacc.c b/other-licenses/libical/src/libicalss/icalssyacc.c index e10d70f616d..b14475a82e2 100644 --- a/other-licenses/libical/src/libicalss/icalssyacc.c +++ b/other-licenses/libical/src/libicalss/icalssyacc.c @@ -37,7 +37,7 @@ DESCRIPTION: - $Id: icalssyacc.c,v 1.1 2001-11-15 19:27:32 mikep%oeone.com Exp $ + $Id: icalssyacc.c,v 1.2 2001-12-21 18:56:39 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -76,7 +76,7 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1); void set_logic(struct icalgauge_impl* impl,icalgaugelogic l); void sserror(char *s); /* Don't know why I need this.... */ - +extern char* sstext; #line 52 "icalssyacc.y" @@ -1181,5 +1181,5 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1) void sserror(char *s){ - fprintf(stderr,"Parse error \'%s\'\n", s); + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); } diff --git a/other-licenses/libical/src/libicalss/icalssyacc.y b/other-licenses/libical/src/libicalss/icalssyacc.y index 03b2977e4a6..4a11aef0cee 100644 --- a/other-licenses/libical/src/libicalss/icalssyacc.y +++ b/other-licenses/libical/src/libicalss/icalssyacc.y @@ -6,7 +6,7 @@ DESCRIPTION: - $Id: icalssyacc.y,v 1.1 2001-11-15 19:27:32 mikep%oeone.com Exp $ + $Id: icalssyacc.y,v 1.2 2001-12-21 18:56:40 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -45,7 +45,7 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1); void set_logic(struct icalgauge_impl* impl,icalgaugelogic l); void sserror(char *s); /* Don't know why I need this.... */ - +extern char* sstext; %} @@ -241,5 +241,5 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1) void sserror(char *s){ - fprintf(stderr,"Parse error \'%s\'\n", s); + icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); } diff --git a/other-licenses/libical/src/libicalss/libicalss.dep b/other-licenses/libical/src/libicalss/libicalss.dep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/libicalss/makefile.win b/other-licenses/libical/src/libicalss/makefile.win index 7467981e6b6..7c927832206 100644 --- a/other-licenses/libical/src/libicalss/makefile.win +++ b/other-licenses/libical/src/libicalss/makefile.win @@ -1,107 +1,107 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public -# License Version 1.1 (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/NPL/ -# -# 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. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): - -# - - - -MODULE = libicalss -EXPORTS = icalss.h - -#//------------------------------------------------------------------------ -#// -#// Makefile to build SUN-JAVA/JPEG Library (NEW) -#// -#//------------------------------------------------------------------------ - - -#//------------------------------------------------------------------------ -#// -#// Specify the depth of the current directory relative to the -#// root of NS -#// -#//------------------------------------------------------------------------ -DEPTH= ..\..\..\.. - -#//------------------------------------------------------------------------ -#// -#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...) -#// -#//------------------------------------------------------------------------ -EXPORT_LIBRARY=1 -LIBRARY_NAME=libicalss$(MOZ_BITS)$(VERSION_NUMBER) -PDBFILE=$(LIBRARY_NAME).pdb -MAPFILE=$(LIBRARY_NAME).map -!if "$(MOZ_BITS)" == "16" -DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def -!endif - -#//------------------------------------------------------------------------ -#// -#// Define any local options for the make tools -#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS) -#// -Zi -GM needed to compile mmx functions in assembly. -LCFLAGS = -Zi -GM -DPACKAGE=\"libcal\" -DVERSION=$(VERSION_NUMBER) -LINCS = -I$(XPDIST)\include -I..\libical - -#//------------------------------------------------------------------------ -#// -#// Define the files necessary to build the target (ie. OBJS) -#// -#//------------------------------------------------------------------------ -LIBICAL_OBJS= .\$(OBJDIR)\icalclassify.obj \ - .\$(OBJDIR)\icalcstp.obj \ - .\$(OBJDIR)\icalcstpclient.obj \ - .\$(OBJDIR)\icalcstpserver.obj \ - .\$(OBJDIR)\icaldirset.obj \ - .\$(OBJDIR)\icalfileset.obj \ - .\$(OBJDIR)\icalgauge.obj \ - .\$(OBJDIR)\icalmessage.obj \ - .\$(OBJDIR)\icalset.obj \ - .\$(OBJDIR)\icalspanlist.obj \ - .\$(OBJDIR)\icalsslexer.obj \ - .\$(OBJDIR)\icalssyacc.obj \ - $(NULL) - - - -OBJS= ..\libical\$(OBJDIR)\libical$(MOZ_BITS)$(VERSION_NUMBER).lib \ - $(LIBICAL_OBJS) \ - $(NULL) - - -#//------------------------------------------------------------------------ -#// -#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...) -#// (these must be defined before the common makefiles are included) -#// -#//------------------------------------------------------------------------ -LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib -MAPFILE= $(DLLNAME).map - - - -#//------------------------------------------------------------------------ -#// -#// Include the common makefile rules -#// -#//------------------------------------------------------------------------ -include <$(DEPTH)/config/rules.mak> +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (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/NPL/ +# +# 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. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): + +# + + + +MODULE = libicalss +EXPORTS = icalss.h + +#//------------------------------------------------------------------------ +#// +#// Makefile to build SUN-JAVA/JPEG Library (NEW) +#// +#//------------------------------------------------------------------------ + + +#//------------------------------------------------------------------------ +#// +#// Specify the depth of the current directory relative to the +#// root of NS +#// +#//------------------------------------------------------------------------ +DEPTH= ..\..\..\.. + +#//------------------------------------------------------------------------ +#// +#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...) +#// +#//------------------------------------------------------------------------ +EXPORT_LIBRARY=1 +LIBRARY_NAME=libicalss$(MOZ_BITS)$(VERSION_NUMBER) +PDBFILE=$(LIBRARY_NAME).pdb +MAPFILE=$(LIBRARY_NAME).map +!if "$(MOZ_BITS)" == "16" +DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def +!endif + +#//------------------------------------------------------------------------ +#// +#// Define any local options for the make tools +#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS) +#// -Zi -GM needed to compile mmx functions in assembly. +LCFLAGS = -Zi -GM -DPACKAGE=\"libcal\" -DVERSION=$(VERSION_NUMBER) +LINCS = -I$(XPDIST)\include -I..\libical + +#//------------------------------------------------------------------------ +#// +#// Define the files necessary to build the target (ie. OBJS) +#// +#//------------------------------------------------------------------------ +LIBICAL_OBJS= .\$(OBJDIR)\icalclassify.obj \ + .\$(OBJDIR)\icalcstp.obj \ + .\$(OBJDIR)\icalcstpclient.obj \ + .\$(OBJDIR)\icalcstpserver.obj \ + .\$(OBJDIR)\icaldirset.obj \ + .\$(OBJDIR)\icalfileset.obj \ + .\$(OBJDIR)\icalgauge.obj \ + .\$(OBJDIR)\icalmessage.obj \ + .\$(OBJDIR)\icalset.obj \ + .\$(OBJDIR)\icalspanlist.obj \ + .\$(OBJDIR)\icalsslexer.obj \ + .\$(OBJDIR)\icalssyacc.obj \ + $(NULL) + + + +OBJS= ..\libical\$(OBJDIR)\libical$(MOZ_BITS)$(VERSION_NUMBER).lib \ + $(LIBICAL_OBJS) \ + $(NULL) + + +#//------------------------------------------------------------------------ +#// +#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...) +#// (these must be defined before the common makefiles are included) +#// +#//------------------------------------------------------------------------ +LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib +MAPFILE= $(DLLNAME).map + + + +#//------------------------------------------------------------------------ +#// +#// Include the common makefile rules +#// +#//------------------------------------------------------------------------ +include <$(DEPTH)/config/rules.mak> diff --git a/other-licenses/libical/src/libicalvcal/Makefile.am b/other-licenses/libical/src/libicalvcal/Makefile.am index a4e9bba8879..c409347d148 100644 --- a/other-licenses/libical/src/libicalvcal/Makefile.am +++ b/other-licenses/libical/src/libicalvcal/Makefile.am @@ -3,8 +3,8 @@ lib_LTLIBRARIES = libicalvcal.la INCLUDES = \ -I$(top_builddir) \ -I$(top_srcdir)/src/libical \ - -I$(top_srcdir)/src/libicalss \ - -I$(srcdir) + -I$(top_builddir)/src/libical \ + -I$(top_srcdir)/src/libicalss libicalvcal_la_LDFLAGS = -version-info 0:0:0 diff --git a/other-licenses/libical/src/libicalvcal/Makefile.in b/other-licenses/libical/src/libicalvcal/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/libicalvcal/icalvcal.c b/other-licenses/libical/src/libicalvcal/icalvcal.c index 64ff1f7d3bc..15472555ecb 100644 --- a/other-licenses/libical/src/libicalvcal/icalvcal.c +++ b/other-licenses/libical/src/libicalvcal/icalvcal.c @@ -2,7 +2,7 @@ FILE: icalvcal.c CREATOR: eric 25 May 00 - $Id: icalvcal.c,v 1.2 2001-11-22 19:22:01 mikep%oeone.com Exp $ + $Id: icalvcal.c,v 1.3 2001-12-21 18:56:46 mikep%oeone.com Exp $ (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org @@ -41,10 +41,11 @@ #include "icalvcal.h" #include -#ifdef WIN32 -#define snprintf _snprintf -#define strcasecmp stricmp -#endif + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif enum datatype { COMPONENT, diff --git a/other-licenses/libical/src/libicalvcal/libicalvcal.dep b/other-licenses/libical/src/libicalvcal/libicalvcal.dep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/libicalvcal/makefile.win b/other-licenses/libical/src/libicalvcal/makefile.win index 4e314c945f3..2b874095f94 100644 --- a/other-licenses/libical/src/libicalvcal/makefile.win +++ b/other-licenses/libical/src/libicalvcal/makefile.win @@ -1,100 +1,100 @@ -#!gmake -# -# The contents of this file are subject to the Netscape Public -# License Version 1.1 (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/NPL/ -# -# 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. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): - -# - - - -MODULE = libicalvcal -EXPORTS = icalvcal.h - -#//------------------------------------------------------------------------ -#// -#// Makefile to build SUN-JAVA/JPEG Library (NEW) -#// -#//------------------------------------------------------------------------ - - -#//------------------------------------------------------------------------ -#// -#// Specify the depth of the current directory relative to the -#// root of NS -#// -#//------------------------------------------------------------------------ -DEPTH= ..\..\..\.. - -#//------------------------------------------------------------------------ -#// -#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...) -#// -#//------------------------------------------------------------------------ -EXPORT_LIBRARY=1 -LIBRARY_NAME=libicalvcal$(MOZ_BITS)$(VERSION_NUMBER) -PDBFILE=$(LIBRARY_NAME).pdb -MAPFILE=$(LIBRARY_NAME).map -!if "$(MOZ_BITS)" == "16" -DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def -!endif - -#//------------------------------------------------------------------------ -#// -#// Define any local options for the make tools -#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS) -#// -Zi -GM needed to compile mmx functions in assembly. -LCFLAGS = -Zi -GM -LINCS = -I$(XPDIST)\include -I..\libical - -#//------------------------------------------------------------------------ -#// -#// Define the files necessary to build the target (ie. OBJS) -#// -#//------------------------------------------------------------------------ -LIBICAL_OBJS= .\$(OBJDIR)\icalvcal.obj \ - .\$(OBJDIR)\vcaltest.obj \ - .\$(OBJDIR)\vcaltmp.obj \ - .\$(OBJDIR)\vcc.obj \ - .\$(OBJDIR)\vobject.obj \ - $(NULL) - - - -OBJS= ..\libical\$(OBJDIR)\libical$(MOZ_BITS)$(VERSION_NUMBER).lib \ - $(LIBICAL_OBJS) \ - $(NULL) - - -#//------------------------------------------------------------------------ -#// -#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...) -#// (these must be defined before the common makefiles are included) -#// -#//------------------------------------------------------------------------ -LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib -MAPFILE= $(DLLNAME).map - - - -#//------------------------------------------------------------------------ -#// -#// Include the common makefile rules -#// -#//------------------------------------------------------------------------ -include <$(DEPTH)/config/rules.mak> +#!gmake +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (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/NPL/ +# +# 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. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): + +# + + + +MODULE = libicalvcal +EXPORTS = icalvcal.h + +#//------------------------------------------------------------------------ +#// +#// Makefile to build SUN-JAVA/JPEG Library (NEW) +#// +#//------------------------------------------------------------------------ + + +#//------------------------------------------------------------------------ +#// +#// Specify the depth of the current directory relative to the +#// root of NS +#// +#//------------------------------------------------------------------------ +DEPTH= ..\..\..\.. + +#//------------------------------------------------------------------------ +#// +#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...) +#// +#//------------------------------------------------------------------------ +EXPORT_LIBRARY=1 +LIBRARY_NAME=libicalvcal$(MOZ_BITS)$(VERSION_NUMBER) +PDBFILE=$(LIBRARY_NAME).pdb +MAPFILE=$(LIBRARY_NAME).map +!if "$(MOZ_BITS)" == "16" +DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def +!endif + +#//------------------------------------------------------------------------ +#// +#// Define any local options for the make tools +#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS) +#// -Zi -GM needed to compile mmx functions in assembly. +LCFLAGS = -Zi -GM +LINCS = -I$(XPDIST)\include -I..\libical + +#//------------------------------------------------------------------------ +#// +#// Define the files necessary to build the target (ie. OBJS) +#// +#//------------------------------------------------------------------------ +LIBICAL_OBJS= .\$(OBJDIR)\icalvcal.obj \ + .\$(OBJDIR)\vcaltest.obj \ + .\$(OBJDIR)\vcaltmp.obj \ + .\$(OBJDIR)\vcc.obj \ + .\$(OBJDIR)\vobject.obj \ + $(NULL) + + + +OBJS= ..\libical\$(OBJDIR)\libical$(MOZ_BITS)$(VERSION_NUMBER).lib \ + $(LIBICAL_OBJS) \ + $(NULL) + + +#//------------------------------------------------------------------------ +#// +#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...) +#// (these must be defined before the common makefiles are included) +#// +#//------------------------------------------------------------------------ +LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib +MAPFILE= $(DLLNAME).map + + + +#//------------------------------------------------------------------------ +#// +#// Include the common makefile rules +#// +#//------------------------------------------------------------------------ +include <$(DEPTH)/config/rules.mak> diff --git a/other-licenses/libical/src/libicalvcal/port.h b/other-licenses/libical/src/libicalvcal/port.h index a079a710e15..e69de29bb2d 100644 --- a/other-licenses/libical/src/libicalvcal/port.h +++ b/other-licenses/libical/src/libicalvcal/port.h @@ -1,93 +0,0 @@ -/*************************************************************************** -(C) Copyright 1996 Apple Computer, Inc., AT&T Corp., International -Business Machines Corporation and Siemens Rolm Communications Inc. - -For purposes of this license notice, the term Licensors shall mean, -collectively, Apple Computer, Inc., AT&T Corp., International -Business Machines Corporation and Siemens Rolm Communications Inc. -The term Licensor shall mean any of the Licensors. - -Subject to acceptance of the following conditions, permission is hereby -granted by Licensors without the need for written agreement and without -license or royalty fees, to use, copy, modify and distribute this -software for any purpose. - -The above copyright notice and the following four paragraphs must be -reproduced in all copies of this software and any software including -this software. - -THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE -ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR -MODIFICATIONS. - -IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT, -INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT -OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. - -EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. - -The software is provided with RESTRICTED RIGHTS. Use, duplication, or -disclosure by the government are subject to restrictions set forth in -DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. - -***************************************************************************/ - -#ifndef __PORT_H__ -#define __PORT_H__ 1 - - -#if defined(__CPLUSPLUS__) || defined(__cplusplus) -extern "C" { -#endif - -/* some of these #defines are commented out because */ -/* Visual C++ sets them on the compiler command line instead */ - -/* #define _DEBUG */ -/* #define WIN32 */ -/* #define WIN16 */ -/* #define _WINDOWS */ -/* #define __MWERKS__ */ -/* #define INCLUDEMFC */ - -#define vCardClipboardFormat "+//ISBN 1-887687-00-9::versit::PDI//vCard" -#define vCalendarClipboardFormat "+//ISBN 1-887687-00-9::versit::PDI//vCalendar" - -/* The above strings vCardClipboardFormat and vCalendarClipboardFormat -are globally unique IDs which can be used to generate clipboard format -ID's as per the requirements of a specific platform. For example, in -Windows they are used as the parameter in a call to RegisterClipboardFormat. -For example: - - CLIPFORMAT foo = RegisterClipboardFormat(vCardClipboardFormat); - -*/ - -#define vCardMimeType "text/x-vCard" -#define vCalendarMimeType "text/x-vCalendar" - -#define DLLEXPORT(t) t - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef WIN32 -#define stricmp strcasecmp -#else -#define snprintf _snprintf -#define strcasecmp stricmp -#endif - -#if defined(__CPLUSPLUS__) || defined(__cplusplus) -} -#endif - -#endif /* __PORT_H__ */ diff --git a/other-licenses/libical/src/libicalvcal/vcc.c b/other-licenses/libical/src/libicalvcal/vcc.c index 5c34395b832..8682044d4cf 100644 --- a/other-licenses/libical/src/libicalvcal/vcc.c +++ b/other-licenses/libical/src/libicalvcal/vcc.c @@ -23,6 +23,11 @@ #define ID 273 #define STRING 274 +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif + #line 1 "vcc.y" diff --git a/other-licenses/libical/src/libicalvcal/vobject.c b/other-licenses/libical/src/libicalvcal/vobject.c index d685b04278d..f2a4fd588c5 100644 --- a/other-licenses/libical/src/libicalvcal/vobject.c +++ b/other-licenses/libical/src/libicalvcal/vobject.c @@ -46,6 +46,11 @@ DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable. #include #endif +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif + #include "vobject.h" #include #include diff --git a/other-licenses/libical/src/makefile.win b/other-licenses/libical/src/makefile.win index 766ce38ad26..dcaf616223e 100644 --- a/other-licenses/libical/src/makefile.win +++ b/other-licenses/libical/src/makefile.win @@ -1,28 +1,28 @@ -# -# The contents of this file are subject to the Netscape Public -# License Version 1.1 (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/NPL/ -# -# 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. -# -# The Original Code is mozilla.org code. -# -# The Initial Developer of the Original Code is Netscape -# Communications Corporation. Portions created by Netscape are -# Copyright (C) 1998 Netscape Communications Corporation. All -# Rights Reserved. -# -# Contributor(s): - -DEPTH=..\..\.. - -DIRS = libical \ - libicalss \ - libicalvcal \ - $(NULL) - -!include $(DEPTH)\config\rules.mak +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (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/NPL/ +# +# 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. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): + +DEPTH=..\..\.. + +DIRS = libical \ + libicalss \ + libicalvcal \ + $(NULL) + +!include $(DEPTH)\config\rules.mak diff --git a/other-licenses/libical/src/python/ChangeLog b/other-licenses/libical/src/python/ChangeLog index 7b16306ce5f..e69de29bb2d 100644 --- a/other-licenses/libical/src/python/ChangeLog +++ b/other-licenses/libical/src/python/ChangeLog @@ -1,109 +0,0 @@ -2001-03-13 Eric Busboom - - * Component.py Added Component.property() - -2001-03-10 Patrick Lewis - - * Added __str__ method to Collection.Collection - - * Component.Component can now be initialized without arguments - - * Made _singular_property and _multiple_properties (in Component) - useful for nearly all the specific component interfaces - - * Changed Property.Attendee and Property.Organizer to allow creation - with no arguments - - * Filled in Todo skeleton - - * Added test function for an Event - - -2001-03-05 Eric Busboom - - * Property.py Added a lot of exception code to signal failure to - create a Property. - - * DerivedProperties.py Added derived property classes for RDATE - and TRIGGER, two properties that can have one of two value types. - - -2001-03-04 Eric Busboom - - * Property.pm Added Property.ConstructorFailedError exception - - * Component.pm fixed bug in Collection.__setslice__. "," used - instead of ":" - -2001-03-04 Patrick Lewis - - * Split Libical.py file into Component.py, Property.py, Collection.py, - and Store.py - - * Added test_* functions to test.py - - * Changed component bindings to return a Collection when objects can - have multiple values - - * Changed Component object to allow for creation of an object without - an initial string - - * Added Todo and Journal events - -2001-02-28 Eric Busboom - - * Property Remove most internal data. The property now work - alsmost entirely off of the icalproperty that it holds a reference - to. Made changes in all derived Properties to accomodate the - change. - - * Property Added __del__ - - * Component Component.properties() now caches properties that it - constructs, so two calls to properties() to that get the same - icalproperty will also get the same Property. - - * Property Added Property.__cmp__ to test equality of properties - based on ical string values - -2001-02-27 Eric Busboom - - * Property Added Property.ref() to set/get the reference to the - Property's internal icalproperty - - * Property Property._update_value now changes the icalproperty - value if a reference has been set. - - * Component re-instituted Component.properties(). The routine now - adds a 'ref' key to the dict that holds the python pointer - string. The C hex value of the pointer is in the 'pid' key - - -2001-02-27 Patrick Lewis - - * Backed out changes to Component removing comp_p; - Component.comp_p should be restored - -2001-02-26 Eric Busboom - - * Period Added test routine,test_period() - - * Period implemented methods in period - - * Time Addedd addition and subtraction operators - -2001-02-25 Eric Busboom - - * Libical.py Added test routine for time, time_test() - - * Libical.py Remove end of line chars ('\r\n" ) from - Property._str__. Caller should add these lines itself - - * Liical.py CHanges Time._update_values to set time VALUE type - based on use of is_date, rather than length of string. - - * Libical.py Removed call to _update_value in TIme::timezone - - - * Libical.py changed update_value to _update_value - diff --git a/other-licenses/libical/src/python/Component.py b/other-licenses/libical/src/python/Component.py index b8303210ae1..fd4c8a22c98 100644 --- a/other-licenses/libical/src/python/Component.py +++ b/other-licenses/libical/src/python/Component.py @@ -7,7 +7,7 @@ # DESCRIPTION: # # -# $Id: Component.py,v 1.1 2001-11-15 19:27:40 mikep%oeone.com Exp $ +# $Id: Component.py,v 1.2 2001-12-21 18:56:50 mikep%oeone.com Exp $ # $Locker: $ # # (C) COPYRIGHT 2001, Eric Busboom @@ -26,29 +26,39 @@ #====================================================================== from LibicalWrap import * -from types import * -from Property import * +from types import DictType, StringType, IntType +from Property import Property from Collection import * +from Attendee import Attendee, Organizer +from Time import Time +from Duration import Duration +from Period import Period +import string + +WrapperNULL = None class Component: - def __init__(self,str=None, component_kind="ANY", ref=None): + def __init__(self,ref=None,kind=None): - if ref != None: + if ref != None: self._ref = ref + elif kind != None: + self._ref = icalcomponent_new( + icalcomponent_string_to_kind("VCALENDAR")) + _kind = icalcomponent_string_to_kind(kind) + inner = icalcomponent_new(_kind) + + icalcomponent_add_component(self._ref,inner); + else: - self._ref = None - if str != None: - self._ref = icalparser_parse_string(str) - else: - kind = icalenum_string_to_component_kind(component_kind) - self._ref = icalcomponent_new(kind) - + raise "Could not construct component of kind" + kind + self.cached_props = {} + self.cached_comps = {} def __del__(self): - if self._ref != None and \ - icalcomponent_get_parent(self._ref) != None: + if self._ref != None and icalcomponent_get_parent(self._ref) != WrapperNULL: for k in self.cached_props.keys(): del self.cached_props[k] @@ -58,7 +68,11 @@ class Component: def _prop_from_ref(self,p): + if(p == None or p== WrapperNULL): + return None; + d_string = icallangbind_property_eval_string(p,":") + d = eval(d_string) d['ref'] = p @@ -85,7 +99,7 @@ class Component: p = icallangbind_get_first_property(self._ref,type) - if p !='NULL': + if p !=WrapperNULL: self._prop_from_ref(p) prop = self.cached_props[p] return prop @@ -102,8 +116,9 @@ class Component: p = icallangbind_get_first_property(self._ref,type) - while p !='NULL': - self._prop_from_ref(p) + while p !=WrapperNULL and p != None: + + self._prop_from_ref(p) # Puts property in self.cached_props prop = self.cached_props[p] props.append(prop) p = icallangbind_get_next_property(self._ref,type) @@ -122,12 +137,12 @@ class Component: s = str(prop) prop_p = icalproperty_new_from_string(s) - if prop_p == 'NULL': + if prop_p == WrapperNULL: raise "Bad property string: " + s prop.ref(prop_p) - if icalproperty_get_parent(prop_p)=='NULL': + if icalproperty_get_parent(prop_p)==WrapperNULL: icalcomponent_add_property(self._ref, prop_p) elif icalproperty_get_parent(prop_p) != self._ref: raise "Property is already a child of another component" @@ -143,16 +158,48 @@ class Component: def components(self,type='ANY'): comps = [] + kind = icalcomponent_string_to_kind(type) + c = icalcomponent_get_first_component(self._ref,kind); + + while c != WrapperNULL and c != None: + + if not self.cached_comps.has_key(c): + + self.cached_comps[c] = Component(c) + + comp = self.cached_comps[c] + comps.append(comp) + c = icalcomponent_get_next_component(self._ref,kind); + return comps - def add_component(self, componentObj): - "Adds a child component." - pass + def inner_component(self): + inner = icalcomponent_get_inner(self._ref) - def remove_component(self, component): + if inner == WrapperNULL and inner != None: + return None + + return NewComponent(inner) + + def add_component(self, comp): + "Adds a child component." + + if not isinstance(comp,Component): + raise ValueError("Expected a Component") + + if icalcomponent_get_parent(comp._ref) != WrapperNULL: + raise "Failed to add child component. Child already has a parent"; + + icalcomponent_add_component(self._ref,comp._ref) + + def remove_component(self, comp): "Removes a child component" - pass + + if not isinstance(comp,Component): + raise ValueError("Expected a Component") + + icalcomponent_remove_component(self._ref,comp._ref) def as_ical_string(self): return self.__str__() @@ -163,30 +210,30 @@ class Component: -def NewComponent(comp): +def NewComponent(c): "Converts a string or C icalcomponent into the right component object." wasStr=0 # Were we passed a string or an icalcomponent? - if isinstance (comp, StringType): - compStr = comp - comp = icalparser_parse_string(comp) - wasStr=1 + if isinstance (c, StringType) and string.find(c,"icalcomponent") == -1: + comp = icalparser_parse_string(c) else: - compStr = icalcomponent_as_ical_string(comp) + comp = c + + if comp == None or comp == WrapperNULL: + raise ValueError("Expected a libical reference or an iCal string") kind = icalcomponent_isa(comp) - kindStr = icalenum_component_kind_to_string(kind) - # Do I need to free kind? (I think not). + kindStr = icalcomponent_kind_to_string(kind) if kindStr == 'VEVENT': - newComp = Event(compStr) + newComp = Event(comp) elif kindStr == 'VTODO': - newComp = Todo(compStr) + newComp = Todo(comp) elif kindStr == 'VJOURNAL': - newComp = Journal(compstr) + newComp = Journal(comp) else: - newComp = Component(compStr) + newComp = Component(comp) # I don't think I need to free the component created when passed a string, # as it wasn't created with a _new function. @@ -196,9 +243,16 @@ def NewComponent(comp): class GenericComponent(Component): - def __init__(self): - - # Component.__init__(self, str) # Call from subclasses + def __init__(self,ref=None,kind=None): + + if ref != None: + Component.__init__(self, ref=ref) # Call from subclasses + elif type != None: + Component.__init__(self, kind=kind) # Call from subclasses + else: + raise ValueError("Expected either a icalcomponent reference or a kind string") + + self._recurrence_set=None def _singular_property(self, name, value_type, value=None, @@ -208,14 +262,23 @@ class GenericComponent(Component): This is a constructor method for properties without a strictly defined object.""" - curr_properties = self.properties(name) + # Depending on the property name, this routine will either + # operate on the VCALENDAR container or on the inner VEVENT, + # VTODO, or VJOURNAL + + if name in ['METHOD','PRODID','CALSCALE','VERSION']: + comp = self + else: + comp = self.inner_component() + + curr_properties = comp.properties(name) # Get the value if value==None: if len(curr_properties) == 0: return None elif len(curr_properties) == 1: - return curr_properties[0].value() + return curr_properties[0] else: raise ValueError, "too many properties of type %s" % propType @@ -223,7 +286,7 @@ class GenericComponent(Component): else: # Check if value is in enumerated_values if enumerated_values: - value = upper(value) + value = string.upper(value) if value not in enumerated_values: raise ValueError, "%s is not one of %s" \ % (value, enumerated_values) @@ -248,12 +311,15 @@ class GenericComponent(Component): p.value(value) if len(curr_properties) == 1: - self.remove_property(curr_properties[0]) + comp.remove_property(curr_properties[0]) elif len(curr_properties) > 1: raise ValueError, "too many properties of type %s" % propType - self.add_property(p) - + comp.add_property(p) + + # METHOD, PRODID, CALSCALE and VERSION are properties of the + # VCALENDAR, not the inner component + def method(self, v=None): "Sets or returns the value of the METHOD property." return self._singular_property("METHOD", "TEXT", v) @@ -266,6 +332,12 @@ class GenericComponent(Component): "Sets or returns the value of the CALSCALE property." return self._singular_property("CALSCALE", "TEXT", v) + def version(self, v=None): + "Sets or returns the value of the Version property." + return self._singular_property("VERSION", "TEXT", v) + + # The remaining properties are all in the inner component + def class_prop(self, v=None): # Class is a reserved word "Sets or returns the value of the CLASS property." if v!=None: @@ -389,7 +461,7 @@ class GenericComponent(Component): """ if values!=None: for alarm in values: - self.addComponent(alarm) + self.add_component(alarm) else: return ComponentCollection(self, self.components('VALARM')) @@ -401,6 +473,8 @@ class GenericComponent(Component): property_obj=None): "Processes set/get for Properties that can have multiple instances." + comp = self.inner_component() + # Set value if values!=None: if not isinstance(values, TupleType) \ @@ -408,8 +482,8 @@ class GenericComponent(Component): raise TypeError, "%s is not a tuple or list." # Delete old properties - for p in self.properties(name): - self.remove_property(p) + for p in comp.properties(name): + comp.remove_property(p) for v in values: if property_obj: # Specialized properties @@ -424,7 +498,7 @@ class GenericComponent(Component): # new_prop.value_type(value_type) new_prop.value(v) - self.add_property(new_prop) + comp.add_property(new_prop) # Get value else: @@ -494,12 +568,15 @@ class GenericComponent(Component): return self._multiple_properties('RELATED-TO', 'TEXT', value) + class Event(GenericComponent): "The iCalendar Event object." - def __init__(self, str=None): - Component.__init__(self, str, "VEVENT") - GenericComponent.__init__(self) + def __init__(self,ref=None): + if ref != None: + GenericComponent.__init__(self, ref=ref) + else: + GenericComponent.__init__(self, kind='VEVENT') def component_type(self): "Returns the type of component for the object." @@ -601,6 +678,13 @@ class Event(GenericComponent): class Todo(GenericComponent): "The iCalendar TODO component." + def __init__(self,ref=None): + if ref != None: + GenericComponent.__init__(self, ref=ref) + else: + GenericComponent.__init__(self, kind='VTODO') + + def component_type(self): "Returns the type of component for the object." return "VTODO" @@ -653,6 +737,12 @@ class Todo(GenericComponent): class Journal(GenericComponent): "The iCalendar JOURNAL component." + def __init__(self): + if ref != None: + GenericComponent.__init__(self, ref=ref) + else: + GenericComponent.__init__(self, kind='VJOURNAL') + def component_type(self): "Returns the type of component for the object." return "VJOURNAL" diff --git a/other-licenses/libical/src/python/DerivedProperties.py b/other-licenses/libical/src/python/DerivedProperties.py index 25f93ef79f0..0b7a4d1d2c0 100644 --- a/other-licenses/libical/src/python/DerivedProperties.py +++ b/other-licenses/libical/src/python/DerivedProperties.py @@ -7,7 +7,7 @@ # DESCRIPTION: # # -# $Id: DerivedProperties.py,v 1.1 2001-11-15 19:27:41 mikep%oeone.com Exp $ +# $Id: DerivedProperties.py,v 1.2 2001-12-21 18:56:50 mikep%oeone.com Exp $ # $Locker: $ # # (C) COPYRIGHT 2001, Eric Busboom @@ -25,7 +25,10 @@ # the License at http://www.mozilla.org/MPL/ #====================================================================== -from Property import Time, Period, Duration +from Property import Property +from Time import Time +from Period import Period +from Duration import Duration def RDate(arg): @@ -57,3 +60,100 @@ def Trigger(arg): +class Recurrence_Id(Time): + """Class for RECURRENCE-ID property. + + Usage: + Reccurence_Id(dict) # A normal property dictionary + Reccurence_Id("19960401") # An iCalendar string + Reccurence_Id(8349873494) # Seconds from epoch + + If the 'dict' constructor is used, 'name' and 'value_type' + entries in dict are ignored and automatically set with the appropriate + values. + """ + + def __init__(self, dict={}): + Time.__init__(self, dict) + Property.name(self, 'RECURRENCE-ID') + + def name(self): + return Property.name(self) + + def _doParam(self, parameter, v): + if v!=None: + self[parameter]=v + return self[parameter] + + # Enumerated parameters + def value_parameter(self, v=None): + """Sets or gets the VALUE parameter value. + + The value passed should be either "DATE-TIME" or "DATE". Setting this + parameter has no impact on the property's value_type. Doing something + like: + + rid=Recurrence_Id("19960401") # Sets value & makes value_type="DATE" + rid.value_parameter("DATE-TIME") # Sets the parameter VALUE=DATE-TIME + + Would be allowed (even though it is wrong), so pay attention. + Verifying the component will reveal the error. + """ + if v!=None and v!="DATE" and v!="DATE-TIME": + raise ValueError, "%s is an invalid VALUE parameter value" % str(v) + self._doParam("VALUE", v) + + def tzid(self, v=None): + "Sets or gets the TZID parameter value." + self._doParam("TZID", v) + + def range_parameter(self, v=None): # 'range' is a builtin function + "Sets or gets the RANGE parameter value." + if v!=None and v!="THISANDPRIOR" and v!= "THISANDFUTURE": + raise ValueError, "%s is an invalid RANGE parameter value" % str(v) + self._doParam("RANGE", v) + +class Attach(Property): + """A class representing an ATTACH property. + + Usage: + Attach(uriString [, parameter_dict]) + Attach(fileObj [, parameter_dict]) + """ + + def __init__(self, value=None, parameter_dict={}): + Property.__init__(self, parameter_dict) + Property.name(self, 'ATTACH') + self.value(value) + + def value(self, v=None): + "Returns or sets the value of the property." + if v != None: + if isinstance(v, StringType): # Is a URI + self._desc['value']=v + Property.value_type(self, 'URI') + else: + try: + tempStr = v.read() + except: + raise TypeError,"%s must be a URL string or file-ish type"\ + % str(v) + self._desc['value'] = base64.encodestring(tempStr) + Property.value_type(self, 'BINARY') + else: + return self._desc['value'] + + def name(self): + "Returns the name of the property." + return Property.name(self) + + def value_type(self): + return Property.value_type(self) + + def fmttype(self, v=None): + "Gets or sets the FMTYPE parameter." + if v!= None: + self['FMTTYPE']=v + else: + return self['FMTTYPE'] + diff --git a/other-licenses/libical/src/python/Libical.py b/other-licenses/libical/src/python/Libical.py index ab27414d3c5..10273c1e799 100644 --- a/other-licenses/libical/src/python/Libical.py +++ b/other-licenses/libical/src/python/Libical.py @@ -7,7 +7,7 @@ # DESCRIPTION: # # -# $Id: Libical.py,v 1.1 2001-11-15 19:27:41 mikep%oeone.com Exp $ +# $Id: Libical.py,v 1.2 2001-12-21 18:56:50 mikep%oeone.com Exp $ # $Locker: $ # # (C) COPYRIGHT 2001, Eric Busboom @@ -25,15 +25,11 @@ # the License at http://www.mozilla.org/MPL/ #====================================================================== - -import LibicalWrap - from Component import Component, NewComponent, Event, Todo, Journal - -# Will eventually remove Time for real Property events -from Property import Property, Time, Duration, Period, Attendee, Organizer, \ - Recurrence_Id, Attach, RecurrenceSet - -from DerivedProperties import RDate, Trigger - +from Property import Property, RecurrenceSet, test_enum +from Time import Time +from Period import Period +from Duration import Duration +from Attendee import Attendee, Organizer +from DerivedProperties import RDate, Trigger,Recurrence_Id, Attach from Store import Store, FileStore diff --git a/other-licenses/libical/src/python/LibicalWrap.c b/other-licenses/libical/src/python/LibicalWrap.c deleted file mode 100644 index 5e7b0a6acf0..00000000000 --- a/other-licenses/libical/src/python/LibicalWrap.c +++ /dev/null @@ -1,3576 +0,0 @@ -/* - * FILE : LibicalWrap.c - * - * This file was automatically generated by : - * Simplified Wrapper and Interface Generator (SWIG) - * Version 1.1 (Patch 5) - * - * Portions Copyright (c) 1995-1998 - * The University of Utah and The Regents of the University of California. - * Permission is granted to distribute this file in any manner provided - * this notice remains intact. - * - * Do not make changes to this file--changes will be lost! - * - */ - - -#define SWIGCODE -/* Implementation : PYTHON */ - -#define SWIGPYTHON -#include -#include -/*********************************************************************** - * $Header: /home/jrmuizel/cvs-mirror/mozilla/other-licenses/libical/src/python/Attic/LibicalWrap.c,v 1.1 2001-11-15 19:27:41 mikep%oeone.com Exp $ - * swig_lib/python/python.cfg - * - * This file contains coded needed to add variable linking to the - * Python interpreter. C variables are added as a new kind of Python - * datatype. - * - * Also contains supporting code for building python under Windows - * and things like that. - * - * $Log: LibicalWrap.c,v $ - * Revision 1.1 2001-11-15 19:27:41 mikep%oeone.com - * Adding in libical source. - * - ************************************************************************/ - -#ifdef __cplusplus -extern "C" { -#endif -#include "Python.h" -#ifdef __cplusplus -} -#endif - -/* Definitions for Windows/Unix exporting */ -#if defined(__WIN32__) -# if defined(_MSC_VER) -# define SWIGEXPORT(a,b) __declspec(dllexport) a b -# else -# if defined(__BORLANDC__) -# define SWIGEXPORT(a,b) a _export b -# else -# define SWIGEXPORT(a,b) a b -# endif -# endif -#else -# define SWIGEXPORT(a,b) a b -#endif - -#ifdef SWIG_GLOBAL -#ifdef __cplusplus -#define SWIGSTATIC extern "C" -#else -#define SWIGSTATIC -#endif -#endif - -#ifndef SWIGSTATIC -#define SWIGSTATIC static -#endif - -typedef struct { - char *name; - PyObject *(*get_attr)(void); - int (*set_attr)(PyObject *); -} swig_globalvar; - -typedef struct swig_varlinkobject { - PyObject_HEAD - swig_globalvar **vars; - int nvars; - int maxvars; -} swig_varlinkobject; - -/* ---------------------------------------------------------------------- - swig_varlink_repr() - - Function for python repr method - ---------------------------------------------------------------------- */ - -static PyObject * -swig_varlink_repr(swig_varlinkobject *v) -{ - v = v; - return PyString_FromString(""); -} - -/* --------------------------------------------------------------------- - swig_varlink_print() - - Print out all of the global variable names - --------------------------------------------------------------------- */ - -static int -swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) -{ - - int i = 0; - flags = flags; - fprintf(fp,"Global variables { "); - while (v->vars[i]) { - fprintf(fp,"%s", v->vars[i]->name); - i++; - if (v->vars[i]) fprintf(fp,", "); - } - fprintf(fp," }\n"); - return 0; -} - -/* -------------------------------------------------------------------- - swig_varlink_getattr - - This function gets the value of a variable and returns it as a - PyObject. In our case, we'll be looking at the datatype and - converting into a number or string - -------------------------------------------------------------------- */ - -static PyObject * -swig_varlink_getattr(swig_varlinkobject *v, char *n) -{ - int i = 0; - char temp[128]; - - while (v->vars[i]) { - if (strcmp(v->vars[i]->name,n) == 0) { - return (*v->vars[i]->get_attr)(); - } - i++; - } - sprintf(temp,"C global variable %s not found.", n); - PyErr_SetString(PyExc_NameError,temp); - return NULL; -} - -/* ------------------------------------------------------------------- - swig_varlink_setattr() - - This function sets the value of a variable. - ------------------------------------------------------------------- */ - -static int -swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) -{ - char temp[128]; - int i = 0; - while (v->vars[i]) { - if (strcmp(v->vars[i]->name,n) == 0) { - return (*v->vars[i]->set_attr)(p); - } - i++; - } - sprintf(temp,"C global variable %s not found.", n); - PyErr_SetString(PyExc_NameError,temp); - return 1; -} - -statichere PyTypeObject varlinktype = { -/* PyObject_HEAD_INIT(&PyType_Type) Note : This doesn't work on some machines */ - PyObject_HEAD_INIT(0) - 0, - "varlink", /* Type name */ - sizeof(swig_varlinkobject), /* Basic size */ - 0, /* Itemsize */ - 0, /* Deallocator */ - (printfunc) swig_varlink_print, /* Print */ - (getattrfunc) swig_varlink_getattr, /* get attr */ - (setattrfunc) swig_varlink_setattr, /* Set attr */ - 0, /* tp_compare */ - (reprfunc) swig_varlink_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_mapping*/ - 0, /* tp_hash */ -}; - -/* Create a variable linking object for use later */ - -SWIGSTATIC PyObject * -SWIG_newvarlink(void) -{ - swig_varlinkobject *result = 0; - result = PyMem_NEW(swig_varlinkobject,1); - varlinktype.ob_type = &PyType_Type; /* Patch varlinktype into a PyType */ - result->ob_type = &varlinktype; - /* _Py_NewReference(result); Does not seem to be necessary */ - result->nvars = 0; - result->maxvars = 64; - result->vars = (swig_globalvar **) malloc(64*sizeof(swig_globalvar *)); - result->vars[0] = 0; - result->ob_refcnt = 0; - Py_XINCREF((PyObject *) result); - return ((PyObject*) result); -} - -SWIGSTATIC void -SWIG_addvarlink(PyObject *p, char *name, - PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) -{ - swig_varlinkobject *v; - v= (swig_varlinkobject *) p; - - if (v->nvars >= v->maxvars -1) { - v->maxvars = 2*v->maxvars; - v->vars = (swig_globalvar **) realloc(v->vars,v->maxvars*sizeof(swig_globalvar *)); - if (v->vars == NULL) { - fprintf(stderr,"SWIG : Fatal error in initializing Python module.\n"); - exit(1); - } - } - v->vars[v->nvars] = (swig_globalvar *) malloc(sizeof(swig_globalvar)); - v->vars[v->nvars]->name = (char *) malloc(strlen(name)+1); - strcpy(v->vars[v->nvars]->name,name); - v->vars[v->nvars]->get_attr = get_attr; - v->vars[v->nvars]->set_attr = set_attr; - v->nvars++; - v->vars[v->nvars] = 0; -} - - - -/***************************************************************************** - * $Header: /home/jrmuizel/cvs-mirror/mozilla/other-licenses/libical/src/python/Attic/LibicalWrap.c,v 1.1 2001-11-15 19:27:41 mikep%oeone.com Exp $ - * - * swigptr.swg - * - * This file contains supporting code for the SWIG run-time type checking - * mechanism. The following functions are available : - * - * SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *)); - * - * Registers a new type-mapping with the type-checker. origtype is the - * original datatype and newtype is an equivalent type. cast is optional - * pointer to a function to cast pointer values between types (this - * is typically used to cast pointers from derived classes to base classes in C++) - * - * SWIG_MakePtr(char *buffer, void *ptr, char *typestring); - * - * Makes a pointer string from a pointer and typestring. The result is returned - * in buffer which is assumed to hold enough space for the result. - * - * char * SWIG_GetPtr(char *buffer, void **ptr, char *type) - * - * Gets a pointer value from a string. If there is a type-mismatch, returns - * a character string to the received type. On success, returns NULL. - * - * - * You can remap these functions by making a file called "swigptr.swg" in - * your the same directory as the interface file you are wrapping. - * - * These functions are normally declared static, but this file can be - * can be used in a multi-module environment by redefining the symbol - * SWIGSTATIC. - *****************************************************************************/ - -#include - -#ifdef SWIG_GLOBAL -#ifdef __cplusplus -#define SWIGSTATIC extern "C" -#else -#define SWIGSTATIC -#endif -#endif - -#ifndef SWIGSTATIC -#define SWIGSTATIC static -#endif - - -/* SWIG pointer structure */ - -typedef struct SwigPtrType { - char *name; /* Datatype name */ - int len; /* Length (used for optimization) */ - void *(*cast)(void *); /* Pointer casting function */ - struct SwigPtrType *next; /* Linked list pointer */ -} SwigPtrType; - -/* Pointer cache structure */ - -typedef struct { - int stat; /* Status (valid) bit */ - SwigPtrType *tp; /* Pointer to type structure */ - char name[256]; /* Given datatype name */ - char mapped[256]; /* Equivalent name */ -} SwigCacheType; - -/* Some variables */ - -static int SwigPtrMax = 64; /* Max entries that can be currently held */ - /* This value may be adjusted dynamically */ -static int SwigPtrN = 0; /* Current number of entries */ -static int SwigPtrSort = 0; /* Status flag indicating sort */ -static int SwigStart[256]; /* Starting positions of types */ - -/* Pointer table */ -static SwigPtrType *SwigPtrTable = 0; /* Table containing pointer equivalences */ - -/* Cached values */ - -#define SWIG_CACHESIZE 8 -#define SWIG_CACHEMASK 0x7 -static SwigCacheType SwigCache[SWIG_CACHESIZE]; -static int SwigCacheIndex = 0; -static int SwigLastCache = 0; - -/* Sort comparison function */ -static int swigsort(const void *data1, const void *data2) { - SwigPtrType *d1 = (SwigPtrType *) data1; - SwigPtrType *d2 = (SwigPtrType *) data2; - return strcmp(d1->name,d2->name); -} - -/* Binary Search function */ -static int swigcmp(const void *key, const void *data) { - char *k = (char *) key; - SwigPtrType *d = (SwigPtrType *) data; - return strncmp(k,d->name,d->len); -} - -/* Register a new datatype with the type-checker */ - -SWIGSTATIC -void SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *)) { - - int i; - SwigPtrType *t = 0,*t1; - - /* Allocate the pointer table if necessary */ - - if (!SwigPtrTable) { - SwigPtrTable = (SwigPtrType *) malloc(SwigPtrMax*sizeof(SwigPtrType)); - SwigPtrN = 0; - } - /* Grow the table */ - if (SwigPtrN >= SwigPtrMax) { - SwigPtrMax = 2*SwigPtrMax; - SwigPtrTable = (SwigPtrType *) realloc((char *) SwigPtrTable,SwigPtrMax*sizeof(SwigPtrType)); - } - for (i = 0; i < SwigPtrN; i++) - if (strcmp(SwigPtrTable[i].name,origtype) == 0) { - t = &SwigPtrTable[i]; - break; - } - if (!t) { - t = &SwigPtrTable[SwigPtrN]; - t->name = origtype; - t->len = strlen(t->name); - t->cast = 0; - t->next = 0; - SwigPtrN++; - } - - /* Check for existing entry */ - - while (t->next) { - if ((strcmp(t->name,newtype) == 0)) { - if (cast) t->cast = cast; - return; - } - t = t->next; - } - - /* Now place entry (in sorted order) */ - - t1 = (SwigPtrType *) malloc(sizeof(SwigPtrType)); - t1->name = newtype; - t1->len = strlen(t1->name); - t1->cast = cast; - t1->next = 0; - t->next = t1; - SwigPtrSort = 0; -} - -/* Make a pointer value string */ - -SWIGSTATIC -void SWIG_MakePtr(char *_c, const void *_ptr, char *type) { - static char _hex[16] = - {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'a', 'b', 'c', 'd', 'e', 'f'}; - unsigned long _p, _s; - char _result[20], *_r; /* Note : a 64-bit hex number = 16 digits */ - _r = _result; - _p = (unsigned long) _ptr; - if (_p > 0) { - while (_p > 0) { - _s = _p & 0xf; - *(_r++) = _hex[_s]; - _p = _p >> 4; - } - *_r = '_'; - while (_r >= _result) - *(_c++) = *(_r--); - } else { - strcpy (_c, "NULL"); - } - if (_ptr) - strcpy (_c, type); -} - -/* Define for backwards compatibility */ - -#define _swig_make_hex SWIG_MakePtr - -/* Function for getting a pointer value */ - -SWIGSTATIC -char *SWIG_GetPtr(char *_c, void **ptr, char *_t) -{ - unsigned long _p; - char temp_type[256]; - char *name; - int i, len; - SwigPtrType *sp,*tp; - SwigCacheType *cache; - int start, end; - _p = 0; - - /* Pointer values must start with leading underscore */ - if (*_c == '_') { - _c++; - /* Extract hex value from pointer */ - while (*_c) { - if ((*_c >= '0') && (*_c <= '9')) - _p = (_p << 4) + (*_c - '0'); - else if ((*_c >= 'a') && (*_c <= 'f')) - _p = (_p << 4) + ((*_c - 'a') + 10); - else - break; - _c++; - } - - if (_t) { - if (strcmp(_t,_c)) { - if (!SwigPtrSort) { - qsort((void *) SwigPtrTable, SwigPtrN, sizeof(SwigPtrType), swigsort); - for (i = 0; i < 256; i++) { - SwigStart[i] = SwigPtrN; - } - for (i = SwigPtrN-1; i >= 0; i--) { - SwigStart[(int) (SwigPtrTable[i].name[1])] = i; - } - for (i = 255; i >= 1; i--) { - if (SwigStart[i-1] > SwigStart[i]) - SwigStart[i-1] = SwigStart[i]; - } - SwigPtrSort = 1; - for (i = 0; i < SWIG_CACHESIZE; i++) - SwigCache[i].stat = 0; - } - - /* First check cache for matches. Uses last cache value as starting point */ - cache = &SwigCache[SwigLastCache]; - for (i = 0; i < SWIG_CACHESIZE; i++) { - if (cache->stat) { - if (strcmp(_t,cache->name) == 0) { - if (strcmp(_c,cache->mapped) == 0) { - cache->stat++; - *ptr = (void *) _p; - if (cache->tp->cast) *ptr = (*(cache->tp->cast))(*ptr); - return (char *) 0; - } - } - } - SwigLastCache = (SwigLastCache+1) & SWIG_CACHEMASK; - if (!SwigLastCache) cache = SwigCache; - else cache++; - } - /* We have a type mismatch. Will have to look through our type - mapping table to figure out whether or not we can accept this datatype */ - - start = SwigStart[(int) _t[1]]; - end = SwigStart[(int) _t[1]+1]; - sp = &SwigPtrTable[start]; - while (start < end) { - if (swigcmp(_t,sp) == 0) break; - sp++; - start++; - } - if (start >= end) sp = 0; - /* Try to find a match for this */ - if (sp) { - while (swigcmp(_t,sp) == 0) { - name = sp->name; - len = sp->len; - tp = sp->next; - /* Try to find entry for our given datatype */ - while(tp) { - if (tp->len >= 255) { - return _c; - } - strcpy(temp_type,tp->name); - strncat(temp_type,_t+len,255-tp->len); - if (strcmp(_c,temp_type) == 0) { - - strcpy(SwigCache[SwigCacheIndex].mapped,_c); - strcpy(SwigCache[SwigCacheIndex].name,_t); - SwigCache[SwigCacheIndex].stat = 1; - SwigCache[SwigCacheIndex].tp = tp; - SwigCacheIndex = SwigCacheIndex & SWIG_CACHEMASK; - - /* Get pointer value */ - *ptr = (void *) _p; - if (tp->cast) *ptr = (*(tp->cast))(*ptr); - return (char *) 0; - } - tp = tp->next; - } - sp++; - /* Hmmm. Didn't find it this time */ - } - } - /* Didn't find any sort of match for this data. - Get the pointer value and return the received type */ - *ptr = (void *) _p; - return _c; - } else { - /* Found a match on the first try. Return pointer value */ - *ptr = (void *) _p; - return (char *) 0; - } - } else { - /* No type specified. Good luck */ - *ptr = (void *) _p; - return (char *) 0; - } - } else { - if (strcmp (_c, "NULL") == 0) { - *ptr = (void *) 0; - return (char *) 0; - } - *ptr = (void *) 0; - return _c; - } -} - -/* Compatibility mode */ - -#define _swig_get_hex SWIG_GetPtr - -#define SWIG_init initLibicalWrap - -#define SWIG_name "LibicalWrap" - -#include "ical.h" -#include "icalss.h" - -#include /* for size_t */ -#include - -static PyObject *_wrap_icalparser_parse_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - char * _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalparser_parse_string",&_arg0)) - return NULL; - _result = (icalcomponent *)icalparser_parse_string(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_new(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - int _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"i:icalcomponent_new",&_arg0)) - return NULL; - _result = (icalcomponent *)icalcomponent_new(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_new_clone(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalcomponent * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_new_clone",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_new_clone. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icalcomponent_new_clone(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_new_from_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - char * _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_new_from_string",&_arg0)) - return NULL; - _result = (icalcomponent *)icalcomponent_new_from_string(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_as_ical_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - icalcomponent * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_as_ical_string",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_as_ical_string. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (char *)icalcomponent_as_ical_string(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_free(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_free",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_free. Expected _icalcomponent_p."); - return NULL; - } - } - icalcomponent_free(_arg0); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_count_errors(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - icalcomponent * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_count_errors",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_count_errors. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (int )icalcomponent_count_errors(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_strip_errors(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_strip_errors",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_strip_errors. Expected _icalcomponent_p."); - return NULL; - } - } - icalcomponent_strip_errors(_arg0); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_convert_errors(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_convert_errors",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_convert_errors. Expected _icalcomponent_p."); - return NULL; - } - } - icalcomponent_convert_errors(_arg0); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_get_current_property(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _result; - icalcomponent * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_get_current_property",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_get_current_property. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalproperty *)icalcomponent_get_current_property(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalproperty_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_get_first_property(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _result; - icalcomponent * _arg0; - int _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"si:icalcomponent_get_first_property",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_get_first_property. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalproperty *)icalcomponent_get_first_property(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalproperty_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_get_next_property(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _result; - icalcomponent * _arg0; - int _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"si:icalcomponent_get_next_property",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_get_next_property. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalproperty *)icalcomponent_get_next_property(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalproperty_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_get_current_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalcomponent * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_get_current_component",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_get_current_component. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icalcomponent_get_current_component(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_get_first_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalcomponent * _arg0; - int _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"si:icalcomponent_get_first_component",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_get_first_component. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icalcomponent_get_first_component(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_get_next_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalcomponent * _arg0; - int _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"si:icalcomponent_get_next_component",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_get_next_component. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icalcomponent_get_next_component(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_add_property(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _arg0; - icalproperty * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalcomponent_add_property",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_add_property. Expected _icalcomponent_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalcomponent_add_property. Expected _icalproperty_p."); - return NULL; - } - } - icalcomponent_add_property(_arg0,_arg1); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_remove_property(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _arg0; - icalproperty * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalcomponent_remove_property",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_remove_property. Expected _icalcomponent_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalcomponent_remove_property. Expected _icalproperty_p."); - return NULL; - } - } - icalcomponent_remove_property(_arg0,_arg1); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_get_parent(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalcomponent * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_get_parent",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_get_parent. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icalcomponent_get_parent(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalcomponent_isa(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - icalcomponent * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalcomponent_isa",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalcomponent_isa. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (int )icalcomponent_isa(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalrestriction_check(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - icalcomponent * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalrestriction_check",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalrestriction_check. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (int )icalrestriction_check(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_new(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _result; - int _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"i:icalproperty_new",&_arg0)) - return NULL; - _result = (icalproperty *)icalproperty_new(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalproperty_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_new_from_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _result; - char * _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalproperty_new_from_string",&_arg0)) - return NULL; - _result = (icalproperty *)icalproperty_new_from_string(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalproperty_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_as_ical_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - icalproperty * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalproperty_as_ical_string",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalproperty_as_ical_string. Expected _icalproperty_p."); - return NULL; - } - } - _result = (char *)icalproperty_as_ical_string(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_set_parameter_from_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _arg0; - char * _arg1; - char * _arg2; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"sss:icalproperty_set_parameter_from_string",&_argc0,&_arg1,&_arg2)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalproperty_set_parameter_from_string. Expected _icalproperty_p."); - return NULL; - } - } - icalproperty_set_parameter_from_string(_arg0,_arg1,_arg2); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalproperty_set_value_from_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _arg0; - char * _arg1; - char * _arg2; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"sss:icalproperty_set_value_from_string",&_argc0,&_arg1,&_arg2)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalproperty_set_value_from_string. Expected _icalproperty_p."); - return NULL; - } - } - icalproperty_set_value_from_string(_arg0,_arg1,_arg2); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalproperty_get_value_as_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - icalproperty * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalproperty_get_value_as_string",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalproperty_get_value_as_string. Expected _icalproperty_p."); - return NULL; - } - } - _result = (char *)icalproperty_get_value_as_string(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_get_parameter_as_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - icalproperty * _arg0; - char * _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalproperty_get_parameter_as_string",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalproperty_get_parameter_as_string. Expected _icalproperty_p."); - return NULL; - } - } - _result = (char *)icalproperty_get_parameter_as_string(_arg0,_arg1); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_get_parent(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalproperty * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalproperty_get_parent",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalproperty_get_parent. Expected _icalproperty_p."); - return NULL; - } - } - _result = (icalcomponent *)icalproperty_get_parent(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalerror_supress(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - char * _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalerror_supress",&_arg0)) - return NULL; - _result = (int )icalerror_supress(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalerror_restore(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _arg0; - int _arg1; - - self = self; - if(!PyArg_ParseTuple(args,"si:icalerror_restore",&_arg0,&_arg1)) - return NULL; - icalerror_restore(_arg0,_arg1); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalerror_perror(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - - self = self; - if(!PyArg_ParseTuple(args,":icalerror_perror")) - return NULL; - _result = (char *)icalerror_perror(); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalerror_clear_errno(PyObject *self, PyObject *args) { - PyObject * _resultobj; - - self = self; - if(!PyArg_ParseTuple(args,":icalerror_clear_errno")) - return NULL; - icalerror_clear_errno(); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalproperty_kind_to_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - int _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"i:icalproperty_kind_to_string",&_arg0)) - return NULL; - _result = (char *)icalproperty_kind_to_string(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_string_to_kind(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - char * _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalproperty_string_to_kind",&_arg0)) - return NULL; - _result = (int )icalproperty_string_to_kind(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalproperty_kind_to_value_kind(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - int _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"i:icalproperty_kind_to_value_kind",&_arg0)) - return NULL; - _result = (int )icalproperty_kind_to_value_kind(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalvalue_kind_to_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - int _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"i:icalvalue_kind_to_string",&_arg0)) - return NULL; - _result = (char *)icalvalue_kind_to_string(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalvalue_string_to_kind(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - char * _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalvalue_string_to_kind",&_arg0)) - return NULL; - _result = (int )icalvalue_string_to_kind(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalparameter_kind_to_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - int _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"i:icalparameter_kind_to_string",&_arg0)) - return NULL; - _result = (char *)icalparameter_kind_to_string(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalparameter_string_to_kind(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - char * _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalparameter_string_to_kind",&_arg0)) - return NULL; - _result = (int )icalparameter_string_to_kind(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalenum_component_kind_to_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - int _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"i:icalenum_component_kind_to_string",&_arg0)) - return NULL; - _result = (char *)icalenum_component_kind_to_string(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalenum_string_to_component_kind(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - char * _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalenum_string_to_component_kind",&_arg0)) - return NULL; - _result = (int )icalenum_string_to_component_kind(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_new_array(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int * _result; - int _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"i:icallangbind_new_array",&_arg0)) - return NULL; - _result = (int *)icallangbind_new_array(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_int_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_free_array(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icallangbind_free_array",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icallangbind_free_array. Expected _int_p."); - return NULL; - } - } - icallangbind_free_array(_arg0); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icallangbind_access_array(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - int * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icallangbind_access_array",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icallangbind_access_array. Expected _int_p."); - return NULL; - } - } - _result = (int )icallangbind_access_array(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalrecur_expand_recurrence(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - char * _arg0; - int _arg1; - int _arg2; - int * _arg3; - char * _argc3 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"siis:icalrecur_expand_recurrence",&_arg0,&_arg1,&_arg2,&_argc3)) - return NULL; - if (_argc3) { - if (SWIG_GetPtr(_argc3,(void **) &_arg3,"_int_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 4 of icalrecur_expand_recurrence. Expected _int_p."); - return NULL; - } - } - _result = (int )icalrecur_expand_recurrence(_arg0,_arg1,_arg2,_arg3); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_get_first_property(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _result; - icalcomponent * _arg0; - char * _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icallangbind_get_first_property",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icallangbind_get_first_property. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalproperty *)icallangbind_get_first_property(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalproperty_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_get_next_property(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalproperty * _result; - icalcomponent * _arg0; - char * _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icallangbind_get_next_property",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icallangbind_get_next_property. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalproperty *)icallangbind_get_next_property(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalproperty_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_get_first_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalcomponent * _arg0; - char * _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icallangbind_get_first_component",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icallangbind_get_first_component. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icallangbind_get_first_component(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_get_next_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalcomponent * _arg0; - char * _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icallangbind_get_next_component",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icallangbind_get_next_component. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icallangbind_get_next_component(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_property_eval_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - icalproperty * _arg0; - char * _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icallangbind_property_eval_string",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icallangbind_property_eval_string. Expected _icalproperty_p."); - return NULL; - } - } - _result = (char *)icallangbind_property_eval_string(_arg0,_arg1); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icallangbind_string_to_open_flag(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - char * _arg0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icallangbind_string_to_open_flag",&_arg0)) - return NULL; - _result = (int )icallangbind_string_to_open_flag(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_from_timet(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - int _arg0; - int _arg1; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ii:icaltime_from_timet",&_arg0,&_arg1)) - return NULL; - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_from_timet(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_as_timet(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_as_timet",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_as_timet. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltime_as_timet(*_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_as_ical_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_as_ical_string",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_as_ical_string. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (char *)icaltime_as_ical_string(*_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_from_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - char * _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_from_string",&_arg0)) - return NULL; - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_from_string(_arg0); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_utc_offset(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icaltime_utc_offset",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_utc_offset. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltime_utc_offset(*_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_as_utc(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icaltimetype * _arg0; - char * _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icaltime_as_utc",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_as_utc. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_as_utc(*_arg0,_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_as_zone(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icaltimetype * _arg0; - char * _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icaltime_as_zone",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_as_zone. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_as_zone(*_arg0,_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_null_time(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,":icaltime_null_time")) - return NULL; - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_null_time(); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_is_null_time(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_is_null_time",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_is_null_time. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltime_is_null_time(*_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_is_valid_time(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_is_valid_time",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_is_valid_time. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltime_is_valid_time(*_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_normalize(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_normalize",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_normalize. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_normalize(*_arg0); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_day_of_year(PyObject *self, PyObject *args) { - PyObject * _resultobj; - short _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_day_of_year",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_day_of_year. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (short )icaltime_day_of_year(*_arg0); - _resultobj = Py_BuildValue("h",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_from_day_of_year(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - short _arg0; - short _arg1; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"hh:icaltime_from_day_of_year",&_arg0,&_arg1)) - return NULL; - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_from_day_of_year(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_day_of_week(PyObject *self, PyObject *args) { - PyObject * _resultobj; - short _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_day_of_week",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_day_of_week. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (short )icaltime_day_of_week(*_arg0); - _resultobj = Py_BuildValue("h",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_start_doy_of_week(PyObject *self, PyObject *args) { - PyObject * _resultobj; - short _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_start_doy_of_week",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_start_doy_of_week. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (short )icaltime_start_doy_of_week(*_arg0); - _resultobj = Py_BuildValue("h",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_as_ctime(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_as_ctime",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_as_ctime. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (char *)icaltime_as_ctime(*_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_week_number(PyObject *self, PyObject *args) { - PyObject * _resultobj; - short _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltime_week_number",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_week_number. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (short )icaltime_week_number(*_arg0); - _resultobj = Py_BuildValue("h",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_compare(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - struct icaltimetype * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icaltime_compare",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_compare. Expected _struct_icaltimetype_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icaltime_compare. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltime_compare(*_arg0,*_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_compare_date_only(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - struct icaltimetype * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icaltime_compare_date_only",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_compare_date_only. Expected _struct_icaltimetype_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icaltime_compare_date_only. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltime_compare_date_only(*_arg0,*_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_days_in_month(PyObject *self, PyObject *args) { - PyObject * _resultobj; - short _result; - short _arg0; - short _arg1; - - self = self; - if(!PyArg_ParseTuple(args,"hh:icaltime_days_in_month",&_arg0,&_arg1)) - return NULL; - _result = (short )icaltime_days_in_month(_arg0,_arg1); - _resultobj = Py_BuildValue("h",_result); - return _resultobj; -} - -static PyObject *_wrap_icaldurationtype_from_int(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaldurationtype * _result; - int _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"i:icaldurationtype_from_int",&_arg0)) - return NULL; - _result = (struct icaldurationtype *) malloc(sizeof(struct icaldurationtype )); - *(_result) = icaldurationtype_from_int(_arg0); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaldurationtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaldurationtype_from_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaldurationtype * _result; - char * _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_from_string",&_arg0)) - return NULL; - _result = (struct icaldurationtype *) malloc(sizeof(struct icaldurationtype )); - *(_result) = icaldurationtype_from_string(_arg0); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaldurationtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaldurationtype_as_int(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_as_int",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_as_int. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (int )icaldurationtype_as_int(*_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaldurationtype_as_ical_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_as_ical_string",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_as_ical_string. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (char *)icaldurationtype_as_ical_string(*_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icaldurationtype_null_duration(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaldurationtype * _result; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,":icaldurationtype_null_duration")) - return NULL; - _result = (struct icaldurationtype *) malloc(sizeof(struct icaldurationtype )); - *(_result) = icaldurationtype_null_duration(); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaldurationtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaldurationtype_is_null_duration(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_is_null_duration",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_is_null_duration. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (int )icaldurationtype_is_null_duration(*_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icaltime_add(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icaltimetype * _arg0; - struct icaldurationtype * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icaltime_add",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_add. Expected _struct_icaltimetype_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icaltime_add. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (struct icaltimetype *) malloc(sizeof(struct icaltimetype )); - *(_result) = icaltime_add(*_arg0,*_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icaltime_subtract(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaldurationtype * _result; - struct icaltimetype * _arg0; - struct icaltimetype * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icaltime_subtract",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltime_subtract. Expected _struct_icaltimetype_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icaltime_subtract. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (struct icaldurationtype *) malloc(sizeof(struct icaldurationtype )); - *(_result) = icaltime_subtract(*_arg0,*_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icaldurationtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalperiodtype_from_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icalperiodtype * _result; - char * _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalperiodtype_from_string",&_arg0)) - return NULL; - _result = (struct icalperiodtype *) malloc(sizeof(struct icalperiodtype )); - *(_result) = icalperiodtype_from_string(_arg0); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icalperiodtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalperiodtype_as_ical_string(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - struct icalperiodtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalperiodtype_as_ical_string",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_as_ical_string. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - _result = (char *)icalperiodtype_as_ical_string(*_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalperiodtype_null_period(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icalperiodtype * _result; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,":icalperiodtype_null_period")) - return NULL; - _result = (struct icalperiodtype *) malloc(sizeof(struct icalperiodtype )); - *(_result) = icalperiodtype_null_period(); - SWIG_MakePtr(_ptemp, (void *) _result,"_struct_icalperiodtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalperiodtype_is_null_period(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icalperiodtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalperiodtype_is_null_period",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_is_null_period. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - _result = (int )icalperiodtype_is_null_period(*_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalperiodtype_is_valid_period(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icalperiodtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalperiodtype_is_valid_period",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_is_valid_period. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - _result = (int )icalperiodtype_is_valid_period(*_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_new(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalfileset * _result; - char * _arg0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_new",&_arg0)) - return NULL; - _result = (icalfileset *)icalfileset_new(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalfileset_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_new_open(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalfileset * _result; - char * _arg0; - int _arg1; - int _arg2; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"sii:icalfileset_new_open",&_arg0,&_arg1,&_arg2)) - return NULL; - _result = (icalfileset *)icalfileset_new_open(_arg0,_arg1,_arg2); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalfileset_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_free(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalfileset * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_free",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_free. Expected _icalfileset_p."); - return NULL; - } - } - icalfileset_free(_arg0); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalfileset_path(PyObject *self, PyObject *args) { - PyObject * _resultobj; - char * _result; - icalfileset * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_path",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_path. Expected _icalfileset_p."); - return NULL; - } - } - _result = (char *)icalfileset_path(_arg0); - _resultobj = Py_BuildValue("s", _result); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_mark(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalfileset * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_mark",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_mark. Expected _icalfileset_p."); - return NULL; - } - } - icalfileset_mark(_arg0); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalfileset_commit(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalerrorenum * _result; - icalfileset * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_commit",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_commit. Expected _icalfileset_p."); - return NULL; - } - } - _result = (icalerrorenum *) malloc(sizeof(icalerrorenum )); - *(_result) = icalfileset_commit(_arg0); - SWIG_MakePtr(_ptemp, (void *) _result,"_icalerrorenum_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_add_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalerrorenum * _result; - icalfileset * _arg0; - icalcomponent * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalfileset_add_component",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_add_component. Expected _icalfileset_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalfileset_add_component. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalerrorenum *) malloc(sizeof(icalerrorenum )); - *(_result) = icalfileset_add_component(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_icalerrorenum_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_remove_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalerrorenum * _result; - icalfileset * _arg0; - icalcomponent * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalfileset_remove_component",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_remove_component. Expected _icalfileset_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalfileset_remove_component. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalerrorenum *) malloc(sizeof(icalerrorenum )); - *(_result) = icalfileset_remove_component(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_icalerrorenum_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_count_components(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - icalfileset * _arg0; - icalcomponent_kind * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalfileset_count_components",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_count_components. Expected _icalfileset_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_icalcomponent_kind_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalfileset_count_components. Expected _icalcomponent_kind_p."); - return NULL; - } - } - _result = (int )icalfileset_count_components(_arg0,*_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_select(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalerrorenum * _result; - icalfileset * _arg0; - icalgauge * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalfileset_select",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_select. Expected _icalfileset_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_icalgauge_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalfileset_select. Expected _icalgauge_p."); - return NULL; - } - } - _result = (icalerrorenum *) malloc(sizeof(icalerrorenum )); - *(_result) = icalfileset_select(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (void *) _result,"_icalerrorenum_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_clear(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalfileset * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_clear",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_clear. Expected _icalfileset_p."); - return NULL; - } - } - icalfileset_clear(_arg0); - Py_INCREF(Py_None); - _resultobj = Py_None; - return _resultobj; -} - -static PyObject *_wrap_icalfileset_fetch(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalfileset * _arg0; - char * _arg1; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalfileset_fetch",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_fetch. Expected _icalfileset_p."); - return NULL; - } - } - _result = (icalcomponent *)icalfileset_fetch(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_has_uid(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - icalfileset * _arg0; - char * _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalfileset_has_uid",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_has_uid. Expected _icalfileset_p."); - return NULL; - } - } - _result = (int )icalfileset_has_uid(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_fetch_match(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalfileset * _arg0; - icalcomponent * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalfileset_fetch_match",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_fetch_match. Expected _icalfileset_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalfileset_fetch_match. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalcomponent *)icalfileset_fetch_match(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_modify(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalerrorenum * _result; - icalfileset * _arg0; - icalcomponent * _arg1; - icalcomponent * _arg2; - char * _argc0 = 0; - char * _argc1 = 0; - char * _argc2 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"sss:icalfileset_modify",&_argc0,&_argc1,&_argc2)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_modify. Expected _icalfileset_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalfileset_modify. Expected _icalcomponent_p."); - return NULL; - } - } - if (_argc2) { - if (SWIG_GetPtr(_argc2,(void **) &_arg2,(char *) 0 )) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of icalfileset_modify. Expected _icalcomponent_p."); - return NULL; - } - } - _result = (icalerrorenum *) malloc(sizeof(icalerrorenum )); - *(_result) = icalfileset_modify(_arg0,_arg1,_arg2); - SWIG_MakePtr(_ptemp, (void *) _result,"_icalerrorenum_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_get_current_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalfileset * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_get_current_component",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_get_current_component. Expected _icalfileset_p."); - return NULL; - } - } - _result = (icalcomponent *)icalfileset_get_current_component(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_get_first_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalfileset * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_get_first_component",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_get_first_component. Expected _icalfileset_p."); - return NULL; - } - } - _result = (icalcomponent *)icalfileset_get_first_component(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_get_next_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalfileset * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_get_next_component",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_get_next_component. Expected _icalfileset_p."); - return NULL; - } - } - _result = (icalcomponent *)icalfileset_get_next_component(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyObject *_wrap_icalfileset_get_component(PyObject *self, PyObject *args) { - PyObject * _resultobj; - icalcomponent * _result; - icalfileset * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalfileset_get_component",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_icalfileset_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalfileset_get_component. Expected _icalfileset_p."); - return NULL; - } - } - _result = (icalcomponent *)icalfileset_get_component(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_icalcomponent_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -#define icaltimetype_year_set(_swigobj,_swigval) (_swigobj->year = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_year_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_year_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_year_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_year_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_year_get(_swigobj) ((int ) _swigobj->year) -static PyObject *_wrap_icaltimetype_year_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_year_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_year_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_year_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_month_set(_swigobj,_swigval) (_swigobj->month = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_month_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_month_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_month_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_month_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_month_get(_swigobj) ((int ) _swigobj->month) -static PyObject *_wrap_icaltimetype_month_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_month_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_month_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_month_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_day_set(_swigobj,_swigval) (_swigobj->day = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_day_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_day_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_day_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_day_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_day_get(_swigobj) ((int ) _swigobj->day) -static PyObject *_wrap_icaltimetype_day_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_day_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_day_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_day_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_hour_set(_swigobj,_swigval) (_swigobj->hour = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_hour_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_hour_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_hour_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_hour_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_hour_get(_swigobj) ((int ) _swigobj->hour) -static PyObject *_wrap_icaltimetype_hour_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_hour_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_hour_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_hour_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_minute_set(_swigobj,_swigval) (_swigobj->minute = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_minute_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_minute_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_minute_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_minute_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_minute_get(_swigobj) ((int ) _swigobj->minute) -static PyObject *_wrap_icaltimetype_minute_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_minute_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_minute_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_minute_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_second_set(_swigobj,_swigval) (_swigobj->second = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_second_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_second_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_second_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_second_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_second_get(_swigobj) ((int ) _swigobj->second) -static PyObject *_wrap_icaltimetype_second_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_second_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_second_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_second_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_is_utc_set(_swigobj,_swigval) (_swigobj->is_utc = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_is_utc_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_is_utc_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_is_utc_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_is_utc_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_is_utc_get(_swigobj) ((int ) _swigobj->is_utc) -static PyObject *_wrap_icaltimetype_is_utc_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_is_utc_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_is_utc_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_is_utc_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_is_date_set(_swigobj,_swigval) (_swigobj->is_date = _swigval,_swigval) -static PyObject *_wrap_icaltimetype_is_date_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaltimetype_is_date_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_is_date_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_is_date_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaltimetype_is_date_get(_swigobj) ((int ) _swigobj->is_date) -static PyObject *_wrap_icaltimetype_is_date_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaltimetype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaltimetype_is_date_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaltimetype_is_date_get. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (int )icaltimetype_is_date_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_is_neg_set(_swigobj,_swigval) (_swigobj->is_neg = _swigval,_swigval) -static PyObject *_wrap_icaldurationtype_is_neg_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaldurationtype * _arg0; - int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaldurationtype_is_neg_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_is_neg_set. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (int )icaldurationtype_is_neg_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_is_neg_get(_swigobj) ((int ) _swigobj->is_neg) -static PyObject *_wrap_icaldurationtype_is_neg_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_is_neg_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_is_neg_get. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (int )icaldurationtype_is_neg_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_days_set(_swigobj,_swigval) (_swigobj->days = _swigval,_swigval) -static PyObject *_wrap_icaldurationtype_days_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - unsigned int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaldurationtype_days_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_days_set. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_days_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_days_get(_swigobj) ((unsigned int ) _swigobj->days) -static PyObject *_wrap_icaldurationtype_days_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_days_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_days_get. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_days_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_weeks_set(_swigobj,_swigval) (_swigobj->weeks = _swigval,_swigval) -static PyObject *_wrap_icaldurationtype_weeks_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - unsigned int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaldurationtype_weeks_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_weeks_set. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_weeks_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_weeks_get(_swigobj) ((unsigned int ) _swigobj->weeks) -static PyObject *_wrap_icaldurationtype_weeks_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_weeks_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_weeks_get. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_weeks_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_hours_set(_swigobj,_swigval) (_swigobj->hours = _swigval,_swigval) -static PyObject *_wrap_icaldurationtype_hours_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - unsigned int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaldurationtype_hours_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_hours_set. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_hours_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_hours_get(_swigobj) ((unsigned int ) _swigobj->hours) -static PyObject *_wrap_icaldurationtype_hours_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_hours_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_hours_get. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_hours_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_minutes_set(_swigobj,_swigval) (_swigobj->minutes = _swigval,_swigval) -static PyObject *_wrap_icaldurationtype_minutes_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - unsigned int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaldurationtype_minutes_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_minutes_set. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_minutes_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_minutes_get(_swigobj) ((unsigned int ) _swigobj->minutes) -static PyObject *_wrap_icaldurationtype_minutes_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_minutes_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_minutes_get. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_minutes_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_seconds_set(_swigobj,_swigval) (_swigobj->seconds = _swigval,_swigval) -static PyObject *_wrap_icaldurationtype_seconds_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - unsigned int _arg1; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"si:icaldurationtype_seconds_set",&_argc0,&_arg1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_seconds_set. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_seconds_set(_arg0,_arg1); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icaldurationtype_seconds_get(_swigobj) ((unsigned int ) _swigobj->seconds) -static PyObject *_wrap_icaldurationtype_seconds_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - unsigned int _result; - struct icaldurationtype * _arg0; - char * _argc0 = 0; - - self = self; - if(!PyArg_ParseTuple(args,"s:icaldurationtype_seconds_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icaldurationtype_seconds_get. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (unsigned int )icaldurationtype_seconds_get(_arg0); - _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define icalperiodtype_start_set(_swigobj,_swigval) (_swigobj->start = *(_swigval),_swigval) -static PyObject *_wrap_icalperiodtype_start_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icalperiodtype * _arg0; - struct icaltimetype * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalperiodtype_start_set",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_start_set. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalperiodtype_start_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (struct icaltimetype *)icalperiodtype_start_set(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -#define icalperiodtype_start_get(_swigobj) (&_swigobj->start) -static PyObject *_wrap_icalperiodtype_start_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icalperiodtype * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalperiodtype_start_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_start_get. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - _result = (struct icaltimetype *)icalperiodtype_start_get(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -#define icalperiodtype_end_set(_swigobj,_swigval) (_swigobj->end = *(_swigval),_swigval) -static PyObject *_wrap_icalperiodtype_end_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icalperiodtype * _arg0; - struct icaltimetype * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalperiodtype_end_set",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_end_set. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_struct_icaltimetype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalperiodtype_end_set. Expected _struct_icaltimetype_p."); - return NULL; - } - } - _result = (struct icaltimetype *)icalperiodtype_end_set(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -#define icalperiodtype_end_get(_swigobj) (&_swigobj->end) -static PyObject *_wrap_icalperiodtype_end_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaltimetype * _result; - struct icalperiodtype * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalperiodtype_end_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_end_get. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - _result = (struct icaltimetype *)icalperiodtype_end_get(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_struct_icaltimetype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -#define icalperiodtype_duration_set(_swigobj,_swigval) (_swigobj->duration = *(_swigval),_swigval) -static PyObject *_wrap_icalperiodtype_duration_set(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaldurationtype * _result; - struct icalperiodtype * _arg0; - struct icaldurationtype * _arg1; - char * _argc0 = 0; - char * _argc1 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"ss:icalperiodtype_duration_set",&_argc0,&_argc1)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_duration_set. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - if (_argc1) { - if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_struct_icaldurationtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of icalperiodtype_duration_set. Expected _struct_icaldurationtype_p."); - return NULL; - } - } - _result = (struct icaldurationtype *)icalperiodtype_duration_set(_arg0,_arg1); - SWIG_MakePtr(_ptemp, (char *) _result,"_struct_icaldurationtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -#define icalperiodtype_duration_get(_swigobj) (&_swigobj->duration) -static PyObject *_wrap_icalperiodtype_duration_get(PyObject *self, PyObject *args) { - PyObject * _resultobj; - struct icaldurationtype * _result; - struct icalperiodtype * _arg0; - char * _argc0 = 0; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTuple(args,"s:icalperiodtype_duration_get",&_argc0)) - return NULL; - if (_argc0) { - if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_struct_icalperiodtype_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of icalperiodtype_duration_get. Expected _struct_icalperiodtype_p."); - return NULL; - } - } - _result = (struct icaldurationtype *)icalperiodtype_duration_get(_arg0); - SWIG_MakePtr(_ptemp, (char *) _result,"_struct_icaldurationtype_p"); - _resultobj = Py_BuildValue("s",_ptemp); - return _resultobj; -} - -static PyMethodDef LibicalWrapMethods[] = { - { "icalperiodtype_duration_get", _wrap_icalperiodtype_duration_get, 1 }, - { "icalperiodtype_duration_set", _wrap_icalperiodtype_duration_set, 1 }, - { "icalperiodtype_end_get", _wrap_icalperiodtype_end_get, 1 }, - { "icalperiodtype_end_set", _wrap_icalperiodtype_end_set, 1 }, - { "icalperiodtype_start_get", _wrap_icalperiodtype_start_get, 1 }, - { "icalperiodtype_start_set", _wrap_icalperiodtype_start_set, 1 }, - { "icaldurationtype_seconds_get", _wrap_icaldurationtype_seconds_get, 1 }, - { "icaldurationtype_seconds_set", _wrap_icaldurationtype_seconds_set, 1 }, - { "icaldurationtype_minutes_get", _wrap_icaldurationtype_minutes_get, 1 }, - { "icaldurationtype_minutes_set", _wrap_icaldurationtype_minutes_set, 1 }, - { "icaldurationtype_hours_get", _wrap_icaldurationtype_hours_get, 1 }, - { "icaldurationtype_hours_set", _wrap_icaldurationtype_hours_set, 1 }, - { "icaldurationtype_weeks_get", _wrap_icaldurationtype_weeks_get, 1 }, - { "icaldurationtype_weeks_set", _wrap_icaldurationtype_weeks_set, 1 }, - { "icaldurationtype_days_get", _wrap_icaldurationtype_days_get, 1 }, - { "icaldurationtype_days_set", _wrap_icaldurationtype_days_set, 1 }, - { "icaldurationtype_is_neg_get", _wrap_icaldurationtype_is_neg_get, 1 }, - { "icaldurationtype_is_neg_set", _wrap_icaldurationtype_is_neg_set, 1 }, - { "icaltimetype_is_date_get", _wrap_icaltimetype_is_date_get, 1 }, - { "icaltimetype_is_date_set", _wrap_icaltimetype_is_date_set, 1 }, - { "icaltimetype_is_utc_get", _wrap_icaltimetype_is_utc_get, 1 }, - { "icaltimetype_is_utc_set", _wrap_icaltimetype_is_utc_set, 1 }, - { "icaltimetype_second_get", _wrap_icaltimetype_second_get, 1 }, - { "icaltimetype_second_set", _wrap_icaltimetype_second_set, 1 }, - { "icaltimetype_minute_get", _wrap_icaltimetype_minute_get, 1 }, - { "icaltimetype_minute_set", _wrap_icaltimetype_minute_set, 1 }, - { "icaltimetype_hour_get", _wrap_icaltimetype_hour_get, 1 }, - { "icaltimetype_hour_set", _wrap_icaltimetype_hour_set, 1 }, - { "icaltimetype_day_get", _wrap_icaltimetype_day_get, 1 }, - { "icaltimetype_day_set", _wrap_icaltimetype_day_set, 1 }, - { "icaltimetype_month_get", _wrap_icaltimetype_month_get, 1 }, - { "icaltimetype_month_set", _wrap_icaltimetype_month_set, 1 }, - { "icaltimetype_year_get", _wrap_icaltimetype_year_get, 1 }, - { "icaltimetype_year_set", _wrap_icaltimetype_year_set, 1 }, - { "icalfileset_get_component", _wrap_icalfileset_get_component, 1 }, - { "icalfileset_get_next_component", _wrap_icalfileset_get_next_component, 1 }, - { "icalfileset_get_first_component", _wrap_icalfileset_get_first_component, 1 }, - { "icalfileset_get_current_component", _wrap_icalfileset_get_current_component, 1 }, - { "icalfileset_modify", _wrap_icalfileset_modify, 1 }, - { "icalfileset_fetch_match", _wrap_icalfileset_fetch_match, 1 }, - { "icalfileset_has_uid", _wrap_icalfileset_has_uid, 1 }, - { "icalfileset_fetch", _wrap_icalfileset_fetch, 1 }, - { "icalfileset_clear", _wrap_icalfileset_clear, 1 }, - { "icalfileset_select", _wrap_icalfileset_select, 1 }, - { "icalfileset_count_components", _wrap_icalfileset_count_components, 1 }, - { "icalfileset_remove_component", _wrap_icalfileset_remove_component, 1 }, - { "icalfileset_add_component", _wrap_icalfileset_add_component, 1 }, - { "icalfileset_commit", _wrap_icalfileset_commit, 1 }, - { "icalfileset_mark", _wrap_icalfileset_mark, 1 }, - { "icalfileset_path", _wrap_icalfileset_path, 1 }, - { "icalfileset_free", _wrap_icalfileset_free, 1 }, - { "icalfileset_new_open", _wrap_icalfileset_new_open, 1 }, - { "icalfileset_new", _wrap_icalfileset_new, 1 }, - { "icalperiodtype_is_valid_period", _wrap_icalperiodtype_is_valid_period, 1 }, - { "icalperiodtype_is_null_period", _wrap_icalperiodtype_is_null_period, 1 }, - { "icalperiodtype_null_period", _wrap_icalperiodtype_null_period, 1 }, - { "icalperiodtype_as_ical_string", _wrap_icalperiodtype_as_ical_string, 1 }, - { "icalperiodtype_from_string", _wrap_icalperiodtype_from_string, 1 }, - { "icaltime_subtract", _wrap_icaltime_subtract, 1 }, - { "icaltime_add", _wrap_icaltime_add, 1 }, - { "icaldurationtype_is_null_duration", _wrap_icaldurationtype_is_null_duration, 1 }, - { "icaldurationtype_null_duration", _wrap_icaldurationtype_null_duration, 1 }, - { "icaldurationtype_as_ical_string", _wrap_icaldurationtype_as_ical_string, 1 }, - { "icaldurationtype_as_int", _wrap_icaldurationtype_as_int, 1 }, - { "icaldurationtype_from_string", _wrap_icaldurationtype_from_string, 1 }, - { "icaldurationtype_from_int", _wrap_icaldurationtype_from_int, 1 }, - { "icaltime_days_in_month", _wrap_icaltime_days_in_month, 1 }, - { "icaltime_compare_date_only", _wrap_icaltime_compare_date_only, 1 }, - { "icaltime_compare", _wrap_icaltime_compare, 1 }, - { "icaltime_week_number", _wrap_icaltime_week_number, 1 }, - { "icaltime_as_ctime", _wrap_icaltime_as_ctime, 1 }, - { "icaltime_start_doy_of_week", _wrap_icaltime_start_doy_of_week, 1 }, - { "icaltime_day_of_week", _wrap_icaltime_day_of_week, 1 }, - { "icaltime_from_day_of_year", _wrap_icaltime_from_day_of_year, 1 }, - { "icaltime_day_of_year", _wrap_icaltime_day_of_year, 1 }, - { "icaltime_normalize", _wrap_icaltime_normalize, 1 }, - { "icaltime_is_valid_time", _wrap_icaltime_is_valid_time, 1 }, - { "icaltime_is_null_time", _wrap_icaltime_is_null_time, 1 }, - { "icaltime_null_time", _wrap_icaltime_null_time, 1 }, - { "icaltime_as_zone", _wrap_icaltime_as_zone, 1 }, - { "icaltime_as_utc", _wrap_icaltime_as_utc, 1 }, - { "icaltime_utc_offset", _wrap_icaltime_utc_offset, 1 }, - { "icaltime_from_string", _wrap_icaltime_from_string, 1 }, - { "icaltime_as_ical_string", _wrap_icaltime_as_ical_string, 1 }, - { "icaltime_as_timet", _wrap_icaltime_as_timet, 1 }, - { "icaltime_from_timet", _wrap_icaltime_from_timet, 1 }, - { "icallangbind_string_to_open_flag", _wrap_icallangbind_string_to_open_flag, 1 }, - { "icallangbind_property_eval_string", _wrap_icallangbind_property_eval_string, 1 }, - { "icallangbind_get_next_component", _wrap_icallangbind_get_next_component, 1 }, - { "icallangbind_get_first_component", _wrap_icallangbind_get_first_component, 1 }, - { "icallangbind_get_next_property", _wrap_icallangbind_get_next_property, 1 }, - { "icallangbind_get_first_property", _wrap_icallangbind_get_first_property, 1 }, - { "icalrecur_expand_recurrence", _wrap_icalrecur_expand_recurrence, 1 }, - { "icallangbind_access_array", _wrap_icallangbind_access_array, 1 }, - { "icallangbind_free_array", _wrap_icallangbind_free_array, 1 }, - { "icallangbind_new_array", _wrap_icallangbind_new_array, 1 }, - { "icalenum_string_to_component_kind", _wrap_icalenum_string_to_component_kind, 1 }, - { "icalenum_component_kind_to_string", _wrap_icalenum_component_kind_to_string, 1 }, - { "icalparameter_string_to_kind", _wrap_icalparameter_string_to_kind, 1 }, - { "icalparameter_kind_to_string", _wrap_icalparameter_kind_to_string, 1 }, - { "icalvalue_string_to_kind", _wrap_icalvalue_string_to_kind, 1 }, - { "icalvalue_kind_to_string", _wrap_icalvalue_kind_to_string, 1 }, - { "icalproperty_kind_to_value_kind", _wrap_icalproperty_kind_to_value_kind, 1 }, - { "icalproperty_string_to_kind", _wrap_icalproperty_string_to_kind, 1 }, - { "icalproperty_kind_to_string", _wrap_icalproperty_kind_to_string, 1 }, - { "icalerror_clear_errno", _wrap_icalerror_clear_errno, 1 }, - { "icalerror_perror", _wrap_icalerror_perror, 1 }, - { "icalerror_restore", _wrap_icalerror_restore, 1 }, - { "icalerror_supress", _wrap_icalerror_supress, 1 }, - { "icalproperty_get_parent", _wrap_icalproperty_get_parent, 1 }, - { "icalproperty_get_parameter_as_string", _wrap_icalproperty_get_parameter_as_string, 1 }, - { "icalproperty_get_value_as_string", _wrap_icalproperty_get_value_as_string, 1 }, - { "icalproperty_set_value_from_string", _wrap_icalproperty_set_value_from_string, 1 }, - { "icalproperty_set_parameter_from_string", _wrap_icalproperty_set_parameter_from_string, 1 }, - { "icalproperty_as_ical_string", _wrap_icalproperty_as_ical_string, 1 }, - { "icalproperty_new_from_string", _wrap_icalproperty_new_from_string, 1 }, - { "icalproperty_new", _wrap_icalproperty_new, 1 }, - { "icalrestriction_check", _wrap_icalrestriction_check, 1 }, - { "icalcomponent_isa", _wrap_icalcomponent_isa, 1 }, - { "icalcomponent_get_parent", _wrap_icalcomponent_get_parent, 1 }, - { "icalcomponent_remove_property", _wrap_icalcomponent_remove_property, 1 }, - { "icalcomponent_add_property", _wrap_icalcomponent_add_property, 1 }, - { "icalcomponent_get_next_component", _wrap_icalcomponent_get_next_component, 1 }, - { "icalcomponent_get_first_component", _wrap_icalcomponent_get_first_component, 1 }, - { "icalcomponent_get_current_component", _wrap_icalcomponent_get_current_component, 1 }, - { "icalcomponent_get_next_property", _wrap_icalcomponent_get_next_property, 1 }, - { "icalcomponent_get_first_property", _wrap_icalcomponent_get_first_property, 1 }, - { "icalcomponent_get_current_property", _wrap_icalcomponent_get_current_property, 1 }, - { "icalcomponent_convert_errors", _wrap_icalcomponent_convert_errors, 1 }, - { "icalcomponent_strip_errors", _wrap_icalcomponent_strip_errors, 1 }, - { "icalcomponent_count_errors", _wrap_icalcomponent_count_errors, 1 }, - { "icalcomponent_free", _wrap_icalcomponent_free, 1 }, - { "icalcomponent_as_ical_string", _wrap_icalcomponent_as_ical_string, 1 }, - { "icalcomponent_new_from_string", _wrap_icalcomponent_new_from_string, 1 }, - { "icalcomponent_new_clone", _wrap_icalcomponent_new_clone, 1 }, - { "icalcomponent_new", _wrap_icalcomponent_new, 1 }, - { "icalparser_parse_string", _wrap_icalparser_parse_string, 1 }, - { NULL, NULL } -}; -static PyObject *SWIG_globals; -#ifdef __cplusplus -extern "C" -#endif -SWIGEXPORT(void,initLibicalWrap)() { - PyObject *m, *d; - SWIG_globals = SWIG_newvarlink(); - m = Py_InitModule("LibicalWrap", LibicalWrapMethods); - d = PyModule_GetDict(m); - PyDict_SetItemString(d,"icaltimetype_zone", PyString_FromString("icaltimetype::zone")); -/* - * These are the pointer type-equivalency mappings. - * (Used by the SWIG pointer type-checker). - */ - SWIG_RegisterMapping("_struct_icaldurationtype","_icaldurationtype",0); - SWIG_RegisterMapping("_signed_long","_long",0); - SWIG_RegisterMapping("_icaldurationtype","_struct_icaldurationtype",0); - SWIG_RegisterMapping("_long","_unsigned_long",0); - SWIG_RegisterMapping("_long","_signed_long",0); - SWIG_RegisterMapping("_icalperiodtype","_struct_icalperiodtype",0); - SWIG_RegisterMapping("_unsigned_long","_long",0); - SWIG_RegisterMapping("_signed_int","_int",0); - SWIG_RegisterMapping("_unsigned_short","_short",0); - SWIG_RegisterMapping("_signed_short","_short",0); - SWIG_RegisterMapping("_unsigned_int","_int",0); - SWIG_RegisterMapping("_short","_unsigned_short",0); - SWIG_RegisterMapping("_short","_signed_short",0); - SWIG_RegisterMapping("_struct_icaltimetype","_icaltimetype",0); - SWIG_RegisterMapping("_int","_unsigned_int",0); - SWIG_RegisterMapping("_int","_signed_int",0); - SWIG_RegisterMapping("_icaltimetype","_struct_icaltimetype",0); - SWIG_RegisterMapping("_struct_icalperiodtype","_icalperiodtype",0); -} diff --git a/other-licenses/libical/src/python/LibicalWrap.i b/other-licenses/libical/src/python/LibicalWrap.i index c6b67403830..e69de29bb2d 100644 --- a/other-licenses/libical/src/python/LibicalWrap.i +++ b/other-licenses/libical/src/python/LibicalWrap.i @@ -1,352 +0,0 @@ -/* -*- Mode: C -*-*/ -/*====================================================================== - FILE: ical.i - - (C) COPYRIGHT 1999 Eric Busboom - http://www.softwarestudio.org - - 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. - - The original author is Eric Busboom - - Contributions from: - Graham Davison (g.m.davison@computer.org) - - ======================================================================*/ - -%module LibicalWrap - - -%{ -#include "ical.h" -#include "icalss.h" - -#include /* for size_t */ -#include - -%} - - -#include "fcntl.h" /* For Open flags */ - -typedef void icalcomponent; -typedef void icalproperty; - -icalcomponent* icalparser_parse_string(char* str); - - -icalcomponent* icalcomponent_new(int kind); -icalcomponent* icalcomponent_new_clone(icalcomponent* component); -icalcomponent* icalcomponent_new_from_string(char* str); - -char* icalcomponent_as_ical_string(icalcomponent* component); - -void icalcomponent_free(icalcomponent* component); -int icalcomponent_count_errors(icalcomponent* component); -void icalcomponent_strip_errors(icalcomponent* component); -void icalcomponent_convert_errors(icalcomponent* component); - -icalproperty* icalcomponent_get_current_property(icalcomponent* component); - -icalproperty* icalcomponent_get_first_property(icalcomponent* component, - int kind); -icalproperty* icalcomponent_get_next_property(icalcomponent* component, - int kind); - -icalcomponent* icalcomponent_get_current_component (icalcomponent* component); - -icalcomponent* icalcomponent_get_first_component(icalcomponent* component, - int kind); -icalcomponent* icalcomponent_get_next_component(icalcomponent* component, - int kind); - -void icalcomponent_add_property(icalcomponent* component, - icalproperty* property); - -void icalcomponent_remove_property(icalcomponent* component, - icalproperty* property); - - -icalcomponent* icalcomponent_get_parent(icalcomponent* component); -int icalcomponent_isa(icalcomponent* component); - -int icalrestriction_check(icalcomponent* comp); - - -/* actually takes icalproperty_kind */ -icalproperty* icalproperty_new(int kind); - -icalproperty* icalproperty_new_from_string(char* str); - -char* icalproperty_as_ical_string(icalproperty *prop); - -void icalproperty_set_parameter_from_string(icalproperty* prop, - const char* name, const char* value); -void icalproperty_set_value_from_string(icalproperty* prop,const char* value, const char * kind); - -const char* icalproperty_get_value_as_string(icalproperty* prop); -const char* icalproperty_get_parameter_as_string(icalproperty* prop, - const char* name); - - -icalcomponent* icalproperty_get_parent(icalproperty* property); - -int icalerror_supress(const char* error); -void icalerror_restore(const char* error, int es); -char* icalerror_perror(); -void icalerror_clear_errno(void); - -const char* icalproperty_kind_to_string(int kind); -int icalproperty_string_to_kind(const char* string); -int icalproperty_kind_to_value_kind(int kind); - -const char* icalvalue_kind_to_string(int kind); -int icalvalue_string_to_kind(const char* str); - -const char* icalparameter_kind_to_string(int kind); -int icalparameter_string_to_kind(const char* string); - -const char* icalenum_component_kind_to_string(int kind); -int icalenum_string_to_component_kind(const char* string); - -int* icallangbind_new_array(int size); -void icallangbind_free_array(int* array); -int icallangbind_access_array(int* array, int index); - - - -int icalrecur_expand_recurrence(char* rule, int start, - int count, int* array); - - -/* Iterate through properties and components using strings for the kind */ -icalproperty* icallangbind_get_first_property(icalcomponent *c, - const char* prop); - -icalproperty* icallangbind_get_next_property(icalcomponent *c, - const char* prop); - -icalcomponent* icallangbind_get_first_component(icalcomponent *c, - const char* comp); - -icalcomponent* icallangbind_get_next_component(icalcomponent *c, - const char* comp); - - -/* Return a string that can be evaluated in perl or python to - generated a hash that holds the property's name, value and - parameters. Sep is the hash seperation string, "=>" for perl and - ":" for python */ -const char* icallangbind_property_eval_string(icalproperty* prop, char* sep); - -int icallangbind_string_to_open_flag(const char* str); - -/*********************************************************************** - Time routines -***********************************************************************/ - - -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. */ - - const char* zone; /*Ptr to Olsen placename. Libical does not own mem*/ -}; - - -/* Convert seconds past UNIX epoch to a timetype*/ -struct icaltimetype icaltime_from_timet(int v, int is_date); - -/* Return the time as seconds past the UNIX epoch */ -/* Normally, this returns a time_t, but SWIG tries to turn that type - into a pointer */ -int icaltime_as_timet(struct icaltimetype); - -/* Return a string represention of the time, in RFC2445 format. The - string is owned by libical */ -char* icaltime_as_ical_string(struct icaltimetype tt); - -/* create a time from an ISO format string */ -struct icaltimetype icaltime_from_string(const char* str); - -/* 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 */ -int icaltime_utc_offset(struct icaltimetype tt, const char* tzid); - -/* convert tt, of timezone tzid, into a utc time. Does nothing if the - time is already UTC. */ -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); - -/* Return a null time, which indicates no time has been set. This time represent the beginning of the epoch */ -struct icaltimetype icaltime_null_time(void); - -/* Return true of the time is null. */ -int icaltime_is_null_time(struct icaltimetype t); - -/* Returns false if the time is clearly invalid, but is not null. This - is usually the result of creating a new time type buy not clearing - it, or setting one of the flags to an illegal value. */ -int icaltime_is_valid_time(struct icaltimetype t); - -/* Reset all of the time components to be in their normal ranges. For - instance, given a time with minutes=70, the minutes will be reduces - to 10, and the hour incremented. This allows the caller to do - arithmetic on times without worrying about overflow or - underflow. */ -struct icaltimetype icaltime_normalize(struct icaltimetype t); - -/* Return the day of the year of the given time */ -short icaltime_day_of_year(struct icaltimetype t); - -/* Create a new time, given a day of year and a year. */ -struct icaltimetype icaltime_from_day_of_year(short doy, short year); - -/* Return the day of the week of the given time. Sunday is 0 */ -short icaltime_day_of_week(struct icaltimetype t); - -/* Return the day of the year for the Sunday of the week that the - given time is within. */ -short icaltime_start_doy_of_week(struct icaltimetype t); - -/* Return a string with the time represented in the same format as ctime(). THe string is owned by libical */ -char* icaltime_as_ctime(struct icaltimetype); - -/* Return the week number for the week the given time is within */ -short icaltime_week_number(struct icaltimetype t); - -/* Return -1, 0, or 1 to indicate that ab */ -int icaltime_compare(struct icaltimetype a,struct icaltimetype b); - -/* like icaltime_compare, but only use the date parts. */ -int icaltime_compare_date_only(struct icaltimetype a, struct icaltimetype b); - -/* Return the number of days in the given month */ -short icaltime_days_in_month(short month,short year); - - -/*********************************************************************** - Duration Routines -***********************************************************************/ - - -struct icaldurationtype -{ - int is_neg; - unsigned int days; - unsigned int weeks; - unsigned int hours; - unsigned int minutes; - unsigned int seconds; -}; - -struct icaldurationtype icaldurationtype_from_int(int t); -struct icaldurationtype icaldurationtype_from_string(const char*); -int icaldurationtype_as_int(struct icaldurationtype duration); -char* icaldurationtype_as_ical_string(struct icaldurationtype d); -struct icaldurationtype icaldurationtype_null_duration(); -int icaldurationtype_is_null_duration(struct icaldurationtype d); - -struct icaltimetype icaltime_add(struct icaltimetype t, - struct icaldurationtype d); - -struct icaldurationtype icaltime_subtract(struct icaltimetype t1, - struct icaltimetype t2); - - -/*********************************************************************** - Period Routines -***********************************************************************/ - - -struct icalperiodtype -{ - struct icaltimetype start; - struct icaltimetype end; - struct icaldurationtype duration; -}; - -struct icalperiodtype icalperiodtype_from_string (const char* str); - -const char* icalperiodtype_as_ical_string(struct icalperiodtype p); -struct icalperiodtype icalperiodtype_null_period(); -int icalperiodtype_is_null_period(struct icalperiodtype p); -int icalperiodtype_is_valid_period(struct icalperiodtype p); - - -/*********************************************************************** - Storage Routines -***********************************************************************/ - -icalfileset* icalfileset_new(const char* path); - -/* Like _new, but takes open() flags for opening the file */ -icalfileset* icalfileset_new_open(const char* path, - int flags, int mode); - -void icalfileset_free(icalfileset* cluster); - -const char* icalfileset_path(icalfileset* cluster); - -/* Mark the cluster as changed, so it will be written to disk when it - is freed. Commit writes to disk immediately. */ -void icalfileset_mark(icalfileset* cluster); -icalerrorenum icalfileset_commit(icalfileset* cluster); - -icalerrorenum icalfileset_add_component(icalfileset* cluster, - icalcomponent* child); - -icalerrorenum icalfileset_remove_component(icalfileset* cluster, - icalcomponent* child); - -int icalfileset_count_components(icalfileset* cluster, - icalcomponent_kind kind); - -/* Restrict the component returned by icalfileset_first, _next to those - that pass the gauge. _clear removes the gauge */ -icalerrorenum icalfileset_select(icalfileset* store, icalgauge* gauge); -void icalfileset_clear(icalfileset* store); - -/* Get and search for a component by uid */ -icalcomponent* icalfileset_fetch(icalfileset* cluster, const char* uid); -int icalfileset_has_uid(icalfileset* cluster, const char* uid); -icalcomponent* icalfileset_fetch_match(icalfileset* set, icalcomponent *c); - - -/* Modify components according to the MODIFY method of CAP. Works on - the currently selected components. */ -icalerrorenum icalfileset_modify(icalfileset* store, icalcomponent *oldcomp, - icalcomponent *newcomp); - -/* Iterate through components. If a guage has been defined, these - will skip over components that do not pass the gauge */ - -icalcomponent* icalfileset_get_current_component (icalfileset* cluster); -icalcomponent* icalfileset_get_first_component(icalfileset* cluster); -icalcomponent* icalfileset_get_next_component(icalfileset* cluster); -/* Return a reference to the internal component. You probably should - not be using this. */ - -icalcomponent* icalfileset_get_component(icalfileset* cluster); diff --git a/other-licenses/libical/src/python/Makefile.am b/other-licenses/libical/src/python/Makefile.am index a464e1acd69..e69de29bb2d 100644 --- a/other-licenses/libical/src/python/Makefile.am +++ b/other-licenses/libical/src/python/Makefile.am @@ -1,43 +0,0 @@ - -lib_LTLIBRARIES = libLibicalWrap.la - -libLibicalWrap_la_SOURCES = LibicalWrap.c - -INCLUDES = \ - -I$(top_builddir) \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - -I$(top_srcdir)/src/libical \ - -I$(srcdir)/libical \ - -I$(top_srcdir)/src/libicalss \ - -I$(srcdir)/libicalss \ - $(PY_CFLAGS) - -LDADD = ../libical/libical.la ../libicalss/libicalss.la - -all: LibicalWrap.so - -LibicalWrap.c: LibicalWrap.i - swig -python -o LibicalWrap.c LibicalWrap.i - -# This part should be done with libtool, but I don't know how to do -# it. Libtool needs to generate a shared library in this directory -# regardless of the value of AM_DISABLE_SHARED -LibicalWrap.so: LibicalWrap.c - ld -shared -o LibicalWrap.so LibicalWrap.o ../libical/.libs/libical.a ../libicalss/.libs/libicalss.a - -CLEANFILES = LibicalWrap.c LibicalWrap_wrap.doc Libical.pyc LibicalWrap.so - -EXTRA_DIST = \ -Libical.py \ -LibicalWrap.i \ -python-binding.txt \ -test.py \ -Collection.py \ -Component.py \ -DerivedProperties.py \ -Property.py \ -Store.py \ -ChangeLog - - diff --git a/other-licenses/libical/src/python/Makefile.in b/other-licenses/libical/src/python/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/python/Property.py b/other-licenses/libical/src/python/Property.py index b172da4e66f..950c978e72a 100644 --- a/other-licenses/libical/src/python/Property.py +++ b/other-licenses/libical/src/python/Property.py @@ -7,7 +7,7 @@ # DESCRIPTION: # # -# $Id: Property.py,v 1.1 2001-11-15 19:27:43 mikep%oeone.com Exp $ +# $Id: Property.py,v 1.2 2001-12-21 18:56:52 mikep%oeone.com Exp $ # $Locker: $ # # (C) COPYRIGHT 2001, Eric Busboom @@ -26,10 +26,10 @@ #====================================================================== from LibicalWrap import * -from types import * import regsub import base64 from string import index, upper +from types import StringType #def icalerror_supress(arg): # pass @@ -41,6 +41,19 @@ def error_type(): error = icalerror_perror() return error[:index(error,':')] +def test_enum(prop,enum): + + kind = icalproperty_string_to_kind(prop) + e = icalproperty_string_to_enum(enum) + + t = icalproperty_enum_belongs_to_property(kind,e) + + if t == 1: + return 1 + + return None + + class Property: """ Represent any iCalendar Property. @@ -96,7 +109,7 @@ class Property: def name(self,v=None): """ Return the name of the property """ str = icalproperty_as_ical_string(self._ref) - + idx = index(str, '\n') return str[:idx] @@ -129,6 +142,7 @@ class Property: vt = kind elif self.__getitem__('VALUE'): vt = self.__getitem__('VALUE') + print "###########", self else: vt = 'NO' # Use the kind of the existing value @@ -136,6 +150,7 @@ class Property: icalerror_clear_errno() #e1=icalerror_supress("MALFORMEDDATA") + icalproperty_set_value_from_string(self._ref,v,vt) #icalerror_restore("MALFORMEDDATA",e1) @@ -143,7 +158,6 @@ class Property: raise Property.UpdateFailedError(error_type()) s = icalproperty_get_value_as_string(self._ref) - assert(s == v) return icalproperty_get_value_as_string(self._ref) @@ -163,7 +177,7 @@ class Property: def as_ical_string(self): - + "Return the property in iCalendar text format." return icalproperty_as_ical_string(self._ref) def __getitem__(self,key): @@ -171,7 +185,7 @@ class Property: key = upper(key) str = icalproperty_get_parameter_as_string(self._ref,key) - + if(str == 'NULL'): return None return str @@ -196,599 +210,6 @@ class Property: return cmp(s_str,o_str) -class Time(Property): - """ Represent iCalendar DATE, TIME and DATE-TIME """ - def __init__(self, arg, name="DTSTART"): - """ - Create a new Time from a string or number of seconds past the - POSIX epoch - - Time("19970325T123000Z") Construct from an iCalendar string - Time(8349873494) Construct from seconds past POSIX epoch - - """ - e1=icalerror_supress("MALFORMEDDATA") - e2=icalerror_supress("BADARG") - - if isinstance(arg, DictType): - # Dictionary -- used for creating from Component - self.tt = icaltime_from_string(arg['value']) - Property.__init__(self, ref=arg['ref']) - else: - if isinstance(arg, StringType): - # Create from an iCal string - self.tt = icaltime_from_string(arg) - elif isinstance(arg, IntType) or \ - isinstance(arg, FloatType): - # Create from seconds past the POSIX epoch - self.tt = icaltime_from_timet(int(arg),0) - elif isinstance(arg, Time): - # Copy an instance - self.tt = arg.tt - else: - self.tt = icaltime_null_time() - - Property.__init__(self,type=name) - - icalerror_restore("MALFORMEDDATA",e1) - icalerror_restore("BADARG",e2) - - if icaltime_is_null_time(self.tt): - raise Property.ConstructorFailedError("Failed to construct a Time") - - try: - self._update_value() - except Property.UpdateFailedError: - raise Property.ConstructorFailedError("Failed to construct a Time") - - def _update_value(self): - self.tt = icaltime_normalize(self.tt) - self.value(icaltime_as_ical_string(self.tt),"DATE-TIME") - - def valid(self): - " Return true if this is a valid time " - return not icaltime_is_null_time(self.tt) - - def utc_seconds(self,v=None): - """ Return or set time in seconds past POSIX epoch""" - if (v!=None): - self.tt = icaltime_from_timet(v,0) - self._update_value() - - return icaltime_as_timet(self.tt) - - def is_utc(self,v=None): - """ Return or set boolean indicating if time is in UTC """ - if(v != None): - icaltimetype_is_utc_set(self.tt,v) - self._update_value() - return icaltimetype_is_utc_get(self.tt) - - def is_date(self,v=None): - """ Return or set boolean indicating if time is actually a date """ - if(v != None): - icaltimetype_is_date_set(self.tt,v) - self._update_value() - return icaltimetype_is_date_get(self.tt) - - def timezone(self,v=None): - """ Return or set the timezone string for this time """ - - if (v != None): - assert(isinstance(v,StringType) ) - self['TZID'] = v - return self['TZID'] - - def second(self,v=None): - """ Get or set the seconds component of this time """ - if(v != None): - icaltimetype_second_set(self.tt,v) - self._update_value() - return icaltimetype_second_get(self.tt) - - def minute(self,v=None): - """ Get or set the minute component of this time """ - if(v != None): - icaltimetype_minute_set(self.tt,v) - self._update_value() - return icaltimetype_minute_get(self.tt) - - def hour(self,v=None): - """ Get or set the hour component of this time """ - if(v != None): - icaltimetype_hour_set(self.tt,v) - self._update_value() - return icaltimetype_hour_get(self.tt) - - def day(self,v=None): - """ Get or set the month day component of this time """ - if(v != None): - icaltimetype_day_set(self.tt,v) - self._update_value() - return icaltimetype_day_get(self.tt) - - def month(self,v=None): - """ Get or set the month component of this time. January is month 1 """ - if(v != None): - icaltimetype_month_set(self.tt,v) - self._update_value() - return icaltimetype_month_get(self.tt) - - def year(self,v=None): - """ Get or set the year component of this time """ - if(v != None): - icaltimetype_year_set(self.tt,v) - self._update_value() - - return icaltimetype_year_get(self.tt) - - - - def __add__(self,o): - - other = Duration(o,"DURATION") - - if not other.valid(): - return Duration(0,"DURATION") - - seconds = self.utc_seconds() + other.seconds() - - new = Time(seconds,self.name()) - new.timezone(self.timezone()) - new.is_utc(self.is_utc()) - - return new - - def __radd_(self,o): - return self.__add__(o) - - - def __sub__(self,o): - - - if isinstance(o,Time): - # Subtract a time from this time and return a duration - seconds = self.utc_seconds() - other.utc_seconds() - return Duration(seconds) - elif isinstance(o,Duration): - # Subtract a duration from this time and return a time - other = Duration(o) - if(not other.valid()): - return Time() - - seconds = self.utc_seconds() - other.seconds() - return Time(seconds) - else: - raise TypeError, "subtraction with Time reqires Time or Duration" - -class Duration(Property): - """ - Represent a length of time, like 3 minutes, or 6 days, 20 seconds. - - - """ - - def __init__(self, arg, name="DURATION"): - """ - Create a new duration from an RFC2445 string or number of seconds. - Construct the duration from an iCalendar string or a number of seconds. - - Duration("P3DT2H34M45S") Construct from an iCalendar string - Duration(3660) Construct from seconds - """ - - self.dur = None - - e=icalerror_supress("MALFORMEDDATA") - - if isinstance(arg, DictType): - - self.dur = icaldurationtype_from_string(arg['value']) - Property.__init__(self,ref=arg['ref']) - else: - if isinstance(arg, StringType): - self.dur = icaldurationtype_from_string(arg) - elif isinstance(arg, IntType): - self.dur = icaldurationtype_from_int(arg) - elif isinstance(arg,Duration): - self.dur = arg.dur - else: - self.dur = icaldurationtype_null_duration() - - Property.__init__(self,type=name) - - icalerror_restore("MALFORMEDDATA",e) - - if self.dur == None or icaldurationtype_is_null_duration(self.dur): - raise Property.ConstructorFailedError("Failed to construct Duration from " +str(arg)) - - try: - self._update_value() - except Property.UpdateFailedError: - raise Property.ConstructorFailedError("Failed to construct Duration from " + str(arg)) - - def _update_value(self): - - self.value(icaldurationtype_as_ical_string(self.dur),"DURATION") - - def valid(self): - "Return true if this is a valid duration" - - return not icaldurationtype_is_null_duration(self.dur) - - def seconds(self,v=None): - """Return or set duration in seconds""" - if(v != None): - self.dur = icaldurationtype_from_int(v); - self.dict['value'] = icaltimedurationtype_as_ical_string(self.dur) - return icaldurationtype_as_int(self.dur) - - -class Period(Property): - """Represent a span of time""" - def __init__(self,arg,name='FREEBUSY'): - """ """ - - Property.__init__(self, type = name) - - self.pt=None - - #icalerror_clear_errno() - e1=icalerror_supress("MALFORMEDDATA") - e2=icalerror_supress("BADARG") - - if isinstance(arg, DictType): - - - es=icalerror_supress("MALFORMEDDATA") - self.pt = icalperiodtype_from_string(arg['value']) - icalerror_restore("MALFORMEDDATA",es) - - Property.__init__(self, ref=arg['ref']) - else: - if isinstance(arg, StringType): - - self.pt = icalperiodtype_from_string(arg) - - else: - self.pt = icalperiodtype_null_period() - - Property.__init__(self,type=name) - - icalerror_restore("MALFORMEDDATA",e1) - icalerror_restore("BADARG",e2) - - - if self.pt == None or icalperiodtype_is_null_period(self.pt): - raise Property.ConstructorFailedError("Failed to construct Period") - - - try: - self._update_value() - except Property.UpdateFailedError: - raise Property.ConstructorFailedError("Failed to construct Period") - - def _end_is_duration(self): - dur = icalperiodtype_duration_get(self.pt) - if not icaldurationtype_is_null_duration(dur): - return 1 - return 0 - - def _end_is_time(self): - end = icalperiodtype_end_get(self.pt) - if not icaltime_is_null_time(end): - return 1 - return 0 - - def _update_value(self): - - self.value(icalperiodtype_as_ical_string(self.pt),"PERIOD") - - - def valid(self): - "Return true if this is a valid period" - - return not icalperiodtype_is_null_period(self.dur) - - def start(self,v=None): - """ - Return or set start time of the period. The start time may be - expressed as an RFC2445 format string or an instance of Time. - The return value is an instance of Time - """ - - if(v != None): - if isinstance(t,Time): - t = v - elif isinstance(t,StringType) or isinstance(t,IntType): - t = Time(v,"DTSTART") - else: - raise TypeError - - icalperiodtype_start_set(self.pt,t.tt) - - self._update_value() - - - return Time(icaltime_as_timet(icalperiodtype_start_get(self.pt)), - "DTSTART") - - def end(self,v=None): - """ - Return or set end time of the period. The end time may be - expressed as an RFC2445 format string or an instance of Time. - The return value is an instance of Time. - - If the Period has a duration set, but not an end time, this - method will caluculate the end time from the duration. """ - - if(v != None): - - if isinstance(t,Time): - t = v - elif isinstance(t,StringType) or isinstance(t,IntType): - t = Time(v) - else: - raise TypeError - - if(self._end_is_duration()): - start = icaltime_as_timet(icalperiodtype_start_get(self.pt)) - dur = t.utc_seconds()-start; - icalperiodtype_duration_set(self.pt, - icaldurationtype_from_int(dur)) - else: - icalperiodtype_end_set(self.pt,t.tt) - - self._update_value() - - if(self._end_is_time()): - rt = Time(icaltime_as_timet(icalperiodtype_end_get(self.pt)), - 'DTEND') - rt.timezone(self.timezone()) - return rt - elif(self._end_is_duration()): - start = icaltime_as_timet(icalperiodtype_start_get(self.pt)) - dur = icaldurationtype_as_int(icalperiodtype_duration_get(self.pt)) - rt = Time(start+dur,'DTEND') - rt.timezone(self.timezone()) - return rt - else: - return Time({},'DTEND') - - - - def duration(self,v=None): - """ - Return or set the duration of the period. The duration may be - expressed as an RFC2445 format string or an instance of Duration. - The return value is an instance of Duration. - - If the period has an end time set, but not a duration, this - method will calculate the duration from the end time. """ - - if(v != None): - - if isinstance(t,Duration): - d = v - elif isinstance(t,StringType) or isinstance(t,IntType): - d = Duration(v) - else: - raise TypeError - - if(self._end_is_time()): - start = icaltime_as_timet(icalperiodtype_start_get(self.pt)) - end = start + d.seconds() - - icalperiodtype_end_set(self.pt,icaltime_from_timet(end,0)) - else: - icalperiodtype_duration_set(self.pt,d.dur) - - if(self._end_is_time()): - start =icaltime_as_timet(icalperiodtype_start_get(self.pt)) - end = icaltime_as_timet(icalperiodtype_end_get(self.pt)) - - print "End is time " + str(end-start) - - return Duration(end-start,"DURATION") - - elif(self._end_is_duration()): - dur = icaldurationtype_as_int( - icalperiodtype_duration_get(self.pt)) - - return Duration(dur,"DURATION") - else: - - - return Duration(0,"DURATION") - - - def timezone(self,v=None): - """ Return or set the timezone string for this time """ - if (v != None): - self['TZID'] = v - return self['TZID'] - -class Attendee(Property): - """Class for Attendee properties. - - Usage: - Attendee([dict]) - Attendee([address]) - - Where: - dict is an optional dictionary with keys of - 'value': CAL-ADDRESS string and any parameter: parameter_value entries. - 'name' and 'value_type' entries in dict are ignored and automatically set - with the appropriate values. - address is the CAL-ADDRESS (string) of the Attendee - """ - - def __init__(self, arg={}): - - assert(isinstance(arg,DictType)) - - ref = None - - if arg!={}: - ref = arg['ref'] - - Property.__init__(self,type='ATTENDEE',ref=ref) - - def _doParam(self, parameter, v): - if v!=None: - self[parameter]=v - return self[parameter] - - # Methods for accessing enumerated parameters - def cn(self, v=None): self._doParam('CN', v) - def cutype(self, v=None): self._doParam('CUTYPE', v) - def dir(self, v=None): self._doParam('DIR', v) - def delegated_from(self, v=None): self._doParam('DELEGATED-FROM', v) - def delegated_to(self, v=None): self._doParam('DELEGATED-TO', v) - def language(self, v=None): self._doParam('LANGUAGE', v) - def member(self, v=None): self._doParam('MEMBER', v) - def partstat(self, v=None): self._doParam('PARTSTAT', v) - def role(self, v=None): self._doParam('ROLE', v) - def rsvp(self, v=None): self._doParam('RSVP', v) - def sent_by(self, v=None): self._doParam('SENT-BY', v) - - -class Organizer(Property): - """Class for Organizer property. - """ - - def __init__(self, arg={}): - - assert(isinstance(arg, DictType)) - - ref = None - if arg != {}: - ref = arg['ref'] - Property.__init__(self, type='ORGANIZER', ref=ref) - -## param_t = ( 'CN', 'DIR', 'SENT-BY', 'LANGUAGE' ) -## for param in param_t: -## self[param] = None -## if value != None: -## self.value(value) - - - def _doParam(self, parameter, v): - if v!=None: - self[parameter]=v - return self[parameter] - - def name(self): - "Return the name of the property." - return Property.name(self) - - def value_type(self): - "Return the value type of the property." - return self._desc['value_type'] - - # Methods for accessing enumerated parameters - def cn(self, v=None): self._doParam('CN', v) - def dir(self, v=None): self._doParam('DIR', v) - def language(self, v=None): self._doParam('LANGUAGE', v) - def sent_by(self, v=None): self._doParam('SENT-BY', v) - -class Recurrence_Id(Time): - """Class for RECURRENCE-ID property. - - Usage: - Reccurence_Id(dict) # A normal property dictionary - Reccurence_Id("19960401") # An iCalendar string - Reccurence_Id(8349873494) # Seconds from epoch - - If the 'dict' constructor is used, 'name' and 'value_type' - entries in dict are ignored and automatically set with the appropriate - values. - """ - - def __init__(self, dict={}): - Time.__init__(self, dict) - Property.name(self, 'RECURRENCE-ID') - - def name(self): - return Property.name(self) - - def _doParam(self, parameter, v): - if v!=None: - self[parameter]=v - return self[parameter] - - # Enumerated parameters - def value_parameter(self, v=None): - """Sets or gets the VALUE parameter value. - - The value passed should be either "DATE-TIME" or "DATE". Setting this - parameter has no impact on the property's value_type. Doing something - like: - - rid=Recurrence_Id("19960401") # Sets value & makes value_type="DATE" - rid.value_parameter("DATE-TIME") # Sets the parameter VALUE=DATE-TIME - - Would be allowed (even though it is wrong), so pay attention. - Verifying the component will reveal the error. - """ - if v!=None and v!="DATE" and v!="DATE-TIME": - raise ValueError, "%s is an invalid VALUE parameter value" % str(v) - self._doParam("VALUE", v) - - def tzid(self, v=None): - "Sets or gets the TZID parameter value." - self._doParam("TZID", v) - - def range_parameter(self, v=None): # 'range' is a builtin function - "Sets or gets the RANGE parameter value." - if v!=None and v!="THISANDPRIOR" and v!= "THISANDFUTURE": - raise ValueError, "%s is an invalid RANGE parameter value" % str(v) - self._doParam("RANGE", v) - -class Attach(Property): - """A class representing an ATTACH property. - - Usage: - Attach(uriString [, parameter_dict]) - Attach(fileObj [, parameter_dict]) - """ - - def __init__(self, value=None, parameter_dict={}): - Property.__init__(self, parameter_dict) - Property.name(self, 'ATTACH') - self.value(value) - - def value(self, v=None): - "Returns or sets the value of the property." - if v != None: - if isinstance(v, StringType): # Is a URI - self._desc['value']=v - Property.value_type(self, 'URI') - else: - try: - tempStr = v.read() - except: - raise TypeError,"%s must be a URL string or file-ish type"\ - % str(v) - self._desc['value'] = base64.encodestring(tempStr) - Property.value_type(self, 'BINARY') - else: - return self._desc['value'] - - def name(self): - "Returns the name of the property." - return Property.name(self) - - def value_type(self): - return Property.value_type(self) - - def fmttype(self, v=None): - "Gets or sets the FMTYPE parameter." - if v!= None: - self['FMTTYPE']=v - else: - return self['FMTTYPE'] - class RecurrenceSet: """ Represents a set of event occurrences. This diff --git a/other-licenses/libical/src/python/test.py b/other-licenses/libical/src/python/test.py index 99c4899c935..96af6a552f0 100644 --- a/other-licenses/libical/src/python/test.py +++ b/other-licenses/libical/src/python/test.py @@ -7,7 +7,7 @@ # DESCRIPTION: # # -# $Id: test.py,v 1.1 2001-11-15 19:27:43 mikep%oeone.com Exp $ +# $Id: test.py,v 1.2 2001-12-21 18:56:52 mikep%oeone.com Exp $ # $Locker: $ # # (C) COPYRIGHT 2001, Eric Busboom @@ -25,6 +25,7 @@ # the License at http://www.mozilla.org/MPL/ #====================================================================== +import LibicalWrap from Libical import * def error_type(): @@ -32,6 +33,10 @@ def error_type(): return error[:index(error,':')] comp_str = """ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//ABC Corporation//NONSGML My Product//EN +METHOD:REQUEST BEGIN:VEVENT ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:MAILTO:employee-A@host.com COMMENT: When in the course of writting comments and nonsense text\, it @@ -43,13 +48,15 @@ DURATION:P3DT4H25M FREEBUSY:19970101T120000/19970101T120000 FREEBUSY:19970101T120000/PT3H FREEBUSY:19970101T120000/PT3H -END:VEVENT""" +END:VEVENT +END:VCALENDAR""" def test_property(): print "--------------------------- Test Property ----------------------" - + + liw = LibicalWrap icalprop = liw.icalproperty_new_from_string("ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:MAILTO:employee-A@host.com") @@ -65,6 +72,10 @@ def test_property(): print p['ROLE'] + p['ROLE'] = 'GROFROMBLATZ' + + print p['ROLE'] + print p.value() p.value("mailto:Bob@bob.com") print p.value() @@ -79,6 +90,13 @@ def test_property(): else: assert(0) + + assert(test_enum('METHOD','PUBLISH')) + assert(not test_enum('METHOD','FOO')) + + assert(test_enum('ACTION','AUDIO')) + assert(not test_enum('ACTION','OPAQUE')) + def test_time(): "Test routine" @@ -221,14 +239,25 @@ def test_component(): print "------------------- Test Component ----------------------" - c = Component(comp_str); - + c = NewComponent(comp_str); + props = c.properties() + for p in props: + print p.as_ical_string() + + inner = c.components()[0] + + print inner + print type(inner) + + + props = inner.properties() + for p in props: print p.as_ical_string() - dtstart = c.properties('DTSTART')[0] + dtstart = inner.properties('DTSTART')[0] print dtstart @@ -240,21 +269,21 @@ def test_component(): print "\n New hour: ", dtstart.hour() assert(dtstart.hour() == 17) - attendee = c.properties('ATTENDEE')[0] + attendee = inner.properties('ATTENDEE')[0] print attendee t = Time("20011111T123030") t.name('DTEND') - c.add_property(t) + inner.add_property(t) print c - dtstart1 = c.properties('DTSTART')[0] - dtstart2 = c.properties('DTSTART')[0] - dtstart3 = c.property('DTSTART') + dtstart1 = inner.properties('DTSTART')[0] + dtstart2 = inner.properties('DTSTART')[0] + dtstart3 = inner.property('DTSTART') assert(dtstart1 is dtstart2) assert(dtstart1 == dtstart2) @@ -266,53 +295,60 @@ def test_component(): p = Property(type="SUMMARY"); p.value("This is a summary") - c.properties().append(p) + inner.properties().append(p) - print c.as_ical_string() + print inner.as_ical_string() - p = c.properties("SUMMARY")[0] + p = inner.properties("SUMMARY")[0] assert(p!=None); print str(p) assert(str(p) == "SUMMARY:This is a summary") - c.properties()[:] = [p] + inner.properties()[:] = [p] - print c.as_ical_string() + print inner.as_ical_string() + + def test_event(): print "------------ Event Class ----------------------" + event = Event() + + event.method('REQUEST') + event.version('2.0') + event.created("20010313T123000Z") - #print "created =", event.created() - assert (event.created() == "20010313T123000Z") + print "created =", event.created() + assert (event.created() == Time("20010313T123000Z")) event.organizer("MAILTO:j_doe@nowhere.com") - org = event.properties('ORGANIZER')[0] - #print org.cn() + org = event.organizer() + print org.cn() org.cn('Jane Doe') assert (isinstance(org, Organizer)) - #print "organizer =", event.organizer() - assert (event.organizer() == "MAILTO:j_doe@nowhere.com") + print "organizer =", event.organizer() + assert (event.organizer().value() == "MAILTO:j_doe@nowhere.com") event.dtstart("20010401T183000Z") - #print "dtstart =", event.dtstart() - assert (event.dtstart()=="20010401T183000Z") + print "dtstart =", event.dtstart() + assert (event.dtstart()== Time("20010401T183000Z")) dtend = Time('20010401T190000Z', 'DTEND') event.dtend(dtend) - assert (event.dtend()==dtend.value()) - assert (event.dtend() == '20010401T190000Z') + assert (event.dtend() ==dtend ) + assert (event.dtend() == Time('20010401T190000Z')) att = Attendee() att.value('jsmith@nothere.com') event.attendees(('ef_hutton@listenup.com', att)) - event.description("A short description. Longer ones break things.") + event.description("A short description. Longer ones break things. Really. What does it break. The code is supposed to handle realy long lines, longer, in fact, than any sane person would create except by writting a random text generator or by excerpting text from a less sane person. Actually, it did \"break\" and I had to remove an \n assert to fix it.") event.status('TeNtAtIvE') print event.as_ical_string() - + def test_derivedprop(): diff --git a/other-licenses/libical/src/test/Makefile.am b/other-licenses/libical/src/test/Makefile.am index d4fa33c0404..e69de29bb2d 100644 --- a/other-licenses/libical/src/test/Makefile.am +++ b/other-licenses/libical/src/test/Makefile.am @@ -1,25 +0,0 @@ - -noinst_PROGRAMS = copycluster regression parser storage stow recur testmime testvcal process testclassify - -LDADD = ../libicalss/.libs/libicalss.a ../libicalvcal/.libs/libicalvcal.a ../libical/.libs/libical.a - -INCLUDES = \ - -I. \ - -I../libicalvcal \ - -I$(srcdir)/../libicalvcal \ - -I$(srcdir) \ - -I../libical \ - -I$(srcdir)/../libical \ - -I../libicalss \ - -I$(srcdir)/../libicalss - -copycluster_SOURCES = copycluster.c -regression_SOURCES = regression.c -parser_SOURCES = icaltestparser.c -storage_SOURCES = storage.c -stow_SOURCES = stow.c -testvcal_SOURCES = testvcal.c -recur_SOURCES = recur.c -testmime_SOURCES = testmime.c -process_SOURCES = process.c -testclassify_SOURCES = testclassify.c diff --git a/other-licenses/libical/src/test/Makefile.in b/other-licenses/libical/src/test/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/test/copycluster.c b/other-licenses/libical/src/test/copycluster.c index 3c8b03d1b90..f3925717b46 100644 --- a/other-licenses/libical/src/test/copycluster.c +++ b/other-licenses/libical/src/test/copycluster.c @@ -3,7 +3,7 @@ FILE: copycluster.c CREATOR: eric 15 January 2000 - $Id: copycluster.c,v 1.1 2001-11-15 19:27:47 mikep%oeone.com Exp $ + $Id: copycluster.c,v 1.2 2001-12-21 18:56:55 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000 Eric Busboom @@ -63,23 +63,26 @@ int main(int c, char *argv[]){ } - icalerror_set_error_state(ICAL_PARSE_ERROR, ICAL_ERROR_NONFATAL); - + /*icalerror_set_error_state(ICAL_PARSE_ERROR, ICAL_ERROR_NONFATAL);*/ signal(SIGALRM,sig_alrm); - alarm(0); + alarm(10); clusterin = icalfileset_new(argv[1]); alarm(0); if (clusterin == 0){ - printf("Could not open input cluster \"%s\"",argv[1]); - + printf("Could not open input cluster \"%s\"\n",argv[1]); + if(icalerrno!= ICAL_NO_ERROR){ + printf("Error: %s\n",icalerror_strerror(icalerrno)); + } exit(1); } if (!tostdout){ + alarm(10); clusterout = icalfileset_new(argv[2]); + alarm(0); if (clusterout == 0){ printf("Could not open output cluster \"%s\"\n",argv[2]); exit(1); diff --git a/other-licenses/libical/src/test/makefile.win b/other-licenses/libical/src/test/makefile.win deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/test/process.c b/other-licenses/libical/src/test/process.c index fafddbd4d5c..97be7f51e01 100644 --- a/other-licenses/libical/src/test/process.c +++ b/other-licenses/libical/src/test/process.c @@ -3,7 +3,7 @@ FILE: process.c CREATOR: eric 11 February 2000 - $Id: process.c,v 1.1 2001-11-15 19:27:48 mikep%oeone.com Exp $ + $Id: process.c,v 1.2 2001-12-21 18:56:56 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000 Eric Busboom @@ -28,49 +28,6 @@ #include /* For strerror */ #include /* for free */ -struct class_map { - ical_class class; - char *str; -} class_map[] = { - {ICAL_NO_CLASS,"No class"}, - {ICAL_PUBLISH_NEW_CLASS,"New Publish"}, - {ICAL_PUBLISH_UPDATE_CLASS,"New Publish"}, - {ICAL_REQUEST_NEW_CLASS,"New request"}, - {ICAL_REQUEST_UPDATE_CLASS,"Update"}, - {ICAL_REQUEST_RESCHEDULE_CLASS,"Reschedule"}, - {ICAL_REQUEST_DELEGATE_CLASS,"Delegate"}, - {ICAL_REQUEST_NEW_ORGANIZER_CLASS,"New Organizer"}, - {ICAL_REQUEST_FORWARD_CLASS,"Forward"}, - {ICAL_REQUEST_STATUS_CLASS,"Status request"}, - {ICAL_REPLY_ACCEPT_CLASS,"Accept reply"}, - {ICAL_REPLY_DECLINE_CLASS,"Decline reply"}, - {ICAL_REPLY_CRASHER_ACCEPT_CLASS,"Crasher's accept reply"}, - {ICAL_REPLY_CRASHER_DECLINE_CLASS,"Crasher's decline reply"}, - {ICAL_ADD_INSTANCE_CLASS,"Add instance"}, - {ICAL_CANCEL_EVENT_CLASS,"Cancel event"}, - {ICAL_CANCEL_INSTANCE_CLASS,"Cancel instance"}, - {ICAL_CANCEL_ALL_CLASS,"Cancel all instances"}, - {ICAL_REFRESH_CLASS,"Refresh"}, - {ICAL_COUNTER_CLASS,"Counter"}, - {ICAL_DECLINECOUNTER_CLASS,"Decline counter"}, - {ICAL_MALFORMED_CLASS,"Malformed"}, - {ICAL_OBSOLETE_CLASS,"Obsolete"}, - {ICAL_MISSEQUENCED_CLASS,"Missequenced"}, - {ICAL_UNKNOWN_CLASS,"Unknown"} -}; - -char* find_class_string(ical_class class) -{ - int i; - - for (i = 0;class_map[i].class != ICAL_UNKNOWN_CLASS;i++){ - if (class_map[i].class == class){ - return class_map[i].str; - } - } - - return "Unknown"; -} void send_message(icalcomponent *reply,const char* this_user) { @@ -103,7 +60,7 @@ int main(int argc, char* argv[]) /* Foreach incoming message */ for(c=icalset_get_first_component(f);c!=0;c = next_c){ - ical_class class; + icalproperty_xlicclass class; icalcomponent *match; icalcomponent *inner; icalcomponent *reply = 0; @@ -130,7 +87,7 @@ int main(int argc, char* argv[]) class = icalclassify(c,match,this_user); - class_string = find_class_string(class); + class_string = icalproperty_enum_to_string(class); /* Print out the notes associated with the incoming component and the matched component in the */ @@ -171,7 +128,7 @@ int main(int argc, char* argv[]) /* Main processing structure */ switch (class){ - case ICAL_NO_CLASS: { + case ICAL_XLICCLASS_NONE: { char temp[1024]; /* Huh? Return an error to sender */ icalrestriction_check(c); @@ -191,15 +148,15 @@ int main(int argc, char* argv[]) break; } - case ICAL_PUBLISH_NEW_CLASS: { + case ICAL_XLICCLASS_PUBLISHNEW: { /* Don't accept published events from anyone but - self. If self, fall through to ICAL_REQUEST_NEW_CLASS */ + self. If self, fall through to ICAL_XLICCLASS_REQUESTNEW */ } - case ICAL_REQUEST_NEW_CLASS: { + case ICAL_XLICCLASS_REQUESTNEW: { /* Book the new component if it does not overlap anything. If the time is busy and the start time is @@ -283,110 +240,114 @@ conflicts with this meeting. I am proposing a time that works better for me."); } break; } - case ICAL_PUBLISH_FREEBUSY_CLASS: { + case ICAL_XLICCLASS_PUBLISHFREEBUSY: { /* Store the busy time information in a file named after the sender */ break; } - case ICAL_PUBLISH_UPDATE_CLASS: { + case ICAL_XLICCLASS_PUBLISHUPDATE: { /* Only accept publish updates from self. If self, fall - throught to ICAL_REQUEST_UPDATE_CLASS */ + throught to ICAL_XLICCLASS_REQUESTUPDATE */ } - case ICAL_REQUEST_UPDATE_CLASS: { + case ICAL_XLICCLASS_REQUESTUPDATE: { /* always accept the changes */ break; } - case ICAL_REQUEST_RESCHEDULE_CLASS: { + case ICAL_XLICCLASS_REQUESTRESCHEDULE: { /* Use same rules as REQUEST_NEW */ icalcomponent *overlaps; overlaps = icalclassify_find_overlaps(cal,c); break; } - case ICAL_REQUEST_DELEGATE_CLASS: { + case ICAL_XLICCLASS_REQUESTDELEGATE: { break; } - case ICAL_REQUEST_NEW_ORGANIZER_CLASS: { + case ICAL_XLICCLASS_REQUESTNEWORGANIZER: { break; } - case ICAL_REQUEST_FORWARD_CLASS: { + case ICAL_XLICCLASS_REQUESTFORWARD: { break; } - case ICAL_REQUEST_STATUS_CLASS: { + case ICAL_XLICCLASS_REQUESTSTATUS: { break; } - case ICAL_REQUEST_FREEBUSY_CLASS: { + case ICAL_XLICCLASS_REQUESTFREEBUSY: { break; } - case ICAL_REPLY_ACCEPT_CLASS: { + case ICAL_XLICCLASS_REPLYACCEPT: { /* Change the PARTSTAT of the sender */ break; } - case ICAL_REPLY_DECLINE_CLASS: { + case ICAL_XLICCLASS_REPLYDECLINE: { /* Change the PARTSTAT of the sender */ break; } - case ICAL_REPLY_CRASHER_ACCEPT_CLASS: { + case ICAL_XLICCLASS_REPLYCRASHERACCEPT: { /* Add the crasher to the ATTENDEE list with the appropriate PARTSTAT */ break; } - case ICAL_REPLY_CRASHER_DECLINE_CLASS: { + case ICAL_XLICCLASS_REPLYCRASHERDECLINE: { /* Add the crasher to the ATTENDEE list with the appropriate PARTSTAT */ break; } - case ICAL_ADD_INSTANCE_CLASS: { + case ICAL_XLICCLASS_ADDINSTANCE: { break; } - case ICAL_CANCEL_EVENT_CLASS: { + case ICAL_XLICCLASS_CANCELEVENT: { /* Remove the component */ break; } - case ICAL_CANCEL_INSTANCE_CLASS: { + case ICAL_XLICCLASS_CANCELINSTANCE: { break; } - case ICAL_CANCEL_ALL_CLASS: { + case ICAL_XLICCLASS_CANCELALL: { /* Remove the component */ break; } - case ICAL_REFRESH_CLASS: { + case ICAL_XLICCLASS_REFRESH: { /* Resend the latest copy of the request */ break; } - case ICAL_COUNTER_CLASS: { + case ICAL_XLICCLASS_COUNTER: { break; } - case ICAL_DECLINECOUNTER_CLASS: { + case ICAL_XLICCLASS_DECLINECOUNTER: { break; } - case ICAL_MALFORMED_CLASS: { + case ICAL_XLICCLASS_MALFORMED: { /* Send back an error */ break; } - case ICAL_OBSOLETE_CLASS: { + case ICAL_XLICCLASS_OBSOLETE: { printf(" ** Got an obsolete component:\n%s", icalcomponent_as_ical_string(c)); /* Send back an error */ break; } - case ICAL_MISSEQUENCED_CLASS: { + case ICAL_XLICCLASS_MISSEQUENCED: { printf(" ** Got a missequenced component:\n%s", icalcomponent_as_ical_string(c)); /* Send back an error */ break; } - case ICAL_UNKNOWN_CLASS: { + case ICAL_XLICCLASS_UNKNOWN: { printf(" ** Don't know what to do with this component:\n%s", icalcomponent_as_ical_string(c)); /* Send back an error */ break; } + case ICAL_XLICCLASS_X: + case ICAL_XLICCLASS_REPLYDELEGATE: + default: { + } } #if(0) diff --git a/other-licenses/libical/src/test/recur.c b/other-licenses/libical/src/test/recur.c index f4d9a386477..78aa2f8b7c2 100644 --- a/other-licenses/libical/src/test/recur.c +++ b/other-licenses/libical/src/test/recur.c @@ -31,11 +31,18 @@ #include /* for malloc */ #include /* for printf */ #include /* for time() */ -#include /* for signal */ -#include /* for alarm */ +#include /* for signal */ +#ifndef WIN32 +#include /* for alarm */ +#endif #include "icalmemory.h" #include "icaldirset.h" #include "icalfileset.h" + +#ifdef WIN32 +#define snprintf _snprintf +#define strcasecmp stricmp +#endif static void sig_alrm(int i){ fprintf(stderr,"Could not get lock on file\n"); @@ -54,9 +61,10 @@ int main(int argc, char *argv[]) char* file; icalerror_set_error_state(ICAL_PARSE_ERROR, ICAL_ERROR_NONFATAL); - + +#ifndef WIN32 signal(SIGALRM,sig_alrm); - +#endif if (argc <= 1){ file = "../../test-data/recur.txt"; @@ -66,11 +74,15 @@ int main(int argc, char *argv[]) fprintf(stderr,"usage: recur [input file]\n"); exit(1); } - - alarm(300); /* to get file lock */ + +#ifndef WIN32 + alarm(300); /* to get file lock */ +#endif cin = icalfileset_new(file); +#ifndef WIN32 alarm(0); - +#endif + if(cin == 0){ fprintf(stderr,"recur: can't open file %s\n",file); exit(1); diff --git a/other-licenses/libical/src/test/regression.c b/other-licenses/libical/src/test/regression.c index 6b16789f6e9..7182fdb4c15 100644 --- a/other-licenses/libical/src/test/regression.c +++ b/other-licenses/libical/src/test/regression.c @@ -5,7 +5,7 @@ DESCRIPTION: - $Id: regression.c,v 1.2 2001-11-22 19:22:04 mikep%oeone.com Exp $ + $Id: regression.c,v 1.3 2001-12-21 18:56:56 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 1999 Eric Busboom @@ -44,10 +44,6 @@ #endif #include /* For wait pid */ -#ifdef WIN32 -#define snprintf _snprintf -#endif - /* For GNU libc, strcmp appears to be a macro, so using strcmp in assert results in incomprehansible assertion messages. This eliminates the problem */ @@ -63,7 +59,7 @@ char str[] = "BEGIN:VCALENDAR\ PRODID:\"-//RDU Software//NONSGML HandCal//EN\"\ VERSION:2.0\ BEGIN:VTIMEZONE\ -TZID:US-Eastern\ +TZID:America/New_York\ BEGIN:STANDARD\ DTSTART:19981025T020000\ RDATE:19981025T020000\ @@ -89,8 +85,8 @@ CATEGORIES:MEETING\ CLASS:PUBLIC\ CREATED:19980309T130000Z\ SUMMARY:XYZ Project Review\ -DTSTART;TZID=US-Eastern:19980312T083000\ -DTEND;TZID=US-Eastern:19980312T093000\ +DTSTART;TZID=America/New_York:19980312T083000\ +DTEND;TZID=America/New_York:19980312T093000\ LOCATION:1CP Conference Room 4350\ END:VEVENT\ BEGIN:BOOGA\ @@ -169,7 +165,7 @@ icalcomponent* create_new_component() icalcomponent_add_property( timezone, - icalproperty_new_tzid("US_Eastern") + icalproperty_new_tzid("America/New_York") ); /* Add a sub-component of the timezone */ @@ -293,7 +289,7 @@ icalcomponent* create_new_component() icalcomponent_add_property( event, - icalproperty_new_class("PUBLIC") + icalproperty_new_class(ICAL_CLASS_PRIVATE) ); icalcomponent_add_property( @@ -311,7 +307,7 @@ icalcomponent* create_new_component() icalproperty_add_parameter( property, - icalparameter_new_tzid("US-Eastern") + icalparameter_new_tzid("America/New_York") ); icalcomponent_add_property(event,property); @@ -321,7 +317,7 @@ icalcomponent* create_new_component() icalproperty_add_parameter( property, - icalparameter_new_tzid("US-Eastern") + icalparameter_new_tzid("America/New_York") ); icalcomponent_add_property(event,property); @@ -362,7 +358,7 @@ icalcomponent* create_new_component_with_va_args() icalproperty_new_prodid("-//RDU Software//NONSGML HandCal//EN"), icalcomponent_vanew( ICAL_VTIMEZONE_COMPONENT, - icalproperty_new_tzid("US_Eastern"), + icalproperty_new_tzid("America/New_York"), icalcomponent_vanew( ICAL_XDAYLIGHT_COMPONENT, icalproperty_new_dtstart(atime), @@ -401,17 +397,17 @@ icalcomponent* create_new_component_with_va_args() ), icalproperty_new_description("Project XYZ Review Meeting"), icalproperty_new_categories("MEETING"), - icalproperty_new_class("PUBLIC"), + icalproperty_new_class(ICAL_CLASS_PUBLIC), icalproperty_new_created(atime), icalproperty_new_summary("XYZ Project Review"), icalproperty_vanew_dtstart( atime, - icalparameter_new_tzid("US-Eastern"), + icalparameter_new_tzid("America/New_York"), 0 ), icalproperty_vanew_dtend( atime, - icalparameter_new_tzid("US-Eastern"), + icalparameter_new_tzid("America/New_York"), 0 ), icalproperty_new_location("1CP Conference Room 4350"), @@ -574,8 +570,7 @@ void test_values() assert(ICAL_DURATION_VALUE == icalparameter_value_to_value_kind(ICAL_VALUE_DURATION)); assert(ICAL_INTEGER_VALUE == icalparameter_value_to_value_kind(ICAL_VALUE_INTEGER)); - assert(ICAL_TIME_VALUE == - icalparameter_value_to_value_kind(ICAL_VALUE_TIME)); + assert(ICAL_URI_VALUE == icalparameter_value_to_value_kind(ICAL_VALUE_URI)); assert(ICAL_FLOAT_VALUE == @@ -593,6 +588,18 @@ void test_values() if (v!=0) icalvalue_free(v); */ + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR, ICAL_ERROR_NONFATAL); + v = icalvalue_new_from_string(ICAL_RECUR_VALUE,"D2 #0"); + assert(v == 0); + + v = icalvalue_new_from_string(ICAL_TRIGGER_VALUE,"Gonk"); + assert(v == 0); + + v = icalvalue_new_from_string(ICAL_REQUESTSTATUS_VALUE,"Gonk"); + assert(v == 0); + + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR, ICAL_ERROR_DEFAULT); + } void test_properties() @@ -669,17 +676,25 @@ void test_parameters() p = icalparameter_new_from_string("PARTSTAT=ACCEPTED"); assert(icalparameter_isa(p) == ICAL_PARTSTAT_PARAMETER); assert(icalparameter_get_partstat(p) == ICAL_PARTSTAT_ACCEPTED); + + icalparameter_free(p); p = icalparameter_new_from_string("ROLE=CHAIR"); assert(icalparameter_isa(p) == ICAL_ROLE_PARAMETER); assert(icalparameter_get_partstat(p) == ICAL_ROLE_CHAIR); + + icalparameter_free(p); p = icalparameter_new_from_string("PARTSTAT=X-FOO"); assert(icalparameter_isa(p) == ICAL_PARTSTAT_PARAMETER); assert(icalparameter_get_partstat(p) == ICAL_PARTSTAT_X); + + icalparameter_free(p); p = icalparameter_new_from_string("X-PARAM=X-FOO"); assert(icalparameter_isa(p) == ICAL_X_PARAMETER); + + icalparameter_free(p); for (i=0;enums[i] != -1; i++){ @@ -862,7 +877,9 @@ void test_memory() printf("Char-by-Char buffer: %s\n", f); icalmemory_append_char(&f, &p, &bufsize, 'j'); printf("Char-by-Char buffer: %s\n", f); - + + free(f); + for(i=0; i<100; i++){ f = icalmemory_tmp_buffer(bufsize); @@ -871,6 +888,7 @@ void test_memory() memset(f,0,bufsize); sprintf(f,"%d",i); } + } @@ -1034,31 +1052,49 @@ int test_compare() printf("%d\n",icalvalue_compare(v1,v2)); + icalvalue_free(v1); + icalvalue_free(v2); + v1 = icalvalue_new_caladdress("A"); v2 = icalvalue_new_caladdress("B"); printf("%d\n",icalvalue_compare(v1,v2)); + icalvalue_free(v1); + icalvalue_free(v2); + v1 = icalvalue_new_caladdress("B"); v2 = icalvalue_new_caladdress("A"); printf("%d\n",icalvalue_compare(v1,v2)); + icalvalue_free(v1); + icalvalue_free(v2); + v1 = icalvalue_new_integer(5); v2 = icalvalue_new_integer(5); printf("%d\n",icalvalue_compare(v1,v2)); + icalvalue_free(v1); + icalvalue_free(v2); + v1 = icalvalue_new_integer(5); v2 = icalvalue_new_integer(10); printf("%d\n",icalvalue_compare(v1,v2)); + icalvalue_free(v1); + icalvalue_free(v2); + v1 = icalvalue_new_integer(10); v2 = icalvalue_new_integer(5); printf("%d\n",icalvalue_compare(v1,v2)); + icalvalue_free(v1); + icalvalue_free(v2); + return 0; } @@ -1083,7 +1119,7 @@ void test_restriction() icalproperty_new_method(ICAL_METHOD_REQUEST), icalcomponent_vanew( ICAL_VTIMEZONE_COMPONENT, - icalproperty_new_tzid("US_Eastern"), + icalproperty_new_tzid("America/New_York"), icalcomponent_vanew( ICAL_XDAYLIGHT_COMPONENT, icalproperty_new_dtstart(atime), @@ -1122,17 +1158,17 @@ void test_restriction() ), icalproperty_new_description("Project XYZ Review Meeting"), icalproperty_new_categories("MEETING"), - icalproperty_new_class("PUBLIC"), + icalproperty_new_class(ICAL_CLASS_PUBLIC), icalproperty_new_created(atime), icalproperty_new_summary("XYZ Project Review"), /* icalproperty_new_dtstart( atime, - icalparameter_new_tzid("US-Eastern"), + icalparameter_new_tzid("America/New_York"), 0 ),*/ icalproperty_vanew_dtend( atime, - icalparameter_new_tzid("US-Eastern"), + icalparameter_new_tzid("America/New_York"), 0 ), icalproperty_new_location("1CP Conference Room 4350"), @@ -1145,6 +1181,8 @@ void test_restriction() printf("#### %d ####\n%s\n",valid, icalcomponent_as_ical_string(comp)); + icalcomponent_free(comp); + } #if 0 @@ -1319,6 +1357,8 @@ void icalrecurrencetype_test() printf("%s",ctime(&tt )); } while( ! icaltime_is_null_time(next)); + + icalvalue_free(v); } @@ -1362,7 +1402,7 @@ void test_recur_parameter_bug(){ p; p = icalcomponent_get_next_property (icalcomp, ICAL_XLICERROR_PROPERTY)) { - char *str; + const char *str; str = icalproperty_as_ical_string (p); fprintf (stderr, "error: %s\n", str); @@ -1379,6 +1419,7 @@ void test_recur_parameter_bug(){ printf("%s\n",icalrecurrencetype_as_string(&recur)); + icalcomponent_free(icalcomp); } @@ -1454,6 +1495,9 @@ void test_period() "19970101T120000/PT3H") == 0); + icalvalue_free(v); + + } void test_strings(){ @@ -1477,64 +1521,75 @@ void test_strings(){ void test_requeststat() { - icalrequeststatus s; - struct icalreqstattype st, st2; - char temp[1024]; + icalproperty *p; + icalrequeststatus s; + struct icalreqstattype st, st2; + char temp[1024]; + + s = icalenum_num_to_reqstat(2,1); + + assert(s == ICAL_2_1_FALLBACK_STATUS); + + assert(icalenum_reqstat_major(s) == 2); + assert(icalenum_reqstat_minor(s) == 1); + + printf("2.1: %s\n",icalenum_reqstat_desc(s)); + + st.code = s; + st.debug = "booga"; + st.desc = 0; + + printf("%s\n",icalreqstattype_as_string(st)); + + st.desc = " A non-standard description"; + + printf("%s\n",icalreqstattype_as_string(st)); + + + st.desc = 0; + + sprintf(temp,"%s\n",icalreqstattype_as_string(st)); + + + st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values.;booga"); + + /* printf("%d -- %d -- %s -- %s\n",*/ + assert(icalenum_reqstat_major(st2.code) == 2); + assert(icalenum_reqstat_minor(st2.code) == 1); + assert(regrstrcmp( icalenum_reqstat_desc(st2.code),"Success but fallback taken on one or more property values.")==0); + + st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values.;booga"); + printf("%s\n",icalreqstattype_as_string(st2)); + + st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values.;"); + printf("%s\n",icalreqstattype_as_string(st2)); + + st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values."); + printf("%s\n",icalreqstattype_as_string(st2)); + + st2 = icalreqstattype_from_string("2.1;"); + printf("%s\n",icalreqstattype_as_string(st2)); + assert(regrstrcmp(icalreqstattype_as_string(st2),"2.1;Success but fallback taken on one or more property values.")==0); + + st2 = icalreqstattype_from_string("2.1"); + printf("%s\n",icalreqstattype_as_string(st2)); + assert(regrstrcmp(icalreqstattype_as_string(st2),"2.1;Success but fallback taken on one or more property values.")==0); + + p = icalproperty_new_from_string("REQUEST-STATUS:2.1;Success but fallback taken on one or more property values.;booga"); - s = icalenum_num_to_reqstat(2,1); + printf("%s\n",icalproperty_as_ical_string(p)); + assert(regrstrcmp(icalproperty_as_ical_string(p),"REQUEST-STATUS\n :2.1;Success but fallback taken on one or more property values.;booga\n")==0); - assert(s == ICAL_2_1_FALLBACK_STATUS); + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL); + st2 = icalreqstattype_from_string("16.4"); + assert(st2.code == ICAL_UNKNOWN_STATUS); + + st2 = icalreqstattype_from_string("1."); + assert(st2.code == ICAL_UNKNOWN_STATUS); + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_DEFAULT); - assert(icalenum_reqstat_major(s) == 2); - assert(icalenum_reqstat_minor(s) == 1); - - printf("2.1: %s\n",icalenum_reqstat_desc(s)); - - st.code = s; - st.debug = "booga"; - st.desc = 0; - - printf("%s\n",icalreqstattype_as_string(st)); - - st.desc = " A non-standard description"; - - printf("%s\n",icalreqstattype_as_string(st)); - - - st.desc = 0; - - sprintf(temp,"%s\n",icalreqstattype_as_string(st)); - - - st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values.;booga"); - - printf("%d -- %d -- %s -- %s\n",icalenum_reqstat_major(st2.code), - icalenum_reqstat_minor(st2.code), - icalenum_reqstat_desc(st2.code), - st2.debug); - - st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values.;booga"); - printf("%s\n",icalreqstattype_as_string(st2)); - - st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values.;"); - printf("%s\n",icalreqstattype_as_string(st2)); - - st2 = icalreqstattype_from_string("2.1;Success but fallback taken on one or more property values."); - printf("%s\n",icalreqstattype_as_string(st2)); - - st2 = icalreqstattype_from_string("2.1;"); - printf("%s\n",icalreqstattype_as_string(st2)); - - st2 = icalreqstattype_from_string("2.1"); - printf("%s\n",icalreqstattype_as_string(st2)); - -#ifndef ICAL_ERRORS_ARE_FATAL - st2 = icalreqstattype_from_string("16.4"); - assert(st2.code == ICAL_UNKNOWN_STATUS); - - st2 = icalreqstattype_from_string("1."); - assert(st2.code == ICAL_UNKNOWN_STATUS); -#endif + icalproperty_free(p); + } char ictt_str[1024]; @@ -1557,6 +1612,50 @@ char* ical_timet_string(time_t t) return ictt_str; +} + +void test_dtstart(){ + + struct icaltimetype tt,tt2; + + icalproperty *p; + + + tt = icaltime_from_string("19970101"); + + assert(tt.is_date == 1); + + p = icalproperty_new_dtstart(tt); + + printf("%s\n",icalvalue_kind_to_string(icalvalue_isa(icalproperty_get_value(p)))); + assert(icalvalue_isa(icalproperty_get_value(p))==ICAL_DATE_VALUE); + + tt2 = icalproperty_get_dtstart(p); + assert(tt2.is_date == 1); + + printf("%s\n",icalproperty_as_ical_string(p)); + + + tt = icaltime_from_string("19970101T103000"); + + assert(tt.is_date == 0); + + icalproperty_free(p); + + p = icalproperty_new_dtstart(tt); + + printf("%s\n",icalvalue_kind_to_string(icalvalue_isa(icalproperty_get_value(p)))); + assert(icalvalue_isa(icalproperty_get_value(p))==ICAL_DATETIME_VALUE); + + tt2 = icalproperty_get_dtstart(p); + assert(tt2.is_date == 0); + + printf("%s\n",icalproperty_as_ical_string(p)); + + icalproperty_free(p); + + + } void do_test_time(char* zone) @@ -1567,6 +1666,7 @@ void do_test_time(char* zone) int offset_la, offset_tz; icalvalue *v; short day_of_week,start_day_of_week, day_of_year; + icaltimezone* lazone; icalerror_errors_are_fatal = 0; @@ -1621,6 +1721,8 @@ void do_test_time(char* zone) printf("System time from libical: %s\n",icalvalue_as_ical_string(v)); + icalvalue_free(v); + tt2 = icaltime_as_timet(ictt); printf("Converted back to libc: %s\n",ical_timet_string(tt2)); @@ -1655,6 +1757,13 @@ void do_test_time(char* zone) printf("\n TimeZone Conversions \n"); + lazone = icaltimezone_get_builtin_timezone("America/Los_Angeles"); + icttla = ictt; + icaltimezone_convert_time(&icttla, + icaltimezone_get_utc_timezone(), + lazone); + + icttla = icaltime_as_zone(ictt,"America/Los_Angeles"); assert(icttla.hour == 10); @@ -1726,25 +1835,25 @@ void test_iterators() c= icalcomponent_vanew( ICAL_VCALENDAR_COMPONENT, icalcomponent_vanew(ICAL_VEVENT_COMPONENT, - icalproperty_vanew_version("1"),0), + icalproperty_new_version("1"),0), icalcomponent_vanew(ICAL_VEVENT_COMPONENT, - icalproperty_vanew_version("2"),0), + icalproperty_new_version("2"),0), icalcomponent_vanew(ICAL_VEVENT_COMPONENT, - icalproperty_vanew_version("3"),0), + icalproperty_new_version("3"),0), icalcomponent_vanew(ICAL_VEVENT_COMPONENT, - icalproperty_vanew_version("4"),0), + icalproperty_new_version("4"),0), icalcomponent_vanew(ICAL_VTODO_COMPONENT, - icalproperty_vanew_version("5"),0), + icalproperty_new_version("5"),0), icalcomponent_vanew(ICAL_VJOURNAL_COMPONENT, - icalproperty_vanew_version("6"),0), + icalproperty_new_version("6"),0), icalcomponent_vanew(ICAL_VEVENT_COMPONENT, - icalproperty_vanew_version("7"),0), + icalproperty_new_version("7"),0), icalcomponent_vanew(ICAL_VJOURNAL_COMPONENT, - icalproperty_vanew_version("8"),0), + icalproperty_new_version("8"),0), icalcomponent_vanew(ICAL_VJOURNAL_COMPONENT, - icalproperty_vanew_version("9"),0), + icalproperty_new_version("9"),0), icalcomponent_vanew(ICAL_VJOURNAL_COMPONENT, - icalproperty_vanew_version("10"),0), + icalproperty_new_version("10"),0), 0); printf("1: "); @@ -1786,6 +1895,7 @@ void test_iterators() while((inner=icalcomponent_get_current_component(c)) != 0 ){ if(icalcomponent_isa(inner) == ICAL_VEVENT_COMPONENT){ icalcomponent_remove_component(c,inner); + icalcomponent_free(inner); } else { icalcomponent_get_next_component(c,ICAL_VEVENT_COMPONENT); } @@ -1854,63 +1964,20 @@ void test_iterators() } printf("\n"); + + icalcomponent_free(c); } - - -char* test_set_tz(const char* tzid) -{ - char *tzstr = 0; - char *tmp; - - /* Put the new time zone into the environment */ - if(getenv("TZ") != 0){ - tzstr = (char*)icalmemory_strdup(getenv("TZ")); - - if(tzstr == 0){ - icalerror_set_errno(ICAL_NEWFAILED_ERROR); - return 0; - } - } - - tmp = (char*)malloc(1024); - - if(tmp == 0){ - icalerror_set_errno(ICAL_NEWFAILED_ERROR); - return 0; - } - - snprintf(tmp,1024,"TZ=%s",tzid); - - /* HACK. In some libc versions, putenv gives the string to the - system and in some it gives a copy, so the following might be a - memory leak. THe linux man page says that glibc2.1.2 take - ownership ( no leak) while BSD4.4 uses a copy ( A leak ) */ - putenv(tmp); - - return tzstr; /* This will be zero if the TZ env var was not set */ -} - -void test_unset_tz(char* tzstr) -{ - /* restore the original environment */ - - if(tzstr!=0){ - char temp[1024]; - snprintf(temp,1024,"TZ=%s",tzstr); - putenv(temp); - free(tzstr); - } else { - putenv("TZ"); /* Delete from environment */ - } -} +struct set_tz_save {char* orig_tzid; char* new_env_str;}; +struct set_tz_save set_tz(const char* tzid); +void unset_tz(struct set_tz_save savetz); void test_time() { char zones[6][40] = { "America/Los_Angeles","America/New_York","Europe/London","Asia/Shanghai", ""}; int i; - char* old_tz; + struct set_tz_save old_tz; int orig_month; time_t tt; struct tm stm; @@ -1923,21 +1990,17 @@ void test_time() do_test_time(0); - old_tz = test_set_tz(zones[0]); - for(i = 0; zones[i][0] != 0; i++){ - if(zones[i][0] != 0){ - test_set_tz(zones[i]); - } - printf(" ######### Timezone: %s ############\n",zones[i]); + + old_tz = set_tz(zones[i]); do_test_time(zones[i]); - } + unset_tz(old_tz); - test_unset_tz(old_tz); + } } @@ -1965,6 +2028,9 @@ void test_icalset() printf(" class %d\n",icalclassify(c,0,"user")); } + + icalset_free(f); + icalset_free(d); } void test_classify() @@ -1980,6 +2046,7 @@ void test_classify() printf("Class %d\n",icalclassify(c,match,"A@example.com")); + icalset_free(f); } @@ -2017,10 +2084,10 @@ void test_span() ICAL_VEVENT_COMPONENT, icalproperty_vanew_dtstart( icaltime_as_local(icaltime_from_timet(tm1,0)), - icalparameter_new_tzid("US/Pacific"),0), + icalparameter_new_tzid("America/Los_Angeles"),0), icalproperty_vanew_dtend( icaltime_as_local(icaltime_from_timet(tm2,0)), - icalparameter_new_tzid("US/Pacific"),0), + icalparameter_new_tzid("America/Los_Angeles"),0), 0 ); @@ -2032,7 +2099,7 @@ void test_span() icalcomponent_free(c); - /* Use machine's local timezone. Same as above if run in US/Pacific */ + /* Use machine's local timezone. Same as above if run in America/Los_Angeles */ c = icalcomponent_vanew( ICAL_VEVENT_COMPONENT, @@ -2053,10 +2120,10 @@ void test_span() ICAL_VEVENT_COMPONENT, icalproperty_vanew_dtstart( icaltime_as_local(icaltime_from_timet(tm1,0)), - icalparameter_new_tzid("US/Eastern"),0), + icalparameter_new_tzid("America/New_York"),0), icalproperty_vanew_dtend( icaltime_as_local(icaltime_from_timet(tm2,0)), - icalparameter_new_tzid("US/Eastern"),0), + icalparameter_new_tzid("America/New_York"),0), 0 ); span = icalcomponent_get_span(c); @@ -2071,10 +2138,10 @@ void test_span() ICAL_VEVENT_COMPONENT, icalproperty_vanew_dtstart( icaltime_as_local(icaltime_from_timet(tm1,0)), - icalparameter_new_tzid("US/Eastern"),0), + icalparameter_new_tzid("America/New_York"),0), icalproperty_vanew_dtend( icaltime_as_local(icaltime_from_timet(tm2,0)), - icalparameter_new_tzid("US/Pacific"),0), + icalparameter_new_tzid("America/Los_Angeles"),0), 0 ); span = icalcomponent_get_span(c); @@ -2088,7 +2155,7 @@ void test_span() ICAL_VEVENT_COMPONENT, icalproperty_vanew_dtstart( icaltime_as_local(icaltime_from_timet(tm1,0)), - icalparameter_new_tzid("US/Pacific"),0), + icalparameter_new_tzid("America/Los_Angeles"),0), icalproperty_new_duration(dur), 0 @@ -2106,9 +2173,9 @@ void test_span() icalcomponent_vanew( ICAL_VEVENT_COMPONENT, icalproperty_vanew_dtstart(icaltime_from_timet(tm1,0), - icalparameter_new_tzid("US/Eastern"),0), + icalparameter_new_tzid("America/New_York"),0), icalproperty_vanew_dtend(icaltime_from_timet(tm2,0), - icalparameter_new_tzid("US/Eastern"),0), + icalparameter_new_tzid("America/New_York"),0), 0 ); @@ -2221,6 +2288,7 @@ void test_fblist() icalspanlist_free(sl); + icalset_free(set); } @@ -2416,10 +2484,113 @@ char* ical_strstr(const char *haystack, const char *needle){ return strstr(haystack,needle); } +void test_start_of_week() +{ + struct icaltimetype tt2; + struct icaltimetype tt1 = icaltime_from_string("19900110"); + int dow, doy,start_dow; + + do{ + struct tm stm; + + tt1 = icaltime_normalize(tt1); + + doy = icaltime_start_doy_of_week(tt1); + dow = icaltime_day_of_week(tt1); + + tt2 = icaltime_from_day_of_year(doy,tt1.year); + start_dow = icaltime_day_of_week(tt2); + + if(start_dow != 1){ /* Sunday is 1 */ + printf("failed: Start of week (%s) is not a Sunday \n for %s (doy=%d,dow=%d)\n",ictt_as_string(tt2), ictt_as_string(tt1),dow,start_dow); + } + + + assert(start_dow == 1); + + if(doy == 1){ + putc('.',stdout); + fflush(stdout); + } + + + tt1.day+=1; + + } while(tt1.year < 2010); + + printf("\n"); +} + void test_doy() { struct icaltimetype tt1, tt2; - short doy; + int year, month; + short doy,doy2; + + doy = -1; + + tt1 = icaltime_from_string("19900101"); + + printf("Test icaltime_day_of_year() agreement with mktime\n"); + + do{ + struct tm stm; + + tt1 = icaltime_normalize(tt1); + + stm.tm_sec = tt1.second; + stm.tm_min = tt1.minute; + stm.tm_hour = tt1.hour; + stm.tm_mday = tt1.day; + stm.tm_mon = tt1.month-1; + stm.tm_year = tt1.year-1900; + stm.tm_isdst = -1; + + mktime(&stm); + + doy = icaltime_day_of_year(tt1); + + if(doy == 1){ + putc('.',stdout); + fflush(stdout); + } + + doy2 = stm.tm_yday+1; + + if(doy != doy2){ + printf("Failed for %s (%d,%d)\n",ictt_as_string(tt1),doy,doy2); + } + + assert(doy == doy2); + + tt1.day+=1; + + } while(tt1.year < 2010); + + printf("\nTest icaltime_day_of_year() agreement with icaltime_from_day_of_year()\n"); + + tt1 = icaltime_from_string("19900101"); + + do{ + if(doy == 1){ + putc('.',stdout); + fflush(stdout); + } + + doy = icaltime_day_of_year(tt1); + tt2 = icaltime_from_day_of_year(doy,tt1.year); + doy2 = icaltime_day_of_year(tt2); + + assert(doy2 == doy); + assert(icaltime_compare(tt1,tt2) == 0); + + tt1.day+=1; + tt1 = icaltime_normalize(tt1); + + } while(tt1.year < 2010); + + printf("\n"); + tt1 = icaltime_from_string("19950301"); doy = icaltime_day_of_year(tt1); @@ -2444,7 +2615,6 @@ void test_doy() } - void test_x(){ #ifdef HAVE_CONFIG_H @@ -2485,7 +2655,7 @@ void test_x(){ p; p = icalcomponent_get_next_property (icalcomp, ICAL_XLICERROR_PROPERTY)) { - char *str; + const char *str; str = icalproperty_as_ical_string (p); fprintf (stderr, "error: %s\n", str); @@ -2502,24 +2672,61 @@ void test_x(){ printf("%s\n",icalrecurrencetype_as_string(&recur)); + icalcomponent_free(icalcomp); + } void test_gauge_sql() { icalgauge *g; + char* str; - printf("\nSELECT DTSTART,DTEND,COMMENT FROM VEVENT,VTODO WHERE VEVENT.SUMMARY = 'Bongoa' AND SEQUENCE < 5\n"); + str= "SELECT DTSTART,DTEND,COMMENT FROM VEVENT,VTODO WHERE VEVENT.SUMMARY = 'Bongoa' AND SEQUENCE < 5"; - g = icalgauge_new_from_sql("SELECT DTSTART,DTEND,COMMENT FROM VEVENT,VTODO WHERE VEVENT.SUMMARY = 'Bongoa' AND SEQUENCE < 5"); + printf("\n%s\n",str); + + g = icalgauge_new_from_sql(str); icalgauge_dump(g); icalgauge_free(g); - printf("\nSELECT * FROM VEVENT,VTODO WHERE VEVENT.SUMMARY = 'Bongoa' AND SEQUENCE < 5 OR METHOD != 'CREATE'\n"); + str="SELECT * FROM VEVENT,VTODO WHERE VEVENT.SUMMARY = 'Bongoa' AND SEQUENCE < 5 OR METHOD != 'CREATE'"; - g = icalgauge_new_from_sql("SELECT * FROM VEVENT,VTODO WHERE VEVENT.SUMMARY = 'Bongoa' AND SEQUENCE < 5 OR METHOD != 'CREATE'"); + printf("\n%s\n",str); + + g = icalgauge_new_from_sql(str); + + icalgauge_dump(g); + + icalgauge_free(g); + + str="SELECT * FROM VEVENT WHERE SUMMARY == 'BA301'"; + + printf("\n%s\n",str); + + g = icalgauge_new_from_sql(str); + + icalgauge_dump(g); + + icalgauge_free(g); + + str="SELECT * FROM VEVENT WHERE SUMMARY == 'BA301'"; + + printf("\n%s\n",str); + + g = icalgauge_new_from_sql(str); + + icalgauge_dump(g); + + icalgauge_free(g); + + str="SELECT * FROM VEVENT WHERE LOCATION == '104 Forum'"; + + printf("\n%s\n",str); + + g = icalgauge_new_from_sql(str); icalgauge_dump(g); @@ -2531,6 +2738,7 @@ void test_gauge_compare() { icalgauge *g; icalcomponent *c; + char* str; /* Equality */ @@ -2669,6 +2877,75 @@ void test_gauge_compare() { icalgauge_free(g); + icalcomponent_free(c); + + /* Combinations */ + + c = icalcomponent_vanew(ICAL_VCALENDAR_COMPONENT, + icalcomponent_vanew(ICAL_VEVENT_COMPONENT, + icalproperty_new_dtstart( + icaltime_from_string("20000102T000000")),0),0); + + + str = "SELECT * FROM VEVENT WHERE DTSTART > '20000101T000000' and DTSTART < '20000103T000000'"; + + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0); assert(icalgauge_compare(g,c) == 1); + + icalgauge_free(g); + + str = "SELECT * FROM VEVENT WHERE DTSTART > '20000101T000000' and DTSTART < '20000102T000000'"; + + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0); assert(icalgauge_compare(g,c) == 0); + + icalgauge_free(g); + + str = "SELECT * FROM VEVENT WHERE DTSTART > '20000101T000000' or DTSTART < '20000102T000000'"; + + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0); assert(icalgauge_compare(g,c) == 1); + + icalgauge_free(g); + + + icalcomponent_free(c); + + /* Combinations, non-cannonical component */ + + c = icalcomponent_vanew(ICAL_VEVENT_COMPONENT, + icalproperty_new_dtstart( + icaltime_from_string("20000102T000000")),0); + + + str = "SELECT * FROM VEVENT WHERE DTSTART > '20000101T000000' and DTSTART < '20000103T000000'"; + + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0); assert(icalgauge_compare(g,c) == 1); + + icalgauge_free(g); + + str = "SELECT * FROM VEVENT WHERE DTSTART > '20000101T000000' and DTSTART < '20000102T000000'"; + + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0); assert(icalgauge_compare(g,c) == 0); + + icalgauge_free(g); + + str = "SELECT * FROM VEVENT WHERE DTSTART > '20000101T000000' or DTSTART < '20000102T000000'"; + + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0); assert(icalgauge_compare(g,c) == 1); + + icalgauge_free(g); + + icalcomponent_free(c); @@ -2691,37 +2968,45 @@ void test_gauge_compare() { 0), 0); + + str = "SELECT * FROM VEVENT WHERE VALARM.DTSTART = '20000101T120000'"; - g = icalgauge_new_from_sql( - "SELECT * FROM VEVENT WHERE VALARM.DTSTART = '20000101T120000'"); - - printf("SELECT * FROM VEVENT WHERE VALARM.DTSTART = '20000101T120000'\n"); - - assert(icalgauge_compare(g,c) == 1); + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0);assert(icalgauge_compare(g,c) == 1); icalgauge_free(g); - g = icalgauge_new_from_sql( - "SELECT * FROM VEVENT WHERE COMMENT = 'foo'"); + str = "SELECT * FROM VEVENT WHERE COMMENT = 'foo'"; + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0);assert(icalgauge_compare(g,c) == 1); - printf("SELECT * FROM VEVENT WHERE COMMENT = 'foo'\n"); - - assert(icalgauge_compare(g,c) == 1); + icalgauge_free(g); + + str = "SELECT * FROM VEVENT WHERE COMMENT = 'foo' AND VALARM.DTSTART = '20000101T120000'"; + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0);assert(icalgauge_compare(g,c) == 1); icalgauge_free(g); + str = "SELECT * FROM VEVENT WHERE COMMENT = 'bar' AND VALARM.DTSTART = '20000101T120000'"; + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0);assert(icalgauge_compare(g,c) == 0); - g = icalgauge_new_from_sql( - "SELECT * FROM VEVENT WHERE COMMENT = 'foo' AND VALARM.DTSTART = '20000101T120000'"); + icalgauge_free(g); - printf("SELECT * FROM VEVENT WHERE COMMENT = 'foo' AND VALARM.DTSTART = '20000101T120000'\n"); - - assert(icalgauge_compare(g,c) == 1); + str = "SELECT * FROM VEVENT WHERE COMMENT = 'bar' or VALARM.DTSTART = '20000101T120000'"; + g = icalgauge_new_from_sql(str); + printf("%s\n",str); + assert(g!=0);assert(icalgauge_compare(g,c) == 1); icalgauge_free(g); icalcomponent_free(c); - + } icalcomponent* make_component(int i){ @@ -2798,6 +3083,8 @@ void test_fileset() } icalfileset_free(fs); + + icalgauge_free(g); } @@ -2810,7 +3097,6 @@ void microsleep(int us) tv.tv_usec = us; select(0,0,0,0,&tv); - #else Sleep(us); #endif @@ -2858,7 +3144,7 @@ void test_file_locks() pid = fork(); - assert(pid >= 0); + assert(pid >= 0); if(pid == 0){ /*child*/ @@ -2997,7 +3283,7 @@ void test_action() assert(icalproperty_get_action(p) == ICAL_ACTION_X); assert(regrstrcmp(icalvalue_get_x(icalproperty_get_value(p)), "FUBAR")==0); - + icalcomponent_free(c); } @@ -3008,7 +3294,7 @@ void test_trigger() struct icaltriggertype tr; icalcomponent *c; icalproperty *p; - char* str; + const char* str; static const char test_icalcomp_str[] = "BEGIN:VEVENT\n" @@ -3039,6 +3325,8 @@ void test_trigger() } } + icalcomponent_free(c); + /* Trigger, as a DATETIME */ tr.duration = icaldurationtype_null_duration(); tr.time = icaltime_from_string("19970101T120000"); @@ -3138,7 +3426,7 @@ void test_rdate() struct icaldatetimeperiodtype dtp; icalproperty *p; - char* str; + const char* str; struct icalperiodtype period; period.start = icaltime_from_string("19970101T120000"); @@ -3243,6 +3531,7 @@ void test_langbind() "BEGIN:VEVENT\n" "ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:MAILTO:employee-A@host.com\n" "COMMENT: Comment that \n spans a line\n" +"COMMENT: Comment with \"quotable\" \'characters\' and other \t bad magic \n things \f Yeah.\n" "DTSTART:19970101T120000\n" "DTSTART:19970101T120000Z\n" "DTSTART:19970101\n" @@ -3255,6 +3544,9 @@ void test_langbind() printf("%s\n",test_str); c = icalparser_parse_string(test_str); + + printf("-----------\n%s\n-----------\n",icalcomponent_as_ical_string(c)); + inner = icalcomponent_get_inner(c); @@ -3280,6 +3572,7 @@ void test_langbind() printf("%s\n",icalproperty_as_ical_string(p)); + icalcomponent_free(c); } void test_property_parse() @@ -3292,12 +3585,15 @@ void test_property_parse() assert (p != 0); printf("%s\n",icalproperty_as_ical_string(p)); + icalproperty_free(p); p= icalproperty_new_from_string("DTSTART:19970101T120000Z\n"); assert (p != 0); printf("%s\n",icalproperty_as_ical_string(p)); + icalproperty_free(p); + } @@ -3331,6 +3627,7 @@ void test_value_parameter() param = icalproperty_get_first_parameter(p,ICAL_VALUE_PARAMETER); assert(icalparameter_get_value(param) == ICAL_VALUE_DATE); + icalcomponent_free(c); } @@ -3347,6 +3644,17 @@ void test_x_property() assert(regrstrcmp(icalproperty_get_x_name(p),"X-LIC-PROPERTY")==0); assert(regrstrcmp(icalproperty_get_x(p)," This is a note")==0); + icalproperty_free(p); +} + +void test_utcoffset() +{ + icalproperty *p; + + p = icalproperty_new_from_string("TZOFFSETFROM:-001608"); + printf("%s\n",icalproperty_as_ical_string(p)); + + icalproperty_free(p); } int main(int argc, char *argv[]) @@ -3359,10 +3667,13 @@ int main(int argc, char *argv[]) int ttime=0, trecur=0,tspan=0, tmisc=0, tgauge = 0, tfile = 0, tbasic = 0; + putenv("TZ="); + if(argc==1) { ttime = trecur = tspan = tmisc = tgauge = tfile = tbasic = 1; } -#ifndef WIN32 /* not getopt under win32 */ + +#ifndef WIN32 while ((c = getopt(argc, argv, "t:s:r:m:g:f:b:")) != -1) { switch (c) { @@ -3415,11 +3726,10 @@ int main(int argc, char *argv[]) } } - } - - #endif + + if(ttime==1 || ttime==2){ printf("\n------------Test time parser ----------\n"); test_time_parser(); @@ -3435,7 +3745,7 @@ int main(int argc, char *argv[]) printf("\n------------Test day of year---------\n"); test_doy(); } - + if(ttime==1 || ttime==5){ printf("\n------------Test duration---------------\n"); test_duration(); @@ -3445,7 +3755,17 @@ int main(int argc, char *argv[]) printf("\n------------Test period ----------------\n"); test_period(); } + + if(ttime==1 || ttime==7){ + printf("\n------------Test DTSTART ----------------\n"); + test_dtstart(); + } + if(ttime==1 || ttime==8){ + printf("\n------------Test day of year of week start----\n"); + test_start_of_week(); + } + if(trecur==1 || trecur==2){ @@ -3501,11 +3821,13 @@ int main(int argc, char *argv[]) test_fileset(); } + /* + File locking is currently broken if(tfile ==1 || tfile == 3){ printf("\n------------Test File Locks--------------\n"); test_file_locks(); } - + */ if(tmisc == 1 || tmisc == 2){ @@ -3558,6 +3880,19 @@ int main(int argc, char *argv[]) test_x_property(); } + if(tmisc == 1 || tmisc == 11){ + printf("\n-----------Test request status-------\n"); + test_requeststat(); + } + + + if(tmisc == 1 || tmisc == 12){ + printf("\n-----------Test UTC-OFFSET-------\n"); + test_utcoffset(); + } + + + if(tbasic == 1 || tbasic == 2){ printf("\n------------Test Values---------------\n"); @@ -3593,8 +3928,6 @@ int main(int argc, char *argv[]) test_iterators(); - printf("\n-----------Test request status-------\n"); - test_requeststat(); printf("\n------------Test strings---------------\n"); test_strings(); @@ -3612,6 +3945,13 @@ int main(int argc, char *argv[]) test_memory(); } + + printf("-------------- Tests complete -----------\n"); + + icaltimezone_free_builtin_timezones(); + + icalmemory_free_ring(); + return 0; } diff --git a/other-licenses/libical/src/test/regression.dep b/other-licenses/libical/src/test/regression.dep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/src/test/stow.c b/other-licenses/libical/src/test/stow.c index 82bc8455e68..7e310f72621 100644 --- a/other-licenses/libical/src/test/stow.c +++ b/other-licenses/libical/src/test/stow.c @@ -3,7 +3,7 @@ FILE: stow.c CREATOR: eric 29 April 2000 - $Id: stow.c,v 1.1 2001-11-15 19:27:51 mikep%oeone.com Exp $ + $Id: stow.c,v 1.2 2001-12-21 18:56:57 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000 Eric Busboom @@ -250,13 +250,20 @@ void return_failure(icalcomponent* comp, char* message, { char* local_attendee = opt->calid; FILE* p; + const char *org_addr; icalcomponent *inner = get_first_real_component(comp); icalproperty *organizer_prop = icalcomponent_get_first_property(inner,ICAL_ORGANIZER_PROPERTY); const char *organizer = icalproperty_get_organizer(organizer_prop); - organizer += 7; + org_addr = strchr(organizer,':'); + + if(org_addr != 0){ + org_addr++; /* Skip the ';' */ + } else { + org_addr = organizer; + } if (opt->errors == ERRORS_TO_ORGANIZER){ p = popen(SENDMAIL,"w"); @@ -271,7 +278,7 @@ void return_failure(icalcomponent* comp, char* message, exit(1); } - fputs(make_mime(organizer, local_attendee, "iMIP error", + fputs(make_mime(org_addr, local_attendee, "iMIP error", message, "reply", icalcomponent_as_ical_string(comp)),p); @@ -380,6 +387,17 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, int errors = 0; icalproperty *p; int found_attendee = 0; + struct icalreqstattype rs; + + rs.code = ICAL_UNKNOWN_STATUS; + rs.desc = 0; + rs.debug = 0; + + /*{ + icalrequeststatus code; + const char* desc; + const char* debug; + };*/ *return_status = 0; @@ -401,6 +419,8 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, strcpy(static_component_error_str, "Root component is not a VCALENDAR"); component_error_str = static_component_error_str; + rs.code = ICAL_3_11_MISSREQCOMP_STATUS; + break; } @@ -410,8 +430,9 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, if (icalcomponent_get_first_property(comp,ICAL_METHOD_PROPERTY) == 0) { strcpy(static_component_error_str, - "Component does not have a METHOD property"); + "The component you sent did not have a METHOD property"); component_error_str = static_component_error_str; + rs.code = ICAL_3_11_MISSREQCOMP_STATUS; break; } @@ -421,8 +442,8 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, /* Check that the compopnent has an organizer */ if(icalcomponent_get_first_property(inner,ICAL_ORGANIZER_PROPERTY) == 0){ fprintf(stderr,"%s: fatal. Component does not have an ORGANIZER property\n",program_name); - - exit(1); + rs.code = ICAL_3_11_MISSREQCOMP_STATUS; + break; } @@ -444,7 +465,6 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, if (found_attendee == 0){ struct icalreqstattype rs; - char* rs_string; memset(static_component_error_str,0,PATH_MAX); snprintf(static_component_error_str,PATH_MAX, @@ -453,11 +473,6 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, component_error_str = static_component_error_str; rs.code = ICAL_3_7_INVCU_STATUS; - rs.desc = 0; - rs.debug = component_error_str; - rs_string = icalreqstattype_as_string(rs); - - *return_status = icalproperty_new_requeststatus(rs_string); break; } @@ -480,6 +495,10 @@ char* check_component(icalcomponent* comp, icalproperty **return_status, } while(0); + if(rs.code != ICAL_UNKNOWN_STATUS){ + *return_status = icalproperty_new_requeststatus(rs); + } + return component_error_str; } @@ -638,35 +657,32 @@ void get_options(int argc, char* argv[], struct options_struct *opt) p = strrchr(facspath,'/'); - if (p == 0){ - fprintf(stderr,"%s: Invalid calendar filename \"%s\"", - program_name,facspath); - exit(1); - } - - *p='\0'; - - type = test_file(facspath); - - errno = 0; - if (type == NO_FILE){ - - if(mkdir(facspath,0775) != 0){ - fprintf(stderr, - "%s: Failed to create calendar directory %s: %s\n", - program_name,facspath, strerror(errno)); - exit(1); - } else { - fprintf(stderr,"%s: Creating calendar directory %s\n", - program_name,facspath); - } - - } else if(type==REGULAR || type == ERROR){ - fprintf(stderr,"%s: Cannot create calendar directory %s\n", - program_name,facspath); - exit(1); - } - } + if (p != 0){ + /* Use some other directory */ + *p='\0'; + + type = test_file(facspath); + + errno = 0; + if (type == NO_FILE){ + + if(mkdir(facspath,0775) != 0){ + fprintf(stderr, + "%s: Failed to create calendar directory %s: %s\n", + program_name,facspath, strerror(errno)); + exit(1); + } else { + fprintf(stderr,"%s: Creating calendar directory %s\n", + program_name,facspath); + } + + } else if(type==REGULAR || type == ERROR){ + fprintf(stderr,"%s: Cannot create calendar directory %s\n", + program_name,facspath); + exit(1); + } + } + } } char* check_options(struct options_struct *opt) @@ -726,6 +742,7 @@ icalcomponent* read_nonmime_component(struct options_struct *opt) FILE *stream; icalcomponent *comp; icalparser* parser = icalparser_new(); + icalerrorstate es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR); char* line; if(opt->input_source == INPUT_FROM_FILE){ @@ -746,7 +763,9 @@ icalcomponent* read_nonmime_component(struct options_struct *opt) do { line = icalparser_get_line(parser,read_stream); + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL); comp = icalparser_add_line(parser,line); + icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es); if (comp != 0){ return comp; @@ -847,12 +866,17 @@ int main(int argc, char* argv[] ) comp = read_component(&opt); + /* If the component had any fatal errors, return an error message + to the organizer */ if ( (component_error_str = check_component(comp,&return_status,&opt)) != 0){ + reply = make_reply(comp,return_status,&opt); + return_failure(reply, component_error_str, &opt); icalcomponent_free(reply); exit(0); + } store_component(comp,&opt); diff --git a/other-licenses/libical/src/test/testclassify.c b/other-licenses/libical/src/test/testclassify.c index 39fb217875a..30c8dd74c0f 100644 --- a/other-licenses/libical/src/test/testclassify.c +++ b/other-licenses/libical/src/test/testclassify.c @@ -3,7 +3,7 @@ FILE: testclassify.c CREATOR: eric 11 February 2000 - $Id: testclassify.c,v 1.1 2001-11-15 19:27:51 mikep%oeone.com Exp $ + $Id: testclassify.c,v 1.2 2001-12-21 18:56:57 mikep%oeone.com Exp $ $Locker: $ (C) COPYRIGHT 2000 Eric Busboom @@ -29,52 +29,29 @@ #include "ical.h" #include #include /* For strerror */ -#include "icalset.h" -#include "icalclassify.h" +#include "icalss.h" - -struct class_map { - ical_class class; - char *str; -} class_map[] = { - {ICAL_NO_CLASS,"No class"}, - {ICAL_PUBLISH_NEW_CLASS,"New Publish"}, - {ICAL_PUBLISH_UPDATE_CLASS,"Update Publish"}, - {ICAL_REQUEST_NEW_CLASS,"New request"}, - {ICAL_REQUEST_UPDATE_CLASS,"Update"}, - {ICAL_REQUEST_RESCHEDULE_CLASS,"Reschedule"}, - {ICAL_REQUEST_DELEGATE_CLASS,"Delegate"}, - {ICAL_REQUEST_NEW_ORGANIZER_CLASS,"New Organizer"}, - {ICAL_REQUEST_FORWARD_CLASS,"Forward"}, - {ICAL_REQUEST_STATUS_CLASS,"Status request"}, - {ICAL_REPLY_ACCEPT_CLASS,"Accept reply"}, - {ICAL_REPLY_DECLINE_CLASS,"Decline reply"}, - {ICAL_REPLY_CRASHER_ACCEPT_CLASS,"Crasher's accept reply"}, - {ICAL_REPLY_CRASHER_DECLINE_CLASS,"Crasher's decline reply"}, - {ICAL_ADD_INSTANCE_CLASS,"Add instance"}, - {ICAL_CANCEL_EVENT_CLASS,"Cancel event"}, - {ICAL_CANCEL_INSTANCE_CLASS,"Cancel instance"}, - {ICAL_CANCEL_ALL_CLASS,"Cancel all instances"}, - {ICAL_REFRESH_CLASS,"Refresh"}, - {ICAL_COUNTER_CLASS,"Counter"}, - {ICAL_DECLINECOUNTER_CLASS,"Decline counter"}, - {ICAL_MALFORMED_CLASS,"Malformed"}, - {ICAL_OBSOLETE_CLASS,"Obsolete"}, - {ICAL_MISSEQUENCED_CLASS,"Missequenced"}, - {ICAL_UNKNOWN_CLASS,"Unknown"} -}; - -char* find_class_string(ical_class class) +/* Get a note about the purpose of the property*/ +const char* get_note(icalcomponent *c) { - int i; + icalproperty *p; + const char* note = 0; - for (i = 0;class_map[i].class != ICAL_UNKNOWN_CLASS;i++){ - if (class_map[i].class == class){ - return class_map[i].str; - } + if(c != 0){ + for(p = icalcomponent_get_first_property(c,ICAL_X_PROPERTY); + p!= 0; + p = icalcomponent_get_next_property(c,ICAL_X_PROPERTY)){ + if(strcmp(icalproperty_get_x_name(p),"X-LIC-NOTE")==0){ + note = icalproperty_get_x(p); + } + } + } + + if(note == 0){ + note = "None"; } - - return "Unknown"; + + return note; } @@ -83,71 +60,66 @@ int main(int argc, char* argv[]) icalcomponent *c; int i=0; - icalset* f = icalset_new_file("../../test-data/incoming.ics"); + /* Open up the two storage files, one for the incomming components, + one for the calendar */ + icalset* incoming = icalset_new_file("../../test-data/incoming.ics"); icalset* cal = icalset_new_file("../../test-data/calendar.ics"); - assert(f!= 0); + assert(incoming!= 0); assert(cal!=0); - - /* Foreach incoming message */ - for(c=icalset_get_first_component(f);c!=0; - c=icalset_get_next_component(f)){ + /* Iterate through all of the incoming components */ + for(c=icalset_get_first_component(incoming);c!=0; + c=icalset_get_next_component(incoming)){ - ical_class class; - icalcomponent *match; - icalcomponent *inner = icalcomponent_get_first_real_component(c); - icalcomponent *p; - const char *this_uid; - const char *i_x_note=0; - const char *c_x_note=0; + icalproperty_xlicclass class; + icalcomponent *match = 0; + const char* this_uid; i++; - if(inner == 0){ - continue; - } + /* Check this component against the restrictions imposed by + iTIP. An errors will be inserted as X-LIC-ERROR properties + in the component. The Parser will also insert errors if it + cannot parse the component */ + icalcomponent_check_restrictions(c); - p = icalcomponent_get_first_property(inner,ICAL_UID_PROPERTY); - this_uid = icalproperty_get_uid(p); + /* If there are any errors, print out the component */ + if(icalcomponent_count_errors(c) != 0){ + printf("----- Component has errors ------- \n%s-----------------\n", + icalcomponent_as_ical_string(c)); + } - assert(this_uid != 0); + /* Use one of the icalcomponent convenience routines to get + the UID. This routine will save you from having to use + icalcomponent_get_inner(), + icalcomponent_get_first_property(), checking the return + value, and then calling icalproperty_get_uid. There are + several other convenience routines for DTSTART, DTEND, + DURATION, SUMMARY, METHOD, and COMMENT */ + this_uid = icalcomponent_get_uid(c); - /* Find a booked component that is matched to the incoming - message, based on the incoming component's UID, SEQUENCE - and RECURRENCE-ID*/ - - match = icalset_fetch(cal,this_uid); + if(this_uid != 0){ + /* Look in the calendar for a component with the same UID + as the incomming component. We should reall also be + checking the RECURRENCE-ID. Another way to do this + operation is to us icalset_find_match(), which does use + the RECURRENCE-ID. */ + match = icalset_fetch(cal,this_uid); + } + + /* Classify the incoming component. The third argument is the + calid of the user who owns the calendar. In a real program, + you would probably switch() on the class.*/ class = icalclassify(c,match,"A@example.com"); - for(p = icalcomponent_get_first_property(c,ICAL_X_PROPERTY); - p!= 0; - p = icalcomponent_get_next_property(c,ICAL_X_PROPERTY)){ - if(strcmp(icalproperty_get_x_name(p),"X-LIC-NOTE")==0){ - i_x_note = icalproperty_get_x(p); - } - } - - - if(i_x_note == 0){ - i_x_note = "None"; - } - - for(p = icalcomponent_get_first_property(match,ICAL_X_PROPERTY); - p!= 0; - p = icalcomponent_get_next_property(match,ICAL_X_PROPERTY)){ - if(strcmp(icalproperty_get_x_name(p),"X-LIC-NOTE")==0){ - c_x_note = icalproperty_get_x(p); - } - } - - if(c_x_note == 0){ - c_x_note = "None"; - } - - - printf("Test %d\nIncoming: %s\nMatched: %s\nClassification: %s\n\n",i,i_x_note,c_x_note,find_class_string(class)); + printf("Test %d\n\ +Incoming: %s\n\ +Matched: %s\n\ +Classification: %s\n\n", + i,get_note(c),get_note(match), + icalproperty_enum_to_string(class)); } return 0; diff --git a/other-licenses/libical/stamp-h.in b/other-licenses/libical/stamp-h.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/test-data/Makefile.in b/other-licenses/libical/test-data/Makefile.in deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/other-licenses/libical/test-data/calendar.ics b/other-licenses/libical/test-data/calendar.ics index 63b0a938382..e69de29bb2d 100644 --- a/other-licenses/libical/test-data/calendar.ics +++ b/other-licenses/libical/test-data/calendar.ics @@ -1,47 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:CREATE -X-LIC-NOTE: #C1. Rescheduled by #I1\ and updated by #I2 -VERSION:2.0 -BEGIN:VEVENT -ORGANIZER:Mailto:B@example.com -ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED;CN=BIG A:Mailto:A@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=B:Mailto:B@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=C:Mailto:C@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=Hal:Mailto:D@example.com -ATTENDEE;RSVP=FALSE;CUTYPE=ROOM:conf_Big@example.com -ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE:Mailto:E@example.com -DTSTAMP:19970611T190000Z -DTSTART:19970701T190000Z -DTEND:19970701T1930000Z -SUMMARY:Conference -UID:calsrv.example.com-873970198738777@example.com -SEQUENCE:1 -STATUS:CONFIRMED -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REQUEST -X-LIC-NOTE: #C2. The test user is the organizer. -VERSION:2.0 -BEGIN:VEVENT -ORGANIZER:Mailto:A@example.com -ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED:Mailto:A@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL:Mailto:B@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL:Mailto:C@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=Hal:Mailto:D@example.com -ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE; - CUTYPE=ROOM:Mailto:Conf@example.com -ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE:Mailto:E@example.com -DTSTART:19970701T180000Z -DTEND:19970701T190000Z -SUMMARY:Phone Conference -UID:calsrv.example.com-873970198738785@example.com -SEQUENCE:0 -DTSTAMP:19970613T190000Z -STATUS:CONFIRMED -END:VEVENT -END:VCALENDAR - diff --git a/other-licenses/libical/test-data/incoming.ics b/other-licenses/libical/test-data/incoming.ics index c598dfa6bf7..e69de29bb2d 100644 --- a/other-licenses/libical/test-data/incoming.ics +++ b/other-licenses/libical/test-data/incoming.ics @@ -1,168 +0,0 @@ -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REQUEST -X-LIC-NOTE: #I1. Reschedules C1 -VERSION:2.0 -BEGIN:VEVENT -ORGANIZER:Mailto:B@example.com -ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED;CN=BIG A:Mailto:A@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=B:Mailto:B@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=C:Mailto:C@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=Hal:Mailto:D@example.com -ATTENDEE;RSVP=FALSE;CUTYPE=ROOM:conf_Big@example.com -ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE:Mailto:E@example.com -DTSTAMP:19970611T190000Z -DTSTART:19970701T200000Z -DTEND:19970701T2000000Z -SUMMARY:Conference -UID:calsrv.example.com-873970198738777@example.com -SEQUENCE:2 -STATUS:CONFIRMED -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REQUEST -X-LIC-NOTE: #I2. Updates C1 -VERSION:2.0 -BEGIN:VEVENT -ORGANIZER:Mailto:B@example.com -ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED;CN=BIG A:Mailto:A@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=B:Mailto:B@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=C:Mailto:C@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=Hal:Mailto:D@example.com -ATTENDEE;RSVP=FALSE;CUTYPE=ROOM:conf_Big@example.com -ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE:Mailto:E@example.com -DTSTAMP:19970611T193000Z -DTSTART:19970701T190000Z -DTEND:19970701T1930000Z -SUMMARY: Pool party -UID:calsrv.example.com-873970198738777@example.com -SEQUENCE:2 -STATUS:CONFIRMED -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REQUEST -X-LIC-NOTE: #I2: This is an obsolete request\, otherwise identical to #I1 -VERSION:2.0 -BEGIN:VEVENT -ORGANIZER:Mailto:B@example.com -ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED:Mailto:A@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL:Mailto:B@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL:Mailto:C@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=Hal:Mailto:D@example.com -ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE; - CUTYPE=ROOM:Mailto:Conf@example.com -ATTENDEE;ROLE=NON-PARTICIPANT;RSVP=FALSE:Mailto:E@example.com -DTSTART:19960701T180000Z -DTEND:19970701T190000Z -SUMMARY:Phone Conference -UID:calsrv.example.com-873970198738777@example.com -SEQUENCE:0 -DTSTAMP:19960613T190000Z -STATUS:CONFIRMED -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REPLY -X-LIC-NOTE: #I3: User B is accepting A's request\, #C2 -VERSION:2.0 -BEGIN:VEVENT -ATTENDEE;PARTSTAT=ACCEPTED:Mailto:B@example.com -ORGANIZER:MAILTO:A@example.com -UID:calsrv.example.com-873970198738785@example.com -SEQUENCE:1 -REQUEST-STATUS:2.0;Success -DTSTAMP:19970612T190000Z -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REPLY -X-LIC-NOTE: #I4: User C is rejecting A's request\, #C2 -VERSION:2.0 -BEGIN:VEVENT -ATTENDEE;PARTSTAT=DECLINED:Mailto:C@example.com -ORGANIZER:MAILTO:A@example.com -UID:calsrv.example.com-873970198738785@example.com -SEQUENCE:1 -REQUEST-STATUS:2.0;Success -DTSTAMP:19970612T190000Z -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REPLY -X-LIC-NOTE: #I5: Crasher X is accepting A's request\, #C2 -VERSION:2.0 -BEGIN:VEVENT -ATTENDEE;PARTSTAT=ACCEPTED:Mailto:X@example.com -ORGANIZER:MAILTO:A@example.com -UID:calsrv.example.com-873970198738785@example.com -SEQUENCE:1 -REQUEST-STATUS:2.0;Success -DTSTAMP:19970612T190000Z -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:REPLY -X-LIC-NOTE: #I6: Crasher Y is declining A's request\, #C2 -VERSION:2.0 -BEGIN:VEVENT -ATTENDEE;PARTSTAT=DECLINED:Mailto:Y@example.com -ORGANIZER:MAILTO:A@example.com -UID:calsrv.example.com-873970198738785@example.com -SEQUENCE:1 -REQUEST-STATUS:2.0;Success -DTSTAMP:19970612T190000Z -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:CANCEL -X-LIC-NOTE: #I7: Cancel #c1 -VERSION:2.0 -BEGIN:VEVENT -ORGANIZER:Mailto:B@example.com -ATTENDEE;CUTYPE=INDIVIDUAL:Mailto:A@example.com -ATTENDEE;CUTYPE=INDIVIDUAL:Mailto:B@example.com -ATTENDEE;CUTYPE=INDIVIDUAL:Mailto:C@example.com -ATTENDEE;CUTYPE=INDIVIDUAL:Mailto:D@example.com -COMMENT:Mr. B cannot attend. It's raining. Lets cancel. -UID:calsrv.example.com-873970198738777@example.com -SEQUENCE:1 -UID:calsrv.example.com-873970198738777@example.com -STATUS:CANCELLED -DTSTAMP:19970613T190000Z -END:VEVENT -END:VCALENDAR - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -METHOD:COUNTER -X-LIC-NOTE: #I8. Counter to #C1. Changed DTEND to DURATION. -VERSION:2.0 -BEGIN:VEVENT -DTSTAMP:19970611T190000Z -DTSTART:19970701T190000Z -DURATION:PT2H -ORGANIZER:Mailto:B@example.com -ATTENDEE;RSVP=TRUE;CUTYPE=INDIVIDUAL;CN=C:Mailto:C@example.com -SUMMARY:Conference -COMMENT: I think the conference should be 2 hours long -UID:calsrv.example.com-873970198738777@example.com -SEQUENCE:1 -END:VEVENT -END:VCALENDAR - diff --git a/other-licenses/libical/test-data/recur.txt b/other-licenses/libical/test-data/recur.txt index f158a2a96b8..05a5b763c01 100644 --- a/other-licenses/libical/test-data/recur.txt +++ b/other-licenses/libical/test-data/recur.txt @@ -1,3 +1,70 @@ +BEGIN:VEVENT +DESCRIPTION + :Repeat every tuesday and wednesday starting Tue 2nd April 2002 +RRULE + :FREQ=WEEKLY;INTERVAL=1;COUNT=6;BYDAY=TU,WE +DTSTART + :20020402T114500 +DTEND + :20020402T124500 +END:VEVENT + +BEGIN:VEVENT +DESCRIPTION + :This freezes the icalrecur_iterator_new function +RRULE + :FREQ=YEARLY;INTERVAL=1 +DTSTART + :19990201T172000 +DTEND + :19990201T182000 +END:VEVENT + +BEGIN:VEVENT +DESCRIPTION +======= + :Monday of week number 20 (where the default start of the week is Monday)\, + forever: +DTSTART + ;TZID=US-Eastern + :19970512T090000 +RRULE + :FREQ=YEARLY;INTERVAL=1;COUNT=10;BYDAY=MO;BYWEEKNO=20 +END:VEVENT + + +BEGIN:VEVENT +DESCRIPTION + : Once a Year +DTSTART + ;TZID=US-Eastern + :20010205T090000 +RRULE + :FREQ=YEARLY;INTERVAL=1 +END:VEVENT + +BEGIN:VEVENT +DESCRIPTION + :Recur every sunday and tuesday +RRULE + :FREQ=WEEKLY;COUNT=10;INTERVAL=1;BYDAY=SU,TU +DTSTART + :20011216T192500 +DTEND + :20011216T202500 +END:VEVENT + +BEGIN:VEVENT +DESCRIPTION + :Every first tuesday of the month +RRULE + :FREQ=MONTHLY;INTERVAL=1;COUNT=3;BYDAY=1TU +DTSTART + :20011204T153500 +DTEND + :20011204T163500 +END:VEVENT + BEGIN:VEVENT DESCRIPTION :Daily for 10 occurrences: @@ -402,3 +469,5 @@ RRULE :FREQ=WEEKLY;COUNT=4;INTERVAL=2;BYDAY=TU,SU END:VEVENT + + diff --git a/other-licenses/libical/test-data/simple-mime.txt b/other-licenses/libical/test-data/simple-mime.txt index aa7113a82fc..e69de29bb2d 100644 --- a/other-licenses/libical/test-data/simple-mime.txt +++ b/other-licenses/libical/test-data/simple-mime.txt @@ -1,26 +0,0 @@ -From: foo1@example.com -MIME-Version: 1.0 -To: foo2@example.com,foo3@example.com -Subject: REQUEST - Phone Conference -Content-Type:text/calendar; method=REQUEST; charset=US-ASCII; - Component=vevent -Content-Transfer-Encoding: 7bit -Content-Disposition: attachment; filename="event.vcs" - -BEGIN:VCALENDAR -PRODID:-//ACME/DesktopCalendar//EN -VERSION:2.0 -BEGIN:VEVENT -ORGANIZER:foo1@example.com -ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:MAILTO:employee-A@host.com -ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:mailto:Employee-B@HOST.com -ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:MailTo:Eric@Agony.Qualcomm.com -DTSTAMP:19970611T190000Z -DTSTART:19970621T170000Z -DTEND:199706211T173000Z -SUMMARY:Let's discuss the attached document -UID:calsvr.example.com-873970198738777-8aa -SEQUENCE:0 -STATUS:CONFIRMED -END:VEVENT -END:VCALENDAR