Fix bug 394902 - update libical; stripped 0.40 without changes. r=philipp

This commit is contained in:
Daniel Boelzle [:dbo] 2008-10-26 16:12:55 +01:00
Родитель 6edd51e4e7
Коммит 24c33c84c6
607 изменённых файлов: 2080 добавлений и 101393 удалений

Просмотреть файл

@ -1,8 +1,6 @@
Art Cancro (version 0.27)
Omar Kilani (version 0.26)
John Gray <gray@agora-net.com>
Eric Busboom <eric@softwarestudio.org>
Andrea Campi <a.campi@inet.it>
Original author May 1998-December 2001, Eric Busboom <eric@softwarestudio.org>
Art Cancro [http://www.citadel.org]
Wilfried Goesgens [http://www.citadel.org]
John Gray <gray@agora-net.com>
Omar Kilani [http://www.rememberthemilk.com]

Просмотреть файл

@ -1,832 +0,0 @@
2004-02-04 JP Rosevear <jpr@ximian.com> (merged to upstream by Ross Burton and Art Cancro)
* src/libicalvcal/icalvcal.c (icalvcal_traverse_objects): just
return on unknown property
2004-08-02 Not Zed <NotZed@Ximian.com> (merged to upstream by Ross Burton and Art Cancro)
* src/libicalvcal/vcc.y: re-alloc when we reach the buffer length,
not one past it. Fixes an ABW.
2005-09-15 Tor Lillqvist <tml@novell.com> (merged to upstream by Ross Burton and Art Cancro)
* src/libical/vsnprintf.c: No reason not to include config.h also
on Win32.
2007-05-18 Matthew Barnes <mbarnes@redhat.com> (merged to upstream by Ross Burton and Art Cancro)
* src/libical/icalvalue.c: Fix implicit function declarations.
2007-03-?? Art Cancro <ajc@uncensored.citadel.org>
* Updated tzdata in order to deal with daylight savings time changes in the US.
200?-??-?? Omar Kilani (merged to upstream by Art Cancro)
* Merge the libical forks from KDE, Evolution, and SourceForge.
2002-07-09 Andrea Campi <a.campi@inet.it>
* src/libical/icalcomponent.c
* src/libical/icalcomponent.h: Added a check for valid component kind
before instancing a new one.
2002-07-08 Andrea Campi <a.campi@inet.it>
* src/python/Gauge.py
* src/python/LibicalWrap.i
* src/python/Property.py
* src/python/Store.py
* src/python/Time.py
* src/python/python-binding.txt
* src/python/test.py: Updated the python bindings to match the C API
changes.
Obtained from: Mark Tearle
2002-07-04 Andrea Campi <a.campi@inet.it>
* src/libical/icalderivedproperty.c.in
* src/libical/icalproperty.c
* src/libical/icalproperty.h: Added a check for valid property kind
before instancing a new one.
* src/libical/icalvalue.c: Fixed icalvalue_new_clone to properly clone
X- properties.
2002-06-28 Andrea Campi <a.campi@inet.it>
* design-data/parameters.csv
* src/libicalss/icalgauge.c
* src/libicalss/icalgaugeimpl.h
* src/libicalss/icalsslexer.c
* src/libicalss/icalsslexer.l
* src/libicalss/icalssyacc.c
* src/libicalss/icalssyacc.h
* src/libicalss/icalssyacc.y: Added IS NULL to icalgauge
syntax.
Obtained from: Paul Lindner
* src/libical/icallexer.c
* src/libical/icallexer.l
* src/libical/icalyacc.c
* src/libical/icalyacc.h
* src/libical/icalyacc.y: Sent lex/yacc code to Attic.
* src/libical/icalparameter.c: Changed icalparameter_as_ical_string
to also quote the param value if it contains a , (comma), as per RFC2445.
* src/libicalss/icalset.c
* src/libicalss/icalset.h: Added experimental code to support
dynamic loading of icalset derived classes.
* src/libicalss/Makefile.am
* src/libicalss/icalspanlist_cxx.cpp
* src/libicalss/icalspanlist_cxx.h: Added C++ binding for libicalss.
Obtained from: Paul Lindner
2002-06-28 Eric Busboom <eric@softwarestudio.org>
* src/libical/Makefile.am
* src/libical/icalduration.c
* src/libical/icalparser.c
* src/libical/icalvalue.c
* src/libical/icalyacc.c
* src/libical/icalyacc.h: removed lex and yacc by writing
code to parse UTC-OFFSET
2002-06-27 Andrea Campi <a.campi@inet.it>
* src/libical/icalcomponent.c
* src/libical/icalcomponent.h: Added icalcomponent_foreach_recurrence
as a better way of handling recurrences; deprecated
icalcomponent_get_span
Obtained from: Paul Lindner
* src/libical/icalderivedvalue.c.in
* src/libical/icalvalue.c
* src/libical/icalvalue.h: Added a check for valid value kind before
instancing a new one.
Obtained from: Paul Lindner
* src/libical/icalproperty.c
* src/libical/icalproperty.h: Deprecated icalproperty_remove_parameter,
added 3 new functions to do the same in a safer way (wrt X- params).
Obtained from: Paul Lindner
* src/libical/icaltime.c
* src/libical/icaltime.h: Added functions to work with time spans.
Obtained from: Paul Lindner
2002-06-26 Andrea Campi <a.campi@inet.it>
* src/libical/icalduration.c: Fixed icaldurationtype_from_int to
generate valid RFC2445 durations (it used to mix weeks and other
time units).
2002-06-13 Andrea Campi <a.campi@inet.it>
* src/libical/icalvalue.c: Fixed escaping of TEXT values and
formatting of UTCOFFSET values to more closely match RFC2445.
* configure.in
* src/libical/Makefile.am
* src/libical/icalparameter_cxx.cpp
* src/libical/icalparameter_cxx.h
* src/libical/icalproperty_cxx.cpp
* src/libical/icalproperty_cxx.h
* src/libical/icalvalue_cxx.cpp
* src/libical/icalvalue_cxx.h
* src/libical/vcomponent.cpp
* src/libical/vcomponent.h
* src/libicalss/icalbdbset_cxx.h: Added C++ binding.
Obtained from: Paul Lindner
* configure.in
* src/libicalss/Makefile.am
* src/libicalss/icalbdbset.c
* src/libicalss/icalbdbset.h
* src/libicalss/icalbdbset.h
* src/libicalss/icalbdbsetimpl.h
* src/test/Makefile.am
* src/test/storage.c: Added BerkeleyDB 4.0 icalset implementation.
Obtained from: Paul Lindner
2002-06-11 Andrea Campi <a.campi@inet.it>
* src/test/Makefile.am
* src/test/regression-classify.c
* src/test/regression-component.c
* src/test/regression-recur.c
* src/test/regression-utils.c
* src/test/regression.c
* src/test/regression.h
* src/test/test_fileset.ics: New regression test suite
Obtained from: Paul Lindner
* src/libical/icalcomponent.c
* src/libical/icalproperty.c
* src/libical/icalproperty.h
* src/python/test.py
* src/test/regression.c: Improved X- parameter handling.
Obtained from: Mark Tearle
2002-06-07 Andrea Campi <a.campi@inet.it>
* configure.in
* src/libical/Makefile.am
* src/libical/icallexer.l
* src/libical/icalparser.c
* src/libical/icalparser.h
* src/libical/icalyacc.y
* src/libicalss/Makefile.am
* src/libicalss/icalgauge.c
* src/libicalss/icalsslexer.c
* src/libicalss/icalsslexer.l
* src/libicalss/icalssyacc.c
* src/libicalss/icalssyacc.h
* src/libicalss/icalssyacc.y: Made parser fully reentrant using
recent versions of flex/bison. Also committed the generated files
so that the library can be compiled even without those tools.
Obtained from: Paul Lindner
* src/python/LibicalWrap.i
* src/python/Property.py
* src/python/test.py: Support X- properties in the Python wrapper.
Obtained from: Mark Tearle
2002-06-04 Andrea Campi <a.campi@inet.it>
* *: Constifed a lot of functions, also made a few of them static
Obtained from: Paul Lindner <lindner@inuus.com>
2002-06-03 Andrea Campi <a.campi@inet.it>
* src/libical/icallangbind.c
* src/python/Component.py
* src/python/Gauge.py
* src/python/Libical.py
* src/python/LibicalWrap.i
* src/python/Store.py
* src/python/test.py: Fully implemented FileStore and Gauge
in the python bindings.
Obtained from: Mark Tearle <mtearle@tearle.com>
2002-05-28 Andrea Campi <a.campi@inet.it>
* src/libical/icalattach.c
* src/libical/icalattach.h
* src/libical/icalattachimpl.h
* src/libical/icalderivedproperty.c.in
* src/libical/icalderivedvalue.c.in
* src/libical/icalderivedvalue.h.in
* src/libical/icaltypes.c
* src/libical/icaltypes.h
* src/libical/icalvalue.c
* src/libical/icalvalueimpl.h: Changed ATTACH to be an opaque type
2002-05-27 Eric Busboom <eric@softwarestudio.org>
* scripts/mkderivedparameters.pl
* scripts/mkderivedproperties.pl
* scripts/mkderivedvalues.pl
* src/libical/icalderivedparameter.c.in
* src/libical/icalderivedparameter.h.in
* src/libical/icalderivedproperty.c.in
* src/libical/icalderivedproperty.h.in
* src/libical/icalderivedvalue.c.in
* src/libical/icalderivedvalue.h.in: changed the auto generated
files and scripts so that the generated code is inserted into the
middle of the template (.in) file, instead of the end. This means
we could get rid of the declaration for the maps.
2002-05-27 Andrea Campi <a.campi@inet.it>
* src/libical/icaltimezone.c: Worked around Outlook/Exchange brokenness.
Obtained from: evolution CVS repository
2002-05-24 Andrea Campi <a.campi@inet.it>
* src/libical/icalproperty.c: Implemented proper RFC2445 folding.
Obtained from: evolution CVS repository
* src/libical/icalrecur.c: Worked around Outlook/Exchange brokenness.
Obtained from: evolution CVS repository
2002-05-21 Andrea Campi <a.campi@inet.it>
* src/libical/*: Removed void * in favor of opaque typedef types.
This helped uncover a few bugs and made debugging easier.
Obtained from: Paul Lindner
2002-05-10 Andrea Campi <a.campi@inet.it>
* src/libical/icalmemory.c: Made the memory allocator threadsafe.
This code is currently conditional on USE_THREAD, but it might
become the default in the future.
Obtained from: Paul Lindner
* src/libical/icaltime.c: Implemented icaltime_is_date(), with the
intent of removing all direct accesses to is_date.
2002-05-09 Andrea Campi <a.campi@inet.it>
* icaltime.c Rewrote and documented icaltime API, with the goal of
keeping it stable until release 1.0. Some functions and internal
implementation details are now declared obsolete and removed from
the documentation; they will be removed at a later time.
2001-12-12 Eric Busboom <eric@softwarestudio.org>
* icalrecur.c implemented recurrence rule for "FREQ=YEARLY",
with no BY rules.
2001-12-11 Eric Busboom <eric@softwarestudio.org>
* icalrecur.c Fixed bug in next_month for MONTHLY rules that have
only BYDAY rules. The code would miss valid dates that fell on the
first of the month. created new routine is_day_in_byday()
* icaltime.c Fixed icaltime_from_day_of_year to correctly handle
negative and over-range day-of-years
* icaltime.c collected all instances of leap year code into
icaltime_is_leap_year
* icaltime.c icaltime_day_of_year. Changed an assert into code
that advances the year when the day of year is lager than the
number of days in the given year
* icalerrno.c,h Added the function version
icalerror_set_errno. Only the define verson existed.
* icaltime.c Moved all of the getenv/putenv operations into icaltimegm()
2001-06-29 Eric Busboom <eric@softwarestudio.org>
* icalderivedproperties.h,c Changed the signature if the CLASS
property from TEXT to CLASS. ( enum icalproperty_class)
2001-06-22 Eric Busboom <eric@softwarestudio.org>
* icaltypes.c Fixed bug in icaltriggertype_new_from_string htat
caused it to fail.
2001-04-12 Eric Busboom <eric@softwarestudio.org>
* icalvalue.c Added quoting to apostrophies ("'") in text
values. This is not required by the spec, but it is necessary in
icallangbind_property_eval_string, since ' is special in both perl
and python.
2001-04-10 Eric Busboom <eric@softwarestudio.org>
* icalvalue.c Added routine icalvalue_reset_kind. This routine is
now called by all autogenerated icalvalue_set_*
routines. icalvalue_reset_kind() will change the kind of the value
based on the data in the value. Currently, it will set a value to
either DATETIME or DATE based on the is_date flag of icaltimetype.
2001-04-09 Eric Busboom <eric@softwarestudio.org>
* icalproperty.h Converted REQUEST-STATUS to use the struct
icalreqstat structure instead of a string
2001-04-01 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icalvalue Changed ACTION properties to take an ACTION value
instead of TEXT. The ACTION value is enumerated.
2001-03-26 Eric Busboom <eric@softwarestudio.org>
* icalparameter.h icalparameter_rsvp_* routines now take, return
ICAL_RSVP_TRUE and ICAL_RSVP_FALSE, not 0 and 1
2001-03-25 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <jpr@ximian.com>
* src/libical/Makefile.am: Sigh, automake is dumber than i thought
2001-02-12 JP Rosevear <jpr@ximian.com>
* 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 <eric@softwarestudio.org>
* src/python/Makefile.am Tweaked makefile to use automake more,
but it stil isn't quie right.
2001-02-09 JP Rosevear <jpr@ximian.com>
* Shush cvs
2001-02-09 JP Rosevear <jpr@ximian.com>
* src/libical/Makefile.am: Slightly over zealous during the merge
2001-02-09 JP Rosevear <jpr@ximian.com>
* src/libical/Makefile.am: Correct typo
* Removal of more auto generated files
2001-02-09 JP Rosevear <jpr@ximian.com>
* Removal of various auto generated files
2001-02-09 JP Rosevear <jpr@ximian.com>
* 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 <eric@softwarestudio.org>
* 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 <clahey@ximian.com>
* 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 <eric@softwarestudio.org>
* 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 <ettore@ximian.com>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icalfileset.c fixed icalfileset_read-from_file so it will handle
lines longer than 80 char properly.
2001-01-23 JP Rosevear <jpr@ximian.com>
* configure.in: Don't AC_INIT on an autogenerated file that does not
exist beforehand
2001-01-23 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icaltime.c implemented icaldurationtype_from_string to parse the
string it self, rather than use lex/yacc
2001-01-15 Eric Busboom <eric@softwarestudio.org>
* icalfileset.c Many improvements. File locking now works, and so
does searching with icalfileset_select()
2001-01-08 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <ettore@helixcode.com>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icalcstp.c added empty bodies to prep_* routines so that shared
libraries would build.
2000-12-11 JP Rosevear <jpr@helixcode.com>
* 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 <limits.h>.
* src/libical/icalrecur.c: Likewise.
* src/libical/icalvalue.c: Likewise.
* src/libical/icalyacc.y: Likewise.
2000-12-11 Federico Mena Quintero <federico@helixcode.com>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icalrecur.c More testing and bug fixes. Many more of the rules
in recur.txt work correctly.
2000-11-28 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icaltypes.c Added routine to create durationtype from string:
icaldurationtype_from_string
2000-11-09 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <federico@helixcode.com>
* 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 <eric@agony.busboom.org>
* Const correctness. Added 'const' all over everywhere.
2000-10-19 Eric Busboom <eric@agony.busboom.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icalvcal.c Added more comments
2000-08-31 JP Rosevear <jpr@helixcode.com>
* configure.in: Don't list config.h in AC_OUTPUT
2000-08-26 Ettore Perazzoli <ettore@helixcode.com>
* 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 <clahey@helixcode.com>
* 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 <clahey@helixcode.com>
* src/libical/icalcomponent.c: Fixed an incorrect struct name.
2000-08-25 Peter Williams <peterw@helixcode.com>
* 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 <federico@helixcode.com>
* src/test/Makefile.am: Make it work.
2000-08-04 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icalstow.c misc improvements and bug fixes to make it useful.
2000-06-09 Eric Busboom <eric@softwarestudio.org>
* icalrecur.c More extensive code changes for recurrence rule.
* icalyacc.y Added support for integers in by day lists
2000-06-01 Eric Busboom <eric@softwarestudio.org>
* icalrecur.c moved recur code into new files
2000-05-30 Eric Busboom <eric@softwarestudio.org>
* 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 <eric@softwarestudio.org>
* icalstore.c Vastly improved icalstore_test.
2000-03-16 Eric Busboom <eric@softwarestudio.org>
* 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.

Просмотреть файл

@ -1,534 +0,0 @@
Version 0.27, 2007-Feb-27
-------------------------
Merges some patches from KDE and Citadel.
Updates timezone data to tzdata 2007c.
Version 0.26, 2005-Sep-14
-------------------------
merges the libical forks from KDE, Evolution and SourceForge. Updates
timezone data to tzdata 2005j.
Version 0.24, XX Xxx 2002 ( cvs tag libical-0-24 )
--------------------------------------------------
**** Incompatibilities with previous version ****
CSTP client/server code has been removed from libicalss.
Future versions will eventually contain a full CAP 6.0
client/server implementation.
icalproperty_get_name() is deprecated and will change
in a future release. Use icalproperty_get_icalproperty_name()
instead.
icalcomponent_get_span() is deprecated in this release
because it does not handle recurring events. See
icalcomponent_foreach_recurrence() for an alternate
interface.
The icalproperty_remove_parameter() call is deprecated
because it improperly deals with extended parameters.
See icalproperty_remove_parameter_by_kind() for a
compatible call.
Code that deals with the TRANSPARENT property now
uses enumeration values to get/set values instead of
strings.
The code for dealing with icalsets was overhauled. You
will want to use the common icalset_* routines
directly instead of calling into the icalfileset_* or
icaldirset_* routines.
A number of routines now expect to be called with
const arguments. A number of routines now
return pointers to const data.
**** New Features ****
Major cleanup of the time-handling routines. New API is
available that deals with timezones much more cleanly.
The regression routines in src/test are much cleaner.
Test runs summarize which tests fail and do not
immediately abort() like the old set of tests. A
number of old, commented tests were resurrected.
C++ Interface: New libraries libical_cxx.la and libicalss_cxx.la
are build when you configure with the --enable-cxx option.
Java Interface: A JNI interface to libical is build when
you configure with the --enable-java option.
Most of libical is now reentrant and thread safe. The Lex/Yacc
query parser is pre-built with flex 2.5.8 and bison 1.34. To
rebuild these files you will need to specify the --with-devel
option. The --enable-reentrant option also adds the -D_REENTRANT
flag for systems that require it. The build system attempts to
add the pthread libraries to support a thread safe memory allocator
and thread-safe error handling.
A new storage mechanism for Berkeley DB 4.0 was contributed
by Critical Path. Specify the --with-bdb4 and --with-bdb4-dir
options to enable.
Embedded code comments are slowly being migrated to be
doxygen compliant. See http://www.doxygen.org/ for
more on this wonderful tool.
The code should now compile with non-gcc compilers. Certain
parts of the autogenerated code were causing problems. The
code base has also been ported to the windows Visual C
environment.
Version 0.23, 26 Mar 01 ( cvs tag libical-0-23 )
------------------------------------------------
**** Incompatibilities with previous versions ****
icalparameter_new_rsvp
icalparameter_get_rsvp
icalparameter_set_rsvp
These routines now take and return ICAL_RSVP_TRUE and
ICAL_RSVP_FALSE instead of 0 and 1
icalenum_*_to_*
These routines have been moved to icalproperty, icalparameter
or icalvalue
Python interface: An alpha level python interface is available in
src/python.
Perl interface: A pre-alpha level interface is available in
src/Net-ICal-Libical
Code Autogeneration: Converted all of the important files in
design-data/ to .csv files and improved the code that is generated
from them. Now all of the enumerations for property, parameters and
values are generated from thes files, as are the string
representations for the enumerations. You can add a new property or
parameter to the system simply by adding a line to the appropriate
file in design-data/
Recurrences: Improved the recurrence code by fixing bugs in MONTHLY
recurrences and completely re-implementing expand_year_days() for
YEARLY recurrences. Hubert V's aided in testing.
Build system: JP Rosevear made several improvements to the build
system. Now checking out the code from cvs should give to a complete
but minimal distribution, without any of the autognerated files.
Interface changes: Nearly all of the icalenum routines for converting
between strings and enumerations have been moved out of icalenum into
icalproperty, icalparameter and icalvalue. This means that their names
have changed, although #defines have been added to icalenum.h to map
back to the old names.
Added src/libical/icllangbind.c that has some functions to make it
easier to bind libical to other languages.
Version 0.22, 15 Jan 01 ( cvs tag libical-0-22)
----------------------------------------------
Many improvements to the time routines in icaltime.c. I think that
they actually make sense now. Note that there is an interface change
with icaltime_from_timet() -- I removed the is_utc parameter, since
all timet values are in UTC. Use icaltime_from_int() if you really
want the old interface
Major improvements to icalfileset. icalfileset_select now works and so
does file locking.
Minor revision to the documentation, but it does include a new section
on file storage ( icalfileset ) and time ( icaltime.c)
Lots of bug fixes and small patches.
I improved the regression test in src/test/regression.c. It now have
command line switches to select specific tests ( undocumentated, of
course ) and more of the tests include asserts, so you can just run it
without looking at the output. If the test runs without crashing, it
is mostly OK.
Version 0.21, 20 Nov 00 ( cvs tag libical-0-21)
----------------------------------------------
* 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
* icaltypes.c Added routine to create durationtype from string:
icaldurationtype_from_string
* 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.
* 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.
Version 0.20D 3 Nov 00
-----------------------
Many miscelaneous tweaks to the build system
More work to icalclassify.
Aded routines to icaltime.c to convert to and from specific timezones
in Olsen format ("America/Los_Angeles")
Version 0.20 7 Sept 00 (cvs tag libical-0-20 )
----------------------------------------------
Addedd icalclassify() which looks at a message and determine how to
process it.
Misc bug fixes and tweaks.
Version 0.19 6 August 00 (cvs tag libical-0-19)
-----------------------------------------------
Created a MIME parser in icalmime.c. This will take any complex MIME
encapsulated message and return an icalcomponent with the same
structure. Each MIME part is represented by a component of type
X-LIC-MIMEPART.
Added MIME partsing to stow.c
Added external iterators to icalcomponent. See test_iterators() in
test/regression.c
Refactored icalcluster and icalstore into icalset, icalfileset and
icaldirset, which have a pseudo inheritance relationship between them.
Fixed more memory leaks.
Version 0.18a 10 June 00 ( cvs tag libical-0-18a )
-----------------------------------------------
Did the final tweaks to stow.c, a program to recieve and store iMIP
messages.
Version 0.18 10 June 00 ( cvs tag libical-0-18 )
-----------------------------------------------
Added libicalvcal, which includes the Versit code for parsing vCal
files and a routine (icalvcal_convert() ) that converts a vCal object
to an iCal object. The test program is src/test/testvcal.
Added marginally functional recurrence code. The curent code does not
handle all of the examples in rfc2445 ( which are extracted in
test-data/recur.txt ) but it can do all of the obvious cases. See the
test program in src/test/recur.c for an example. In particular, the
code cannot handle the integer values in BYDAY, nor negative integers
in BYMONTH or BYMONTHDAY. It also cannot handle BYSETPOS.
Moved some code to the examples directory and improved the comments.
Did a little more work on the documentation in the doc directory. The
documentation is in LyX source, but there is a text version in
UsingLibical.txt
Version 0.17 15 May 00 (cvs tag libical-0-17 )
---------------------------------------------
Fixed two bugs that added extraneous '/' to test values
Fixed type in internal string for the COUNTER method
Eliminated a memory leak in icalparser.c
Version 0.16a 29 April 00
----------------------------------------------
Fixed bug in icalvalue_new_from_string that caused METHOD value to
choke on non standard input.
Fixed a memory leak in icalparser_add_line -- failed to free 'line'
Version 0.16 5 April 00 ( cvs tag libical-0-16)
----------------------------------------------
Now using automake.
Substantial changes to the parser. New interfaces let you parser
multiple components from a single stream by feading the parser object
one line at a time.
Added a STRING value type. this type is like TEXT, but does not
backslash magic characters. It is used in PRODID and REQUEST-STATUS,
where the '/' and ';' are literal.
Added several convience functions for REQUEST-STATUS to icalenums.c
Addedd a routine to icalcomponent to convert X-LIC errors to
REQUEST-STATUS return values.
Version 0.15a 5 Mar 00 (cvs tag libical-0-15a)
---------------------
Experimented with CVS
Fixed icalvalue_set_text to convert escaped characters into the proper
values.
Other minor code tweaks.
Version 0.15 7 Feb 00
---------------------
Split the storage classess ( icalstore, icalcluster, icalcalendar )
into a seperate library, libicalss
Implemented restriction checking in file icalrestrictions.c. The
checking is not complete, but can handle the bulk of the restrictions
described in RFC 2446.
Created a new value type, METHOD. Changed METHOD property to use the
new value. The METHOD value uses an enumeration.
Version 0.14b
-------------
Implemented parsing of RECUR values, although it does not handle BYDAY
specs with numbers.
Fixed error in icalparser_next_line that mangled lines longer than the
temp buffer (1024 chars.) The temp buffer is now 80 chars, and it can
handle (apparently) arbitrary length lines
Fixed severe brokenness in a value, but I forgot which one.
Cleaned cruft out of the distribution, so the tarfile is smaller.
Version 0.14a 14 Jan 00
-----------------------
Fixed bug in ROLE parameter -- missing '-' in the text of allowed values
Fixed bug in X-parameters
Version 0.14 11 Jan 00
----------------------
Fixed wrong value type for TRIGGER property
Added Calendar object. Calendar is an aggregate of two stores and two
clusters, and can store all of the inforamation associated with a
calendar.
icalcomponent_add_property and icalcomponent_add_component will
complain if you try to add a component or property that is already
part of an other component. The *_free routines wil complain if you try
to free a linked component or property.
More improvements to error handling.
Parser is much more robust.
Minor memory enhancements.
Regression test runs without memory leaks.
Version 0.13d 21Dec99
---------------------
Seperated perl interface and library
Added autoconf support
Scripts that generate derived properties, values and parameters now
change source and header files inline.
Changed icalstore to cluster all components with DTSTART in a month
into a single file. This should reduce number of file accesses by a
factor of 60.
Ran code through Purify and fixed memory leaks.
Version 0.13 16Nov99
---------------------
Yet more bug fixes! Yeah!
Added better error handling. The Parser inserts X-LIC-*ERROR
properties to warn of parsing errors.
The imip source/sink programs in /src/imip is demonstrably functional.
Version 0.12b 17Oct99
---------------------
More bug fixes, particularily in parse from string routines
ICal::Store is mostly functional
This is version is a checkpoint, not a release.
Version 0.12a 10Oct99
---------------------
Expanded perl interface:
Added 1/2 of Store module
Fixed bugs
Implemeted get_{first,next}_property
Extended C interface
Made get_{first,next}_property work properly
Fixed bugs
This is version is a checkpoint, not a release.
Version 0.12 27Aug99
--------------------
Added a rudimentatry perl interface
This is version is a checkpoint, not a release.
Version 0.11 11Aug99
--------------------
Eliminated most use of flex/bison -- all parsing, except for the
values, is done in C.
Cleaned up memory leaks. Purify claims that I got them all.
Moved all derived component/prop/param/value code ( in .inc / .h
files) into main files ( icalcomponent.{c,h}, icalproperty.{c,h}, etc/
)
Implemented *_clone routines.
Fixed a lot of bugs.
Implemented more value types. Still unimplemeneted are BINARY and RECUR
Included MacOS/Code Warior files from Graham Davison
Version 0.10 8Jul99
-------------------
Eliminated shift/reduce and reduce/reduce conflicts in the parser.
This version is almost feature complete -- it has the basic structure
for all of the library's functionality, and it will only require
implementing procedure shells and fixing bugs. I think that all of the
hard work is done...
Version 0.09a,b 3,7 Jul99
-------------------------
Various improvements to the parser, added some functionality. The parser code
is mostly complete, and should be fully functional, except for a horde of
bugs. Also added support for X-Properties.
Version 0.09 25Jun99
--------------------
Added a parser in files src/comp/icalitip.{y,l} The lexer is mostly
functional, but the parser is not.
Version 0.08 2Jun99
--------------------
All files now have MPL licensing
Implement enough of the code to perform some rudimentary testing
Version 0.07 14May99
--------------------
Remove all interfaces that construct object from a string
Moved most code back into comp directory
Implemented C files for most headers -- usecases.c now links.
Many improvements to generation scripts.
Version 0.06 25Apr99
--------------------
Expanded distribution to include:
Directory structure that can accomodate future expansion
Several levels of Makefiles
This CHANGES file
Added headers for irip and parse modules
Added several files with design information
Added scripts that I had used to generate much of the ical header code.
Split C headers from CC headers
Added data for iTIP and iCAL component restrictions in restrictions.csv
Version 0.05 11Apr99
----------------------
Changes to ical headers
Added derived Property classes.
Improved the interface to the derived property and parameter classes
Added derived component classes.
Created usecases.c and ccusecases.cc to demonstrate use
C++ interface compile
Version 0.04 5Apr99
-------------------
Version 0.02 30Mar99
--------------------

Просмотреть файл

@ -1,101 +0,0 @@
LIBICAL -- An implementation of basic iCAL protocols
Most of the code in here was written by Eric Busboom with help from
dozens of contributors. It is currently (and minimally) maintained
by Art Cancro.
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.
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.
Portions of this distribution are Copyright (c) 1997 Theo de
Raadt. See the header for src/libical/vsnprintf.c for the full
copyright statement.
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://www.softwarestudio.org/softwarestudio/app.php/libical
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 CentOS Linux and usually
compiles on Solaris and FreeBSD. There are reports of success of
previous version on MacOS ( with CodeWarrior ) and on UnixWare, but we
don't know about any other systems.
The library is configured with automake. IF YOU ARE BUILDING THE
SOURCE FROM A TARBALL, 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
IF YOU ARE BUILDING FROM CVS, there will be no configure file until
you create one with autogen.sh. YOu can pass configure parameters to
autogen.sh on the command line.
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 and the test code in src/test.

Просмотреть файл

@ -1,69 +0,0 @@
Thanks to:
Allan Clark <allanc@atlas.platypus.bc.ca> for testing libical against
UnixWare.
Graham Davison <g.m.davison@computer.org> for MacOS support and
miscelaneous code bits
Seth Alves <alves@hungry.com> for the first cut at the Makefile.am
files and various utility functions.
Russ Steinthal <rms39@columbia.edu> for several utility functions and
comments.
Ola Lundqvist <olalu526@student.liu.se> for the vCal test data file.
Colin DuPlantis <colin@cp.net> for new functions in icalparser.c
Holger Schmidt <hschmidt@chronolabs.de> for all of icalcstp.c, The
CSTP protocol implementation, and modifications to icalcstp.h
Gisle Hannemyr <gisle@oslonett.no> 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
<federico@helixcode.com>, JP Rosevear <jpr@helixcode.com>, Ettore
Perazzoli <ettore@helixcode.com>, Christopher James Lahey
<clahey@helixcode.com>, Peter Williams <peterw@helixcode.com>) for
miscelaneous patches and adjustments to the build system.
Cornelius Schumacher <schumacher@kde.org> for many insightful
suggestions and a few patches.
Mark D. Anderson <mda@discerning.com> for discussions and ideas.
Martin Neimeier <nei@ibn.de> for correcting bugs in icalrecur.c
Tom Leitner <tom@radar.tu-graz.ac.at> For several bug fixes in
compiling on Tru64 UNIX.
Patrick Lewis <plewis@inetarena.com> for several bug reports and
substantial ( co-authorship) contributions to the Python bindings
Larry W. Virden <lvirden@cas.org> for several bug reports in compiling
on Solaris.
Bryan Bartone <bsb@mesasys.com> for code changes based on porting
libical to Windows.
Hubert V <hubertv@bigfoot.com> for checking and analyzing the output
of the recurrence rule system.
Jonathan Yue <jonathan.yue@cp.net> for icalproperty_get_name()
Jeff Mace <jhm18@psu.edu> for finding bugs in gauges.
John Gray <gray@agora-net.com> for routing memory leaks, porting to
WIN32, and taking over leadership of the project.
Andrea Campi <a.campi@inet.it> for miscellaneous updates and beginning
of Doxygen documentation.
Paul Lindner <plindner@cp.net> for several contributions, including
C++ binding, reentrant parser, thread safe memory allocator, and a
lot of documentation.
Mark Tearle <mtearle@tearle.com> for keeping the Python bindings up
to date.

Просмотреть файл

@ -1,39 +0,0 @@
TODOs for libical
-----------------
libical treats properties with multiple values incorrecty -- it always
seperates multiple values into multiple properties. This is not
acceptable for CATEGORIES and RESOURCES.
Some TEXT valued properties, like METHOD, have a limited set of valid
values. The code should check that the values of these properites are
valid. ( Although METHOD now uses enums, and is not really TEXT valued )
Finish implementing values
ATTACH/BINARY
content_type
language
Check for buffer overflow on external input.
Error Handling
Dates and times: the parser will accept many illegal date time
values
RECUR values ignore integers in BYDAY clauses, ie 'FREQ=MONTHLY;BYDAY=-1SU'
Restrictions code does not catch lack of DTEND or DURATION
For some value types, if there illegal characters in the value ( like
4.56 in an integer value), the parser will output the characters to
stdout.
Check all uses of strcpy and sprinf for buffer overflows
Make the mime parsing code in sspm grow the list of parts as needed,
rather than having a hard limit.
in sspm.c, and unrecognized content-transfer-encoding values must
force a content type of application/octet-stream.

Просмотреть файл

@ -1,117 +1,16 @@
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <assert.h> header file. */
#define HAVE_ASSERT_H 1
/* Define to 1 if you have the `gmtime_r' function. */
/* XXX Not using gmtime_r isn't threadsafe */
/* #define HAVE_GMTIME_R 1 */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if we have pthread. */
/* #undef HAVE_PTHREAD */
/* Define to 1 if you have the <pthread.h> header file. */
/* #undef HAVE_PTHREAD_H 1 */
/* Define to 1 if you have the `snprintf' function. */
#ifdef XP_WIN
#define HAVE_SNPRINTF 1
#define snprintf _snprintf
#endif
/* Define to 1 if you have the <stdint.h> header file. */
#if !defined(XP_WIN32) && !defined(__sun) && !defined(XP_BEOS)
#define HAVE_STDINT_H 1
#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <time.h> header file. */
#define HAVE_TIME_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#ifdef XP_WIN32
#define YY_NO_UNISTD_H 1
#else
#define HAVE_UNISTD_H 1
#endif
/* most of the settings will be properly included from mozilla-config.h */
/* Define to make icalerror_* calls abort instead of internally signalling an
error */
/* #undef ICAL_ERRORS_ARE_FATAL */
#undef ICAL_ERRORS_ARE_FATAL
/* Define if we want _REENTRANT */
/* #undef ICAL_REENTRANT */
#define ICAL_REENTRANT
/* Define to terminate lines with "\n" instead of "\r\n" */
#undef ICAL_UNIX_NEWLINE
/* Define to 1 if you DO NOT WANT to see deprecated messages */
#define NO_WARN_DEPRECATED 1
#define NO_WARN_DEPRECATED
/* Define to 1 if you DO NO WANT to see the warning messages related to
ICAL_MALFORMEDDATA_ERROR and parsing .ics zoneinfo files */
#define NO_WARN_ICAL_MALFORMEDDATA_ERROR_HACK 1
/* Name of package */
#define PACKAGE "libical"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define PACKAGE_STRING ""
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define PACKAGE_VERSION ""
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Version number of package */
#define VERSION "0.24"
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#define YYTEXT_POINTER 1
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
#define PACKAGE_DATA_DIR

Просмотреть файл

@ -1,6 +0,0 @@
EXTRA_DIST =\
properties.csv \
parameters.csv \
restrictions.csv \
status.txt \
value-types.csv

Просмотреть файл

@ -1,347 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = design-data
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BDB_DIR = @BDB_DIR@
BDB_DIR_INCLUDE = @BDB_DIR_INCLUDE@
BDB_DIR_LIB = @BDB_DIR_LIB@
BDB_LIB = @BDB_LIB@
BDB_VERSION = @BDB_VERSION@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEV_FALSE = @DEV_FALSE@
DEV_TRUE = @DEV_TRUE@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
HAVE_PTHREAD_FALSE = @HAVE_PTHREAD_FALSE@
HAVE_PTHREAD_TRUE = @HAVE_PTHREAD_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WITH_BDB4_FALSE = @WITH_BDB4_FALSE@
WITH_BDB4_TRUE = @WITH_BDB4_TRUE@
YACC = @YACC@
YFLAGS = @YFLAGS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
EXTRA_DIST = \
properties.csv \
parameters.csv \
restrictions.csv \
status.txt \
value-types.csv
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu design-data/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu design-data/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# 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:

Просмотреть файл

@ -1,5 +1,6 @@
"#Name ","C Type","Enumeration Values"
"ALTREP","const char*",
"CHARSET","const char*",
"CN","const char*",
"CUTYPE","icalparameter_cutype","INDIVIDUAL;GROUP;RESOURCE;ROOM;UNKNOWN"
"DELEGATED-FROM","const char*",
@ -22,3 +23,12 @@
"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;VCAL-PROP-PARSE-ERROR"
"X-LIC-COMPARETYPE","icalparameter_xliccomparetype","EQUAL;NOTEQUAL;LESS;GREATER;LESSEQUAL;GREATEREQUAL;REGEX;ISNULL;ISNOTNULL"
"#CAP Parameters","Draft 8",
"#this parameter should really be called ACTION, but this conflicts with the ACTION property"
"ACTIONPARAM","icalparameter_action","ASK;ABORT"
"ID","const char*",
"ENABLE","icalparameter_enable","TRUE;FALSE"
"LATENCY","const char*",
"LOCAL","icalparameter_local","TRUE;FALSE"
"LOCALIZE","const char*",
"OPTIONS","const char*",

Не удается отобразить этот файл, потому что он имеет неправильное количество полей в строке 27.

Просмотреть файл

@ -76,3 +76,47 @@
"X-LIC-CLASS","X-LIC-CLASS","X-LIC-CLASS"
"ANY","NO","NO"
"NO","NO","NO"
"#CAP Properties",,
,"FIXME","Should be BOOLEAN"
"ALLOW-CONFLICT","TEXT","TEXT"
"CALID","TEXT","TEXT"
"CALMASTER","TEXT","TEXT"
"CARID","TEXT","TEXT"
"CMD","CMD","CMD"
"CSID","URI","URI"
"DECREED","TEXT","TEXT"
"DEFAULT-CHARSET","TEXT","TEXT"
"DEFAULT-LOCALE","TEXT","TEXT"
"DEFAULT-TZID","TEXT","TEXT"
"DEFAULT-VCARS","TEXT","TEXT"
,"FIXME","Should be UPN-FILTER"
"DENY","TEXT","TEXT"
,"FIXME","Should be BOOLEAN"
"EXPAND","INTEGER","INTEGER"
,"FIXME","Should be UPN-FILTER"
"GRANT","TEXT","TEXT"
"MAXDATE","DATE-TIME","DATE-TIME"
"MINDATE","DATE-TIME","DATE-TIME"
"NAME","TEXT","TEXT"
"OWNER","TEXT","TEXT"
"PERMISSION","TEXT","TEXT"
"QUERY","QUERY","QUERY"
"QUERYID","TEXT","TEXT"
"RELCALID","TEXT","TEXT"
"RESTRICTION","QUERY","QUERY"
"SCOPE","TEXT","TEXT"
"TARGET","CAL-ADDRESS","CAL-ADDRESS"
"#CAP Properties","These are only allowed in VREPLY",
"CAP-VERSION","TEXT","TEXT"
"CAR-LEVEL","CAR-LEVEL","CAR-LEVEL"
"COMPONENTS","TEXT","TEXT"
"STORES-EXPANDED","TEXT","TEXT"
"DATE-MAX","DATE-TIME","DATE-TIME"
"DATE-MIN","DATE-TIME","DATE-TIME"
"ITIP-VERSION","TEXT","TEXT"
"MAX-COMPONENT-SIZE","INTEGER","INTEGER"
"MULTIPART","TEXT","TEXT"
"QUERY-LEVEL","QUERY-LEVEL","QUERY-LEVEL"
"RECUR-ACCEPTED","TEXT","TEXT"
"RECUR-EXPAND","TEXT","TEXT"
"RECUR-LIMIT","TEXT","TEXT"

1
76 X-LIC-CLASS X-LIC-CLASS X-LIC-CLASS
77 ANY NO NO
78 NO NO NO
79 #CAP Properties
80 FIXME Should be BOOLEAN
81 ALLOW-CONFLICT TEXT TEXT
82 CALID TEXT TEXT
83 CALMASTER TEXT TEXT
84 CARID TEXT TEXT
85 CMD CMD CMD
86 CSID URI URI
87 DECREED TEXT TEXT
88 DEFAULT-CHARSET TEXT TEXT
89 DEFAULT-LOCALE TEXT TEXT
90 DEFAULT-TZID TEXT TEXT
91 DEFAULT-VCARS TEXT TEXT
92 FIXME Should be UPN-FILTER
93 DENY TEXT TEXT
94 FIXME Should be BOOLEAN
95 EXPAND INTEGER INTEGER
96 FIXME Should be UPN-FILTER
97 GRANT TEXT TEXT
98 MAXDATE DATE-TIME DATE-TIME
99 MINDATE DATE-TIME DATE-TIME
100 NAME TEXT TEXT
101 OWNER TEXT TEXT
102 PERMISSION TEXT TEXT
103 QUERY QUERY QUERY
104 QUERYID TEXT TEXT
105 RELCALID TEXT TEXT
106 RESTRICTION QUERY QUERY
107 SCOPE TEXT TEXT
108 TARGET CAL-ADDRESS CAL-ADDRESS
109 #CAP Properties These are only allowed in VREPLY
110 CAP-VERSION TEXT TEXT
111 CAR-LEVEL CAR-LEVEL CAR-LEVEL
112 COMPONENTS TEXT TEXT
113 STORES-EXPANDED TEXT TEXT
114 DATE-MAX DATE-TIME DATE-TIME
115 DATE-MIN DATE-TIME DATE-TIME
116 ITIP-VERSION TEXT TEXT
117 MAX-COMPONENT-SIZE INTEGER INTEGER
118 MULTIPART TEXT TEXT
119 QUERY-LEVEL QUERY-LEVEL QUERY-LEVEL
120 RECUR-ACCEPTED TEXT TEXT
121 RECUR-EXPAND TEXT TEXT
122 RECUR-LIMIT TEXT TEXT

Просмотреть файл

@ -29,3 +29,7 @@
"GEO","(a)struct icalgeotype","tuple","unitary",
"STRING","(a)const char*","string","unitary",
"X","(m)const char*","string","unitary",
"#CAP enumeration types",,,,
"CMD","(a)enum icalproperty_cmd","string","unitary","ABORT;CONTINUE;CREATE;DELETE;GENERATE-UID;GET-CAPABILITY;IDENTIFY;MODIFY;MOVE;REPLY;SEARCH;SET-LOCALE"
"QUERY-LEVEL","(a)enum icalproperty_querylevel","string","unitary","CAL-QL-1;CAL-QL-NONE"
"CAR-LEVEL","(a)enum icalproperty_carlevel","string","unitary","CAR-NONE;CAR-MIN;CAR-FULL-1"

Не удается отобразить этот файл, потому что он имеет неправильное количество полей в строке 28.

Просмотреть файл

@ -1,23 +0,0 @@
How to add or change Components, Properties, Values or Parameters
Adding or modifying values
---------------------------
You may have to modify these files or data structures
file design-data/value-c-types.txt
file design-data/prop-to-val.txt
table parameter_map[] in icalenums.c
enum icalvalue_kind in icalenum.h
table value_map[] in icalenums.c
enum icalparameter_value in icalenum.h
table propval_map[] in icalenums.c
function icalvalue_as_ical_string() in icalvalue.c
function icalvalue_new_from_string_with_error() in icalvalue.c
When you are done, if you changed any files in the design-data
directory, regnerate derived datatypes in src/libical with "make
derived" or "make icalvalue"

Просмотреть файл

@ -1 +0,0 @@
EXTRA_DIST = UsingLibical.lyx UsingLibical.ps UsingLibical.txt

Просмотреть файл

@ -1,341 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BDB_DIR = @BDB_DIR@
BDB_DIR_INCLUDE = @BDB_DIR_INCLUDE@
BDB_DIR_LIB = @BDB_DIR_LIB@
BDB_LIB = @BDB_LIB@
BDB_VERSION = @BDB_VERSION@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEV_FALSE = @DEV_FALSE@
DEV_TRUE = @DEV_TRUE@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
HAVE_PTHREAD_FALSE = @HAVE_PTHREAD_FALSE@
HAVE_PTHREAD_TRUE = @HAVE_PTHREAD_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WITH_BDB4_FALSE = @WITH_BDB4_FALSE@
WITH_BDB4_TRUE = @WITH_BDB4_TRUE@
YACC = @YACC@
YFLAGS = @YFLAGS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
EXTRA_DIST = UsingLibical.lyx UsingLibical.ps UsingLibical.txt
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# 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:

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,20 +0,0 @@
noinst_PROGRAMS = doesnothing
if WITH_BDB4
doesnothing_LDADD = ../src/libical/libical.la ../src/libicalss/libicalss.la ../src/libicalvcal/libicalvcal.la @BDB_DIR_LIB@/@BDB_LIB@
else
doesnothing_LDADD = ../src/libical/libical.la ../src/libicalss/libicalss.la ../src/libicalvcal/libicalvcal.la
endif
LIBS = @PTHREAD_LIBS@
INCLUDES = -I. -I../src/libical -I$(srcdir)/../src/libical -I../src/libicalss -I../src/libicalvcal
doesnothing_SOURCES = \
access_components.c \
access_properties_and_parameters.c \
errors.c \
main.c \
parse_text.c

Просмотреть файл

@ -1,469 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
noinst_PROGRAMS = doesnothing$(EXEEXT)
subdir = examples
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(noinst_PROGRAMS)
am_doesnothing_OBJECTS = access_components.$(OBJEXT) \
access_properties_and_parameters.$(OBJEXT) errors.$(OBJEXT) \
main.$(OBJEXT) parse_text.$(OBJEXT)
doesnothing_OBJECTS = $(am_doesnothing_OBJECTS)
@WITH_BDB4_FALSE@doesnothing_DEPENDENCIES = ../src/libical/libical.la \
@WITH_BDB4_FALSE@ ../src/libicalss/libicalss.la \
@WITH_BDB4_FALSE@ ../src/libicalvcal/libicalvcal.la
@WITH_BDB4_TRUE@doesnothing_DEPENDENCIES = ../src/libical/libical.la \
@WITH_BDB4_TRUE@ ../src/libicalss/libicalss.la \
@WITH_BDB4_TRUE@ ../src/libicalvcal/libicalvcal.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(doesnothing_SOURCES)
DIST_SOURCES = $(doesnothing_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BDB_DIR = @BDB_DIR@
BDB_DIR_INCLUDE = @BDB_DIR_INCLUDE@
BDB_DIR_LIB = @BDB_DIR_LIB@
BDB_LIB = @BDB_LIB@
BDB_VERSION = @BDB_VERSION@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEV_FALSE = @DEV_FALSE@
DEV_TRUE = @DEV_TRUE@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
HAVE_PTHREAD_FALSE = @HAVE_PTHREAD_FALSE@
HAVE_PTHREAD_TRUE = @HAVE_PTHREAD_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @PTHREAD_LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WITH_BDB4_FALSE = @WITH_BDB4_FALSE@
WITH_BDB4_TRUE = @WITH_BDB4_TRUE@
YACC = @YACC@
YFLAGS = @YFLAGS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
@WITH_BDB4_FALSE@doesnothing_LDADD = ../src/libical/libical.la ../src/libicalss/libicalss.la ../src/libicalvcal/libicalvcal.la
@WITH_BDB4_TRUE@doesnothing_LDADD = ../src/libical/libical.la ../src/libicalss/libicalss.la ../src/libicalvcal/libicalvcal.la @BDB_DIR_LIB@/@BDB_LIB@
INCLUDES = -I. -I../src/libical -I$(srcdir)/../src/libical -I../src/libicalss -I../src/libicalvcal
doesnothing_SOURCES = \
access_components.c \
access_properties_and_parameters.c \
errors.c \
main.c \
parse_text.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu examples/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
doesnothing$(EXEEXT): $(doesnothing_OBJECTS) $(doesnothing_DEPENDENCIES)
@rm -f doesnothing$(EXEEXT)
$(LINK) $(doesnothing_LDFLAGS) $(doesnothing_OBJECTS) $(doesnothing_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access_components.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access_properties_and_parameters.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_text.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-info-am
# 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:

Просмотреть файл

@ -1,60 +0,0 @@
Usecases
---------
1) iMIP based CUA uses a local, file-based store
2) CAP based CUA uses one or more remote CAP servers
3) CAP based CUA uses a local cache that synchronizes with one or more
CAP servers.
4) CUA imports and exports from a file
Scenarios.
---------
1 Open a connection to a store.
2 Create a new calendar for which user Bob can read and user Alice can
read an write.
3 Create several new calendars
4 Delete a calendar
5 Change the calid of a calendar
6 Delete all calendars belonging to user bob
7 Get three new UIDs from the store
8 Store a new VEVENT in the store.
9 Find all components for which the LOCATION is "West Conference Room"
and change them to "East Conference Room"
10 Find the component with UID X and add a GEO property to it.
11 Delete all VEVENTS which have a METHOD that is not CREATED
12 Retrieve all VEVENTS which have a METHOD that is not CREATED
13 Retrieve the capabilities of the store
14 Retrieve/Modify/Add/Delete properties of a store
15 Retrieve/Modify/Add/Delete VCARs of a store
16 Retrieve/Modify/Add/Delete VTIMEZONEs of a store
17 Retrieve/Modify/Add/Delete properties of a calendar
18 Retrieve/Modify/Add/Delete VCARs of a calendar
19 Retrieve/Modify/Add/Delete VTIMEZONEs of a calendar
20 Translate a CALID into one or more UPNs
21 Expand a group UPN into all of the members of the group

Просмотреть файл

@ -1,318 +0,0 @@
/* Access_component.c */
#include "ical.h"
#include <assert.h>
#include <string.h> /* for strdup */
#include <stdlib.h> /* for malloc */
#include <stdio.h> /* for printf */
#include <time.h> /* for time() */
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(ICAL_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(ICAL_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);
}
}

Просмотреть файл

@ -1,144 +0,0 @@
/* access_properties_and_parameters.c */
#include "ical.h"
#include <string.h>
/* Get a particular parameter out of a component. This routine will
return a list of strings of all attendees who are required. Note
that this routine assumes that the component that we pass in is a
VEVENT. */
void get_required_attendees(icalcomponent* event)
{
icalproperty* p;
icalparameter* parameter;
assert(event != 0);
assert(icalcomponent_isa(event) == ICAL_VEVENT_COMPONENT);
/* This loop iterates over all of the ATTENDEE properties in the
event */
/* The iteration routines save their state in the event
struct, so the are not thread safe unless you lock the whole
component. */
for(
p = icalcomponent_get_first_property(event,ICAL_ATTENDEE_PROPERTY);
p != 0;
p = icalcomponent_get_next_property(event,ICAL_ATTENDEE_PROPERTY)
) {
/* Get the first ROLE parameter in the property. There should
only be one, so we won't bother to iterate over them. But,
you can iterate over parameters just like with properties */
parameter = icalproperty_get_first_parameter(p,ICAL_ROLE_PARAMETER);
/* If the parameter indicates the participant is required, get
the attendees name and stick a copy of it into the output
array */
if ( icalparameter_get_role(parameter) == ICAL_ROLE_REQPARTICIPANT)
{
/* Remember, the caller does not own this string, so you
should strdup it if you want to change it. */
const char *attendee = icalproperty_get_attendee(p);
}
}
}
/* Here is a similar example. If an attendee has a PARTSTAT of
NEEDSACTION or has no PARTSTAT parameter, change it to
TENTATIVE. */
void update_attendees(icalcomponent* event)
{
icalproperty* p;
icalparameter* parameter;
assert(event != 0);
assert(icalcomponent_isa(event) == ICAL_VEVENT_COMPONENT);
for(
p = icalcomponent_get_first_property(event,ICAL_ATTENDEE_PROPERTY);
p != 0;
p = icalcomponent_get_next_property(event,ICAL_ATTENDEE_PROPERTY)
) {
parameter = icalproperty_get_first_parameter(p,ICAL_PARTSTAT_PARAMETER);
if (parameter == 0) {
/* There was no PARTSTAT parameter, so add one. */
icalproperty_add_parameter(
p,
icalparameter_new_partstat(ICAL_PARTSTAT_TENTATIVE)
);
} else if (icalparameter_get_partstat(parameter) == ICAL_PARTSTAT_NEEDSACTION) {
/* Remove the NEEDSACTION parameter and replace it with
TENTATIVE */
icalproperty_remove_parameter(p,ICAL_PARTSTAT_PARAMETER);
/* Don't forget to free it */
icalparameter_free(parameter);
/* Add a new one */
icalproperty_add_parameter(
p,
icalparameter_new_partstat(ICAL_PARTSTAT_TENTATIVE)
);
}
}
}
/* Here are some examples of manipulating properties */
void test_properties()
{
icalproperty *prop;
icalparameter *param;
icalvalue *value;
icalproperty *clone;
/* Create a new property */
prop = icalproperty_vanew_comment(
"Another Comment",
icalparameter_new_cn("A Common Name 1"),
icalparameter_new_cn("A Common Name 2"),
icalparameter_new_cn("A Common Name 3"),
icalparameter_new_cn("A Common Name 4"),
0);
/* Iterate through all of the parameters in the property */
for(param = icalproperty_get_first_parameter(prop,ICAL_ANY_PARAMETER);
param != 0;
param = icalproperty_get_next_parameter(prop,ICAL_ANY_PARAMETER)) {
printf("Prop parameter: %s\n",icalparameter_get_cn(param));
}
/* Get a string representation of the property's value */
printf("Prop value: %s\n",icalproperty_get_comment(prop));
/* Spit out the property in its RFC 2445 representation */
printf("As iCAL string:\n %s\n",icalproperty_as_ical_string(prop));
/* Make a copy of the property. Caller owns the memory */
clone = icalproperty_new_clone(prop);
/* Get a reference to the value within the clone property */
value = icalproperty_get_value(clone);
printf("Value: %s",icalvalue_as_ical_string(value));
/* Free the original and the clone */
icalproperty_free(clone);
icalproperty_free(prop);
}

Просмотреть файл

@ -1,210 +0,0 @@
void acess_cap(void) {
/* Note, all routines that are prefixed with "caller_" are
implemented by the caller of libical */
/* 1 Open a connection to a store. */
/* The caller is responsible for getting a socket to the server
and negotiating the first stages of the CAP exchange. These can
be fairly complex and varied for different operating systems,
local vs remote usage, and for different authentication
schemes, so the API does not try to simplify them. */
int sock = caller_create_socket_to_server();
icalcstp *cstp = icalcstp_new(0,sock,sock);
caller_authenticate(cstp);
icalcsdb *csdb = icalcsdb_new(cstp);
/* 2 Create a new calendar for which user Bill can read and user Mary can
read and write. See CAP draft 7.2.1.1.1. for the text of this example*/
/* This case requires setting up a TARGET, multiple OWNERs and
multiple VCARs, so it creates a component and uses CSTP that
than the CSDB interface.
icalcomponent *create = icalcaputil_new_create();
icalcomponent_add_property(create,
icalproperty_new_target(
strdup("cap://cal.example.com/relcal8")
));
icalcomponent *cal =
icalcomponent_vanew_vcalendar(
icalproperty_new_relcalid(strdup("relcalid")),
icalproperty_new_name(strdup("Bill & Mary's cal")),
icalproperty_new_owner(strdup("bill")),
icalproperty_new_owner(strdup("mary")),
icalproperty_new_calmaster(strdup("mailto:bill@example.com")),
icalcomponent_vanew_vcar(
icalproperty_new_grant(strdup("UPN=bill;ACTION=*;OBJECT=*")),
icalproperty_new_grant(strdup("UPN=bill;ACTION=*;OBJECT=*"))
0)
0);
error = icalcomponent_add_component(create,cal);
/* Send the data */
error = icalcstp_senddata(cstp,10,create);
/* Get the response */
icalcstp_response response = icalcstp_get_first_response(cstp);
/* Do something with the response*/
if(icalenum_reqstat_major(response.code) != 2){
/* do something with the error */
}
icalcomponent_free(create);
/* 3 Create several new calendars */
/* Same as #2, but insert more TARGET properties and read more responses*/
/* 4 Delete a calendar */
error = icalcsdb_delete(csdb,"uid12345-example.com");
/* 5 Change the calid of a calendar */
erorr = icalcsdb_move(csdb,"uid12345-old-example.com",
"uid12345-new-example.com");
/* 6 Delete all calendars belonging to user bob */
icalproperty *p;
/* First expand bob's UPN into a set of CALIDs */
icalcomponent *calids = icalcsdb_expand_upn("bob@example.com");
/* Then, create a message to delete all of them */
icalcomponent *delete = icalcaputil_new_create();
for(p = icalcomponent_get_first_property(calids,ICAL_CALID_PROPERTY);
p != 0;
p = icalcomponent_get_next_property(calids,ICAL_CALID_PROPERTY)){
char* = icalproperty_get_calid(p);
icalcomponent_add_target(delete,p);
}
/* Send the message */
error = icalcstp_senddata(cstp,10,delete);
/* Finally, read the responses */
for(response = icalcstp_get_first_response(cstp);
response.code != ICAL_UNKNOWN_STATUS;
response = icalcstp_get_next_response(cstp)){
if(icalenum_reqstat_major(response.code) != 2){
/* do something with the error */
}
}
/* 7 Get three new UIDs from the store */
/* libical owns the returned memory. Copy before using */
char* uid1 = icalcsdb_generateuid(csdb);
char* uid2 = icalcsdb_generateuid(csdb);
char* uid3 = icalcsdb_generateuid(csdb);
/* 8 Store a new VEVENT in the store. */
/* Very similar to case #2 */
/* 9 Find all components for which the LOCATION is "West Conference
Room" and change them to "East Conference Room" */
icalcomponent *modify = icalcaputil_new_modify();
icalcaputil_modify_add_old_prop(modify,
icalproperty_new_location(
strdup("West Conference Room")));
icalcaputil_modify_add_new_prop(modify,
icalproperty_new_location(
strdup("East Conference Room")));
icalcaputil_add_target(modify,"relcal2");
/* Send the component */
error = icalcstp_senddata(cstp,10,delete);
/* Get the response */
icalcstp_response response = icalcstp_get_first_response(cstp);
/* Do something with the response*/
if(icalenum_reqstat_major(response.code) != 2){
/* do something with the error */
}
icalcomponent_free(modify);
/* 10 Find the component with UID X and add a GEO property to it. */
icalcomponent *modify = icalcaputil_new_modify();
icalcaputil_modify_add_query(modify,
"SELECT UID FROM VEVENT WHERE UID = 'X'");
icalcaputil_modify_add_new_prop(modify,
icalproperty_new_geo(
strdup("-117;32")));
icalcaputil_add_target(modify,"relcal2");
/* Send the component */
error = icalcstp_senddata(cstp,10,delete);
/* Get the response */
icalcstp_response response = icalcstp_get_first_response(cstp);
/* Do something with the response*/
if(icalenum_reqstat_major(response.code) != 2){
/* do something with the error */
}
icalcomponent_free(modify);
/* 11 Delete all VEVENTS which have a METHOD that is not CREATED */
/* 12 Retrieve all VEVENTS which have a METHOD that is not CREATED */
/* Nearly the same at #11 */
/* 13 Retrieve the capabilities of the store */
/* 14 Retrieve/Modify/Add/Delete properties of a store */
/* 15 Retrieve/Modify/Add/Delete VCARs of a store */
/* 16 Retrieve/Modify/Add/Delete VTIMEZONEs of a store */
/* 17 Retrieve/Modify/Add/Delete properties of a calendar */
/* 18 Retrieve/Modify/Add/Delete VCARs of a calendar */
/* 19 Retrieve/Modify/Add/Delete VTIMEZONEs of a calendar */
/* 20 Translate a CALID into one or more UPNs */
/* 21 Expand a group UPN into all of the members of the group */

Просмотреть файл

@ -1,4 +0,0 @@
s/icalcluster/icalfileset/g;
s/ICALCLUSTER/ICALFILESET/g;
s/icalstore/icaldirset/g;
s/ICALSTORE/ICALDIRSET/g;

Просмотреть файл

@ -1,70 +0,0 @@
/* errors.c */
#include "ical.h"
#include <stdio.h>
void program_errors()
{
/*Most routines will set icalerrno on errors. This is an
enumeration defined in icalerror.h */
icalcomponent *c;
icalerror_clear_errno();
c = icalcomponent_new(ICAL_VEVENT_COMPONENT);
if (icalerrno != ICAL_NO_ERROR){
fprintf(stderr,"Horrible libical error: %s\n",
icalerror_strerror(icalerrno));
}
}
void component_errors(icalcomponent *comp)
{
int errors;
icalproperty *p;
/* presume that we just got this component from the parser */
errors = icalcomponent_count_errors(comp);
printf("This component has %d parsing errors\n", errors);
/* Print out all of the parsing errors. This is not strictly
correct, because it does not descend into any sub-components,
as icalcomponent_count_errors() does. */
for(p = icalcomponent_get_first_property(comp,ICAL_XLICERROR_PROPERTY);
p != 0;
p = icalcomponent_get_next_property(comp,ICAL_XLICERROR_PROPERTY))
{
printf("-- The error is %s:\n",icalproperty_get_xlicerror(p));
}
/* Check the component for iTIP compilance, and add more
X-LIC-ERROR properties if it is non-compilant. */
icalrestriction_check(comp);
/* Count the new errors. */
if(errors != icalcomponent_count_errors(comp)){
printf(" -- The component also has iTIP restriction errors \n");
}
/* Since there are iTIP restriction errors, it may be impossible
to process this component as an iTIP request. In this case, the
X-LIC-ERROR proeprties should be expressed as REQUEST-STATUS
properties in the reply. This following routine makes this
conversion */
icalcomponent_convert_errors(comp);
}

Просмотреть файл

@ -1,12 +0,0 @@
/* This is just to make the code in the example directory link properly. */
#include "ical.h"
int main()
{
return 1;
}
void do_something(icalcomponent* comp){
}

Просмотреть файл

@ -1,68 +0,0 @@
/* parse_text.c
*/
#include <stdio.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include "ical.h"
#include <stdlib.h>
/* The icalparser_get_line routine will create a single *content* line
out of one or more input lines. The content line is all of the
properties and values for a single property, and it can span several
input lines. So, icalparser_get_line will need to be able to get more
data on its own. Read_string is a routine that does this. You can
write your own version of read stream to get data from other types of
files, sockets, etc. */
char* read_stream(char *s, size_t size, void *d)
{
char *c = fgets(s,size, (FILE*)d);
return c;
}
void parse_text(int argc, char* argv[])
{
char* line;
FILE* stream;
icalcomponent *c;
/* Create a new parser object */
icalparser *parser = icalparser_new();
stream = fopen(argv[1],"r");
assert(stream != 0);
/* Tell the parser what input routie it should use. */
icalparser_set_gen_data(parser,stream);
do{
/* Get a single content line by making one or more calls to
read_stream()*/
line = icalparser_get_line(parser,read_stream);
/* Now, add that line into the parser object. If that line
completes a component, c will be non-zero */
c = icalparser_add_line(parser,line);
if (c != 0){
printf("%s",icalcomponent_as_ical_string(c));
printf("\n---------------\n");
icalcomponent_free(c);
}
} while ( line != 0);
icalparser_free(parser);
}

Просмотреть файл

@ -1,89 +0,0 @@
/* -*- Mode: C -*-
======================================================================
FILE: usecases.c
CREATOR: eric 03 April 1999
DESCRIPTION:
$Id: usecases.c,v 1.1.1.1 2007/12/10 11:43:50 mvl%exedo.nl 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 usecases.c
======================================================================*/
#include "ical.h"
#include <assert.h>
#include <string.h> /* for strdup */
#include <stdlib.h> /* for malloc */
#include <stdio.h> /* for printf */
#include <time.h> /* for time() */
char str[] = "BEGIN:VCALENDAR\
PRODID:\"-//RDU Software//NONSGML HandCal//EN\"\
VERSION:2.0\
BEGIN:VEVENT\
DTSTAMP:19980309T231000Z\
UID:guid-1.host1.com\
ORGANIZER;ROLE=CHAIR:MAILTO:mrbig@host.com\
ATTENDEE;RSVP=TRUE;ROLE=REQ-PARTICIPANT;CUTYPE=GROUP:MAILTO:employee-A@host.com\
DESCRIPTION:Project XYZ Review Meeting\
CATEGORIES:MEETING\
CREATED:19980309T130000Z\
SUMMARY:XYZ Project Review\
DTSTART;TZID=US-Eastern:19980312T083000\
DTEND;TZID=US-Eastern:19980312T093000\
END:VEVENT\
END:VCALENDAR";
/* Here are some ways to work with values. */
void test_values()
{
icalvalue *v;
icalvalue *copy;
v = icalvalue_new_caladdress("cap://value/1");
printf("caladdress 1: %s\n",icalvalue_get_caladdress(v));
icalvalue_set_caladdress(v,"cap://value/2");
printf("caladdress 2: %s\n",icalvalue_get_caladdress(v));
printf("String: %s\n",icalvalue_as_ical_string(v));
copy = icalvalue_new_clone(v);
printf("Clone: %s\n",icalvalue_as_ical_string(v));
icalvalue_free(v);
icalvalue_free(copy);
}
void test_parameters()
{
icalparameter *p;
p = icalparameter_new_cn("A Common Name");
printf("Common Name: %s\n",icalparameter_get_cn(p));
printf("As String: %s\n",icalparameter_as_ical_string(p));
}

Просмотреть файл

@ -1,9 +0,0 @@
EXTRA_DIST = \
mkderivedcomponents.pl \
mkderivedparameters.pl \
mkderivedproperties.pl \
mkderivedvalues.pl \
mkparameterrestrictions.pl \
mkrestrictionrecords.pl \
mkrestrictiontable.pl \
readvaluesfile.pl

Просмотреть файл

@ -1,350 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 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.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = scripts
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BDB_DIR = @BDB_DIR@
BDB_DIR_INCLUDE = @BDB_DIR_INCLUDE@
BDB_DIR_LIB = @BDB_DIR_LIB@
BDB_LIB = @BDB_LIB@
BDB_VERSION = @BDB_VERSION@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEV_FALSE = @DEV_FALSE@
DEV_TRUE = @DEV_TRUE@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
GREP = @GREP@
HAVE_PTHREAD_FALSE = @HAVE_PTHREAD_FALSE@
HAVE_PTHREAD_TRUE = @HAVE_PTHREAD_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PTHREAD_LIBS = @PTHREAD_LIBS@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WITH_BDB4_FALSE = @WITH_BDB4_FALSE@
WITH_BDB4_TRUE = @WITH_BDB4_TRUE@
YACC = @YACC@
YFLAGS = @YFLAGS@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
EXTRA_DIST = \
mkderivedcomponents.pl \
mkderivedparameters.pl \
mkderivedproperties.pl \
mkderivedvalues.pl \
mkparameterrestrictions.pl \
mkrestrictionrecords.pl \
mkrestrictiontable.pl \
readvaluesfile.pl
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu scripts/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
# 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:

Просмотреть файл

@ -223,12 +223,41 @@ void icalproperty_set_${lc}(icalproperty* prop, $type v){
}
EOM
}
# Dirk Theisen pointed out, exdate needs to match TZID parameters in EXDATE
if ($lc eq "exdate") {
print<<EOM;
$type icalproperty_get_${lc}(const icalproperty* prop){
icalerror_check_arg( (prop!=0),"prop");
#ifndef _MSC_VER
/*
* Code by dirk\@objectpark.net:
* Set the time zone manually. I am really puzzled that
* it doesnot work automatically like in the other functions
* like icalproperty_get_dtstart().
*/
struct icaltimetype itt =
icalvalue_get_datetime(icalproperty_get_value(prop));
icalparameter* param = icalproperty_get_first_parameter(prop,
ICAL_TZID_PARAMETER);
if (param) {
const icaltimezone *zone =
icaltimezone_get_builtin_timezone(icalparameter_get_tzid(param));
icaltime_set_timezone(&itt, zone);
}
return itt;
#else
return icalvalue_get_datetime(icalproperty_get_value(prop));
#endif
}
EOM
} else {
print<<EOM;
$type icalproperty_get_${lc}(const icalproperty* prop){
icalerror_check_arg( (prop!=0),"prop");
return icalvalue_get_${lcvalue}(icalproperty_get_value(prop));
}
EOM
}
} elsif ($opt_h) { # Generate C Header file

Просмотреть файл

@ -206,13 +206,14 @@ void icalvalue_set_${lc}(icalvalue* value, $type v) {\
impl->data.v_$union_data = $assign \n\
icalvalue_reset_kind(impl);\n}\n";
print "$type\ icalvalue_get_${lc}(const icalvalue* value)\ {\n";
if ($type =~ m/(\*|int|float)$/) {
print " icalerror_check_arg_rz( (value!=0),\"value\");\n";
} else {
print " icalerror_check_arg( (value!=0),\"value\");\n";
print "$type\ icalvalue_get_${lc} (const icalvalue* value) {\n\n";
if( $union_data eq 'string') {
print " icalerror_check_arg_rz ((value!=0),\"value\");\n";
}
print " icalerror_check_value_type(value, ICAL_${uc}_VALUE);\
else {
print " icalerror_check_arg ((value!=0),\"value\");\n";
}
print " icalerror_check_value_type (value, ICAL_${uc}_VALUE);\
return ((struct icalvalue_impl*)value)->data.v_${union_data};\n}\n";

Просмотреть файл

@ -16,22 +16,24 @@ if ($opt_i) {
while(<IN>){
if (/<insert_code_here>/){
insert_code();
}
if (/Do not edit/){
last;
}
print;
}
print "/* Everything below this line is machine generated. Do not edit. */\n";
}
close IN;
}
sub insert_code {
# First build the property restriction table
print "icalrestriction_property_record icalrestriction_property_records[] = {\n";
print "static const icalrestriction_property_record icalrestriction_property_records[] = {\n";
while(<F>)
{
@ -62,7 +64,7 @@ print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION
print "};\n";
print "icalrestriction_component_record icalrestriction_component_records[] = {\n";
print "static const icalrestriction_component_record icalrestriction_component_records[] = {\n";
# Go back through the entire file and build the component restriction table
@ -96,3 +98,5 @@ while(<F>)
# print the terminating line
print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}\n";
print "};\n";
}

Просмотреть файл

@ -13,6 +13,7 @@ sub read_values_file {
s/#.*$//g;
s/\"//g;
s/\r//g;
next if ! $_;
@ -69,6 +70,7 @@ sub read_properties_file {
s/#.*$//g;
s/\"//g;
s/\r//g;
next if ! $_;
@ -100,6 +102,7 @@ sub read_parameters_file {
s/#.*$//g;
s/\"//g;
s/\r//g;
next if ! $_;

Просмотреть файл

@ -1,269 +0,0 @@
#======================================================================
# FILE: Makefile.am
# CREATOR: eric
#
# $Id: Makefile.am,v 1.38 2007/12/01 12:17:44 dothebart 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/
#
#
#
#======================================================================
DESIGNDATA = $(top_srcdir)/design-data
ICALSCRIPTS = $(top_srcdir)/scripts
cxx_lib=
cxx_headers=
lib_LTLIBRARIES = libical.la $(cxx_lib)
noinst_LTLIBRARIES = libical-static.la
libical_static_la_SOURCES = $(libical_la_SOURCES)
libical_static_la_LDFLAGS = --all-static
AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\""$(datadir)/$(PACKAGE)"\"
# CFLAGS = -g
all: ical.h
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir)/src \
-I$(top_builddir)/src \
-I$(srcdir)
libical_la_LDFLAGS = -version-info 30:0:30
libical_la_SOURCES = \
$(BUILT_SOURCES) \
icalarray.c \
icalarray.h \
icalattach.h \
icalattachimpl.h \
icalattach.c \
icalcomponent.c \
icalcomponent.h \
icalenums.c \
icalenums.h \
icalerror.c \
icalerror.h \
icalmemory.c \
icalmemory.h \
icalmime.c \
icalmime.h \
icalparameter.c \
icalparameter.h \
icalparameterimpl.h \
icalparser.c \
icalparser.h \
icalproperty.c \
icalproperty.h \
icalrecur.c \
icalrecur.h \
icalrestriction.h \
icaltime.c \
icaltime.h \
icaltimezone.c \
icaltimezone.h \
icalduration.h \
icalduration.c \
icalperiod.h \
icalperiod.c \
icaltypes.c \
icaltypes.h \
icalvalue.c \
icalvalue.h \
icalvalueimpl.h \
pvl.c \
pvl.h \
sspm.c \
sspm.h \
vsnprintf.c \
icallangbind.h \
icallangbind.c \
caldate.c \
astime.h
libicalincludedir = $(includedir)
libicalinclude_HEADERS = ical.h icalmemory.h icalerror.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 \
$(top_srcdir)/src/libical/icalattach.h \
icalderivedvalue.h \
icalderivedparameter.h \
$(top_srcdir)/src/libical/icalvalue.h \
$(top_srcdir)/src/libical/icalparameter.h \
icalderivedproperty.h \
$(top_srcdir)/src/libical/icalproperty.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 \
$(top_srcdir)/src/libical/icalrestriction.h \
$(top_srcdir)/src/libical/sspm.h \
$(top_srcdir)/src/libical/icalmime.h \
$(top_srcdir)/src/libical/icallangbind.h
# exporting the configure stuff is probably no good idea.
# others use standard defines not in our namespace too.
# $(top_builddir)/config.h \
BUILT_COMBINEDHEADERS = \
icalderivedparameter.h \
icalderivedproperty.h \
icalderivedvalue.h
BUILT_SOURCES = \
$(BUILT_COMBINEDHEADERS)\
icalderivedparameter.c \
icalderivedproperty.c \
icalrestriction.c \
icalderivedvalue.c
ical.h: $(COMBINEDHEADERS)
echo '#ifdef __cplusplus' > ical.h
echo 'extern "C" {' >> ical.h
echo '#endif' >> ical.h
echo '/*' >> ical.h
echo ' $$''Id''$$' >> ical.h
echo '*/' >> ical.h
cat $(COMBINEDHEADERS) \
| egrep -v "#include.*\"ical" \
| egrep -v "#include.*\"config" \
| egrep -v "#include.*\"pvl\.h\"" \
| egrep -v '\$$(Id|Locker): .+\$$'>> ical.h
echo '#ifdef __cplusplus' >> ical.h
echo '};' >> ical.h
echo '#endif' >> 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 $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.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 = \
$(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 $(srcdir)/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 $(srcdir)/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 $(srcdir)/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 $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > 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
# c++ needs ical.h auto-generated.
icalparameter_cxx.lo: ical.h
icalproperty_cxx.lo: ical.h
icalvalue_cxx.lo: ical.h
vcomponent.lo: ical.h
# housekeeping
CONFIG_CLEAN_FILES = y.output
CLEANFILES = $(BUILT_SOURCES) $(BUILT_COMBINEDHEADERS)
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
cd $(distdir); rm -f ical.h icalversion.h
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
$(srcdir)/icalcomponent.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
icalderivedparameter.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
icalderivedproperty.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
icalderivedvalue.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icalduration.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icallangbind.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icalmime.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icalparameter.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icalparser.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icalproperty.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icalrestriction.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icaltime.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h
$(srcdir)/icalvalue.c: icalderivedvalue.h icalderivedproperty.h icalderivedparameter.h

Просмотреть файл

@ -58,6 +58,7 @@ CSRCS = \
icalderivedproperty.c \
icalrestriction.c \
icalderivedvalue.c \
\
icalarray.c \
icalattach.c \
icalcomponent.c \
@ -77,9 +78,9 @@ CSRCS = \
icalvalue.c \
pvl.c \
sspm.c \
icallangbind.c \
caldate.c \
vsnprintf.c \
icallangbind.c \
caldate.c \
$(NULL)
DEFINES += -DHAVE_CONFIG_H
@ -147,8 +148,10 @@ BUILT_SOURCES = \
GARBAGE += $(BUILT_SOURCES)
ical.h: $(COMBINEDHEADERS) Makefile
echo '#ifdef __cplusplus' > ical.h
ical.h: $(COMBINEDHEADERS)
echo '#ifndef LIBICAL_ICAL_H' > ical.h
echo '#define LIBICAL_ICAL_H' >> ical.h
echo '#ifdef __cplusplus' >> ical.h
echo 'extern "C" {' >> ical.h
echo '#endif' >> ical.h
echo '/*' >> ical.h
@ -162,85 +165,68 @@ ical.h: $(COMBINEDHEADERS) Makefile
echo '#ifdef __cplusplus' >> ical.h
echo '}' >> ical.h
echo '#endif' >> ical.h
echo '#endif' >> ical.h
GARBAGE += ical.h
#
# parameters
#
PARAMETERDEPS = \
$(ICALSCRIPTS)/mkderivedparameters.pl \
$(DESIGNDATA)/parameters.csv \
icalderivedparameter.c.in \
$(ICALSCRIPTS)/mkderivedparameters.pl \
$(DESIGNDATA)/parameters.csv \
icalderivedparameter.c.in \
icalderivedparameter.h.in
icalderivedparameter.h: $(PARAMETERDEPS)
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl \
-i $(srcdir)/icalderivedparameter.h.in \
-h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h
icalderivedparameter.c: $(PARAMETERDEPS) $(BUILT_COMBINEDHEADERS)
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl \
-i $(srcdir)/icalderivedparameter.c.in \
-c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.c.in -c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c
#
# properties
#
PROPERTYDEPS = \
$(ICALSCRIPTS)/mkderivedproperties.pl \
$(DESIGNDATA)/properties.csv \
$(DESIGNDATA)/value-types.csv \
$(ICALSCRIPTS)/mkderivedproperties.pl \
$(DESIGNDATA)/properties.csv \
$(DESIGNDATA)/value-types.csv \
icalderivedproperty.c.in \
icalderivedproperty.h.in
icalderivedproperty.h: $(PROPERTYDEPS) Makefile
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
-i $(srcdir)/icalderivedproperty.h.in \
-h $(DESIGNDATA)/properties.csv \
${DESIGNDATA}/value-types.csv > icalderivedproperty.h
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) $(BUILT_COMBINEDHEADERS) Makefile
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
-i $(srcdir)/icalderivedproperty.c.in \
-c $(DESIGNDATA)/properties.csv \
${DESIGNDATA}/value-types.csv > icalderivedproperty.c
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
#
# restrictions
#
RESTRICTIONDEPS = \
$(ICALSCRIPTS)/mkrestrictiontable.pl \
$(DESIGNDATA)/restrictions.csv \
$(srcdir)/icalrestriction.c.in
$(ICALSCRIPTS)/mkrestrictiontable.pl \
$(DESIGNDATA)/restrictions.csv \
icalrestriction.c.in
icalrestriction.c: $(RESTRICTIONDEPS) Makefile
$(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl \
-i $(srcdir)/icalrestriction.c.in \
$(DESIGNDATA)/restrictions.csv > icalrestriction.c
icalrestriction.c: $(RESTRICTIONDEPS)
$(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl -i $(srcdir)/icalrestriction.c.in \
$(DESIGNDATA)/restrictions.csv > icalrestriction.c
#
# values
#
VALUEDEPS = \
$(ICALSCRIPTS)/mkderivedvalues.pl \
$(DESIGNDATA)/value-types.csv \
$(srcdir)/icalderivedvalue.c.in \
$(srcdir)/icalderivedvalue.h.in
$(ICALSCRIPTS)/mkderivedvalues.pl \
$(DESIGNDATA)/value-types.csv \
icalderivedvalue.c.in \
icalderivedvalue.h.in
icalderivedvalue.h: $(VALUEDEPS) Makefile
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
-i $(srcdir)/icalderivedvalue.h.in \
-h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h
icalderivedvalue.c: $(VALUEDEPS) $(BUILT_COMBINEDHEADERS) Makefile
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
-i $(srcdir)/icalderivedvalue.c.in \
-c $(DESIGNDATA)/value-types.csv > icalderivedvalue.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) $(BUILT_COMBINEDHEADERS)
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
-i $(srcdir)/icalderivedvalue.c.in -c $(DESIGNDATA)/value-types.csv > icalderivedvalue.c

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,310 +0,0 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalparam.h
CREATOR: eric 20 March 1999
$Id: icalderivedparameter.h,v 1.5 2002/09/01 19:12:31 gray-john 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 struct icalparameter_impl icalparameter;
const char* icalparameter_enum_to_string(int e);
int icalparameter_string_to_enum(const char* str);
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_URI = 20059,
ICAL_VALUE_ERROR = 20060,
ICAL_VALUE_DATETIME = 20061,
ICAL_VALUE_UTCOFFSET = 20062,
ICAL_VALUE_CALADDRESS = 20063,
ICAL_VALUE_NONE = 20064
} icalparameter_value;
typedef enum icalparameter_xliccomparetype {
ICAL_XLICCOMPARETYPE_X = 20065,
ICAL_XLICCOMPARETYPE_EQUAL = 20066,
ICAL_XLICCOMPARETYPE_NOTEQUAL = 20067,
ICAL_XLICCOMPARETYPE_LESS = 20068,
ICAL_XLICCOMPARETYPE_GREATER = 20069,
ICAL_XLICCOMPARETYPE_LESSEQUAL = 20070,
ICAL_XLICCOMPARETYPE_GREATEREQUAL = 20071,
ICAL_XLICCOMPARETYPE_REGEX = 20072,
ICAL_XLICCOMPARETYPE_ISNULL = 20073,
ICAL_XLICCOMPARETYPE_ISNOTNULL = 20074,
ICAL_XLICCOMPARETYPE_NONE = 20075
} icalparameter_xliccomparetype;
typedef enum icalparameter_xlicerrortype {
ICAL_XLICERRORTYPE_X = 20076,
ICAL_XLICERRORTYPE_COMPONENTPARSEERROR = 20077,
ICAL_XLICERRORTYPE_PROPERTYPARSEERROR = 20078,
ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR = 20079,
ICAL_XLICERRORTYPE_PARAMETERVALUEPARSEERROR = 20080,
ICAL_XLICERRORTYPE_VALUEPARSEERROR = 20081,
ICAL_XLICERRORTYPE_INVALIDITIP = 20082,
ICAL_XLICERRORTYPE_UNKNOWNVCALPROPERROR = 20083,
ICAL_XLICERRORTYPE_MIMEPARSEERROR = 20084,
ICAL_XLICERRORTYPE_VCALPROPPARSEERROR = 20085,
ICAL_XLICERRORTYPE_NONE = 20086
} icalparameter_xlicerrortype;
#define ICALPARAMETER_LAST_ENUM 20087
/* DELEGATED-FROM */
icalparameter* icalparameter_new_delegatedfrom(const char* v);
const char* icalparameter_get_delegatedfrom(const icalparameter* value);
void icalparameter_set_delegatedfrom(icalparameter* value, const char* v);
/* RELATED */
icalparameter* icalparameter_new_related(icalparameter_related v);
icalparameter_related icalparameter_get_related(const 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(const icalparameter* value);
void icalparameter_set_sentby(icalparameter* value, const char* v);
/* LANGUAGE */
icalparameter* icalparameter_new_language(const char* v);
const char* icalparameter_get_language(const icalparameter* value);
void icalparameter_set_language(icalparameter* value, const char* v);
/* RELTYPE */
icalparameter* icalparameter_new_reltype(icalparameter_reltype v);
icalparameter_reltype icalparameter_get_reltype(const icalparameter* value);
void icalparameter_set_reltype(icalparameter* value, icalparameter_reltype v);
/* ENCODING */
icalparameter* icalparameter_new_encoding(icalparameter_encoding v);
icalparameter_encoding icalparameter_get_encoding(const icalparameter* value);
void icalparameter_set_encoding(icalparameter* value, icalparameter_encoding v);
/* ALTREP */
icalparameter* icalparameter_new_altrep(const char* v);
const char* icalparameter_get_altrep(const icalparameter* value);
void icalparameter_set_altrep(icalparameter* value, const char* v);
/* FMTTYPE */
icalparameter* icalparameter_new_fmttype(const char* v);
const char* icalparameter_get_fmttype(const icalparameter* value);
void icalparameter_set_fmttype(icalparameter* value, const char* v);
/* FBTYPE */
icalparameter* icalparameter_new_fbtype(icalparameter_fbtype v);
icalparameter_fbtype icalparameter_get_fbtype(const icalparameter* value);
void icalparameter_set_fbtype(icalparameter* value, icalparameter_fbtype v);
/* RSVP */
icalparameter* icalparameter_new_rsvp(icalparameter_rsvp v);
icalparameter_rsvp icalparameter_get_rsvp(const icalparameter* value);
void icalparameter_set_rsvp(icalparameter* value, icalparameter_rsvp v);
/* RANGE */
icalparameter* icalparameter_new_range(icalparameter_range v);
icalparameter_range icalparameter_get_range(const 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(const icalparameter* value);
void icalparameter_set_delegatedto(icalparameter* value, const char* v);
/* CN */
icalparameter* icalparameter_new_cn(const char* v);
const char* icalparameter_get_cn(const icalparameter* value);
void icalparameter_set_cn(icalparameter* value, const char* v);
/* ROLE */
icalparameter* icalparameter_new_role(icalparameter_role v);
icalparameter_role icalparameter_get_role(const 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(const icalparameter* value);
void icalparameter_set_xliccomparetype(icalparameter* value, icalparameter_xliccomparetype v);
/* PARTSTAT */
icalparameter* icalparameter_new_partstat(icalparameter_partstat v);
icalparameter_partstat icalparameter_get_partstat(const 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(const icalparameter* value);
void icalparameter_set_xlicerrortype(icalparameter* value, icalparameter_xlicerrortype v);
/* MEMBER */
icalparameter* icalparameter_new_member(const char* v);
const char* icalparameter_get_member(const icalparameter* value);
void icalparameter_set_member(icalparameter* value, const char* v);
/* X */
icalparameter* icalparameter_new_x(const char* v);
const char* icalparameter_get_x(const icalparameter* value);
void icalparameter_set_x(icalparameter* value, const char* v);
/* CUTYPE */
icalparameter* icalparameter_new_cutype(icalparameter_cutype v);
icalparameter_cutype icalparameter_get_cutype(const icalparameter* value);
void icalparameter_set_cutype(icalparameter* value, icalparameter_cutype v);
/* TZID */
icalparameter* icalparameter_new_tzid(const char* v);
const char* icalparameter_get_tzid(const icalparameter* value);
void icalparameter_set_tzid(icalparameter* value, const char* v);
/* VALUE */
icalparameter* icalparameter_new_value(icalparameter_value v);
icalparameter_value icalparameter_get_value(const icalparameter* value);
void icalparameter_set_value(icalparameter* value, icalparameter_value v);
/* DIR */
icalparameter* icalparameter_new_dir(const char* v);
const char* icalparameter_get_dir(const icalparameter* value);
void icalparameter_set_dir(icalparameter* value, const char* v);
#endif /*ICALPARAMETER_H*/
/* Everything below this line is machine generated. Do not edit. */

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,473 +0,0 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalderivedproperties.{c,h}
CREATOR: eric 09 May 1999
$Id: icalderivedproperty.h,v 1.5 2002/09/01 19:12:31 gray-john Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
======================================================================*/
#ifndef ICALDERIVEDPROPERTY_H
#define ICALDERIVEDPROPERTY_H
#include <time.h>
#include "icalparameter.h"
#include "icalderivedvalue.h"
#include "icalrecur.h"
typedef struct icalproperty_impl icalproperty;
typedef enum icalproperty_kind {
ICAL_ANY_PROPERTY = 0,
ICAL_ACTION_PROPERTY,
ICAL_ALLOWCONFLICT_PROPERTY,
ICAL_ATTACH_PROPERTY,
ICAL_ATTENDEE_PROPERTY,
ICAL_CALID_PROPERTY,
ICAL_CALMASTER_PROPERTY,
ICAL_CALSCALE_PROPERTY,
ICAL_CARID_PROPERTY,
ICAL_CATEGORIES_PROPERTY,
ICAL_CLASS_PROPERTY,
ICAL_COMMENT_PROPERTY,
ICAL_COMPLETED_PROPERTY,
ICAL_CONTACT_PROPERTY,
ICAL_CREATED_PROPERTY,
ICAL_DECREED_PROPERTY,
ICAL_DEFAULTCHARSET_PROPERTY,
ICAL_DEFAULTLOCALE_PROPERTY,
ICAL_DEFAULTTZID_PROPERTY,
ICAL_DESCRIPTION_PROPERTY,
ICAL_DTEND_PROPERTY,
ICAL_DTSTAMP_PROPERTY,
ICAL_DTSTART_PROPERTY,
ICAL_DUE_PROPERTY,
ICAL_DURATION_PROPERTY,
ICAL_EXDATE_PROPERTY,
ICAL_EXPAND_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_OWNER_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_RELCALID_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_XLICCLASS_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);
void icalproperty_set_action(icalproperty* prop, enum icalproperty_action v);
enum icalproperty_action icalproperty_get_action(const icalproperty* prop);icalproperty* icalproperty_vanew_action(enum icalproperty_action v, ...);
/* ALLOW-CONFLICT */
icalproperty* icalproperty_new_allowconflict(const char* v);
void icalproperty_set_allowconflict(icalproperty* prop, const char* v);
const char* icalproperty_get_allowconflict(const icalproperty* prop);icalproperty* icalproperty_vanew_allowconflict(const char* v, ...);
/* ATTACH */
icalproperty* icalproperty_new_attach(icalattach * v);
void icalproperty_set_attach(icalproperty* prop, icalattach * v);
icalattach * icalproperty_get_attach(const icalproperty* prop);icalproperty* icalproperty_vanew_attach(icalattach * v, ...);
/* ATTENDEE */
icalproperty* icalproperty_new_attendee(const char* v);
void icalproperty_set_attendee(icalproperty* prop, const char* v);
const char* icalproperty_get_attendee(const icalproperty* prop);icalproperty* icalproperty_vanew_attendee(const char* v, ...);
/* CALID */
icalproperty* icalproperty_new_calid(const char* v);
void icalproperty_set_calid(icalproperty* prop, const char* v);
const char* icalproperty_get_calid(const icalproperty* prop);icalproperty* icalproperty_vanew_calid(const char* v, ...);
/* CALMASTER */
icalproperty* icalproperty_new_calmaster(const char* v);
void icalproperty_set_calmaster(icalproperty* prop, const char* v);
const char* icalproperty_get_calmaster(const icalproperty* prop);icalproperty* icalproperty_vanew_calmaster(const char* v, ...);
/* CALSCALE */
icalproperty* icalproperty_new_calscale(const char* v);
void icalproperty_set_calscale(icalproperty* prop, const char* v);
const char* icalproperty_get_calscale(const icalproperty* prop);icalproperty* icalproperty_vanew_calscale(const char* v, ...);
/* CARID */
icalproperty* icalproperty_new_carid(const char* v);
void icalproperty_set_carid(icalproperty* prop, const char* v);
const char* icalproperty_get_carid(const icalproperty* prop);icalproperty* icalproperty_vanew_carid(const char* v, ...);
/* CATEGORIES */
icalproperty* icalproperty_new_categories(const char* v);
void icalproperty_set_categories(icalproperty* prop, const char* v);
const char* icalproperty_get_categories(const icalproperty* prop);icalproperty* icalproperty_vanew_categories(const char* v, ...);
/* CLASS */
icalproperty* icalproperty_new_class(enum icalproperty_class v);
void icalproperty_set_class(icalproperty* prop, enum icalproperty_class v);
enum icalproperty_class icalproperty_get_class(const icalproperty* prop);icalproperty* icalproperty_vanew_class(enum icalproperty_class v, ...);
/* COMMENT */
icalproperty* icalproperty_new_comment(const char* v);
void icalproperty_set_comment(icalproperty* prop, const char* v);
const char* icalproperty_get_comment(const icalproperty* prop);icalproperty* icalproperty_vanew_comment(const char* v, ...);
/* COMPLETED */
icalproperty* icalproperty_new_completed(struct icaltimetype v);
void icalproperty_set_completed(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_completed(const icalproperty* prop);icalproperty* icalproperty_vanew_completed(struct icaltimetype v, ...);
/* CONTACT */
icalproperty* icalproperty_new_contact(const char* v);
void icalproperty_set_contact(icalproperty* prop, const char* v);
const char* icalproperty_get_contact(const icalproperty* prop);icalproperty* icalproperty_vanew_contact(const char* v, ...);
/* CREATED */
icalproperty* icalproperty_new_created(struct icaltimetype v);
void icalproperty_set_created(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_created(const icalproperty* prop);icalproperty* icalproperty_vanew_created(struct icaltimetype v, ...);
/* DECREED */
icalproperty* icalproperty_new_decreed(const char* v);
void icalproperty_set_decreed(icalproperty* prop, const char* v);
const char* icalproperty_get_decreed(const icalproperty* prop);icalproperty* icalproperty_vanew_decreed(const char* v, ...);
/* DEFAULT-CHARSET */
icalproperty* icalproperty_new_defaultcharset(const char* v);
void icalproperty_set_defaultcharset(icalproperty* prop, const char* v);
const char* icalproperty_get_defaultcharset(const icalproperty* prop);icalproperty* icalproperty_vanew_defaultcharset(const char* v, ...);
/* DEFAULT-LOCALE */
icalproperty* icalproperty_new_defaultlocale(const char* v);
void icalproperty_set_defaultlocale(icalproperty* prop, const char* v);
const char* icalproperty_get_defaultlocale(const icalproperty* prop);icalproperty* icalproperty_vanew_defaultlocale(const char* v, ...);
/* DEFAULT-TZID */
icalproperty* icalproperty_new_defaulttzid(const char* v);
void icalproperty_set_defaulttzid(icalproperty* prop, const char* v);
const char* icalproperty_get_defaulttzid(const icalproperty* prop);icalproperty* icalproperty_vanew_defaulttzid(const char* v, ...);
/* DESCRIPTION */
icalproperty* icalproperty_new_description(const char* v);
void icalproperty_set_description(icalproperty* prop, const char* v);
const char* icalproperty_get_description(const icalproperty* prop);icalproperty* icalproperty_vanew_description(const char* v, ...);
/* DTEND */
icalproperty* icalproperty_new_dtend(struct icaltimetype v);
void icalproperty_set_dtend(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_dtend(const icalproperty* prop);icalproperty* icalproperty_vanew_dtend(struct icaltimetype v, ...);
/* DTSTAMP */
icalproperty* icalproperty_new_dtstamp(struct icaltimetype v);
void icalproperty_set_dtstamp(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_dtstamp(const icalproperty* prop);icalproperty* icalproperty_vanew_dtstamp(struct icaltimetype v, ...);
/* DTSTART */
icalproperty* icalproperty_new_dtstart(struct icaltimetype v);
void icalproperty_set_dtstart(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_dtstart(const icalproperty* prop);icalproperty* icalproperty_vanew_dtstart(struct icaltimetype v, ...);
/* DUE */
icalproperty* icalproperty_new_due(struct icaltimetype v);
void icalproperty_set_due(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_due(const icalproperty* prop);icalproperty* icalproperty_vanew_due(struct icaltimetype v, ...);
/* DURATION */
icalproperty* icalproperty_new_duration(struct icaldurationtype v);
void icalproperty_set_duration(icalproperty* prop, struct icaldurationtype v);
struct icaldurationtype icalproperty_get_duration(const icalproperty* prop);icalproperty* icalproperty_vanew_duration(struct icaldurationtype v, ...);
/* EXDATE */
icalproperty* icalproperty_new_exdate(struct icaltimetype v);
void icalproperty_set_exdate(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_exdate(const icalproperty* prop);icalproperty* icalproperty_vanew_exdate(struct icaltimetype v, ...);
/* EXPAND */
icalproperty* icalproperty_new_expand(int v);
void icalproperty_set_expand(icalproperty* prop, int v);
int icalproperty_get_expand(const icalproperty* prop);icalproperty* icalproperty_vanew_expand(int v, ...);
/* EXRULE */
icalproperty* icalproperty_new_exrule(struct icalrecurrencetype v);
void icalproperty_set_exrule(icalproperty* prop, struct icalrecurrencetype v);
struct icalrecurrencetype icalproperty_get_exrule(const icalproperty* prop);icalproperty* icalproperty_vanew_exrule(struct icalrecurrencetype v, ...);
/* FREEBUSY */
icalproperty* icalproperty_new_freebusy(struct icalperiodtype v);
void icalproperty_set_freebusy(icalproperty* prop, struct icalperiodtype v);
struct icalperiodtype icalproperty_get_freebusy(const icalproperty* prop);icalproperty* icalproperty_vanew_freebusy(struct icalperiodtype v, ...);
/* GEO */
icalproperty* icalproperty_new_geo(struct icalgeotype v);
void icalproperty_set_geo(icalproperty* prop, struct icalgeotype v);
struct icalgeotype icalproperty_get_geo(const icalproperty* prop);icalproperty* icalproperty_vanew_geo(struct icalgeotype v, ...);
/* LAST-MODIFIED */
icalproperty* icalproperty_new_lastmodified(struct icaltimetype v);
void icalproperty_set_lastmodified(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_lastmodified(const icalproperty* prop);icalproperty* icalproperty_vanew_lastmodified(struct icaltimetype v, ...);
/* LOCATION */
icalproperty* icalproperty_new_location(const char* v);
void icalproperty_set_location(icalproperty* prop, const char* v);
const char* icalproperty_get_location(const icalproperty* prop);icalproperty* icalproperty_vanew_location(const char* v, ...);
/* MAXRESULTS */
icalproperty* icalproperty_new_maxresults(int v);
void icalproperty_set_maxresults(icalproperty* prop, int v);
int icalproperty_get_maxresults(const icalproperty* prop);icalproperty* icalproperty_vanew_maxresults(int v, ...);
/* MAXRESULTSSIZE */
icalproperty* icalproperty_new_maxresultssize(int v);
void icalproperty_set_maxresultssize(icalproperty* prop, int v);
int icalproperty_get_maxresultssize(const icalproperty* prop);icalproperty* icalproperty_vanew_maxresultssize(int v, ...);
/* METHOD */
icalproperty* icalproperty_new_method(enum icalproperty_method v);
void icalproperty_set_method(icalproperty* prop, enum icalproperty_method v);
enum icalproperty_method icalproperty_get_method(const icalproperty* prop);icalproperty* icalproperty_vanew_method(enum icalproperty_method v, ...);
/* ORGANIZER */
icalproperty* icalproperty_new_organizer(const char* v);
void icalproperty_set_organizer(icalproperty* prop, const char* v);
const char* icalproperty_get_organizer(const icalproperty* prop);icalproperty* icalproperty_vanew_organizer(const char* v, ...);
/* OWNER */
icalproperty* icalproperty_new_owner(const char* v);
void icalproperty_set_owner(icalproperty* prop, const char* v);
const char* icalproperty_get_owner(const icalproperty* prop);icalproperty* icalproperty_vanew_owner(const char* v, ...);
/* PERCENT-COMPLETE */
icalproperty* icalproperty_new_percentcomplete(int v);
void icalproperty_set_percentcomplete(icalproperty* prop, int v);
int icalproperty_get_percentcomplete(const icalproperty* prop);icalproperty* icalproperty_vanew_percentcomplete(int v, ...);
/* PRIORITY */
icalproperty* icalproperty_new_priority(int v);
void icalproperty_set_priority(icalproperty* prop, int v);
int icalproperty_get_priority(const icalproperty* prop);icalproperty* icalproperty_vanew_priority(int v, ...);
/* PRODID */
icalproperty* icalproperty_new_prodid(const char* v);
void icalproperty_set_prodid(icalproperty* prop, const char* v);
const char* icalproperty_get_prodid(const icalproperty* prop);icalproperty* icalproperty_vanew_prodid(const char* v, ...);
/* QUERY */
icalproperty* icalproperty_new_query(const char* v);
void icalproperty_set_query(icalproperty* prop, const char* v);
const char* icalproperty_get_query(const icalproperty* prop);icalproperty* icalproperty_vanew_query(const char* v, ...);
/* QUERYNAME */
icalproperty* icalproperty_new_queryname(const char* v);
void icalproperty_set_queryname(icalproperty* prop, const char* v);
const char* icalproperty_get_queryname(const icalproperty* prop);icalproperty* icalproperty_vanew_queryname(const char* v, ...);
/* RDATE */
icalproperty* icalproperty_new_rdate(struct icaldatetimeperiodtype v);
void icalproperty_set_rdate(icalproperty* prop, struct icaldatetimeperiodtype v);
struct icaldatetimeperiodtype icalproperty_get_rdate(const icalproperty* prop);icalproperty* icalproperty_vanew_rdate(struct icaldatetimeperiodtype v, ...);
/* RECURRENCE-ID */
icalproperty* icalproperty_new_recurrenceid(struct icaltimetype v);
void icalproperty_set_recurrenceid(icalproperty* prop, struct icaltimetype v);
struct icaltimetype icalproperty_get_recurrenceid(const icalproperty* prop);icalproperty* icalproperty_vanew_recurrenceid(struct icaltimetype v, ...);
/* RELATED-TO */
icalproperty* icalproperty_new_relatedto(const char* v);
void icalproperty_set_relatedto(icalproperty* prop, const char* v);
const char* icalproperty_get_relatedto(const icalproperty* prop);icalproperty* icalproperty_vanew_relatedto(const char* v, ...);
/* RELCALID */
icalproperty* icalproperty_new_relcalid(const char* v);
void icalproperty_set_relcalid(icalproperty* prop, const char* v);
const char* icalproperty_get_relcalid(const icalproperty* prop);icalproperty* icalproperty_vanew_relcalid(const char* v, ...);
/* REPEAT */
icalproperty* icalproperty_new_repeat(int v);
void icalproperty_set_repeat(icalproperty* prop, int v);
int icalproperty_get_repeat(const icalproperty* prop);icalproperty* icalproperty_vanew_repeat(int v, ...);
/* REQUEST-STATUS */
icalproperty* icalproperty_new_requeststatus(struct icalreqstattype v);
void icalproperty_set_requeststatus(icalproperty* prop, struct icalreqstattype v);
struct icalreqstattype icalproperty_get_requeststatus(const icalproperty* prop);icalproperty* icalproperty_vanew_requeststatus(struct icalreqstattype v, ...);
/* RESOURCES */
icalproperty* icalproperty_new_resources(const char* v);
void icalproperty_set_resources(icalproperty* prop, const char* v);
const char* icalproperty_get_resources(const icalproperty* prop);icalproperty* icalproperty_vanew_resources(const char* v, ...);
/* RRULE */
icalproperty* icalproperty_new_rrule(struct icalrecurrencetype v);
void icalproperty_set_rrule(icalproperty* prop, struct icalrecurrencetype v);
struct icalrecurrencetype icalproperty_get_rrule(const icalproperty* prop);icalproperty* icalproperty_vanew_rrule(struct icalrecurrencetype v, ...);
/* SCOPE */
icalproperty* icalproperty_new_scope(const char* v);
void icalproperty_set_scope(icalproperty* prop, const char* v);
const char* icalproperty_get_scope(const icalproperty* prop);icalproperty* icalproperty_vanew_scope(const char* v, ...);
/* SEQUENCE */
icalproperty* icalproperty_new_sequence(int v);
void icalproperty_set_sequence(icalproperty* prop, int v);
int icalproperty_get_sequence(const icalproperty* prop);icalproperty* icalproperty_vanew_sequence(int v, ...);
/* STATUS */
icalproperty* icalproperty_new_status(enum icalproperty_status v);
void icalproperty_set_status(icalproperty* prop, enum icalproperty_status v);
enum icalproperty_status icalproperty_get_status(const icalproperty* prop);icalproperty* icalproperty_vanew_status(enum icalproperty_status v, ...);
/* SUMMARY */
icalproperty* icalproperty_new_summary(const char* v);
void icalproperty_set_summary(icalproperty* prop, const char* v);
const char* icalproperty_get_summary(const icalproperty* prop);icalproperty* icalproperty_vanew_summary(const char* v, ...);
/* TARGET */
icalproperty* icalproperty_new_target(const char* v);
void icalproperty_set_target(icalproperty* prop, const char* v);
const char* icalproperty_get_target(const icalproperty* prop);icalproperty* icalproperty_vanew_target(const char* v, ...);
/* TRANSP */
icalproperty* icalproperty_new_transp(enum icalproperty_transp v);
void icalproperty_set_transp(icalproperty* prop, enum icalproperty_transp v);
enum icalproperty_transp icalproperty_get_transp(const icalproperty* prop);icalproperty* icalproperty_vanew_transp(enum icalproperty_transp v, ...);
/* TRIGGER */
icalproperty* icalproperty_new_trigger(struct icaltriggertype v);
void icalproperty_set_trigger(icalproperty* prop, struct icaltriggertype v);
struct icaltriggertype icalproperty_get_trigger(const icalproperty* prop);icalproperty* icalproperty_vanew_trigger(struct icaltriggertype v, ...);
/* TZID */
icalproperty* icalproperty_new_tzid(const char* v);
void icalproperty_set_tzid(icalproperty* prop, const char* v);
const char* icalproperty_get_tzid(const icalproperty* prop);icalproperty* icalproperty_vanew_tzid(const char* v, ...);
/* TZNAME */
icalproperty* icalproperty_new_tzname(const char* v);
void icalproperty_set_tzname(icalproperty* prop, const char* v);
const char* icalproperty_get_tzname(const icalproperty* prop);icalproperty* icalproperty_vanew_tzname(const char* v, ...);
/* TZOFFSETFROM */
icalproperty* icalproperty_new_tzoffsetfrom(int v);
void icalproperty_set_tzoffsetfrom(icalproperty* prop, int v);
int icalproperty_get_tzoffsetfrom(const icalproperty* prop);icalproperty* icalproperty_vanew_tzoffsetfrom(int v, ...);
/* TZOFFSETTO */
icalproperty* icalproperty_new_tzoffsetto(int v);
void icalproperty_set_tzoffsetto(icalproperty* prop, int v);
int icalproperty_get_tzoffsetto(const icalproperty* prop);icalproperty* icalproperty_vanew_tzoffsetto(int v, ...);
/* TZURL */
icalproperty* icalproperty_new_tzurl(const char* v);
void icalproperty_set_tzurl(icalproperty* prop, const char* v);
const char* icalproperty_get_tzurl(const icalproperty* prop);icalproperty* icalproperty_vanew_tzurl(const char* v, ...);
/* UID */
icalproperty* icalproperty_new_uid(const char* v);
void icalproperty_set_uid(icalproperty* prop, const char* v);
const char* icalproperty_get_uid(const icalproperty* prop);icalproperty* icalproperty_vanew_uid(const char* v, ...);
/* URL */
icalproperty* icalproperty_new_url(const char* v);
void icalproperty_set_url(icalproperty* prop, const char* v);
const char* icalproperty_get_url(const icalproperty* prop);icalproperty* icalproperty_vanew_url(const char* v, ...);
/* VERSION */
icalproperty* icalproperty_new_version(const char* v);
void icalproperty_set_version(icalproperty* prop, const char* v);
const char* icalproperty_get_version(const icalproperty* prop);icalproperty* icalproperty_vanew_version(const char* v, ...);
/* X */
icalproperty* icalproperty_new_x(const char* v);
void icalproperty_set_x(icalproperty* prop, const char* v);
const char* icalproperty_get_x(const icalproperty* prop);icalproperty* icalproperty_vanew_x(const char* v, ...);
/* X-LIC-CLASS */
icalproperty* icalproperty_new_xlicclass(enum icalproperty_xlicclass v);
void icalproperty_set_xlicclass(icalproperty* prop, enum icalproperty_xlicclass v);
enum icalproperty_xlicclass icalproperty_get_xlicclass(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicclass(enum icalproperty_xlicclass v, ...);
/* X-LIC-CLUSTERCOUNT */
icalproperty* icalproperty_new_xlicclustercount(const char* v);
void icalproperty_set_xlicclustercount(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicclustercount(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicclustercount(const char* v, ...);
/* X-LIC-ERROR */
icalproperty* icalproperty_new_xlicerror(const char* v);
void icalproperty_set_xlicerror(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicerror(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicerror(const char* v, ...);
/* X-LIC-MIMECHARSET */
icalproperty* icalproperty_new_xlicmimecharset(const char* v);
void icalproperty_set_xlicmimecharset(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimecharset(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimecharset(const char* v, ...);
/* X-LIC-MIMECID */
icalproperty* icalproperty_new_xlicmimecid(const char* v);
void icalproperty_set_xlicmimecid(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimecid(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimecid(const char* v, ...);
/* X-LIC-MIMECONTENTTYPE */
icalproperty* icalproperty_new_xlicmimecontenttype(const char* v);
void icalproperty_set_xlicmimecontenttype(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimecontenttype(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimecontenttype(const char* v, ...);
/* X-LIC-MIMEENCODING */
icalproperty* icalproperty_new_xlicmimeencoding(const char* v);
void icalproperty_set_xlicmimeencoding(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimeencoding(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimeencoding(const char* v, ...);
/* X-LIC-MIMEFILENAME */
icalproperty* icalproperty_new_xlicmimefilename(const char* v);
void icalproperty_set_xlicmimefilename(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimefilename(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimefilename(const char* v, ...);
/* X-LIC-MIMEOPTINFO */
icalproperty* icalproperty_new_xlicmimeoptinfo(const char* v);
void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, const char* v);
const char* icalproperty_get_xlicmimeoptinfo(const icalproperty* prop);icalproperty* icalproperty_vanew_xlicmimeoptinfo(const char* v, ...);
#endif /*ICALPROPERTY_H*/

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,324 +0,0 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue.h
CREATOR: eric 20 March 1999
$Id: icalderivedvalue.h,v 1.5 2002/09/01 19:12:31 gray-john 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"
#include "icalattach.h"
typedef struct icalvalue_impl icalvalue;
void icalvalue_set_x(icalvalue* value, const char* v);
icalvalue* icalvalue_new_x(const char* v);
const char* icalvalue_get_x(const icalvalue* value);
icalvalue* icalvalue_new_recur (struct icalrecurrencetype v);
void icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v);
struct icalrecurrencetype icalvalue_get_recur(const icalvalue* value);
icalvalue* icalvalue_new_trigger (struct icaltriggertype v);
void icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v);
struct icaltriggertype icalvalue_get_trigger(const icalvalue* value);
icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v);
void icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v);
struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(const icalvalue* value);
icalvalue *icalvalue_new_attach (icalattach *attach);
void icalvalue_set_attach (icalvalue *value, icalattach *attach);
icalattach *icalvalue_get_attach (const icalvalue *value);
void icalvalue_reset_kind(icalvalue* value);
typedef enum icalvalue_kind {
ICAL_ANY_VALUE=5000,
ICAL_BOOLEAN_VALUE=5001,
ICAL_UTCOFFSET_VALUE=5002,
ICAL_XLICCLASS_VALUE=5003,
ICAL_RECUR_VALUE=5004,
ICAL_METHOD_VALUE=5005,
ICAL_CALADDRESS_VALUE=5006,
ICAL_PERIOD_VALUE=5007,
ICAL_STATUS_VALUE=5008,
ICAL_BINARY_VALUE=5009,
ICAL_TEXT_VALUE=5010,
ICAL_DURATION_VALUE=5011,
ICAL_DATETIMEPERIOD_VALUE=5012,
ICAL_INTEGER_VALUE=5013,
ICAL_URI_VALUE=5014,
ICAL_TRIGGER_VALUE=5015,
ICAL_ATTACH_VALUE=5016,
ICAL_CLASS_VALUE=5017,
ICAL_FLOAT_VALUE=5018,
ICAL_QUERY_VALUE=5019,
ICAL_STRING_VALUE=5020,
ICAL_TRANSP_VALUE=5021,
ICAL_X_VALUE=5022,
ICAL_DATETIME_VALUE=5023,
ICAL_REQUESTSTATUS_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_OPAQUENOCONFLICT = 10040,
ICAL_TRANSP_TRANSPARENT = 10041,
ICAL_TRANSP_TRANSPARENTNOCONFLICT = 10042,
ICAL_TRANSP_NONE = 10043
} icalproperty_transp;
typedef enum icalproperty_xlicclass {
ICAL_XLICCLASS_X = 10044,
ICAL_XLICCLASS_PUBLISHNEW = 10045,
ICAL_XLICCLASS_PUBLISHUPDATE = 10046,
ICAL_XLICCLASS_PUBLISHFREEBUSY = 10047,
ICAL_XLICCLASS_REQUESTNEW = 10048,
ICAL_XLICCLASS_REQUESTUPDATE = 10049,
ICAL_XLICCLASS_REQUESTRESCHEDULE = 10050,
ICAL_XLICCLASS_REQUESTDELEGATE = 10051,
ICAL_XLICCLASS_REQUESTNEWORGANIZER = 10052,
ICAL_XLICCLASS_REQUESTFORWARD = 10053,
ICAL_XLICCLASS_REQUESTSTATUS = 10054,
ICAL_XLICCLASS_REQUESTFREEBUSY = 10055,
ICAL_XLICCLASS_REPLYACCEPT = 10056,
ICAL_XLICCLASS_REPLYDECLINE = 10057,
ICAL_XLICCLASS_REPLYDELEGATE = 10058,
ICAL_XLICCLASS_REPLYCRASHERACCEPT = 10059,
ICAL_XLICCLASS_REPLYCRASHERDECLINE = 10060,
ICAL_XLICCLASS_ADDINSTANCE = 10061,
ICAL_XLICCLASS_CANCELEVENT = 10062,
ICAL_XLICCLASS_CANCELINSTANCE = 10063,
ICAL_XLICCLASS_CANCELALL = 10064,
ICAL_XLICCLASS_REFRESH = 10065,
ICAL_XLICCLASS_COUNTER = 10066,
ICAL_XLICCLASS_DECLINECOUNTER = 10067,
ICAL_XLICCLASS_MALFORMED = 10068,
ICAL_XLICCLASS_OBSOLETE = 10069,
ICAL_XLICCLASS_MISSEQUENCED = 10070,
ICAL_XLICCLASS_UNKNOWN = 10071,
ICAL_XLICCLASS_NONE = 10072
} icalproperty_xlicclass;
#define ICALPROPERTY_LAST_ENUM 10073
/* BOOLEAN */
icalvalue* icalvalue_new_boolean(int v);
int icalvalue_get_boolean(const icalvalue* value);
void icalvalue_set_boolean(icalvalue* value, int v);
/* UTC-OFFSET */
icalvalue* icalvalue_new_utcoffset(int v);
int icalvalue_get_utcoffset(const icalvalue* value);
void icalvalue_set_utcoffset(icalvalue* value, int v);
/* X-LIC-CLASS */
icalvalue* icalvalue_new_xlicclass(enum icalproperty_xlicclass v);
enum icalproperty_xlicclass icalvalue_get_xlicclass(const icalvalue* value);
void icalvalue_set_xlicclass(icalvalue* value, enum icalproperty_xlicclass v);
/* METHOD */
icalvalue* icalvalue_new_method(enum icalproperty_method v);
enum icalproperty_method icalvalue_get_method(const 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(const icalvalue* value);
void icalvalue_set_caladdress(icalvalue* value, const char* v);
/* PERIOD */
icalvalue* icalvalue_new_period(struct icalperiodtype v);
struct icalperiodtype icalvalue_get_period(const 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(const 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(const icalvalue* value);
void icalvalue_set_binary(icalvalue* value, const char* v);
/* TEXT */
icalvalue* icalvalue_new_text(const char* v);
const char* icalvalue_get_text(const icalvalue* value);
void icalvalue_set_text(icalvalue* value, const char* v);
/* DURATION */
icalvalue* icalvalue_new_duration(struct icaldurationtype v);
struct icaldurationtype icalvalue_get_duration(const icalvalue* value);
void icalvalue_set_duration(icalvalue* value, struct icaldurationtype v);
/* INTEGER */
icalvalue* icalvalue_new_integer(int v);
int icalvalue_get_integer(const icalvalue* value);
void icalvalue_set_integer(icalvalue* value, int v);
/* URI */
icalvalue* icalvalue_new_uri(const char* v);
const char* icalvalue_get_uri(const icalvalue* value);
void icalvalue_set_uri(icalvalue* value, const char* v);
/* CLASS */
icalvalue* icalvalue_new_class(enum icalproperty_class v);
enum icalproperty_class icalvalue_get_class(const icalvalue* value);
void icalvalue_set_class(icalvalue* value, enum icalproperty_class v);
/* FLOAT */
icalvalue* icalvalue_new_float(float v);
float icalvalue_get_float(const icalvalue* value);
void icalvalue_set_float(icalvalue* value, float v);
/* QUERY */
icalvalue* icalvalue_new_query(const char* v);
const char* icalvalue_get_query(const icalvalue* value);
void icalvalue_set_query(icalvalue* value, const char* v);
/* STRING */
icalvalue* icalvalue_new_string(const char* v);
const char* icalvalue_get_string(const 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(const 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(const icalvalue* value);
void icalvalue_set_datetime(icalvalue* value, struct icaltimetype v);
/* REQUEST-STATUS */
icalvalue* icalvalue_new_requeststatus(struct icalreqstattype v);
struct icalreqstattype icalvalue_get_requeststatus(const icalvalue* value);
void icalvalue_set_requeststatus(icalvalue* value, struct icalreqstattype v);
/* GEO */
icalvalue* icalvalue_new_geo(struct icalgeotype v);
struct icalgeotype icalvalue_get_geo(const icalvalue* value);
void icalvalue_set_geo(icalvalue* value, struct icalgeotype v);
/* DATE */
icalvalue* icalvalue_new_date(struct icaltimetype v);
struct icaltimetype icalvalue_get_date(const 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(const icalvalue* value);
void icalvalue_set_action(icalvalue* value, enum icalproperty_action v);
#endif /*ICALVALUE_H*/

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,7 +0,0 @@
#ifndef ICAL_VERSION_H
#define ICAL_VERSION_H
#define ICAL_PACKAGE "libical"
#define ICAL_VERSION "0.24"
#endif

Просмотреть файл

@ -0,0 +1,49 @@
# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering.
# It is required to make the combined header ical.h properly.
set(COMBINEDHEADERSICAL
${TOPB}/src/libical/icalversion.h
${TOPS}/src/libical/icaltime.h
${TOPS}/src/libical/icalduration.h
${TOPS}/src/libical/icalperiod.h
${TOPS}/src/libical/icalenums.h
${TOPS}/src/libical/icaltypes.h
${TOPS}/src/libical/icalrecur.h
${TOPS}/src/libical/icalattach.h
${TOPB}/src/libical/icalderivedvalue.h
${TOPB}/src/libical/icalderivedparameter.h
${TOPS}/src/libical/icalvalue.h
${TOPS}/src/libical/icalparameter.h
${TOPB}/src/libical/icalderivedproperty.h
${TOPS}/src/libical/icalproperty.h
${TOPS}/src/libical/pvl.h
${TOPS}/src/libical/icalarray.h
${TOPS}/src/libical/icalcomponent.h
${TOPS}/src/libical/icaltimezone.h
${TOPS}/src/libical/icalparser.h
${TOPS}/src/libical/icalmemory.h
${TOPS}/src/libical/icalerror.h
${TOPS}/src/libical/icalrestriction.h
${TOPS}/src/libical/sspm.h
${TOPS}/src/libical/icalmime.h
${TOPS}/src/libical/icallangbind.h
)
FILE(WRITE ${ICAL_FILE_H_FILE} "#ifndef LIBICAL_ICAL_H\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "#define LIBICAL_ICAL_H\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "#ifdef __cplusplus\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "extern \"C\" {\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "#endif\n")
foreach (_current_FILE ${COMBINEDHEADERSICAL})
FILE(READ ${_current_FILE} _contents)
STRING(REGEX REPLACE "#include *\"ical.*\\.h\"" "" _contents "${_contents}")
STRING(REGEX REPLACE "#include *\"config.*\\.h\"" "" _contents "${_contents}")
STRING(REGEX REPLACE "#include *\"pvl\\.h\"" "" _contents "${_contents}" )
FILE(APPEND ${ICAL_FILE_H_FILE} "${_contents}")
endforeach (_current_FILE)
FILE(APPEND ${ICAL_FILE_H_FILE} "\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "#ifdef __cplusplus\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "}\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "#endif\n")
FILE(APPEND ${ICAL_FILE_H_FILE} "#endif\n")

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalarray.c
CREATOR: Damon Chaplin 07 March 2001
$Id: icalarray.c,v 1.6 2007/04/30 13:57:47 artcancro Exp $
$Id: icalarray.c,v 1.7 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2001, Ximian, Inc.
@ -80,7 +80,7 @@ icalarray_free (icalarray *array)
void
icalarray_append (icalarray *array,
void *element)
const void *element)
{
if (array->num_elements >= array->space_allocated)
icalarray_expand (array, 1);
@ -96,7 +96,7 @@ icalarray_element_at (icalarray *array,
int position)
{
assert (position >= 0);
assert (position < array->num_elements);
assert ((unsigned int)position < array->num_elements);
return (char *)(array->data) + (position * array->element_size);
}
@ -110,7 +110,7 @@ icalarray_remove_element_at (icalarray *array,
int elements_to_move;
assert (position >= 0);
assert (position < array->num_elements);
assert ((unsigned int)position < array->num_elements);
dest = (char *)array->data + (position * array->element_size);
elements_to_move = array->num_elements - position - 1;
@ -141,7 +141,7 @@ icalarray_expand (icalarray *array,
new_space_allocated = array->space_allocated + array->increment_size;
if (space_needed > array->increment_size)
if ((unsigned int)space_needed > array->increment_size)
new_space_allocated += space_needed;
/*
@ -149,10 +149,10 @@ icalarray_expand (icalarray *array,
new_space_allocated * array->element_size);
*/
new_data = malloc(new_space_allocated * array->element_size);
memcpy(new_data,array->data,array->element_size*array->space_allocated);
free(array->data);
if (new_data) {
memcpy(new_data,array->data,array->element_size*array->space_allocated);
free(array->data);
array->data = new_data;
array->space_allocated = new_space_allocated;
} else {

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: Damon Chaplin 07 March 2001
$Id: icalarray.h,v 1.4 2007/04/30 13:57:47 artcancro Exp $
$Id: icalarray.h,v 1.5 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2001, Ximian, Inc.
@ -49,7 +49,7 @@ icalarray *icalarray_new (int element_size,
void icalarray_free (icalarray *array);
void icalarray_append (icalarray *array,
void *element);
const void *element);
void icalarray_remove_element_at (icalarray *array,
int position);

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalattach.c
CREATOR: acampi 28 May 02
$Id: icalattach.c,v 1.3 2007/04/30 13:57:47 artcancro Exp $
$Id: icalattach.c,v 1.3 2007-04-30 13:57:47 artcancro Exp $
$Locker: $

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: acampi 28 May 02
(C) COPYRIGHT 2002, Andrea Campi
(C) COPYRIGHT 2002, Andrea Campi <a.campi@inet.it>
This program is free software; you can redistribute it and/or modify
it under the terms of either:

Просмотреть файл

@ -3,10 +3,10 @@
FILE: icalattachimpl.h
CREATOR: acampi 28 May 02
$Id: icalattachimpl.h,v 1.2 2007/04/30 13:57:47 artcancro Exp $
$Id: icalattachimpl.h,v 1.3 2008-01-15 23:17:40 dothebart Exp $
(C) COPYRIGHT 2000, Andrea Campi
(C) COPYRIGHT 2000, Andrea Campi <a.campi@inet.it>
This program is free software; you can redistribute it and/or modify
it under the terms of either:

Просмотреть файл

@ -2,7 +2,7 @@
FILE: icalcomponent.c
CREATOR: eric 28 April 1999
$Id: icalcomponent.c,v 1.60 2007/11/30 22:32:08 dothebart Exp $
$Id: icalcomponent.c,v 1.64 2008-01-30 20:28:42 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -47,11 +47,6 @@
#include <string.h> /* for strdup */
#include <limits.h> /* for INT_MAX */
#ifdef WIN32
#define strncasecmp strnicmp
#endif
struct icalcomponent_impl
{
char id[5];
@ -173,7 +168,7 @@ icalcomponent_vanew (icalcomponent_kind kind, ...)
/** @brief Constructor
*/
icalcomponent* icalcomponent_new_from_string(char* str)
icalcomponent* icalcomponent_new_from_string(const char* str)
{
return icalparser_parse_string(str);
}
@ -289,28 +284,27 @@ icalcomponent_free (icalcomponent* c)
}
}
char*
icalcomponent_as_ical_string (icalcomponent* impl)
{
char* buf, *out_buf;
const char* tmp_buf;
char *buf;
buf = icalcomponent_as_ical_string_r(impl);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char*
icalcomponent_as_ical_string_r (icalcomponent* impl)
{
char* buf;
char* tmp_buf;
size_t buf_size = 1024;
char* buf_ptr = 0;
pvl_elem itr;
/* RFC 2445 explicitly says that the newline is *ALWAYS* a \r\n (CRLF)!!!! */
/* WIN32 automatically adds the \r, Anybody else need it?
well, the spec says \r\n is a MUST
#ifdef ICAL_UNIX_NEWLINE
char newline[] = "\n";
#else
*/
char newline[] = "\r\n";
/*
#endif
*/
/* RFC 2445 explicitly says that the newline is *ALWAYS* a \r\n (CRLF)!!!! */
const char newline[] = "\r\n";
icalcomponent *c;
icalproperty *p;
@ -345,9 +339,10 @@ icalcomponent_as_ical_string (icalcomponent* impl)
p = (icalproperty*)pvl_data(itr);
icalerror_assert((p!=0),"Got a null property");
tmp_buf = icalproperty_as_ical_string(p);
tmp_buf = icalproperty_as_ical_string_r(p);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, tmp_buf);
free(tmp_buf);
}
@ -357,9 +352,10 @@ icalcomponent_as_ical_string (icalcomponent* impl)
{
c = (icalcomponent*)pvl_data(itr);
tmp_buf = icalcomponent_as_ical_string(c);
tmp_buf = icalcomponent_as_ical_string_r(c);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, tmp_buf);
free(tmp_buf);
}
@ -368,10 +364,7 @@ icalcomponent_as_ical_string (icalcomponent* impl)
icalcomponent_kind_to_string(kind));
icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline);
out_buf = icalmemory_tmp_copy(buf);
free(buf);
return out_buf;
return buf;
}
@ -880,8 +873,8 @@ int icalproperty_recurrence_is_excluded(icalcomponent *comp,
/** Now test against the EXRULEs **/
for (exrule = icalcomponent_get_first_property(comp,ICAL_EXRULE_PROPERTY);
exdate != NULL;
exdate = icalcomponent_get_next_property(comp,ICAL_EXRULE_PROPERTY)) {
exrule != NULL;
exrule = icalcomponent_get_next_property(comp,ICAL_EXRULE_PROPERTY)) {
struct icalrecurrencetype recur = icalproperty_get_exrule(exrule);
icalrecur_iterator *exrule_itr = icalrecur_iterator_new(recur, *dtstart);
@ -1052,7 +1045,7 @@ void icalcomponent_foreach_recurrence(icalcomponent* comp,
struct icaltimetype rrule_time = icalrecur_iterator_next(rrule_itr);
/** note that icalrecur_iterator_next always returns dtstart
the first time.. **/
while (1) {
rrule_time = icalrecur_iterator_next(rrule_itr);
@ -1289,9 +1282,10 @@ static const struct icalcomponent_kind_map component_map[] =
{ ICAL_VSCHEDULE_COMPONENT, "SCHEDULE" },
/* CAP components */
{ ICAL_VQUERY_COMPONENT, "VQUERY" },
{ ICAL_VCAR_COMPONENT, "VCAR" },
{ ICAL_VCOMMAND_COMPONENT, "VCOMMAND" },
{ ICAL_VQUERY_COMPONENT, "VQUERY" },
{ ICAL_VREPLY_COMPONENT, "VREPLY" },
/* libical private components */
{ ICAL_XLICINVALID_COMPONENT, "X-LIC-UNKNOWN" },
@ -1517,7 +1511,7 @@ icalproperty_method icalcomponent_get_method(icalcomponent* comp)
*/
void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v)
{
char *tzid;
const char *tzid;
ICALSETUPSET(ICAL_DTSTART_PROPERTY);
if (prop == 0){
@ -1546,6 +1540,7 @@ void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v)
static struct icaltimetype
icalcomponent_get_datetime(icalcomponent *comp, icalproperty *prop) {
icalcomponent *c;
icalparameter *param;
struct icaltimetype ret;
@ -1554,11 +1549,19 @@ icalcomponent_get_datetime(icalcomponent *comp, icalproperty *prop) {
if ((param = icalproperty_get_first_parameter(prop, ICAL_TZID_PARAMETER))
!= NULL) {
const char *tzid = icalparameter_get_tzid(param);
icaltimezone *tz;
icaltimezone *tz = NULL;
if ((tz = icalcomponent_get_timezone(comp, tzid)) != NULL) {
icaltime_set_timezone(&ret, tz);
for (c = comp; c != NULL; c = icalcomponent_get_parent(c)) {
tz = icalcomponent_get_timezone(c, tzid);
if (tz != NULL)
break;
}
if (tz == NULL)
tz = icaltimezone_get_builtin_timezone_from_tzid(tzid);
if (tz != NULL)
ret = icaltime_set_timezone(&ret, tz);
}
return ret;
@ -1635,7 +1638,7 @@ struct icaltimetype icalcomponent_get_dtend(icalcomponent* comp)
*/
void icalcomponent_set_dtend(icalcomponent* comp, struct icaltimetype v)
{
char *tzid;
const char *tzid;
ICALSETUPSET(ICAL_DTEND_PROPERTY);
if (icalcomponent_get_first_property(inner,ICAL_DURATION_PROPERTY)
@ -2068,6 +2071,10 @@ icalcomponent* icalcomponent_new_vquery()
{
return icalcomponent_new(ICAL_VQUERY_COMPONENT);
}
icalcomponent* icalcomponent_new_vreply()
{
return icalcomponent_new(ICAL_VREPLY_COMPONENT);
}
/*
* Timezone stuff.
@ -2084,7 +2091,7 @@ void icalcomponent_merge_component(icalcomponent* comp,
{
icalcomponent *subcomp, *next_subcomp;
icalarray *tzids_to_rename;
int i;
unsigned int i;
/* Check that both components are VCALENDAR components. */
assert (icalcomponent_isa(comp) == ICAL_VCALENDAR_COMPONENT);
@ -2204,6 +2211,7 @@ icalcomponent_handle_conflicting_vtimezones (icalcomponent *comp,
int i, suffix, max_suffix = 0, num_elements;
unsigned int tzid_len;
char *tzid_copy, *new_tzid, suffix_buf[32];
(void)tzid_prop; /* hack to stop unused variable warning */
/* Find the length of the TZID without any trailing digits. */
tzid_len = icalcomponent_get_tzid_prefix_len (tzid);
@ -2218,7 +2226,8 @@ icalcomponent_handle_conflicting_vtimezones (icalcomponent *comp,
num_elements = comp->timezones ? comp->timezones->num_elements : 0;
for (i = 0; i < num_elements; i++) {
icaltimezone *zone;
char *existing_tzid, *existing_tzid_copy;
const char *existing_tzid;
const char *existing_tzid_copy;
unsigned int existing_tzid_len;
zone = icalarray_element_at (comp->timezones, i);
@ -2315,7 +2324,7 @@ static void icalcomponent_rename_tzids_callback(icalparameter *param, void *data
/* 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) {
for (i = 0; (unsigned int)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;
@ -2372,7 +2381,7 @@ icaltimezone* icalcomponent_get_timezone(icalcomponent* comp, const char *tzid)
{
icaltimezone *zone;
int lower, upper, middle, cmp;
char *zone_tzid;
const char *zone_tzid;
if (!comp->timezones)
return NULL;
@ -2464,13 +2473,13 @@ static int icalcomponent_compare_vtimezones (icalcomponent *vtimezone1,
icalproperty_set_tzid (prop2, tzid1);
/* Now convert both VTIMEZONEs to strings and compare them. */
string1 = icalcomponent_as_ical_string (vtimezone1);
string1 = icalcomponent_as_ical_string_r (vtimezone1);
if (!string1) {
free (tzid2_copy);
return -1;
}
string2 = icalcomponent_as_ical_string (vtimezone2);
string2 = icalcomponent_as_ical_string_r (vtimezone2);
if (!string2) {
free (string1);
free (tzid2_copy);

Просмотреть файл

@ -4,7 +4,8 @@
CREATOR: eric 20 March 1999
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -51,12 +52,13 @@ typedef struct icalcompiter
icalcomponent* icalcomponent_new(icalcomponent_kind kind);
icalcomponent* icalcomponent_new_clone(icalcomponent* component);
icalcomponent* icalcomponent_new_from_string(char* str);
icalcomponent* icalcomponent_new_from_string(const char* str);
icalcomponent* icalcomponent_vanew(icalcomponent_kind kind, ...);
icalcomponent* icalcomponent_new_x(const char* x_name);
void icalcomponent_free(icalcomponent* component);
char* icalcomponent_as_ical_string(icalcomponent* component);
char* icalcomponent_as_ical_string_r(icalcomponent* component);
int icalcomponent_is_valid(icalcomponent* component);

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalderivedparameters.{c,h}
CREATOR: eric 09 May 1999
$Id: icalderivedparameter.c.in,v 1.8 2007/04/30 13:57:48 artcancro Exp $
$Id: icalderivedparameter.c.in,v 1.9 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
@ -55,7 +55,7 @@ struct icalparameter_impl* icalparameter_new_impl(icalparameter_kind kind);
representation of the parameter's name */
struct icalparameter_kind_map {
icalparameter_kind kind;
char *name;
const char *name;
};
@ -174,6 +174,8 @@ icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind,const
/* Search through the parameter map to find a matching kind */
param = icalparameter_new_impl(kind);
if (!param)
return 0;
for (i=0; icalparameter_map[i].kind != ICAL_NO_PARAMETER; i++){
if(kind == icalparameter_map[i].kind) {

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: eric 20 March 1999
$Id: icalderivedparameter.h.in,v 1.4 2007/04/30 13:57:48 artcancro Exp $
$Id: icalderivedparameter.h.in,v 1.4 2007-04-30 13:57:48 artcancro Exp $
$Locker: $

Просмотреть файл

@ -4,7 +4,7 @@
FILE: icalderivedproperty.c
CREATOR: eric 15 Feb 2001
$Id: icalderivedproperty.c.in,v 1.14 2007/04/30 13:57:48 artcancro Exp $
$Id: icalderivedproperty.c.in,v 1.15 2008-01-28 22:34:37 artcancro Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -35,6 +35,7 @@
#include "icalerror.h"
#include "icalmemory.h"
#include "icalparser.h"
#include "icaltimezone.h"
#include <string.h> /* For icalmemory_strdup, rindex */
#include <assert.h>
@ -162,6 +163,13 @@ const char* icalproperty_enum_to_string(int e)
return enum_map[e-ICALPROPERTY_FIRST_ENUM].str;
}
char *icalproperty_enum_to_string_r(int e)
{
return icalmemory_strdup(icalproperty_enum_to_string(e));
}
int icalproperty_kind_and_string_to_enum(const int kind, const char* str)
{
icalproperty_kind pkind;
@ -169,7 +177,7 @@ int icalproperty_kind_and_string_to_enum(const int kind, const char* str)
icalerror_check_arg_rz(str!=0,"str")
if ((pkind = icalproperty_value_kind_to_kind(kind)) == ICAL_NO_VALUE)
if ((pkind = icalproperty_value_kind_to_kind(kind)) == ICAL_NO_PROPERTY)
return 0;
while(*str == ' '){

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalderivedproperties.{c,h}
CREATOR: eric 09 May 1999
$Id: icalderivedproperty.h.in,v 1.7 2007/04/30 13:57:48 artcancro Exp $
$Id: icalderivedproperty.h.in,v 1.7 2007-04-30 13:57:48 artcancro Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
======================================================================*/

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalderivedvalue.c.in,v 1.15 2007/04/30 13:57:48 artcancro Exp $
$Id: icalderivedvalue.c.in,v 1.15 2007-04-30 13:57:48 artcancro Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -45,8 +45,8 @@
#include <errno.h>
#include <time.h> /* for mktime */
#include <stdlib.h> /* for atoi and atof */
#include <limits.h> /* for SHRT_MAX */
#include <limits.h> /* for SHRT_MAX */
#ifdef WIN32
#define strcasecmp stricmp
#endif

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: eric 20 March 1999
$Id: icalderivedvalue.h.in,v 1.10 2007/04/30 13:57:48 artcancro Exp $
$Id: icalderivedvalue.h.in,v 1.10 2007-04-30 13:57:48 artcancro Exp $
$Locker: $

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icaltime.c
CREATOR: eric 02 June 2000
$Id: icalduration.c,v 1.20 2007/04/30 13:57:48 artcancro Exp $
$Id: icalduration.c,v 1.21 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -186,7 +186,7 @@ struct icaldurationtype icaldurationtype_from_string(const char* str)
#define TMP_BUF_SIZE 1024
static
void append_duration_segment(char** buf, char** buf_ptr, size_t* buf_size,
char* sep, unsigned int value) {
const char* sep, unsigned int value) {
char temp[TMP_BUF_SIZE];
@ -199,8 +199,17 @@ void append_duration_segment(char** buf, char** buf_ptr, size_t* buf_size,
char* icaldurationtype_as_ical_string(struct icaldurationtype d)
{
char *buf;
buf = icaldurationtype_as_ical_string_r(d);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char *buf, *output_line;
char* icaldurationtype_as_ical_string_r(struct icaldurationtype d)
{
char *buf;
size_t buf_size = 256;
char* buf_ptr = 0;
int seconds;
@ -248,11 +257,7 @@ char* icaldurationtype_as_ical_string(struct icaldurationtype d)
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "PT0S");
}
output_line = icalmemory_tmp_copy(buf);
icalmemory_free_buffer(buf);
return output_line;
return buf;
}

Просмотреть файл

@ -4,10 +4,11 @@
CREATOR: eric 26 Jan 2001
$Id: icalduration.h,v 1.4 2007/04/30 13:57:48 artcancro Exp $
$Id: icalduration.h,v 1.5 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -45,6 +46,7 @@ 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);
char* icaldurationtype_as_ical_string_r(struct icaldurationtype d);
struct icaldurationtype icaldurationtype_null_duration(void);
struct icaldurationtype icaldurationtype_bad_duration(void);
int icaldurationtype_is_null_duration(struct icaldurationtype d);

Просмотреть файл

@ -3,10 +3,11 @@
FILE: icalenum.c
CREATOR: eric 29 April 1999
$Id: icalenums.c,v 1.15 2007/05/25 02:57:04 artcancro Exp $
$Id: icalenums.c,v 1.16 2008-01-15 23:17:40 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -101,9 +102,18 @@ const char* icalenum_reqstat_desc(icalrequeststatus stat)
return 0;
}
char* icalenum_reqstat_code(icalrequeststatus stat)
{
char *buf;
buf = icalenum_reqstat_code_r(stat);
icalmemory_add_tmp_buffer(buf);
return buf;
}
/*** @brief Return the code for a request status
*/
char* icalenum_reqstat_code(icalrequeststatus stat)
char* icalenum_reqstat_code_r(icalrequeststatus stat)
{
int i, major, minor;
char tmpbuf[36];
@ -113,7 +123,7 @@ char* icalenum_reqstat_code(icalrequeststatus stat)
major = request_status_map[i].major;
minor = request_status_map[i].minor;
snprintf(tmpbuf, sizeof(tmpbuf), "%i.%i", major, minor);
return icalmemory_tmp_copy(tmpbuf);
return icalmemory_strdup(tmpbuf);
}
}
return NULL;

Просмотреть файл

@ -5,7 +5,8 @@
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -21,7 +22,7 @@
The original code is icalenums.h
Contributions from:
Graham Davison (g.m.davison@computer.org)
Graham Davison <g.m.davison@computer.org>
======================================================================*/
@ -56,6 +57,7 @@ typedef enum icalcomponent_kind {
ICAL_X_COMPONENT,
ICAL_VSCHEDULE_COMPONENT,
ICAL_VQUERY_COMPONENT,
ICAL_VREPLY_COMPONENT,
ICAL_VCAR_COMPONENT,
ICAL_VCOMMAND_COMPONENT,
ICAL_XLICINVALID_COMPONENT,
@ -118,6 +120,7 @@ short icalenum_reqstat_major(icalrequeststatus stat);
short icalenum_reqstat_minor(icalrequeststatus stat);
icalrequeststatus icalenum_num_to_reqstat(short major, short minor);
char* icalenum_reqstat_code(icalrequeststatus stat);
char* icalenum_reqstat_code_r(icalrequeststatus stat);
/***********************************************************************
* Conversion functions

Просмотреть файл

@ -3,11 +3,12 @@
FILE: icalerror.c
CREATOR: eric 16 May 1999
$Id: icalerror.c,v 1.20 2007/05/31 21:26:14 artcancro Exp $
$Id: icalerror.c,v 1.22 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -29,6 +30,10 @@
#include "config.h"
#endif
#ifdef HAVE_BACKTRACE
#include <execinfo.h>
#endif
#include <stdlib.h> /* for malloc() */
#include <string.h> /* for strcmp */
#include "icalerror.h"
@ -97,6 +102,7 @@ void icalerror_set_errno(icalerrorenum x)
(icalerror_get_error_state(x)==ICAL_ERROR_DEFAULT &&
icalerror_errors_are_fatal == 1 )){
icalerror_warn(icalerror_strerror(x));
ical_bt();
assert(0);
}
@ -108,7 +114,7 @@ void icalerror_clear_errno() {
icalerrno = ICAL_NO_ERROR;
}
#if ICAL_ERRORS_ARE_FATAL
#if ICAL_ERRORS_ARE_FATAL == 1
int icalerror_errors_are_fatal = 1;
#else
int icalerror_errors_are_fatal = 0;
@ -158,17 +164,13 @@ static const struct icalerror_string_map string_map[] =
icalerrorenum icalerror_error_from_string(const char* str){
icalerrorenum e;
int i = 0;
int i;
for( i = 0; string_map[i].error != ICAL_NO_ERROR; i++){
if (strcmp(string_map[i].str,str) == 0){
e = string_map[i].error;
}
}
for( i = 0; string_map[i].error != ICAL_UNKNOWN_ERROR; i++)
if (strcmp(string_map[i].str,str) == 0)
break;
return e;
return string_map[i].error;
}
icalerrorstate icalerror_supress(const char* error){
@ -248,4 +250,22 @@ const char* icalerror_strerror(icalerrorenum e) {
}
void ical_bt(void)
{
#ifdef HAVE_BACKTRACE
void *stack_frames[50];
size_t size, i;
char **strings;
size = backtrace(stack_frames, sizeof(stack_frames) / sizeof(void*));
strings = backtrace_symbols(stack_frames, size);
for (i = 0; i < size; i++) {
if (strings != NULL)
fprintf(stderr, "%s\n", strings[i]);
else
fprintf(stderr, "%p\n", stack_frames[i]);
}
free(strings);
#endif
}

Просмотреть файл

@ -3,10 +3,11 @@
FILE: icalerror.h
CREATOR: eric 09 May 1999
$Id: icalerror.h,v 1.16 2007/05/25 02:57:04 artcancro Exp $
$Id: icalerror.h,v 1.17 2008-01-15 23:17:40 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -92,6 +93,7 @@ typedef enum icalerrorstate {
const char* icalerror_strerror(icalerrorenum e);
const char* icalerror_perror();
void ical_bt(void);
void icalerror_set_error_state( icalerrorenum error, icalerrorstate);
icalerrorstate icalerror_get_error_state( icalerrorenum error);
@ -102,8 +104,9 @@ 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)); \
ical_bt(); \
assert(0); \
}
} }
#else
void icalerror_set_errno(icalerrorenum x);
#endif

Просмотреть файл

@ -5,7 +5,7 @@
DESCRIPTION:
$Id: icallangbind.c,v 1.23 2007/04/30 13:57:48 artcancro Exp $
$Id: icallangbind.c,v 1.24 2008-01-02 20:07:31 dothebart Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
@ -18,6 +18,10 @@
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "icalcomponent.h"
#include "icalproperty.h"
#include "icalerror.h"
@ -40,8 +44,8 @@ void icallangbind_free_array(int* array){
free(array);
}
int icallangbind_access_array(int* array, int indx) {
return array[indx];
int icallangbind_access_array(int* array, int index) {
return array[index];
}
/** Iterators to fetch parameters given property */
@ -152,8 +156,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* icallangbind_property_eval_string_r(icalproperty* prop, char* sep)
{
char tmp[25];
size_t buf_size = 1024;
@ -205,7 +208,7 @@ const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
default:
{
const char* str = icalvalue_as_ical_string(value);
char* str = icalvalue_as_ical_string_r(value);
char* copy = (char*) malloc(strlen(str)+1);
const char *i;
@ -233,6 +236,7 @@ const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
APPENDC('\'');
free(copy);
free(str);
break;
}
@ -245,8 +249,7 @@ const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
param != 0;
param = icalproperty_get_next_parameter(prop,ICAL_ANY_PARAMETER)){
const char* str = icalparameter_as_ical_string(param);
char *copy = icalmemory_tmp_copy(str);
char *copy = icalparameter_as_ical_string_r(param);
char *v;
if(copy == 0){
@ -258,6 +261,7 @@ const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
if(v == 0){
free(copy);
continue;
}
@ -273,17 +277,25 @@ const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
APPENDC('\'');
APPENDS(v);
APPENDC('\'');
free(copy);
}
APPENDC('}');
icalmemory_add_tmp_buffer(buf);
return buf;
}
const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
{
char *buf;
buf = icallangbind_property_eval_string_r(prop, sep);
icalmemory_add_tmp_buffer(buf);
return buf;
}
#include "fcntl.h"
int icallangbind_string_to_open_flag(const char* str)
{
@ -296,7 +308,7 @@ int icallangbind_string_to_open_flag(const char* str)
}
const char* icallangbind_quote_as_ical(const char* str)
char* icallangbind_quote_as_ical_r(const char* str)
{
size_t buf_size = 2 * strlen(str);
@ -306,7 +318,15 @@ const char* icallangbind_quote_as_ical(const char* str)
result = icalvalue_encode_ical_string(str, buf, buf_size);
icalmemory_add_tmp_buffer(buf);
return buf;
}
const char* icallangbind_quote_as_ical(const char* str)
{
char *buf;
buf = icallangbind_quote_as_ical_r(str);
icalmemory_add_tmp_buffer(buf);
return(buf);
}

Просмотреть файл

@ -5,7 +5,7 @@
DESCRIPTION:
$Id: icallangbind.h,v 1.7 2007/04/30 13:57:48 artcancro Exp $
$Id: icallangbind.h,v 1.8 2008-01-02 20:07:31 dothebart Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
@ -23,7 +23,7 @@
int* icallangbind_new_array(int size);
void icallangbind_free_array(int* array);
int icallangbind_access_array(int* array, int indx);
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);
@ -46,9 +46,11 @@ icalparameter* icallangbind_get_first_parameter(icalproperty *prop);
icalparameter* icallangbind_get_next_parameter(icalproperty *prop);
const char* icallangbind_property_eval_string(icalproperty* prop, char* sep);
char* icallangbind_property_eval_string_r(icalproperty* prop, char* sep);
int icallangbind_string_to_open_flag(const char* str);
const char* icallangbind_quote_as_ical(const char* str);
char* icallangbind_quote_as_ical_r(const char* str);
#endif /*__ICALLANGBIND_H__*/

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalmemory.c
CREATOR: eric 30 June 1999
$Id: icalmemory.c,v 1.11 2007/04/30 13:57:48 artcancro Exp $
$Id: icalmemory.c,v 1.12 2008-02-03 16:10:46 dothebart Exp $
$Locker: $
The contents of this file are subject to the Mozilla Public License
@ -83,7 +83,9 @@ typedef struct {
void icalmemory_free_tmp_buffer (void* buf);
void icalmemory_free_ring_byval(buffer_ring *br);
#ifndef HAVE_PTHREAD
static buffer_ring* global_buffer_ring = 0;
#endif
#ifdef HAVE_PTHREAD
#include <pthread.h>
@ -130,8 +132,7 @@ static buffer_ring* get_buffer_ring_pthread(void) {
}
return(br);
}
#endif
#else
/* get buffer ring via a single global for a non-threaded program */
static buffer_ring* get_buffer_ring_global(void) {
if (global_buffer_ring == 0) {
@ -139,6 +140,7 @@ static buffer_ring* get_buffer_ring_global(void) {
}
return(global_buffer_ring);
}
#endif
static buffer_ring *get_buffer_ring(void) {
#ifdef HAVE_PTHREAD

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: eric 30 June 1999
$Id: icalmemory.h,v 1.5 2007/04/30 13:57:48 artcancro Exp $
$Id: icalmemory.h,v 1.6 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
This program is free software; you can redistribute it and/or modify
@ -20,7 +20,8 @@
The Initial Developer of the Original Code is Eric Busboom
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
======================================================================*/
#ifndef ICALMEMORY_H

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: eric 26 July 2000
$Id: icalmime.c,v 1.11 2007/05/31 21:26:14 artcancro Exp $
$Id: icalmime.c,v 1.14 2008-01-29 22:25:05 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -73,9 +73,11 @@ void* icalmime_text_new_part()
}
void icalmime_text_add_line(void *part,
struct sspm_header *header,
char* line, size_t size)
const char* line, size_t size)
{
struct text_part* impl = (struct text_part*) part;
(void)header;
(void)size;
icalmemory_append_string(&(impl->buf),&(impl->buf_pos),
&(impl->buf_size),line);
@ -95,18 +97,26 @@ void* icalmime_textcalendar_end_part(void* part)
}
void* icalmime_text_end_part(void* part)
void* icalmime_text_end_part_r(void* part)
{
char *buf;
struct text_part* impl = ( struct text_part*) part;
icalmemory_add_tmp_buffer(impl->buf);
buf = impl->buf;
free(impl);
return buf;
}
void* icalmime_text_end_part(void* part)
{
void *buf;
buf = icalmime_text_end_part_r(part);
icalmemory_add_tmp_buffer(buf);
return buf;
}
void icalmime_text_free_part(void *part)
{
part = part;
@ -120,21 +130,23 @@ void* icalmime_attachment_new_part()
return 0;
}
void icalmime_attachment_add_line(void *part, struct sspm_header *header,
char* line, size_t size)
const char* line, size_t size)
{
part = part;
header = header;
line = line;
size = size;
(void)part;
(void)header;
(void)line;
(void)size;
}
void* icalmime_attachment_end_part(void* part)
{
(void)part;
return 0;
}
void icalmime_attachment_free_part(void *part)
{
(void)part;
}
@ -143,8 +155,8 @@ void icalmime_attachment_free_part(void *part)
static const struct sspm_action_map icalmime_local_action_map[] =
{
{SSPM_TEXT_MAJOR_TYPE,SSPM_CALENDAR_MINOR_TYPE,icalmime_text_new_part,icalmime_text_add_line,icalmime_textcalendar_end_part,icalmime_text_free_part},
{SSPM_TEXT_MAJOR_TYPE,SSPM_ANY_MINOR_TYPE,icalmime_text_new_part,icalmime_text_add_line,icalmime_text_end_part,icalmime_text_free_part},
{SSPM_TEXT_MAJOR_TYPE,SSPM_PLAIN_MINOR_TYPE,icalmime_text_new_part,icalmime_text_add_line,icalmime_text_end_part,icalmime_text_free_part},
{SSPM_TEXT_MAJOR_TYPE,SSPM_ANY_MINOR_TYPE,icalmime_text_new_part,icalmime_text_add_line,icalmime_text_end_part_r,icalmime_text_free_part},
{SSPM_TEXT_MAJOR_TYPE,SSPM_PLAIN_MINOR_TYPE,icalmime_text_new_part,icalmime_text_add_line,icalmime_text_end_part_r,icalmime_text_free_part},
{SSPM_APPLICATION_MAJOR_TYPE,SSPM_CALENDAR_MINOR_TYPE,icalmime_attachment_new_part,icalmime_attachment_add_line,icalmime_attachment_end_part,icalmime_attachment_free_part},
{SSPM_IMAGE_MAJOR_TYPE,SSPM_CALENDAR_MINOR_TYPE,icalmime_attachment_new_part,icalmime_attachment_add_line,icalmime_attachment_end_part,icalmime_attachment_free_part},
{SSPM_AUDIO_MAJOR_TYPE,SSPM_CALENDAR_MINOR_TYPE,icalmime_attachment_new_part,icalmime_attachment_add_line,icalmime_attachment_end_part,icalmime_attachment_free_part},
@ -193,8 +205,8 @@ icalcomponent* icalmime_parse(char* (*get_string)(char *s, size_t size,
#define TMPSZ 1024
char mimetype[TMPSZ];
char* major = sspm_major_type_string(parts[i].header.major);
char* minor = sspm_minor_type_string(parts[i].header.minor);
const char* major = sspm_major_type_string(parts[i].header.major);
const char* minor = sspm_minor_type_string(parts[i].header.minor);
if(parts[i].header.minor == SSPM_UNKNOWN_MINOR_TYPE ){
assert(parts[i].header.minor_text !=0);
@ -213,6 +225,9 @@ icalcomponent* icalmime_parse(char* (*get_string)(char *s, size_t size,
if(parts[i].header.error!=SSPM_NO_ERROR){
const char *str="Unknown error";
char temp[256];
if(parts[i].header.error==SSPM_MALFORMED_HEADER_ERROR){
str = "Malformed header, possibly due to input not in MIME format";
}
if(parts[i].header.error==SSPM_UNEXPECTED_BOUNDARY_ERROR){
str = "Got an unexpected boundary, possibly due to a MIME header for a MULTIPART part that is missing the Content-Type line";
@ -376,8 +391,8 @@ int icalmime_test(char* (*get_string)(char *s, size_t size, void *d),
for(i = 0; i <NUM_PARTS && parts[i].header.major != SSPM_NO_MAJOR_TYPE ;
i++){
if(parts[i].header.minor == SSPM_CALENDAR_MINOR_TYPE){
parts[i].data = icalmemory_strdup(
icalcomponent_as_ical_string((icalcomponent*)parts[i].data));
parts[i].data =
icalcomponent_as_ical_string_r((icalcomponent*)parts[i].data);
}
}

Просмотреть файл

@ -4,10 +4,11 @@
CREATOR: eric 26 July 2000
$Id: icalmime.h,v 1.2 2007/04/30 13:57:48 artcancro Exp $
$Id: icalmime.h,v 1.3 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:

Просмотреть файл

@ -3,11 +3,12 @@
FILE: icalderivedparameters.{c,h}
CREATOR: eric 09 May 1999
$Id: icalparameter.c,v 1.13 2007/04/30 13:57:48 artcancro Exp $
$Id: icalparameter.c,v 1.15 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -23,7 +24,7 @@
The original code is icalderivedparameters.{c,h}
Contributions from:
Graham Davison (g.m.davison@computer.org)
Graham Davison <g.m.davison@computer.org>
======================================================================*/
/*#line 29 "icalparameter.c.in"*/
@ -192,6 +193,16 @@ icalparameter* icalparameter_new_from_string(const char *str)
}
char*
icalparameter_as_ical_string(icalparameter* param)
{
char *buf;
buf = icalparameter_as_ical_string_r(param);
icalmemory_add_tmp_buffer(buf);
return buf;
}
/**
* Return a string representation of the parameter according to RFC2445.
*
@ -204,7 +215,7 @@ icalparameter* icalparameter_new_from_string(const char *str)
* SAFE-CHAR = any character except CTLs, DQUOTE. ";", ":", ","
*/
char*
icalparameter_as_ical_string (icalparameter* param)
icalparameter_as_ical_string_r(icalparameter* param)
{
size_t buf_size = 1024;
char* buf;
@ -215,10 +226,8 @@ icalparameter_as_ical_string (icalparameter* param)
icalerror_check_arg_rz( (param!=0), "parameter");
/* Create new buffer that we can append names, parameters and a
value to, and reallocate as needed. Later, this buffer will be
copied to a icalmemory_tmp_buffer, which is managed internally
by libical, so it can be given to the caller without fear of
the caller forgetting to free it */
* value to, and reallocate as needed.
*/
buf = icalmemory_new_buffer(buf_size);
buf_ptr = buf;
@ -268,16 +277,7 @@ icalparameter_as_ical_string (icalparameter* param)
return 0;
}
/* Now, copy the buffer to a tmp_buffer, which is safe to give to
the caller without worring about de-allocating it. */
out_buf = icalmemory_tmp_buffer(strlen(buf)+1);
strcpy(out_buf, buf);
icalmemory_free_buffer(buf);
return out_buf;
return buf;
}

Просмотреть файл

@ -4,12 +4,13 @@
CREATOR: eric 20 March 1999
$Id: icalparameter.h,v 1.4 2007/04/30 13:57:48 artcancro Exp $
$Id: icalparameter.h,v 1.5 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -46,6 +47,7 @@ icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind, cons
void icalparameter_free(icalparameter* parameter);
char* icalparameter_as_ical_string(icalparameter* parameter);
char* icalparameter_as_ical_string_r(icalparameter* parameter);
int icalparameter_is_valid(icalparameter* parameter);
@ -53,7 +55,7 @@ icalparameter_kind icalparameter_isa(icalparameter* parameter);
int icalparameter_isa_parameter(void* param);
/* Acess the name of an X parameer */
/* Access 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);

Просмотреть файл

@ -1,289 +0,0 @@
/* -*- Mode: C++ -*- */
/**
* @file icalparameter_cxx.cpp
* @author fnguyen (12/10/01)
* @brief Implementation of C++ Wrapper for icalparameter.c
*
* (C) COPYRIGHT 2001, Critical Path
*/
#ifndef ICALPARAMETER_CXX_H
#include "icalparameter_cxx.h"
#endif
#ifndef ICALVALUE_CXX_H
#include "icalvalue_cxx.h"
#endif
typedef char* string; // Will use the string library from STL
ICalParameter::ICalParameter() throw(icalerrorenum) : imp(icalparameter_new(ICAL_ANY_PARAMETER)){
}
ICalParameter::ICalParameter(const ICalParameter& v) throw(icalerrorenum) {
imp = icalparameter_new_clone(v.imp);
if (!imp) throw icalerrno;
}
ICalParameter& ICalParameter::operator=(const ICalParameter& v) throw(icalerrorenum) {
if (this == &v) return *this;
if (imp != NULL)
{
icalparameter_free(imp);
imp = icalparameter_new_clone(v.imp);
if (!imp) throw icalerrno;
}
return *this;
}
ICalParameter::~ICalParameter(){
if (imp != NULL) icalparameter_free(imp);
}
ICalParameter::ICalParameter(icalparameter* v) throw(icalerrorenum) : imp(v){
}
/// Create from string of form "PARAMNAME=VALUE"
ICalParameter::ICalParameter(string str) throw(icalerrorenum) {
imp = icalparameter_new_from_string(str);
if (!imp) throw icalerrno;
}
/// Create from just the value, the part after the "="
ICalParameter::ICalParameter(icalparameter_kind kind, string str) throw(icalerrorenum) {
imp = icalparameter_new_from_value_string(kind, str);
if (!imp) throw icalerrno;
}
ICalParameter::ICalParameter(icalparameter_kind kind) throw(icalerrorenum) {
imp = icalparameter_new(kind);
if (!imp) throw icalerrno;
}
string ICalParameter::as_ical_string() throw(icalerrorenum) {
char *str = icalparameter_as_ical_string(imp);
if (!str) throw icalerrno;
return str;
}
bool ICalParameter::is_valid(){
if (imp == NULL) return false;
return (icalparameter_isa_parameter((void*)imp) ? true : false);
}
icalparameter_kind ICalParameter::isa(){
return icalparameter_isa(imp);
}
int ICalParameter::isa_parameter(void* param){
return icalparameter_isa_parameter(param);
}
/* Acess the name of an X parameer */
void ICalParameter::set_xname(ICalParameter &param, string v){
icalparameter_set_xname(param, v);
}
string ICalParameter::get_xname(ICalParameter &param){
return (string)icalparameter_get_xname(param);
}
void ICalParameter::set_xvalue (ICalParameter &param, string v){
icalparameter_set_xvalue(param, v);
}
string ICalParameter::get_xvalue(ICalParameter &param){
return (string)icalparameter_get_xvalue(param);
}
/* Convert enumerations */
string ICalParameter::kind_to_string(icalparameter_kind kind){
return (string)icalparameter_kind_to_string(kind);
}
icalparameter_kind ICalParameter::string_to_kind(string str){
return icalparameter_string_to_kind(str);
}
/* DELEGATED-FROM */
string ICalParameter::get_delegatedfrom(){
return (string)icalparameter_get_delegatedfrom(imp);
}
void ICalParameter::set_delegatedfrom(string v){
icalparameter_set_delegatedfrom(imp, v);
}
/* RELATED */
icalparameter_related ICalParameter::get_related(){
return icalparameter_get_related(imp);
}
void ICalParameter::set_related(icalparameter_related v){
icalparameter_set_related(imp, v);
}
/* SENT-BY */
string ICalParameter::get_sentby(){
return (string)icalparameter_get_sentby(imp);
}
void ICalParameter::set_sentby(string v){
icalparameter_set_sentby(imp, v);
}
/* LANGUAGE */
string ICalParameter::get_language(){
return (string)icalparameter_get_language(imp);
}
void ICalParameter::set_language(string v){
icalparameter_set_language(imp, v);
}
/* RELTYPE */
icalparameter_reltype ICalParameter::get_reltype(){
return icalparameter_get_reltype(imp);
}
void ICalParameter::set_reltype(icalparameter_reltype v){
icalparameter_set_reltype(imp, v);
}
/* ENCODING */
icalparameter_encoding ICalParameter::get_encoding(){
return icalparameter_get_encoding(imp);
}
void ICalParameter::set_encoding(icalparameter_encoding v){
icalparameter_set_encoding(imp, v);
}
/* ALTREP */
string ICalParameter::get_altrep(){
return (string)icalparameter_get_language(imp);
}
void ICalParameter::set_altrep(string v){
icalparameter_set_altrep(imp, v);
}
/* FMTTYPE */
string ICalParameter::get_fmttype(){
return (string)icalparameter_get_fmttype(imp);
}
void ICalParameter::set_fmttype(string v){
icalparameter_set_fmttype(imp, v);
}
/* FBTYPE */
icalparameter_fbtype ICalParameter::get_fbtype(){
return icalparameter_get_fbtype(imp);
}
void ICalParameter::set_fbtype(icalparameter_fbtype v){
icalparameter_set_fbtype(imp, v);
}
/* RSVP */
icalparameter_rsvp ICalParameter::get_rsvp(){
return icalparameter_get_rsvp(imp);
}
void ICalParameter::set_rsvp(icalparameter_rsvp v){
icalparameter_set_rsvp(imp, v);
}
/* RANGE */
icalparameter_range ICalParameter::get_range(){
return icalparameter_get_range(imp);
}
void ICalParameter::set_range(icalparameter_range v){
icalparameter_set_range(imp, v);
}
/* DELEGATED-TO */
string ICalParameter::get_delegatedto(){
return (string)icalparameter_get_delegatedto(imp);
}
void ICalParameter::set_delegatedto(string v){
icalparameter_set_delegatedto(imp, v);
}
/* CN */
string ICalParameter::get_cn(){
return (string)icalparameter_get_cn(imp);
}
void ICalParameter::set_cn(string v){
icalparameter_set_cn(imp, v);
}
/* ROLE */
icalparameter_role ICalParameter::get_role(){
return icalparameter_get_role(imp);
}
void ICalParameter::set_role(icalparameter_role v){
icalparameter_set_role(imp, v);
}
/* X-LIC-COMPARETYPE */
icalparameter_xliccomparetype ICalParameter::get_xliccomparetype(){
return icalparameter_get_xliccomparetype(imp);
}
void ICalParameter::set_xliccomparetype(icalparameter_xliccomparetype v){
icalparameter_set_xliccomparetype(imp, v);
}
/* PARTSTAT */
icalparameter_partstat ICalParameter::get_partstat(){
return icalparameter_get_partstat(imp);
}
void ICalParameter::set_partstat(icalparameter_partstat v){
icalparameter_set_partstat(imp, v);
}
/* X-LIC-ERRORTYPE */
icalparameter_xlicerrortype ICalParameter::get_xlicerrortype(){
return icalparameter_get_xlicerrortype(imp);
}
void ICalParameter::set_xlicerrortype(icalparameter_xlicerrortype v){
icalparameter_set_xlicerrortype(imp, v);
}
/* MEMBER */
string ICalParameter::get_member(){
return (string)icalparameter_get_member(imp);
}
void ICalParameter::set_member(string v){
icalparameter_set_member(imp, v);
}
/* X */
string ICalParameter::get_x(){
return (string)icalparameter_get_x(imp);
}
void ICalParameter::set_x(string v){
icalparameter_set_x(imp, v);
}
/* CUTYPE */
icalparameter_cutype ICalParameter::get_cutype(){
return icalparameter_get_cutype(imp);
}
void ICalParameter::set_cutype(icalparameter_cutype v){
icalparameter_set_cutype(imp, v);
}
/* TZID */
string ICalParameter::get_tzid(){
return (string)icalparameter_get_tzid(imp);
}
void ICalParameter::set_tzid(string v){
icalparameter_set_tzid(imp, v);
}
/* VALUE */
icalparameter_value ICalParameter::get_value(){
return icalparameter_get_value(imp);
}
void ICalParameter::set_value(icalparameter_value v){
icalparameter_set_value(imp, v);
}
/* DIR */
string ICalParameter::get_dir(){
return (string)icalparameter_get_dir(imp);
}
void ICalParameter::set_dir(string v){
icalparameter_set_dir(imp, v);
}

Просмотреть файл

@ -1,159 +0,0 @@
/* -*- Mode: C++ -*- */
/**
* @file icalparameter_cxx.h
* @author fnguyen (12/10/01)
* @brief Definition of C++ Wrapper for icalparameter.c
*
* (C) COPYRIGHT 2001, Critical Path
*/
#ifndef ICALPARAMETER_CXX_H
#define ICALPARAMETER_CXX_H
extern "C" {
#include "ical.h"
};
#include "icptrholder.h"
typedef char* string; // Will use the string library from STL
class ICalParameter {
public:
ICalParameter() throw(icalerrorenum);
ICalParameter(const ICalParameter&) throw(icalerrorenum);
ICalParameter& operator=(const ICalParameter&) throw(icalerrorenum);
~ICalParameter();
ICalParameter(icalparameter* v) throw(icalerrorenum);
// Create from string of form "PARAMNAME=VALUE"
ICalParameter(string str) throw(icalerrorenum);
// Create from just the value, the part after the "="
ICalParameter(icalparameter_kind kind, string str) throw(icalerrorenum);
ICalParameter(icalparameter_kind kind) throw(icalerrorenum);
operator icalparameter*() { return imp; }
void detach() {
imp = NULL;
}
public:
string as_ical_string() throw(icalerrorenum);
bool is_valid();
icalparameter_kind isa( );
int isa_parameter(void* param);
public:
/* Acess the name of an X parameer */
static void set_xname (ICalParameter &param, string v);
static string get_xname(ICalParameter &param);
static void set_xvalue (ICalParameter &param, string v);
static string get_xvalue(ICalParameter &param);
/* Convert enumerations */
static string kind_to_string(icalparameter_kind kind);
static icalparameter_kind string_to_kind(string str);
public:
/* DELEGATED-FROM */
string get_delegatedfrom();
void set_delegatedfrom(string v);
/* RELATED */
icalparameter_related get_related();
void set_related(icalparameter_related v);
/* SENT-BY */
string get_sentby();
void set_sentby(string v);
/* LANGUAGE */
string get_language();
void set_language(string v);
/* RELTYPE */
icalparameter_reltype get_reltype();
void set_reltype(icalparameter_reltype v);
/* ENCODING */
icalparameter_encoding get_encoding();
void set_encoding(icalparameter_encoding v);
/* ALTREP */
string get_altrep();
void set_altrep(string v);
/* FMTTYPE */
string get_fmttype();
void set_fmttype(string v);
/* FBTYPE */
icalparameter_fbtype get_fbtype();
void set_fbtype(icalparameter_fbtype v);
/* RSVP */
icalparameter_rsvp get_rsvp();
void set_rsvp(icalparameter_rsvp v);
/* RANGE */
icalparameter_range get_range();
void set_range(icalparameter_range v);
/* DELEGATED-TO */
string get_delegatedto();
void set_delegatedto(string v);
/* CN */
string get_cn();
void set_cn(string v);
/* ROLE */
icalparameter_role get_role();
void set_role(icalparameter_role v);
/* X-LIC-COMPARETYPE */
icalparameter_xliccomparetype get_xliccomparetype();
void set_xliccomparetype(icalparameter_xliccomparetype v);
/* PARTSTAT */
icalparameter_partstat get_partstat();
void set_partstat(icalparameter_partstat v);
/* X-LIC-ERRORTYPE */
icalparameter_xlicerrortype get_xlicerrortype();
void set_xlicerrortype(icalparameter_xlicerrortype v);
/* MEMBER */
string get_member();
void set_member(string v);
/* X */
string get_x();
void set_x(string v);
/* CUTYPE */
icalparameter_cutype get_cutype();
void set_cutype(icalparameter_cutype v);
/* TZID */
string get_tzid();
void set_tzid(string v);
/* VALUE */
icalparameter_value get_value();
void set_value(icalparameter_value v);
/* DIR */
string get_dir();
void set_dir(string v);
private:
icalparameter* imp;
};
#endif

Просмотреть файл

@ -3,11 +3,12 @@
FILE: icalparameterimpl.h
CREATOR: eric 09 May 1999
$Id: icalparameterimpl.h,v 1.3 2007/04/30 13:57:48 artcancro Exp $
$Id: icalparameterimpl.h,v 1.4 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icalparser.c
CREATOR: eric 04 August 1999
$Id: icalparser.c,v 1.51 2007/11/30 22:32:10 dothebart Exp $
$Id: icalparser.c,v 1.53 2008-01-15 23:17:40 dothebart Exp $
$Locker: $
The contents of this file are subject to the Mozilla Public License
@ -30,7 +30,8 @@
The Initial Developer of the Original Code is Eric Busboom
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
======================================================================*/
#ifdef HAVE_CONFIG_H
@ -49,10 +50,16 @@
#include <string.h> /* For strncpy & size_t */
#include <stdio.h> /* For FILE and fgets and snprintf */
#include <stdlib.h> /* for free */
#include <ctype.h>
#include "icalmemory.h"
#include "icalparser.h"
#ifdef WIN32
#define HAVE_CTYPE_H
#define HAVE_ISWSPACE
#endif
#ifdef HAVE_WCTYPE_H
# include <wctype.h>
/* Some systems have an imcomplete implementation on wctype (FreeBSD,
@ -61,7 +68,7 @@
# define iswspace isspace
# endif
#else
# ifndef HAVE_ISWSPACE
# if !defined HAVE_ISWSPACE && !defined WIN32
# define iswspace isspace
# endif
#endif
@ -98,6 +105,38 @@ struct icalparser_impl
};
/*
* New version of strstrip() that does not move the pointer.
*/
void strstriplt(char *buf)
{
size_t len;
int a;
if (buf==NULL) {
return;
}
if (buf[0] == 0) {
return;
}
len = strlen(buf);
while ((buf[0] != 0) && (isspace(buf[len - 1]))) {
buf[--len] = 0;
}
if (buf[0] == 0) {
return;
}
a = 0;
while ((buf[0]!=0) && (isspace(buf[a]))) {
a++;
}
if (a > 0) {
memmove(buf, &buf[a], len - a + 1);
}
}
icalparser* icalparser_new(void)
{
struct icalparser_impl* impl = 0;
@ -185,15 +224,13 @@ static char* make_segment(char* start, char* end)
char *buf, *tmp;
size_t size = (size_t)end - (size_t)start;
//buf = icalmemory_tmp_buffer(size+1);
buf = icalmemory_new_buffer(size+1);
strncpy(buf,start,size);
*(buf+size) = 0;
tmp = (buf+size);
while ( *tmp == '\0' || iswspace(*tmp) )
while ((tmp >= buf) &&
((*tmp == '\0') || iswspace(*tmp)))
{
*tmp = 0;
tmp--;
@ -315,7 +352,7 @@ char* parser_get_next_value(char* line, char **end, icalvalue_kind kind)
next = parser_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
can both separate digits in a list, and it can separate
multiple recurrence specifications. This is not a friendly
part of the spec. This weirdness tries to
distinguish the two uses. it is probably a HACK*/
@ -325,7 +362,7 @@ char* parser_get_next_value(char* line, char **end, icalvalue_kind kind)
(*end+length) > next+5 &&
strncmp(next,"FREQ",4) == 0
) {
/* The COMMA was followed by 'FREQ', is it a real seperator*/
/* The COMMA was followed by 'FREQ', is it a real separator*/
/* Fall through */
} else if (next != 0){
/* Not real, get the next COMMA */
@ -345,7 +382,7 @@ char* parser_get_next_value(char* line, char **end, icalvalue_kind kind)
}
/* If the comma is preceded by a '\', then it is a literal and
not a value seperator*/
not a value separator*/
if ( (next!=0 && *(next-1) == '\\') ||
(next!=0 && *(next-3) == '\\')
@ -491,8 +528,8 @@ char* icalparser_get_line(icalparser *parser,
/* If the output line ends in a '\n' and the temp buffer
begins with a ' ', then the buffer holds a continuation
line, so keep reading. */
begins with a ' ' or tab, then the buffer holds a continuation
line, so keep reading. RFC 2445, section 4.1 */
if ( line_p > line+1 && *(line_p-1) == '\n'
&& (parser->temp[0] == ' ' || parser->temp[0] == '\t') ) {
@ -533,8 +570,8 @@ char* icalparser_get_line(icalparser *parser,
}
static void insert_error(icalcomponent* comp, char* text,
char* message, icalparameter_xlicerrortype type)
static void insert_error(icalcomponent* comp, const char* text,
const char* message, icalparameter_xlicerrortype type)
{
char temp[1024];
@ -619,7 +656,7 @@ icalcomponent* icalparser_parse(icalparser *parser,
}
cont = 0;
if(line != 0){
free(line);
icalmemory_free_buffer(line);
cont = 1;
}
} while ( cont );
@ -664,7 +701,7 @@ icalcomponent* icalparser_add_line(icalparser* parser,
end = 0;
str = parser_get_prop_name(line, &end);
if (str == 0 || strlen(str) == 0 ){
if (str == 0 || *str == '\0' ){
/* Could not get a property name */
icalcomponent *tail = pvl_data(pvl_tail(parser->components));
@ -676,12 +713,13 @@ icalcomponent* icalparser_add_line(icalparser* parser,
tail = 0;
parser->state = ICALPARSER_ERROR;
icalmemory_free_buffer(str);
str = NULL;
return 0;
}
/**********************************************************************
* Handle begin and end of components
**********************************************************************/
**********************************************************************/
/* If the property name is BEGIN or END, we are actually
starting or ending a new component */
@ -691,6 +729,7 @@ icalcomponent* icalparser_add_line(icalparser* parser,
icalcomponent_kind comp_kind;
icalmemory_free_buffer(str);
str = NULL;
parser->level++;
str = parser_get_next_value(end,&end, value_kind);
@ -707,12 +746,7 @@ icalcomponent* icalparser_add_line(icalparser* parser,
ICAL_XLICERRORTYPE_COMPONENTPARSEERROR);
}
if (comp_kind != ICAL_X_COMPONENT) {
c = icalcomponent_new(comp_kind);
} else {
c = icalcomponent_new_x(str);
}
c = icalcomponent_new(comp_kind);
if (c == 0){
c = icalcomponent_new(ICAL_XLICINVALID_COMPONENT);
@ -725,12 +759,14 @@ icalcomponent* icalparser_add_line(icalparser* parser,
parser->state = ICALPARSER_BEGIN_COMP;
icalmemory_free_buffer(str);
str = NULL;
return 0;
} else if (strcasecmp(str,"END") == 0 ) {
icalcomponent* tail;
icalmemory_free_buffer(str);
str = NULL;
parser->level--;
str = parser_get_next_value(end,&end, value_kind);
@ -745,7 +781,8 @@ icalcomponent* icalparser_add_line(icalparser* parser,
}
tail = 0;
icalmemory_free_buffer(str), str = NULL;
icalmemory_free_buffer(str);
str = NULL;
/* Return the component if we are back to the 0th level */
if (parser->level == 0){
@ -778,6 +815,7 @@ icalcomponent* icalparser_add_line(icalparser* parser,
if(pvl_data(pvl_tail(parser->components)) == 0){
parser->state = ICALPARSER_ERROR;
icalmemory_free_buffer(str);
str = NULL;
return 0;
}
@ -817,10 +855,12 @@ icalcomponent* icalparser_add_line(icalparser* parser,
tail = 0;
parser->state = ICALPARSER_ERROR;
icalmemory_free_buffer(str);
str = NULL;
return 0;
}
icalmemory_free_buffer(str), str = NULL;
icalmemory_free_buffer(str);
str = NULL;
/**********************************************************************
* Handle parameter values
@ -831,18 +871,18 @@ icalcomponent* icalparser_add_line(icalparser* parser,
while(1) {
if (*(end-1) == ':'){
/* if the last seperator was a ":" and the value is a
/* if the last separator was a ":" and the value is a
URL, icalparser_get_next_parameter will find the
':' in the URL, so better break now. */
break;
}
str = parser_get_next_parameter(end,&end);
strstriplt(str);
if (str != 0){
char* name;
char* pvalue;
char *buf_value = NULL;
char* name = 0;
char* pvalue = 0;
char *buf_value = NULL;
icalparameter *param = 0;
icalparameter_kind kind;
@ -867,12 +907,14 @@ icalcomponent* icalparser_add_line(icalparser* parser,
icalparameter_set_xname(param,name);
icalparameter_set_xvalue(param,pvalue);
}
icalmemory_free_buffer(buf_value), buf_value = NULL;
icalmemory_free_buffer(buf_value);
buf_value = NULL;
} else if (kind != ICAL_NO_PARAMETER){
param = icalparameter_new_from_value_string(kind,pvalue);
icalmemory_free_buffer(buf_value), buf_value = NULL;
icalmemory_free_buffer(buf_value);
buf_value = NULL;
} else {
/* Error. Failed to parse the parameter*/
@ -888,9 +930,26 @@ icalcomponent* icalparser_add_line(icalparser* parser,
ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR);
tail = 0;
parser->state = ICALPARSER_ERROR;
/* if (pvalue) {
free(pvalue);
pvalue = 0;
} */
if (name) {
free(name);
name = 0;
}
return 0;
}
/* if (pvalue) {
free(pvalue);
pvalue = 0;
} */
if (name) {
free(name);
name = 0;
}
if (param == 0){
/* 'tail' defined above */
insert_error(tail,str,"Cant parse parameter value",
@ -899,12 +958,13 @@ icalcomponent* icalparser_add_line(icalparser* parser,
tail = 0;
parser->state = ICALPARSER_ERROR;
icalmemory_free_buffer(buf_value), buf_value = NULL;
icalmemory_free_buffer(name), name = NULL;
icalmemory_free_buffer(str), str = NULL;
icalmemory_free_buffer(buf_value);
buf_value = NULL;
icalmemory_free_buffer(name);
name = NULL;
icalmemory_free_buffer(str);
str = NULL;
icalmemory_free_buffer(name), name = NULL;
icalmemory_free_buffer(str), str = NULL;
continue;
}
@ -936,21 +996,28 @@ icalcomponent* icalparser_add_line(icalparser* parser,
tail = 0;
parser->state = ICALPARSER_ERROR;
icalmemory_free_buffer(name), name = NULL;
icalmemory_free_buffer(str), str = NULL;
icalmemory_free_buffer(name);
name = NULL;
icalmemory_free_buffer(str);
str = NULL;
continue;
}
}
icalmemory_free_buffer(name), name = NULL;
icalmemory_free_buffer(name);
name = NULL;
/* Everything is OK, so add the parameter */
icalproperty_add_parameter(prop,param);
tail = 0;
icalmemory_free_buffer(str), str = NULL;
icalmemory_free_buffer(str);
str = NULL;
} else { /* if ( str != 0) */
/* If we did not get a param string, go on to looking
for a value */
/* If we did not get a param string, go on to looking for a value */
if (str != NULL) {
icalmemory_free_buffer(str);
str = NULL;
}
break;
} /* if ( str != 0) */
@ -986,9 +1053,11 @@ icalcomponent* icalparser_add_line(icalparser* parser,
*/
case ICAL_FREEBUSY_PROPERTY:
str = parser_get_next_value(end,&end, value_kind);
strstriplt (str);
break;
default:
str = icalparser_get_value(end, &end, value_kind);
strstriplt (str);
break;
}
@ -1027,16 +1096,23 @@ icalcomponent* icalparser_add_line(icalparser* parser,
tail = 0;
parser->state = ICALPARSER_ERROR;
icalmemory_free_buffer(str), str = NULL;
icalmemory_free_buffer(str);
str = NULL;
return 0;
} else {
vcount++;
icalproperty_set_value(prop, value);
}
icalmemory_free_buffer(str), str = NULL;
icalmemory_free_buffer(str);
str = NULL;
} else {
if (str != NULL) {
icalmemory_free_buffer(str);
str = NULL;
}
if (vcount == 0){
char temp[200]; /* HACK */
@ -1105,7 +1181,7 @@ icalcomponent* icalparser_clean(icalparser* parser)
parser->root_component = pvl_pop(parser->components);
tail=pvl_data(pvl_tail(parser->components));
if(tail != 0){
if(tail != 0 && parser->root_component != NULL){
if(icalcomponent_get_parent(parser->root_component)!=0){
icalerror_warn("icalparser_clean is trying to attach a component for the second time");
} else {

Просмотреть файл

@ -3,10 +3,11 @@
FILE: icalparser.h
CREATOR: eric 20 April 1999
$Id: icalparser.h,v 1.8 2007/04/30 13:57:48 artcancro Exp $
$Id: icalparser.h,v 1.9 2008-01-15 23:17:41 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:

Просмотреть файл

@ -3,10 +3,11 @@
FILE: icalperiod.c
CREATOR: eric 02 June 2000
$Id: icalperiod.c,v 1.12 2007/04/30 13:57:48 artcancro Exp $
$Id: icalperiod.c,v 1.13 2008-01-15 23:17:41 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -26,7 +27,7 @@
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "config.h"
#endif
#include "icalperiod.h"
@ -105,6 +106,15 @@ struct icalperiodtype icalperiodtype_from_string (const char* str)
const char* icalperiodtype_as_ical_string(struct icalperiodtype p)
{
char *buf;
buf = icalperiodtype_as_ical_string_r(p);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char* icalperiodtype_as_ical_string_r(struct icalperiodtype p)
{
const char* start;
@ -118,22 +128,21 @@ const char* icalperiodtype_as_ical_string(struct icalperiodtype p)
buf_ptr = buf;
start = icaltime_as_ical_string(p.start);
start = icaltime_as_ical_string_r(p.start);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, start);
icalmemory_free_buffer(start);
if(!icaltime_is_null_time(p.end)){
end = icaltime_as_ical_string(p.end);
end = icaltime_as_ical_string_r(p.end);
} else {
end = icaldurationtype_as_ical_string(p.duration);
end = icaldurationtype_as_ical_string_r(p.duration);
}
icalmemory_append_char(&buf, &buf_ptr, &buf_size, '/');
icalmemory_append_string(&buf, &buf_ptr, &buf_size, end);
icalmemory_free_buffer(end);
icalmemory_add_tmp_buffer(buf);
return buf;
}

Просмотреть файл

@ -4,10 +4,11 @@
CREATOR: eric 26 Jan 2001
$Id: icalperiod.h,v 1.5 2007/04/30 13:57:48 artcancro Exp $
$Id: icalperiod.h,v 1.6 2008-01-15 23:17:41 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -42,6 +43,7 @@ struct icalperiodtype
struct icalperiodtype icalperiodtype_from_string (const char* str);
const char* icalperiodtype_as_ical_string(struct icalperiodtype p);
char* icalperiodtype_as_ical_string_r(struct icalperiodtype p);
struct icalperiodtype icalperiodtype_null_period(void);

Просмотреть файл

@ -4,10 +4,11 @@
FILE: icalproperty.c
CREATOR: eric 28 April 1999
$Id: icalproperty.c,v 1.41 2007/11/30 22:32:10 dothebart Exp $
$Id: icalproperty.c,v 1.44 2008-01-30 20:28:42 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -25,7 +26,7 @@
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "config.h"
#endif
#include "icalproperty.h"
@ -311,7 +312,6 @@ get_next_line_start (char *line_start, int chars_left)
* It returns a tmp buffer. NOTE: I'm not sure if it matters if we
* split a line in the middle of a UTF-8 character. It probably won't
* look nice in a text editor.
* This will add the trailing newline as well
*/
static char*
fold_property_line (char *text)
@ -358,14 +358,7 @@ fold_property_line (char *text)
line_start = next_line_start;
}
icalmemory_append_string (&buf, &buf_ptr, &buf_size, "\r\n");
/* Copy it to a temporary buffer, and then free it. */
out_buf = icalmemory_tmp_buffer (strlen (buf) + 1);
strcpy (out_buf, buf);
icalmemory_free_buffer (buf);
return out_buf;
return buf;
}
@ -390,15 +383,16 @@ icalproperty_get_value_kind(icalproperty *prop)
= icalproperty_kind_to_value_kind(prop->kind);
if(orig_val_param){
orig_kind = (icalvalue_kind)icalparameter_get_value(orig_val_param);
orig_kind = icalparameter_value_to_value_kind( icalparameter_get_value(orig_val_param) );
}
if(value != 0){
this_kind = icalvalue_isa(value);
}
if(this_kind == default_kind &&
if ( orig_kind != ICAL_NO_VALUE ) {
kind_string = icalvalue_kind_to_string( orig_kind );
} else if(this_kind == default_kind &&
orig_kind != ICAL_NO_VALUE){
/* The kind is the default, so it does not need to be
included, but do it anyway, since it was explicit in
@ -419,14 +413,22 @@ icalproperty_get_value_kind(icalproperty *prop)
const char*
icalproperty_as_ical_string (icalproperty* prop)
{
char *buf;
buf = icalproperty_as_ical_string_r(prop);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char*
icalproperty_as_ical_string_r(icalproperty* prop)
{
icalparameter *param;
/* Create new buffer that we can append names, parameters and a
value to, and reallocate as needed. Later, this buffer will be
copied to a icalmemory_tmp_buffer, which is managed internally
by libical, so it can be given to the caller without fear of
the caller forgetting to free it */
* value to, and reallocate as needed.
*/
const char* property_name = 0;
size_t buf_size = 1024;
@ -435,8 +437,7 @@ icalproperty_as_ical_string (icalproperty* prop)
icalvalue* value;
char *out_buf;
const char* kind_string = 0;
char newline[] = "\r\n";
const char newline[] = "\r\n";
icalerror_check_arg_rz( (prop!=0),"prop");
@ -471,11 +472,7 @@ icalproperty_as_ical_string (icalproperty* prop)
param = icalproperty_get_next_parameter(prop,ICAL_ANY_PARAMETER)) {
icalparameter_kind kind = icalparameter_isa(param);
kind_string = icalparameter_as_ical_string(param);
if(kind==ICAL_VALUE_PARAMETER){
continue;
}
kind_string = icalparameter_as_ical_string_r(param);
if (kind_string == 0 ) {
icalerror_warn("Got a parameter of unknown kind for the following property");
@ -484,8 +481,14 @@ icalproperty_as_ical_string (icalproperty* prop)
continue;
}
if (kind==ICAL_VALUE_PARAMETER) {
free ((char *) kind_string);
continue;
}
icalmemory_append_string(&buf, &buf_ptr, &buf_size, ";");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, kind_string);
free((char *)kind_string);
}
/* Append value */
@ -495,16 +498,16 @@ icalproperty_as_ical_string (icalproperty* prop)
value = icalproperty_get_value(prop);
if (value != 0){
const char *str = icalvalue_as_ical_string(value);
char *str = icalvalue_as_ical_string_r(value);
icalerror_assert((str !=0),"Could not get string representation of a value");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, str);
free(str);
} else {
icalmemory_append_string(&buf, &buf_ptr, &buf_size,"ERROR: No Value");
}
/* Now, copy the buffer to a tmp_buffer, which is safe to give to
the caller without worring about de-allocating it. */
icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline);
/* We now use a function to fold the line properly every 75 characters.
That function also adds the newline for us. */
@ -604,11 +607,21 @@ void icalproperty_set_parameter_from_string(icalproperty* prop,
const char* icalproperty_get_parameter_as_string(icalproperty* prop,
const char* name)
{
char *buf;
buf = icalproperty_get_parameter_as_string_r(prop, name);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char* icalproperty_get_parameter_as_string_r(icalproperty* prop,
const char* name)
{
icalparameter_kind kind;
icalparameter *param;
char* str;
char* pv;
char *pv, *t;
char* pvql;
char* pvqr;
@ -639,28 +652,40 @@ const char* icalproperty_get_parameter_as_string(icalproperty* prop,
}
str = icalparameter_as_ical_string(param);
str = icalparameter_as_ical_string_r(param);
pv = strchr(str,'=');
t = strchr(str,'=');
if(pv == 0){
if (t == 0) {
icalerror_set_errno(ICAL_INTERNAL_ERROR);
free(str);
return 0;
}
// see if this string is quoted, immediately return if not
// otherwise removed the quotes from the string.
++pv;
pvql = strchr(pv,'"');
if(pvql == 0)
return pv;
pvqr = strrchr(pvql,'"');
if(pvqr == 0){
/* Strip the property name and the equal sign */
pv = icalmemory_strdup(t+1);
free(str);
/* Is the string quoted? */
pvql = strchr(pv, '"');
if (pvql == 0) {
return(pv); /* No quotes? Return it immediately. */
}
/* Strip everything up to the first quote */
str = icalmemory_strdup(pvql+1);
free(pv);
/* Search for the end quote */
pvqr = strrchr(str, '"');
if (pvqr == 0) {
icalerror_set_errno(ICAL_INTERNAL_ERROR);
free(str);
return 0;
}
*pvqr = '\0';
return pvql+1;
return str;
}
/** @see icalproperty_remove_parameter_by_kind()
@ -709,7 +734,7 @@ icalproperty_remove_parameter_by_kind(icalproperty* prop, icalparameter_kind kin
* @param prop A valid icalproperty.
* @param name The name of the parameter to remove
*
* This function removes paramters with the given name. The name
* This function removes parameters with the given name. The name
* corresponds to either a built-in name (TZID, etc.) or the name of
* an extended parameter (X-FOO)
*
@ -917,6 +942,15 @@ icalproperty_get_value(const icalproperty* prop)
}
const char* icalproperty_get_value_as_string(const icalproperty* prop)
{
char *buf;
buf = icalproperty_get_value_as_string_r(prop);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char* icalproperty_get_value_as_string_r(const icalproperty* prop)
{
icalvalue *value;
@ -924,7 +958,7 @@ const char* icalproperty_get_value_as_string(const icalproperty* prop)
value = prop->value;
return icalvalue_as_ical_string(value);
return icalvalue_as_ical_string_r(value);
}
@ -951,16 +985,16 @@ const char* icalproperty_get_x_name(icalproperty* prop){
return prop->x_name;
}
const char* icalproperty_get_name(const icalproperty* prop)
const char* icalproperty_get_property_name(const icalproperty* prop)
{
#ifndef NO_WARN_DEPRECATED
icalerror_warn("icalproperty_get_name() is DEPRECATED, please use icalproperty_get_property_name() instead.");
#endif
return icalproperty_get_property_name(prop);
char *buf;
buf = icalproperty_get_property_name_r(prop);
icalmemory_add_tmp_buffer(buf);
return buf;
}
const char* icalproperty_get_property_name(const icalproperty* prop)
char* icalproperty_get_property_name_r(const icalproperty* prop)
{
const char* property_name = 0;
@ -986,10 +1020,6 @@ const char* icalproperty_get_property_name(const icalproperty* prop)
icalmemory_append_string(&buf, &buf_ptr, &buf_size, property_name);
}
/* Add the buffer to the temporary buffer ring -- the caller will
not have to free the memory. */
icalmemory_add_tmp_buffer(buf);
return buf;
}

Просмотреть файл

@ -4,12 +4,13 @@
CREATOR: eric 20 March 1999
$Id: icalproperty.h,v 1.19 2007/04/30 13:57:48 artcancro Exp $
$Id: icalproperty.h,v 1.20 2008-01-15 23:17:41 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -50,6 +51,7 @@ icalproperty* icalproperty_new_clone(icalproperty * prop);
icalproperty* icalproperty_new_from_string(const char* str);
const char* icalproperty_as_ical_string(icalproperty* prop);
char* icalproperty_as_ical_string_r(icalproperty* prop);
void icalproperty_free(icalproperty* prop);
@ -63,6 +65,8 @@ 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);
char* icalproperty_get_parameter_as_string_r(icalproperty* prop,
const char* name);
void icalproperty_remove_parameter(icalproperty* prop,
icalparameter_kind kind);
@ -91,6 +95,7 @@ void icalproperty_set_value_from_string(icalproperty* prop,const char* value, co
icalvalue* icalproperty_get_value(const icalproperty* prop);
const char* icalproperty_get_value_as_string(const icalproperty* prop);
char* icalproperty_get_value_as_string_r(const icalproperty* prop);
/* Deal with X properties */
@ -102,6 +107,7 @@ const char* icalproperty_get_x_name(icalproperty* prop);
* property
*/
const char* icalproperty_get_property_name (const icalproperty* prop);
char* icalproperty_get_property_name_r(const icalproperty* prop);
icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value);
@ -120,6 +126,7 @@ const char* icalproperty_method_to_string(icalproperty_method method);
const char* icalproperty_enum_to_string(int e);
char* icalproperty_enum_to_string_r(int e);
int icalproperty_string_to_enum(const char* str);
int icalproperty_kind_and_string_to_enum(const int kind, const char* str);

Просмотреть файл

@ -1,704 +0,0 @@
/* -*- Mode: C++ -*- */
/**
* @file icalproperty_cxx.cpp
* @author fnguyen (12/10/01)
* @brief Implementation of C++ Wrapper for icalproperty.c
*
* (C) COPYRIGHT 2001, Critical Path
*/
#ifndef ICALPROPERTY_CXX_H
#include "icalproperty_cxx.h"
#endif
#ifndef ICALPARAMETER_CXX_H
#include "icalparameter_cxx.h"
#endif
#ifndef ICALVALUE_CXX_H
#include "icalvalue_cxx.h"
#endif
ICalProperty::ICalProperty() : imp(icalproperty_new(ICAL_ANY_PROPERTY)){
}
ICalProperty::ICalProperty(const ICalProperty& v) throw(icalerrorenum){
imp = icalproperty_new_clone(v.imp);
if (!imp) throw icalerrno;
}
ICalProperty& ICalProperty::operator=(const ICalProperty& v) throw(icalerrorenum) {
if (this == &v) return *this;
if (imp != NULL)
{
icalproperty_free(imp);
imp = icalproperty_new_clone(v.imp);
if (!imp) throw icalerrno;
}
return *this;
}
ICalProperty::~ICalProperty(){
if (imp != NULL) icalproperty_free(imp);
}
ICalProperty::ICalProperty(icalproperty* v) : imp(v) {
}
ICalProperty::ICalProperty(string str){
imp = icalproperty_new_from_string(str);
}
ICalProperty::ICalProperty(icalproperty_kind kind){
imp = icalproperty_new(kind);
}
string ICalProperty::as_ical_string(){
return (string)icalproperty_as_ical_string(imp);
}
icalproperty_kind ICalProperty::isa(){
return icalproperty_isa(imp);
}
int ICalProperty::isa_property(void* property){
return icalproperty_isa_property(property);
}
int ICalProperty::operator==(ICalProperty& rhs){
icalparameter_xliccomparetype result;
ICalValue* thisPropValue = this->get_value();
ICalValue* rhsPropValue = rhs.get_value();
result = icalvalue_compare((icalvalue*)*thisPropValue, (icalvalue*)*rhsPropValue);
return (result == ICAL_XLICCOMPARETYPE_EQUAL);
}
void ICalProperty::add_parameter(ICalParameter& parameter){
icalproperty_add_parameter(imp, parameter);
}
void ICalProperty::set_parameter(ICalParameter &parameter){
icalproperty_set_parameter(imp, parameter);
}
void ICalProperty::set_parameter_from_string(string name, string val){
icalproperty_set_parameter_from_string(imp, name, val);
}
string ICalProperty::get_parameter_as_string(string name){
return (string)icalproperty_get_parameter_as_string(imp, name);
}
void ICalProperty::remove_parameter(icalparameter_kind kind){
icalproperty_remove_parameter(imp, kind);
}
int ICalProperty::count_parameters(){
return icalproperty_count_parameters(imp);
}
/** Iterate through the parameters */
ICalParameter* ICalProperty::get_first_parameter(icalparameter_kind kind){
icalparameter* p = icalproperty_get_first_parameter(imp, kind);
return (p != NULL)? new ICalParameter(p): NULL;
}
ICalParameter* ICalProperty::get_next_parameter(icalparameter_kind kind){
icalparameter* p = icalproperty_get_next_parameter(imp, kind);
return (p != NULL)? new ICalParameter(p): NULL;
}
/** Access the value of the property */
void ICalProperty::set_value(const ICalValue& val){
icalproperty_set_value(imp, (ICalValue&)val);
}
void ICalProperty::set_value_from_string(string val, string kind){
icalproperty_set_value_from_string(imp, val, kind);
}
ICalValue* ICalProperty::get_value(){
return new ICalValue(icalproperty_get_value(imp));
}
string ICalProperty::get_value_as_string(){
return (string)icalproperty_get_value_as_string(imp);
}
/** Return the name of the property -- the type name converted to a
* string, or the value of get_x_name if the type is X property
*/
string ICalProperty::get_name(){
return (string)icalproperty_get_property_name(imp);
}
/* Deal with X properties */
void ICalProperty::set_x_name(ICalProperty &prop, string name){
icalproperty_set_x_name(prop, name);
}
string ICalProperty::get_x_name(ICalProperty &prop){
return (string)icalproperty_get_x_name(prop);
}
icalvalue_kind ICalProperty::icalparameter_value_to_value_kind(icalparameter_value val){
return icalparameter_value_to_value_kind(val);
}
/* Convert kinds to string and get default value type */
icalvalue_kind ICalProperty::kind_to_value_kind(icalproperty_kind kind){
return icalproperty_kind_to_value_kind(kind);
}
icalproperty_kind ICalProperty::value_kind_to_kind(icalvalue_kind kind){
return icalproperty_value_kind_to_kind(kind);
}
string ICalProperty::kind_to_string(icalproperty_kind kind){
return (string)icalproperty_kind_to_string(kind);
}
icalproperty_kind ICalProperty::string_to_kind(string str){
return icalproperty_string_to_kind(str);
}
string ICalProperty::method_to_string(icalproperty_method method){
return (string)icalproperty_method_to_string(method);
}
icalproperty_method ICalProperty::string_to_method(string str){
return icalproperty_string_to_method(str);
}
string ICalProperty::enum_to_string(int e){
return (string)icalproperty_enum_to_string(e);
}
int ICalProperty::string_to_enum(string str){
return icalproperty_string_to_enum(str);
}
string ICalProperty::status_to_string(icalproperty_status s){
return (string)icalproperty_status_to_string(s);
}
icalproperty_status ICalProperty::string_to_status(string str){
return icalproperty_string_to_status(str);
}
int ICalProperty::enum_belongs_to_property(icalproperty_kind kind, int e){
return icalproperty_enum_belongs_to_property(kind, e);
}
/* ACTION */
void ICalProperty::set_action(enum icalproperty_action val){
icalproperty_set_action(imp, val);
}
enum icalproperty_action ICalProperty::get_action(){
return icalproperty_get_action(imp);
}
/* ATTACH */
void ICalProperty::set_attach(icalattach *val){
icalproperty_set_attach(imp, val);
}
icalattach * ICalProperty::get_attach(){
return icalproperty_get_attach(imp);
}
/* ATTENDEE */
void ICalProperty::set_attendee(string val){
icalproperty_set_attendee(imp, val);
}
string ICalProperty::get_attendee(){
return (string)icalproperty_get_attendee(imp);
}
/* CALSCALE */
void ICalProperty::set_calscale(string val){
icalproperty_set_calscale(imp, val);
}
string ICalProperty::get_calscale(){
return (string)icalproperty_get_calscale(imp);
}
/* CATEGORIES */
void ICalProperty::set_categories(string val){
icalproperty_set_categories(imp, val);
}
string ICalProperty::get_categories(){
return (string)icalproperty_get_categories(imp);
}
/* CLASS */
void ICalProperty::set_class(enum icalproperty_class val){
icalproperty_set_class(imp, val);
}
enum icalproperty_class ICalProperty::get_class(){
return (enum icalproperty_class)icalproperty_get_class(imp);
}
/* COMMENT */
void ICalProperty::set_comment(string val){
icalproperty_set_comment(imp, val);
}
string ICalProperty::get_comment(){
return (string)icalproperty_get_comment(imp);
}
/* COMPLETED */
void ICalProperty::set_completed(struct icaltimetype val){
icalproperty_set_completed(imp, val);
}
struct icaltimetype ICalProperty::get_completed(){
return icalproperty_get_completed(imp);
}
/* CONTACT */
void ICalProperty::set_contact(string val){
icalproperty_set_contact(imp, val);
}
string ICalProperty::get_contact(){
return (string)icalproperty_get_contact(imp);
}
/* CREATED */
void ICalProperty::set_created(struct icaltimetype val){
icalproperty_set_created(imp, val);
}
struct icaltimetype ICalProperty::get_created(){
return icalproperty_get_created(imp);
}
/* DESCRIPTION */
void ICalProperty::set_description(string val){
icalproperty_set_description(imp, val);
}
string ICalProperty::get_description(){
return (string)icalproperty_get_description(imp);
}
/* DTEND */
void ICalProperty::set_dtend(struct icaltimetype val){
icalproperty_set_dtend(imp, val);
}
struct icaltimetype ICalProperty::get_dtend(){
return icalproperty_get_dtend(imp);
}
/* DTSTAMP */
void ICalProperty::set_dtstamp(struct icaltimetype val){
icalproperty_set_dtstamp(imp, val);
}
struct icaltimetype ICalProperty::get_dtstamp(){
return icalproperty_get_dtstamp(imp);
}
/* DTSTART */
void ICalProperty::set_dtstart(struct icaltimetype val){
icalproperty_set_dtstart(imp, val);
}
struct icaltimetype ICalProperty::get_dtstart(){
return icalproperty_get_dtstart(imp);
}
/* DUE */
void ICalProperty::set_due(struct icaltimetype val){
icalproperty_set_due(imp, val);
}
struct icaltimetype ICalProperty::get_due(){
return icalproperty_get_due(imp);
}
/* DURATION */
void ICalProperty::set_duration(struct icaldurationtype val){
icalproperty_set_duration(imp, val);
}
struct icaldurationtype ICalProperty::get_duration(){
return icalproperty_get_duration(imp);
}
/* EXDATE */
void ICalProperty::set_exdate(struct icaltimetype val){
icalproperty_set_exdate(imp, val);
}
struct icaltimetype ICalProperty::get_exdate(){
return icalproperty_get_exdate(imp);
}
/* EXPAND */
void ICalProperty::set_expand(int val){
icalproperty_set_expand(imp, val);
}
int ICalProperty::get_expand(){
return icalproperty_get_expand(imp);
}
/* EXRULE */
void ICalProperty::set_exrule(struct icalrecurrencetype val){
icalproperty_set_exrule(imp, val);
}
struct icalrecurrencetype ICalProperty::get_exrule(){
return icalproperty_get_exrule(imp);
}
/* FREEBUSY */
void ICalProperty::set_freebusy(struct icalperiodtype val){
icalproperty_set_freebusy(imp, val);
}
struct icalperiodtype ICalProperty::get_freebusy(){
return icalproperty_get_freebusy(imp);
}
/* GEO */
void ICalProperty::set_geo(struct icalgeotype val){
icalproperty_set_geo(imp, val);
}
struct icalgeotype ICalProperty::get_geo(){
return icalproperty_get_geo(imp);
}
/* LAST-MODIFIED */
void ICalProperty::set_lastmodified(struct icaltimetype val){
icalproperty_set_lastmodified(imp, val);
}
struct icaltimetype ICalProperty::get_lastmodified(){
return icalproperty_get_lastmodified(imp);
}
/* LOCATION */
void ICalProperty::set_location(string val){
icalproperty_set_location(imp, val);
}
string ICalProperty::get_location(){
return (string)icalproperty_get_location(imp);
}
/* MAXRESULTS */
void ICalProperty::set_maxresults(int val){
icalproperty_set_maxresults(imp, val);
}
int ICalProperty::get_maxresults(){
return icalproperty_get_maxresults(imp);
}
/* MAXRESULTSSIZE */
void ICalProperty::set_maxresultsize(int val){
icalproperty_set_maxresultssize(imp, val);
}
int ICalProperty::get_maxresultsize(){
return icalproperty_get_maxresultssize(imp);
}
/* METHOD */
void ICalProperty::set_method(enum icalproperty_method val){
icalproperty_set_method(imp, val);
}
enum icalproperty_method ICalProperty::get_method(){
return icalproperty_get_method(imp);
}
/* ORGANIZER */
void ICalProperty::set_organizer(string val){
icalproperty_set_organizer(imp, val);
}
string ICalProperty::get_organizer(){
return (string)icalproperty_get_organizer(imp);
}
/* OWNER */
void ICalProperty::set_owner(string val){
icalproperty_set_owner(imp, val);
}
string ICalProperty::get_owner(){
return (string)icalproperty_get_owner(imp);
}
/* PERCENT-COMPLETE */
void ICalProperty::set_percentcomplete(int val){
icalproperty_set_percentcomplete(imp, val);
}
int ICalProperty::get_percentcomplete(){
return icalproperty_get_percentcomplete(imp);
}
/* PRIORITY */
void ICalProperty::set_priority(int val){
icalproperty_set_priority(imp, val);
}
int ICalProperty::get_priority(){
return icalproperty_get_priority(imp);
}
/* PRODID */
void ICalProperty::set_prodid(string val){
icalproperty_set_prodid(imp, val);
}
string ICalProperty::get_prodid(){
return (string)icalproperty_get_prodid(imp);
}
/* QUERY */
void ICalProperty::set_query(string val){
icalproperty_set_query(imp, val);
}
string ICalProperty::get_query(){
return (string)icalproperty_get_query(imp);
}
/* QUERYNAME */
void ICalProperty::set_queryname(string val){
icalproperty_set_queryname(imp, val);
}
string ICalProperty::get_queryname(){
return (string)icalproperty_get_queryname(imp);
}
/* RDATE */
void ICalProperty::set_rdate(struct icaldatetimeperiodtype val){
icalproperty_set_rdate(imp, val);
}
struct icaldatetimeperiodtype ICalProperty::get_rdate(){
return icalproperty_get_rdate(imp);
}
/* RECURRENCE-ID */
void ICalProperty::set_recurrenceid(struct icaltimetype val){
icalproperty_set_recurrenceid(imp, val);
}
struct icaltimetype ICalProperty::get_recurrenceid(){
return icalproperty_get_recurrenceid(imp);
}
/* RELATED-TO */
void ICalProperty::set_relatedto(string val){
icalproperty_set_relatedto(imp, val);
}
string ICalProperty::get_relatedto(){
return (string)icalproperty_get_relatedto(imp);
}
/* RELCALID */
void ICalProperty::set_relcalid(string val){
icalproperty_set_relcalid(imp, val);
}
string ICalProperty::get_relcalid(){
return (string)icalproperty_get_relcalid(imp);
}
/* REPEAT */
void ICalProperty::set_repeat(int val){
icalproperty_set_repeat(imp, val);
}
int ICalProperty::get_repeat(){
return icalproperty_get_repeat(imp);
}
/* REQUEST-STATUS */
void ICalProperty::set_requeststatus(string val){
icalreqstattype v;
v = icalreqstattype_from_string((char*)val);
icalproperty_set_requeststatus(imp, v);
}
string ICalProperty::get_requeststatus(){
icalreqstattype v;
v = icalproperty_get_requeststatus(imp);
return (string)(icalreqstattype_as_string(v));
}
/* RESOURCES */
void ICalProperty::set_resources(string val){
icalproperty_set_resources(imp, val);
}
string ICalProperty::get_resources(){
return (string)icalproperty_get_resources(imp);
}
/* RRULE */
void ICalProperty::set_rrule(struct icalrecurrencetype val){
icalproperty_set_rrule(imp, val);
}
struct icalrecurrencetype ICalProperty::get_rrule(){
return icalproperty_get_rrule(imp);
}
/* SCOPE */
void ICalProperty::set_scope(string val){
icalproperty_set_scope(imp, val);
}
string ICalProperty::get_scope(){
return (string)icalproperty_get_scope(imp);
}
/* SEQUENCE */
void ICalProperty::set_sequence(int val){
icalproperty_set_sequence(imp, val);
}
int ICalProperty::get_sequence(){
return icalproperty_get_sequence(imp);
}
/* STATUS */
void ICalProperty::set_status(enum icalproperty_status val){
icalproperty_set_status(imp, val);
}
enum icalproperty_status ICalProperty::get_status(){
return icalproperty_get_status(imp);
}
/* SUMMARY */
void ICalProperty::set_summary(string val){
icalproperty_set_summary(imp, val);
}
string ICalProperty::get_summary(){
return (string)icalproperty_get_summary(imp);
}
/* TARGET */
void ICalProperty::set_target(string val){
icalproperty_set_target(imp, val);
}
string ICalProperty::get_target(){
return (string)icalproperty_get_target(imp);
}
/* TRANSP */
void ICalProperty::set_transp(enum icalproperty_transp val){
icalproperty_set_transp(imp, val);
}
enum icalproperty_transp ICalProperty::get_transp(){
return icalproperty_get_transp(imp);
}
/* TRIGGER */
void ICalProperty::set_trigger(struct icaltriggertype val){
icalproperty_set_trigger(imp, val);
}
struct icaltriggertype ICalProperty::get_trigger(){
return icalproperty_get_trigger(imp);
}
/* TZID */
void ICalProperty::set_tzid(string val){
icalproperty_set_tzid(imp, val);
}
string ICalProperty::get_tzid(){
return (string)icalproperty_get_tzid(imp);
}
/* TZNAME */
void ICalProperty::set_tzname(string val){
icalproperty_set_tzname(imp, val);
}
string ICalProperty::get_tzname(){
return (string)icalproperty_get_tzname(imp);
}
/* TZOFFSETFROM */
void ICalProperty::set_tzoffsetfrom(int val){
icalproperty_set_tzoffsetfrom(imp, val);
}
int ICalProperty::get_tzoffsetfrom(){
return icalproperty_get_tzoffsetfrom(imp);
}
/* TZOFFSETTO */
void ICalProperty::set_tzoffsetto(int val){
icalproperty_set_tzoffsetto(imp, val);
}
int ICalProperty::get_tzoffsetto(){
return icalproperty_get_tzoffsetto(imp);
}
/* TZURL */
void ICalProperty::set_tzurl(string val){
icalproperty_set_tzurl(imp, val);
}
string ICalProperty::get_tzurl(){
return (string)icalproperty_get_tzurl(imp);
}
/* UID */
void ICalProperty::set_uid(string val){
icalproperty_set_uid(imp, val);
}
string ICalProperty::get_uid(){
return (string)icalproperty_get_uid(imp);
}
/* URL */
void ICalProperty::set_url(string val){
icalproperty_set_url(imp, val);
}
string ICalProperty::get_url(){
return (string)icalproperty_get_url(imp);
}
/* VERSION */
void ICalProperty::set_version(string val){
icalproperty_set_version(imp, val);
}
string ICalProperty::get_version(){
return (string)icalproperty_get_version(imp);
}
/* X */
void ICalProperty::set_x(string val){
icalproperty_set_x(imp, val);
}
string ICalProperty::get_x(){
return (string)icalproperty_get_x(imp);
}
/* X-LIC-CLUSTERCOUNT */
void ICalProperty::set_xlicclustercount(string val){
icalproperty_set_xlicclustercount(imp, val);
}
string ICalProperty::get_xlicclustercount(){
return (string)icalproperty_get_xlicclustercount(imp);
}
/* X-LIC-ERROR */
void ICalProperty::set_xlicerror(string val){
icalproperty_set_xlicerror(imp, val);
}
string ICalProperty::get_xlicerror(){
return (string)icalproperty_get_xlicerror(imp);
}
/* X-LIC-MIMECHARSET */
void ICalProperty::set_xlicmimecharset(string val){
icalproperty_set_xlicmimecharset(imp, val);
}
string ICalProperty::get_xlicmimecharset(){
return (string)icalproperty_get_xlicmimecharset(imp);
}
/* X-LIC-MIMECID */
void ICalProperty::set_xlicmimecid(string val){
icalproperty_set_xlicmimecid(imp, val);
}
string ICalProperty::get_xlicmimecid(){
return (string)icalproperty_get_xlicmimecid(imp);
}
/* X-LIC-MIMECONTENTTYPE */
void ICalProperty::set_xlicmimecontenttype(string val){
icalproperty_set_xlicmimecontenttype(imp, val);
}
string ICalProperty::get_xlicmimecontenttype(){
return (string)icalproperty_get_xlicmimecontenttype(imp);
}
/* X-LIC-MIMEENCODING */
void ICalProperty::set_xlicmimeencoding(string val){
icalproperty_set_xlicmimeencoding(imp, val);
}
string ICalProperty::get_xlicmimeencoding(){
return (string)icalproperty_get_xlicmimeencoding(imp);
}
/* X-LIC-MIMEFILENAME */
void ICalProperty::set_xlicmimefilename(string val){
icalproperty_set_xlicmimefilename(imp, val);
}
string ICalProperty::get_xlicmimefilename(){
return (string)icalproperty_get_xlicmimefilename(imp);
}
/* X-LIC-MIMEOPTINFO */
void ICalProperty::set_xlicmimeoptinfo(string val){
icalproperty_set_xlicmimeoptinfo(imp, val);
}
string ICalProperty::get_xlicmimeoptinfo(){
return (string)icalproperty_get_xlicmimeoptinfo(imp);
}

Просмотреть файл

@ -1,365 +0,0 @@
/* -*- Mode: C++ -*- */
/**
* @file icalproperty_cxx.h
* @author fnguyen (12/10/01)
* @brief Definition of C++ Wrapper for icalproperty.c
*
* (C) COPYRIGHT 2001, Critical Path
*/
#ifndef ICALPROPERTY_CXX_H
#define ICALPROPERTY_CXX_H
#include "ical.h"
#include "icptrholder.h"
typedef char* string; // Will use the string library from STL
class ICalParameter;
class ICalValue;
class ICalProperty {
public:
ICalProperty();
ICalProperty(const ICalProperty&) throw(icalerrorenum);
ICalProperty& operator=(const ICalProperty&) throw(icalerrorenum);
~ICalProperty();
ICalProperty(icalproperty* v);
ICalProperty(string str);
ICalProperty(icalproperty_kind kind);
ICalProperty(icalproperty_kind kind, string str);
operator icalproperty*() {return imp;}
int operator==(ICalProperty& rhs);
void detach() {
imp = NULL;
}
public:
string as_ical_string();
icalproperty_kind isa();
int isa_property(void* property);
void add_parameter(ICalParameter& parameter);
void set_parameter(ICalParameter& parameter);
void set_parameter_from_string(string name, string val);
string get_parameter_as_string(string name);
void remove_parameter(icalparameter_kind kind);
int count_parameters();
/** Iterate through the parameters */
ICalParameter* get_first_parameter(icalparameter_kind kind);
ICalParameter* get_next_parameter(icalparameter_kind kind);
/** Access the value of the property */
void set_value(const ICalValue& val);
void set_value_from_string(string val, string kind);
ICalValue* get_value();
string get_value_as_string();
/** Return the name of the property -- the type name converted
* to a string, or the value of get_x_name if the type is X
* property
*/
string get_name();
public:
/* Deal with X properties */
static void set_x_name(ICalProperty &prop, string name);
static string get_x_name(ICalProperty &prop);
static icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value val);
/* Convert kinds to string and get default value type */
static icalvalue_kind kind_to_value_kind(icalproperty_kind kind);
static icalproperty_kind value_kind_to_kind(icalvalue_kind kind);
static string kind_to_string(icalproperty_kind kind);
static icalproperty_kind string_to_kind(string str);
static icalproperty_method string_to_method(string str);
static string method_to_string(icalproperty_method method);
static string enum_to_string(int e);
static int string_to_enum(string str);
static string status_to_string(icalproperty_status);
static icalproperty_status string_to_status(string str);
static int enum_belongs_to_property(icalproperty_kind kind, int e);
public:
/* ACTION */
void set_action(enum icalproperty_action v);
enum icalproperty_action get_action();
/* ATTACH */
void set_attach(icalattach *v);
icalattach *get_attach();
/* ATTENDEE */
void set_attendee(string val);
string get_attendee();
/* CALSCALE */
void set_calscale(string val);
string get_calscale();
/* CATEGORIES */
void set_categories(string val);
string get_categories();
/* CLASS */
void set_class(enum icalproperty_class val);
enum icalproperty_class get_class();
/* COMMENT */
void set_comment(string val);
string get_comment();
/* COMPLETED */
void set_completed(struct icaltimetype val);
struct icaltimetype get_completed();
/* CONTACT */
void set_contact(string val);
string get_contact();
/* CREATED */
void set_created(struct icaltimetype val);
struct icaltimetype get_created();
/* DESCRIPTION */
void set_description(string val);
string get_description();
/* DTEND */
void set_dtend(struct icaltimetype val);
struct icaltimetype get_dtend();
/* DTSTAMP */
void set_dtstamp(struct icaltimetype val);
struct icaltimetype get_dtstamp();
/* DTSTART */
void set_dtstart(struct icaltimetype val);
struct icaltimetype get_dtstart();
/* DUE */
void set_due(struct icaltimetype val);
struct icaltimetype get_due();
/* DURATION */
void set_duration(struct icaldurationtype val);
struct icaldurationtype get_duration();
/* EXDATE */
void set_exdate(struct icaltimetype val);
struct icaltimetype get_exdate();
/* EXPAND */
void set_expand(int val);
int get_expand();
/* EXRULE */
void set_exrule(struct icalrecurrencetype val);
struct icalrecurrencetype get_exrule();
/* FREEBUSY */
void set_freebusy(struct icalperiodtype val);
struct icalperiodtype get_freebusy();
/* GEO */
void set_geo(struct icalgeotype val);
struct icalgeotype get_geo();
/* GRANT */
void set_grant(string val);
string get_grant();
/* LAST-MODIFIED */
void set_lastmodified(struct icaltimetype val);
struct icaltimetype get_lastmodified();
/* LOCATION */
void set_location(string val);
string get_location();
/* MAXRESULTS */
void set_maxresults(int val);
int get_maxresults();
/* MAXRESULTSSIZE */
void set_maxresultsize(int val);
int get_maxresultsize();
/* METHOD */
void set_method(enum icalproperty_method val);
enum icalproperty_method get_method();
/* OWNER */
void set_owner(string val);
string get_owner();
/* ORGANIZER */
void set_organizer(string val);
string get_organizer();
/* PERCENT-COMPLETE */
void set_percentcomplete(int val);
int get_percentcomplete();
/* PRIORITY */
void set_priority(int val);
int get_priority();
/* PRODID */
void set_prodid(string val);
string get_prodid();
/* QUERY */
void set_query(string val);
string get_query();
/* QUERYNAME */
void set_queryname(string val);
string get_queryname();
/* RDATE */
void set_rdate(struct icaldatetimeperiodtype val);
struct icaldatetimeperiodtype get_rdate();
/* RECURRENCE-ID */
void set_recurrenceid(struct icaltimetype val);
struct icaltimetype get_recurrenceid();
/* RELATED-TO */
void set_relatedto(string val);
string get_relatedto();
/* RELCALID */
void set_relcalid(string val);
string get_relcalid();
/* REPEAT */
void set_repeat(int val);
int get_repeat();
/* REQUEST-STATUS */
void set_requeststatus(string val);
string get_requeststatus();
/* RESOURCES */
void set_resources(string val);
string get_resources();
/* RRULE */
void set_rrule(struct icalrecurrencetype val);
struct icalrecurrencetype get_rrule();
/* SCOPE */
void set_scope(string val);
string get_scope();
/* SEQUENCE */
void set_sequence(int val);
int get_sequence();
/* STATUS */
void set_status(enum icalproperty_status val);
enum icalproperty_status get_status();
/* SUMMARY */
void set_summary(string val);
string get_summary();
/* TARGET */
void set_target(string val);
string get_target();
/* TRANSP */
void set_transp(enum icalproperty_transp val);
enum icalproperty_transp get_transp();
/* TRIGGER */
void set_trigger(struct icaltriggertype val);
struct icaltriggertype get_trigger();
/* TZID */
void set_tzid(string val);
string get_tzid();
/* TZNAME */
void set_tzname(string val);
string get_tzname();
/* TZOFFSETFROM */
void set_tzoffsetfrom(int val);
int get_tzoffsetfrom();
/* TZOFFSETTO */
void set_tzoffsetto(int val);
int get_tzoffsetto();
/* TZURL */
void set_tzurl(string val);
string get_tzurl();
/* UID */
void set_uid(string val);
string get_uid();
/* URL */
void set_url(string val);
string get_url();
/* VERSION */
void set_version(string val);
string get_version();
/* X */
void set_x(string val);
string get_x();
/* X-LIC-CLUSTERCOUNT */
void set_xlicclustercount(string val);
string get_xlicclustercount();
/* X-LIC-ERROR */
void set_xlicerror(string val);
string get_xlicerror();
/* X-LIC-MIMECHARSET */
void set_xlicmimecharset(string val);
string get_xlicmimecharset();
/* X-LIC-MIMECID */
void set_xlicmimecid(string val);
string get_xlicmimecid();
/* X-LIC-MIMECONTENTTYPE */
void set_xlicmimecontenttype(string val);
string get_xlicmimecontenttype();
/* X-LIC-MIMEENCODING */
void set_xlicmimeencoding(string val);
string get_xlicmimeencoding();
/* X-LIC-MIMEFILENAME */
void set_xlicmimefilename(string val);
string get_xlicmimefilename();
/* X-LIC-MIMEOPTINFO */
void set_xlicmimeoptinfo(string val);
string get_xlicmimeoptinfo();
private:
icalproperty* imp; /**< The actual C based icalproperty */
};
typedef ICPointerHolder<ICalProperty> ICalPropertyTmpPtr; /* see icptrholder.h for comments */
#endif /* ICalProperty_H */

Просмотреть файл

@ -3,11 +3,12 @@
FILE: icalrecur.c
CREATOR: eric 16 May 2000
$Id: icalrecur.c,v 1.68 2007/05/31 21:26:14 artcancro Exp $
$Id: icalrecur.c,v 1.71 2008-02-03 16:10:46 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -160,6 +161,9 @@ typedef long intptr_t;
#include <string.h> /* for strdup and strchr*/
#include <assert.h>
#include <stddef.h> /* For offsetof() macro */
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include "pvl.h"
@ -312,6 +316,38 @@ void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array,
}
/*
* Days in the BYDAY rule are expected by the code to be sorted, and while
* this may be the common case, the RFC doesn't actually mandate it. This
* function sorts the days taking into account the first day of week.
*/
static void
sort_bydayrules(struct icalrecur_parser *parser)
{
short *array;
int week_start, one, two, i, j;
array = parser->rt.by_day;
week_start = parser->rt.week_start;
for (i=0;
i<ICAL_BY_DAY_SIZE && array[i] != ICAL_RECURRENCE_ARRAY_MAX;
i++) {
for (j=0; j<i; j++) {
one = icalrecurrencetype_day_day_of_week(array[j]) - week_start;
if (one < 0) one += 7;
two = icalrecurrencetype_day_day_of_week(array[i]) - week_start;
if (two < 0) two += 7;
if (one > two) {
short tmp = array[j];
array[j] = array[i];
array[i] = tmp;
}
}
}
}
void icalrecur_add_bydayrules(struct icalrecur_parser *parser, const char* vals)
{
@ -370,6 +406,7 @@ void icalrecur_add_bydayrules(struct icalrecur_parser *parser, const char* vals)
free(vals_copy);
sort_bydayrules(parser);
}
@ -411,19 +448,14 @@ struct icalrecurrencetype icalrecurrencetype_from_string(const char* str)
if (strcasecmp(name,"FREQ") == 0){
parser.rt.freq = icalrecur_string_to_freq(value);
} else if (strcasecmp(name,"COUNT") == 0){
int v = atoi(value);
if (v >= 0) {
parser.rt.count = v;
}
parser.rt.count = atoi(value);
} else if (strcasecmp(name,"UNTIL") == 0){
parser.rt.until = icaltime_from_string(value);
} else if (strcasecmp(name,"INTERVAL") == 0){
int v = atoi(value);
if (v > 0 && v <= SHRT_MAX) {
parser.rt.interval = (short) v;
}
parser.rt.interval = (short)atoi(value);
} else if (strcasecmp(name,"WKST") == 0){
parser.rt.week_start = icalrecur_string_to_weekday(value);
sort_bydayrules(&parser);
} else if (strcasecmp(name,"BYSECOND") == 0){
icalrecur_add_byrules(&parser,parser.rt.by_second,
ICAL_BY_SECOND_SIZE,value);
@ -465,7 +497,7 @@ struct icalrecurrencetype icalrecurrencetype_from_string(const char* str)
}
static struct { char* str;size_t offset; int limit; } recurmap[] =
static struct {const char* str;size_t offset; int limit; } recurmap[] =
{
{";BYSECOND=",offsetof(struct icalrecurrencetype,by_second),ICAL_BY_SECOND_SIZE - 1},
{";BYMINUTE=",offsetof(struct icalrecurrencetype,by_minute),ICAL_BY_MINUTE_SIZE - 1},
@ -484,6 +516,15 @@ 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)
{
char *buf;
buf = icalrecurrencetype_as_string_r(recur);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char* icalrecurrencetype_as_string_r(struct icalrecurrencetype *recur)
{
char* str;
char *str_p;
@ -495,7 +536,7 @@ char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur)
return 0;
}
str = (char*)icalmemory_tmp_buffer(buf_sz);
str = (char*)icalmemory_new_buffer(buf_sz);
str_p = str;
icalmemory_append_string(&str,&str_p,&buf_sz,"FREQ=");
@ -714,7 +755,7 @@ static int icalrecur_one_byrule(icalrecur_iterator* impl,enum byrule one)
return passes;
}
/*
static int count_byrules(icalrecur_iterator* impl)
{
int count = 0;
@ -728,7 +769,7 @@ static int count_byrules(icalrecur_iterator* impl)
return count;
}
*/
static void setup_defaults(icalrecur_iterator* impl,
enum byrule byrule, icalrecurrencetype_frequency req,
@ -926,18 +967,19 @@ icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
monday. Otherwise, jumping to the next week ( jumping 7
days ahead ) will skip over some occurrences in the
second week. */
/* This is probably a HACK. There should be some more
general way to solve this problem */
/* This depends on impl->by_ptrs[BY_DAY] being correctly sorted by
* day. This should probably be abstracted to make such assumption
* more explicit. */
short dow = (short)(impl->by_ptrs[BY_DAY][0]-icaltime_day_of_week(impl->last));
if(dow < 0) {
/* initial time is after first day of BY_DAY data */
impl->last.day += dow;
impl->last = icaltime_normalize(impl->last);
if((icaltime_day_of_week(impl->last) < impl->by_ptrs[BY_DAY][0] && dow >= 0) || dow < 0)
{
/* initial time is after first day of BY_DAY data */
impl->last.day += dow;
impl->last = icaltime_normalize(impl->last);
}
}
@ -1015,6 +1057,8 @@ icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
return 0;
}
} else if (has_by_data(impl,BY_MONTH_DAY)) {
impl->last = icaltime_normalize(impl->last);
}
@ -1346,7 +1390,7 @@ static int next_day(icalrecur_iterator* impl)
}
/*
static int next_yearday(icalrecur_iterator* impl)
{
@ -1379,7 +1423,7 @@ static int next_yearday(icalrecur_iterator* impl)
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 */
@ -1509,7 +1553,6 @@ static int next_month(icalrecur_iterator* impl)
if ( day > days_in_month){
impl->last.day = 1;
increment_month(impl);
impl->last.day--; /* Go back one day, so searches next month start at day 1 */
data_valid = 0; /* signal that impl->last is invalid */
}
@ -1563,7 +1606,7 @@ static int next_month(icalrecur_iterator* impl)
*/
} else if (has_by_data(impl,BY_MONTH_DAY)) {
int day;
int day, days_in_month;
assert( BYMDPTR[0]!=ICAL_RECURRENCE_ARRAY_MAX);
@ -1576,16 +1619,41 @@ static int next_month(icalrecur_iterator* impl)
increment_month(impl);
}
days_in_month = icaltime_days_in_month(impl->last.month,
impl->last.year);
day = BYMDPTR[BYMDIDX];
if (day < 0) {
day = icaltime_days_in_month(impl->last.month, impl->last.year) + day + 1;
}
if ( day > days_in_month){
impl->last.day = 1;
/* 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 */
}
}
impl->last.day = day;
} else {
int days_in_month;
increment_month(impl);
days_in_month = icaltime_days_in_month(impl->last.month,
impl->last.year);
if (impl->last.day > days_in_month){
data_valid = 0; /* signal that impl->last is invalid */
}
}
return data_valid;
@ -2233,6 +2301,11 @@ struct icaltimetype icalrecur_iterator_next(icalrecur_iterator *impl)
}
}
if(impl->last.year >= 2038 ){
/* HACK */
return icaltime_null_time();
}
} while(!check_contracting_rules(impl)
|| icaltime_compare(impl->last,impl->dtstart) < 0
|| valid == 0);

Просмотреть файл

@ -4,7 +4,8 @@
CREATOR: eric 20 March 2000
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -114,7 +115,7 @@ enum {
* Recurrence type routines
*/
/* See RFC 2445 Section 4.3.10, RECUR Value, for an explanation of
/* 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
@ -179,12 +180,14 @@ 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 */
int icalrecurrencetype_day_position(short day);
icalrecurrencetype_weekday icalrecur_string_to_weekday(const char* str);
/** Recurrance rule parser */
/** Convert between strings and recurrencetype structures. */
struct icalrecurrencetype icalrecurrencetype_from_string(const char* str);
char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur);
char* icalrecurrencetype_as_string_r(struct icalrecurrencetype *recur);
/** Recurrence iteration routines */

Просмотреть файл

@ -19,18 +19,12 @@
#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
in machine generated code below */
struct icalrestriction_property_record;
typedef char* (*restriction_func)(struct icalrestriction_property_record* rec,icalcomponent* comp,icalproperty* prop);
typedef const char* (*restriction_func)(const struct icalrestriction_property_record* rec,icalcomponent* comp,icalproperty* prop);
typedef struct icalrestriction_property_record {
@ -59,9 +53,6 @@ icalrestriction_get_component_restriction(icalproperty_method method,
icalcomponent_kind component,
icalcomponent_kind subcomponent);
icalrestriction_component_record icalrestriction_component_records[];
icalrestriction_property_record icalrestriction_property_records[];
icalrestriction_property_record null_prop_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_UNKNOWN,0};
icalrestriction_component_record null_comp_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_UNKNOWN,0};
@ -100,7 +91,8 @@ const char restr_string_map[ICAL_RESTRICTION_UNKNOWN+1][60] = {
int
icalrestriction_compare(icalrestriction_kind restr, int count){
if ( restr < ICAL_RESTRICTION_NONE || restr > ICAL_RESTRICTION_UNKNOWN
/* restr is an unsigned int, ICAL_RESTRICTION_NONE == 0, so the check will always return false */
if ( /*restr < ICAL_RESTRICTION_NONE ||*/ restr > ICAL_RESTRICTION_UNKNOWN
|| count < 0){
return -1;
}
@ -115,13 +107,14 @@ icalrestriction_compare(icalrestriction_kind restr, int count){
/* Special case routines */
char* icalrestriction_may_be_draft_final_canceled(
const char* icalrestriction_may_be_draft_final_canceled(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_status(prop);
(void)rec;
(void)comp;
if( !( stat == ICAL_STATUS_DRAFT ||
stat == ICAL_STATUS_FINAL ||
@ -134,12 +127,14 @@ char* icalrestriction_may_be_draft_final_canceled(
return 0;
}
char* icalrestriction_may_be_comp_need_process(
const char* icalrestriction_may_be_comp_need_process(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_status(prop);
(void)rec;
(void)comp;
if( !( stat == ICAL_STATUS_COMPLETED ||
stat == ICAL_STATUS_NEEDSACTION ||
@ -151,11 +146,15 @@ char* icalrestriction_may_be_comp_need_process(
return 0;
}
char* icalrestriction_may_be_tent_conf(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
const char* icalrestriction_may_be_tent_conf(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_status(prop);
(void)rec;
(void)comp;
if( !( stat == ICAL_STATUS_TENTATIVE ||
stat == ICAL_STATUS_CONFIRMED )){
@ -165,13 +164,16 @@ char* icalrestriction_may_be_tent_conf(const icalrestriction_property_record *re
return 0;
}
char* icalrestriction_may_be_tent_conf_cancel(
const char* icalrestriction_may_be_tent_conf_cancel(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_status(prop);
(void)rec;
(void)comp;
if( !( stat == ICAL_STATUS_TENTATIVE ||
stat == ICAL_STATUS_CONFIRMED ||
stat == ICAL_STATUS_CANCELLED )){
@ -183,13 +185,15 @@ char* icalrestriction_may_be_tent_conf_cancel(
return 0;
}
char* icalrestriction_must_be_cancel_if_present(
const char* icalrestriction_must_be_cancel_if_present(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalcomponent* comp,
icalproperty* prop)
{
/* This routine will not be called if prop == 0 */
icalproperty_status stat = icalproperty_get_status(prop);
(void)rec;
(void)comp;
if( stat != ICAL_STATUS_CANCELLED)
{
@ -201,27 +205,37 @@ char* icalrestriction_must_be_cancel_if_present(
return 0;
}
char* icalrestriction_must_be_canceled_no_attendee(
const char* icalrestriction_must_be_canceled_no_attendee(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalcomponent* comp,
icalproperty* prop)
{
(void)rec;
(void)comp;
(void)prop;
/* Hack. see rfc2446, 3.2.5 CANCEL for porperty STATUS. I don't
understand the note */
return 0;
}
char* icalrestriction_must_be_recurring(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
const char* icalrestriction_must_be_recurring(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
/* Hack */
(void)rec;
(void)comp;
(void)prop;
return 0;
}
char* icalrestriction_must_have_duration(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
const char* icalrestriction_must_have_duration(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
if( !icalcomponent_get_first_property(comp,ICAL_DURATION_PROPERTY)){
return "Failed iTIP restrictions for DURATION property. This component must have a DURATION property";
@ -230,9 +244,14 @@ char* icalrestriction_must_have_duration(const icalrestriction_property_record *
return 0;
}
char* icalrestriction_must_have_repeat(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
const char* icalrestriction_must_have_repeat(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
(void)rec;
(void)prop;
if( !icalcomponent_get_first_property(comp,ICAL_REPEAT_PROPERTY)){
return "Failed iTIP restrictions for REPEAT property. This component must have a REPEAT property";
@ -241,17 +260,27 @@ char* icalrestriction_must_have_repeat(const icalrestriction_property_record *re
return 0;
}
char* icalrestriction_must_if_tz_ref(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
const char* icalrestriction_must_if_tz_ref(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
/* Hack */
(void)rec;
(void)comp;
(void)prop;
return 0;
}
char* icalrestriction_no_dtend(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
const char* icalrestriction_no_dtend(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
(void)rec;
(void)prop;
if( !icalcomponent_get_first_property(comp,ICAL_DTEND_PROPERTY)){
return "Failed iTIP restrictions for DTEND property. The component must not have both DURATION and DTEND";
@ -260,19 +289,29 @@ char* icalrestriction_no_dtend(const icalrestriction_property_record *rec,
return 0;
}
char* icalrestriction_no_duration(const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
const char* icalrestriction_no_duration(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
(void)rec;
(void)comp;
(void)prop;
/* _no_dtend takes care of this one */
return 0;
}
char* icalrestriction_must_be_email(
}
const char* icalrestriction_must_be_email(
const icalrestriction_property_record *rec,
icalcomponent* comp,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_action(prop);
icalproperty_action stat = icalproperty_get_action(prop);
(void)rec;
(void)comp;
if( !( stat == ICAL_ACTION_EMAIL)){
@ -419,6 +458,8 @@ int icalrestriction_check(icalcomponent* outer_comp)
}
<insert_code_here>
static const icalrestriction_property_record*
icalrestriction_get_property_restriction(icalproperty_method method,
icalcomponent_kind component,
@ -462,4 +503,3 @@ icalrestriction_get_component_restriction(icalproperty_method method,
return &null_comp_record;
}

Просмотреть файл

@ -3,10 +3,11 @@
FILE: icalrestriction.h
CREATOR: eric 24 April 1999
$Id: icalrestriction.h,v 1.2 2007/04/30 13:57:48 artcancro Exp $
$Id: icalrestriction.h,v 1.3 2008-01-15 23:17:42 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:

Просмотреть файл

@ -3,10 +3,11 @@
FILE: icaltime.c
CREATOR: eric 02 June 2000
$Id: icaltime.c,v 1.68 2007/11/30 22:56:49 dothebart Exp $
$Id: icaltime.c,v 1.71 2008-01-29 18:31:48 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -51,11 +52,26 @@
#define strcasecmp stricmp
#endif
#ifdef WIN32
/* Undef the similar macro from pthread.h, it doesn't check if
* gmtime() returns NULL.
*/
#undef gmtime_r
/* The gmtime() in Microsoft's C library is MT-safe */
#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
#endif
#ifdef HAVE_PTHREAD
#include <pthread.h>
static pthread_mutex_t tzid_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
/*
* Function to convert a struct tm time specification
* to an ANSI time_t using the specified time zone.
* This is different from the standard mktime() function
* in that we dont want the automatic adjustments for
* in that we don't want the automatic adjustments for
* local daylight savings time applied to the result.
* This function expects well-formed input.
*/
@ -179,41 +195,42 @@ struct icaltimetype
icaltime_from_timet_with_zone(const time_t tm, const int is_date,
const icaltimezone *zone)
{
struct icaltimetype tt = icaltime_null_time();
struct icaltimetype tt;
struct tm t;
icaltimezone *utc_zone;
/* Convert the time_t to a struct tm. We can trust gmtime for this. */
#ifdef HAVE_GMTIME_R
gmtime_r(&tm, &t);
#else
{
struct tm *t_ptr = gmtime(&tm);
t = *t_ptr;
}
#endif
utc_zone = icaltimezone_get_utc_timezone ();
/* Convert the time_t to a struct tm in UTC time. We can trust gmtime
for this. */
#ifdef HAVE_PTHREAD
gmtime_r (&tm, &t);
#else
t = *(gmtime (&tm));
#endif
tt.year = t.tm_year + 1900;
tt.month = t.tm_mon + 1;
tt.day = t.tm_mday;
if (is_date) {
tt.is_date = 1;
return tt;
}
tt.hour = t.tm_hour;
tt.minute = t.tm_min;
tt.second = t.tm_sec;
/* If it's a floating time, we don't do any conversion. */
if (zone == NULL) {
return tt;
}
utc_zone = icaltimezone_get_utc_timezone ();
tt.is_date = 0;
tt.is_utc = (zone == utc_zone) ? 1 : 0;
tt.zone = zone;
tt.is_daylight = 0;
tt.zone = NULL;
/* Use our timezone functions to convert to the required timezone. */
icaltimezone_convert_time (&tt, utc_zone, (icaltimezone *)zone);
tt.is_date = is_date;
/* If it is a DATE value, make sure hour, minute & second are 0. */
if (is_date) {
tt.hour = 0;
tt.minute = 0;
tt.second = 0;
}
return tt;
}
@ -237,6 +254,12 @@ struct icaltimetype icaltime_today(void)
}
/** @brief Return the time as seconds past the UNIX epoch
*
* While this function is not currently deprecated, it probably won't do
* what you expect, unless you know what you're doing. In particular, you
* should only pass an icaltime in UTC, since no conversion is done. Even
* in that case, it's probably better to just use
* icaltime_as_timet_with_zone().
*/
time_t icaltime_as_timet(const struct icaltimetype tt)
{
@ -251,9 +274,14 @@ time_t icaltime_as_timet(const struct icaltimetype tt)
/* 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;
if (icaltime_is_date(tt)) {
stm.tm_sec = stm.tm_min = stm.tm_hour = 0;
} else {
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;
@ -265,51 +293,169 @@ time_t icaltime_as_timet(const struct icaltimetype tt)
}
/** @brief Return the time as seconds past the UNIX epoch, using the
/* 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. */
static char* saved_tz = NULL;
/* If you use set_tz(), you must call unset_tz() some time later to restore the
original TZ. Pass unset_tz() the string that set_tz() returns. Call both the functions
locking the tzid mutex as in icaltime_as_timet_with_zone */
char* set_tz(const char* tzid)
{
char *old_tz, *old_tz_copy = NULL, *new_tz;
/* Get the old TZ setting and save a copy of it to return. */
old_tz = getenv("TZ");
if(old_tz){
old_tz_copy = (char*)malloc(strlen (old_tz) + 4);
if(old_tz_copy == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
strcpy (old_tz_copy, "TZ=");
strcpy (old_tz_copy + 3, old_tz);
}
/* Create the new TZ string. */
new_tz = (char*)malloc(strlen (tzid) + 4);
if(new_tz == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
strcpy (new_tz, "TZ=");
strcpy (new_tz + 3, tzid);
/* Add the new TZ to the environment. */
putenv(new_tz);
/* Free any previous TZ environment string we have used in a synchronized manner. */
free (saved_tz);
/* Save a pointer to the TZ string we just set, so we can free it later. */
saved_tz = new_tz;
return old_tz_copy; /* This will be zero if the TZ env var was not set */
}
void unset_tz(char *tzstr)
{
/* restore the original environment */
if(tzstr!=0){
putenv(tzstr);
} else {
/* Delete from environment. We prefer unsetenv(3) over putenv(3)
because the former is POSIX and behaves consistently. The later
does not unset the variable in some systems (like NetBSD), leaving
it with an empty value. This causes problems later because further
calls to time related functions in libc will treat times in UTC. */
#ifdef HAVE_UNSETENV
unsetenv("TZ");
#else
putenv("TZ");
#endif
}
/* Free any previous TZ environment string we have used in a synchronized manner */
free (saved_tz);
/* Save a pointer to the TZ string we just set, so we can free it later.
(This can possibly be NULL if there was no TZ to restore.) */
saved_tz = tzstr;
}
/** Return the time as seconds past the UNIX epoch, using the
* given timezone.
*
* This convenience method combines a call to icaltime_convert() with
* a call to icaltime_as_timet().
* This convenience method combines a call to icaltime_convert_to_zone()
* with a call to icaltime_as_timet().
* If the input timezone is null, no conversion is done; that is, the
* time is simply returned as time_t in its native timezone.
*/
time_t icaltime_as_timet_with_zone(const struct icaltimetype _tt,
time_t icaltime_as_timet_with_zone(const struct icaltimetype tt,
const icaltimezone *zone)
{
struct icaltimetype tt = _tt;
icaltimezone *utc_zone;
struct tm stm;
time_t t;
char *old_tz;
struct icaltimetype local_tt;
utc_zone = icaltimezone_get_utc_timezone ();
/* If the time is the special null time, return 0. */
if (icaltime_is_null_time(tt)) {
return 0;
}
if (zone != NULL) {
tt = icaltime_convert_to_zone(_tt, zone);
}
local_tt = tt;
/* Clear the is_date flag, so we can convert the time. */
local_tt.is_date = 0;
/* Use our timezone functions to convert to UTC. */
icaltimezone_convert_time (&local_tt, (icaltimezone *)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_sec = local_tt.second;
stm.tm_min = local_tt.minute;
stm.tm_hour = local_tt.hour;
stm.tm_mday = local_tt.day;
stm.tm_mon = local_tt.month-1;
stm.tm_year = local_tt.year-1900;
stm.tm_isdst = -1;
/* The functions putenv and mktime are not thread safe, inserting a lock
to prevent any crashes */
t = make_time(&stm, 0);
#ifdef HAVE_PTHREAD
pthread_mutex_lock (&tzid_mutex);
#endif
/* Set TZ to UTC and use mktime to convert to a time_t. */
old_tz = set_tz ("UTC");
#ifdef WIN32
tzset ();
#endif
t = mktime (&stm);
unset_tz (old_tz);
#ifdef WIN32
tzset ();
#endif
#ifdef HAVE_PTHREAD
pthread_mutex_unlock (&tzid_mutex);
#endif
return t;
}
const char* icaltime_as_ical_string(const struct icaltimetype tt)
{
char *buf;
buf = icaltime_as_ical_string_r(tt);
icalmemory_add_tmp_buffer(buf);
return buf;
}
/**
* Return a string represention of the time, in RFC2445 format. The
* string is owned by libical
*/
const char* icaltime_as_ical_string(const struct icaltimetype tt)
char* icaltime_as_ical_string_r(const struct icaltimetype tt)
{
size_t size = 17;
char* buf = icalmemory_new_buffer(size);
@ -317,7 +463,7 @@ const char* icaltime_as_ical_string(const struct icaltimetype tt)
if(tt.is_date){
snprintf(buf, size,"%04d%02d%02d",tt.year,tt.month,tt.day);
} else {
char* fmt;
const char* fmt;
if(tt.is_utc){
fmt = "%04d%02d%02dT%02d%02d%02dZ";
} else {
@ -327,12 +473,10 @@ const char* icaltime_as_ical_string(const struct icaltimetype tt)
tt.hour,tt.minute,tt.second);
}
icalmemory_add_tmp_buffer(buf);
return buf;
}
/**
* 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
@ -369,39 +513,57 @@ struct icaltimetype icaltime_from_string(const char* str)
size = strlen(str);
if(size == 15) { /* floating time */
if ((size == 15) || (size == 19)) { /* floating time with/without separators*/
tt.is_utc = 0;
tt.is_date = 0;
} else if (size == 16) { /* UTC time, ends in 'Z'*/
if(str[15] != 'Z')
goto errorlabel;
} else if ((size == 16) || (size == 20)) { /* UTC time, ends in 'Z'*/
if ((str[15] != 'Z') && (str[19] != 'Z'))
goto FAIL;
tt.is_utc = 1;
tt.zone = icaltimezone_get_utc_timezone();
tt.is_date = 0;
} else if (size == 8) { /* A DATE */
} else if ((size == 8) || (size == 10)) { /* A DATE */
tt.is_utc = 0;
tt.is_date = 1;
} else { /* error */
goto errorlabel;
goto FAIL;
}
if(tt.is_date == 1){
if (sscanf(str,"%04d%02d%02d",&tt.year,&tt.month,&tt.day) < 3)
goto errorlabel;
if (tt.is_date == 1){
if (size == 10) {
char dsep1, dsep2;
if (sscanf(str,"%04d%c%02d%c%02d",&tt.year,&dsep1,&tt.month,&dsep2,&tt.day) < 5)
goto FAIL;
if ((dsep1 != '-') || (dsep2 != '-'))
goto FAIL;
} else if (sscanf(str,"%04d%02d%02d",&tt.year,&tt.month,&tt.day) < 3) {
goto FAIL;
}
} else {
if (size > 16 ) {
char dsep1, dsep2, tsep, tsep1, tsep2;
if (sscanf(str,"%04d%c%02d%c%02d%c%02d%c%02d%c%02d",&tt.year,&dsep1,&tt.month,&dsep2,
&tt.day,&tsep,&tt.hour,&tsep1,&tt.minute,&tsep2,&tt.second) < 11)
goto FAIL;
if((tsep != 'T') || (dsep1 != '-') || (dsep2 != '-') || (tsep1 != ':') || (tsep2 != ':'))
goto FAIL;
} else {
char tsep;
if (sscanf(str,"%04d%02d%02d%c%02d%02d%02d",&tt.year,&tt.month,&tt.day,
&tsep,&tt.hour,&tt.minute,&tt.second) < 7)
goto errorlabel;
goto FAIL;
if(tsep != 'T')
goto errorlabel;
goto FAIL;
}
}
return tt;
errorlabel:
FAIL:
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return icaltime_null_time();
}
@ -419,6 +581,15 @@ icaltime_is_leap_year (const int year)
return ( (year % 4==0) && (year % 100 !=0 )) || (year % 400 == 0);
}
int
ycaltime_days_in_year (const int year)
{
if (icaltime_is_leap_year (year))
return 366;
else return 365;
}
static int _days_in_month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
int icaltime_days_in_month(const int month, const int year)
@ -426,8 +597,17 @@ int icaltime_days_in_month(const int month, const int year)
int days = _days_in_month[month];
assert(month > 0);
assert(month <= 12);
/* The old code aborting if it was passed a parameter like BYMONTH=0
* Unfortunately it's not practical right now to pass an error all
* the way up the stack, so instead of aborting we're going to apply
* the GIGO principle and simply return '30 days' if we get an
* invalid month. Modern applications cannot tolerate crashing.
* assert(month > 0);
* assert(month <= 12);
*/
if ((month < 1) || (month > 12)) {
return 30;
}
if( month == 2){
days += icaltime_is_leap_year(year);
@ -455,11 +635,10 @@ int icaltime_day_of_week(const struct icaltimetype t){
}
/** Day of the year that the first day of the week (Sunday) is on.
*
* @todo Doesn't take into account different week start days.
*/
int icaltime_start_doy_of_week(const struct icaltimetype t){
int icaltime_start_doy_week(const struct icaltimetype t, int fdow){
UTinstant jt;
int delta;
memset(&jt,0,sizeof(UTinstant));
@ -473,7 +652,23 @@ int icaltime_start_doy_of_week(const struct icaltimetype t){
juldat(&jt);
caldat(&jt);
return jt.day_of_year - jt.weekday;
delta = jt.weekday - (fdow - 1);
if (delta < 0) delta += 7;
return jt.day_of_year - delta;
}
/** Day of the year that the first day of the week (Sunday) is on.
*
* @deprecated Doesn't take into account different week start days.
*/
int icaltime_start_doy_of_week(const struct icaltimetype t){
#ifndef NO_WARN_DEPRECATED
icalerror_warn("icaltime_start_doy_of_week() is DEPRECATED, use\
icaltime_start_doy_week() instead");
#endif
return icaltime_start_doy_week(t, 1);
}
/**
@ -500,7 +695,7 @@ int icaltime_week_number(const struct icaltimetype ictt)
}
/* The first array is for non-leap years, the second for leap years*/
static const int days_in_year[2][13] =
static const int days_in_year_passed_month[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 }
@ -512,7 +707,7 @@ static const int days_in_year[2][13] =
int icaltime_day_of_year(const struct icaltimetype t){
int is_leap = icaltime_is_leap_year (t.year);
return days_in_year[is_leap][t.month - 1] + t.day;
return days_in_year_passed_month[is_leap][t.month - 1] + t.day;
}
/** @brief Contructor.
@ -534,20 +729,20 @@ struct icaltimetype icaltime_from_day_of_year(const int _doy, const int _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]){
doy += days_in_year_passed_month[is_leap][12];
} else if(doy > days_in_year_passed_month[is_leap][12]){
/* Move on to the next year*/
is_leap = icaltime_is_leap_year(year);
doy -= days_in_year[is_leap][12];
doy -= days_in_year_passed_month[is_leap][12];
year++;
}
tt.year = year;
for (month = 11; month >= 0; month--) {
if (doy > days_in_year[is_leap][month]) {
if (doy > days_in_year_passed_month[is_leap][month]) {
tt.month = month + 1;
tt.day = doy - days_in_year[is_leap][month];
tt.day = doy - days_in_year_passed_month[is_leap][month];
break;
}
}
@ -698,33 +893,60 @@ int icaltime_compare(const struct icaltimetype a_in, const struct icaltimetype b
*/
int
icaltime_compare_date_only(const struct icaltimetype a_in, const struct icaltimetype b_in, icaltimezone *tz)
icaltime_compare_date_only(const struct icaltimetype a_in, const struct icaltimetype b_in)
{
struct icaltimetype a, b;
icaltimezone *tz = icaltimezone_get_utc_timezone();
a = icaltime_convert_to_zone(a_in, tz);
b = icaltime_convert_to_zone(b_in, tz);
if (a.year > b.year)
return 1;
else if (a.year < b.year)
return -1;
if (a.month > b.month)
return 1;
else if (a.month < b.month)
return -1;
if (a.day > b.day)
return 1;
else if (a.day < b.day)
return -1;
return 0;
}
/**
* like icaltime_compare, but only use the date parts; accepts timezone.
*/
int
icaltime_compare_date_only_tz(const struct icaltimetype a_in, const struct icaltimetype b_in, icaltimezone *tz)
{
int retval;
struct icaltimetype a, b;
a = icaltime_convert_to_zone(a_in, tz);
b = icaltime_convert_to_zone(b_in, tz);
if (a.year > b.year)
retval = 1;
return 1;
else if (a.year < b.year)
retval = -1;
return -1;
else if (a.month > b.month)
retval = 1;
if (a.month > b.month)
return 1;
else if (a.month < b.month)
retval = -1;
return -1;
else if (a.day > b.day)
retval = 1;
if (a.day > b.day)
return 1;
else if (a.day < b.day)
retval = -1;
return -1;
else
retval = 0;
return retval;
return 0;
}
/* These are defined in icalduration.c:
@ -747,9 +969,13 @@ icaltime_adjust(struct icaltimetype *tt, const int days, const int hours,
const int minutes, const int seconds) {
int second, minute, hour, day;
int minutes_overflow, hours_overflow, days_overflow, years_overflow;
int minutes_overflow, hours_overflow, days_overflow = 0, years_overflow;
int days_in_month;
/* If we are passed a date make sure to ignore hour minute and second */
if (tt->is_date)
goto IS_DATE;
/* Add on the seconds. */
second = tt->second + seconds;
tt->second = second % 60;
@ -777,6 +1003,7 @@ icaltime_adjust(struct icaltimetype *tt, const int days, const int hours,
days_overflow--;
}
IS_DATE:
/* 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. */
@ -848,7 +1075,7 @@ struct icaltimetype icaltime_convert_to_zone(const struct icaltimetype tt,
/* If it's a floating time we don't want to adjust the time */
if (tt.zone != NULL) {
icaltimezone_convert_time(&ret, tt.zone, zone);
icaltimezone_convert_time(&ret, (icaltimezone *)tt.zone, zone);
}
ret.zone = zone;
@ -867,11 +1094,11 @@ icaltime_get_timezone(const struct icaltimetype t) {
return t.zone;
}
char *
const char *
icaltime_get_tzid(const struct icaltimetype t) {
if (t.zone != NULL) {
return icaltimezone_get_tzid(t.zone);
return icaltimezone_get_tzid((icaltimezone *)t.zone);
} else {
return NULL;
}
@ -927,7 +1154,7 @@ icaltime_span icaltime_span_new(struct icaltimetype dtstart,
span.is_busy = is_busy;
span.start = icaltime_as_timet_with_zone(dtstart,
icaltimezone_get_utc_timezone());
dtstart.zone ? dtstart.zone : icaltimezone_get_utc_timezone());
if (icaltime_is_null_time(dtend)) {
if (!icaltime_is_date(dtstart)) {
@ -940,7 +1167,8 @@ icaltime_span icaltime_span_new(struct icaltimetype dtstart,
}
}
span.end = icaltime_as_timet_with_zone(dtend, icaltimezone_get_utc_timezone());
span.end = icaltime_as_timet_with_zone(dtend,
dtend.zone ? dtend.zone : icaltimezone_get_utc_timezone());
if (icaltime_is_date(dtstart)) {
/* no time specified, go until the end of the day..*/

Просмотреть файл

@ -4,10 +4,11 @@
CREATOR: eric 02 June 2000
$Id: icaltime.h,v 1.26 2007/04/30 13:57:48 artcancro Exp $
$Id: icaltime.h,v 1.28 2008-01-15 23:17:42 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -64,7 +65,7 @@
* - icaltime_set_timezone(struct icaltimetype t, const icaltimezone *zone)
* - icaltime_day_of_year(struct icaltimetype t)
* - icaltime_day_of_week(struct icaltimetype t)
* - icaltime_start_doy_of_week(struct icaltimetype t)
* - icaltime_start_doy_of_week(struct icaltimetype t, int fdow)
* - icaltime_week_number(struct icaltimetype t)
*
* Query methods include:
@ -82,7 +83,7 @@
* - icaltime_compare_with_zone(struct icaltimetype a,struct icaltimetype b)
* - icaltime_compare(struct icaltimetype a,struct icaltimetype b)
* - icaltime_compare_date_only(struct icaltimetype a,
* struct icaltimetype b, icaltimezone *tz)
* struct icaltimetype b)
* - icaltime_adjust(struct icaltimetype *tt, int days, int hours,
* int minutes, int seconds);
* - icaltime_normalize(struct icaltimetype t);
@ -180,15 +181,15 @@ time_t icaltime_as_timet(const struct icaltimetype);
time_t icaltime_as_timet_with_zone(const struct icaltimetype tt,
const icaltimezone *zone);
/** Return a string represention of the time, in RFC2445 format. The
string is owned by libical */
/** Return a string represention of the time, in RFC2445 format. */
const char* icaltime_as_ical_string(const struct icaltimetype tt);
char* icaltime_as_ical_string_r(const struct icaltimetype tt);
/** @brief Return the timezone */
const icaltimezone *icaltime_get_timezone(const struct icaltimetype t);
/** @brief Return the tzid, or NULL for a floating time */
char *icaltime_get_tzid(const struct icaltimetype t);
const char *icaltime_get_tzid(const struct icaltimetype t);
/** @brief Set the timezone */
struct icaltimetype icaltime_set_timezone(struct icaltimetype *t,
@ -204,6 +205,10 @@ int icaltime_day_of_week(const struct icaltimetype t);
given time is within. */
int icaltime_start_doy_of_week(const struct icaltimetype t);
/** Return the day of the year for the first day of the week that the
given time is within. */
int icaltime_start_doy_week(const struct icaltimetype t, int fdow);
/** Return the week number for the week the given time is within */
int icaltime_week_number(const struct icaltimetype t);
@ -234,6 +239,10 @@ int icaltime_compare(const struct icaltimetype a,
/** like icaltime_compare, but only use the date parts. */
int icaltime_compare_date_only(const struct icaltimetype a,
const struct icaltimetype b);
/** like icaltime_compare, but only use the date parts. */
int icaltime_compare_date_only_tz(const struct icaltimetype a,
const struct icaltimetype b, icaltimezone *tz);
/** Adds or subtracts a number of days, hours, minutes and seconds. */
@ -251,6 +260,11 @@ struct icaltimetype icaltime_convert_to_zone(const struct icaltimetype tt,
/** Return the number of days in the given month */
int icaltime_days_in_month(const int month, const int year);
/** Return whether you've specified a leapyear or not. */
int icaltime_is_leap_year (const int year);
/** Return the number of days in this year */
int icaltime_days_in_year (const int year);
/** @brief calculate an icaltimespan given a start and end time. */
struct icaltime_span icaltime_span_new(struct icaltimetype dtstart,

Просмотреть файл

@ -3,7 +3,7 @@
FILE: icaltimezone.c
CREATOR: Damon Chaplin 15 March 2001
$Id: icaltimezone.c,v 1.37 2007/12/01 11:14:00 dothebart Exp $
$Id: icaltimezone.c,v 1.44 2008-02-03 16:10:46 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2001, Damon Chaplin
@ -30,34 +30,38 @@
#include "config.h"
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "icalproperty.h"
#include "icalarray.h"
#include "icalerror.h"
#include "icalparser.h"
#include "icaltimezone.h"
#include "icaltz-util.h"
#include <sys/stat.h>
#ifdef WIN32
#define strcasecmp stricmp
#define PACKAGE_DATA_DIR "/Projects/libical"
#else
#ifdef XP_MAC
#define PACKAGE_DATA_DIR "/Projects/libical"
#else
#ifndef PACKAGE_DATA_DIR
#define PACKAGE_DATA_DIR "/usr/share/libical"
#endif
#endif
#include <mbstring.h>
#include <windows.h>
/* Undef the similar macro from pthread.h, it doesn't check if
* gmtime() returns NULL.
*/
#undef gmtime_r
/* The gmtime() in Microsoft's C library is MT-safe */
#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
#endif
/** This is the toplevel directory where the timezone data is installed in. */
#define ZONEINFO_DIRECTORY PACKAGE_DATA_DIR "/zoneinfo"
/** The prefix we use to uniquely identify TZIDs. */
#define TZID_PREFIX "/softwarestudio.org/"
#define TZID_PREFIX_LEN 20
#define TZID_PREFIX "/citadel.org/"
#define TZID_PREFIX_LEN 13
/** This is the filename of the file containing the city names and
coordinates of all the builtin timezones. */
@ -74,7 +78,7 @@
struct _icaltimezone {
char *tzid;
/**< The unique ID of this timezone,
e.g. "/softwarestudio.org/Olson_20010601_1/Africa/Banjul".
e.g. "/citadel.org/Olson_20010601_1/Africa/Banjul".
This should only be used to identify a VTIMEZONE. It is not
meant to be displayed to the user in any form. */
@ -151,7 +155,7 @@ static icaltimezone utc_timezone = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static char* zone_files_directory = NULL;
static void icaltimezone_reset (icaltimezone *zone);
static void icaltimezone_reset (icaltimezone *zone);
static char* icaltimezone_get_location_from_vtimezone (icalcomponent *component);
static char* icaltimezone_get_tznames_from_vtimezone (icalcomponent *component);
static void icaltimezone_expand_changes (icaltimezone *zone,
@ -162,7 +166,7 @@ static void icaltimezone_expand_vtimezone (icalcomponent *comp,
static int icaltimezone_compare_change_fn (const void *elem1,
const void *elem2);
static int icaltimezone_find_nearby_change (icaltimezone *zone,
static int icaltimezone_find_nearby_change (icaltimezone *zone,
icaltimezonechange *change);
static void icaltimezone_adjust_change (icaltimezonechange *tt,
@ -171,18 +175,18 @@ static void icaltimezone_adjust_change (icaltimezonechange *tt,
int minutes,
int seconds);
static void icaltimezone_init (icaltimezone *zone);
static void icaltimezone_init (icaltimezone *zone);
/** Gets the TZID, LOCATION/X-LIC-LOCATION, and TZNAME properties from the
VTIMEZONE component and places them in the icaltimezone. It returns 1 on
success, or 0 if the TZID can't be found. */
static int icaltimezone_get_vtimezone_properties (icaltimezone *zone,
static int icaltimezone_get_vtimezone_properties (icaltimezone *zone,
icalcomponent *component);
static void icaltimezone_load_builtin_timezone (icaltimezone *zone);
static void icaltimezone_load_builtin_timezone (icaltimezone *zone);
static void icaltimezone_ensure_coverage (icaltimezone *zone,
static void icaltimezone_ensure_coverage (icaltimezone *zone,
int end_year);
@ -190,15 +194,15 @@ static void icaltimezone_init_builtin_timezones(void);
static void icaltimezone_parse_zone_tab (void);
#ifdef USE_BUILTIN_TZDATA
static char* icaltimezone_load_get_line_fn (char *s,
size_t size,
void *data);
#endif
static void format_utc_offset (int utc_offset,
char *buffer);
static char* get_zone_directory(void);
static const char* get_zone_directory(void);
/** Creates a new icaltimezone. */
icaltimezone*
@ -217,6 +221,25 @@ icaltimezone_new (void)
return zone;
}
icaltimezone *
icaltimezone_copy (icaltimezone *originalzone)
{
icaltimezone *zone;
zone = (icaltimezone*) malloc (sizeof (icaltimezone));
if (!zone) {
icalerror_set_errno (ICAL_NEWFAILED_ERROR);
return NULL;
}
memcpy (zone, originalzone, sizeof (icaltimezone));
if (zone->location != NULL)
zone->location = strdup (zone->location);
if (zone->tznames != NULL)
zone->tznames = strdup (zone->tznames);
return zone;
}
/** Frees all memory used for the icaltimezone. */
void
@ -270,11 +293,11 @@ icaltimezone_init (icaltimezone *zone)
it expects the zone to be initialized or reset - it doesn't free
any old values. */
static int
icaltimezone_get_vtimezone_properties (icaltimezone *zone,
icaltimezone_get_vtimezone_properties (icaltimezone *zone,
icalcomponent *component)
{
icalproperty *prop;
const char *tzid;
const char *tzid, *tzname;
prop = icalcomponent_get_first_property (component, ICAL_TZID_PROPERTY);
if (!prop)
@ -285,6 +308,13 @@ icaltimezone_get_vtimezone_properties (icaltimezone *zone,
if (!tzid)
return 0;
prop = icalcomponent_get_first_property (component, ICAL_TZNAME_PROPERTY);
if (prop) {
tzname = icalproperty_get_tzname (prop);
zone->tznames = strdup(tzname);
} else
zone->tznames = NULL;
zone->tzid = strdup (tzid);
zone->component = component;
if ( zone->location != 0 ) free ( zone->location );
@ -442,7 +472,7 @@ icaltimezone_get_tznames_from_vtimezone (icalcomponent *component)
static void
icaltimezone_ensure_coverage (icaltimezone *zone,
icaltimezone_ensure_coverage (icaltimezone *zone,
int end_year)
{
/* When we expand timezone changes we always expand at least up to this
@ -474,7 +504,7 @@ icaltimezone_ensure_coverage (icaltimezone *zone,
static void
icaltimezone_expand_changes (icaltimezone *zone,
icaltimezone_expand_changes (icaltimezone *zone,
int end_year)
{
icalarray *changes;
@ -701,8 +731,8 @@ icaltimezone_compare_change_fn (const void *elem1,
const icaltimezonechange *change1, *change2;
int retval;
change1 = elem1;
change2 = elem2;
change1 = (const icaltimezonechange *)elem1;
change2 = (const icaltimezonechange *)elem2;
if (change1->year < change2->year)
retval = -1;
@ -744,8 +774,8 @@ icaltimezone_compare_change_fn (const void *elem1,
void
icaltimezone_convert_time (struct icaltimetype *tt,
icaltimezone *from_zone,
icaltimezone *to_zone)
icaltimezone *from_zone,
icaltimezone *to_zone)
{
int utc_offset, is_daylight;
@ -872,7 +902,7 @@ icaltimezone_get_utc_offset (icaltimezone *zone,
if (change_num < 0)
return 0;
if (change_num >= zone->changes->num_elements)
if ((unsigned int)change_num >= zone->changes->num_elements)
break;
zone_change = icalarray_element_at (zone->changes, change_num);
@ -1007,7 +1037,7 @@ icaltimezone_get_utc_offset_of_utc_time (icaltimezone *zone,
if (change_num < 0)
return 0;
if (change_num >= zone->changes->num_elements)
if ((unsigned int)change_num >= zone->changes->num_elements)
break;
zone_change = icalarray_element_at (zone->changes, change_num);
@ -1030,7 +1060,7 @@ icaltimezone_get_utc_offset_of_utc_time (icaltimezone *zone,
/** Returns the index of a timezone change which is close to the time
given in change. */
static int
icaltimezone_find_nearby_change (icaltimezone *zone,
icaltimezone_find_nearby_change (icaltimezone *zone,
icaltimezonechange *change)
{
icaltimezonechange *zone_change;
@ -1131,8 +1161,8 @@ icaltimezone_adjust_change (icaltimezonechange *tt,
}
char*
icaltimezone_get_tzid (icaltimezone *zone)
const char*
icaltimezone_get_tzid (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
@ -1145,8 +1175,8 @@ icaltimezone_get_tzid (icaltimezone *zone)
}
char*
icaltimezone_get_location (icaltimezone *zone)
const char*
icaltimezone_get_location (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
@ -1158,8 +1188,8 @@ icaltimezone_get_location (icaltimezone *zone)
}
char*
icaltimezone_get_tznames (icaltimezone *zone)
const char*
icaltimezone_get_tznames (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
@ -1174,7 +1204,7 @@ icaltimezone_get_tznames (icaltimezone *zone)
/** Returns the latitude of a builtin timezone. */
double
icaltimezone_get_latitude (icaltimezone *zone)
icaltimezone_get_latitude (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return 0. */
if (!zone)
@ -1188,7 +1218,7 @@ icaltimezone_get_latitude (icaltimezone *zone)
/** Returns the longitude of a builtin timezone. */
double
icaltimezone_get_longitude (icaltimezone *zone)
icaltimezone_get_longitude (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return 0. */
if (!zone)
@ -1202,7 +1232,7 @@ icaltimezone_get_longitude (icaltimezone *zone)
/** Returns the VTIMEZONE component of a timezone. */
icalcomponent*
icaltimezone_get_component (icaltimezone *zone)
icaltimezone_get_component (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
@ -1219,7 +1249,7 @@ icaltimezone_get_component (icaltimezone *zone)
tzid, location & tzname fields. It returns 1 on success or 0 on
failure, i.e. no TZID was found. */
int
icaltimezone_set_component (icaltimezone *zone,
icaltimezone_set_component (icaltimezone *zone,
icalcomponent *comp)
{
icaltimezone_reset (zone);
@ -1227,6 +1257,43 @@ icaltimezone_set_component (icaltimezone *zone,
}
/* Returns the timezone name to display to the user. We prefer to use the
Olson city name, but fall back on the TZNAME, or finally the TZID. We don't
want to use "" as it may be wrongly interpreted as a floating time.
Do not free the returned string. */
const char*
icaltimezone_get_display_name (icaltimezone *zone)
{
const char *display_name;
display_name = icaltimezone_get_location (zone);
if (!display_name)
display_name = icaltimezone_get_tznames (zone);
if (!display_name) {
display_name = icaltimezone_get_tzid (zone);
/* Outlook will strip out X-LIC-LOCATION property and so all
we get back in the iTIP replies is the TZID. So we see if
this is one of our TZIDs and if so we jump to the city name
at the end of it. */
if (display_name
&& !strncmp (display_name, TZID_PREFIX, TZID_PREFIX_LEN)) {
/* Get the location, which is after the 3rd '/' char. */
const char *p;
int num_slashes = 0;
for (p = display_name; *p; p++) {
if (*p == '/') {
num_slashes++;
if (num_slashes == 3)
return p + 1;
}
}
}
}
return display_name;
}
icalarray*
icaltimezone_array_new (void)
{
@ -1254,7 +1321,7 @@ icaltimezone_array_free (icalarray *timezones)
if ( timezones )
{
for (i = 0; i < timezones->num_elements; i++) {
for (i = 0; (unsigned int)i < timezones->num_elements; i++) {
zone = icalarray_element_at (timezones, i);
icaltimezone_free (zone, 0);
}
@ -1295,8 +1362,8 @@ icaltimezone*
icaltimezone_get_builtin_timezone (const char *location)
{
icaltimezone *zone;
int lower, upper, middle, cmp;
char *zone_location;
int lower;
const char *zone_location;
if (!location || !location[0])
return NULL;
@ -1306,7 +1373,8 @@ icaltimezone_get_builtin_timezone (const char *location)
if (!strcmp (location, "UTC"))
return &utc_timezone;
#if 0
/* Do a simple binary search. */
lower = middle = 0;
upper = builtin_timezones->num_elements;
@ -1323,10 +1391,88 @@ icaltimezone_get_builtin_timezone (const char *location)
else
lower = middle + 1;
}
#endif
/* The zones from the system are not stored in alphabetical order,
so we just do a sequential search */
for (lower = 0; lower < builtin_timezones->num_elements; lower++) {
zone = icalarray_element_at (builtin_timezones, lower);
zone_location = icaltimezone_get_location (zone);
if (strcmp (location, zone_location) == 0)
return zone;
}
return NULL;
}
static struct icaltimetype
tm_to_icaltimetype (struct tm *tm)
{
struct icaltimetype itt;
memset (&itt, 0, sizeof (struct icaltimetype));
itt.second = tm->tm_sec;
itt.minute = tm->tm_min;
itt.hour = tm->tm_hour;
itt.day = tm->tm_mday;
itt.month = tm->tm_mon + 1;
itt.year = tm->tm_year+ 1900;
itt.is_utc = 0;
itt.is_date = 0;
return itt;
}
static int
get_offset (icaltimezone *zone)
{
struct tm local;
struct icaltimetype tt;
int offset;
time_t now = time(NULL);
gmtime_r ((const time_t *) &now, &local);
tt = tm_to_icaltimetype (&local);
offset = icaltimezone_get_utc_offset(zone, &tt, NULL);
return offset;
}
/** Returns a single builtin timezone, given its offset from UTC */
icaltimezone*
icaltimezone_get_builtin_timezone_from_offset (int offset, const char *tzname)
{
icaltimezone *zone=NULL;
int count, i;
if (!builtin_timezones)
icaltimezone_init_builtin_timezones ();
if (offset==0)
return &utc_timezone;
if (!tzname)
return NULL;
count = builtin_timezones->num_elements;
for (i=0; i<count; i++) {
int z_offset;
zone = icalarray_element_at (builtin_timezones, i);
if (!zone->component)
icaltimezone_load_builtin_timezone (zone);
z_offset = get_offset(zone);
if (z_offset == offset && zone->tznames && !strcmp(tzname, zone->tznames))
return zone;
}
return NULL;
}
/** Returns a single builtin timezone, given its TZID. */
icaltimezone*
@ -1393,11 +1539,76 @@ static void
icaltimezone_init_builtin_timezones (void)
{
/* Initialize the special UTC timezone. */
utc_timezone.tzid = "UTC";
utc_timezone.tzid = (char *)"UTC";
icaltimezone_parse_zone_tab ();
}
static int
parse_coord (char *coord,
int len,
int *degrees,
int *minutes,
int *seconds)
{
if (len == 5)
sscanf (coord + 1, "%2d%2d", degrees, minutes);
else if (len == 6)
sscanf (coord + 1, "%3d%2d", degrees, minutes);
else if (len == 7)
sscanf (coord + 1, "%2d%2d%2d", degrees, minutes, seconds);
else if (len == 8)
sscanf (coord + 1, "%3d%2d%2d", degrees, minutes, seconds);
else {
fprintf (stderr, "Invalid coordinate: %s\n", coord);
return 1;
}
if (coord [0] == '-')
*degrees = -*degrees;
return 0;
}
static int
fetch_lat_long_from_string (const char *str, int *latitude_degrees, int *latitude_minutes, int *latitude_seconds,
int *longitude_degrees, int *longitude_minutes, int *longitude_seconds, char *location)
{
size_t len;
char *sptr, *lat, *lon, *loc, *temp;
/* We need to parse the latitude/longitude co-ordinates and location fields */
sptr = (char *) str;
while (*sptr != '\t')
sptr++;
temp = ++sptr;
while (*sptr != '\t')
sptr++;
len = sptr-temp;
lat = (char *) malloc (len + 1);
lat = strncpy (lat, temp, len);
lat [len] = '\0';
while (*sptr != '\t')
sptr++;
loc = ++sptr;
while (!isspace (*sptr))
sptr++;
len = sptr - loc;
location = strncpy (location, loc, len);
location [len] = '\0';
lon = lat + 1;
while (*lon != '+' && *lon != '-')
lon++;
if (parse_coord (lat, lon - lat, latitude_degrees, latitude_minutes, latitude_seconds) == 1 ||
parse_coord (lon, strlen (lon), longitude_degrees, longitude_minutes, longitude_seconds)
== 1)
return 1;
free (lat);
return 0;
}
/** This parses the zones.tab file containing the names and locations
of the builtin timezones. It creates the builtin_timezones array
@ -1414,8 +1625,8 @@ icaltimezone_parse_zone_tab (void)
char buf[1024]; /* Used to store each line of zones.tab as it is read. */
char location[1024]; /* Stores the city name when parsing buf. */
unsigned int filename_len;
int latitude_degrees, latitude_minutes, latitude_seconds;
int longitude_degrees, longitude_minutes, longitude_seconds;
int latitude_degrees = 0, latitude_minutes = 0, latitude_seconds = 0;
int longitude_degrees = 0, longitude_minutes = 0, longitude_seconds = 0;
icaltimezone zone;
icalerror_assert (builtin_timezones == NULL,
@ -1423,17 +1634,26 @@ icaltimezone_parse_zone_tab (void)
builtin_timezones = icalarray_new (sizeof (icaltimezone), 32);
#ifndef USE_BUILTIN_TZDATA
filename_len = strlen ((char *) icaltzutil_get_zone_directory()) + strlen (ZONES_TAB_SYSTEM_FILENAME)
+ 2;
#else
filename_len = strlen (get_zone_directory()) + strlen (ZONES_TAB_FILENAME)
+ 2;
#endif
filename = (char*) malloc (filename_len);
if (!filename) {
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return;
}
#ifndef USE_BUILTIN_TZDATA
snprintf (filename, filename_len, "%s/%s", icaltzutil_get_zone_directory (),
ZONES_TAB_SYSTEM_FILENAME);
#else
snprintf (filename, filename_len, "%s/%s", get_zone_directory(),
ZONES_TAB_FILENAME);
#endif
fp = fopen (filename, "r");
free (filename);
@ -1445,6 +1665,7 @@ icaltimezone_parse_zone_tab (void)
while (fgets (buf, sizeof(buf), fp)) {
if (*buf == '#') continue;
#ifdef USE_BUILTIN_TZDATA
/* The format of each line is: "latitude longitude location". */
if (sscanf (buf, "%4d%2d%2d %4d%2d%2d %s",
&latitude_degrees, &latitude_minutes,
@ -1455,6 +1676,15 @@ icaltimezone_parse_zone_tab (void)
fprintf (stderr, "Invalid timezone description line: %s\n", buf);
continue;
}
#else
if (fetch_lat_long_from_string (buf, &latitude_degrees, &latitude_minutes,
&latitude_seconds,
&longitude_degrees, &longitude_minutes, &longitude_seconds,
location)) {
fprintf (stderr, "Invalid timezone description line: %s\n", buf);
continue;
}
#endif
icaltimezone_init (&zone);
zone.location = strdup (location);
@ -1483,7 +1713,6 @@ icaltimezone_parse_zone_tab (void)
printf ("Found zone: %s %f %f\n",
location, zone.latitude, zone.longitude);
#endif
free (zone.location);
}
fclose (fp);
@ -1492,25 +1721,35 @@ icaltimezone_parse_zone_tab (void)
void
icaltimezone_release_zone_tab (void)
{
int i;
icalarray *mybuiltin_timezones = builtin_timezones;
if (builtin_timezones == NULL)
return;
builtin_timezones = NULL;
for (i = 0; i < mybuiltin_timezones->num_elements; i++)
free ( ((icaltimezone*)icalarray_element_at(mybuiltin_timezones, i))->location);
icalarray_free (mybuiltin_timezones);
}
/** Loads the builtin VTIMEZONE data for the given timezone. */
static void
icaltimezone_load_builtin_timezone (icaltimezone *zone)
icaltimezone_load_builtin_timezone (icaltimezone *zone)
{
char *filename;
unsigned int filename_len;
FILE *fp;
icalparser *parser;
icalcomponent *comp, *subcomp;
icalcomponent *subcomp;
/* If the location isn't set, it isn't a builtin timezone. */
if (!zone->location || !zone->location[0])
return;
#ifdef USE_BUILTIN_TZDATA
{
char *filename;
icalcomponent *comp;
unsigned int filename_len;
FILE *fp;
icalparser *parser;
filename_len = strlen (get_zone_directory()) + strlen (zone->location) + 6;
filename = (char*) malloc (filename_len);
@ -1541,11 +1780,13 @@ icaltimezone_load_builtin_timezone (icaltimezone *zone)
icalparser_free (parser);
fclose (fp);
/* Find the VTIMEZONE component inside the VCALENDAR. There should be 1. */
subcomp = icalcomponent_get_first_component (comp,
ICAL_VTIMEZONE_COMPONENT);
#else
subcomp = icaltzutil_fetch_timezone (zone->location);
#endif
if (!subcomp) {
icalerror_set_errno(ICAL_PARSE_ERROR);
return;
@ -1553,22 +1794,25 @@ icaltimezone_load_builtin_timezone (icaltimezone *zone)
icaltimezone_get_vtimezone_properties (zone, subcomp);
icalcomponent_remove_component(comp,subcomp);
icalcomponent_free(comp);
#ifdef USE_BUILTIN_TZDATA
icalcomponent_remove_component(comp,subcomp);
icalcomponent_free(comp);
}
#endif
}
#ifdef USE_BUILTIN_TZDATA
/** Callback used from icalparser_parse() */
static char *
icaltimezone_load_get_line_fn (char *s,
size_t size,
void *data)
{
return fgets (s, size, (FILE*) data);
return fgets (s, (int)size, (FILE*) data);
}
#endif
@ -1592,11 +1836,11 @@ icaltimezone_load_get_line_fn (char *s,
* to add to UTC to get local time.
*/
int
icaltimezone_dump_changes (icaltimezone *zone,
icaltimezone_dump_changes (icaltimezone *zone,
int max_year,
FILE *fp)
{
static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
icaltimezonechange *zone_change;
int change_num;
@ -1610,7 +1854,7 @@ icaltimezone_dump_changes (icaltimezone *zone,
#endif
change_num = 0;
for (change_num = 0; change_num < zone->changes->num_elements; change_num++) {
for (change_num = 0; (unsigned int)change_num < zone->changes->num_elements; change_num++) {
zone_change = icalarray_element_at (zone->changes, change_num);
if (zone_change->year > max_year)
@ -1638,7 +1882,7 @@ static void
format_utc_offset (int utc_offset,
char *buffer)
{
char *sign = "+";
const char *sign = "+";
int hours, minutes, seconds;
if (utc_offset < 0) {
@ -1665,9 +1909,98 @@ format_utc_offset (int utc_offset,
snprintf (buffer, sizeof(buffer), "%s%02i%02i%02i", sign, hours, minutes, seconds);
}
static char* get_zone_directory(void)
static const char* get_zone_directory(void)
{
#ifndef WIN32
return zone_files_directory == NULL ? ZONEINFO_DIRECTORY : zone_files_directory;
#else
wchar_t wbuffer[1000];
char buffer[1000], zoneinfodir[1000], dirname[1000];
int used_default;
static char *cache = NULL;
char *dirslash, *zislash;
struct stat st;
if (zone_files_directory)
return zone_files_directory;
if (cache)
return cache;
/* Get the filename of the application */
if (!GetModuleFileNameW (NULL, wbuffer, sizeof (wbuffer) / sizeof (wbuffer[0])))
return ZONEINFO_DIRECTORY;
/* Convert to system codepage */
if (!WideCharToMultiByte (CP_ACP, 0, wbuffer, -1, buffer, sizeof (buffer),
NULL, &used_default) ||
used_default) {
/* Failed, try 8.3 format */
if (!GetShortPathNameW (wbuffer, wbuffer,
sizeof (wbuffer) / sizeof (wbuffer[0])) ||
!WideCharToMultiByte (CP_ACP, 0, wbuffer, -1, buffer, sizeof (buffer),
NULL, &used_default) ||
used_default)
return ZONEINFO_DIRECTORY;
}
/* Look for the zoneinfo directory somewhere in the path where
* the app is installed. If the path to the app is
*
* C:\opt\evo-2.6\bin\evolution-2.6.exe
*
* and the compile-time ZONEINFO_DIRECTORY is
*
* C:/devel/target/evo/share/evolution-data-server-1.6/zoneinfo,
*
* we check the pathnames:
*
* C:\opt\evo-2.6/devel/target/evo/share/evolution-data-server-1.6/zoneinfo
* C:\opt\evo-2.6/target/evo/share/evolution-data-server-1.6/zoneinfo
* C:\opt\evo-2.6/evo/share/evolution-data-server-1.6/zoneinfo
* C:\opt\evo-2.6/share/evolution-data-server-1.6/zoneinfo <===
* C:\opt\evo-2.6/evolution-data-server-1.6/zoneinfo
* C:\opt\evo-2.6/zoneinfo
* C:\opt/devel/target/evo/share/evolution-data-server-1.6/zoneinfo
* C:\opt/target/evo/share/evolution-data-server-1.6/zoneinfo
* C:\opt/evo/share/evolution-data-server-1.6/zoneinfo
* C:\opt/share/evolution-data-server-1.6/zoneinfo
* C:\opt/evolution-data-server-1.6/zoneinfo
* C:\opt/zoneinfo
* C:/devel/target/evo/share/evolution-data-server-1.6/zoneinfo
* C:/target/evo/share/evolution-data-server-1.6/zoneinfo
* C:/evo/share/evolution-data-server-1.6/zoneinfo
* C:/share/evolution-data-server-1.6/zoneinfo
* C:/evolution-data-server-1.6/zoneinfo
* C:/zoneinfo
*
* In Evolution's case, we would get a match already at the
* fourth pathname check.
*/
/* Strip away basename of app .exe first */
dirslash = _mbsrchr (buffer, '\\');
if (dirslash)
*dirslash = '\0';
while ((dirslash = _mbsrchr (buffer, '\\'))) {
/* Strip one more directory from app .exe location */
*dirslash = '\0';
strcpy (zoneinfodir, ZONEINFO_DIRECTORY);
while ((zislash = _mbschr (zoneinfodir, '/'))) {
*zislash = '.';
strcpy (dirname, buffer);
strcat (dirname, "/");
strcat (dirname, zislash + 1);
if (stat (dirname, &st) == 0 &&
S_ISDIR (st.st_mode)) {
cache = strdup (dirname);
return cache;
}
}
}
return ZONEINFO_DIRECTORY;
#endif
}
void set_zone_directory(char *path)

Просмотреть файл

@ -4,7 +4,7 @@
CREATOR: Damon Chaplin 15 March 2001
$Id: icaltimezone.h,v 1.12 2007/12/01 11:14:00 dothebart Exp $
$Id: icaltimezone.h,v 1.14 2008-01-15 23:17:42 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2001, Damon Chaplin
@ -50,6 +50,7 @@ typedef struct _icaltimezone icaltimezone;
/** Creates a new icaltimezone. */
icaltimezone *icaltimezone_new (void);
icaltimezone *icaltimezone_copy (icaltimezone *originalzone);
/** Frees all memory used for the icaltimezone. Set free_struct to free the
icaltimezone struct as well. */
@ -70,6 +71,9 @@ icalarray* icaltimezone_get_builtin_timezones (void);
/** Returns a single builtin timezone, given its Olson city name. */
icaltimezone* icaltimezone_get_builtin_timezone (const char *location);
/** Returns a single builtin timezone, given its offset. */
icaltimezone* icaltimezone_get_builtin_timezone_from_offset (int offset, const char *tzname);
/** Returns a single builtin timezone, given its TZID. */
icaltimezone* icaltimezone_get_builtin_timezone_from_tzid (const char *tzid);
@ -77,39 +81,41 @@ icaltimezone* icaltimezone_get_builtin_timezone_from_tzid (const char *tzid);
icaltimezone* icaltimezone_get_utc_timezone (void);
/** Returns the TZID of a timezone. */
char* icaltimezone_get_tzid (icaltimezone *zone);
const char* icaltimezone_get_tzid (icaltimezone *zone);
/** Returns the city name of a timezone. */
char* icaltimezone_get_location (icaltimezone *zone);
const char* icaltimezone_get_location (icaltimezone *zone);
/** Returns the TZNAME properties used in the latest STANDARD and DAYLIGHT
components. If they are the same it will return just one, e.g. "LMT".
If they are different it will format them like "EST/EDT". Note that this
may also return NULL. */
char* icaltimezone_get_tznames (icaltimezone *zone);
const char* icaltimezone_get_tznames (icaltimezone *zone);
/** Returns the latitude of a builtin timezone. */
double icaltimezone_get_latitude (icaltimezone *zone);
double icaltimezone_get_latitude (icaltimezone *zone);
/** Returns the longitude of a builtin timezone. */
double icaltimezone_get_longitude (icaltimezone *zone);
double icaltimezone_get_longitude (icaltimezone *zone);
/** Returns the VTIMEZONE component of a timezone. */
icalcomponent* icaltimezone_get_component (icaltimezone *zone);
icalcomponent* icaltimezone_get_component (icaltimezone *zone);
/** Sets the VTIMEZONE component of an icaltimezone, initializing the tzid,
location & tzname fields. It returns 1 on success or 0 on failure, i.e.
no TZID was found. */
int icaltimezone_set_component (icaltimezone *zone,
int icaltimezone_set_component (icaltimezone *zone,
icalcomponent *comp);
const char* icaltimezone_get_display_name (icaltimezone *zone);
/**
* @par Converting times between timezones.
*/
void icaltimezone_convert_time (struct icaltimetype *tt,
icaltimezone *from_zone,
icaltimezone *to_zone);
icaltimezone *from_zone,
icaltimezone *to_zone);
/**
@ -120,15 +126,15 @@ void icaltimezone_convert_time (struct icaltimetype *tt,
timezone. It is the number of seconds to add to UTC to get local
time. The is_daylight flag is set to 1 if the time is in
daylight-savings time. */
int icaltimezone_get_utc_offset (icaltimezone *zone,
struct icaltimetype *tt,
int *is_daylight);
int icaltimezone_get_utc_offset (icaltimezone *zone,
struct icaltimetype *tt,
int *is_daylight);
/** Calculates the UTC offset of a given UTC time in the given
timezone. It is the number of seconds to add to UTC to get local
time. The is_daylight flag is set to 1 if the time is in
daylight-savings time. */
int icaltimezone_get_utc_offset_of_utc_time (icaltimezone *zone,
int icaltimezone_get_utc_offset_of_utc_time (icaltimezone *zone,
struct icaltimetype *tt,
int *is_daylight);
@ -161,7 +167,7 @@ void icaltimezone_release_zone_tab(void);
/** Dumps information about changes in the timezone up to and including
max_year. */
int icaltimezone_dump_changes (icaltimezone *zone,
int icaltimezone_dump_changes (icaltimezone *zone,
int max_year,
FILE *fp);

Просмотреть файл

@ -3,11 +3,12 @@
FILE: icaltypes.c
CREATOR: eric 16 May 1999
$Id: icaltypes.c,v 1.16 2007/04/30 13:57:48 artcancro Exp $
$Id: icaltypes.c,v 1.18 2008-01-15 23:17:42 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -77,7 +78,7 @@ struct icaltriggertype icaltriggertype_from_string(const char* str)
struct icaltriggertype tr, null_tr;
icalerrorstate es;
icalerrorstate es = ICAL_ERROR_DEFAULT;
icalerrorenum e;
tr.time= icaltime_null_time();
@ -85,10 +86,10 @@ struct icaltriggertype icaltriggertype_from_string(const char* str)
null_tr = tr;
if(str == 0) goto error;
/* Suppress errors so a failure in icaltime_from_string() does not cause an abort */
es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR);
if(str == 0) goto error;
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL);
e = icalerrno;
icalerror_set_errno(ICAL_NO_ERROR);
@ -165,10 +166,19 @@ struct icalreqstattype icalreqstattype_from_string(const char* str)
}
const char* icalreqstattype_as_string(struct icalreqstattype stat)
{
char *buf;
buf = icalreqstattype_as_string_r(stat);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char* icalreqstattype_as_string_r(struct icalreqstattype stat)
{
char *temp;
temp = (char*)icalmemory_tmp_buffer(TEMP_MAX);
temp = (char*)icalmemory_new_buffer(TEMP_MAX);
icalerror_check_arg_rz((stat.code != ICAL_UNKNOWN_STATUS),"Status");

Просмотреть файл

@ -4,7 +4,8 @@
CREATOR: eric 20 March 1999
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -77,6 +78,7 @@ struct icalreqstattype {
struct icalreqstattype icalreqstattype_from_string(const char* str);
const char* icalreqstattype_as_string(struct icalreqstattype);
char* icalreqstattype_as_string_r(struct icalreqstattype);

Просмотреть файл

@ -4,10 +4,11 @@
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalvalue.c,v 1.42 2007/05/25 02:57:04 artcancro Exp $
$Id: icalvalue.c,v 1.44 2008-01-15 23:17:43 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -23,7 +24,7 @@
The original code is icalvalue.c
Contributions from:
Graham Davison (g.m.davison@computer.org)
Graham Davison <g.m.davison@computer.org>
======================================================================*/
@ -46,6 +47,7 @@
#include <time.h> /* for mktime */
#include <stdlib.h> /* for atoi and atof */
#include <limits.h> /* for SHRT_MAX */
#include <locale.h>
#include <ctype.h> /* for isspace and isdigit */
#ifdef WIN32
@ -287,6 +289,75 @@ icalvalue* icalvalue_new_enum(icalvalue_kind kind, int x_type, const char* str)
return value;
}
/**
* Transforms a simple float number string into a double.
* The decimal separator (if any) of the double has to be '.'
* The code is locale *independant* and does *not* change the locale.
* It should be thread safe.
* If you want a code that that does the same job with a decimal separator
* dependant on the current locale, then use strtof() from libc.
*/
int simple_str_to_float(const char* from,
float *result,
char** to)
{
#define TMP_NUM_SIZE 100
char *start=NULL, *end=NULL, *cur=(char*)from ;
char tmp_buf[TMP_NUM_SIZE+1] ; /*hack*/
struct lconv *loc_data = localeconv () ;
int i=0 ;
/*sanity checks*/
if (!from || !result) {
return 1 ;
}
/*skip the white spaces at the beginning*/
while (cur && isspace (*cur))
cur++ ;
start = cur ;
/*
* copy the part that looks like a double into tmp_buf
* so that we can call strtof() on it.
* during the copy, we give ourselves a chance to convert the '.'
* into the decimal separator of the current locale.
*/
while (cur && (isdigit (*cur) ||
*cur == '.' ||
*cur == '+' ||
*cur == '-')){
++cur ;
}
end = cur ;
if (end - start + 1> 100) {
/*huh hoh, number is too big. getting out*/
return 1 ;
}
memset(tmp_buf, 0, TMP_NUM_SIZE+1) ;
i=0 ;
/*
* copy the float number string into tmp_buf, and take
* care to have the (optional) decimal separator be the one
* of the current locale.
*/
for (i=0 ; i < end - from ;++i) {
if (start[i] == '.'
&& loc_data
&& loc_data->decimal_point
&& loc_data->decimal_point[0]
&& loc_data->decimal_point[0] != '.') {
/*replace '.' by the digit separator of the current locale*/
tmp_buf[i] = loc_data->decimal_point[0] ;
} else {
tmp_buf[i] = start[i] ;
}
}
if (to)
*to = end ;
*result = atof(tmp_buf) ;
return 0 ;
}
icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char* str,icalproperty** error)
{
@ -315,6 +386,15 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
}
case ICAL_BINARY_VALUE:
{
icalattach *attach;
attach = icalattach_new_from_data ((unsigned char*)str, 0, 0);
if ( !attach )
break;
value = icalvalue_new_attach (attach);
icalattach_unref (attach);
break;
}
case ICAL_BOOLEAN_VALUE:
{
/* HACK */
@ -354,7 +434,15 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
case ICAL_CLASS_VALUE:
value = icalvalue_new_enum(kind, (int)ICAL_CLASS_X,str);
break;
case ICAL_CMD_VALUE:
value = icalvalue_new_enum(kind, ICAL_CMD_X,str);
break;
case ICAL_QUERYLEVEL_VALUE:
value = icalvalue_new_enum(kind, ICAL_QUERYLEVEL_X,str);
break;
case ICAL_CARLEVEL_VALUE:
value = icalvalue_new_enum(kind, ICAL_CARLEVEL_X,str);
break;
case ICAL_INTEGER_VALUE:
value = icalvalue_new_integer(atoi(str));
@ -403,21 +491,51 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
break;
case ICAL_GEO_VALUE:
value = 0;
/* HACK */
if (error != 0){
char temp[TMP_BUF_SIZE];
strcpy(temp,"GEO Values are not implemented");
*error = icalproperty_vanew_xlicerror(
temp,
icalparameter_new_xlicerrortype(
ICAL_XLICERRORTYPE_VALUEPARSEERROR),
0);
}
{
char *cur=NULL ;
struct icalgeotype geo = {0.0, 0.0};
if (simple_str_to_float (str, &geo.lat, &cur)) {
goto geo_parsing_error ;
}
/*skip white spaces*/
while (cur && isspace (*cur)) {
++cur ;
}
/*icalerror_warn("Parsing GEO properties is unimplmeneted");*/
/*there is a ';' between the latitude and longitude parts*/
if (!cur || *cur != ';') {
goto geo_parsing_error ;
}
++cur ;
if (!cur)
goto geo_parsing_error ;
/*skip white spaces*/
while (cur && isspace (*cur)) {
++cur ;
}
if (simple_str_to_float (cur, &geo.lon, &cur)) {
goto geo_parsing_error ;
}
value = icalvalue_new_geo (geo) ;
break ;
geo_parsing_error:
if (error != 0){
char temp[TMP_BUF_SIZE];
sprintf(temp, "Could not parse %s as a %s property",
str, icalvalue_kind_to_string(kind));
*error = icalproperty_vanew_xlicerror(
temp,
icalparameter_new_xlicerrortype(
ICAL_XLICERRORTYPE_VALUEPARSEERROR),
0);
}
}
break;
case ICAL_RECUR_VALUE:
@ -629,7 +747,7 @@ icalvalue_is_valid (const icalvalue* value)
return 1;
}
static char* icalvalue_binary_as_ical_string(const icalvalue* value) {
static char* icalvalue_binary_as_ical_string_r(const icalvalue* value) {
const char* data;
char* str;
@ -637,8 +755,8 @@ static char* icalvalue_binary_as_ical_string(const icalvalue* value) {
data = icalvalue_get_binary(value);
str = (char*)icalmemory_tmp_buffer(60);
strcpy(str,"icalvalue_binary_as_ical_string is not implemented yet");
str = (char*)icalmemory_new_buffer(60);
snprintf(str, 60,"icalvalue_binary_as_ical_string is not implemented yet");
return str;
}
@ -646,9 +764,9 @@ static char* icalvalue_binary_as_ical_string(const icalvalue* value) {
#define MAX_INT_DIGITS 12 /* Enough for 2^32 + sign*/
static char* icalvalue_int_as_ical_string(const icalvalue* value) {
static char* icalvalue_int_as_ical_string_r(const icalvalue* value) {
int data;
char* str = (char*)icalmemory_tmp_buffer(MAX_INT_DIGITS);
char* str = (char*)icalmemory_new_buffer(MAX_INT_DIGITS);
icalerror_check_arg_rz( (value!=0),"value");
@ -659,11 +777,12 @@ static char* icalvalue_int_as_ical_string(const icalvalue* value) {
return str;
}
static char* icalvalue_utcoffset_as_ical_string(const icalvalue* value)
static char* icalvalue_utcoffset_as_ical_string_r(const icalvalue* value)
{
int data,h,m,s;
char sign;
char* str = (char*)icalmemory_tmp_buffer(9);
char* str = (char*)icalmemory_new_buffer(9);
icalerror_check_arg_rz( (value!=0),"value");
@ -687,14 +806,14 @@ static char* icalvalue_utcoffset_as_ical_string(const icalvalue* value)
return str;
}
static char* icalvalue_string_as_ical_string(const icalvalue* value) {
static char* icalvalue_string_as_ical_string_r(const icalvalue* value) {
const char* data;
char* str = 0;
icalerror_check_arg_rz( (value!=0),"value");
data = value->data.v_string;
str = (char*)icalmemory_tmp_buffer(strlen(data)+1);
str = (char*)icalmemory_new_buffer(strlen(data)+1);
strcpy(str,data);
@ -702,11 +821,10 @@ static char* icalvalue_string_as_ical_string(const icalvalue* value) {
}
static char* icalvalue_recur_as_ical_string(const icalvalue* value)
static char* icalvalue_recur_as_ical_string_r(const icalvalue* value)
{
struct icalrecurrencetype *recur = value->data.v_recur;
return icalrecurrencetype_as_string(recur);
return icalrecurrencetype_as_string_r(recur);
}
/* @todo This is not RFC2445 compliant.
@ -715,10 +833,9 @@ static char* icalvalue_recur_as_ical_string(const icalvalue* value)
* As such, \t\r\b\f are not allowed, not even escaped
*/
static char* icalvalue_text_as_ical_string(const icalvalue* value) {
static char* icalvalue_text_as_ical_string_r(const icalvalue* value) {
char *str;
char *str_p;
char *rtrn;
const char *p;
size_t buf_sz;
@ -776,17 +893,21 @@ static char* icalvalue_text_as_ical_string(const icalvalue* value) {
icalmemory_append_char(&str,&str_p,&buf_sz,'\0');
rtrn = icalmemory_tmp_copy(str);
icalmemory_free_buffer(str);
return rtrn;
return str;
}
static char* icalvalue_text_as_ical_string(const icalvalue* value) {
char *buf;
buf = icalvalue_text_as_ical_string_r(value);
icalmemory_add_tmp_buffer(buf);
return buf;
}
static char*
icalvalue_attach_as_ical_string(const icalvalue* value)
icalvalue_attach_as_ical_string_r(const icalvalue* value)
{
icalattach *a;
char * str;
@ -799,24 +920,31 @@ icalvalue_attach_as_ical_string(const icalvalue* value)
const char *url;
url = icalattach_get_url (a);
str = icalmemory_tmp_buffer (strlen (url) + 1);
str = icalmemory_new_buffer (strlen (url) + 1);
strcpy (str, url);
return str;
} else
return icalvalue_binary_as_ical_string (value);
} else {
const char *data = 0;
data = (const char*)icalattach_get_data(a);
str = icalmemory_new_buffer (strlen (data) + 1);
strcpy (str, data);
return str;
}
}
static char* icalvalue_duration_as_ical_string(const icalvalue* value) {
static char* icalvalue_duration_as_ical_string_r(const icalvalue* value) {
struct icaldurationtype data;
icalerror_check_arg_rz( (value!=0),"value");
data = icalvalue_get_duration(value);
return icaldurationtype_as_ical_string(data);
return icaldurationtype_as_ical_string_r(data);
}
void print_time_to_string(char* str, const struct icaltimetype *data)
{
char temp[20];
@ -840,14 +968,14 @@ void print_date_to_string(char* str, const struct icaltimetype *data)
strcat(str,temp);
}
static char* icalvalue_date_as_ical_string(const icalvalue* value) {
static char* icalvalue_date_as_ical_string_r(const icalvalue* value) {
struct icaltimetype data;
char* str;
icalerror_check_arg_rz( (value!=0),"value");
data = icalvalue_get_date(value);
str = (char*)icalmemory_tmp_buffer(9);
str = (char*)icalmemory_new_buffer(9);
str[0] = 0;
print_date_to_string(str,&data);
@ -864,7 +992,8 @@ void print_datetime_to_string(char* str, const struct icaltimetype *data)
}
}
static const char* icalvalue_datetime_as_ical_string(const icalvalue* value) {
static char* icalvalue_datetime_as_ical_string_r(const icalvalue* value) {
struct icaltimetype data;
char* str;
@ -881,7 +1010,7 @@ static const char* icalvalue_datetime_as_ical_string(const icalvalue* value) {
data = icalvalue_get_datetime(value);
str = (char*)icalmemory_tmp_buffer(20);
str = (char*)icalmemory_new_buffer(20);
str[0] = 0;
@ -891,21 +1020,22 @@ static const char* icalvalue_datetime_as_ical_string(const icalvalue* value) {
}
static char* icalvalue_float_as_ical_string(const icalvalue* value) {
static char* icalvalue_float_as_ical_string_r(const icalvalue* value) {
float data;
char* str;
icalerror_check_arg_rz( (value!=0),"value");
data = icalvalue_get_float(value);
str = (char*)icalmemory_tmp_buffer(40);
str = (char*)icalmemory_new_buffer(40);
snprintf(str,40,"%f",data);
return str;
}
static char* icalvalue_geo_as_ical_string(const icalvalue* value) {
static char* icalvalue_geo_as_ical_string_r(const icalvalue* value) {
struct icalgeotype data;
char* str;
@ -913,35 +1043,38 @@ static char* icalvalue_geo_as_ical_string(const icalvalue* value) {
data = icalvalue_get_geo(value);
str = (char*)icalmemory_tmp_buffer(80);
str = (char*)icalmemory_new_buffer(80);
snprintf(str,80,"%f;%f",data.lat,data.lon);
return str;
}
static const char* icalvalue_datetimeperiod_as_ical_string(const icalvalue* value) {
static char* icalvalue_datetimeperiod_as_ical_string_r(const icalvalue* value) {
struct icaldatetimeperiodtype dtp = icalvalue_get_datetimeperiod(value);
icalerror_check_arg_rz( (value!=0),"value");
if(!icaltime_is_null_time(dtp.time)){
return icaltime_as_ical_string(dtp.time);
return icaltime_as_ical_string_r(dtp.time);
} else {
return icalperiodtype_as_ical_string(dtp.period);
return icalperiodtype_as_ical_string_r(dtp.period);
}
}
static const char* icalvalue_period_as_ical_string(const icalvalue* value) {
static char* icalvalue_period_as_ical_string_r(const icalvalue* value) {
struct icalperiodtype data;
icalerror_check_arg_rz( (value!=0),"value");
data = icalvalue_get_period(value);
return icalperiodtype_as_ical_string(data);
return icalperiodtype_as_ical_string_r(data);
}
static const char* icalvalue_trigger_as_ical_string(const icalvalue* value) {
static char* icalvalue_trigger_as_ical_string_r(const icalvalue* value) {
struct icaltriggertype data;
@ -949,15 +1082,25 @@ static const char* icalvalue_trigger_as_ical_string(const icalvalue* value) {
data = icalvalue_get_trigger(value);
if(!icaltime_is_null_time(data.time)){
return icaltime_as_ical_string(data.time);
return icaltime_as_ical_string_r(data.time);
} else {
return icaldurationtype_as_ical_string(data.duration);
return icaldurationtype_as_ical_string_r(data.duration);
}
}
const char*
icalvalue_as_ical_string(const icalvalue* value)
{
char *buf;
buf = icalvalue_as_ical_string_r(value);
icalmemory_add_tmp_buffer(buf);
return buf;
}
char*
icalvalue_as_ical_string_r(const icalvalue* value)
{
if(value == 0){
return 0;
@ -966,70 +1109,73 @@ icalvalue_as_ical_string(const icalvalue* value)
switch (value->kind){
case ICAL_ATTACH_VALUE:
return icalvalue_attach_as_ical_string(value);
return icalvalue_attach_as_ical_string_r(value);
case ICAL_BINARY_VALUE:
return icalvalue_binary_as_ical_string(value);
return icalvalue_binary_as_ical_string_r(value);
case ICAL_BOOLEAN_VALUE:
case ICAL_INTEGER_VALUE:
return icalvalue_int_as_ical_string(value);
return icalvalue_int_as_ical_string_r(value);
case ICAL_UTCOFFSET_VALUE:
return icalvalue_utcoffset_as_ical_string(value);
return icalvalue_utcoffset_as_ical_string_r(value);
case ICAL_TEXT_VALUE:
return icalvalue_text_as_ical_string(value);
return icalvalue_text_as_ical_string_r(value);
case ICAL_QUERY_VALUE:
return icalvalue_string_as_ical_string(value);
return icalvalue_string_as_ical_string_r(value);
case ICAL_STRING_VALUE:
case ICAL_URI_VALUE:
case ICAL_CALADDRESS_VALUE:
return icalvalue_string_as_ical_string(value);
return icalvalue_string_as_ical_string_r(value);
case ICAL_DATE_VALUE:
return icalvalue_date_as_ical_string(value);
return icalvalue_date_as_ical_string_r(value);
case ICAL_DATETIME_VALUE:
return icalvalue_datetime_as_ical_string(value);
return icalvalue_datetime_as_ical_string_r(value);
case ICAL_DURATION_VALUE:
return icalvalue_duration_as_ical_string(value);
return icalvalue_duration_as_ical_string_r(value);
case ICAL_PERIOD_VALUE:
return icalvalue_period_as_ical_string(value);
return icalvalue_period_as_ical_string_r(value);
case ICAL_DATETIMEPERIOD_VALUE:
return icalvalue_datetimeperiod_as_ical_string(value);
return icalvalue_datetimeperiod_as_ical_string_r(value);
case ICAL_FLOAT_VALUE:
return icalvalue_float_as_ical_string(value);
return icalvalue_float_as_ical_string_r(value);
case ICAL_GEO_VALUE:
return icalvalue_geo_as_ical_string(value);
return icalvalue_geo_as_ical_string_r(value);
case ICAL_RECUR_VALUE:
return icalvalue_recur_as_ical_string(value);
return icalvalue_recur_as_ical_string_r(value);
case ICAL_TRIGGER_VALUE:
return icalvalue_trigger_as_ical_string(value);
return icalvalue_trigger_as_ical_string_r(value);
case ICAL_REQUESTSTATUS_VALUE:
return icalreqstattype_as_string(value->data.v_requeststatus);
return icalreqstattype_as_string_r(value->data.v_requeststatus);
case ICAL_ACTION_VALUE:
case ICAL_CMD_VALUE:
case ICAL_QUERYLEVEL_VALUE:
case ICAL_CARLEVEL_VALUE:
case ICAL_METHOD_VALUE:
case ICAL_STATUS_VALUE:
case ICAL_TRANSP_VALUE:
case ICAL_CLASS_VALUE:
if(value->x_value !=0){
return icalmemory_tmp_copy(value->x_value);
return icalmemory_strdup(value->x_value);
}
return icalproperty_enum_to_string(value->data.v_enum);
return icalproperty_enum_to_string_r(value->data.v_enum);
case ICAL_X_VALUE:
if (value->x_value != 0)
return icalmemory_tmp_copy(value->x_value);
return icalmemory_strdup(value->x_value);
/* FALLTHRU */
@ -1183,9 +1329,12 @@ icalvalue_compare(const icalvalue* a, const icalvalue *b)
case ICAL_RECUR_VALUE:
{
int r;
r = strcmp(icalvalue_as_ical_string(a),
icalvalue_as_ical_string(b));
char *temp1, *temp2;
temp1 = icalvalue_as_ical_string_r(a);
temp2 = icalvalue_as_ical_string_r(b);
r = strcmp(temp1, temp2);
free(temp1);
free(temp2);
if (r > 0) {
return ICAL_XLICCOMPARETYPE_GREATER;
@ -1291,22 +1440,63 @@ int icalvalue_encode_ical_string(const char *szText, char *szEncText, int nMaxBu
if (value == 0)
return 0;
ptr = icalvalue_text_as_ical_string(value);
ptr = icalvalue_text_as_ical_string_r(value);
if (ptr == 0)
return 0;
if ((int)strlen(ptr) >= nMaxBufferLen)
{
icalvalue_free (value);
free(ptr);
return 0;
}
strcpy(szEncText, ptr);
free(ptr);
icalvalue_free ((icalvalue*)value);
return 1;
}
int icalvalue_decode_ical_string(const char *szText, char *szDecText, int nMaxBufferLen)
{
char *str, *str_p;
const char *p;
size_t buf_sz;
if ((szText == 0) || (szDecText == 0))
return 0;
buf_sz = strlen(szText);
str_p = str = (char*)icalmemory_new_buffer(buf_sz + 1);
if (str_p == 0){
return 0;
}
for (p=szText; *p!=0; p++) {
if (*p == '\\') {
icalmemory_append_char (&str,&str_p,&buf_sz,*(p+1));
p++;
}
else
icalmemory_append_char (&str,&str_p,&buf_sz,*p);
}
icalmemory_append_char(&str,&str_p,&buf_sz,'\0');
if ((int)strlen(str) > nMaxBufferLen) {
icalmemory_free_buffer(str);
return 0;
}
strcpy(szDecText, str);
icalmemory_free_buffer(str);
return 1;
}
/* The remaining interfaces are 'new', 'set' and 'get' for each of the value
types */

Просмотреть файл

@ -4,10 +4,11 @@
CREATOR: eric 20 March 1999
$Id: icalvalue.h,v 1.8 2007/04/30 13:57:48 artcancro Exp $
$Id: icalvalue.h,v 1.10 2008-01-15 23:17:43 dothebart Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -51,6 +52,7 @@ void icalvalue_free(icalvalue* value);
int icalvalue_is_valid(const icalvalue* value);
const char* icalvalue_as_ical_string(const icalvalue* value);
char* icalvalue_as_ical_string_r(const icalvalue* value);
icalvalue_kind icalvalue_isa(const icalvalue* value);
@ -85,4 +87,7 @@ int icalvalue_kind_is_valid(const icalvalue_kind kind);
/** Encode a character string in ical format, esacpe certain characters, etc. */
int icalvalue_encode_ical_string(const char *szText, char *szEncText, int MaxBufferLen);
/** Extract the original character string encoded by the above function **/
int icalvalue_decode_ical_string(const char *szText, char *szDecText, int nMaxBufferLen);
#endif /*ICALVALUE_H*/

Просмотреть файл

@ -1,262 +0,0 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue_cxx.cpp
CREATOR: fnguyen 12/21/01
(C) COPYRIGHT 2001, Critical Path
======================================================================*/
#ifndef ICALVALUE_CXX_H
#include "icalvalue_cxx.h"
#endif
typedef char* string; // Will use the string library from STL
ICalValue::ICalValue() throw(icalerrorenum) : imp(icalvalue_new(ICAL_ANY_VALUE)){}
ICalValue::ICalValue(const ICalValue& v) throw (icalerrorenum) {
imp = icalvalue_new_clone(v.imp);
if (!imp) throw icalerrno;
}
ICalValue& ICalValue::operator=(const ICalValue& v) throw(icalerrorenum) {
if (this == &v) return *this;
if (imp != NULL)
{
icalvalue_free(imp);
imp = icalvalue_new_clone(v.imp);
if (!imp) throw icalerrno;
}
return *this;
}
ICalValue::~ICalValue(){
if (imp != NULL) icalvalue_free(imp);
}
ICalValue::ICalValue(icalvalue* v) throw(icalerrorenum) : imp(v){
}
ICalValue::ICalValue(icalvalue_kind kind) throw(icalerrorenum) {
imp = icalvalue_new(kind);
if (!imp) throw icalerrno;
}
ICalValue::ICalValue(icalvalue_kind kind, string str) throw(icalerrorenum) {
imp = icalvalue_new_from_string(kind, str);
if (!imp) throw icalerrno;
}
string ICalValue::as_ical_string(){
return (string)icalvalue_as_ical_string(imp);
}
bool ICalValue::is_valid(){
if (imp == NULL) return false;
return (icalvalue_is_valid(imp) ? true : false);
}
icalvalue_kind ICalValue::isa(){
return icalvalue_isa(imp);
}
int ICalValue::isa_value(void* value){
return icalvalue_isa_value(value);
}
/* Special, non autogenerated value accessors */
void ICalValue::set_recur(struct icalrecurrencetype v){
icalvalue_set_recur(imp, v);
}
struct icalrecurrencetype ICalValue::get_recur(){
return icalvalue_get_recur(imp);
}
void ICalValue::set_trigger(struct icaltriggertype v){}
struct icaltriggertype ICalValue::get_trigger(){
return icalvalue_get_trigger(imp);
}
void ICalValue::set_datetimeperiod(struct icaldatetimeperiodtype v){
icalvalue_set_datetimeperiod(imp, v);
}
struct icaldatetimeperiodtype ICalValue::get_datetimeperiod(){
return icalvalue_get_datetimeperiod(imp);
}
icalparameter_xliccomparetype ICalValue::compare(ICalValue& a, ICalValue& b){
return icalvalue_compare(a, b);
}
/* Convert enumerations */
icalvalue_kind ICalValue::string_to_kind(string str){
return icalvalue_string_to_kind(str);
}
string ICalValue::kind_to_string(icalvalue_kind kind){
return (string)icalvalue_kind_to_string(kind);
}
/* BOOLEAN */
int ICalValue::get_boolean(){
return icalvalue_get_boolean(imp);
}
void ICalValue::set_boolean(int v){
icalvalue_set_boolean(imp, v);
}
/* UTC-OFFSET */
int ICalValue::get_utcoffset(){
return icalvalue_get_utcoffset(imp);
}
void ICalValue::set_utcoffset(int v){
icalvalue_set_utcoffset(imp, v);
}
/* METHOD */
enum icalproperty_method ICalValue::get_method(){
return icalvalue_get_method(imp);
}
void ICalValue::set_method(enum icalproperty_method v){
icalvalue_set_method(imp, v);
}
/* CAL-ADDRESS */
string ICalValue::get_caladdress(){
return (string)icalvalue_get_caladdress(imp);
}
void ICalValue::set_caladdress(string v){
icalvalue_set_caladdress(imp, v);
}
/* PERIOD */
struct icalperiodtype ICalValue::get_period(){
return icalvalue_get_period(imp);
}
void ICalValue::set_period(struct icalperiodtype v){
icalvalue_set_period(imp, v);
}
/* STATUS */
enum icalproperty_status ICalValue::get_status(){
return icalvalue_get_status(imp);
}
void ICalValue::set_status(enum icalproperty_status v){
icalvalue_set_status(imp, v);
}
/* BINARY */
string ICalValue::get_binary(){
return (string)icalvalue_get_binary(imp);
}
void ICalValue::set_binary(string v){
icalvalue_set_binary(imp, v);
}
/* TEXT */
string ICalValue::get_text(){
return (string)icalvalue_get_text(imp);
}
void ICalValue::set_text(string v){
icalvalue_set_text(imp, v);
}
/* DURATION */
struct icaldurationtype ICalValue::get_duration(){
return icalvalue_get_duration(imp);
}
void ICalValue::set_duration(struct icaldurationtype v){
icalvalue_set_duration(imp, v);
}
/* INTEGER */
int ICalValue::get_integer(){
return icalvalue_get_integer(imp);
}
void ICalValue::set_integer(int v){
icalvalue_set_integer(imp, v);
}
/* URI */
string ICalValue::get_uri(){
return (string)icalvalue_get_uri(imp);
}
void ICalValue::set_uri(string v){
icalvalue_set_uri(imp, v);
}
/* ATTACH */
icalattach *ICalValue::get_attach(){
return icalvalue_get_attach(imp);
}
void ICalValue::set_attach(icalattach *v){
icalvalue_set_attach(imp, v);
}
/* CLASS */
enum icalproperty_class ICalValue::get_class(){
return icalvalue_get_class(imp);
}
void ICalValue::set_class(enum icalproperty_class v){
icalvalue_set_class(imp, v);
}
/* FLOAT */
float ICalValue::get_float(){
return icalvalue_get_float(imp);
}
void ICalValue::set_float(float v){
icalvalue_set_float(imp, v);
}
/* QUERY */
string ICalValue::get_query(){
return (string)icalvalue_get_query(imp);
}
void ICalValue::set_query(string v){
icalvalue_set_query(imp, v);
}
/* STRING */
string ICalValue::get_string(){
return (string)icalvalue_get_string(imp);
}
void ICalValue::set_string(string v){
icalvalue_set_string(imp, v);
}
/* TRANSP */
enum icalproperty_transp ICalValue::get_transp(){
return icalvalue_get_transp(imp);
}
void ICalValue::set_transp(enum icalproperty_transp v){
icalvalue_set_transp(imp, v);
}
/* DATE-TIME */
struct icaltimetype ICalValue::get_datetime(){
return icalvalue_get_datetime(imp);
}
void ICalValue::set_datetime(struct icaltimetype v){
icalvalue_set_datetime(imp, v);
}
/* GEO */
struct icalgeotype ICalValue::get_geo(){
return icalvalue_get_geo(imp);
}
void ICalValue::set_geo(struct icalgeotype v){
icalvalue_set_geo(imp, v);
}
/* DATE */
struct icaltimetype ICalValue::get_date(){
return icalvalue_get_date(imp);
}
void ICalValue::set_date(struct icaltimetype v){
icalvalue_set_date(imp, v);
}
/* ACTION */
enum icalproperty_action ICalValue::get_action(){
return icalvalue_get_action(imp);
}
void ICalValue::set_action(enum icalproperty_action v){
icalvalue_set_action(imp, v);
}

Просмотреть файл

@ -1,151 +0,0 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue_cxx.h
CREATOR: fnguyen 12/13/01
(C) COPYRIGHT 2001, Critical Path
======================================================================*/
#ifndef CP_ICALVALUE_H
#define CP_ICALVALUE_H
extern "C" {
#include "ical.h"
};
#include "icptrholder.h"
typedef char* string; // Will use the string library from STL
class ICalValue {
public:
ICalValue() throw(icalerrorenum);
ICalValue(const ICalValue&) throw(icalerrorenum);
ICalValue& operator=(const ICalValue&) throw(icalerrorenum);
~ICalValue();
ICalValue(icalvalue*) throw(icalerrorenum);
ICalValue(icalvalue_kind kind) throw(icalerrorenum);
ICalValue(icalvalue_kind kind, string str) throw(icalerrorenum);
operator icalvalue* () { return imp; }
void detach() {
imp = NULL;
}
public:
string as_ical_string();
bool is_valid();
icalvalue_kind isa();
int isa_value(void*);
/* Special, non autogenerated value accessors */
void set_recur(struct icalrecurrencetype v);
struct icalrecurrencetype get_recur();
void set_trigger(struct icaltriggertype v);
struct icaltriggertype get_trigger();
void set_datetimeperiod(struct icaldatetimeperiodtype v);
struct icaldatetimeperiodtype get_datetimeperiod();
public:
static icalparameter_xliccomparetype compare(ICalValue& a, ICalValue& b);
/* Convert enumerations */
static icalvalue_kind string_to_kind(string str);
string kind_to_string(icalvalue_kind kind);
public:
/* BOOLEAN */
int get_boolean();
void set_boolean(int v);
/* UTC-OFFSET */
int get_utcoffset();
void set_utcoffset(int v);
/* METHOD */
enum icalproperty_method get_method();
void set_method(enum icalproperty_method v);
/* CAL-ADDRESS */
string get_caladdress();
void set_caladdress(string v);
/* PERIOD */
struct icalperiodtype get_period();
void set_period(struct icalperiodtype v);
/* STATUS */
enum icalproperty_status get_status();
void set_status(enum icalproperty_status v);
/* BINARY */
string get_binary();
void set_binary(string v);
/* TEXT */
string get_text();
void set_text(string v);
/* DURATION */
struct icaldurationtype get_duration();
void set_duration(struct icaldurationtype v);
/* INTEGER */
int get_integer();
void set_integer(int v);
/* URI */
string get_uri();
void set_uri(string v);
/* ATTACH */
icalattach *get_attach();
void set_attach(icalattach *v);
/* CLASS */
enum icalproperty_class get_class();
void set_class(enum icalproperty_class v);
/* FLOAT */
float get_float();
void set_float(float v);
/* QUERY */
string get_query();
void set_query(string v);
/* STRING */
string get_string();
void set_string(string v);
/* TRANSP */
enum icalproperty_transp get_transp();
void set_transp(enum icalproperty_transp v);
/* DATE-TIME */
struct icaltimetype get_datetime();
void set_datetime(struct icaltimetype v);
/* GEO */
struct icalgeotype get_geo();
void set_geo(struct icalgeotype v);
/* DATE */
struct icaltimetype get_date();
void set_date(struct icaltimetype v);
/* ACTION */
enum icalproperty_action get_action();
void set_action(enum icalproperty_action v);
private:
icalvalue* imp;
};
typedef ICPointerHolder<ICalValue> ICalValueTmpPtr; /* see icptrholder.h for comments */
#endif /*ICALVALUE_H*/

Просмотреть файл

@ -3,10 +3,11 @@
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalvalueimpl.h,v 1.6 2007/04/30 13:57:48 artcancro Exp $
$Id: icalvalueimpl.h,v 1.7 2008-01-15 23:17:43 dothebart Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
(C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
@ -28,7 +29,7 @@
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "config.h"
#endif
#ifndef ICALVALUEIMPL_H

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше