caldav.h File Reference

interface to the caldav library. More...

#include <time.h>

Data Structures

struct  debug_curl
 A struct used to set internal options in the library. More...
struct  _caldav_error
 A struct for storing error codes and messages. More...
struct  _response
 A struct used for returning messages from the library to users. More...

Typedefs

typedef struct _caldav_error caldav_error
 Pointer to a caldav_error structure.
typedef struct _response response
 Pointer to a _response structure.

Enumerations

enum  CALDAV_ACTION {
  UNKNOWN, ADD, DELETE, MODIFY,
  GET, GETALL, GETCALNAME, ISCALDAV,
  OPTIONS
}
 specifies supported CalDAV actions. More...
enum  CALDAV_RESPONSE { OK, FORBIDDEN, CONFLICT, LOCKED }
 specifies CalDAV error states. More...

Functions

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.
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.
void caldav_set_options (struct debug_curl curl_options)
 Function which supports sending various options inside the library.
char ** caldav_get_server_options (const char *URL)
 Function to call to get a list of supported CalDAV options for a server.


Detailed Description

interface to the caldav library.

The library conforms to RFC4791. For further information follow this link http://www.ietf.org/rfc/rfc4791.txt


Typedef Documentation

Pointer to a caldav_error structure.

Pointer to a _response structure.


Enumeration Type Documentation

specifies supported CalDAV actions.

UNKNOWN. An unknown action. ADD. Add a CalDAV calendar object. DELETE. Delete a CalDAV calendar object. MODIFY. Modify a CalDAV calendar object. GET. Get one or more CalDAV calendar object(s). GETALL. Get all CalDAV calendar objects.

Enumerator:
UNKNOWN 
ADD 
DELETE 
MODIFY 
GET 
GETALL 
GETCALNAME 
ISCALDAV 
OPTIONS 

specifies CalDAV error states.

OK (HTTP 200). Request was satisfied. FORBIDDEN (HTTP 403). Access not allowed. Dont repeat request. CONFLICT (HTTP 409). Conflict between current state of CalDAV collection and request. Client must solve the conflict and then resend request. LOCKED (HTTP 423). Locking failed.

Enumerator:
OK 
FORBIDDEN 
CONFLICT 
LOCKED 


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 for range. Included in search.
end time_t variable specifying end for range. Included in search.
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
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.


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