7¤0ìo^‚?¨¢u0333333333ÅÝˆ”Â¶È¥/ØNïcXûŽÿÂ”ðìõñÑ#FCUUûÿw³]dÍDÕã   �‹dâp@�ö` ‹ŽŠŸ—�ŽÍÄÁX,
‚†Q1Ã@�1
I(Õ  9=Ë)d                    ===========================================*/
#ifndef ICALSET_H
#define ICALSET_H
#include "libical_icalss_export.h"
typedef struct icalset_impl icalset;
typedef enum icalset_kind
{
    ICAL_FILE_SET,
    ICAL_DIR_SET,
    ICAL_BDB_SET
} icalset_kind;
typedef struct icalsetiter
{
    icalcompiter iter;  /* icalcomponent_kind, pvl_elem iter */
    icalgauge *gauge;
    icalrecur_iterator *ritr;   /*the last iterator */
    icalcomponent *last_component;      /*the pending recurring component to be processed  */
    const char *tzid;   /* the calendar's timezone id */
} icalsetiter;
struct icalset_impl
{
    icalset_kind kind;
    size_t size;
    char *dsn;
    icalset *(*init) (icalset *set, const char *dsn, void *options);
    void (*free) (icalset *set);
    const char *(*path) (icalset *set);
    void (*mark) (icalset *set);
    icalerrorenum(*commit) (icalset *set);
    icalerrorenum(*add_component) (icalset *set, icalcomponent *comp);
    icalerrorenum(*remove_component) (icalset *set, icalcomponent *comp);
    int (*count_components) (icalT icalproperty *icalproperty_vanew_xlicmimefilename(const char * v, ...);

/* X-LIC-MIMEOPTINFO */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_xlicmimeoptinfo(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_xlicmimeoptinfo(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_xlicmimeoptinfo(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_xlicmimeoptinfo(const char * v, ...);

#endif /*ICALPROPERTY_H*/
#ifndef LIBICAL_ICALSS_H
#define LIBICAL_ICALSS_H
#ifndef S_SPLINT_S
#ifdef __cplusplus
extern "C" {
#endif
/*======================================================================
 FILE: icalgauge.h
 CREATOR: eric 23 December 1999
 (C) COPYRIGHT 2000, Eric Busboom <eric@civicknowledge.com>
 This library 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: https://www.gnu.org/licenses/lgpl-2.1.html
 Or:
    perty_vanew_storesexpanded(const char * v, ...);

/* SUMMARY */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_summary(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_summary(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_summary(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_summary(const char * v, ...);

/* TARGET */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_target(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_target(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_target(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_target(const char * v, ...);

/* TASK-MODE */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_taskmode(enum icalproperty_taskmode v);
LIBICAL_ICAL_EXPORT void icalproperty_set_taskmode(icalproperty *prop, enum icalproperty_taskmode v);
LIBICAL_ICAL_EXPORT enum icalproperty_taskmode icalproperty_get_taskmode(constpatchorder(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_patchorder(int v, ...);

/* PATCH-PARAMETER */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_patchparameter(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_patchparameter(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_patchparameter(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_patchparameter(const char * v, ...);

/* PATCH-TARGET */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_patchtarget(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_patchtarget(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_patchtarget(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_patchtarget(const char * v, ...);

/* PATCH-VERSION */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_patchversion(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_patchversion(icaAL_EXPORT icalproperty *icalproperty_vanew_defaulttzid(const char * v, ...);

/* DEFAULT-VCARS */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_defaultvcars(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_defaultvcars(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_defaultvcars(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_defaultvcars(const char * v, ...);

/* DENY */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_deny(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_deny(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_deny(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_deny(const char * v, ...);

/* DESCRIPTION */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_description(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_description(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_descERTY = 44,
    ICAL_MAXDATE_PROPERTY = 45,
    ICAL_MAXRESULTS_PROPERTY = 46,
    ICAL_MAXRESULTSSIZE_PROPERTY = 47,
    ICAL_METHOD_PROPERTY = 48,
    ICAL_MINDATE_PROPERTY = 49,
    ICAL_MULTIPART_PROPERTY = 50,
    ICAL_NAME_PROPERTY = 115,
    ICAL_ORGANIZER_PROPERTY = 52,
    ICAL_OWNER_PROPERTY = 53,
    ICAL_PATCHDELETE_PROPERTY = 124,
    ICAL_PATCHORDER_PROPERTY = 122,
    ICAL_PATCHPARAMETER_PROPERTY = 125,
    ICAL_PATCHTARGET_PROPERTY = 123,
    ICAL_PATCHVERSION_PROPERTY = 121,
    ICAL_PERCENTCOMPLETE_PROPERTY = 54,
    ICAL_PERMISSION_PROPERTY = 55,
    ICAL_POLLCOMPLETION_PROPERTY = 110,
    ICAL_POLLITEMID_PROPERTY = 103,
    ICAL_POLLMODE_PROPERTY = 104,
    ICAL_POLLPROPERTIES_PROPERTY = 105,
    ICAL_POLLWINNER_PROPERTY = 106,
    ICAL_PRIORITY_PROPERTY = 56,
    ICAL_PRODID_PROPERTY = 57,
    ICAL_QUERY_PROPERTY = 58,
    ICAL_QUERYLEVEL_PROPERTY = 59,
    ICAL_QUERYID_PROPERTY = 60,
    ICAL_QUERYNAME_PROPERTY = 61,
    ICAL_RDATE_PROPERTY = 62,
    ICAL_RECURACCEPTED_PROPERTY = 63,
     to start looking.
 *
 *  Given a spanlist and a time, finds the next period of time
 *  that is free.
 */
LIBICAL_ICALSS_EXPORT struct icalperiodtype icalspanlist_next_free_time(icalspanlist *sl,
                                                                        struct icaltimetype t);

/** @brief (Debug) print out spanlist to STDOUT.
 *  @param sl A valid icalspanlist.
 */
LIBICAL_ICALSS_EXPORT void icalspanlist_dump(icalspanlist *sl);

/** @brief Returns a VFREEBUSY component for a spanlist.
 *
 *   @param sl         A valid icalspanlist, from icalspanlist_new()
 *   @param organizer  The organizer specified as "MAILTO:user@domain"
 *   @param attendee   The attendee specified as "MAILTO:user@domain"
 *
 *   @return            A valid icalcomponent or NULL.
 *
 * This function returns a VFREEBUSY component for the given spanlist.
 * The start time is mapped to DTSTART, the end time to DTEND.
 * Each busy span is represented as a separate FREEBUSY entry.
 * An attendee parameter is required, and organi/MPL/
 */

#ifndef ICPTRHOLDER_CXX_H
#define ICPTRHOLDER_CXX_H

#include <cassert>

template < class T > class ICPointerHolder
{
public:
    ICPointerHolder()
        : ptr(0)
    {
    }

    ICPointerHolder(T *p)
        : ptr(p)
    {
    }

    // copy constructor to support assignment
    ICPointerHolder(const ICPointerHolder &ip)
        : ptr(ip.ptr)
    {
        // We need to transfer ownership of ptr to this object by setting
        // ip's ptr to null. Otherwise, ptr will de deleted twice.
        // const ugliness requires us to do the const_cast.
        ICPointerHolder *ipp = const_cast < ICPointerHolder * >(&ip);

        ipp->ptr = 0;
    };

    ~ICPointerHolder()
    {
        release();
    }

    ICPointerHolder &operator=(T *p)
    {
        this->release();
        ptr = p;
        return *this;
    }

    ICPointerHolder &operator=(ICPointerHolder &p)
    {
        this->release();
        ptr = p.ptr;    // this transfer ownership of the pointer
        p.ptr = 0;      // set it to nunal
Business Machines Corporation and Siemens Rolm Communications Inc.

For purposes of this license notice, the term Licensors shall mean,
collectively, Apple Computer, Inc., AT&T Corp., International
Business Machines Corporation and Siemens Rolm Communications Inc.
The term Licensor shall mean any of the Licensors.

Subject to acceptance of the following conditions, permission is hereby
granted by Licensors without the need for written agreement and without
license or royalty fees, to use, copy, modify and distribute this
software for any purpose.

The above copyright notice and the following four paragraphs must be
reproduced in all copies of this software and any software including
this software.

THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND NO LICENSOR SHALL HAVE
ANY OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS OR
MODIFICATIONS.

IN NO EVENT SHALL ANY LICENSOR BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT
OF THE USE OFp The time period to check
 * @return 1 if @a p is a valid period, 0 otherwise
 *
 * @par Usage
 * ```c
 * // creates null period
 * struct icalperiodtype period = icalperiodtype_null_period();
 *
 * // a null period isn't a valid period
 * assert(icalperiodtype_is_valid_period(period) == 0);
 * ```
 */
LIBICAL_ICAL_EXPORT int icalperiodtype_is_valid_period(struct icalperiodtype p);

#endif /* !ICALTIME_H */
#ifndef LIBICAL_ICALSS_EXPORT_H
#define LIBICAL_ICALSS_EXPORT_H

#if !defined(S_SPLINT_S)

#ifdef LIBICAL_ICALSS_STATIC_DEFINE
#define LIBICAL_ICALSS_EXPORT
#define LIBICAL_ICALSS_NO_EXPORT
#else
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
#if defined(libical_icalss_EXPORTS)
       /* We are building this library */
#define LIBICAL_ICALSS_EXPORT __declspec(dllexport)
#else
       /* We are using this library */
#define LIBICAL_ICALSS_EXPORT __declspec(dllimport)
#endif
#define LIBICAL_ICALSS_NO_EXPORT
#else
#define LIBICAL_ICALSS_EXPORT __attribute__((visibility("default")))
#defi   void *data),
                                                    void *callback_data);

/** @brief Returns the icaltimezone in the component corresponding to the
 *  TZID, or NULL if it can't be found.
 */
LIBICAL_ICAL_EXPORT icaltimezone *icalcomponent_get_timezone(icalcomponent *comp,
                                                             const char *tzid);

/**
 * @brief Decides if a recurrence is acceptable.
 *
 * @param comp       A valid icalcomponent.
 * @param dtstart    The base dtstart value for this component.
 * @param recurtime  The time to test against.
 *
 * @return true if the recurrence value is excluded, false otherwise.
 *
 * This function decides if a specific recurrence value is
 * excluded by EXRULE or EXDATE properties.
 *
 * It's not the most efficient code.  You might get better performance
 * if you assume that recurtime is always increasing for each
 * call. Then you could:
 *
 *   - sort the EXDATE values
 *   - save the state of each EXRULE iterator for the next call.
 *
TIME with a timezone parameter and a
 *      corresponding VTIMEZONE is present in the component, the
 *      returned component will already be in the correct timezone;
 *      otherwise the caller is responsible for converting it.
 *
 *      For the icalcomponent routines only, dtend and duration are tied
 *      together. If you call the get routine for one and the other
 *      exists, the routine will calculate the return value. That is, if
 *      there is a DTEND and you call get_duration, the routine will
 *      return the difference between DTEND and DTSTART.
 *
 *      When DURATION and DTEND are both missing, for VEVENT an implicit
 *      DTEND is calculated based of DTSTART; for AVAILABLE, VAVAILABILITY,
 *      and VFREEBUSY null-time is returned.
 *
 *      Returns null-time, unless called on AVAILABLE, VEVENT,
 *      VAVAILABILITY, or VFREEBUSY components.
 *
 *      FIXME this is useless until we can flag the failure
 */
LIBICAL_ICAL_EXPORT struct icaltimetype icalcomponent_get_dtend(icalcoarly invalid, but is not null.
 *
 *      This is usually the result of creating a new time type but not
 *      clearing it, or setting one of the flags to an illegal value.
 */
LIBICAL_ICAL_EXPORT int icaltime_is_valid_time(const struct icaltimetype t);

/**     @brief Returns true if time is a DATE.
 *
 * The options are DATE type, which returns true, or DATE-TIME, which
 * returns false.
 */
LIBICAL_ICAL_EXPORT int icaltime_is_date(const struct icaltimetype t);

/**     @brief Returns true if the time is relative to UTC zone.
 *
 *      @todo  We should only check the zone.
 */
LIBICAL_ICAL_EXPORT int icaltime_is_utc(const struct icaltimetype t);

/**
 *      @brief Returns -1, 0, or 1 to indicate that a is less than b, a
 *      equals b, or a is greater than b.
 *
 *      This converts both times to the UTC timezone and compares them.
 */
LIBICAL_ICAL_EXPORT int icaltime_compare(const struct icaltimetype a, const struct icaltimetype b);

/** @brief Like icaltime_compare, but only use the date parts.
 *
ing.
 *
 * @todo If the given string specifies a DATE-TIME not in UTC, there
 *       is no way to know if this is a floating time or really refers to a
 *       timezone. We should probably add a new constructor:
 *       icaltime_from_string_with_zone()
 */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_string(const char *str);

/**     @brief Constructor.
 *
 *      Creates a new time, given a day of year and a year.
 *
 *      Note that Jan 1 is day #1, not 0.
 */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_day_of_year(const int doy, const int year);

/**
 * Returns the time as seconds past the UNIX epoch.
 *
 * This function probably won't do what you expect.  In particular, you should
 * only pass an icaltime in UTC, since no conversion is done.  Even in that case,
 * it's probably better to just use icaltime_as_timet_with_zone().
 *
 * The return value is defined for dates ranging from 1902-01-01 (incl.) up to 10000-01-01 (excl.)
 * if time_t has a size of 64 bit and up to 2038-01-18 (Example
 * ```c
 * assert(icalrestriction_compare(ICALRESTRICTION_ONEPLUS, 5) == true);
 * assert(icalrestriction_compare(ICALRESTRICTION_NONE,    3) == false);
 * ```
 */
LIBICAL_ICAL_EXPORT int icalrestriction_compare(icalrestriction_kind restr, int count);

/**
 * @brief Checks if a given `VCALENDAR` meets all the restrictions imposed by
 *  the standard.
 * @param comp The `VCALENDAR` component to check
 * @return 1 if the restrictions are met, 0 if not
 *
 * @par Error handling
 * Returns 0 and sets ::icalerrno if `NULL` is passed as @a comp, or if the
 * component is not a `VCALENDAR`.
 *
 * @par Example
 * ```c
 * icalcomponent *component = // ...
 *
 * // check component
 * assert(icalrestriction_check(component) == true);
 * ```
 */
LIBICAL_ICAL_EXPORT int icalrestriction_check(icalcomponent *comp);

#endif /* !ICALRESTRICTION_H */
/**
 * @file    icalparameter_cxx.h
 * @author  fnguyen (12/10/01)
 * @brief   Definition of C++ Wrapper for icalparameter.c
 *
 * (C) COPYRIGHT 2001, Critical Path

 Thisvoid icalparameter_set_cutype(icalparameter *value, icalparameter_cutype v);

/* DELEGATED-FROM */
LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_delegatedfrom(const char * v);
LIBICAL_ICAL_EXPORT const char * icalparameter_get_delegatedfrom(const icalparameter *value);
LIBICAL_ICAL_EXPORT void icalparameter_set_delegatedfrom(icalparameter *value, const char * v);

/* DELEGATED-TO */
LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_delegatedto(const char * v);
LIBICAL_ICAL_EXPORT const char * icalparameter_get_delegatedto(const icalparameter *value);
LIBICAL_ICAL_EXPORT void icalparameter_set_delegatedto(icalparameter *value, const char * v);

/* DIR */
LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_dir(const char * v);
LIBICAL_ICAL_EXPORT const char * icalparameter_get_dir(const icalparameter *value);
LIBICAL_ICAL_EXPORT void icalparameter_set_dir(icalparameter *value, const char * v);

/* DISPLAY */
LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_display(icalparameter_display v);
LIFBTYPE_FREE = 20401,
    ICAL_FBTYPE_BUSY = 20402,
    ICAL_FBTYPE_BUSYUNAVAILABLE = 20403,
    ICAL_FBTYPE_BUSYTENTATIVE = 20404,
    ICAL_FBTYPE_NONE = 20499
} icalparameter_fbtype;

typedef enum icalparameter_feature {
    ICAL_FEATURE_X = 22100,
    ICAL_FEATURE_AUDIO = 22101,
    ICAL_FEATURE_CHAT = 22102,
    ICAL_FEATURE_FEED = 22103,
    ICAL_FEATURE_MODERATOR = 22104,
    ICAL_FEATURE_PHONE = 22105,
    ICAL_FEATURE_SCREEN = 22106,
    ICAL_FEATURE_VIDEO = 22107,
    ICAL_FEATURE_NONE = 22199
} icalparameter_feature;

typedef enum icalparameter_local {
    ICAL_LOCAL_X = 20500,
    ICAL_LOCAL_TRUE = 20501,
    ICAL_LOCAL_FALSE = 20502,
    ICAL_LOCAL_NONE = 20599
} icalparameter_local;

typedef enum icalparameter_partstat {
    ICAL_PARTSTAT_X = 20600,
    ICAL_PARTSTAT_NEEDSACTION = 20601,
    ICAL_PARTSTAT_ACCEPTED = 20602,
    ICAL_PARTSTAT_DECLINED = 20603,
    ICAL_PARTSTAT_TENTATIVE = 20604,
    ICAL_PARTSTAT_DELEGATED = 20605,
    ICAL_PARTSTAT_COMPLETED = 20606,
    ICAL_PARTSTAT_INPROCESS = one_set_component(icaltimezone *zone, icalcomponent *comp);

/** @brief Returns the timezone name to display to the user.
 *
 * We prefer to use the Olson city name, but fall back on the TZNAME, or finally
 * the TZID. We don't want to use "" as it may be wrongly interpreted as a
 * floating time. Do not free the returned string.
 */
LIBICAL_ICAL_EXPORT const char *icaltimezone_get_display_name(icaltimezone *zone);

/*
 * Converting times between timezones.
 */

LIBICAL_ICAL_EXPORT void icaltimezone_convert_time(struct icaltimetype *tt,
                                                   icaltimezone *from_zone,
                                                   icaltimezone *to_zone);

/*
 * Getting offsets from UTC.
 */

/** @brief Calculates the UTC offset of a given local time in the given
 * timezone.
 *
 * It is the number of seconds to add to UTC to get local
 * time.  The is_daylight flag is set to 1 if the time is in
 * daylight-savings time.
 */
LIBICAL_ICAL_EXPORT int icaltimezone_get_utc_offset(ica

/** @file icalenums.h */

/***********************************************************************
 * Component enumerations
**********************************************************************/

typedef enum icalcomponent_kind
{
    ICAL_NO_COMPONENT,
    ICAL_ANY_COMPONENT, /* Used to select all components */
    ICAL_XROOT_COMPONENT,
    ICAL_XATTACH_COMPONENT, /* MIME attached data, returned by parser. */
    ICAL_VEVENT_COMPONENT,
    ICAL_VTODO_COMPONENT,
    ICAL_VJOURNAL_COMPONENT,
    ICAL_VCALENDAR_COMPONENT,
    ICAL_VAGENDA_COMPONENT,
    ICAL_VFREEBUSY_COMPONENT,
    ICAL_VALARM_COMPONENT,
    ICAL_XAUDIOALARM_COMPONENT,
    ICAL_XDISPLAYALARM_COMPONENT,
    ICAL_XEMAILALARM_COMPONENT,
    ICAL_XPROCEDUREALARM_COMPONENT,
    ICAL_VTIMEZONE_COMPONENT,
    ICAL_XSTANDARD_COMPONENT,
    ICAL_XDAYLIGHT_COMPONENT,
    ICAL_X_COMPONENT,
    ICAL_VSCHEDULE_COMPONENT,
    ICAL_VQUERY_COMPONENT,
    ICAL_VREPLY_COMPONENT,
    ICAL_VCAR_COMPONENT,
    ICAL_VCOMMAND_COMPONENT,
    ICAL_XLICINVALID_COMPODARG_ERROR if @a buf, `*buf`, @a pos, `* pos`,
 * or @a buf_size `NULL`.
 *
 * This method will copy the character @a ch and a `'\0'` character after it to
 * the buffer @a buf starting at position @a pos, reallocing @a buf if it is too
 * small. @a buf_size is the size of @a buf and will be changed if @a buf is
 * reallocated. @a pos will point to the new terminating `'\0'` character @a
 * buf.
 *
 * @par Example
 * ```c
 * // creates a new buffer
 * int buffer_len = 15;
 * char *buffer = icalmemory_new_buffer(buffer_len);
 * strcpy(buffer, "My number is: ");
 *
 * // append a char to the buffer
 * int buffer_end = strlen(buffer);
 * char *buffer_end_pos = buffer[buffer_str_end];
 * icalmemory_append_char(&buffer, &buffer_end_pos, &buffer_len, '7');
 *
 * // print string
 * printf("%s\n", buffer);
 *
 * // release memory
 * icalmemory_free_buffer(buffer);
 * ```
 */
LIBICAL_ICAL_EXPORT void icalmemory_append_char(char **buf, char **pos, size_t *buf_size, char ch);

/**
 * @brief Creates a duplicate of a striuffer, 20);
 *
 * // fill with more data
 * strcpy(buffer, "a lot more data");
 *
 * // release
 * icalmemory_free_buffer(buffer);
 * ```
 */
LIBICAL_ICAL_EXPORT void *icalmemory_resize_buffer(void *buf, size_t size);

/**
 * @brief Releases a buffer
 * @param buf The buffer to release
 * @sa icalmemory_new_buffer()
 *
 * Releases the memory of the buffer.
 */
LIBICAL_ICAL_EXPORT void icalmemory_free_buffer(void *buf);

/* 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. */

/**
 * @brief Appends a string to a buffer.
 * @param buf The buffer to append the string to.
 * @param pos The position to append the string at.
 * @param buf_size The size of the buffer (will be changed if buffer is
 * reallocated)
 * @param string The

    /**
     * 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
    VComponent *get_current_component();
    VComponent *get_first_component(const icalcomponent_kind &kind);
    VComponent *get_next_component(const icalcomponent_kind &kind);

    /// Using external iterators
    icalcompiter begin_component(const icalcomponent_kind &kind);
    icalcompiter end_component(const icalcomponent_kind &kind);
    VComponent *next(icalcompiter *i);
    VComponent *prev(icalcompiter *i);
    VComponent *current(icalcompiter *i);

    /// Working with embedded error properties
    int count_errors();

    /// Remove all X-LIC-ERROR properties
    void strip_errors();

    /// Convert some X-LIC-ERROR properties into RETURN-STATUS properties
    void converrant() const;

    /* LAST-MODIFIED */
    void set_lastmodified(const struct icaltimetype &val);
    struct icaltimetype get_lastmodified() const;

    /* LOCATION */
    void set_location(const std::string &val);
    std::string get_location() const;

    /* MAXRESULTS */
    void set_maxresults(const int &val);
    int get_maxresults() const;

    /* MAXRESULTSSIZE */
    void set_maxresultsize(const int &val);
    int get_maxresultsize() const;

    /* METHOD */
    void set_method(const enum icalproperty_method &val);
    enum icalproperty_method get_method() const;

    /* OWNER */
    void set_owner(const std::string &val);
    std::string get_owner() const;

    /* ORGANIZER */
    void set_organizer(const std::string &val);
    std::string get_organizer() const;

    /* PERCENT-COMPLETE */
    void set_percentcomplete(const int &val);
    int get_percentcomplete() const;

    /* PRIORITY */
    void set_priority(const int &val);
    int get_priority() const;

    /* PRODID */
    void set_prodid(consozilla.org/MPL/
======================================================================*/

/**
 * @file icalattach.h
 * @brief A set of functions to handle iCal attachments.
 *
 * With the `ATTACH` property, the iCal standard defines a way to
 * associate a document object with a calendar component.
 *
 * These are represented with icalattach objects in libical.
 * This file contains functions to create and work with these
 * objects.
 */

#ifndef ICALATTACH_H
#define ICALATTACH_H

#include "libical_ical_export.h"

/**
 * @typedef icalattach
 * @brief An iCal attach object representing a link to a document object.
 *
 * Represents an association with a document object. icalattach objects
 * are reference counted, meaning that if the last reference to them is
 * removed (with icalattach_unref()), they are destroyed.
 */
typedef struct icalattach_impl icalattach;

/**
 * @typedef icalattach_free_fn_t
 * @brief Function to be called to free the data of an ::icalattach object.
 * @warning Currently not used
 *
 * al.
 *
 * Can be checked with libical_get_errors_are_fatal().
 */

#if !defined(ICAL_ERRORS_ARE_FATAL)
#define ICAL_ERRORS_ARE_FATAL 0
#endif

#if ICAL_ERRORS_ARE_FATAL == 1
#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 */
/**
 * @def icalerror_assert(test, message)
 * @brief Assert with a message
 * @param test The assertion to test
 * @param message The message to print on failure of assertion
 *
 * Tests the given assertion @a test, and if it fails, prints the
 * @a message given on @a stderr as a warning and aborts the process.
 * This only works if ::ICAL_ERRORS_ARE_FATAL is true, otherwise
 * does nothing.
 */
#if ICAL_ERRORS_ARE_FATAL == 1

#ifdef __GNUC__
#define icalerror_assert(test,message) \
if (!(test)) { \
    fprintf(stderr, "%s(), %s:%d: %s\n", __FUNCTION__, __FILE__, __LINE__, message); \
  tart);

/**
 * Sets the date-time at which the iterator will start,
 * where @p start is a value between DTSTART and UNTIL.
 *
 * NOTE: CAN NOT be used with RRULEs that contain COUNT.
 * @since 3.0
 */
LIBICAL_ICAL_EXPORT int icalrecur_iterator_set_start(icalrecur_iterator *impl,
                                                     struct icaltimetype start);

/** Gets the next occurrence from an iterator. */
LIBICAL_ICAL_EXPORT struct icaltimetype icalrecur_iterator_next(icalrecur_iterator *);

/** Frees the iterator. */
LIBICAL_ICAL_EXPORT void icalrecur_iterator_free(icalrecur_iterator *);

/** @brief Fills an array with the 'count' number of occurrences generated by
 * the rrule.
 *
 * Specifically, this fills @p array up with at most 'count' time_t values, each
 * representing an occurrence time in seconds past the POSIX epoch.
 *
 * Note that the times are returned in UTC, but the times
 * are calculated in local time. You will have to convert the results
 * back into local time before using them.
 */
Lief Decrements reference count of the icalattach.
 * @param attach The object to decrease the reference count of
 * @sa icalattach_ref()
 *
 * Decreases the reference count of @a attach. If this was the
 * last user of the object, it is freed.
 *
 * @par Error handling
 * If @a attach is `NULL`, or the reference count is smaller than 0,
 * it sets ::icalerrno to ::ICAL_BADARG_ERROR.
 *
 * @par Ownership
 * Calling this function releases the icalattach back to the library,
 * and it must not be used afterwards.
 *
 * @par Usage
 * ```c
 * // creates new
 * icalattach *attach = icalattach_new_from_url("http://example.com");
 *
 * // release it
 * icalattach_unref(attach);
 * ```
 */
LIBICAL_ICAL_EXPORT void icalattach_unref(icalattach *attach);

/**
 * @brief Determines if @a attach is an URL.
 * @param attach the icalattach object to check
 * @return 1 if it is a URL, otherwise 0.
 * @sa icalattach_get_url()
 *
 * @par Error handling
 * Returns `NULL/* A Bison parser, made by GNU Bison 2.3.  */

/* Skeleton inE          /* 1 to N */
#define ICAL_BY_DAY_SIZE        7*(ICAL_BY_WEEKNO_SIZE-1)+1   /* 1 to N */

/** 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 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];             /**< @brief Encoded value
        *
        * The 'day' element of the by_day array is encoded to allow
        * represy_get_dtstart(dtstart);
@endcode

Or, just make them up:

@code
        recur = icalrecurrencetype_from_string("FREQ=YEARLY;BYDAY=SU,WE");
        dtstart = icaltime_from_string("19970101T123000")
@endcode

2) Create an iterator

@code
        icalrecur_iterator *ritr;
        ritr = icalrecur_iterator_new(recur,start);
@endcode

3) Iterator over the occurrences

@code
        struct icaltimetype next;
        while (next = icalrecur_iterator_next(ritr)
               && !icaltime_is_null_time(next){
                Do something with next
        }
@endcode

Note that the time returned by icalrecur_iterator_next is in
whatever timezone that dtstart is in.

*/

#ifndef ICALRECUR_H
#define ICALRECUR_H

#include "libical_ical_export.h"


/*
 * Recurrence 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,


struct icaltimezonetype
{
    const char *tzid;
    struct icaltimetype last_mod;
    const char *tzurl;

    /* Array of phases. The end of the array is a phase with tzname == 0 */
    struct icaltimezonephase *phases;
};

/* ical_unknown_token_handling :
 *    How should the ICAL library handle components, properties and parameters with
 *    unknown names?
 *    FIXME:  Currently only affects parameters.  Extend to components and properties.
 */
typedef enum ical_unknown_token_handling
{
    ICAL_ASSUME_IANA_TOKEN = 1,
    ICAL_DISCARD_TOKEN = 2,
    ICAL_TREAT_AS_ERROR = 3
} ical_unknown_token_handling;

LIBICAL_ICAL_EXPORT ical_unknown_token_handling ical_get_unknown_token_handling_setting(void);

LIBICAL_ICAL_EXPORT void ical_set_unknown_token_handling_setting(
    ical_unknown_token_handling newSetting);

#endif /* !ICALTYPES_H */

/*======================================================================
 FILE: icalarray.h
 CREATOR: Damon Chaplin 07 March 2001

 (C) COPYRIGHT 2001, Ximian, Inc.

 ThisChecks if a duration is a bad duration.
 * @param d The duration to check
 * @return 1 if the duration is a bad duration, 0 otherwise
 * @sa icalduration_bad_duration()
 *
 * @par Usage
 * ```
 * // make bad duration
 * struct icaldurationtype duration;
 * duration = icaldurationtype_bad_duration();
 *
 * // check bad duration
 * assert(icaldurationtype_is_bad_duration(duration));
 * ```
 */
LIBICAL_ICAL_EXPORT int icaldurationtype_is_bad_duration(struct icaldurationtype d);

/**
 * @brief Adds a duration to an icaltime object and returns the result.
 * @param t The time object to add the duration to
 * @param d The duration to add to the time object
 * @return The new ::icaltimetype which has been added the duration to
 *
 * @par Example
 * ```c
 * struct icaltimetype time;
 * struct icaldurationtype duration;
 *
 * // create time and duration objects
 * time = icaltime_today();
 * duration = icaldurationtype_from_int(60);
 *
 * // add the duration to the time object
 * time = icaltime_add(time, duration);
 ds);

/**
 *      @brief Normalizes the icaltime, so all of the time components
 *      are in their normal ranges.
 *
 *      For instance, given a time with minutes=70, the minutes will be
 *      reduces to 10, and the hour incremented. This allows the caller
 *      to do arithmetic on times without worrying about overflow or
 *      underflow.
 */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_normalize(const struct icaltimetype tt);

/**     @brief Converts time to a given timezone.
 *
 *      Converts a time from its native timezone to a given timezone.
 *
 *      If @p tt is a date, the timezone is not converted and the returned
 *      time is an exact copy of @p tt.
 *
 *      If it's a floating time, the returned object
 *      represents the same time relative to @p zone.
 *      For example, if @p tt represents 9:30 AM floating and @p zone
 *      is the GMT timezone, the returned object will represent 9:30 AM GMT.
 *
 *      Otherwise, the time will be converted to @p zone, and its timezone
 *caltime_is_null_time(struct icaltimetype t)
 *      - icaltime_is_valid_time(struct icaltimetype t)
 *      - icaltime_is_date(struct icaltimetype t)
 *      - icaltime_is_utc(struct icaltimetype t)
 *
 *      Modify, compare and utility methods include:
 *
 *      - icaltime_compare(struct icaltimetype a,struct icaltimetype b)
 *      - icaltime_compare_date_only(struct icaltimetype a,
 *              struct icaltimetype b)
 *      - icaltime_adjust(struct icaltimetype *tt, int days, int hours,
 *              int minutes, int seconds);
 *      - icaltime_normalize(struct icaltimetype t);
 *      - icaltime_convert_to_zone(const struct icaltimetype tt,
 *              icaltimezone *zone);
 */

#ifndef ICALTIME_H
#define ICALTIME_H

#include "libical_ical_export.h"

#include <time.h>

/* An opaque struct representing a timezone. We declare this here to avoid
   a circular dependency. */
#if !defined(ICALTIMEZONE_DEFINED)
#define ICALTIMEZONE_DEFINED
typedef struct _icaltimezone icaltimezone;
#endif

/** icalt   void set_duration(const struct icaldurationtype &v);

    /* INTEGER */
    int get_integer() const;
    void set_integer(const int &v);

    /* URI */
    std::string get_uri() const;
    void set_uri(const std::string &v);

    /* ATTACH */
    icalattach *get_attach();
    void set_attach(icalattach *v);

    /* CLASS */
    enum icalproperty_class get_class() const;
    void set_class(const enum icalproperty_class &v);

    /* FLOAT */
    float get_float() const;
    void set_float(const float &v);

    /* QUERY */
    std::string get_query() const;
    void set_query(const std::string &v);

    /* STRING */
    std::string get_string() const;
    void set_string(const std::string &v);

    /* TRANSP */
    enum icalproperty_transp get_transp() const;
    void set_transp(const enum icalproperty_transp &v);

    /* DATE-TIME */
    struct icaltimetype get_datetime() const;
    void set_datetime(const struct icaltimetype &v);

    /* GEO */
    struct icalgeotype get_geo() const;
    void set_geo(const PE_TIMEZONE))

/**
 * ICalTimezone:
 *
 * This is the ICalTimezone instance.
 */

/**
 * ICalTimezoneClass:
 *
 * This is the ICalTimezone class.
 */
typedef struct _ICalTimezoneClass ICalTimezoneClass;

struct _ICalTimezone {
    /*< private >*/
    ICalObject parent;
};

struct _ICalTimezoneClass {
    /*< private >*/
    ICalObjectClass parent;
};

LIBICAL_ICAL_EXPORT
GType 		i_cal_timezone_get_type		(void);

LIBICAL_ICAL_EXPORT
ICalTimezone *	i_cal_timezone_new		(void);

LIBICAL_ICAL_EXPORT
ICalTimezone *	i_cal_timezone_copy		(const ICalTimezone *zone);

LIBICAL_ICAL_EXPORT
void		i_cal_timezone_free		(ICalTimezone *zone,
						 gint free_struct);

LIBICAL_ICAL_EXPORT
void		i_cal_timezone_set_tzid_prefix	(const gchar *new_prefix);

LIBICAL_ICAL_EXPORT
void		i_cal_timezone_free_builtin_timezones
						(void);

LIBICAL_ICAL_EXPORT
ICalTimezone *	i_cal_timezone_get_builtin_timezone
						(const gchar *location);

LIBICAL_ICAL_EXPORT
ICalTimezone *	i_cal_timezone_get_builtin_timezone_from_offset
						(gint ofAL_ICAL_EXPORT
void		i_cal_recurrence_set_count	(ICalRecurrence *recur,
						 gint count);

LIBICAL_ICAL_EXPORT
gshort 		i_cal_recurrence_get_interval	(ICalRecurrence *recur);

LIBICAL_ICAL_EXPORT
void		i_cal_recurrence_set_interval	(ICalRecurrence *recur,
						 gshort interval);

LIBICAL_ICAL_EXPORT
ICalRecurrenceWeekday 
		i_cal_recurrence_get_week_start	(ICalRecurrence *recur);

LIBICAL_ICAL_EXPORT
void		i_cal_recurrence_set_week_start	(ICalRecurrence *recur,
						 ICalRecurrenceWeekday week_start);

LIBICAL_ICAL_EXPORT
GArray *	i_cal_recurrence_get_by_second_array
						(ICalRecurrence *recur);

LIBICAL_ICAL_EXPORT
void		i_cal_recurrence_set_by_second_array
						(ICalRecurrence *recur,
						 GArray *values);

LIBICAL_ICAL_EXPORT
gshort 		i_cal_recurrence_get_by_second	(ICalRecurrence *recur,
						 guint index);

LIBICAL_ICAL_EXPORT
void		i_cal_recurrence_set_by_second	(ICalRecurrence *recur,
						 guint index,
						 gshort value);

LIBICAL_ICAL_EXPORT
GArray *	i_cal_recurrence_get_by_minute_array
KDAY,
	I_CAL_WEDNESDAY_WEEKDAY = ICAL_WEDNESDAY_WEEKDAY,
	I_CAL_THURSDAY_WEEKDAY = ICAL_THURSDAY_WEEKDAY,
	I_CAL_FRIDAY_WEEKDAY = ICAL_FRIDAY_WEEKDAY,
	I_CAL_SATURDAY_WEEKDAY = ICAL_SATURDAY_WEEKDAY
} ICalRecurrenceWeekday;

typedef enum {
	I_CAL_SKIP_BACKWARD = ICAL_SKIP_BACKWARD,
	I_CAL_SKIP_FORWARD = ICAL_SKIP_FORWARD,
	I_CAL_SKIP_OMIT = ICAL_SKIP_OMIT,
	I_CAL_SKIP_UNDEFINED = ICAL_SKIP_UNDEFINED
} ICalRecurrenceSkip;

typedef enum {
	I_CAL_RECURRENCE_ARRAY_MAX = ICAL_RECURRENCE_ARRAY_MAX
} ICalRecurrenceArrayMaxValues;

typedef enum {
	I_CAL_BY_SECOND_SIZE = ICAL_BY_SECOND_SIZE,
	I_CAL_BY_MINUTE_SIZE = ICAL_BY_MINUTE_SIZE,
	I_CAL_BY_HOUR_SIZE = ICAL_BY_HOUR_SIZE,
	I_CAL_BY_MONTH_SIZE = ICAL_BY_MONTH_SIZE,
	I_CAL_BY_MONTHDAY_SIZE = ICAL_BY_MONTHDAY_SIZE,
	I_CAL_BY_WEEKNO_SIZE = ICAL_BY_WEEKNO_SIZE,
	I_CAL_BY_YEARDAY_SIZE = ICAL_BY_YEARDAY_SIZE,
	I_CAL_BY_SETPOS_SIZE = ICAL_BY_SETPOS_SIZE,
	I_CAL_BY_DAY_SIZE = ICAL_BY_DAY_SIZE
} ICalRecurrenceArraySizes;


LIBICAL_ICAL_EXPORT
GType 		i_cal_recurrence_get_tydatetimedate	(ICalValue *value);

LIBICAL_ICAL_EXPORT
void		i_cal_value_set_datetimeperiod	(ICalValue *value,
						 ICalDatetimeperiod *v);

LIBICAL_ICAL_EXPORT
ICalValue *	i_cal_value_new_datetimeperiod	(ICalDatetimeperiod *v);

LIBICAL_ICAL_EXPORT
ICalDatetimeperiod *
		i_cal_value_get_datetimeperiod	(ICalValue *value);

LIBICAL_ICAL_EXPORT
void		i_cal_value_set_geo		(ICalValue *value,
						 ICalGeo *v);

LIBICAL_ICAL_EXPORT
ICalValue *	i_cal_value_new_geo		(ICalGeo *v);

LIBICAL_ICAL_EXPORT
ICalGeo *	i_cal_value_get_geo		(ICalValue *value);

LIBICAL_ICAL_EXPORT
void		i_cal_value_set_attach		(ICalValue *value,
						 ICalAttach *v);

LIBICAL_ICAL_EXPORT
ICalValue *	i_cal_value_new_attach		(ICalAttach *v);

LIBICAL_ICAL_EXPORT
ICalAttach *	i_cal_value_get_attach		(ICalValue *value);

LIBICAL_ICAL_EXPORT
void		i_cal_value_reset_kind		(ICalValue *value);

LIBICAL_ICAL_EXPORT
void		i_cal_value_set_xlicclass	(ICalValue *value,
						 ICalPropertyXlicclass v);

LIBICAL_ICAL_EXPORT
ICalValue *	i_cal_value_new_xlDELEGATE = ICAL_XLICCLASS_REPLYDELEGATE,
	I_CAL_XLICCLASS_REPLYCRASHERACCEPT = ICAL_XLICCLASS_REPLYCRASHERACCEPT,
	I_CAL_XLICCLASS_REPLYCRASHERDECLINE = ICAL_XLICCLASS_REPLYCRASHERDECLINE,
	I_CAL_XLICCLASS_ADDINSTANCE = ICAL_XLICCLASS_ADDINSTANCE,
	I_CAL_XLICCLASS_CANCELEVENT = ICAL_XLICCLASS_CANCELEVENT,
	I_CAL_XLICCLASS_CANCELINSTANCE = ICAL_XLICCLASS_CANCELINSTANCE,
	I_CAL_XLICCLASS_CANCELALL = ICAL_XLICCLASS_CANCELALL,
	I_CAL_XLICCLASS_REFRESH = ICAL_XLICCLASS_REFRESH,
	I_CAL_XLICCLASS_COUNTER = ICAL_XLICCLASS_COUNTER,
	I_CAL_XLICCLASS_DECLINECOUNTER = ICAL_XLICCLASS_DECLINECOUNTER,
	I_CAL_XLICCLASS_MALFORMED = ICAL_XLICCLASS_MALFORMED,
	I_CAL_XLICCLASS_OBSOLETE = ICAL_XLICCLASS_OBSOLETE,
	I_CAL_XLICCLASS_MISSEQUENCED = ICAL_XLICCLASS_MISSEQUENCED,
	I_CAL_XLICCLASS_UNKNOWN = ICAL_XLICCLASS_UNKNOWN,
	I_CAL_XLICCLASS_NONE = ICAL_XLICCLASS_NONE
} ICalPropertyXlicclass;


LIBICAL_ICAL_EXPORT
void		i_cal_value_set_x		(ICalValue *value,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
ICalValue *	i_cal_value_new_x	L_INTERNAL_ERROR = ICAL_INTERNAL_ERROR,
	I_CAL_FILE_ERROR = ICAL_FILE_ERROR,
	I_CAL_USAGE_ERROR = ICAL_USAGE_ERROR,
	I_CAL_UNIMPLEMENTED_ERROR = ICAL_UNIMPLEMENTED_ERROR,
	I_CAL_UNKNOWN_ERROR = ICAL_UNKNOWN_ERROR
} ICalErrorEnum;

typedef enum {
	I_CAL_ERROR_FATAL = ICAL_ERROR_FATAL,
	I_CAL_ERROR_NONFATAL = ICAL_ERROR_NONFATAL,
	I_CAL_ERROR_DEFAULT = ICAL_ERROR_DEFAULT,
	I_CAL_ERROR_UNKNOWN = ICAL_ERROR_UNKNOWN
} ICalErrorState;


LIBICAL_ICAL_EXPORT
void		i_cal_error_stop_here		(void);

LIBICAL_ICAL_EXPORT
void		i_cal_error_crash_here		(void);

LIBICAL_ICAL_EXPORT
ICalErrorEnum 	i_cal_errno_return		(void);

LIBICAL_ICAL_EXPORT
void		i_cal_error_clear_errno		(void);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_error_strerror		(ICalErrorEnum e);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_error_perror		(void);

LIBICAL_ICAL_EXPORT
void		i_cal_bt			(void);

LIBICAL_ICAL_EXPORT
void		i_cal_error_set_error_state	(ICalErrorEnum error,
						 ICalErrorState state);

LIBICAL_ICAL_EXPORT
ICalErrorState 	i_cal_error_get_erroalPropertyTaskmode 
		i_cal_property_get_taskmode	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_transp	(ICalPropertyTransp v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_transp	(ICalProperty *prop,
						 ICalPropertyTransp v);

LIBICAL_ICAL_EXPORT
ICalPropertyTransp 
		i_cal_property_get_transp	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_trigger	(ICalTrigger *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_trigger	(ICalProperty *prop,
						 ICalTrigger *v);

LIBICAL_ICAL_EXPORT
ICalTrigger *	i_cal_property_get_trigger	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_tzid		(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_tzid		(ICalProperty *prop,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_property_get_tzid		(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_tzidaliasof	(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_tzidaliasof	(ICalPICAL_EXPORT
const gchar *	i_cal_property_get_relcalid	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_repeat	(gint v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_repeat	(ICalProperty *prop,
						 gint v);

LIBICAL_ICAL_EXPORT
gint 		i_cal_property_get_repeat	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_replyurl	(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_replyurl	(ICalProperty *prop,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_property_get_replyurl	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_requeststatus
						(ICalReqstat *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_requeststatus
						(ICalProperty *prop,
						 ICalReqstat *v);

LIBICAL_ICAL_EXPORT
ICalReqstat *	i_cal_property_get_requeststatus
						(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_resources	(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_resources	(ICast gchar *	i_cal_property_get_capversion	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_carlevel	(ICalPropertyCarlevel v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_carlevel	(ICalProperty *prop,
						 ICalPropertyCarlevel v);

LIBICAL_ICAL_EXPORT
ICalPropertyCarlevel 
		i_cal_property_get_carlevel	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_carid	(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_carid	(ICalProperty *prop,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_property_get_carid	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_categories	(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_categories	(ICalProperty *prop,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_property_get_categories	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_class	(ICalProperty_Class v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_class	 ICAL_DEFAULTLOCALE_PROPERTY,
	I_CAL_DEFAULTTZID_PROPERTY = ICAL_DEFAULTTZID_PROPERTY,
	I_CAL_DEFAULTVCARS_PROPERTY = ICAL_DEFAULTVCARS_PROPERTY,
	I_CAL_DENY_PROPERTY = ICAL_DENY_PROPERTY,
	I_CAL_DESCRIPTION_PROPERTY = ICAL_DESCRIPTION_PROPERTY,
	I_CAL_DTEND_PROPERTY = ICAL_DTEND_PROPERTY,
	I_CAL_DTSTAMP_PROPERTY = ICAL_DTSTAMP_PROPERTY,
	I_CAL_DTSTART_PROPERTY = ICAL_DTSTART_PROPERTY,
	I_CAL_DUE_PROPERTY = ICAL_DUE_PROPERTY,
	I_CAL_DURATION_PROPERTY = ICAL_DURATION_PROPERTY,
	I_CAL_ESTIMATEDDURATION_PROPERTY = ICAL_ESTIMATEDDURATION_PROPERTY,
	I_CAL_EXDATE_PROPERTY = ICAL_EXDATE_PROPERTY,
	I_CAL_EXPAND_PROPERTY = ICAL_EXPAND_PROPERTY,
	I_CAL_EXRULE_PROPERTY = ICAL_EXRULE_PROPERTY,
	I_CAL_FREEBUSY_PROPERTY = ICAL_FREEBUSY_PROPERTY,
	I_CAL_GEO_PROPERTY = ICAL_GEO_PROPERTY,
	I_CAL_GRANT_PROPERTY = ICAL_GRANT_PROPERTY,
	I_CAL_ITIPVERSION_PROPERTY = ICAL_ITIPVERSION_PROPERTY,
	I_CAL_LASTMODIFIED_PROPERTY = ICAL_LASTMODIFIED_PROPERTY,
	I_CAL_LOCATION_PROPERTY = ICAL_LOCATION_PROPERTY,
	I_CAL_MAXCOMPONENTSIZE_PROPEmeter *value,
						 ICalParameterScheduleforcesend v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_schedulestatus
						(const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_parameter_get_schedulestatus
						(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_schedulestatus
						(ICalParameter *value,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_sentby	(const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_parameter_get_sentby	(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_sentby	(ICalParameter *value,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_size	(const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_parameter_get_size	(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_size	(ICalParameter *value,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_stayinformed
						(ICalParameterStayinformed v);
ICAL_ICAL_EXPORT
ICalParameterPartstat 
		i_cal_parameter_get_partstat	(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_partstat	(ICalParameter *value,
						 ICalParameterPartstat v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_patchaction	(ICalParameterPatchaction value);

LIBICAL_ICAL_EXPORT
ICalParameterPatchaction 
		i_cal_parameter_get_patchaction	(const ICalParameter *param);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_patchaction	(ICalParameter *param,
						 ICalParameterPatchaction value);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_publiccomment
						(const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_parameter_get_publiccomment
						(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_publiccomment
						(ICalParameter *value,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_range	(ICalParameterRange v);

LIBICAL_ICAL_EXPORT
ICalParameterRange 
		i_cal_parameter_get_range	(cons_MANAGEDID_PARAMETER,
	I_CAL_MEMBER_PARAMETER = ICAL_MEMBER_PARAMETER,
	I_CAL_MODIFIED_PARAMETER = ICAL_MODIFIED_PARAMETER,
	I_CAL_OPTIONS_PARAMETER = ICAL_OPTIONS_PARAMETER,
	I_CAL_PARTSTAT_PARAMETER = ICAL_PARTSTAT_PARAMETER,
	I_CAL_PATCHACTION_PARAMETER = ICAL_PATCHACTION_PARAMETER,
	I_CAL_PUBLICCOMMENT_PARAMETER = ICAL_PUBLICCOMMENT_PARAMETER,
	I_CAL_RANGE_PARAMETER = ICAL_RANGE_PARAMETER,
	I_CAL_REASON_PARAMETER = ICAL_REASON_PARAMETER,
	I_CAL_RELATED_PARAMETER = ICAL_RELATED_PARAMETER,
	I_CAL_RELTYPE_PARAMETER = ICAL_RELTYPE_PARAMETER,
	I_CAL_REQUIRED_PARAMETER = ICAL_REQUIRED_PARAMETER,
	I_CAL_RESPONSE_PARAMETER = ICAL_RESPONSE_PARAMETER,
	I_CAL_ROLE_PARAMETER = ICAL_ROLE_PARAMETER,
	I_CAL_RSVP_PARAMETER = ICAL_RSVP_PARAMETER,
	I_CAL_SCHEDULEAGENT_PARAMETER = ICAL_SCHEDULEAGENT_PARAMETER,
	I_CAL_SCHEDULEFORCESEND_PARAMETER = ICAL_SCHEDULEFORCESEND_PARAMETER,
	I_CAL_SCHEDULESTATUS_PARAMETER = ICAL_SCHEDULESTATUS_PARAMETER,
	I_CAL_SENTBY_PARAMETER = ICAL_SENTBY_PARAMETER,
	I_CAL_SIZE_PARAMETER = ICAL_SIZI_CAL_IS_ARRAY(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE \
    ((obj), I_CAL_TYPE_ARRAY))

#define I_CAL_IS_ARRAY_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE \
    ((klass), I_CAL_TYPE_ARRAY))

/**
 * ICalArray:
 *
 * This is the ICalArray instance.
 */

/**
 * ICalArrayClass:
 *
 * This is the ICalArray class.
 */
typedef struct _ICalArrayClass ICalArrayClass;

struct _ICalArray {
    /*< private >*/
    ICalObject parent;
};

struct _ICalArrayClass {
    /*< private >*/
    ICalObjectClass parent;
};

LIBICAL_ICAL_EXPORT
GType 		i_cal_array_get_type		(void);

LIBICAL_ICAL_EXPORT
gint 		i_cal_array_size		(ICalArray *array);

LIBICAL_ICAL_EXPORT
ICalArray *	i_cal_array_copy		(ICalArray *array);

LIBICAL_ICAL_EXPORT
void		i_cal_array_free		(ICalArray *array);

LIBICAL_ICAL_EXPORT
void		i_cal_array_remove_element_at	(ICalArray *array,
						 gint position);

LIBICAL_ICAL_EXPORT
void		i_cal_array_sort		(ICalArray *array,
						 gint (*compare) (const void *, const void *));

G_END_DECLS

#endif /* I_CAL_ARRAY_H */
_TYPE_ATTACH, ICalAttachClass))

#define I_CAL_IS_ATTACH(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE \
    ((obj), I_CAL_TYPE_ATTACH))

#define I_CAL_IS_ATTACH_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE \
    ((klass), I_CAL_TYPE_ATTACH))

/**
 * ICalAttach:
 *
 * This is the ICalAttach instance.
 */

/**
 * ICalAttachClass:
 *
 * This is the ICalAttach class.
 */
typedef struct _ICalAttachClass ICalAttachClass;

struct _ICalAttach {
    /*< private >*/
    ICalObject parent;
};

struct _ICalAttachClass {
    /*< private >*/
    ICalObjectClass parent;
};

LIBICAL_ICAL_EXPORT
GType 		i_cal_attach_get_type		(void);

LIBICAL_ICAL_EXPORT
ICalAttach *	i_cal_attach_new_from_url	(const gchar *url);

LIBICAL_ICAL_EXPORT
ICalAttach *	i_cal_attach_new_from_data	(const gchar *data,
						 GFunc free_fn,
						 void *free_fn_data);

LIBICAL_ICAL_EXPORT
ICalAttach *	i_cal_attach_new_from_bytes	(GBytes *bytes);

LIBICAL_ICAL_EXPORT
void		i_cal_attach_ref		(ICalAttach *attach);

LIBICAL_ICAL_EXPORT
void		i_cal_attach_unref		(I = ICAL_3_10_TOOBIG_STATUS,
	I_CAL_3_11_MISSREQCOMP_STATUS = ICAL_3_11_MISSREQCOMP_STATUS,
	I_CAL_3_12_UNKCOMP_STATUS = ICAL_3_12_UNKCOMP_STATUS,
	I_CAL_3_13_BADCOMP_STATUS = ICAL_3_13_BADCOMP_STATUS,
	I_CAL_3_14_NOCAP_STATUS = ICAL_3_14_NOCAP_STATUS,
	I_CAL_3_15_INVCOMMAND = ICAL_3_15_INVCOMMAND,
	I_CAL_4_0_BUSY_STATUS = ICAL_4_0_BUSY_STATUS,
	I_CAL_4_1_STORE_ACCESS_DENIED = ICAL_4_1_STORE_ACCESS_DENIED,
	I_CAL_4_2_STORE_FAILED = ICAL_4_2_STORE_FAILED,
	I_CAL_4_3_STORE_NOT_FOUND = ICAL_4_3_STORE_NOT_FOUND,
	I_CAL_5_0_MAYBE_STATUS = ICAL_5_0_MAYBE_STATUS,
	I_CAL_5_1_UNAVAIL_STATUS = ICAL_5_1_UNAVAIL_STATUS,
	I_CAL_5_2_NOSERVICE_STATUS = ICAL_5_2_NOSERVICE_STATUS,
	I_CAL_5_3_NOSCHED_STATUS = ICAL_5_3_NOSCHED_STATUS,
	I_CAL_6_1_CONTAINER_NOT_FOUND = ICAL_6_1_CONTAINER_NOT_FOUND,
	I_CAL_9_0_UNRECOGNIZED_COMMAND = ICAL_9_0_UNRECOGNIZED_COMMAND
} ICalRequestStatus;


LIBICAL_ICAL_EXPORT
const gchar *	i_cal_request_status_desc	(ICalRequestStatus stat);

LIBICAL_ICAL_EXPORT
gshort 		i_cal_request_status_major	(ICalR_CAL_IS_DATETIMEPERIOD(obj) \
    (G_TYPE_CHECK_INSTANCE_TYPE \
    ((obj), I_CAL_TYPE_DATETIMEPERIOD))

#define I_CAL_IS_DATETIMEPERIOD_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE \
    ((klass), I_CAL_TYPE_DATETIMEPERIOD))

/**
 * ICalDatetimeperiod:
 *
 * This is the ICalDatetimeperiod instance.
 */

/**
 * ICalDatetimeperiodClass:
 *
 * This is the ICalDatetimeperiod class.
 */
typedef struct _ICalDatetimeperiodClass ICalDatetimeperiodClass;

struct _ICalDatetimeperiod {
    /*< private >*/
    ICalObject parent;
};

struct _ICalDatetimeperiodClass {
    /*< private >*/
    ICalObjectClass parent;
};

LIBICAL_ICAL_EXPORT
GType 		i_cal_datetimeperiod_get_type	(void);

LIBICAL_ICAL_EXPORT
ICalDatetimeperiod *
		i_cal_datetimeperiod_new	(void);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_datetimeperiod_get_time	(ICalDatetimeperiod *dtp);

LIBICAL_ICAL_EXPORT
void		i_cal_datetimeperiod_set_time	(ICalDatetimeperiod *dtp,
						 ICalTime *time);

LIBICAL_ICAL_EXPORT
ICalPeriod *	i_cal_datetimeperiod_get_period	(ICalDifndef LIBICAL_GLIB_H
#define LIBICAL_GLIB_H

#include <glib-object.h>

#if !defined(LIBICAL_GLIB_UNSTABLE_API) && !defined(LIBICAL_GLIB_COMPILATION)
#error "Define LIBICAL_GLIB_UNSTABLE_API, to indicate it's understood the libical-glib API is currently unstable"
#endif

#define __LIBICAL_GLIB_H_INSIDE__

#include <libical-glib/i-cal-forward-declarations.h>
#include <libical-glib/i-cal-array.h>
#include <libical-glib/i-cal-attach.h>
#include <libical-glib/i-cal-comp-iter.h>
#include <libical-glib/i-cal-component.h>
#include <libical-glib/i-cal-datetimeperiod.h>
#include <libical-glib/i-cal-derived-parameter.h>
#include <libical-glib/i-cal-derived-property.h>
#include <libical-glib/i-cal-derived-value.h>
#include <libical-glib/i-cal-duration.h>
#include <libical-glib/i-cal-enums.h>
#include <libical-glib/i-cal-error.h>
#include <libical-glib/i-cal-geo.h>
#include <libical-glib/i-cal-memory.h>
#include <libical-glib/i-cal-mime.h>
#include <libical-glib/i-cal-parameter.h>
#include <libical-glib/i-cal-parser.h>
#         "VOICE"
#define VCWAVEProp                      "WAVE"
#define VCWMFProp                       "WMF"
#define VCWorkProp                      "WORK"
#define VCX400Prop                      "X400"
#define VCX509Prop                      "X509"
#define VCXRuleProp                     "XRULE"

/* Extensions */

#define XPilotIdProp                    "X-PILOTID"
#define XPilotStatusProp                "X-PILOTSTAT"

    typedef struct VObject VObject;

    typedef struct VObjectIterator
    {
        VObject *start;
        VObject *next;
    } VObjectIterator;

    LIBICAL_VCAL_EXPORT VObject *newVObject(const char *id);
    LIBICAL_VCAL_EXPORT void deleteVObject(VObject *p);
    LIBICAL_VCAL_EXPORT char *dupStr(const char *s, size_t size);
    LIBICAL_VCAL_EXPORT void deleteStr(const char *p);
    LIBICAL_VCAL_EXPORT void unUseStr(const char *s);

    LIBICAL_VCAL_EXPORT void setVObjectName(VObject *o, const char *id);
    LIBICAL_VCAL_EXPORT void setVObjectStringZValue(VObject *o, const char *s);
    gertype_is_bad_trigger(struct icaltriggertype tr);

/* struct icalreqstattype. This struct contains two string pointers,
but don't try to free either of them. The "desc" string is a pointer
to a static table inside the library.  Don't try to free it. The
"debug" string is allocated in the ring buffer. Don't try to free it
either.

BTW, you would get that original string from
*icalproperty_get_requeststatus() or icalvalue_get_text(), when
operating on the value of a request_status property. */

struct icalreqstattype
{
    icalrequeststatus code;
    const char *desc;
    const char *debug;
};

LIBICAL_ICAL_EXPORT struct icalreqstattype icalreqstattype_from_string(const char *str);

LIBICAL_ICAL_EXPORT const char *icalreqstattype_as_string(struct icalreqstattype);

LIBICAL_ICAL_EXPORT char *icalreqstattype_as_string_r(struct icalreqstattype);

struct icaltimezonephase
{
    const char *tzname;
    int is_stdandard;   /* 1 = standard tme, 0 = daylight savings time */
    struct icaltimetype dtstart;
    int offDARG_ERROR when a `NULL`
 * is passed instead of an icalparameter.
 *
 * @par Ownership
 * The string that is returned stays owned by libical and must not
 * be freed by the caller.
 *
 * @par Usage
 * ```c
 * // creates new parameter
 * icalparameter *param = icalparameter_new();
 *
 * // sets xname
 * icalparameter_set_xname(param, "X-TEST");
 *
 * // compare xname
 * assert(0 == strcmp(icalparameter_get_xname(param), "X-TEST"));
 *
 * icalparameter_free(param);
 * ```
 */
LIBICAL_ICAL_EXPORT const char *icalparameter_get_xname(icalparameter *param);

/**
 * @brief Sets the X-value of @a param to @a v
 * @param param The icalparameter to change
 * @param v The X-value to set @a param to
 * @sa icalparameter_get_xvalue()
 *
 * @par Error handling
 * If either @a param or @a v are `NULL`, it sets ::icalerrno to ICAL_BARARG_ERROR.
 * If there is an error acquiring memory, it sets `errno` to `ENOMEM`.
 *
 * @par Ownership
 * The passed string @a v stays in the ownership of the caller - libical
 * creates a copy *param = icalparameter_new_from_string("ROLE=CHAIR");
 *
 * if(param) {
 *     // use param ...
 * }
 *
 * icalparameter_free(param);
 * ```
 */
LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new_from_string(const char *value);

/**
 * @brief Creates new icalparameter of a given @a kind with a given @a value
 * @param kind The kind of icalparameter to create
 * @param value The value of the parameter
 * @return An icalparameter with the given kind and value.
 *
 * @par Error handling
 * If value is `NULL`, it returns `NULL` and sets ::icalerrno to ::ICAL_BADARG_ERROR.
 *
 * @par Ownership
 * Objects created by this method are owned by the caller and
 * must be released with the icalparameter_free() method.
 *
 * @par Example
 * ```c
 * // create new parameter
 * icalparameter *param;
 * param = icalparameter_new_from_value_string(ICAL_ROLE_PARAMETER, "CHAIR");
 *
 * // check parameter
 * assert(0 == strcmp(icalparameter_get_iana_name(param), "ROLE"));
 * assert(0 == strcmp(icalparameter_get_iana_value(parat char *attendee);
/** @brief Returns an hour-by-hour array of free/busy times over a
 *         given period.
 *
 *  @param span      A valid icalspanlist
 *  @param delta_t   The time slice to divide by, in seconds.  Default 3600.
 *
 *  @return A pointer to an array of integers containing the number of
 *       busy events in each delta_t time period.  The final entry
 *       contains the value -1.
 *
 *  This calculation is somewhat tricky.  This is due to the fact that
 *  the time range contains the start time, but does not contain the
 *  end time.  To perform a proper calculation we subtract one second
 *  off the end times to get a true containing time.
 *
 *  Also note that if you supplying a spanlist that does not start or
 *  end on a time boundary divisible by delta_t you may get results
 *  that are not quite what you expect.
 */
LIBICAL_ICALSS_EXPORT int *icalspanlist_as_freebusy_matrix(icalspanlist *span, int delta_t);
/** @brief Constructs an icalspanlist from a VFREEBUSY component */
/** @b as MMYYYY) plus a unique serial number. The serial number is
  stored as a property of the cluster.
*/
#ifndef ICALDIRSET_H
#define ICALDIRSET_H
#include "libical_icalss_export.h"
/* icaldirset Routines for storing, fetching, and searching for ical
 * objects in a database */
typedef struct icaldirset_impl icaldirset;
LIBICAL_ICALSS_EXPORT icalset *icaldirset_new(const char *path);
LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_reader(const char *path);
LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_writer(const char *path);
LIBICAL_ICALSS_EXPORT icalset *icaldirset_init(icalset *set, const char *dsn, void *options);
LIBICAL_ICALSS_EXPORT void icaldirset_free(icalset *set);
LIBICAL_ICALSS_EXPORT const char *icaldirset_path(icalset *set);
/* Marks the cluster as changed, so it will be written to disk when it
   is freed. Commit writes to disk immediately*/
LIBICAL_ICALSS_EXPORT void icaldirset_mark(icalset *set);
LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_commit(icalset *set);
/**
  This assumes that the toXPORT int icalset_count_components(icalset *set, icalcomponent_kind kind);
/** Restricts the component returned by icalset_first, _next to those
    that pass the gauge. */
LIBICAL_ICALSS_EXPORT icalerrorenum icalset_select(icalset *set, icalgauge *gauge);
/** Gets a component by uid */
LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch(icalset *set, const char *uid);
LIBICAL_ICALSS_EXPORT int icalset_has_uid(icalset *set, const char *uid);
LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch_match(icalset *set, icalcomponent *c);
/** Modifies components according to the MODIFY method of CAP. Works on
   the currently selected components. */
LIBICAL_ICALSS_EXPORT icalerrorenum icalset_modify(icalset *set,
                                                   icalcomponent *oldc, icalcomponent *newc);
/** Iterates through the components. If a gauge has been defined, these
   will skip over components that do not pass the gauge */
LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_current_component(icalset *set);
LIBIg
 *
 * Prints gauge information to STDOUT.
 */
LIBICAL_ICALSS_EXPORT void icalgauge_dump(icalgauge *gauge);
/** @brief Returns true if comp matches the gauge.
 *
 * The component must be in
 * canonical form -- a VCALENDAR with one VEVENT, VTODO or VJOURNAL
 * sub component
 */
LIBICAL_ICALSS_EXPORT int icalgauge_compare(icalgauge *g, icalcomponent *comp);
#endif /* ICALGAUGE_H */
/**
 @file icalset.h
 @author eric 28 November 1999
 Icalset is the "base class" for representations of a collection of
 iCal components. Derived classes (actually delegatees) include:
    icalfileset   Store components in a single file
    icaldirset    Store components in multiple files in a directory
    icalbdbset    Store components in a Berkeley DB File
    icalheapset   Store components on the heap
    icalmysqlset  Store components in a mysql database.
**/
/*
 (C) COPYRIGHT 2000, Eric Busboom <eric@civicknowledge.com>
 This library is free software; you can redistribute it and/or modify
 it under the terms of either:
    Thr * v, ...);

/* QUERYNAME */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_queryname(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_queryname(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_queryname(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_queryname(const char * v, ...);

/* RDATE */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_rdate(struct icaldatetimeperiodtype v);
LIBICAL_ICAL_EXPORT void icalproperty_set_rdate(icalproperty *prop, struct icaldatetimeperiodtype v);
LIBICAL_ICAL_EXPORT struct icaldatetimeperiodtype icalproperty_get_rdate(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_rdate(struct icaldatetimeperiodtype v, ...);

/* RECUR-ACCEPTED */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_recuraccepted(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_recuraccepted(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_recu int icalproperty_get_maxresults(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_maxresults(int v, ...);

/* MAXRESULTSSIZE */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_maxresultssize(int v);
LIBICAL_ICAL_EXPORT void icalproperty_set_maxresultssize(icalproperty *prop, int v);
LIBICAL_ICAL_EXPORT int icalproperty_get_maxresultssize(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_maxresultssize(int v, ...);

/* METHOD */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_method(enum icalproperty_method v);
LIBICAL_ICAL_EXPORT void icalproperty_set_method(icalproperty *prop, enum icalproperty_method v);
LIBICAL_ICAL_EXPORT enum icalproperty_method icalproperty_get_method(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_method(enum icalproperty_method v, ...);

/* MINDATE */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_mindate(struct icaltimetype v);
LIBICAL_ICAL_EXPORT void icalproperty_set_mindate(icalp_EXPORT struct icaltimetype icalproperty_get_exdate(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_exdate(struct icaltimetype v, ...);

/* EXPAND */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_expand(int v);
LIBICAL_ICAL_EXPORT void icalproperty_set_expand(icalproperty *prop, int v);
LIBICAL_ICAL_EXPORT int icalproperty_get_expand(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_expand(int v, ...);

/* EXRULE */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_exrule(struct icalrecurrencetype v);
LIBICAL_ICAL_EXPORT void icalproperty_set_exrule(icalproperty *prop, struct icalrecurrencetype v);
LIBICAL_ICAL_EXPORT struct icalrecurrencetype icalproperty_get_exrule(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_exrule(struct icalrecurrencetype v, ...);

/* FREEBUSY */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_freebusy(struct icalperiodtype v);
LIBICAL_ICAL_EXPORT void icalproperty_set_freebusy(icalp_PROPERTY = 87,
    ICAL_URL_PROPERTY = 88,
    ICAL_VERSION_PROPERTY = 89,
    ICAL_VOTER_PROPERTY = 107,
    ICAL_X_PROPERTY = 90,
    ICAL_XLICCLASS_PROPERTY = 91,
    ICAL_XLICCLUSTERCOUNT_PROPERTY = 92,
    ICAL_XLICERROR_PROPERTY = 93,
    ICAL_XLICMIMECHARSET_PROPERTY = 94,
    ICAL_XLICMIMECID_PROPERTY = 95,
    ICAL_XLICMIMECONTENTTYPE_PROPERTY = 96,
    ICAL_XLICMIMEENCODING_PROPERTY = 97,
    ICAL_XLICMIMEFILENAME_PROPERTY = 98,
    ICAL_XLICMIMEOPTINFO_PROPERTY = 99,
    ICAL_NO_PROPERTY = 100
} icalproperty_kind;

/* ACCEPT-RESPONSE */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_acceptresponse(const char * v);
LIBICAL_ICAL_EXPORT void icalproperty_set_acceptresponse(icalproperty *prop, const char * v);
LIBICAL_ICAL_EXPORT const char * icalproperty_get_acceptresponse(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_vanew_acceptresponse(const char * v, ...);

/* ACKNOWLEDGED */
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_acknowledged(struct icaltimetype v);
LI   icalgauge *gauge, const char *tzid);

LIBICAL_ICALSS_EXPORT icalcomponent *icalfilesetiter_to_next(icalset *set, icalsetiter *iter);

LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_form_a_matched_recurrence_component(icalsetiter *
                                                                                     itr);

/** Returns a reference to the internal component. **You probably should
   not be using this.** */

LIBICAL_ICALSS_EXPORT icalcomponent *icalfileset_get_component(icalset *cluster);

/**
 * @brief Options for opening an icalfileset.
 *
 * These options should be passed to the icalset_new() function
 */

typedef struct icalfileset_options
{
    int flags;                /**< flags for open() O_RDONLY, etc  */
    int mode;                 /**< file mode */
    int safe_saves;           /**< to lock or not */
    icalcluster *cluster;     /**< use this cluster to initialize data */
} icalfileset_options;

extern icalfileset_options icalfileset_options_default;

#endif /* !ICALFILESET_H */property_kind kind);

LIBICAL_ICAL_EXPORT icalproperty_method icalproperty_string_to_method(const char *str);
LIBICAL_ICAL_EXPORT const char *icalproperty_method_to_string(icalproperty_method method);

LIBICAL_ICAL_EXPORT const char *icalproperty_enum_to_string(int e);
LIBICAL_ICAL_EXPORT char *icalproperty_enum_to_string_r(int e);
LIBICAL_ICAL_EXPORT int icalproperty_kind_and_string_to_enum(const int kind, const char *str);

LIBICAL_ICAL_EXPORT const char *icalproperty_status_to_string(icalproperty_status);
LIBICAL_ICAL_EXPORT icalproperty_status icalproperty_string_to_status(const char *string);

LIBICAL_ICAL_EXPORT int icalproperty_enum_belongs_to_property(icalproperty_kind kind, int e);

/**
 * Normalizes (reorders and sorts the parameters) the specified @p icalproperty.
 * @since 3.0
 */
LIBICAL_ICAL_EXPORT void icalproperty_normalize(icalproperty *prop);

#endif /*ICALPROPERTY_H */
/*======================================================================
 FILE: icalspanlist.h
 CREATOR: eric 21 Aug 2000

 USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

EACH LICENSOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF NONINFRINGEMENT OR THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.

The software is provided with RESTRICTED RIGHTS.  Use, duplication, or
disclosure by the government are subject to restrictions set forth in
DFARS 252.227-7013 or 48 CFR 52.227-19, as applicable.

***************************************************************************/

#ifndef VCC_H
#define VCC_H

#include "libical_vcal_export.h"
#include "vobject.h"

#if defined(__CPLUSPLUS__) || defined(__cplusplus)
extern "C"
{
#endif

    typedef void (*MimeErrorHandler) (char *);

    LIBICAL_VCAL_EXPORT void registerMimeErrorHandler(MimeErrorHandler);

    LIBICAL_VCAL_EXPORT VObject *Parse_MIME(const char *input, unsigned long len);

    LIBICAL_VCAL_EXPORT VObject *Parse_MIME_FromFileName(const char *fname);

/* NOTE regardingION>`
 *
 * The format for the times is the same as those used by
 * icaltime_from_string(), and the format for the duration
 * is the same as that used by icaldurationtype_from_string().
 *
 * @par Usage
 * ```c
 * // create icalperiodtype
 * const char *period_string = "20170606T090000/20170607T090000";
 * struct icalperiodtype period = icalperiodtype_from_string(period_string);
 *
 * // print period in iCal format
 * printf("%s\n", icalperiodtype_as_ical_string(period));
 * ```
 */
LIBICAL_ICAL_EXPORT struct icalperiodtype icalperiodtype_from_string(const char *str);

/**
 * @brief Converts an ::icalperiodtype into an iCal-formatted string.
 * @param p The time period to convert
 * @return A string representing the iCal-formatted period
 * @sa icalperiodtype_as_ical_string_r()
 *
 * @par Error handling
 * Sets ::icalerrno to ::ICAL_ALLOCATION_ERROR if there was an
 * internal error allocating memory.
 *
 * @par Ownership
 * The string returned by this method is owned by libical and must not be
 * `free()`  DUE property is already set, then resets it to the value v.
 *  - If a DURATION property is already set, then calculates the new
 *    duration based on the supplied value of @p v.
 */
LIBICAL_ICAL_EXPORT void icalcomponent_set_due(icalcomponent *comp, struct icaltimetype v);

/**     @brief Sets the DURATION property to given icalduration.
 *
 *      This method respects the icaltime type (DATE vs DATE-TIME) and
 *      timezone (or lack thereof).
 *
 *      This also checks that a DTEND property isn't already there,
 *      and returns an error if it is. It's the caller's responsibility
 *      to remove it.
 *
 *      For the icalcomponent routines only, DTEND and DURATION are tied
 *      together. If you call this routine and DTEND exists, no action
 *      will be taken and icalerrno will be set to ICAL_MALFORMEDDATA_ERROR.
 *      If neither exists, the routine will create the appropriate
 *      property.
 */
LIBICAL_ICAL_EXPORT void icalcomponent_set_duration(icalcomponent *comp,
      icalcomponent for the specified @p property.
 */
LIBICAL_ICAL_EXPORT icalcomponent *icalproperty_get_parent(const icalproperty *property);

/* Iterate through the properties */
LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_current_property(icalcomponent *component);

LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_first_property(icalcomponent *component,
                                                                   icalproperty_kind kind);
LIBICAL_ICAL_EXPORT 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 */
LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_get_inner(icalcomponent *comp);

LIBICAL_ICAL_EXPORT void icalcomponent_add_component(icalcomponent *parent, icalcomponent *child);

LIBICAL_ICAL_EXPORT void icalcomponent_remove_componCAL_ICAL_EXPORT int icaltime_is_leap_year(const int year);

/** Returns the number of days in this year. */
LIBICAL_ICAL_EXPORT int icaltime_days_in_year(const int year);

/**
 *  @brief Builds an icaltimespan given a start time, end time and busy value.
 *
 *  @param dtstart   The beginning time of the span, can be a date-time
 *                   or just a date.
 *  @param dtend     The end time of the span.
 *  @param is_busy   A boolean value, 0/1.
 *  @returns          A span using the supplied values. The times are specified in UTC.
 */
LIBICAL_ICAL_EXPORT struct icaltime_span icaltime_span_new(struct icaltimetype dtstart,
                                                           struct icaltimetype dtend, int is_busy);

/** @brief Returns true if the two spans overlap.
 *
 *  @param s1         First span to test
 *  @param s2         Second span to test
 *  @return           boolean value
 *
 *  The result is calculated by testing if the start time of s1 is contained
 *  by the s2 span, or if the end loating time
 *
 *      Returns a new icaltime instance, initialized to the given time,
 *      optionally using the given timezone.
 *
 *      If the caller specifies the is_date param as TRUE, the returned
 *      object is of DATE type, otherwise the input is meant to be of
 *      DATE-TIME type.
 *      If the zone is not specified (NULL zone param) the time is taken
 *      to be floating, that is, valid in any timezone. Note that, in
 *      addition to the uses specified in [RFC5545], this can be used
 *      when doing simple math on couples of times.
 *      If the zone is specified (UTC or otherwise), it's stored in the
 *      object and it's used as the native timezone for this object.
 *      This means that the caller can convert this time to a different
 *      target timezone with no need to store the source timezone.
 *
 */
LIBICAL_ICAL_EXPORT struct icaltimetype icaltime_from_timet_with_zone(const time_t tm,
                                                                      const int is_get_xname(ICalParameter &param);
    static void set_xvalue(ICalParameter &param, const std::string &v);
    static std::string get_xvalue(ICalParameter &param);

    /* Convert enumerations */
    static std::string kind_to_string(const icalparameter_kind &kind);
    static icalparameter_kind string_to_kind(const std::string &str);

public:
    /* DELEGATED-FROM */
    std::string get_delegatedfrom() const;
    void set_delegatedfrom(const std::string &v);

    /* RELATED */
    icalparameter_related get_related() const;
    void set_related(const icalparameter_related &v);

    /* SENT-BY */
    std::string get_sentby() const;
    void set_sentby(const std::string &v);

    /* LANGUAGE */
    std::string get_language() const;
    void set_language(const std::string &v);

    /* RELTYPE */
    icalparameter_reltype get_reltype() const;
    void set_reltype(const icalparameter_reltype &v);

    /* ENCODING */
    icalparameter_encoding get_encoding() const;
    void set_encoding(const icalparameter_encoding &E_VCALPROPPARSEERROR = 21809,
    ICAL_XLICERRORTYPE_NONE = 21899
} icalparameter_xlicerrortype;

#define ICALPARAMETER_LAST_ENUM 22300

/* ACTIONPARAM */
LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_actionparam(icalparameter_action v);
LIBICAL_ICAL_EXPORT icalparameter_action icalparameter_get_actionparam(const icalparameter *value);
LIBICAL_ICAL_EXPORT void icalparameter_set_actionparam(icalparameter *value, icalparameter_action v);

/* ALTREP */
LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_altrep(const char * v);
LIBICAL_ICAL_EXPORT const char * icalparameter_get_altrep(const icalparameter *value);
LIBICAL_ICAL_EXPORT void icalparameter_set_altrep(icalparameter *value, const char * v);

/* CHARSET */
LIBICAL_ICAL_EXPORT icalparameter * icalparameter_new_charset(const char * v);
LIBICAL_ICAL_EXPORT const char * icalparameter_get_charset(const icalparameter *value);
LIBICAL_ICAL_EXPORT void icalparameter_set_charset(icalparameter *value, const char * v);

/* CN */
LIBr *icalparameter_enum_to_string(int e);
LIBICAL_ICAL_EXPORT int icalparameter_string_to_enum(const char *str);

/* START of section of machine generated code (mkderivedparameters.pl). Do not edit. */

typedef enum icalparameter_kind {
    ICAL_ANY_PARAMETER = 0,
    ICAL_ACTIONPARAM_PARAMETER = 1,
    ICAL_ALTREP_PARAMETER = 2,
    ICAL_CHARSET_PARAMETER = 3,
    ICAL_CN_PARAMETER = 4,
    ICAL_CUTYPE_PARAMETER = 5,
    ICAL_DELEGATEDFROM_PARAMETER = 6,
    ICAL_DELEGATEDTO_PARAMETER = 7,
    ICAL_DIR_PARAMETER = 8,
    ICAL_DISPLAY_PARAMETER = 46,
    ICAL_EMAIL_PARAMETER = 50,
    ICAL_ENABLE_PARAMETER = 9,
    ICAL_ENCODING_PARAMETER = 10,
    ICAL_FBTYPE_PARAMETER = 11,
    ICAL_FEATURE_PARAMETER = 48,
    ICAL_FILENAME_PARAMETER = 42,
    ICAL_FMTTYPE_PARAMETER = 12,
    ICAL_IANA_PARAMETER = 33,
    ICAL_ID_PARAMETER = 13,
    ICAL_LABEL_PARAMETER = 49,
    ICAL_LANGUAGE_PARAMETER = 14,
    ICAL_LATENCY_PARAMETER = 15,
    ICAL_LOCAL_PARAMETER = 16,
    ICAL_LOCALIZE_PARAMETER = 17,
    ICAL_MANAGEDID_P      int end_year, icalarray *changes);

/** @brief Gets the LOCATION or X-LIC-LOCATION property from a VTIMEZONE. */
LIBICAL_ICAL_EXPORT char *icaltimezone_get_location_from_vtimezone(icalcomponent *component);

/** @brief Gets the TZNAMEs used for the last STANDARD & DAYLIGHT
 * components in a VTIMEZONE.
 *
 * If both STANDARD and DAYLIGHT components use the same TZNAME, it
 * returns that. If they use different TZNAMEs, it formats them like
 * "EST/EDT". The returned string should be freed by the caller. */
LIBICAL_ICAL_EXPORT char *icaltimezone_get_tznames_from_vtimezone(icalcomponent *component);

/*
 * Truncate a VTIMEZONE component to the given start and end times.
 * If either time is null, then no truncation will occur at that point.
 * If either time is non-null, then it MUST be specified as UTC.
 * If the start time is non-null and ms_compatible is zero,
 * then the DTSTART of RRULEs will be adjusted to occur after the start time.
 * @since 3.0.6
 */
LIBICAL_ICAL_EXPORT void icaltimezone_truncateAL_XLICMIMEPART_COMPONENT, /* A non-stardard component that mirrors
                                           structure of MIME data */
    ICAL_VAVAILABILITY_COMPONENT,
    ICAL_XAVAILABLE_COMPONENT,
    ICAL_VPOLL_COMPONENT,
    ICAL_VVOTER_COMPONENT,
    ICAL_XVOTE_COMPONENT,
    ICAL_VPATCH_COMPONENT,
    ICAL_XPATCH_COMPONENT
} 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=====================================*/

#ifndef ICALVCAL_H
#define ICALVCAL_H

#include "libical_vcal_export.h"
#include "vobject.h"
#include "icalcomponent.h"

/* These are used as default values if the values are missing in the vCalendar
   file. Gnome Calendar, for example, does not save the URL of the audio alarm,
   so we have to add a value here to make a valid iCalendar object. */
typedef struct _icalvcal_defaults icalvcal_defaults;
struct _icalvcal_defaults
{
    char *alarm_audio_url;
    char *alarm_audio_fmttype;
    char *alarm_description;
};

/* Convert a vObject into an icalcomponent */

LIBICAL_VCAL_EXPORT icalcomponent *icalvcal_convert(VObject *object);

LIBICAL_VCAL_EXPORT icalcomponent *icalvcal_convert_with_defaults(VObject *object,
                                                                  icalvcal_defaults * defaults);

#endif /* !ICALVCAL_H */
/*======================================================================
 FILE: icalfilesetimpl.h
 CREATOR: eric 23 December 1999

 (C) e owned by the caller. The must be
 * released with the appropriate icalmemory_free_buffer() method.
 *
 * This creates a new (non-temporary) buffer of the specified @a size. All
 * buffers returned by this method are zeroed-out.
 *
 * @par Usage
 * ```c
 * // create buffer
 * char *buffer = icalmemory_new_buffer(50);
 *
 * // fill buffer
 * strcpy(buffer, "some data");
 *
 * // release buffer
 * icalmemory_free_buffer(buffer);
 * ```
 */
LIBICAL_ICAL_EXPORT void *icalmemory_new_buffer(size_t size);

/**
 * @brief Resizes a buffer created with icalmemory_new_buffer().
 * @param buf The buffer to be resized.
 * @param size The new size of the buffer.
 * @return The new, resized buffer.
 * @sa icalmemory_new_buffer()
 * @warning This method may not be used for temporary buffers (buffers allocated
 * with icalmemory_tmp_buffer() and related functions)!
 *
 * @par Error handling
 * If there is a problem while reallocating the buffer, the method sets
 * ::icalerrno to ::ICAL_NEWFAILED_ERROR and returns `NULL`.
 *
ude "icptrholder_cxx.h"

extern "C"
{
#include "icalerror.h"
#include "icalcomponent.h"
}

#include <string>

namespace LibICal
{

class ICalProperty;

/**
 * @class VComponent
 * @brief A class wrapping the libical icalcomponent functions
 *
 * @exception icalerrorenum   Any errors generated in libical are
 *                            propagated via this exception type.
 */

class LIBICAL_ICAL_EXPORT VComponent
{
public:
    VComponent();
    VComponent(const VComponent &);
    VComponent &operator=(const VComponent &);
    virtual ~VComponent();

    explicit VComponent(icalcomponent *v);
    explicit VComponent(const std::string &str);
    explicit VComponent(const icalcomponent_kind &kind);

    operator icalcomponent *()
    {
        return imp;
    }

    void new_from_string(const std::string &str);

    // detach imp to this object. use with caution. it would cause
    // memory leak if you are not careful.
    void detach();

public:
    std::string as_ical_string();
    bool is_valid();
    icalcoameter &parameter);
    void set_parameter_from_string(const std::string &name, const std::string &val);
    std::string get_parameter_as_string(const std::string &name);
    void remove_parameter_by_kind(const icalparameter_kind &kind);
    int count_parameters();

    /** Iterate through the parameters */
    ICalParameter *get_first_parameter(const icalparameter_kind &kind);
    ICalParameter *get_next_parameter(const icalparameter_kind &kind);

    /** Access the value of the property */
    void set_value(const ICalValue &val);
    void set_value_from_string(const std::string &val, const std::string &kind);

    ICalValue *get_value();
    std::string get_value_as_string();

    /** Returns the name of the property -- the type name converted
     *  to a string, or the value of get_x_name if the type is X
     *  property
     */
    std::string get_name() const;

public:
    /* Deal with X properties */
    static void set_x_name(ICalProperty &prop, const std::string &name);
    static std::string get_x icalcomponent_count_kinds(component, ICAL_ANY_COMPONENT);
 * }
 * ```
 */
#define icalerror_check_arg_rz(test,arg) \
if (!(test)) { \
    icalerror_set_errno(ICAL_BADARG_ERROR); \
    return 0; \
}

/**
 * @brief Checks the assertion @a test and raises error on failure, returns @a error
 * @param test The assertion to check
 * @param arg  The argument involved (as a string)
 * @param error What to return on error
 *
 * This function checks the assertion @a test, which is used to
 * test if the parameter @a arg is correct. If the assertion fails,
 * it aborts the process with `assert(0)` and causes the enclosing
 * function to return @a error.
 *
 * @par Example
 * ```c
 * icalcomponent *test_function(icalcomponent *component) {
 *    icalerror_check_arg_re(component != 0, "component", NULL);
 *
 *    // use component
 *    return icalcomponent_get_first_real_component(component);
 * }
 * ```
 */
#define icalerror_check_arg_re(test,arg,error) \
if (!(test)) { \
    icalerror_stop_here(); \
    assert(0); \
  
 * If the type of error @a e wasn't found, it returns the description
 * for ::ICAL_UNKNOWN_ERROR.
 *
 * @par Ownership
 * The string that is returned is owned by the library and must not
 * be free'd() by the user.
 *
 * @par Usage
 * ```c
 * if(icalerrno != ICAL_NO_ERROR) {
 *     printf("%s\n", icalerror_perror());
 * }
 * ```
 */
LIBICAL_ICAL_EXPORT const char *icalerror_perror(void);

/**
 * @brief Prints backtrace
 * @note Only works on systems that support it (HAVE_BACKTRACE enabled).
 *
 * @par Usage
 * ```
 * if(icalerrno != ICAL_NO_ERROR) {
 *     ical_bt();
 * }
 * ```
 */
LIBICAL_ICAL_EXPORT void ical_bt(void);

/**
 * @brief Sets the ::icalerrorstate for a given ::icalerrorenum @a error
 * @param error The error to change
 * @param state The new error state of the error
 *
 * Sets the severity of a given error. For example, it can be used to
 * set the severity of an ::ICAL_PARSE_ERROR to be an ::ICAL_ERROR_NONFATAL.
 *
 * @par Usage
 * ```c
 * icalerror_set_error_state(ICAL_PARSE_ERROR, ICAL_ER=====*/

#ifndef ICALCALENDAR_H
#define ICALCALENDAR_H

#include "libical_icalss_export.h"
#include "icalset.h"

/** @file icalcalendar.h
 *
 * @brief Routines for storing calendar data in a file system.
 *
 * The calendar has two icaldirsets, one for incoming components and one for
 * booked components. It also has interfaces to access the free/busy list and a
 * list of calendar properties
 */

typedef struct icalcalendar_impl icalcalendar;

LIBICAL_ICALSS_EXPORT icalcalendar *icalcalendar_new(const char *dir);

LIBICAL_ICALSS_EXPORT void icalcalendar_free(icalcalendar *calendar);

LIBICAL_ICALSS_EXPORT int icalcalendar_lock(icalcalendar *calendar);

LIBICAL_ICALSS_EXPORT int icalcalendar_unlock(icalcalendar *calendar);

LIBICAL_ICALSS_EXPORT int icalcalendar_islocked(icalcalendar *calendar);

LIBICAL_ICALSS_EXPORT int icalcalendar_ownlock(icalcalendar *calendar);

LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_booked(icalcalendar *calendar);

LIBICAL_ICALSS_EXPORT icalset *icalcalendar_get_incoming(icalca
 * // checks it
 * assert(icalattach_get_is_url(attach));
 * assert(0 == strcmp(icalattach_get_url(attach), "http://example.com"));
 *
 * // release it
 * icalattach_unref(attach);
 * ```
 */
LIBICAL_ICAL_EXPORT icalattach *icalattach_new_from_url(const char *url);

/**
 * @brief Creates new icalattach object from data.
 * @param data The data to create the icalattach from
 * @param free_fn The function to free the data
 * @param free_fn_data Data to pass to the @a free_fn
 * @return An icalattach object with the given data
 * @sa icalattach_unref()
 *
 * @par Error handling
 * If @a url is `NULL`, it returns `NULL` and sets ::icalerrno to
 * ::ICAL_BADARG_ERROR. If there was an error allocating memory, it
 * returns `NULL` and sets `errno` to `ENOMEM`.
 *
 * @par Ownership
 * The returned icalattach object is owned by the caller of the function.
 * icalattach objects are reference counted, which means that after
 * use, icalattach_unref() needs to be called to signal that they are
 * not used anymore.
 */
L \
    { ICAL_RECURRENCE_ARRAY_MAX_BYTE },  /* by_set_pos   */ \
    NULL,                                /* rscale       */ \
    ICAL_SKIP_OMIT                       /* skip         */ \
}

LIBICAL_ICAL_EXPORT int icalrecurrencetype_rscale_is_supported(void);

LIBICAL_ICAL_EXPORT icalarray *icalrecurrencetype_rscale_supported_calendars(void);

LIBICAL_ICAL_EXPORT void icalrecurrencetype_clear(struct icalrecurrencetype *r);

/*
 * Routines to decode the day values of the by_day array
 */

/** @brief Decodes a day to a weekday.
 *
 * @returns The decoded day of the week. 1 is Monday, 2 is Tuesday, etc.
 * A position of 0 means 'any' or 'every'.
 *
 * The 'day' element of icalrecurrencetype_weekday is encoded to
 * allow representation of both the day of the week ( Monday, Tuesday),
 * but also the Nth day of the week ( First tuesday of the month, last
 * thursday of the year) These routines decode the day values.
 *
 * The day's position in the period ( Nth-ness) and the numerical
 * value of the day are enco, using the icalarray
 * object results in undefined behaviour. If there is an error while creating the
 * object, it returns `NULL` and sets ::icalerrno to ::ICAL_NEWFAILED_ERROR.
 *
 * @par Ownership
 * The returned icalarray object is owned by the caller of the function,
 * and needs to be released properly after it's no longer needed with
 * icalarray_free().
 *
 * @par Usage
 * ```c
 * // create new array
 * icalarray *array = icalarray_new(sizeof(int), 1);
 *
 * // use array
 * int a = 4;
 * icalarray_append(array, &a);
 * assert(*icalarray_element_at(array, 0) == a);
 *
 * // release memory
 * icalarray_free(array);
 * ```
 */
LIBICAL_ICAL_EXPORT icalarray *icalarray_new(size_t element_size, size_t increment_size);

/**
 * @brief Copies an existing icalarray and its elements, creating a new one.
 * @param array The array to copy
 * @return A new array, holding all the elements of @a array
 *
 * Creates a new icalarray object, copying all the existing elements from
 * @a array as well as its properties 
/** @brief Returns a request status for major/minor status numbers
 */
LIBICAL_ICAL_EXPORT icalrequeststatus icalenum_num_to_reqstat(short major, short minor);

LIBICAL_ICAL_EXPORT char *icalenum_reqstat_code(icalrequeststatus stat);

/** @brief Returns the code for a request status.
 */
LIBICAL_ICAL_EXPORT char *icalenum_reqstat_code_r(icalrequeststatus stat);

/***********************************************************************
 * Conversion functions
**********************************************************************/

/* These 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(icalprg/MPL/

 The Original Code is eric. The Initial Developer of the Original
 Code is Eric Busboom
======================================================================*/

#ifndef ICALPERIOD_H
#define ICALPERIOD_H

/**
 * @file icalperiod.h
 * @brief Functions for working with iCal periods (of time).
 */

#include "libical_ical_export.h"


/**
 * @brief Struct to represent a period in time.
 */
struct icalperiodtype
{
    struct icaltimetype start;
    struct icaltimetype end;
    struct icaldurationtype duration;
};

#define ICALPERIODTYPE_INITIALIZER { \
    ICALTIMETYPE_INITIALIZER,        \
    ICALTIMETYPE_INITIALIZER,        \
    ICALDURATIONTYPE_INITIALIZER     \
}

/**
 * @brief Constructs a new ::icalperiodtype from @a str
 * @param str The string from which to construct a time period
 * @return An ::icalperiodtype representing the period @a str
 * @sa icaltime_from_string(), icaldurationtype_from_string()
 *
 * @par Error handling
 * If @a str is not properly formatted, it sets ::icalerrno to
 * ::IChe duration @a dur
 *
 * @par Error handling
 * When given bad input, it sets ::icalerrno to ::ICAL_MALFORMEDDATA_ERROR and
 * returns icaldurationtype_bad_duration().
 *
 * @par Usage
 * ```c
 * // create a new icaldurationtype
 * struct icaldurationtype duration;
 * duration = icaldurationtype_from_string("+PT05M");
 *
 * // verify that it's 5 minutes
 * assert(duration.minutes == 5);
 * ```
 */
LIBICAL_ICAL_EXPORT struct icaldurationtype icaldurationtype_from_string(const char *dur);

/**
 * @brief Converts an ::icaldurationtype into the duration in seconds as `int`.
 * @param duration The duration to convert to seconds
 * @return An `int` representing the duration in seconds
 *
 * @par Usage
 * ```c
 * // create icaldurationtype with given duration
 * struct icaldurationtype duration;
 * duration = icaldurationtype_from_int(3532342);
 *
 * // get the duration in seconds and verify it
 * assert(icaldurationtype_as_int(duration) == 3532342);
 * ```
 */
LIBICAL_ICAL_EXPORT int icaldurationtype_as_int(struct _string(const struct icaltimetype tt);

/**
 * @brief Returns a string representation of the time, in RFC5545 format.
 *
 * @par Ownership
 * The string is owned by the caller.
 */
LIBICAL_ICAL_EXPORT char *icaltime_as_ical_string_r(const struct icaltimetype tt);

/** @brief Returns the timezone. */
LIBICAL_ICAL_EXPORT const icaltimezone *icaltime_get_timezone(const struct icaltimetype t);

/** @brief Returns the tzid, or NULL for a floating time. */
LIBICAL_ICAL_EXPORT const char *icaltime_get_tzid(const struct icaltimetype t);

/**     @brief Sets the timezone.
 *
 *      Forces the icaltime to be interpreted relative to another timezone.
 *      The returned time represents the same time as @p t, but relative to
 *      the new @p zone.
 *      For example, modifying July 20 1969, 8:17 PM UTC to the EDT time zone
 *      would return a time representing July 20 1969, 8:17 PM EDT.
 *
 *      If you need to do timezone conversion, applying offset adjustments,
 *      then you should use icaltime_convert_to_zstruct icaltimetype &v);

    /* ACTION */
    enum icalproperty_action get_action() const;
    void set_action(const enum icalproperty_action &v);

private:
    icalvalue *imp;
};

} // namespace LibICal

typedef ICPointerHolder < LibICal::ICalValue > ICalValueTmpPtr;

#endif
/*======================================================================
 FILE: icalmessage.h
 CREATOR: eric 07 Nov 2000

 (C) COPYRIGHT 2000, Eric Busboom <eric@civicknowledge.com>

 This library 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: https://www.gnu.org/licenses/lgpl-2.1.html

 Or:

    The Mozilla Public License Version 2.0. You may obtain a copy of
    the License at https://www.mozilla.org/MPL/
 =========================================================================*/

#ifndef ICALMESSAGE_H
#define ICALMESSAGE_H

#include "libical_icalss_export.h"
#include "icalcomponent.h"

LIBICAL_ICALSS_EXPnent_get_sequence	(ICalComponent *comp);

LIBICAL_ICAL_EXPORT
void		i_cal_component_set_status	(ICalComponent *comp,
						 ICalPropertyStatus status);

LIBICAL_ICAL_EXPORT
ICalPropertyStatus 
		i_cal_component_get_status	(ICalComponent *comp);

LIBICAL_ICAL_EXPORT
void		i_cal_component_foreach_tzid	(ICalComponent *comp,
						 ICalComponentForeachTZIDFunc callback,
						 gpointer user_data);

LIBICAL_ICAL_EXPORT
void		i_cal_component_foreach_recurrence
						(ICalComponent *comp,
						 ICalTime *start,
						 ICalTime *end,
						 ICalComponentForeachRecurrenceFunc callback,
						 gpointer user_data);

LIBICAL_ICAL_EXPORT
ICalTimezone *	i_cal_component_get_timezone	(ICalComponent *comp,
						 const gchar *tzid);

LIBICAL_ICAL_EXPORT
gboolean 	i_cal_property_recurrence_is_excluded
						(ICalComponent *comp,
						 ICalTime *dtstart,
						 ICalTime *recurtime);

LIBICAL_ICAL_EXPORT
ICalComponent *	i_cal_component_new_vcalendar	(void);

LIBICAL_ICAL_EXPORT
ICalComponent *	i_cal_component_new_vevent	(void)L_TYPE_COMPONENT))

/**
 * ICalComponent:
 *
 * This is the ICalComponent instance.
 */

/**
 * ICalComponentClass:
 *
 * This is the ICalComponent class.
 */
typedef struct _ICalComponentClass ICalComponentClass;

struct _ICalComponent {
    /*< private >*/
    ICalObject parent;
};

struct _ICalComponentClass {
    /*< private >*/
    ICalObjectClass parent;
};
typedef void (*ICalComponentForeachTZIDFunc)(ICalParameter *param, gpointer user_data);
typedef void (*ICalComponentForeachRecurrenceFunc)(ICalComponent *comp, ICalTimeSpan *span, gpointer user_data);

LIBICAL_ICAL_EXPORT
GType 		i_cal_component_get_type	(void);

LIBICAL_ICAL_EXPORT
ICalComponent *	i_cal_component_new		(ICalComponentKind kind);

LIBICAL_ICAL_EXPORT
ICalComponent *	i_cal_component_clone		(ICalComponent *component);

LIBICAL_ICAL_EXPORT
ICalComponent *	i_cal_component_new_from_string	(const gchar *str);

LIBICAL_ICAL_EXPORT
ICalComponent *	i_cal_component_new_x		(const gchar *x_name);

LIBICAL_ICAL_EXPORT
void		i_cal_component_free		(IalTime *timetype);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_time_new_null_time	(void);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_time_new_null_date	(void);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_time_new_current_with_zone
						(ICalTimezone *zone);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_time_new_today		(void);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_time_new_from_timet_with_zone
						(const time_t v,
						 gint is_date,
						 ICalTimezone *zone);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_time_new_from_string	(const gchar *str);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_time_new_from_day_of_year	(const gint day,
						 const gint year);

LIBICAL_ICAL_EXPORT
time_t 		i_cal_time_as_timet		(const ICalTime *tt);

LIBICAL_ICAL_EXPORT
time_t 		i_cal_time_as_timet_with_zone	(const ICalTime *tt,
						 const ICalTimezone *zone);

LIBICAL_ICAL_EXPORT
gchar *		i_cal_time_as_ical_string	(const ICalTime *tt);

LIBICAL_ICAL_EXPORT
ICalTimezone *	i_cal_time_get_timezone		(const ICalTime *tt);

LIBICAL_ICAL_EXPORT
void		i_cal_time_set_timeLIBICAL_GLIB_COMPILATION)
#error "Only <libical-glib/libical-glib.h> can be included directly."
#endif

#ifndef I_CAL_RESTRICTION_H
#define I_CAL_RESTRICTION_H

#include <libical-glib/i-cal-forward-declarations.h>
#include <libical-glib/i-cal-object.h>

G_BEGIN_DECLS

typedef enum {
	I_CAL_RESTRICTION_NONE = ICAL_RESTRICTION_NONE,
	I_CAL_RESTRICTION_ZERO = ICAL_RESTRICTION_ZERO,
	I_CAL_RESTRICTION_ONE = ICAL_RESTRICTION_ONE,
	I_CAL_RESTRICTION_ZEROPLUS = ICAL_RESTRICTION_ZEROPLUS,
	I_CAL_RESTRICTION_ONEPLUS = ICAL_RESTRICTION_ONEPLUS,
	I_CAL_RESTRICTION_ZEROORONE = ICAL_RESTRICTION_ZEROORONE,
	I_CAL_RESTRICTION_ONEEXCLUSIVE = ICAL_RESTRICTION_ONEEXCLUSIVE,
	I_CAL_RESTRICTION_ONEMUTUAL = ICAL_RESTRICTION_ONEMUTUAL,
	I_CAL_RESTRICTION_UNKNOWN = ICAL_RESTRICTION_UNKNOWN
} ICalRestrictionKind;


LIBICAL_ICAL_EXPORT
gint 		i_cal_restriction_compare	(ICalRestrictionKind restr,
						 gint count);

LIBICAL_ICAL_EXPORT
gint 		i_cal_restriction_check		(ICalComponent *comp);

G_END_DECLS

#endif /* I_CAL_RESTRICTION_H ypedef enum {
	I_CAL_ANY_VALUE = ICAL_ANY_VALUE,
	I_CAL_ACTION_VALUE = ICAL_ACTION_VALUE,
	I_CAL_ATTACH_VALUE = ICAL_ATTACH_VALUE,
	I_CAL_BINARY_VALUE = ICAL_BINARY_VALUE,
	I_CAL_BOOLEAN_VALUE = ICAL_BOOLEAN_VALUE,
	I_CAL_BUSYTYPE_VALUE = ICAL_BUSYTYPE_VALUE,
	I_CAL_CALADDRESS_VALUE = ICAL_CALADDRESS_VALUE,
	I_CAL_CARLEVEL_VALUE = ICAL_CARLEVEL_VALUE,
	I_CAL_CLASS_VALUE = ICAL_CLASS_VALUE,
	I_CAL_CMD_VALUE = ICAL_CMD_VALUE,
	I_CAL_DATE_VALUE = ICAL_DATE_VALUE,
	I_CAL_DATETIME_VALUE = ICAL_DATETIME_VALUE,
	I_CAL_DATETIMEDATE_VALUE = ICAL_DATETIMEDATE_VALUE,
	I_CAL_DATETIMEPERIOD_VALUE = ICAL_DATETIMEPERIOD_VALUE,
	I_CAL_DURATION_VALUE = ICAL_DURATION_VALUE,
	I_CAL_FLOAT_VALUE = ICAL_FLOAT_VALUE,
	I_CAL_GEO_VALUE = ICAL_GEO_VALUE,
	I_CAL_INTEGER_VALUE = ICAL_INTEGER_VALUE,
	I_CAL_METHOD_VALUE = ICAL_METHOD_VALUE,
	I_CAL_PERIOD_VALUE = ICAL_PERIOD_VALUE,
	I_CAL_POLLCOMPLETION_VALUE = ICAL_POLLCOMPLETION_VALUE,
	I_CAL_POLLMODE_VALUE = ICAL_POLLMODE_VALUE,
	I_CAL_QUERY_VALUE = ICAL_QUERY_VALUE,
	I_CAL_QUERYLEVEL_Vminutes	(ICalDuration *duration);

LIBICAL_ICAL_EXPORT
void		i_cal_duration_set_minutes	(ICalDuration *duration,
						 guint minutes);

LIBICAL_ICAL_EXPORT
guint 		i_cal_duration_get_seconds	(ICalDuration *duration);

LIBICAL_ICAL_EXPORT
void		i_cal_duration_set_seconds	(ICalDuration *duration,
						 guint seconds);

LIBICAL_ICAL_EXPORT
ICalDuration *	i_cal_duration_new_from_int	(gint t);

LIBICAL_ICAL_EXPORT
ICalDuration *	i_cal_duration_new_from_string	(const gchar *str);

LIBICAL_ICAL_EXPORT
gint 		i_cal_duration_as_int		(ICalDuration *duration);

LIBICAL_ICAL_EXPORT
gchar *		i_cal_duration_as_ical_string	(ICalDuration *duration);

LIBICAL_ICAL_EXPORT
ICalDuration *	i_cal_duration_new_null_duration
						(void);

LIBICAL_ICAL_EXPORT
ICalDuration *	i_cal_duration_new_bad_duration	(void);

LIBICAL_ICAL_EXPORT
gboolean 	i_cal_duration_is_null_duration	(ICalDuration *duration);

LIBICAL_ICAL_EXPORT
gboolean 	i_cal_duration_is_bad_duration	(ICalDuration *duration);

G_END_DECLS

#endif /* I_CAL_DURATION_H */
LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_xlicclass	(ICalPropertyXlicclass v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_xlicclass	(ICalProperty *prop,
						 ICalPropertyXlicclass v);

LIBICAL_ICAL_EXPORT
ICalPropertyXlicclass 
		i_cal_property_get_xlicclass	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_xlicclustercount
						(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_xlicclustercount
						(ICalProperty *prop,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_property_get_xlicclustercount
						(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_xlicerror	(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_xlicerror	(ICalProperty *prop,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_property_get_xlicerror	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_xlicmimecharset
						(const gchar *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_xlicmihar *	i_cal_property_get_permission	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_pollcompletion
						(ICalPropertyPollcompletion v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_pollcompletion
						(ICalProperty *prop,
						 ICalPropertyPollcompletion v);

LIBICAL_ICAL_EXPORT
ICalPropertyPollcompletion 
		i_cal_property_get_pollcompletion
						(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_pollitemid	(gint v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_pollitemid	(ICalProperty *prop,
						 gint v);

LIBICAL_ICAL_EXPORT
gint 		i_cal_property_get_pollitemid	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_pollmode	(ICalPropertyPollmode v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_pollmode	(ICalProperty *prop,
						 ICalPropertyPollmode v);

LIBICAL_ICAL_EXPORT
ICalPropertyPollmode 
		i_cal_property_get_pollmode	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_pollproperties
						_cal_property_get_duration	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_estimatedduration
						(ICalDuration *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_estimatedduration
						(ICalProperty *prop,
						 ICalDuration *v);

LIBICAL_ICAL_EXPORT
ICalDuration *	i_cal_property_get_estimatedduration
						(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_exdate	(ICalTime *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_exdate	(ICalProperty *prop,
						 ICalTime *v);

LIBICAL_ICAL_EXPORT
ICalTime *	i_cal_property_get_exdate	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_expand	(gint v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_expand	(ICalProperty *prop,
						 gint v);

LIBICAL_ICAL_EXPORT
gint 		i_cal_property_get_expand	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_property_new_exrule	(ICalRecurrence *v);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_exrule	(ICalProperty *prop,
						 ICalReCUREXPAND_PROPERTY,
	I_CAL_RECURLIMIT_PROPERTY = ICAL_RECURLIMIT_PROPERTY,
	I_CAL_RECURRENCEID_PROPERTY = ICAL_RECURRENCEID_PROPERTY,
	I_CAL_RELATEDTO_PROPERTY = ICAL_RELATEDTO_PROPERTY,
	I_CAL_RELCALID_PROPERTY = ICAL_RELCALID_PROPERTY,
	I_CAL_REPEAT_PROPERTY = ICAL_REPEAT_PROPERTY,
	I_CAL_REPLYURL_PROPERTY = ICAL_REPLYURL_PROPERTY,
	I_CAL_REQUESTSTATUS_PROPERTY = ICAL_REQUESTSTATUS_PROPERTY,
	I_CAL_RESOURCES_PROPERTY = ICAL_RESOURCES_PROPERTY,
	I_CAL_RESPONSE_PROPERTY = ICAL_RESPONSE_PROPERTY,
	I_CAL_RESTRICTION_PROPERTY = ICAL_RESTRICTION_PROPERTY,
	I_CAL_RRULE_PROPERTY = ICAL_RRULE_PROPERTY,
	I_CAL_SCOPE_PROPERTY = ICAL_SCOPE_PROPERTY,
	I_CAL_SEQUENCE_PROPERTY = ICAL_SEQUENCE_PROPERTY,
	I_CAL_STATUS_PROPERTY = ICAL_STATUS_PROPERTY,
	I_CAL_STORESEXPANDED_PROPERTY = ICAL_STORESEXPANDED_PROPERTY,
	I_CAL_SUMMARY_PROPERTY = ICAL_SUMMARY_PROPERTY,
	I_CAL_TARGET_PROPERTY = ICAL_TARGET_PROPERTY,
	I_CAL_TASKMODE_PROPERTY = ICAL_TASKMODE_PROPERTY,
	I_CAL_TRANSP_PROPERTY = ICAL_TRANSP_PROPERTY,
	I_CAL_TRIGGER_PROPERYPE_CHECK_INSTANCE_TYPE \
    ((obj), I_CAL_TYPE_TIME_SPAN))

#define I_CAL_IS_TIME_SPAN_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_TYPE \
    ((klass), I_CAL_TYPE_TIME_SPAN))

/**
 * ICalTimeSpan:
 *
 * This is the ICalTimeSpan instance.
 */

/**
 * ICalTimeSpanClass:
 *
 * This is the ICalTimeSpan class.
 */
typedef struct _ICalTimeSpanClass ICalTimeSpanClass;

struct _ICalTimeSpan {
    /*< private >*/
    ICalObject parent;
};

struct _ICalTimeSpanClass {
    /*< private >*/
    ICalObjectClass parent;
};

LIBICAL_ICAL_EXPORT
GType 		i_cal_time_span_get_type	(void);

LIBICAL_ICAL_EXPORT
ICalTimeSpan *	i_cal_time_span_new_timet	(time_t start,
						 time_t end,
						 gboolean is_busy);

LIBICAL_ICAL_EXPORT
ICalTimeSpan *	i_cal_time_span_clone		(const ICalTimeSpan *src);

LIBICAL_ICAL_EXPORT
time_t 		i_cal_time_span_get_start	(ICalTimeSpan *timespan);

LIBICAL_ICAL_EXPORT
void		i_cal_time_span_set_start	(ICalTimeSpan *timespan,
						 time_t start);

LIBICAL_ICAL_EXPORT
time_t 		i_cal_time_span_get_end		(ICalTet_related	(ICalParameter *value,
						 ICalParameterRelated v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_reltype	(ICalParameterReltype v);

LIBICAL_ICAL_EXPORT
ICalParameterReltype 
		i_cal_parameter_get_reltype	(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_reltype	(ICalParameter *value,
						 ICalParameterReltype v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_required	(ICalParameterRequired v);

LIBICAL_ICAL_EXPORT
ICalParameterRequired 
		i_cal_parameter_get_required	(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_required	(ICalParameter *value,
						 ICalParameterRequired v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_response	(gint v);

LIBICAL_ICAL_EXPORT
gint 		i_cal_parameter_get_response	(const ICalParameter *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_response	(ICalParameter *value,
						 gint v);

LIBICAL_ICAL_EXPORT
ICalParameter *	i_cal_parameter_new_role	(ICalParameterRole v);

ER = ICAL_STAYINFORMED_PARAMETER,
	I_CAL_SUBSTATE_PARAMETER = ICAL_SUBSTATE_PARAMETER,
	I_CAL_TZID_PARAMETER = ICAL_TZID_PARAMETER,
	I_CAL_VALUE_PARAMETER = ICAL_VALUE_PARAMETER,
	I_CAL_X_PARAMETER = ICAL_X_PARAMETER,
	I_CAL_XLICCOMPARETYPE_PARAMETER = ICAL_XLICCOMPARETYPE_PARAMETER,
	I_CAL_XLICERRORTYPE_PARAMETER = ICAL_XLICERRORTYPE_PARAMETER,
	I_CAL_NO_PARAMETER = ICAL_NO_PARAMETER
} ICalParameterKind;

typedef enum {
	I_CAL_ACTIONPARAM_X = ICAL_ACTIONPARAM_X,
	I_CAL_ACTIONPARAM_ASK = ICAL_ACTIONPARAM_ASK,
	I_CAL_ACTIONPARAM_ABORT = ICAL_ACTIONPARAM_ABORT,
	I_CAL_ACTIONPARAM_NONE = ICAL_ACTIONPARAM_NONE
} ICalParameterAction;

typedef enum {
	I_CAL_CUTYPE_X = ICAL_CUTYPE_X,
	I_CAL_CUTYPE_INDIVIDUAL = ICAL_CUTYPE_INDIVIDUAL,
	I_CAL_CUTYPE_GROUP = ICAL_CUTYPE_GROUP,
	I_CAL_CUTYPE_RESOURCE = ICAL_CUTYPE_RESOURCE,
	I_CAL_CUTYPE_ROOM = ICAL_CUTYPE_ROOM,
	I_CAL_CUTYPE_UNKNOWN = ICAL_CUTYPE_UNKNOWN,
	I_CAL_CUTYPE_NONE = ICAL_CUTYPE_NONE
} ICalParameterCutype;

typedef enum {
	I_CAL_DISPLAY_X = ICAL_DISPLAY_X,
	I_CalValue *	i_cal_property_get_value	(const ICalProperty *prop);

LIBICAL_ICAL_EXPORT
gchar *		i_cal_property_get_value_as_string
						(const ICalProperty *prop);

LIBICAL_ICAL_EXPORT
void		i_cal_value_set_parent		(ICalValue *value,
						 ICalProperty *property);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_value_get_parent		(ICalValue *value);

LIBICAL_ICAL_EXPORT
void		i_cal_parameter_set_parent	(ICalParameter *param,
						 ICalProperty *property);

LIBICAL_ICAL_EXPORT
ICalProperty *	i_cal_parameter_get_parent	(ICalParameter *param);

LIBICAL_ICAL_EXPORT
void		i_cal_property_set_x_name	(ICalProperty *prop,
						 const gchar *name);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_property_get_x_name	(ICalProperty *prop);

LIBICAL_ICAL_EXPORT
gchar *		i_cal_property_get_property_name
						(const ICalProperty *prop);

LIBICAL_ICAL_EXPORT
ICalValueKind 	i_cal_parameter_value_to_value_kind
						(ICalParameterValue value);

LIBICAL_ICAL_EXPORT
ICalValueKind 	i_cal_property_kind_to_value_kind
						(ICalPropertyKind kiuct _ICalObjectPrivate ICalObjectPrivate;

struct _ICalObject
{
    /*< private > */
    GObject parent;
    ICalObjectPrivate *priv;
};

struct _ICalObjectClass
{
    /*< private > */
    GObjectClass parent_class;
};

LIBICAL_ICAL_EXPORT GType i_cal_object_get_type(void);

LIBICAL_ICAL_EXPORT gpointer i_cal_object_construct(GType object_type,
                                                    gpointer native,
                                                    GDestroyNotify native_destroy_func,
                                                    gboolean is_global_memory, GObject *owner);

LIBICAL_ICAL_EXPORT gpointer i_cal_object_get_native(ICalObject *iobject);

LIBICAL_ICAL_EXPORT gpointer i_cal_object_steal_native(ICalObject *iobject);

LIBICAL_ICAL_EXPORT gboolean i_cal_object_get_is_global_memory(ICalObject *iobject);

LIBICAL_ICAL_EXPORT GDestroyNotify i_cal_object_get_native_destroy_func(ICalObject *iobject);

LIBICAL_ICAL_EXPORT void i_cal_object_set_native_destroy_func(ICalObject *iobject,
     nstance.
 */

/**
 * ICalParserClass:
 *
 * This is the ICalParser class.
 */
typedef struct _ICalParserClass ICalParserClass;

struct _ICalParser {
    /*< private >*/
    ICalObject parent;
};

struct _ICalParserClass {
    /*< private >*/
    ICalObjectClass parent;
};
/**
 * ICalParserLineGenFunc:
 * @bytes: (array length=size) (element-type gchar): the bytes to process
 * @size: the length of the bytes array
 * @user_data: the user data
 *
 * Returns: One content line per invocation
 */
typedef gchar *(*ICalParserLineGenFunc)(gchar *bytes, size_t size, gpointer user_data);
typedef enum {
	I_CAL_PARSER_ERROR = ICALPARSER_ERROR,
	I_CAL_PARSER_SUCCESS = ICALPARSER_SUCCESS,
	I_CAL_PARSER_BEGIN_COMP = ICALPARSER_BEGIN_COMP,
	I_CAL_PARSER_END_COMP = ICALPARSER_END_COMP,
	I_CAL_PARSER_IN_PROGRESS = ICALPARSER_IN_PROGRESS
} ICalParserState;


LIBICAL_ICAL_EXPORT
GType 		i_cal_parser_get_type		(void);

LIBICAL_ICAL_EXPORT
ICalParser *	i_cal_parser_new		(void);

LIBICAL_ICAL_EXPORT
ICalComponent *	i_cal_parser_add WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library. If not, see <https://www.gnu.org/licenses/>.
 */

#if !defined (__LIBICAL_GLIB_H_INSIDE__) && !defined (LIBICAL_GLIB_COMPILATION)
#error "Only <libical-glib/libical-glib.h> can be included directly."
#endif

#ifndef I_CAL_RECUR_ITERATOR_H
#define I_CAL_RECUR_ITERATOR_H

#include <libical-glib/i-cal-forward-declarations.h>
#include <libical-glib/i-cal-object.h>

G_BEGIN_DECLS

#define I_CAL_TYPE_RECUR_ITERATOR \
    (i_cal_recur_iterator_get_type ())

#define I_CAL_RECUR_ITERATOR(obj) \
    (G_TYPE_CHECK_INSTANCE_CAST \
    ((obj), I_CAL_TYPE_RECUR_ITERATOR, ICalRecurIterator))

#define I_CAL_RECUR_ITERATOR_CLASS(klass) \
    (G_TYPE_CHECK_CLASS_CAST \
    ((klass), I_CAL_TYPE_RECUR_ITERATOR, ICalRecurIteratorClass))

#define I_CAL_IS_RECUR_EXPORT
void		i_cal_parameter_set_iana_value	(ICalParameter *param,
						 const gchar *v);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_parameter_get_iana_value	(ICalParameter *param);

LIBICAL_ICAL_EXPORT
gint 		i_cal_parameter_has_same_name	(ICalParameter *param1,
						 ICalParameter *param2);

LIBICAL_ICAL_EXPORT
const gchar *	i_cal_parameter_kind_to_string	(ICalParameterKind kind);

LIBICAL_ICAL_EXPORT
ICalParameterKind 
		i_cal_parameter_kind_from_string
						(const gchar *string);

LIBICAL_ICAL_EXPORT
gboolean 	i_cal_parameter_kind_is_valid	(const ICalParameterKind kind);

G_END_DECLS

#endif /* I_CAL_PARAMETER_H */
/* Generated file (by generator) */

/*
 * Copyright (C) 2015 William Yu <williamyu@gnome.org>
 *
 * This library is free software: you can redistribute it and/or modify it
 * under the terms of version 2.1. of the GNU Lesser General Publ