зеркало из https://github.com/mozilla/pjs.git
Modified files, and removing other files.
This commit is contained in:
Родитель
b3a682d4f6
Коммит
45860f878d
|
@ -1 +0,0 @@
|
|||
Eric Busboom <eric@softwarestudio.org>
|
|
@ -1,505 +0,0 @@
|
|||
2001-04-01 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalcomponent.h Changed meaning of
|
||||
icalcomponent_new_from_string. It used to create a new component
|
||||
given the text name of the component type to create. Now it calls
|
||||
icalparser_parse_string to create a new component from the
|
||||
complete iCalendar text representation of the component.
|
||||
|
||||
2001-03-31 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalvalue Changed ACTION properties to take an ACTION value
|
||||
instead of TEXT. The ACTION value is enumerated.
|
||||
|
||||
2001-03-26 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalparameter.h icalparameter_rsvp_* routines now take, return
|
||||
ICAL_RSVP_TRUE and ICAL_RSVP_FALSE, not 0 and 1
|
||||
|
||||
2001-03-25 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalrecur.c Many changes to get YEARLY rules working and fix
|
||||
other errors. Recurrences are stil broken, but more types of rue
|
||||
now work.
|
||||
|
||||
2001-03-16 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalparameter.c Changed icalparameter_new_from_string() to
|
||||
icalparameter_new_from_value_string(). Created new
|
||||
icalparameter_new_from_string() that takes strings of
|
||||
form"PARAMNAME=PARAMVALUE"
|
||||
|
||||
* *_XNAME changes all _XNAME enumerations to _X
|
||||
|
||||
* derived props, values, parameters. Seperated out derived
|
||||
proeprties, parameters and values into their own files. This makes
|
||||
it easier to auto generate all of the enumerations for values,
|
||||
parameters and proeprties.
|
||||
|
||||
* icalenum.h Major changes to icalenum. Movel all of the
|
||||
icalenum_* values to other modules, and changed the names. Look
|
||||
for #defines in icalenum.h tying the old name to the new
|
||||
name. Also moved all of the enumerations into other files.
|
||||
|
||||
|
||||
|
||||
2001-02-26 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* src/libical/icalproperty.c Added
|
||||
icalproperty_set_parameter_from_string and
|
||||
icalproperty_set_value_from_string to aid in binding to Python
|
||||
|
||||
2001-02-15 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* design-data/prop-to-value.txt Made a new CSV file,
|
||||
properties.cvs That collects property-to-value and default value
|
||||
information
|
||||
|
||||
* src/libical/icalproperty.{c,h}.in Moved auto generated code into
|
||||
icalderivedproperty.{c,h} and created icalderivedproperty.{c,h}.in
|
||||
|
||||
|
||||
|
||||
2001-02-14 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* src/libical/Makefile.am: Sigh, automake is dumber than i thought
|
||||
|
||||
2001-02-12 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* src/test/Makefile.am: link with the static versions
|
||||
|
||||
* src/python/Makefile.am: use include dir discovered in configure checks
|
||||
|
||||
* src/python/.cvsignore: shush
|
||||
|
||||
* src/libical/icalrestriction.c: remove autogenerated file
|
||||
|
||||
* src/libical/Makefile.am: the generated files are now disted so
|
||||
look for them in the source dir rather than the build dir
|
||||
|
||||
* src/Makefile.am: Only build the python dir if all the configure
|
||||
stuff checked out
|
||||
|
||||
* configure.in: Remove shared library disabling and add a python
|
||||
check and allow for the python bindings to not be built
|
||||
|
||||
2001-02-11 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* src/python/Makefile.am Tweaked makefile to use automake more,
|
||||
but it stil isn't quie right.
|
||||
|
||||
2001-02-09 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* Shush cvs
|
||||
|
||||
2001-02-09 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* src/libical/Makefile.am: Slightly over zealous during the merge
|
||||
|
||||
2001-02-09 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* src/libical/Makefile.am: Correct typo
|
||||
|
||||
* Removal of more auto generated files
|
||||
|
||||
2001-02-09 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* Removal of various auto generated files
|
||||
|
||||
2001-02-09 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* src/libical/icalparameter.c.in (icalparameter_new_from_string):
|
||||
its NEEDS-ACTION rather than NEEDSACTION
|
||||
(icalparameter_as_ical_string): ditto
|
||||
|
||||
2001-02-09 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* python Added src/python directory. Inserted SWIG wrapper files,
|
||||
and a simple interface to Component, Time, Duration, Period and
|
||||
Store.
|
||||
|
||||
* icallangbind.c More experimental work
|
||||
|
||||
* icalduration.{c,h}, icalperiod.{c,h} Broke out period and
|
||||
duration types into their own files
|
||||
|
||||
2001-02-06 Christopher James Lahey <clahey@ximian.com>
|
||||
|
||||
* src/libical/icallangbind.c: Added a missing #include here.
|
||||
|
||||
* src/libical/icalrecur.c (icalrecur_add_bydayrules): Copy the
|
||||
passed in const vals since we change it.
|
||||
|
||||
2001-02-06 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icaltime.c Changed icaltime_from_day_of_year to run mktime in
|
||||
the UTC timezone. This fixed a bug where it would return one day
|
||||
eariler for some timezones.
|
||||
|
||||
2001-02-05 Ettore Perazzoli <ettore@ximian.com>
|
||||
|
||||
* src/libical/Makefile.am (COMBINEDHEADERS): `icalvalue.h',
|
||||
`icalparameter.h', `icalproperty.h' and `icalrestriction.h' are
|
||||
created in the builddir so they shouldn't be prefixed with
|
||||
`$(top_builddir)/src/libical'.
|
||||
|
||||
2001-01-26 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalproperty.c.in Improved icalproperty_as_ical_string() to
|
||||
eliminate the possibility of having a VALUE parameter that does
|
||||
not match the actual kind of value.
|
||||
|
||||
* icalvalue.c.in made icalvalue_*_trigger() and
|
||||
icalvalue_*_datetimeperiod non-autogenerated. These routines were
|
||||
for combined value type -- non standard values that can have more
|
||||
than on standard value type. These non-standard types now delegate
|
||||
to stadard types.
|
||||
|
||||
2001-01-24 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalfileset.c fixed icalfileset_read-from_file so it will handle
|
||||
lines longer than 80 char properly.
|
||||
|
||||
2001-01-23 JP Rosevear <jpr@ximian.com>
|
||||
|
||||
* configure.in: Don't AC_INIT on an autogenerated file that does not
|
||||
exist beforehand
|
||||
|
||||
2001-01-23 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icltime.c Removed all of the _local_ routines and simplified
|
||||
icaltime_utc_offset and icaltime_as_timet
|
||||
|
||||
* regression.c Added tests for triggers and improvements to icaltime.c
|
||||
|
||||
* icaltypes.c Addedd icaltriggertype_from_string and changed
|
||||
icaltriggertype to be a struct
|
||||
|
||||
2001-01-22 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icaltime.c implemented icaldurationtype_from_string to parse the
|
||||
string it self, rather than use lex/yacc
|
||||
|
||||
2001-01-15 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalfileset.c Many improvements. File locking now works, and so
|
||||
does searching with icalfileset_select()
|
||||
|
||||
2001-01-08 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* Makefile.am Remove spaces after -I in several
|
||||
Makefile.am routines.
|
||||
|
||||
* icalset.c removed return statements from some void functions.
|
||||
|
||||
* icalparameter.c.in Added break to default: case that had no
|
||||
body. Compilers on Solaris and Tru64 UNIX complained.
|
||||
|
||||
2001-01-02 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icaltime.c Changed icaldurationtype_from_time and _as_timet to
|
||||
_from_int and _as_int. This is a change interface that may break
|
||||
some code.
|
||||
|
||||
* icalgauge.c icalgaugeimpl.h, icalgauge.h., Rewrote gauge code to
|
||||
use pvl-lists directly, instead of trying to reuse icalcomponent.
|
||||
|
||||
2000-12-13 Ettore Perazzoli <ettore@helixcode.com>
|
||||
|
||||
* src/libicalvcal/Makefile.am (INCLUDES): Add
|
||||
`$(top_builddir)/src/libical' to the include directory list.
|
||||
|
||||
* src/libical/Makefile.am (icalparameter.h): Use `$(srcdir)'.
|
||||
(icalparameter.c): Likewise.
|
||||
(icalproperty.h): Likewise.
|
||||
(icalproperty.c): Likewise.
|
||||
(icalvalue.h): Likewise.
|
||||
(icalvalue.c): Likewise.
|
||||
(icalrestriction.c): Likewise.
|
||||
(COMBINEDHEADERS): `icalvalue.h', `icalparameter.h' and
|
||||
`icalproperty.h' are in builddir, not srcdir, so fix the list to
|
||||
use `$(top_builddir)' instead of `$(top_srcdir)'.
|
||||
(all): Removed.
|
||||
(BUILT_SOURCES): Move `ical.h' here instead.
|
||||
(ical.h): Don't depend on `(BUILT_SOURCES)'; this a built source
|
||||
itself.
|
||||
|
||||
2000-12-12 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalparser.c Addedd support for x-parameters.
|
||||
|
||||
* icalenum.c Fixed icalenum_parameter_type_to_string and
|
||||
icalenum_property_type_to_string to property identify X- parameers
|
||||
and properties.
|
||||
|
||||
* icalparameter.c Fixed icalparameter_as_ical_string to property
|
||||
write out X-Parameters.
|
||||
|
||||
|
||||
2000-12-11 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalcstp.c added empty bodies to prep_* routines so that shared
|
||||
libraries would build.
|
||||
|
||||
2000-12-11 JP Rosevear <jpr@helixcode.com>
|
||||
|
||||
* src/libical/icaltime.c (icaltime_compare_date_only): New
|
||||
function that compares only the dates, not the times as well.
|
||||
|
||||
* src/libical/icaltime.h: Add prototype for the function above.
|
||||
|
||||
* src/libical/icalrecur.h (struct icalrecurrencetype): Correct
|
||||
header documentation.
|
||||
|
||||
* src/libical/icaltypes.c: No longer include <limits.h>.
|
||||
|
||||
* src/libical/icalrecur.c: Likewise.
|
||||
|
||||
* src/libical/icalvalue.c: Likewise.
|
||||
|
||||
* src/libical/icalyacc.y: Likewise.
|
||||
|
||||
2000-12-11 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* configure.in (AC_OUTPUT): Fixed order of generated files to make
|
||||
"make distcheck" work. Turn on AM_MAINTAINER_MODE.
|
||||
|
||||
* src/libical/Makefile.am (EXTRA_DIST): Add icalversion.h.in.
|
||||
(COMBINEDHEADERS): Added paths to make "make distcheck" work.
|
||||
(libical_la_SOURCES): Added headers for distribution in our weird
|
||||
setup.
|
||||
|
||||
2000-12-06 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icaltime.c added icaltime_as_local to convert a UTC time to a
|
||||
local time
|
||||
|
||||
* icaltime.h icaltime.c Removed is_utc argument from
|
||||
icaltime_from_timet
|
||||
|
||||
|
||||
2000-11-29 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalrecur.c More testing and bug fixes. Many more of the rules
|
||||
in recur.txt work correctly.
|
||||
|
||||
2000-11-28 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalrecur.c Several changes to extract icalrecur.c from
|
||||
libical. I'd like to make it into a reference impl for recurrence
|
||||
rules. CHanges include moving all of the recurrence type and
|
||||
recurrence enums from icalenum and icaltypes into icalrecur, and
|
||||
adding code to parse recurrence rule strings.
|
||||
|
||||
* icaltime.c Changed icaltime_from_string to parse the string
|
||||
directly. Now icaltime.c has no dependency on icalvalue.c
|
||||
|
||||
2000-11-21 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalrecur.c Fixed a bug in the increment_* routines that made
|
||||
incrementing by more then 1 insensible. Thanks to Martin Neimeier
|
||||
|
||||
2000-11-20 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalmessage.c Many routines to create new ical messages.
|
||||
|
||||
* icalspanlist.c Code to generate a list of the busy time f the
|
||||
VEVENTS in a set. Also includes routiens to generate free and busy
|
||||
lists from the spanlist, and to find the next free time after a
|
||||
given time.
|
||||
|
||||
* icalvalue.c The STATUS property now has its own value type,
|
||||
STATUS, which holds the enumeration icalproperty_status.
|
||||
|
||||
* icalrestriction.c Added more restrictions. Now handles mutual
|
||||
and exclusive consitions, and checks for the reight values in
|
||||
STATUS properties
|
||||
|
||||
|
||||
2000-11-10 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icaltypes.c Added routine to create durationtype from string:
|
||||
icaldurationtype_from_string
|
||||
|
||||
2000-11-09 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalcomponet.c Add sever get/set convienience routines to access
|
||||
and manipulate common component propoerties from the component
|
||||
interface. This eliminates the need to create a lot of temporary
|
||||
variables if you just want to change the start time of and event.
|
||||
|
||||
2000-11-06 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalcomponent.c Added new routines to icalcomponent:
|
||||
_get_span -- returns the start and end times of the event in UTC
|
||||
_get_first_real_component -- return ref to VTODO, VEVENT or VJOURNAL
|
||||
|
||||
* icalspanlist.c Added new class, icalspanlist, that generates a
|
||||
list of alternating busy and free times from an icalset. The class
|
||||
includes routines to gnerate rfc2445 busy and free lists, and to
|
||||
get the next avaliable busy or free time after a given time.
|
||||
|
||||
2000-11-06 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* src/libical/icalvalue.c (icalvalue_recur_as_ical_string): Handle
|
||||
both the position and weekday in the by_day field.
|
||||
|
||||
2000-10-20 Eric Busboom <eric@agony.busboom.org>
|
||||
|
||||
* Const correctness. Added 'const' all over everywhere.
|
||||
|
||||
2000-10-19 Eric Busboom <eric@agony.busboom.org>
|
||||
|
||||
* icalproperty, icalparameter, icalvalue .c, .h Changed most
|
||||
instances of char* to const char*
|
||||
|
||||
* icalclassify.h Added multiple include protection
|
||||
|
||||
* icalset.h and others, got rid of parameter named "new"
|
||||
|
||||
2000-10-15 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalcomponent Added convienience functions for constructing
|
||||
components: icalcomponent_new_vcalendar(), etc.
|
||||
|
||||
* Makefile.am Incorporated build system patch from Federico
|
||||
Quintero. Misc small fixes and cleanup
|
||||
|
||||
* scripts Incorporated auto-gen patch from Frederico. Generated
|
||||
code in libical now uses icalproperty.c.in (etc) instead of
|
||||
editing file icalparoperty.c in place.
|
||||
|
||||
* libical. Changed flex/bison to use the -P/-p options to set
|
||||
ical_yy as a prefix. Removed prefix redefinition from icalyacc.y
|
||||
|
||||
2000-10-12 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalproperty.c Fixed icalproperty_get_{first,next}_parameter to
|
||||
honor the parameter kind argument
|
||||
|
||||
* icalparameter.c Added, but did not complete, a new version of
|
||||
icalparameters_from_string that does not use the hairy nested
|
||||
case/switch statements of the previous version
|
||||
|
||||
|
||||
2000-10-02 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* ical.h ical.h and icalss.h now are concatenations of all of the
|
||||
public headers for their respective libraries. Thus, only ical.h,
|
||||
icalss.h and icalvcal.h need to be installed.
|
||||
|
||||
2000-09-11 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalvcal.c Added more comments
|
||||
|
||||
2000-08-31 JP Rosevear <jpr@helixcode.com>
|
||||
|
||||
* configure.in: Don't list config.h in AC_OUTPUT
|
||||
|
||||
2000-08-26 Ettore Perazzoli <ettore@helixcode.com>
|
||||
|
||||
* examples/Makefile.am (INCLUDES): More `$(srcdir)' loving.
|
||||
|
||||
* src/libicalvcal/Makefile.am (INCLUDES): Add `-I
|
||||
$(srcdir)/../libical' for builddir != srcdir loving.
|
||||
|
||||
2000-08-25 Christopher James Lahey <clahey@helixcode.com>
|
||||
|
||||
* examples/access_properties_and_parameters.c,
|
||||
src/libicalvcal/vcc.y: Got rid of some warnings.
|
||||
|
||||
* src/libicalvcal/vcc.c: Checking in generated C file.
|
||||
|
||||
2000-08-25 Christopher James Lahey <clahey@helixcode.com>
|
||||
|
||||
* src/libical/icalcomponent.c: Fixed an incorrect struct name.
|
||||
|
||||
2000-08-25 Peter Williams <peterw@helixcode.com>
|
||||
|
||||
* src/libical/icalcomponent.c (icalcomponent_end_component): Compile fix;
|
||||
use icalerror_check_arg_re so we can return an valid icalcompiter.
|
||||
(icalcomponent_begin_component): Same.
|
||||
|
||||
2000-08-24 Federico Mena Quintero <federico@helixcode.com>
|
||||
|
||||
* src/test/Makefile.am: Make it work.
|
||||
|
||||
2000-08-04 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* stow.c Changed stow to write data to a file ( icalfileset) not a
|
||||
calendar. Also added MIME parsing capability
|
||||
|
||||
* sspm.c Core of the mime processor. Now handles quoted-printable
|
||||
and base64 encodings
|
||||
|
||||
* icalmime.h New file that parses mime data and returns an
|
||||
icalcomponent that includes all of the parts.
|
||||
|
||||
|
||||
2000-07-26 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icaldirset.h misc bug fixes to get deleting components to work
|
||||
|
||||
* icalcomponent.h Eliminated internal use of _get_first_component
|
||||
and _get_next_component, since these will reset the interal
|
||||
iterators.
|
||||
|
||||
2000-07-23 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalcomponent.h Added external iterators to icalcomponent for
|
||||
subcomponents: icalcompiter. These are still experimental, but they
|
||||
seem to work OK and have a nice syntax
|
||||
|
||||
2000-07-18 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalset This is a new "superclass" for icalstore, icalcluster,
|
||||
and others. It merges the interfaces of the old icalstore and
|
||||
icalcluster
|
||||
|
||||
* icalstore.{c,h} CHanged name to icaldirset
|
||||
|
||||
* icalcluster.{c,h} Changed name to icalfileset
|
||||
|
||||
|
||||
2000-06-12 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalstow.c misc improvements and bug fixes to make it useful.
|
||||
|
||||
2000-06-09 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalrecur.c More extensive code changes for recurrence rule.
|
||||
|
||||
* icalyacc.y Added support for integers in by day lists
|
||||
|
||||
2000-06-01 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalrecur.c moved recur code into new files
|
||||
|
||||
2000-05-30 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icaltypes.c Extensive work on code to expand recurences
|
||||
|
||||
* icaltypes.h Changed signature icaltimetype_from_timet to include
|
||||
is_utc flag.
|
||||
|
||||
|
||||
2000-03-17 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalstore.c Vastly improved icalstore_test.
|
||||
|
||||
2000-03-16 Eric Busboom <eric@softwarestudio.org>
|
||||
|
||||
* icalcluster.c Added compile flag (ICAL_SAFESAVES) to switch how
|
||||
icalcluster saves files during commits. When the flag is define,
|
||||
it will write the data to a temorar file and rename the file to
|
||||
the target file.
|
||||
|
||||
* storage.c Added seterate test suite for sotage components
|
||||
|
||||
* icalparser.c Created parser object, implemented line-oriented
|
||||
parsering, and made message oriented parsing work in terms f line
|
||||
oriented parsing.
|
||||
|
||||
* icalparser.c Fixed icalparser_get_line to remove \r in input.
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
EXTRA_DIST = \
|
||||
ChangeLog \
|
||||
README \
|
||||
TEST \
|
||||
TODO
|
||||
|
||||
SUBDIRS = design-data doc scripts test-data src examples
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
|
||||
LIBICAL -- An implementation of basic iCAL protocols
|
||||
|
||||
The code and datafiles in this distribution are licensed under the
|
||||
Mozilla Public License. See http://www.mozilla.org/NPL/MPL-1.0.html
|
||||
for a copy of the license. Alternately, you may use libical under the
|
||||
terms of the GNU Library General Public License. See
|
||||
http://www.fsf.org/copyleft/lesser.html for a copy of the LGPL.
|
||||
|
||||
This dual license ensures that the library can be incorporated into
|
||||
both proprietary code and GPL'd programs, and will benefit from
|
||||
improvements made by programmers in both realms. I will only accept
|
||||
changes into my version of the library if they are similarly
|
||||
dual-licensed.
|
||||
|
||||
The code in this distribution implements the iCal protocols as
|
||||
described in RFC2445 and RFC2446. The code is in very early stages of
|
||||
development.
|
||||
|
||||
Portions of this distribution are (C) Copyright 1996 Apple Computer,
|
||||
Inc., AT&T Corp., International Business Machines Corporation and
|
||||
Siemens Rolm Communications Inc. See src/libicalvcal/README.TXT for
|
||||
details.
|
||||
|
||||
This code is under active development. If you would like to contribute
|
||||
to the project, you can contact me, Eric Busboom, at
|
||||
eric@softwarestudio.org. The project has a webpage at
|
||||
|
||||
http://softwarestudio.org/libical/index.html
|
||||
|
||||
and a mailing list that you can join by sending the following mail:
|
||||
|
||||
------------
|
||||
To: minimalist@softwarestudio.org
|
||||
Subject: subscribe libical
|
||||
------------
|
||||
|
||||
|
||||
Building the library
|
||||
--------------------
|
||||
|
||||
This distribution is developed on Red Hat Linux 6.0 and usually
|
||||
compiles on SunOS 5.6 and FreeBSD 2.27. I have reports of success of
|
||||
previous version on MacOS ( with CodeWarrior ) and on UnixWare, but I
|
||||
don't know about any other systems.
|
||||
|
||||
The library is configured with automake. From the root directory, run
|
||||
|
||||
./configure
|
||||
|
||||
To build all of the Makefiles for your system. If you will be installing the library, you may want to use the --prefix flag to set the directory where the library and header files will be installed.
|
||||
|
||||
./configure --prefix=/proj/local/
|
||||
|
||||
If configure runs fine, run "make" to build the library and
|
||||
"make install" to install it.
|
||||
|
||||
Although the distribution uses libtool to generate libraries, it has
|
||||
shared libraries turned off by default. To create and install shared
|
||||
libraries use:
|
||||
|
||||
./configure --enable-shared
|
||||
|
||||
The current version of libical focuses on creating and
|
||||
manipulating iCal objects. With it, you can parse text representations
|
||||
of iCal components, add and remove sub-components, properties,
|
||||
parameters and values, and print the components back out as strings.
|
||||
|
||||
|
||||
Notes for Libical Developers
|
||||
-------------------
|
||||
|
||||
If you don't want to use gcc as the compiler, and you got the sources
|
||||
from CVS, you should set the CC variable to the path to the compiler
|
||||
and run "automake --include-deps" to keep automake from using
|
||||
gcc-specific automatic dependancy tracking.
|
||||
|
||||
> CC=/pkg/SUNWspro/bin/cc; export CC
|
||||
> automake --include-deps
|
||||
> ./configure --prefix=/proj/local/
|
||||
> make
|
||||
|
||||
You will not need to re-run automake unless you got the sources from CVS.
|
||||
|
||||
Using the Library
|
||||
-----------------
|
||||
|
||||
There is rudimentary, unfinished documentation in the /doc directory,
|
||||
and annotated examples in /examples.
|
||||
|
||||
|
||||
Perl Library
|
||||
------------
|
||||
|
||||
There is a perl language binding of this library, LIBICAL.
|
||||
It is available from http://www.softwarestudio.org/libical
|
||||
|
||||
|
||||
Eric Busboom
|
||||
eric@softwarestudio.org
|
|
@ -1,54 +0,0 @@
|
|||
Thanks to:
|
||||
|
||||
Allan Clark <allanc@atlas.platypus.bc.ca> for testing libical against
|
||||
UnixWare.
|
||||
|
||||
Graham Davison <g.m.davison@computer.org> for MacOS support and
|
||||
miscelaneous code bits
|
||||
|
||||
Seth Alves <alves@hungry.com> for the first cut at the Makefile.am
|
||||
files and various utility functions.
|
||||
|
||||
Russ Steinthal <rms39@columbia.edu> for several utility functions and
|
||||
comments.
|
||||
|
||||
Ola Lundqvist <olalu526@student.liu.se> for the vCal test data file.
|
||||
|
||||
Colin DuPlantis <colin@cp.net> for new functions in icalparser.c
|
||||
|
||||
Holger Schmidt <hschmidt@chronolabs.de> for all of icalcstp.c, The
|
||||
CSTP protocol implementation, and modifications to icalcstp.h
|
||||
|
||||
Gisle Hannemyr <gisle@oslonett.no> The decode*() functions in sspm.c
|
||||
are based on the decode() routine in the mimelite program, Copyright
|
||||
(c) 1994 Gisle Hannemyr.
|
||||
|
||||
The Evolution team at Helixcode ( Federico Mena Quintero
|
||||
<federico@helixcode.com>, JP Rosevear <jpr@helixcode.com>, Ettore
|
||||
Perazzoli <ettore@helixcode.com>, Christopher James Lahey
|
||||
<clahey@helixcode.com>, Peter Williams <peterw@helixcode.com>) for
|
||||
miscelaneous patches and adjustments to the build system.
|
||||
|
||||
Cornelius Schumacher <schumacher@kde.org> for many insightful
|
||||
suggestions and a few patches.
|
||||
|
||||
Mark D. Anderson <mda@discerning.com> for discussions and ideas.
|
||||
|
||||
Martin Neimeier <nei@ibn.de> for correcting bugs in icalrecur.c
|
||||
|
||||
Tom Leitner <tom@radar.tu-graz.ac.at> For several bug fixes in
|
||||
compiling on Tru64 UNIX.
|
||||
|
||||
Patrick Lewis <plewis@inetarena.com> for several bug reports and
|
||||
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()
|
|
@ -1,20 +0,0 @@
|
|||
/* Define to make icalerror_* calls abort instead of internally
|
||||
signalling an error */
|
||||
#undef ICAL_ERRORS_ARE_FATAL
|
||||
|
||||
/* Define to make icalcluster_commit() save to a temp file and mv to
|
||||
the original file instead of writing to the orig file directly */
|
||||
#undef ICAL_SAFESAVES
|
||||
|
||||
/* Define to terminate lines with "\n" instead of "\r\n" */
|
||||
#undef ICAL_UNIX_NEWLINE
|
||||
|
||||
/* Define if your libc defines a "timezone" variable */
|
||||
#undef HAVE_TIMEZONE
|
||||
|
||||
/* Define if your libc defines a struct tm containing a "tm_gmtoff" member */
|
||||
#undef HAVE_TM_GMTOFF
|
||||
|
||||
/* Define to 1 if your compile does not like lines like: struct
|
||||
something foo[]*/
|
||||
#undef ICAL_NO_EMPTY_ARRAY_DECL
|
|
@ -1,6 +1,6 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(src)
|
||||
AM_INIT_AUTOMAKE(libical,0.23)
|
||||
AM_INIT_AUTOMAKE(libical,0.23a)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl Initialize maintainer mode
|
||||
|
@ -21,7 +21,13 @@ AC_SUBST(AR)
|
|||
AC_CHECK_PROGS(AR, ar aal, ar)
|
||||
AC_CHECK_PROGS(PERL, perl5 perl)
|
||||
|
||||
dnl **************************************************
|
||||
dnl test/regression.c (and maybe others) needs this defined
|
||||
dnl **************************************************
|
||||
AC_DEFINE(ICAL_ERRORS_ARE_FATAL,1)
|
||||
AC_DEFINE(NO_WARN_DEPRECATED,1)
|
||||
AC_DEFINE(NO_WARN_ICAL_MALFORMEDDATA_ERROR_HACK,1)
|
||||
|
||||
AC_DEFINE(ICAL_SAFESAVES,1)
|
||||
AC_DEFINE(ICAL_UNIX_NEWLINE,1)
|
||||
dnl AC_DEFINE(ICAL_NO_EMPTY_ARRAY_DECL)
|
||||
|
@ -100,5 +106,6 @@ src/libicalvcal/Makefile
|
|||
src/python/Makefile
|
||||
src/test/Makefile
|
||||
test-data/Makefile
|
||||
zoneinfo/Makefile
|
||||
])
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"RSVP","icalparameter_rsvp","TRUE;FALSE"
|
||||
"SENT-BY","const char*",
|
||||
"TZID","const char*",
|
||||
"VALUE","icalparameter_value","BINARY;BOOLEAN;DATE;DURATION;FLOAT;INTEGER;PERIOD;RECUR;TEXT;TIME;URI;ERROR;DATE-TIME;UTC-OFFSET;CAL-ADDRESS"
|
||||
"VALUE","icalparameter_value","BINARY;BOOLEAN;DATE;DURATION;FLOAT;INTEGER;PERIOD;RECUR;TEXT;URI;ERROR;DATE-TIME;UTC-OFFSET;CAL-ADDRESS"
|
||||
"X","const char*",
|
||||
"X-LIC-ERRORTYPE","icalparameter_xlicerrortype","COMPONENT-PARSE-ERROR;PROPERTY-PARSE-ERROR;PARAMETER-NAME-PARSE-ERROR;PARAMETER-VALUE-PARSE-ERROR;VALUE-PARSE-ERROR;INVALID-ITIP;UNKNOWN-VCAL-PROP-ERROR;MIME-PARSE-ERROR"
|
||||
"X-LIC-COMPARETYPE","icalparameter_xliccomparetype","EQUAL;NOTEQUAL;LESS;GREATER;LESSEQUAL;GREATEREQUAL;REGEX"
|
||||
|
|
|
|
@ -5,7 +5,7 @@
|
|||
"ATTENDEE","CAL-ADDRESS","CAL-ADDRESS"
|
||||
"CALSCALE","TEXT","TEXT"
|
||||
"CATEGORIES","TEXT","TEXT"
|
||||
"CLASS","TEXT","TEXT"
|
||||
"CLASS","CLASS","CLASS"
|
||||
"COMMENT","TEXT","TEXT"
|
||||
"COMPLETED","DATE-TIME","DATE-TIME"
|
||||
"CONTACT","TEXT","TEXT"
|
||||
|
@ -31,7 +31,7 @@
|
|||
"RECURRENCE-ID","DATE-TIME","DATE-TIME"
|
||||
"RELATED-TO","TEXT","TEXT"
|
||||
"REPEAT","INTEGER","INTEGER"
|
||||
"REQUEST-STATUS","STRING","STRING"
|
||||
"REQUEST-STATUS","REQUEST-STATUS","REQUEST-STATUS"
|
||||
"RESOURCES","TEXT","TEXT"
|
||||
"RRULE","RECUR","RECUR"
|
||||
"SEQUENCE","INTEGER","INTEGER"
|
||||
|
@ -62,5 +62,6 @@
|
|||
"X-LIC-MIMEOPTINFO","STRING","STRING"
|
||||
"X-LIC-MIMECID","STRING","STRING"
|
||||
"X-LIC-MIMEFILENAME","STRING","STRING"
|
||||
"X-LIC-CLASS","X-LIC-CLASS","X-LIC-CLASS"
|
||||
"ANY","NO","NO"
|
||||
"NO","NO","NO"
|
||||
|
|
|
|
@ -1,31 +0,0 @@
|
|||
"#Name","C type& gen flag","Python","Component Values","Enum Values"
|
||||
"BINARY","(a)const char*","file","unitary",
|
||||
"BOOLEAN","(a)int","integer","unitary",
|
||||
"CAL-ADDRESS","(a)const char*","string","unitary",
|
||||
"DATE","(a)struct icaltimetype","Time","unitary",
|
||||
"DATE-TIME","(a)struct icaltimetype","Time","unitary",
|
||||
"DURATION","(a)struct icaldurationtype","Duration","unitary",
|
||||
"FLOAT","(a)float","float","unitary",
|
||||
"INTEGER","(a)int","integer","unitary",
|
||||
"PERIOD","(a)struct icalperiodtype","Period","unitary",
|
||||
"RECUR","(m)struct icalrecurrencetype","RecurrenceSet","unitary",
|
||||
"TEXT","(a)const char*","string","unitary",
|
||||
"TIME","(a)struct icaltimetype","Time","unitary",
|
||||
"URI","(a)const char*","string","unitary",
|
||||
"UTC-OFFSET","(a)int","integer","unitary",
|
||||
"QUERY","(a)const char*","string","unitary",
|
||||
"#Non-standard multi-valued types",,,,
|
||||
"ATTACH","(a)struct icalattachtype","none","URI;BINARY",
|
||||
"DATE-TIME-DATE","(a)struct icaltimetype","none","DATE-TIME;DATE",
|
||||
"DATE-TIME-PERIOD","(m)struct icaldatetimeperiodtype","none","DATE-TIME;PERIOD",
|
||||
"TRIGGER","(m)struct icaltriggertype","string","DURATION;DATE-TIME",
|
||||
"#Non-standard property enumeration types",,,,
|
||||
"METHOD","(a)enum icalproperty_method","string","unitary","PUBLISH;REQUEST;REPLY;ADD;CANCEL;REFRESH;COUNTER;DECLINECOUNTER;CREATE;READ;RESPONSE;MOVE;MODIFY;GENERATEUID;DELETE"
|
||||
"ACTION","(a)enum icalproperty_action","string","unitary","AUDIO;DISPLAY;EMAIL;PROCEDURE"
|
||||
"STATUS","(a)enum icalproperty_status","string","unitary","TENTATIVE;CONFIRMED;COMPLETED;NEEDS-ACTION;CANCELLED;IN-PROCESS;DRAFT;FINAL"
|
||||
"TRANSP","(a)enum icalproperty_transp","string","unitary","OPAQUE;TRANSPARENT"
|
||||
"CLASS","(a)enum icalproperty_class","string","unitary","PUBLIC;PRIVATE;CONFIDENTIAL"
|
||||
"#Other non-standard",,,,
|
||||
"GEO","(a)struct icalgeotype","tuple","unitary",
|
||||
"STRING","(a)const char*","string","unitary",
|
||||
"X","(m)const char*","string","unitary",
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,319 +0,0 @@
|
|||
/* Access_component.c */
|
||||
|
||||
#include "ical.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h> /* for strdup */
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <stdio.h> /* for printf */
|
||||
#include <time.h> /* for time() */
|
||||
#include "icalmemory.h"
|
||||
|
||||
void do_something(icalcomponent *c);
|
||||
|
||||
/* Creating iCal Components
|
||||
|
||||
There are two ways to create new component in libical. You can
|
||||
build the component from primitive parts, or you can create it
|
||||
from a string.
|
||||
|
||||
There are two variations of the API for building the component from
|
||||
primitive parts. In the first variation, you add each parameter and
|
||||
value to a property, and then add each property to a
|
||||
component. This results in a long series of function calls. This
|
||||
style is show in create_new_component()
|
||||
|
||||
The second variation uses vargs lists to nest many primitive part
|
||||
constructors, resulting in a compact, neatly formated way to create
|
||||
components. This style is shown in create_new_component_with_va_args()
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
icalcomponent* create_new_component()
|
||||
{
|
||||
|
||||
/* variable definitions */
|
||||
icalcomponent* calendar;
|
||||
icalcomponent* event;
|
||||
struct icaltimetype atime = icaltime_from_timet( time(0),0);
|
||||
struct icalperiodtype rtime;
|
||||
icalproperty* property;
|
||||
|
||||
/* Define a time type that will use as data later. */
|
||||
rtime.start = icaltime_from_timet( time(0),0);
|
||||
rtime.end = icaltime_from_timet( time(0),0);
|
||||
rtime.end.hour++;
|
||||
|
||||
/* Create calendar and add properties */
|
||||
|
||||
calendar = icalcomponent_new(ICAL_VCALENDAR_COMPONENT);
|
||||
|
||||
/* Nearly every libical function call has the same general
|
||||
form. The first part of the name defines the 'class' for the
|
||||
function, and the first argument will be a pointer to a struct
|
||||
of that class. So, icalcomponent_ functions will all take
|
||||
icalcomponent* as their first argument. */
|
||||
|
||||
/* The next call creates a new proeprty and immediately adds it to the
|
||||
'calendar' component. */
|
||||
|
||||
icalcomponent_add_property(
|
||||
calendar,
|
||||
icalproperty_new_version("2.0")
|
||||
);
|
||||
|
||||
|
||||
/* Here is the short version of the memory rules:
|
||||
|
||||
If the routine name has "new" in it:
|
||||
Caller owns the returned memory.
|
||||
If you pass in a string, the routine takes the memory.
|
||||
|
||||
If the routine name has "add" in it:
|
||||
The routine takes control of the component, property,
|
||||
parameter or value memory.
|
||||
|
||||
If the routine returns a string ( "get" and "as_ical_string" )
|
||||
The library owns the returned memory.
|
||||
|
||||
There are more rules, so refer to the documentation for more
|
||||
details.
|
||||
|
||||
*/
|
||||
|
||||
icalcomponent_add_property(
|
||||
calendar,
|
||||
icalproperty_new_prodid("-//RDU Software//NONSGML HandCal//EN")
|
||||
);
|
||||
|
||||
/* Add an event */
|
||||
|
||||
event = icalcomponent_new(ICAL_VEVENT_COMPONENT);
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_dtstamp(atime)
|
||||
);
|
||||
|
||||
/* In the previous call, atime is a struct, and it is passed in by value.
|
||||
This is how all compound types of values are handled. */
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_uid("guid-1.host1.com")
|
||||
);
|
||||
|
||||
/* add a property that has parameters */
|
||||
property = icalproperty_new_organizer("mailto:mrbig@host.com");
|
||||
|
||||
icalproperty_add_parameter(
|
||||
property,
|
||||
icalparameter_new_role(ICAL_ROLE_CHAIR)
|
||||
);
|
||||
|
||||
icalcomponent_add_property(event,property);
|
||||
|
||||
/* In this style of component creation, you need to use an extra
|
||||
call to add parameters to properties, but the form of this
|
||||
operation is the same as adding a property to a component */
|
||||
|
||||
/* add another property that has parameters */
|
||||
property = icalproperty_new_attendee("mailto:employee-A@host.com");
|
||||
|
||||
icalproperty_add_parameter(
|
||||
property,
|
||||
icalparameter_new_role(ICAL_ROLE_REQPARTICIPANT)
|
||||
);
|
||||
|
||||
icalproperty_add_parameter(
|
||||
property,
|
||||
icalparameter_new_rsvp(1)
|
||||
);
|
||||
|
||||
icalproperty_add_parameter(
|
||||
property,
|
||||
icalparameter_new_cutype(ICAL_CUTYPE_GROUP)
|
||||
);
|
||||
|
||||
icalcomponent_add_property(event,property);
|
||||
|
||||
|
||||
/* more properties */
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_description("Project XYZ Review Meeting")
|
||||
);
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_categories("MEETING")
|
||||
);
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_class("PUBLIC")
|
||||
);
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_created(atime)
|
||||
);
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_summary("XYZ Project Review")
|
||||
);
|
||||
|
||||
property = icalproperty_new_dtstart(atime);
|
||||
|
||||
icalproperty_add_parameter(
|
||||
property,
|
||||
icalparameter_new_tzid("US-Eastern")
|
||||
);
|
||||
|
||||
icalcomponent_add_property(event,property);
|
||||
|
||||
|
||||
property = icalproperty_new_dtend(atime);
|
||||
|
||||
icalproperty_add_parameter(
|
||||
property,
|
||||
icalparameter_new_tzid("US-Eastern")
|
||||
);
|
||||
|
||||
icalcomponent_add_property(event,property);
|
||||
|
||||
icalcomponent_add_property(
|
||||
event,
|
||||
icalproperty_new_location("1CP Conference Room 4350")
|
||||
);
|
||||
|
||||
icalcomponent_add_component(calendar,event);
|
||||
|
||||
return calendar;
|
||||
}
|
||||
|
||||
|
||||
/* Now, create the same component as in the previous routine, but use
|
||||
the constructor style. */
|
||||
|
||||
icalcomponent* create_new_component_with_va_args()
|
||||
{
|
||||
|
||||
/* This is a similar set up to the last routine */
|
||||
icalcomponent* calendar;
|
||||
struct icaltimetype atime = icaltime_from_timet( time(0),0);
|
||||
struct icalperiodtype rtime;
|
||||
|
||||
rtime.start = icaltime_from_timet( time(0),0);
|
||||
rtime.end = icaltime_from_timet( time(0),0);
|
||||
rtime.end.hour++;
|
||||
|
||||
/* Some of these routines are the same as those in the previous
|
||||
routine, but we've also added several 'vanew' routines. These
|
||||
'vanew' routines take a list of properties, parameters or
|
||||
values and add each of them to the parent property or
|
||||
component. */
|
||||
|
||||
calendar =
|
||||
icalcomponent_vanew(
|
||||
ICAL_VCALENDAR_COMPONENT,
|
||||
icalproperty_new_version("2.0"),
|
||||
icalproperty_new_prodid("-//RDU Software//NONSGML HandCal//EN"),
|
||||
icalcomponent_vanew(
|
||||
ICAL_VEVENT_COMPONENT,
|
||||
icalproperty_new_dtstamp(atime),
|
||||
icalproperty_new_uid("guid-1.host1.com"),
|
||||
icalproperty_vanew_organizer(
|
||||
"mailto:mrbig@host.com",
|
||||
icalparameter_new_role(ICAL_ROLE_CHAIR),
|
||||
0
|
||||
),
|
||||
icalproperty_vanew_attendee(
|
||||
"mailto:employee-A@host.com",
|
||||
icalparameter_new_role(ICAL_ROLE_REQPARTICIPANT),
|
||||
icalparameter_new_rsvp(1),
|
||||
icalparameter_new_cutype(ICAL_CUTYPE_GROUP),
|
||||
0
|
||||
),
|
||||
icalproperty_new_description("Project XYZ Review Meeting"),
|
||||
|
||||
icalproperty_new_categories("MEETING"),
|
||||
icalproperty_new_class("PUBLIC"),
|
||||
icalproperty_new_created(atime),
|
||||
icalproperty_new_summary("XYZ Project Review"),
|
||||
icalproperty_vanew_dtstart(
|
||||
atime,
|
||||
icalparameter_new_tzid("US-Eastern"),
|
||||
0
|
||||
),
|
||||
icalproperty_vanew_dtend(
|
||||
atime,
|
||||
icalparameter_new_tzid("US-Eastern"),
|
||||
0
|
||||
),
|
||||
icalproperty_new_location("1CP Conference Room 4350"),
|
||||
0
|
||||
),
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
/* Note that properties with no parameters can use the regular
|
||||
'new' constructor, while those with parameters use the 'vanew'
|
||||
constructor. And, be sure that the last argument in the 'vanew'
|
||||
call is a zero. Without, your program will probably crash. */
|
||||
|
||||
return calendar;
|
||||
}
|
||||
|
||||
|
||||
void find_sub_components(icalcomponent* comp)
|
||||
{
|
||||
icalcomponent *c;
|
||||
|
||||
/* The second parameter to icalcomponent_get_first_component
|
||||
indicates the type of component to search for. This will
|
||||
iterate through all sub-components */
|
||||
for(c = icalcomponent_get_first_component(comp,ICAL_ANY_COMPONENT);
|
||||
c != 0;
|
||||
c = icalcomponent_get_next_component(comp,ICAL_ANY_COMPONENT)){
|
||||
|
||||
do_something(c);
|
||||
}
|
||||
|
||||
/* This will iterate only though VEVENT sub-components */
|
||||
|
||||
for(c = icalcomponent_get_first_component(comp,ICAL_VEVENT_COMPONENT);
|
||||
c != 0;
|
||||
c = icalcomponent_get_next_component(comp,ICAL_VEVENT_COMPONENT)){
|
||||
|
||||
do_something(c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Ical components only have one internal iterator, so removing the
|
||||
object that the iterator points to can cause problems. Here is the
|
||||
right way to remove components */
|
||||
|
||||
void remove_vevent_sub_components(icalcomponent* comp){
|
||||
|
||||
icalcomponent *c, *next;
|
||||
|
||||
for( c = icalcomponent_get_first_component(comp,ICAL_VEVENT_COMPONENT);
|
||||
c != 0;
|
||||
c = next)
|
||||
{
|
||||
next = icalcomponent_get_next_component(comp,ICAL_VEVENT_COMPONENT);
|
||||
|
||||
icalcomponent_remove_component(comp,c);
|
||||
|
||||
do_something(c);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id: mkinstalldirs,v 1.1 2001-11-15 19:26:24 mikep%oeone.com Exp $
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
|
@ -1,170 +0,0 @@
|
|||
#!/usr/local/bin/perl
|
||||
|
||||
use Getopt::Std;
|
||||
getopts('chspi:');
|
||||
|
||||
|
||||
# ARG 0 is components.txt
|
||||
open(PV,"$ARGV[0]") || die "Can't open components file $ARGV[0]:$!";
|
||||
|
||||
my @components;
|
||||
|
||||
while (<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
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/local/bin/perl
|
||||
#!/usr/bin/env perl
|
||||
|
||||
require "readvaluesfile.pl";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/local/bin/perl
|
||||
#!/usr/bin/env perl
|
||||
|
||||
require "readvaluesfile.pl";
|
||||
|
||||
|
@ -12,6 +12,8 @@ getopts('chspmi:');
|
|||
%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
|
||||
|
||||
|
@ -163,13 +165,9 @@ foreach $prop (sort keys %propmap) {
|
|||
my $set_pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
|
||||
|
||||
if($opt_c) { # Generate C source
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -179,30 +177,57 @@ icalproperty* icalproperty_vanew_${lc}($type v, ...){
|
|||
va_end(args);
|
||||
return (icalproperty*)impl;
|
||||
}
|
||||
EOM
|
||||
}
|
||||
# Allow EXDATEs to take DATE values easily.
|
||||
if ($lc eq "exdate") {
|
||||
print<<EOM;
|
||||
void icalproperty_set_${lc}(icalproperty* prop, $type v){
|
||||
icalvalue *value;
|
||||
$set_pointer_check
|
||||
icalerror_check_arg_rv( (prop!=0),"prop");
|
||||
value = icalvalue_new_${lcvalue}(v);
|
||||
if (v.is_date)
|
||||
value = icalvalue_new_date(v);
|
||||
else
|
||||
value = icalvalue_new_datetime(v);
|
||||
icalproperty_set_value(prop,value);
|
||||
}
|
||||
EOM
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
$type icalproperty_get_${lc}(icalproperty* prop){
|
||||
icalvalue *value;
|
||||
icalerror_check_arg( (prop!=0),"prop");
|
||||
value = icalproperty_get_value(prop);
|
||||
return icalvalue_get_${lcvalue}(value);
|
||||
return icalvalue_get_${lcvalue}(icalproperty_get_value(prop));
|
||||
}
|
||||
EOM
|
||||
|
||||
|
||||
}
|
||||
} elsif ($opt_h) { # Generate C Header file
|
||||
|
||||
|
||||
print "\
|
||||
/* $prop */\
|
||||
icalproperty* icalproperty_new_${lc}($type v);\
|
||||
icalproperty* icalproperty_vanew_${lc}($type v, ...);\
|
||||
void icalproperty_set_${lc}(icalproperty* prop, $type v);\
|
||||
$type icalproperty_get_${lc}(icalproperty* prop);";
|
||||
|
||||
|
||||
if ($include_vanew){
|
||||
print "icalproperty* icalproperty_vanew_${lc}($type v, ...);\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -194,7 +194,9 @@ void icalvalue_set_${lc}(icalvalue* value, $type v) {\
|
|||
}
|
||||
|
||||
|
||||
print "\n impl->data.v_$union_data = $assign \n }\n";
|
||||
print "\n\
|
||||
impl->data.v_$union_data = $assign \n\
|
||||
icalvalue_reset_kind(impl);\n}\n";
|
||||
|
||||
print "$type\ icalvalue_get_${lc}(icalvalue* value)\ {\n\
|
||||
icalerror_check_arg( (value!=0),\"value\");\
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
#!/usr/bin/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
|
|
@ -1,98 +0,0 @@
|
|||
#!/usr/bin/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";
|
|
@ -1,7 +0,0 @@
|
|||
if WITH_PYTHON
|
||||
PYTHON_DIR = python
|
||||
else
|
||||
PYTHON_DIR =
|
||||
endif
|
||||
|
||||
SUBDIRS = libical libicalss libicalvcal $(PYTHON_DIR) test
|
|
@ -2,7 +2,7 @@
|
|||
# FILE: Makefile.am
|
||||
# CREATOR: eric
|
||||
#
|
||||
# $Id: Makefile.am,v 1.1 2001-11-15 19:26:49 mikep%oeone.com Exp $
|
||||
# $Id: Makefile.am,v 1.2 2001-12-21 18:56:11 mikep%oeone.com Exp $
|
||||
#
|
||||
#
|
||||
# (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -18,7 +18,7 @@
|
|||
# The Mozilla Public License Version 1.0. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# The original code is icalcomponent.c
|
||||
#
|
||||
#
|
||||
#======================================================================
|
||||
|
||||
|
@ -28,10 +28,20 @@ ICALSCRIPTS = $(top_srcdir)/scripts
|
|||
|
||||
lib_LTLIBRARIES = libical.la
|
||||
|
||||
noinst_LTLIBRARIES = libical-static.la
|
||||
libical_static_la_SOURCES = $(libical_la_SOURCES)
|
||||
libical_static_la_LDFLAGS = --all-static
|
||||
|
||||
YFLAGS = -d -v -t -pical_yy
|
||||
LFLAGS = -Pical_yy
|
||||
LEX_OUTPUT_ROOT = lex.ical_yy
|
||||
|
||||
CPPFLAGS = -DPACKAGE_DATA_DIR=\""$(datadir)/$(PACKAGE)"\"
|
||||
|
||||
# CFLAGS = -g
|
||||
|
||||
all: ical.h
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/src \
|
||||
|
@ -41,6 +51,9 @@ INCLUDES = \
|
|||
libical_la_LDFLAGS = -version-info 0:0:0
|
||||
|
||||
libical_la_SOURCES = \
|
||||
$(BUILT_SOURCES) \
|
||||
icalarray.c \
|
||||
icalarray.h \
|
||||
icalattendee.h \
|
||||
icalattendee.c \
|
||||
icalcomponent.c \
|
||||
|
@ -57,20 +70,17 @@ libical_la_SOURCES = \
|
|||
icalparameter.c \
|
||||
icalparameter.h \
|
||||
icalparameterimpl.h \
|
||||
icalderivedparameter.c \
|
||||
icalderivedparameter.h \
|
||||
icalparser.c \
|
||||
icalparser.h \
|
||||
icalderivedproperty.c \
|
||||
icalderivedproperty.h \
|
||||
icalproperty.c \
|
||||
icalproperty.h \
|
||||
icalrecur.c \
|
||||
icalrecur.h \
|
||||
icalrestriction.c \
|
||||
icalrestriction.h \
|
||||
icaltime.c \
|
||||
icaltime.h \
|
||||
icaltimezone.c \
|
||||
icaltimezone.h \
|
||||
icalduration.h \
|
||||
icalduration.c \
|
||||
icalperiod.h \
|
||||
|
@ -80,8 +90,6 @@ libical_la_SOURCES = \
|
|||
icalvalue.c \
|
||||
icalvalue.h \
|
||||
icalvalueimpl.h \
|
||||
icalderivedvalue.c \
|
||||
icalderivedvalue.h \
|
||||
icalyacc.h \
|
||||
icalyacc.y \
|
||||
pvl.c \
|
||||
|
@ -99,6 +107,7 @@ libicalinclude_HEADERS = ical.h
|
|||
# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It
|
||||
# is required to make the combined header ical.h properly
|
||||
COMBINEDHEADERS = \
|
||||
$(top_builddir)/config.h \
|
||||
$(top_builddir)/src/libical/icalversion.h \
|
||||
$(top_srcdir)/src/libical/icaltime.h \
|
||||
$(top_srcdir)/src/libical/icalduration.h \
|
||||
|
@ -108,13 +117,15 @@ COMBINEDHEADERS = \
|
|||
$(top_srcdir)/src/libical/icalrecur.h \
|
||||
icalderivedvalue.h \
|
||||
icalderivedparameter.h \
|
||||
icalvalue.h \
|
||||
icalparameter.h \
|
||||
$(top_srcdir)/src/libical/icalvalue.h \
|
||||
$(top_srcdir)/src/libical/icalparameter.h \
|
||||
icalderivedproperty.h \
|
||||
icalproperty.h \
|
||||
$(top_srcdir)/src/libical/icalproperty.h \
|
||||
$(top_srcdir)/src/libical/icalattendee.h \
|
||||
$(top_srcdir)/src/libical/pvl.h \
|
||||
$(top_srcdir)/src/libical/icalarray.h \
|
||||
$(top_srcdir)/src/libical/icalcomponent.h \
|
||||
$(top_srcdir)/src/libical/icaltimezone.h \
|
||||
$(top_srcdir)/src/libical/icalparser.h \
|
||||
$(top_srcdir)/src/libical/icalmemory.h \
|
||||
$(top_srcdir)/src/libical/icalerror.h \
|
||||
|
@ -123,19 +134,22 @@ COMBINEDHEADERS = \
|
|||
$(top_srcdir)/src/libical/icalmime.h \
|
||||
$(top_srcdir)/src/libical/icallangbind.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
ical.h \
|
||||
icalderivedparameter.c \
|
||||
BUILT_COMBINEDHEADERS = \
|
||||
icalderivedparameter.h \
|
||||
icalderivedproperty.c \
|
||||
icalderivedproperty.h \
|
||||
icalrestriction.c \
|
||||
icalderivedvalue.c \
|
||||
icalderivedvalue.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
$(BUILT_COMBINEDHEADERS)\
|
||||
icalderivedparameter.c \
|
||||
icalderivedproperty.c \
|
||||
icalrestriction.c \
|
||||
icalderivedvalue.c
|
||||
|
||||
ical.h: $(COMBINEDHEADERS)
|
||||
cat $(COMBINEDHEADERS) \
|
||||
| egrep -v "#include.*\"ical" \
|
||||
| egrep -v "#include.*\"config" \
|
||||
| egrep -v "#include.*\"pvl\.h\"" > ical.h
|
||||
|
||||
icallexer.c : icalyacc.h
|
||||
|
@ -152,10 +166,9 @@ PARAMETERDEPS = \
|
|||
icalderivedparameter.h: $(PARAMETERDEPS)
|
||||
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h
|
||||
|
||||
icalderivedparameter.c: $(PARAMETERDEPS) icalparameter.h
|
||||
icalderivedparameter.c: $(PARAMETERDEPS) $(BUILT_COMBINEDHEADERS)
|
||||
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.c.in -c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c
|
||||
|
||||
|
||||
# properties
|
||||
|
||||
PROPERTYDEPS = \
|
||||
|
@ -171,7 +184,7 @@ icalderivedproperty.h: $(PROPERTYDEPS)
|
|||
-i $(srcdir)/icalderivedproperty.h.in -h $(DESIGNDATA)/properties.csv\
|
||||
${DESIGNDATA}/value-types.csv > icalderivedproperty.h
|
||||
|
||||
icalderivedproperty.c: $(PROPERTYDEPS) icalproperty.h
|
||||
icalderivedproperty.c: $(PROPERTYDEPS) $(BUILT_COMBINEDHEADERS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
|
||||
-i $(srcdir)/icalderivedproperty.c.in -c $(DESIGNDATA)/properties.csv \
|
||||
${DESIGNDATA}/value-types.csv > icalderivedproperty.c
|
||||
|
@ -199,7 +212,7 @@ icalderivedvalue.h: $(VALUEDEPS)
|
|||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
|
||||
-i $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h
|
||||
|
||||
icalderivedvalue.c: $(VALUEDEPS) icalderivedvalue.h
|
||||
icalderivedvalue.c: $(VALUEDEPS) $(BUILT_COMBINEDHEADERS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
|
||||
-i $(srcdir)/icalderivedvalue.c.in -c $(DESIGNDATA)/value-types.csv > icalderivedvalue.c
|
||||
|
||||
|
@ -208,7 +221,11 @@ icalderivedvalue.c: $(VALUEDEPS) icalderivedvalue.h
|
|||
# housekeeping
|
||||
CONFIG_CLEAN_FILES = y.output
|
||||
|
||||
CLEANFILES += $(BUILT_SOURCES)
|
||||
CLEANFILES += $(BUILT_SOURCES) $(BUILT_COMBINEDHEADERS)
|
||||
|
||||
dist-hook:
|
||||
cd $(distdir); rm -f $(BUILT_SOURCES)
|
||||
cd $(distdir); rm -f ical.h icalversion.h icalyacc.c icalyacc.h icallexer.c
|
||||
|
||||
EXTRA_DIST = \
|
||||
icalderivedparameter.c.in \
|
||||
|
|
|
@ -1,565 +0,0 @@
|
|||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
#======================================================================
|
||||
# FILE: Makefile.am
|
||||
# CREATOR: eric
|
||||
#
|
||||
# $Id: Makefile.in,v 1.1 2001-11-15 19:26:50 mikep%oeone.com Exp $
|
||||
#
|
||||
#
|
||||
# (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of either:
|
||||
#
|
||||
# The LGPL as published by the Free Software Foundation, version
|
||||
# 2.1, available at: http://www.fsf.org/copyleft/lesser.html
|
||||
#
|
||||
# Or:
|
||||
#
|
||||
# The Mozilla Public License Version 1.0. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/MPL/
|
||||
#
|
||||
# The original code is icalcomponent.c
|
||||
#
|
||||
#======================================================================
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
LEX = @LEX@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
PERL = @PERL@
|
||||
PY_CFLAGS = @PY_CFLAGS@
|
||||
PY_EXTRA_LIBS = @PY_EXTRA_LIBS@
|
||||
PY_LIBS = @PY_LIBS@
|
||||
PY_LIB_LOC = @PY_LIB_LOC@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
YACC = @YACC@
|
||||
python_val = @python_val@
|
||||
|
||||
DESIGNDATA = $(top_srcdir)/design-data
|
||||
ICALSCRIPTS = $(top_srcdir)/scripts
|
||||
|
||||
lib_LTLIBRARIES = libical.la
|
||||
|
||||
YFLAGS = -d -v -t -pical_yy
|
||||
LFLAGS = -Pical_yy
|
||||
LEX_OUTPUT_ROOT = lex.ical_yy
|
||||
|
||||
INCLUDES = -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src -I$(srcdir)
|
||||
|
||||
|
||||
libical_la_LDFLAGS = -version-info 0:0:0
|
||||
|
||||
libical_la_SOURCES = icalattendee.h icalattendee.c icalcomponent.c icalcomponent.h icalenums.c icalenums.h icalerror.c icalerror.h icallexer.l icalmemory.c icalmemory.h icalmime.c icalmime.h icalparameter.c icalparameter.h icalparameterimpl.h icalderivedparameter.c icalderivedparameter.h icalparser.c icalparser.h icalderivedproperty.c icalderivedproperty.h icalproperty.c icalproperty.h icalrecur.c icalrecur.h icalrestriction.c icalrestriction.h icaltime.c icaltime.h icalduration.h icalduration.c icalperiod.h icalperiod.c icaltypes.c icaltypes.h icalvalue.c icalvalue.h icalvalueimpl.h icalderivedvalue.c icalderivedvalue.h icalyacc.h icalyacc.y pvl.c pvl.h sspm.c sspm.h vsnprintf.c icallangbind.h icallangbind.c
|
||||
|
||||
|
||||
libicalincludedir = $(includedir)
|
||||
|
||||
libicalinclude_HEADERS = ical.h
|
||||
|
||||
# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It
|
||||
# is required to make the combined header ical.h properly
|
||||
COMBINEDHEADERS = $(top_builddir)/src/libical/icalversion.h $(top_srcdir)/src/libical/icaltime.h $(top_srcdir)/src/libical/icalduration.h $(top_srcdir)/src/libical/icalperiod.h $(top_srcdir)/src/libical/icalenums.h $(top_srcdir)/src/libical/icaltypes.h $(top_srcdir)/src/libical/icalrecur.h icalderivedvalue.h icalderivedparameter.h icalvalue.h icalparameter.h icalderivedproperty.h icalproperty.h $(top_srcdir)/src/libical/icalattendee.h $(top_srcdir)/src/libical/pvl.h $(top_srcdir)/src/libical/icalcomponent.h $(top_srcdir)/src/libical/icalparser.h $(top_srcdir)/src/libical/icalmemory.h $(top_srcdir)/src/libical/icalerror.h $(top_srcdir)/src/libical/icalrestriction.h $(top_srcdir)/src/libical/sspm.h $(top_srcdir)/src/libical/icalmime.h $(top_srcdir)/src/libical/icallangbind.h
|
||||
|
||||
|
||||
BUILT_SOURCES = ical.h icalderivedparameter.c icalderivedparameter.h icalderivedproperty.c icalderivedproperty.h icalrestriction.c icalderivedvalue.c icalderivedvalue.h
|
||||
|
||||
|
||||
# parameters
|
||||
|
||||
PARAMETERDEPS = $(ICALSCRIPTS)/mkderivedparameters.pl $(DESIGNDATA)/parameters.csv icalderivedparameter.c.in icalderivedparameter.h.in
|
||||
|
||||
|
||||
# properties
|
||||
|
||||
PROPERTYDEPS = $(ICALSCRIPTS)/mkderivedproperties.pl $(DESIGNDATA)/properties.csv $(DESIGNDATA)/value-types.csv icalderivedproperty.c.in icalderivedproperty.h.in
|
||||
|
||||
|
||||
# restrictions
|
||||
|
||||
RESTRICTIONDEPS = $(ICALSCRIPTS)/mkrestrictiontable.pl $(DESIGNDATA)/restrictions.csv icalrestriction.c.in
|
||||
|
||||
|
||||
# values
|
||||
|
||||
VALUEDEPS = $(ICALSCRIPTS)/mkderivedvalues.pl $(DESIGNDATA)/value-types.csv icalderivedvalue.c.in icalderivedvalue.h.in
|
||||
|
||||
|
||||
# housekeeping
|
||||
CONFIG_CLEAN_FILES = y.output
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
EXTRA_DIST = icalderivedparameter.c.in icalderivedparameter.h.in icalderivedproperty.c.in icalderivedproperty.h.in icalrestriction.c.in icalderivedvalue.c.in icalderivedvalue.h.in icalversion.h.in icallexer.c icalyacc.c
|
||||
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I../..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
libical_la_LIBADD =
|
||||
libical_la_OBJECTS = icalattendee.lo icalcomponent.lo icalenums.lo \
|
||||
icalerror.lo icallexer.lo icalmemory.lo icalmime.lo icalparameter.lo \
|
||||
icalderivedparameter.lo icalparser.lo icalderivedproperty.lo \
|
||||
icalproperty.lo icalrecur.lo icalrestriction.lo icaltime.lo \
|
||||
icalduration.lo icalperiod.lo icaltypes.lo icalvalue.lo \
|
||||
icalderivedvalue.lo icalyacc.lo pvl.lo sspm.lo vsnprintf.lo \
|
||||
icallangbind.lo
|
||||
LEXLIB = @LEXLIB@
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
HEADERS = $(libicalinclude_HEADERS)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in icallexer.c icalversion.h.in \
|
||||
icalyacc.c
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(libical_la_SOURCES)
|
||||
OBJECTS = $(libical_la_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .l .lo .o .s .y
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/libical/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
icalversion.h: $(top_builddir)/config.status icalversion.h.in
|
||||
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
mostlyclean-libLTLIBRARIES:
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
|
||||
distclean-libLTLIBRARIES:
|
||||
|
||||
maintainer-clean-libLTLIBRARIES:
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.s.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.S.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
|
||||
maintainer-clean-libtool:
|
||||
|
||||
libical.la: $(libical_la_OBJECTS) $(libical_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libical_la_LDFLAGS) $(libical_la_OBJECTS) $(libical_la_LIBADD) $(LIBS)
|
||||
.l.c:
|
||||
$(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@
|
||||
.y.c:
|
||||
$(YACC) $(AM_YFLAGS) $(YFLAGS) $< && mv y.tab.c $*.c
|
||||
if test -f y.tab.h; then \
|
||||
if cmp -s y.tab.h $*.h; then rm -f y.tab.h; else mv y.tab.h $*.h; fi; \
|
||||
else :; fi
|
||||
icalyacc.h: icalyacc.c
|
||||
|
||||
|
||||
install-libicalincludeHEADERS: $(libicalinclude_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libicalincludedir)
|
||||
@list='$(libicalinclude_HEADERS)'; for p in $$list; do \
|
||||
if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
|
||||
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libicalincludedir)/$$p"; \
|
||||
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(libicalincludedir)/$$p; \
|
||||
done
|
||||
|
||||
uninstall-libicalincludeHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(libicalinclude_HEADERS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(libicalincludedir)/$$p; \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = src/libical
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
icalattendee.lo icalattendee.o : icalattendee.c ../../config.h \
|
||||
icalattendee.h icalenums.h icaltime.h icalduration.h \
|
||||
icalperiod.h icalderivedparameter.h icalderivedvalue.h \
|
||||
icaltypes.h icalrecur.h
|
||||
icalcomponent.lo icalcomponent.o : icalcomponent.c ../../config.h \
|
||||
icalcomponent.h icalproperty.h icalderivedparameter.h \
|
||||
icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \
|
||||
icalperiod.h icalrecur.h icalderivedproperty.h icalparameter.h \
|
||||
icalderivedvalue.h icalattendee.h pvl.h icalerror.h \
|
||||
icalmemory.h icalparser.h
|
||||
icalderivedparameter.lo icalderivedparameter.o : icalderivedparameter.c \
|
||||
../../config.h icalparameter.h icalderivedparameter.h \
|
||||
icalparameterimpl.h icalproperty.h icalvalue.h icalenums.h \
|
||||
icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \
|
||||
icalderivedproperty.h icalderivedvalue.h icalerror.h \
|
||||
icalmemory.h
|
||||
icalderivedproperty.lo icalderivedproperty.o : icalderivedproperty.c \
|
||||
../../config.h icalproperty.h icalderivedparameter.h \
|
||||
icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \
|
||||
icalperiod.h icalrecur.h icalderivedproperty.h icalparameter.h \
|
||||
icalderivedvalue.h icalcomponent.h icalattendee.h pvl.h \
|
||||
icalerror.h icalmemory.h icalparser.h
|
||||
icalderivedvalue.lo icalderivedvalue.o : icalderivedvalue.c \
|
||||
../../config.h icalerror.h icalmemory.h icalparser.h \
|
||||
icalenums.h icaltypes.h icaltime.h icalduration.h icalperiod.h \
|
||||
icalcomponent.h icalproperty.h icalderivedparameter.h \
|
||||
icalvalue.h icalrecur.h icalderivedproperty.h icalparameter.h \
|
||||
icalderivedvalue.h icalattendee.h pvl.h icalvalueimpl.h
|
||||
icalduration.lo icalduration.o : icalduration.c ../../config.h \
|
||||
icalduration.h icaltime.h icalerror.h icalmemory.h icalvalue.h \
|
||||
icalenums.h icaltypes.h icalperiod.h icalrecur.h \
|
||||
icalderivedproperty.h icalparameter.h icalderivedparameter.h \
|
||||
icalderivedvalue.h
|
||||
icalenums.lo icalenums.o : icalenums.c ../../config.h icalenums.h
|
||||
icalerror.lo icalerror.o : icalerror.c ../../config.h icalerror.h
|
||||
icallangbind.lo icallangbind.o : icallangbind.c icalcomponent.h \
|
||||
icalproperty.h icalderivedparameter.h icalvalue.h icalenums.h \
|
||||
icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \
|
||||
icalderivedproperty.h icalparameter.h icalderivedvalue.h \
|
||||
icalattendee.h pvl.h icalerror.h ../../config.h icalmemory.h
|
||||
icallexer.lo icallexer.o : icallexer.c icalparser.h icalenums.h \
|
||||
icaltypes.h icaltime.h icalduration.h icalperiod.h \
|
||||
icalcomponent.h icalproperty.h icalderivedparameter.h \
|
||||
icalvalue.h icalrecur.h icalderivedproperty.h icalparameter.h \
|
||||
icalderivedvalue.h icalattendee.h pvl.h icalmemory.h icalyacc.h
|
||||
icalmemory.lo icalmemory.o : icalmemory.c ../../config.h icalmemory.h \
|
||||
icalerror.h
|
||||
icalmime.lo icalmime.o : icalmime.c icalmime.h icalcomponent.h \
|
||||
icalproperty.h icalderivedparameter.h icalvalue.h icalenums.h \
|
||||
icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \
|
||||
icalderivedproperty.h icalparameter.h icalderivedvalue.h \
|
||||
icalattendee.h pvl.h icalparser.h icalerror.h ../../config.h \
|
||||
icalmemory.h sspm.h
|
||||
icalparameter.lo icalparameter.o : icalparameter.c ../../config.h \
|
||||
icalparameter.h icalderivedparameter.h icalproperty.h \
|
||||
icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \
|
||||
icalperiod.h icalrecur.h icalderivedproperty.h \
|
||||
icalderivedvalue.h icalerror.h icalmemory.h icalparameterimpl.h
|
||||
icalparser.lo icalparser.o : icalparser.c ../../config.h icalparser.h \
|
||||
icalenums.h icaltypes.h icaltime.h icalduration.h icalperiod.h \
|
||||
icalcomponent.h icalproperty.h icalderivedparameter.h \
|
||||
icalvalue.h icalrecur.h icalderivedproperty.h icalparameter.h \
|
||||
icalderivedvalue.h icalattendee.h pvl.h icalmemory.h \
|
||||
icalerror.h
|
||||
icalperiod.lo icalperiod.o : icalperiod.c ../../config.h icalperiod.h \
|
||||
icaltime.h icalduration.h icalerror.h icalmemory.h
|
||||
icalproperty.lo icalproperty.o : icalproperty.c ../../config.h \
|
||||
icalproperty.h icalderivedparameter.h icalvalue.h icalenums.h \
|
||||
icaltypes.h icaltime.h icalduration.h icalperiod.h icalrecur.h \
|
||||
icalderivedproperty.h icalparameter.h icalderivedvalue.h \
|
||||
icalcomponent.h icalattendee.h pvl.h icalerror.h icalmemory.h \
|
||||
icalparser.h
|
||||
icalrecur.lo icalrecur.o : icalrecur.c ../../config.h icalrecur.h \
|
||||
icaltime.h icalerror.h icalmemory.h pvl.h
|
||||
icalrestriction.lo icalrestriction.o : icalrestriction.c ../../config.h \
|
||||
icalrestriction.h icalproperty.h icalderivedparameter.h \
|
||||
icalvalue.h icalenums.h icaltypes.h icaltime.h icalduration.h \
|
||||
icalperiod.h icalrecur.h icalderivedproperty.h icalparameter.h \
|
||||
icalderivedvalue.h icalcomponent.h icalattendee.h pvl.h \
|
||||
icalerror.h
|
||||
icaltime.lo icaltime.o : icaltime.c ../../config.h icaltime.h \
|
||||
icalerror.h icalmemory.h icalvalue.h icalenums.h icaltypes.h \
|
||||
icalduration.h icalperiod.h icalrecur.h icalderivedproperty.h \
|
||||
icalparameter.h icalderivedparameter.h icalderivedvalue.h
|
||||
icaltypes.lo icaltypes.o : icaltypes.c ../../config.h icaltypes.h \
|
||||
icalenums.h icaltime.h icalduration.h icalperiod.h icalerror.h \
|
||||
icalmemory.h
|
||||
icalvalue.lo icalvalue.o : icalvalue.c ../../config.h icalerror.h \
|
||||
icalmemory.h icalparser.h icalenums.h icaltypes.h icaltime.h \
|
||||
icalduration.h icalperiod.h icalcomponent.h icalproperty.h \
|
||||
icalderivedparameter.h icalvalue.h icalrecur.h \
|
||||
icalderivedproperty.h icalparameter.h icalderivedvalue.h \
|
||||
icalattendee.h pvl.h icalvalueimpl.h
|
||||
icalyacc.lo icalyacc.o : icalyacc.c icalparser.h icalenums.h icaltypes.h \
|
||||
icaltime.h icalduration.h icalperiod.h icalcomponent.h \
|
||||
icalproperty.h icalderivedparameter.h icalvalue.h icalrecur.h \
|
||||
icalderivedproperty.h icalparameter.h icalderivedvalue.h \
|
||||
icalattendee.h pvl.h
|
||||
pvl.lo pvl.o : pvl.c ../../config.h pvl.h
|
||||
sspm.lo sspm.o : sspm.c sspm.h
|
||||
vsnprintf.lo vsnprintf.o : vsnprintf.c
|
||||
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-libicalincludeHEADERS
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-libLTLIBRARIES uninstall-libicalincludeHEADERS
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(libicalincludedir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "icallexerlicalyacchicalyaccc$(BUILT_SOURCES)" || rm -f icallexerl icalyacch icalyaccc $(BUILT_SOURCES)
|
||||
mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-libtool mostlyclean-tags \
|
||||
mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
|
||||
clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-libLTLIBRARIES distclean-compile \
|
||||
distclean-libtool distclean-tags distclean-generic \
|
||||
clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
|
||||
maintainer-clean-compile maintainer-clean-libtool \
|
||||
maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
|
||||
clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
|
||||
uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
|
||||
distclean-compile clean-compile maintainer-clean-compile \
|
||||
mostlyclean-libtool distclean-libtool clean-libtool \
|
||||
maintainer-clean-libtool uninstall-libicalincludeHEADERS \
|
||||
install-libicalincludeHEADERS tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
|
||||
check-am installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
ical.h: $(COMBINEDHEADERS)
|
||||
cat $(COMBINEDHEADERS) \
|
||||
| egrep -v "#include.*\"ical" \
|
||||
| egrep -v "#include.*\"pvl\.h\"" > ical.h
|
||||
|
||||
icallexer.c : icalyacc.h
|
||||
|
||||
icalderivedparameter.h: $(PARAMETERDEPS)
|
||||
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h
|
||||
|
||||
icalderivedparameter.c: $(PARAMETERDEPS) icalparameter.h
|
||||
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.c.in -c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c
|
||||
|
||||
icalderivedproperty.h: $(PROPERTYDEPS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
|
||||
-i $(srcdir)/icalderivedproperty.h.in -h $(DESIGNDATA)/properties.csv\
|
||||
${DESIGNDATA}/value-types.csv > icalderivedproperty.h
|
||||
|
||||
icalderivedproperty.c: $(PROPERTYDEPS) icalproperty.h
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
|
||||
-i $(srcdir)/icalderivedproperty.c.in -c $(DESIGNDATA)/properties.csv \
|
||||
${DESIGNDATA}/value-types.csv > icalderivedproperty.c
|
||||
|
||||
icalrestriction.c: $(RESTRICTIONDEPS)
|
||||
$(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl -i $(srcdir)/icalrestriction.c.in \
|
||||
$(DESIGNDATA)/restrictions.csv > icalrestriction.c
|
||||
|
||||
icalderivedvalue.h: $(VALUEDEPS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
|
||||
-i $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h
|
||||
|
||||
icalderivedvalue.c: $(VALUEDEPS) icalderivedvalue.h
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
|
||||
-i $(srcdir)/icalderivedvalue.c.in -c $(DESIGNDATA)/value-types.csv > icalderivedvalue.c
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -2,7 +2,7 @@
|
|||
FILE: icalcomponent.c
|
||||
CREATOR: eric 28 April 1999
|
||||
|
||||
$Id: icalcomponent.c,v 1.2 2001-11-22 19:21:47 mikep%oeone.com Exp $
|
||||
$Id: icalcomponent.c,v 1.3 2001-12-21 18:56:13 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -33,19 +33,19 @@
|
|||
#include "icalmemory.h"
|
||||
#include "icalenums.h"
|
||||
#include "icaltime.h"
|
||||
#include "icalarray.h"
|
||||
#include "icaltimezone.h"
|
||||
#include "icalduration.h"
|
||||
#include "icalperiod.h"
|
||||
#include "icalparser.h"
|
||||
#include "icalrestriction.h"
|
||||
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <stdarg.h> /* for va_list, etc */
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h> /* for fprintf */
|
||||
|
||||
#ifndef win32
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include <string.h> /* for strdup */
|
||||
|
||||
#define MAX_TMP 1024
|
||||
|
||||
|
@ -59,6 +59,13 @@ struct icalcomponent_impl
|
|||
pvl_list components;
|
||||
pvl_elem component_iterator;
|
||||
icalcomponent* parent;
|
||||
|
||||
/* An array of icaltimezone structs. We use this so we can do fast
|
||||
lookup of timezones using binary searches. timezones_sorted is
|
||||
set to 0 whenever we add a timezone, so we remember to sort the
|
||||
array before doing a binary search. */
|
||||
icalarray* timezones;
|
||||
int timezones_sorted;
|
||||
};
|
||||
|
||||
/* icalproperty functions that only components get to use */
|
||||
|
@ -69,6 +76,24 @@ void icalcomponent_add_children(struct icalcomponent_impl *impl,va_list args);
|
|||
icalcomponent* icalcomponent_new_impl (icalcomponent_kind kind);
|
||||
int icalcomponent_property_sorter(void *a, void *b);
|
||||
|
||||
static void icalcomponent_merge_vtimezone (icalcomponent *comp,
|
||||
icalcomponent *vtimezone,
|
||||
icalarray *tzids_to_rename);
|
||||
static void icalcomponent_handle_conflicting_vtimezones (icalcomponent *comp,
|
||||
icalcomponent *vtimezone,
|
||||
icalproperty *tzid_prop,
|
||||
const char *tzid,
|
||||
icalarray *tzids_to_rename);
|
||||
static int icalcomponent_get_tzid_prefix_len (const char *tzid);
|
||||
static void icalcomponent_rename_tzids(icalcomponent* comp,
|
||||
icalarray* rename_table);
|
||||
static void icalcomponent_rename_tzids_callback(icalparameter *param,
|
||||
void *data);
|
||||
static int icalcomponent_compare_vtimezones (icalcomponent *vtimezone1,
|
||||
icalcomponent *vtimezone2);
|
||||
static int icalcomponent_compare_timezone_fn (const void *elem1,
|
||||
const void *elem2);
|
||||
|
||||
|
||||
void icalcomponent_add_children(struct icalcomponent_impl *impl,va_list args)
|
||||
{
|
||||
|
@ -112,6 +137,8 @@ icalcomponent_new_impl (icalcomponent_kind kind)
|
|||
comp->component_iterator = 0;
|
||||
comp->x_name = 0;
|
||||
comp->parent = 0;
|
||||
comp->timezones = NULL;
|
||||
comp->timezones_sorted = 1;
|
||||
|
||||
return comp;
|
||||
}
|
||||
|
@ -202,14 +229,17 @@ icalcomponent_free (icalcomponent* component)
|
|||
#endif
|
||||
|
||||
if(component != 0 ){
|
||||
|
||||
while( (prop=pvl_pop(c->properties)) != 0){
|
||||
assert(prop != 0);
|
||||
icalproperty_set_parent(prop,0);
|
||||
icalproperty_free(prop);
|
||||
}
|
||||
|
||||
pvl_free(c->properties);
|
||||
|
||||
if ( c->properties != 0 )
|
||||
{
|
||||
while( (prop=pvl_pop(c->properties)) != 0){
|
||||
assert(prop != 0);
|
||||
icalproperty_set_parent(prop,0);
|
||||
icalproperty_free(prop);
|
||||
}
|
||||
pvl_free(c->properties);
|
||||
}
|
||||
|
||||
|
||||
while( (comp=pvl_data(pvl_head(c->components))) != 0){
|
||||
assert(comp!=0);
|
||||
|
@ -223,6 +253,9 @@ icalcomponent_free (icalcomponent* component)
|
|||
free(c->x_name);
|
||||
}
|
||||
|
||||
if (c->timezones)
|
||||
icaltimezone_array_free (c->timezones);
|
||||
|
||||
c->kind = ICAL_NO_COMPONENT;
|
||||
c->properties = 0;
|
||||
c->property_iterator = 0;
|
||||
|
@ -230,6 +263,7 @@ icalcomponent_free (icalcomponent* component)
|
|||
c->component_iterator = 0;
|
||||
c->x_name = 0;
|
||||
c->id[0] = 'X';
|
||||
c->timezones = NULL;
|
||||
|
||||
free(c);
|
||||
}
|
||||
|
@ -263,7 +297,7 @@ icalcomponent_as_ical_string (icalcomponent* component)
|
|||
icalerror_check_arg_rz( (component!=0), "component");
|
||||
icalerror_check_arg_rz( (kind!=ICAL_NO_COMPONENT), "component kind is ICAL_NO_COMPONENT");
|
||||
|
||||
kind_string = icalenum_component_kind_to_string(kind);
|
||||
kind_string = icalcomponent_kind_to_string(kind);
|
||||
|
||||
icalerror_check_arg_rz( (kind_string!=0),"Unknown kind of component");
|
||||
|
||||
|
@ -300,7 +334,7 @@ icalcomponent_as_ical_string (icalcomponent* component)
|
|||
|
||||
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "END:");
|
||||
icalmemory_append_string(&buf, &buf_ptr, &buf_size,
|
||||
icalenum_component_kind_to_string(kind));
|
||||
icalcomponent_kind_to_string(kind));
|
||||
icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline);
|
||||
|
||||
out_buf = icalmemory_tmp_copy(buf);
|
||||
|
@ -364,8 +398,8 @@ int icalcomponent_property_sorter(void *a, void *b)
|
|||
kinda = icalproperty_isa((icalproperty*)a);
|
||||
kindb = icalproperty_isa((icalproperty*)b);
|
||||
|
||||
ksa = icalenum_property_kind_to_string(kinda);
|
||||
ksb = icalenum_property_kind_to_string(kindb);
|
||||
ksa = icalproperty_kind_to_string(kinda);
|
||||
ksb = icalproperty_kind_to_string(kindb);
|
||||
|
||||
return strcmp(ksa,ksb);
|
||||
}
|
||||
|
@ -530,11 +564,26 @@ icalcomponent_add_component (icalcomponent* parent, icalcomponent* child)
|
|||
impl = (struct icalcomponent_impl*)parent;
|
||||
cimpl = (struct icalcomponent_impl*)child;
|
||||
|
||||
icalerror_assert( (cimpl->parent ==0),"The child component has already been added to a parent component. Remove the component with icalcomponent_remove_component before calling icalcomponent_add_component");
|
||||
if (cimpl->parent !=0) {
|
||||
icalerror_set_errno(ICAL_USAGE_ERROR);
|
||||
}
|
||||
|
||||
cimpl->parent = parent;
|
||||
|
||||
pvl_push(impl->components,child);
|
||||
|
||||
/* If the new component is a VTIMEZONE, add it to our array. */
|
||||
if (cimpl->kind == ICAL_VTIMEZONE_COMPONENT) {
|
||||
/* FIXME: Currently we are also creating this array when loading in
|
||||
a builtin VTIMEZONE, when we don't need it. */
|
||||
if (!impl->timezones)
|
||||
impl->timezones = icaltimezone_array_new ();
|
||||
|
||||
icaltimezone_array_append_from_vtimezone (impl->timezones, child);
|
||||
|
||||
/* Flag that we need to sort it before doing any binary searches. */
|
||||
impl->timezones_sorted = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -550,6 +599,22 @@ icalcomponent_remove_component (icalcomponent* parent, icalcomponent* child)
|
|||
impl = (struct icalcomponent_impl*)parent;
|
||||
cimpl = (struct icalcomponent_impl*)child;
|
||||
|
||||
/* If the component is a VTIMEZONE, remove it from our array as well. */
|
||||
if (cimpl->kind == ICAL_VTIMEZONE_COMPONENT) {
|
||||
icaltimezone *zone;
|
||||
int i, num_elements;
|
||||
|
||||
num_elements = impl->timezones ? impl->timezones->num_elements : 0;
|
||||
for (i = 0; i < num_elements; i++) {
|
||||
zone = icalarray_element_at (impl->timezones, i);
|
||||
if (icaltimezone_get_component (zone) == child) {
|
||||
icaltimezone_free (zone, 0);
|
||||
icalarray_remove_element_at (impl->timezones, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( itr = pvl_head(impl->components);
|
||||
itr != 0;
|
||||
itr = next_itr)
|
||||
|
@ -673,12 +738,19 @@ icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c)
|
|||
|
||||
if(kind == ICAL_VEVENT_COMPONENT ||
|
||||
kind == ICAL_VTODO_COMPONENT ||
|
||||
kind == ICAL_VJOURNAL_COMPONENT ){
|
||||
kind == ICAL_VJOURNAL_COMPONENT ||
|
||||
kind == ICAL_VFREEBUSY_COMPONENT ){
|
||||
return comp;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
#define BEN
|
||||
#endif
|
||||
|
||||
#ifdef BEN
|
||||
|
||||
time_t icalcomponent_convert_time(icalproperty *p)
|
||||
{
|
||||
|
@ -707,12 +779,25 @@ time_t icalcomponent_convert_time(icalproperty *p)
|
|||
icalproperty_as_ical_string(p), ctime(&convt));
|
||||
#endif
|
||||
|
||||
} else if (sict.is_utc == 0 && tzp == 0 ) {
|
||||
} else if (sict.is_utc == 0 && tzp == 0 ) { /* not utc and no zone info */
|
||||
time_t offset;
|
||||
|
||||
/* _as_timet will use localtime() to do the conversion */
|
||||
convt = icaltime_as_timet(sict);
|
||||
offset = icaltime_utc_offset(sict,0);
|
||||
|
||||
/* offset = icaltime_utc_offset(sict,0); */
|
||||
|
||||
/* benjaminlee: this replaces the line above
|
||||
maybe it can be changed to something better? */
|
||||
|
||||
{
|
||||
struct tm *tmp_tm;
|
||||
time_t t;
|
||||
|
||||
t = time(NULL);
|
||||
offset = localtime(&t)->tm_gmtoff;
|
||||
}
|
||||
|
||||
convt += offset;
|
||||
|
||||
#ifdef TEST_CONVERT_TIME
|
||||
|
@ -720,9 +805,17 @@ time_t icalcomponent_convert_time(icalproperty *p)
|
|||
icalproperty_as_ical_string(p), ctime(&convt));
|
||||
#endif
|
||||
} else {
|
||||
/* Convert the time to UTC for the named timezone*/
|
||||
const char* timezone = icalparameter_get_tzid(tzp);
|
||||
convt = icaltime_as_timet(icaltime_as_utc(sict,timezone));
|
||||
/* Convert the local time in the timezone (from tzp) to UTC*/
|
||||
const char* mytimezone = icalparameter_get_tzid(tzp);
|
||||
|
||||
icaltimezone_convert_time (&sict,
|
||||
icaltimezone_get_builtin_timezone(mytimezone),
|
||||
icaltimezone_get_utc_timezone()
|
||||
);
|
||||
|
||||
sict.is_utc = 1;
|
||||
|
||||
convt = icaltime_as_timet(sict);
|
||||
|
||||
#ifdef TEST_CONVERT_TIME
|
||||
printf("convert time: use _as_utc:\n %s\n %s",
|
||||
|
@ -732,6 +825,9 @@ time_t icalcomponent_convert_time(icalproperty *p)
|
|||
|
||||
return convt;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
struct icaltime_span icalcomponent_get_span(icalcomponent* comp)
|
||||
{
|
||||
icalcomponent *inner;
|
||||
|
@ -798,7 +894,10 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp)
|
|||
|
||||
icalerror_clear_errno();
|
||||
|
||||
/* FIXME: Needs updating to new icaltimezone functions. */
|
||||
#ifdef BEN
|
||||
span.start = icalcomponent_convert_time(p);
|
||||
#endif
|
||||
|
||||
#ifdef TEST_CONVERT_TIME
|
||||
printf("convert time:\n %s %s",
|
||||
|
@ -806,9 +905,16 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp)
|
|||
#endif
|
||||
|
||||
if(icalerrno != ICAL_NO_ERROR){
|
||||
|
||||
if ( icalerrno != ICAL_MALFORMEDDATA_ERROR ) {
|
||||
span.start = 0;
|
||||
return span;
|
||||
}
|
||||
#ifndef NO_WARN_ICAL_MALFORMEDDATA_ERROR_HACK
|
||||
fprintf(stderr, "** WARNING ** %s: %d %s\n", __FILE__, __LINE__, icalerror_strerror(icalerrno));
|
||||
fprintf(stderr, "** WARNING ** %s: %d %s\n", __FILE__, __LINE__, "HACK around ICAL_MALFORMEDDATA_ERROR");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* The end time could be specified as either a DTEND or a DURATION */
|
||||
p = icalcomponent_get_first_property(inner, ICAL_DTEND_PROPERTY);
|
||||
|
@ -822,7 +928,10 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp)
|
|||
}
|
||||
|
||||
if (p!=0){
|
||||
/* FIXME: Needs updating to new icaltimezone functions. */
|
||||
#ifdef BEN
|
||||
span.end = icalcomponent_convert_time(p);
|
||||
#endif
|
||||
} else if (start.is_date == 1) {
|
||||
/* Duration is all day */
|
||||
span.end = span.start + 60*60*24;
|
||||
|
@ -842,6 +951,10 @@ struct icaltime_span icalcomponent_get_span(icalcomponent* comp)
|
|||
|
||||
}
|
||||
|
||||
int icalcomponent_check_restrictions(icalcomponent* comp){
|
||||
icalerror_check_arg_rz(comp!=0,"comp");
|
||||
return icalrestriction_check(comp);
|
||||
}
|
||||
|
||||
int icalcomponent_count_errors(icalcomponent* component)
|
||||
{
|
||||
|
@ -958,10 +1071,7 @@ void icalcomponent_convert_errors(icalcomponent* component)
|
|||
|
||||
rst.debug = icalproperty_get_xlicerror(p);
|
||||
icalcomponent_add_property(component,
|
||||
icalproperty_new_requeststatus(
|
||||
icalreqstattype_as_string(rst)
|
||||
)
|
||||
);
|
||||
icalproperty_new_requeststatus(rst));
|
||||
|
||||
icalcomponent_remove_property(component,p);
|
||||
}
|
||||
|
@ -1076,7 +1186,8 @@ icalcomponent_begin_component(icalcomponent* component,icalcomponent_kind kind)
|
|||
|
||||
icalerror_check_arg_re( (component!=0),"component",icalcompiter_null);
|
||||
|
||||
for( i = pvl_head(impl->components); i != 0; i = pvl_next(itr.iter)) {
|
||||
// for( i = pvl_head(impl->components); i != 0; i = pvl_next(itr.iter)) {
|
||||
for( i = pvl_head(impl->components); i != 0; i = pvl_next(i)) {
|
||||
|
||||
icalcomponent *c = (icalcomponent*) pvl_data(i);
|
||||
|
||||
|
@ -1183,14 +1294,49 @@ icalcomponent* icalcomponent_get_inner(icalcomponent* comp)
|
|||
}
|
||||
}
|
||||
|
||||
void icalcomponent_set_method(icalcomponent* comp, icalproperty_method method)
|
||||
{
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(comp, ICAL_METHOD_PROPERTY);
|
||||
|
||||
|
||||
if (prop == 0){
|
||||
prop = icalproperty_new_method(method);
|
||||
icalcomponent_add_property(comp, prop);
|
||||
}
|
||||
|
||||
icalproperty_set_method(prop,method);
|
||||
|
||||
}
|
||||
|
||||
icalproperty_method icalcomponent_get_method(icalcomponent* comp)
|
||||
{
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(comp,ICAL_METHOD_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
return ICAL_METHOD_NONE;
|
||||
}
|
||||
|
||||
return icalproperty_get_method(prop);
|
||||
}
|
||||
|
||||
#define ICALSETUPSET(p_kind) \
|
||||
icalcomponent *inner; \
|
||||
icalproperty *prop; \
|
||||
icalerror_check_arg_rv(comp!=0,"comp");\
|
||||
inner = icalcomponent_get_inner(comp); \
|
||||
if(inner == 0){\
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);\
|
||||
return;\
|
||||
}\
|
||||
prop = icalcomponent_get_first_property(inner, p_kind);
|
||||
|
||||
|
||||
|
||||
void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v)
|
||||
{
|
||||
|
||||
icalcomponent *inner = icalcomponent_get_inner(comp);
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(inner, ICAL_DTSTART_PROPERTY);
|
||||
|
||||
ICALSETUPSET(ICAL_DTSTART_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
prop = icalproperty_new_dtstart(v);
|
||||
|
@ -1352,40 +1498,10 @@ struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp)
|
|||
}
|
||||
}
|
||||
|
||||
void icalcomponent_set_method(icalcomponent* comp, icalproperty_method method)
|
||||
{
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(comp, ICAL_METHOD_PROPERTY);
|
||||
|
||||
|
||||
if (prop == 0){
|
||||
prop = icalproperty_new_method(method);
|
||||
icalcomponent_add_property(comp, prop);
|
||||
}
|
||||
|
||||
icalproperty_set_method(prop,method);
|
||||
|
||||
}
|
||||
|
||||
icalproperty_method icalcomponent_get_method(icalcomponent* comp)
|
||||
{
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(comp,ICAL_METHOD_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
return ICAL_METHOD_NONE;
|
||||
}
|
||||
|
||||
return icalproperty_get_method(prop);
|
||||
}
|
||||
|
||||
void icalcomponent_set_dtstamp(icalcomponent* comp, struct icaltimetype v)
|
||||
{
|
||||
|
||||
icalcomponent *inner = icalcomponent_get_inner(comp);
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(inner, ICAL_DTSTAMP_PROPERTY);
|
||||
|
||||
ICALSETUPSET(ICAL_DTSTAMP_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
prop = icalproperty_new_dtstamp(v);
|
||||
|
@ -1413,10 +1529,8 @@ struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp)
|
|||
|
||||
void icalcomponent_set_summary(icalcomponent* comp, const char* v)
|
||||
{
|
||||
icalcomponent *inner = icalcomponent_get_inner(comp);
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(inner, ICAL_SUMMARY_PROPERTY);
|
||||
|
||||
ICALSETUPSET(ICAL_SUMMARY_PROPERTY)
|
||||
|
||||
if (prop == 0){
|
||||
prop = icalproperty_new_summary(v);
|
||||
icalcomponent_add_property(inner, prop);
|
||||
|
@ -1428,9 +1542,18 @@ void icalcomponent_set_summary(icalcomponent* comp, const char* v)
|
|||
|
||||
const char* icalcomponent_get_summary(icalcomponent* comp)
|
||||
{
|
||||
icalcomponent *inner = icalcomponent_get_inner(comp);
|
||||
icalproperty *prop
|
||||
= icalcomponent_get_first_property(inner,ICAL_SUMMARY_PROPERTY);
|
||||
icalcomponent *inner;
|
||||
icalproperty *prop;
|
||||
icalerror_check_arg_rz(comp!=0,"comp");
|
||||
|
||||
inner = icalcomponent_get_inner(comp);
|
||||
|
||||
if(inner == 0){
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
prop= icalcomponent_get_first_property(inner,ICAL_SUMMARY_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
return 0;
|
||||
|
@ -1440,11 +1563,72 @@ const char* icalcomponent_get_summary(icalcomponent* comp)
|
|||
|
||||
}
|
||||
|
||||
void icalcomponent_set_comment(icalcomponent* comp, const char* v);
|
||||
const char* icalcomponent_get_comment(icalcomponent* comp);
|
||||
void icalcomponent_set_comment(icalcomponent* comp, const char* v)
|
||||
{
|
||||
ICALSETUPSET(ICAL_COMMENT_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
prop = icalproperty_new_comment(v);
|
||||
icalcomponent_add_property(inner, prop);
|
||||
}
|
||||
|
||||
icalproperty_set_summary(prop,v);
|
||||
|
||||
}
|
||||
const char* icalcomponent_get_comment(icalcomponent* comp){
|
||||
icalcomponent *inner;
|
||||
icalproperty *prop;
|
||||
icalerror_check_arg_rz(comp!=0,"comp");
|
||||
|
||||
inner = icalcomponent_get_inner(comp);
|
||||
|
||||
if(inner == 0){
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
prop= icalcomponent_get_first_property(inner,ICAL_COMMENT_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
return icalproperty_get_comment(prop);
|
||||
}
|
||||
|
||||
void icalcomponent_set_uid(icalcomponent* comp, const char* v)
|
||||
{
|
||||
ICALSETUPSET(ICAL_UID_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
prop = icalproperty_new_comment(v);
|
||||
icalcomponent_add_property(inner, prop);
|
||||
}
|
||||
|
||||
icalproperty_set_summary(prop,v);
|
||||
|
||||
}
|
||||
const char* icalcomponent_get_uid(icalcomponent* comp){
|
||||
icalcomponent *inner;
|
||||
icalproperty *prop;
|
||||
icalerror_check_arg_rz(comp!=0,"comp");
|
||||
|
||||
inner = icalcomponent_get_inner(comp);
|
||||
|
||||
if(inner == 0){
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
prop= icalcomponent_get_first_property(inner,ICAL_UID_PROPERTY);
|
||||
|
||||
if (prop == 0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
return icalproperty_get_uid(prop);
|
||||
}
|
||||
|
||||
void icalcomponent_set_uid(icalcomponent* comp, const char* v);
|
||||
const char* icalcomponent_get_uid(icalcomponent* comp);
|
||||
|
||||
void icalcomponent_set_recurrenceid(icalcomponent* comp,
|
||||
struct icaltimetype v);
|
||||
|
@ -1489,3 +1673,415 @@ icalcomponent* icalcomponent_new_xdaylight()
|
|||
{
|
||||
return icalcomponent_new(ICAL_XDAYLIGHT_COMPONENT);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Timezone stuff.
|
||||
*/
|
||||
|
||||
/* This takes 2 VCALENDAR components and merges the second one into the first,
|
||||
resolving any problems with conflicting TZIDs. comp_to_merge will no
|
||||
longer exist after calling this function. */
|
||||
void icalcomponent_merge_component(icalcomponent* comp,
|
||||
icalcomponent* comp_to_merge)
|
||||
{
|
||||
icalcomponent *subcomp, *next_subcomp;
|
||||
icalarray *tzids_to_rename;
|
||||
int i;
|
||||
|
||||
/* Check that both components are VCALENDAR components. */
|
||||
assert (icalcomponent_isa(comp) == ICAL_VCALENDAR_COMPONENT);
|
||||
assert (icalcomponent_isa(comp_to_merge) == ICAL_VCALENDAR_COMPONENT);
|
||||
|
||||
/* Step through each subcomponent of comp_to_merge, looking for VTIMEZONEs.
|
||||
For each VTIMEZONE found, check if we need to add it to comp and if we
|
||||
need to rename it and all TZID references to it. */
|
||||
tzids_to_rename = icalarray_new (sizeof (char*), 16);
|
||||
subcomp = icalcomponent_get_first_component (comp_to_merge,
|
||||
ICAL_VTIMEZONE_COMPONENT);
|
||||
while (subcomp) {
|
||||
next_subcomp = icalcomponent_get_next_component (comp_to_merge,
|
||||
ICAL_VTIMEZONE_COMPONENT);
|
||||
/* This will add the VTIMEZONE to comp, if necessary, and also update
|
||||
the array of TZIDs we need to rename. */
|
||||
icalcomponent_merge_vtimezone (comp, subcomp, tzids_to_rename);
|
||||
/* FIXME: Handle possible NEWFAILED error. */
|
||||
|
||||
subcomp = next_subcomp;
|
||||
}
|
||||
|
||||
/* If we need to do any renaming of TZIDs, do it now. */
|
||||
if (tzids_to_rename->num_elements != 0) {
|
||||
icalcomponent_rename_tzids (comp_to_merge, tzids_to_rename);
|
||||
|
||||
/* Now free the tzids_to_rename array. */
|
||||
for (i = 0; i < tzids_to_rename->num_elements; i++) {
|
||||
free (icalarray_element_at (tzids_to_rename, i));
|
||||
}
|
||||
icalarray_free (tzids_to_rename);
|
||||
}
|
||||
|
||||
/* Now move all the components from comp_to_merge to comp, excluding
|
||||
VTIMEZONE components. */
|
||||
subcomp = icalcomponent_get_first_component (comp_to_merge,
|
||||
ICAL_ANY_COMPONENT);
|
||||
while (subcomp) {
|
||||
next_subcomp = icalcomponent_get_next_component (comp_to_merge,
|
||||
ICAL_ANY_COMPONENT);
|
||||
if (icalcomponent_isa(subcomp) != ICAL_VTIMEZONE_COMPONENT) {
|
||||
icalcomponent_remove_component (comp_to_merge, subcomp);
|
||||
icalcomponent_add_component (comp, subcomp);
|
||||
}
|
||||
subcomp = next_subcomp;
|
||||
}
|
||||
|
||||
/* Free comp_to_merge. We have moved most of the subcomponents over to
|
||||
comp now. */
|
||||
icalcomponent_free (comp_to_merge);
|
||||
}
|
||||
|
||||
|
||||
static void icalcomponent_merge_vtimezone (icalcomponent *comp,
|
||||
icalcomponent *vtimezone,
|
||||
icalarray *tzids_to_rename)
|
||||
{
|
||||
icalproperty *tzid_prop;
|
||||
const char *tzid;
|
||||
char *tzid_copy;
|
||||
icaltimezone *existing_vtimezone;
|
||||
|
||||
/* Get the TZID of the VTIMEZONE. */
|
||||
tzid_prop = icalcomponent_get_first_property (vtimezone, ICAL_TZID_PROPERTY);
|
||||
if (!tzid_prop)
|
||||
return;
|
||||
|
||||
tzid = icalproperty_get_tzid (tzid_prop);
|
||||
if (!tzid)
|
||||
return;
|
||||
|
||||
/* See if there is already a VTIMEZONE in comp with the same TZID. */
|
||||
existing_vtimezone = icalcomponent_get_timezone (comp, tzid);
|
||||
|
||||
/* If there is no existing VTIMEZONE with the same TZID, we can just move
|
||||
the VTIMEZONE to comp and return. */
|
||||
if (!existing_vtimezone) {
|
||||
icalcomponent_remove_component (icalcomponent_get_parent (vtimezone),
|
||||
vtimezone);
|
||||
icalcomponent_add_component (comp, vtimezone);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If the TZID has a '/' prefix, then we don't have to worry about the
|
||||
clashing TZIDs, as they are supposed to be exactly the same VTIMEZONE. */
|
||||
if (tzid[0] == '/')
|
||||
return;
|
||||
|
||||
/* Now we have two VTIMEZONEs with the same TZID (which isn't a globally
|
||||
unique one), so we compare the VTIMEZONE components to see if they are
|
||||
the same. If they are, we don't need to do anything. We make a copy of
|
||||
the tzid, since the parameter may get modified in these calls. */
|
||||
tzid_copy = strdup (tzid);
|
||||
if (!tzid_copy) {
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!icalcomponent_compare_vtimezones (existing_vtimezone, vtimezone)) {
|
||||
/* FIXME: Handle possible NEWFAILED error. */
|
||||
|
||||
/* Now we have two different VTIMEZONEs with the same TZID. */
|
||||
icalcomponent_handle_conflicting_vtimezones (comp, vtimezone, tzid_prop,
|
||||
tzid_copy, tzids_to_rename);
|
||||
}
|
||||
free (tzid_copy);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
icalcomponent_handle_conflicting_vtimezones (icalcomponent *comp,
|
||||
icalcomponent *vtimezone,
|
||||
icalproperty *tzid_prop,
|
||||
const char *tzid,
|
||||
icalarray *tzids_to_rename)
|
||||
{
|
||||
struct icalcomponent_impl *impl = (struct icalcomponent_impl*)comp;
|
||||
int tzid_len, i, suffix, max_suffix = 0, num_elements;
|
||||
char *tzid_copy, *new_tzid, suffix_buf[32];
|
||||
|
||||
/* Find the length of the TZID without any trailing digits. */
|
||||
tzid_len = icalcomponent_get_tzid_prefix_len (tzid);
|
||||
|
||||
/* Step through each of the VTIMEZONEs in comp. We may already have the
|
||||
clashing VTIMEZONE in the calendar, but it may have been renamed
|
||||
(i.e. a unique number added on the end of the TZID, e.g. 'London2').
|
||||
So we compare the new VTIMEZONE with any VTIMEZONEs that have the
|
||||
same prefix (e.g. 'London'). If it matches any of those, we have to
|
||||
rename the TZIDs to that TZID, else we rename to a new TZID, using
|
||||
the biggest numeric suffix found + 1. */
|
||||
num_elements = impl->timezones ? impl->timezones->num_elements : 0;
|
||||
for (i = 0; i < num_elements; i++) {
|
||||
icaltimezone *zone;
|
||||
char *existing_tzid, *existing_tzid_copy;
|
||||
int existing_tzid_len;
|
||||
|
||||
zone = icalarray_element_at (impl->timezones, i);
|
||||
existing_tzid = icaltimezone_get_tzid (zone);
|
||||
|
||||
/* Find the length of the TZID without any trailing digits. */
|
||||
existing_tzid_len = icalcomponent_get_tzid_prefix_len (existing_tzid);
|
||||
|
||||
/* Check if we have the same prefix. */
|
||||
if (tzid_len == existing_tzid_len
|
||||
&& !strncmp (tzid, existing_tzid, tzid_len)) {
|
||||
/* Compare the VTIMEZONEs. */
|
||||
if (icalcomponent_compare_vtimezones (icaltimezone_get_component (zone),
|
||||
vtimezone)) {
|
||||
/* The VTIMEZONEs match, so we can use the existing VTIMEZONE. But
|
||||
we have to rename TZIDs to this TZID. */
|
||||
tzid_copy = strdup (tzid);
|
||||
existing_tzid_copy = strdup (existing_tzid);
|
||||
if (!tzid_copy || !existing_tzid_copy) {
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
} else {
|
||||
icalarray_append (tzids_to_rename, tzid_copy);
|
||||
icalarray_append (tzids_to_rename, existing_tzid_copy);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
/* FIXME: Handle possible NEWFAILED error. */
|
||||
|
||||
/* Convert the suffix to an integer and remember the maximum numeric
|
||||
suffix found. */
|
||||
suffix = atoi (existing_tzid + existing_tzid_len);
|
||||
if (max_suffix < suffix)
|
||||
max_suffix = suffix;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* We didn't find a VTIMEZONE that matched, so we have to rename the TZID,
|
||||
using the maximum numerical suffix found + 1. */
|
||||
tzid_copy = strdup (tzid);
|
||||
sprintf (suffix_buf, "%i", max_suffix + 1);
|
||||
new_tzid = malloc (tzid_len + strlen (suffix_buf) + 1);
|
||||
if (!new_tzid || !tzid_copy) {
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
strncpy (new_tzid, tzid, tzid_len);
|
||||
strcpy (new_tzid + tzid_len, suffix_buf);
|
||||
icalarray_append (tzids_to_rename, tzid_copy);
|
||||
icalarray_append (tzids_to_rename, new_tzid);
|
||||
}
|
||||
|
||||
|
||||
/* Returns the length of the TZID, without any trailing digits. */
|
||||
static int icalcomponent_get_tzid_prefix_len (const char *tzid)
|
||||
{
|
||||
int len;
|
||||
const char *p;
|
||||
|
||||
len = strlen (tzid);
|
||||
p = tzid + len - 1;
|
||||
while (len > 0 && *p >= '0' && *p <= '9') {
|
||||
p--;
|
||||
len--;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
/* Renames all references to the given TZIDs to a new name. rename_table
|
||||
contains pairs of strings - a current TZID, and the new TZID to rename it
|
||||
to. */
|
||||
static void icalcomponent_rename_tzids(icalcomponent* comp,
|
||||
icalarray* rename_table)
|
||||
{
|
||||
icalcomponent_foreach_tzid (comp, icalcomponent_rename_tzids_callback,
|
||||
rename_table);
|
||||
}
|
||||
|
||||
|
||||
static void icalcomponent_rename_tzids_callback(icalparameter *param, void *data)
|
||||
{
|
||||
icalarray *rename_table = data;
|
||||
const char *tzid;
|
||||
int i;
|
||||
|
||||
tzid = icalparameter_get_tzid (param);
|
||||
if (!tzid)
|
||||
return;
|
||||
|
||||
/* Step through the rename table to see if the current TZID matches
|
||||
any of the ones we want to rename. */
|
||||
for (i = 0; i < rename_table->num_elements - 1; i += 2) {
|
||||
if (!strcmp (tzid, icalarray_element_at (rename_table, i))) {
|
||||
icalparameter_set_tzid (param, icalarray_element_at (rename_table, i + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Calls the given function for each TZID parameter found in the component. */
|
||||
void icalcomponent_foreach_tzid(icalcomponent* comp,
|
||||
void (*callback)(icalparameter *param, void *data),
|
||||
void *callback_data)
|
||||
{
|
||||
icalproperty *prop;
|
||||
icalproperty_kind kind;
|
||||
icalparameter *param;
|
||||
icalcomponent *subcomp;
|
||||
|
||||
/* First look for any TZID parameters used in this component itself. */
|
||||
prop = icalcomponent_get_first_property (comp, ICAL_ANY_PROPERTY);
|
||||
while (prop) {
|
||||
kind = icalproperty_isa (prop);
|
||||
|
||||
/* These are the only properties that can have a TZID. Note that
|
||||
COMPLETED, CREATED, DTSTAMP & LASTMODIFIED must be in UTC. */
|
||||
if (kind == ICAL_DTSTART_PROPERTY || kind == ICAL_DTEND_PROPERTY
|
||||
|| kind == ICAL_DUE_PROPERTY || kind == ICAL_EXDATE_PROPERTY
|
||||
|| kind == ICAL_RDATE_PROPERTY) {
|
||||
param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
|
||||
if (param)
|
||||
(*callback) (param, callback_data);
|
||||
}
|
||||
|
||||
prop = icalcomponent_get_next_property (comp, ICAL_ANY_PROPERTY);
|
||||
}
|
||||
|
||||
/* Now recursively check child components. */
|
||||
subcomp = icalcomponent_get_first_component (comp, ICAL_ANY_COMPONENT);
|
||||
while (subcomp) {
|
||||
icalcomponent_foreach_tzid (subcomp, callback, callback_data);
|
||||
subcomp = icalcomponent_get_next_component (comp, ICAL_ANY_COMPONENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Returns the icaltimezone from the component corresponding to the given
|
||||
TZID, or NULL if the component does not have a corresponding VTIMEZONE. */
|
||||
icaltimezone* icalcomponent_get_timezone(icalcomponent* comp, const char *tzid)
|
||||
{
|
||||
struct icalcomponent_impl *impl;
|
||||
icaltimezone *zone;
|
||||
int lower, upper, middle, cmp;
|
||||
char *zone_tzid;
|
||||
|
||||
impl = (struct icalcomponent_impl*)comp;
|
||||
|
||||
if (!impl->timezones)
|
||||
return NULL;
|
||||
|
||||
/* Sort the array if necessary (by the TZID string). */
|
||||
if (!impl->timezones_sorted) {
|
||||
icalarray_sort (impl->timezones, icalcomponent_compare_timezone_fn);
|
||||
impl->timezones_sorted = 1;
|
||||
}
|
||||
|
||||
/* Do a simple binary search. */
|
||||
lower = middle = 0;
|
||||
upper = impl->timezones->num_elements;
|
||||
|
||||
while (lower < upper) {
|
||||
middle = (lower + upper) >> 1;
|
||||
zone = icalarray_element_at (impl->timezones, middle);
|
||||
zone_tzid = icaltimezone_get_tzid (zone);
|
||||
cmp = strcmp (tzid, zone_tzid);
|
||||
if (cmp == 0)
|
||||
return zone;
|
||||
else if (cmp < 0)
|
||||
upper = middle;
|
||||
else
|
||||
lower = middle + 1;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/* A function to compare 2 icaltimezone elements, used for qsort(). */
|
||||
static int icalcomponent_compare_timezone_fn (const void *elem1,
|
||||
const void *elem2)
|
||||
{
|
||||
icaltimezone *zone1, *zone2;
|
||||
const char *zone1_tzid, *zone2_tzid;
|
||||
int retval;
|
||||
|
||||
zone1 = (icaltimezone*) elem1;
|
||||
zone2 = (icaltimezone*) elem2;
|
||||
|
||||
zone1_tzid = icaltimezone_get_tzid (zone1);
|
||||
zone2_tzid = icaltimezone_get_tzid (zone2);
|
||||
|
||||
return strcmp (zone1_tzid, zone2_tzid);
|
||||
}
|
||||
|
||||
|
||||
/* Compares 2 VTIMEZONE components to see if they match, ignoring their TZIDs.
|
||||
It returns 1 if they match, 0 if they don't, or -1 on error. */
|
||||
static int icalcomponent_compare_vtimezones (icalcomponent *vtimezone1,
|
||||
icalcomponent *vtimezone2)
|
||||
{
|
||||
icalproperty *prop1, *prop2;
|
||||
const char *tzid1, *tzid2;
|
||||
char *tzid2_copy, *string1, *string2;
|
||||
int cmp;
|
||||
|
||||
/* Get the TZID property of the first VTIMEZONE. */
|
||||
prop1 = icalcomponent_get_first_property (vtimezone1, ICAL_TZID_PROPERTY);
|
||||
if (!prop1)
|
||||
return -1;
|
||||
|
||||
tzid1 = icalproperty_get_tzid (prop1);
|
||||
if (!tzid1)
|
||||
return -1;
|
||||
|
||||
/* Get the TZID property of the second VTIMEZONE. */
|
||||
prop2 = icalcomponent_get_first_property (vtimezone2, ICAL_TZID_PROPERTY);
|
||||
if (!prop2)
|
||||
return -1;
|
||||
|
||||
tzid2 = icalproperty_get_tzid (prop2);
|
||||
if (!tzid2)
|
||||
return -1;
|
||||
|
||||
/* Copy the second TZID, and set the property to the same as the first
|
||||
TZID, since we don't care if these match of not. */
|
||||
tzid2_copy = strdup (tzid2);
|
||||
if (!tzid2_copy) {
|
||||
icalerror_set_errno (ICAL_NEWFAILED_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
icalproperty_set_tzid (prop2, tzid1);
|
||||
|
||||
/* Now convert both VTIMEZONEs to strings and compare them. */
|
||||
string1 = icalcomponent_as_ical_string (vtimezone1);
|
||||
if (!string1) {
|
||||
free (tzid2_copy);
|
||||
return -1;
|
||||
}
|
||||
|
||||
string2 = icalcomponent_as_ical_string (vtimezone2);
|
||||
if (!string2) {
|
||||
free (string1);
|
||||
free (tzid2_copy);
|
||||
return -1;
|
||||
}
|
||||
|
||||
cmp = strcmp (string1, string2);
|
||||
|
||||
free (string1);
|
||||
free (string2);
|
||||
|
||||
/* Now reset the second TZID. */
|
||||
icalproperty_set_tzid (prop2, tzid2_copy);
|
||||
free (tzid2_copy);
|
||||
|
||||
return (cmp == 0) ? 1 : 0;
|
||||
}
|
||||
|
|
|
@ -32,6 +32,14 @@
|
|||
|
||||
typedef void icalcomponent;
|
||||
|
||||
/* An opaque struct representing a timezone. We declare this here to avoid
|
||||
a circular dependancy. */
|
||||
#ifndef ICALTIMEONE_DEFINED
|
||||
#define ICALTIMEONE_DEFINED
|
||||
typedef struct _icaltimezone icaltimezone;
|
||||
#endif
|
||||
|
||||
|
||||
/* This is exposed so that callers will not have to allocate and
|
||||
deallocate iterators. Pretend that you can't see it. */
|
||||
typedef struct icalcompiter
|
||||
|
@ -97,6 +105,13 @@ void icalcomponent_remove_component(icalcomponent* parent,
|
|||
int icalcomponent_count_components(icalcomponent* component,
|
||||
icalcomponent_kind kind);
|
||||
|
||||
/* This takes 2 VCALENDAR components and merges the second one into the first,
|
||||
resolving any problems with conflicting TZIDs. comp_to_merge will no
|
||||
longer exist after calling this function. */
|
||||
void icalcomponent_merge_component(icalcomponent* comp,
|
||||
icalcomponent* comp_to_merge);
|
||||
|
||||
|
||||
/* Iteration Routines. There are two forms of iterators, internal and
|
||||
external. The internal ones came first, and are almost completely
|
||||
sufficient, but they fail badly when you want to construct a loop that
|
||||
|
@ -121,10 +136,14 @@ icalcomponent* icalcompiter_prior(icalcompiter* i);
|
|||
icalcomponent* icalcompiter_deref(icalcompiter* i);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Working with embedded error properties */
|
||||
|
||||
|
||||
/* Check the component against itip rules and insert error properties*/
|
||||
/* Working with embedded error properties */
|
||||
int icalcomponent_check_restrictions(icalcomponent* comp);
|
||||
|
||||
/*Count embedded errors*/
|
||||
int icalcomponent_count_errors(icalcomponent* component);
|
||||
|
||||
/* Remove all X-LIC-ERROR properties*/
|
||||
|
@ -217,7 +236,16 @@ int icalcomponent_remove_attendee(icalcomponent *comp, char* cuid);
|
|||
struct icalattendeetype icalcomponent_get_attendee(icalcomponent *comp,
|
||||
int index);
|
||||
|
||||
/* Calls the given function for each TZID parameter found in the component,
|
||||
and any subcomponents. */
|
||||
void icalcomponent_foreach_tzid(icalcomponent* comp,
|
||||
void (*callback)(icalparameter *param, void *data),
|
||||
void *callback_data);
|
||||
|
||||
/* Returns the icaltimezone in the component corresponding to the TZID, or NULL
|
||||
if it can't be found. */
|
||||
icaltimezone* icalcomponent_get_timezone(icalcomponent* comp,
|
||||
const char *tzid);
|
||||
|
||||
|
||||
/*************** Type Specific routines ***************/
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,308 +0,0 @@
|
|||
/* -*- Mode: C -*- */
|
||||
/*======================================================================
|
||||
FILE: icalparam.h
|
||||
CREATOR: eric 20 March 1999
|
||||
|
||||
|
||||
$Id: icalderivedparameter.h,v 1.1 2001-11-15 19:26:53 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of either:
|
||||
|
||||
The LGPL as published by the Free Software Foundation, version
|
||||
2.1, available at: http://www.fsf.org/copyleft/lesser.html
|
||||
|
||||
Or:
|
||||
|
||||
The Mozilla Public License Version 1.0. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/MPL/
|
||||
|
||||
The original code is icalparam.h
|
||||
|
||||
======================================================================*/
|
||||
|
||||
#ifndef ICALDERIVEDPARAMETER_H
|
||||
#define ICALDERIVEDPARAMETER_H
|
||||
|
||||
|
||||
typedef void icalparameter;
|
||||
|
||||
const char* icalparameter_enum_to_string(int e);
|
||||
int icalparameter_string_to_enum(const char* str);
|
||||
|
||||
/* Everything below this line is machine generated. Do not edit. */
|
||||
typedef enum icalparameter_kind {
|
||||
ICAL_ANY_PARAMETER = 0,
|
||||
ICAL_ALTREP_PARAMETER,
|
||||
ICAL_CN_PARAMETER,
|
||||
ICAL_CUTYPE_PARAMETER,
|
||||
ICAL_DELEGATEDFROM_PARAMETER,
|
||||
ICAL_DELEGATEDTO_PARAMETER,
|
||||
ICAL_DIR_PARAMETER,
|
||||
ICAL_ENCODING_PARAMETER,
|
||||
ICAL_FBTYPE_PARAMETER,
|
||||
ICAL_FMTTYPE_PARAMETER,
|
||||
ICAL_LANGUAGE_PARAMETER,
|
||||
ICAL_MEMBER_PARAMETER,
|
||||
ICAL_PARTSTAT_PARAMETER,
|
||||
ICAL_RANGE_PARAMETER,
|
||||
ICAL_RELATED_PARAMETER,
|
||||
ICAL_RELTYPE_PARAMETER,
|
||||
ICAL_ROLE_PARAMETER,
|
||||
ICAL_RSVP_PARAMETER,
|
||||
ICAL_SENTBY_PARAMETER,
|
||||
ICAL_TZID_PARAMETER,
|
||||
ICAL_VALUE_PARAMETER,
|
||||
ICAL_X_PARAMETER,
|
||||
ICAL_XLICCOMPARETYPE_PARAMETER,
|
||||
ICAL_XLICERRORTYPE_PARAMETER,
|
||||
ICAL_NO_PARAMETER
|
||||
} icalparameter_kind;
|
||||
|
||||
#define ICALPARAMETER_FIRST_ENUM 20000
|
||||
|
||||
typedef enum icalparameter_cutype {
|
||||
ICAL_CUTYPE_X = 20000,
|
||||
ICAL_CUTYPE_INDIVIDUAL = 20001,
|
||||
ICAL_CUTYPE_GROUP = 20002,
|
||||
ICAL_CUTYPE_RESOURCE = 20003,
|
||||
ICAL_CUTYPE_ROOM = 20004,
|
||||
ICAL_CUTYPE_UNKNOWN = 20005,
|
||||
ICAL_CUTYPE_NONE = 20006
|
||||
} icalparameter_cutype;
|
||||
|
||||
typedef enum icalparameter_encoding {
|
||||
ICAL_ENCODING_X = 20007,
|
||||
ICAL_ENCODING_8BIT = 20008,
|
||||
ICAL_ENCODING_BASE64 = 20009,
|
||||
ICAL_ENCODING_NONE = 20010
|
||||
} icalparameter_encoding;
|
||||
|
||||
typedef enum icalparameter_fbtype {
|
||||
ICAL_FBTYPE_X = 20011,
|
||||
ICAL_FBTYPE_FREE = 20012,
|
||||
ICAL_FBTYPE_BUSY = 20013,
|
||||
ICAL_FBTYPE_BUSYUNAVAILABLE = 20014,
|
||||
ICAL_FBTYPE_BUSYTENTATIVE = 20015,
|
||||
ICAL_FBTYPE_NONE = 20016
|
||||
} icalparameter_fbtype;
|
||||
|
||||
typedef enum icalparameter_partstat {
|
||||
ICAL_PARTSTAT_X = 20017,
|
||||
ICAL_PARTSTAT_NEEDSACTION = 20018,
|
||||
ICAL_PARTSTAT_ACCEPTED = 20019,
|
||||
ICAL_PARTSTAT_DECLINED = 20020,
|
||||
ICAL_PARTSTAT_TENTATIVE = 20021,
|
||||
ICAL_PARTSTAT_DELEGATED = 20022,
|
||||
ICAL_PARTSTAT_COMPLETED = 20023,
|
||||
ICAL_PARTSTAT_INPROCESS = 20024,
|
||||
ICAL_PARTSTAT_NONE = 20025
|
||||
} icalparameter_partstat;
|
||||
|
||||
typedef enum icalparameter_range {
|
||||
ICAL_RANGE_X = 20026,
|
||||
ICAL_RANGE_THISANDPRIOR = 20027,
|
||||
ICAL_RANGE_THISANDFUTURE = 20028,
|
||||
ICAL_RANGE_NONE = 20029
|
||||
} icalparameter_range;
|
||||
|
||||
typedef enum icalparameter_related {
|
||||
ICAL_RELATED_X = 20030,
|
||||
ICAL_RELATED_START = 20031,
|
||||
ICAL_RELATED_END = 20032,
|
||||
ICAL_RELATED_NONE = 20033
|
||||
} icalparameter_related;
|
||||
|
||||
typedef enum icalparameter_reltype {
|
||||
ICAL_RELTYPE_X = 20034,
|
||||
ICAL_RELTYPE_PARENT = 20035,
|
||||
ICAL_RELTYPE_CHILD = 20036,
|
||||
ICAL_RELTYPE_SIBLING = 20037,
|
||||
ICAL_RELTYPE_NONE = 20038
|
||||
} icalparameter_reltype;
|
||||
|
||||
typedef enum icalparameter_role {
|
||||
ICAL_ROLE_X = 20039,
|
||||
ICAL_ROLE_CHAIR = 20040,
|
||||
ICAL_ROLE_REQPARTICIPANT = 20041,
|
||||
ICAL_ROLE_OPTPARTICIPANT = 20042,
|
||||
ICAL_ROLE_NONPARTICIPANT = 20043,
|
||||
ICAL_ROLE_NONE = 20044
|
||||
} icalparameter_role;
|
||||
|
||||
typedef enum icalparameter_rsvp {
|
||||
ICAL_RSVP_X = 20045,
|
||||
ICAL_RSVP_TRUE = 20046,
|
||||
ICAL_RSVP_FALSE = 20047,
|
||||
ICAL_RSVP_NONE = 20048
|
||||
} icalparameter_rsvp;
|
||||
|
||||
typedef enum icalparameter_value {
|
||||
ICAL_VALUE_X = 20049,
|
||||
ICAL_VALUE_BINARY = 20050,
|
||||
ICAL_VALUE_BOOLEAN = 20051,
|
||||
ICAL_VALUE_DATE = 20052,
|
||||
ICAL_VALUE_DURATION = 20053,
|
||||
ICAL_VALUE_FLOAT = 20054,
|
||||
ICAL_VALUE_INTEGER = 20055,
|
||||
ICAL_VALUE_PERIOD = 20056,
|
||||
ICAL_VALUE_RECUR = 20057,
|
||||
ICAL_VALUE_TEXT = 20058,
|
||||
ICAL_VALUE_TIME = 20059,
|
||||
ICAL_VALUE_URI = 20060,
|
||||
ICAL_VALUE_ERROR = 20061,
|
||||
ICAL_VALUE_DATETIME = 20062,
|
||||
ICAL_VALUE_UTCOFFSET = 20063,
|
||||
ICAL_VALUE_CALADDRESS = 20064,
|
||||
ICAL_VALUE_NONE = 20065
|
||||
} icalparameter_value;
|
||||
|
||||
typedef enum icalparameter_xliccomparetype {
|
||||
ICAL_XLICCOMPARETYPE_X = 20066,
|
||||
ICAL_XLICCOMPARETYPE_EQUAL = 20067,
|
||||
ICAL_XLICCOMPARETYPE_NOTEQUAL = 20068,
|
||||
ICAL_XLICCOMPARETYPE_LESS = 20069,
|
||||
ICAL_XLICCOMPARETYPE_GREATER = 20070,
|
||||
ICAL_XLICCOMPARETYPE_LESSEQUAL = 20071,
|
||||
ICAL_XLICCOMPARETYPE_GREATEREQUAL = 20072,
|
||||
ICAL_XLICCOMPARETYPE_REGEX = 20073,
|
||||
ICAL_XLICCOMPARETYPE_NONE = 20074
|
||||
} icalparameter_xliccomparetype;
|
||||
|
||||
typedef enum icalparameter_xlicerrortype {
|
||||
ICAL_XLICERRORTYPE_X = 20075,
|
||||
ICAL_XLICERRORTYPE_COMPONENTPARSEERROR = 20076,
|
||||
ICAL_XLICERRORTYPE_PROPERTYPARSEERROR = 20077,
|
||||
ICAL_XLICERRORTYPE_PARAMETERNAMEPARSEERROR = 20078,
|
||||
ICAL_XLICERRORTYPE_PARAMETERVALUEPARSEERROR = 20079,
|
||||
ICAL_XLICERRORTYPE_VALUEPARSEERROR = 20080,
|
||||
ICAL_XLICERRORTYPE_INVALIDITIP = 20081,
|
||||
ICAL_XLICERRORTYPE_UNKNOWNVCALPROPERROR = 20082,
|
||||
ICAL_XLICERRORTYPE_MIMEPARSEERROR = 20083,
|
||||
ICAL_XLICERRORTYPE_NONE = 20084
|
||||
} icalparameter_xlicerrortype;
|
||||
|
||||
#define ICALPARAMETER_LAST_ENUM 20085
|
||||
|
||||
/* DELEGATED-FROM */
|
||||
icalparameter* icalparameter_new_delegatedfrom(const char* v);
|
||||
const char* icalparameter_get_delegatedfrom(icalparameter* value);
|
||||
void icalparameter_set_delegatedfrom(icalparameter* value, const char* v);
|
||||
|
||||
/* RELATED */
|
||||
icalparameter* icalparameter_new_related(icalparameter_related v);
|
||||
icalparameter_related icalparameter_get_related(icalparameter* value);
|
||||
void icalparameter_set_related(icalparameter* value, icalparameter_related v);
|
||||
|
||||
/* SENT-BY */
|
||||
icalparameter* icalparameter_new_sentby(const char* v);
|
||||
const char* icalparameter_get_sentby(icalparameter* value);
|
||||
void icalparameter_set_sentby(icalparameter* value, const char* v);
|
||||
|
||||
/* LANGUAGE */
|
||||
icalparameter* icalparameter_new_language(const char* v);
|
||||
const char* icalparameter_get_language(icalparameter* value);
|
||||
void icalparameter_set_language(icalparameter* value, const char* v);
|
||||
|
||||
/* RELTYPE */
|
||||
icalparameter* icalparameter_new_reltype(icalparameter_reltype v);
|
||||
icalparameter_reltype icalparameter_get_reltype(icalparameter* value);
|
||||
void icalparameter_set_reltype(icalparameter* value, icalparameter_reltype v);
|
||||
|
||||
/* ENCODING */
|
||||
icalparameter* icalparameter_new_encoding(icalparameter_encoding v);
|
||||
icalparameter_encoding icalparameter_get_encoding(icalparameter* value);
|
||||
void icalparameter_set_encoding(icalparameter* value, icalparameter_encoding v);
|
||||
|
||||
/* ALTREP */
|
||||
icalparameter* icalparameter_new_altrep(const char* v);
|
||||
const char* icalparameter_get_altrep(icalparameter* value);
|
||||
void icalparameter_set_altrep(icalparameter* value, const char* v);
|
||||
|
||||
/* FMTTYPE */
|
||||
icalparameter* icalparameter_new_fmttype(const char* v);
|
||||
const char* icalparameter_get_fmttype(icalparameter* value);
|
||||
void icalparameter_set_fmttype(icalparameter* value, const char* v);
|
||||
|
||||
/* FBTYPE */
|
||||
icalparameter* icalparameter_new_fbtype(icalparameter_fbtype v);
|
||||
icalparameter_fbtype icalparameter_get_fbtype(icalparameter* value);
|
||||
void icalparameter_set_fbtype(icalparameter* value, icalparameter_fbtype v);
|
||||
|
||||
/* RSVP */
|
||||
icalparameter* icalparameter_new_rsvp(icalparameter_rsvp v);
|
||||
icalparameter_rsvp icalparameter_get_rsvp(icalparameter* value);
|
||||
void icalparameter_set_rsvp(icalparameter* value, icalparameter_rsvp v);
|
||||
|
||||
/* RANGE */
|
||||
icalparameter* icalparameter_new_range(icalparameter_range v);
|
||||
icalparameter_range icalparameter_get_range(icalparameter* value);
|
||||
void icalparameter_set_range(icalparameter* value, icalparameter_range v);
|
||||
|
||||
/* DELEGATED-TO */
|
||||
icalparameter* icalparameter_new_delegatedto(const char* v);
|
||||
const char* icalparameter_get_delegatedto(icalparameter* value);
|
||||
void icalparameter_set_delegatedto(icalparameter* value, const char* v);
|
||||
|
||||
/* CN */
|
||||
icalparameter* icalparameter_new_cn(const char* v);
|
||||
const char* icalparameter_get_cn(icalparameter* value);
|
||||
void icalparameter_set_cn(icalparameter* value, const char* v);
|
||||
|
||||
/* ROLE */
|
||||
icalparameter* icalparameter_new_role(icalparameter_role v);
|
||||
icalparameter_role icalparameter_get_role(icalparameter* value);
|
||||
void icalparameter_set_role(icalparameter* value, icalparameter_role v);
|
||||
|
||||
/* X-LIC-COMPARETYPE */
|
||||
icalparameter* icalparameter_new_xliccomparetype(icalparameter_xliccomparetype v);
|
||||
icalparameter_xliccomparetype icalparameter_get_xliccomparetype(icalparameter* value);
|
||||
void icalparameter_set_xliccomparetype(icalparameter* value, icalparameter_xliccomparetype v);
|
||||
|
||||
/* PARTSTAT */
|
||||
icalparameter* icalparameter_new_partstat(icalparameter_partstat v);
|
||||
icalparameter_partstat icalparameter_get_partstat(icalparameter* value);
|
||||
void icalparameter_set_partstat(icalparameter* value, icalparameter_partstat v);
|
||||
|
||||
/* X-LIC-ERRORTYPE */
|
||||
icalparameter* icalparameter_new_xlicerrortype(icalparameter_xlicerrortype v);
|
||||
icalparameter_xlicerrortype icalparameter_get_xlicerrortype(icalparameter* value);
|
||||
void icalparameter_set_xlicerrortype(icalparameter* value, icalparameter_xlicerrortype v);
|
||||
|
||||
/* MEMBER */
|
||||
icalparameter* icalparameter_new_member(const char* v);
|
||||
const char* icalparameter_get_member(icalparameter* value);
|
||||
void icalparameter_set_member(icalparameter* value, const char* v);
|
||||
|
||||
/* X */
|
||||
icalparameter* icalparameter_new_x(const char* v);
|
||||
const char* icalparameter_get_x(icalparameter* value);
|
||||
void icalparameter_set_x(icalparameter* value, const char* v);
|
||||
|
||||
/* CUTYPE */
|
||||
icalparameter* icalparameter_new_cutype(icalparameter_cutype v);
|
||||
icalparameter_cutype icalparameter_get_cutype(icalparameter* value);
|
||||
void icalparameter_set_cutype(icalparameter* value, icalparameter_cutype v);
|
||||
|
||||
/* TZID */
|
||||
icalparameter* icalparameter_new_tzid(const char* v);
|
||||
const char* icalparameter_get_tzid(icalparameter* value);
|
||||
void icalparameter_set_tzid(icalparameter* value, const char* v);
|
||||
|
||||
/* VALUE */
|
||||
icalparameter* icalparameter_new_value(icalparameter_value v);
|
||||
icalparameter_value icalparameter_get_value(icalparameter* value);
|
||||
void icalparameter_set_value(icalparameter* value, icalparameter_value v);
|
||||
|
||||
/* DIR */
|
||||
icalparameter* icalparameter_new_dir(const char* v);
|
||||
const char* icalparameter_get_dir(icalparameter* value);
|
||||
void icalparameter_set_dir(icalparameter* value, const char* v);
|
||||
|
||||
#endif /*ICALPARAMETER_H*/
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,403 +0,0 @@
|
|||
/* -*- Mode: C -*-
|
||||
======================================================================
|
||||
FILE: icalderivedproperties.{c,h}
|
||||
CREATOR: eric 09 May 1999
|
||||
|
||||
$Id: icalderivedproperty.h,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
======================================================================*/
|
||||
|
||||
|
||||
#ifndef ICALDERIVEDPROPERTY_H
|
||||
#define ICALDERIVEDPROPERTY_H
|
||||
|
||||
#include <time.h>
|
||||
#include "icalparameter.h"
|
||||
#include "icalderivedvalue.h"
|
||||
#include "icalrecur.h"
|
||||
|
||||
typedef void icalproperty;
|
||||
|
||||
|
||||
/* Everything below this line is machine generated. Do not edit. */
|
||||
typedef enum icalproperty_kind {
|
||||
ICAL_ANY_PROPERTY = 0,
|
||||
ICAL_ACTION_PROPERTY,
|
||||
ICAL_ATTACH_PROPERTY,
|
||||
ICAL_ATTENDEE_PROPERTY,
|
||||
ICAL_CALSCALE_PROPERTY,
|
||||
ICAL_CATEGORIES_PROPERTY,
|
||||
ICAL_CLASS_PROPERTY,
|
||||
ICAL_COMMENT_PROPERTY,
|
||||
ICAL_COMPLETED_PROPERTY,
|
||||
ICAL_CONTACT_PROPERTY,
|
||||
ICAL_CREATED_PROPERTY,
|
||||
ICAL_DESCRIPTION_PROPERTY,
|
||||
ICAL_DTEND_PROPERTY,
|
||||
ICAL_DTSTAMP_PROPERTY,
|
||||
ICAL_DTSTART_PROPERTY,
|
||||
ICAL_DUE_PROPERTY,
|
||||
ICAL_DURATION_PROPERTY,
|
||||
ICAL_EXDATE_PROPERTY,
|
||||
ICAL_EXRULE_PROPERTY,
|
||||
ICAL_FREEBUSY_PROPERTY,
|
||||
ICAL_GEO_PROPERTY,
|
||||
ICAL_LASTMODIFIED_PROPERTY,
|
||||
ICAL_LOCATION_PROPERTY,
|
||||
ICAL_MAXRESULTS_PROPERTY,
|
||||
ICAL_MAXRESULTSSIZE_PROPERTY,
|
||||
ICAL_METHOD_PROPERTY,
|
||||
ICAL_ORGANIZER_PROPERTY,
|
||||
ICAL_PERCENTCOMPLETE_PROPERTY,
|
||||
ICAL_PRIORITY_PROPERTY,
|
||||
ICAL_PRODID_PROPERTY,
|
||||
ICAL_QUERY_PROPERTY,
|
||||
ICAL_QUERYNAME_PROPERTY,
|
||||
ICAL_RDATE_PROPERTY,
|
||||
ICAL_RECURRENCEID_PROPERTY,
|
||||
ICAL_RELATEDTO_PROPERTY,
|
||||
ICAL_REPEAT_PROPERTY,
|
||||
ICAL_REQUESTSTATUS_PROPERTY,
|
||||
ICAL_RESOURCES_PROPERTY,
|
||||
ICAL_RRULE_PROPERTY,
|
||||
ICAL_SCOPE_PROPERTY,
|
||||
ICAL_SEQUENCE_PROPERTY,
|
||||
ICAL_STATUS_PROPERTY,
|
||||
ICAL_SUMMARY_PROPERTY,
|
||||
ICAL_TARGET_PROPERTY,
|
||||
ICAL_TRANSP_PROPERTY,
|
||||
ICAL_TRIGGER_PROPERTY,
|
||||
ICAL_TZID_PROPERTY,
|
||||
ICAL_TZNAME_PROPERTY,
|
||||
ICAL_TZOFFSETFROM_PROPERTY,
|
||||
ICAL_TZOFFSETTO_PROPERTY,
|
||||
ICAL_TZURL_PROPERTY,
|
||||
ICAL_UID_PROPERTY,
|
||||
ICAL_URL_PROPERTY,
|
||||
ICAL_VERSION_PROPERTY,
|
||||
ICAL_X_PROPERTY,
|
||||
ICAL_XLICCLUSTERCOUNT_PROPERTY,
|
||||
ICAL_XLICERROR_PROPERTY,
|
||||
ICAL_XLICMIMECHARSET_PROPERTY,
|
||||
ICAL_XLICMIMECID_PROPERTY,
|
||||
ICAL_XLICMIMECONTENTTYPE_PROPERTY,
|
||||
ICAL_XLICMIMEENCODING_PROPERTY,
|
||||
ICAL_XLICMIMEFILENAME_PROPERTY,
|
||||
ICAL_XLICMIMEOPTINFO_PROPERTY,
|
||||
ICAL_NO_PROPERTY
|
||||
} icalproperty_kind;
|
||||
|
||||
|
||||
/* ACTION */
|
||||
icalproperty* icalproperty_new_action(enum icalproperty_action v);
|
||||
icalproperty* icalproperty_vanew_action(enum icalproperty_action v, ...);
|
||||
void icalproperty_set_action(icalproperty* prop, enum icalproperty_action v);
|
||||
enum icalproperty_action icalproperty_get_action(icalproperty* prop);
|
||||
/* ATTACH */
|
||||
icalproperty* icalproperty_new_attach(struct icalattachtype v);
|
||||
icalproperty* icalproperty_vanew_attach(struct icalattachtype v, ...);
|
||||
void icalproperty_set_attach(icalproperty* prop, struct icalattachtype v);
|
||||
struct icalattachtype icalproperty_get_attach(icalproperty* prop);
|
||||
/* ATTENDEE */
|
||||
icalproperty* icalproperty_new_attendee(const char* v);
|
||||
icalproperty* icalproperty_vanew_attendee(const char* v, ...);
|
||||
void icalproperty_set_attendee(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_attendee(icalproperty* prop);
|
||||
/* CALSCALE */
|
||||
icalproperty* icalproperty_new_calscale(const char* v);
|
||||
icalproperty* icalproperty_vanew_calscale(const char* v, ...);
|
||||
void icalproperty_set_calscale(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_calscale(icalproperty* prop);
|
||||
/* CATEGORIES */
|
||||
icalproperty* icalproperty_new_categories(const char* v);
|
||||
icalproperty* icalproperty_vanew_categories(const char* v, ...);
|
||||
void icalproperty_set_categories(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_categories(icalproperty* prop);
|
||||
/* CLASS */
|
||||
icalproperty* icalproperty_new_class(const char* v);
|
||||
icalproperty* icalproperty_vanew_class(const char* v, ...);
|
||||
void icalproperty_set_class(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_class(icalproperty* prop);
|
||||
/* COMMENT */
|
||||
icalproperty* icalproperty_new_comment(const char* v);
|
||||
icalproperty* icalproperty_vanew_comment(const char* v, ...);
|
||||
void icalproperty_set_comment(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_comment(icalproperty* prop);
|
||||
/* COMPLETED */
|
||||
icalproperty* icalproperty_new_completed(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_completed(struct icaltimetype v, ...);
|
||||
void icalproperty_set_completed(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_completed(icalproperty* prop);
|
||||
/* CONTACT */
|
||||
icalproperty* icalproperty_new_contact(const char* v);
|
||||
icalproperty* icalproperty_vanew_contact(const char* v, ...);
|
||||
void icalproperty_set_contact(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_contact(icalproperty* prop);
|
||||
/* CREATED */
|
||||
icalproperty* icalproperty_new_created(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_created(struct icaltimetype v, ...);
|
||||
void icalproperty_set_created(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_created(icalproperty* prop);
|
||||
/* DESCRIPTION */
|
||||
icalproperty* icalproperty_new_description(const char* v);
|
||||
icalproperty* icalproperty_vanew_description(const char* v, ...);
|
||||
void icalproperty_set_description(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_description(icalproperty* prop);
|
||||
/* DTEND */
|
||||
icalproperty* icalproperty_new_dtend(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_dtend(struct icaltimetype v, ...);
|
||||
void icalproperty_set_dtend(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_dtend(icalproperty* prop);
|
||||
/* DTSTAMP */
|
||||
icalproperty* icalproperty_new_dtstamp(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_dtstamp(struct icaltimetype v, ...);
|
||||
void icalproperty_set_dtstamp(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_dtstamp(icalproperty* prop);
|
||||
/* DTSTART */
|
||||
icalproperty* icalproperty_new_dtstart(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_dtstart(struct icaltimetype v, ...);
|
||||
void icalproperty_set_dtstart(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_dtstart(icalproperty* prop);
|
||||
/* DUE */
|
||||
icalproperty* icalproperty_new_due(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_due(struct icaltimetype v, ...);
|
||||
void icalproperty_set_due(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_due(icalproperty* prop);
|
||||
/* DURATION */
|
||||
icalproperty* icalproperty_new_duration(struct icaldurationtype v);
|
||||
icalproperty* icalproperty_vanew_duration(struct icaldurationtype v, ...);
|
||||
void icalproperty_set_duration(icalproperty* prop, struct icaldurationtype v);
|
||||
struct icaldurationtype icalproperty_get_duration(icalproperty* prop);
|
||||
/* EXDATE */
|
||||
icalproperty* icalproperty_new_exdate(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_exdate(struct icaltimetype v, ...);
|
||||
void icalproperty_set_exdate(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_exdate(icalproperty* prop);
|
||||
/* EXRULE */
|
||||
icalproperty* icalproperty_new_exrule(struct icalrecurrencetype v);
|
||||
icalproperty* icalproperty_vanew_exrule(struct icalrecurrencetype v, ...);
|
||||
void icalproperty_set_exrule(icalproperty* prop, struct icalrecurrencetype v);
|
||||
struct icalrecurrencetype icalproperty_get_exrule(icalproperty* prop);
|
||||
/* FREEBUSY */
|
||||
icalproperty* icalproperty_new_freebusy(struct icalperiodtype v);
|
||||
icalproperty* icalproperty_vanew_freebusy(struct icalperiodtype v, ...);
|
||||
void icalproperty_set_freebusy(icalproperty* prop, struct icalperiodtype v);
|
||||
struct icalperiodtype icalproperty_get_freebusy(icalproperty* prop);
|
||||
/* GEO */
|
||||
icalproperty* icalproperty_new_geo(struct icalgeotype v);
|
||||
icalproperty* icalproperty_vanew_geo(struct icalgeotype v, ...);
|
||||
void icalproperty_set_geo(icalproperty* prop, struct icalgeotype v);
|
||||
struct icalgeotype icalproperty_get_geo(icalproperty* prop);
|
||||
/* LAST-MODIFIED */
|
||||
icalproperty* icalproperty_new_lastmodified(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_lastmodified(struct icaltimetype v, ...);
|
||||
void icalproperty_set_lastmodified(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_lastmodified(icalproperty* prop);
|
||||
/* LOCATION */
|
||||
icalproperty* icalproperty_new_location(const char* v);
|
||||
icalproperty* icalproperty_vanew_location(const char* v, ...);
|
||||
void icalproperty_set_location(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_location(icalproperty* prop);
|
||||
/* MAXRESULTS */
|
||||
icalproperty* icalproperty_new_maxresults(int v);
|
||||
icalproperty* icalproperty_vanew_maxresults(int v, ...);
|
||||
void icalproperty_set_maxresults(icalproperty* prop, int v);
|
||||
int icalproperty_get_maxresults(icalproperty* prop);
|
||||
/* MAXRESULTSSIZE */
|
||||
icalproperty* icalproperty_new_maxresultssize(int v);
|
||||
icalproperty* icalproperty_vanew_maxresultssize(int v, ...);
|
||||
void icalproperty_set_maxresultssize(icalproperty* prop, int v);
|
||||
int icalproperty_get_maxresultssize(icalproperty* prop);
|
||||
/* METHOD */
|
||||
icalproperty* icalproperty_new_method(enum icalproperty_method v);
|
||||
icalproperty* icalproperty_vanew_method(enum icalproperty_method v, ...);
|
||||
void icalproperty_set_method(icalproperty* prop, enum icalproperty_method v);
|
||||
enum icalproperty_method icalproperty_get_method(icalproperty* prop);
|
||||
/* ORGANIZER */
|
||||
icalproperty* icalproperty_new_organizer(const char* v);
|
||||
icalproperty* icalproperty_vanew_organizer(const char* v, ...);
|
||||
void icalproperty_set_organizer(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_organizer(icalproperty* prop);
|
||||
/* PERCENT-COMPLETE */
|
||||
icalproperty* icalproperty_new_percentcomplete(int v);
|
||||
icalproperty* icalproperty_vanew_percentcomplete(int v, ...);
|
||||
void icalproperty_set_percentcomplete(icalproperty* prop, int v);
|
||||
int icalproperty_get_percentcomplete(icalproperty* prop);
|
||||
/* PRIORITY */
|
||||
icalproperty* icalproperty_new_priority(int v);
|
||||
icalproperty* icalproperty_vanew_priority(int v, ...);
|
||||
void icalproperty_set_priority(icalproperty* prop, int v);
|
||||
int icalproperty_get_priority(icalproperty* prop);
|
||||
/* PRODID */
|
||||
icalproperty* icalproperty_new_prodid(const char* v);
|
||||
icalproperty* icalproperty_vanew_prodid(const char* v, ...);
|
||||
void icalproperty_set_prodid(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_prodid(icalproperty* prop);
|
||||
/* QUERY */
|
||||
icalproperty* icalproperty_new_query(const char* v);
|
||||
icalproperty* icalproperty_vanew_query(const char* v, ...);
|
||||
void icalproperty_set_query(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_query(icalproperty* prop);
|
||||
/* QUERYNAME */
|
||||
icalproperty* icalproperty_new_queryname(const char* v);
|
||||
icalproperty* icalproperty_vanew_queryname(const char* v, ...);
|
||||
void icalproperty_set_queryname(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_queryname(icalproperty* prop);
|
||||
/* RDATE */
|
||||
icalproperty* icalproperty_new_rdate(struct icaldatetimeperiodtype v);
|
||||
icalproperty* icalproperty_vanew_rdate(struct icaldatetimeperiodtype v, ...);
|
||||
void icalproperty_set_rdate(icalproperty* prop, struct icaldatetimeperiodtype v);
|
||||
struct icaldatetimeperiodtype icalproperty_get_rdate(icalproperty* prop);
|
||||
/* RECURRENCE-ID */
|
||||
icalproperty* icalproperty_new_recurrenceid(struct icaltimetype v);
|
||||
icalproperty* icalproperty_vanew_recurrenceid(struct icaltimetype v, ...);
|
||||
void icalproperty_set_recurrenceid(icalproperty* prop, struct icaltimetype v);
|
||||
struct icaltimetype icalproperty_get_recurrenceid(icalproperty* prop);
|
||||
/* RELATED-TO */
|
||||
icalproperty* icalproperty_new_relatedto(const char* v);
|
||||
icalproperty* icalproperty_vanew_relatedto(const char* v, ...);
|
||||
void icalproperty_set_relatedto(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_relatedto(icalproperty* prop);
|
||||
/* REPEAT */
|
||||
icalproperty* icalproperty_new_repeat(int v);
|
||||
icalproperty* icalproperty_vanew_repeat(int v, ...);
|
||||
void icalproperty_set_repeat(icalproperty* prop, int v);
|
||||
int icalproperty_get_repeat(icalproperty* prop);
|
||||
/* REQUEST-STATUS */
|
||||
icalproperty* icalproperty_new_requeststatus(const char* v);
|
||||
icalproperty* icalproperty_vanew_requeststatus(const char* v, ...);
|
||||
void icalproperty_set_requeststatus(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_requeststatus(icalproperty* prop);
|
||||
/* RESOURCES */
|
||||
icalproperty* icalproperty_new_resources(const char* v);
|
||||
icalproperty* icalproperty_vanew_resources(const char* v, ...);
|
||||
void icalproperty_set_resources(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_resources(icalproperty* prop);
|
||||
/* RRULE */
|
||||
icalproperty* icalproperty_new_rrule(struct icalrecurrencetype v);
|
||||
icalproperty* icalproperty_vanew_rrule(struct icalrecurrencetype v, ...);
|
||||
void icalproperty_set_rrule(icalproperty* prop, struct icalrecurrencetype v);
|
||||
struct icalrecurrencetype icalproperty_get_rrule(icalproperty* prop);
|
||||
/* SCOPE */
|
||||
icalproperty* icalproperty_new_scope(const char* v);
|
||||
icalproperty* icalproperty_vanew_scope(const char* v, ...);
|
||||
void icalproperty_set_scope(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_scope(icalproperty* prop);
|
||||
/* SEQUENCE */
|
||||
icalproperty* icalproperty_new_sequence(int v);
|
||||
icalproperty* icalproperty_vanew_sequence(int v, ...);
|
||||
void icalproperty_set_sequence(icalproperty* prop, int v);
|
||||
int icalproperty_get_sequence(icalproperty* prop);
|
||||
/* STATUS */
|
||||
icalproperty* icalproperty_new_status(enum icalproperty_status v);
|
||||
icalproperty* icalproperty_vanew_status(enum icalproperty_status v, ...);
|
||||
void icalproperty_set_status(icalproperty* prop, enum icalproperty_status v);
|
||||
enum icalproperty_status icalproperty_get_status(icalproperty* prop);
|
||||
/* SUMMARY */
|
||||
icalproperty* icalproperty_new_summary(const char* v);
|
||||
icalproperty* icalproperty_vanew_summary(const char* v, ...);
|
||||
void icalproperty_set_summary(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_summary(icalproperty* prop);
|
||||
/* TARGET */
|
||||
icalproperty* icalproperty_new_target(const char* v);
|
||||
icalproperty* icalproperty_vanew_target(const char* v, ...);
|
||||
void icalproperty_set_target(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_target(icalproperty* prop);
|
||||
/* TRANSP */
|
||||
icalproperty* icalproperty_new_transp(const char* v);
|
||||
icalproperty* icalproperty_vanew_transp(const char* v, ...);
|
||||
void icalproperty_set_transp(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_transp(icalproperty* prop);
|
||||
/* TRIGGER */
|
||||
icalproperty* icalproperty_new_trigger(struct icaltriggertype v);
|
||||
icalproperty* icalproperty_vanew_trigger(struct icaltriggertype v, ...);
|
||||
void icalproperty_set_trigger(icalproperty* prop, struct icaltriggertype v);
|
||||
struct icaltriggertype icalproperty_get_trigger(icalproperty* prop);
|
||||
/* TZID */
|
||||
icalproperty* icalproperty_new_tzid(const char* v);
|
||||
icalproperty* icalproperty_vanew_tzid(const char* v, ...);
|
||||
void icalproperty_set_tzid(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_tzid(icalproperty* prop);
|
||||
/* TZNAME */
|
||||
icalproperty* icalproperty_new_tzname(const char* v);
|
||||
icalproperty* icalproperty_vanew_tzname(const char* v, ...);
|
||||
void icalproperty_set_tzname(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_tzname(icalproperty* prop);
|
||||
/* TZOFFSETFROM */
|
||||
icalproperty* icalproperty_new_tzoffsetfrom(int v);
|
||||
icalproperty* icalproperty_vanew_tzoffsetfrom(int v, ...);
|
||||
void icalproperty_set_tzoffsetfrom(icalproperty* prop, int v);
|
||||
int icalproperty_get_tzoffsetfrom(icalproperty* prop);
|
||||
/* TZOFFSETTO */
|
||||
icalproperty* icalproperty_new_tzoffsetto(int v);
|
||||
icalproperty* icalproperty_vanew_tzoffsetto(int v, ...);
|
||||
void icalproperty_set_tzoffsetto(icalproperty* prop, int v);
|
||||
int icalproperty_get_tzoffsetto(icalproperty* prop);
|
||||
/* TZURL */
|
||||
icalproperty* icalproperty_new_tzurl(const char* v);
|
||||
icalproperty* icalproperty_vanew_tzurl(const char* v, ...);
|
||||
void icalproperty_set_tzurl(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_tzurl(icalproperty* prop);
|
||||
/* UID */
|
||||
icalproperty* icalproperty_new_uid(const char* v);
|
||||
icalproperty* icalproperty_vanew_uid(const char* v, ...);
|
||||
void icalproperty_set_uid(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_uid(icalproperty* prop);
|
||||
/* URL */
|
||||
icalproperty* icalproperty_new_url(const char* v);
|
||||
icalproperty* icalproperty_vanew_url(const char* v, ...);
|
||||
void icalproperty_set_url(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_url(icalproperty* prop);
|
||||
/* VERSION */
|
||||
icalproperty* icalproperty_new_version(const char* v);
|
||||
icalproperty* icalproperty_vanew_version(const char* v, ...);
|
||||
void icalproperty_set_version(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_version(icalproperty* prop);
|
||||
/* X */
|
||||
icalproperty* icalproperty_new_x(const char* v);
|
||||
icalproperty* icalproperty_vanew_x(const char* v, ...);
|
||||
void icalproperty_set_x(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_x(icalproperty* prop);
|
||||
/* X-LIC-CLUSTERCOUNT */
|
||||
icalproperty* icalproperty_new_xlicclustercount(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicclustercount(const char* v, ...);
|
||||
void icalproperty_set_xlicclustercount(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicclustercount(icalproperty* prop);
|
||||
/* X-LIC-ERROR */
|
||||
icalproperty* icalproperty_new_xlicerror(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicerror(const char* v, ...);
|
||||
void icalproperty_set_xlicerror(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicerror(icalproperty* prop);
|
||||
/* X-LIC-MIMECHARSET */
|
||||
icalproperty* icalproperty_new_xlicmimecharset(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicmimecharset(const char* v, ...);
|
||||
void icalproperty_set_xlicmimecharset(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicmimecharset(icalproperty* prop);
|
||||
/* X-LIC-MIMECID */
|
||||
icalproperty* icalproperty_new_xlicmimecid(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicmimecid(const char* v, ...);
|
||||
void icalproperty_set_xlicmimecid(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicmimecid(icalproperty* prop);
|
||||
/* X-LIC-MIMECONTENTTYPE */
|
||||
icalproperty* icalproperty_new_xlicmimecontenttype(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicmimecontenttype(const char* v, ...);
|
||||
void icalproperty_set_xlicmimecontenttype(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicmimecontenttype(icalproperty* prop);
|
||||
/* X-LIC-MIMEENCODING */
|
||||
icalproperty* icalproperty_new_xlicmimeencoding(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicmimeencoding(const char* v, ...);
|
||||
void icalproperty_set_xlicmimeencoding(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicmimeencoding(icalproperty* prop);
|
||||
/* X-LIC-MIMEFILENAME */
|
||||
icalproperty* icalproperty_new_xlicmimefilename(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicmimefilename(const char* v, ...);
|
||||
void icalproperty_set_xlicmimefilename(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicmimefilename(icalproperty* prop);
|
||||
/* X-LIC-MIMEOPTINFO */
|
||||
icalproperty* icalproperty_new_xlicmimeoptinfo(const char* v);
|
||||
icalproperty* icalproperty_vanew_xlicmimeoptinfo(const char* v, ...);
|
||||
void icalproperty_set_xlicmimeoptinfo(icalproperty* prop, const char* v);
|
||||
const char* icalproperty_get_xlicmimeoptinfo(icalproperty* prop);
|
||||
|
||||
#endif /*ICALPROPERTY_H*/
|
|
@ -1,928 +0,0 @@
|
|||
/* -*- Mode: C -*- */
|
||||
/*======================================================================
|
||||
FILE: icalvalue.c
|
||||
CREATOR: eric 02 May 1999
|
||||
|
||||
$Id: icalderivedvalue.c,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of either:
|
||||
|
||||
The LGPL as published by the Free Software Foundation, version
|
||||
2.1, available at: http://www.fsf.org/copyleft/lesser.html
|
||||
|
||||
Or:
|
||||
|
||||
The Mozilla Public License Version 1.0. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/MPL/
|
||||
|
||||
The original code is icalvalue.c
|
||||
|
||||
Contributions from:
|
||||
Graham Davison (g.m.davison@computer.org)
|
||||
|
||||
|
||||
======================================================================*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <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 */
|
||||
|
||||
|
||||
|
||||
#define TMP_BUF_SIZE 1024
|
||||
|
||||
struct icalvalue_impl* icalvalue_new_impl(icalvalue_kind kind);
|
||||
|
||||
/* This map associates each of the value types with its string
|
||||
representation */
|
||||
struct icalvalue_kind_map {
|
||||
icalvalue_kind kind;
|
||||
char name[20];
|
||||
};
|
||||
|
||||
extern struct icalvalue_kind_map value_map[];
|
||||
|
||||
const char* icalvalue_kind_to_string(icalvalue_kind kind)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; value_map[i].kind != ICAL_NO_VALUE; i++) {
|
||||
if (value_map[i].kind == kind) {
|
||||
return value_map[i].name;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
icalvalue_kind icalvalue_string_to_kind(const char* str)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; value_map[i].kind != ICAL_NO_VALUE; i++) {
|
||||
if (strcmp(value_map[i].name,str) == 0) {
|
||||
return value_map[i].kind;
|
||||
}
|
||||
}
|
||||
|
||||
return value_map[i].kind;
|
||||
|
||||
}
|
||||
|
||||
icalvalue* icalvalue_new_x (const char* v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_X_VALUE);
|
||||
icalerror_check_arg_rz( (v!=0),"v");
|
||||
|
||||
icalvalue_set_x((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_x(icalvalue* value, const char* v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_arg_rv( (v!=0),"v");
|
||||
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
if(impl->x_value!=0) {free((void*)impl->x_value);}
|
||||
|
||||
impl->x_value = icalmemory_strdup(v);
|
||||
|
||||
if (impl->x_value == 0){
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
}
|
||||
const char* icalvalue_get_x(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_X_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->x_value;
|
||||
}
|
||||
|
||||
/* Recur is a special case, so it is not auto generated. */
|
||||
icalvalue*
|
||||
icalvalue_new_recur (struct icalrecurrencetype v)
|
||||
{
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_RECUR_VALUE);
|
||||
|
||||
icalvalue_set_recur((icalvalue*)impl,v);
|
||||
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
|
||||
void
|
||||
icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v)
|
||||
{
|
||||
struct icalvalue_impl* impl;
|
||||
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_RECUR_VALUE);
|
||||
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
if (impl->data.v_recur != 0){
|
||||
free(impl->data.v_recur);
|
||||
impl->data.v_recur = 0;
|
||||
}
|
||||
|
||||
impl->data.v_recur = malloc(sizeof(struct icalrecurrencetype));
|
||||
|
||||
if (impl->data.v_recur == 0){
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return;
|
||||
} else {
|
||||
memcpy(impl->data.v_recur, &v, sizeof(struct icalrecurrencetype));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct icalrecurrencetype
|
||||
icalvalue_get_recur(icalvalue* value)
|
||||
{
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_RECUR_VALUE);
|
||||
|
||||
return *(((struct icalvalue_impl*)value)->data.v_recur);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
icalvalue*
|
||||
icalvalue_new_trigger (struct icaltriggertype v)
|
||||
{
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TRIGGER_VALUE);
|
||||
|
||||
icalvalue_set_trigger((icalvalue*)impl,v);
|
||||
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
|
||||
void
|
||||
icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v)
|
||||
{
|
||||
struct icalvalue_impl* impl;
|
||||
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
if(!icaltime_is_null_time(v.time)){
|
||||
icalvalue_set_datetime((icalvalue*)impl,v.time);
|
||||
impl->kind = ICAL_DATETIME_VALUE;
|
||||
} else {
|
||||
icalvalue_set_duration((icalvalue*)impl,v.duration);
|
||||
impl->kind = ICAL_DURATION_VALUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct icaltriggertype
|
||||
icalvalue_get_trigger(icalvalue* value)
|
||||
{
|
||||
struct icalvalue_impl *impl = (struct icalvalue_impl*)value;
|
||||
struct icaltriggertype tr;
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
|
||||
if(impl->kind == ICAL_DATETIME_VALUE){
|
||||
tr.duration = icaldurationtype_from_int(0);
|
||||
tr.time = impl->data.v_time;
|
||||
} else if(impl->kind == ICAL_DURATION_VALUE){
|
||||
tr.time = icaltime_null_time();
|
||||
tr.duration = impl->data.v_duration;
|
||||
} else {
|
||||
tr.duration = icaldurationtype_from_int(0);
|
||||
tr.time = icaltime_null_time();
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
}
|
||||
|
||||
return tr;
|
||||
}
|
||||
|
||||
/* DATE-TIME-PERIOD is a special case, and is not auto generated */
|
||||
|
||||
icalvalue*
|
||||
icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v)
|
||||
{
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATETIMEPERIOD_VALUE);
|
||||
|
||||
icalvalue_set_datetimeperiod((icalvalue*)impl,v);
|
||||
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
|
||||
void
|
||||
icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v)
|
||||
{
|
||||
struct icalvalue_impl* impl = (struct icalvalue_impl*)value;
|
||||
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_DATETIMEPERIOD_VALUE);
|
||||
|
||||
if(!icaltime_is_null_time(v.time)){
|
||||
if(!icaltime_is_valid_time(v.time)){
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
return;
|
||||
}
|
||||
impl->kind = ICAL_DATETIME_VALUE;
|
||||
icalvalue_set_datetime(impl,v.time);
|
||||
} else if (!icalperiodtype_is_null_period(v.period)) {
|
||||
if(!icalperiodtype_is_valid_period(v.period)){
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
return;
|
||||
}
|
||||
impl->kind = ICAL_PERIOD_VALUE;
|
||||
icalvalue_set_period(impl,v.period);
|
||||
} else {
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
struct icaldatetimeperiodtype
|
||||
icalvalue_get_datetimeperiod(icalvalue* value)
|
||||
{
|
||||
struct icaldatetimeperiodtype dtp;
|
||||
|
||||
struct icalvalue_impl* impl = (struct icalvalue_impl*)value;
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_DATETIMEPERIOD_VALUE);
|
||||
|
||||
if(impl->kind == ICAL_DATETIME_VALUE){
|
||||
dtp.period = icalperiodtype_null_period();
|
||||
dtp.time = impl->data.v_time;
|
||||
} else if(impl->kind == ICAL_PERIOD_VALUE) {
|
||||
dtp.period = impl->data.v_period;
|
||||
dtp.time = icaltime_null_time();
|
||||
} else {
|
||||
dtp.period = icalperiodtype_null_period();
|
||||
dtp.time = icaltime_null_time();
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
}
|
||||
|
||||
return dtp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* The remaining interfaces are 'new', 'set' and 'get' for each of the value
|
||||
types */
|
||||
|
||||
|
||||
/* Everything below this line is machine generated. Do not edit. */
|
||||
static struct icalvalue_kind_map value_map[]={
|
||||
{ICAL_BOOLEAN_VALUE,"BOOLEAN"},
|
||||
{ICAL_UTCOFFSET_VALUE,"UTC-OFFSET"},
|
||||
{ICAL_RECUR_VALUE,"RECUR"},
|
||||
{ICAL_METHOD_VALUE,"METHOD"},
|
||||
{ICAL_CALADDRESS_VALUE,"CAL-ADDRESS"},
|
||||
{ICAL_PERIOD_VALUE,"PERIOD"},
|
||||
{ICAL_STATUS_VALUE,"STATUS"},
|
||||
{ICAL_BINARY_VALUE,"BINARY"},
|
||||
{ICAL_TEXT_VALUE,"TEXT"},
|
||||
{ICAL_DATETIMEDATE_VALUE,"DATE-TIME-DATE"},
|
||||
{ICAL_DURATION_VALUE,"DURATION"},
|
||||
{ICAL_DATETIMEPERIOD_VALUE,"DATE-TIME-PERIOD"},
|
||||
{ICAL_INTEGER_VALUE,"INTEGER"},
|
||||
{ICAL_TIME_VALUE,"TIME"},
|
||||
{ICAL_URI_VALUE,"URI"},
|
||||
{ICAL_TRIGGER_VALUE,"TRIGGER"},
|
||||
{ICAL_ATTACH_VALUE,"ATTACH"},
|
||||
{ICAL_CLASS_VALUE,"CLASS"},
|
||||
{ICAL_FLOAT_VALUE,"FLOAT"},
|
||||
{ICAL_QUERY_VALUE,"QUERY"},
|
||||
{ICAL_STRING_VALUE,"STRING"},
|
||||
{ICAL_TRANSP_VALUE,"TRANSP"},
|
||||
{ICAL_X_VALUE,"X"},
|
||||
{ICAL_DATETIME_VALUE,"DATE-TIME"},
|
||||
{ICAL_GEO_VALUE,"GEO"},
|
||||
{ICAL_DATE_VALUE,"DATE"},
|
||||
{ICAL_ACTION_VALUE,"ACTION"},
|
||||
{ICAL_NO_VALUE,""}
|
||||
};
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_boolean (int v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_BOOLEAN_VALUE);
|
||||
|
||||
icalvalue_set_boolean((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_boolean(icalvalue* value, int v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_BOOLEAN_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_int = v;
|
||||
}
|
||||
int icalvalue_get_boolean(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_BOOLEAN_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_int;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_utcoffset (int v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_UTCOFFSET_VALUE);
|
||||
|
||||
icalvalue_set_utcoffset((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_utcoffset(icalvalue* value, int v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_UTCOFFSET_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_int = v;
|
||||
}
|
||||
int icalvalue_get_utcoffset(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_UTCOFFSET_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_int;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_method (enum icalproperty_method v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_METHOD_VALUE);
|
||||
|
||||
icalvalue_set_method((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_method(icalvalue* value, enum icalproperty_method v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_METHOD_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_enum = v;
|
||||
}
|
||||
enum icalproperty_method icalvalue_get_method(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_METHOD_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_enum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_caladdress (const char* v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_CALADDRESS_VALUE);
|
||||
icalerror_check_arg_rz( (v!=0),"v");
|
||||
|
||||
icalvalue_set_caladdress((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_caladdress(icalvalue* value, const char* v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_arg_rv( (v!=0),"v");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_CALADDRESS_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
if(impl->data.v_string!=0) {free((void*)impl->data.v_string);}
|
||||
|
||||
impl->data.v_string = icalmemory_strdup(v);
|
||||
|
||||
if (impl->data.v_string == 0){
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
}
|
||||
const char* icalvalue_get_caladdress(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_CALADDRESS_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_period (struct icalperiodtype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_PERIOD_VALUE);
|
||||
|
||||
icalvalue_set_period((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_period(icalvalue* value, struct icalperiodtype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_PERIOD_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_period = v;
|
||||
}
|
||||
struct icalperiodtype icalvalue_get_period(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_PERIOD_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_period;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_status (enum icalproperty_status v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_STATUS_VALUE);
|
||||
|
||||
icalvalue_set_status((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_status(icalvalue* value, enum icalproperty_status v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_STATUS_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_enum = v;
|
||||
}
|
||||
enum icalproperty_status icalvalue_get_status(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_STATUS_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_enum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_binary (const char* v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_BINARY_VALUE);
|
||||
icalerror_check_arg_rz( (v!=0),"v");
|
||||
|
||||
icalvalue_set_binary((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_binary(icalvalue* value, const char* v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_arg_rv( (v!=0),"v");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_BINARY_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
if(impl->data.v_string!=0) {free((void*)impl->data.v_string);}
|
||||
|
||||
impl->data.v_string = icalmemory_strdup(v);
|
||||
|
||||
if (impl->data.v_string == 0){
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
}
|
||||
const char* icalvalue_get_binary(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_BINARY_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_text (const char* v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TEXT_VALUE);
|
||||
icalerror_check_arg_rz( (v!=0),"v");
|
||||
|
||||
icalvalue_set_text((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_text(icalvalue* value, const char* v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_arg_rv( (v!=0),"v");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_TEXT_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
if(impl->data.v_string!=0) {free((void*)impl->data.v_string);}
|
||||
|
||||
impl->data.v_string = icalmemory_strdup(v);
|
||||
|
||||
if (impl->data.v_string == 0){
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
}
|
||||
const char* icalvalue_get_text(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_TEXT_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_datetimedate (struct icaltimetype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATETIMEDATE_VALUE);
|
||||
|
||||
icalvalue_set_datetimedate((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_datetimedate(icalvalue* value, struct icaltimetype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_DATETIMEDATE_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_time = v;
|
||||
}
|
||||
struct icaltimetype icalvalue_get_datetimedate(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_DATETIMEDATE_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_duration (struct icaldurationtype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DURATION_VALUE);
|
||||
|
||||
icalvalue_set_duration((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_duration(icalvalue* value, struct icaldurationtype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_DURATION_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_duration = v;
|
||||
}
|
||||
struct icaldurationtype icalvalue_get_duration(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_DURATION_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_duration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_integer (int v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_INTEGER_VALUE);
|
||||
|
||||
icalvalue_set_integer((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_integer(icalvalue* value, int v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_INTEGER_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_int = v;
|
||||
}
|
||||
int icalvalue_get_integer(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_INTEGER_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_int;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_time (struct icaltimetype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TIME_VALUE);
|
||||
|
||||
icalvalue_set_time((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_time(icalvalue* value, struct icaltimetype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_TIME_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_time = v;
|
||||
}
|
||||
struct icaltimetype icalvalue_get_time(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_TIME_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_uri (const char* v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_URI_VALUE);
|
||||
icalerror_check_arg_rz( (v!=0),"v");
|
||||
|
||||
icalvalue_set_uri((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_uri(icalvalue* value, const char* v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_arg_rv( (v!=0),"v");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_URI_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
if(impl->data.v_string!=0) {free((void*)impl->data.v_string);}
|
||||
|
||||
impl->data.v_string = icalmemory_strdup(v);
|
||||
|
||||
if (impl->data.v_string == 0){
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
}
|
||||
const char* icalvalue_get_uri(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_URI_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_attach (struct icalattachtype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_ATTACH_VALUE);
|
||||
|
||||
icalvalue_set_attach((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_attach(icalvalue* value, struct icalattachtype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_ATTACH_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_attach = v;
|
||||
}
|
||||
struct icalattachtype icalvalue_get_attach(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_ATTACH_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_attach;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_class (enum icalproperty_class v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_CLASS_VALUE);
|
||||
|
||||
icalvalue_set_class((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_class(icalvalue* value, enum icalproperty_class v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_CLASS_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_enum = v;
|
||||
}
|
||||
enum icalproperty_class icalvalue_get_class(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_CLASS_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_enum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_float (float v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_FLOAT_VALUE);
|
||||
|
||||
icalvalue_set_float((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_float(icalvalue* value, float v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_FLOAT_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_float = v;
|
||||
}
|
||||
float icalvalue_get_float(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_FLOAT_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_float;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_query (const char* v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_QUERY_VALUE);
|
||||
icalerror_check_arg_rz( (v!=0),"v");
|
||||
|
||||
icalvalue_set_query((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_query(icalvalue* value, const char* v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_arg_rv( (v!=0),"v");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_QUERY_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
if(impl->data.v_string!=0) {free((void*)impl->data.v_string);}
|
||||
|
||||
impl->data.v_string = icalmemory_strdup(v);
|
||||
|
||||
if (impl->data.v_string == 0){
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
}
|
||||
const char* icalvalue_get_query(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_QUERY_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_string (const char* v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_STRING_VALUE);
|
||||
icalerror_check_arg_rz( (v!=0),"v");
|
||||
|
||||
icalvalue_set_string((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_string(icalvalue* value, const char* v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
icalerror_check_arg_rv( (v!=0),"v");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_STRING_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
if(impl->data.v_string!=0) {free((void*)impl->data.v_string);}
|
||||
|
||||
impl->data.v_string = icalmemory_strdup(v);
|
||||
|
||||
if (impl->data.v_string == 0){
|
||||
errno = ENOMEM;
|
||||
}
|
||||
|
||||
}
|
||||
const char* icalvalue_get_string(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_STRING_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_transp (enum icalproperty_transp v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_TRANSP_VALUE);
|
||||
|
||||
icalvalue_set_transp((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_transp(icalvalue* value, enum icalproperty_transp v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_TRANSP_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_enum = v;
|
||||
}
|
||||
enum icalproperty_transp icalvalue_get_transp(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_TRANSP_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_enum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_datetime (struct icaltimetype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATETIME_VALUE);
|
||||
|
||||
icalvalue_set_datetime((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_datetime(icalvalue* value, struct icaltimetype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_DATETIME_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_time = v;
|
||||
}
|
||||
struct icaltimetype icalvalue_get_datetime(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_DATETIME_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_geo (struct icalgeotype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_GEO_VALUE);
|
||||
|
||||
icalvalue_set_geo((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_geo(icalvalue* value, struct icalgeotype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_GEO_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_geo = v;
|
||||
}
|
||||
struct icalgeotype icalvalue_get_geo(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_GEO_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_geo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_date (struct icaltimetype v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_DATE_VALUE);
|
||||
|
||||
icalvalue_set_date((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_date(icalvalue* value, struct icaltimetype v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_DATE_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_time = v;
|
||||
}
|
||||
struct icaltimetype icalvalue_get_date(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_DATE_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
icalvalue* icalvalue_new_action (enum icalproperty_action v){
|
||||
struct icalvalue_impl* impl = icalvalue_new_impl(ICAL_ACTION_VALUE);
|
||||
|
||||
icalvalue_set_action((icalvalue*)impl,v);
|
||||
return (icalvalue*)impl;
|
||||
}
|
||||
void icalvalue_set_action(icalvalue* value, enum icalproperty_action v) {
|
||||
struct icalvalue_impl* impl;
|
||||
icalerror_check_arg_rv( (value!=0),"value");
|
||||
|
||||
icalerror_check_value_type(value, ICAL_ACTION_VALUE);
|
||||
impl = (struct icalvalue_impl*)value;
|
||||
|
||||
impl->data.v_enum = v;
|
||||
}
|
||||
enum icalproperty_action icalvalue_get_action(icalvalue* value) {
|
||||
|
||||
icalerror_check_arg( (value!=0),"value");
|
||||
icalerror_check_value_type(value, ICAL_ACTION_VALUE);
|
||||
return ((struct icalvalue_impl*)value)->data.v_enum;
|
||||
}
|
|
@ -1,290 +0,0 @@
|
|||
/* -*- Mode: C -*- */
|
||||
/*======================================================================
|
||||
FILE: icalvalue.h
|
||||
CREATOR: eric 20 March 1999
|
||||
|
||||
|
||||
$Id: icalderivedvalue.h,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of either:
|
||||
|
||||
The LGPL as published by the Free Software Foundation, version
|
||||
2.1, available at: http://www.fsf.org/copyleft/lesser.html
|
||||
|
||||
Or:
|
||||
|
||||
The Mozilla Public License Version 1.0. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/MPL/
|
||||
|
||||
The original code is icalvalue.h
|
||||
|
||||
======================================================================*/
|
||||
|
||||
#ifndef ICALDERIVEDVALUE_H
|
||||
#define ICALDERIVEDVALUE_H
|
||||
|
||||
#include "icaltypes.h"
|
||||
#include "icalrecur.h"
|
||||
#include "icaltime.h"
|
||||
#include "icalduration.h"
|
||||
#include "icalperiod.h"
|
||||
|
||||
typedef void icalvalue;
|
||||
|
||||
|
||||
|
||||
void icalvalue_set_x(icalvalue* value, const char* v);
|
||||
icalvalue* icalvalue_new_x(const char* v);
|
||||
const char* icalvalue_get_x(icalvalue* value);
|
||||
|
||||
icalvalue* icalvalue_new_recur (struct icalrecurrencetype v);
|
||||
void icalvalue_set_recur(icalvalue* value, struct icalrecurrencetype v);
|
||||
struct icalrecurrencetype icalvalue_get_recur(icalvalue* value);
|
||||
|
||||
icalvalue* icalvalue_new_trigger (struct icaltriggertype v);
|
||||
void icalvalue_set_trigger(icalvalue* value, struct icaltriggertype v);
|
||||
struct icaltriggertype icalvalue_get_trigger(icalvalue* value);
|
||||
|
||||
icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v);
|
||||
void icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v);
|
||||
struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(icalvalue* value);
|
||||
|
||||
/* Everything below this line is machine generated. Do not edit. */
|
||||
typedef enum icalvalue_kind {
|
||||
ICAL_ANY_VALUE=5000,
|
||||
ICAL_BOOLEAN_VALUE=5001,
|
||||
ICAL_UTCOFFSET_VALUE=5002,
|
||||
ICAL_RECUR_VALUE=5003,
|
||||
ICAL_METHOD_VALUE=5004,
|
||||
ICAL_CALADDRESS_VALUE=5005,
|
||||
ICAL_PERIOD_VALUE=5006,
|
||||
ICAL_STATUS_VALUE=5007,
|
||||
ICAL_BINARY_VALUE=5008,
|
||||
ICAL_TEXT_VALUE=5009,
|
||||
ICAL_DATETIMEDATE_VALUE=5010,
|
||||
ICAL_DURATION_VALUE=5011,
|
||||
ICAL_DATETIMEPERIOD_VALUE=5012,
|
||||
ICAL_INTEGER_VALUE=5013,
|
||||
ICAL_TIME_VALUE=5014,
|
||||
ICAL_URI_VALUE=5015,
|
||||
ICAL_TRIGGER_VALUE=5016,
|
||||
ICAL_ATTACH_VALUE=5017,
|
||||
ICAL_CLASS_VALUE=5018,
|
||||
ICAL_FLOAT_VALUE=5019,
|
||||
ICAL_QUERY_VALUE=5020,
|
||||
ICAL_STRING_VALUE=5021,
|
||||
ICAL_TRANSP_VALUE=5022,
|
||||
ICAL_X_VALUE=5023,
|
||||
ICAL_DATETIME_VALUE=5024,
|
||||
ICAL_GEO_VALUE=5025,
|
||||
ICAL_DATE_VALUE=5026,
|
||||
ICAL_ACTION_VALUE=5027,
|
||||
ICAL_NO_VALUE=5028
|
||||
} icalvalue_kind ;
|
||||
|
||||
#define ICALPROPERTY_FIRST_ENUM 10000
|
||||
|
||||
typedef enum icalproperty_action {
|
||||
ICAL_ACTION_X = 10000,
|
||||
ICAL_ACTION_AUDIO = 10001,
|
||||
ICAL_ACTION_DISPLAY = 10002,
|
||||
ICAL_ACTION_EMAIL = 10003,
|
||||
ICAL_ACTION_PROCEDURE = 10004,
|
||||
ICAL_ACTION_NONE = 10005
|
||||
} icalproperty_action;
|
||||
|
||||
typedef enum icalproperty_class {
|
||||
ICAL_CLASS_X = 10006,
|
||||
ICAL_CLASS_PUBLIC = 10007,
|
||||
ICAL_CLASS_PRIVATE = 10008,
|
||||
ICAL_CLASS_CONFIDENTIAL = 10009,
|
||||
ICAL_CLASS_NONE = 10010
|
||||
} icalproperty_class;
|
||||
|
||||
typedef enum icalproperty_method {
|
||||
ICAL_METHOD_X = 10011,
|
||||
ICAL_METHOD_PUBLISH = 10012,
|
||||
ICAL_METHOD_REQUEST = 10013,
|
||||
ICAL_METHOD_REPLY = 10014,
|
||||
ICAL_METHOD_ADD = 10015,
|
||||
ICAL_METHOD_CANCEL = 10016,
|
||||
ICAL_METHOD_REFRESH = 10017,
|
||||
ICAL_METHOD_COUNTER = 10018,
|
||||
ICAL_METHOD_DECLINECOUNTER = 10019,
|
||||
ICAL_METHOD_CREATE = 10020,
|
||||
ICAL_METHOD_READ = 10021,
|
||||
ICAL_METHOD_RESPONSE = 10022,
|
||||
ICAL_METHOD_MOVE = 10023,
|
||||
ICAL_METHOD_MODIFY = 10024,
|
||||
ICAL_METHOD_GENERATEUID = 10025,
|
||||
ICAL_METHOD_DELETE = 10026,
|
||||
ICAL_METHOD_NONE = 10027
|
||||
} icalproperty_method;
|
||||
|
||||
typedef enum icalproperty_status {
|
||||
ICAL_STATUS_X = 10028,
|
||||
ICAL_STATUS_TENTATIVE = 10029,
|
||||
ICAL_STATUS_CONFIRMED = 10030,
|
||||
ICAL_STATUS_COMPLETED = 10031,
|
||||
ICAL_STATUS_NEEDSACTION = 10032,
|
||||
ICAL_STATUS_CANCELLED = 10033,
|
||||
ICAL_STATUS_INPROCESS = 10034,
|
||||
ICAL_STATUS_DRAFT = 10035,
|
||||
ICAL_STATUS_FINAL = 10036,
|
||||
ICAL_STATUS_NONE = 10037
|
||||
} icalproperty_status;
|
||||
|
||||
typedef enum icalproperty_transp {
|
||||
ICAL_TRANSP_X = 10038,
|
||||
ICAL_TRANSP_OPAQUE = 10039,
|
||||
ICAL_TRANSP_TRANSPARENT = 10040,
|
||||
ICAL_TRANSP_NONE = 10041
|
||||
} icalproperty_transp;
|
||||
|
||||
#define ICALPROPERTY_LAST_ENUM 10042
|
||||
|
||||
|
||||
/* BOOLEAN */
|
||||
icalvalue* icalvalue_new_boolean(int v);
|
||||
int icalvalue_get_boolean(icalvalue* value);
|
||||
void icalvalue_set_boolean(icalvalue* value, int v);
|
||||
|
||||
|
||||
/* UTC-OFFSET */
|
||||
icalvalue* icalvalue_new_utcoffset(int v);
|
||||
int icalvalue_get_utcoffset(icalvalue* value);
|
||||
void icalvalue_set_utcoffset(icalvalue* value, int v);
|
||||
|
||||
|
||||
/* METHOD */
|
||||
icalvalue* icalvalue_new_method(enum icalproperty_method v);
|
||||
enum icalproperty_method icalvalue_get_method(icalvalue* value);
|
||||
void icalvalue_set_method(icalvalue* value, enum icalproperty_method v);
|
||||
|
||||
|
||||
/* CAL-ADDRESS */
|
||||
icalvalue* icalvalue_new_caladdress(const char* v);
|
||||
const char* icalvalue_get_caladdress(icalvalue* value);
|
||||
void icalvalue_set_caladdress(icalvalue* value, const char* v);
|
||||
|
||||
|
||||
/* PERIOD */
|
||||
icalvalue* icalvalue_new_period(struct icalperiodtype v);
|
||||
struct icalperiodtype icalvalue_get_period(icalvalue* value);
|
||||
void icalvalue_set_period(icalvalue* value, struct icalperiodtype v);
|
||||
|
||||
|
||||
/* STATUS */
|
||||
icalvalue* icalvalue_new_status(enum icalproperty_status v);
|
||||
enum icalproperty_status icalvalue_get_status(icalvalue* value);
|
||||
void icalvalue_set_status(icalvalue* value, enum icalproperty_status v);
|
||||
|
||||
|
||||
/* BINARY */
|
||||
icalvalue* icalvalue_new_binary(const char* v);
|
||||
const char* icalvalue_get_binary(icalvalue* value);
|
||||
void icalvalue_set_binary(icalvalue* value, const char* v);
|
||||
|
||||
|
||||
/* TEXT */
|
||||
icalvalue* icalvalue_new_text(const char* v);
|
||||
const char* icalvalue_get_text(icalvalue* value);
|
||||
void icalvalue_set_text(icalvalue* value, const char* v);
|
||||
|
||||
|
||||
/* DATE-TIME-DATE */
|
||||
icalvalue* icalvalue_new_datetimedate(struct icaltimetype v);
|
||||
struct icaltimetype icalvalue_get_datetimedate(icalvalue* value);
|
||||
void icalvalue_set_datetimedate(icalvalue* value, struct icaltimetype v);
|
||||
|
||||
|
||||
/* DURATION */
|
||||
icalvalue* icalvalue_new_duration(struct icaldurationtype v);
|
||||
struct icaldurationtype icalvalue_get_duration(icalvalue* value);
|
||||
void icalvalue_set_duration(icalvalue* value, struct icaldurationtype v);
|
||||
|
||||
|
||||
/* INTEGER */
|
||||
icalvalue* icalvalue_new_integer(int v);
|
||||
int icalvalue_get_integer(icalvalue* value);
|
||||
void icalvalue_set_integer(icalvalue* value, int v);
|
||||
|
||||
|
||||
/* TIME */
|
||||
icalvalue* icalvalue_new_time(struct icaltimetype v);
|
||||
struct icaltimetype icalvalue_get_time(icalvalue* value);
|
||||
void icalvalue_set_time(icalvalue* value, struct icaltimetype v);
|
||||
|
||||
|
||||
/* URI */
|
||||
icalvalue* icalvalue_new_uri(const char* v);
|
||||
const char* icalvalue_get_uri(icalvalue* value);
|
||||
void icalvalue_set_uri(icalvalue* value, const char* v);
|
||||
|
||||
|
||||
/* ATTACH */
|
||||
icalvalue* icalvalue_new_attach(struct icalattachtype v);
|
||||
struct icalattachtype icalvalue_get_attach(icalvalue* value);
|
||||
void icalvalue_set_attach(icalvalue* value, struct icalattachtype v);
|
||||
|
||||
|
||||
/* CLASS */
|
||||
icalvalue* icalvalue_new_class(enum icalproperty_class v);
|
||||
enum icalproperty_class icalvalue_get_class(icalvalue* value);
|
||||
void icalvalue_set_class(icalvalue* value, enum icalproperty_class v);
|
||||
|
||||
|
||||
/* FLOAT */
|
||||
icalvalue* icalvalue_new_float(float v);
|
||||
float icalvalue_get_float(icalvalue* value);
|
||||
void icalvalue_set_float(icalvalue* value, float v);
|
||||
|
||||
|
||||
/* QUERY */
|
||||
icalvalue* icalvalue_new_query(const char* v);
|
||||
const char* icalvalue_get_query(icalvalue* value);
|
||||
void icalvalue_set_query(icalvalue* value, const char* v);
|
||||
|
||||
|
||||
/* STRING */
|
||||
icalvalue* icalvalue_new_string(const char* v);
|
||||
const char* icalvalue_get_string(icalvalue* value);
|
||||
void icalvalue_set_string(icalvalue* value, const char* v);
|
||||
|
||||
|
||||
/* TRANSP */
|
||||
icalvalue* icalvalue_new_transp(enum icalproperty_transp v);
|
||||
enum icalproperty_transp icalvalue_get_transp(icalvalue* value);
|
||||
void icalvalue_set_transp(icalvalue* value, enum icalproperty_transp v);
|
||||
|
||||
|
||||
/* DATE-TIME */
|
||||
icalvalue* icalvalue_new_datetime(struct icaltimetype v);
|
||||
struct icaltimetype icalvalue_get_datetime(icalvalue* value);
|
||||
void icalvalue_set_datetime(icalvalue* value, struct icaltimetype v);
|
||||
|
||||
|
||||
/* GEO */
|
||||
icalvalue* icalvalue_new_geo(struct icalgeotype v);
|
||||
struct icalgeotype icalvalue_get_geo(icalvalue* value);
|
||||
void icalvalue_set_geo(icalvalue* value, struct icalgeotype v);
|
||||
|
||||
|
||||
/* DATE */
|
||||
icalvalue* icalvalue_new_date(struct icaltimetype v);
|
||||
struct icaltimetype icalvalue_get_date(icalvalue* value);
|
||||
void icalvalue_set_date(icalvalue* value, struct icaltimetype v);
|
||||
|
||||
|
||||
/* ACTION */
|
||||
icalvalue* icalvalue_new_action(enum icalproperty_action v);
|
||||
enum icalproperty_action icalvalue_get_action(icalvalue* value);
|
||||
void icalvalue_set_action(icalvalue* value, enum icalproperty_action v);
|
||||
|
||||
#endif /*ICALVALUE_H*/
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 20 March 1999
|
||||
|
||||
|
||||
$Id: icalderivedvalue.h.in,v 1.1 2001-11-15 19:26:55 mikep%oeone.com Exp $
|
||||
$Id: icalderivedvalue.h.in,v 1.2 2001-12-21 18:56:19 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
@ -55,4 +55,6 @@ icalvalue* icalvalue_new_datetimeperiod (struct icaldatetimeperiodtype v);
|
|||
void icalvalue_set_datetimeperiod(icalvalue* value, struct icaldatetimeperiodtype v);
|
||||
struct icaldatetimeperiodtype icalvalue_get_datetimeperiod(icalvalue* value);
|
||||
|
||||
void icalvalue_reset_kind(icalvalue* value);
|
||||
|
||||
/* Everything below this line is machine generated. Do not edit. */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalerror.c
|
||||
CREATOR: eric 16 May 1999
|
||||
|
||||
$Id: icalerror.c,v 1.2 2001-11-22 19:21:47 mikep%oeone.com Exp $
|
||||
$Id: icalerror.c,v 1.3 2001-12-21 18:56:19 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
@ -30,7 +30,6 @@
|
|||
#endif
|
||||
|
||||
#include "icalerror.h"
|
||||
#include <string.h>
|
||||
|
||||
icalerrorenum icalerrno;
|
||||
|
||||
|
@ -48,6 +47,19 @@ void icalerror_crash_here(void)
|
|||
assert( *p);
|
||||
}
|
||||
|
||||
#ifdef ICAL_SETERROR_ISFUNC
|
||||
void icalerror_set_errno(icalerrorenum x)
|
||||
{
|
||||
icalerrno = x;
|
||||
if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL ||
|
||||
(icalerror_get_error_state(x)==ICAL_ERROR_DEFAULT &&
|
||||
icalerror_errors_are_fatal == 1 )){
|
||||
icalerror_warn(icalerror_strerror(x));
|
||||
assert(0);
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void icalerror_clear_errno() {
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalerror.h
|
||||
CREATOR: eric 09 May 1999
|
||||
|
||||
$Id: icalerror.h,v 1.1 2001-11-15 19:26:57 mikep%oeone.com Exp $
|
||||
$Id: icalerror.h,v 1.2 2001-12-21 18:56:19 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -35,6 +35,8 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#define ICAL_SETERROR_ISFUNC
|
||||
|
||||
|
||||
/* This routine is called before any error is triggered. It is called
|
||||
by icalerror_set_errno, so it does not appear in all of the macros
|
||||
|
@ -90,7 +92,7 @@ char* icalerror_perror();
|
|||
void icalerror_set_error_state( icalerrorenum error, icalerrorstate);
|
||||
icalerrorstate icalerror_get_error_state( icalerrorenum error);
|
||||
|
||||
|
||||
#ifndef ICAL_SETERROR_ISFUNC
|
||||
#define icalerror_set_errno(x) \
|
||||
icalerrno = x; \
|
||||
if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || \
|
||||
|
@ -99,7 +101,9 @@ if(icalerror_get_error_state(x)==ICAL_ERROR_FATAL || \
|
|||
icalerror_warn(icalerror_strerror(x)); \
|
||||
assert(0); \
|
||||
}
|
||||
|
||||
#else
|
||||
void icalerror_set_errno(icalerrorenum x);
|
||||
#endif
|
||||
|
||||
#ifdef ICAL_ERRORS_ARE_FATAL
|
||||
#undef NDEBUG
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
DESCRIPTION:
|
||||
|
||||
$Id: icallangbind.c,v 1.2 2001-11-22 19:21:48 mikep%oeone.com Exp $
|
||||
$Id: icallangbind.c,v 1.3 2001-12-21 18:56:21 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 1999 Eric Busboom
|
||||
|
@ -24,11 +24,12 @@
|
|||
#include "icalmemory.h"
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
int* icallangbind_new_array(int size){
|
||||
int* p = (int*)malloc(size*sizeof(int));
|
||||
return p; /* Caller handles failures */
|
||||
|
@ -133,6 +134,7 @@ icalcomponent* icallangbind_get_next_component(icalcomponent *c,
|
|||
|
||||
#define APPENDC(x) icalmemory_append_char(&buf, &buf_ptr, &buf_size, x);
|
||||
|
||||
|
||||
const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
|
||||
{
|
||||
char tmp[25];
|
||||
|
@ -154,14 +156,14 @@ const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
|
|||
APPENDS(" 'name' ");
|
||||
APPENDS(sep);
|
||||
APPENDC('\'');
|
||||
APPENDS(icalenum_property_kind_to_string(icalproperty_isa(prop)));
|
||||
APPENDS(icalproperty_kind_to_string(icalproperty_isa(prop)));
|
||||
APPENDC('\'');
|
||||
|
||||
if(value){
|
||||
APPENDS(", 'value_type' ");
|
||||
APPENDS(sep);
|
||||
APPENDC('\'');
|
||||
APPENDS(icalenum_value_kind_to_string(icalvalue_isa(value)));
|
||||
APPENDS(icalvalue_kind_to_string(icalvalue_isa(value)));
|
||||
APPENDC('\'');
|
||||
}
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -6,7 +6,7 @@
|
|||
|
||||
DESCRIPTION:
|
||||
|
||||
$Id: icallexer.l,v 1.1 2001-11-15 19:26:58 mikep%oeone.com Exp $
|
||||
$Id: icallexer.l,v 1.2 2001-12-21 18:56:22 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 1999 Eric Busboom
|
||||
|
@ -63,12 +63,6 @@ char *str_buf;
|
|||
char *str_buf_p;
|
||||
size_t buf_sz; /* = ICAL_MAX_STR_CONST;*/
|
||||
|
||||
/* Define routines that were not propertly defined because of the
|
||||
renaming hack applied in icalyacc.y */
|
||||
YY_BUFFER_STATE ical_yy_scan_buffer ( char *base, yy_size_t size );
|
||||
YY_BUFFER_STATE ical_yy_scan_string ( yyconst char *yy_str );
|
||||
YY_BUFFER_STATE ical_yy_scan_bytes ( yyconst char *bytes, int len );
|
||||
|
||||
%}
|
||||
|
||||
crlf \x0D?\x0A
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalmemory.c
|
||||
CREATOR: eric 30 June 1999
|
||||
|
||||
$Id: icalmemory.c,v 1.1 2001-11-15 19:26:58 mikep%oeone.com Exp $
|
||||
$Id: icalmemory.c,v 1.2 2001-12-21 18:56:22 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
|
@ -60,7 +60,7 @@
|
|||
#include <stdlib.h> /* for malloc, realloc */
|
||||
#include <string.h> /* for memset(), strdup */
|
||||
|
||||
#define BUFFER_RING_SIZE 25
|
||||
#define BUFFER_RING_SIZE 2500
|
||||
#define MIN_BUFFER_SIZE 200
|
||||
|
||||
void icalmemory_free_tmp_buffer (void* buf);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 30 June 1999
|
||||
|
||||
|
||||
$Id: icalmemory.h,v 1.2 2001-11-22 19:21:48 mikep%oeone.com Exp $
|
||||
$Id: icalmemory.h,v 1.3 2001-12-21 18:56:22 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 26 July 2000
|
||||
|
||||
|
||||
$Id: icalmime.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $
|
||||
$Id: icalmime.c,v 1.3 2001-12-21 18:56:22 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -37,12 +37,11 @@
|
|||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
/* These *_part routines are called by the MIME parser via the
|
||||
local_action_map */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalderivedparameters.{c,h}
|
||||
CREATOR: eric 09 May 1999
|
||||
|
||||
$Id: icalparameter.c,v 1.1 2001-11-15 19:27:00 mikep%oeone.com Exp $
|
||||
$Id: icalparameter.c,v 1.2 2001-12-21 18:56:22 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
@ -245,7 +245,17 @@ icalparameter_as_ical_string (icalparameter* parameter)
|
|||
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "=");
|
||||
|
||||
if(impl->string !=0){
|
||||
int qm = 0;
|
||||
|
||||
/* Encapsulate the property in quotes if necessary */
|
||||
if (strchr (impl->string, ';') != 0 || strchr (impl->string, ':') != 0) {
|
||||
icalmemory_append_char (&buf, &buf_ptr, &buf_size, '"');
|
||||
qm = 1;
|
||||
}
|
||||
icalmemory_append_string(&buf, &buf_ptr, &buf_size, impl->string);
|
||||
if (qm == 1) {
|
||||
icalmemory_append_char (&buf, &buf_ptr, &buf_size, '"');
|
||||
}
|
||||
} else if (impl->data != 0){
|
||||
const char* str = icalparameter_enum_to_string(impl->data);
|
||||
icalmemory_append_string(&buf, &buf_ptr, &buf_size, str);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- Mode: C -*-
|
||||
/* -*- Mode: C; tab-width: 4; c-basic-offset: 8; -*-
|
||||
======================================================================
|
||||
FILE: icalparser.c
|
||||
CREATOR: eric 04 August 1999
|
||||
|
||||
$Id: icalparser.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $
|
||||
$Id: icalparser.c,v 1.3 2001-12-21 18:56:23 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
|
@ -50,18 +50,20 @@
|
|||
|
||||
#include <string.h> /* For strncpy & size_t */
|
||||
#include <stdio.h> /* For FILE and fgets and sprintf */
|
||||
#include <stdlib.h> /* for free */
|
||||
#include <stdlib.h> /* for free */
|
||||
#include <wctype.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
extern icalvalue* icalparser_yy_value;
|
||||
void set_parser_value_state(icalvalue_kind kind);
|
||||
int ical_yyparse(void);
|
||||
|
||||
char* icalparser_get_next_char(char c, char *str);
|
||||
char* icalparser_get_next_char(char c, char *str, int qm);
|
||||
char* icalparser_get_next_parameter(char* line,char** end);
|
||||
char* icalparser_get_next_value(char* line, char **end, icalvalue_kind kind);
|
||||
char* icalparser_get_prop_name(char* line, char** end);
|
||||
|
@ -101,11 +103,10 @@ icalparser* icalparser_new(void)
|
|||
impl->components = pvl_newlist();
|
||||
impl->level = 0;
|
||||
impl->state = ICALPARSER_SUCCESS;
|
||||
|
||||
impl->tmp_buf_size = TMP_BUF_SIZE;
|
||||
impl->buffer_full = 0;
|
||||
impl->lineno = 0;
|
||||
|
||||
impl->continuation_line = 0;
|
||||
memset(impl->temp,0, TMP_BUF_SIZE);
|
||||
|
||||
return (icalparser*)impl;
|
||||
|
@ -144,14 +145,14 @@ icalvalue* icalvalue_new_From_string_with_error(icalvalue_kind kind,
|
|||
|
||||
|
||||
|
||||
char* icalparser_get_next_char(char c, char *str)
|
||||
char* icalparser_get_next_char(char c, char *str, int qm)
|
||||
{
|
||||
int quote_mode = 0;
|
||||
char* p;
|
||||
|
||||
|
||||
for(p=str; *p!=0; p++){
|
||||
|
||||
if (qm == 1) {
|
||||
if ( quote_mode == 0 && *p=='"' && *(p-1) != '\\' ){
|
||||
quote_mode =1;
|
||||
continue;
|
||||
|
@ -161,6 +162,7 @@ char* icalparser_get_next_char(char c, char *str)
|
|||
quote_mode =0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (quote_mode == 0 && *p== c && *(p-1) != '\\' ){
|
||||
return p;
|
||||
|
@ -174,14 +176,21 @@ char* icalparser_get_next_char(char c, char *str)
|
|||
/* make a new tmp buffer out of a substring */
|
||||
char* make_segment(char* start, char* end)
|
||||
{
|
||||
char *buf;
|
||||
char *buf, *tmp;
|
||||
size_t size = (size_t)end - (size_t)start;
|
||||
|
||||
buf = icalmemory_tmp_buffer(size+1);
|
||||
|
||||
|
||||
strncpy(buf,start,size);
|
||||
*(buf+size) = 0;
|
||||
*(buf+size) = 0;
|
||||
|
||||
tmp = (buf+size);
|
||||
while ( *tmp == '\0' || iswspace(*tmp) )
|
||||
{
|
||||
*tmp = 0;
|
||||
tmp--;
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
||||
|
@ -189,9 +198,7 @@ char* make_segment(char* start, char* end)
|
|||
|
||||
const char* input_buffer;
|
||||
const char* input_buffer_p;
|
||||
#ifndef WIN32
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
int icalparser_flex_input(char* buf, int max_size)
|
||||
{
|
||||
|
@ -248,8 +255,8 @@ char* icalparser_get_prop_name(char* line, char** end)
|
|||
char* v;
|
||||
char *str;
|
||||
|
||||
p = icalparser_get_next_char(';',line);
|
||||
v = icalparser_get_next_char(':',line);
|
||||
p = icalparser_get_next_char(';',line,1);
|
||||
v = icalparser_get_next_char(':',line,1);
|
||||
if (p== 0 && v == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -271,9 +278,10 @@ char* icalparser_get_param_name(char* line, char **end)
|
|||
{
|
||||
|
||||
char* next;
|
||||
char* quote;
|
||||
char *str;
|
||||
|
||||
next = icalparser_get_next_char('=',line);
|
||||
next = icalparser_get_next_char('=',line,1);
|
||||
|
||||
if (next == 0) {
|
||||
return 0;
|
||||
|
@ -281,6 +289,16 @@ char* icalparser_get_param_name(char* line, char **end)
|
|||
|
||||
str = make_segment(line,next);
|
||||
*end = next+1;
|
||||
if (**end == '"') {
|
||||
*end = *end+1;
|
||||
next = icalparser_get_next_char('"',*end,0);
|
||||
if (next == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*end = make_segment(*end,next);
|
||||
}
|
||||
|
||||
return str;
|
||||
|
||||
}
|
||||
|
@ -291,7 +309,7 @@ char* icalparser_get_next_paramvalue(char* line, char **end)
|
|||
char* next;
|
||||
char *str;
|
||||
|
||||
next = icalparser_get_next_char(',',line);
|
||||
next = icalparser_get_next_char(',',line,1);
|
||||
|
||||
if (next == 0){
|
||||
next = (char*)(size_t)line+(size_t)strlen(line);\
|
||||
|
@ -323,7 +341,7 @@ char* icalparser_get_next_value(char* line, char **end, icalvalue_kind kind)
|
|||
p = line;
|
||||
while(1){
|
||||
|
||||
next = icalparser_get_next_char(',',p);
|
||||
next = icalparser_get_next_char(',',p,1);
|
||||
|
||||
/* Unforunately, RFC2445 says that for the RECUR value, COMMA
|
||||
can both seperate digits in a list, and it can seperate
|
||||
|
@ -384,14 +402,14 @@ char* icalparser_get_next_parameter(char* line,char** end)
|
|||
char *v;
|
||||
char *str;
|
||||
|
||||
v = icalparser_get_next_char(':',line);
|
||||
next = icalparser_get_next_char(';', line);
|
||||
v = icalparser_get_next_char(':',line,1);
|
||||
next = icalparser_get_next_char(';', line,1);
|
||||
|
||||
/* There is no ';' or, it is after the ':' that marks the beginning of
|
||||
the value */
|
||||
|
||||
if (next == 0 || next > v) {
|
||||
next = icalparser_get_next_char(':', line);
|
||||
next = icalparser_get_next_char(':', line,1);
|
||||
}
|
||||
|
||||
if (next != 0) {
|
||||
|
@ -521,7 +539,13 @@ char* icalparser_get_line(icalparser *parser,
|
|||
|
||||
} else {
|
||||
*(line_p) = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
while ( *line_p == '\0' || iswspace(*line_p) )
|
||||
{
|
||||
*line_p = '\0';
|
||||
line_p--;
|
||||
}
|
||||
|
||||
return line;
|
||||
|
||||
|
@ -569,7 +593,8 @@ icalcomponent* icalparser_parse(icalparser *parser,
|
|||
icalcomponent *c=0;
|
||||
icalcomponent *root=0;
|
||||
struct icalparser_impl *impl = (struct icalparser_impl*)parser;
|
||||
icalerrorstate es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR);
|
||||
icalerrorstate es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR);
|
||||
int cont;
|
||||
|
||||
icalerror_check_arg_rz((parser !=0),"parser");
|
||||
|
||||
|
@ -609,11 +634,13 @@ icalcomponent* icalparser_parse(icalparser *parser,
|
|||
|
||||
c = 0;
|
||||
|
||||
}
|
||||
}
|
||||
cont = 0;
|
||||
if(line != 0){
|
||||
free(line);
|
||||
free(line);
|
||||
cont = 1;
|
||||
}
|
||||
} while ( line != 0);
|
||||
} while ( cont );
|
||||
|
||||
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
|
||||
|
||||
|
@ -1094,7 +1121,7 @@ icalcomponent* icalparser_parse_string(const char* str)
|
|||
struct slg_data d;
|
||||
icalparser *p;
|
||||
|
||||
icalerrorstate es = icalerror_get_error_state(ICAL_PARSE_ERROR);
|
||||
icalerrorstate es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR);
|
||||
|
||||
d.pos = 0;
|
||||
d.str = str;
|
||||
|
@ -1102,11 +1129,11 @@ icalcomponent* icalparser_parse_string(const char* str)
|
|||
p = icalparser_new();
|
||||
icalparser_set_gen_data(p,&d);
|
||||
|
||||
icalerror_set_error_state(ICAL_PARSE_ERROR,ICAL_ERROR_NONFATAL);
|
||||
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL);
|
||||
|
||||
c = icalparser_parse(p,string_line_generator);
|
||||
|
||||
icalerror_set_error_state(ICAL_PARSE_ERROR,es);
|
||||
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
|
||||
|
||||
icalparser_free(p);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalperiod.c
|
||||
CREATOR: eric 02 June 2000
|
||||
|
||||
$Id: icalperiod.c,v 1.1 2001-11-15 19:27:04 mikep%oeone.com Exp $
|
||||
$Id: icalperiod.c,v 1.2 2001-12-21 18:56:23 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -95,11 +95,14 @@ struct icalperiodtype icalperiodtype_from_string (const char* str)
|
|||
if(icaldurationtype_as_int(p.duration) == 0) goto error;
|
||||
}
|
||||
|
||||
icalerrno = e;
|
||||
icalerrno = e;
|
||||
|
||||
free(s);
|
||||
|
||||
return p;
|
||||
|
||||
error:
|
||||
error:
|
||||
free(s);
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return null_p;
|
||||
}
|
||||
|
@ -133,6 +136,7 @@ const char* icalperiodtype_as_ical_string(struct icalperiodtype p)
|
|||
|
||||
icalmemory_append_string(&buf, &buf_ptr, &buf_size, end);
|
||||
|
||||
icalmemory_add_tmp_buffer(buf);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
FILE: icalproperty.c
|
||||
CREATOR: eric 28 April 1999
|
||||
|
||||
$Id: icalproperty.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $
|
||||
$Id: icalproperty.c,v 1.3 2001-12-21 18:56:23 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -45,12 +45,12 @@
|
|||
#include <stdio.h> /* for printf */
|
||||
#include <stdarg.h> /* for va_list, va_start, etc. */
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#define TMP_BUF_SIZE 1024
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
/* Private routines for icalproperty */
|
||||
void icalvalue_set_parent(icalvalue* value,
|
||||
|
@ -62,7 +62,7 @@ void icalparameter_set_parent(icalparameter* param,
|
|||
icalproperty* icalparameter_get_parent(icalparameter* value);
|
||||
|
||||
|
||||
void icalproperty_set_x_name(icalproperty* prop, char* name);
|
||||
void icalproperty_set_x_name(icalproperty* prop, const char* name);
|
||||
|
||||
struct icalproperty_impl
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ void icalproperty_add_parameters(struct icalproperty_impl *prop,va_list args)
|
|||
icalproperty_add_parameter((icalproperty*)impl,
|
||||
(icalparameter*)vp);
|
||||
} else {
|
||||
assert(0);
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ icalproperty_new_clone(icalproperty* prop)
|
|||
|
||||
}
|
||||
|
||||
icalproperty* icalproperty_new_from_string(char* str)
|
||||
icalproperty* icalproperty_new_from_string(const char* str)
|
||||
{
|
||||
|
||||
size_t buf_size = 1024;
|
||||
|
@ -268,7 +268,7 @@ icalproperty_free (icalproperty* prop)
|
|||
}
|
||||
|
||||
|
||||
char*
|
||||
const char*
|
||||
icalproperty_as_ical_string (icalproperty* prop)
|
||||
{
|
||||
icalparameter *param;
|
||||
|
@ -717,7 +717,7 @@ const char* icalproperty_get_value_as_string(icalproperty* prop)
|
|||
}
|
||||
|
||||
|
||||
void icalproperty_set_x_name(icalproperty* prop, char* name)
|
||||
void icalproperty_set_x_name(icalproperty* prop, const char* name)
|
||||
{
|
||||
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
|
||||
|
||||
|
@ -736,7 +736,7 @@ void icalproperty_set_x_name(icalproperty* prop, char* name)
|
|||
|
||||
}
|
||||
|
||||
char* icalproperty_get_x_name(icalproperty* prop){
|
||||
const char* icalproperty_get_x_name(icalproperty* prop){
|
||||
|
||||
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
|
||||
|
||||
|
@ -747,7 +747,7 @@ char* icalproperty_get_x_name(icalproperty* prop){
|
|||
|
||||
|
||||
/* From Jonathan Yue <jonathan.yue@cp.net> */
|
||||
char* icalproperty_get_name (icalproperty* prop)
|
||||
const char* icalproperty_get_name (icalproperty* prop)
|
||||
{
|
||||
|
||||
const char* property_name = 0;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 20 March 1999
|
||||
|
||||
|
||||
$Id: icalproperty.h,v 1.1 2001-11-15 19:27:08 mikep%oeone.com Exp $
|
||||
$Id: icalproperty.h,v 1.2 2001-12-21 18:56:23 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
@ -47,9 +47,9 @@ icalproperty* icalproperty_new(icalproperty_kind kind);
|
|||
|
||||
icalproperty* icalproperty_new_clone(icalproperty * prop);
|
||||
|
||||
icalproperty* icalproperty_new_from_string(char* str);
|
||||
icalproperty* icalproperty_new_from_string(const char* str);
|
||||
|
||||
char* icalproperty_as_ical_string(icalproperty* prop);
|
||||
const char* icalproperty_as_ical_string(icalproperty* prop);
|
||||
|
||||
void icalproperty_free(icalproperty* prop);
|
||||
|
||||
|
@ -82,12 +82,12 @@ const char* icalproperty_get_value_as_string(icalproperty* prop);
|
|||
|
||||
/* Deal with X properties */
|
||||
|
||||
void icalproperty_set_x_name(icalproperty* prop, char* name);
|
||||
char* icalproperty_get_x_name(icalproperty* prop);
|
||||
void icalproperty_set_x_name(icalproperty* prop, const char* name);
|
||||
const char* icalproperty_get_x_name(icalproperty* prop);
|
||||
|
||||
/* Return the name of the property -- the type name converted to a
|
||||
string, or the value of _get_x_name if the type is and X property */
|
||||
char* icalproperty_get_name (icalproperty* prop);
|
||||
const char* icalproperty_get_name (icalproperty* prop);
|
||||
|
||||
icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalrecur.c
|
||||
CREATOR: eric 16 May 2000
|
||||
|
||||
$Id: icalrecur.c,v 1.1 2001-11-15 19:27:09 mikep%oeone.com Exp $
|
||||
$Id: icalrecur.c,v 1.2 2001-12-21 18:56:23 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
@ -170,7 +170,6 @@ const char* icalrecur_weekday_to_string(icalrecurrencetype_weekday kind);
|
|||
icalrecurrencetype_weekday icalrecur_string_to_weekday(const char* str);
|
||||
|
||||
|
||||
|
||||
/*********************** Rule parsing routines ************************/
|
||||
|
||||
struct icalrecur_parser {
|
||||
|
@ -280,6 +279,8 @@ void icalrecur_add_byrules(struct icalrecur_parser *parser, short *array,
|
|||
} else if (*t == '+'){
|
||||
sign = 1;
|
||||
t++;
|
||||
} else {
|
||||
sign = 1;
|
||||
}
|
||||
|
||||
v = atoi(t) * sign ;
|
||||
|
@ -386,7 +387,8 @@ struct icalrecurrencetype icalrecurrencetype_from_string(const char* str)
|
|||
|
||||
if(name == 0){
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
icalrecurrencetype_clear(&parser.rt);
|
||||
icalrecurrencetype_clear(&parser.rt);
|
||||
free(parser.copy);
|
||||
return parser.rt;
|
||||
}
|
||||
|
||||
|
@ -429,6 +431,7 @@ struct icalrecurrencetype icalrecurrencetype_from_string(const char* str)
|
|||
} else {
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
icalrecurrencetype_clear(&parser.rt);
|
||||
free(parser.copy);
|
||||
return parser.rt;
|
||||
}
|
||||
|
||||
|
@ -457,6 +460,7 @@ struct { char* str;size_t offset; short limit; } recurmap[] =
|
|||
};
|
||||
|
||||
/* A private routine in icalvalue.c */
|
||||
void print_date_to_string(char* str, struct icaltimetype *data);
|
||||
void print_datetime_to_string(char* str, struct icaltimetype *data);
|
||||
|
||||
char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur)
|
||||
|
@ -481,6 +485,9 @@ char* icalrecurrencetype_as_string(struct icalrecurrencetype *recur)
|
|||
if(recur->until.year != 0){
|
||||
|
||||
temp[0] = 0;
|
||||
if (recur->until.is_date)
|
||||
print_date_to_string(temp,&(recur->until));
|
||||
else
|
||||
print_datetime_to_string(temp,&(recur->until));
|
||||
|
||||
icalmemory_append_string(&str,&str_p,&buf_sz,";UNTIL=");
|
||||
|
@ -580,6 +587,8 @@ struct icalrecur_iterator_impl {
|
|||
|
||||
};
|
||||
|
||||
void increment_year(struct icalrecur_iterator_impl* impl, int inc);
|
||||
|
||||
int icalrecur_iterator_sizeof_byarray(short* byarray)
|
||||
{
|
||||
int array_itr;
|
||||
|
@ -636,7 +645,7 @@ int icalrecur_two_byrule(struct icalrecur_iterator_impl* impl,
|
|||
enum byrule itr;
|
||||
int passes = 0;
|
||||
|
||||
memset(test_array,0,9);
|
||||
memset(test_array,0,9*sizeof(short));
|
||||
|
||||
test_array[one] = 1;
|
||||
test_array[two] = 1;
|
||||
|
@ -901,10 +910,24 @@ icalrecur_iterator* icalrecur_iterator_new(struct icalrecurrencetype rule,
|
|||
|
||||
}
|
||||
|
||||
/* For YEARLY rule, begin by setting up the year days array */
|
||||
/* For YEARLY rule, begin by setting up the year days array . THey
|
||||
YEARLY rules work by expanding one year at a time. */
|
||||
|
||||
if(impl->rule.freq == ICAL_YEARLY_RECURRENCE){
|
||||
expand_year_days(impl,impl->last.year);
|
||||
struct icaltimetype next;
|
||||
|
||||
for (;;) {
|
||||
expand_year_days(impl,impl->last.year);
|
||||
if (impl->days[0] != ICAL_RECURRENCE_ARRAY_MAX)
|
||||
break;
|
||||
increment_year(impl,impl->rule.interval);
|
||||
}
|
||||
|
||||
/* Copy the first day into last. */
|
||||
next = icaltime_from_day_of_year(impl->days[0], impl->last.year);
|
||||
|
||||
impl->last.day = next.day;
|
||||
impl->last.month = next.month;
|
||||
}
|
||||
|
||||
|
||||
|
@ -979,7 +1002,6 @@ void icalrecur_iterator_free(icalrecur_iterator* i)
|
|||
|
||||
}
|
||||
|
||||
|
||||
void increment_year(struct icalrecur_iterator_impl* impl, int inc)
|
||||
{
|
||||
impl->last.year+=inc;
|
||||
|
@ -1329,56 +1351,9 @@ int next_yearday(struct icalrecur_iterator_impl* impl)
|
|||
|
||||
}
|
||||
|
||||
/* This routine is only called by next_week. It is certain that BY_DAY
|
||||
has data */
|
||||
|
||||
int next_weekday_by_week(struct icalrecur_iterator_impl* impl)
|
||||
{
|
||||
|
||||
short end_of_data = 0;
|
||||
short start_of_week, dow;
|
||||
struct icaltimetype next;
|
||||
|
||||
if (next_hour(impl) == 0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert( impl->by_ptrs[BY_DAY][0]!=ICAL_RECURRENCE_ARRAY_MAX);
|
||||
|
||||
while(1) {
|
||||
|
||||
impl->by_indices[BY_DAY]++; /* Look at next elem in BYDAY array */
|
||||
|
||||
/* Are we at the end of the BYDAY array? */
|
||||
if (impl->by_ptrs[BY_DAY][impl->by_indices[BY_DAY]]
|
||||
==ICAL_RECURRENCE_ARRAY_MAX){
|
||||
|
||||
impl->by_indices[BY_DAY] = 0; /* Reset to 0 */
|
||||
end_of_data = 1; /* Signal that we're at the end */
|
||||
}
|
||||
|
||||
/* Add the day of week offset to to the start of this week, and use
|
||||
that to get the next day */
|
||||
dow = impl->by_ptrs[BY_DAY][impl->by_indices[BY_DAY]];
|
||||
start_of_week = icaltime_start_doy_of_week(impl->last);
|
||||
|
||||
dow--; /*Sun is 1, not 0 */
|
||||
|
||||
if(dow+start_of_week <1 && !end_of_data){
|
||||
/* The selected date is in the previous year. */
|
||||
continue;
|
||||
}
|
||||
|
||||
next = icaltime_from_day_of_year(start_of_week + dow,impl->last.year);
|
||||
|
||||
impl->last.day = next.day;
|
||||
impl->last.month = next.month;
|
||||
impl->last.year = next.year;
|
||||
|
||||
return end_of_data;
|
||||
}
|
||||
|
||||
}
|
||||
/* Returns the day of the month for the current month of t that is the
|
||||
pos'th instance of the day-of-week dow */
|
||||
|
||||
int nth_weekday(short dow, short pos, struct icaltimetype t){
|
||||
|
||||
|
@ -1428,6 +1403,23 @@ int nth_weekday(short dow, short pos, struct icaltimetype t){
|
|||
return wd;
|
||||
}
|
||||
|
||||
int is_day_in_byday(struct icalrecur_iterator_impl* impl,struct icaltimetype tt){
|
||||
|
||||
int idx;
|
||||
|
||||
for(idx = 0; BYDAYPTR[idx] != ICAL_RECURRENCE_ARRAY_MAX; idx++){
|
||||
short dow = icalrecurrencetype_day_day_of_week(BYDAYPTR[idx]);
|
||||
short pos = icalrecurrencetype_day_position(BYDAYPTR[idx]);
|
||||
short this_dow = icaltime_day_of_week(tt);
|
||||
|
||||
if( (pos == 0 && dow == this_dow ) || /* Just a dow, like "TU" or "FR" */
|
||||
(nth_weekday(dow,pos,tt) == tt.day)){ /*pos+wod: "3FR" or -1TU" */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int next_month(struct icalrecur_iterator_impl* impl)
|
||||
{
|
||||
|
@ -1445,12 +1437,15 @@ int next_month(struct icalrecur_iterator_impl* impl)
|
|||
return data_valid; /* Signal that the data is valid */
|
||||
}
|
||||
|
||||
|
||||
/* Now iterate through the occurrences within a month -- by days,
|
||||
weeks or weekdays. */
|
||||
|
||||
/*
|
||||
* Case 1:
|
||||
* Rules Like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYMONTHDAY=13
|
||||
*/
|
||||
|
||||
if(has_by_data(impl,BY_DAY) && has_by_data(impl,BY_MONTH_DAY)){
|
||||
/* Cases like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR;BYMONTHDAY=13 */
|
||||
short day, idx,j;
|
||||
short days_in_month = icaltime_days_in_month(impl->last.month,
|
||||
impl->last.year);
|
||||
|
@ -1488,50 +1483,56 @@ int next_month(struct icalrecur_iterator_impl* impl)
|
|||
data_valid = 0; /* signal that impl->last is invalid */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Case 2:
|
||||
* Rules Like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR
|
||||
*/
|
||||
|
||||
} else if(has_by_data(impl,BY_DAY)){
|
||||
/* Cases like: FREQ=MONTHLY;INTERVAL=1;BYDAY=FR */
|
||||
/* For this case, the weekdays are relative to the
|
||||
month. BYDAY=FR -> First Friday in month, etc. */
|
||||
|
||||
short day, idx;
|
||||
/* This code iterates through the remaining days in the month
|
||||
and checks if each day is listed in the BY_DAY array. This
|
||||
seems very inneficient, but I think it is the simplest way to
|
||||
account for both BYDAY=1FR (First friday in month) and
|
||||
BYDAY=FR ( every friday in month ) */
|
||||
|
||||
short day;
|
||||
short days_in_month = icaltime_days_in_month(impl->last.month,
|
||||
impl->last.year);
|
||||
|
||||
assert( BYDAYPTR[0]!=ICAL_RECURRENCE_ARRAY_MAX);
|
||||
|
||||
/* Iterate through the remaining days in the month and check if
|
||||
each day is listed in the BY_DAY array. This seems very
|
||||
inneficient, but I think it is the simplest way to account
|
||||
for both BYDAY=1FR (First friday in month) and BYDAY=FR (
|
||||
every friday in month ) */
|
||||
|
||||
for(day = impl->last.day+1; day <= days_in_month; day++){
|
||||
for(idx = 0; BYDAYPTR[idx] != ICAL_RECURRENCE_ARRAY_MAX; idx++){
|
||||
short dow = icalrecurrencetype_day_day_of_week(BYDAYPTR[idx]);
|
||||
short pos = icalrecurrencetype_day_position(BYDAYPTR[idx]);
|
||||
short this_dow;
|
||||
|
||||
impl->last.day = day;
|
||||
this_dow = icaltime_day_of_week(impl->last);
|
||||
|
||||
if( (pos == 0 && dow == this_dow ) ||
|
||||
(nth_weekday(dow,pos,impl->last) == day)){
|
||||
goto DEND;
|
||||
}
|
||||
impl->last.day = day;
|
||||
if(is_day_in_byday(impl,impl->last)){
|
||||
data_valid = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DEND:
|
||||
|
||||
if ( day > days_in_month){
|
||||
impl->last.day = 1;
|
||||
increment_month(impl);
|
||||
data_valid = 0; /* signal that impl->last is invalid */
|
||||
|
||||
/* Did moving to the next month put us on a valid date? if
|
||||
so, note that the new data is valid, if, not, mark it
|
||||
invalid */
|
||||
|
||||
if(is_day_in_byday(impl,impl->last)){
|
||||
data_valid = 1;
|
||||
} else {
|
||||
data_valid = 0; /* signal that impl->last is invalid */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Case 3
|
||||
* Rules Like: FREQ=MONTHLY;COUNT=10;BYMONTHDAY=-3
|
||||
*/
|
||||
|
||||
} else if (has_by_data(impl,BY_MONTH_DAY)) {
|
||||
/* Cases like: FREQ=MONTHLY;COUNT=10;BYMONTHDAY=-3 */
|
||||
short day;
|
||||
|
||||
assert( BYMDPTR[0]!=ICAL_RECURRENCE_ARRAY_MAX);
|
||||
|
@ -1558,18 +1559,70 @@ int next_month(struct icalrecur_iterator_impl* impl)
|
|||
increment_month(impl);
|
||||
}
|
||||
|
||||
return data_valid; /* Signal that the data is valid */
|
||||
return data_valid;
|
||||
|
||||
}
|
||||
|
||||
int next_weekday_by_week(struct icalrecur_iterator_impl* impl)
|
||||
{
|
||||
|
||||
short end_of_data = 0;
|
||||
short start_of_week, dow;
|
||||
struct icaltimetype next;
|
||||
|
||||
if (next_hour(impl) == 0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
assert(has_by_data(impl,BY_DAY));
|
||||
|
||||
/* If we get here, we need to step to tne next day */
|
||||
|
||||
while(1) {
|
||||
struct icaltimetype tt = icaltime_null_time();
|
||||
BYDAYIDX++; /* Look at next elem in BYDAY array */
|
||||
|
||||
/* Are we at the end of the BYDAY array? */
|
||||
if (BYDAYPTR[BYDAYIDX]==ICAL_RECURRENCE_ARRAY_MAX){
|
||||
BYDAYIDX = 0; /* Reset to 0 */
|
||||
end_of_data = 1; /* Signal that we're at the end */
|
||||
}
|
||||
|
||||
/* Add the day of week offset to to the start of this week, and use
|
||||
that to get the next day */
|
||||
/* ignore position of dow ("4FR"), only use dow ("FR")*/
|
||||
dow = icalrecurrencetype_day_day_of_week(BYDAYPTR[BYDAYIDX]);
|
||||
tt.year = impl->last.year;
|
||||
tt.day = impl->last.day;
|
||||
tt.month = impl->last.month;
|
||||
|
||||
start_of_week = icaltime_start_doy_of_week(tt);
|
||||
|
||||
dow--; /* Set Sunday to be 0 */
|
||||
|
||||
if(dow+start_of_week <1){
|
||||
/* The selected date is in the previous year. */
|
||||
if(!end_of_data){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
next = icaltime_from_day_of_year(start_of_week + dow,impl->last.year);
|
||||
|
||||
impl->last.day = next.day;
|
||||
impl->last.month = next.month;
|
||||
impl->last.year = next.year;
|
||||
|
||||
return end_of_data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int next_week(struct icalrecur_iterator_impl* impl)
|
||||
{
|
||||
short has_by_data = (impl->by_ptrs[BY_WEEK_NO][0]!=ICAL_RECURRENCE_ARRAY_MAX);
|
||||
short this_frequency = (impl->rule.freq == ICAL_WEEKLY_RECURRENCE);
|
||||
short end_of_data = 0;
|
||||
|
||||
/* Increment to the next week day */
|
||||
/* Increment to the next week day, if there is data at a level less than a week */
|
||||
if (next_weekday_by_week(impl) == 0){
|
||||
return 0; /* Have not reached end of week yet */
|
||||
}
|
||||
|
@ -1577,8 +1630,8 @@ int next_week(struct icalrecur_iterator_impl* impl)
|
|||
/* If we get here, we have incremented through the entire week, and
|
||||
can increment to the next week */
|
||||
|
||||
|
||||
if( has_by_data){
|
||||
if( has_by_data(impl,BY_WEEK_NO)){
|
||||
/*FREQ=WEEKLY;BYWEEK=20*/
|
||||
/* Use the Week Number byrule data */
|
||||
int week_no;
|
||||
struct icaltimetype t;
|
||||
|
@ -1602,13 +1655,12 @@ int next_week(struct icalrecur_iterator_impl* impl)
|
|||
|
||||
impl->last = icaltime_normalize(impl->last);
|
||||
|
||||
} else if( !has_by_data && this_frequency ){
|
||||
/* If there is no BY_WEEK_NO data, just jump forward 7 days. */
|
||||
} else {
|
||||
/* Jump to the next week */
|
||||
increment_monthday(impl,7*impl->rule.interval);
|
||||
}
|
||||
|
||||
|
||||
if(has_by_data && end_of_data && this_frequency ){
|
||||
if( has_by_data(impl,BY_WEEK_NO) && end_of_data){
|
||||
increment_year(impl,1);
|
||||
}
|
||||
|
||||
|
@ -1616,14 +1668,14 @@ int next_week(struct icalrecur_iterator_impl* impl)
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* Expand the BYDAY rule part and return a pointer to a newly allocated list of days. */
|
||||
pvl_list expand_by_day(struct icalrecur_iterator_impl* impl,short year)
|
||||
{
|
||||
/* Try to calculate each of the occurrences. */
|
||||
int i;
|
||||
pvl_list days_list = pvl_newlist();
|
||||
|
||||
short start_dow, end_dow, end_year_day, start_doy;
|
||||
short start_dow, end_dow, end_year_day;
|
||||
struct icaltimetype tmp = impl->last;
|
||||
|
||||
tmp.year= year;
|
||||
|
@ -1631,35 +1683,34 @@ pvl_list expand_by_day(struct icalrecur_iterator_impl* impl,short year)
|
|||
tmp.day = 1;
|
||||
tmp.is_date = 1;
|
||||
|
||||
/* Find the day that 1st Jan falls on, 1 (Sun) to 7 (Sat). */
|
||||
start_dow = icaltime_day_of_week(tmp);
|
||||
start_doy = icaltime_start_doy_of_week(tmp);
|
||||
|
||||
/* Get the last day of the year*/
|
||||
tmp.year++;
|
||||
tmp = icaltime_normalize(tmp);
|
||||
tmp.day--;
|
||||
tmp = icaltime_normalize(tmp);
|
||||
tmp.year= year;
|
||||
tmp.month = 12;
|
||||
tmp.day = 31;
|
||||
tmp.is_date = 1;
|
||||
|
||||
end_dow = icaltime_day_of_week(tmp);
|
||||
end_year_day = icaltime_day_of_year(tmp);
|
||||
|
||||
for(i = 0; BYDAYPTR[i] != ICAL_RECURRENCE_ARRAY_MAX; i++){
|
||||
/* This is 1 (Sun) to 7 (Sat). */
|
||||
short dow =
|
||||
icalrecurrencetype_day_day_of_week(BYDAYPTR[i]);
|
||||
short pos = icalrecurrencetype_day_position(BYDAYPTR[i]);
|
||||
|
||||
if(pos == 0){
|
||||
/* add all of the days of the year with this day-of-week*/
|
||||
int week;
|
||||
for(week = 0; week < 52 ; week ++){
|
||||
short doy = start_doy + (week * 7) + dow-1;
|
||||
/* The day was specified without a position -- it is just
|
||||
a bare day of the week ( BYDAY=SU) so add all of the
|
||||
days of the year with this day-of-week*/
|
||||
int doy, tmp_start_doy;
|
||||
|
||||
if(doy > end_year_day){
|
||||
break;
|
||||
} else {
|
||||
tmp_start_doy = ((dow + 7 - start_dow) % 7) + 1;
|
||||
|
||||
for (doy = tmp_start_doy; doy <= end_year_day; doy += 7)
|
||||
pvl_push(days_list,(void*)(int)doy);
|
||||
}
|
||||
}
|
||||
|
||||
} else if ( pos > 0) {
|
||||
int first;
|
||||
|
@ -1669,14 +1720,24 @@ pvl_list expand_by_day(struct icalrecur_iterator_impl* impl,short year)
|
|||
} else {
|
||||
first = dow - start_dow + 8;
|
||||
}
|
||||
|
||||
|
||||
/* Then just multiple the position times 7 to get the pos'th day in the year */
|
||||
pvl_push(days_list,(void*)(first+ (pos-1) * 7));
|
||||
|
||||
} else { /* pos < 0 */
|
||||
assert(0);
|
||||
int last;
|
||||
pos = -pos;
|
||||
|
||||
/* last occurrence of dow in year */
|
||||
if( dow <= end_dow) {
|
||||
last = end_year_day - end_dow + dow;
|
||||
} else {
|
||||
last = end_year_day - end_dow + dow - 7;
|
||||
}
|
||||
|
||||
pvl_push(days_list,(void*)(last - (pos-1) * 7));
|
||||
}
|
||||
}
|
||||
|
||||
return days_list;
|
||||
}
|
||||
|
||||
|
@ -1692,6 +1753,8 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
struct icaltimetype t;
|
||||
int flags;
|
||||
|
||||
t = icaltime_null_time();
|
||||
|
||||
#define HBD(x) has_by_data(impl,x)
|
||||
|
||||
t.is_date = 1; /* Needed to make day_of_year routines work property */
|
||||
|
@ -1699,18 +1762,26 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
memset(&t,0,sizeof(t));
|
||||
memset(impl->days,ICAL_RECURRENCE_ARRAY_MAX_BYTE,sizeof(impl->days));
|
||||
|
||||
/* The flags and the following switch statement select which code
|
||||
to use to expand the yers days, based on which BY-rules are
|
||||
present. */
|
||||
|
||||
flags = (HBD(BY_DAY) ? 1<<BY_DAY : 0) +
|
||||
(HBD(BY_WEEK_NO) ? 1<<BY_WEEK_NO : 0) +
|
||||
(HBD(BY_MONTH_DAY) ? 1<<BY_MONTH_DAY : 0) +
|
||||
(HBD(BY_MONTH) ? 1<<BY_MONTH : 0) +
|
||||
(HBD(BY_YEAR_DAY) ? 1<<BY_YEAR_DAY : 0);
|
||||
|
||||
|
||||
|
||||
switch(flags) {
|
||||
|
||||
|
||||
case 0: {
|
||||
/* FREQ=YEARLY; */
|
||||
|
||||
struct icaltimetype t = impl->dtstart;
|
||||
t.year = impl->last.year;
|
||||
|
||||
impl->days[days_index++] = icaltime_day_of_year(t);
|
||||
|
||||
break;
|
||||
}
|
||||
case 1<<BY_MONTH: {
|
||||
|
@ -1736,7 +1807,21 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
|
||||
case 1<<BY_MONTH_DAY: {
|
||||
/* FREQ=YEARLY; BYMONTHDAY=1,15*/
|
||||
assert(0);
|
||||
for(k=0;impl->by_ptrs[BY_MONTH_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++)
|
||||
{
|
||||
short month_day = impl->by_ptrs[BY_MONTH_DAY][k];
|
||||
short doy;
|
||||
|
||||
t = impl->dtstart;
|
||||
t.day = month_day;
|
||||
t.year = year;
|
||||
t.is_date = 1;
|
||||
|
||||
doy = icaltime_day_of_year(t);
|
||||
|
||||
impl->days[days_index++] = doy;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1778,13 +1863,15 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
|
||||
dow = icaltime_day_of_week(t);
|
||||
/* HACK Not finished */
|
||||
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case (1<<BY_WEEK_NO) + (1<<BY_MONTH_DAY): {
|
||||
/*FREQ=YEARLY; WEEKNO=20,50; BYMONTH= 6,11 */
|
||||
assert(0);
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1800,6 +1887,8 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
impl->days[days_index++] = day;
|
||||
}
|
||||
|
||||
pvl_free(days);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1810,38 +1899,86 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
for(j=0;impl->by_ptrs[BY_MONTH][j]!=ICAL_RECURRENCE_ARRAY_MAX;j++){
|
||||
short month = impl->by_ptrs[BY_MONTH][j];
|
||||
short days_in_month = icaltime_days_in_month(month,year);
|
||||
|
||||
short first_dow, last_dow, doy_offset;
|
||||
|
||||
struct icaltimetype t;
|
||||
memset(&t,0,sizeof(struct icaltimetype));
|
||||
t.day = 1;
|
||||
t.year = year;
|
||||
t.month = month;
|
||||
t.day = 1;
|
||||
t.is_date = 1;
|
||||
|
||||
for(t.day = 1; t.day <=days_in_month; t.day++){
|
||||
|
||||
short current_dow = icaltime_day_of_week(t);
|
||||
|
||||
for(k=0;impl->by_ptrs[BY_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++){
|
||||
|
||||
enum icalrecurrencetype_weekday dow =
|
||||
icalrecurrencetype_day_day_of_week(impl->by_ptrs[BY_DAY][k]);
|
||||
|
||||
if(current_dow == dow){
|
||||
short doy = icaltime_day_of_year(t);
|
||||
/* HACK, incomplete Nth day of week handling */
|
||||
impl->days[days_index++] = doy;
|
||||
|
||||
}
|
||||
|
||||
first_dow = icaltime_day_of_week(t);
|
||||
|
||||
/* This holds the day offset used to calculate the day of the year
|
||||
from the month day. Just add the month day to this. */
|
||||
doy_offset = icaltime_day_of_year(t) - 1;
|
||||
|
||||
t.day = days_in_month;
|
||||
last_dow = icaltime_day_of_week(t);
|
||||
|
||||
for(k=0;impl->by_ptrs[BY_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++){
|
||||
short day_coded = impl->by_ptrs[BY_DAY][k];
|
||||
enum icalrecurrencetype_weekday dow =
|
||||
icalrecurrencetype_day_day_of_week(day_coded);
|
||||
short pos = icalrecurrencetype_day_position(day_coded);
|
||||
short first_matching_day, last_matching_day, day, month_day;
|
||||
|
||||
/* Calculate the first day in the month with the given weekday,
|
||||
and the last day. */
|
||||
first_matching_day = ((dow + 7 - first_dow) % 7) + 1;
|
||||
last_matching_day = days_in_month - ((last_dow + 7 - dow) % 7);
|
||||
|
||||
if (pos == 0) {
|
||||
/* Add all of instances of the weekday within the month. */
|
||||
for (day = first_matching_day; day <= days_in_month; day += 7)
|
||||
impl->days[days_index++] = doy_offset + day;
|
||||
|
||||
} else if (pos > 0) {
|
||||
/* Add the nth instance of the weekday within the month. */
|
||||
month_day = first_matching_day + (pos - 1) * 7;
|
||||
|
||||
if (month_day <= days_in_month)
|
||||
impl->days[days_index++] = doy_offset + month_day;
|
||||
|
||||
} else {
|
||||
/* Add the -nth instance of the weekday within the month.*/
|
||||
month_day = last_matching_day + (pos + 1) * 7;
|
||||
|
||||
if (month_day > 0)
|
||||
impl->days[days_index++] = doy_offset + month_day;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case (1<<BY_DAY) + (1<<BY_MONTH_DAY) : {
|
||||
/*FREQ=YEARLY; BYDAY=TH,20MO,-10FR; BYMONTHDAY=1,15*/
|
||||
assert(0);
|
||||
|
||||
int days_index = 0;
|
||||
pvl_elem itr;
|
||||
pvl_list days = expand_by_day(impl,year);
|
||||
|
||||
for(itr=pvl_head(days);itr!=0;itr=pvl_next(itr)){
|
||||
short day = (short)(int)pvl_data(itr);
|
||||
struct icaltimetype tt;
|
||||
short j;
|
||||
|
||||
tt = icaltime_from_day_of_year(day,year);
|
||||
|
||||
for(j = 0; BYMDPTR[j]!=ICAL_RECURRENCE_ARRAY_MAX; j++){
|
||||
short mday = BYMDPTR[j];
|
||||
|
||||
if(tt.day == mday){
|
||||
impl->days[days_index++] = day;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pvl_free(days);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1872,6 +2009,8 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
|
||||
}
|
||||
|
||||
pvl_free(days);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
@ -1899,12 +2038,14 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
pvl_free(days);
|
||||
break;
|
||||
}
|
||||
|
||||
case (1<<BY_DAY) + (1<<BY_WEEK_NO) + (1<<BY_MONTH_DAY): {
|
||||
/*FREQ=YEARLY; BYDAY=TH,20MO,-10FR; WEEKNO=20,50; BYMONTHDAY=1,15*/
|
||||
assert(0);
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1917,7 +2058,7 @@ int expand_year_days(struct icalrecur_iterator_impl* impl,short year)
|
|||
}
|
||||
|
||||
default: {
|
||||
assert(0);
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1937,8 +2078,13 @@ int next_year(struct icalrecur_iterator_impl* impl)
|
|||
|
||||
if (impl->days[++impl->days_index] == ICAL_RECURRENCE_ARRAY_MAX){
|
||||
impl->days_index = 0;
|
||||
|
||||
for (;;) {
|
||||
increment_year(impl,impl->rule.interval);
|
||||
expand_year_days(impl,impl->last.year);
|
||||
if (impl->days[0] != ICAL_RECURRENCE_ARRAY_MAX)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
next = icaltime_from_day_of_year(impl->days[impl->days_index],impl->last.year);
|
||||
|
|
|
@ -18,6 +18,11 @@
|
|||
#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
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icaltime.c
|
||||
CREATOR: eric 02 June 2000
|
||||
|
||||
$Id: icaltime.c,v 1.2 2001-11-22 19:21:49 mikep%oeone.com Exp $
|
||||
$Id: icaltime.c,v 1.3 2001-12-21 18:56:27 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -26,7 +26,7 @@
|
|||
======================================================================*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "icaltime.h"
|
||||
|
@ -35,22 +35,245 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
#ifdef ICAL_NO_LIBICAL
|
||||
#define icalerror_set_errno(x)
|
||||
#define icalerror_check_arg_rv(x,y)
|
||||
#define icalerror_check_arg_re(x,y,z)
|
||||
#else
|
||||
#endif
|
||||
*/
|
||||
|
||||
#include "icalerror.h"
|
||||
#include "icalmemory.h"
|
||||
#endif
|
||||
|
||||
#include "icaltimezone.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#include <time.h>
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#include <Windows.h>
|
||||
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Deprecated TIme functions
|
||||
* The following four routines are required under UNIX systems to account for the lack
|
||||
* of two time routines, a version of mktime() that operates in UTC ( the inverse of
|
||||
* gmtime() ), and a routine to get the UTC offset for a particular timezone.
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
/* Structure used by set_tz to hold an old value of TZ, and the new
|
||||
value, which is in memory we will have to free in unset_tz */
|
||||
struct set_tz_save {char* orig_tzid; char* new_env_str;};
|
||||
|
||||
/* Structure used by set_tz to hold an old value of TZ, and the new
|
||||
value, which is in memory we will have to free in unset_tz */
|
||||
/* This will hold the last "TZ=XXX" string we used with putenv(). After we
|
||||
call putenv() again to set a new TZ string, we can free the previous one.
|
||||
As far as I know, no libc implementations actually free the memory used in
|
||||
the environment variables (how could they know if it is a static string or
|
||||
a malloc'ed string?), so we have to free it ourselves. */
|
||||
|
||||
struct set_tz_save saved_tz;
|
||||
|
||||
|
||||
/* Temporarily change the TZ environmental variable. */
|
||||
struct set_tz_save set_tz(const char* tzid)
|
||||
{
|
||||
|
||||
char *orig_tzid = 0;
|
||||
char *new_env_str;
|
||||
struct set_tz_save savetz;
|
||||
size_t tmp_sz;
|
||||
|
||||
savetz.orig_tzid = 0;
|
||||
savetz.new_env_str = 0;
|
||||
|
||||
if(getenv("TZ") != 0){
|
||||
orig_tzid = (char*)icalmemory_strdup(getenv("TZ"));
|
||||
|
||||
if(orig_tzid == 0){
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
free(orig_tzid);
|
||||
return savetz;
|
||||
}
|
||||
}
|
||||
|
||||
tmp_sz =strlen(tzid)+4;
|
||||
new_env_str = (char*)malloc(tmp_sz);
|
||||
|
||||
if(new_env_str == 0){
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return savetz;
|
||||
}
|
||||
|
||||
/* Copy the TZid into a string with the form that putenv expects. */
|
||||
strcpy(new_env_str,"TZ=");
|
||||
strcpy(new_env_str+3,tzid);
|
||||
|
||||
putenv(new_env_str);
|
||||
|
||||
/* Old value of TZ and the string we will have to free later */
|
||||
savetz.orig_tzid = orig_tzid;
|
||||
savetz.new_env_str = new_env_str;
|
||||
|
||||
return savetz;
|
||||
}
|
||||
|
||||
void unset_tz(struct set_tz_save savetz)
|
||||
{
|
||||
/* restore the original TZ environment */
|
||||
|
||||
char* orig_tzid = savetz.orig_tzid;
|
||||
|
||||
if(orig_tzid!=0){
|
||||
size_t tmp_sz =strlen(orig_tzid)+4;
|
||||
char* orig_env_str = (char*)icalmemory_tmp_buffer(tmp_sz);
|
||||
|
||||
if(orig_env_str == 0){
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy(orig_env_str,"TZ=");
|
||||
strcpy(orig_env_str+3,orig_tzid);
|
||||
|
||||
putenv(orig_env_str);
|
||||
|
||||
free(orig_tzid);
|
||||
} else {
|
||||
putenv("TZ="); /* Delete from environment */
|
||||
}
|
||||
|
||||
if(savetz.new_env_str != 0){
|
||||
free(savetz.new_env_str);
|
||||
}
|
||||
}
|
||||
|
||||
/* A UTC version of mktime() */
|
||||
time_t icaltimegm(struct tm* stm)
|
||||
{
|
||||
|
||||
time_t t;
|
||||
#ifndef WIN32
|
||||
struct set_tz_save old_tz = set_tz("UTC");
|
||||
t = mktime(stm);
|
||||
unset_tz(old_tz);
|
||||
return t;
|
||||
#else
|
||||
TIME_ZONE_INFORMATION tz;
|
||||
char * szZone;
|
||||
icaltimezone* zone;
|
||||
int offset_tt;
|
||||
|
||||
t = mktime(stm);
|
||||
|
||||
GetTimeZoneInformation(&tz);
|
||||
|
||||
t -= tz.Bias*60;
|
||||
|
||||
return t;
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Get the offset for a named timezone. */
|
||||
int icaltime_utc_offset(struct icaltimetype ictt, const char* tzid)
|
||||
{
|
||||
icaltimezone *utc_zone, *local_zone;
|
||||
struct tm gtm;
|
||||
struct set_tz_save old_tz;
|
||||
|
||||
time_t tt = icaltime_as_timet(ictt);
|
||||
time_t offset_tt;
|
||||
|
||||
local_zone = icaltimezone_get_builtin_timezone(tzid);
|
||||
utc_zone = icaltimezone_get_utc_timezone ();
|
||||
|
||||
icaltimezone_get_utc_offset(local_zone, &ictt, ictt.is_daylight);
|
||||
|
||||
|
||||
#ifndef NO_WARN_DEPRECATED
|
||||
fprintf(stderr, "%s: %d: WARNING: icaltime_utc_offset is deprecated\n", __FILE__, __LINE__);
|
||||
#endif
|
||||
/* This function, combined with the set_tz/unset_tz calls in regression.c
|
||||
makes for very convoluted behaviour (due to the setting of the tz environment variable)
|
||||
arrghgh, at least this is what I think: benjaminlee */
|
||||
|
||||
if(tzid != 0){
|
||||
old_tz = set_tz(tzid);
|
||||
}
|
||||
|
||||
/* Mis-interpret a UTC broken out time as local time */
|
||||
gtm = *(gmtime(&tt));
|
||||
gtm.tm_isdst = localtime(&tt)->tm_isdst;
|
||||
offset_tt = mktime(>m);
|
||||
|
||||
if(tzid != 0){
|
||||
unset_tz(old_tz);
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifndef NO_WARN_DEPRECATED
|
||||
fprintf(stderr, "%s: %d: WARNING: offset %d tt-offset_tt %d\n", __FILE__, __LINE__, offset, tt-offset_tt);
|
||||
#endif
|
||||
assert(offset == tt-offset_tt);
|
||||
#endif
|
||||
return tt-offset_tt;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* Old conversion routines that use a string to represent the timezone
|
||||
***********************************************************************/
|
||||
|
||||
/* convert tt, of timezone tzid, into a utc time */
|
||||
struct icaltimetype icaltime_as_utc(struct icaltimetype tt,const char* tzid)
|
||||
{
|
||||
int tzid_offset;
|
||||
|
||||
if(tt.is_utc == 1 || tt.is_date == 1){
|
||||
return tt;
|
||||
}
|
||||
|
||||
tzid_offset = icaltime_utc_offset(tt,tzid);
|
||||
|
||||
tt.second -= tzid_offset;
|
||||
|
||||
tt.is_utc = 1;
|
||||
|
||||
#ifndef NO_WARN_DEPRECATED
|
||||
fprintf(stderr, "%s: %d: WARNING: icaltime_as_utc is deprecated: '%s'\n", __FILE__, __LINE__, tzid);
|
||||
#endif
|
||||
return icaltime_normalize(tt);
|
||||
}
|
||||
|
||||
/* convert tt, a time in UTC, into a time in timezone tzid */
|
||||
struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid)
|
||||
{
|
||||
int tzid_offset;
|
||||
|
||||
tzid_offset = icaltime_utc_offset(tt,tzid);
|
||||
|
||||
tt.second += tzid_offset;
|
||||
|
||||
tt.is_utc = 0;
|
||||
|
||||
#ifndef NO_WARN_DEPRECATED
|
||||
fprintf(stderr, "%s: %d: WARNING: icaltime_as_zone is deprecated: '%s'\n", __FILE__, __LINE__, tzid);
|
||||
#endif
|
||||
return icaltime_normalize(tt);
|
||||
|
||||
}
|
||||
|
||||
/* **********************************************************************/
|
||||
|
||||
|
||||
struct icaltimetype
|
||||
icaltime_from_timet(time_t tm, int is_date)
|
||||
{
|
||||
|
@ -77,87 +300,55 @@ icaltime_from_timet(time_t tm, int is_date)
|
|||
return tt;
|
||||
}
|
||||
|
||||
/* Structure used by set_tz to hold an old value of TZ, and the new
|
||||
value, which is in memory we will have to free in unset_tz */
|
||||
struct set_tz_save {char* orig_tzid; char* new_env_str;};
|
||||
|
||||
/* Temporarily change the TZ environmental variable. */
|
||||
struct set_tz_save set_tz(const char* tzid)
|
||||
struct icaltimetype
|
||||
icaltime_from_timet_with_zone(time_t tm, int is_date, icaltimezone *zone)
|
||||
{
|
||||
struct icaltimetype tt;
|
||||
struct tm t;
|
||||
icaltimezone *utc_zone;
|
||||
|
||||
char *orig_tzid = 0;
|
||||
char *new_env_str;
|
||||
struct set_tz_save savetz;
|
||||
size_t tmp_sz;
|
||||
utc_zone = icaltimezone_get_utc_timezone ();
|
||||
|
||||
savetz.orig_tzid = 0;
|
||||
savetz.new_env_str = 0;
|
||||
/* Convert the time_t to a struct tm in UTC time. We can trust gmtime
|
||||
for this. */
|
||||
t = *(gmtime(&tm));
|
||||
|
||||
tt.year = t.tm_year + 1900;
|
||||
tt.month = t.tm_mon + 1;
|
||||
tt.day = t.tm_mday;
|
||||
|
||||
if(getenv("TZ") != 0){
|
||||
orig_tzid = (char*)icalmemory_strdup(getenv("TZ"));
|
||||
tt.is_utc = (zone == utc_zone) ? 1 : 0;
|
||||
tt.is_date = is_date;
|
||||
tt.is_daylight = 0;
|
||||
tt.zone = NULL;
|
||||
|
||||
if(orig_tzid == 0){
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return savetz;
|
||||
}
|
||||
if (is_date) {
|
||||
/* We don't convert DATE values between timezones. */
|
||||
tt.hour = 0;
|
||||
tt.minute = 0;
|
||||
tt.second = 0;
|
||||
} else {
|
||||
tt.hour = t.tm_hour;
|
||||
tt.minute = t.tm_min;
|
||||
tt.second = t.tm_sec;
|
||||
|
||||
/* Use our timezone functions to convert to the required timezone. */
|
||||
icaltimezone_convert_time (&tt, utc_zone, zone);
|
||||
}
|
||||
|
||||
tmp_sz =strlen(tzid)+4;
|
||||
new_env_str = (char*)malloc(tmp_sz);
|
||||
|
||||
if(new_env_str == 0){
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return savetz;
|
||||
}
|
||||
|
||||
/* Copy the TZid into a string with the form that putenv expects. */
|
||||
strcpy(new_env_str,"TZ=");
|
||||
strcpy(new_env_str+3,tzid);
|
||||
|
||||
putenv(new_env_str);
|
||||
|
||||
/* Old value of TZ and the string we will have to free later */
|
||||
savetz.orig_tzid = orig_tzid;
|
||||
savetz.new_env_str = new_env_str;
|
||||
#ifdef WIN32
|
||||
_tzset();
|
||||
#endif
|
||||
|
||||
return savetz;
|
||||
return tt;
|
||||
}
|
||||
|
||||
void unset_tz(struct set_tz_save savetz)
|
||||
/* Returns the current time in the given timezone, as an icaltimetype. */
|
||||
struct icaltimetype icaltime_current_time_with_zone(icaltimezone *zone)
|
||||
{
|
||||
/* restore the original TZ environment */
|
||||
return icaltime_from_timet_with_zone (time (NULL), 0, zone);
|
||||
}
|
||||
|
||||
char* orig_tzid = savetz.orig_tzid;
|
||||
|
||||
if(orig_tzid!=0){
|
||||
size_t tmp_sz =strlen(orig_tzid)+4;
|
||||
char* orig_env_str = (char*)malloc(tmp_sz);
|
||||
|
||||
if(orig_env_str == 0){
|
||||
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy(orig_env_str,"TZ=");
|
||||
strcpy(orig_env_str+3,orig_tzid);
|
||||
|
||||
putenv(orig_env_str);
|
||||
|
||||
free(orig_tzid);
|
||||
} else {
|
||||
putenv("TZ"); /* Delete from environment */
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
_tzset();
|
||||
#endif
|
||||
|
||||
if(savetz.new_env_str != 0){
|
||||
free(savetz.new_env_str);
|
||||
}
|
||||
/* Returns the current day as an icaltimetype, with is_date set. */
|
||||
struct icaltimetype icaltime_today(void)
|
||||
{
|
||||
return icaltime_from_timet_with_zone (time (NULL), 1, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -165,7 +356,12 @@ time_t icaltime_as_timet(struct icaltimetype tt)
|
|||
{
|
||||
struct tm stm;
|
||||
time_t t;
|
||||
|
||||
#ifdef WIN32
|
||||
TIME_ZONE_INFORMATION tz;
|
||||
char * szZone;
|
||||
icaltimezone* zone;
|
||||
int offset_tt;
|
||||
#endif
|
||||
memset(&stm,0,sizeof( struct tm));
|
||||
|
||||
if(icaltime_is_null_time(tt)) {
|
||||
|
@ -181,23 +377,63 @@ time_t icaltime_as_timet(struct icaltimetype tt)
|
|||
stm.tm_isdst = -1;
|
||||
|
||||
if(tt.is_utc == 1 || tt.is_date == 1){
|
||||
#ifndef WIN32
|
||||
struct set_tz_save old_tz = set_tz("UTC");
|
||||
t = icaltimegm(&stm);
|
||||
} else {
|
||||
t = mktime(&stm);
|
||||
unset_tz(old_tz);
|
||||
#else
|
||||
t = mktime(&stm);
|
||||
_tzset();
|
||||
t -= _timezone;
|
||||
#ifdef WIN32
|
||||
/* Arg, mktime on Win32 always returns the time is localtime
|
||||
zone, so we'll figure out what time we are looking for and adjust it */
|
||||
|
||||
szZone = getenv("TZ");
|
||||
if ( szZone != NULL && strlen(szZone) != 0 ){
|
||||
GetTimeZoneInformation(&tz);
|
||||
zone = icaltimezone_get_builtin_timezone(szZone);
|
||||
offset_tt = icaltimezone_get_utc_offset_of_utc_time (zone,
|
||||
&tt,
|
||||
NULL);
|
||||
t += -offset_tt - tz.Bias*60;
|
||||
}
|
||||
|
||||
#endif
|
||||
} else {
|
||||
t = mktime(&stm);
|
||||
}
|
||||
|
||||
return t;
|
||||
|
||||
}
|
||||
|
||||
time_t icaltime_as_timet_with_zone(struct icaltimetype tt, icaltimezone *zone)
|
||||
{
|
||||
icaltimezone *utc_zone;
|
||||
struct tm stm;
|
||||
time_t t;
|
||||
|
||||
utc_zone = icaltimezone_get_utc_timezone ();
|
||||
|
||||
/* If the time is the special null time, return 0. */
|
||||
if (icaltime_is_null_time(tt)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Use our timezone functions to convert to UTC. */
|
||||
if (!tt.is_date)
|
||||
icaltimezone_convert_time (&tt, zone, utc_zone);
|
||||
|
||||
/* Copy the icaltimetype to a struct tm. */
|
||||
memset (&stm, 0, sizeof (struct tm));
|
||||
|
||||
stm.tm_sec = tt.second;
|
||||
stm.tm_min = tt.minute;
|
||||
stm.tm_hour = tt.hour;
|
||||
stm.tm_mday = tt.day;
|
||||
stm.tm_mon = tt.month-1;
|
||||
stm.tm_year = tt.year-1900;
|
||||
stm.tm_isdst = -1;
|
||||
|
||||
t = icaltimegm(&stm);
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
char* icaltime_as_ical_string(struct icaltimetype tt)
|
||||
{
|
||||
size_t size = 17;
|
||||
|
@ -222,110 +458,11 @@ char* icaltime_as_ical_string(struct icaltimetype tt)
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* convert tt, of timezone tzid, into a utc time */
|
||||
struct icaltimetype icaltime_as_utc(struct icaltimetype tt,const char* tzid)
|
||||
{
|
||||
int tzid_offset;
|
||||
|
||||
if(tt.is_utc == 1 || tt.is_date == 1){
|
||||
return tt;
|
||||
}
|
||||
|
||||
tzid_offset = icaltime_utc_offset(tt,tzid);
|
||||
|
||||
tt.second -= tzid_offset;
|
||||
|
||||
tt.is_utc = 1;
|
||||
|
||||
return icaltime_normalize(tt);
|
||||
}
|
||||
|
||||
/* convert tt, a time in UTC, into a time in timezone tzid */
|
||||
struct icaltimetype icaltime_as_zone(struct icaltimetype tt,const char* tzid)
|
||||
{
|
||||
int tzid_offset;
|
||||
|
||||
tzid_offset = icaltime_utc_offset(tt,tzid);
|
||||
|
||||
tt.second += tzid_offset;
|
||||
|
||||
tt.is_utc = 0;
|
||||
|
||||
return icaltime_normalize(tt);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* Return the offset of the named zone as seconds. tt is a time
|
||||
indicating the date for which you want the offset */
|
||||
int icaltime_utc_offset(struct icaltimetype ictt, const char* tzid)
|
||||
{
|
||||
|
||||
time_t tt = icaltime_as_timet(ictt);
|
||||
time_t offset_tt;
|
||||
struct tm gtm;
|
||||
struct set_tz_save old_tz;
|
||||
|
||||
if(tzid != 0){
|
||||
old_tz = set_tz(tzid);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
/* Mis-interpret a UTC broken out time as local time */
|
||||
gtm = *(gmtime(&tt));
|
||||
gtm.tm_isdst = localtime(&tt)->tm_isdst;
|
||||
offset_tt = mktime(>m);
|
||||
#else
|
||||
_tzset();
|
||||
offset_tt = _timezone;
|
||||
if ( localtime(&tt)->tm_isdst )
|
||||
offset_tt -= 3600;
|
||||
#endif
|
||||
if(tzid != 0){
|
||||
unset_tz(old_tz);
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
return tt-offset_tt;
|
||||
#else
|
||||
return -offset_tt;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Normalize by converting from localtime to utc and back to local
|
||||
time. This uses localtime because localtime and mktime are inverses
|
||||
of each other */
|
||||
/* Normalize the icaltime, so that all fields are within the normal range. */
|
||||
|
||||
struct icaltimetype icaltime_normalize(struct icaltimetype tt)
|
||||
{
|
||||
struct tm stm;
|
||||
time_t tut;
|
||||
|
||||
memset(&stm,0,sizeof( struct tm));
|
||||
|
||||
stm.tm_sec = tt.second;
|
||||
stm.tm_min = tt.minute;
|
||||
stm.tm_hour = tt.hour;
|
||||
stm.tm_mday = tt.day;
|
||||
stm.tm_mon = tt.month-1;
|
||||
stm.tm_year = tt.year-1900;
|
||||
stm.tm_isdst = -1; /* prevents mktime from changing hour based on
|
||||
daylight savings */
|
||||
|
||||
tut = mktime(&stm);
|
||||
|
||||
stm = *(localtime(&tut));
|
||||
|
||||
tt.second = stm.tm_sec;
|
||||
tt.minute = stm.tm_min;
|
||||
tt.hour = stm.tm_hour;
|
||||
tt.day = stm.tm_mday;
|
||||
tt.month = stm.tm_mon +1;
|
||||
tt.year = stm.tm_year+1900;
|
||||
|
||||
icaltime_adjust (&tt, 0, 0, 0, 0);
|
||||
return tt;
|
||||
}
|
||||
|
||||
|
@ -393,25 +530,30 @@ char* icaltime_as_ctime(struct icaltimetype t)
|
|||
return ctime_str;
|
||||
}
|
||||
|
||||
/* Returns whether the specified year is a leap year. Year is the normal year,
|
||||
e.g. 2001. */
|
||||
int
|
||||
icaltime_is_leap_year (int year)
|
||||
{
|
||||
|
||||
if (year <= 1752)
|
||||
return (year % 4 == 0);
|
||||
else
|
||||
return ( (year % 4==0) && (year % 100 !=0 )) || (year % 400 == 0);
|
||||
}
|
||||
|
||||
short days_in_month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
|
||||
|
||||
short icaltime_days_in_month(short month,short year)
|
||||
{
|
||||
|
||||
int is_leap =0;
|
||||
int days = days_in_month[month];
|
||||
|
||||
assert(month > 0);
|
||||
assert(month <= 12);
|
||||
|
||||
if( (year % 4 == 0 && year % 100 != 0) ||
|
||||
year % 400 == 0){
|
||||
is_leap =1;
|
||||
}
|
||||
|
||||
if( month == 2){
|
||||
days += is_leap;
|
||||
days += icaltime_is_leap_year(year);
|
||||
}
|
||||
|
||||
return days;
|
||||
|
@ -419,102 +561,131 @@ short icaltime_days_in_month(short month,short year)
|
|||
|
||||
/* 1-> Sunday, 7->Saturday */
|
||||
short icaltime_day_of_week(struct icaltimetype t){
|
||||
struct tm stm;
|
||||
|
||||
time_t tt = icaltime_as_timet(t);
|
||||
struct tm *tm;
|
||||
stm.tm_year = t.year - 1900;
|
||||
stm.tm_mon = t.month - 1;
|
||||
stm.tm_mday = t.day;
|
||||
stm.tm_hour = 0;
|
||||
stm.tm_min = 0;
|
||||
stm.tm_sec = 0;
|
||||
stm.tm_isdst = -1;
|
||||
|
||||
if(t.is_utc == 1){
|
||||
tm = gmtime(&tt);
|
||||
} else {
|
||||
tm = localtime(&tt);
|
||||
}
|
||||
mktime (&stm);
|
||||
|
||||
return tm->tm_wday+1;
|
||||
return stm.tm_wday + 1;
|
||||
}
|
||||
|
||||
/* Day of the year that the first day of the week (Sunday) is on */
|
||||
/* Day of the year that the first day of the week (Sunday) is on.
|
||||
FIXME: Doesn't take into account different week start days. */
|
||||
short icaltime_start_doy_of_week(struct icaltimetype t){
|
||||
time_t tt = icaltime_as_timet(t);
|
||||
time_t start_tt;
|
||||
struct tm *stm;
|
||||
int syear;
|
||||
struct tm stm;
|
||||
int start;
|
||||
|
||||
stm = gmtime(&tt);
|
||||
syear = stm->tm_year;
|
||||
stm.tm_year = t.year - 1900;
|
||||
stm.tm_mon = t.month - 1;
|
||||
stm.tm_mday = t.day;
|
||||
stm.tm_hour = 0;
|
||||
stm.tm_min = 0;
|
||||
stm.tm_sec = 0;
|
||||
stm.tm_isdst = -1;
|
||||
|
||||
start_tt = tt - stm->tm_wday*(60*60*24);
|
||||
mktime (&stm);
|
||||
|
||||
stm = gmtime(&start_tt);
|
||||
/* Move back to the start of the week. */
|
||||
stm.tm_mday -= stm.tm_wday;
|
||||
|
||||
if(syear == stm->tm_year){
|
||||
return stm->tm_yday+1;
|
||||
mktime (&stm);
|
||||
|
||||
|
||||
/* If we are still in the same year as the original date, we just return
|
||||
the day of the year. */
|
||||
if (t.year - 1900 == stm.tm_year){
|
||||
start = stm.tm_yday+1;
|
||||
} else {
|
||||
/* return negative to indicate that start of week is in
|
||||
previous year. */
|
||||
int is_leap = 0;
|
||||
int year = stm->tm_year;
|
||||
|
||||
if( (year % 4 == 0 && year % 100 != 0) ||
|
||||
year % 400 == 0){
|
||||
is_leap =1;
|
||||
}
|
||||
int is_leap = icaltime_is_leap_year(stm.tm_year+1900);
|
||||
|
||||
return (stm->tm_yday+1)-(365+is_leap);
|
||||
start = (stm.tm_yday+1)-(365+is_leap);
|
||||
}
|
||||
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
/* FIXME: Doesn't take into account the start day of the week. strftime assumes
|
||||
that weeks start on Monday. */
|
||||
short icaltime_week_number(struct icaltimetype ictt)
|
||||
{
|
||||
char str[5];
|
||||
time_t t = icaltime_as_timet(ictt);
|
||||
struct tm stm;
|
||||
int week_no;
|
||||
char str[8];
|
||||
|
||||
strftime(str,5,"%V", gmtime(&t));
|
||||
stm.tm_year = ictt.year - 1900;
|
||||
stm.tm_mon = ictt.month - 1;
|
||||
stm.tm_mday = ictt.day;
|
||||
stm.tm_hour = 0;
|
||||
stm.tm_min = 0;
|
||||
stm.tm_sec = 0;
|
||||
stm.tm_isdst = -1;
|
||||
|
||||
mktime (&stm);
|
||||
|
||||
strftime(str,5,"%V", &stm);
|
||||
|
||||
week_no = atoi(str);
|
||||
|
||||
return week_no;
|
||||
|
||||
}
|
||||
|
||||
/* The first array is for non-leap years, the seoncd for leap years*/
|
||||
static const short days_in_year[2][13] =
|
||||
{ /* jan feb mar apr may jun jul aug sep oct nov dec */
|
||||
{ 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
|
||||
{ 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
|
||||
};
|
||||
|
||||
/* Returns the day of the year, counting from 1 (Jan 1st). */
|
||||
short icaltime_day_of_year(struct icaltimetype t){
|
||||
time_t tt = icaltime_as_timet(t);
|
||||
struct tm *stm;
|
||||
int is_leap = icaltime_is_leap_year (t.year);
|
||||
|
||||
if(t.is_utc==1){
|
||||
stm = gmtime(&tt);
|
||||
} else {
|
||||
stm = localtime(&tt);
|
||||
}
|
||||
|
||||
return stm->tm_yday+1;
|
||||
|
||||
return days_in_year[is_leap][t.month - 1] + t.day;
|
||||
}
|
||||
|
||||
/* Jan 1 is day #1, not 0 */
|
||||
struct icaltimetype icaltime_from_day_of_year(short doy, short year)
|
||||
{
|
||||
struct tm stm;
|
||||
time_t tt;
|
||||
struct set_tz_save old_tz = set_tz("UTC");
|
||||
struct icaltimetype tt={0};
|
||||
int is_leap;
|
||||
int month;
|
||||
|
||||
/* Get the time of january 1 of this year*/
|
||||
memset(&stm,0,sizeof(struct tm));
|
||||
stm.tm_year = year-1900;
|
||||
stm.tm_mday = 1;
|
||||
is_leap = icaltime_is_leap_year(year);
|
||||
|
||||
tt = mktime(&stm);
|
||||
unset_tz(old_tz);
|
||||
/* Zero and neg numbers represent days of the previous year */
|
||||
if(doy <1){
|
||||
year--;
|
||||
is_leap = icaltime_is_leap_year(year);
|
||||
doy += days_in_year[is_leap][12];
|
||||
} else if(doy > days_in_year[is_leap][12]){
|
||||
/* Move on to the next year*/
|
||||
is_leap = icaltime_is_leap_year(year);
|
||||
doy -= days_in_year[is_leap][12];
|
||||
year++;
|
||||
}
|
||||
|
||||
tt.year = year;
|
||||
|
||||
/* Now add in the days */
|
||||
for (month = 11; month >= 0; month--) {
|
||||
if (doy > days_in_year[is_leap][month]) {
|
||||
tt.month = month + 1;
|
||||
tt.day = doy - days_in_year[is_leap][month];
|
||||
return tt;
|
||||
}
|
||||
}
|
||||
|
||||
doy--;
|
||||
tt += doy *60*60*24;
|
||||
|
||||
return icaltime_from_timet(tt, 1);
|
||||
/* Shouldn't reach here. */
|
||||
assert (0);
|
||||
}
|
||||
|
||||
struct icaltimetype icaltime_null_time()
|
||||
|
@ -547,45 +718,72 @@ int icaltime_is_null_time(struct icaltimetype t)
|
|||
|
||||
}
|
||||
|
||||
int icaltime_compare(struct icaltimetype a,struct icaltimetype b)
|
||||
int icaltime_compare(struct icaltimetype a, struct icaltimetype b)
|
||||
{
|
||||
time_t t1 = icaltime_as_timet(a);
|
||||
time_t t2 = icaltime_as_timet(b);
|
||||
int retval;
|
||||
|
||||
if (t1 > t2) {
|
||||
return 1;
|
||||
} else if (t1 < t2) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
if (a.year > b.year)
|
||||
retval = 1;
|
||||
else if (a.year < b.year)
|
||||
retval = -1;
|
||||
|
||||
else if (a.month > b.month)
|
||||
retval = 1;
|
||||
else if (a.month < b.month)
|
||||
retval = -1;
|
||||
|
||||
else if (a.day > b.day)
|
||||
retval = 1;
|
||||
else if (a.day < b.day)
|
||||
retval = -1;
|
||||
|
||||
else if (a.hour > b.hour)
|
||||
retval = 1;
|
||||
else if (a.hour < b.hour)
|
||||
retval = -1;
|
||||
|
||||
else if (a.minute > b.minute)
|
||||
retval = 1;
|
||||
else if (a.minute < b.minute)
|
||||
retval = -1;
|
||||
|
||||
else if (a.second > b.second)
|
||||
retval = 1;
|
||||
else if (a.second < b.second)
|
||||
retval = -1;
|
||||
|
||||
else
|
||||
retval = 0;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int
|
||||
icaltime_compare_date_only (struct icaltimetype a, struct icaltimetype b)
|
||||
{
|
||||
time_t t1;
|
||||
time_t t2;
|
||||
int retval;
|
||||
|
||||
if (a.year == b.year && a.month == b.month && a.day == b.day)
|
||||
return 0;
|
||||
if (a.year > b.year)
|
||||
retval = 1;
|
||||
else if (a.year < b.year)
|
||||
retval = -1;
|
||||
|
||||
t1 = icaltime_as_timet (a);
|
||||
t2 = icaltime_as_timet (b);
|
||||
else if (a.month > b.month)
|
||||
retval = 1;
|
||||
else if (a.month < b.month)
|
||||
retval = -1;
|
||||
|
||||
if (t1 > t2)
|
||||
return 1;
|
||||
else if (t1 < t2)
|
||||
return -1;
|
||||
else {
|
||||
/* not reached */
|
||||
assert (0);
|
||||
return 0;
|
||||
}
|
||||
else if (a.day > b.day)
|
||||
retval = 1;
|
||||
else if (a.day < b.day)
|
||||
retval = -1;
|
||||
|
||||
else
|
||||
retval = 0;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/* These are defined in icalduration.c:
|
||||
struct icaltimetype icaltime_add(struct icaltimetype t,
|
||||
struct icaldurationtype d)
|
||||
|
@ -593,3 +791,90 @@ struct icaldurationtype icaltime_subtract(struct icaltimetype t1,
|
|||
struct icaltimetype t2)
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Adds (or subtracts) a time from a icaltimetype.
|
||||
NOTE: This function is exactly the same as icaltimezone_adjust_change()
|
||||
except for the type of the first parameter. */
|
||||
void
|
||||
icaltime_adjust (struct icaltimetype *tt,
|
||||
int days,
|
||||
int hours,
|
||||
int minutes,
|
||||
int seconds)
|
||||
{
|
||||
int second, minute, hour, day;
|
||||
int minutes_overflow, hours_overflow, days_overflow, years_overflow;
|
||||
int days_in_month;
|
||||
|
||||
/* Add on the seconds. */
|
||||
second = tt->second + seconds;
|
||||
tt->second = second % 60;
|
||||
minutes_overflow = second / 60;
|
||||
if (tt->second < 0) {
|
||||
tt->second += 60;
|
||||
minutes_overflow--;
|
||||
}
|
||||
|
||||
/* Add on the minutes. */
|
||||
minute = tt->minute + minutes + minutes_overflow;
|
||||
tt->minute = minute % 60;
|
||||
hours_overflow = minute / 60;
|
||||
if (tt->minute < 0) {
|
||||
tt->minute += 60;
|
||||
hours_overflow--;
|
||||
}
|
||||
|
||||
/* Add on the hours. */
|
||||
hour = tt->hour + hours + hours_overflow;
|
||||
tt->hour = hour % 24;
|
||||
days_overflow = hour / 24;
|
||||
if (tt->hour < 0) {
|
||||
tt->hour += 24;
|
||||
days_overflow--;
|
||||
}
|
||||
|
||||
/* Normalize the month. We do this before handling the day since we may
|
||||
need to know what month it is to get the number of days in it.
|
||||
Note that months are 1 to 12, so we have to be a bit careful. */
|
||||
if (tt->month >= 13) {
|
||||
years_overflow = (tt->month - 1) / 12;
|
||||
tt->year += years_overflow;
|
||||
tt->month -= years_overflow * 12;
|
||||
} else if (tt->month <= 0) {
|
||||
/* 0 to -11 is -1 year out, -12 to -23 is -2 years. */
|
||||
years_overflow = (tt->month / 12) - 1;
|
||||
tt->year += years_overflow;
|
||||
tt->month -= years_overflow * 12;
|
||||
}
|
||||
|
||||
/* Add on the days. */
|
||||
day = tt->day + days + days_overflow;
|
||||
if (day > 0) {
|
||||
for (;;) {
|
||||
days_in_month = icaltime_days_in_month (tt->month, tt->year);
|
||||
if (day <= days_in_month)
|
||||
break;
|
||||
|
||||
tt->month++;
|
||||
if (tt->month >= 13) {
|
||||
tt->year++;
|
||||
tt->month = 1;
|
||||
}
|
||||
|
||||
day -= days_in_month;
|
||||
}
|
||||
} else {
|
||||
while (day <= 0) {
|
||||
if (tt->month == 1) {
|
||||
tt->year--;
|
||||
tt->month = 12;
|
||||
} else {
|
||||
tt->month--;
|
||||
}
|
||||
|
||||
day += icaltime_days_in_month (tt->month, tt->year);
|
||||
}
|
||||
}
|
||||
tt->day = day;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 02 June 2000
|
||||
|
||||
|
||||
$Id: icaltime.h,v 1.1 2001-11-15 19:27:10 mikep%oeone.com Exp $
|
||||
$Id: icaltime.h,v 1.2 2001-12-21 18:56:27 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -31,6 +31,13 @@
|
|||
|
||||
#include <time.h>
|
||||
|
||||
/* An opaque struct representing a timezone. We declare this here to avoid
|
||||
a circular dependancy. */
|
||||
#ifndef ICALTIMEONE_DEFINED
|
||||
#define ICALTIMEONE_DEFINED
|
||||
typedef struct _icaltimezone icaltimezone;
|
||||
#endif
|
||||
|
||||
/* icaltime_span is returned by icalcomponent_get_span() */
|
||||
struct icaltime_span {
|
||||
time_t start; /* in UTC */
|
||||
|
@ -41,8 +48,8 @@ struct icaltime_span {
|
|||
|
||||
struct icaltimetype
|
||||
{
|
||||
int year;
|
||||
int month;
|
||||
int year; /* Actual year, e.g. 2001. */
|
||||
int month; /* 1 (Jan) to 12 (Dec). */
|
||||
int day;
|
||||
int hour;
|
||||
int minute;
|
||||
|
@ -52,15 +59,30 @@ struct icaltimetype
|
|||
|
||||
int is_date; /* 1 -> interpret this as date. */
|
||||
|
||||
int is_daylight; /* 1 -> time is in daylight savings time. */
|
||||
|
||||
const char* zone; /*Ptr to Olsen placename. Libical does not own mem*/
|
||||
};
|
||||
|
||||
/* Convert seconds past UNIX epoch to a timetype*/
|
||||
struct icaltimetype icaltime_from_timet(time_t v, int is_date);
|
||||
|
||||
/* Newer version of above, using timezones. */
|
||||
struct icaltimetype icaltime_from_timet_with_zone(time_t tm, int is_date,
|
||||
icaltimezone *zone);
|
||||
|
||||
/* Returns the current time in the given timezone, as an icaltimetype. */
|
||||
struct icaltimetype icaltime_current_time_with_zone(icaltimezone *zone);
|
||||
|
||||
/* Returns the current day as an icaltimetype, with is_date set. */
|
||||
struct icaltimetype icaltime_today(void);
|
||||
|
||||
/* Return the time as seconds past the UNIX epoch */
|
||||
time_t icaltime_as_timet(struct icaltimetype);
|
||||
|
||||
/* Newer version of above, using timezones. */
|
||||
time_t icaltime_as_timet_with_zone(struct icaltimetype tt, icaltimezone *zone);
|
||||
|
||||
/* Return a string represention of the time, in RFC2445 format. The
|
||||
string is owned by libical */
|
||||
char* icaltime_as_ical_string(struct icaltimetype tt);
|
||||
|
@ -75,6 +97,11 @@ int icaltime_as_int(struct icaltimetype);
|
|||
/* create a time from an ISO format string */
|
||||
struct icaltimetype icaltime_from_string(const char* str);
|
||||
|
||||
|
||||
/* begin WARNING !! DEPRECATED !! functions *****
|
||||
use new icaltimezone functions, see icaltimezone.h
|
||||
*/
|
||||
|
||||
/* Routines for handling timezones */
|
||||
/* Return the offset of the named zone as seconds. tt is a time
|
||||
indicating the date for which you want the offset */
|
||||
|
@ -89,6 +116,11 @@ struct icaltimetype icaltime_as_utc(struct icaltimetype tt,
|
|||
struct icaltimetype icaltime_as_zone(struct icaltimetype tt,
|
||||
const char* tzid);
|
||||
|
||||
/* end WARNING !! DEPRECATED !! functions *****
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Return a null time, which indicates no time has been set. This time represent the beginning of the epoch */
|
||||
struct icaltimetype icaltime_null_time(void);
|
||||
|
||||
|
@ -138,6 +170,9 @@ int icaltime_compare_date_only(struct icaltimetype a, struct icaltimetype b);
|
|||
/* Return the number of days in the given month */
|
||||
short icaltime_days_in_month(short month,short year);
|
||||
|
||||
/* Adds or subtracts a number of days, hours, minutes and seconds. */
|
||||
void icaltime_adjust(struct icaltimetype *tt, int days, int hours,
|
||||
int minutes, int seconds);
|
||||
|
||||
#endif /* !ICALTIME_H */
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icaltypes.c
|
||||
CREATOR: eric 16 May 1999
|
||||
|
||||
$Id: icaltypes.c,v 1.2 2001-11-22 19:21:50 mikep%oeone.com Exp $
|
||||
$Id: icaltypes.c,v 1.3 2001-12-21 18:56:27 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
|
||||
|
@ -34,10 +34,11 @@
|
|||
#include <errno.h> /* for errno */
|
||||
#include <string.h> /* for icalmemory_strdup */
|
||||
#include <assert.h>
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#define TEMP_MAX 1024
|
||||
|
||||
|
@ -152,13 +153,23 @@ void* icalattachtype_get_binary(struct icalattachtype* v)
|
|||
return v->binary;
|
||||
}
|
||||
|
||||
int icaltriggertype_is_null_trigger(struct icaltriggertype tr)
|
||||
{
|
||||
if(icaltime_is_null_time(tr.time) &&
|
||||
icaldurationtype_is_null_duration(tr.duration)){
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct icaltriggertype icaltriggertype_from_string(const char* str)
|
||||
{
|
||||
|
||||
|
||||
struct icaltriggertype tr, null_tr;
|
||||
int old_ieaf = icalerror_errors_are_fatal;
|
||||
icalerrorstate es;
|
||||
icalerrorenum e;
|
||||
|
||||
tr.time= icaltime_null_time();
|
||||
tr.duration = icaldurationtype_from_int(0);
|
||||
|
@ -167,13 +178,14 @@ struct icaltriggertype icaltriggertype_from_string(const char* str)
|
|||
|
||||
if(str == 0) goto error;
|
||||
|
||||
|
||||
icalerror_errors_are_fatal = 0;
|
||||
/* Surpress errors so a failure in icaltime_from_string() does not cause an abort */
|
||||
es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR);
|
||||
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL);
|
||||
e = icalerrno;
|
||||
icalerror_set_errno(ICAL_NO_ERROR);
|
||||
|
||||
tr.time = icaltime_from_string(str);
|
||||
|
||||
icalerror_errors_are_fatal = old_ieaf;
|
||||
|
||||
if (icaltime_is_null_time(tr.time)){
|
||||
|
||||
tr.duration = icaldurationtype_from_string(str);
|
||||
|
@ -181,18 +193,21 @@ struct icaltriggertype icaltriggertype_from_string(const char* str)
|
|||
if(icaldurationtype_as_int(tr.duration) == 0) goto error;
|
||||
}
|
||||
|
||||
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
|
||||
icalerror_set_errno(e);
|
||||
return tr;
|
||||
|
||||
error:
|
||||
icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return null_tr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct icalreqstattype icalreqstattype_from_string(char* str)
|
||||
struct icalreqstattype icalreqstattype_from_string(const char* str)
|
||||
{
|
||||
char *p1,*p2;
|
||||
const char *p1,*p2;
|
||||
struct icalreqstattype stat;
|
||||
int major, minor;
|
||||
|
||||
|
@ -207,14 +222,14 @@ struct icalreqstattype icalreqstattype_from_string(char* str)
|
|||
sscanf(str, "%d.%d",&major, &minor);
|
||||
|
||||
if (major <= 0 || minor < 0){
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return stat;
|
||||
}
|
||||
|
||||
stat.code = icalenum_num_to_reqstat(major, minor);
|
||||
|
||||
if (stat.code == ICAL_UNKNOWN_STATUS){
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return stat;
|
||||
}
|
||||
|
||||
|
@ -240,7 +255,7 @@ struct icalreqstattype icalreqstattype_from_string(char* str)
|
|||
|
||||
}
|
||||
|
||||
char* icalreqstattype_as_string(struct icalreqstattype stat)
|
||||
const char* icalreqstattype_as_string(struct icalreqstattype stat)
|
||||
{
|
||||
char *temp;
|
||||
|
||||
|
|
|
@ -1,136 +0,0 @@
|
|||
/* -*- Mode: C -*- */
|
||||
/*======================================================================
|
||||
FILE: icaltypes.h
|
||||
CREATOR: eric 20 March 1999
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of either:
|
||||
|
||||
The LGPL as published by the Free Software Foundation, version
|
||||
2.1, available at: http://www.fsf.org/copyleft/lesser.html
|
||||
|
||||
Or:
|
||||
|
||||
The Mozilla Public License Version 1.0. You may obtain a copy of
|
||||
the License at http://www.mozilla.org/MPL/
|
||||
|
||||
The original code is icaltypes.h
|
||||
|
||||
======================================================================*/
|
||||
|
||||
#ifndef ICALTYPES_H
|
||||
#define ICALTYPES_H
|
||||
|
||||
#include <time.h>
|
||||
#include "icalenums.h"
|
||||
#include "icaltime.h"
|
||||
#include "icalduration.h"
|
||||
#include "icalperiod.h"
|
||||
|
||||
|
||||
/* This type type should probably be an opaque type... */
|
||||
struct icalattachtype
|
||||
{
|
||||
void* binary;
|
||||
int owns_binary;
|
||||
|
||||
char* base64;
|
||||
int owns_base64;
|
||||
|
||||
char* url;
|
||||
|
||||
int refcount;
|
||||
|
||||
};
|
||||
|
||||
/* converts base64 to binary, fetches url and stores as binary, or
|
||||
just returns data */
|
||||
|
||||
struct icalattachtype* icalattachtype_new(void);
|
||||
void icalattachtype_add_reference(struct icalattachtype* v);
|
||||
void icalattachtype_free(struct icalattachtype* v);
|
||||
|
||||
void icalattachtype_set_url(struct icalattachtype* v, char* url);
|
||||
char* icalattachtype_get_url(struct icalattachtype* v);
|
||||
|
||||
void icalattachtype_set_base64(struct icalattachtype* v, char* base64,
|
||||
int owns);
|
||||
char* icalattachtype_get_base64(struct icalattachtype* v);
|
||||
|
||||
void icalattachtype_set_binary(struct icalattachtype* v, char* binary,
|
||||
int owns);
|
||||
void* icalattachtype_get_binary(struct icalattachtype* v);
|
||||
|
||||
struct icalgeotype
|
||||
{
|
||||
float lat;
|
||||
float lon;
|
||||
};
|
||||
|
||||
|
||||
struct icaldatetimeperiodtype
|
||||
{
|
||||
struct icaltimetype time;
|
||||
struct icalperiodtype period;
|
||||
};
|
||||
|
||||
|
||||
struct icaltriggertype
|
||||
{
|
||||
struct icaltimetype time;
|
||||
struct icaldurationtype duration;
|
||||
};
|
||||
|
||||
struct icaltriggertype icaltriggertype_from_string(const char* str);
|
||||
|
||||
/* struct icalreqstattype. This struct contains two string pointers,
|
||||
but don't try to free either of them. The "desc" string is a pointer
|
||||
to a static table inside the library. Don't try to free it. The
|
||||
"debug" string is a pointer into the string that the called passed
|
||||
into to icalreqstattype_from_string. Don't try to free it either, and
|
||||
don't use it after the original string has been freed.
|
||||
|
||||
BTW, you would get that original string from
|
||||
*icalproperty_get_requeststatus() or icalvalue_get_text(), when
|
||||
operating on a the value of a request_status property. */
|
||||
|
||||
struct icalreqstattype {
|
||||
|
||||
icalrequeststatus code;
|
||||
const char* desc;
|
||||
const char* debug;
|
||||
};
|
||||
|
||||
struct icalreqstattype icalreqstattype_from_string(char* str);
|
||||
char* icalreqstattype_as_string(struct icalreqstattype);
|
||||
|
||||
|
||||
|
||||
struct icaltimezonephase {
|
||||
const char* tzname;
|
||||
int is_stdandard; /* 1 = standard tme, 0 = daylight savings time */
|
||||
struct icaltimetype dtstart;
|
||||
int offsetto;
|
||||
int tzoffsetfrom;
|
||||
const char* comment;
|
||||
struct icaldatetimeperiodtype rdate;
|
||||
const char* rrule;
|
||||
};
|
||||
|
||||
|
||||
struct icaltimezonetype {
|
||||
const char* tzid;
|
||||
struct icaltimetype last_mod;
|
||||
const char* tzurl;
|
||||
|
||||
/* Array of phases. The end of the array is a phase with tzname == 0 */
|
||||
struct icaltimezonephase *phases;
|
||||
};
|
||||
|
||||
void icaltimezonetype_free(struct icaltimezonetype tzt);
|
||||
|
||||
|
||||
#endif /* !ICALTYPES_H */
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalvalue.c
|
||||
CREATOR: eric 02 May 1999
|
||||
|
||||
$Id: icalvalue.c,v 1.2 2001-11-22 19:21:50 mikep%oeone.com Exp $
|
||||
$Id: icalvalue.c,v 1.3 2001-12-21 18:56:28 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -45,10 +45,11 @@
|
|||
#include <time.h> /* for mktime */
|
||||
#include <stdlib.h> /* for atoi and atof */
|
||||
#include <limits.h> /* for SHRT_MAX */
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#if _MAC_OS_
|
||||
#include "icalmemory_strdup.h"
|
||||
|
@ -185,18 +186,39 @@ char* icalmemory_strdup_and_dequote(const char* str)
|
|||
|
||||
}
|
||||
case 'n':
|
||||
{
|
||||
*pout = '\n';
|
||||
break;
|
||||
}
|
||||
case 'N':
|
||||
{
|
||||
*pout = '\n';
|
||||
break;
|
||||
}
|
||||
case '\\':
|
||||
case ',':
|
||||
case 't':
|
||||
case 'T':
|
||||
{
|
||||
*pout = '\t';
|
||||
break;
|
||||
}
|
||||
case 'r':
|
||||
case 'R':
|
||||
{
|
||||
*pout = '\r';
|
||||
break;
|
||||
}
|
||||
case 'b':
|
||||
case 'B':
|
||||
{
|
||||
*pout = '\b';
|
||||
break;
|
||||
}
|
||||
case 'f':
|
||||
case 'F':
|
||||
{
|
||||
*pout = '\f';
|
||||
break;
|
||||
}
|
||||
case ';':
|
||||
case ',':
|
||||
case '"':
|
||||
case '\\':
|
||||
{
|
||||
*pout = *p;
|
||||
break;
|
||||
|
@ -336,7 +358,7 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
case ICAL_GEO_VALUE:
|
||||
{
|
||||
value = 0;
|
||||
|
@ -346,56 +368,59 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
|
|||
char temp[TMP_BUF_SIZE];
|
||||
sprintf(temp,"GEO Values are not implemented");
|
||||
*error = icalproperty_vanew_xlicerror(
|
||||
temp,
|
||||
icalparameter_new_xlicerrortype(
|
||||
ICAL_XLICERRORTYPE_VALUEPARSEERROR),
|
||||
0);
|
||||
temp,
|
||||
icalparameter_new_xlicerrortype(
|
||||
ICAL_XLICERRORTYPE_VALUEPARSEERROR),
|
||||
0);
|
||||
}
|
||||
|
||||
|
||||
/*icalerror_warn("Parsing GEO properties is unimplmeneted");*/
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ICAL_RECUR_VALUE:
|
||||
|
||||
case ICAL_RECUR_VALUE:
|
||||
{
|
||||
struct icalrecurrencetype rt;
|
||||
rt = icalrecurrencetype_from_string(str);
|
||||
value = icalvalue_new_recur(rt);
|
||||
if(rt.freq != ICAL_NO_RECURRENCE){
|
||||
value = icalvalue_new_recur(rt);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ICAL_TIME_VALUE:
|
||||
case ICAL_DATE_VALUE:
|
||||
case ICAL_DATETIME_VALUE:
|
||||
case ICAL_DATETIMEDATE_VALUE:
|
||||
|
||||
case ICAL_DATE_VALUE:
|
||||
case ICAL_DATETIME_VALUE:
|
||||
{
|
||||
struct icaltimetype tt;
|
||||
|
||||
tt = icaltime_from_string(str);
|
||||
if(!icaltime_is_null_time(tt)){
|
||||
value = icalvalue_new_impl(kind);
|
||||
value->data.v_time = tt;
|
||||
|
||||
icalvalue_reset_kind(value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ICAL_DATETIMEPERIOD_VALUE:
|
||||
|
||||
case ICAL_DATETIMEPERIOD_VALUE:
|
||||
{
|
||||
struct icaltimetype tt;
|
||||
struct icalperiodtype p;
|
||||
tt = icaltime_from_string(str);
|
||||
p = icalperiodtype_from_string(str);
|
||||
|
||||
|
||||
if(!icaltime_is_null_time(tt)){
|
||||
value = icalvalue_new_datetime(tt);
|
||||
} else if (!icalperiodtype_is_null_period(p)){
|
||||
value = icalvalue_new_period(p);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ICAL_DURATION_VALUE:
|
||||
|
||||
case ICAL_DURATION_VALUE:
|
||||
{
|
||||
struct icaldurationtype dur = icaldurationtype_from_string(str);
|
||||
|
||||
|
@ -404,34 +429,45 @@ icalvalue* icalvalue_new_from_string_with_error(icalvalue_kind kind,const char*
|
|||
} else {
|
||||
value = icalvalue_new_duration(dur);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case ICAL_PERIOD_VALUE:
|
||||
|
||||
case ICAL_PERIOD_VALUE:
|
||||
{
|
||||
struct icalperiodtype p;
|
||||
p = icalperiodtype_from_string(str);
|
||||
|
||||
if(!icalperiodtype_is_null_period(p)){
|
||||
value = icalvalue_new_period(p);
|
||||
}
|
||||
break;
|
||||
struct icalperiodtype p;
|
||||
p = icalperiodtype_from_string(str);
|
||||
|
||||
if(!icalperiodtype_is_null_period(p)){
|
||||
value = icalvalue_new_period(p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ICAL_TRIGGER_VALUE:
|
||||
case ICAL_TRIGGER_VALUE:
|
||||
{
|
||||
struct icaltriggertype tr = icaltriggertype_from_string(str);
|
||||
value = icalvalue_new_trigger(tr);
|
||||
if (!icaltriggertype_is_null_trigger(tr)){
|
||||
value = icalvalue_new_trigger(tr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ICAL_REQUESTSTATUS_VALUE:
|
||||
{
|
||||
struct icalreqstattype rst = icalreqstattype_from_string(str);
|
||||
if(rst.code != ICAL_UNKNOWN_STATUS){
|
||||
value = icalvalue_new_requeststatus(rst);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
if (error != 0 ){
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
||||
if (error != 0 ){
|
||||
char temp[TMP_BUF_SIZE];
|
||||
|
||||
|
||||
snprintf(temp,TMP_BUF_SIZE,"Unknown type for \'%s\'",str);
|
||||
|
||||
*error = icalproperty_vanew_xlicerror(
|
||||
|
@ -668,6 +704,8 @@ char* icalvalue_text_as_ical_string(icalvalue* value) {
|
|||
break;
|
||||
}
|
||||
|
||||
/* case '\\':
|
||||
case '"': */
|
||||
case ';':
|
||||
case ',':{
|
||||
icalmemory_append_char(&str,&str_p,&buf_sz,'\\');
|
||||
|
@ -676,13 +714,6 @@ char* icalvalue_text_as_ical_string(icalvalue* value) {
|
|||
break;
|
||||
}
|
||||
|
||||
case '"':{
|
||||
icalmemory_append_char(&str,&str_p,&buf_sz,'\\');
|
||||
icalmemory_append_char(&str,&str_p,&buf_sz,*p);
|
||||
line_length+=3;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
icalmemory_append_char(&str,&str_p,&buf_sz,*p);
|
||||
line_length++;
|
||||
|
@ -735,7 +766,7 @@ char* icalvalue_attach_as_ical_string(icalvalue* value) {
|
|||
} else if (a.url != 0){
|
||||
return icalvalue_string_as_ical_string(value);
|
||||
} else {
|
||||
icalerrno = ICAL_MALFORMEDDATA_ERROR;
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -765,21 +796,6 @@ void print_time_to_string(char* str, struct icaltimetype *data)
|
|||
}
|
||||
|
||||
|
||||
char* icalvalue_time_as_ical_string(icalvalue* value) {
|
||||
|
||||
struct icaltimetype data;
|
||||
char* str;
|
||||
icalerror_check_arg_rz( (value!=0),"value");
|
||||
data = icalvalue_get_time(value);
|
||||
|
||||
str = (char*)icalmemory_tmp_buffer(8);
|
||||
|
||||
str[0] = 0;
|
||||
print_time_to_string(str,&data);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
void print_date_to_string(char* str, struct icaltimetype *data)
|
||||
{
|
||||
char temp[20];
|
||||
|
@ -821,10 +837,7 @@ const char* icalvalue_datetime_as_ical_string(icalvalue* value) {
|
|||
icalerror_check_arg_rz( (value!=0),"value");
|
||||
|
||||
|
||||
if( !(kind == ICAL_DATETIMEDATE_VALUE ||
|
||||
kind == ICAL_DATE_VALUE ||
|
||||
kind == ICAL_DATETIME_VALUE ||
|
||||
kind == ICAL_TIME_VALUE))
|
||||
if( !(kind == ICAL_DATE_VALUE || kind == ICAL_DATETIME_VALUE ))
|
||||
{
|
||||
icalerror_set_errno(ICAL_BADARG_ERROR);
|
||||
return 0;
|
||||
|
@ -842,21 +855,6 @@ const char* icalvalue_datetime_as_ical_string(icalvalue* value) {
|
|||
|
||||
}
|
||||
|
||||
|
||||
const char* icalvalue_datetimedate_as_ical_string(icalvalue* value) {
|
||||
|
||||
struct icaltimetype data;
|
||||
icalerror_check_arg_rz( (value!=0),"value");
|
||||
data = icalvalue_get_datetime(value);
|
||||
|
||||
if (data.is_date == 1){
|
||||
return icalvalue_date_as_ical_string(value);
|
||||
} else {
|
||||
return icalvalue_datetime_as_ical_string(value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char* icalvalue_float_as_ical_string(icalvalue* value) {
|
||||
|
||||
float data;
|
||||
|
@ -960,12 +958,8 @@ icalvalue_as_ical_string (icalvalue* value)
|
|||
return icalvalue_date_as_ical_string(value);
|
||||
case ICAL_DATETIME_VALUE:
|
||||
return icalvalue_datetime_as_ical_string(value);
|
||||
case ICAL_DATETIMEDATE_VALUE:
|
||||
return icalvalue_datetimedate_as_ical_string(value);
|
||||
case ICAL_DURATION_VALUE:
|
||||
return icalvalue_duration_as_ical_string(value);
|
||||
case ICAL_TIME_VALUE:
|
||||
return icalvalue_time_as_ical_string(value);
|
||||
|
||||
case ICAL_PERIOD_VALUE:
|
||||
return icalvalue_period_as_ical_string(value);
|
||||
|
@ -983,6 +977,9 @@ icalvalue_as_ical_string (icalvalue* value)
|
|||
|
||||
case ICAL_TRIGGER_VALUE:
|
||||
return icalvalue_trigger_as_ical_string(value);
|
||||
|
||||
case ICAL_REQUESTSTATUS_VALUE:
|
||||
return icalreqstattype_as_string(v->data.v_requeststatus);
|
||||
|
||||
case ICAL_ACTION_VALUE:
|
||||
case ICAL_METHOD_VALUE:
|
||||
|
@ -1038,10 +1035,8 @@ icalvalue_isa_value (void* value)
|
|||
int icalvalue_is_time(icalvalue* a) {
|
||||
icalvalue_kind kind = icalvalue_isa(a);
|
||||
|
||||
if(kind == ICAL_DATETIMEDATE_VALUE ||
|
||||
kind == ICAL_DATETIME_VALUE ||
|
||||
kind == ICAL_DATE_VALUE ||
|
||||
kind == ICAL_TIME_VALUE ){
|
||||
if(kind == ICAL_DATETIME_VALUE ||
|
||||
kind == ICAL_DATE_VALUE ){
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1122,8 +1117,6 @@ icalvalue_compare(icalvalue* a, icalvalue *b)
|
|||
case ICAL_TRIGGER_VALUE:
|
||||
case ICAL_DATE_VALUE:
|
||||
case ICAL_DATETIME_VALUE:
|
||||
case ICAL_DATETIMEDATE_VALUE:
|
||||
case ICAL_TIME_VALUE:
|
||||
case ICAL_DATETIMEPERIOD_VALUE:
|
||||
{
|
||||
int r;
|
||||
|
@ -1175,6 +1168,23 @@ icalvalue_compare(icalvalue* a, icalvalue *b)
|
|||
|
||||
}
|
||||
|
||||
/* Examine the value and possiby chage the kind to agree with the value */
|
||||
void icalvalue_reset_kind(icalvalue* value)
|
||||
{
|
||||
struct icalvalue_impl* impl = (struct icalvalue_impl*)value;
|
||||
|
||||
if( (impl->kind==ICAL_DATETIME_VALUE || impl->kind==ICAL_DATE_VALUE )&&
|
||||
!icaltime_is_null_time(impl->data.v_time) ) {
|
||||
|
||||
if( impl->data.v_time.is_date == 1){
|
||||
impl->kind = ICAL_DATE_VALUE;
|
||||
} else {
|
||||
impl->kind = ICAL_DATETIME_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void icalvalue_set_parent(icalvalue* value,
|
||||
icalproperty* property)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalvalue.c
|
||||
CREATOR: eric 02 May 1999
|
||||
|
||||
$Id: icalvalueimpl.h,v 1.1 2001-11-15 19:27:11 mikep%oeone.com Exp $
|
||||
$Id: icalvalueimpl.h,v 1.2 2001-12-21 18:56:28 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -68,6 +68,8 @@ struct icalvalue_impl {
|
|||
/*struct icaltimetype v_datetime;*/
|
||||
/*struct icaltimetype v_datetimedate;*/
|
||||
|
||||
struct icalreqstattype v_requeststatus;
|
||||
|
||||
/* struct icalrecurrencetype was once included
|
||||
directly ( not referenced ) in this union, but it
|
||||
contributes 2000 bytes to every value, so now it is
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,137 +0,0 @@
|
|||
typedef union {
|
||||
float v_float;
|
||||
int v_int;
|
||||
char* v_string;
|
||||
} YYSTYPE;
|
||||
#define DIGITS 257
|
||||
#define INTNUMBER 258
|
||||
#define FLOATNUMBER 259
|
||||
#define STRING 260
|
||||
#define EOL 261
|
||||
#define EQUALS 262
|
||||
#define CHARACTER 263
|
||||
#define COLON 264
|
||||
#define COMMA 265
|
||||
#define SEMICOLON 266
|
||||
#define MINUS 267
|
||||
#define TIMESEPERATOR 268
|
||||
#define TRUE 269
|
||||
#define FALSE 270
|
||||
#define FREQ 271
|
||||
#define BYDAY 272
|
||||
#define BYHOUR 273
|
||||
#define BYMINUTE 274
|
||||
#define BYMONTH 275
|
||||
#define BYMONTHDAY 276
|
||||
#define BYSECOND 277
|
||||
#define BYSETPOS 278
|
||||
#define BYWEEKNO 279
|
||||
#define BYYEARDAY 280
|
||||
#define DAILY 281
|
||||
#define MINUTELY 282
|
||||
#define MONTHLY 283
|
||||
#define SECONDLY 284
|
||||
#define WEEKLY 285
|
||||
#define HOURLY 286
|
||||
#define YEARLY 287
|
||||
#define INTERVAL 288
|
||||
#define COUNT 289
|
||||
#define UNTIL 290
|
||||
#define WKST 291
|
||||
#define MO 292
|
||||
#define SA 293
|
||||
#define SU 294
|
||||
#define TU 295
|
||||
#define WE 296
|
||||
#define TH 297
|
||||
#define FR 298
|
||||
#define BIT8 299
|
||||
#define ACCEPTED 300
|
||||
#define ADD 301
|
||||
#define AUDIO 302
|
||||
#define BASE64 303
|
||||
#define BINARY 304
|
||||
#define BOOLEAN 305
|
||||
#define BUSY 306
|
||||
#define BUSYTENTATIVE 307
|
||||
#define BUSYUNAVAILABLE 308
|
||||
#define CALADDRESS 309
|
||||
#define CANCEL 310
|
||||
#define CANCELLED 311
|
||||
#define CHAIR 312
|
||||
#define CHILD 313
|
||||
#define COMPLETED 314
|
||||
#define CONFIDENTIAL 315
|
||||
#define CONFIRMED 316
|
||||
#define COUNTER 317
|
||||
#define DATE 318
|
||||
#define DATETIME 319
|
||||
#define DECLINECOUNTER 320
|
||||
#define DECLINED 321
|
||||
#define DELEGATED 322
|
||||
#define DISPLAY 323
|
||||
#define DRAFT 324
|
||||
#define DURATION 325
|
||||
#define EMAIL 326
|
||||
#define END 327
|
||||
#define FINAL 328
|
||||
#define FLOAT 329
|
||||
#define FREE 330
|
||||
#define GREGORIAN 331
|
||||
#define GROUP 332
|
||||
#define INDIVIDUAL 333
|
||||
#define INPROCESS 334
|
||||
#define INTEGER 335
|
||||
#define NEEDSACTION 336
|
||||
#define NONPARTICIPANT 337
|
||||
#define OPAQUE 338
|
||||
#define OPTPARTICIPANT 339
|
||||
#define PARENT 340
|
||||
#define PERIOD 341
|
||||
#define PRIVATE 342
|
||||
#define PROCEDURE 343
|
||||
#define PUBLIC 344
|
||||
#define PUBLISH 345
|
||||
#define RECUR 346
|
||||
#define REFRESH 347
|
||||
#define REPLY 348
|
||||
#define REQPARTICIPANT 349
|
||||
#define REQUEST 350
|
||||
#define RESOURCE 351
|
||||
#define ROOM 352
|
||||
#define SIBLING 353
|
||||
#define START 354
|
||||
#define TENTATIVE 355
|
||||
#define TEXT 356
|
||||
#define THISANDFUTURE 357
|
||||
#define THISANDPRIOR 358
|
||||
#define TIME 359
|
||||
#define TRANSPAENT 360
|
||||
#define UNKNOWN 361
|
||||
#define UTCOFFSET 362
|
||||
#define XNAME 363
|
||||
#define ALTREP 364
|
||||
#define CN 365
|
||||
#define CUTYPE 366
|
||||
#define DAYLIGHT 367
|
||||
#define DIR 368
|
||||
#define ENCODING 369
|
||||
#define EVENT 370
|
||||
#define FBTYPE 371
|
||||
#define FMTTYPE 372
|
||||
#define LANGUAGE 373
|
||||
#define MEMBER 374
|
||||
#define PARTSTAT 375
|
||||
#define RANGE 376
|
||||
#define RELATED 377
|
||||
#define RELTYPE 378
|
||||
#define ROLE 379
|
||||
#define RSVP 380
|
||||
#define SENTBY 381
|
||||
#define STANDARD 382
|
||||
#define URI 383
|
||||
#define TIME_CHAR 384
|
||||
#define UTC_CHAR 385
|
||||
|
||||
|
||||
extern YYSTYPE ical_yylval;
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
DESCRIPTION:
|
||||
|
||||
$Id: icalyacc.y,v 1.1 2001-11-15 19:27:13 mikep%oeone.com Exp $
|
||||
$Id: icalyacc.y,v 1.2 2001-12-21 18:56:30 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 1999 Eric Busboom
|
||||
|
@ -367,12 +367,12 @@ plusminus: '+' { utcsign = 1; }
|
|||
utcoffset_value:
|
||||
plusminus INTNUMBER INTNUMBER
|
||||
{
|
||||
icalparser_yy_value = icalvalue_new_utcoffset( utcsign * ($2*3600) + ($3*60) );
|
||||
icalparser_yy_value = icalvalue_new_utcoffset( utcsign * (($2*3600) + ($3*60)) );
|
||||
}
|
||||
|
||||
| plusminus INTNUMBER INTNUMBER INTNUMBER
|
||||
{
|
||||
icalparser_yy_value = icalvalue_new_utcoffset(utcsign * ($2*3600) + ($3*60) +($4));
|
||||
icalparser_yy_value = icalvalue_new_utcoffset(utcsign * (($2*3600) + ($3*60) +($4)));
|
||||
}
|
||||
|
||||
%%
|
||||
|
|
|
@ -1,120 +1,238 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
MODULE = libical
|
||||
EXPORTS = ical.h
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build SUN-JAVA/JPEG Library (NEW)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..\..\..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
EXPORT_LIBRARY=1
|
||||
LIBRARY_NAME=libical$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
PDBFILE=$(LIBRARY_NAME).pdb
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any local options for the make tools
|
||||
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
|
||||
#// -Zi -GM needed to compile mmx functions in assembly.
|
||||
LCFLAGS = -Zi -GM
|
||||
LINCS = -I$(XPDIST)\include
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBICAL_OBJS= .\$(OBJDIR)\icalattendee.obj \
|
||||
.\$(OBJDIR)\icalcomponent.obj \
|
||||
.\$(OBJDIR)\icalderivedparameter.obj \
|
||||
.\$(OBJDIR)\icalderivedproperty.obj \
|
||||
.\$(OBJDIR)\icalderivedvalue.obj \
|
||||
.\$(OBJDIR)\icalduration.obj \
|
||||
.\$(OBJDIR)\icalenums.obj \
|
||||
.\$(OBJDIR)\icalerror.obj \
|
||||
.\$(OBJDIR)\icallangbind.obj \
|
||||
.\$(OBJDIR)\icallexer.obj \
|
||||
.\$(OBJDIR)\icalmemory.obj \
|
||||
.\$(OBJDIR)\icalmime.obj \
|
||||
.\$(OBJDIR)\icalparameter.obj \
|
||||
.\$(OBJDIR)\icalparser.obj \
|
||||
.\$(OBJDIR)\icalperiod.obj \
|
||||
.\$(OBJDIR)\icalproperty.obj \
|
||||
.\$(OBJDIR)\icalrecur.obj \
|
||||
.\$(OBJDIR)\icalrestriction.obj \
|
||||
.\$(OBJDIR)\icaltime.obj \
|
||||
.\$(OBJDIR)\icaltypes.obj \
|
||||
.\$(OBJDIR)\icalvalue.obj \
|
||||
.\$(OBJDIR)\icalyacc.obj \
|
||||
.\$(OBJDIR)\pvl.obj \
|
||||
.\$(OBJDIR)\sspm.obj \
|
||||
.\$(OBJDIR)\vsnprintf.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
|
||||
OBJS= \
|
||||
$(LIBICAL_OBJS) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib
|
||||
MAPFILE= $(DLLNAME).map
|
||||
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
MODULE = libical
|
||||
EXPORTS = ical.h
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build SUN-JAVA/JPEG Library (NEW)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..\..\..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
EXPORT_LIBRARY=1
|
||||
LIBRARY_NAME=libical$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
PDBFILE=$(LIBRARY_NAME).pdb
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def
|
||||
!endif
|
||||
DESIGNDATA = ..\..\design-data
|
||||
ICALSCRIPTS = ..\..\scripts
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Generate files that are automatically generated (*.h.in and *.c.in)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
# ORDERING OF HEADERS IS SIGNIFICANT. Don't change this ordering. It
|
||||
# is required to make the combined header ical.h properly
|
||||
COMBINEDHEADERS = \
|
||||
..\..\config.h \
|
||||
icalversion.h \
|
||||
icaltime.h \
|
||||
icalduration.h \
|
||||
icalperiod.h \
|
||||
icalenums.h \
|
||||
icaltypes.h \
|
||||
icalrecur.h \
|
||||
icalderivedvalue.h \
|
||||
icalderivedparameter.h \
|
||||
icalvalue.h \
|
||||
icalparameter.h \
|
||||
icalderivedproperty.h \
|
||||
icalproperty.h \
|
||||
icalattendee.h \
|
||||
pvl.h \
|
||||
icalarray.h \
|
||||
icalcomponent.h \
|
||||
icaltimezone.h \
|
||||
icalparser.h \
|
||||
icalmemory.h \
|
||||
icalerror.h \
|
||||
icalrestriction.h \
|
||||
sspm.h \
|
||||
icalmime.h \
|
||||
icallangbind.h
|
||||
|
||||
BUILT_COMBINEDHEADERS = \
|
||||
icalderivedparameter.h \
|
||||
icalderivedproperty.h \
|
||||
icalderivedvalue.h
|
||||
|
||||
BUILT_SOURCES = \
|
||||
$(BUILT_COMBINEDHEADERS)\
|
||||
icalderivedparameter.c \
|
||||
icalderivedproperty.c \
|
||||
icalrestriction.c \
|
||||
icalderivedvalue.c
|
||||
|
||||
ical.h: $(COMBINEDHEADERS)
|
||||
cat $(COMBINEDHEADERS) \
|
||||
| egrep -v "#include.*ical" \
|
||||
| egrep -v "#include.*config" \
|
||||
| egrep -v "#include.*pvl\.h" > ical.h
|
||||
|
||||
# parameters
|
||||
|
||||
PARAMETERDEPS = \
|
||||
$(ICALSCRIPTS)\mkderivedparameters.pl \
|
||||
$(DESIGNDATA)\parameters.csv \
|
||||
icalderivedparameter.c.in \
|
||||
icalderivedparameter.h.in
|
||||
|
||||
icalderivedparameter.h: $(PARAMETERDEPS)
|
||||
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedparameters.pl -i icalderivedparameter.h.in -h $(DESIGNDATA)\parameters.csv > icalderivedparameter.h
|
||||
|
||||
icalderivedparameter.c: $(PARAMETERDEPS) $(BUILT_COMBINEDHEADERS)
|
||||
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedparameters.pl -i icalderivedparameter.c.in -c $(DESIGNDATA)\parameters.csv > icalderivedparameter.c
|
||||
|
||||
# properties
|
||||
|
||||
PROPERTYDEPS = \
|
||||
$(ICALSCRIPTS)\mkderivedproperties.pl \
|
||||
$(DESIGNDATA)\properties.csv \
|
||||
$(DESIGNDATA)\value-types.csv \
|
||||
icalderivedproperty.c.in \
|
||||
icalderivedproperty.h.in
|
||||
|
||||
|
||||
icalderivedproperty.h: $(PROPERTYDEPS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedproperties.pl \
|
||||
-i icalderivedproperty.h.in -h $(DESIGNDATA)\properties.csv \
|
||||
$(DESIGNDATA)\value-types.csv > icalderivedproperty.h
|
||||
|
||||
icalderivedproperty.c: $(PROPERTYDEPS) $(BUILT_COMBINEDHEADERS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedproperties.pl \
|
||||
-i icalderivedproperty.c.in -c $(DESIGNDATA)\properties.csv \
|
||||
$(DESIGNDATA)\value-types.csv > icalderivedproperty.c
|
||||
|
||||
# restrictions
|
||||
|
||||
RESTRICTIONDEPS = \
|
||||
$(ICALSCRIPTS)\mkrestrictiontable.pl \
|
||||
$(DESIGNDATA)\restrictions.csv \
|
||||
icalrestriction.c.in
|
||||
|
||||
icalrestriction.c: $(RESTRICTIONDEPS)
|
||||
$(PERL) $(ICALSCRIPTS)\mkrestrictiontable.pl -i icalrestriction.c.in \
|
||||
$(DESIGNDATA)\restrictions.csv > icalrestriction.c
|
||||
|
||||
# values
|
||||
|
||||
VALUEDEPS = \
|
||||
$(ICALSCRIPTS)\mkderivedvalues.pl \
|
||||
$(DESIGNDATA)\value-types.csv \
|
||||
icalderivedvalue.c.in \
|
||||
icalderivedvalue.h.in
|
||||
|
||||
icalderivedvalue.h: $(VALUEDEPS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedvalues.pl \
|
||||
-i icalderivedvalue.h.in -h $(DESIGNDATA)\value-types.csv > icalderivedvalue.h
|
||||
|
||||
icalderivedvalue.c: $(VALUEDEPS) $(BUILT_COMBINEDHEADERS)
|
||||
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)\mkderivedvalues.pl \
|
||||
-i icalderivedvalue.c.in -c $(DESIGNDATA)\value-types.csv > icalderivedvalue.c
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any local options for the make tools
|
||||
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
|
||||
#// -Zi -GM needed to compile mmx functions in assembly.
|
||||
LCFLAGS = -Zi -GM
|
||||
LINCS = -I$(XPDIST)\include
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBICAL_OBJS= .\$(OBJDIR)\icalarray.obj \
|
||||
.\$(OBJDIR)\icalattendee.obj \
|
||||
.\$(OBJDIR)\icalcomponent.obj \
|
||||
.\$(OBJDIR)\icalderivedparameter.obj \
|
||||
.\$(OBJDIR)\icalderivedproperty.obj \
|
||||
.\$(OBJDIR)\icalderivedvalue.obj \
|
||||
.\$(OBJDIR)\icalduration.obj \
|
||||
.\$(OBJDIR)\icalenums.obj \
|
||||
.\$(OBJDIR)\icalerror.obj \
|
||||
.\$(OBJDIR)\icallangbind.obj \
|
||||
.\$(OBJDIR)\icallexer.obj \
|
||||
.\$(OBJDIR)\icalmemory.obj \
|
||||
.\$(OBJDIR)\icalmime.obj \
|
||||
.\$(OBJDIR)\icalparameter.obj \
|
||||
.\$(OBJDIR)\icalparser.obj \
|
||||
.\$(OBJDIR)\icalperiod.obj \
|
||||
.\$(OBJDIR)\icalproperty.obj \
|
||||
.\$(OBJDIR)\icalrecur.obj \
|
||||
.\$(OBJDIR)\icalrestriction.obj \
|
||||
.\$(OBJDIR)\icaltime.obj \
|
||||
.\$(OBJDIR)\icaltimezone.obj \
|
||||
.\$(OBJDIR)\icaltypes.obj \
|
||||
.\$(OBJDIR)\icalvalue.obj \
|
||||
.\$(OBJDIR)\icalyacc.obj \
|
||||
.\$(OBJDIR)\pvl.obj \
|
||||
.\$(OBJDIR)\sspm.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
|
||||
OBJS= \
|
||||
$(LIBICAL_OBJS) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib
|
||||
MAPFILE= $(DLLNAME).map
|
||||
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: sspm.c Parse Mime
|
||||
CREATOR: eric 25 June 2000
|
||||
|
||||
$Id: sspm.c,v 1.2 2001-11-22 19:21:51 mikep%oeone.com Exp $
|
||||
$Id: sspm.c,v 1.3 2001-12-21 18:56:30 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License
|
||||
|
@ -40,14 +40,15 @@
|
|||
#include <ctype.h> /* for tolower */
|
||||
#include <stdlib.h> /* for malloc, free */
|
||||
#include <string.h> /* for strcasecmp */
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#ifdef DMALLOC
|
||||
#include "dmalloc.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
#endif
|
||||
|
||||
#define TMP_BUF_SIZE 1024
|
||||
|
||||
|
@ -282,12 +283,8 @@ int sspm_is_mime_header(char *line)
|
|||
}
|
||||
|
||||
for(i = 0; mime_headers[i] != 0; i++){
|
||||
#ifndef WIN32
|
||||
if(strcasecmp(name, mime_headers[i]) == 0)
|
||||
#else
|
||||
if(stricmp(name, mime_headers[i]) == 0)
|
||||
#endif
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#ifdef __osf__
|
||||
#ifndef WIN32
|
||||
#include "config.h"
|
||||
#endif
|
||||
#ifndef HAVE_SNPRINTF
|
||||
/*
|
||||
* Revision 12: http://theos.com/~deraadt/snprintf.c
|
||||
*
|
||||
|
@ -24,13 +27,15 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/param.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
lib_LTLIBRARIES = libicalss.la
|
||||
|
||||
YFLAGS =-d -v -p ss
|
||||
LFLAGS = -Pss
|
||||
LEX_OUTPUT_ROOT = lex.ss
|
||||
|
||||
all: icalss.h
|
||||
|
||||
INCLUDES = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_builddir)/src \
|
||||
-I$(top_srcdir)/src/libical \
|
||||
-I$(srcdir)/libical
|
||||
|
||||
libicalss_la_LDFLAGS = -version-info 0:0:0
|
||||
|
||||
libicalss_la_SOURCES = \
|
||||
icalclassify.c \
|
||||
icalgauge.c \
|
||||
icalgaugeimpl.h \
|
||||
icaldirset.c \
|
||||
icaldirsetimpl.h \
|
||||
icalfileset.c \
|
||||
icalfilesetimpl.h \
|
||||
icalset.c \
|
||||
icalsslexer.l \
|
||||
icalssyacc.h \
|
||||
icalssyacc.y \
|
||||
icalspanlist.c \
|
||||
icalmessage.c \
|
||||
icalcstpclient.c \
|
||||
icalcstpclient.h \
|
||||
icalcstpserver.c \
|
||||
icalcstpserver.h \
|
||||
icalcstp.c
|
||||
|
||||
libicalssincludedir = $(includedir)
|
||||
|
||||
COMBINEDHEADERS = \
|
||||
icalgauge.h \
|
||||
icalset.h \
|
||||
icalfileset.h \
|
||||
icaldirset.h \
|
||||
icalcalendar.h \
|
||||
icalclassify.h \
|
||||
icalspanlist.h \
|
||||
icalmessage.h \
|
||||
icalcstp.h \
|
||||
icalcstpclient.h \
|
||||
icalcstpserver.h
|
||||
|
||||
|
||||
icalss.h: $(COMBINEDHEADERS)
|
||||
cat $(COMBINEDHEADERS) | egrep -v "#include.*\"ical" \
|
||||
| egrep -v "#include.*\"pvl\.h\"" > icalss.h
|
||||
|
||||
|
||||
libicalssinclude_HEADERS = icalss.h
|
||||
|
||||
CONFIG_CLEAN_FILES = y.output
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(COMBINEDHEADERS) \
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalclassify.c
|
||||
CREATOR: ebusboom 23 aug 2000
|
||||
|
||||
$Id: icalclassify.c,v 1.1 2001-11-15 19:27:19 mikep%oeone.com Exp $
|
||||
$Id: icalclassify.c,v 1.2 2001-12-21 18:56:34 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -36,15 +36,16 @@
|
|||
|
||||
|
||||
struct icalclassify_parts {
|
||||
icalcomponent *c;
|
||||
icalproperty_method method;
|
||||
char* organizer;
|
||||
icalparameter_partstat reply_partstat;
|
||||
char* reply_attendee;
|
||||
char* uid;
|
||||
int sequence;
|
||||
struct icaltimetype dtstamp;
|
||||
struct icaltimetype recurrence_id;
|
||||
icalcomponent *c;
|
||||
icalcomponent_kind inner_kind;
|
||||
icalproperty_method method;
|
||||
char* organizer;
|
||||
icalparameter_partstat reply_partstat;
|
||||
char* reply_attendee;
|
||||
char* uid;
|
||||
int sequence;
|
||||
struct icaltimetype dtstamp;
|
||||
struct icaltimetype recurrence_id;
|
||||
};
|
||||
|
||||
|
||||
|
@ -121,9 +122,24 @@ icalproperty* icalclassify_find_attendee(icalcomponent *c,
|
|||
const char* attendee)
|
||||
{
|
||||
icalproperty *p;
|
||||
char* lattendee = icalclassify_lowercase(attendee);
|
||||
char* upn = strchr(lattendee,':');
|
||||
icalcomponent *inner = icalcomponent_get_first_real_component(c);
|
||||
icalcomponent* inner;
|
||||
char* lattendee;
|
||||
char* upn;
|
||||
|
||||
if(attendee == 0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
lattendee = icalclassify_lowercase(attendee);
|
||||
upn = strchr(lattendee,':');
|
||||
|
||||
if (upn== 0){
|
||||
upn = lattendee;
|
||||
} else {
|
||||
upn++; /* skip the ";"*/
|
||||
}
|
||||
|
||||
inner = icalcomponent_get_first_real_component(c);
|
||||
|
||||
for(p = icalcomponent_get_first_property(inner,ICAL_ATTENDEE_PROPERTY);
|
||||
p != 0;
|
||||
|
@ -135,13 +151,19 @@ icalproperty* icalclassify_find_attendee(icalcomponent *c,
|
|||
|
||||
if(this_upn == 0){
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
this_upn++;
|
||||
}
|
||||
|
||||
if(strcmp(this_upn,upn)==0){
|
||||
if(strcmp(this_upn,upn)==0){
|
||||
free(lattendee);
|
||||
free(this_attendee);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
free(this_attendee);
|
||||
}
|
||||
free(lattendee);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -191,6 +213,8 @@ void icalssutil_get_parts(icalcomponent* c,
|
|||
|
||||
inner = icalcomponent_get_first_real_component(c);
|
||||
|
||||
parts->inner_kind = icalcomponent_isa(inner);
|
||||
|
||||
p = icalcomponent_get_first_property(inner,ICAL_ORGANIZER_PROPERTY);
|
||||
if(p!=0){
|
||||
parts->organizer = strdup(icalproperty_get_organizer(p));
|
||||
|
@ -263,7 +287,7 @@ int icalssutil_is_rescheduled(icalcomponent* a,icalcomponent* b)
|
|||
p1 = icalcomponent_get_first_property(i1,kind_array[i]);
|
||||
p2 = icalcomponent_get_first_property(i2,kind_array[i]);
|
||||
|
||||
if( (p1!=0)^(p1!=0) ){
|
||||
if( (p1!=0)^(p2!=0) ){
|
||||
/* Return true if the property exists in one component and not
|
||||
the other */
|
||||
return 1;
|
||||
|
@ -293,7 +317,7 @@ int icalclassify_publish_new(struct icalclassify_parts *comp,
|
|||
icalclassify_pre;
|
||||
|
||||
if(comp->method == ICAL_METHOD_PUBLISH &&
|
||||
match == 0){
|
||||
match == 0 && comp->inner_kind != ICAL_VFREEBUSY_COMPONENT){
|
||||
rtrn = 1;
|
||||
}
|
||||
|
||||
|
@ -308,7 +332,7 @@ int icalclassify_publish_update(struct icalclassify_parts *comp,
|
|||
icalclassify_pre;
|
||||
|
||||
if(comp->method == ICAL_METHOD_PUBLISH &&
|
||||
match !=0 ){
|
||||
match !=0 && comp->inner_kind != ICAL_VFREEBUSY_COMPONENT){
|
||||
rtrn = 1;
|
||||
}
|
||||
|
||||
|
@ -323,7 +347,7 @@ int icalclassify_publish_freebusy(struct icalclassify_parts *comp,
|
|||
icalclassify_pre;
|
||||
|
||||
if(comp->method == ICAL_METHOD_PUBLISH &&
|
||||
match == 0){
|
||||
comp->inner_kind == ICAL_VFREEBUSY_COMPONENT){
|
||||
rtrn = 1;
|
||||
}
|
||||
|
||||
|
@ -392,11 +416,19 @@ int icalclassify_request_delegate(
|
|||
struct icalclassify_parts *match,
|
||||
const char* user)
|
||||
{
|
||||
icalclassify_pre
|
||||
icalproperty* attendee;
|
||||
icalparameter* param;
|
||||
icalclassify_pre;
|
||||
|
||||
if (match->c != 0 &&
|
||||
comp->sequence > match->sequence &&
|
||||
icalssutil_is_rescheduled(comp->c,match->c)){
|
||||
attendee = icalclassify_find_attendee(comp->c,user);
|
||||
|
||||
if(attendee == 0){
|
||||
return 0;
|
||||
}
|
||||
|
||||
param = icalproperty_get_first_parameter(attendee,ICAL_DELEGATEDFROM_PARAMETER);
|
||||
|
||||
if (param != 0){
|
||||
rtrn = 1;
|
||||
}
|
||||
|
||||
|
@ -411,7 +443,7 @@ int icalclassify_request_new_organizer(
|
|||
{
|
||||
/* Organizer has changed between match and component */
|
||||
icalclassify_pre
|
||||
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
icalclassify_post
|
||||
|
||||
}
|
||||
|
@ -422,6 +454,7 @@ int icalclassify_request_status(
|
|||
const char* user)
|
||||
{
|
||||
icalclassify_pre
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
icalclassify_post
|
||||
}
|
||||
|
||||
|
@ -431,6 +464,7 @@ int icalclassify_request_forward(
|
|||
const char* user)
|
||||
{
|
||||
icalclassify_pre
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
icalclassify_post
|
||||
}
|
||||
|
||||
|
@ -440,6 +474,7 @@ int icalclassify_request_freebusy(
|
|||
const char* user)
|
||||
{
|
||||
icalclassify_pre
|
||||
icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
|
||||
icalclassify_post
|
||||
}
|
||||
|
||||
|
@ -477,6 +512,22 @@ int icalclassify_reply_decline(
|
|||
}
|
||||
icalclassify_post
|
||||
}
|
||||
int icalclassify_reply_delegate(
|
||||
struct icalclassify_parts *comp,
|
||||
struct icalclassify_parts *match,
|
||||
const char* user)
|
||||
{
|
||||
icalproperty* attendee;
|
||||
icalclassify_pre;
|
||||
|
||||
attendee = icalclassify_find_attendee(match->c,comp->reply_attendee);
|
||||
|
||||
if( attendee != 0 &&
|
||||
comp->reply_partstat == ICAL_PARTSTAT_DELEGATED){
|
||||
rtrn = 1;
|
||||
}
|
||||
icalclassify_post
|
||||
}
|
||||
int icalclassify_reply_crasher_accept(
|
||||
struct icalclassify_parts *comp,
|
||||
struct icalclassify_parts *match,
|
||||
|
@ -498,7 +549,6 @@ int icalclassify_reply_crasher_decline(
|
|||
struct icalclassify_parts *match,
|
||||
const char* user)
|
||||
{
|
||||
icalparameter_partstat partstat;
|
||||
icalproperty* attendee;
|
||||
icalclassify_pre;
|
||||
|
||||
|
@ -594,45 +644,47 @@ int icalclassify_delinecounter(
|
|||
struct icalclassify_map {
|
||||
icalproperty_method method;
|
||||
int (*fn)(struct icalclassify_parts *comp,struct icalclassify_parts *match, const char* user);
|
||||
ical_class class;
|
||||
icalproperty_xlicclass class;
|
||||
} icalclassify_map[] =
|
||||
{ {ICAL_METHOD_PUBLISH,icalclassify_publish_new,ICAL_PUBLISH_NEW_CLASS},
|
||||
{ICAL_METHOD_PUBLISH,icalclassify_publish_update,ICAL_PUBLISH_UPDATE_CLASS},
|
||||
{ICAL_METHOD_PUBLISH,icalclassify_publish_freebusy,ICAL_PUBLISH_FREEBUSY_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_new,ICAL_REQUEST_NEW_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_update,ICAL_REQUEST_UPDATE_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_reschedule,ICAL_REQUEST_RESCHEDULE_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_delegate,ICAL_REQUEST_DELEGATE_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_new_organizer,ICAL_REQUEST_NEW_ORGANIZER_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_forward,ICAL_REQUEST_FORWARD_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_status,ICAL_REQUEST_STATUS_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_freebusy,ICAL_REQUEST_FREEBUSY_CLASS},
|
||||
{ {ICAL_METHOD_PUBLISH,icalclassify_publish_new,ICAL_XLICCLASS_PUBLISHNEW},
|
||||
{ICAL_METHOD_PUBLISH,icalclassify_publish_update,ICAL_XLICCLASS_PUBLISHUPDATE},
|
||||
{ICAL_METHOD_PUBLISH,icalclassify_publish_freebusy,ICAL_XLICCLASS_PUBLISHFREEBUSY},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_delegate,ICAL_XLICCLASS_REQUESTDELEGATE},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_new,ICAL_XLICCLASS_REQUESTNEW},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_update,ICAL_XLICCLASS_REQUESTUPDATE},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_reschedule,ICAL_XLICCLASS_REQUESTRESCHEDULE},
|
||||
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_accept,ICAL_REPLY_ACCEPT_CLASS},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_decline,ICAL_REPLY_DECLINE_CLASS},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_crasher_accept,ICAL_REPLY_CRASHER_ACCEPT_CLASS},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_crasher_decline,ICAL_REPLY_CRASHER_DECLINE_CLASS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_new_organizer,ICAL_XLICCLASS_REQUESTNEWORGANIZER},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_forward,ICAL_XLICCLASS_REQUESTFORWARD},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_status,ICAL_XLICCLASS_REQUESTSTATUS},
|
||||
{ICAL_METHOD_REQUEST,icalclassify_request_freebusy,ICAL_XLICCLASS_REQUESTFREEBUSY},
|
||||
|
||||
{ICAL_METHOD_ADD,icalclassify_add_instance,ICAL_ADD_INSTANCE_CLASS},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_accept,ICAL_XLICCLASS_REPLYACCEPT},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_decline,ICAL_XLICCLASS_REPLYDECLINE},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_delegate,ICAL_XLICCLASS_REPLYDELEGATE},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_crasher_accept,ICAL_XLICCLASS_REPLYCRASHERACCEPT},
|
||||
{ICAL_METHOD_REPLY,icalclassify_reply_crasher_decline,ICAL_XLICCLASS_REPLYCRASHERDECLINE},
|
||||
|
||||
{ICAL_METHOD_CANCEL,icalclassify_cancel_event,ICAL_CANCEL_EVENT_CLASS},
|
||||
{ICAL_METHOD_CANCEL,icalclassify_cancel_instance,ICAL_CANCEL_INSTANCE_CLASS},
|
||||
{ICAL_METHOD_CANCEL,icalclassify_cancel_all,ICAL_CANCEL_ALL_CLASS},
|
||||
{ICAL_METHOD_ADD,icalclassify_add_instance,ICAL_XLICCLASS_ADDINSTANCE},
|
||||
|
||||
{ICAL_METHOD_REFRESH,icalclassify_refesh,ICAL_REFRESH_CLASS},
|
||||
{ICAL_METHOD_COUNTER,icalclassify_counter,ICAL_COUNTER_CLASS},
|
||||
{ICAL_METHOD_DECLINECOUNTER,icalclassify_delinecounter,ICAL_DECLINECOUNTER_CLASS},
|
||||
{ICAL_METHOD_NONE,0,ICAL_NO_CLASS}
|
||||
{ICAL_METHOD_CANCEL,icalclassify_cancel_event,ICAL_XLICCLASS_CANCELEVENT},
|
||||
{ICAL_METHOD_CANCEL,icalclassify_cancel_instance,ICAL_XLICCLASS_CANCELINSTANCE},
|
||||
{ICAL_METHOD_CANCEL,icalclassify_cancel_all,ICAL_XLICCLASS_CANCELALL},
|
||||
|
||||
{ICAL_METHOD_REFRESH,icalclassify_refesh,ICAL_XLICCLASS_REFRESH},
|
||||
{ICAL_METHOD_COUNTER,icalclassify_counter,ICAL_XLICCLASS_COUNTER},
|
||||
{ICAL_METHOD_DECLINECOUNTER,icalclassify_delinecounter,ICAL_XLICCLASS_DECLINECOUNTER},
|
||||
{ICAL_METHOD_NONE,0,ICAL_XLICCLASS_NONE}
|
||||
};
|
||||
|
||||
|
||||
ical_class icalclassify(icalcomponent* c,icalcomponent* match,
|
||||
icalproperty_xlicclass icalclassify(icalcomponent* c,icalcomponent* match,
|
||||
const char* user)
|
||||
{
|
||||
icalcomponent *inner;
|
||||
icalproperty *p;
|
||||
icalproperty_method method;
|
||||
ical_class class = ICAL_UNKNOWN_CLASS;
|
||||
icalproperty_xlicclass class = ICAL_XLICCLASS_UNKNOWN;
|
||||
|
||||
int i;
|
||||
|
||||
|
@ -642,7 +694,7 @@ ical_class icalclassify(icalcomponent* c,icalcomponent* match,
|
|||
inner = icalcomponent_get_first_real_component(c);
|
||||
|
||||
if (inner == 0) {
|
||||
return ICAL_NO_CLASS;
|
||||
return ICAL_XLICCLASS_NONE;
|
||||
}
|
||||
|
||||
icalssutil_get_parts(c,&comp_parts);
|
||||
|
@ -659,7 +711,7 @@ ical_class icalclassify(icalcomponent* c,icalcomponent* match,
|
|||
icaltime_compare(comp_parts.dtstamp,match_parts.dtstamp)>0)
|
||||
{
|
||||
/* comp has a smaller sequence and a later DTSTAMP */
|
||||
return ICAL_MISSEQUENCED_CLASS;
|
||||
return ICAL_XLICCLASS_MISSEQUENCED;
|
||||
}
|
||||
|
||||
if( (comp_parts.sequence<match_parts.sequence )
|
||||
|
@ -668,14 +720,14 @@ ical_class icalclassify(icalcomponent* c,icalcomponent* match,
|
|||
( comp_parts.sequence == match_parts.sequence &&
|
||||
icaltime_compare(comp_parts.dtstamp,match_parts.dtstamp)<=0)){
|
||||
|
||||
return ICAL_OBSOLETE_CLASS;
|
||||
return ICAL_XLICCLASS_OBSOLETE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
p = icalcomponent_get_first_property(c,ICAL_METHOD_PROPERTY);
|
||||
if (p == 0) {
|
||||
return ICAL_UNKNOWN_CLASS;
|
||||
return ICAL_XLICCLASS_UNKNOWN;
|
||||
}
|
||||
method = icalproperty_get_method(p);
|
||||
|
||||
|
@ -694,3 +746,4 @@ ical_class icalclassify(icalcomponent* c,icalcomponent* match,
|
|||
return class;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 21 Aug 2000
|
||||
|
||||
|
||||
$Id: icalclassify.h,v 1.1 2001-11-15 19:27:19 mikep%oeone.com Exp $
|
||||
$Id: icalclassify.h,v 1.2 2001-12-21 18:56:34 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -29,42 +29,14 @@
|
|||
#include "ical.h"
|
||||
#include "icalset.h"
|
||||
|
||||
|
||||
typedef enum icalclass {
|
||||
ICAL_NO_CLASS,
|
||||
ICAL_PUBLISH_NEW_CLASS,
|
||||
ICAL_PUBLISH_UPDATE_CLASS,
|
||||
ICAL_PUBLISH_FREEBUSY_CLASS,
|
||||
ICAL_REQUEST_NEW_CLASS,
|
||||
ICAL_REQUEST_UPDATE_CLASS,
|
||||
ICAL_REQUEST_RESCHEDULE_CLASS,
|
||||
ICAL_REQUEST_DELEGATE_CLASS,
|
||||
ICAL_REQUEST_NEW_ORGANIZER_CLASS,
|
||||
ICAL_REQUEST_FORWARD_CLASS,
|
||||
ICAL_REQUEST_STATUS_CLASS,
|
||||
ICAL_REQUEST_FREEBUSY_CLASS,
|
||||
ICAL_REPLY_ACCEPT_CLASS,
|
||||
ICAL_REPLY_DECLINE_CLASS,
|
||||
ICAL_REPLY_CRASHER_ACCEPT_CLASS,
|
||||
ICAL_REPLY_CRASHER_DECLINE_CLASS,
|
||||
ICAL_ADD_INSTANCE_CLASS,
|
||||
ICAL_CANCEL_EVENT_CLASS,
|
||||
ICAL_CANCEL_INSTANCE_CLASS,
|
||||
ICAL_CANCEL_ALL_CLASS,
|
||||
ICAL_REFRESH_CLASS,
|
||||
ICAL_COUNTER_CLASS,
|
||||
ICAL_DECLINECOUNTER_CLASS,
|
||||
ICAL_MALFORMED_CLASS,
|
||||
ICAL_OBSOLETE_CLASS, /* 21 */
|
||||
ICAL_MISSEQUENCED_CLASS, /* 22 */
|
||||
ICAL_UNKNOWN_CLASS /* 23 */
|
||||
} ical_class;
|
||||
|
||||
ical_class icalclassify(icalcomponent* c,icalcomponent* match,
|
||||
icalproperty_xlicclass icalclassify(icalcomponent* c,icalcomponent* match,
|
||||
const char* user);
|
||||
|
||||
icalcomponent* icalclassify_find_overlaps(icalset* set, icalcomponent* comp);
|
||||
|
||||
char* icalclassify_class_to_string(icalproperty_xlicclass c);
|
||||
|
||||
|
||||
#endif /* ICALCLASSIFY_H*/
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalcstps.c
|
||||
CREATOR: ebusboom 23 Jun 2000
|
||||
|
||||
$Id: icalcstp.c,v 1.2 2001-11-22 19:21:53 mikep%oeone.com Exp $
|
||||
$Id: icalcstp.c,v 1.3 2001-12-21 18:56:34 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -31,10 +31,10 @@
|
|||
#include "pvl.h"
|
||||
|
||||
#include <sys/types.h> /* For send(), others */
|
||||
#ifndef WIN32
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h> /* For send(), others. */
|
||||
#include <unistd.h> /* For alarm */
|
||||
#endif
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <string.h>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalcstps.c
|
||||
CREATOR: ebusboom 23 Jun 2000
|
||||
|
||||
$Id: icalcstpclient.c,v 1.2 2001-11-22 19:21:53 mikep%oeone.com Exp $
|
||||
$Id: icalcstpclient.c,v 1.3 2001-12-21 18:56:35 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -32,9 +32,9 @@
|
|||
#include "pvl.h"
|
||||
|
||||
#include <sys/types.h> /* For send(), others */
|
||||
#ifndef WIN32
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h> /* For send(), others. */
|
||||
#include <unistd.h> /* For alarm */
|
||||
#include <unistd.h> /* For alarm */
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <stdlib.h> /* for malloc */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalcstpserver.c
|
||||
CREATOR: ebusboom 13 Feb 01
|
||||
|
||||
$Id: icalcstpserver.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $
|
||||
$Id: icalcstpserver.c,v 1.3 2001-12-21 18:56:35 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -32,9 +32,9 @@
|
|||
#include "pvl.h"
|
||||
|
||||
#include <sys/types.h> /* For send(), others */
|
||||
#ifndef WIN32
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h> /* For send(), others. */
|
||||
#include <unistd.h> /* For alarm */
|
||||
#include <unistd.h> /* For alarm */
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <stdlib.h> /* for malloc */
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icaldirset.c
|
||||
CREATOR: eric 28 November 1999
|
||||
|
||||
$Id: icaldirset.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $
|
||||
$Id: icaldirset.c,v 1.3 2001-12-21 18:56:36 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -65,13 +65,14 @@
|
|||
#include "icalfilesetimpl.h"
|
||||
#include "icalgauge.h"
|
||||
|
||||
#include <limits.h> /* For PATH_MAX */
|
||||
#include <limits.h> /* For PATH_MAX */
|
||||
#ifndef WIN32
|
||||
#include <dirent.h> /* for opendir() */
|
||||
#include <unistd.h> /* for stat, getpid */
|
||||
#include <sys/utsname.h> /* for uname */
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <dirent.h> /* for opendir() */
|
||||
#include <unistd.h> /* for stat, getpid */
|
||||
#include <sys/utsname.h> /* for uname */
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <process.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <sys/types.h> /* for opendir() */
|
||||
|
@ -81,16 +82,16 @@
|
|||
#include <string.h> /* for strdup */
|
||||
#include "icaldirsetimpl.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
|
||||
#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))
|
||||
|
||||
#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR)
|
||||
#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
|
||||
#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))
|
||||
|
||||
#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR)
|
||||
#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG)
|
||||
#endif
|
||||
|
||||
struct icaldirset_impl* icaldirset_new_impl()
|
||||
{
|
||||
|
@ -143,8 +144,8 @@ void icaldirset_unlock(const char* dir)
|
|||
/* Load the contents of the store directory into the store's internal directory list*/
|
||||
icalerrorenum icaldirset_read_directory(struct icaldirset_impl* impl)
|
||||
{
|
||||
char *str;
|
||||
#ifndef WIN32
|
||||
char *str;
|
||||
#ifndef WIN32
|
||||
struct dirent *de;
|
||||
DIR* dp;
|
||||
|
||||
|
@ -175,39 +176,39 @@ icalerrorenum icaldirset_read_directory(struct icaldirset_impl* impl)
|
|||
}
|
||||
|
||||
closedir(dp);
|
||||
#else
|
||||
struct _finddata_t c_file;
|
||||
long hFile;
|
||||
|
||||
/* Find first .c file in current directory */
|
||||
if( (hFile = _findfirst( "*", &c_file )) == -1L )
|
||||
{
|
||||
icalerror_set_errno(ICAL_FILE_ERROR);
|
||||
return ICAL_FILE_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
while((str = pvl_pop(impl->directory))){
|
||||
free(str);
|
||||
}
|
||||
|
||||
/* load all of the cluster names in the directory list */
|
||||
do
|
||||
{
|
||||
/* Remove known directory names '.' and '..'*/
|
||||
if (strcmp(c_file.name,".") == 0 ||
|
||||
strcmp(c_file.name,"..") == 0 ){
|
||||
continue;
|
||||
}
|
||||
|
||||
pvl_push(impl->directory, (void*)strdup(c_file.name));
|
||||
}
|
||||
while ( _findnext( hFile, &c_file ) == 0 );
|
||||
|
||||
_findclose( hFile );
|
||||
}
|
||||
|
||||
#endif
|
||||
#else
|
||||
struct _finddata_t c_file;
|
||||
long hFile;
|
||||
|
||||
/* Find first .c file in current directory */
|
||||
if( (hFile = _findfirst( "*", &c_file )) == -1L )
|
||||
{
|
||||
icalerror_set_errno(ICAL_FILE_ERROR);
|
||||
return ICAL_FILE_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
while((str = pvl_pop(impl->directory))){
|
||||
free(str);
|
||||
}
|
||||
|
||||
/* load all of the cluster names in the directory list */
|
||||
do
|
||||
{
|
||||
/* Remove known directory names '.' and '..'*/
|
||||
if (strcmp(c_file.name,".") == 0 ||
|
||||
strcmp(c_file.name,"..") == 0 ){
|
||||
continue;
|
||||
}
|
||||
|
||||
pvl_push(impl->directory, (void*)strdup(c_file.name));
|
||||
}
|
||||
while ( _findnext( hFile, &c_file ) == 0 );
|
||||
|
||||
_findclose( hFile );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return ICAL_NO_ERROR;
|
||||
}
|
||||
|
@ -382,23 +383,25 @@ void icaldirset_add_uid(icaldirset* store, icaldirset* comp)
|
|||
{
|
||||
char uidstring[ICAL_PATH_MAX];
|
||||
icalproperty *uid;
|
||||
#ifndef WIN32
|
||||
#ifndef WIN32
|
||||
struct utsname unamebuf;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
icalerror_check_arg_rv( (store!=0), "store");
|
||||
icalerror_check_arg_rv( (comp!=0), "comp");
|
||||
|
||||
uid = icalcomponent_get_first_property(comp,ICAL_UID_PROPERTY);
|
||||
|
||||
if (uid == 0) {
|
||||
#ifndef WIN32
|
||||
|
||||
#ifndef WIN32
|
||||
uname(&unamebuf);
|
||||
|
||||
sprintf(uidstring,"%d-%s",(int)getpid(),unamebuf.nodename);
|
||||
#else
|
||||
sprintf(uidstring,"%d-%s",(int)getpid(),"WINDOWS"); /* FIX: There must be an easy get the system name */
|
||||
#endif
|
||||
|
||||
#else
|
||||
sprintf(uidstring,"%d-%s",(int)getpid(),"WINDOWS"); /* FIX: There must be an easy get the system name */
|
||||
#endif
|
||||
uid = icalproperty_new_uid(uidstring);
|
||||
icalcomponent_add_property(comp,uid);
|
||||
} else {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalfileset.c
|
||||
CREATOR: eric 23 December 1999
|
||||
|
||||
$Id: icalfileset.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $
|
||||
$Id: icalfileset.c,v 1.3 2001-12-21 18:56:36 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -34,26 +34,26 @@
|
|||
#include "icalgauge.h"
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h> /* for stat */
|
||||
#ifndef WIN32
|
||||
#include <unistd.h> /* for stat, getpid */
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <share.h>
|
||||
#endif
|
||||
#ifndef WIN32
|
||||
#include <unistd.h> /* for stat, getpid */
|
||||
#else
|
||||
#include <io.h>
|
||||
#include <share.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h> /* for fcntl */
|
||||
#include "icalfilesetimpl.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
|
||||
#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))
|
||||
|
||||
#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR)
|
||||
#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG)
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#define snprintf _snprintf
|
||||
#define strcasecmp stricmp
|
||||
|
||||
#define _S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask))
|
||||
|
||||
#define S_ISDIR(mode) _S_ISTYPE((mode), _S_IFDIR)
|
||||
#define S_ISREG(mode) _S_ISTYPE((mode), _S_IFREG)
|
||||
#endif
|
||||
|
||||
extern int errno;
|
||||
|
||||
|
@ -113,20 +113,21 @@ icalfileset* icalfileset_new_open(const char* path, int flags, mode_t mode)
|
|||
}
|
||||
|
||||
#ifndef WIN32
|
||||
impl->fd = open(impl->path,flags, mode);
|
||||
#else
|
||||
impl->fd = sopen(impl->path,flags, _SH_DENYWR, _S_IREAD | _S_IWRITE);
|
||||
#endif
|
||||
impl->fd = open(impl->path,flags, mode);
|
||||
#else
|
||||
impl->fd = sopen(impl->path,flags, _SH_DENYWR, _S_IREAD | _S_IWRITE);
|
||||
#endif
|
||||
|
||||
if (impl->fd < 0){
|
||||
icalerror_set_errno(ICAL_FILE_ERROR);
|
||||
icalfileset_free(impl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef WIN32 // We need this under win32, we'd open'd and lock'd in one operation
|
||||
icalfileset_lock(impl);
|
||||
|
||||
#ifndef WIN32
|
||||
icalfileset_lock(impl);
|
||||
#endif
|
||||
|
||||
if(cluster_file_size > 0 ){
|
||||
icalerrorenum error;
|
||||
if((error = icalfileset_read_file(impl,mode))!= ICAL_NO_ERROR){
|
||||
|
@ -269,7 +270,7 @@ const char* icalfileset_path(icalfileset* cluster)
|
|||
|
||||
|
||||
int icalfileset_lock(icalfileset *cluster)
|
||||
{
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct icalfileset_impl *impl = (struct icalfileset_impl*)cluster;
|
||||
struct flock lock;
|
||||
|
@ -284,14 +285,14 @@ int icalfileset_lock(icalfileset *cluster)
|
|||
|
||||
rtrn = fcntl(impl->fd, F_SETLKW, &lock);
|
||||
|
||||
return rtrn;
|
||||
#else
|
||||
return 0;
|
||||
return rtrn;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int icalfileset_unlock(icalfileset *cluster)
|
||||
{
|
||||
{
|
||||
#ifndef WIN32
|
||||
struct icalfileset_impl *impl = (struct icalfileset_impl*)cluster;
|
||||
struct flock lock;
|
||||
|
@ -303,9 +304,8 @@ int icalfileset_unlock(icalfileset *cluster)
|
|||
lock.l_len = 0; /* #bytes (0 means to EOF) */
|
||||
|
||||
return (fcntl(impl->fd, F_UNLCK, &lock));
|
||||
|
||||
#else
|
||||
return 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -366,11 +366,11 @@ icalerrorenum icalfileset_commit(icalfileset* cluster)
|
|||
}
|
||||
|
||||
impl->changed = 0;
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
if(ftruncate(impl->fd,write_size) < 0){
|
||||
return ICAL_FILE_ERROR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ICAL_NO_ERROR;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 23 December 1999
|
||||
|
||||
|
||||
$Id: icalfileset.h,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $
|
||||
$Id: icalfileset.h,v 1.3 2001-12-21 18:56:36 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -32,11 +32,11 @@
|
|||
#include "ical.h"
|
||||
#include "icalset.h"
|
||||
#include "icalgauge.h"
|
||||
#ifndef WIN32
|
||||
#include <sys/types.h> /* For open() flags and mode */
|
||||
#include <sys/stat.h> /* For open() flags and mode */
|
||||
#include <fcntl.h> /* For open() flags and mode */
|
||||
#else
|
||||
|
||||
#ifdef WIN32
|
||||
#define mode_t int
|
||||
#endif
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 23 December 1999
|
||||
|
||||
|
||||
$Id: icalgauge.c,v 1.1 2001-11-15 19:27:25 mikep%oeone.com Exp $
|
||||
$Id: icalgauge.c,v 1.2 2001-12-21 18:56:37 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -94,47 +94,12 @@ void icalgauge_free(icalgauge* gauge)
|
|||
|
||||
if(impl->from){
|
||||
pvl_free(impl->from);
|
||||
}
|
||||
}
|
||||
|
||||
free(impl);
|
||||
|
||||
}
|
||||
|
||||
/* Convert a VQUERY component into a gauge */
|
||||
icalcomponent* icalgauge_make_gauge(icalcomponent* query);
|
||||
|
||||
/* icaldirset_test compares a component against a gauge, and returns
|
||||
true if the component passes the test
|
||||
|
||||
The gauge is a VCALENDAR component that specifies how to test the
|
||||
target components. The guage holds a collection of VEVENT, VTODO or
|
||||
VJOURNAL sub-components. Each of the sub-components has a
|
||||
collection of properties that are compared to corresponding
|
||||
properties in the target component, according to the
|
||||
X-LIC-COMPARETYPE parameters to the gauge's properties.
|
||||
|
||||
When a gauge has several sub-components, the results of testing the
|
||||
target against each of them is ORed together - the target
|
||||
component will pass if it matches any of the sub-components in the
|
||||
gauge. However, the results of matching the properties in a
|
||||
sub-component are ANDed -- the target must match every property in
|
||||
a gauge sub-component to match the sub-component.
|
||||
|
||||
Here is an example:
|
||||
|
||||
BEGIN:XROOT
|
||||
DTSTART;X-LIC-COMPARETYPE=LESS:19981025T020000
|
||||
ORGANIZER;X-LIC-COMPARETYPE=EQUAL:mrbig@host.com
|
||||
END:XROOT
|
||||
BEGIN:XROOT
|
||||
LOCATION;X-LIC-COMPARETYPE=EQUAL:McNary's Pub
|
||||
END:XROOT
|
||||
|
||||
This gauge has two sub-components; one which will match a VEVENT
|
||||
based on start time, and organizer, and another that matches based
|
||||
on LOCATION. A target component will pass the test if it matched
|
||||
either of the sub-components.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
int icalgauge_compare_recurse(icalcomponent* comp, icalcomponent* gauge)
|
||||
{
|
||||
|
@ -264,8 +229,7 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp)
|
|||
inner = icalcomponent_get_first_real_component(comp);
|
||||
|
||||
if(inner == 0){
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
return 0;
|
||||
inner = comp;
|
||||
}
|
||||
|
||||
|
||||
|
@ -301,7 +265,7 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp)
|
|||
vk = icalenum_property_kind_to_value_kind(w->prop);
|
||||
|
||||
if(vk == ICAL_NO_VALUE){
|
||||
icalerror_set_errno(ICAL_INTERNAL_ERROR);
|
||||
icalerror_set_errno(ICAL_INTERNAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -354,7 +318,7 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp)
|
|||
local_pass = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this_clause = local_pass > 0 ? 1 : 0;
|
||||
|
||||
/* Now look at the logic operator for this clause to see how
|
||||
|
@ -362,12 +326,15 @@ int icalgauge_compare(icalgauge* gauge,icalcomponent* comp)
|
|||
|
||||
if(w->logic == ICALGAUGELOGIC_AND){
|
||||
last_clause = this_clause && last_clause;
|
||||
} else if(w->logic == ICALGAUGELOGIC_AND) {
|
||||
} else if(w->logic == ICALGAUGELOGIC_OR) {
|
||||
last_clause = this_clause || last_clause;
|
||||
} else {
|
||||
last_clause = this_clause;
|
||||
}
|
||||
|
||||
icalvalue_free(v);
|
||||
}
|
||||
|
||||
|
||||
return last_clause;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 23 December 1999
|
||||
|
||||
|
||||
$Id: icalgauge.h,v 1.1 2001-11-15 19:27:25 mikep%oeone.com Exp $
|
||||
$Id: icalgauge.h,v 1.2 2001-12-21 18:56:37 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -39,7 +39,7 @@ char* icalgauge_as_sql(icalcomponent* gauge);
|
|||
|
||||
void icalgauge_dump(icalcomponent* gauge);
|
||||
|
||||
/* Return true is comp matches the gauge. The component must be in
|
||||
/* Return true if comp matches the gauge. The component must be in
|
||||
cannonical form -- a VCALENDAR with one VEVENT, VTODO or VJOURNAL
|
||||
sub component */
|
||||
int icalgauge_compare(icalgauge* g, icalcomponent* comp);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalmessage.c
|
||||
CREATOR: ebusboom 07 Nov 2000
|
||||
|
||||
$Id: icalmessage.c,v 1.1 2001-11-15 19:27:25 mikep%oeone.com Exp $
|
||||
$Id: icalmessage.c,v 1.2 2001-12-21 18:56:38 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -353,10 +353,7 @@ icalcomponent* icalmessage_new_error_reply(icalcomponent* c,
|
|||
rs.debug = debug;
|
||||
|
||||
icalcomponent_add_property(inner,
|
||||
icalproperty_new_requeststatus(
|
||||
icalreqstattype_as_string(rs)
|
||||
)
|
||||
);
|
||||
icalproperty_new_requeststatus(rs));
|
||||
} else { /* code == ICAL_UNKNOWN_STATUS */
|
||||
|
||||
/* Copy all of the request status properties */
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
icalheapset Store components on the heap
|
||||
icalmysqlset Store components in a mysql database.
|
||||
|
||||
$Id: icalset.c,v 1.2 2001-11-22 19:21:54 mikep%oeone.com Exp $
|
||||
$Id: icalset.c,v 1.3 2001-12-21 18:56:38 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -43,7 +43,6 @@
|
|||
#include <stdlib.h>
|
||||
/*#include "icalheapset.h"*/
|
||||
/*#include "icalmysqlset.h"*/
|
||||
#include <string.h>
|
||||
|
||||
#define ICALSET_ID "set "
|
||||
|
||||
|
@ -266,7 +265,7 @@ void icalset_free(icalset* set)
|
|||
struct icalset_impl impl = icalset_get_impl(set);
|
||||
(*(impl.fp->free))(impl.derived_impl);
|
||||
|
||||
if(strcmp((char*)set,ICALSET_ID)) {
|
||||
if(!strcmp((char*)set,ICALSET_ID)) {
|
||||
free(set);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
FILE: icalspanlist.c
|
||||
CREATOR: ebusboom 23 aug 2000
|
||||
|
||||
$Id: icalspanlist.c,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalspanlist.c,v 1.3 2001-12-21 18:56:38 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -30,7 +30,6 @@
|
|||
#include "icalspanlist.h"
|
||||
#include "pvl.h"
|
||||
#include <stdlib.h> /* for free and malloc */
|
||||
#include <string.h>
|
||||
|
||||
struct icalspanlist_impl {
|
||||
pvl_list spans;
|
||||
|
@ -212,7 +211,9 @@ void icalspanlist_free(icalspanlist* s)
|
|||
|
||||
pvl_free(impl->spans);
|
||||
|
||||
impl->spans = 0;
|
||||
impl->spans = 0;
|
||||
|
||||
free(impl);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
CREATOR: eric 23 December 1999
|
||||
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -28,6 +28,7 @@
|
|||
|
||||
#ifndef ICALGAUGE_H
|
||||
#define ICALGAUGE_H
|
||||
|
||||
#ifdef WIN32
|
||||
#define mode_t int
|
||||
#endif
|
||||
|
@ -42,7 +43,7 @@ char* icalgauge_as_sql(icalcomponent* gauge);
|
|||
|
||||
void icalgauge_dump(icalcomponent* gauge);
|
||||
|
||||
/* Return true is comp matches the gauge. The component must be in
|
||||
/* Return true if comp matches the gauge. The component must be in
|
||||
cannonical form -- a VCALENDAR with one VEVENT, VTODO or VJOURNAL
|
||||
sub component */
|
||||
int icalgauge_compare(icalgauge* g, icalcomponent* comp);
|
||||
|
@ -66,7 +67,7 @@ icalcomponent* icalgauge_new_clone(icalgauge* g, icalcomponent* comp);
|
|||
icalheapset Store components on the heap
|
||||
icalmysqlset Store components in a mysql database.
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -167,7 +168,7 @@ icalcomponent* icalset_get_next_component(icalset* set);
|
|||
CREATOR: eric 23 December 1999
|
||||
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -269,7 +270,7 @@ icalcomponent* icalfileset_get_component(icalfileset* cluster);
|
|||
CREATOR: eric 28 November 1999
|
||||
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -350,7 +351,7 @@ icalcomponent* icaldirset_get_next_component(icaldirset* store);
|
|||
CREATOR: eric 23 December 1999
|
||||
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -415,7 +416,7 @@ icalset* icalcalendar_get_freebusy(icalcalendar* calendar);
|
|||
CREATOR: eric 21 Aug 2000
|
||||
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -438,42 +439,14 @@ icalset* icalcalendar_get_freebusy(icalcalendar* calendar);
|
|||
#define ICALCLASSIFY_H
|
||||
|
||||
|
||||
|
||||
typedef enum icalclass {
|
||||
ICAL_NO_CLASS,
|
||||
ICAL_PUBLISH_NEW_CLASS,
|
||||
ICAL_PUBLISH_UPDATE_CLASS,
|
||||
ICAL_PUBLISH_FREEBUSY_CLASS,
|
||||
ICAL_REQUEST_NEW_CLASS,
|
||||
ICAL_REQUEST_UPDATE_CLASS,
|
||||
ICAL_REQUEST_RESCHEDULE_CLASS,
|
||||
ICAL_REQUEST_DELEGATE_CLASS,
|
||||
ICAL_REQUEST_NEW_ORGANIZER_CLASS,
|
||||
ICAL_REQUEST_FORWARD_CLASS,
|
||||
ICAL_REQUEST_STATUS_CLASS,
|
||||
ICAL_REQUEST_FREEBUSY_CLASS,
|
||||
ICAL_REPLY_ACCEPT_CLASS,
|
||||
ICAL_REPLY_DECLINE_CLASS,
|
||||
ICAL_REPLY_CRASHER_ACCEPT_CLASS,
|
||||
ICAL_REPLY_CRASHER_DECLINE_CLASS,
|
||||
ICAL_ADD_INSTANCE_CLASS,
|
||||
ICAL_CANCEL_EVENT_CLASS,
|
||||
ICAL_CANCEL_INSTANCE_CLASS,
|
||||
ICAL_CANCEL_ALL_CLASS,
|
||||
ICAL_REFRESH_CLASS,
|
||||
ICAL_COUNTER_CLASS,
|
||||
ICAL_DECLINECOUNTER_CLASS,
|
||||
ICAL_MALFORMED_CLASS,
|
||||
ICAL_OBSOLETE_CLASS, /* 21 */
|
||||
ICAL_MISSEQUENCED_CLASS, /* 22 */
|
||||
ICAL_UNKNOWN_CLASS /* 23 */
|
||||
} ical_class;
|
||||
|
||||
ical_class icalclassify(icalcomponent* c,icalcomponent* match,
|
||||
icalproperty_xlicclass icalclassify(icalcomponent* c,icalcomponent* match,
|
||||
const char* user);
|
||||
|
||||
icalcomponent* icalclassify_find_overlaps(icalset* set, icalcomponent* comp);
|
||||
|
||||
char* icalclassify_class_to_string(icalproperty_xlicclass c);
|
||||
|
||||
|
||||
#endif /* ICALCLASSIFY_H*/
|
||||
|
||||
|
||||
|
@ -486,7 +459,7 @@ icalcomponent* icalclassify_find_overlaps(icalset* set, icalcomponent* comp);
|
|||
CREATOR: eric 21 Aug 2000
|
||||
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -538,7 +511,7 @@ void icalspanlist_dump(icalspanlist* s);
|
|||
CREATOR: eric 07 Nov 2000
|
||||
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -607,7 +580,7 @@ icalcomponent* icalmessage_new_error_reply(icalcomponent* c,
|
|||
FILE: icalcstp.h
|
||||
CREATOR: eric 20 April 1999
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -685,7 +658,7 @@ icalcstp_command icalcstp_string_to_command(const char* str);
|
|||
FILE: icalcstpclient.h
|
||||
CREATOR: eric 4 Feb 01
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -783,7 +756,7 @@ icalerrorenum icalcstpc_sendata(icalcstpc* cstp, unsigned int time,
|
|||
FILE: icalcstpserver.h
|
||||
CREATOR: eric 13 Feb 01
|
||||
|
||||
$Id: icalss.h,v 1.2 2001-11-22 19:21:55 mikep%oeone.com Exp $
|
||||
$Id: icalss.h,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
/* A lexical scanner generated by flex */
|
||||
|
||||
/* Scanner skeleton version:
|
||||
* $Header: /home/jrmuizel/cvs-mirror/mozilla/other-licenses/libical/src/libicalss/Attic/icalsslexer.c,v 1.2 2001-11-22 19:21:56 mikep%oeone.com Exp $
|
||||
* $Header: /home/jrmuizel/cvs-mirror/mozilla/other-licenses/libical/src/libicalss/Attic/icalsslexer.c,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
*/
|
||||
|
||||
#define FLEX_SCANNER
|
||||
|
@ -27,10 +27,11 @@
|
|||
#define YY_FLEX_MINOR_VERSION 5
|
||||
|
||||
#include <stdio.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
|
||||
#ifdef c_plusplus
|
||||
#ifndef __cplusplus
|
||||
|
@ -304,15 +305,15 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
|
|||
yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \
|
||||
yy_c_buf_p = yy_cp;
|
||||
|
||||
#define YY_NUM_RULES 19
|
||||
#define YY_END_OF_BUFFER 20
|
||||
static yyconst short int yy_accept[47] =
|
||||
#define YY_NUM_RULES 20
|
||||
#define YY_END_OF_BUFFER 21
|
||||
static yyconst short int yy_accept[48] =
|
||||
{ 0,
|
||||
0, 0, 0, 0, 0, 0, 20, 18, 14, 14,
|
||||
18, 13, 17, 4, 15, 7, 5, 8, 17, 17,
|
||||
17, 17, 17, 14, 6, 0, 17, 9, 10, 17,
|
||||
17, 12, 17, 17, 16, 11, 17, 17, 17, 2,
|
||||
17, 17, 17, 3, 1, 0
|
||||
0, 0, 0, 0, 0, 0, 21, 19, 15, 15,
|
||||
19, 14, 18, 4, 16, 8, 5, 9, 18, 18,
|
||||
18, 18, 18, 15, 7, 0, 18, 10, 6, 11,
|
||||
18, 18, 13, 18, 18, 17, 12, 18, 18, 18,
|
||||
2, 18, 18, 18, 3, 1, 0
|
||||
} ;
|
||||
|
||||
static yyconst int yy_ec[256] =
|
||||
|
@ -320,17 +321,17 @@ static yyconst int yy_ec[256] =
|
|||
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
|
||||
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 2, 4, 1, 1, 1, 1, 1, 5, 1,
|
||||
1, 6, 1, 7, 6, 6, 1, 6, 6, 6,
|
||||
6, 6, 6, 6, 6, 6, 6, 1, 8, 9,
|
||||
10, 11, 1, 1, 12, 6, 13, 14, 15, 16,
|
||||
6, 17, 6, 6, 6, 18, 19, 20, 21, 6,
|
||||
6, 22, 23, 24, 6, 6, 25, 6, 6, 6,
|
||||
1, 1, 1, 1, 1, 1, 12, 6, 13, 14,
|
||||
1, 4, 5, 1, 1, 1, 1, 1, 6, 1,
|
||||
1, 7, 1, 8, 7, 7, 1, 7, 7, 7,
|
||||
7, 7, 7, 7, 7, 7, 7, 1, 9, 10,
|
||||
11, 12, 1, 1, 13, 7, 14, 15, 16, 17,
|
||||
7, 18, 7, 7, 7, 19, 20, 21, 22, 7,
|
||||
7, 23, 24, 25, 7, 7, 26, 7, 7, 7,
|
||||
1, 1, 1, 1, 1, 1, 13, 7, 14, 15,
|
||||
|
||||
15, 16, 6, 17, 6, 6, 6, 18, 19, 20,
|
||||
21, 6, 6, 22, 23, 24, 6, 6, 25, 6,
|
||||
6, 6, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
16, 17, 7, 18, 7, 7, 7, 19, 20, 21,
|
||||
22, 7, 7, 23, 24, 25, 7, 7, 26, 7,
|
||||
7, 7, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
|
@ -347,53 +348,55 @@ static yyconst int yy_ec[256] =
|
|||
1, 1, 1, 1, 1
|
||||
} ;
|
||||
|
||||
static yyconst int yy_meta[26] =
|
||||
static yyconst int yy_meta[27] =
|
||||
{ 0,
|
||||
1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
|
||||
1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2
|
||||
1, 1, 1, 2, 1, 1, 3, 1, 1, 1,
|
||||
1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
3, 3, 3, 3, 3, 3
|
||||
} ;
|
||||
|
||||
static yyconst short int yy_base[49] =
|
||||
static yyconst short int yy_base[50] =
|
||||
{ 0,
|
||||
0, 0, 0, 0, 0, 0, 53, 54, 24, 26,
|
||||
42, 0, 0, 54, 54, 41, 54, 40, 29, 26,
|
||||
25, 31, 28, 28, 54, 39, 0, 54, 54, 29,
|
||||
21, 0, 23, 25, 54, 0, 20, 23, 15, 0,
|
||||
23, 20, 10, 0, 0, 54, 31, 30
|
||||
0, 0, 0, 0, 0, 0, 59, 60, 25, 28,
|
||||
47, 0, 0, 60, 60, 46, 45, 44, 33, 30,
|
||||
29, 35, 32, 31, 60, 43, 0, 60, 60, 60,
|
||||
33, 25, 0, 27, 29, 60, 0, 24, 27, 19,
|
||||
0, 27, 24, 14, 0, 0, 60, 34, 35
|
||||
} ;
|
||||
|
||||
static yyconst short int yy_def[49] =
|
||||
static yyconst short int yy_def[50] =
|
||||
{ 0,
|
||||
46, 1, 1, 1, 1, 1, 46, 46, 46, 46,
|
||||
46, 47, 48, 46, 46, 46, 46, 46, 48, 48,
|
||||
48, 48, 48, 46, 46, 47, 48, 46, 46, 48,
|
||||
48, 48, 48, 48, 46, 48, 48, 48, 48, 48,
|
||||
48, 48, 48, 48, 48, 0, 46, 46
|
||||
47, 1, 1, 1, 1, 1, 47, 47, 47, 47,
|
||||
47, 48, 49, 47, 47, 47, 47, 47, 49, 49,
|
||||
49, 49, 49, 47, 47, 48, 49, 47, 47, 47,
|
||||
49, 49, 49, 49, 49, 47, 49, 49, 49, 49,
|
||||
49, 49, 49, 49, 49, 49, 0, 47, 47
|
||||
} ;
|
||||
|
||||
static yyconst short int yy_nxt[80] =
|
||||
static yyconst short int yy_nxt[87] =
|
||||
{ 0,
|
||||
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
|
||||
18, 19, 13, 13, 13, 20, 13, 13, 13, 13,
|
||||
21, 13, 22, 13, 23, 24, 24, 24, 24, 24,
|
||||
24, 27, 26, 45, 44, 43, 42, 41, 40, 39,
|
||||
38, 37, 36, 35, 34, 33, 32, 31, 30, 29,
|
||||
28, 25, 46, 7, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46, 46
|
||||
8, 9, 10, 9, 11, 12, 13, 14, 15, 16,
|
||||
17, 18, 19, 13, 13, 13, 20, 13, 13, 13,
|
||||
13, 21, 13, 22, 13, 23, 24, 24, 24, 24,
|
||||
24, 24, 24, 24, 24, 26, 26, 27, 46, 45,
|
||||
44, 43, 42, 41, 40, 39, 38, 37, 36, 35,
|
||||
34, 33, 32, 31, 30, 29, 28, 25, 47, 7,
|
||||
47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
|
||||
47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
|
||||
47, 47, 47, 47, 47, 47
|
||||
} ;
|
||||
|
||||
static yyconst short int yy_chk[80] =
|
||||
static yyconst short int yy_chk[87] =
|
||||
{ 0,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 9, 9, 10, 10, 24,
|
||||
24, 48, 47, 43, 42, 41, 39, 38, 37, 34,
|
||||
33, 31, 30, 26, 23, 22, 21, 20, 19, 18,
|
||||
16, 11, 7, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
|
||||
46, 46, 46, 46, 46, 46, 46, 46, 46
|
||||
1, 1, 1, 1, 1, 1, 9, 9, 9, 10,
|
||||
10, 10, 24, 24, 24, 48, 48, 49, 44, 43,
|
||||
42, 40, 39, 38, 35, 34, 32, 31, 26, 23,
|
||||
22, 21, 20, 19, 18, 17, 16, 11, 7, 47,
|
||||
47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
|
||||
47, 47, 47, 47, 47, 47, 47, 47, 47, 47,
|
||||
47, 47, 47, 47, 47, 47
|
||||
} ;
|
||||
|
||||
static yy_state_type yy_last_accepting_state;
|
||||
|
@ -422,7 +425,7 @@ char *yytext_ptr;
|
|||
|
||||
DESCRIPTION:
|
||||
|
||||
$Id: icalsslexer.c,v 1.2 2001-11-22 19:21:56 mikep%oeone.com Exp $
|
||||
$Id: icalsslexer.c,v 1.3 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -462,7 +465,7 @@ void icalparser_clear_flex_input();
|
|||
#define sql 1
|
||||
#define string_value 2
|
||||
|
||||
#line 465 "lex.ss.c"
|
||||
#line 467 "lex.ss.c"
|
||||
|
||||
/* Macros after this point can all be overridden by user definitions in
|
||||
* section 1.
|
||||
|
@ -620,7 +623,7 @@ YY_DECL
|
|||
|
||||
|
||||
|
||||
#line 623 "lex.ss.c"
|
||||
#line 625 "lex.ss.c"
|
||||
|
||||
if ( yy_init )
|
||||
{
|
||||
|
@ -671,13 +674,13 @@ yy_match:
|
|||
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
||||
{
|
||||
yy_current_state = (int) yy_def[yy_current_state];
|
||||
if ( yy_current_state >= 47 )
|
||||
if ( yy_current_state >= 48 )
|
||||
yy_c = yy_meta[(unsigned int) yy_c];
|
||||
}
|
||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||
++yy_cp;
|
||||
}
|
||||
while ( yy_base[yy_current_state] != 54 );
|
||||
while ( yy_base[yy_current_state] != 60 );
|
||||
|
||||
yy_find_action:
|
||||
yy_act = yy_accept[yy_current_state];
|
||||
|
@ -731,56 +734,61 @@ YY_RULE_SETUP
|
|||
case 6:
|
||||
YY_RULE_SETUP
|
||||
#line 80 "icalsslexer.l"
|
||||
{ return NOTEQUALS; }
|
||||
{ return EQUALS; }
|
||||
YY_BREAK
|
||||
case 7:
|
||||
YY_RULE_SETUP
|
||||
#line 81 "icalsslexer.l"
|
||||
{ return LESS; }
|
||||
{ return NOTEQUALS; }
|
||||
YY_BREAK
|
||||
case 8:
|
||||
YY_RULE_SETUP
|
||||
#line 82 "icalsslexer.l"
|
||||
{ return GREATER; }
|
||||
{ return LESS; }
|
||||
YY_BREAK
|
||||
case 9:
|
||||
YY_RULE_SETUP
|
||||
#line 83 "icalsslexer.l"
|
||||
{ return LESSEQUALS; }
|
||||
{ return GREATER; }
|
||||
YY_BREAK
|
||||
case 10:
|
||||
YY_RULE_SETUP
|
||||
#line 84 "icalsslexer.l"
|
||||
{ return GREATEREQUALS; }
|
||||
{ return LESSEQUALS; }
|
||||
YY_BREAK
|
||||
case 11:
|
||||
YY_RULE_SETUP
|
||||
#line 85 "icalsslexer.l"
|
||||
{ return AND; }
|
||||
{ return GREATEREQUALS; }
|
||||
YY_BREAK
|
||||
case 12:
|
||||
YY_RULE_SETUP
|
||||
#line 86 "icalsslexer.l"
|
||||
{ return OR; }
|
||||
{ return AND; }
|
||||
YY_BREAK
|
||||
case 13:
|
||||
YY_RULE_SETUP
|
||||
#line 87 "icalsslexer.l"
|
||||
{ return QUOTE; }
|
||||
{ return OR; }
|
||||
YY_BREAK
|
||||
case 14:
|
||||
YY_RULE_SETUP
|
||||
#line 88 "icalsslexer.l"
|
||||
;
|
||||
{ return QUOTE; }
|
||||
YY_BREAK
|
||||
case 15:
|
||||
YY_RULE_SETUP
|
||||
#line 89 "icalsslexer.l"
|
||||
{ return EOL; }
|
||||
;
|
||||
YY_BREAK
|
||||
case 16:
|
||||
YY_RULE_SETUP
|
||||
#line 90 "icalsslexer.l"
|
||||
{ return EOL; }
|
||||
YY_BREAK
|
||||
case 17:
|
||||
YY_RULE_SETUP
|
||||
#line 92 "icalsslexer.l"
|
||||
{
|
||||
int c = input();
|
||||
unput(c);
|
||||
|
@ -792,23 +800,26 @@ YY_RULE_SETUP
|
|||
}
|
||||
}
|
||||
YY_BREAK
|
||||
case 17:
|
||||
YY_RULE_SETUP
|
||||
#line 101 "icalsslexer.l"
|
||||
{ sslval.v_string= icalmemory_tmp_copy(sstext);
|
||||
return STRING; }
|
||||
YY_BREAK
|
||||
case 18:
|
||||
YY_RULE_SETUP
|
||||
#line 105 "icalsslexer.l"
|
||||
{ return yytext[0]; }
|
||||
#line 103 "icalsslexer.l"
|
||||
{
|
||||
|
||||
sslval.v_string= icalmemory_tmp_copy(sstext);
|
||||
return STRING;
|
||||
}
|
||||
YY_BREAK
|
||||
case 19:
|
||||
YY_RULE_SETUP
|
||||
#line 107 "icalsslexer.l"
|
||||
#line 110 "icalsslexer.l"
|
||||
{ return yytext[0]; }
|
||||
YY_BREAK
|
||||
case 20:
|
||||
YY_RULE_SETUP
|
||||
#line 112 "icalsslexer.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 811 "lex.ss.c"
|
||||
#line 821 "lex.ss.c"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
case YY_STATE_EOF(sql):
|
||||
case YY_STATE_EOF(string_value):
|
||||
|
@ -1102,7 +1113,7 @@ static yy_state_type yy_get_previous_state()
|
|||
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
||||
{
|
||||
yy_current_state = (int) yy_def[yy_current_state];
|
||||
if ( yy_current_state >= 47 )
|
||||
if ( yy_current_state >= 48 )
|
||||
yy_c = yy_meta[(unsigned int) yy_c];
|
||||
}
|
||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||
|
@ -1137,11 +1148,11 @@ yy_state_type yy_current_state;
|
|||
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
|
||||
{
|
||||
yy_current_state = (int) yy_def[yy_current_state];
|
||||
if ( yy_current_state >= 47 )
|
||||
if ( yy_current_state >= 48 )
|
||||
yy_c = yy_meta[(unsigned int) yy_c];
|
||||
}
|
||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||
yy_is_jam = (yy_current_state == 46);
|
||||
yy_is_jam = (yy_current_state == 47);
|
||||
|
||||
return yy_is_jam ? 0 : yy_current_state;
|
||||
}
|
||||
|
@ -1691,7 +1702,7 @@ int main()
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
#line 107 "icalsslexer.l"
|
||||
#line 112 "icalsslexer.l"
|
||||
|
||||
|
||||
int sswrap()
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
DESCRIPTION:
|
||||
|
||||
$Id: icalsslexer.l,v 1.1 2001-11-15 19:27:31 mikep%oeone.com Exp $
|
||||
$Id: icalsslexer.l,v 1.2 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -77,6 +77,7 @@ FROM { return FROM; }
|
|||
WHERE { return WHERE; }
|
||||
, { return COMMA; }
|
||||
"=" { return EQUALS; }
|
||||
"==" { return EQUALS; }
|
||||
"!=" { return NOTEQUALS; }
|
||||
"<" { return LESS; }
|
||||
">" { return GREATER; }
|
||||
|
@ -87,7 +88,8 @@ OR { return OR; }
|
|||
\' { return QUOTE; }
|
||||
[ \t\n\r]+ ;
|
||||
; { return EOL; }
|
||||
\'[\*A-Za-z0-9\-\.]+\' {
|
||||
|
||||
\'[\*A-Za-z0-9\-\. ]+\' {
|
||||
int c = input();
|
||||
unput(c);
|
||||
if(c!='\''){
|
||||
|
@ -98,8 +100,11 @@ OR { return OR; }
|
|||
}
|
||||
}
|
||||
|
||||
[\*A-Za-z0-9\-\.]+ { sslval.v_string= icalmemory_tmp_copy(sstext);
|
||||
return STRING; }
|
||||
[\*A-Za-z0-9\-\.]+ {
|
||||
|
||||
sslval.v_string= icalmemory_tmp_copy(sstext);
|
||||
return STRING;
|
||||
}
|
||||
|
||||
|
||||
. { return yytext[0]; }
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
DESCRIPTION:
|
||||
|
||||
$Id: icalssyacc.c,v 1.1 2001-11-15 19:27:32 mikep%oeone.com Exp $
|
||||
$Id: icalssyacc.c,v 1.2 2001-12-21 18:56:39 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -76,7 +76,7 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1);
|
|||
void set_logic(struct icalgauge_impl* impl,icalgaugelogic l);
|
||||
void sserror(char *s); /* Don't know why I need this.... */
|
||||
|
||||
|
||||
extern char* sstext;
|
||||
|
||||
|
||||
#line 52 "icalssyacc.y"
|
||||
|
@ -1181,5 +1181,5 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1)
|
|||
|
||||
|
||||
void sserror(char *s){
|
||||
fprintf(stderr,"Parse error \'%s\'\n", s);
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
DESCRIPTION:
|
||||
|
||||
$Id: icalssyacc.y,v 1.1 2001-11-15 19:27:32 mikep%oeone.com Exp $
|
||||
$Id: icalssyacc.y,v 1.2 2001-12-21 18:56:40 mikep%oeone.com Exp $
|
||||
$Locker: $
|
||||
|
||||
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
|
||||
|
@ -45,7 +45,7 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1);
|
|||
void set_logic(struct icalgauge_impl* impl,icalgaugelogic l);
|
||||
void sserror(char *s); /* Don't know why I need this.... */
|
||||
|
||||
|
||||
extern char* sstext;
|
||||
|
||||
%}
|
||||
|
||||
|
@ -241,5 +241,5 @@ void ssyacc_add_from(struct icalgauge_impl* impl, char* str1)
|
|||
|
||||
|
||||
void sserror(char *s){
|
||||
fprintf(stderr,"Parse error \'%s\'\n", s);
|
||||
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
|
||||
}
|
||||
|
|
|
@ -1,107 +1,107 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
MODULE = libicalss
|
||||
EXPORTS = icalss.h
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build SUN-JAVA/JPEG Library (NEW)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..\..\..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
EXPORT_LIBRARY=1
|
||||
LIBRARY_NAME=libicalss$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
PDBFILE=$(LIBRARY_NAME).pdb
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any local options for the make tools
|
||||
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
|
||||
#// -Zi -GM needed to compile mmx functions in assembly.
|
||||
LCFLAGS = -Zi -GM -DPACKAGE=\"libcal\" -DVERSION=$(VERSION_NUMBER)
|
||||
LINCS = -I$(XPDIST)\include -I..\libical
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBICAL_OBJS= .\$(OBJDIR)\icalclassify.obj \
|
||||
.\$(OBJDIR)\icalcstp.obj \
|
||||
.\$(OBJDIR)\icalcstpclient.obj \
|
||||
.\$(OBJDIR)\icalcstpserver.obj \
|
||||
.\$(OBJDIR)\icaldirset.obj \
|
||||
.\$(OBJDIR)\icalfileset.obj \
|
||||
.\$(OBJDIR)\icalgauge.obj \
|
||||
.\$(OBJDIR)\icalmessage.obj \
|
||||
.\$(OBJDIR)\icalset.obj \
|
||||
.\$(OBJDIR)\icalspanlist.obj \
|
||||
.\$(OBJDIR)\icalsslexer.obj \
|
||||
.\$(OBJDIR)\icalssyacc.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
|
||||
OBJS= ..\libical\$(OBJDIR)\libical$(MOZ_BITS)$(VERSION_NUMBER).lib \
|
||||
$(LIBICAL_OBJS) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib
|
||||
MAPFILE= $(DLLNAME).map
|
||||
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
#
|
||||
|
||||
|
||||
|
||||
MODULE = libicalss
|
||||
EXPORTS = icalss.h
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Makefile to build SUN-JAVA/JPEG Library (NEW)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Specify the depth of the current directory relative to the
|
||||
#// root of NS
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
DEPTH= ..\..\..\..
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Make Variables here: (ie. PDFFILE, MAPFILE, ...)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
EXPORT_LIBRARY=1
|
||||
LIBRARY_NAME=libicalss$(MOZ_BITS)$(VERSION_NUMBER)
|
||||
PDBFILE=$(LIBRARY_NAME).pdb
|
||||
MAPFILE=$(LIBRARY_NAME).map
|
||||
!if "$(MOZ_BITS)" == "16"
|
||||
DEFFILE=jpg$(MOZ_BIGS)$(VERSION_NUMBER).def
|
||||
!endif
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any local options for the make tools
|
||||
#// (ie. LCFLAGS, LLFLAGS, LLIBS, LINCS)
|
||||
#// -Zi -GM needed to compile mmx functions in assembly.
|
||||
LCFLAGS = -Zi -GM -DPACKAGE=\"libcal\" -DVERSION=$(VERSION_NUMBER)
|
||||
LINCS = -I$(XPDIST)\include -I..\libical
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define the files necessary to build the target (ie. OBJS)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBICAL_OBJS= .\$(OBJDIR)\icalclassify.obj \
|
||||
.\$(OBJDIR)\icalcstp.obj \
|
||||
.\$(OBJDIR)\icalcstpclient.obj \
|
||||
.\$(OBJDIR)\icalcstpserver.obj \
|
||||
.\$(OBJDIR)\icaldirset.obj \
|
||||
.\$(OBJDIR)\icalfileset.obj \
|
||||
.\$(OBJDIR)\icalgauge.obj \
|
||||
.\$(OBJDIR)\icalmessage.obj \
|
||||
.\$(OBJDIR)\icalset.obj \
|
||||
.\$(OBJDIR)\icalspanlist.obj \
|
||||
.\$(OBJDIR)\icalsslexer.obj \
|
||||
.\$(OBJDIR)\icalssyacc.obj \
|
||||
$(NULL)
|
||||
|
||||
|
||||
|
||||
OBJS= ..\libical\$(OBJDIR)\libical$(MOZ_BITS)$(VERSION_NUMBER).lib \
|
||||
$(LIBICAL_OBJS) \
|
||||
$(NULL)
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Define any Public Targets here (ie. PROGRAM, LIBRARY, DLL, ...)
|
||||
#// (these must be defined before the common makefiles are included)
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
LIBRARY = .\$(OBJDIR)\$(LIBRARY_NAME).lib
|
||||
MAPFILE= $(DLLNAME).map
|
||||
|
||||
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
#//
|
||||
#// Include the common makefile rules
|
||||
#//
|
||||
#//------------------------------------------------------------------------
|
||||
include <$(DEPTH)/config/rules.mak>
|
||||
|
|
|
@ -3,8 +3,8 @@ lib_LTLIBRARIES = libicalvcal.la
|
|||
INCLUDES = \
|
||||
-I$(top_builddir) \
|
||||
-I$(top_srcdir)/src/libical \
|
||||
-I$(top_srcdir)/src/libicalss \
|
||||
-I$(srcdir)
|
||||
-I$(top_builddir)/src/libical \
|
||||
-I$(top_srcdir)/src/libicalss
|
||||
|
||||
libicalvcal_la_LDFLAGS = -version-info 0:0:0
|
||||
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче