caldav.c File Reference

#include "caldav.h"
#include "caldav-utils.h"
#include "get-caldav-report.h"
#include "add-caldav-object.h"
#include "delete-caldav-object.h"
#include "modify-caldav-object.h"
#include "get-display-name.h"
#include "options-caldav-server.h"
#include <curl/curl.h>
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Typedefs

typedef struct debug_curl debug_options

Functions

static gboolean test_caldav_enabled (CURL *curl, gchar *url)
static gboolean make_caldav_call (caldav_settings *settings)
CALDAV_RESPONSE caldav_add_object (const char *object, const char *URL)
 Function for adding a new event.
CALDAV_RESPONSE caldav_delete_object (const char *object, const char *URL)
 Function for deleting an event.
CALDAV_RESPONSE caldav_modify_object (const char *object, const char *URL)
 Function for modifying an event.
CALDAV_RESPONSE caldav_get_object (response *result, time_t start, time_t end, const char *URL)
 Function for getting a collection of events determined by time range.
CALDAV_RESPONSE caldav_getall_object (response *result, const char *URL)
 Function for getting all events from the collection.
CALDAV_RESPONSE caldav_get_displayname (response *result, const char *URL)
 Function for getting the stored display name for the collection.
int caldav_enabled_resource (const char *URL)
 Function to test wether a calendar resource is CalDAV enabled or not.
void caldav_set_options (struct debug_curl curl_options)
 Function which supports sending various options inside the library.
caldav_errorcaldav_get_error (caldav_error *lib_error)
 Function to call in case of errors.
void caldav_free_error (caldav_error *lib_error)
 Function for freeing memory for a previous initialization of a caldav_error.
char ** caldav_get_server_options (const char *URL)
 Function to call to get a list of supported CalDAV options for a server.

Variables

static debug_options options = {1,0}
static caldav_error error

Typedef Documentation

typedef struct debug_curl debug_options


Function Documentation

CALDAV_RESPONSE caldav_add_object ( const char *  object,
const char *  URL 
)

Function for adding a new event.

Parameters:
object Appointment following ICal format (RFC2445). Receiver is responsible for freeing the memory.
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
Ok, FORBIDDEN, or CONFLICT.
See also:
CALDAV_RESPONSE

CALDAV_RESPONSE caldav_delete_object ( const char *  object,
const char *  URL 
)

Function for deleting an event.

Parameters:
object Appointment following ICal format (RFC2445). Receiver is responsible for freeing the memory.
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
Ok, FORBIDDEN, or CONFLICT.
See also:
CALDAV_RESPONSE

int caldav_enabled_resource ( const char *  URL  ) 

Function to test wether a calendar resource is CalDAV enabled or not.

Parameters:
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
0 (zero) means no CalDAV support, otherwise CalDAV support detechted.

void caldav_free_error ( caldav_error lib_error  ) 

Function for freeing memory for a previous initialization of a caldav_error.

See also:
caldav_get_error() Caller provides a pointer to a local caldav_error structure.
Parameters:
lib_error A pointer to a struct _caldav_error.
See also:
_caldav_error

CALDAV_RESPONSE caldav_get_displayname ( response result,
const char *  URL 
)

Function for getting the stored display name for the collection.

Parameters:
result A pointer to struct _response where the result is to stored.
See also:
response. Caller is responsible for freeing the memory.
Parameters:
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
Ok, FORBIDDEN, or CONFLICT.
See also:
CALDAV_RESPONSE

caldav_error* caldav_get_error ( caldav_error lib_error  ) 

Function to call in case of errors.

Caller provides a pointer to a local caldav_error structure. Caldav_get_error will initialize pointer if NULL. Caller is responsible for freeing returned memory. After the first call the internal error buffer is reset.

Parameters:
lib_error A pointer to a struct _caldav_error.
See also:
_caldav_error
Returns:
An initialized caldav_error pointer to memory where error messages can be found from the last call to the library.

CALDAV_RESPONSE caldav_get_object ( response result,
time_t  start,
time_t  end,
const char *  URL 
)

Function for getting a collection of events determined by time range.

Parameters:
result A pointer to struct _response where the result is to stored.
See also:
response. Caller is responsible for freeing the memory.
Parameters:
start time_t variable specifying start and end for range. Both are included in range.
end time_t variable specifying start and end for range. Both are included in range.
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
Ok, FORBIDDEN, or CONFLICT.
See also:
CALDAV_RESPONSE

char** caldav_get_server_options ( const char *  URL  ) 

Function to call to get a list of supported CalDAV options for a server.

Parameters:
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
A list of available options or NULL in case of any error.

CALDAV_RESPONSE caldav_getall_object ( response result,
const char *  URL 
)

Function for getting all events from the collection.

Parameters:
result A pointer to struct _response where the result is to stored.
See also:
response. Caller is responsible for freeing the memory.
Parameters:
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
Ok, FORBIDDEN, or CONFLICT.
See also:
CALDAV_RESPONSE

CALDAV_RESPONSE caldav_modify_object ( const char *  object,
const char *  URL 
)

Function for modifying an event.

Parameters:
object Appointment following ICal format (RFC2445). Receiver is responsible for freeing the memory.
URL Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username[:password]@]host[:port]/url-path. See (RFC1738).
Returns:
Ok, FORBIDDEN, or CONFLICT.
See also:
CALDAV_RESPONSE

void caldav_set_options ( struct debug_curl  curl_options  ) 

Function which supports sending various options inside the library.

Parameters:
curl_options A struct debug_curl. See debug_curl.

static gboolean make_caldav_call ( caldav_settings settings  )  [static]

static gboolean test_caldav_enabled ( CURL *  curl,
gchar *  url 
) [static]

Parameters:
curl An instance of libcurl.
url Defines CalDAV resource. Receiver is responsible for freeing the memory. [http://][username:password@]host[:port]/url-path. See (RFC1738).
Returns:
FALSE (zero) mens URL does not reference a CalDAV calendar resource. TRUE if the URL does reference a CalDAV calendar resource.


Variable Documentation

caldav_error error [static]

debug_options options = {1,0} [static]


Generated on Tue Apr 8 00:29:58 2008 for libcaldav-0.3.0 by  doxygen 1.5.5