CALDAV_PARSE(3)

NAME
ical_parse - parse a CalDAV file

LIBRARY
libkcaldav

SYNOPSIS
#include <libkcaldav.h>
struct caldav *
caldav_parse(const, char, *file, const, char, *cp, size_t, len, char, **er);

DESCRIPTION
Parse an CalDAV file given in cp, which may not be NULL, of length sz. If file is not NULL, it is used for reporting errors only. The er, if not NULL, is filled in with an error message on parse failure.

The parsed CalDAV file must be freed with caldav_free(3). If errors occur and er is set, the error string must be freed with free(3).

The returned struct caldav structure has the following members:

enum calreqtype type
    Type of CalDAV request.

struct calprop *props
    Array of properties passed in the request. This is NULL if the request has no properties.

size_t propsz
    The number of properties in props.

char **hrefs
    Any URLs passed in with the request or NULL if not having an URLs. These are interpreted depending upon the request.

size_t hrefsz
    The number of elements in hrefs.
The calendar properties are encoded in struct calprop:

enum calproptype key
    The property type or CALPROP__MAX if unknown.

char *name
    The property name (without its XML namespace).

char *xmlns
    The property XML namespace.

char *val
    The value of the property or NULL if it has none.

int valid
    Validity of property: if -1, invalid; if zero, not valid; if 1, valid.

RETURN VALUES
Returns the parse object on success. It must be freed with caldav_free(3). On failure, returns NULL.

The er pointer, if not NULL, is provided an error message. If the error message is NULL, memory allocation has failed.

SEE ALSO
caldav_free(3)

STANDARDS
The CalDAV and underlying WebDAV formats are specified in RFC 4918 (WebDAV), RFC 4791 (CalDAV), caldav-ctag-02 (CalDAV ctags), RFC 3744 (the ACL component), RFC 5397 (current principal address), and RFC 4331 (file-system quota).