Import of libical from upstream cvs on 20050105 -- approximately 0.24RC (not part of the build).

This commit is contained in:
mvl%exedo.nl 2005-01-05 20:09:32 +00:00
Коммит 8660fa72ff
581 изменённых файлов: 138003 добавлений и 0 удалений

4
calendar/libical/AUTHORS Normal file
Просмотреть файл

@ -0,0 +1,4 @@
John Gray <gray@agora-net.com>
Andrea Campi <a.campi@inet.it>
Original author May 1998-December 2001, Eric Busboom <eric@softwarestudio.org>

811
calendar/libical/ChangeLog Normal file
Просмотреть файл

@ -0,0 +1,811 @@
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.

33
calendar/libical/LICENSE Normal file
Просмотреть файл

@ -0,0 +1,33 @@
Libical is distributed under both the LGPL and the MPL. The MPL
notice, reproduced below, covers the use of either of the licenses.
----------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/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 Code is libical.
The Initial Developer of the Original Code is Eric Busboom
All Rights Reserved.
Contributor(s): See individual source files.
Alternatively, the contents of this file may be used under the terms
of the LGPL license, in which case the provisions of LGPL License are
applicable instead of those above. If you wish to allow use of your
version of this file only under the terms of the LGPL License and not
to allow others to use your version of this file under the MPL,
indicate your decision by deleting the provisions above and replace
them with the notice and other provisions required by the LGPL
License. If you do not delete the provisions above, a recipient may
use your version of this file under either the MPL or the LGPL
License."

522
calendar/libical/NEWS Normal file
Просмотреть файл

@ -0,0 +1,522 @@
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
--------------------

102
calendar/libical/README Normal file
Просмотреть файл

@ -0,0 +1,102 @@
LIBICAL -- An implementation of basic iCAL protocols
The code and datafiles in this distribution are licensed under the
Mozilla Public License. See http://www.mozilla.org/NPL/MPL-1.0.html
for a copy of the license. Alternately, you may use libical under the
terms of the GNU Library General Public License. See
http://www.fsf.org/copyleft/lesser.html for a copy of the LGPL.
This dual license ensures that the library can be incorporated into
both proprietary code and GPL'd programs, and will benefit from
improvements made by programmers in both realms. I will only accept
changes into my version of the library if they are similarly
dual-licensed.
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://softwarestudio.org/libical/index.html
and a mailing list that you can join by sending the following mail:
------------
To: minimalist@softwarestudio.org
Subject: subscribe libical
------------
Building the library
--------------------
This distribution is developed on Red Hat Linux 6.0 and usually
compiles on SunOS 5.6 and FreeBSD 2.27. I have reports of success of
previous version on MacOS ( with CodeWarrior ) and on UnixWare, but I
don't know about any other systems.
The library is configured with automake. 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.
Eric Busboom
eric@softwarestudio.org

69
calendar/libical/THANKS Normal file
Просмотреть файл

@ -0,0 +1,69 @@
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.

39
calendar/libical/TODO Normal file
Просмотреть файл

@ -0,0 +1,39 @@
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.

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

@ -0,0 +1,5 @@
Makefile
.deps
.libs
*.lo
*.la

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

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

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

@ -0,0 +1,242 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# 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@
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_alias = @build_alias@
build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
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@
CXX = @CXX@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAR = @JAR@
JAVA = @JAVA@
JAVAC = @JAVAC@
JAVAH = @JAVAH@
JAVA_PLATFORM = @JAVA_PLATFORM@
LEX = @LEX@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PTHREAD_LIBS = @PTHREAD_LIBS@
PY_CFLAGS = @PY_CFLAGS@
PY_EXTRA_LIBS = @PY_EXTRA_LIBS@
PY_LIBS = @PY_LIBS@
PY_LIB_LOC = @PY_LIB_LOC@
RANLIB = @RANLIB@
RRCAP_CFLAGS = @RRCAP_CFLAGS@
RRCAP_LIBS = @RRCAP_LIBS@
VERSION = @VERSION@
YACC = @YACC@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
python_val = @python_val@
EXTRA_DIST = \
properties.csv \
parameters.csv \
restrictions.csv \
status.txt \
value-types.csv
subdir = design-data
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = Makefile.am Makefile.in
all: all-am
.SUFFIXES:
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu design-data/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
uninstall-info-am:
tags: TAGS
TAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| 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)" \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
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
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-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
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
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 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 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:

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

@ -0,0 +1,22 @@
ANY
VAGENDA
VALARM
VCALENDAR
VCAR
VCOMMAND
VEVENT
VFREEBUSY
VJOURNAL
VQUERY
VSCHEDULE
VTIMEZONE
VTODO
X
XAUDIOALARM
XDAYLIGHTSAVINGSTIME
XDISPLAYALARM
XEMAILALARM
XLICINVALID
XMIMEPART
XPROCEDUREALARM
XSTANDARDTIME

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

@ -0,0 +1,33 @@
"#Name ","C Type","Enumeration Values"
"ALTREP","const char*",
"CN","const char*",
"CUTYPE","icalparameter_cutype","INDIVIDUAL;GROUP;RESOURCE;ROOM;UNKNOWN"
"DELEGATED-FROM","const char*",
"DELEGATED-TO","const char*",
"DIR","const char*",
"ENCODING","icalparameter_encoding","8BIT;BASE64"
"FBTYPE","icalparameter_fbtype","FREE;BUSY;BUSYUNAVAILABLE;BUSYTENTATIVE"
"FMTTYPE","const char*",
"LANGUAGE","const char*",
"MEMBER","const char*",
"PARTSTAT","icalparameter_partstat","NEEDS-ACTION;ACCEPTED;DECLINED;TENTATIVE;DELEGATED;COMPLETED;INPROCESS"
"RANGE","icalparameter_range","THISANDPRIOR;THISANDFUTURE"
"RELATED","icalparameter_related","START;END"
"RELTYPE","icalparameter_reltype","PARENT;CHILD;SIBLING"
"ROLE","icalparameter_role","CHAIR;REQ-PARTICIPANT;OPT-PARTICIPANT;NON-PARTICIPANT"
"RSVP","icalparameter_rsvp","TRUE;FALSE"
"SENT-BY","const char*",
"TZID","const char*",
"VALUE","icalparameter_value","BINARY;BOOLEAN;DATE;DURATION;FLOAT;INTEGER;PERIOD;RECUR;TEXT;URI;ERROR;DATE-TIME;UTC-OFFSET;CAL-ADDRESS"
"X","const char*",
"X-LIC-ERRORTYPE","icalparameter_xlicerrortype","COMPONENT-PARSE-ERROR;PROPERTY-PARSE-ERROR;PARAMETER-NAME-PARSE-ERROR;PARAMETER-VALUE-PARSE-ERROR;VALUE-PARSE-ERROR;INVALID-ITIP;UNKNOWN-VCAL-PROP-ERROR;MIME-PARSE-ERROR;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*",
Не удается отобразить этот файл, потому что он имеет неправильное количество полей в строке 26.

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

@ -0,0 +1,57 @@
ACTION VALUE X
ATTACH FMTTYPE ENCODING VALUE X
ATTENDEE CN CUTYPE DELEGATED-FROM DELEGATED-TO DIR LANGUAGE MEMBER PARTSTAT ROLE RSVP SENT-BY X
CALSCALE X
CATEGORIES LANGUAGE X
CLASS X
CMD ACTIONPARAM ID LATENCY LOCALIZE OPTIONS X
COMMENT ALTREP LANGUAGE X
COMPLETED X
CONTACT ALTREP LANGUAGE X
CREATED X
DESCRIPTION ALTREP LANGUAGE X
DTEND VALUE TZID X
DTSTAMP X
DTSTART VALUE TZID X
DUE VALUE TZID X
DURATION X
EXDATE VALUE TZID X
EXRULE X
FREEBUSY FBTYPE X
GEO X
LAST-MODIFIED X
LOCATION ALTREP LANGUAGE X
METHOD X
ORGANIZER CN DIR LANGUAGE SENT-BY X
PERCENT-COMPLETE X
PRIORITY X
PRODID X
RDATE VALUE TZID X
RECURRENCE-ID VALUE RANGE TZID X
RELATED-TO RELTYPE X
REPEAT X
REQUEST-STATUS LANGUAGE X
RESOURCES ALTREP LANGUAGE X
RRULE X
SEQUENCE LOCAL X
STATUS X
SUMMARY ALTREP LANGUAGE X
TRANSP X
TRIGGER ENABLE VALUE RELATED X
TZID X
TZNAME LANGUAGE X
TZOFFSETFROM X
TZOFFSETTO X
TZURL X
UID X
URL X
VERSION X
XPROP LANGUAGE X
X-LIC-ERROR XLICEERRORTYPE X
SCOPE X
MAXRESULTS X
MAXRESULTSSIZE X
QUERY X
QUERYNAME X
TARGET X
EXPAND X

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

@ -0,0 +1,108 @@
,,
"#Property Name","libical Value type","iCalendar default value"
"ACTION","ACTION","ACTION"
"ATTACH","ATTACH","URI"
"ATTENDEE","CAL-ADDRESS","CAL-ADDRESS"
"CALSCALE","TEXT","TEXT"
"CATEGORIES","TEXT","TEXT"
"CLASS","CLASS","CLASS"
"COMMENT","TEXT","TEXT"
"COMPLETED","DATE-TIME","DATE-TIME"
"CONTACT","TEXT","TEXT"
"CREATED","DATE-TIME","DATE-TIME"
"DESCRIPTION","TEXT","TEXT"
"DTEND","DATE-TIME","DATE-TIME"
"DTSTAMP","DATE-TIME","DATE-TIME"
"DTSTART","DATE-TIME","DATE-TIME"
"DUE","DATE-TIME","DATE-TIME"
"DURATION","DURATION","DURATION"
"EXDATE","DATE-TIME","DATE-TIME"
"EXRULE","RECUR","RECUR"
"FREEBUSY","PERIOD","PERIOD"
"GEO","GEO","GEO"
"LAST-MODIFIED","DATE-TIME","DATE-TIME"
"LOCATION","TEXT","TEXT"
"METHOD","METHOD","METHOD"
"ORGANIZER","CAL-ADDRESS","CAL-ADDRESS"
"PERCENT-COMPLETE","INTEGER","INTEGER"
"PRIORITY","INTEGER","INTEGER"
"PRODID","TEXT","TEXT"
"RDATE","DATE-TIME-PERIOD","DATE-TIME"
"RECURRENCE-ID","DATE-TIME","DATE-TIME"
"RELATED-TO","TEXT","TEXT"
"REPEAT","INTEGER","INTEGER"
"REQUEST-STATUS","REQUEST-STATUS","REQUEST-STATUS"
"RESOURCES","TEXT","TEXT"
"RRULE","RECUR","RECUR"
"SEQUENCE","INTEGER","INTEGER"
"STATUS","STATUS","STATUS"
"SUMMARY","TEXT","TEXT"
"TRANSP","TRANSP","TRANSP"
"TRIGGER","TRIGGER","DURATION"
"TZID","TEXT","TEXT"
"TZNAME","TEXT","TEXT"
"TZOFFSETFROM","UTC-OFFSET","UTC-OFFSET"
"TZOFFSETTO","UTC-OFFSET","UTC-OFFSET"
"TZURL","URI","URI"
"UID","TEXT","TEXT"
"URL","URI","URI"
"VERSION","TEXT","TEXT"
"X","X","X"
"MAXRESULTS","INTEGER","INTEGER"
"MAXRESULTSSIZE","INTEGER","INTEGER"
"QUERYNAME","TEXT","TEXT"
"X-LIC-ERROR","TEXT","TEXT"
"X-LIC-CLUSTERCOUNT","STRING","STRING"
"X-LIC-MIMECONTENTTYPE","STRING","STRING"
"X-LIC-MIMECHARSET","STRING","STRING"
"X-LIC-MIMEENCODING","STRING","STRING"
"X-LIC-MIMEOPTINFO","STRING","STRING"
"X-LIC-MIMECID","STRING","STRING"
"X-LIC-MIMEFILENAME","STRING","STRING"
"X-LIC-CLASS","X-LIC-CLASS","X-LIC-CLASS"
"ANY","NO","NO"
"NO","NO","NO"
"#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
2 #Property Name libical Value type iCalendar default value
3 ACTION ACTION ACTION
4 ATTACH ATTACH URI
5 ATTENDEE CAL-ADDRESS CAL-ADDRESS
6 CALSCALE TEXT TEXT
7 CATEGORIES TEXT TEXT
8 CLASS CLASS CLASS
9 COMMENT TEXT TEXT
10 COMPLETED DATE-TIME DATE-TIME
11 CONTACT TEXT TEXT
12 CREATED DATE-TIME DATE-TIME
13 DESCRIPTION TEXT TEXT
14 DTEND DATE-TIME DATE-TIME
15 DTSTAMP DATE-TIME DATE-TIME
16 DTSTART DATE-TIME DATE-TIME
17 DUE DATE-TIME DATE-TIME
18 DURATION DURATION DURATION
19 EXDATE DATE-TIME DATE-TIME
20 EXRULE RECUR RECUR
21 FREEBUSY PERIOD PERIOD
22 GEO GEO GEO
23 LAST-MODIFIED DATE-TIME DATE-TIME
24 LOCATION TEXT TEXT
25 METHOD METHOD METHOD
26 ORGANIZER CAL-ADDRESS CAL-ADDRESS
27 PERCENT-COMPLETE INTEGER INTEGER
28 PRIORITY INTEGER INTEGER
29 PRODID TEXT TEXT
30 RDATE DATE-TIME-PERIOD DATE-TIME
31 RECURRENCE-ID DATE-TIME DATE-TIME
32 RELATED-TO TEXT TEXT
33 REPEAT INTEGER INTEGER
34 REQUEST-STATUS REQUEST-STATUS REQUEST-STATUS
35 RESOURCES TEXT TEXT
36 RRULE RECUR RECUR
37 SEQUENCE INTEGER INTEGER
38 STATUS STATUS STATUS
39 SUMMARY TEXT TEXT
40 TRANSP TRANSP TRANSP
41 TRIGGER TRIGGER DURATION
42 TZID TEXT TEXT
43 TZNAME TEXT TEXT
44 TZOFFSETFROM UTC-OFFSET UTC-OFFSET
45 TZOFFSETTO UTC-OFFSET UTC-OFFSET
46 TZURL URI URI
47 UID TEXT TEXT
48 URL URI URI
49 VERSION TEXT TEXT
50 X X X
51 MAXRESULTS INTEGER INTEGER
52 MAXRESULTSSIZE INTEGER INTEGER
53 QUERYNAME TEXT TEXT
54 X-LIC-ERROR TEXT TEXT
55 X-LIC-CLUSTERCOUNT STRING STRING
56 X-LIC-MIMECONTENTTYPE STRING STRING
57 X-LIC-MIMECHARSET STRING STRING
58 X-LIC-MIMEENCODING STRING STRING
59 X-LIC-MIMEOPTINFO STRING STRING
60 X-LIC-MIMECID STRING STRING
61 X-LIC-MIMEFILENAME STRING STRING
62 X-LIC-CLASS X-LIC-CLASS X-LIC-CLASS
63 ANY NO NO
64 NO NO NO
65 #CAP Properties
66 FIXME Should be BOOLEAN
67 ALLOW-CONFLICT TEXT TEXT
68 CALID TEXT TEXT
69 CALMASTER TEXT TEXT
70 CARID TEXT TEXT
71 CMD CMD CMD
72 CSID URI URI
73 DECREED TEXT TEXT
74 DEFAULT-CHARSET TEXT TEXT
75 DEFAULT-LOCALE TEXT TEXT
76 DEFAULT-TZID TEXT TEXT
77 DEFAULT-VCARS TEXT TEXT
78 FIXME Should be UPN-FILTER
79 DENY TEXT TEXT
80 FIXME Should be BOOLEAN
81 EXPAND INTEGER INTEGER
82 FIXME Should be UPN-FILTER
83 GRANT TEXT TEXT
84 MAXDATE DATE-TIME DATE-TIME
85 MINDATE DATE-TIME DATE-TIME
86 NAME TEXT TEXT
87 OWNER TEXT TEXT
88 PERMISSION TEXT TEXT
89 QUERY QUERY QUERY
90 QUERYID TEXT TEXT
91 RELCALID TEXT TEXT
92 RESTRICTION QUERY QUERY
93 SCOPE TEXT TEXT
94 TARGET CAL-ADDRESS CAL-ADDRESS
95 #CAP Properties These are only allowed in VREPLY
96 CAP-VERSION TEXT TEXT
97 CAR-LEVEL CAR-LEVEL CAR-LEVEL
98 COMPONENTS TEXT TEXT
99 STORES-EXPANDED TEXT TEXT
100 DATE-MAX DATE-TIME DATE-TIME
101 DATE-MIN DATE-TIME DATE-TIME
102 ITIP-VERSION TEXT TEXT
103 MAX-COMPONENT-SIZE INTEGER INTEGER
104 MULTIPART TEXT TEXT
105 QUERY-LEVEL QUERY-LEVEL QUERY-LEVEL
106 RECUR-ACCEPTED TEXT TEXT
107 RECUR-EXPAND TEXT TEXT
108 RECUR-LIMIT TEXT TEXT

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

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

@ -0,0 +1,56 @@
2.0 STATOK Operation was successfully performed.
2.0.1 STARTSENDATA Start ICAL input; end with <CRLF>.<CRLF>
2.0.11 OKDATAFOLLOWS The request was processed successfully. Reply data follows on the next line and terminates with <CRLF>.<CRLF>
2.0.2 REPLYPENDING A timeout has occurred. The server is still working on the reply. Use CONTINUE to continue waiting for the reply or ABORT to terminate the command.
2.0.3 ABORTED The command currently underway was successsfully aborted.
2.0.4 WILLATTEMPT The specified Calendar is not here but an attempt will be made to deliver the request or reply to the Calendar anyway.
2.0.5 TRUSTEDWILLQUEUE The request or reply will be queued and delivered to the target calendar when its iRIP server contacts this server and issues the SWITCH command.
2.0.6 WILLATTEMPT The specified Calendar is not here but an attempt will be made to deliver the request or reply to the Calendar anyway.
2.0.7 QUEUED The message has been queued for delivery.
2.0.8 QUEUEEMPTY There are no more queued messages.
2.1 FALLBACK Success. Fallback taken on one or more property values.
2.2 NOCOMMANDINPROGRESS An ABORT or CONTINUE was received when no command was in progress
2.2 IGPROP Success. Invalid property ignored.
2.3 IGPARAM Success. invalid property parameter ignored.
2.4 IGXPROP Success. Unknown non-standard property ignored.
2.5 IGXPARAM Success. Unknown non standard property value ignored.
2.6 IGCOMP Success. Invalid calendar component ignored.
2.7 FORWARD Success. Request forwarded to Calendar User.
2.8 ONEEVENT Success. Repeating event ignored. Scheduled as a single component.
2.9 TRUNC Success. Truncated end date time to date boundary.
2.10 ONETODO Success. Repeating VTODO ignored. Scheduled as a single VTODO.
2.11 TRUNCRRULE Success. Unbounded RRULE clipped at some finite number of instances
3.0 INVPROPNAME Invalid property name.
3.1 INVPROPVAL Invalid property value.
3.2 INVPARAM Invalid property parameter.
3.3 INVPARAMVAL Invalid property parameter value.
3.4 INVCOMP Invalid calendar component sequence.
3.5 INVTIME Invalid date or time.
3.6 INVRULE Invalid rule.
3.7 INVCU Invalid Calendar User.
3.8 NOAUTH No authority.
3.9 BADVERSION Unsupported version.
3.10 TOOBIG Request entity too large.
3.11 MISSREQCOMP Required component or property missing.
3.12 UNKCOMP Unknown component or property found.
3.13 BADCOMP Unsupported component or property found
3.14 NOCAP Unsupported capability.
4.0 BUSY Event conflict. Date/time is busy.
5.0 MAYBE Request MAY supported.
5.1 UNAVAIL Service unavailable.
5.2 NOSERVICE Invalid calendar service.
5.3 NOSCHED No scheduling support for user.
6.1 AUTHENTICATEFAILURE Unsupported authentication mechanism, credentials rejected
6.2 AUTHENTICATIONABORTED Sender aborted authentication, authentication exchange cancelled
8.0 GENERALFAILURE A failure has occurred in the Receiver that prevents the operation from succeeding.
8.1 SERVERTOOBUSY The iRIP Receiver is too busy.
8.2 ICALOBJECTTOOBIG Object has exceeded the server's size limit.
8.3 DATETOOLARGE A DATETIME value was too far in the future to be represented on this Calendar.
8.4 DATETOOSMALL A DATETIME value was too far in the past to be represented on this Calendar.
9.0 INVALIDIRIPCOMMAND An unrecongnized command was received.
9.1 UNEXPECTEDCOMMAND The command is not allowed for the server's current state.
10.1 REFERRAL Accompanied by an alternate address.
10.2 SERVERSHUTDOWN The server is shutting down.
10.3 SERVERSTOPPING FLOOD 2
10.4 EXCEEDEDQUOTAS The operation would cause a resource to exceed the allocated quota
10.5 QUEUEDTOOLONG The ITIP message has been queued too long. Delivery has been aborted.

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

@ -0,0 +1,35 @@
"#Name","C type& gen flag","Python","Component Values","Enum Values"
"BINARY","(a)const char*","file","unitary",
"BOOLEAN","(a)int","integer","unitary",
"CAL-ADDRESS","(a)const char*","string","unitary",
"DATE","(a)struct icaltimetype","Time","unitary",
"DATE-TIME","(a)struct icaltimetype","Time","unitary",
"DURATION","(a)struct icaldurationtype","Duration","unitary",
"FLOAT","(a)float","float","unitary",
"INTEGER","(a)int","integer","unitary",
"PERIOD","(a)struct icalperiodtype","Period","unitary",
"RECUR","(m)struct icalrecurrencetype","RecurrenceSet","unitary",
"TEXT","(a)const char*","string","unitary",
"URI","(a)const char*","string","unitary",
"UTC-OFFSET","(a)int","integer","unitary",
"QUERY","(a)const char*","string","unitary",
"#Non-standard multi-valued types",,,,
"ATTACH","(m)icalattach *","none","URI;BINARY",
"DATE-TIME-PERIOD","(m)struct icaldatetimeperiodtype","none","DATE-TIME;PERIOD",
"TRIGGER","(m)struct icaltriggertype","string","DURATION;DATE-TIME",
"#Non-standard property enumeration types",,,,
"METHOD","(a)enum icalproperty_method","string","unitary","PUBLISH;REQUEST;REPLY;ADD;CANCEL;REFRESH;COUNTER;DECLINECOUNTER;CREATE;READ;RESPONSE;MOVE;MODIFY;GENERATEUID;DELETE"
"X-LIC-CLASS","(a)enum icalproperty_xlicclass","string","unitary","PUBLISH-NEW;PUBLISH-UPDATE;PUBLISH-FREEBUSY;REQUEST-NEW;REQUEST-UPDATE;REQUEST-RESCHEDULE;REQUEST-DELEGATE;REQUEST-NEW-ORGANIZER;REQUEST-FORWARD;REQUEST-STATUS;REQUEST-FREEBUSY;REPLY-ACCEPT;REPLY-DECLINE;REPLY-DELEGATE;REPLY-CRASHER-ACCEPT;REPLY-CRASHER-DECLINE;ADD-INSTANCE;CANCEL-EVENT;CANCEL-INSTANCE;CANCEL-ALL;REFRESH;COUNTER;DECLINECOUNTER;MALFORMED;OBSOLETE;MISSEQUENCED;UNKNOWN"
"ACTION","(a)enum icalproperty_action","string","unitary","AUDIO;DISPLAY;EMAIL;PROCEDURE"
"STATUS","(a)enum icalproperty_status","string","unitary","TENTATIVE;CONFIRMED;COMPLETED;NEEDS-ACTION;CANCELLED;IN-PROCESS;DRAFT;FINAL"
"TRANSP","(a)enum icalproperty_transp","string","unitary","OPAQUE;OPAQUE-NOCONFLICT;TRANSPARENT;TRANSPARENT-NOCONFLICT"
"CLASS","(a)enum icalproperty_class","string","unitary","PUBLIC;PRIVATE;CONFIDENTIAL"
"#Other non-standard",,,,
"REQUEST-STATUS","(a)struct icalreqstattype","string","unitary"
"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.

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

@ -0,0 +1,5 @@
Makefile
.deps
.libs
*.lo
*.la

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

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

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

@ -0,0 +1,245 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# 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@
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_alias = @build_alias@
build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
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@
CXX = @CXX@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAR = @JAR@
JAVA = @JAVA@
JAVAC = @JAVAC@
JAVAH = @JAVAH@
JAVA_PLATFORM = @JAVA_PLATFORM@
LEX = @LEX@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PTHREAD_LIBS = @PTHREAD_LIBS@
PY_CFLAGS = @PY_CFLAGS@
PY_EXTRA_LIBS = @PY_EXTRA_LIBS@
PY_LIBS = @PY_LIBS@
PY_LIB_LOC = @PY_LIB_LOC@
RANLIB = @RANLIB@
RRCAP_CFLAGS = @RRCAP_CFLAGS@
RRCAP_LIBS = @RRCAP_LIBS@
VERSION = @VERSION@
YACC = @YACC@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
python_val = @python_val@
EXTRA_DIST = \
mkderivedcomponents.pl \
mkderivedparameters.pl \
mkderivedproperties.pl \
mkderivedvalues.pl \
mkparameterrestrictions.pl \
mkrestrictionrecords.pl \
mkrestrictiontable.pl \
readvaluesfile.pl
subdir = scripts
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
DIST_COMMON = Makefile.am Makefile.in
all: all-am
.SUFFIXES:
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu scripts/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
uninstall-info-am:
tags: TAGS
TAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| 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)" \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
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
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-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
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
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 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 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:

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

@ -0,0 +1,170 @@
#!/usr/bin/env perl
use Getopt::Std;
getopts('chspi:');
# ARG 0 is components.txt
open(PV,"$ARGV[0]") || die "Can't open components file $ARGV[0]:$!";
my @components;
while (<PV>){
s/#.*//;
chop;
push(@components,$_);
}
close PV;
# Write the file inline by copying everything before a demarcation
# line, and putting the generated data after the demarcation
if ($opt_i) {
open(IN,$opt_i) || die "Can't open input file \"$opt_i\"";
while(<IN>){
if (/Do not edit/){
last;
}
print;
}
if($opt_i){
print "# Everything below this line is machine generated. Do not edit. \n";
} else {
print "/* Everything below this line is machine generated. Do not edit. */\n";
}
}
if ($opt_c or $opt_h and !$opt_i){
print <<EOM;
/* -*- Mode: C -*-
======================================================================
FILE: icalderivedproperties.{c,h}
CREATOR: eric 09 May 1999
\044Id:\044
(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.
======================================================================*/
/*
* THIS FILE IS MACHINE GENERATED DO NOT EDIT
*/
#include <stdarg.h> /* for va_arg functions */
EOM
}
if ($opt_p and !$opt_i){
print <<EOM;
EOM
}
foreach $comp (@components) {
next if !$comp;
my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$comp));
my $lc = lc($ucf);
my $uc = uc($lc);
if($opt_c) { # Make C source
print<<EOM;
/* $comp */
icalcomponent* icalcomponent_new_${lc}()
{
return (icalcomponent*)icalcomponent_new_impl(ICAL_${uc}_COMPONENT);
}
icalcomponent* icalcomponent_vanew_${lc}(...)
{
va_list args;
struct icalcomponent_impl *impl = icalcomponent_new_impl(ICAL_${uc}_component);
va_start(args,v);
icalcomponent_add_properties(impl, args);
va_end(args);
return (icalcomponent*)impl;
}
EOM
} elsif ($opt_h) { # Make a C header
print<<EOM;
/* $comp */
icalcomponent* icalcomponent_new_${lc}();
icalcomponent* icalcomponent_vanew_${lc}(...);
EOM
} elsif ($opt_s) { # Make something for a switch statement
print <<EOM;
case ICAL_${uc}_PROPERTY:
EOM
} elsif ($opt_p) { # make perl source
print <<EOM;
# $comp
package Net::ICal::Component::${ucf};
\@ISA=qw(Net::ICal::Component);
sub new
{
my \$package = shift;
my \$c = Net::ICal::icalcomponent_new(\$Net::ICal::ICAL_${uc}_COMPONENT);
my \$self = Net::ICal::Component::new_from_ref(\$c);
Net::ICal::Component::_add_elements(\$self,\\\@_);
# Self is blessed in new_from_ref
return \$self;
}
EOM
}
}

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

@ -0,0 +1,332 @@
#!/usr/bin/env perl
require "readvaluesfile.pl";
use Getopt::Std;
getopts('chspi:');
%no_xname = (RELATED=>1,RANGE=>1,RSVP=>1,XLICERRORTYPE=>1,XLICCOMPARETYPE=>1);
%params = read_parameters_file($ARGV[0]);
# Write the file inline by copying everything before a demarcation
# line, and putting the generated data after the demarcation
if ($opt_i) {
open(IN,$opt_i) || die "Can't open input file $opt_i";
while(<IN>){
if (/<insert_code_here>/){
insert_code();
} else {
print;
}
}
if($opt_p){
print "# Everything below this line is machine generated. Do not edit. \n";
} else {
print "/* Everything below this line is machine generated. Do not edit. */\n";
}
}
sub insert_code
{
# Write parameter enumerations and datatypes
if($opt_h){
print "typedef enum icalparameter_kind {\n ICAL_ANY_PARAMETER = 0,\n";
foreach $param (sort keys %params) {
next if !$param;
next if $param eq 'NO' or $param eq 'ANY';
my $uc = join("",map {uc($_);} split(/-/,$param));
my @enums = @{$params{$param}->{'enums'}};
print " ICAL_${uc}_PARAMETER, \n";
}
print " ICAL_NO_PARAMETER\n} icalparameter_kind;\n\n";
# Now create enumerations for parameter values
$idx = 20000;
print "#define ICALPARAMETER_FIRST_ENUM $idx\n\n";
foreach $param (sort keys %params) {
next if !$param;
next if $param eq 'NO' or $prop eq 'ANY';
my $type = $params{$param}->{"C"};
my $ucv = join("",map {uc(lc($_));} split(/-/,$param));
my @enums = @{$params{$param}->{'enums'}};
if(@enums){
print "typedef enum $type {\n";
my $first = 1;
unshift(@enums,"X");
push(@enums,"NONE");
foreach $e (@enums) {
if (!$first){
print ",\n";
} else {
$first = 0;
}
my $uce = join("",map {uc(lc($_));} split(/-/,$e));
print " ICAL_${ucv}_${uce} = $idx";
$idx++;
}
$c_type =~ s/enum //;
print "\n} $type;\n\n";
}
}
print "#define ICALPARAMETER_LAST_ENUM $idx\n\n";
}
if ($opt_c){
# Create the icalparameter_value to icalvalue_kind conversion table
my $count = 0;
my $out;
foreach $enum (@{$params{'VALUE'}->{'enums'}}){
next if $enum eq 'NO' or $enum eq 'ERROR';
$uc = join("",map {uc(lc($_));} split(/-/,$enum));
$out.=" {ICAL_VALUE_${uc},ICAL_${uc}_VALUE},\n";
$count++;
}
$count+=2;
print "static struct icalparameter_value_kind_map value_kind_map[$count] = {\n";
print $out;
print " {ICAL_VALUE_X,ICAL_X_VALUE},\n";
print " {ICAL_VALUE_NONE,ICAL_NO_VALUE}\n};\n\n";
#Create the parameter Name map
$out="";
$count=0;
foreach $param (sort keys %params) {
next if !$param;
next if $param eq 'NO' or $prop eq 'ANY';
my $lc = join("",map {lc($_);} split(/-/,$param));
my $uc = join("",map {uc(lc($_));} split(/-/,$param));
$count++;
$out.=" {ICAL_${uc}_PARAMETER,\"$param\"},\n";
}
$count+=1;
print "static struct icalparameter_kind_map parameter_map[$count] = { \n";
print $out;
print " { ICAL_NO_PARAMETER, \"\"}\n};\n\n";
# Create the parameter value map
$out ="";
$count=0;
foreach $param (sort keys %params) {
next if !$param;
next if $param eq 'NO' or $prop eq 'ANY';
my $type = $params{$param}->{"C"};
my $uc = join("",map {uc(lc($_));} split(/-/,$param));
my @enums = @{$params{$param}->{'enums'}};
if(@enums){
foreach $e (@enums){
my $uce = join("",map {uc(lc($_));} split(/-/,$e));
$count++;
$out.=" {ICAL_${uc}_PARAMETER,ICAL_${uc}_${uce},\"$e\"},\n";
}
}
}
$count+=3;
print "static struct icalparameter_map icalparameter_map[] = {\n";
print "{ICAL_ANY_PARAMETER,0,\"\"},\n";
print $out;
print " {ICAL_NO_PARAMETER,0,\"\"}};\n\n";
}
foreach $param (keys %params){
my $type = $params{$param}->{'C'};
my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$param));
my $lc = lc($ucf);
my $uc = uc($lc);
my $charorenum;
my $set_code;
my $pointer_check;
my $pointer_check_v;
my $xrange;
if ($type=~/char/ ) {
$charorenum = " icalerror_check_arg_rz( (param!=0), \"param\");\n return param->string;";
$set_code = "((struct icalparameter_impl*)param)->string = icalmemory_strdup(v);";
$pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");";
$pointer_check_v = "icalerror_check_arg_rv( (v!=0),\"v\");";
} else {
$xrange =" if (param->string != 0){\n return ICAL_${uc}_X;\n }\n" if !exists $no_xname{$uc};
$charorenum= "icalerror_check_arg( (param!=0), \"param\");\n$xrange\nreturn ($type)(param->data);";
$pointer_check = "icalerror_check_arg_rz(v >= ICAL_${uc}_X,\"v\");\n icalerror_check_arg_rz(v < ICAL_${uc}_NONE,\"v\");";
$pointer_check_v = "icalerror_check_arg_rv(v >= ICAL_${uc}_X,\"v\");\n icalerror_check_arg_rv(v < ICAL_${uc}_NONE,\"v\");";
$set_code = "((struct icalparameter_impl*)param)->data = (int)v;";
}
if ($opt_c) {
print <<EOM;
/* $param */
icalparameter* icalparameter_new_${lc}($type v)
{
struct icalparameter_impl *impl;
icalerror_clear_errno();
$pointer_check
impl = icalparameter_new_impl(ICAL_${uc}_PARAMETER);
if (impl == 0) {
return 0;
}
icalparameter_set_${lc}((icalparameter*) impl,v);
if (icalerrno != ICAL_NO_ERROR) {
icalparameter_free((icalparameter*) impl);
return 0;
}
return (icalparameter*) impl;
}
${type} icalparameter_get_${lc}(const icalparameter* param)
{
icalerror_clear_errno();
$charorenum
}
void icalparameter_set_${lc}(icalparameter* param, ${type} v)
{
$pointer_check_v
icalerror_check_arg_rv( (param!=0), "param");
icalerror_clear_errno();
$set_code
}
EOM
} elsif( $opt_h) {
print <<EOM;
/* $param */
icalparameter* icalparameter_new_${lc}($type v);
${type} icalparameter_get_${lc}(const icalparameter* value);
void icalparameter_set_${lc}(icalparameter* value, ${type} v);
EOM
}
if ($opt_p) {
print <<EOM;
# $param
package Net::ICal::Parameter::${ucf};
\@ISA=qw(Net::ICal::Parameter);
sub new
{
my \$self = [];
my \$package = shift;
my \$value = shift;
bless \$self, \$package;
my \$p;
if (\$value) {
\$p = Net::ICal::icalparameter_new_from_string(\$Net::ICal::ICAL_${uc}_PARAMETER,\$value);
} else {
\$p = Net::ICal::icalparameter_new(\$Net::ICal::ICAL_${uc}_PARAMETER);
}
\$self->[0] = \$p;
return \$self;
}
sub get
{
my \$self = shift;
my \$impl = \$self->_impl();
return Net::ICal::icalparameter_as_ical_string(\$impl);
}
sub set
{
# This is hard to implement, so I've punted for now.
die "Set is not implemented";
}
EOM
}
}
if ($opt_h){
print <<EOM;
#endif /*ICALPARAMETER_H*/
EOM
}
}

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

@ -0,0 +1,258 @@
#!/usr/bin/env perl
require "readvaluesfile.pl";
use Getopt::Std;
getopts('chspmi:');
# ARG 0 is properties.csv
%propmap = read_properties_file($ARGV[0]);
# ARG 1 is value-types.txt
%valuemap = read_values_file($ARGV[1]);
$include_vanew = 1;
# Write the file inline by copying everything before a demarcation
# line, and putting the generated data after the demarcation
if ($opt_i) {
open(IN,$opt_i) || die "Can't open input file $opt_i";
while(<IN>){
if (/<insert_code_here>/){
insert_code();
} else {
print;
}
}
}
sub fudge_data {
my $prop = shift;
my $value = $propmap{$prop}->{'lic_value'};
if (!$value){
die "Can't find value for property \"$prop\"\n";
}
my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$prop));
my $lc = lc($ucf);
my $uc = uc($lc);
my $ucfvalue = join("",map {ucfirst(lc($_));} split(/-/,$value));
my $lcvalue = lc($ucfvalue);
my $ucvalue = uc($lcvalue);
my $type = $valuemap{$value}->{C}->[1];
return ($uc,$lc,$lcvalue,$ucvalue,$type);
}
sub insert_code {
# Create the property map data
if($opt_c){
my @props = sort keys %propmap;
my $count = scalar(@props);
print "static struct icalproperty_map property_map[$count] = {\n";
foreach $prop (@props) {
next if !$prop;
next if $prop eq 'NO';
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
print "{ICAL_${uc}_PROPERTY,\"$prop\",ICAL_${ucvalue}_VALUE},\n";
}
$prop = "NO";
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
print "{ICAL_${uc}_PROPERTY,\"\",ICAL_NO_VALUE}};\n\n";
$idx = 10000;
$count = 1;
my $out = "";
foreach $value (sort keys %valuemap) {
next if !$value;
next if $value eq 'NO' or $prop eq 'ANY';
my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
my @enums = @{$valuemap{$value}->{'enums'}};
if(@enums){
my ($c_autogen,$c_type) = @{$valuemap{$value}->{'C'}};
unshift(@enums,"X");
push(@enums,"NONE");
foreach $e (@enums) {
my $uce = join("",map {uc(lc($_));} split(/-/,$e));
if($e ne "X" and $e ne "NONE"){
$str = $e;
} else {
$str = "";
}
$out.=" {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n";
$idx++;
$count++;
}
}
}
$count++;
print "static struct icalproperty_enum_map enum_map[$count] = {\n";
print $out;
print " {ICAL_NO_PROPERTY,0,\"\"}\n};\n\n";
}
if($opt_h){
# Create the property enumerations list
print "typedef enum icalproperty_kind {\n ICAL_ANY_PROPERTY = 0,\n";
foreach $prop (sort keys %propmap) {
next if !$prop;
next if $prop eq 'NO' or $prop eq 'ANY';
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
print " ICAL_${uc}_PROPERTY, \n";
}
print " ICAL_NO_PROPERTY\n} icalproperty_kind;\n\n";
}
foreach $prop (sort keys %propmap) {
next if !$prop;
next if $prop eq 'NO' or $prop eq 'ANY';
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
my $pointer_check;
if ($type =~ /\*/){
$pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");\n" if $type =~ /\*/;
} elsif ( $type eq "void" ){
$pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
}
my $set_pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
if($opt_c) { # Generate C source
if ($include_vanew) {
print<<EOM;
icalproperty* icalproperty_vanew_${lc}($type v, ...){
va_list args;
struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY); $pointer_check
icalproperty_set_${lc}((icalproperty*)impl,v);
va_start(args,v);
icalproperty_add_parameters(impl, args);
va_end(args);
return (icalproperty*)impl;
}
EOM
}
print<<EOM;
/* $prop */
icalproperty* icalproperty_new_${lc}($type v) {
struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY); $pointer_check
icalproperty_set_${lc}((icalproperty*)impl,v);
return (icalproperty*)impl;
}
EOM
# Allow DTSTART, DTEND, DUE, EXDATE and RECURRENCE-ID to take DATE values.
if ($lc eq "dtstart" || $lc eq "dtend" || $lc eq "due" || $lc eq "exdate"
|| $lc eq "recurrenceid") {
print<<EOM;
void icalproperty_set_${lc}(icalproperty* prop, $type v){
icalvalue *value;
$set_pointer_check
icalerror_check_arg_rv( (prop!=0),"prop");
if (v.is_date)
value = icalvalue_new_date(v);
else
value = icalvalue_new_datetime(v);
icalproperty_set_value(prop,value);
}
EOM
} else {
print<<EOM;
void icalproperty_set_${lc}(icalproperty* prop, $type v){
$set_pointer_check
icalerror_check_arg_rv( (prop!=0),"prop");
icalproperty_set_value(prop,icalvalue_new_${lcvalue}(v));
}
EOM
}
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
print "\
/* $prop */\
icalproperty* icalproperty_new_${lc}($type v);\
void icalproperty_set_${lc}(icalproperty* prop, $type v);\
$type icalproperty_get_${lc}(const icalproperty* prop);";
if ($include_vanew){
print "icalproperty* icalproperty_vanew_${lc}($type v, ...);\n";
}
}
} # This brace terminates the main loop
if ($opt_h){
print "\n\n#endif /*ICALPROPERTY_H*/\n"
}
}

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

@ -0,0 +1,236 @@
#!/usr/bin/perl
use lib '.';
require 'readvaluesfile.pl';
use Getopt::Std;
getopts('chi:');
#Options
# c -> generate c code file
# h-> generate header file
# Open with value-types.txt
my %h = read_values_file($ARGV[0]);
# Write the file inline by copying everything before a demarcation
# line, and putting the generated data after the demarcation
if ($opt_i) {
open(IN,$opt_i) || die "Can't open input file $opt_i";
while(<IN>){
if (/<insert_code_here>/){
insert_code();
} else {
print;
}
}
}
sub insert_code
{
# Map type names to the value in the icalvalue_impl data union */
%union_map = (
BOOLEAN => 'int',
CALADDRESS=>'string',
DATE=>'time',
DATETIME=>'time',
DATETIMEDATE=>'time',
DATETIMEPERIOD=>'period',
DURATION=>'duration',
INTEGER=>'int',
TEXT=>'string',
URI=>'string',
UTCOFFSET=>'int',
QUERY=>'string',
BINARY=>'string',
X=>'string'
);
if($opt_h){
# First print out the value enumerations
$idx = 5000;
print "typedef enum icalvalue_kind {\n";
print " ICAL_ANY_VALUE=$idx,\n";
foreach $value (keys %h) {
$idx++;
my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
next if $value eq "NO";
print " ICAL_${ucv}_VALUE=$idx,\n";
}
$idx++;
print " ICAL_NO_VALUE=$idx\n} icalvalue_kind ;\n\n";
# Now create enumerations for property values
$idx = 10000;
print "#define ICALPROPERTY_FIRST_ENUM $idx\n\n";
foreach $value (sort keys %h) {
next if !$value;
next if $value eq 'NO' or $prop eq 'ANY';
my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
my @enums = @{$h{$value}->{'enums'}};
if(@enums){
my ($c_autogen,$c_type) = @{$h{$value}->{'C'}};
print "typedef $c_type {\n";
my $first = 1;
unshift(@enums,"X");
push(@enums,"NONE");
foreach $e (@enums) {
if (!$first){
print ",\n";
} else {
$first = 0;
}
my $uce = join("",map {uc(lc($_));} split(/-/,$e));
print " ICAL_${ucv}_${uce} = $idx";
$idx++;
}
$c_type =~ s/enum //;
print "\n} $c_type;\n\n";
}
}
print "#define ICALPROPERTY_LAST_ENUM $idx\n\n";
}
if($opt_c){
# print out the value to string map
my $count = scalar(keys %h) + 1;
print "static struct icalvalue_kind_map value_map[$count]={\n";
foreach $value (keys %h) {
$idx++;
my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
next if $value eq "NO";
print " {ICAL_${ucv}_VALUE,\"$value\"},\n";
}
print " {ICAL_NO_VALUE,\"\"}\n};";
}
foreach $value (keys %h) {
my $autogen = $h{$value}->{C}->[0];
my $type = $h{$value}->{C}->[1];
my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$value));
my $lc = lc($ucf);
my $uc = uc($lc);
my $pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");\n" if $type =~ /\*/;
my $pointer_check_rv = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
my $assign;
if ($type =~ /char/){
$assign = "icalmemory_strdup(v);\n\n if (impl->data.v_string == 0){\n errno = ENOMEM;\n }\n";
} else {
$assign = "v;";
}
my $union_data;
if(@{$h{$value}->{'enums'}}){
$union_data = 'enum';
} elsif (exists $union_map{$uc} ){
$union_data=$union_map{$uc};
} else {
$union_data = $lc;
}
if ($opt_c && $autogen) {
print "\n\n\
icalvalue* icalvalue_new_${lc} ($type v){\
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_${uc}_VALUE);\
$pointer_check\
icalvalue_set_${lc}((icalvalue*)impl,v);\
return (icalvalue*)impl;\
}\
void icalvalue_set_${lc}(icalvalue* value, $type v) {\
struct icalvalue_impl* impl; \
icalerror_check_arg_rv( (value!=0),\"value\");\
$pointer_check_rv\
icalerror_check_value_type(value, ICAL_${uc}_VALUE);\
impl = (struct icalvalue_impl*)value;\n";
if( $union_data eq 'string') {
print " if(impl->data.v_${union_data}!=0) {free((void*)impl->data.v_${union_data});}\n";
}
print "\n\
impl->data.v_$union_data = $assign \n\
icalvalue_reset_kind(impl);\n}\n";
print "$type icalvalue_get_${lc}(const icalvalue* value) {\n";
if( $type =~ /^(int|const char\s?[*])$/) {
print " icalerror_check_arg_rz( (value!=0),\"value\");\n";
} 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";
} elsif($opt_h && $autogen) {
print "\n /* $value */ \
icalvalue* icalvalue_new_${lc}($type v); \
$type icalvalue_get_${lc}(const icalvalue* value); \
void icalvalue_set_${lc}(icalvalue* value, ${type} v);\n\n";
}
}
if ($opt_h){
print "#endif /*ICALVALUE_H*/\n";
}
}

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

@ -0,0 +1,39 @@
#!/bin/sh
#
# Given a list of headers, combine them into one, excluding certain lines
#
OUTFILE="/dev/stdout"
COMBINEDHEADERS=""
EXCLUDES=""
while [ $# -gt 0 ]
do
case $1 in
-o) OUTFILE=$2; shift;;
-e) EXCLUDES="$EXCLUDES $2"; shift;;
*) COMBINEDHEADERS="$COMBINEDHEADERS $1";
esac
shift
done
echo '#ifdef __cplusplus' > $OUTFILE
echo 'extern "C" {' >> $OUTFILE
echo '#endif' >> $OUTFILE
echo '/*' >> $OUTFILE
echo " \$Id\$" >> $OUTFILE
echo '*/' >> $OUTFILE
cat $COMBINEDHEADERS >> file.temp1
for exclude in $EXCLUDES
do
cp file.temp1 file.temp2
egrep -v "$exclude" file.temp2 > file.temp1
done
cat file.temp1 >> $OUTFILE
rm -f file.temp1
rm -f file.temp2
echo '#ifdef __cplusplus' >> $OUTFILE
echo '};' >> $OUTFILE
echo '#endif' >> $OUTFILE

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

@ -0,0 +1,99 @@
#!/usr/local/bin/perl
$pr = 1;
$ignore = 0;
print<<EOM;
/* -*- Mode: C -*-*/
/*======================================================================
FILE: ical.i
(C) COPYRIGHT 1999 Eric Busboom
http://www.softwarestudio.org
The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
The original author is Eric Busboom
Contributions from:
Graham Davison (g.m.davison\@computer.org)
======================================================================*/
%module Net__ICal
%{
#include "ical.h"
#include <sys/types.h> /* for size_t */
#include <time.h>
%}
EOM
foreach $f (@ARGV)
{
@f = split(/\//,$f);
$fn = pop(@f);
$fn=~/pvl/ && next;
$fn=~/sspm/ && next;
$fn=~/cstp/ && next;
$fn=~/csdb/ && next;
$fn=~/vcal/ && next;
$fn=~/yacc/ && next;
$fn=~/lex/ && next;
print "\n/**********************************************************************\n";
print "\t$fn\n";
print "**********************************************************************/\n\n";
open F, $f;
while(<F>){
s/^#.*//;
s/\/\*.*\*\///;
/^\/\// && next;
next if /^$/;
if(/\/\*/){ $pr = 0;}
/icalparser_parse\(/ and $ignore = 1;
/vanew/ and $ignore = 1;
/_stub/ and $ignore = 1;
/_response/ and $ignore = 1;
/line_gen_func/ and $ignore = 1;
/extern/ and $ignore = 1;
/sspm/ and $ignore = 1;
/icalrecur/ and $ignore = 1;
if ($pr == 1 && $ignore == 0){
print ;
}
if(/\*\//){ $pr = 1;}
if (/\;/){ $ignore = 0; }
}
}

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

@ -0,0 +1,85 @@
#!/usr/bin/perl
# Version: 1.0
# Script last updated: 30May1999 GMD
# Change log:
# <none>
# usually open params-in-prop.txt
open(F,"$ARGV[0]") || die "Can't open restriction file $ARGV[0]:$!";
print <<EOM;
/*
======================================================================
File: parameterrestrictions.c
(C) COPYRIGHT 1999 Graham Davison
mailto:g.m.davison\@computer.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.
======================================================================*/
/*
* THIS FILE IS MACHINE GENERATED DO NOT EDIT
*/
int icalrestriction_is_parameter_allowed(icalproperty_kind prop,icalparameter_kind param)
{
switch (prop)
{
EOM
while(<F>)
{
chop;
# split line by whitespace
my @v = split(/\s+/,$_);
# property is first item on line
my $prop = shift @v;
my $prop_name = $prop;
if (substr($prop,0,1) eq "X") { $prop = "X"; }
$prop = join("",split(/-/,$prop));
print <<EOM;
/* ${prop_name} */
case ICAL_${prop}_PROPERTY:
switch (param)
{
EOM
foreach $param (@v)
{
$param = join("",split(/-/,$param));
print "\t\t\t\tcase ICAL_${param}_PARAMETER:\n";
}
print <<EOM;
return 1;
default:
return 0;
}
EOM
}
print <<EOM;
}
return 0;
}
EOM

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

@ -0,0 +1,109 @@
#!/usr/bin/env perl
# Version: 1.0
# Script last updated: 30May1999 GMD
# Change log:
# <none>
# usually open restrictions.csv
open(F,"$ARGV[0]") || die "Can't open restriction file $ARGV[0]:$!";
print <<EOM;
/*
======================================================================
File: restrictionrecords.c
(C) COPYRIGHT 1999 Graham Davison
mailto:g.m.davison\@computer.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.
======================================================================*/
/*
* THIS FILE IS MACHINE GENERATED DO NOT EDIT
*/
typedef struct icalrestriction_record {
icalproperty_method method;
icalcomponent_kind component;
icalproperty_kind property;
icalcomponent_kind subcomponent;
icalrestriction_kind restriction;
} icalrestriction_record;
icalrestriction_record icalrestriction_records[] =
{
EOM
my $last_method = "";
my $last_component = "";
my $last_property = "";
my $need_header = 0;
while(<F>)
{
chop;
# split line at commas
my ($method,$component,$property,$subcomponent,$restriction)=split(/\,/,$_);
#
#put in code to generate comments here!
#
if ($method ne $last_method)
{
$need_header = 1;
$last_method = $method;
}
if ($component ne $last_component)
{
$need_header = 1;
$last_component = $component;
}
if ($need_header)
{
print "\n\t/* METHOD: ${method}, COMPONENT: ${component} */\n";
$need_header = 0;
}
foreach $item ($component,$property,$subcomponent,$restriction)
{
# handle special cases.
if ($item eq "NONE")
{ $item = "NO"; }
else { if (substr($item,0,1) eq "X")
{ $item = "X"; }}
# strip out dashes
$item = join("",split(/-/,$item));
}
# strip leading V from component names
$component =~ s/^(V?)(\w+?)((SAVINGS)?)((TIME)?)$/$2/;
$subcomponent =~ s/^V(\w+)/$1/;
print "\t\{ICAL_METHOD_${method},ICAL_${component}_COMPONENT,";
print "ICAL_${property}_PROPERTY,ICAL_${subcomponent}_COMPONENT,";
print "ICAL_RESTRICTION_${restriction}\},\n";
}
print <<EOM;
/* END */
{ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}
};
EOM

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

@ -0,0 +1,98 @@
#!/usr/bin/env perl
use Getopt::Std;
getopts('i:');
# the argument should be the path to the restriction datafile, usually
# design-data/restrictions.csv
open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!";
# Write the file inline by copying everything before a demarcation
# line, and putting the generated data after the demarcation
if ($opt_i) {
open(IN,$opt_i) || die "Can't open input file $opt_i";
while(<IN>){
if (/Do not edit/){
last;
}
print;
}
print "/* Everything below this line is machine generated. Do not edit. */\n";
close IN;
}
# First build the property restriction table
print "icalrestriction_property_record icalrestriction_property_records[] = {\n";
while(<F>)
{
chop;
s/\#.*$//;
my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
next if !$method;
if(!$sub) {
$sub = "0";
} else {
$sub = "icalrestriction_".$sub;
}
if($prop ne "NONE"){
print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${prop}_PROPERTY,ICAL_RESTRICTION_${restr},$sub},\n");
}
}
# Print the terminating line
print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_NONE}\n";
print "};\n";
print "icalrestriction_component_record icalrestriction_component_records[] = {\n";
# Go back through the entire file and build the component restriction table
close(F);
open(F,"$ARGV[0]") || die "Can't open restriction data file $ARGV[0]:$!";
while(<F>)
{
chop;
s/\#.*$//;
my($method,$targetcomp,$prop,$subcomp,$restr,$sub) = split(/,/,$_);
next if !$method;
if(!$sub) {
$sub = "0";
} else {
$sub = "icalrestriction_".$sub;
}
if($subcomp ne "NONE"){
print(" \{ICAL_METHOD_${method},ICAL_${targetcomp}_COMPONENT,ICAL_${subcomp}_COMPONENT,ICAL_RESTRICTION_${restr},$sub\},\n");
}
}
# print the terminating line
print " {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_NONE}\n";
print "};\n";

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

@ -0,0 +1,133 @@
sub read_values_file {
my $path = shift;
my %h;
open(F,$path) || die "Can't open values file $path";
while(<F>){
chop;
s/#.*$//g;
s/\"//g;
s/\r//g;
next if ! $_;
@column = split(/,/,$_);
my $value_name = $column[0];
my $c_type_str = $column[1];
my $c_autogen = ($c_type_str =~ /\(a\)/);
my $c_type = $c_type_str;
$c_type =~ s/\(.\)//;
my $python_type = $column[2];
my $components = $column[3];
my $enum_values = $column[4];
my @components;
if($components ne "unitary"){
@components = split(/;/,$components);
} else {
@components = ();
}
my @enums;
if($enum_values) {
@enums = split(/;/,$enum_values);
} else {
@enums = ();
}
$h{$value_name} = { C => [$c_autogen,$c_type],
perl => $perl_type,
python => $python_type,
components=>[@components],
enums=>[@enums]
};
}
return %h;
}
sub read_properties_file {
my $path = shift;
my %h;
open(F,$path) || die "Can't open properties file $path";
while(<F>){
chop;
s/#.*$//g;
s/\"//g;
s/\r//g;
next if ! $_;
@column = split(/,/,$_);
my $property_name = $column[0];
my $lic_value = $column[1];
my $default_value = $column[2];
$h{$property_name} = { lic_value => $lic_value,
default_value => $default_value
};
}
return %h;
}
sub read_parameters_file {
my $path = shift;
my %h;
open(F,$path) || die "Can't open parameters file $path";
while(<F>){
chop;
s/#.*$//g;
s/\"//g;
s/\r//g;
next if ! $_;
@column = split(/\,/,$_);
my $parameter_name = $column[0];
my $data_type = $column[1];
my $enum_string = $column[2];
my @enums;
if($enum_string){
@enums = split(/;/,$enum_string);
}
$h{$parameter_name} = { C => $data_type,
enums => [@enums]
};
}
close(F);
return %h;
}
1;

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

@ -0,0 +1,5 @@
Makefile
.deps
.libs
*.lo
*.la

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

@ -0,0 +1,19 @@
if WITH_PYTHON
PYTHON_DIR = python
else
PYTHON_DIR =
endif
if WITH_JAVA
JAVA_DIR = java
else
JAVA_DIR =
endif
if WITH_CAP
LIBICALCAP_DIR = libicalcap
else
LIBICALCAP_DIR =
endif
SUBDIRS = libical libicalss $(LIBICALCAP_DIR) libicalvcal $(PYTHON_DIR) $(JAVA_DIR) test

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

@ -0,0 +1,362 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# 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@
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_alias = @build_alias@
build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
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@
CXX = @CXX@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAR = @JAR@
JAVA = @JAVA@
JAVAC = @JAVAC@
JAVAH = @JAVAH@
JAVA_PLATFORM = @JAVA_PLATFORM@
LEX = @LEX@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PTHREAD_LIBS = @PTHREAD_LIBS@
PY_CFLAGS = @PY_CFLAGS@
PY_EXTRA_LIBS = @PY_EXTRA_LIBS@
PY_LIBS = @PY_LIBS@
PY_LIB_LOC = @PY_LIB_LOC@
RANLIB = @RANLIB@
RRCAP_CFLAGS = @RRCAP_CFLAGS@
RRCAP_LIBS = @RRCAP_LIBS@
VERSION = @VERSION@
YACC = @YACC@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
python_val = @python_val@
@WITH_PYTHON_TRUE@PYTHON_DIR = python
@WITH_PYTHON_FALSE@PYTHON_DIR =
@WITH_JAVA_TRUE@JAVA_DIR = java
@WITH_JAVA_FALSE@JAVA_DIR =
@WITH_CAP_TRUE@LIBICALCAP_DIR = libicalcap
@WITH_CAP_FALSE@LIBICALCAP_DIR =
SUBDIRS = libical libicalss $(LIBICALCAP_DIR) libicalvcal $(PYTHON_DIR) $(JAVA_DIR) test
subdir = src
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
uninstall-info-recursive all-recursive install-data-recursive \
install-exec-recursive installdirs-recursive install-recursive \
uninstall-recursive check-recursive installcheck-recursive
DIST_COMMON = Makefile.am Makefile.in
DIST_SUBDIRS = libical libicalss libicalcap libicalvcal python java test
all: all-recursive
.SUFFIXES:
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(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 $(LISP)
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(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 "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
for subdir in $(DIST_SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
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-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
clean-generic clean-libtool clean-recursive distclean \
distclean-generic distclean-libtool distclean-recursive \
distclean-tags distdir dvi dvi-am dvi-recursive info info-am \
info-recursive install install-am install-data install-data-am \
install-data-recursive install-exec install-exec-am \
install-exec-recursive install-info install-info-am \
install-info-recursive install-man install-recursive \
install-strip installcheck installcheck-am installdirs \
installdirs-am installdirs-recursive maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
tags tags-recursive uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
# 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:

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

@ -0,0 +1,27 @@
icalyacc.h
icalyacc.c
icallexer.c
y.output
Makefile
icalversion.h
.deps
.libs
*.lo
*.la
ical.h
icalyacc.output
icalproperty.c
icalproperty.h
icalvalue.h
icalvalue.c
icalparameter.h
icalparameter.c
icalrestriction.c
icalderivedparameter.c
icalderivedparameter.h
icalderivedproperty.c
icalderivedproperty.h
icalderivedvalue.c
icalderivedvalue.h
icallexer.c
y.output

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

@ -0,0 +1,284 @@
#======================================================================
# FILE: Makefile.am
# CREATOR: eric
#
# $Id: Makefile.am,v 1.35 2002/11/05 14:59:21 acampi 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
if WITH_CXX
cxx_lib=libical_cxx.la
cxx_headers=vcomponent.h icalparameter_cxx.h icalproperty_cxx.h icalvalue_cxx.h icptrholder.h
else
cxx_lib=
cxx_headers=
endif
lib_LTLIBRARIES = libical.la $(cxx_lib)
noinst_LTLIBRARIES = libical-static.la
libical_static_la_SOURCES = $(libical_la_SOURCES)
libical_static_la_LDFLAGS = --all-static
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 0:0:0
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
if WITH_CXX
libical_cxx_la_SOURCES = \
$(libical_la_SOURCES) \
vcomponent.h \
vcomponent.cpp \
icalproperty_cxx.h \
icalproperty_cxx.cpp \
icalparameter_cxx.h \
icalparameter_cxx.cpp \
icalvalue_cxx.h \
icalvalue_cxx.cpp \
icptrholder.h
endif
libicalincludedir = $(includedir)
libicalinclude_HEADERS = ical.h icalmemory.h icalerror.h $(cxx_headers)
# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It
# is required to make the combined header ical.h properly
COMBINEDHEADERS = \
$(top_builddir)/config.h \
$(top_builddir)/src/libical/icalversion.h \
$(top_srcdir)/src/libical/icaltime.h \
$(top_srcdir)/src/libical/icalduration.h \
$(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
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

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

@ -0,0 +1,776 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# 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@
#======================================================================
# FILE: Makefile.am
# CREATOR: eric
#
# $Id: Makefile.in,v 1.1 2003/04/28 17:20:46 acampi 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/
#
#
#
#======================================================================
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_alias = @build_alias@
build_triplet = @build@
host_alias = @host_alias@
host_triplet = @host@
target_alias = @target_alias@
target_triplet = @target@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
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@
CXX = @CXX@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
EXEEXT = @EXEEXT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
JAR = @JAR@
JAVA = @JAVA@
JAVAC = @JAVAC@
JAVAH = @JAVAH@
JAVA_PLATFORM = @JAVA_PLATFORM@
LEX = @LEX@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PERL = @PERL@
PKG_CONFIG = @PKG_CONFIG@
PTHREAD_LIBS = @PTHREAD_LIBS@
PY_CFLAGS = @PY_CFLAGS@
PY_EXTRA_LIBS = @PY_EXTRA_LIBS@
PY_LIBS = @PY_LIBS@
PY_LIB_LOC = @PY_LIB_LOC@
RANLIB = @RANLIB@
RRCAP_CFLAGS = @RRCAP_CFLAGS@
RRCAP_LIBS = @RRCAP_LIBS@
VERSION = @VERSION@
YACC = @YACC@
am__include = @am__include@
am__quote = @am__quote@
install_sh = @install_sh@
python_val = @python_val@
DESIGNDATA = $(top_srcdir)/design-data
ICALSCRIPTS = $(top_srcdir)/scripts
@WITH_CXX_TRUE@cxx_lib = libical_cxx.la
@WITH_CXX_FALSE@cxx_lib =
@WITH_CXX_TRUE@cxx_headers = vcomponent.h icalparameter_cxx.h icalproperty_cxx.h icalvalue_cxx.h icptrholder.h
@WITH_CXX_FALSE@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
CPPFLAGS = -DPACKAGE_DATA_DIR=\""$(datadir)/$(PACKAGE)"\"
INCLUDES = \
-I$(top_builddir) \
-I$(top_srcdir)/src \
-I$(top_builddir)/src \
-I$(srcdir)
libical_la_LDFLAGS = -version-info 0:0:0
libical_la_SOURCES = \
$(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
@WITH_CXX_TRUE@libical_cxx_la_SOURCES = \
@WITH_CXX_TRUE@ $(libical_la_SOURCES) \
@WITH_CXX_TRUE@ vcomponent.h \
@WITH_CXX_TRUE@ vcomponent.cpp \
@WITH_CXX_TRUE@ icalproperty_cxx.h \
@WITH_CXX_TRUE@ icalproperty_cxx.cpp \
@WITH_CXX_TRUE@ icalparameter_cxx.h \
@WITH_CXX_TRUE@ icalparameter_cxx.cpp \
@WITH_CXX_TRUE@ icalvalue_cxx.h \
@WITH_CXX_TRUE@ icalvalue_cxx.cpp \
@WITH_CXX_TRUE@ icptrholder.h
libicalincludedir = $(includedir)
libicalinclude_HEADERS = ical.h icalmemory.h icalerror.h $(cxx_headers)
# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It
# is required to make the combined header ical.h properly
COMBINEDHEADERS = \
$(top_builddir)/config.h \
$(top_builddir)/src/libical/icalversion.h \
$(top_srcdir)/src/libical/icaltime.h \
$(top_srcdir)/src/libical/icalduration.h \
$(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
BUILT_COMBINEDHEADERS = \
icalderivedparameter.h \
icalderivedproperty.h \
icalderivedvalue.h
BUILT_SOURCES = \
$(BUILT_COMBINEDHEADERS)\
icalderivedparameter.c \
icalderivedproperty.c \
icalrestriction.c \
icalderivedvalue.c
# parameters
PARAMETERDEPS = \
$(ICALSCRIPTS)/mkderivedparameters.pl \
$(DESIGNDATA)/parameters.csv \
icalderivedparameter.c.in \
icalderivedparameter.h.in
# properties
PROPERTYDEPS = \
$(ICALSCRIPTS)/mkderivedproperties.pl \
$(DESIGNDATA)/properties.csv \
$(DESIGNDATA)/value-types.csv \
icalderivedproperty.c.in \
icalderivedproperty.h.in
# restrictions
RESTRICTIONDEPS = \
$(ICALSCRIPTS)/mkrestrictiontable.pl \
$(DESIGNDATA)/restrictions.csv \
icalrestriction.c.in
# values
VALUEDEPS = \
$(ICALSCRIPTS)/mkderivedvalues.pl \
$(DESIGNDATA)/value-types.csv \
icalderivedvalue.c.in \
icalderivedvalue.h.in
# housekeeping
CONFIG_CLEAN_FILES = y.output
CLEANFILES = $(BUILT_SOURCES) $(BUILT_COMBINEDHEADERS)
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
subdir = src/libical
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
libical_static_la_LIBADD =
am_libical_static_la_OBJECTS = icalderivedparameter.lo \
icalderivedproperty.lo icalrestriction.lo icalderivedvalue.lo \
icalarray.lo icalattach.lo icalcomponent.lo icalenums.lo \
icalerror.lo icalmemory.lo icalmime.lo icalparameter.lo \
icalparser.lo icalproperty.lo icalrecur.lo icaltime.lo \
icaltimezone.lo icalduration.lo icalperiod.lo icaltypes.lo \
icalvalue.lo pvl.lo sspm.lo vsnprintf.lo icallangbind.lo \
caldate.lo
libical_static_la_OBJECTS = $(am_libical_static_la_OBJECTS)
libical_la_LIBADD =
am_libical_la_OBJECTS = icalderivedparameter.lo icalderivedproperty.lo \
icalrestriction.lo icalderivedvalue.lo icalarray.lo \
icalattach.lo icalcomponent.lo icalenums.lo icalerror.lo \
icalmemory.lo icalmime.lo icalparameter.lo icalparser.lo \
icalproperty.lo icalrecur.lo icaltime.lo icaltimezone.lo \
icalduration.lo icalperiod.lo icaltypes.lo icalvalue.lo pvl.lo \
sspm.lo vsnprintf.lo icallangbind.lo caldate.lo
libical_la_OBJECTS = $(am_libical_la_OBJECTS)
libical_cxx_la_LDFLAGS =
libical_cxx_la_LIBADD =
@WITH_CXX_TRUE@am_libical_cxx_la_OBJECTS = icalderivedparameter.lo \
@WITH_CXX_TRUE@ icalderivedproperty.lo icalrestriction.lo \
@WITH_CXX_TRUE@ icalderivedvalue.lo icalarray.lo icalattach.lo \
@WITH_CXX_TRUE@ icalcomponent.lo icalenums.lo icalerror.lo \
@WITH_CXX_TRUE@ icalmemory.lo icalmime.lo icalparameter.lo \
@WITH_CXX_TRUE@ icalparser.lo icalproperty.lo icalrecur.lo \
@WITH_CXX_TRUE@ icaltime.lo icaltimezone.lo icalduration.lo \
@WITH_CXX_TRUE@ icalperiod.lo icaltypes.lo icalvalue.lo pvl.lo \
@WITH_CXX_TRUE@ sspm.lo vsnprintf.lo icallangbind.lo caldate.lo \
@WITH_CXX_TRUE@ vcomponent.lo icalproperty_cxx.lo \
@WITH_CXX_TRUE@ icalparameter_cxx.lo icalvalue_cxx.lo
@WITH_CXX_FALSE@am_libical_cxx_la_OBJECTS =
libical_cxx_la_OBJECTS = $(am_libical_cxx_la_OBJECTS)
DEFS = @DEFS@
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
depcomp = $(SHELL) $(top_srcdir)/depcomp
@AMDEP_TRUE@DEP_FILES = $(DEPDIR)/caldate.Plo $(DEPDIR)/icalarray.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalattach.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalcomponent.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalderivedparameter.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalderivedproperty.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalderivedvalue.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalduration.Plo $(DEPDIR)/icalenums.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalerror.Plo $(DEPDIR)/icallangbind.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalmemory.Plo $(DEPDIR)/icalmime.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalparameter.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalparameter_cxx.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalparser.Plo $(DEPDIR)/icalperiod.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalproperty.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalproperty_cxx.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalrecur.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalrestriction.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icaltime.Plo $(DEPDIR)/icaltimezone.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icaltypes.Plo $(DEPDIR)/icalvalue.Plo \
@AMDEP_TRUE@ $(DEPDIR)/icalvalue_cxx.Plo $(DEPDIR)/pvl.Plo \
@AMDEP_TRUE@ $(DEPDIR)/sspm.Plo $(DEPDIR)/vcomponent.Plo \
@AMDEP_TRUE@ $(DEPDIR)/vsnprintf.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
$(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CFLAGS = @CFLAGS@
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
CXXFLAGS = @CXXFLAGS@
DIST_SOURCES = $(libical_static_la_SOURCES) $(libical_la_SOURCES) \
$(libical_cxx_la_SOURCES)
HEADERS = $(libicalinclude_HEADERS)
DIST_COMMON = $(libicalinclude_HEADERS) Makefile.am Makefile.in \
icalversion.h.in
SOURCES = $(libical_static_la_SOURCES) $(libical_la_SOURCES) $(libical_cxx_la_SOURCES)
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .cpp .lo .o .obj
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/libical/Makefile
Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && \
CONFIG_HEADERS= CONFIG_LINKS= \
CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
icalversion.h: $(top_builddir)/config.status icalversion.h.in
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p"; \
$(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$p; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
done
clean-libLTLIBRARIES:
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
libical-static.la: $(libical_static_la_OBJECTS) $(libical_static_la_DEPENDENCIES)
$(LINK) $(libical_static_la_LDFLAGS) $(libical_static_la_OBJECTS) $(libical_static_la_LIBADD) $(LIBS)
libical.la: $(libical_la_OBJECTS) $(libical_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libical_la_LDFLAGS) $(libical_la_OBJECTS) $(libical_la_LIBADD) $(LIBS)
libical_cxx.la: $(libical_cxx_la_OBJECTS) $(libical_cxx_la_DEPENDENCIES)
$(CXXLINK) -rpath $(libdir) $(libical_cxx_la_LDFLAGS) $(libical_cxx_la_OBJECTS) $(libical_cxx_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/caldate.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalarray.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalattach.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalcomponent.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalderivedparameter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalderivedproperty.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalderivedvalue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalduration.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalenums.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalerror.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icallangbind.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalmemory.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalmime.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalparameter.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalparameter_cxx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalparser.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalperiod.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalproperty.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalproperty_cxx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalrecur.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalrestriction.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icaltime.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icaltimezone.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icaltypes.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalvalue.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/icalvalue_cxx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pvl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/sspm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vcomponent.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/vsnprintf.Plo@am__quote@
distclean-depend:
-rm -rf $(DEPDIR)
.c.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
.c.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(COMPILE) -c `cygpath -w $<`
.c.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
CCDEPMODE = @CCDEPMODE@
.cpp.o:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CXXCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
.cpp.obj:
@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(CXXCOMPILE) -c -o $@ `cygpath -w $<`
.cpp.lo:
@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
$(LTCXXCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$<
CXXDEPMODE = @CXXDEPMODE@
uninstall-info-am:
install-libicalincludeHEADERS: $(libicalinclude_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libicalincludedir)
@list='$(libicalinclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " $(INSTALL_HEADER) $$d$$p $(DESTDIR)$(libicalincludedir)/$$f"; \
$(INSTALL_HEADER) $$d$$p $(DESTDIR)$(libicalincludedir)/$$f; \
done
uninstall-libicalincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(libicalinclude_HEADERS)'; for p in $$list; do \
f="`echo $$p | sed -e 's|^.*/||'`"; \
echo " rm -f $(DESTDIR)$(libicalincludedir)/$$f"; \
rm -f $(DESTDIR)$(libicalincludedir)/$$f; \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(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 $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(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 "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|| etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
GTAGS:
here=`CDPATH=: && cd $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ../..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
$(mkinstalldirs) "$(distdir)/$$dir"; \
fi; \
if test -d $$d/$$file; then \
cp -pR $$d/$$file $(distdir) \
|| exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="${top_distdir}" distdir="$(distdir)" \
dist-hook
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(libicalincludedir)
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)" \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
clean-noinstLTLIBRARIES mostlyclean-am
distclean: distclean-am
distclean-am: clean-am distclean-compile distclean-depend \
distclean-generic distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
info: info-am
info-am:
install-data-am: install-libicalincludeHEADERS
install-exec-am: install-libLTLIBRARIES
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
uninstall-libicalincludeHEADERS
.PHONY: GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
distclean distclean-compile distclean-depend distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am info \
info-am install install-am install-data install-data-am \
install-exec install-exec-am install-info install-info-am \
install-libLTLIBRARIES install-libicalincludeHEADERS \
install-man install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool tags uninstall uninstall-am \
uninstall-info-am uninstall-libLTLIBRARIES \
uninstall-libicalincludeHEADERS
# CFLAGS = -g
all: ical.h
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
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
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
icalrestriction.c: $(RESTRICTIONDEPS)
$(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl -i $(srcdir)/icalrestriction.c.in \
$(DESIGNDATA)/restrictions.csv > icalrestriction.c
icalderivedvalue.h: $(VALUEDEPS)
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
-i $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h
icalderivedvalue.c: $(VALUEDEPS) $(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
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
cd $(distdir); rm -f ical.h icalversion.h
$(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
# 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:

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

@ -0,0 +1,65 @@
/*
* Copyright (c) 1986-2000, Hiram Clawson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
*
* Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither name of The Museum of Hiram nor the names of
* its contributors may be used to endorse or promote products
* derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file astime.h
* @brief contains definitions of structures used for time calculations.
*/
#ifndef _astime_h_
#define _astime_h_
typedef struct ut_instant {
double j_date; /**< julian decimal date, 0 = 01 Jan 4713 BC 12 HR UT */
long year; /**< year, valid range [-4,713, +2,147,483,647] */
int month; /**< [1-12] */
int day; /**< [1-31] */
int i_hour; /**< [0-23] */
int i_minute; /**< [0-59] */
int i_second; /**< [0-59] */
double d_hour; /**< [0.0-23.9999] includes minute and second */
double d_minute; /**< [0.0-59.9999] includes second */
double d_second; /**< [0.0-59.9999] */
int weekday; /**< [0-6] */
int day_of_year; /**< [1-366] */
} UTinstant, * UTinstantPtr;
/* Functions in caldate.c */
long caldat( UTinstantPtr ); /** converts julian date to year,mo,da */
double juldat( UTinstantPtr ); /** returns julian day from year,mo,da */
#endif /* _astime_h_ */

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

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

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

@ -0,0 +1,310 @@
/* -*- 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. */

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

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

@ -0,0 +1,473 @@
/* -*- 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*/

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

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

@ -0,0 +1,324 @@
/* -*- 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*/

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

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

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

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

@ -0,0 +1,176 @@
/*
* Copyright (c) 1986-2000, Hiram Clawson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* Redistributions of source code must retain the above
* copyright notice, this list of conditions and the
* following disclaimer.
*
* Redistributions in binary form must reproduce the
* above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* Neither name of The Museum of Hiram nor the names of
* its contributors may be used to endorse or promote products
* derived from this software without specific prior
* written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "astime.h" /* time structures */
/**
* caldat computes the day of the week, the day of the year
* the gregorian (or julian) calendar date and the universal
* time from the julian decimal date.
* for astronomical purposes, The Gregorian calendar reform occurred
* on 15 Oct. 1582. This is 05 Oct 1582 by the julian calendar.
* Input: a ut_instant structure pointer, where the j_date element
* has been set. ( = 0 for 01 Jan 4713 B.C. 12 HR UT )
*
* output: will set all the other elements of the structure.
* As a convienence, the function will also return the year.
*
* Reference: Astronomial formulae for calculators, meeus, p 23
* from fortran program by F. Espenak - April 1982 Page 277,
* 50 Year canon of solar eclipses: 1986-2035
*
*/
long caldat( date )
struct ut_instant * date;
{
double frac;
long jd;
long ka;
long kb;
long kc;
long kd;
long ke;
long ialp;
jd = (long) (date->j_date + 0.5); /* integer julian date */
frac = date->j_date + 0.5 - (double) jd + 1.0e-10; /* day fraction */
ka = (long) jd;
if ( jd >= 2299161L )
{
ialp = ( (double) jd - 1867216.25 ) / ( 36524.25 );
ka = jd + 1L + ialp - ( ialp >> 2 );
}
kb = ka + 1524L;
kc = ( (double) kb - 122.1 ) / 365.25;
kd = (double) kc * 365.25;
ke = (double) ( kb - kd ) / 30.6001;
date->day = kb - kd - ((long) ( (double) ke * 30.6001 ));
if ( ke > 13L )
date->month = ke - 13L;
else
date->month = ke - 1L;
if ( (date->month == 2) && (date->day > 28) )
date->day = 29;
if ( (date->month == 2) && (date->day == 29) && (ke == 3L) )
date->year = kc - 4716L;
else if ( date->month > 2 )
date->year = kc - 4716L;
else
date->year = kc - 4715L;
date->i_hour = date->d_hour = frac * 24.0; /* hour */
date->i_minute = date->d_minute =
( date->d_hour - (double) date->i_hour ) * 60.0; /* minute */
date->i_second = date->d_second =
( date->d_minute - (double) date->i_minute ) * 60.0;/* second */
date->weekday = (jd + 1L) % 7L; /* day of week */
if ( date->year == ((date->year >> 2) << 2) )
date->day_of_year =
( ( 275 * date->month ) / 9)
- ((date->month + 9) / 12)
+ date->day - 30;
else
date->day_of_year =
( ( 275 * date->month ) / 9)
- (((date->month + 9) / 12) << 1)
+ date->day - 30;
return( date->year );
}
/**
* juldat computes the julian decimal date (j_date) from
* the gregorian (or Julian) calendar date.
* for astronomical purposes, The Gregorian calendar reform occurred
* on 15 Oct. 1582. This is 05 Oct 1582 by the julian calendar.
* Input: a ut_instant structure pointer where Day, Month, Year and
* i_hour, i_minute, d_second have been set for the date
* in question.
*
* Output: the j_date and weekday elements of the structure will be set.
* Also, the return value of the function will be the j_date too.
*
* Reference: Astronomial formulae for calculators, meeus, p 23
* from fortran program by F. Espenak - April 1982 Page 276,
* 50 Year canon of solar eclipses: 1986-2035
*/
double juldat( date )
struct ut_instant * date;
{
double frac, gyr;
long iy0, im0;
long ia, ib;
long jd;
/* decimal day fraction */
frac = (( double)date->i_hour/ 24.0)
+ ((double) date->i_minute / 1440.0)
+ (date->d_second / 86400.0);
/* convert date to format YYYY.MMDDdd */
gyr = (double) date->year
+ (0.01 * (double) date->month)
+ (0.0001 * (double) date->day)
+ (0.0001 * frac) + 1.0e-9;
/* conversion factors */
if ( date->month <= 2 )
{
iy0 = date->year - 1L;
im0 = date->month + 12;
}
else
{
iy0 = date->year;
im0 = date->month;
}
ia = iy0 / 100L;
ib = 2L - ia + (ia >> 2);
/* calculate julian date */
if ( date->year < 0L )
jd = (long) ((365.25 * (double) iy0) - 0.75)
+ (long) (30.6001 * (im0 + 1L) )
+ (long) date->day + 1720994L;
else
jd = (long) (365.25 * (double) iy0)
+ (long) (30.6001 * (double) (im0 + 1L))
+ (long) date->day + 1720994L;
if ( gyr >= 1582.1015 ) /* on or after 15 October 1582 */
jd += ib;
date->j_date = (double) jd + frac + 0.5;
jd = (long) (date->j_date + 0.5);
date->weekday = (jd + 1L) % 7L;
return( date->j_date );
} /* end of double juldat( date ) */

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

@ -0,0 +1,163 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*-
======================================================================
FILE: icalarray.c
CREATOR: Damon Chaplin 07 March 2001
$Id: icalarray.c,v 1.5 2002/06/28 09:30:15 acampi Exp $
$Locker: $
(C) COPYRIGHT 2001, Ximian, Inc.
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/
======================================================================*/
/** @file icalarray.c
*
* @brief An array of arbitrarily-sized elements which grows
* dynamically as elements are added.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "icalarray.h"
#include "icalerror.h"
static void icalarray_expand (icalarray *array,
int space_needed);
/** @brief Constructor
*/
icalarray*
icalarray_new (int element_size,
int increment_size)
{
icalarray *array;
array = (icalarray*) malloc (sizeof (icalarray));
if (!array) {
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return NULL;
}
array->element_size = element_size;
array->increment_size = increment_size;
array->num_elements = 0;
array->space_allocated = 0;
array->data = NULL;
return array;
}
/** @brief Destructor
*/
void
icalarray_free (icalarray *array)
{
if (array->data)
free (array->data);
free (array);
}
void
icalarray_append (icalarray *array,
void *element)
{
if (array->num_elements >= array->space_allocated)
icalarray_expand (array, 1);
memcpy ((char *)(array->data) + ( array->num_elements * array->element_size ), element,
array->element_size);
array->num_elements++;
}
void*
icalarray_element_at (icalarray *array,
int position)
{
assert (position >= 0);
assert (position < array->num_elements);
return (char *)(array->data) + (position * array->element_size);
}
void
icalarray_remove_element_at (icalarray *array,
int position)
{
void *dest;
int elements_to_move;
assert (position >= 0);
assert (position < array->num_elements);
dest = (char *)array->data + (position * array->element_size);
elements_to_move = array->num_elements - position - 1;
if (elements_to_move > 0)
memmove (dest, (char *)dest + array->element_size,
elements_to_move * array->element_size);
array->num_elements--;
}
void
icalarray_sort (icalarray *array,
int (*compare) (const void *,
const void *))
{
qsort (array->data, array->num_elements, array->element_size, compare);
}
static void
icalarray_expand (icalarray *array,
int space_needed)
{
int new_space_allocated;
void *new_data;
new_space_allocated = array->space_allocated + array->increment_size;
if (space_needed > array->increment_size)
new_space_allocated += space_needed;
/*
new_data = realloc (array->data,
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) {
array->data = new_data;
array->space_allocated = new_space_allocated;
} else {
icalerror_set_errno(ICAL_ALLOCATION_ERROR);
}
}

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

@ -0,0 +1,63 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*======================================================================
FILE: icalarray.h
CREATOR: Damon Chaplin 07 March 2001
$Id: icalarray.h,v 1.3 2002/10/09 19:50:46 acampi Exp $
$Locker: $
(C) COPYRIGHT 2001, Ximian, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
======================================================================*/
#ifndef ICALARRAY_H
#define ICALARRAY_H
/** @file icalarray.h
*
* @brief An array of arbitrarily-sized elements which grows
* dynamically as elements are added.
*/
typedef struct _icalarray icalarray;
struct _icalarray {
unsigned int element_size;
unsigned int increment_size;
unsigned int num_elements;
unsigned int space_allocated;
void *data;
};
icalarray *icalarray_new (int element_size,
int increment_size);
void icalarray_free (icalarray *array);
void icalarray_append (icalarray *array,
void *element);
void icalarray_remove_element_at (icalarray *array,
int position);
void *icalarray_element_at (icalarray *array,
int position);
void icalarray_sort (icalarray *array,
int (*compare) (const void *, const void *));
#endif /* ICALARRAY_H */

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

@ -0,0 +1,139 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalattach.c
CREATOR: acampi 28 May 02
$Id: icalattach.c,v 1.2 2002/10/09 19:54:59 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Andrea Campi
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icaltypes.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "icaltypes.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "icalattachimpl.h"
#include <stdlib.h> /* for malloc and abs() */
#include <errno.h> /* for errno */
#include <string.h> /* for icalmemory_strdup */
#include <assert.h>
icalattach *
icalattach_new_from_url (const char *url)
{
icalattach *attach;
char *url_copy;
icalerror_check_arg_rz ((url != NULL), "url");
if ((attach = malloc (sizeof (icalattach))) == NULL) {
errno = ENOMEM;
return NULL;
}
if ((url_copy = strdup (url)) == NULL) {
free (attach);
errno = ENOMEM;
return NULL;
}
attach->refcount = 1;
attach->is_url = 1;
attach->u.url.url = url_copy;
return attach;
}
icalattach *
icalattach_new_from_data (unsigned char *data, icalattach_free_fn_t free_fn,
void *free_fn_data)
{
icalattach *attach;
icalerror_check_arg_rz ((data != NULL), "data");
if ((attach = malloc (sizeof (icalattach))) == NULL) {
errno = ENOMEM;
return NULL;
}
attach->refcount = 1;
attach->is_url = 0;
attach->u.data.data = data;
attach->u.data.free_fn = free_fn;
attach->u.data.free_fn_data = free_fn_data;
return attach;
}
void
icalattach_ref (icalattach *attach)
{
icalerror_check_arg_rv ((attach != NULL), "attach");
icalerror_check_arg_rv ((attach->refcount > 0), "attach->refcount > 0");
attach->refcount++;
}
void
icalattach_unref (icalattach *attach)
{
icalerror_check_arg_rv ((attach != NULL), "attach");
icalerror_check_arg_rv ((attach->refcount > 0), "attach->refcount > 0");
attach->refcount--;
if (attach->refcount != 0)
return;
if (attach->is_url)
free (attach->u.url.url);
else if (attach->u.data.free_fn)
(* attach->u.data.free_fn) (attach->u.data.data, attach->u.data.free_fn_data);
free (attach);
}
int
icalattach_get_is_url (icalattach *attach)
{
icalerror_check_arg_rz ((attach != NULL), "attach");
return attach->is_url ? 1 : 0;
}
const char *
icalattach_get_url (icalattach *attach)
{
icalerror_check_arg_rz ((attach != NULL), "attach");
icalerror_check_arg_rz ((attach->is_url), "attach->is_url");
return attach->u.url.url;
}
unsigned char *
icalattach_get_data (icalattach *attach)
{
icalerror_check_arg_rz ((attach != NULL), "attach");
icalerror_check_arg_rz ((!attach->is_url), "!attach->is_url");
return attach->u.data.data;
}

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

@ -0,0 +1,60 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalattach.h
CREATOR: acampi 28 May 02
(C) COPYRIGHT 2002, Andrea Campi
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 icalattach.h
======================================================================*/
#ifndef ICALATTACH_H
#define ICALATTACH_H
typedef struct icalattach_impl icalattach;
typedef void (* icalattach_free_fn_t) (unsigned char *data, void *user_data);
icalattach *icalattach_new_from_url (const char *url);
icalattach *icalattach_new_from_data (unsigned char *data,
icalattach_free_fn_t free_fn, void *free_fn_data);
void icalattach_ref (icalattach *attach);
void icalattach_unref (icalattach *attach);
int icalattach_get_is_url (icalattach *attach);
const char *icalattach_get_url (icalattach *attach);
unsigned char *icalattach_get_data (icalattach *attach);
struct icalattachtype* icalattachtype_new(void);
void icalattachtype_add_reference(struct icalattachtype* v);
void icalattachtype_free(struct icalattachtype* v);
void icalattachtype_set_url(struct icalattachtype* v, char* url);
char* icalattachtype_get_url(struct icalattachtype* v);
void icalattachtype_set_base64(struct icalattachtype* v, char* base64,
int owns);
char* icalattachtype_get_base64(struct icalattachtype* v);
void icalattachtype_set_binary(struct icalattachtype* v, char* binary,
int owns);
void* icalattachtype_get_binary(struct icalattachtype* v);
#endif /* !ICALATTACH_H */

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

@ -0,0 +1,59 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalattachimpl.h
CREATOR: acampi 28 May 02
$Id: icalattachimpl.h,v 1.1 2002/05/28 14:08:00 acampi Exp $
(C) COPYRIGHT 2000, Andrea Campi
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 icalattachimpl.h
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef ICALATTACHIMPL_H
#define ICALATTACHIMPL_H
#include "icalattach.h"
/* Private structure for ATTACH values */
struct icalattach_impl {
/* Reference count */
int refcount;
union {
/* URL attachment data */
struct {
char *url;
} url;
/* Inline data */
struct {
unsigned char *data;
icalattach_free_fn_t free_fn;
void *free_fn_data;
} data;
} u;
/* TRUE if URL, FALSE if inline data */
unsigned int is_url : 1;
};
#endif

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

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

@ -0,0 +1,287 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalcomponent.h
CREATOR: eric 20 March 1999
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalcomponent.h
======================================================================*/
#ifndef ICALCOMPONENT_H
#define ICALCOMPONENT_H
#include "icalproperty.h"
#include "icalvalue.h"
#include "icalenums.h" /* defines icalcomponent_kind */
#include "pvl.h"
typedef struct icalcomponent_impl icalcomponent;
#ifndef ICALTIMEZONE_DEFINED
#define ICALTIMEZONE_DEFINED
/** @brief An opaque struct representing a timezone.
* We declare this here to avoid a circular dependancy.
*/
typedef struct _icaltimezone icaltimezone;
#endif
/* This is exposed so that callers will not have to allocate and
deallocate iterators. Pretend that you can't see it. */
typedef struct icalcompiter
{
icalcomponent_kind kind;
pvl_elem iter;
} icalcompiter;
icalcomponent* icalcomponent_new(icalcomponent_kind kind);
icalcomponent* icalcomponent_new_clone(icalcomponent* component);
icalcomponent* icalcomponent_new_from_string(char* str);
icalcomponent* icalcomponent_vanew(icalcomponent_kind kind, ...);
void icalcomponent_free(icalcomponent* component);
char* icalcomponent_as_ical_string(icalcomponent* component);
int icalcomponent_is_valid(icalcomponent* component);
icalcomponent_kind icalcomponent_isa(const icalcomponent* component);
int icalcomponent_isa_component (void* component);
/*
* Working with properties
*/
void icalcomponent_add_property(icalcomponent* component,
icalproperty* property);
void icalcomponent_remove_property(icalcomponent* component,
icalproperty* property);
int icalcomponent_count_properties(icalcomponent* component,
icalproperty_kind kind);
/* Iterate through the properties */
icalproperty* icalcomponent_get_current_property(icalcomponent* component);
icalproperty* icalcomponent_get_first_property(icalcomponent* component,
icalproperty_kind kind);
icalproperty* icalcomponent_get_next_property(icalcomponent* component,
icalproperty_kind kind);
icalproperty* icalcomponent_get_first_x_property(icalcomponent* component,
const char *name);
icalproperty* icalcomponent_get_next_x_property(icalcomponent* component,
const char *name);
/*
* Working with components
*/
/* Return the first VEVENT, VTODO or VJOURNAL sub-component of cop, or
comp if it is one of those types */
icalcomponent* icalcomponent_get_inner(icalcomponent* comp);
void icalcomponent_add_component(icalcomponent* parent,
icalcomponent* child);
void icalcomponent_remove_component(icalcomponent* parent,
icalcomponent* child);
int icalcomponent_count_components(icalcomponent* component,
icalcomponent_kind kind);
/**
This takes 2 VCALENDAR components and merges the second one into the first,
resolving any problems with conflicting TZIDs. comp_to_merge will no
longer exist after calling this function. */
void icalcomponent_merge_component(icalcomponent* comp,
icalcomponent* comp_to_merge);
/* Iteration Routines. There are two forms of iterators, internal and
external. The internal ones came first, and are almost completely
sufficient, but they fail badly when you want to construct a loop that
removes components from the container.*/
/* Iterate through components */
icalcomponent* icalcomponent_get_current_component (icalcomponent* component);
icalcomponent* icalcomponent_get_first_component(icalcomponent* component,
icalcomponent_kind kind);
icalcomponent* icalcomponent_get_next_component(icalcomponent* component,
icalcomponent_kind kind);
/* Using external iterators */
icalcompiter icalcomponent_begin_component(icalcomponent* component,
icalcomponent_kind kind);
icalcompiter icalcomponent_end_component(icalcomponent* component,
icalcomponent_kind kind);
icalcomponent* icalcompiter_next(icalcompiter* i);
icalcomponent* icalcompiter_prior(icalcompiter* i);
icalcomponent* icalcompiter_deref(icalcompiter* i);
/* Working with embedded error properties */
/* Check the component against itip rules and insert error properties*/
/* Working with embedded error properties */
int icalcomponent_check_restrictions(icalcomponent* comp);
/** Count embedded errors. */
int icalcomponent_count_errors(icalcomponent* component);
/** Remove all X-LIC-ERROR properties*/
void icalcomponent_strip_errors(icalcomponent* component);
/** Convert some X-LIC-ERROR properties into RETURN-STATUS properties*/
void icalcomponent_convert_errors(icalcomponent* component);
/* Internal operations. They are private, and you should not be using them. */
icalcomponent* icalcomponent_get_parent(icalcomponent* component);
void icalcomponent_set_parent(icalcomponent* component,
icalcomponent* parent);
/* Kind conversion routines */
int icalcomponent_kind_is_valid(const icalcomponent_kind kind);
icalcomponent_kind icalcomponent_string_to_kind(const char* string);
const char* icalcomponent_kind_to_string(icalcomponent_kind kind);
/************* Derived class methods. ****************************
If the code was in an OO language, the remaining routines would be
members of classes derived from icalcomponent. Don't call them on the
wrong component subtypes. */
/** For VCOMPONENT: Return a reference to the first VEVENT, VTODO or
VJOURNAL */
icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c);
/** For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end
times of an event in UTC */
struct icaltime_span icalcomponent_get_span(icalcomponent* comp);
/******************** Convienience routines **********************/
void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v);
struct icaltimetype icalcomponent_get_dtstart(icalcomponent* comp);
/* For the icalcomponent routines only, dtend and duration are tied
together. If you call the set routine for one and the other exists,
the routine will calculate the change to the other. That is, if
there is a DTEND and you call set_duration, the routine will modify
DTEND to be the sum of DTSTART and the duration. If you call a get
routine for one and the other exists, the routine will calculate
the return value. If you call a set routine and neither exists, the
routine will create the apcompriate comperty */
struct icaltimetype icalcomponent_get_dtend(icalcomponent* comp);
void icalcomponent_set_dtend(icalcomponent* comp, struct icaltimetype v);
struct icaltimetype icalcomponent_get_due(icalcomponent* comp);
void icalcomponent_set_due(icalcomponent* comp, struct icaltimetype v);
void icalcomponent_set_duration(icalcomponent* comp,
struct icaldurationtype v);
struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp);
void icalcomponent_set_method(icalcomponent* comp, icalproperty_method method);
icalproperty_method icalcomponent_get_method(icalcomponent* comp);
struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp);
void icalcomponent_set_dtstamp(icalcomponent* comp, struct icaltimetype v);
void icalcomponent_set_summary(icalcomponent* comp, const char* v);
const char* icalcomponent_get_summary(icalcomponent* comp);
void icalcomponent_set_comment(icalcomponent* comp, const char* v);
const char* icalcomponent_get_comment(icalcomponent* comp);
void icalcomponent_set_uid(icalcomponent* comp, const char* v);
const char* icalcomponent_get_uid(icalcomponent* comp);
void icalcomponent_set_relcalid(icalcomponent* comp, const char* v);
const char* icalcomponent_get_relcalid(icalcomponent* comp);
void icalcomponent_set_recurrenceid(icalcomponent* comp,
struct icaltimetype v);
struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent* comp);
void icalcomponent_set_description(icalcomponent* comp, const char* v);
const char* icalcomponent_get_description(icalcomponent* comp);
void icalcomponent_set_location(icalcomponent* comp, const char* v);
const char* icalcomponent_get_location(icalcomponent* comp);
void icalcomponent_set_sequence(icalcomponent* comp, int v);
int icalcomponent_get_sequence(icalcomponent* comp);
void icalcomponent_set_status(icalcomponent* comp, enum icalproperty_status v);
enum icalproperty_status icalcomponent_get_status(icalcomponent* comp);
/** Calls the given function for each TZID parameter found in the
component, and any subcomponents. */
void icalcomponent_foreach_tzid(icalcomponent* comp,
void (*callback)(icalparameter *param, void *data),
void *callback_data);
/** Returns the icaltimezone in the component corresponding to the
TZID, or NULL if it can't be found. */
icaltimezone* icalcomponent_get_timezone(icalcomponent* comp,
const char *tzid);
int icalproperty_recurrence_is_excluded(icalcomponent *comp,
struct icaltimetype *dtstart,
struct icaltimetype *recurtime);
void icalcomponent_foreach_recurrence(icalcomponent* comp,
struct icaltimetype start,
struct icaltimetype end,
void (*callback)(icalcomponent *comp,
struct icaltime_span *span,
void *data),
void *callback_data);
/*************** Type Specific routines ***************/
icalcomponent* icalcomponent_new_vcalendar();
icalcomponent* icalcomponent_new_vevent();
icalcomponent* icalcomponent_new_vtodo();
icalcomponent* icalcomponent_new_vjournal();
icalcomponent* icalcomponent_new_valarm();
icalcomponent* icalcomponent_new_vfreebusy();
icalcomponent* icalcomponent_new_vtimezone();
icalcomponent* icalcomponent_new_xstandard();
icalcomponent* icalcomponent_new_xdaylight();
icalcomponent* icalcomponent_new_vagenda();
icalcomponent* icalcomponent_new_vquery();
#endif /* !ICALCOMPONENT_H */

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

@ -0,0 +1,205 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalderivedparameters.{c,h}
CREATOR: eric 09 May 1999
$Id: icalderivedparameter.c.in,v 1.7 2004/05/10 22:05:23 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalderivedparameters.{c,h}
Contributions from:
Graham Davison (g.m.davison@computer.org)
======================================================================*/
/*#line 29 "icalparameter.c.in"*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalparameter.h"
#include "icalparameterimpl.h"
#include "icalproperty.h"
#include "icalerror.h"
#include "icalmemory.h"
#include <stdlib.h> /* for malloc() */
#include <errno.h>
#include <string.h> /* for memset() */
icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value);
struct icalparameter_impl* icalparameter_new_impl(icalparameter_kind kind);
/* This map associates each of the parameters with the string
representation of the parameter's name */
struct icalparameter_kind_map {
icalparameter_kind kind;
char *name;
};
/* This map associates the enumerations for the VALUE parameter with
the kinds of VALUEs. */
struct icalparameter_value_kind_map {
icalparameter_value value;
icalvalue_kind kind;
};
/* This map associates the parameter enumerations with a specific parameter and the string representation of the enumeration */
struct icalparameter_map {
icalparameter_kind kind;
int enumeration;
const char* str;
};
<insert_code_here>
const char* icalparameter_kind_to_string(icalparameter_kind kind)
{
int i;
for (i=0; parameter_map[i].kind != ICAL_NO_PARAMETER; i++) {
if (parameter_map[i].kind == kind) {
return parameter_map[i].name;
}
}
return 0;
}
icalparameter_kind icalparameter_string_to_kind(const char* string)
{
int i;
if (string ==0 ) {
return ICAL_NO_PARAMETER;
}
for (i=0; parameter_map[i].kind != ICAL_NO_PARAMETER; i++) {
if (strcmp(parameter_map[i].name, string) == 0) {
return parameter_map[i].kind;
}
}
if(strncmp(string,"X-",2)==0){
return ICAL_X_PARAMETER;
}
return ICAL_NO_PARAMETER;
}
icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value)
{
int i;
for (i=0; value_kind_map[i].kind != ICAL_NO_VALUE; i++) {
if (value_kind_map[i].value == value) {
return value_kind_map[i].kind;
}
}
return ICAL_NO_VALUE;
}
const char* icalparameter_enum_to_string(int e)
{
int i;
icalerror_check_arg_rz(e >= ICALPARAMETER_FIRST_ENUM,"e");
icalerror_check_arg_rz(e <= ICALPARAMETER_LAST_ENUM,"e");
for (i=0; icalparameter_map[i].kind != ICAL_NO_PARAMETER; i++){
if(e == icalparameter_map[i].enumeration){
return icalparameter_map[i].str;
}
}
return 0;
}
int icalparameter_string_to_enum(const char* str)
{
int i;
icalerror_check_arg_rz(str != 0,"str");
for (i=0; icalparameter_map[i].kind != ICAL_NO_PARAMETER; i++){
if(strcmp(str,icalparameter_map[i].str) == 0) {
return icalparameter_map[i].enumeration;
}
}
return 0;
}
icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind,const char* val)
{
struct icalparameter_impl* param=0;
int found_kind = 0;
int i;
icalerror_check_arg_rz((val!=0),"val");
/* Search through the parameter map to find a matching kind */
param = icalparameter_new_impl(kind);
for (i=0; icalparameter_map[i].kind != ICAL_NO_PARAMETER; i++){
if(kind == icalparameter_map[i].kind) {
found_kind = 1;
if(strcmp(val,icalparameter_map[i].str) == 0) {
param->data = (int)icalparameter_map[i].enumeration;
return param;
}
}
}
if(found_kind == 1){
/* The kind was in the parameter map, but the string did not
match, so assume that it is an alternate value, like an
X-value.*/
icalparameter_set_xvalue(param, val);
} else {
/* If the kind was not found, then it must be a string type */
((struct icalparameter_impl*)param)->string = icalmemory_strdup(val);
}
return param;
}

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

@ -0,0 +1,38 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalparam.h
CREATOR: eric 20 March 1999
$Id: icalderivedparameter.h.in,v 1.3 2002/05/27 20:55:36 ebusboom 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);
<insert_code_here>

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

@ -0,0 +1,285 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalderivedproperty.c
CREATOR: eric 15 Feb 2001
$Id: icalderivedproperty.c.in,v 1.13 2002/10/10 00:05:37 acampi Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalproperty.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalproperty.h"
#include "icalcomponent.h"
#include "pvl.h"
#include "icalenums.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "icalparser.h"
#include <string.h> /* For icalmemory_strdup, rindex */
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h> /* for printf */
#include <stdarg.h> /* for va_list, va_start, etc. */
struct icalproperty_impl*
icalproperty_new_impl (icalproperty_kind kind);
void icalproperty_add_parameters(struct icalproperty_impl *prop,va_list args);
/* This map associates the property kinds with the string
representation of the property name and the kind of VALUE that the
property uses as a default */
struct icalproperty_map {
icalproperty_kind kind;
const char *name;
icalvalue_kind value;
};
/* This map associates the property enumerations with the king of
property that they are used in and the string representation of the
enumeration */
struct icalproperty_enum_map {
icalproperty_kind prop;
int prop_enum;
const char* str;
};
<insert_code_here>
int icalproperty_kind_is_valid(const icalproperty_kind kind)
{
int i = 0;
do {
if (property_map[i].kind == kind)
return 1;
} while (property_map[i++].kind != ICAL_NO_PROPERTY);
return 0;
}
const char* icalproperty_kind_to_string(icalproperty_kind kind)
{
int i;
for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) {
if (property_map[i].kind == kind) {
return property_map[i].name;
}
}
return 0;
}
icalproperty_kind icalproperty_string_to_kind(const char* string)
{
int i;
if (string ==0 ) {
return ICAL_NO_PROPERTY;
}
for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) {
if (strcmp(property_map[i].name, string) == 0) {
return property_map[i].kind;
}
}
if(strncmp(string,"X-",2)==0){
return ICAL_X_PROPERTY;
}
return ICAL_NO_PROPERTY;
}
icalproperty_kind icalproperty_value_kind_to_kind(icalvalue_kind kind)
{
int i;
for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) {
if ( property_map[i].value == kind ) {
return property_map[i].kind;
}
}
return ICAL_NO_PROPERTY;
}
icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind)
{
int i;
for (i=0; property_map[i].kind != ICAL_NO_PROPERTY; i++) {
if ( property_map[i].kind == kind ) {
return property_map[i].value;
}
}
return ICAL_NO_VALUE;
}
const char* icalproperty_enum_to_string(int e)
{
icalerror_check_arg_rz(e >= ICALPROPERTY_FIRST_ENUM,"e");
icalerror_check_arg_rz(e <= ICALPROPERTY_LAST_ENUM,"e");
return enum_map[e-ICALPROPERTY_FIRST_ENUM].str;
}
int icalproperty_kind_and_string_to_enum(const int kind, const char* str)
{
icalproperty_kind pkind;
int i;
icalerror_check_arg_rz(str!=0,"str")
if ((pkind = icalproperty_value_kind_to_kind(kind)) == ICAL_NO_VALUE)
return 0;
while(*str == ' '){
str++;
}
for (i=ICALPROPERTY_FIRST_ENUM; i != ICALPROPERTY_LAST_ENUM; i++) {
if (enum_map[i-ICALPROPERTY_FIRST_ENUM].prop == pkind)
break;
}
if (i == ICALPROPERTY_LAST_ENUM)
return 0;
for (; i != ICALPROPERTY_LAST_ENUM; i++) {
if ( strcmp(enum_map[i-ICALPROPERTY_FIRST_ENUM].str, str) == 0) {
return enum_map[i-ICALPROPERTY_FIRST_ENUM].prop_enum;
}
}
return 0;
}
/** @deprecated please use icalproperty_kind_and_string_to_enum instead */
int icalproperty_string_to_enum(const char* str)
{
int i;
icalerror_check_arg_rz(str!=0,"str")
while(*str == ' '){
str++;
}
for (i=ICALPROPERTY_FIRST_ENUM; i != ICALPROPERTY_LAST_ENUM; i++) {
if ( strcmp(enum_map[i-ICALPROPERTY_FIRST_ENUM].str, str) == 0) {
return enum_map[i-ICALPROPERTY_FIRST_ENUM].prop_enum;
}
}
return 0;
}
int icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e)
{
int i;
for (i=ICALPROPERTY_FIRST_ENUM; i != ICALPROPERTY_LAST_ENUM; i++) {
if(enum_map[i-ICALPROPERTY_FIRST_ENUM].prop_enum == e &&
enum_map[i-ICALPROPERTY_FIRST_ENUM].prop == kind ){
return 1;
}
}
return 0;
}
const char* icalproperty_method_to_string(icalproperty_method method)
{
icalerror_check_arg_rz(method >= ICAL_METHOD_X,"method");
icalerror_check_arg_rz(method <= ICAL_METHOD_NONE,"method");
return enum_map[method-ICALPROPERTY_FIRST_ENUM].str;
}
icalproperty_method icalproperty_string_to_method(const char* str)
{
int i;
icalerror_check_arg_rx(str!=0,"str",ICAL_METHOD_NONE)
while(*str == ' '){
str++;
}
for (i=ICAL_METHOD_X-ICALPROPERTY_FIRST_ENUM;
i != ICAL_METHOD_NONE-ICALPROPERTY_FIRST_ENUM;
i++) {
if ( strcmp(enum_map[i].str, str) == 0) {
return (icalproperty_method)enum_map[i].prop_enum;
}
}
return ICAL_METHOD_NONE;
}
const char* icalenum_status_to_string(icalproperty_status status)
{
icalerror_check_arg_rz(status >= ICAL_STATUS_X,"status");
icalerror_check_arg_rz(status <= ICAL_STATUS_NONE,"status");
return enum_map[status-ICALPROPERTY_FIRST_ENUM].str;
}
icalproperty_status icalenum_string_to_status(const char* str)
{
int i;
icalerror_check_arg_rx(str!=0,"str",ICAL_STATUS_NONE)
while(*str == ' '){
str++;
}
for (i=ICAL_STATUS_X-ICALPROPERTY_FIRST_ENUM;
i != ICAL_STATUS_NONE-ICALPROPERTY_FIRST_ENUM;
i++) {
if ( strcmp(enum_map[i].str, str) == 0) {
return (icalproperty_status)enum_map[i].prop_enum;
}
}
return ICAL_STATUS_NONE;
}

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

@ -0,0 +1,22 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalderivedproperties.{c,h}
CREATOR: eric 09 May 1999
$Id: icalderivedproperty.h.in,v 1.6 2002/05/27 20:55:36 ebusboom 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;
<insert_code_here>

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

@ -0,0 +1,337 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalderivedvalue.c.in,v 1.11 2002/06/27 00:22:09 acampi Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalvalue.c
Contributions from:
Graham Davison (g.m.davison@computer.org)
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalerror.h"
#include "icalmemory.h"
#include "icalparser.h"
#include "icalenums.h"
#include "icalvalueimpl.h"
#include <stdlib.h> /* for malloc */
#include <stdio.h> /* for sprintf */
#include <string.h> /* For memset, others */
#include <stddef.h> /* For offsetof() macro */
#include <errno.h>
#include <time.h> /* for mktime */
#include <stdlib.h> /* for atoi and atof */
#include <limits.h> /* for SHRT_MAX */
struct icalvalue_impl* icalvalue_new_impl(icalvalue_kind kind);
/* This map associates each of the value types with its string
representation */
struct icalvalue_kind_map {
icalvalue_kind kind;
char name[20];
};
<insert_code_here>
int icalvalue_kind_is_valid(const icalvalue_kind kind)
{
int i = 0;
do {
if (value_map[i].kind == kind)
return 1;
} while (value_map[i++].kind != ICAL_NO_VALUE);
return 0;
}
const char* icalvalue_kind_to_string(const icalvalue_kind kind)
{
int i;
for (i=0; value_map[i].kind != ICAL_NO_VALUE; i++) {
if (value_map[i].kind == kind) {
return value_map[i].name;
}
}
return 0;
}
icalvalue_kind icalvalue_string_to_kind(const char* str)
{
int i;
for (i=0; value_map[i].kind != ICAL_NO_VALUE; i++) {
if (strcmp(value_map[i].name,str) == 0) {
return value_map[i].kind;
}
}
return value_map[i].kind;
}
icalvalue* icalvalue_new_x (const char* v){
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_X_VALUE);
icalerror_check_arg_rz( (v!=0),"v");
icalvalue_set_x((icalvalue*)impl,v);
return (icalvalue*)impl;
}
void icalvalue_set_x(icalvalue* impl, const char* v) {
icalerror_check_arg_rv( (impl!=0),"value");
icalerror_check_arg_rv( (v!=0),"v");
if(impl->x_value!=0) {free((void*)impl->x_value);}
impl->x_value = icalmemory_strdup(v);
if (impl->x_value == 0){
errno = ENOMEM;
}
}
const char* icalvalue_get_x(const icalvalue* value) {
icalerror_check_arg( (value!=0),"value");
icalerror_check_value_type(value, ICAL_X_VALUE);
return value->x_value;
}
/* Recur is a special case, so it is not auto generated. */
icalvalue*
icalvalue_new_recur (struct icalrecurrencetype v)
{
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_RECUR_VALUE);
icalvalue_set_recur((icalvalue*)impl,v);
return (icalvalue*)impl;
}
void
icalvalue_set_recur(icalvalue* impl, struct icalrecurrencetype v)
{
icalerror_check_arg_rv( (impl!=0),"value");
icalerror_check_value_type(value, ICAL_RECUR_VALUE);
if (impl->data.v_recur != 0){
free(impl->data.v_recur);
impl->data.v_recur = 0;
}
impl->data.v_recur = malloc(sizeof(struct icalrecurrencetype));
if (impl->data.v_recur == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return;
} else {
memcpy(impl->data.v_recur, &v, sizeof(struct icalrecurrencetype));
}
}
struct icalrecurrencetype
icalvalue_get_recur(const icalvalue* value)
{
icalerror_check_arg( (value!=0),"value");
icalerror_check_value_type(value, ICAL_RECUR_VALUE);
return *(value->data.v_recur);
}
icalvalue*
icalvalue_new_trigger (struct icaltriggertype v)
{
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TRIGGER_VALUE);
icalvalue_set_trigger((icalvalue*)impl,v);
return (icalvalue*)impl;
}
void
icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v)
{
icalerror_check_arg_rv( (value!=0),"value");
if(!icaltime_is_null_time(v.time)){
icalvalue_set_datetime(value,v.time);
value->kind = ICAL_DATETIME_VALUE;
} else {
icalvalue_set_duration(value,v.duration);
value->kind = ICAL_DURATION_VALUE;
}
}
struct icaltriggertype
icalvalue_get_trigger(const icalvalue* impl)
{
struct icaltriggertype tr;
icalerror_check_arg( (impl!=0),"value");
icalerror_check_arg( (impl!=0),"value");
if(impl->kind == ICAL_DATETIME_VALUE){
tr.duration = icaldurationtype_from_int(0);
tr.time = impl->data.v_time;
} else if(impl->kind == ICAL_DURATION_VALUE){
tr.time = icaltime_null_time();
tr.duration = impl->data.v_duration;
} else {
tr.duration = icaldurationtype_from_int(0);
tr.time = icaltime_null_time();
icalerror_set_errno(ICAL_BADARG_ERROR);
}
return tr;
}
/* DATE-TIME-PERIOD is a special case, and is not auto generated */
icalvalue*
icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v)
{
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATETIMEPERIOD_VALUE);
icalvalue_set_datetimeperiod(impl,v);
return (icalvalue*)impl;
}
void
icalvalue_set_datetimeperiod(icalvalue* impl, struct icaldatetimeperiodtype v)
{
icalerror_check_arg_rv( (impl!=0),"value");
icalerror_check_value_type(value, ICAL_DATETIMEPERIOD_VALUE);
if(!icaltime_is_null_time(v.time)){
if(!icaltime_is_valid_time(v.time)){
icalerror_set_errno(ICAL_BADARG_ERROR);
return;
}
impl->kind = ICAL_DATETIME_VALUE;
icalvalue_set_datetime(impl,v.time);
} else if (!icalperiodtype_is_null_period(v.period)) {
if(!icalperiodtype_is_valid_period(v.period)){
icalerror_set_errno(ICAL_BADARG_ERROR);
return;
}
impl->kind = ICAL_PERIOD_VALUE;
icalvalue_set_period(impl,v.period);
} else {
icalerror_set_errno(ICAL_BADARG_ERROR);
}
}
struct icaldatetimeperiodtype
icalvalue_get_datetimeperiod(const icalvalue* impl)
{
struct icaldatetimeperiodtype dtp;
icalerror_check_arg( (impl!=0),"value");
icalerror_check_value_type(value, ICAL_DATETIMEPERIOD_VALUE);
if(impl->kind == ICAL_DATETIME_VALUE){
dtp.period = icalperiodtype_null_period();
dtp.time = impl->data.v_time;
} else if(impl->kind == ICAL_PERIOD_VALUE) {
dtp.period = impl->data.v_period;
dtp.time = icaltime_null_time();
} else {
dtp.period = icalperiodtype_null_period();
dtp.time = icaltime_null_time();
icalerror_set_errno(ICAL_BADARG_ERROR);
}
return dtp;
}
icalvalue *
icalvalue_new_attach (icalattach *attach)
{
struct icalvalue_impl *impl;
icalerror_check_arg_rz ((attach != NULL), "attach");
impl = icalvalue_new_impl (ICAL_ATTACH_VALUE);
if (!impl) {
errno = ENOMEM;
return NULL;
}
icalvalue_set_attach ((icalvalue *) impl, attach);
return (icalvalue *) impl;
}
void
icalvalue_set_attach (icalvalue *value, icalattach *attach)
{
struct icalvalue_impl *impl;
icalerror_check_arg_rv ((value != NULL), "value");
icalerror_check_value_type (value, ICAL_ATTACH_VALUE);
icalerror_check_arg_rv ((attach != NULL), "attach");
impl = (struct icalvalue_impl *) value;
icalattach_ref (attach);
if (impl->data.v_attach)
icalattach_unref (impl->data.v_attach);
impl->data.v_attach = attach;
}
icalattach *
icalvalue_get_attach (const icalvalue *value)
{
icalerror_check_arg_rz ((value != NULL), "value");
icalerror_check_value_type (value, ICAL_ATTACH_VALUE);
return value->data.v_attach;
}
/* The remaining interfaces are 'new', 'set' and 'get' for each of the value
types */
/* Everything below this line is machine generated. Do not edit. */

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

@ -0,0 +1,65 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue.h
CREATOR: eric 20 March 1999
$Id: icalderivedvalue.h.in,v 1.9 2002/06/04 14:07:09 acampi 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);
<insert_code_here>

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

@ -0,0 +1,332 @@
/* -*- Mode: C -*-
======================================================================
FILE: icaltime.c
CREATOR: eric 02 June 2000
$Id: icalduration.c,v 1.16 2002/10/30 21:22:03 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is eric. The Initial Developer of the Original
Code is Eric Busboom
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalduration.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "icalerror.h"
#include "icalmemory.h"
#include "icalvalue.h"
/* From Seth Alves, <alves@hungry.com> */
struct icaldurationtype icaldurationtype_from_int(int t)
{
struct icaldurationtype dur;
int used = 0;
dur = icaldurationtype_null_duration();
if(t < 0){
dur.is_neg = 1;
t = -t;
}
if (t % (60 * 60 * 24 * 7) == 0) {
dur.weeks = t / (60 * 60 * 24 * 7);
} else {
used += dur.weeks * (60 * 60 * 24 * 7);
dur.days = (t - used) / (60 * 60 * 24);
used += dur.days * (60 * 60 * 24);
dur.hours = (t - used) / (60 * 60);
used += dur.hours * (60 * 60);
dur.minutes = (t - used) / (60);
used += dur.minutes * (60);
dur.seconds = (t - used);
}
return dur;
}
struct icaldurationtype icaldurationtype_from_string(const char* str)
{
int i;
int begin_flag = 0;
int time_flag = 0;
int date_flag = 0;
int week_flag = 0;
int digits=-1;
int scan_size = -1;
int size = strlen(str);
char p;
struct icaldurationtype d;
memset(&d, 0, sizeof(struct icaldurationtype));
for(i=0;i != size;i++){
p = str[i];
switch(p)
{
case '-': {
if(i != 0 || begin_flag == 1) goto error;
d.is_neg = 1;
break;
}
case 'P': {
if (i != 0 && i !=1 ) goto error;
begin_flag = 1;
break;
}
case 'T': {
time_flag = 1;
break;
}
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
/* HACK. Skip any more digits if the l;ast one
read has not been assigned */
if(digits != -1){
break;
}
if (begin_flag == 0) goto error;
/* Get all of the digits, not one at a time */
scan_size = sscanf(&str[i],"%d",&digits);
if(scan_size == 0) goto error;
break;
}
case 'H': {
if (time_flag == 0||week_flag == 1||d.hours !=0||digits ==-1)
goto error;
d.hours = digits; digits = -1;
break;
}
case 'M': {
if (time_flag == 0||week_flag==1||d.minutes != 0||digits ==-1)
goto error;
d.minutes = digits; digits = -1;
break;
}
case 'S': {
if (time_flag == 0||week_flag==1||d.seconds!=0||digits ==-1)
goto error;
d.seconds = digits; digits = -1;
break;
}
case 'W': {
if (time_flag==1||date_flag==1||d.weeks!=0||digits ==-1)
goto error;
week_flag = 1;
d.weeks = digits; digits = -1;
break;
}
case 'D': {
if (time_flag==1||week_flag==1||d.days!=0||digits ==-1)
goto error;
date_flag = 1;
d.days = digits; digits = -1;
break;
}
default: {
goto error;
}
}
}
return d;
error:
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return icaldurationtype_bad_duration();
}
#define TMP_BUF_SIZE 1024
static
void append_duration_segment(char** buf, char** buf_ptr, size_t* buf_size,
char* sep, unsigned int value) {
char temp[TMP_BUF_SIZE];
sprintf(temp,"%d",value);
icalmemory_append_string(buf, buf_ptr, buf_size, temp);
icalmemory_append_string(buf, buf_ptr, buf_size, sep);
}
char* icaldurationtype_as_ical_string(struct icaldurationtype d)
{
char *buf, *output_line;
size_t buf_size = 256;
char* buf_ptr = 0;
int seconds;
buf = (char*)icalmemory_new_buffer(buf_size);
buf_ptr = buf;
seconds = icaldurationtype_as_int(d);
if(seconds !=0){
if(d.is_neg == 1){
icalmemory_append_char(&buf, &buf_ptr, &buf_size, '-');
}
icalmemory_append_char(&buf, &buf_ptr, &buf_size, 'P');
if (d.weeks != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "W", d.weeks);
}
if (d.days != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "D", d.days);
}
if (d.hours != 0 || d.minutes != 0 || d.seconds != 0) {
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "T");
if (d.hours != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "H", d.hours);
}
if (d.minutes != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "M",
d.minutes);
}
if (d.seconds != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "S",
d.seconds);
}
}
} else {
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "PT0S");
}
output_line = icalmemory_tmp_copy(buf);
icalmemory_free_buffer(buf);
return output_line;
}
/* From Russel Steinthal */
int icaldurationtype_as_int(struct icaldurationtype dur)
{
return (int)( (dur.seconds +
(60 * dur.minutes) +
(60 * 60 * dur.hours) +
(60 * 60 * 24 * dur.days) +
(60 * 60 * 24 * 7 * dur.weeks))
* (dur.is_neg==1? -1 : 1) ) ;
}
struct icaldurationtype icaldurationtype_null_duration(void)
{
struct icaldurationtype d;
memset(&d,0,sizeof(struct icaldurationtype));
return d;
}
int icaldurationtype_is_null_duration(struct icaldurationtype d)
{
if(icaldurationtype_as_int(d) == 0){
return 1;
} else {
return 0;
}
}
/* in icalvalue_new_from_string_with_error, we should not call
icaldurationtype_is_null_duration() to see if there is an error
condition. Null duration is perfectly valid for an alarm.
We cannot depend on the caller to check icalerrno either,
following the philosophy of unix errno. we set the is_neg
to -1 to indicate that this is a bad duration.
*/
struct icaldurationtype icaldurationtype_bad_duration()
{
struct icaldurationtype d;
memset(&d,0,sizeof(struct icaldurationtype));
d.is_neg = -1;
return d;
}
int icaldurationtype_is_bad_duration(struct icaldurationtype d)
{
return (d.is_neg == -1);
}
struct icaltimetype icaltime_add(struct icaltimetype t,
struct icaldurationtype d)
{
int dt = icaldurationtype_as_int(d);
t.second += dt;
t = icaltime_normalize(t);
return t;
}
struct icaldurationtype icaltime_subtract(struct icaltimetype t1,
struct icaltimetype t2)
{
time_t t1t = icaltime_as_timet(t1);
time_t t2t = icaltime_as_timet(t2);
return icaldurationtype_from_int((int)(t1t-t2t));
}

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

@ -0,0 +1,62 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalduration.h
CREATOR: eric 26 Jan 2001
$Id: icalduration.h,v 1.3 2002/09/26 22:04:56 lindner Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is eric. The Initial Developer of the Original
Code is Eric Busboom
======================================================================*/
#ifndef ICALDURATION_H
#define ICALDURATION_H
#include "icaltime.h"
struct icaldurationtype
{
int is_neg;
unsigned int days;
unsigned int weeks;
unsigned int hours;
unsigned int minutes;
unsigned int seconds;
};
struct icaldurationtype icaldurationtype_from_int(int t);
struct icaldurationtype icaldurationtype_from_string(const char*);
int icaldurationtype_as_int(struct icaldurationtype duration);
char* icaldurationtype_as_ical_string(struct icaldurationtype d);
struct icaldurationtype icaldurationtype_null_duration(void);
struct icaldurationtype icaldurationtype_bad_duration(void);
int icaldurationtype_is_null_duration(struct icaldurationtype d);
int icaldurationtype_is_bad_duration(struct icaldurationtype d);
struct icaltimetype icaltime_add(struct icaltimetype t,
struct icaldurationtype d);
struct icaldurationtype icaltime_subtract(struct icaltimetype t1,
struct icaltimetype t2);
#endif /* !ICALDURATION_H */

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

@ -0,0 +1,166 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalenum.c
CREATOR: eric 29 April 1999
$Id: icalenums.c,v 1.13 2002/06/11 12:22:25 acampi Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalenum.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "icalenums.h"
#include <stdio.h> /* For fprintf */
#include <stdio.h> /* For stderr */
#include <string.h> /* For strncmp */
#include <assert.h>
#include "icalmemory.h"
/*** @brief Allowed request status values
*/
static struct {
enum icalrequeststatus kind;
int major;
int minor;
const char* str;
} request_status_map[] = {
{ICAL_2_0_SUCCESS_STATUS, 2,0,"Success."},
{ICAL_2_1_FALLBACK_STATUS, 2,1,"Success but fallback taken on one or more property values."},
{ICAL_2_2_IGPROP_STATUS, 2,2,"Success, invalid property ignored."},
{ICAL_2_3_IGPARAM_STATUS, 2,3,"Success, invalid property parameter ignored."},
{ICAL_2_4_IGXPROP_STATUS, 2,4,"Success, unknown non-standard property ignored."},
{ICAL_2_5_IGXPARAM_STATUS, 2,5,"Success, unknown non standard property value ignored."},
{ICAL_2_6_IGCOMP_STATUS, 2,6,"Success, invalid calendar component ignored."},
{ICAL_2_7_FORWARD_STATUS, 2,7,"Success, request forwarded to Calendar User."},
{ICAL_2_8_ONEEVENT_STATUS, 2,8,"Success, repeating event ignored. Scheduled as a single component."},
{ICAL_2_9_TRUNC_STATUS, 2,9,"Success, truncated end date time to date boundary."},
{ICAL_2_10_ONETODO_STATUS, 2,10,"Success, repeating VTODO ignored. Scheduled as a single VTODO."},
{ICAL_2_11_TRUNCRRULE_STATUS, 2,11,"Success, unbounded RRULE clipped at some finite number of instances "},
{ICAL_3_0_INVPROPNAME_STATUS, 3,0,"Invalid property name."},
{ICAL_3_1_INVPROPVAL_STATUS, 3,1,"Invalid property value."},
{ICAL_3_2_INVPARAM_STATUS, 3,2,"Invalid property parameter."},
{ICAL_3_3_INVPARAMVAL_STATUS, 3,3,"Invalid property parameter value."},
{ICAL_3_4_INVCOMP_STATUS, 3,4,"Invalid calendar component."},
{ICAL_3_5_INVTIME_STATUS, 3,5,"Invalid date or time."},
{ICAL_3_6_INVRULE_STATUS, 3,6,"Invalid rule."},
{ICAL_3_7_INVCU_STATUS, 3,7,"Invalid Calendar User."},
{ICAL_3_8_NOAUTH_STATUS, 3,8,"No authority."},
{ICAL_3_9_BADVERSION_STATUS, 3,9,"Unsupported version."},
{ICAL_3_10_TOOBIG_STATUS, 3,10,"Request entity too large."},
{ICAL_3_11_MISSREQCOMP_STATUS, 3,11,"Required component or property missing."},
{ICAL_3_12_UNKCOMP_STATUS, 3,12,"Unknown component or property found."},
{ICAL_3_13_BADCOMP_STATUS, 3,13,"Unsupported component or property found"},
{ICAL_3_14_NOCAP_STATUS, 3,14,"Unsupported capability."},
{ICAL_3_15_INVCOMMAND, 3,15,"Invalid command."},
{ICAL_4_0_BUSY_STATUS, 4,0,"Event conflict. Date/time is busy."},
{ICAL_4_1_STORE_ACCESS_DENIED, 4,1,"Store Access Denied."},
{ICAL_4_2_STORE_FAILED, 4,2,"Store Failed."},
{ICAL_4_3_STORE_NOT_FOUND, 4,3,"Store not found."},
{ICAL_5_0_MAYBE_STATUS, 5,0,"Request MAY supported."},
{ICAL_5_1_UNAVAIL_STATUS, 5,1,"Service unavailable."},
{ICAL_5_2_NOSERVICE_STATUS, 5,2,"Invalid calendar service."},
{ICAL_5_3_NOSCHED_STATUS, 5,3,"No scheduling support for user."},
{ICAL_6_1_CONTAINER_NOT_FOUND, 6,1,"Container not found."},
{ICAL_9_0_UNRECOGNIZED_COMMAND, 9,0,"An unrecognized command was received."},
{ICAL_UNKNOWN_STATUS, 0,0,"Error: Unknown request status"}
};
/*** @brief Return the descriptive text for a request status
*/
const char* icalenum_reqstat_desc(icalrequeststatus stat)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].kind == stat) {
return request_status_map[i].str;
}
}
return 0;
}
/*** @brief Return the code for a request status
*/
char* icalenum_reqstat_code(icalrequeststatus stat)
{
int i, major, minor;
char tmpbuf[36];
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].kind == stat) {
major = request_status_map[i].major;
minor = request_status_map[i].minor;
sprintf(tmpbuf, "%i.%i", major, minor);
return icalmemory_tmp_copy(tmpbuf);
}
}
return NULL;
}
/*** @brief Return the major number for a request status
*/
short icalenum_reqstat_major(icalrequeststatus stat)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].kind == stat) {
return request_status_map[i].major;
}
}
return -1;
}
/*** @brief Return the minor number for a request status
*/
short icalenum_reqstat_minor(icalrequeststatus stat)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].kind == stat) {
return request_status_map[i].minor;
}
}
return -1;
}
/*** @brief Return a request status for major/minor status numbers
*/
icalrequeststatus icalenum_num_to_reqstat(short major, short minor)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].major == major && request_status_map[i].minor == minor) {
return request_status_map[i].kind;
}
}
return 0;
}

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

@ -0,0 +1,166 @@
/* -*- Mode: C -*-*/
/*======================================================================
FILE: icalenums.h
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalenums.h
Contributions from:
Graham Davison (g.m.davison@computer.org)
======================================================================*/
#ifndef ICALENUMS_H
#define ICALENUMS_H
/***********************************************************************
* Component enumerations
**********************************************************************/
typedef enum icalcomponent_kind {
ICAL_NO_COMPONENT,
ICAL_ANY_COMPONENT, /* Used to select all components*/
ICAL_XROOT_COMPONENT,
ICAL_XATTACH_COMPONENT, /* MIME attached data, returned by parser. */
ICAL_VEVENT_COMPONENT,
ICAL_VTODO_COMPONENT,
ICAL_VJOURNAL_COMPONENT,
ICAL_VCALENDAR_COMPONENT,
ICAL_VAGENDA_COMPONENT,
ICAL_VFREEBUSY_COMPONENT,
ICAL_VALARM_COMPONENT,
ICAL_XAUDIOALARM_COMPONENT,
ICAL_XDISPLAYALARM_COMPONENT,
ICAL_XEMAILALARM_COMPONENT,
ICAL_XPROCEDUREALARM_COMPONENT,
ICAL_VTIMEZONE_COMPONENT,
ICAL_XSTANDARD_COMPONENT,
ICAL_XDAYLIGHT_COMPONENT,
ICAL_X_COMPONENT,
ICAL_VSCHEDULE_COMPONENT,
ICAL_VQUERY_COMPONENT,
ICAL_VREPLY_COMPONENT,
ICAL_VCAR_COMPONENT,
ICAL_VCOMMAND_COMPONENT,
ICAL_XLICINVALID_COMPONENT,
ICAL_XLICMIMEPART_COMPONENT /* a non-stardard component that mirrors
structure of MIME data */
} icalcomponent_kind;
/***********************************************************************
* Request Status codes
**********************************************************************/
typedef enum icalrequeststatus {
ICAL_UNKNOWN_STATUS,
ICAL_2_0_SUCCESS_STATUS,
ICAL_2_1_FALLBACK_STATUS,
ICAL_2_2_IGPROP_STATUS,
ICAL_2_3_IGPARAM_STATUS,
ICAL_2_4_IGXPROP_STATUS,
ICAL_2_5_IGXPARAM_STATUS,
ICAL_2_6_IGCOMP_STATUS,
ICAL_2_7_FORWARD_STATUS,
ICAL_2_8_ONEEVENT_STATUS,
ICAL_2_9_TRUNC_STATUS,
ICAL_2_10_ONETODO_STATUS,
ICAL_2_11_TRUNCRRULE_STATUS,
ICAL_3_0_INVPROPNAME_STATUS,
ICAL_3_1_INVPROPVAL_STATUS,
ICAL_3_2_INVPARAM_STATUS,
ICAL_3_3_INVPARAMVAL_STATUS,
ICAL_3_4_INVCOMP_STATUS,
ICAL_3_5_INVTIME_STATUS,
ICAL_3_6_INVRULE_STATUS,
ICAL_3_7_INVCU_STATUS,
ICAL_3_8_NOAUTH_STATUS,
ICAL_3_9_BADVERSION_STATUS,
ICAL_3_10_TOOBIG_STATUS,
ICAL_3_11_MISSREQCOMP_STATUS,
ICAL_3_12_UNKCOMP_STATUS,
ICAL_3_13_BADCOMP_STATUS,
ICAL_3_14_NOCAP_STATUS,
ICAL_3_15_INVCOMMAND,
ICAL_4_0_BUSY_STATUS,
ICAL_4_1_STORE_ACCESS_DENIED,
ICAL_4_2_STORE_FAILED,
ICAL_4_3_STORE_NOT_FOUND,
ICAL_5_0_MAYBE_STATUS,
ICAL_5_1_UNAVAIL_STATUS,
ICAL_5_2_NOSERVICE_STATUS,
ICAL_5_3_NOSCHED_STATUS,
ICAL_6_1_CONTAINER_NOT_FOUND,
ICAL_9_0_UNRECOGNIZED_COMMAND
} icalrequeststatus;
const char* icalenum_reqstat_desc(icalrequeststatus stat);
short icalenum_reqstat_major(icalrequeststatus stat);
short icalenum_reqstat_minor(icalrequeststatus stat);
icalrequeststatus icalenum_num_to_reqstat(short major, short minor);
char* icalenum_reqstat_code(icalrequeststatus stat);
/***********************************************************************
* Conversion functions
**********************************************************************/
/* Thse routines used to be in icalenums.c, but were moved into the
icalproperty, icalparameter, icalvalue, or icalcomponent modules. */
/* const char* icalproperty_kind_to_string(icalproperty_kind kind);*/
#define icalenum_property_kind_to_string(x) icalproperty_kind_to_string(x)
/*icalproperty_kind icalproperty_string_to_kind(const char* string)*/
#define icalenum_string_to_property_kind(x) icalproperty_string_to_kind(x)
/*icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind);*/
#define icalenum_property_kind_to_value_kind(x) icalproperty_kind_to_value_kind(x)
/*const char* icalenum_method_to_string(icalproperty_method);*/
#define icalenum_method_to_string(x) icalproperty_method_to_string(x)
/*icalproperty_method icalenum_string_to_method(const char* string);*/
#define icalenum_string_to_method(x) icalproperty_string_to_method(x)
/*const char* icalenum_status_to_string(icalproperty_status);*/
#define icalenum_status_to_string(x) icalproperty_status_to_string(x)
/*icalproperty_status icalenum_string_to_status(const char* string);*/
#define icalenum_string_to_status(x) icalproperty_string_to_status(x)
/*icalvalue_kind icalenum_string_to_value_kind(const char* str);*/
#define icalenum_string_to_value_kind(x) icalvalue_string_to_kind(x)
/*const char* icalenum_value_kind_to_string(icalvalue_kind kind);*/
#define icalenum_value_kind_to_string(x) icalvalue_kind_to_string(x)
/*const char* icalenum_component_kind_to_string(icalcomponent_kind kind);*/
#define icalenum_component_kind_to_string(x) icalcomponent_kind_to_string(x)
/*icalcomponent_kind icalenum_string_to_component_kind(const char* string);*/
#define icalenum_string_to_component_kind(x) icalcomponent_string_to_kind(x)
#endif /* !ICALENUMS_H */

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

@ -0,0 +1,251 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalerror.c
CREATOR: eric 16 May 1999
$Id: icalerror.c,v 1.17 2002/10/09 20:48:08 acampi 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 icalerror.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h> /* for malloc() */
#include <string.h> /* for strcmp */
#include "icalerror.h"
#ifdef HAVE_PTHREAD
#include <pthread.h>
static pthread_key_t icalerrno_key;
static pthread_once_t icalerrno_key_once = PTHREAD_ONCE_INIT;
static void icalerrno_destroy(void* buf) {
free(buf);
pthread_setspecific(icalerrno_key, NULL);
}
static void icalerrno_key_alloc(void) {
pthread_key_create(&icalerrno_key, icalerrno_destroy);
}
icalerrorenum *icalerrno_return(void) {
icalerrorenum *_errno;
pthread_once(&icalerrno_key_once, icalerrno_key_alloc);
_errno = (icalerrorenum*) pthread_getspecific(icalerrno_key);
if (!_errno) {
_errno = malloc(sizeof(icalerrorenum));
*_errno = ICAL_NO_ERROR;
pthread_setspecific(icalerrno_key, _errno);
}
return _errno;
}
#else
static icalerrorenum icalerrno_storage = ICAL_NO_ERROR;
icalerrorenum *icalerrno_return(void) {
return &icalerrno_storage;
}
#endif
static int foo;
void icalerror_stop_here(void)
{
foo++; /* Keep optimizers from removing routine */
}
void icalerror_crash_here(void)
{
int *p=0;
*p = 1;
assert( *p);
}
#ifdef ICAL_SETERROR_ISFUNC
void icalerror_set_errno(icalerrorenum x)
{
icalerrno = x;
if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL ||
(icalerror_get_error_state(x)==ICAL_ERROR_DEFAULT &&
icalerror_errors_are_fatal == 1 )){
icalerror_warn(icalerror_strerror(x));
assert(0);
}
}
#endif
void icalerror_clear_errno() {
icalerrno = ICAL_NO_ERROR;
}
#ifdef ICAL_ERRORS_ARE_FATAL
int icalerror_errors_are_fatal = 1;
#else
int icalerror_errors_are_fatal = 0;
#endif
struct icalerror_state {
icalerrorenum error;
icalerrorstate state;
};
static struct icalerror_state error_state_map[] =
{
{ ICAL_BADARG_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_NEWFAILED_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_ALLOCATION_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_PARSE_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_INTERNAL_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_FILE_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_USAGE_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_UNIMPLEMENTED_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_UNKNOWN_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_NO_ERROR,ICAL_ERROR_DEFAULT}
};
struct icalerror_string_map {
const char* str;
icalerrorenum error;
char name[160];
};
static struct icalerror_string_map string_map[] =
{
{"BADARG",ICAL_BADARG_ERROR,"BADARG: Bad argument to function"},
{ "NEWFAILED",ICAL_NEWFAILED_ERROR,"NEWFAILED: Failed to create a new object via a *_new() routine"},
{ "ALLOCATION",ICAL_ALLOCATION_ERROR,"ALLOCATION: Failed to allocate new memory"},
{"MALFORMEDDATA",ICAL_MALFORMEDDATA_ERROR,"MALFORMEDDATA: An input string was not correctly formed or a component has missing or extra properties"},
{ "PARSE",ICAL_PARSE_ERROR,"PARSE: Failed to parse a part of an iCal component"},
{"INTERNAL",ICAL_INTERNAL_ERROR,"INTERNAL: Random internal error. This indicates an error in the library code, not an error in use"},
{ "FILE",ICAL_FILE_ERROR,"FILE: An operation on a file failed. Check errno for more detail."},
{ "USAGE",ICAL_USAGE_ERROR,"USAGE: Failed to propertyl sequence calls to a set of interfaces"},
{ "UNIMPLEMENTED",ICAL_UNIMPLEMENTED_ERROR,"UNIMPLEMENTED: This feature has not been implemented"},
{ "NO",ICAL_NO_ERROR,"NO: No error"},
{"UNKNOWN",ICAL_UNKNOWN_ERROR,"UNKNOWN: Unknown error type -- icalerror_strerror() was probably given bad input"}
};
icalerrorenum icalerror_error_from_string(const char* str){
icalerrorenum e;
int i = 0;
for( i = 0; string_map[i].error != ICAL_NO_ERROR; i++){
if (strcmp(string_map[i].str,str) == 0){
e = string_map[i].error;
}
}
return e;
}
icalerrorstate icalerror_supress(const char* error){
icalerrorenum e = icalerror_error_from_string(error);
icalerrorstate es;
if (e == ICAL_NO_ERROR){
return ICAL_ERROR_UNKNOWN;
}
es = icalerror_get_error_state(e);
icalerror_set_error_state(e,ICAL_ERROR_NONFATAL);
return es;
}
char* icalerror_perror()
{
return icalerror_strerror(icalerrno);
}
void icalerror_restore(const char* error, icalerrorstate es){
icalerrorenum e = icalerror_error_from_string(error);
if (e != ICAL_NO_ERROR){
icalerror_set_error_state(e,es);
}
}
void icalerror_set_error_state( icalerrorenum error,
icalerrorstate state)
{
int i;
for(i = 0; error_state_map[i].error!= ICAL_NO_ERROR;i++){
if(error_state_map[i].error == error){
error_state_map[i].state = state;
}
}
}
icalerrorstate icalerror_get_error_state( icalerrorenum error)
{
int i;
for(i = 0; error_state_map[i].error!= ICAL_NO_ERROR;i++){
if(error_state_map[i].error == error){
return error_state_map[i].state;
}
}
return ICAL_ERROR_UNKNOWN;
}
char* icalerror_strerror(icalerrorenum e) {
int i;
for (i=0; string_map[i].error != ICAL_UNKNOWN_ERROR; i++) {
if (string_map[i].error == e) {
return string_map[i].name;
}
}
return string_map[i].name; /* Return string for ICAL_UNKNOWN_ERROR*/
}

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

@ -0,0 +1,160 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalerror.h
CREATOR: eric 09 May 1999
$Id: icalerror.h,v 1.14 2002/07/21 14:58:17 lindner Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalerror.h
======================================================================*/
#ifndef ICALERROR_H
#define ICALERROR_H
#include <assert.h>
#include <stdio.h> /* For icalerror_warn() */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define ICAL_SETERROR_ISFUNC
/** This routine is called before any error is triggered. It is called
by icalerror_set_errno, so it does not appear in all of the macros
below */
void icalerror_stop_here(void);
void icalerror_crash_here(void);
typedef enum icalerrorenum {
ICAL_NO_ERROR, /* icalerrno may not be initialized - put it first so and pray that the compiler initialize things to zero */
ICAL_BADARG_ERROR,
ICAL_NEWFAILED_ERROR,
ICAL_ALLOCATION_ERROR,
ICAL_MALFORMEDDATA_ERROR,
ICAL_PARSE_ERROR,
ICAL_INTERNAL_ERROR, /* Like assert --internal consist. prob */
ICAL_FILE_ERROR,
ICAL_USAGE_ERROR,
ICAL_UNIMPLEMENTED_ERROR,
ICAL_UNKNOWN_ERROR /* Used for problems in input to icalerror_strerror()*/
} icalerrorenum;
icalerrorenum * icalerrno_return(void);
#define icalerrno (*(icalerrno_return()))
/** If true, libicl aborts after a call to icalerror_set_error
*
* @warning NOT THREAD SAFE -- recommended that you do not change
* this in a multithreaded program.
*/
extern int icalerror_errors_are_fatal;
/* Warning messages */
#ifdef __GNUC__ca
#define icalerror_warn(message) {fprintf(stderr,"%s(), %s:%d: %s\n",__FUNCTION__,__FILE__,__LINE__,message);}
#else /* __GNU_C__ */
#define icalerror_warn(message) {fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);}
#endif /* __GNU_C__ */
void icalerror_clear_errno(void);
void _icalerror_set_errno(icalerrorenum);
/* Make an individual error fatal or non-fatal. */
typedef enum icalerrorstate {
ICAL_ERROR_FATAL, /* Not fata */
ICAL_ERROR_NONFATAL, /* Fatal */
ICAL_ERROR_DEFAULT, /* Use the value of icalerror_errors_are_fatal*/
ICAL_ERROR_UNKNOWN /* Asked state for an unknown error type */
} icalerrorstate ;
char* icalerror_strerror(icalerrorenum e);
char* icalerror_perror();
void icalerror_set_error_state( icalerrorenum error, icalerrorstate);
icalerrorstate icalerror_get_error_state( icalerrorenum error);
#ifndef ICAL_SETERROR_ISFUNC
#define icalerror_set_errno(x) \
icalerrno = x; \
if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || \
(icalerror_get_error_state(x)==ICAL_ERROR_DEFAULT && \
icalerror_errors_are_fatal == 1 )){ \
icalerror_warn(icalerror_strerror(x)); \
assert(0); \
}
#else
void icalerror_set_errno(icalerrorenum x);
#endif
#ifdef ICAL_ERRORS_ARE_FATAL
#undef NDEBUG
#endif
#define icalerror_check_value_type(value,type);
#define icalerror_check_property_type(value,type);
#define icalerror_check_parameter_type(value,type);
#define icalerror_check_component_type(value,type);
/* Assert with a message */
#ifdef ICAL_ERRORS_ARE_FATAL
#ifdef __GNUC__
#define icalerror_assert(test,message) if(!(test)){fprintf(stderr,"%s(), %s:%d: %s\n",__FUNCTION__,__FILE__,__LINE__,message);icalerror_stop_here(); abort();}
#else /*__GNUC__*/
#define icalerror_assert(test,message) if(!(test)){fprintf(stderr,"%s:%d: %s\n",__FILE__,__LINE__,message);icalerror_stop_here(); abort();}
#endif /*__GNUC__*/
#else /* ICAL_ERRORS_ARE_FATAL */
#define icalerror_assert(test,message)
#endif /* ICAL_ERRORS_ARE_FATAL */
/* Check & abort if check fails */
#define icalerror_check_arg(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); }
/* Check & return void if check fails*/
#define icalerror_check_arg_rv(test,arg) if(!(test)) {icalerror_set_errno(ICAL_BADARG_ERROR); return; }
/* Check & return 0 if check fails*/
#define icalerror_check_arg_rz(test,arg) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return 0;}
/* Check & return an error if check fails*/
#define icalerror_check_arg_re(test,arg,error) if(!(test)) { icalerror_stop_here(); assert(0); return error;}
/* Check & return something*/
#define icalerror_check_arg_rx(test,arg,x) if(!(test)) { icalerror_set_errno(ICAL_BADARG_ERROR); return x;}
/* String interfaces to set an error to NONFATAL and restore it to its
original value */
icalerrorstate icalerror_supress(const char* error);
void icalerror_restore(const char* error, icalerrorstate es);
#endif /* !ICALERROR_H */

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

@ -0,0 +1,312 @@
/* -*- Mode: C -*-
======================================================================
FILE: icallangbind.c
CREATOR: eric 15 dec 2000
DESCRIPTION:
$Id: icallangbind.c,v 1.22 2002/10/24 13:44:30 acampi Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
http://www.softwarestudio.org
This package is free software and is provided "as is" without
express or implied warranty. It may be used, redistributed and/or
modified under the same terms as perl itself. ( Either the Artistic
License or the GPL. )
======================================================================*/
#include "icalcomponent.h"
#include "icalproperty.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "icalvalue.h"
#include <stdlib.h>
#include <string.h>
#ifdef WIN32
#define snprintf _snprintf
#define strcasecmp stricmp
#endif
int* icallangbind_new_array(int size){
int* p = (int*)malloc(size*sizeof(int));
return p; /* Caller handles failures */
}
void icallangbind_free_array(int* array){
free(array);
}
int icallangbind_access_array(int* array, int index) {
return array[index];
}
/** Iterators to fetch parameters given property */
icalparameter* icallangbind_get_first_parameter(icalproperty *prop)
{
icalparameter_kind kind = ICAL_ANY_PARAMETER;
return icalproperty_get_first_parameter(prop,kind);
}
icalparameter* icallangbind_get_next_parameter(icalproperty *prop)
{
icalparameter_kind kind = ICAL_ANY_PARAMETER;
return icalproperty_get_next_parameter(prop,kind);
}
/** Like icalcomponent_get_first_component(), but takes a string for the
kind and can iterate over X properties as if each X name was a
seperate kind */
icalproperty* icallangbind_get_first_property(icalcomponent *c,
const char* prop)
{
icalproperty_kind kind = icalproperty_string_to_kind(prop);
icalproperty *p;
if (kind == ICAL_NO_PROPERTY){
return 0;
}
if(kind == ICAL_X_PROPERTY){
for(p = icalcomponent_get_first_property(c,kind);
p !=0;
p = icalcomponent_get_next_property(c,kind)){
if(strcmp(icalproperty_get_x_name(p),prop) == 0){
return p;
}
}
} else {
p=icalcomponent_get_first_property(c,kind);
return p;
}
return 0;
}
icalproperty* icallangbind_get_next_property(icalcomponent *c,
const char* prop)
{
icalproperty_kind kind = icalenum_string_to_property_kind(prop);
icalproperty *p;
if (kind == ICAL_NO_PROPERTY){
return 0;
}
if(kind == ICAL_X_PROPERTY){
for(p = icalcomponent_get_next_property(c,kind);
p !=0;
p = icalcomponent_get_next_property(c,kind)){
if(strcmp(icalproperty_get_x_name(p),prop) == 0){
return p;
}
}
} else {
p=icalcomponent_get_next_property(c,kind);
return p;
}
return 0;
}
icalcomponent* icallangbind_get_first_component(icalcomponent *c,
const char* comp)
{
icalcomponent_kind kind = icalenum_string_to_component_kind(comp);
if (kind == ICAL_NO_COMPONENT){
return 0;
}
return icalcomponent_get_first_component(c,kind);
}
icalcomponent* icallangbind_get_next_component(icalcomponent *c,
const char* comp)
{
icalcomponent_kind kind = icalenum_string_to_component_kind(comp);
if (kind == ICAL_NO_COMPONENT){
return 0;
}
return icalcomponent_get_next_component(c,kind);
}
#define APPENDS(x) icalmemory_append_string(&buf, &buf_ptr, &buf_size, x);
#define APPENDC(x) icalmemory_append_char(&buf, &buf_ptr, &buf_size, x);
const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
{
char tmp[25];
size_t buf_size = 1024;
char* buf = icalmemory_new_buffer(buf_size);
char* buf_ptr = buf;
icalparameter *param;
icalvalue* value;
if( prop == 0){
return 0;
}
APPENDS("{ ");
value = icalproperty_get_value(prop);
APPENDS(" 'name' ");
APPENDS(sep);
APPENDC('\'');
APPENDS(icalproperty_kind_to_string(icalproperty_isa(prop)));
APPENDC('\'');
if(value){
APPENDS(", 'value_type' ");
APPENDS(sep);
APPENDC('\'');
APPENDS(icalvalue_kind_to_string(icalvalue_isa(value)));
APPENDC('\'');
}
APPENDS(", 'pid' ");
APPENDS(sep);
APPENDC('\'');
snprintf(tmp,25,"%p",prop);
APPENDS(tmp);
APPENDC('\'');
if(value){
switch (icalvalue_isa(value)){
case ICAL_ATTACH_VALUE:
case ICAL_BINARY_VALUE:
case ICAL_NO_VALUE: {
icalerror_set_errno(ICAL_INTERNAL_ERROR);
break;
}
default:
{
const char* str = icalvalue_as_ical_string(value);
char* copy = (char*) malloc(strlen(str)+1);
const char *i;
char *j;
if(copy ==0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
break;
}
/* Remove any newlines */
for(j=copy, i = str; *i != 0; j++,i++){
if(*i=='\n'){
i++;
}
*j = *i;
}
*j = 0;
APPENDS(", 'value'");
APPENDS(sep);
APPENDC('\'');
APPENDS(copy);
APPENDC('\'');
free(copy);
break;
}
}
}
/* Add Parameters */
for(param = icalproperty_get_first_parameter(prop,ICAL_ANY_PARAMETER);
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 *v;
if(copy == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
continue;
}
v = strchr(copy,'=');
if(v == 0){
continue;
}
*v = 0;
v++;
APPENDS(", ");
APPENDC('\'');
APPENDS(copy);
APPENDC('\'');
APPENDS(sep);
APPENDC('\'');
APPENDS(v);
APPENDC('\'');
}
APPENDC('}');
icalmemory_add_tmp_buffer(buf);
return buf;
}
#include "fcntl.h"
int icallangbind_string_to_open_flag(const char* str)
{
if (strcmp(str,"r") == 0) {return O_RDONLY;}
else if (strcmp(str,"r+") == 0) {return O_RDWR;}
else if (strcmp(str,"w") == 0) {return O_WRONLY;}
else if (strcmp(str,"w+") == 0) {return O_RDWR|O_CREAT;}
else if (strcmp(str,"a") == 0) {return O_WRONLY|O_APPEND;}
else return -1;
}
const char* icallangbind_quote_as_ical(const char* str)
{
size_t buf_size = 2 * strlen(str);
/* assume every char could be quoted */
char* buf = icalmemory_new_buffer(buf_size);
int result;
result = icalvalue_encode_ical_string(str, buf, buf_size);
icalmemory_add_tmp_buffer(buf);
return buf;
}

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

@ -0,0 +1,54 @@
/* -*- Mode: C -*-
======================================================================
FILE: icallangbind.h
CREATOR: eric 25 jan 2001
DESCRIPTION:
$Id: icallangbind.h,v 1.6 2002/10/24 13:44:30 acampi Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
http://www.softwarestudio.org
This package is free software and is provided "as is" without
express or implied warranty. It may be used, redistributed and/or
modified under the same terms as perl itself. ( Either the Artistic
License or the GPL. )
======================================================================*/
#ifndef __ICALLANGBIND_H__
#define __ICALLANGBIND_H__
int* icallangbind_new_array(int size);
void icallangbind_free_array(int* array);
int icallangbind_access_array(int* array, int index);
icalproperty* icallangbind_get_property(icalcomponent *c, int n, const char* prop);
const char* icallangbind_get_property_val(icalproperty* p);
const char* icallangbind_get_parameter(icalproperty *p, const char* parameter);
icalcomponent* icallangbind_get_component(icalcomponent *c, const char* comp);
icalproperty* icallangbind_get_first_property(icalcomponent *c,
const char* prop);
icalproperty* icallangbind_get_next_property(icalcomponent *c,
const char* prop);
icalcomponent* icallangbind_get_first_component(icalcomponent *c,
const char* comp);
icalcomponent* icallangbind_get_next_component(icalcomponent *c,
const char* comp);
icalparameter* icallangbind_get_first_parameter(icalproperty *prop);
icalparameter* icallangbind_get_next_parameter(icalproperty *prop);
const char* icallangbind_property_eval_string(icalproperty* prop, char* sep);
int icallangbind_string_to_open_flag(const char* str);
const char* icallangbind_quote_as_ical(const char* str);
#endif /*__ICALLANGBIND_H__*/

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

@ -0,0 +1,367 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalmemory.c
CREATOR: eric 30 June 1999
$Id: icalmemory.c,v 1.10 2002/08/09 14:28:56 lindner Exp $
$Locker: $
The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is icalmemory.h
======================================================================*/
/**
* @file icalmemory.c
* @brief Common memory management routines.
*
* libical often passes strings back to the caller. To make these
* interfaces simple, I did not want the caller to have to pass in a
* memory buffer, but having libical pass out newly allocated memory
* makes it difficult to de-allocate the memory.
*
* The ring buffer in this scheme makes it possible for libical to pass
* out references to memory which the caller does not own, and be able
* to de-allocate the memory later. The ring allows libical to have
* several buffers active simultaneously, which is handy when creating
* string representations of components.
*/
#define ICALMEMORY_C
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef DMALLOC
#include "dmalloc.h"
#endif
#include "icalmemory.h"
#include "icalerror.h"
#include <stdio.h> /* for printf (debugging) */
#include <stdlib.h> /* for malloc, realloc */
#include <string.h> /* for memset(), strdup */
#ifdef WIN32
#include <windows.h>
#endif
#define BUFFER_RING_SIZE 2500
#define MIN_BUFFER_SIZE 200
/* HACK. Not threadsafe */
typedef struct {
int pos;
void *ring[BUFFER_RING_SIZE];
} buffer_ring;
void icalmemory_free_tmp_buffer (void* buf);
void icalmemory_free_ring_byval(buffer_ring *br);
static buffer_ring* global_buffer_ring = 0;
#ifdef HAVE_PTHREAD
#include <pthread.h>
static pthread_key_t ring_key;
static pthread_once_t ring_key_once = PTHREAD_ONCE_INIT;
static void ring_destroy(void * buf) {
if (buf) icalmemory_free_ring_byval((buffer_ring *) buf);
pthread_setspecific(ring_key, NULL);
}
static void ring_key_alloc(void) {
pthread_key_create(&ring_key, ring_destroy);
}
#endif
static buffer_ring * buffer_ring_new(void) {
buffer_ring *br;
int i;
br = (buffer_ring *)malloc(sizeof(buffer_ring));
for(i=0; i<BUFFER_RING_SIZE; i++){
br->ring[i] = 0;
}
br->pos = 0;
return(br);
}
#ifdef HAVE_PTHREAD
static buffer_ring* get_buffer_ring_pthread(void) {
buffer_ring *br;
pthread_once(&ring_key_once, ring_key_alloc);
br = pthread_getspecific(ring_key);
if (!br) {
br = buffer_ring_new();
pthread_setspecific(ring_key, br);
}
return(br);
}
#endif
/* 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) {
global_buffer_ring = buffer_ring_new();
}
return(global_buffer_ring);
}
static buffer_ring *get_buffer_ring(void) {
#ifdef HAVE_PTHREAD
return(get_buffer_ring_pthread());
#else
return get_buffer_ring_global();
#endif
}
/** Add an existing buffer to the buffer ring */
void icalmemory_add_tmp_buffer(void* buf)
{
buffer_ring *br = get_buffer_ring();
/* Wrap around the ring */
if(++(br->pos) == BUFFER_RING_SIZE){
br->pos = 0;
}
/* Free buffers as their slots are overwritten */
if ( br->ring[br->pos] != 0){
free( br->ring[br->pos]);
}
/* Assign the buffer to a slot */
br->ring[br->pos] = buf;
}
/**
* Create a new temporary buffer on the ring. Libical owns these and
* will deallocate them.
*/
void*
icalmemory_tmp_buffer (size_t size)
{
char *buf;
if (size < MIN_BUFFER_SIZE){
size = MIN_BUFFER_SIZE;
}
buf = (void*)malloc(size);
if( buf == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
memset(buf,0,size);
icalmemory_add_tmp_buffer(buf);
return buf;
}
/** get rid of this buffer ring */
void icalmemory_free_ring_byval(buffer_ring *br) {
int i;
for(i=0; i<BUFFER_RING_SIZE; i++){
if ( br->ring[i] != 0){
free( br->ring[i]);
}
}
free(br);
}
void icalmemory_free_ring()
{
buffer_ring *br;
br = get_buffer_ring();
icalmemory_free_ring_byval(br);
}
/** Like strdup, but the buffer is on the ring. */
char*
icalmemory_tmp_copy(const char* str)
{
char* b = icalmemory_tmp_buffer(strlen(str)+1);
strcpy(b,str);
return b;
}
char* icalmemory_strdup(const char *s)
{
return strdup(s);
}
void
icalmemory_free_tmp_buffer (void* buf)
{
if(buf == 0)
{
return;
}
free(buf);
}
/*
* These buffer routines create memory the old fashioned way -- so the
* caller will have to deallocate the new memory
*/
void* icalmemory_new_buffer(size_t size)
{
void *b = malloc(size);
if( b == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
memset(b,0,size);
return b;
}
void* icalmemory_resize_buffer(void* buf, size_t size)
{
void *b = realloc(buf, size);
if( b == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
return b;
}
void icalmemory_free_buffer(void* buf)
{
free(buf);
}
void
icalmemory_append_string(char** buf, char** pos, size_t* buf_size,
const char* string)
{
char *new_buf;
char *new_pos;
size_t data_length, final_length, string_length;
#ifndef ICAL_NO_INTERNAL_DEBUG
icalerror_check_arg_rv( (buf!=0),"buf");
icalerror_check_arg_rv( (*buf!=0),"*buf");
icalerror_check_arg_rv( (pos!=0),"pos");
icalerror_check_arg_rv( (*pos!=0),"*pos");
icalerror_check_arg_rv( (buf_size!=0),"buf_size");
icalerror_check_arg_rv( (*buf_size!=0),"*buf_size");
icalerror_check_arg_rv( (string!=0),"string");
#endif
string_length = strlen(string);
data_length = (size_t)*pos - (size_t)*buf;
final_length = data_length + string_length;
if ( final_length >= (size_t) *buf_size) {
*buf_size = (*buf_size) * 2 + final_length;
new_buf = realloc(*buf,*buf_size);
new_pos = (void*)((size_t)new_buf + data_length);
*pos = new_pos;
*buf = new_buf;
}
strcpy(*pos, string);
*pos += string_length;
}
void
icalmemory_append_char(char** buf, char** pos, size_t* buf_size,
char ch)
{
char *new_buf;
char *new_pos;
size_t data_length, final_length;
#ifndef ICAL_NO_INTERNAL_DEBUG
icalerror_check_arg_rv( (buf!=0),"buf");
icalerror_check_arg_rv( (*buf!=0),"*buf");
icalerror_check_arg_rv( (pos!=0),"pos");
icalerror_check_arg_rv( (*pos!=0),"*pos");
icalerror_check_arg_rv( (buf_size!=0),"buf_size");
icalerror_check_arg_rv( (*buf_size!=0),"*buf_size");
#endif
data_length = (size_t)*pos - (size_t)*buf;
final_length = data_length + 2;
if ( final_length > (size_t) *buf_size ) {
*buf_size = (*buf_size) * 2 + final_length +1;
new_buf = realloc(*buf,*buf_size);
new_pos = (void*)((size_t)new_buf + data_length);
*pos = new_pos;
*buf = new_buf;
}
**pos = ch;
*pos += 1;
**pos = 0;
}

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

@ -0,0 +1,84 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalmemory.h
CREATOR: eric 30 June 1999
$Id: icalmemory.h,v 1.4 2002/06/11 12:15:11 acampi Exp $
$Locker: $
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Initial Developer of the Original Code is Eric Busboom
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
======================================================================*/
#ifndef ICALMEMORY_H
#define ICALMEMORY_H
#ifndef WIN32
#include <sys/types.h> /* for size_t */
#else
#include <stddef.h>
#endif
/* Tmp buffers are managed by ical. References can be returned to the
caller, although the caller will not own the memory. */
void* icalmemory_tmp_buffer(size_t size);
char* icalmemory_tmp_copy(const char* str);
/** Add an externally allocated buffer to the ring. */
void icalmemory_add_tmp_buffer(void*);
/** Free all memory used in the ring */
void icalmemory_free_ring(void);
/* Non-tmp buffers must be freed. These are mostly wrappers around
* malloc, etc, but are used so the caller can change the memory
* allocators in a future version of the library */
void* icalmemory_new_buffer(size_t size);
void* icalmemory_resize_buffer(void* buf, size_t size);
void icalmemory_free_buffer(void* buf);
/**
icalmemory_append_string will copy the string 'string' to the
buffer 'buf' starting at position 'pos', reallocing 'buf' if it is
too small. 'buf_size' is the size of 'buf' and will be changed if
'buf' is reallocated. 'pos' will point to the last byte of the new
string in 'buf', usually a '\0' */
/* THESE ROUTINES CAN NOT BE USED ON TMP BUFFERS. Only use them on
normally allocated memory, or on buffers created from
icalmemory_new_buffer, never with buffers created by
icalmemory_tmp_buffer. If icalmemory_append_string has to resize a
buffer on the ring, the ring will loose track of it an you will
have memory problems. */
void icalmemory_append_string(char** buf, char** pos, size_t* buf_size,
const char* string);
/** icalmemory_append_char is similar, but is appends a character instead of a string */
void icalmemory_append_char(char** buf, char** pos, size_t* buf_size,
char ch);
/** A wrapper around strdup. Partly to trap calls to strdup, partly
because in -ansi, gcc on Red Hat claims that strdup is undeclared */
char* icalmemory_strdup(const char *s);
#endif /* !ICALMEMORY_H */

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

@ -0,0 +1,394 @@
/* -*- Mode: C -*-*/
/*======================================================================
FILE: icalmime.c
CREATOR: eric 26 July 2000
$Id: icalmime.c,v 1.7 2003/05/09 14:30:06 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is eric. The Initial Developer of the Original
Code is Eric Busboom
======================================================================*/
#include "icalmime.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "sspm.h"
#include "stdlib.h"
#include <string.h> /* For strdup */
#include <stdio.h> /* for snprintf*/
#ifdef DMALLOC
#include "dmalloc.h"
#endif
#ifdef WIN32
#define snprintf _snprintf
#define strcasecmp stricmp
#endif
/* These *_part routines are called by the MIME parser via the
local_action_map */
struct text_part
{
char* buf;
char* buf_pos;
size_t buf_size;
};
void* icalmime_text_new_part()
{
#define BUF_SIZE 2048
struct text_part* impl;
if ( ( impl = (struct text_part*)
malloc(sizeof(struct text_part))) == 0) {
return 0;
}
impl->buf = icalmemory_new_buffer(BUF_SIZE);
impl->buf_pos = impl->buf;
impl->buf_size = BUF_SIZE;
return impl;
}
void icalmime_text_add_line(void *part,
struct sspm_header *header,
char* line, size_t size)
{
struct text_part* impl = (struct text_part*) part;
icalmemory_append_string(&(impl->buf),&(impl->buf_pos),
&(impl->buf_size),line);
}
void* icalmime_textcalendar_end_part(void* part)
{
struct text_part* impl = (struct text_part*) part;
icalcomponent *c = icalparser_parse_string(impl->buf);
icalmemory_free_buffer(impl->buf);
free(impl);
return c;
}
void* icalmime_text_end_part(void* part)
{
struct text_part* impl = ( struct text_part*) part;
icalmemory_add_tmp_buffer(impl->buf);
free(impl);
return impl->buf;
}
void icalmime_text_free_part(void *part)
{
part = part;
}
/* Ignore Attachments for now */
void* icalmime_attachment_new_part()
{
return 0;
}
void icalmime_attachment_add_line(void *part, struct sspm_header *header,
char* line, size_t size)
{
part = part;
header = header;
line = line;
size = size;
}
void* icalmime_attachment_end_part(void* part)
{
return 0;
}
void icalmime_attachment_free_part(void *part)
{
}
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_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},
{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_UNKNOWN_MAJOR_TYPE,SSPM_UNKNOWN_MINOR_TYPE,0,0,0,0}
};
#define NUM_PARTS 100 /* HACK. Hard Limit */
struct sspm_part* icalmime_make_part(icalcomponent* comp)
{
comp = comp;
return 0;
}
char* icalmime_as_mime_string(char* icalcomponent);
icalcomponent* icalmime_parse(char* (*get_string)(char *s, size_t size,
void *d),
void *data)
{
struct sspm_part *parts;
int i, last_level=0;
icalcomponent *root=0, *parent=0, *comp=0, *last = 0;
if ( (parts = (struct sspm_part *)
malloc(NUM_PARTS*sizeof(struct sspm_part)))==0) {
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
memset(parts,0,sizeof(parts));
sspm_parse_mime(parts,
NUM_PARTS, /* Max parts */
icalmime_local_action_map, /* Actions */
get_string,
data, /* data for get_string*/
0 /* First header */);
for(i = 0; i <NUM_PARTS && parts[i].header.major != SSPM_NO_MAJOR_TYPE ; i++){
#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);
if(parts[i].header.minor == SSPM_UNKNOWN_MINOR_TYPE ){
assert(parts[i].header.minor_text !=0);
minor = parts[i].header.minor_text;
}
sprintf(mimetype,"%s/%s",major,minor);
comp = icalcomponent_new(ICAL_XLICMIMEPART_COMPONENT);
if(comp == 0){
/* HACK Handle Error */
assert(0);
}
if(parts[i].header.error!=SSPM_NO_ERROR){
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";
}
if(parts[i].header.error==SSPM_WRONG_BOUNDARY_ERROR){
str = "Got the wrong boundary for the opening of a MULTIPART part.";
}
if(parts[i].header.error==SSPM_NO_BOUNDARY_ERROR){
str = "Got a multipart header that did not specify a boundary";
}
if(parts[i].header.error==SSPM_NO_HEADER_ERROR){
str = "Did not get a header for the part. Is there a blank\
line between the header and the previous boundary\?";
}
if(parts[i].header.error_text != 0){
snprintf(temp,sizeof(temp),
"%s: %s",str,parts[i].header.error_text);
} else {
strcpy(temp,str);
}
icalcomponent_add_property
(comp,
icalproperty_vanew_xlicerror(
temp,
icalparameter_new_xlicerrortype(
ICAL_XLICERRORTYPE_MIMEPARSEERROR),
0));
}
if(parts[i].header.major != SSPM_NO_MAJOR_TYPE &&
parts[i].header.major != SSPM_UNKNOWN_MAJOR_TYPE){
icalcomponent_add_property(comp,
icalproperty_new_xlicmimecontenttype((char*)
icalmemory_strdup(mimetype)));
}
if (parts[i].header.encoding != SSPM_NO_ENCODING){
icalcomponent_add_property(comp,
icalproperty_new_xlicmimeencoding(
sspm_encoding_string(parts[i].header.encoding)));
}
if (parts[i].header.filename != 0){
icalcomponent_add_property(comp,
icalproperty_new_xlicmimefilename(parts[i].header.filename));
}
if (parts[i].header.content_id != 0){
icalcomponent_add_property(comp,
icalproperty_new_xlicmimecid(parts[i].header.content_id));
}
if (parts[i].header.charset != 0){
icalcomponent_add_property(comp,
icalproperty_new_xlicmimecharset(parts[i].header.charset));
}
/* Add iCal components as children of the component */
if(parts[i].header.major == SSPM_TEXT_MAJOR_TYPE &&
parts[i].header.minor == SSPM_CALENDAR_MINOR_TYPE &&
parts[i].data != 0){
icalcomponent_add_component(comp,
(icalcomponent*)parts[i].data);
parts[i].data = 0;
} else if(parts[i].header.major == SSPM_TEXT_MAJOR_TYPE &&
parts[i].header.minor != SSPM_CALENDAR_MINOR_TYPE &&
parts[i].data != 0){
/* Add other text components as "DESCRIPTION" properties */
icalcomponent_add_property(comp,
icalproperty_new_description(
(char*)icalmemory_strdup((char*)parts[i].data)));
parts[i].data = 0;
}
if(root!= 0 && parts[i].level == 0){
/* We've already assigned the root, but there is another
part at the root level. This is probably a parse
error*/
icalcomponent_free(comp);
continue;
}
if(parts[i].level == last_level && last_level != 0){
icalerror_assert(parent!=0,"No parent for adding component");
icalcomponent_add_component(parent,comp);
} else if (parts[i].level == last_level && last_level == 0 &&
root == 0) {
root = comp;
parent = comp;
} else if (parts[i].level > last_level){
parent = last;
icalcomponent_add_component(parent,comp);
last_level = parts[i].level;
} else if (parts[i].level < last_level){
parent = icalcomponent_get_parent(parent);
icalcomponent_add_component(parent,comp);
last_level = parts[i].level;
} else {
assert(0);
}
last = comp;
last_level = parts[i].level;
assert(parts[i].data == 0);
}
sspm_free_parts(parts,NUM_PARTS);
free(parts);
return root;
}
int icalmime_test(char* (*get_string)(char *s, size_t size, void *d),
void *data)
{
char *out;
struct sspm_part *parts;
int i;
if ( (parts = (struct sspm_part *)
malloc(NUM_PARTS*sizeof(struct sspm_part)))==0) {
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
memset(parts,0,sizeof(parts));
sspm_parse_mime(parts,
NUM_PARTS, /* Max parts */
icalmime_local_action_map, /* Actions */
get_string,
data, /* data for get_string*/
0 /* First header */);
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));
}
}
sspm_write_mime(parts,NUM_PARTS,&out,"To: bob@bob.org");
printf("%s\n",out);
return 0;
}

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

@ -0,0 +1,43 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalmime.h
CREATOR: eric 26 July 2000
$Id: icalmime.h,v 1.1.1.1 2001/01/02 07:33:02 ebusboom Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
======================================================================*/
#ifndef ICALMIME_H
#define ICALMIME_H
#include "icalcomponent.h"
#include "icalparser.h"
icalcomponent* icalmime_parse( char* (*line_gen_func)(char *s, size_t size,
void *d),
void *data);
/* The inverse of icalmime_parse, not implemented yet. Use sspm.h directly. */
char* icalmime_as_mime_string(char* component);
#endif /* !ICALMIME_H */

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

@ -0,0 +1,289 @@
/* -*- 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);
}

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

@ -0,0 +1,159 @@
/* -*- 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

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

@ -0,0 +1,52 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalparameterimpl.h
CREATOR: eric 09 May 1999
$Id: icalparameterimpl.h,v 1.2 2001/03/26 19:17:28 ebusboom Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalderivedparameters.{c,h}
Contributions from:
Graham Davison (g.m.davison@computer.org)
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef ICALPARAMETER_IMPL
#define ICALPARAMETER_IMPL
#include "icalparameter.h"
#include "icalproperty.h"
struct icalparameter_impl
{
icalparameter_kind kind;
char id[5];
int size;
const char* string;
const char* x_name;
icalproperty* parent;
int data;
};
#endif /*ICALPARAMETER_IMPL*/

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

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

@ -0,0 +1,96 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalparser.h
CREATOR: eric 20 April 1999
$Id: icalparser.h,v 1.7 2002/06/28 08:55:23 acampi Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalparser.h
======================================================================*/
#ifndef ICALPARSER_H
#define ICALPARSER_H
#include "icalenums.h"
#include "icaltypes.h"
#include"icalcomponent.h"
#include <stdio.h> /* For FILE* */
typedef struct icalparser_impl icalparser;
/**
* @file icalparser.h
* @brief Line-oriented parsing.
*
* Create a new parser via icalparse_new_parser, then add lines one at
* a time with icalparse_add_line(). icalparser_add_line() will return
* non-zero when it has finished with a component.
*/
typedef enum icalparser_state {
ICALPARSER_ERROR,
ICALPARSER_SUCCESS,
ICALPARSER_BEGIN_COMP,
ICALPARSER_END_COMP,
ICALPARSER_IN_PROGRESS
} icalparser_state;
icalparser* icalparser_new(void);
icalcomponent* icalparser_add_line(icalparser* parser, char* str );
icalcomponent* icalparser_clean(icalparser* parser);
icalparser_state icalparser_get_state(icalparser* parser);
void icalparser_free(icalparser* parser);
/**
* Message oriented parsing. icalparser_parse takes a string that
* holds the text ( in RFC 2445 format ) and returns a pointer to an
* icalcomponent. The caller owns the memory. line_gen_func is a
* pointer to a function that returns one content line per invocation
*/
icalcomponent* icalparser_parse(icalparser *parser,
char* (*line_gen_func)(char *s, size_t size, void *d));
/**
Set the data that icalparser_parse will give to the line_gen_func
as the parameter 'd'
*/
void icalparser_set_gen_data(icalparser* parser, void* data);
icalcomponent* icalparser_parse_string(const char* str);
/***********************************************************************
* Parser support functions
***********************************************************************/
/** Use the flex/bison parser to turn a string into a value type */
icalvalue* icalparser_parse_value(icalvalue_kind kind,
const char* str, icalcomponent** errors);
/** Given a line generator function, return a single iCal content line.*/
char* icalparser_get_line(icalparser* parser, char* (*line_gen_func)(char *s, size_t size, void *d));
char* icalparser_string_line_generator(char *out, size_t buf_size, void *d);
#endif /* !ICALPARSE_H */

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

@ -0,0 +1,170 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalperiod.c
CREATOR: eric 02 June 2000
$Id: icalperiod.c,v 1.11 2002/10/30 21:22:03 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is eric. The Initial Developer of the Original
Code is Eric Busboom
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalperiod.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "icalerror.h"
#include "icalmemory.h"
struct icalperiodtype icalperiodtype_from_string (const char* str)
{
struct icalperiodtype p, null_p;
char *s = icalmemory_strdup(str);
char *start, *end = s;
icalerrorstate es;
/* Errors are normally generated in the following code, so save
the error state for resoration later */
icalerrorenum e = icalerrno;
p.start = p.end = icaltime_null_time();
p.duration = icaldurationtype_from_int(0);
null_p = p;
if(s == 0) goto error;
start = s;
end = strchr(s, '/');
if(end == 0) goto error;
*end = 0;
end++;
p.start = icaltime_from_string(start);
if (icaltime_is_null_time(p.start)) goto error;
es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR);
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL);
p.end = icaltime_from_string(end);
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
if (icaltime_is_null_time(p.end)){
p.duration = icaldurationtype_from_string(end);
if(icaldurationtype_as_int(p.duration) == 0) goto error;
}
icalerrno = e;
icalmemory_free_buffer(s);
return p;
error:
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
if (s)
icalmemory_free_buffer (s);
return null_p;
}
const char* icalperiodtype_as_ical_string(struct icalperiodtype p)
{
const char* start;
const char* end;
char *buf;
size_t buf_size = 40;
char* buf_ptr = 0;
buf = (char*)icalmemory_new_buffer(buf_size);
buf_ptr = buf;
start = icaltime_as_ical_string(p.start);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, start);
if(!icaltime_is_null_time(p.end)){
end = icaltime_as_ical_string(p.end);
} else {
end = icaldurationtype_as_ical_string(p.duration);
}
icalmemory_append_char(&buf, &buf_ptr, &buf_size, '/');
icalmemory_append_string(&buf, &buf_ptr, &buf_size, end);
icalmemory_add_tmp_buffer(buf);
return buf;
}
struct icalperiodtype icalperiodtype_null_period(void) {
struct icalperiodtype p;
p.start = icaltime_null_time();
p.end = icaltime_null_time();
p.duration = icaldurationtype_null_duration();
return p;
}
int icalperiodtype_is_null_period(struct icalperiodtype p){
if(icaltime_is_null_time(p.start) &&
icaltime_is_null_time(p.end) &&
icaldurationtype_is_null_duration(p.duration)){
return 1;
} else {
return 0;
}
}
int icalperiodtype_is_valid_period(struct icalperiodtype p){
if(icaltime_is_valid_time(p.start) &&
(icaltime_is_valid_time(p.end) || icaltime_is_null_time(p.end)) )
{
return 1;
}
return 0;
}

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

@ -0,0 +1,55 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalperiod.h
CREATOR: eric 26 Jan 2001
$Id: icalperiod.h,v 1.4 2002/06/28 11:11:24 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is eric. The Initial Developer of the Original
Code is Eric Busboom
======================================================================*/
#ifndef ICALPERIOD_H
#define ICALPERIOD_H
#include "icaltime.h"
#include "icalduration.h"
struct icalperiodtype
{
struct icaltimetype start;
struct icaltimetype end;
struct icaldurationtype duration;
};
struct icalperiodtype icalperiodtype_from_string (const char* str);
const char* icalperiodtype_as_ical_string(struct icalperiodtype p);
struct icalperiodtype icalperiodtype_null_period(void);
int icalperiodtype_is_null_period(struct icalperiodtype p);
int icalperiodtype_is_valid_period(struct icalperiodtype p);
#endif /* !ICALTIME_H */

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

@ -0,0 +1,704 @@
/* -*- 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);
}

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

@ -0,0 +1,365 @@
/* -*- 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 */

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

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

@ -0,0 +1,215 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalrecur.h
CREATOR: eric 20 March 2000
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
*/
/**
@file icalrecur.h
@brief Routines for dealing with recurring time
How to use:
1) Get a rule and a start time from a component
@code
icalproperty rrule;
struct icalrecurrencetype recur;
struct icaltimetype dtstart;
rrule = icalcomponent_get_first_property(comp,ICAL_RRULE_PROPERTY);
recur = icalproperty_get_rrule(rrule);
start = icalproperty_get_dtstart(dtstart);
@endcode
Or, just make them up:
@code
recur = icalrecurrencetype_from_string("FREQ=YEARLY;BYDAY=SU,WE");
dtstart = icaltime_from_string("19970101T123000")
@endcode
2) Create an iterator
@code
icalrecur_iterator* ritr;
ritr = icalrecur_iterator_new(recur,start);
@endcode
3) Iterator over the occurrences
@code
struct icaltimetype next;
while (next = icalrecur_iterator_next(ritr)
&& !icaltime_is_null_time(next){
Do something with next
}
@endcode
Note that that the time returned by icalrecur_iterator_next is in
whatever timezone that dtstart is in.
*/
#ifndef ICALRECUR_H
#define ICALRECUR_H
#include <time.h>
#include "icaltime.h"
/*
* Recurrance enumerations
*/
typedef enum icalrecurrencetype_frequency
{
/* These enums are used to index an array, so don't change the
order or the integers */
ICAL_SECONDLY_RECURRENCE=0,
ICAL_MINUTELY_RECURRENCE=1,
ICAL_HOURLY_RECURRENCE=2,
ICAL_DAILY_RECURRENCE=3,
ICAL_WEEKLY_RECURRENCE=4,
ICAL_MONTHLY_RECURRENCE=5,
ICAL_YEARLY_RECURRENCE=6,
ICAL_NO_RECURRENCE=7
} icalrecurrencetype_frequency;
typedef enum icalrecurrencetype_weekday
{
ICAL_NO_WEEKDAY,
ICAL_SUNDAY_WEEKDAY,
ICAL_MONDAY_WEEKDAY,
ICAL_TUESDAY_WEEKDAY,
ICAL_WEDNESDAY_WEEKDAY,
ICAL_THURSDAY_WEEKDAY,
ICAL_FRIDAY_WEEKDAY,
ICAL_SATURDAY_WEEKDAY
} icalrecurrencetype_weekday;
enum {
ICAL_RECURRENCE_ARRAY_MAX = 0x7f7f,
ICAL_RECURRENCE_ARRAY_MAX_BYTE = 0x7f
};
/**
* Recurrence type routines
*/
/* See RFC 2445 Section 4.3.10, RECUR Value, for an explaination of
the values and fields in struct icalrecurrencetype */
#define ICAL_BY_SECOND_SIZE 61
#define ICAL_BY_MINUTE_SIZE 61
#define ICAL_BY_HOUR_SIZE 25
#define ICAL_BY_DAY_SIZE 364 /* 7 days * 52 weeks */
#define ICAL_BY_MONTHDAY_SIZE 32
#define ICAL_BY_YEARDAY_SIZE 367
#define ICAL_BY_WEEKNO_SIZE 54
#define ICAL_BY_MONTH_SIZE 13
#define ICAL_BY_SETPOS_SIZE 367
/** Main struct for holding digested recurrence rules */
struct icalrecurrencetype
{
icalrecurrencetype_frequency freq;
/* until and count are mutually exclusive. */
struct icaltimetype until;
int count;
short interval;
icalrecurrencetype_weekday week_start;
/* The BY* parameters can each take a list of values. Here I
* assume that the list of values will not be larger than the
* range of the value -- that is, the client will not name a
* value more than once.
* Each of the lists is terminated with the value
* ICAL_RECURRENCE_ARRAY_MAX unless the the list is full.
*/
short by_second[ICAL_BY_SECOND_SIZE];
short by_minute[ICAL_BY_MINUTE_SIZE];
short by_hour[ICAL_BY_HOUR_SIZE];
short by_day[ICAL_BY_DAY_SIZE]; /* Encoded value, see below */
short by_month_day[ICAL_BY_MONTHDAY_SIZE];
short by_year_day[ ICAL_BY_YEARDAY_SIZE];
short by_week_no[ICAL_BY_WEEKNO_SIZE];
short by_month[ICAL_BY_MONTH_SIZE];
short by_set_pos[ICAL_BY_SETPOS_SIZE];
};
void icalrecurrencetype_clear(struct icalrecurrencetype *r);
/**
* Array Encoding
*
* The 'day' element of the by_day array is encoded to allow
* representation of both the day of the week ( Monday, Tueday), but also
* the Nth day of the week ( First tuesday of the month, last thursday of
* the year) These routines decode the day values
*/
/** 1 == Monday, etc. */
enum icalrecurrencetype_weekday icalrecurrencetype_day_day_of_week(short day);
/** 0 == any of day of week. 1 == first, 2 = second, -2 == second to last, etc */
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);
/** Recurrence iteration routines */
typedef struct icalrecur_iterator_impl icalrecur_iterator;
/** Create a new recurrence rule iterator */
icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
struct icaltimetype dtstart);
/** Get the next occurrence from an iterator */
struct icaltimetype icalrecur_iterator_next(icalrecur_iterator*);
void icalrecur_iterator_decrement_count(icalrecur_iterator*);
/** Free the iterator */
void icalrecur_iterator_free(icalrecur_iterator*);
/**
* Fills array up with at most 'count' time_t values, each
* representing an occurrence time in seconds past the POSIX epoch
*/
int icalrecur_expand_recurrence(char* rule, time_t start,
int count, time_t* array);
#endif

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

@ -0,0 +1,465 @@
/* -*- Mode: C -*- */
/* ======================================================================
File: icalrestriction.c
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
======================================================================*/
/*#line 7 "icalrestriction.c.in"*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalrestriction.h"
#include "icalenums.h"
#include "icalerror.h"
#include <assert.h>
#include <stdio.h> /* For snprintf */
#define TMP_BUF_SIZE 1024
#ifdef WIN32
#define snprintf _snprintf
#define strcasecmp stricmp
#endif
/* Define the structs for the restrictions. these data are filled out
in machine generated code below */
struct icalrestriction_property_record;
typedef char* (*restriction_func)(struct icalrestriction_property_record* rec,icalcomponent* comp,icalproperty* prop);
typedef struct icalrestriction_property_record {
icalproperty_method method;
icalcomponent_kind component;
icalproperty_kind property;
icalrestriction_kind restriction;
restriction_func function;
} icalrestriction_property_record;
typedef struct icalrestriction_component_record {
icalproperty_method method;
icalcomponent_kind component;
icalcomponent_kind subcomponent;
icalrestriction_kind restriction;
restriction_func function;
} icalrestriction_component_record;
icalrestriction_property_record*
icalrestriction_get_property_restriction(icalproperty_method method,
icalcomponent_kind component,
icalproperty_kind property);
icalrestriction_component_record*
icalrestriction_get_component_restriction(icalproperty_method method,
icalcomponent_kind component,
icalcomponent_kind subcomponent);
icalrestriction_component_record icalrestriction_component_records[];
icalrestriction_property_record icalrestriction_property_records[];
icalrestriction_property_record null_prop_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_PROPERTY,ICAL_RESTRICTION_UNKNOWN,0};
icalrestriction_component_record null_comp_record = {ICAL_METHOD_NONE,ICAL_NO_COMPONENT,ICAL_NO_COMPONENT,ICAL_RESTRICTION_UNKNOWN,0};
/** The each row gives the result of comparing a restriction against a
count. The columns in each row represent 0,1,2+. '-1' indicates
'invalid, 'don't care' or 'needs more analysis' So, for
ICAL_RESTRICTION_ONE, if there is 1 of a property with that
restriction, it passes, but if there are 0 or 2+, it fails. */
char compare_map[ICAL_RESTRICTION_UNKNOWN+1][3] = {
{ 1, 1, 1},/*ICAL_RESTRICTION_NONE*/
{ 1, 0, 0},/*ICAL_RESTRICTION_ZERO*/
{ 0, 1, 0},/*ICAL_RESTRICTION_ONE*/
{ 1, 1, 1},/*ICAL_RESTRICTION_ZEROPLUS*/
{ 0, 1, 1},/*ICAL_RESTRICTION_ONEPLUS*/
{ 1, 1, 0},/*ICAL_RESTRICTION_ZEROORONE*/
{ 1, 1, 0},/*ICAL_RESTRICTION_ONEEXCLUSIVE*/
{ 1, 1, 0},/*ICAL_RESTRICTION_ONEMUTUAL*/
{ 1, 1, 1} /*ICAL_RESTRICTION_UNKNOWN*/
};
char restr_string_map[ICAL_RESTRICTION_UNKNOWN+1][60] = {
"unknown number",/*ICAL_RESTRICTION_NONE*/
"0",/*ICAL_RESTRICTION_ZERO*/
"1",/*ICAL_RESTRICTION_ONE*/
"zero or more",/*ICAL_RESTRICTION_ZEROPLUS*/
"one or more" ,/*ICAL_RESTRICTION_ONEPLUS*/
"zero or one",/*ICAL_RESTRICTION_ZEROORONE*/
"zero or one, exclusive with another property",/*ICAL_RESTRICTION_ONEEXCLUSIVE*/
"zero or one, mutual with another property",/*ICAL_RESTRICTION_ONEMUTUAL*/
"unknown number" /*ICAL_RESTRICTION_UNKNOWN*/
};
int
icalrestriction_compare(icalrestriction_kind restr, int count){
if ( restr < ICAL_RESTRICTION_NONE || restr > ICAL_RESTRICTION_UNKNOWN
|| count < 0){
return -1;
}
if (count > 2) {
count = 2;
}
return compare_map[restr][count];
}
/* Special case routines */
char* icalrestriction_may_be_draft_final_canceled(
icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_status(prop);
if( !( stat == ICAL_STATUS_DRAFT ||
stat == ICAL_STATUS_FINAL ||
stat == ICAL_STATUS_CANCELLED )){
return "Failed iTIP restrictions for STATUS property. Value must be one of DRAFT, FINAL, or CANCELED";
}
return 0;
}
char* icalrestriction_may_be_comp_need_process(
icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_status(prop);
if( !( stat == ICAL_STATUS_COMPLETED ||
stat == ICAL_STATUS_NEEDSACTION ||
stat == ICAL_STATUS_INPROCESS )){
return "Failed iTIP restrictions for STATUS property. Value must be one of COMPLETED, NEEDS-ACTION or IN-PROCESS";
}
return 0;
}
char* icalrestriction_may_be_tent_conf(icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
icalproperty_status stat = icalproperty_get_status(prop);
if( !( stat == ICAL_STATUS_TENTATIVE ||
stat == ICAL_STATUS_CONFIRMED )){
return "Failed iTIP restrictions for STATUS property. Value must be one of TENTATIVE or CONFIRMED";
}
return 0;
}
char* icalrestriction_may_be_tent_conf_cancel(
icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_status(prop);
if( !( stat == ICAL_STATUS_TENTATIVE ||
stat == ICAL_STATUS_CONFIRMED ||
stat == ICAL_STATUS_CANCELLED )){
return "Failed iTIP restrictions for STATUS property. Value must be one of TENTATIVE, CONFIRMED or CANCELED";
}
return 0;
}
char* icalrestriction_must_be_cancel_if_present(
icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
/* This routine will not be called if prop == 0 */
icalproperty_status stat = icalproperty_get_status(prop);
if( stat != ICAL_STATUS_CANCELLED)
{
return "Failed iTIP restrictions for STATUS property. Value must be CANCELLED";
}
return 0;
}
char* icalrestriction_must_be_canceled_no_attendee(
icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
/* Hack. see rfc2446, 3.2.5 CANCEL for porperty STATUS. I don't
understand the note */
return 0;
}
char* icalrestriction_must_be_recurring(icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
/* Hack */
return 0;
}
char* icalrestriction_must_have_duration(icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
if( !icalcomponent_get_first_property(comp,ICAL_DURATION_PROPERTY)){
return "Failed iTIP restrictions. This component must have a DURATION property";
}
return 0;
}
char* icalrestriction_must_have_repeat(icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
if( !icalcomponent_get_first_property(comp,ICAL_REPEAT_PROPERTY)){
return "Failed iTIP restrictions. This component must have a REPEAT property";
}
return 0;
}
char* icalrestriction_must_if_tz_ref(icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
/* Hack */
return 0;
}
char* icalrestriction_no_dtend(icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
if( icalcomponent_get_first_property(comp,ICAL_DTEND_PROPERTY)){
return "Failed iTIP restrictions. The component must not have both DURATION and DTEND";
}
return 0;
}
char* icalrestriction_no_duration(icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop){
/* _no_dtend takes care of this one */
return 0;
}
char* icalrestriction_must_be_email(
icalrestriction_property_record *rec,
icalcomponent* comp,
icalproperty* prop)
{
icalproperty_status stat = icalproperty_get_action(prop);
if( !( stat == ICAL_ACTION_EMAIL)){
return "Failed iTIP restrictions for ACTION property. Value must be EMAIL.";
}
return 0;
}
int icalrestriction_check_component(icalproperty_method method,
icalcomponent* comp)
{
icalproperty_kind kind;
icalcomponent_kind comp_kind;
icalrestriction_kind restr;
icalrestriction_property_record *prop_record;
char* funcr = 0;
icalproperty *prop;
int count;
int compare;
int valid = 1;
comp_kind = icalcomponent_isa(comp);
/* Check all of the properties in this component */
for(kind = ICAL_ANY_PROPERTY+1; kind != ICAL_NO_PROPERTY; kind++){
count = icalcomponent_count_properties(comp, kind);
prop_record = icalrestriction_get_property_restriction(method,
comp_kind,
kind);
restr = prop_record->restriction;
if(restr == ICAL_RESTRICTION_ONEEXCLUSIVE ||
restr == ICAL_RESTRICTION_ONEMUTUAL) {
/* First treat is as a 0/1 restriction */
restr = ICAL_RESTRICTION_ZEROORONE;
compare = icalrestriction_compare(restr,count);
} else {
compare = icalrestriction_compare(restr,count);
}
assert(compare != -1);
if (compare == 0){
char temp[TMP_BUF_SIZE];
snprintf(temp, TMP_BUF_SIZE,"Failed iTIP restrictions for %s property. Expected %s instances of the property and got %d",
icalenum_property_kind_to_string(kind),
restr_string_map[restr], count);
icalcomponent_add_property
(comp,
icalproperty_vanew_xlicerror(
temp,
icalparameter_new_xlicerrortype(ICAL_XLICERRORTYPE_INVALIDITIP),
0));
}
prop = icalcomponent_get_first_property(comp, kind);
if (prop != 0 && prop_record->function !=0 ){
funcr = prop_record->function(prop_record,comp,prop);
}
if(funcr !=0){
icalcomponent_add_property
(comp,
icalproperty_vanew_xlicerror(
funcr,
icalparameter_new_xlicerrortype(
ICAL_XLICERRORTYPE_INVALIDITIP),
0));
compare = 0;
}
valid = valid && compare;
}
return valid;
}
int icalrestriction_check(icalcomponent* outer_comp)
{
icalcomponent_kind comp_kind;
icalproperty_method method;
icalcomponent* inner_comp;
icalproperty *method_prop;
int valid;
icalerror_check_arg_rz( (outer_comp!=0), "outer comp");
/* Get the Method value from the outer component */
comp_kind = icalcomponent_isa(outer_comp);
if (comp_kind != ICAL_VCALENDAR_COMPONENT){
icalerror_set_errno(ICAL_BADARG_ERROR);
return 0;
}
method_prop = icalcomponent_get_first_property(outer_comp,
ICAL_METHOD_PROPERTY);
if (method_prop == 0){
method = ICAL_METHOD_NONE;
} else {
method = icalproperty_get_method(method_prop);
}
/* Check the VCALENDAR wrapper */
valid = icalrestriction_check_component(ICAL_METHOD_NONE,outer_comp);
/* Now check the inner components */
for(inner_comp= icalcomponent_get_first_component(outer_comp,
ICAL_ANY_COMPONENT);
inner_comp != 0;
inner_comp= icalcomponent_get_next_component(outer_comp,
ICAL_ANY_COMPONENT)){
valid = valid && icalrestriction_check_component(method,inner_comp);
}
return valid;
}
icalrestriction_property_record*
icalrestriction_get_property_restriction(icalproperty_method method,
icalcomponent_kind component,
icalproperty_kind property)
{
int i;
for(i = 0;
icalrestriction_property_records[i].restriction != ICAL_RESTRICTION_NONE;
i++){
if (method == icalrestriction_property_records[i].method &&
component == icalrestriction_property_records[i].component &&
property == icalrestriction_property_records[i].property ){
return &icalrestriction_property_records[i];
}
}
return &null_prop_record;
}
icalrestriction_component_record*
icalrestriction_get_component_restriction(icalproperty_method method,
icalcomponent_kind component,
icalcomponent_kind subcomponent)
{
int i;
for(i = 0;
icalrestriction_component_records[i].restriction != ICAL_RESTRICTION_NONE;
i++){
if (method == icalrestriction_component_records[i].method &&
component == icalrestriction_component_records[i].component &&
subcomponent == icalrestriction_component_records[i].subcomponent ){
return &icalrestriction_component_records[i];
}
}
return &null_comp_record;
}

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

@ -0,0 +1,63 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalrestriction.h
CREATOR: eric 24 April 1999
$Id: icalrestriction.h,v 1.1.1.1 2001/01/02 07:33:02 ebusboom Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalrestriction.h
Contributions from:
Graham Davison (g.m.davison@computer.org)
======================================================================*/
#include "icalproperty.h"
#include "icalcomponent.h"
#ifndef ICALRESTRICTION_H
#define ICALRESTRICTION_H
/* These must stay in this order for icalrestriction_compare to work */
typedef enum icalrestriction_kind {
ICAL_RESTRICTION_NONE=0, /* 0 */
ICAL_RESTRICTION_ZERO, /* 1 */
ICAL_RESTRICTION_ONE, /* 2 */
ICAL_RESTRICTION_ZEROPLUS, /* 3 */
ICAL_RESTRICTION_ONEPLUS, /* 4 */
ICAL_RESTRICTION_ZEROORONE, /* 5 */
ICAL_RESTRICTION_ONEEXCLUSIVE, /* 6 */
ICAL_RESTRICTION_ONEMUTUAL, /* 7 */
ICAL_RESTRICTION_UNKNOWN /* 8 */
} icalrestriction_kind;
int
icalrestriction_compare(icalrestriction_kind restr, int count);
int
icalrestriction_is_parameter_allowed(icalproperty_kind property,
icalparameter_kind parameter);
int icalrestriction_check(icalcomponent* comp);
#endif /* !ICALRESTRICTION_H */

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

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

@ -0,0 +1,277 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icaltime.h
CREATOR: eric 02 June 2000
$Id: icaltime.h,v 1.24 2003/02/17 14:23:17 acampi Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is eric. The Initial Developer of the Original
Code is Eric Busboom
======================================================================*/
/** @file icaltime.h
* @brief struct icaltimetype is a pseudo-object that abstracts time
* handling.
*
* It can represent either a DATE or a DATE-TIME (floating, UTC or in a
* given timezone), and it keeps track internally of its native timezone.
*
* The typical usage is to call the correct constructor specifying the
* desired timezone. If this is not known until a later time, the
* correct behavior is to specify a NULL timezone and call
* icaltime_convert_to_zone() at a later time.
*
* There are several ways to create a new icaltimetype:
*
* - icaltime_null_time()
* - icaltime_null_date()
* - icaltime_current_time_with_zone()
* - icaltime_today()
* - icaltime_from_timet_with_zone(time_t tm, int is_date,
* icaltimezone *zone)
* - icaltime_from_string_with_zone(const char* str, icaltimezone *zone)
* - icaltime_from_day_of_year(int doy, int year)
* - icaltime_from_week_number(int week_number, int year)
*
* italtimetype objects can be converted to different formats:
*
* - icaltime_as_timet(struct icaltimetype tt)
* - icaltime_as_timet_with_zone(struct icaltimetype tt,
* icaltimezone *zone)
* - icaltime_as_ical_string(struct icaltimetype tt)
*
* Accessor methods include:
*
* - icaltime_get_timezone(struct icaltimetype t)
* - icaltime_get_tzid(struct icaltimetype t)
* - 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_week(struct icaltimetype t, int fdow)
* - icaltime_week_number(struct icaltimetype t)
*
* Query methods include:
*
* - icaltime_is_null_time(struct icaltimetype t)
* - icaltime_is_valid_time(struct icaltimetype t)
* - icaltime_is_date(struct icaltimetype t)
* - icaltime_is_utc(struct icaltimetype t)
* - icaltime_is_floating(struct icaltimetype t)
*
* Modify, compare and utility methods include:
*
* - icaltime_add(struct icaltimetype t, struct icaldurationtype d)
* - icaltime_subtract(struct icaltimetype t1, struct icaltimetype t2)
* - 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)
* - icaltime_adjust(struct icaltimetype *tt, int days, int hours,
* int minutes, int seconds);
* - icaltime_normalize(struct icaltimetype t);
* - icaltime_convert_to_zone(const struct icaltimetype tt,
* icaltimezone *zone);
*/
#ifndef ICALTIME_H
#define ICALTIME_H
#include <time.h>
/* An opaque struct representing a timezone. We declare this here to avoid
a circular dependancy. */
#ifndef ICALTIMEZONE_DEFINED
#define ICALTIMEZONE_DEFINED
typedef struct _icaltimezone icaltimezone;
#endif
/** icaltime_span is returned by icalcomponent_get_span() */
struct icaltime_span {
time_t start; /**< in UTC */
time_t end; /**< in UTC */
int is_busy; /**< 1->busy time, 0-> free time */
};
typedef struct icaltime_span icaltime_span;
/*
* FIXME
*
* is_utc is redundant, and might be considered a minor optimization.
* It might be deprecated, so you should use icaltime_is_utc() instead.
*/
struct icaltimetype
{
int year; /**< Actual year, e.g. 2001. */
int month; /**< 1 (Jan) to 12 (Dec). */
int day;
int hour;
int minute;
int second;
int is_utc; /**< 1-> time is in UTC timezone */
int is_date; /**< 1 -> interpret this as date. */
int is_daylight; /**< 1 -> time is in daylight savings time. */
const icaltimezone *zone; /**< timezone */
};
typedef struct icaltimetype icaltimetype;
/** Return a null time, which indicates no time has been set.
This time represent the beginning of the epoch */
struct icaltimetype icaltime_null_time(void);
/** Return a null date */
struct icaltimetype icaltime_null_date(void);
/** Returns the current time in the given timezone, as an icaltimetype. */
struct icaltimetype icaltime_current_time_with_zone(const icaltimezone *zone);
/** Returns the current day as an icaltimetype, with is_date set. */
struct icaltimetype icaltime_today(void);
/** Convert seconds past UNIX epoch to a timetype*/
struct icaltimetype icaltime_from_timet(const time_t v, const int is_date);
/** Convert seconds past UNIX epoch to a timetype, using timezones. */
struct icaltimetype icaltime_from_timet_with_zone(const time_t tm,
const int is_date, const icaltimezone *zone);
/** create a time from an ISO format string */
struct icaltimetype icaltime_from_string(const char* str);
/** create a time from an ISO format string */
struct icaltimetype icaltime_from_string_with_zone(const char* str,
const icaltimezone *zone);
/** Create a new time, given a day of year and a year. */
struct icaltimetype icaltime_from_day_of_year(const int doy,
const int year);
/** @brief Contructor (TODO).
* Create a new time from a weeknumber and a year. */
struct icaltimetype icaltime_from_week_number(const int week_number,
const int year);
/** Return the time as seconds past the UNIX epoch */
time_t icaltime_as_timet(const struct icaltimetype);
/** Return the time as seconds past the UNIX epoch, using timezones. */
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 */
const char* icaltime_as_ical_string(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);
/** @brief Set the timezone */
struct icaltimetype icaltime_set_timezone(struct icaltimetype *t,
const icaltimezone *zone);
/** Return the day of the year of the given time */
int icaltime_day_of_year(const struct icaltimetype t);
/** Return the day of the week of the given time. Sunday is 1 */
int icaltime_day_of_week(const struct icaltimetype t);
/** Return the day of the year for the Sunday of the week that the
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);
/** Return true of the time is null. */
int icaltime_is_null_time(const struct icaltimetype t);
/** Returns false if the time is clearly invalid, but is not null. This
is usually the result of creating a new time type buy not clearing
it, or setting one of the flags to an illegal value. */
int icaltime_is_valid_time(const struct icaltimetype t);
/** @brief Returns true if time is of DATE type, false if DATE-TIME */
int icaltime_is_date(const struct icaltimetype t);
/** @brief Returns true if time is relative to UTC zone */
int icaltime_is_utc(const struct icaltimetype t);
/** @brief Returns true if time is a floating time */
int icaltime_is_floating(const struct icaltimetype t);
/** Return -1, 0, or 1 to indicate that a<b, a==b or a>b */
int icaltime_compare_with_zone(const struct icaltimetype a,
const struct icaltimetype b);
/** Return -1, 0, or 1 to indicate that a<b, a==b or a>b */
int icaltime_compare(const struct icaltimetype a,
const struct icaltimetype b);
/** like icaltime_compare, but only use the date parts. */
int icaltime_compare_date_only(const struct icaltimetype a,
const struct icaltimetype b);
/** Adds or subtracts a number of days, hours, minutes and seconds. */
void icaltime_adjust(struct icaltimetype *tt, const int days,
const int hours, const int minutes, const int seconds);
/** Normalize the icaltime, so that all fields are within the normal range. */
struct icaltimetype icaltime_normalize(const struct icaltimetype t);
/** convert tt, of timezone tzid, into a utc time. Does nothing if the
time is already UTC. */
struct icaltimetype icaltime_convert_to_zone(const struct icaltimetype tt,
icaltimezone *zone);
/** Return the number of days in the given month */
int icaltime_days_in_month(const int month, const int year);
/** @brief calculate an icaltimespan given a start and end time. */
struct icaltime_span icaltime_span_new(struct icaltimetype dtstart,
struct icaltimetype dtend,
int is_busy);
/** @brief Returns true if the two spans overlap **/
int icaltime_span_overlaps(icaltime_span *s1,
icaltime_span *s2);
/** @brief Returns true if the span is totally within the containing
* span
*/
int icaltime_span_contains(icaltime_span *s,
icaltime_span *container);
#endif /* !ICALTIME_H */

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

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

@ -0,0 +1,167 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*======================================================================
FILE: icaltimezone.h
CREATOR: Damon Chaplin 15 March 2001
$Id: icaltimezone.h,v 1.10 2002/11/03 23:51:55 acampi Exp $
$Locker: $
(C) COPYRIGHT 2001, Damon Chaplin
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/
======================================================================*/
/**
* @file icaltimezone.h
* @brief timezone handling routines
*/
#ifndef ICALTIMEZONE_H
#define ICALTIMEZONE_H
#include <stdio.h> /* For FILE* */
#include "icaltime.h"
#include "icalarray.h"
#include "icalcomponent.h"
#ifndef ICALTIMEZONE_DEFINED
#define ICALTIMEZONE_DEFINED
/** @brief An opaque struct representing a timezone.
* We declare this here to avoid a circular dependancy.
*/
typedef struct _icaltimezone icaltimezone;
#endif
/**
* @par Creating/Destroying individual icaltimezones.
*/
/** Creates a new icaltimezone. */
icaltimezone *icaltimezone_new (void);
/** Frees all memory used for the icaltimezone. Set free_struct to free the
icaltimezone struct as well. */
void icaltimezone_free (icaltimezone *zone,
int free_struct);
/**
* @par Accessing timezones.
*/
/** Free any builtin timezone information **/
void icaltimezone_free_builtin_timezones(void);
/** Returns the array of builtin icaltimezones. */
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 TZID. */
icaltimezone* icaltimezone_get_builtin_timezone_from_tzid (const char *tzid);
/** Returns the UTC timezone. */
icaltimezone* icaltimezone_get_utc_timezone (void);
/** Returns the TZID of a timezone. */
char* icaltimezone_get_tzid (icaltimezone *zone);
/** Returns the city name of a timezone. */
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);
/** Returns the latitude of a builtin timezone. */
double icaltimezone_get_latitude (icaltimezone *zone);
/** Returns the longitude of a builtin timezone. */
double icaltimezone_get_longitude (icaltimezone *zone);
/** Returns the VTIMEZONE component of a timezone. */
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,
icalcomponent *comp);
/**
* @par Converting times between timezones.
*/
void icaltimezone_convert_time (struct icaltimetype *tt,
icaltimezone *from_zone,
icaltimezone *to_zone);
/**
* @par Getting offsets from UTC.
*/
/** Calculates the UTC offset of a given local 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 (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,
struct icaltimetype *tt,
int *is_daylight);
/*
* Handling arrays of timezones. Mainly for internal use.
*/
icalarray* icaltimezone_array_new (void);
void icaltimezone_array_append_from_vtimezone (icalarray *timezones,
icalcomponent *child);
void icaltimezone_array_free (icalarray *timezones);
/*
* @par Handling the default location the timezone files
*/
/** Set the directory to look for the zonefiles */
void set_zone_directory(char *path);
/** Free memory dedicated to the zonefile directory */
void free_zone_directory(void);
/*
* @par Debugging Output.
*/
/** Dumps information about changes in the timezone up to and including
max_year. */
int icaltimezone_dump_changes (icaltimezone *zone,
int max_year,
FILE *fp);
#endif /* ICALTIMEZONE_H */

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

@ -0,0 +1,191 @@
/* -*- Mode: C -*-
======================================================================
FILE: icaltypes.c
CREATOR: eric 16 May 1999
$Id: icaltypes.c,v 1.15 2002/10/30 23:59:57 acampi 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 icaltypes.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "icaltypes.h"
#include "icalerror.h"
#include "icalmemory.h"
#include <stdlib.h> /* for malloc and abs() */
#include <errno.h> /* for errno */
#include <string.h> /* for icalmemory_strdup */
#include <assert.h>
#ifdef WIN32
#define snprintf _snprintf
#define strcasecmp stricmp
#endif
#define TEMP_MAX 1024
int icaltriggertype_is_null_trigger(struct icaltriggertype tr)
{
if(icaltime_is_null_time(tr.time) &&
icaldurationtype_is_null_duration(tr.duration)){
return 1;
}
return 0;
}
int icaltriggertype_is_bad_trigger(struct icaltriggertype tr)
{
if(icaldurationtype_is_bad_duration(tr.duration)){
return 1;
}
return 0;
}
struct icaltriggertype icaltriggertype_from_int(const int reltime)
{
struct icaltriggertype tr;
tr.time = icaltime_null_time();
tr.duration = icaldurationtype_from_int(reltime);
return tr;
}
struct icaltriggertype icaltriggertype_from_string(const char* str)
{
struct icaltriggertype tr, null_tr;
icalerrorstate es;
icalerrorenum e;
tr.time= icaltime_null_time();
tr.duration = icaldurationtype_from_int(0);
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);
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL);
e = icalerrno;
icalerror_set_errno(ICAL_NO_ERROR);
tr.time = icaltime_from_string(str);
if (icaltime_is_null_time(tr.time)){
tr.duration = icaldurationtype_from_string(str);
if (icaldurationtype_is_bad_duration(tr.duration)) goto error;
}
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
icalerror_set_errno(e);
return tr;
error:
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return tr;
}
struct icalreqstattype icalreqstattype_from_string(const char* str)
{
const char *p1,*p2;
struct icalreqstattype stat;
short major=0, minor=0;
icalerror_check_arg((str != 0),"str");
stat.code = ICAL_UNKNOWN_STATUS;
stat.debug = 0;
stat.desc = 0;
/* Get the status numbers */
sscanf(str, "%hd.%hd",&major, &minor);
if (major <= 0 || minor < 0){
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return stat;
}
stat.code = icalenum_num_to_reqstat(major, minor);
if (stat.code == ICAL_UNKNOWN_STATUS){
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return stat;
}
p1 = strchr(str,';');
if (p1 == 0){
/* icalerror_set_errno(ICAL_BADARG_ERROR);*/
return stat;
}
/* Just ignore the second clause; it will be taken from inside the library
*/
p2 = strchr(p1+1,';');
if (p2 != 0 && *p2 != 0){
stat.debug = p2+1;
}
return stat;
}
const char* icalreqstattype_as_string(struct icalreqstattype stat)
{
char *temp;
temp = (char*)icalmemory_tmp_buffer(TEMP_MAX);
icalerror_check_arg_rz((stat.code != ICAL_UNKNOWN_STATUS),"Status");
if (stat.desc == 0){
stat.desc = icalenum_reqstat_desc(stat.code);
}
if(stat.debug != 0){
snprintf(temp,TEMP_MAX,"%d.%d;%s;%s", icalenum_reqstat_major(stat.code),
icalenum_reqstat_minor(stat.code),
stat.desc, stat.debug);
} else {
snprintf(temp,TEMP_MAX,"%d.%d;%s", icalenum_reqstat_major(stat.code),
icalenum_reqstat_minor(stat.code),
stat.desc);
}
return temp;
}

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

@ -0,0 +1,107 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icaltypes.h
CREATOR: eric 20 March 1999
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icaltypes.h
======================================================================*/
#ifndef ICALTYPES_H
#define ICALTYPES_H
#include <time.h>
#include "icalenums.h"
#include "icaltime.h"
#include "icalduration.h"
#include "icalperiod.h"
struct icalgeotype
{
float lat;
float lon;
};
struct icaldatetimeperiodtype
{
struct icaltimetype time;
struct icalperiodtype period;
};
struct icaltriggertype
{
struct icaltimetype time;
struct icaldurationtype duration;
};
struct icaltriggertype icaltriggertype_from_int(const int reltime);
struct icaltriggertype icaltriggertype_from_string(const char* str);
int icaltriggertype_is_null_trigger(struct icaltriggertype tr);
int icaltriggertype_is_bad_trigger(struct icaltriggertype tr);
/* struct icalreqstattype. This struct contains two string pointers,
but don't try to free either of them. The "desc" string is a pointer
to a static table inside the library. Don't try to free it. The
"debug" string is a pointer into the string that the called passed
into to icalreqstattype_from_string. Don't try to free it either, and
don't use it after the original string has been freed.
BTW, you would get that original string from
*icalproperty_get_requeststatus() or icalvalue_get_text(), when
operating on a the value of a request_status property. */
struct icalreqstattype {
icalrequeststatus code;
const char* desc;
const char* debug;
};
struct icalreqstattype icalreqstattype_from_string(const char* str);
const char* icalreqstattype_as_string(struct icalreqstattype);
struct icaltimezonephase {
const char* tzname;
int is_stdandard; /* 1 = standard tme, 0 = daylight savings time */
struct icaltimetype dtstart;
int offsetto;
int tzoffsetfrom;
const char* comment;
struct icaldatetimeperiodtype rdate;
const char* rrule;
};
struct icaltimezonetype {
const char* tzid;
struct icaltimetype last_mod;
const char* tzurl;
/* Array of phases. The end of the array is a phase with tzname == 0 */
struct icaltimezonephase *phases;
};
void icaltimezonetype_free(struct icaltimezonetype tzt);
#endif /* !ICALTYPES_H */

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

@ -0,0 +1,262 @@
/* -*- 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);
}

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

@ -0,0 +1,151 @@
/* -*- 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*/

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

@ -0,0 +1,95 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalvalueimpl.h,v 1.5 2002/05/28 14:08:00 acampi Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalvalue.c
Contributions from:
Graham Davison (g.m.davison@computer.org)
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef ICALVALUEIMPL_H
#define ICALVALUEIMPL_H
#include "icalenums.h"
#include "icalproperty.h"
#include "icalderivedvalue.h"
struct icalvalue_impl {
icalvalue_kind kind; /*this is the kind that is visible from the outside*/
char id[5];
int size;
icalproperty* parent;
char* x_value;
union data {
icalattach *v_attach;
/* void *v_binary; */ /* use v_attach */
const char *v_string;
/*char *v_text;*/
/*char *v_caladdress;*/
/*char *v_uri;*/
float v_float;
int v_int;
/*int v_boolean;*/
/*int v_integer;*/
struct icaldurationtype v_duration;
/*int v_utcoffset;*/
struct icalperiodtype v_period;
/*struct icalperiodtype v_datetimeperiod;*/
struct icalgeotype v_geo;
/*time_t v_time;*/
struct icaltimetype v_time;
/*struct icaltimetype v_date;*/
/*struct icaltimetype v_datetime;*/
/*struct icaltimetype v_datetimedate;*/
struct icalreqstattype v_requeststatus;
/* struct icalrecurrencetype was once included
directly ( not referenced ) in this union, but it
contributes 2000 bytes to every value, so now it is
a reference*/
struct icalrecurrencetype *v_recur;
struct icaltriggertype v_trigger;
int v_enum;
/* v_enum takes care of several enumerated types including:
icalproperty_method v_method;
icalproperty_status v_status;
icalproperty_action v_action;
icalproperty_class v_class;
icalproperty_transp v_transp;
*/
} data;
};
#endif

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

@ -0,0 +1,7 @@
#ifndef ICAL_VERSION_H
#define ICAL_VERSION_H
#define ICAL_PACKAGE "@PACKAGE@"
#define ICAL_VERSION "@VERSION@"
#endif

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

@ -0,0 +1,93 @@
/* -*- Mode: C++ -*- */
/**
* @file icptrholder.h
* @author wyau (08/29/02)
* @brief C++ template classes for managing C++ pointers returned by VComponent::get_..._component,
* VComponent::get_..._property, ICalPropety::get_..._value.
* @remarks VComponent::get... functions returns a C++ oject that wraps the libical implementation.
* It is important to note that the wrapped implementation still belongs to the orginal
* component. To stop memory leak, caller must delete the pointer. However, the destructor
* will call the appropriate free function. eg. ~VComponent calls icalcomponent_free(imp).
* As stated previously, imp stil belongs to the original component. To avoid freeing the
* wrapped "imp", caller must set the "imp" to null before deleting the pointer.
*
* The template class relieves the burden of memory management when used as a stack based
* object. The class holds a pointer to the C++ Wrapper. The destructor set the imp to
* null before deleting the pointer.
*
* Each C++ Wrapper instantiates a template class in it's corresponding .h file.
*
* Usage example:
* VComponentTmpPtr p; // VComponentTmpPtr is an instantiation of this template
* for (p=component.get_first_component; p!= NULL; p=component.get_next_component) {
*
* (C) COPYRIGHT 2001, Critical Path
*/
#ifndef __ICPTRHOLDER_H__
#define __ICPTRHOLDER_H__
template<class T> class ICPointerHolder {
public:
ICPointerHolder() { ptr = NULL; }
ICPointerHolder(T* p) { ptr = p; }
// copy constructor to support assignment
ICPointerHolder(const ICPointerHolder& ip) {
ptr = ip.ptr;
// We need to transfer ownership of ptr to this object by setting
// ip's ptr to null. Otherwise, ptr will de deleted twice.
// const ugliness requires us to do the const_cast.
ICPointerHolder *ipp = const_cast<ICPointerHolder*>(&ip);
ipp->ptr = NULL;
};
~ICPointerHolder() {
release();
}
ICPointerHolder& operator=(T* p) {
this->release();
ptr = p;
return *this;
}
ICPointerHolder& operator=(ICPointerHolder& p) {
this->release();
ptr = p.ptr; // this transfer ownership of the pointer
p.ptr = NULL; // set it to null so the pointer won't get delete twice.
return *this;
}
int operator!=(T* p) {return (ptr != p);}
int operator==(T* p) {return (ptr == p);}
operator T*() const {
return ptr;
}
T* operator->() const {
assert(ptr);
return ptr;
}
T& operator*() {
assert(ptr);
return *ptr;
}
private:
void release() {
if (ptr != NULL) {
ptr->detach();
delete ptr;
ptr = NULL;
}
}
T* ptr;
};
#endif

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

@ -0,0 +1,594 @@
# Microsoft Developer Studio Project File - Name="libical" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=libical - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "libical.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "libical.mak" CFG="libical - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "libical - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "libical - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "libical - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "./autogenex" /I "./" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo
!ENDIF
# Begin Target
# Name "libical - Win32 Release"
# Name "libical - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\caldate.c
# End Source File
# Begin Source File
SOURCE=.\icalarray.c
# End Source File
# Begin Source File
SOURCE=.\icalattach.c
# End Source File
# Begin Source File
SOURCE=icalcomponent.c
# End Source File
# Begin Source File
SOURCE=.\icalderivedparameter.c
# End Source File
# Begin Source File
SOURCE=icalderivedparameter.c.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICALD="../../scripts/mkderivedparameters.pl" "../../design-data/parameters.csv"
# Begin Custom Build
InputPath=icalderivedparameter.c.in
InputName=icalderivedparameter.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedparameters.pl -i $(InputName).in -c ../../design-data/parameters.csv > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
USERDEP__ICALD="../../scripts/mkderivedparameters.pl" "../../design-data/parameters.csv"
# Begin Custom Build
InputPath=icalderivedparameter.c.in
InputName=icalderivedparameter.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedparameters.pl -i $(InputName).in -c ../../design-data/parameters.csv > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\icalderivedproperty.c
# End Source File
# Begin Source File
SOURCE=icalderivedproperty.c.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICALDE="../../scripts/mkderivedproperties.pl" "../../design-data/properties.csv" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedproperty.c.in
InputName=icalderivedproperty.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedproperties.pl -i $(InputName).in -c ../../design-data/properties.csv ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
USERDEP__ICALDE="../../scripts/mkderivedproperties.pl" "../../design-data/properties.csv" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedproperty.c.in
InputName=icalderivedproperty.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedproperties.pl -i $(InputName).in -c ../../design-data/properties.csv ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\icalderivedvalue.c
# End Source File
# Begin Source File
SOURCE=icalderivedvalue.c.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICALDER="../../scripts/mkderivedvalues.pl" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedvalue.c.in
InputName=icalderivedvalue.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedvalues.pl -i $(InputName).in -c ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
USERDEP__ICALDER="../../scripts/mkderivedvalues.pl" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedvalue.c.in
InputName=icalderivedvalue.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedvalues.pl -i $(InputName).in -c ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=icalduration.c
# End Source File
# Begin Source File
SOURCE=icalenums.c
# End Source File
# Begin Source File
SOURCE=icalerror.c
# End Source File
# Begin Source File
SOURCE=icallangbind.c
# End Source File
# Begin Source File
SOURCE=icalmemory.c
# End Source File
# Begin Source File
SOURCE=icalmime.c
# End Source File
# Begin Source File
SOURCE=icalparameter.c
# End Source File
# Begin Source File
SOURCE=icalparser.c
# End Source File
# Begin Source File
SOURCE=icalperiod.c
# End Source File
# Begin Source File
SOURCE=icalproperty.c
# End Source File
# Begin Source File
SOURCE=icalrecur.c
# End Source File
# Begin Source File
SOURCE=.\icalrestriction.c
# End Source File
# Begin Source File
SOURCE=icalrestriction.c.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICALR="../../scripts/mkrestrictiontable.pl" "../../design-data/restrictions.csv"
# Begin Custom Build
InputPath=icalrestriction.c.in
InputName=icalrestriction.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkrestrictiontable.pl -i $(InputName).in ../../design-data/restrictions.csv > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
# PROP Ignore_Default_Tool 1
USERDEP__ICALR="../../scripts/mkrestrictiontable.pl" "../../design-data/restrictions.csv"
# Begin Custom Build
InputPath=icalrestriction.c.in
InputName=icalrestriction.c
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkrestrictiontable.pl -i $(InputName).in ../../design-data/restrictions.csv > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=icaltime.c
# End Source File
# Begin Source File
SOURCE=.\icaltimezone.c
# End Source File
# Begin Source File
SOURCE=icaltypes.c
# End Source File
# Begin Source File
SOURCE=icalvalue.c
# End Source File
# Begin Source File
SOURCE=pvl.c
# End Source File
# Begin Source File
SOURCE=sspm.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\astime.h
# End Source File
# Begin Source File
SOURCE=.\ical.h
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICAL_="icalversion.h" "icaltime.h" "icalduration.h" "icalperiod.h" "icalenums.h" "icaltypes.h" "icalrecur.h" "icalattach.h" "icalderivedvalue.h" "icalderivedparameter.h" "icalvalue.h" "icalparameter.h" "icalderivedproperty.h" "icalproperty.h" "pvl.h" "icalarray.h" "icalcomponent.h" "icaltimezone.h" "icalparser.h" "icalmemory.h" "icalerror.h" "icalrestriction.h" "sspm.h" "icalmime.h" "icallangbind.h"
# Begin Custom Build
InputPath=.\ical.h
"ical.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
sh ../../scripts/mkinclude.sh -o ical.h -e "#include.*\"ical" -e "#include.*\"config" -e "#include.*\"pvl\.h\"" -e '\$$(Id|Locker): .+\$$' icalversion.h icaltime.h icalduration.h icalperiod.h icalenums.h icaltypes.h icalrecur.h icalattach.h icalderivedvalue.h icalderivedparameter.h icalvalue.h icalparameter.h icalderivedproperty.h icalproperty.h pvl.h icalarray.h icalcomponent.h icaltimezone.h icalparser.h icalmemory.h icalerror.h icalrestriction.h sspm.h icalmime.h icallangbind.h
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
USERDEP__ICAL_="icalversion.h" "icaltime.h" "icalduration.h" "icalperiod.h" "icalenums.h" "icaltypes.h" "icalrecur.h" "icalattach.h" "icalderivedvalue.h" "icalderivedparameter.h" "icalvalue.h" "icalparameter.h" "icalderivedproperty.h" "icalproperty.h" "pvl.h" "icalarray.h" "icalcomponent.h" "icaltimezone.h" "icalparser.h" "icalmemory.h" "icalerror.h" "icalrestriction.h" "sspm.h" "icalmime.h" "icallangbind.h"
# Begin Custom Build
InputPath=.\ical.h
"ical.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
sh ../../scripts/mkinclude.sh -o ical.h -e "#include.*\"ical" -e "#include.*\"config" -e "#include.*\"pvl\.h\"" -e '\$$(Id|Locker): .+\$$' icalversion.h icaltime.h icalduration.h icalperiod.h icalenums.h icaltypes.h icalrecur.h icalattach.h icalderivedvalue.h icalderivedparameter.h icalvalue.h icalparameter.h icalderivedproperty.h icalproperty.h pvl.h icalarray.h icalcomponent.h icaltimezone.h icalparser.h icalmemory.h icalerror.h icalrestriction.h sspm.h icalmime.h icallangbind.h
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\icalarray.h
# End Source File
# Begin Source File
SOURCE=.\icalattach.h
# End Source File
# Begin Source File
SOURCE=.\icalattachimpl.h
# End Source File
# Begin Source File
SOURCE=icalcomponent.h
# End Source File
# Begin Source File
SOURCE=.\icalderivedparameter.h
# End Source File
# Begin Source File
SOURCE=icalderivedparameter.h.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICALDERI="../../scripts/mkderivedparameters.pl" "../../design-data/parameters.csv"
# Begin Custom Build
InputPath=icalderivedparameter.h.in
InputName=icalderivedparameter.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedparameters.pl -i $(InputName).in -h ../../design-data/parameters.csv > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
USERDEP__ICALDERI="../../scripts/mkderivedparameters.pl" "../../design-data/parameters.csv"
# Begin Custom Build
InputPath=icalderivedparameter.h.in
InputName=icalderivedparameter.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedparameters.pl -i $(InputName).in -h ../../design-data/parameters.csv > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\icalderivedproperty.h
# End Source File
# Begin Source File
SOURCE=icalderivedproperty.h.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICALDERIV="../../scripts/mkderivedproperties.pl" "../../design-data/properties.csv" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedproperty.h.in
InputName=icalderivedproperty.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedproperties.pl -i $(InputName).in -h ../../design-data/properties.csv ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
USERDEP__ICALDERIV="../../scripts/mkderivedproperties.pl" "../../design-data/properties.csv" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedproperty.h.in
InputName=icalderivedproperty.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedproperties.pl -i $(InputName).in -h ../../design-data/properties.csv ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\icalderivedvalue.h
# End Source File
# Begin Source File
SOURCE=icalderivedvalue.h.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__ICALDERIVE="../../scripts/mkderivedvalues.pl" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedvalue.h.in
InputName=icalderivedvalue.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedvalues.pl -i $(InputName).in -h ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
USERDEP__ICALDERIVE="../../scripts/mkderivedvalues.pl" "../../design-data/value-types.csv"
# Begin Custom Build
InputPath=icalderivedvalue.h.in
InputName=icalderivedvalue.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
perl -I ../../scripts ../../scripts/mkderivedvalues.pl -i $(InputName).in -h ../../design-data/value-types.csv > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=icalduration.h
# End Source File
# Begin Source File
SOURCE=icalenums.h
# End Source File
# Begin Source File
SOURCE=icalerror.h
# End Source File
# Begin Source File
SOURCE=icallangbind.h
# End Source File
# Begin Source File
SOURCE=icalmemory.h
# End Source File
# Begin Source File
SOURCE=icalmime.h
# End Source File
# Begin Source File
SOURCE=icalparameter.h
# End Source File
# Begin Source File
SOURCE=icalparameterimpl.h
# End Source File
# Begin Source File
SOURCE=icalparser.h
# End Source File
# Begin Source File
SOURCE=icalperiod.h
# End Source File
# Begin Source File
SOURCE=icalproperty.h
# End Source File
# Begin Source File
SOURCE=icalrecur.h
# End Source File
# Begin Source File
SOURCE=icalrestriction.h
# End Source File
# Begin Source File
SOURCE=icaltime.h
# End Source File
# Begin Source File
SOURCE=.\icaltimezone.h
# End Source File
# Begin Source File
SOURCE=icaltypes.h
# End Source File
# Begin Source File
SOURCE=icalvalue.h
# End Source File
# Begin Source File
SOURCE=icalvalueimpl.h
# End Source File
# Begin Source File
SOURCE=.\icalversion.h
# End Source File
# Begin Source File
SOURCE=icalversion.h.in
!IF "$(CFG)" == "libical - Win32 Release"
# PROP Ignore_Default_Tool 1
# Begin Custom Build
InputPath=icalversion.h.in
InputName=icalversion.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
sed -e "s/@VERSION@/0.24/g" -e "s/@PACKAGE@/libical/g" $(InputName).in > $(InputName)
# End Custom Build
!ELSEIF "$(CFG)" == "libical - Win32 Debug"
# PROP Ignore_Default_Tool 1
# Begin Custom Build
InputPath=icalversion.h.in
InputName=icalversion.h
"$(InputName)" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
sed -e "s/@VERSION@/0.24/g" -e "s/@PACKAGE@/libical/g" $(InputName).in > $(InputName)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=pvl.h
# End Source File
# Begin Source File
SOURCE=sspm.h
# End Source File
# End Group
# End Target
# End Project

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

@ -0,0 +1,584 @@
/*======================================================================
FILE: pvl.c
CREATOR: eric November, 1995
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "pvl.h"
#include <errno.h>
#include <assert.h>
#include <stdlib.h>
/**
struct pvl_list_t
The list structure. This is the hanlde for the entire list
This type is also private. Use pvl_list instead
*/
typedef struct pvl_list_t
{
int MAGIC; /**< Magic Identifier */
struct pvl_elem_t *head; /**< Head of list */
struct pvl_elem_t *tail; /**< Tail of list */
int count; /**< Number of items in the list */
struct pvl_elem_t *p; /**< Pointer used for iterators */
} pvl_list_t;
/**
* This global is incremented for each call to pvl_new_element(); it gives each
* list a unique identifer
*/
int pvl_elem_count = 0;
int pvl_list_count = 0;
/**
* @brief Creates a new list, clears the pointers and assigns a magic number
*
* @return Pointer to the new list, 0 if there is no available memory.
*/
pvl_list
pvl_newlist()
{
struct pvl_list_t *L;
if ( ( L = (struct pvl_list_t*)malloc(sizeof(struct pvl_list_t))) == 0)
{
errno = ENOMEM;
return 0;
}
L->MAGIC = pvl_list_count;
pvl_list_count++;
L->head = 0;
L->tail = 0;
L->count = 0;
L->p = 0;
return L;
}
void
pvl_free(pvl_list l)
{
struct pvl_list_t *L = (struct pvl_list_t *)l;
pvl_clear(l);
free(L);
}
/**
* @brief Creates a new list element, assigns a magic number, and assigns
* the next and previous pointers.
*
* Passing in the next and previous points may seem odd, but it allos the user
* to set them while keeping the internal data hidden. In nearly all cases,
* the user is the pvl library itself.
*
* @param d The data item to be stored in the list
* @param next Pointer value to assign to the member "next"
* @param prior Pointer value to assign to the member "prior"
*
* @return A pointer to the new element, 0 if there is no memory available.
*/
pvl_elem
pvl_new_element(void *d, pvl_elem next, pvl_elem prior)
{
struct pvl_elem_t *E;
if ( ( E = (struct pvl_elem_t*)malloc(sizeof(struct pvl_elem_t))) == 0)
{
errno = ENOMEM;
return 0;
}
E->MAGIC = pvl_elem_count++;
E->d = d;
E->next = next;
E->prior = prior;
return (pvl_elem)E;
}
/**
* @brief Add a new element to the from of the list
*
* @param L The list to add the item to
* @param d Pointer to the item to add
*/
void
pvl_unshift(pvl_list L,void *d)
{
struct pvl_elem_t *E = pvl_new_element(d,L->head,0);
if (E->next != 0)
{
/* Link the head node to it */
E->next->prior = E;
}
/* move the head */
L->head = E;
/* maybe move the tail */
if (L->tail == 0)
{
L->tail = E;
}
L->count++;
}
/**
* @brief Remove an element from the front of the list
*
* @param L The list to operate on
*
* @return the entry on the front of the list
*/
void*
pvl_shift(pvl_list L)
{
if (L->head == 0)
{
return 0;
}
return pvl_remove(L,(void*)L->head);
}
/**
* @brief Add a new item to the tail of the list
*
* @param L The list to operate on
* @param d Pointer to the item to add
*
*/
void
pvl_push(pvl_list L,void *d)
{
struct pvl_elem_t *E = pvl_new_element(d,0,L->tail);
/* These are done in pvl_new_element
E->next = 0;
E->prior = L->tail;
*/
if (L->tail != 0)
{
L->tail->next = E;
}
if (L->head == 0)
{
L->head = E;
}
L->tail = E;
L->count++;
}
/**
* @brief Remove an element from the tail of the list
*
* @param L The list to operate on
*/
void*
pvl_pop(pvl_list L)
{
if ( L->tail == 0)
{
return 0;
}
return pvl_remove(L,(void*) L->tail);;
}
/**
* Add a new item to a list that is ordered by a comparison function.
* This routine assumes that the list is properly ordered.
*
* @param L The list to operate on
* @param f Pointer to a comparison function
* @param d Pointer to data to pass to the comparison function
*/
void
pvl_insert_ordered(pvl_list L,pvl_comparef f,void *d)
{
struct pvl_elem_t *P;
L->count++;
/* Empty list, add to head */
if(L->head == 0)
{
pvl_unshift(L,d);
return;
}
/* smaller than head, add to head */
if ( ((*f)(d,L->head->d)) <= 0)
{
pvl_unshift(L,d);
return;
}
/* larger than tail, add to tail */
if ( (*f)(d,L->tail->d) >= 0)
{
pvl_push(L,d);
return;
}
/* Search for the first element that is smaller, and add before it */
for (P=L->head; P != 0; P = P->next)
{
if ( (*f)(P->d,d) >= 0)
{
pvl_insert_before(L,P,d);
return;
}
}
/* badness, choke */
#ifndef lint
assert(0);
#endif
}
/**
* @brief Add a new item after the referenced element.
* @param L The list to operate on
* @param P The list element to add the item after
* @param d Pointer to the item to add.
*/
void
pvl_insert_after(pvl_list L,pvl_elem P,void *d)
{
struct pvl_elem_t *E = 0;
L->count++;
if (P == 0)
{
pvl_unshift(L,d);
return;
}
if ( P == L->tail)
{
E = pvl_new_element(d,0,P);
L->tail = E;
E->prior->next = E;
}
else
{
E = pvl_new_element(d,P->next,P);
E->next->prior = E;
E->prior->next = E;
}
}
/**
* @brief Add an item after a referenced item
*
* @param L The list to operate on
* @param P The list element to add the item before
* @param d Pointer to the data to be added.
*/
void
pvl_insert_before(pvl_list L,pvl_elem P,void *d)
{
struct pvl_elem_t *E = 0;
L->count++;
if (P == 0)
{
pvl_unshift(L,d);
return;
}
if ( P == L->head)
{
E = pvl_new_element(d,P,0);
E->next->prior = E;
L->head = E;
}
else
{
E = pvl_new_element(d,P,P->prior);
E->prior->next = E;
E->next->prior = E;
}
}
/**
* @brief Remove the referenced item from the list.
*
* This routine will free the element, but not the data item that the
* element contains.
*
* @param L The list to operate on
* @param E The element to remove.
*/
void*
pvl_remove(pvl_list L,pvl_elem E)
{
void* data;
if (E == L->head)
{
if (E->next != 0)
{
E->next->prior = 0;
L->head = E->next;
} else {
/* E Also points to tail -> only one element in list */
L->tail = 0;
L->head = 0;
}
}
else if (E == L->tail)
{
if (E->prior != 0)
{
E->prior->next = 0;
L->tail = E->prior;
} else {
/* E points to the head, so it was the last element */
/* This case should be taken care of in the previous clause */
L->head = 0;
L->tail = 0;
}
}
else
{
E->prior->next = E->next;
E->next->prior = E->prior;
}
L->count--;
data = E->d;
E->prior = 0;
E->next = 0;
E->d = 0;
free(E);
return data;
}
/**
* @brief Return a pointer to data that satisfies a function.
*
* This routine will interate through the entire list and call the
* find function for each item. It will break and return a pointer to the
* data that causes the find function to return 1.
*
* @param l The list to operate on
* @param f Pointer to the find function
* @param v Pointer to constant data to pass into the function
*
* @return Pointer to the element that the find function found.
*/
pvl_elem
pvl_find(pvl_list l,pvl_findf f,void* v)
{
pvl_elem e;
for (e=pvl_head(l); e!= 0; e = pvl_next(e))
{
if ( (*f)(((struct pvl_elem_t *)e)->d,v) == 1)
{
/* Save this elem for a call to find_next */
((struct pvl_list_t *)l)->p = e;
return e;
}
}
return 0;
}
/**
* @brief Like pvl_find(), but continues the search where the last find() or
* find_next() left off.
*
* @param l The list to operate on
* @param f Pointer to the find function
* @param v Pointer to constant data to pass into the function
*
* @return Pointer to the element that the find function found.
*/
pvl_elem
pvl_find_next(pvl_list l,pvl_findf f,void* v)
{
pvl_elem e;
for (e=pvl_head(l); e!= 0; e = pvl_next(e))
{
if ( (*f)(((struct pvl_elem_t *)e)->d,v) == 1)
{
/* Save this elem for a call to find_next */
((struct pvl_list_t *)l)->p = e;
return e;
}
}
return 0;
}
/**
* @brief Remove the all the elements in the list. The does not free
* the data items the elements hold.
*/
void
pvl_clear(pvl_list l)
{
pvl_elem e = pvl_head(l);
pvl_elem next;
if (e == 0) {
return;
}
while(e != 0)
{
next = pvl_next(e);
pvl_remove(l,e);
e = next;
}
}
/**
* @brief Returns the number of items in the list.
*/
int
pvl_count(pvl_list L)
{
return L->count;
}
/**
* @brief Returns a pointer to the given element
*/
pvl_elem
pvl_next(pvl_elem E)
{
if (E == 0){
return 0;
}
return (pvl_elem)E->next;
}
/**
* @brief Returns a pointer to the element previous to the element given.
*/
pvl_elem
pvl_prior(pvl_elem E)
{
return (pvl_elem)E->prior;
}
/**
* @brief Returns a pointer to the first item in the list.
*/
pvl_elem
pvl_head(pvl_list L )
{
return (pvl_elem)L->head;
}
/**
* @brief Returns a pointer to the last item in the list.
*/
pvl_elem
pvl_tail(pvl_list L)
{
return (pvl_elem)L->tail;
}
#ifndef PVL_USE_MACROS
void*
pvl_data(pvl_elem E)
{
if ( E == 0){
return 0;
}
return E->d;
}
#endif
/**
* @brief Call a function for every item in the list.
*
* @param l The list to operate on
* @param f Pointer to the function to call
* @param v Data to pass to the function on every iteration
*/
void
pvl_apply(pvl_list l,pvl_applyf f, void *v)
{
pvl_elem e;
for (e=pvl_head(l); e!= 0; e = pvl_next(e))
{
(*f)(((struct pvl_elem_t *)e)->d,v);
}
}

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

@ -0,0 +1,97 @@
/*======================================================================
FILE: pvl.h
CREATOR: eric November, 1995
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
======================================================================*/
#ifndef __PVL_H__
#define __PVL_H__
typedef struct pvl_list_t* pvl_list;
typedef struct pvl_elem_t* pvl_elem;
/**
* This type is private. Always use pvl_elem instead. The struct would
* not even appear in this header except to make code in the USE_MACROS
* blocks work
*/
typedef struct pvl_elem_t
{
int MAGIC; /**< Magic Identifier */
void *d; /**< Pointer to data user is storing */
struct pvl_elem_t *next; /**< Next element */
struct pvl_elem_t *prior; /**< Prior element */
} pvl_elem_t;
/**
* This global is incremented for each call to pvl_new_element(); it gives each
* list a unique identifer
*/
extern int pvl_elem_count;
extern int pvl_list_count;
/* Create new lists or elements */
pvl_elem pvl_new_element(void* d, pvl_elem next,pvl_elem prior);
pvl_list pvl_newlist(void);
void pvl_free(pvl_list);
/* Add, remove, or get the head of the list */
void pvl_unshift(pvl_list l,void *d);
void* pvl_shift(pvl_list l);
pvl_elem pvl_head(pvl_list);
/* Add, remove or get the tail of the list */
void pvl_push(pvl_list l,void *d);
void* pvl_pop(pvl_list l);
pvl_elem pvl_tail(pvl_list);
/* Insert elements in random places */
typedef int (*pvl_comparef)(void* a, void* b); /* a, b are of the data type*/
void pvl_insert_ordered(pvl_list l,pvl_comparef f,void *d);
void pvl_insert_after(pvl_list l,pvl_elem e,void *d);
void pvl_insert_before(pvl_list l,pvl_elem e,void *d);
/* Remove an element, or clear the entire list */
void* pvl_remove(pvl_list,pvl_elem); /* Remove element, return data */
void pvl_clear(pvl_list); /* Remove all elements, de-allocate all data */
int pvl_count(pvl_list);
/* Navagate the list */
pvl_elem pvl_next(pvl_elem e);
pvl_elem pvl_prior(pvl_elem e);
/* get the data in the list */
#ifndef PVL_USE_MACROS
void* pvl_data(pvl_elem);
#else
#define pvl_data(x) x==0 ? 0 : ((struct pvl_elem_t *)x)->d;
#endif
/* Find an element for which a function returns true */
typedef int (*pvl_findf)(void* a, void* b); /*a is list elem, b is other data*/
pvl_elem pvl_find(pvl_list l,pvl_findf f,void* v);
pvl_elem pvl_find_next(pvl_list l,pvl_findf f,void* v);
/**
* Pass each element in the list to a function
* a is list elem, b is other data
*/
typedef void (*pvl_applyf)(void* a, void* b);
void pvl_apply(pvl_list l,pvl_applyf f, void *v);
#endif /* __PVL_H__ */

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

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