Adding in libical source.

This commit is contained in:
mikep%oeone.com 2001-11-15 19:28:01 +00:00
parent 3251934fef
commit 771298d6d9
215 changed files with 91424 additions and 0 deletions

View File

@ -0,0 +1 @@
Eric Busboom <eric@softwarestudio.org>

View File

View File

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

View File

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

View File

@ -0,0 +1,9 @@
EXTRA_DIST = \
ChangeLog \
README \
TEST \
TODO
SUBDIRS = design-data doc scripts test-data src examples

View File

@ -0,0 +1,370 @@
# 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.
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@
EXTRA_DIST = ChangeLog README TEST TODO
SUBDIRS = design-data doc scripts test-data src examples
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
Makefile.am Makefile.in NEWS THANKS TODO acconfig.h aclocal.m4 \
config.guess config.h.in config.sub configure configure.in install-sh \
ltconfig ltmain.sh missing mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
@if test ! -f $@; then \
rm -f stamp-h; \
$(MAKE) stamp-h; \
else :; fi
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
$(SHELL) ./config.status
@echo timestamp > stamp-h 2> /dev/null
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f config.h
maintainer-clean-hdr:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
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: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
-rm -f TAGS ID
maintainer-clean-tags:
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
-rm -rf $(distdir)
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
dc_install_base=`cd $(distdir)/=inst && pwd`; \
cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) dist
-rm -rf $(distdir)
@banner="$(distdir).tar.gz is ready for distribution"; \
dashes=`echo "$$banner" | sed s/./=/g`; \
echo "$$dashes"; \
echo "$$banner"; \
echo "$$dashes"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
-rm -rf $(distdir)
distdir: $(DISTFILES)
-rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@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
for subdir in $(SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
dvi: dvi-recursive
check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
all-recursive-am: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
install-exec-am:
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am:
uninstall: uninstall-recursive
all-am: Makefile config.h
all-redirect: all-recursive-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr 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-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
install-data-recursive uninstall-data-recursive install-exec-recursive \
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
install-exec-am install-exec install-data-am install-data install-am \
install uninstall-am uninstall all-redirect all-am all installdirs-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# 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:

447
other-licenses/libical/NEWS Normal file
View File

@ -0,0 +1,447 @@
Version 0.23, 26 Mar 01 ( cvs tag libical-0-23 )
------------------------------------------------
**** Incompatibilities with previous versions ****
icalparameter_new_rsvp
icalparameter_get_rsvp
icalparameter_set_rsvp
These routines now take and return ICAL_RSVP_TRUE and
ICAL_RSVP_FALSE instead of 0 and 1
icalenum_*_to_*
These routines have been moved to icalproperty, icalparameter
or icalvalue
Python interface: An alpha level python interface is available in
src/python.
Perl interface: A pre-alpha level interface is available in
src/Net-ICal-Libical
Code Autogeneration: Converted all of the important files in
design-data/ to .csv files and improved the code that is generated
from them. Now all of the enumerations for property, parameters and
values are generated from thes files, as are the string
representations for the enumerations. You can add a new property or
parameter to the system simply by adding a line to the appropriate
file in design-data/
Recurrences: Improved the recurrence code by fixing bugs in MONTHLY
recurrences and completely re-implementing expand_year_days() for
YEARLY recurrences. Hubert V's aided in testing.
Build system: JP Rosevear made several improvements to the build
system. Now checking out the code from cvs should give to a complete
but minimal distribution, without any of the autognerated files.
Interface changes: Nearly all of the icalenum routines for converting
between strings and enumerations have been moved out of icalenum into
icalproperty, icalparameter and icalvalue. This means that their names
have changed, although #defines have been added to icalenum.h to map
back to the old names.
Added src/libical/icllangbind.c that has some functions to make it
easier to bind libical to other languages.
Version 0.22, 15 Jan 01 ( cvs tag libical-0-22)
----------------------------------------------
Many improvements to the time routines in icaltime.c. I think that
they actually make sense now. Note that there is an interface change
with icaltime_from_timet() -- I removed the is_utc parameter, since
all timet values are in UTC. Use icaltime_from_int() if you really
want the old interface
Major improvements to icalfileset. icalfileset_select now works and so
does file locking.
Minor revision to the documentation, but it does include a new section
on file storage ( icalfileset ) and time ( icaltime.c)
Lots of bug fixes and small patches.
I improved the regression test in src/test/regression.c. It now have
command line switches to select specific tests ( undocumentated, of
course ) and more of the tests include asserts, so you can just run it
without looking at the output. If the test runs without crashing, it
is mostly OK.
Version 0.21, 20 Nov 00 ( cvs tag libical-0-21)
----------------------------------------------
* icalmessage.c Many routines to create new ical messages.
* icalspanlist.c Code to generate a list of the busy time f the
VEVENTS in a set. Also includes routiens to generate free and busy
lists from the spanlist, and to find the next free time after a
given time.
* icalvalue.c The STATUS property now has its own value type,
STATUS, which holds the enumeration icalproperty_status.
* icalrestriction.c Added more restrictions. Now handles mutual
and exclusive consitions, and checks for the reight values in
STATUS properties
* icaltypes.c Added routine to create durationtype from string:
icaldurationtype_from_string
* icalcomponet.c Add sever get/set convienience routines to access
and manipulate common component propoerties from the component
interface. This eliminates the need to create a lot of temporary
variables if you just want to change the start time of and event.
* icalcomponent.c Added new routines to icalcomponent:
_get_span -- returns the start and end times of the event in UTC
_get_first_real_component -- return ref to VTODO, VEVENT or VJOURNAL
* icalspanlist.c Added new class, icalspanlist, that generates a
list of alternating busy and free times from an icalset. The class
includes routines to gnerate rfc2445 busy and free lists, and to
get the next avaliable busy or free time after a given time.
Version 0.20D 3 Nov 00
-----------------------
Many miscelaneous tweaks to the build system
More work to icalclassify.
Aded routines to icaltime.c to convert to and from specific timezones
in Olsen format ("America/Los_Angeles")
Version 0.20 7 Sept 00 (cvs tag libical-0-20 )
----------------------------------------------
Addedd icalclassify() which looks at a message and determine how to
process it.
Misc bug fixes and tweaks.
Version 0.19 6 August 00 (cvs tag libical-0-19)
-----------------------------------------------
Created a MIME parser in icalmime.c. This will take any complex MIME
encapsulated message and return an icalcomponent with the same
structure. Each MIME part is represented by a component of type
X-LIC-MIMEPART.
Added MIME partsing to stow.c
Added external iterators to icalcomponent. See test_iterators() in
test/regression.c
Refactored icalcluster and icalstore into icalset, icalfileset and
icaldirset, which have a pseudo inheritance relationship between them.
Fixed more memory leaks.
Version 0.18a 10 June 00 ( cvs tag libical-0-18a )
-----------------------------------------------
Did the final tweaks to stow.c, a program to recieve and store iMIP
messages.
Version 0.18 10 June 00 ( cvs tag libical-0-18 )
-----------------------------------------------
Added libicalvcal, which includes the Versit code for parsing vCal
files and a routine (icalvcal_convert() ) that converts a vCal object
to an iCal object. The test program is src/test/testvcal.
Added marginally functional recurrence code. The curent code does not
handle all of the examples in rfc2445 ( which are extracted in
test-data/recur.txt ) but it can do all of the obvious cases. See the
test program in src/test/recur.c for an example. In particular, the
code cannot handle the integer values in BYDAY, nor negative integers
in BYMONTH or BYMONTHDAY. It also cannot handle BYSETPOS.
Moved some code to the examples directory and improved the comments.
Did a little more work on the documentation in the doc directory. The
documentation is in LyX source, but there is a text version in
UsingLibical.txt
Version 0.17 15 May 00 (cvs tag libical-0-17 )
---------------------------------------------
Fixed two bugs that added extraneous '/' to test values
Fixed type in internal string for the COUNTER method
Eliminated a memory leak in icalparser.c
Version 0.16a 29 April 00
----------------------------------------------
Fixed bug in icalvalue_new_from_string that caused METHOD value to
choke on non standard input.
Fixed a memory leak in icalparser_add_line -- failed to free 'line'
Version 0.16 5 April 00 ( cvs tag libical-0-16)
----------------------------------------------
Now using automake.
Substantial changes to the parser. New interfaces let you parser
multiple components from a single stream by feading the parser object
one line at a time.
Added a STRING value type. this type is like TEXT, but does not
backslash magic characters. It is used in PRODID and REQUEST-STATUS,
where the '/' and ';' are literal.
Added several convience functions for REQUEST-STATUS to icalenums.c
Addedd a routine to icalcomponent to convert X-LIC errors to
REQUEST-STATUS return values.
Version 0.15a 5 Mar 00 (cvs tag libical-0-15a)
---------------------
Experimented with CVS
Fixed icalvalue_set_text to convert escaped characters into the proper
values.
Other minor code tweaks.
Version 0.15 7 Feb 00
---------------------
Split the storage classess ( icalstore, icalcluster, icalcalendar )
into a seperate library, libicalss
Implemented restriction checking in file icalrestrictions.c. The
checking is not complete, but can handle the bulk of the restrictions
described in RFC 2446.
Created a new value type, METHOD. Changed METHOD property to use the
new value. The METHOD value uses an enumeration.
Version 0.14b
-------------
Implemented parsing of RECUR values, although it does not handle BYDAY
specs with numbers.
Fixed error in icalparser_next_line that mangled lines longer than the
temp buffer (1024 chars.) The temp buffer is now 80 chars, and it can
handle (apparently) arbitrary length lines
Fixed severe brokenness in a value, but I forgot which one.
Cleaned cruft out of the distribution, so the tarfile is smaller.
Version 0.14a 14 Jan 00
-----------------------
Fixed bug in ROLE parameter -- missing '-' in the text of allowed values
Fixed bug in X-parameters
Version 0.14 11 Jan 00
----------------------
Fixed wrong value type for TRIGGER property
Added Calendar object. Calendar is an aggregate of two stores and two
clusters, and can store all of the inforamation associated with a
calendar.
icalcomponent_add_property and icalcomponent_add_component will
complain if you try to add a component or property that is already
part of an other component. The *_free routines wil complain if you try
to free a linked component or property.
More improvements to error handling.
Parser is much more robust.
Minor memory enhancements.
Regression test runs without memory leaks.
Version 0.13d 21Dec99
---------------------
Seperated perl interface and library
Added autoconf support
Scripts that generate derived properties, values and parameters now
change source and header files inline.
Changed icalstore to cluster all components with DTSTART in a month
into a single file. This should reduce number of file accesses by a
factor of 60.
Ran code through Purify and fixed memory leaks.
Version 0.13 16Nov99
---------------------
Yet more bug fixes! Yeah!
Added better error handling. The Parser inserts X-LIC-*ERROR
properties to warn of parsing errors.
The imip source/sink programs in /src/imip is demonstrably functional.
Version 0.12b 17Oct99
---------------------
More bug fixes, particularily in parse from string routines
ICal::Store is mostly functional
This is version is a checkpoint, not a release.
Version 0.12a 10Oct99
---------------------
Expanded perl interface:
Added 1/2 of Store module
Fixed bugs
Implemeted get_{first,next}_property
Extended C interface
Made get_{first,next}_property work properly
Fixed bugs
This is version is a checkpoint, not a release.
Version 0.12 27Aug99
--------------------
Added a rudimentatry perl interface
This is version is a checkpoint, not a release.
Version 0.11 11Aug99
--------------------
Eliminated most use of flex/bison -- all parsing, except for the
values, is done in C.
Cleaned up memory leaks. Purify claims that I got them all.
Moved all derived component/prop/param/value code ( in .inc / .h
files) into main files ( icalcomponent.{c,h}, icalproperty.{c,h}, etc/
)
Implemented *_clone routines.
Fixed a lot of bugs.
Implemented more value types. Still unimplemeneted are BINARY and RECUR
Included MacOS/Code Warior files from Graham Davison
Version 0.10 8Jul99
-------------------
Eliminated shift/reduce and reduce/reduce conflicts in the parser.
This version is almost feature complete -- it has the basic structure
for all of the library's functionality, and it will only require
implementing procedure shells and fixing bugs. I think that all of the
hard work is done...
Version 0.09a,b 3,7 Jul99
-------------------------
Various improvements to the parser, added some functionality. The parser code
is mostly complete, and should be fully functional, except for a horde of
bugs. Also added support for X-Properties.
Version 0.09 25Jun99
--------------------
Added a parser in files src/comp/icalitip.{y,l} The lexer is mostly
functional, but the parser is not.
Version 0.08 2Jun99
--------------------
All files now have MPL licensing
Implement enough of the code to perform some rudimentary testing
Version 0.07 14May99
--------------------
Remove all interfaces that construct object from a string
Moved most code back into comp directory
Implemented C files for most headers -- usecases.c now links.
Many improvements to generation scripts.
Version 0.06 25Apr99
--------------------
Expanded distribution to include:
Directory structure that can accomodate future expansion
Several levels of Makefiles
This CHANGES file
Added headers for irip and parse modules
Added several files with design information
Added scripts that I had used to generate much of the ical header code.
Split C headers from CC headers
Added data for iTIP and iCAL component restrictions in restrictions.csv
Version 0.05 11Apr99
----------------------
Changes to ical headers
Added derived Property classes.
Improved the interface to the derived property and parameter classes
Added derived component classes.
Created usecases.c and ccusecases.cc to demonstrate use
C++ interface compile
Version 0.04 5Apr99
-------------------
Version 0.02 30Mar99
--------------------

View File

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

View File

@ -0,0 +1,4 @@
Parser Tests
------------
Use iCAL keywords as first words of unquoted strings

View File

@ -0,0 +1,54 @@
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()

View File

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

View File

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

583
other-licenses/libical/aclocal.m4 vendored Normal file
View File

@ -0,0 +1,583 @@
dnl aclocal.m4 generated automatically by aclocal 1.4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.
# serial 1
dnl Usage:
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
AC_DEFUN(AM_INIT_AUTOMAKE,
[AC_REQUIRE([AC_PROG_INSTALL])
PACKAGE=[$1]
AC_SUBST(PACKAGE)
VERSION=[$2]
AC_SUBST(VERSION)
dnl test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
ifelse([$3],,
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
AC_REQUIRE([AM_SANITY_CHECK])
AC_REQUIRE([AC_ARG_PROGRAM])
dnl FIXME This is truly gross.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_REQUIRE([AC_PROG_MAKE_SET])])
#
# Check to make sure that the build environment is sane.
#
AC_DEFUN(AM_SANITY_CHECK,
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftestfile
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
if test "[$]*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
if test "[$]*" != "X $srcdir/configure conftestfile" \
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "[$]2" = conftestfile
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
rm -f conftest*
AC_MSG_RESULT(yes)])
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
dnl The program must properly implement --version.
AC_DEFUN(AM_MISSING_PROG,
[AC_MSG_CHECKING(for working $2)
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
if ($2 --version) < /dev/null > /dev/null 2>&1; then
$1=$2
AC_MSG_RESULT(found)
else
$1="$3/missing $2"
AC_MSG_RESULT(missing)
fi
AC_SUBST($1)])
# Like AC_CONFIG_HEADER, but automatically create stamp file.
AC_DEFUN(AM_CONFIG_HEADER,
[AC_PREREQ([2.12])
AC_CONFIG_HEADER([$1])
dnl When config.status generates a header, we must update the stamp-h file.
dnl This file resides in the same directory as the config header
dnl that is generated. We must strip everything past the first ":",
dnl and everything past the last "/".
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
<<am_indx=1
for am_file in <<$1>>; do
case " <<$>>CONFIG_HEADERS " in
*" <<$>>am_file "*<<)>>
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
;;
esac
am_indx=`expr "<<$>>am_indx" + 1`
done<<>>dnl>>)
changequote([,]))])
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
# serial 1
AC_DEFUN(AM_MAINTAINER_MODE,
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode is disabled by default
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
AC_MSG_RESULT($USE_MAINTAINER_MODE)
AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
# Define a conditional.
AC_DEFUN(AM_CONDITIONAL,
[AC_SUBST($1_TRUE)
AC_SUBST($1_FALSE)
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi])
dnl AM_PROG_LEX
dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
AC_DEFUN(AM_PROG_LEX,
[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
AC_PROG_LEX
AC_DECL_YYTEXT])
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
# Save cache, so that ltconfig can load it
AC_CACHE_SAVE
# Actually configure libtool. ac_aux_dir is where install-sh is found.
CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|| AC_MSG_ERROR([libtool configure failed])
# Reload cache, that may have been modified by ltconfig
AC_CACHE_LOAD
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
AC_SUBST(LIBTOOL)dnl
# Redirect the config.log output again, so that the ltconfig log is not
# clobbered by the next message.
exec 5>>./config.log
])
AC_DEFUN(AC_LIBTOOL_SETUP,
[AC_PREREQ(2.13)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
dnl
case "$target" in
NONE) lt_target="$host" ;;
*) lt_target="$target" ;;
esac
# Check for any special flags to pass to ltconfig.
#
# the following will cause an existing older ltconfig to fail, so
# we ignore this at the expense of the cache file... Checking this
# will just take longer ... bummer!
#libtool_flags="--cache-file=$cache_file"
#
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case "$lt_target" in
*-*-irix6*)
# Find out which ABI we are using.
echo '[#]line __oline__ "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
])
esac
])
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
# AC_ENABLE_SHARED - implement the --enable-shared flag
# Usage: AC_ENABLE_SHARED[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_SHARED, [dnl
define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(shared,
changequote(<<, >>)dnl
<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
])
# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_SHARED(no)])
# AC_ENABLE_STATIC - implement the --enable-static flag
# Usage: AC_ENABLE_STATIC[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_STATIC, [dnl
define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(static,
changequote(<<, >>)dnl
<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
])
# AC_DISABLE_STATIC - set the default static flag to --disable-static
AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_STATIC(no)])
# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
# `yes'.
AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(fast-install,
changequote(<<, >>)dnl
<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case "$enableval" in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
for pkg in $enableval; do
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$ac_save_ifs"
;;
esac],
enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
])
# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_ENABLE_FAST_INSTALL(no)])
# AC_PROG_LD - find the path to the GNU or non-GNU linker
AC_DEFUN(AC_PROG_LD,
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
ac_prog=ld
if test "$ac_cv_prog_gcc" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
ac_prog=`($CC -print-prog-name=ld) 2>&5`
case "$ac_prog" in
# Accept absolute paths.
changequote(,)dnl
[\\/]* | [A-Za-z]:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
changequote([,])dnl
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
ac_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
AC_DEFUN(AC_PROG_LD_GNU,
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
ac_cv_prog_gnu_ld=yes
else
ac_cv_prog_gnu_ld=no
fi])
])
# AC_PROG_NM - find the path to a BSD-compatible name lister
AC_DEFUN(AC_PROG_NM,
[AC_MSG_CHECKING([for BSD-compatible nm])
AC_CACHE_VAL(ac_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
ac_cv_path_NM="$NM"
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -B"
break
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
ac_cv_path_NM="$ac_dir/nm -p"
break
else
ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
fi
fi
done
IFS="$ac_save_ifs"
test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
fi])
NM="$ac_cv_path_NM"
AC_MSG_RESULT([$NM])
])
# AC_CHECK_LIBM - check for math library
AC_DEFUN(AC_CHECK_LIBM,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case "$lt_target" in
*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
;;
*)
AC_CHECK_LIB(m, main, LIBM="-lm")
;;
esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl convenience library, adds --enable-ltdl-convenience to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
case "$enable_ltdl_convenience" in
no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
"") enable_ltdl_convenience=yes
ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
esac
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
# the libltdl installable library, and adds --enable-ltdl-install to
# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor
# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed
# to be `${top_builddir}/libltdl'. Make sure you start DIR with
# '${top_builddir}/' (note the single quotes!) if your package is not
# flat, and, if you're not using automake, define top_builddir as
# appropriate in the Makefiles.
# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
AC_CHECK_LIB(ltdl, main,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
else
enable_ltdl_install=yes
fi
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
INCLTDL=
fi
])
dnl old names
AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
dnl This is just to silence aclocal about the macro not being used
ifelse([AC_DISABLE_FAST_INSTALL])dnl

1121
other-licenses/libical/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if your <sys/time.h> declares struct tm. */
#undef TM_IN_SYS_TIME
/* Define if lex declares yytext as a char * by default, not a char[]. */
#undef YYTEXT_POINTER
/* 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 you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION

1232
other-licenses/libical/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

2821
other-licenses/libical/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,104 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src)
AM_INIT_AUTOMAKE(libical,0.23)
AM_CONFIG_HEADER(config.h)
dnl Initialize maintainer mode
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_YACC
AC_PROG_CC
AM_PROG_LEX
AC_PROG_LN_S
AC_PROG_INSTALL
dnl Initialize libtool
AM_PROG_LIBTOOL
AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar)
AC_CHECK_PROGS(PERL, perl5 perl)
AC_DEFINE(ICAL_ERRORS_ARE_FATAL,1)
AC_DEFINE(ICAL_SAFESAVES,1)
AC_DEFINE(ICAL_UNIX_NEWLINE,1)
dnl AC_DEFINE(ICAL_NO_EMPTY_ARRAY_DECL)
dnl Checks for libraries.
dnl Replace `main' with a function in -lical:
dnl AC_CHECK_LIB(ical, main)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(time.h sys/types.h assert.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_STRUCT_TM
dnl Checks for library functions.
AC_CHECK_FUNCS(strdup)
dnl **************************************************
dnl * Check for Python
dnl **************************************************
python_val=false
AC_ARG_ENABLE(python-bindings,
[ --enable-python-bindings=[yes/no] Enable python bindings],,enable_python_bindings=yes)
if test "x$enable_python_bindings" = "xyes"; then
python_val=true
else
python_val=false
fi
if $python_val; then
AC_CHECK_PROG(python_val, python, true, false)
fi
if $python_val; then
AC_CHECK_PROG(python_val, swig, true, false)
fi
if $python_val; then
PY_PREFIX=`python -c 'import sys ; print sys.prefix'`
PY_EXEC_PREFIX=`python -c 'import sys ; print sys.exec_prefix'`
changequote(<<, >>)dnl
PY_VERSION=`python -c 'import sys ; print sys.version[0:3]'`
changequote([, ])dnl
if test -f $PY_PREFIX/include/python$PY_VERSION/Python.h; then
PY_LIBS="python$PY_VERSION"
PY_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PY_VERSION/config"
PY_CFLAGS="-I$PY_PREFIX/include/python$PY_VERSION"
PY_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PY_VERSION/config/Makefile"
PY_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE`
PY_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PY_MAKEFILE`
PY_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PY_MAKEFILE`
PY_EXTRA_LIBS="$PY_LOCALMODLIBS $PY_BASEMODLIBS $PY_OTHER_LIBS"
AC_SUBST(PY_LIBS)
AC_SUBST(PY_LIB_LOC)
AC_SUBST(PY_CFLAGS)
AC_SUBST(PY_EXTRA_LIBS)
else
python_val=false
fi
fi
AM_CONDITIONAL(WITH_PYTHON, $python_val)
AC_OUTPUT([
Makefile
design-data/Makefile
doc/Makefile
examples/Makefile
scripts/Makefile
src/Makefile
src/libical/Makefile
src/libical/icalversion.h
src/libicalss/Makefile
src/libicalvcal/Makefile
src/python/Makefile
src/test/Makefile
test-data/Makefile
])

View File

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

View File

@ -0,0 +1,187 @@
# 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.
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@
EXTRA_DIST = properties.csv parameters.csv restrictions.csv status.txt value-types.csv
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps design-data/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = design-data
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
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-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
-rm -f libtool
distclean: distclean-am
maintainer-clean-am: 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: 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
# 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:

View File

@ -0,0 +1,24 @@
"#Name ","C Type","Enumeration Values"
"ALTREP","const char*",
"CN","const char*",
"CUTYPE","icalparameter_cutype","INDIVIDUAL;GROUP;RESOURCE;ROOM;UNKNOWN"
"DELEGATED-FROM","const char*",
"DELEGATED-TO","const char*",
"DIR","const char*",
"ENCODING","icalparameter_encoding","8BIT;BASE64"
"FBTYPE","icalparameter_fbtype","FREE;BUSY;BUSYUNAVAILABLE;BUSYTENTATIVE"
"FMTTYPE","const char*",
"LANGUAGE","const char*",
"MEMBER","const char*",
"PARTSTAT","icalparameter_partstat","NEEDS-ACTION;ACCEPTED;DECLINED;TENTATIVE;DELEGATED;COMPLETED;INPROCESS"
"RANGE","icalparameter_range","THISANDPRIOR;THISANDFUTURE"
"RELATED","icalparameter_related","START;END "
"RELTYPE","icalparameter_reltype","PARENT;CHILD;SIBLING"
"ROLE","icalparameter_role","CHAIR;REQ-PARTICIPANT;OPT-PARTICIPANT;NON-PARTICIPANT"
"RSVP","icalparameter_rsvp","TRUE;FALSE"
"SENT-BY","const char*",
"TZID","const char*",
"VALUE","icalparameter_value","BINARY;BOOLEAN;DATE;DURATION;FLOAT;INTEGER;PERIOD;RECUR;TEXT;TIME;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"
1 #Name C Type Enumeration Values
2 ALTREP const char*
3 CN const char*
4 CUTYPE icalparameter_cutype INDIVIDUAL;GROUP;RESOURCE;ROOM;UNKNOWN
5 DELEGATED-FROM const char*
6 DELEGATED-TO const char*
7 DIR const char*
8 ENCODING icalparameter_encoding 8BIT;BASE64
9 FBTYPE icalparameter_fbtype FREE;BUSY;BUSYUNAVAILABLE;BUSYTENTATIVE
10 FMTTYPE const char*
11 LANGUAGE const char*
12 MEMBER const char*
13 PARTSTAT icalparameter_partstat NEEDS-ACTION;ACCEPTED;DECLINED;TENTATIVE;DELEGATED;COMPLETED;INPROCESS
14 RANGE icalparameter_range THISANDPRIOR;THISANDFUTURE
15 RELATED icalparameter_related START;END
16 RELTYPE icalparameter_reltype PARENT;CHILD;SIBLING
17 ROLE icalparameter_role CHAIR;REQ-PARTICIPANT;OPT-PARTICIPANT;NON-PARTICIPANT
18 RSVP icalparameter_rsvp TRUE;FALSE
19 SENT-BY const char*
20 TZID const char*
21 VALUE icalparameter_value BINARY;BOOLEAN;DATE;DURATION;FLOAT;INTEGER;PERIOD;RECUR;TEXT;TIME;URI;ERROR;DATE-TIME;UTC-OFFSET;CAL-ADDRESS
22 X const char*
23 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
24 X-LIC-COMPARETYPE icalparameter_xliccomparetype EQUAL;NOTEQUAL;LESS;GREATER;LESSEQUAL;GREATEREQUAL;REGEX

View File

@ -0,0 +1,66 @@
,,
"#Property Name","libical Value type","iCalendar default value"
"ACTION","ACTION","ACTION"
"ATTACH","ATTACH","URI"
"ATTENDEE","CAL-ADDRESS","CAL-ADDRESS"
"CALSCALE","TEXT","TEXT"
"CATEGORIES","TEXT","TEXT"
"CLASS","TEXT","TEXT"
"COMMENT","TEXT","TEXT"
"COMPLETED","DATE-TIME","DATE-TIME"
"CONTACT","TEXT","TEXT"
"CREATED","DATE-TIME","DATE-TIME"
"DESCRIPTION","TEXT","TEXT"
"DTEND","DATE-TIME","DATE-TIME"
"DTSTAMP","DATE-TIME","DATE-TIME"
"DTSTART","DATE-TIME","DATE-TIME"
"DUE","DATE-TIME","DATE-TIME"
"DURATION","DURATION","DURATION"
"EXDATE","DATE-TIME","DATE-TIME"
"EXRULE","RECUR","RECUR"
"FREEBUSY","PERIOD","PERIOD"
"GEO","GEO","GEO"
"LAST-MODIFIED","DATE-TIME","DATE-TIME"
"LOCATION","TEXT","TEXT"
"METHOD","METHOD","METHOD"
"ORGANIZER","CAL-ADDRESS","CAL-ADDRESS"
"PERCENT-COMPLETE","INTEGER","INTEGER"
"PRIORITY","INTEGER","INTEGER"
"PRODID","TEXT","TEXT"
"RDATE","DATE-TIME-PERIOD","DATE-TIME"
"RECURRENCE-ID","DATE-TIME","DATE-TIME"
"RELATED-TO","TEXT","TEXT"
"REPEAT","INTEGER","INTEGER"
"REQUEST-STATUS","STRING","STRING"
"RESOURCES","TEXT","TEXT"
"RRULE","RECUR","RECUR"
"SEQUENCE","INTEGER","INTEGER"
"STATUS","STATUS","STATUS"
"SUMMARY","TEXT","TEXT"
"TRANSP","TEXT","TEXT"
"TRIGGER","TRIGGER","DURATION"
"TZID","TEXT","TEXT"
"TZNAME","TEXT","TEXT"
"TZOFFSETFROM","UTC-OFFSET","UTC-OFFSET"
"TZOFFSETTO","UTC-OFFSET","UTC-OFFSET"
"TZURL","URI","URI"
"UID","TEXT","TEXT"
"URL","URI","URI"
"VERSION","TEXT","TEXT"
"X","TEXT","TEXT"
"SCOPE","TEXT","TEXT"
"MAXRESULTS","INTEGER","INTEGER"
"MAXRESULTSSIZE","INTEGER","INTEGER"
"QUERY","QUERY","QUERY"
"QUERYNAME","TEXT","TEXT"
"TARGET","CAL-ADDRESS","CAL-ADDRESS"
"X-LIC-ERROR","TEXT","TEXT"
"X-LIC-CLUSTERCOUNT","STRING","STRING"
"X-LIC-MIMECONTENTTYPE","STRING","STRING"
"X-LIC-MIMECHARSET","STRING","STRING"
"X-LIC-MIMEENCODING","STRING","STRING"
"X-LIC-MIMEOPTINFO","STRING","STRING"
"X-LIC-MIMECID","STRING","STRING"
"X-LIC-MIMEFILENAME","STRING","STRING"
"ANY","NO","NO"
"NO","NO","NO"
1
2 #Property Name libical Value type iCalendar default value
3 ACTION ACTION ACTION
4 ATTACH ATTACH URI
5 ATTENDEE CAL-ADDRESS CAL-ADDRESS
6 CALSCALE TEXT TEXT
7 CATEGORIES TEXT TEXT
8 CLASS TEXT TEXT
9 COMMENT TEXT TEXT
10 COMPLETED DATE-TIME DATE-TIME
11 CONTACT TEXT TEXT
12 CREATED DATE-TIME DATE-TIME
13 DESCRIPTION TEXT TEXT
14 DTEND DATE-TIME DATE-TIME
15 DTSTAMP DATE-TIME DATE-TIME
16 DTSTART DATE-TIME DATE-TIME
17 DUE DATE-TIME DATE-TIME
18 DURATION DURATION DURATION
19 EXDATE DATE-TIME DATE-TIME
20 EXRULE RECUR RECUR
21 FREEBUSY PERIOD PERIOD
22 GEO GEO GEO
23 LAST-MODIFIED DATE-TIME DATE-TIME
24 LOCATION TEXT TEXT
25 METHOD METHOD METHOD
26 ORGANIZER CAL-ADDRESS CAL-ADDRESS
27 PERCENT-COMPLETE INTEGER INTEGER
28 PRIORITY INTEGER INTEGER
29 PRODID TEXT TEXT
30 RDATE DATE-TIME-PERIOD DATE-TIME
31 RECURRENCE-ID DATE-TIME DATE-TIME
32 RELATED-TO TEXT TEXT
33 REPEAT INTEGER INTEGER
34 REQUEST-STATUS STRING STRING
35 RESOURCES TEXT TEXT
36 RRULE RECUR RECUR
37 SEQUENCE INTEGER INTEGER
38 STATUS STATUS STATUS
39 SUMMARY TEXT TEXT
40 TRANSP TEXT TEXT
41 TRIGGER TRIGGER DURATION
42 TZID TEXT TEXT
43 TZNAME TEXT TEXT
44 TZOFFSETFROM UTC-OFFSET UTC-OFFSET
45 TZOFFSETTO UTC-OFFSET UTC-OFFSET
46 TZURL URI URI
47 UID TEXT TEXT
48 URL URI URI
49 VERSION TEXT TEXT
50 X TEXT TEXT
51 SCOPE TEXT TEXT
52 MAXRESULTS INTEGER INTEGER
53 MAXRESULTSSIZE INTEGER INTEGER
54 QUERY QUERY QUERY
55 QUERYNAME TEXT TEXT
56 TARGET CAL-ADDRESS CAL-ADDRESS
57 X-LIC-ERROR TEXT TEXT
58 X-LIC-CLUSTERCOUNT STRING STRING
59 X-LIC-MIMECONTENTTYPE STRING STRING
60 X-LIC-MIMECHARSET STRING STRING
61 X-LIC-MIMEENCODING STRING STRING
62 X-LIC-MIMEOPTINFO STRING STRING
63 X-LIC-MIMECID STRING STRING
64 X-LIC-MIMEFILENAME STRING STRING
65 ANY NO NO
66 NO NO NO

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,31 @@
"#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 #Name C type& gen flag Python Component Values Enum Values
2 BINARY (a)const char* file unitary
3 BOOLEAN (a)int integer unitary
4 CAL-ADDRESS (a)const char* string unitary
5 DATE (a)struct icaltimetype Time unitary
6 DATE-TIME (a)struct icaltimetype Time unitary
7 DURATION (a)struct icaldurationtype Duration unitary
8 FLOAT (a)float float unitary
9 INTEGER (a)int integer unitary
10 PERIOD (a)struct icalperiodtype Period unitary
11 RECUR (m)struct icalrecurrencetype RecurrenceSet unitary
12 TEXT (a)const char* string unitary
13 TIME (a)struct icaltimetype Time unitary
14 URI (a)const char* string unitary
15 UTC-OFFSET (a)int integer unitary
16 QUERY (a)const char* string unitary
17 #Non-standard multi-valued types
18 ATTACH (a)struct icalattachtype none URI;BINARY
19 DATE-TIME-DATE (a)struct icaltimetype none DATE-TIME;DATE
20 DATE-TIME-PERIOD (m)struct icaldatetimeperiodtype none DATE-TIME;PERIOD
21 TRIGGER (m)struct icaltriggertype string DURATION;DATE-TIME
22 #Non-standard property enumeration types
23 METHOD (a)enum icalproperty_method string unitary PUBLISH;REQUEST;REPLY;ADD;CANCEL;REFRESH;COUNTER;DECLINECOUNTER;CREATE;READ;RESPONSE;MOVE;MODIFY;GENERATEUID;DELETE
24 ACTION (a)enum icalproperty_action string unitary AUDIO;DISPLAY;EMAIL;PROCEDURE
25 STATUS (a)enum icalproperty_status string unitary TENTATIVE;CONFIRMED;COMPLETED;NEEDS-ACTION;CANCELLED;IN-PROCESS;DRAFT;FINAL
26 TRANSP (a)enum icalproperty_transp string unitary OPAQUE;TRANSPARENT
27 CLASS (a)enum icalproperty_class string unitary PUBLIC;PRIVATE;CONFIDENTIAL
28 #Other non-standard
29 GEO (a)struct icalgeotype tuple unitary
30 STRING (a)const char* string unitary
31 X (m)const char* string unitary

View File

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

View File

@ -0,0 +1,186 @@
# 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.
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@
EXTRA_DIST = UsingLibical.lyx UsingLibical.ps UsingLibical.txt
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps doc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = doc
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
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-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
-rm -f libtool
distclean: distclean-am
maintainer-clean-am: 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: 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
# 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:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,14 @@
noinst_PROGRAMS = doesnothing
LDADD = ../src/libical/libical.la ../src/libicalss/libicalss.la ../src/libicalvcal/libicalvcal.la
INCLUDES = -I. -I../src/libical -I$(srcdir)/../src/libical -I../src/libicalss -I../src/libicalvcal
doesnothing_SOURCES = \
access_components.c \
access_properties_and_parameters.c \
errors.c \
main.c \
parse_text.c

View File

@ -0,0 +1,313 @@
# 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.
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@
noinst_PROGRAMS = doesnothing
LDADD = ../src/libical/libical.la ../src/libicalss/libicalss.la ../src/libicalvcal/libicalvcal.la
INCLUDES = -I. -I../src/libical -I$(srcdir)/../src/libical -I../src/libicalss -I../src/libicalvcal
doesnothing_SOURCES = access_components.c access_properties_and_parameters.c errors.c main.c parse_text.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(noinst_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
doesnothing_OBJECTS = access_components.o \
access_properties_and_parameters.o errors.o main.o parse_text.o
doesnothing_LDADD = $(LDADD)
doesnothing_DEPENDENCIES = ../src/libical/libical.la \
../src/libicalss/libicalss.la ../src/libicalvcal/libicalvcal.la
doesnothing_LDFLAGS =
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 $@
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
SOURCES = $(doesnothing_SOURCES)
OBJECTS = $(doesnothing_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .s
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps examples/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-noinstPROGRAMS:
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS:
.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:
doesnothing: $(doesnothing_OBJECTS) $(doesnothing_DEPENDENCIES)
@rm -f doesnothing
$(LINK) $(doesnothing_LDFLAGS) $(doesnothing_OBJECTS) $(doesnothing_LDADD) $(LIBS)
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 = examples
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
access_components.o: access_components.c ../src/libical/ical.h \
../config.h ../src/libical/icalmemory.h
access_properties_and_parameters.o: access_properties_and_parameters.c \
../src/libical/ical.h ../config.h
errors.o: errors.c ../src/libical/ical.h ../config.h
main.o: main.c ../src/libical/ical.h ../config.h
parse_text.o: parse_text.c ../src/libical/ical.h ../config.h
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-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile $(PROGRAMS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-libtool mostlyclean-tags \
mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \
clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-noinstPROGRAMS distclean-compile \
distclean-libtool distclean-tags distclean-generic \
clean-am
-rm -f libtool
distclean: distclean-am
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
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-noinstPROGRAMS distclean-noinstPROGRAMS \
clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool 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
# 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:

View File

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

View File

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

View File

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

View File

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

View File

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

251
other-licenses/libical/install-sh Executable file
View File

@ -0,0 +1,251 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

3078
other-licenses/libical/ltconfig Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

190
other-licenses/libical/missing Executable file
View File

@ -0,0 +1,190 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,40 @@
#! /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

View File

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

View File

@ -0,0 +1,187 @@
# 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.
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@
EXTRA_DIST = mkderivedcomponents.pl mkderivedparameters.pl mkderivedproperties.pl mkderivedvalues.pl mkparameterrestrictions.pl mkrestrictionrecords.pl mkrestrictiontable.pl readvaluesfile.pl
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps scripts/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = scripts
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
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-exec: install-exec-am
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am:
uninstall: uninstall-am
all-am: Makefile
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-generic
mostlyclean: mostlyclean-am
clean-am: clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-generic clean-am
-rm -f libtool
distclean: distclean-am
maintainer-clean-am: 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: 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
# 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:

View File

@ -0,0 +1,170 @@
#!/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
}
}

View File

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

View File

@ -0,0 +1,217 @@
#!/usr/local/bin/perl
require "readvaluesfile.pl";
use Getopt::Std;
getopts('chspmi:');
# ARG 0 is properties.csv
%propmap = read_properties_file($ARGV[0]);
# ARG 1 is value-types.txt
%valuemap = read_values_file($ARGV[1]);
# 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";
}
sub fudge_data {
my $prop = shift;
my $value = $propmap{$prop}->{'lic_value'};
if (!$value){
die "Can't find value for property \"$prop\"\n";
}
my $ucf = join("",map {ucfirst(lc($_));} split(/-/,$prop));
my $lc = lc($ucf);
my $uc = uc($lc);
my $ucfvalue = join("",map {ucfirst(lc($_));} split(/-/,$value));
my $lcvalue = lc($ucfvalue);
my $ucvalue = uc($lcvalue);
my $type = $valuemap{$value}->{C}->[1];
return ($uc,$lc,$lcvalue,$ucvalue,$type);
}
# Create the property map data
if($opt_c){
print "static struct icalproperty_map property_map[] = {\n";
foreach $prop (sort keys %propmap) {
next if !$prop;
next if $prop eq 'NO';
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
print "{ICAL_${uc}_PROPERTY,\"$prop\",ICAL_${ucvalue}_VALUE},\n";
}
$prop = "NO";
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
print "{ICAL_${uc}_PROPERTY,\"\",ICAL_NO_VALUE}};\n\n";
print "static struct icalproperty_enum_map enum_map[] = {\n";
$idx = 10000;
foreach $value (sort keys %valuemap) {
next if !$value;
next if $value eq 'NO' or $prop eq 'ANY';
my $ucv = join("",map {uc(lc($_));} split(/-/,$value));
my @enums = @{$valuemap{$value}->{'enums'}};
if(@enums){
my ($c_autogen,$c_type) = @{$valuemap{$value}->{'C'}};
unshift(@enums,"X");
push(@enums,"NONE");
foreach $e (@enums) {
my $uce = join("",map {uc(lc($_));} split(/-/,$e));
if($e ne "X" and $e ne "NONE"){
$str = $e;
} else {
$str = "";
}
print " {ICAL_${ucv}_PROPERTY,ICAL_${ucv}_${uce},\"$str\" }, /*$idx*/\n";
$idx++;
}
}
}
print " {ICAL_NO_PROPERTY,0,\"\"}\n};\n\n";
}
if($opt_h){
# Create the property enumerations list
print "typedef enum icalproperty_kind {\n ICAL_ANY_PROPERTY = 0,\n";
foreach $prop (sort keys %propmap) {
next if !$prop;
next if $prop eq 'NO' or $prop eq 'ANY';
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
print " ICAL_${uc}_PROPERTY, \n";
}
print " ICAL_NO_PROPERTY\n} icalproperty_kind;\n\n";
}
foreach $prop (sort keys %propmap) {
next if !$prop;
next if $prop eq 'NO' or $prop eq 'ANY';
my ($uc,$lc,$lcvalue,$ucvalue,$type) = fudge_data($prop);
my $pointer_check;
if ($type =~ /\*/){
$pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");\n" if $type =~ /\*/;
} elsif ( $type eq "void" ){
$pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
}
my $set_pointer_check = "icalerror_check_arg_rv( (v!=0),\"v\");\n" if $type =~ /\*/;
if($opt_c) { # Generate C source
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;
}
icalproperty* icalproperty_vanew_${lc}($type v, ...){
va_list args;
struct icalproperty_impl *impl = icalproperty_new_impl(ICAL_${uc}_PROPERTY); $pointer_check
icalproperty_set_${lc}((icalproperty*)impl,v);
va_start(args,v);
icalproperty_add_parameters(impl, args);
va_end(args);
return (icalproperty*)impl;
}
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);
icalproperty_set_value(prop,value);
}
$type icalproperty_get_${lc}(icalproperty* prop){
icalvalue *value;
icalerror_check_arg( (prop!=0),"prop");
value = icalproperty_get_value(prop);
return icalvalue_get_${lcvalue}(value);
}
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);";
}
} # This brace terminates the main loop
if ($opt_h){
print "\n\n#endif /*ICALPROPERTY_H*/\n"
}

View File

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

View File

@ -0,0 +1,85 @@
#!/usr/bin/perl
# Version: 1.0
# Script last updated: 30May1999 GMD
# Change log:
# <none>
# usually open params-in-prop.txt
open(F,"$ARGV[0]") || die "Can't open restriction file $ARGV[0]:$!";
print <<EOM;
/*
======================================================================
File: parameterrestrictions.c
(C) COPYRIGHT 1999 Graham Davison
mailto:g.m.davison\@computer.org
The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
======================================================================*/
/*
* THIS FILE IS MACHINE GENERATED DO NOT EDIT
*/
int icalrestriction_is_parameter_allowed(icalproperty_kind prop,icalparameter_kind param)
{
switch (prop)
{
EOM
while(<F>)
{
chop;
# split line by whitespace
my @v = split(/\s+/,$_);
# property is first item on line
my $prop = shift @v;
my $prop_name = $prop;
if (substr($prop,0,1) eq "X") { $prop = "X"; }
$prop = join("",split(/-/,$prop));
print <<EOM;
/* ${prop_name} */
case ICAL_${prop}_PROPERTY:
switch (param)
{
EOM
foreach $param (@v)
{
$param = join("",split(/-/,$param));
print "\t\t\t\tcase ICAL_${param}_PARAMETER:\n";
}
print <<EOM;
return 1;
default:
return 0;
}
EOM
}
print <<EOM;
}
return 0;
}
EOM

View File

@ -0,0 +1,109 @@
#!/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

View File

@ -0,0 +1,98 @@
#!/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";

View File

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

View File

@ -0,0 +1,7 @@
if WITH_PYTHON
PYTHON_DIR = python
else
PYTHON_DIR =
endif
SUBDIRS = libical libicalss libicalvcal $(PYTHON_DIR) test

View File

@ -0,0 +1,293 @@
# 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.
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@
@WITH_PYTHON_TRUE@PYTHON_DIR = python
@WITH_PYTHON_FALSE@PYTHON_DIR =
SUBDIRS = libical libicalss libicalvcal $(PYTHON_DIR) test
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = gtar
GZIP_ENV = --best
DIST_SUBDIRS = libical libicalss libicalvcal python test
all: all-redirect
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
@SET_MAKE@
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
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: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS)'; \
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
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
for subdir in $(DIST_SUBDIRS); do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
chmod 777 $(distdir)/$$subdir; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
fi; \
done
info-am:
info: info-recursive
dvi-am:
dvi: dvi-recursive
check-am: all-am
check: check-recursive
installcheck-am:
installcheck: installcheck-recursive
install-exec-am:
install-exec: install-exec-recursive
install-data-am:
install-data: install-data-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-recursive
uninstall-am:
uninstall: uninstall-recursive
all-am: Makefile
all-redirect: all-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs: installdirs-recursive
installdirs-am:
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-tags clean-generic mostlyclean-am
clean: clean-recursive
distclean-am: distclean-tags distclean-generic clean-am
-rm -f libtool
distclean: distclean-recursive
maintainer-clean-am: 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-recursive
.PHONY: install-data-recursive uninstall-data-recursive \
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
uninstalldirs-recursive all-recursive check-recursive \
installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive 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-am \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
# 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:

View File

@ -0,0 +1,224 @@
#======================================================================
# FILE: Makefile.am
# CREATOR: eric
#
# $Id: Makefile.am,v 1.1 2001/11/15 19:26:49 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
#
#======================================================================
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
ical.h: $(COMBINEDHEADERS)
cat $(COMBINEDHEADERS) \
| egrep -v "#include.*\"ical" \
| egrep -v "#include.*\"pvl\.h\"" > ical.h
icallexer.c : icalyacc.h
# parameters
PARAMETERDEPS = \
$(ICALSCRIPTS)/mkderivedparameters.pl \
$(DESIGNDATA)/parameters.csv \
icalderivedparameter.c.in \
icalderivedparameter.h.in
icalderivedparameter.h: $(PARAMETERDEPS)
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.h.in -h $(DESIGNDATA)/parameters.csv > icalderivedparameter.h
icalderivedparameter.c: $(PARAMETERDEPS) icalparameter.h
$(PERL) -I $(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedparameters.pl -i $(srcdir)/icalderivedparameter.c.in -c $(DESIGNDATA)/parameters.csv > icalderivedparameter.c
# properties
PROPERTYDEPS = \
$(ICALSCRIPTS)/mkderivedproperties.pl \
$(DESIGNDATA)/properties.csv \
$(DESIGNDATA)/value-types.csv \
icalderivedproperty.c.in \
icalderivedproperty.h.in
icalderivedproperty.h: $(PROPERTYDEPS)
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
-i $(srcdir)/icalderivedproperty.h.in -h $(DESIGNDATA)/properties.csv\
${DESIGNDATA}/value-types.csv > icalderivedproperty.h
icalderivedproperty.c: $(PROPERTYDEPS) icalproperty.h
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedproperties.pl \
-i $(srcdir)/icalderivedproperty.c.in -c $(DESIGNDATA)/properties.csv \
${DESIGNDATA}/value-types.csv > icalderivedproperty.c
# restrictions
RESTRICTIONDEPS = \
$(ICALSCRIPTS)/mkrestrictiontable.pl \
$(DESIGNDATA)/restrictions.csv \
icalrestriction.c.in
icalrestriction.c: $(RESTRICTIONDEPS)
$(PERL) $(ICALSCRIPTS)/mkrestrictiontable.pl -i $(srcdir)/icalrestriction.c.in \
$(DESIGNDATA)/restrictions.csv > icalrestriction.c
# values
VALUEDEPS = \
$(ICALSCRIPTS)/mkderivedvalues.pl \
$(DESIGNDATA)/value-types.csv \
icalderivedvalue.c.in \
icalderivedvalue.h.in
icalderivedvalue.h: $(VALUEDEPS)
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
-i $(srcdir)/icalderivedvalue.h.in -h $(DESIGNDATA)/value-types.csv > icalderivedvalue.h
icalderivedvalue.c: $(VALUEDEPS) icalderivedvalue.h
$(PERL) -I$(ICALSCRIPTS) $(ICALSCRIPTS)/mkderivedvalues.pl \
-i $(srcdir)/icalderivedvalue.c.in -c $(DESIGNDATA)/value-types.csv > icalderivedvalue.c
# 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

View File

@ -0,0 +1,565 @@
# 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:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalattendee.c
CREATOR: eric 08 Mar 01
$Id: icalattendee.c,v 1.2 2001/12/21 18:56:13 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 icaltypes.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "icalattendee.h"

View File

@ -0,0 +1,68 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalattendee.h
CREATOR: eric 8 Mar 01
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icaltypes.h
======================================================================*/
#ifndef ICALATTENDEE_H
#define ICALATTENDEE_H
#include <time.h>
#include "icalenums.h"
#include "icaltime.h"
#include "icalduration.h"
#include "icalperiod.h"
#include "icalderivedparameter.h"
#include "icalderivedvalue.h"
struct icalorganizertype {
const char* value;
const char* common_name;
const char* dir;
const char* sentby;
const char* language;
};
/* Create a copy of the given organizer. Libical will not own the
memory for the strings in the copy; the call must free them */
struct icalorganizertype icalorganizertype_new_clone(struct icalorganizertype a);
struct icalattendeetype {
const char* cuid; /* Cal user id, contents of the property value */
/*icalparameter_cutype cutype;*/
const char* member;
/*icalparameter_role role;*/
int rsvp;
const char* delto;
const char* delfrom;
const char* sentby;
const char* cn;
const char* dir;
const char* language;
};
/* Create a copy of the given attendee. Libical will not own the
memory for the strings in the copy; the call must free them */
struct icalattendeetype icalattendeetype_new_clone(struct icalattendeetype a);
#endif /* !ICALATTENDEE_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,240 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalcomponent.h
CREATOR: eric 20 March 1999
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalcomponent.h
======================================================================*/
#ifndef ICALCOMPONENT_H
#define ICALCOMPONENT_H
#include "icalproperty.h"
#include "icalvalue.h"
#include "icalenums.h" /* defines icalcomponent_kind */
#include "icalattendee.h"
#include "pvl.h"
typedef void icalcomponent;
/* This is exposed so that callers will not have to allocate and
deallocate iterators. Pretend that you can't see it. */
typedef struct icalcompiter
{
icalcomponent_kind kind;
pvl_elem iter;
} icalcompiter;
icalcomponent* icalcomponent_new(icalcomponent_kind kind);
icalcomponent* icalcomponent_new_clone(icalcomponent* component);
icalcomponent* icalcomponent_new_from_string(char* str);
icalcomponent* icalcomponent_vanew(icalcomponent_kind kind, ...);
void icalcomponent_free(icalcomponent* component);
char* icalcomponent_as_ical_string(icalcomponent* component);
int icalcomponent_is_valid(icalcomponent* component);
icalcomponent_kind icalcomponent_isa(icalcomponent* component);
int icalcomponent_isa_component (void* component);
/*
* Working with properties
*/
void icalcomponent_add_property(icalcomponent* component,
icalproperty* property);
void icalcomponent_remove_property(icalcomponent* component,
icalproperty* property);
int icalcomponent_count_properties(icalcomponent* component,
icalproperty_kind kind);
/* Iterate through the properties */
icalproperty* icalcomponent_get_current_property(icalcomponent* component);
icalproperty* icalcomponent_get_first_property(icalcomponent* component,
icalproperty_kind kind);
icalproperty* icalcomponent_get_next_property(icalcomponent* component,
icalproperty_kind kind);
/*
* Working with components
*/
/* Return the first VEVENT, VTODO or VJOURNAL sub-component of cop, or
comp if it is one of those types */
icalcomponent* icalcomponent_get_inner(icalcomponent* comp);
void icalcomponent_add_component(icalcomponent* parent,
icalcomponent* child);
void icalcomponent_remove_component(icalcomponent* parent,
icalcomponent* child);
int icalcomponent_count_components(icalcomponent* component,
icalcomponent_kind kind);
/* Iteration Routines. There are two forms of iterators, internal and
external. The internal ones came first, and are almost completely
sufficient, but they fail badly when you want to construct a loop that
removes components from the container.*/
/* Iterate through components */
icalcomponent* icalcomponent_get_current_component (icalcomponent* component);
icalcomponent* icalcomponent_get_first_component(icalcomponent* component,
icalcomponent_kind kind);
icalcomponent* icalcomponent_get_next_component(icalcomponent* component,
icalcomponent_kind kind);
/* Using external iterators */
icalcompiter icalcomponent_begin_component(icalcomponent* component,
icalcomponent_kind kind);
icalcompiter icalcomponent_end_component(icalcomponent* component,
icalcomponent_kind kind);
icalcomponent* icalcompiter_next(icalcompiter* i);
icalcomponent* icalcompiter_prior(icalcompiter* i);
icalcomponent* icalcompiter_deref(icalcompiter* i);
/* Working with embedded error properties */
int icalcomponent_count_errors(icalcomponent* component);
/* Remove all X-LIC-ERROR properties*/
void icalcomponent_strip_errors(icalcomponent* component);
/* Convert some X-LIC-ERROR properties into RETURN-STATUS properties*/
void icalcomponent_convert_errors(icalcomponent* component);
/* Internal operations. They are private, and you should not be using them. */
icalcomponent* icalcomponent_get_parent(icalcomponent* component);
void icalcomponent_set_parent(icalcomponent* component,
icalcomponent* parent);
/* Kind conversion routiens */
icalcomponent_kind icalcomponent_string_to_kind(const char* string);
const char* icalcomponent_kind_to_string(icalcomponent_kind kind);
/************* Derived class methods. ****************************
If the code was in an OO language, the remaining routines would be
members of classes derived from icalcomponent. Don't call them on the
wrong component subtypes. */
/* For VCOMPONENT: Return a reference to the first VEVENT, VTODO or
VJOURNAL */
icalcomponent* icalcomponent_get_first_real_component(icalcomponent *c);
/* For VEVENT, VTODO, VJOURNAL and VTIMEZONE: report the start and end
times of an event in UTC */
struct icaltime_span icalcomponent_get_span(icalcomponent* comp);
/******************** Convienience routines **********************/
void icalcomponent_set_dtstart(icalcomponent* comp, struct icaltimetype v);
struct icaltimetype icalcomponent_get_dtstart(icalcomponent* comp);
/* For the icalcomponent routines only, dtend and duration are tied
together. If you call the set routine for one and the other exists,
the routine will calculate the change to the other. That is, if
there is a DTEND and you call set_duration, the routine will modify
DTEND to be the sum of DTSTART and the duration. If you call a get
routine for one and the other exists, the routine will calculate
the return value. If you call a set routine and neither exists, the
routine will create the apcompriate comperty */
struct icaltimetype icalcomponent_get_dtend(icalcomponent* comp);
void icalcomponent_set_dtend(icalcomponent* comp, struct icaltimetype v);
void icalcomponent_set_duration(icalcomponent* comp,
struct icaldurationtype v);
struct icaldurationtype icalcomponent_get_duration(icalcomponent* comp);
void icalcomponent_set_method(icalcomponent* comp, icalproperty_method method);
icalproperty_method icalcomponent_get_method(icalcomponent* comp);
struct icaltimetype icalcomponent_get_dtstamp(icalcomponent* comp);
void icalcomponent_set_dtstamp(icalcomponent* comp, struct icaltimetype v);
void icalcomponent_set_summary(icalcomponent* comp, const char* v);
const char* icalcomponent_get_summary(icalcomponent* comp);
void icalcomponent_set_comment(icalcomponent* comp, const char* v);
const char* icalcomponent_get_comment(icalcomponent* comp);
void icalcomponent_set_uid(icalcomponent* comp, const char* v);
const char* icalcomponent_get_uid(icalcomponent* comp);
void icalcomponent_set_recurrenceid(icalcomponent* comp,
struct icaltimetype v);
struct icaltimetype icalcomponent_get_recurrenceid(icalcomponent* comp);
void icalcomponent_set_organizer(icalcomponent* comp,
struct icalorganizertype org);
struct icalorganizertype icalcomponent_get_organizer(icalcomponent* comp);
void icalcomponent_add_attendee(icalcomponent *comp,
struct icalattendeetype attendee);
int icalcomponent_remove_attendee(icalcomponent *comp, char* cuid);
/* Get the Nth attendee. Out of range indices return an attendee
with cuid == 0 */
struct icalattendeetype icalcomponent_get_attendee(icalcomponent *comp,
int index);
/*************** Type Specific routines ***************/
icalcomponent* icalcomponent_new_vcalendar();
icalcomponent* icalcomponent_new_vevent();
icalcomponent* icalcomponent_new_vtodo();
icalcomponent* icalcomponent_new_vjournal();
icalcomponent* icalcomponent_new_valarm();
icalcomponent* icalcomponent_new_vfreebusy();
icalcomponent* icalcomponent_new_vtimezone();
icalcomponent* icalcomponent_new_xstandard();
icalcomponent* icalcomponent_new_xdaylight();
#endif /* !ICALCOMPONENT_H */

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@ -0,0 +1,37 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalparam.h
CREATOR: eric 20 March 1999
$Id: icalderivedparameter.h.in,v 1.2 2001/12/21 18:56:15 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);

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@ -0,0 +1,23 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalderivedproperties.{c,h}
CREATOR: eric 09 May 1999
$Id: icalderivedproperty.h.in,v 1.2 2001/12/21 18:56:17 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. */

View File

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

View File

@ -0,0 +1,299 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue.c
CREATOR: eric 02 May 1999
$Id: icalderivedvalue.c.in,v 1.2 2001/12/21 18:56:18 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. */

View File

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

View File

@ -0,0 +1,58 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalvalue.h
CREATOR: eric 20 March 1999
$Id: icalderivedvalue.h.in,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. */

View File

@ -0,0 +1,320 @@
/* -*- Mode: C -*-
======================================================================
FILE: icaltime.c
CREATOR: eric 02 June 2000
$Id: icalduration.c,v 1.2 2001/12/21 18:56:19 mikep%oeone.com Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is eric. The Initial Developer of the Original
Code is Eric Busboom
======================================================================*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalduration.h"
#include <assert.h>
#include <string.h>
#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
#include "icalerror.h"
#include "icalmemory.h"
#endif
/* From Seth Alves, <alves@hungry.com> */
struct icaldurationtype icaldurationtype_from_int(int t)
{
struct icaldurationtype dur;
int used = 0;
dur = icaldurationtype_null_duration();
if(t < 0){
dur.is_neg = 1;
t = -t;
}
dur.weeks = (t - used) / (60 * 60 * 24 * 7);
used += dur.weeks * (60 * 60 * 24 * 7);
dur.days = (t - used) / (60 * 60 * 24);
used += dur.days * (60 * 60 * 24);
dur.hours = (t - used) / (60 * 60);
used += dur.hours * (60 * 60);
dur.minutes = (t - used) / (60);
used += dur.minutes * (60);
dur.seconds = (t - used);
return dur;
}
#ifndef ICAL_NO_LIBICAL
#include "icalvalue.h"
struct icaldurationtype icaldurationtype_from_string(const char* str)
{
int i;
int begin_flag = 0;
int time_flag = 0;
int date_flag = 0;
int week_flag = 0;
int digits=-1;
int scan_size = -1;
int size = strlen(str);
char p;
struct icaldurationtype d;
memset(&d, 0, sizeof(struct icaldurationtype));
for(i=0;i != size;i++){
p = str[i];
switch(p)
{
case '-': {
if(i != 0 || begin_flag == 1) goto error;
d.is_neg = 1;
break;
}
case 'P': {
if (i != 0 && i !=1 ) goto error;
begin_flag = 1;
break;
}
case 'T': {
time_flag = 1;
break;
}
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
/* HACK. Skip any more digits if the l;ast one
read has not been assigned */
if(digits != -1){
break;
}
if (begin_flag == 0) goto error;
/* Get all of the digits, not one at a time */
scan_size = sscanf((char*)(str+i),"%d",&digits);
if(scan_size == 0) goto error;
break;
}
case 'H': {
if (time_flag == 0||week_flag == 1||d.hours !=0||digits ==-1)
goto error;
d.hours = digits; digits = -1;
break;
}
case 'M': {
if (time_flag == 0||week_flag==1||d.minutes != 0||digits ==-1)
goto error;
d.minutes = digits; digits = -1;
break;
}
case 'S': {
if (time_flag == 0||week_flag==1||d.seconds!=0||digits ==-1)
goto error;
d.seconds = digits; digits = -1;
break;
}
case 'W': {
if (time_flag==1||date_flag==1||d.weeks!=0||digits ==-1)
goto error;
week_flag = 1;
d.weeks = digits; digits = -1;
break;
}
case 'D': {
if (time_flag==1||week_flag==1||d.days!=0||digits ==-1)
goto error;
date_flag = 1;
d.days = digits; digits = -1;
break;
}
default: {
goto error;
}
}
}
return d;
error:
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
memset(&d, 0, sizeof(struct icaldurationtype));
return d;
}
#define TMP_BUF_SIZE 1024
void append_duration_segment(char** buf, char** buf_ptr, size_t* buf_size,
char* sep, unsigned int value) {
char temp[TMP_BUF_SIZE];
sprintf(temp,"%d",value);
icalmemory_append_string(buf, buf_ptr, buf_size, temp);
icalmemory_append_string(buf, buf_ptr, buf_size, sep);
}
char* icaldurationtype_as_ical_string(struct icaldurationtype d)
{
char *buf, *output_line;
size_t buf_size = 256;
char* buf_ptr = 0;
int seconds;
buf = (char*)icalmemory_new_buffer(buf_size);
buf_ptr = buf;
seconds = icaldurationtype_as_int(d);
if(seconds !=0){
if(d.is_neg == 1){
icalmemory_append_char(&buf, &buf_ptr, &buf_size, '-');
}
icalmemory_append_char(&buf, &buf_ptr, &buf_size, 'P');
if (d.weeks != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "W", d.weeks);
}
if (d.days != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "D", d.days);
}
if (d.hours != 0 || d.minutes != 0 || d.seconds != 0) {
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "T");
if (d.hours != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "H", d.hours);
}
if (d.minutes != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "M",
d.minutes);
}
if (d.seconds != 0 ) {
append_duration_segment(&buf, &buf_ptr, &buf_size, "S",
d.seconds);
}
}
} else {
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "PTS0");
}
output_line = icalmemory_tmp_copy(buf);
icalmemory_free_buffer(buf);
return output_line;
}
#endif
/* From Russel Steinthal */
int icaldurationtype_as_int(struct icaldurationtype dur)
{
return (int)( (dur.seconds +
(60 * dur.minutes) +
(60 * 60 * dur.hours) +
(60 * 60 * 24 * dur.days) +
(60 * 60 * 24 * 7 * dur.weeks))
* (dur.is_neg==1? -1 : 1) ) ;
}
struct icaldurationtype icaldurationtype_null_duration()
{
struct icaldurationtype d;
memset(&d,0,sizeof(struct icaldurationtype));
return d;
}
int icaldurationtype_is_null_duration(struct icaldurationtype d)
{
if(icaldurationtype_as_int(d) == 0){
return 1;
} else {
return 0;
}
}
struct icaltimetype icaltime_add(struct icaltimetype t,
struct icaldurationtype d)
{
int dt = icaldurationtype_as_int(d);
t.second += dt;
t = icaltime_normalize(t);
return t;
}
struct icaldurationtype icaltime_subtract(struct icaltimetype t1,
struct icaltimetype t2)
{
time_t t1t = icaltime_as_timet(t1);
time_t t2t = icaltime_as_timet(t2);
return icaldurationtype_from_int(t1t-t2t);
}

View File

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

View File

@ -0,0 +1,135 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalenum.c
CREATOR: eric 29 April 1999
$Id: icalenums.c,v 1.2 2001/12/21 18:56:19 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 icalenum.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "icalenums.h"
#include <stdio.h> /* For fprintf */
#include <stdio.h> /* For stderr */
#include <string.h> /* For strncmp */
#include <assert.h>
struct {
enum icalrequeststatus kind;
int major;
int minor;
const char* str;
} request_status_map[] = {
{ICAL_2_0_SUCCESS_STATUS, 2,0,"Success."},
{ICAL_2_1_FALLBACK_STATUS, 2,1,"Success but fallback taken on one or more property values."},
{ICAL_2_2_IGPROP_STATUS, 2,2,"Success, invalid property ignored."},
{ICAL_2_3_IGPARAM_STATUS, 2,3,"Success, invalid property parameter ignored."},
{ICAL_2_4_IGXPROP_STATUS, 2,4,"Success, unknown non-standard property ignored."},
{ICAL_2_5_IGXPARAM_STATUS, 2,5,"Success, unknown non standard property value ignored."},
{ICAL_2_6_IGCOMP_STATUS, 2,6,"Success, invalid calendar component ignored."},
{ICAL_2_7_FORWARD_STATUS, 2,7,"Success, request forwarded to Calendar User."},
{ICAL_2_8_ONEEVENT_STATUS, 2,8,"Success, repeating event ignored. Scheduled as a single component."},
{ICAL_2_9_TRUNC_STATUS, 2,9,"Success, truncated end date time to date boundary."},
{ICAL_2_10_ONETODO_STATUS, 2,10,"Success, repeating VTODO ignored. Scheduled as a single VTODO."},
{ICAL_2_11_TRUNCRRULE_STATUS, 2,11,"Success, unbounded RRULE clipped at some finite number of instances "},
{ICAL_3_0_INVPROPNAME_STATUS, 3,0,"Invalid property name."},
{ICAL_3_1_INVPROPVAL_STATUS, 3,1,"Invalid property value."},
{ICAL_3_2_INVPARAM_STATUS, 3,2,"Invalid property parameter."},
{ICAL_3_3_INVPARAMVAL_STATUS, 3,3,"Invalid property parameter value."},
{ICAL_3_4_INVCOMP_STATUS, 3,4,"Invalid calendar component."},
{ICAL_3_5_INVTIME_STATUS, 3,5,"Invalid date or time."},
{ICAL_3_6_INVRULE_STATUS, 3,6,"Invalid rule."},
{ICAL_3_7_INVCU_STATUS, 3,7,"Invalid Calendar User."},
{ICAL_3_8_NOAUTH_STATUS, 3,8,"No authority."},
{ICAL_3_9_BADVERSION_STATUS, 3,9,"Unsupported version."},
{ICAL_3_10_TOOBIG_STATUS, 3,10,"Request entity too large."},
{ICAL_3_11_MISSREQCOMP_STATUS, 3,11,"Required component or property missing."},
{ICAL_3_12_UNKCOMP_STATUS, 3,12,"Unknown component or property found."},
{ICAL_3_13_BADCOMP_STATUS, 3,13,"Unsupported component or property found"},
{ICAL_3_14_NOCAP_STATUS, 3,14,"Unsupported capability."},
{ICAL_4_0_BUSY_STATUS, 4,0,"Event conflict. Date/time is busy."},
{ICAL_5_0_MAYBE_STATUS, 5,0,"Request MAY supported."},
{ICAL_5_1_UNAVAIL_STATUS, 5,1,"Service unavailable."},
{ICAL_5_2_NOSERVICE_STATUS, 5,2,"Invalid calendar service."},
{ICAL_5_3_NOSCHED_STATUS, 5,3,"No scheduling support for user."},
{ICAL_UNKNOWN_STATUS, 0,0,"Error: Unknown request status"}
};
const char* icalenum_reqstat_desc(icalrequeststatus stat)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].kind == stat) {
return request_status_map[i].str;
}
}
return 0;
}
short icalenum_reqstat_major(icalrequeststatus stat)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].kind == stat) {
return request_status_map[i].major;
}
}
return -1;
}
short icalenum_reqstat_minor(icalrequeststatus stat)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].kind == stat) {
return request_status_map[i].minor;
}
}
return -1;
}
icalrequeststatus icalenum_num_to_reqstat(short major, short minor)
{
int i;
for (i=0; request_status_map[i].kind != ICAL_UNKNOWN_STATUS; i++) {
if ( request_status_map[i].major == major && request_status_map[i].minor == minor) {
return request_status_map[i].kind;
}
}
return 0;
}

View File

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

View File

@ -0,0 +1,194 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalerror.c
CREATOR: eric 16 May 1999
$Id: icalerror.c,v 1.1 2001/11/15 19:26:56 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 icalerror.c
======================================================================*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "icalerror.h"
icalerrorenum icalerrno;
int foo;
void icalerror_stop_here(void)
{
foo++; /* Keep optimizers from removing routine */
}
void icalerror_crash_here(void)
{
int *p=0;
*p = 1;
assert( *p);
}
void icalerror_clear_errno() {
icalerrno = ICAL_NO_ERROR;
}
#ifdef ICAL_ERRORS_ARE_FATAL
int icalerror_errors_are_fatal = 1;
#else
int icalerror_errors_are_fatal = 0;
#endif
struct icalerror_state {
icalerrorenum error;
icalerrorstate state;
};
struct icalerror_state error_state_map[] =
{
{ ICAL_BADARG_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_NEWFAILED_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_PARSE_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_INTERNAL_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_FILE_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_USAGE_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_UNIMPLEMENTED_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_UNKNOWN_ERROR,ICAL_ERROR_DEFAULT},
{ ICAL_NO_ERROR,ICAL_ERROR_DEFAULT}
};
struct icalerror_string_map {
const char* str;
icalerrorenum error;
char name[160];
};
static struct icalerror_string_map string_map[] =
{
{"BADARG",ICAL_BADARG_ERROR,"BADARG: Bad argument to function"},
{ "NEWFAILED",ICAL_NEWFAILED_ERROR,"NEWFAILED: Failed to create a new object via a *_new() routine"},
{"MALFORMEDDATA",ICAL_MALFORMEDDATA_ERROR,"MALFORMEDDATA: An input string was not correctly formed or a component has missing or extra properties"},
{ "PARSE",ICAL_PARSE_ERROR,"PARSE: Failed to parse a part of an iCal component"},
{"INTERNAL",ICAL_INTERNAL_ERROR,"INTERNAL: Random internal error. This indicates an error in the library code, not an error in use"},
{ "FILE",ICAL_FILE_ERROR,"FILE: An operation on a file failed. Check errno for more detail."},
{ "USAGE",ICAL_USAGE_ERROR,"USAGE: Failed to propertyl sequence calls to a set of interfaces"},
{ "UNIMPLEMENTED",ICAL_UNIMPLEMENTED_ERROR,"UNIMPLEMENTED: This feature has not been implemented"},
{ "NO",ICAL_NO_ERROR,"NO: No error"},
{"UNKNOWN",ICAL_UNKNOWN_ERROR,"UNKNOWN: Unknown error type -- icalerror_strerror() was probably given bad input"}
};
icalerrorenum icalerror_error_from_string(const char* str){
icalerrorenum e;
int i = 0;
for( i = 0; string_map[i].error != ICAL_NO_ERROR; i++){
if (strcmp(string_map[i].str,str) == 0){
e = string_map[i].error;
}
}
return e;
}
icalerrorstate icalerror_supress(const char* error){
icalerrorenum e = icalerror_error_from_string(error);
icalerrorstate es;
if (e == ICAL_NO_ERROR){
return ICAL_ERROR_UNKNOWN;
}
es = icalerror_get_error_state(e);
icalerror_set_error_state(e,ICAL_ERROR_NONFATAL);
return es;
}
char* icalerror_perror()
{
return icalerror_strerror(icalerrno);
}
void icalerror_restore(const char* error, icalerrorstate es){
icalerrorenum e = icalerror_error_from_string(error);
if (e != ICAL_NO_ERROR){
icalerror_set_error_state(e,es);
}
}
void icalerror_set_error_state( icalerrorenum error,
icalerrorstate state)
{
int i;
for(i = ICAL_BADARG_ERROR; error_state_map[i].error!= ICAL_NO_ERROR;i++){
if(error_state_map[i].error == error){
error_state_map[i].state = state;
}
}
}
icalerrorstate icalerror_get_error_state( icalerrorenum error)
{
int i;
for(i = ICAL_BADARG_ERROR; error_state_map[i].error!= ICAL_NO_ERROR;i++){
if(error_state_map[i].error == error){
return error_state_map[i].state;
}
}
return ICAL_ERROR_UNKNOWN;
}
char* icalerror_strerror(icalerrorenum e) {
int i;
for (i=0; string_map[i].error != ICAL_UNKNOWN_ERROR; i++) {
if (string_map[i].error == e) {
return string_map[i].name;
}
}
return string_map[i].name; /* Return string for ICAL_UNKNOWN_ERROR*/
}

View File

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

View File

@ -0,0 +1,272 @@
/* -*- Mode: C -*-
======================================================================
FILE: icallangbind.c
CREATOR: eric 15 dec 2000
DESCRIPTION:
$Id: icallangbind.c,v 1.1 2001/11/15 19:26:57 mikep%oeone.com Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
http://www.softwarestudio.org
This package is free software and is provided "as is" without
express or implied warranty. It may be used, redistributed and/or
modified under the same terms as perl itself. ( Either the Artistic
License or the GPL. )
======================================================================*/
#include "icalcomponent.h"
#include "icalproperty.h"
#include "icalerror.h"
#include "icalmemory.h"
#include <malloc.h>
#include <string.h>
int* icallangbind_new_array(int size){
int* p = (int*)malloc(size*sizeof(int));
return p; /* Caller handles failures */
}
void icallangbind_free_array(int* array){
free(array);
}
int icallangbind_access_array(int* array, int index) {
return array[index];
}
/* LIke icalcomponent_get_first_component, buut takes a string for the
kind and can iterate over X properties as if each X name was a
seperate kind */
icalproperty* icallangbind_get_first_property(icalcomponent *c,
const char* prop)
{
icalproperty_kind kind = icalproperty_string_to_kind(prop);
icalproperty *p;
if (kind == ICAL_NO_PROPERTY){
return 0;
}
if(kind == ICAL_X_PROPERTY){
for(p = icalcomponent_get_first_property(c,kind);
p !=0;
p = icalcomponent_get_next_property(c,kind)){
if(strcmp(icalproperty_get_x_name(p),prop) == 0){
return p;
}
}
} else {
p=icalcomponent_get_first_property(c,kind);
return p;
}
return 0;
}
icalproperty* icallangbind_get_next_property(icalcomponent *c,
const char* prop)
{
icalproperty_kind kind = icalenum_string_to_property_kind(prop);
icalproperty *p;
if (kind == ICAL_NO_PROPERTY){
return 0;
}
if(kind == ICAL_X_PROPERTY){
for(p = icalcomponent_get_next_property(c,kind);
p !=0;
p = icalcomponent_get_next_property(c,kind)){
if(strcmp(icalproperty_get_x_name(p),prop) == 0){
return p;
}
}
} else {
p=icalcomponent_get_next_property(c,kind);
return p;
}
return 0;
}
icalcomponent* icallangbind_get_first_component(icalcomponent *c,
const char* comp)
{
icalcomponent_kind kind = icalenum_string_to_component_kind(comp);
if (kind == ICAL_NO_COMPONENT){
return 0;
}
return icalcomponent_get_first_component(c,kind);
}
icalcomponent* icallangbind_get_next_component(icalcomponent *c,
const char* comp)
{
icalcomponent_kind kind = icalenum_string_to_component_kind(comp);
if (kind == ICAL_NO_COMPONENT){
return 0;
}
return icalcomponent_get_next_component(c,kind);
}
#define APPENDS(x) icalmemory_append_string(&buf, &buf_ptr, &buf_size, x);
#define APPENDC(x) icalmemory_append_char(&buf, &buf_ptr, &buf_size, x);
const char* icallangbind_property_eval_string(icalproperty* prop, char* sep)
{
char tmp[25];
size_t buf_size = 1024;
char* buf = icalmemory_new_buffer(buf_size);
char* buf_ptr = buf;
icalparameter *param;
icalvalue* value;
if( prop == 0){
return 0;
}
APPENDS("{ ");
value = icalproperty_get_value(prop);
APPENDS(" 'name' ");
APPENDS(sep);
APPENDC('\'');
APPENDS(icalenum_property_kind_to_string(icalproperty_isa(prop)));
APPENDC('\'');
if(value){
APPENDS(", 'value_type' ");
APPENDS(sep);
APPENDC('\'');
APPENDS(icalenum_value_kind_to_string(icalvalue_isa(value)));
APPENDC('\'');
}
APPENDS(", 'pid' ");
APPENDS(sep);
APPENDC('\'');
snprintf(tmp,25,"%p",prop);
APPENDS(tmp);
APPENDC('\'');
if(value){
switch (icalvalue_isa(value)){
case ICAL_ATTACH_VALUE:
case ICAL_BINARY_VALUE:
case ICAL_NO_VALUE: {
icalerror_set_errno(ICAL_INTERNAL_ERROR);
break;
}
default:
{
const char* str = icalvalue_as_ical_string(value);
char* copy = (char*) malloc(strlen(str)+1);
const char *i;
char *j;
if(copy ==0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
break;
}
/* Remove any newlines */
for(j=copy, i = str; *i != 0; j++,i++){
if(*i=='\n'){
i++;
}
*j = *i;
}
*j = 0;
APPENDS(", 'value'");
APPENDS(sep);
APPENDC('\'');
APPENDS(copy);
APPENDC('\'');
free(copy);
break;
}
}
}
/* Add Parameters */
for(param = icalproperty_get_first_parameter(prop,ICAL_ANY_PARAMETER);
param != 0;
param = icalproperty_get_next_parameter(prop,ICAL_ANY_PARAMETER)){
const char* str = icalparameter_as_ical_string(param);
char *copy = icalmemory_tmp_copy(str);
char *v;
if(copy == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
continue;
}
v = strchr(copy,'=');
if(v == 0){
continue;
}
*v = 0;
v++;
APPENDS(", ");
APPENDC('\'');
APPENDS(copy);
APPENDC('\'');
APPENDS(sep);
APPENDC('\'');
APPENDS(v);
APPENDC('\'');
}
APPENDC('}');
icalmemory_add_tmp_buffer(buf);
return buf;
}
#include "fcntl.h"
int icallangbind_string_to_open_flag(const char* str)
{
if (strcmp(str,"r") == 0) {return O_RDONLY;}
else if (strcmp(str,"r+") == 0) {return O_RDWR;}
else if (strcmp(str,"w") == 0) {return O_WRONLY;}
else if (strcmp(str,"a") == 0) {return O_WRONLY|O_APPEND;}
else return -1;
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,168 @@
%{
/* -*- Mode: C -*-
======================================================================
FILE: icallexer.l
CREATOR: eric 10 June 1999
DESCRIPTION:
$Id: icallexer.l,v 1.1 2001/11/15 19:26:58 mikep%oeone.com Exp $
$Locker: $
(C) COPYRIGHT 1999 Eric Busboom
http://www.softwarestudio.org
The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
The original author is Eric Busboom
The original code is icalitip.y
======================================================================*/
#include "icalparser.h"
#include "icalenums.h"
#include "icalmemory.h"
#include "assert.h"
#include "icalyacc.h"
#include <string.h> /* For strdup() */
int icalparser_flex_input(char* buf, int max_size);
void icalparser_clear_flex_input(void);
#define ICAL_MAX_STR_CONST 1024
#undef YY_INPUT
#define YY_INPUT(b,r,ms) ( r= icalparser_flex_input(b,ms))
#undef yywrap
#undef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) ical_yyerror(msg)
icalvalue_kind value_kind=ICAL_NO_VALUE;
void set_parser_value_state(icalvalue_kind kind);
extern int yydebug;
void ical_yyerror(char *s);
void init_str_buf(void);
int last_state;
char *str_buf;
char *str_buf_p;
size_t buf_sz; /* = ICAL_MAX_STR_CONST;*/
/* Define routines that were not propertly defined because of the
renaming hack applied in icalyacc.y */
YY_BUFFER_STATE ical_yy_scan_buffer ( char *base, yy_size_t size );
YY_BUFFER_STATE ical_yy_scan_string ( yyconst char *yy_str );
YY_BUFFER_STATE ical_yy_scan_bytes ( yyconst char *bytes, int len );
%}
crlf \x0D?\x0A
space [ ]
qsafechar [^\x00-\x1F\"]
safechar [^\x00-\x1F\"\:\;\,]
tsafechar [\x20-\x21\x23-\x2B\x2D-\x39\x3C-\x5B\x5D-\x7E]
valuechar [^\x00-\x08\x10-\x1F]
xname X-[a-zA-Z0-9\-]+
xname2 [a-zA-Z0-9\-\ ]
paramtext {safechar}+
value {valuechar}+
quotedstring \"{qsafechar}+\"
digit [0-9]
%array /* Make yytext an array. Slow, but handy. HACK */
%option caseless
%s quoted_string
%s binary_value boolean_value uri_value time_value duration_value number_value period_value recur_value text_value utcoffset_value
%s enum_param_value string_param_value stringlist_param_value keyword line_start component seperator parameter end_of_value paramtext
%%
%{
%}
<time_value>{
{digit}+ { ical_yylval.v_string =icalmemory_tmp_copy(yytext) ;
return DIGITS; }
T { return TIME_CHAR; }
Z { return UTC_CHAR; }
[\/\+\-PWHMSD] { return yytext[0]; }
{crlf} { return EOL;}
}
<utcoffset_value>{
{crlf} { return EOL;}
\-|\+ { return yytext[0]; }
{digit}{digit} { ical_yylval.v_int=atoi(yytext); return INTNUMBER; }
}
<enum_param_value>{
. { return CHARACTER; }
{crlf} { return EOL;}
}
<seperator>{
, { BEGIN(last_state); return COMMA; }
}
%%
int yywrap()
{
return 1;
}
void set_parser_value_state(icalvalue_kind kind)
{
switch (kind){
case ICAL_UTCOFFSET_VALUE:
{BEGIN(utcoffset_value);break;}
case ICAL_DATETIMEPERIOD_VALUE:
case ICAL_DURATION_VALUE:
case ICAL_PERIOD_VALUE:
{BEGIN(time_value);break;}
default:
{
assert(1==0);
}
}
}
void init_str_buf(void)
{
str_buf = icalmemory_tmp_buffer(ICAL_MAX_STR_CONST);
str_buf_p = str_buf;
buf_sz = ICAL_MAX_STR_CONST;
}

View File

@ -0,0 +1,287 @@
/* -*- Mode: C -*-
======================================================================
FILE: icalmemory.c
CREATOR: eric 30 June 1999
$Id: icalmemory.c,v 1.1 2001/11/15 19:26:58 mikep%oeone.com Exp $
$Locker: $
The contents of this file are subject to the Mozilla Public License
Version 1.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The Original Code is icalmemory.h
======================================================================*/
/* libical often passes strings back to the caller. To make these
* interfaces simple, I did not want the caller to have to pass in a
* memory buffer, but having libical pass out newly allocated memory
* makes it difficult to de-allocate the memory.
*
* The ring buffer in this scheme makes it possible for libical to pass
* out references to memory which the caller does not own, and be able
* to de-allocate the memory later. The ring allows libical to have
* several buffers active simultaneously, which is handy when creating
* string representations of components. */
#define ICALMEMORY_C
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef DMALLOC
#include "dmalloc.h"
#endif
#include "icalmemory.h"
#include "icalerror.h"
#include <stdio.h> /* for printf (debugging) */
#include <stdlib.h> /* for malloc, realloc */
#include <string.h> /* for memset(), strdup */
#define BUFFER_RING_SIZE 25
#define MIN_BUFFER_SIZE 200
void icalmemory_free_tmp_buffer (void* buf);
/* HACK. Not threadsafe */
void* buffer_ring[BUFFER_RING_SIZE];
int buffer_pos = -1;
int initialized = 0;
/* Add an existing buffer to the buffer ring */
void icalmemory_add_tmp_buffer(void* buf)
{
/* I don't think I need this -- I think static arrays are
initialized to 0 as a standard part of C, but I am not sure. */
if (initialized == 0){
int i;
for(i=0; i<BUFFER_RING_SIZE; i++){
buffer_ring[i] = 0;
}
initialized = 1;
}
/* Wrap around the ring */
if(++buffer_pos == BUFFER_RING_SIZE){
buffer_pos = 0;
}
/* Free buffers as their slots are overwritten */
if ( buffer_ring[buffer_pos] != 0){
free( buffer_ring[buffer_pos]);
buffer_ring[buffer_pos] = 0;
}
/* Assign the buffer to a slot */
buffer_ring[buffer_pos] = buf;
}
/* Create a new temporary buffer on the ring. Libical owns these and
wil deallocate them. */
void*
icalmemory_tmp_buffer (size_t size)
{
char *buf;
if (size < MIN_BUFFER_SIZE){
size = MIN_BUFFER_SIZE;
}
buf = (void*)malloc(size);
if( buf == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
memset(buf,0,size);
icalmemory_add_tmp_buffer(buf);
return buf;
}
void icalmemory_free_ring()
{
int i;
for(i=0; i<BUFFER_RING_SIZE; i++){
if ( buffer_ring[i] != 0){
free( buffer_ring[i]);
}
buffer_ring[i] = 0;
}
initialized = 1;
}
/* Like strdup, but the buffer is on the ring. */
char*
icalmemory_tmp_copy(const char* str)
{
char* b = icalmemory_tmp_buffer(strlen(str)+1);
strcpy(b,str);
return b;
}
char* icalmemory_strdup(const char *s)
{
return strdup(s);
}
void
icalmemory_free_tmp_buffer (void* buf)
{
if(buf == 0)
{
return;
}
free(buf);
}
/* These buffer routines create memory the old fashioned way -- so the
caller will have to delocate the new memory */
void* icalmemory_new_buffer(size_t size)
{
void *b = malloc(size);
if( b == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
memset(b,0,size);
return b;
}
void* icalmemory_resize_buffer(void* buf, size_t size)
{
void *b = realloc(buf, size);
if( b == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
return b;
}
void icalmemory_free_buffer(void* buf)
{
free(buf);
}
void
icalmemory_append_string(char** buf, char** pos, size_t* buf_size,
const char* string)
{
char *new_buf;
char *new_pos;
size_t data_length, final_length, string_length;
#ifndef ICAL_NO_INTERNAL_DEBUG
icalerror_check_arg_rv( (buf!=0),"buf");
icalerror_check_arg_rv( (*buf!=0),"*buf");
icalerror_check_arg_rv( (pos!=0),"pos");
icalerror_check_arg_rv( (*pos!=0),"*pos");
icalerror_check_arg_rv( (buf_size!=0),"buf_size");
icalerror_check_arg_rv( (*buf_size!=0),"*buf_size");
icalerror_check_arg_rv( (string!=0),"string");
#endif
string_length = strlen(string);
data_length = (size_t)*pos - (size_t)*buf;
final_length = data_length + string_length;
if ( final_length >= (size_t) *buf_size) {
*buf_size = (*buf_size) * 2 + final_length;
new_buf = realloc(*buf,*buf_size);
new_pos = (void*)((size_t)new_buf + data_length);
*pos = new_pos;
*buf = new_buf;
}
strcpy(*pos, string);
*pos += string_length;
}
void
icalmemory_append_char(char** buf, char** pos, size_t* buf_size,
char ch)
{
char *new_buf;
char *new_pos;
size_t data_length, final_length;
#ifndef ICAL_NO_INTERNAL_DEBUG
icalerror_check_arg_rv( (buf!=0),"buf");
icalerror_check_arg_rv( (*buf!=0),"*buf");
icalerror_check_arg_rv( (pos!=0),"pos");
icalerror_check_arg_rv( (*pos!=0),"*pos");
icalerror_check_arg_rv( (buf_size!=0),"buf_size");
icalerror_check_arg_rv( (*buf_size!=0),"*buf_size");
#endif
data_length = (size_t)*pos - (size_t)*buf;
final_length = data_length + 2;
if ( final_length > (size_t) *buf_size ) {
*buf_size = (*buf_size) * 2 + final_length +1;
new_buf = realloc(*buf,*buf_size);
new_pos = (void*)((size_t)new_buf + data_length);
*pos = new_pos;
*buf = new_buf;
}
**pos = ch;
*pos += 1;
**pos = 0;
}

View File

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

View File

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

View File

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

View File

@ -0,0 +1,382 @@
/* -*- Mode: C -*-
======================================================================
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 $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalderivedparameters.{c,h}
Contributions from:
Graham Davison (g.m.davison@computer.org)
======================================================================*/
/*#line 29 "icalparameter.c.in"*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalparameter.h"
#include "icalproperty.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "icalparameterimpl.h"
#include <stdlib.h> /* for malloc() */
#include <errno.h>
#include <string.h> /* for memset() */
/* In icalderivedparameter */
icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind,const char* val);
struct icalparameter_impl* icalparameter_new_impl(icalparameter_kind kind)
{
struct icalparameter_impl* v;
if ( ( v = (struct icalparameter_impl*)
malloc(sizeof(struct icalparameter_impl))) == 0) {
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
strcpy(v->id,"para");
v->kind = kind;
v->size = 0;
v->string = 0;
v->x_name = 0;
v->parent = 0;
v->data = 0;
return v;
}
icalparameter*
icalparameter_new (icalparameter_kind kind)
{
struct icalparameter_impl* v = icalparameter_new_impl(kind);
return (icalparameter*) v;
}
void
icalparameter_free (icalparameter* parameter)
{
struct icalparameter_impl * impl;
impl = (struct icalparameter_impl*)parameter;
/* HACK. This always triggers, even when parameter is non-zero
icalerror_check_arg_rv((parameter==0),"parameter");*/
#ifdef ICAL_FREE_ON_LIST_IS_ERROR
icalerror_assert( (impl->parent ==0),"Tried to free a parameter that is still attached to a component. ");
#else
if(impl->parent !=0){
return;
}
#endif
if (impl->string != 0){
free ((void*)impl->string);
}
if (impl->x_name != 0){
free ((void*)impl->x_name);
}
memset(impl,0,sizeof(impl));
impl->parent = 0;
impl->id[0] = 'X';
free(impl);
}
icalparameter*
icalparameter_new_clone(icalparameter* param)
{
struct icalparameter_impl *old;
struct icalparameter_impl *new;
old = (struct icalparameter_impl *)param;
new = icalparameter_new_impl(old->kind);
icalerror_check_arg_rz((param!=0),"param");
if (new == 0){
return 0;
}
memcpy(new,old,sizeof(struct icalparameter_impl));
if (old->string != 0){
new->string = icalmemory_strdup(old->string);
if (new->string == 0){
icalparameter_free(new);
return 0;
}
}
if (old->x_name != 0){
new->x_name = icalmemory_strdup(old->x_name);
if (new->x_name == 0){
icalparameter_free(new);
return 0;
}
}
return new;
}
icalparameter* icalparameter_new_from_string(const char *str)
{
char* eq;
char* cpy;
icalparameter_kind kind;
icalparameter *param;
icalerror_check_arg_rz(str != 0,"str");
cpy = icalmemory_strdup(str);
if (cpy == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
eq = strchr(cpy,'=');
if(eq == 0){
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return 0;
}
*eq = '\0';
eq++;
kind = icalparameter_string_to_kind(cpy);
if(kind == ICAL_NO_PARAMETER){
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return 0;
}
param = icalparameter_new_from_value_string(kind,eq);
if(kind == ICAL_X_PARAMETER){
icalparameter_set_xname(param,cpy);
}
free(cpy);
return param;
}
char*
icalparameter_as_ical_string (icalparameter* parameter)
{
struct icalparameter_impl* impl;
size_t buf_size = 1024;
char* buf;
char* buf_ptr;
char *out_buf;
const char *kind_string;
icalerror_check_arg_rz( (parameter!=0), "parameter");
/* Create new buffer that we can append names, parameters and a
value to, and reallocate as needed. Later, this buffer will be
copied to a icalmemory_tmp_buffer, which is managed internally
by libical, so it can be given to the caller without fear of
the caller forgetting to free it */
buf = icalmemory_new_buffer(buf_size);
buf_ptr = buf;
impl = (struct icalparameter_impl*)parameter;
if(impl->kind == ICAL_X_PARAMETER) {
icalmemory_append_string(&buf, &buf_ptr, &buf_size,
icalparameter_get_xname(impl));
} else {
kind_string = icalparameter_kind_to_string(impl->kind);
if (impl->kind == ICAL_NO_PARAMETER ||
impl->kind == ICAL_ANY_PARAMETER ||
kind_string == 0)
{
icalerror_set_errno(ICAL_BADARG_ERROR);
return 0;
}
/* Put the parameter name into the string */
icalmemory_append_string(&buf, &buf_ptr, &buf_size, kind_string);
}
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "=");
if(impl->string !=0){
icalmemory_append_string(&buf, &buf_ptr, &buf_size, impl->string);
} else if (impl->data != 0){
const char* str = icalparameter_enum_to_string(impl->data);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, str);
} else {
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return 0;
}
/* Now, copy the buffer to a tmp_buffer, which is safe to give to
the caller without worring about de-allocating it. */
out_buf = icalmemory_tmp_buffer(strlen(buf));
strcpy(out_buf, buf);
icalmemory_free_buffer(buf);
return out_buf;
}
int
icalparameter_is_valid (icalparameter* parameter);
icalparameter_kind
icalparameter_isa (icalparameter* parameter)
{
if(parameter == 0){
return ICAL_NO_PARAMETER;
}
return ((struct icalparameter_impl *)parameter)->kind;
}
int
icalparameter_isa_parameter (void* parameter)
{
struct icalparameter_impl *impl = (struct icalparameter_impl *)parameter;
if (parameter == 0){
return 0;
}
if (strcmp(impl->id,"para") == 0) {
return 1;
} else {
return 0;
}
}
void
icalparameter_set_xname (icalparameter* param, const char* v)
{
struct icalparameter_impl *impl = (struct icalparameter_impl*)param;
icalerror_check_arg_rv( (param!=0),"param");
icalerror_check_arg_rv( (v!=0),"v");
if (impl->x_name != 0){
free((void*)impl->x_name);
}
impl->x_name = icalmemory_strdup(v);
if (impl->x_name == 0){
errno = ENOMEM;
}
}
const char*
icalparameter_get_xname (icalparameter* param)
{
struct icalparameter_impl *impl = (struct icalparameter_impl*)param;
icalerror_check_arg_rz( (param!=0),"param");
return impl->x_name;
}
void
icalparameter_set_xvalue (icalparameter* param, const char* v)
{
struct icalparameter_impl *impl = (struct icalparameter_impl*)param;
icalerror_check_arg_rv( (param!=0),"param");
icalerror_check_arg_rv( (v!=0),"v");
if (impl->string != 0){
free((void*)impl->string);
}
impl->string = icalmemory_strdup(v);
if (impl->string == 0){
errno = ENOMEM;
}
}
const char*
icalparameter_get_xvalue (icalparameter* param)
{
struct icalparameter_impl *impl = (struct icalparameter_impl*)param;
icalerror_check_arg_rz( (param!=0),"param");
return impl->string;
}
void icalparameter_set_parent(icalparameter* param,
icalproperty* property)
{
struct icalparameter_impl *impl = (struct icalparameter_impl*)param;
icalerror_check_arg_rv( (param!=0),"param");
impl->parent = property;
}
icalproperty* icalparameter_get_parent(icalparameter* param)
{
struct icalparameter_impl *impl = (struct icalparameter_impl*)param;
icalerror_check_arg_rz( (param!=0),"param");
return impl->parent;
}
/* Everything below this line is machine generated. Do not edit. */
/* ALTREP */

View File

@ -0,0 +1,69 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalparam.h
CREATOR: eric 20 March 1999
$Id: icalparameter.h,v 1.2 2001/12/21 18:56:22 mikep%oeone.com Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalparam.h
======================================================================*/
#ifndef ICALPARAM_H
#define ICALPARAM_H
#include "icalderivedparameter.h"
/* Declared in icalderivedparameter.h */
/*typedef void icalparameter;*/
icalparameter* icalparameter_new(icalparameter_kind kind);
icalparameter* icalparameter_new_clone(icalparameter* p);
/* Create from string of form "PARAMNAME=VALUE" */
icalparameter* icalparameter_new_from_string(const char* value);
/* Create from just the value, the part after the "=" */
icalparameter* icalparameter_new_from_value_string(icalparameter_kind kind, const char* value);
void icalparameter_free(icalparameter* parameter);
char* icalparameter_as_ical_string(icalparameter* parameter);
int icalparameter_is_valid(icalparameter* parameter);
icalparameter_kind icalparameter_isa(icalparameter* parameter);
int icalparameter_isa_parameter(void* param);
/* Acess the name of an X parameer */
void icalparameter_set_xname (icalparameter* param, const char* v);
const char* icalparameter_get_xname(icalparameter* param);
void icalparameter_set_xvalue (icalparameter* param, const char* v);
const char* icalparameter_get_xvalue(icalparameter* param);
/* Convert enumerations */
const char* icalparameter_kind_to_string(icalparameter_kind kind);
icalparameter_kind icalparameter_string_to_kind(const char* string);
#endif

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -0,0 +1,808 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalproperty.c
CREATOR: eric 28 April 1999
$Id: icalproperty.c,v 1.1 2001/11/15 19:27:07 mikep%oeone.com Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalproperty.c
======================================================================*/
/*#line 27 "icalproperty.c.in"*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "icalproperty.h"
#include "icalparameter.h"
#include "icalcomponent.h"
#include "pvl.h"
#include "icalenums.h"
#include "icalerror.h"
#include "icalmemory.h"
#include "icalparser.h"
#include <string.h> /* For icalmemory_strdup, rindex */
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h> /* for printf */
#include <stdarg.h> /* for va_list, va_start, etc. */
#define TMP_BUF_SIZE 1024
/* Private routines for icalproperty */
void icalvalue_set_parent(icalvalue* value,
icalproperty* property);
icalproperty* icalvalue_get_parent(icalvalue* value);
void icalparameter_set_parent(icalparameter* param,
icalproperty* property);
icalproperty* icalparameter_get_parent(icalparameter* value);
void icalproperty_set_x_name(icalproperty* prop, char* name);
struct icalproperty_impl
{
char id[5];
icalproperty_kind kind;
char* x_name;
pvl_list parameters;
pvl_elem parameter_iterator;
icalvalue* value;
icalcomponent *parent;
};
void icalproperty_add_parameters(struct icalproperty_impl *prop,va_list args)
{
void* vp;
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
while((vp = va_arg(args, void*)) != 0) {
if (icalvalue_isa_value(vp) != 0 ){
} else if (icalparameter_isa_parameter(vp) != 0 ){
icalproperty_add_parameter((icalproperty*)impl,
(icalparameter*)vp);
} else {
assert(0);
}
}
}
struct icalproperty_impl*
icalproperty_new_impl (icalproperty_kind kind)
{
struct icalproperty_impl* prop;
if ( ( prop = (struct icalproperty_impl*)
malloc(sizeof(struct icalproperty_impl))) == 0) {
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
strcpy(prop->id,"prop");
prop->kind = kind;
prop->parameters = pvl_newlist();
prop->parameter_iterator = 0;
prop->value = 0;
prop->x_name = 0;
prop->parent = 0;
return prop;
}
icalproperty*
icalproperty_new (icalproperty_kind kind)
{
if(kind == ICAL_NO_PROPERTY){
return 0;
}
return (icalproperty*)icalproperty_new_impl(kind);
}
icalproperty*
icalproperty_new_clone(icalproperty* prop)
{
struct icalproperty_impl *old = (struct icalproperty_impl*)prop;
struct icalproperty_impl *new = icalproperty_new_impl(old->kind);
pvl_elem p;
icalerror_check_arg_rz((prop!=0),"Prop");
icalerror_check_arg_rz((old!=0),"old");
icalerror_check_arg_rz((new!=0),"new");
if (old->value !=0) {
new->value = icalvalue_new_clone(old->value);
}
if (old->x_name != 0) {
new->x_name = icalmemory_strdup(old->x_name);
if (new->x_name == 0) {
icalproperty_free(new);
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
}
for(p=pvl_head(old->parameters);p != 0; p = pvl_next(p)){
icalparameter *param = icalparameter_new_clone(pvl_data(p));
if (param == 0){
icalproperty_free(new);
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
return 0;
}
pvl_push(new->parameters,param);
}
return new;
}
icalproperty* icalproperty_new_from_string(char* str)
{
size_t buf_size = 1024;
char* buf = icalmemory_new_buffer(buf_size);
char* buf_ptr = buf;
icalproperty *prop;
icalcomponent *comp;
int errors = 0;
icalerror_check_arg_rz( (str!=0),"str");
/* Is this a HACK or a crafty reuse of code? */
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "BEGIN:VCALENDAR\n");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, str);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "\n");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "END:VCALENDAR\n");
comp = icalparser_parse_string(buf);
if(comp == 0){
icalerror_set_errno(ICAL_PARSE_ERROR);
return 0;
}
errors = icalcomponent_count_errors(comp);
prop = icalcomponent_get_first_property(comp,ICAL_ANY_PROPERTY);
icalcomponent_remove_property(comp,prop);
icalcomponent_free(comp);
free(buf);
if(errors > 0){
icalproperty_free(prop);
return 0;
} else {
return prop;
}
}
void
icalproperty_free (icalproperty* prop)
{
struct icalproperty_impl *p;
icalparameter* param;
icalerror_check_arg_rv((prop!=0),"prop");
p = (struct icalproperty_impl*)prop;
#ifdef ICAL_FREE_ON_LIST_IS_ERROR
icalerror_assert( (p->parent ==0),"Tried to free a property that is still attached to a component. ");
#else
if(p->parent !=0){
return;
}
#endif
if (p->value != 0){
icalvalue_set_parent(p->value,0);
icalvalue_free(p->value);
}
while( (param = pvl_pop(p->parameters)) != 0){
icalparameter_free(param);
}
pvl_free(p->parameters);
if (p->x_name != 0) {
free(p->x_name);
}
p->kind = ICAL_NO_PROPERTY;
p->parameters = 0;
p->parameter_iterator = 0;
p->value = 0;
p->x_name = 0;
p->id[0] = 'X';
free(p);
}
char*
icalproperty_as_ical_string (icalproperty* prop)
{
icalparameter *param;
/* Create new buffer that we can append names, parameters and a
value to, and reallocate as needed. Later, this buffer will be
copied to a icalmemory_tmp_buffer, which is managed internally
by libical, so it can be given to the caller without fear of
the caller forgetting to free it */
const char* property_name = 0;
size_t buf_size = 1024;
char* buf = icalmemory_new_buffer(buf_size);
char* buf_ptr = buf;
icalvalue* value;
char *out_buf;
char newline[] = "\n";
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
icalerror_check_arg_rz( (prop!=0),"prop");
/* Append property name */
if (impl->kind == ICAL_X_PROPERTY && impl->x_name != 0){
property_name = impl->x_name;
} else {
property_name = icalproperty_kind_to_string(impl->kind);
}
if (property_name == 0 ) {
icalerror_warn("Got a property of an unknown kind.");
icalmemory_free_buffer(buf);
return 0;
}
icalmemory_append_string(&buf, &buf_ptr, &buf_size, property_name);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline);
/* Determine what VALUE parameter to include. The VALUE parameters
are ignored in the normal parameter printing ( the block after
this one, so we need to do it here */
{
const char* kind_string = 0;
icalparameter *orig_val_param
= icalproperty_get_first_parameter(prop,ICAL_VALUE_PARAMETER);
icalvalue *value = icalproperty_get_value(impl);
icalvalue_kind orig_kind = ICAL_NO_VALUE;
icalvalue_kind this_kind = ICAL_NO_VALUE;
icalvalue_kind default_kind
= icalproperty_kind_to_value_kind(impl->kind);
if(orig_val_param){
orig_kind = (icalvalue_kind)icalparameter_get_value(orig_val_param);
}
if(value != 0){
this_kind = icalvalue_isa(value);
}
if(this_kind == default_kind &&
orig_kind != ICAL_NO_VALUE){
/* The kind is the default, so it does not need to be
included, but do it anyway, since it was explicit in
the property. But, use the default, not the one
specified in the property */
kind_string = icalvalue_kind_to_string(default_kind);
} else if (this_kind != default_kind && this_kind != ICAL_NO_VALUE){
/* Not the default, so it must be specified */
kind_string = icalvalue_kind_to_string(this_kind);
} else {
/* Don'tinclude the VALUE parameter at all */
}
if(kind_string!=0){
icalmemory_append_string(&buf, &buf_ptr, &buf_size, " ;");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, "VALUE=");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, kind_string);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline);
}
}
/* Append parameters */
for(param = icalproperty_get_first_parameter(prop,ICAL_ANY_PARAMETER);
param != 0;
param = icalproperty_get_next_parameter(prop,ICAL_ANY_PARAMETER)) {
char* kind_string = icalparameter_as_ical_string(param);
icalparameter_kind kind = icalparameter_isa(param);
if(kind==ICAL_VALUE_PARAMETER){
continue;
}
if (kind_string == 0 ) {
char temp[TMP_BUF_SIZE];
snprintf(temp, TMP_BUF_SIZE,"Got a parameter of unknown kind in %s property",property_name);
icalerror_warn(temp);
continue;
}
icalmemory_append_string(&buf, &buf_ptr, &buf_size, " ;");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, kind_string);
icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline);
}
/* Append value */
icalmemory_append_string(&buf, &buf_ptr, &buf_size, " :");
value = icalproperty_get_value(prop);
if (value != 0){
const char *str = icalvalue_as_ical_string(value);
icalerror_assert((str !=0),"Could not get string representation of a value");
icalmemory_append_string(&buf, &buf_ptr, &buf_size, str);
} else {
icalmemory_append_string(&buf, &buf_ptr, &buf_size,"ERROR: No Value");
}
icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline);
/* Now, copy the buffer to a tmp_buffer, which is safe to give to
the caller without worring about de-allocating it. */
out_buf = icalmemory_tmp_buffer(strlen(buf)+1);
strcpy(out_buf, buf);
icalmemory_free_buffer(buf);
return out_buf;
}
icalproperty_kind
icalproperty_isa (icalproperty* property)
{
struct icalproperty_impl *p = (struct icalproperty_impl*)property;
if(property != 0){
return p->kind;
}
return ICAL_NO_PROPERTY;
}
int
icalproperty_isa_property (void* property)
{
struct icalproperty_impl *impl = (struct icalproperty_impl*)property;
icalerror_check_arg_rz( (property!=0), "property");
if (strcmp(impl->id,"prop") == 0) {
return 1;
} else {
return 0;
}
}
void
icalproperty_add_parameter (icalproperty* prop,icalparameter* parameter)
{
struct icalproperty_impl *p = (struct icalproperty_impl*)prop;
icalerror_check_arg_rv( (prop!=0),"prop");
icalerror_check_arg_rv( (parameter!=0),"parameter");
pvl_push(p->parameters, parameter);
}
void
icalproperty_set_parameter (icalproperty* prop,icalparameter* parameter)
{
icalparameter_kind kind;
icalerror_check_arg_rv( (prop!=0),"prop");
icalerror_check_arg_rv( (parameter!=0),"parameter");
kind = icalparameter_isa(parameter);
icalproperty_remove_parameter(prop,kind);
icalproperty_add_parameter(prop,parameter);
}
void icalproperty_set_parameter_from_string(icalproperty* prop,
const char* name, const char* value)
{
icalparameter_kind kind;
icalparameter *param;
icalerror_check_arg_rv( (prop!=0),"prop");
icalerror_check_arg_rv( (name!=0),"name");
icalerror_check_arg_rv( (value!=0),"value");
kind = icalparameter_string_to_kind(name);
if(kind == ICAL_NO_PARAMETER){
icalerror_set_errno(ICAL_BADARG_ERROR);
return;
}
param = icalparameter_new_from_value_string(kind,value);
if (param == 0){
icalerror_set_errno(ICAL_BADARG_ERROR);
return;
}
icalproperty_set_parameter(prop,param);
}
const char* icalproperty_get_parameter_as_string(icalproperty* prop,
const char* name)
{
icalparameter_kind kind;
icalparameter *param;
char* str;
char* pv;
icalerror_check_arg_rz( (prop!=0),"prop");
icalerror_check_arg_rz( (name!=0),"name");
kind = icalparameter_string_to_kind(name);
if(kind == ICAL_NO_PROPERTY){
/* icalenum_string_to_parameter_kind will set icalerrno */
return 0;
}
param = icalproperty_get_first_parameter(prop,kind);
if (param == 0){
return 0;
}
str = icalparameter_as_ical_string(param);
pv = strchr(str,'=');
if(pv == 0){
icalerror_set_errno(ICAL_INTERNAL_ERROR);
return 0;
}
return pv+1;
}
void
icalproperty_remove_parameter (icalproperty* prop, icalparameter_kind kind)
{
pvl_elem p;
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
icalerror_check_arg_rv((prop!=0),"prop");
for(p=pvl_head(impl->parameters);p != 0; p = pvl_next(p)){
icalparameter* param = (icalparameter *)pvl_data (p);
if (icalparameter_isa(param) == kind) {
pvl_remove (impl->parameters, p);
icalparameter_free (param);
break;
}
}
}
int
icalproperty_count_parameters (icalproperty* prop)
{
struct icalproperty_impl *p = (struct icalproperty_impl*)prop;
if(prop != 0){
return pvl_count(p->parameters);
}
icalerror_set_errno(ICAL_USAGE_ERROR);
return -1;
}
icalparameter*
icalproperty_get_first_parameter (icalproperty* prop, icalparameter_kind kind)
{
struct icalproperty_impl *p = (struct icalproperty_impl*)prop;
icalerror_check_arg_rz( (prop!=0),"prop");
p->parameter_iterator = pvl_head(p->parameters);
if (p->parameter_iterator == 0) {
return 0;
}
for( p->parameter_iterator = pvl_head(p->parameters);
p->parameter_iterator !=0;
p->parameter_iterator = pvl_next(p->parameter_iterator)){
icalparameter *param = (icalparameter*)pvl_data(p->parameter_iterator);
if(icalparameter_isa(param) == kind || kind == ICAL_ANY_PARAMETER){
return param;
}
}
return 0;
}
icalparameter*
icalproperty_get_next_parameter (icalproperty* prop, icalparameter_kind kind)
{
struct icalproperty_impl *p = (struct icalproperty_impl*)prop;
icalerror_check_arg_rz( (prop!=0),"prop");
if (p->parameter_iterator == 0) {
return 0;
}
for( p->parameter_iterator = pvl_next(p->parameter_iterator);
p->parameter_iterator !=0;
p->parameter_iterator = pvl_next(p->parameter_iterator)){
icalparameter *param = (icalparameter*)pvl_data(p->parameter_iterator);
if(icalparameter_isa(param) == kind || kind == ICAL_ANY_PARAMETER){
return param;
}
}
return 0;
}
void
icalproperty_set_value (icalproperty* prop, icalvalue* value)
{
struct icalproperty_impl *p = (struct icalproperty_impl*)prop;
icalerror_check_arg_rv((prop !=0),"prop");
icalerror_check_arg_rv((value !=0),"value");
if (p->value != 0){
icalvalue_set_parent(p->value,0);
icalvalue_free(p->value);
p->value = 0;
}
p->value = value;
icalvalue_set_parent(value,prop);
}
void icalproperty_set_value_from_string(icalproperty* prop,const char* str,
const char* type)
{
icalvalue *oval,*nval;
icalvalue_kind kind = ICAL_NO_VALUE;
icalerror_check_arg_rv( (prop!=0),"prop");
icalerror_check_arg_rv( (str!=0),"str");
icalerror_check_arg_rv( (type!=0),"type");
if(strcmp(type,"NO")==0){
/* Get the type from the value the property already has, if it exists */
oval = icalproperty_get_value(prop);
if(oval != 0){
/* Use the existing value kind */
kind = icalvalue_isa(oval);
} else {
/* Use the default kind for the property */
kind = icalproperty_kind_to_value_kind(icalproperty_isa(prop));
}
} else {
/* Use the given kind string */
kind = icalvalue_string_to_kind(type);
}
if(kind == ICAL_NO_VALUE){
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return;
}
nval = icalvalue_new_from_string(kind, str);
if(nval == 0){
/* icalvalue_new_from_string sets errno */
assert(icalerrno != ICAL_NO_ERROR);
return;
}
icalproperty_set_value(prop,nval);
}
icalvalue*
icalproperty_get_value (icalproperty* prop)
{
struct icalproperty_impl *p = (struct icalproperty_impl*)prop;
icalerror_check_arg_rz( (prop!=0),"prop");
return p->value;
}
const char* icalproperty_get_value_as_string(icalproperty* prop)
{
icalvalue *value;
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
icalerror_check_arg_rz( (prop!=0),"prop");
value = impl->value;
return icalvalue_as_ical_string(value);
}
void icalproperty_set_x_name(icalproperty* prop, char* name)
{
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
icalerror_check_arg_rv( (name!=0),"name");
icalerror_check_arg_rv( (prop!=0),"prop");
if (impl->x_name != 0) {
free(impl->x_name);
}
impl->x_name = icalmemory_strdup(name);
if(impl->x_name == 0){
icalerror_set_errno(ICAL_NEWFAILED_ERROR);
}
}
char* icalproperty_get_x_name(icalproperty* prop){
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
icalerror_check_arg_rz( (prop!=0),"prop");
return impl->x_name;
}
/* From Jonathan Yue <jonathan.yue@cp.net> */
char* icalproperty_get_name (icalproperty* prop)
{
const char* property_name = 0;
size_t buf_size = 256;
char* buf = icalmemory_new_buffer(buf_size);
char* buf_ptr = buf;
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;
icalerror_check_arg_rz( (prop!=0),"prop");
if (impl->kind == ICAL_X_PROPERTY && impl->x_name != 0){
property_name = impl->x_name;
} else {
property_name = icalproperty_kind_to_string(impl->kind);
}
if (property_name == 0 ) {
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
return 0;
} else {
/* _append_string will automatically grow the buffer if
property_name is longer than the initial buffer size */
icalmemory_append_string(&buf, &buf_ptr, &buf_size, property_name);
}
/* Add the buffer to the temporary buffer ring -- the caller will
not have to free the memory. */
icalmemory_add_tmp_buffer(buf);
return buf;
}
void icalproperty_set_parent(icalproperty* property,
icalcomponent* component)
{
struct icalproperty_impl *impl = (struct icalproperty_impl*)property;
icalerror_check_arg_rv( (property!=0),"property");
impl->parent = component;
}
icalcomponent* icalproperty_get_parent(icalproperty* property)
{
struct icalproperty_impl *impl = (struct icalproperty_impl*)property;
icalerror_check_arg_rz( (property!=0),"property");
return impl->parent;
}
/* Everything below this line is machine generated. Do not edit. */

View File

@ -0,0 +1,116 @@
/* -*- Mode: C -*- */
/*======================================================================
FILE: icalproperty.h
CREATOR: eric 20 March 1999
$Id: icalproperty.h,v 1.1 2001/11/15 19:27:08 mikep%oeone.com Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
This program is free software; you can redistribute it and/or modify
it under the terms of either:
The LGPL as published by the Free Software Foundation, version
2.1, available at: http://www.fsf.org/copyleft/lesser.html
Or:
The Mozilla Public License Version 1.0. You may obtain a copy of
the License at http://www.mozilla.org/MPL/
The original code is icalparam.h
======================================================================*/
#ifndef ICALPROPERTY_H
#define ICALPROPERTY_H
#include <time.h>
#include "icalderivedparameter.h"
#include "icalvalue.h"
#include "icalrecur.h"
/* Actually in icalderivedproperty.h:
typedef void icalproperty; */
#include "icalderivedproperty.h" /* To get icalproperty_kind enumerations */
icalproperty* icalproperty_new(icalproperty_kind kind);
icalproperty* icalproperty_new_clone(icalproperty * prop);
icalproperty* icalproperty_new_from_string(char* str);
char* icalproperty_as_ical_string(icalproperty* prop);
void icalproperty_free(icalproperty* prop);
icalproperty_kind icalproperty_isa(icalproperty* property);
int icalproperty_isa_property(void* property);
void icalproperty_add_parameter(icalproperty* prop,icalparameter* parameter);
void icalproperty_set_parameter(icalproperty* prop,icalparameter* parameter);
void icalproperty_set_parameter_from_string(icalproperty* prop,
const char* name, const char* value);
const char* icalproperty_get_parameter_as_string(icalproperty* prop,
const char* name);
void icalproperty_remove_parameter(icalproperty* prop,
icalparameter_kind kind);
int icalproperty_count_parameters(icalproperty* prop);
/* Iterate through the parameters */
icalparameter* icalproperty_get_first_parameter(icalproperty* prop,
icalparameter_kind kind);
icalparameter* icalproperty_get_next_parameter(icalproperty* prop,
icalparameter_kind kind);
/* Access the value of the property */
void icalproperty_set_value(icalproperty* prop, icalvalue* value);
void icalproperty_set_value_from_string(icalproperty* prop,const char* value, const char* kind);
icalvalue* icalproperty_get_value(icalproperty* prop);
const char* icalproperty_get_value_as_string(icalproperty* prop);
/* Deal with X properties */
void icalproperty_set_x_name(icalproperty* prop, char* name);
char* icalproperty_get_x_name(icalproperty* prop);
/* Return the name of the property -- the type name converted to a
string, or the value of _get_x_name if the type is and X property */
char* icalproperty_get_name (icalproperty* prop);
icalvalue_kind icalparameter_value_to_value_kind(icalparameter_value value);
/* Convert kinds to string and get default value type */
icalvalue_kind icalproperty_kind_to_value_kind(icalproperty_kind kind);
icalvalue_kind icalproperty_value_kind_to_kind(icalvalue_kind kind);
const char* icalproperty_kind_to_string(icalproperty_kind kind);
icalproperty_kind icalproperty_string_to_kind(const char* string);
icalproperty_method icalproperty_string_to_method(const char* str);
const char* icalproperty_method_to_string(icalproperty_method method);
const char* icalproperty_enum_to_string(int e);
int icalproperty_string_to_enum(const char* str);
const char* icalproperty_status_to_string(icalproperty_status);
icalproperty_status icalproperty_string_to_status(const char* string);
int icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e);
#endif /*ICALPROPERTY_H*/

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

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

Some files were not shown because too many files have changed in this diff Show More