#include "caldav-utils.h"#include "md5.h"#include <glib.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <unistd.h>Defines | |
| #define | MAX_TOKENS 2 |
| Find a specific HTTP header from last request. | |
| #define | ELEM_HREF "href>" |
| Fetch a URL from a XML element. | |
| #define | ELEM_ETAG "getetag" |
| Fetch the etag element from XML. | |
Functions | |
| void | dump (const char *text, FILE *stream, unsigned char *ptr, size_t size, char nohex) |
| This function is burrowed from the libcurl documentation. | |
| int | my_trace (CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userp) |
| This function is burrowed from the libcurl documentation. | |
| static void * | myrealloc (void *ptr, size_t size) |
| This function is burrowed from the libcurl documentation. | |
| size_t | WriteMemoryCallback (void *ptr, size_t size, size_t nmemb, void *data) |
| This function is burrowed from the libcurl documentation. | |
| size_t | WriteHeaderCallback (void *ptr, size_t size, size_t nmemb, void *data) |
| This function is burrowed from the libcurl documentation. | |
| void | init_caldav_settings (caldav_settings *settings) |
| Initialize caldav settings structure. | |
| void | free_caldav_settings (caldav_settings *settings) |
| Free momory assigned to caldav settings structure. | |
| void | parse_url (caldav_settings *settings, const char *url) |
| Parse URL. | |
| gchar * | get_response_header (const char *header, gchar *headers, gboolean lowcase) |
| Find a specific HTTP header from last request. | |
| static gchar * | parse_caldav_report_wrap (char *report, const char *element, const char *type, gboolean wrap, gboolean recursive) |
| Parse response from CalDAV server. | |
| gchar * | parse_caldav_report (char *report, const char *element, const char *type) |
| Parse response from CalDAV server. | |
| gchar * | get_caldav_datetime (time_t *time) |
| Convert a time_t variable to CalDAV DateTime. | |
| gchar * | random_file_name (gchar *text) |
| Create a random text string, using MD5. | |
| gchar * | verify_uid (gchar *object) |
| Does the event contain a UID element or not. | |
| gchar * | get_url (gchar *text) |
| Fetch a URL from a XML element. | |
| gchar * | get_tag (const gchar *tag, gchar *text) |
| Fetch any element from XML. | |
| gchar * | get_etag (gchar *text) |
| Fetch the etag element from XML. | |
| gchar * | get_host (gchar *url) |
| Fetch host from URL. | |
Variables | |
| static const char * | VCAL_HEAD |
| static const char * | VCAL_FOOT = "END:VCALENDAR" |
| #define ELEM_ETAG "getetag" |
Fetch the etag element from XML.
| text | String |
| #define ELEM_HREF "href>" |
Fetch a URL from a XML element.
| text | String |
| #define MAX_TOKENS 2 |
Find a specific HTTP header from last request.
| header | HTTP header to search for | |
| headers | String of HTTP headers from last request | |
| lowcase | Should string be returned in all lower case. |
| void dump | ( | const char * | text, | |
| FILE * | stream, | |||
| unsigned char * | ptr, | |||
| size_t | size, | |||
| char | nohex | |||
| ) |
This function is burrowed from the libcurl documentation.
| text | ||
| stream | ||
| ptr | ||
| size | ||
| nohex |
| void free_caldav_settings | ( | caldav_settings * | settings | ) |
| gchar* get_caldav_datetime | ( | time_t * | time | ) |
Convert a time_t variable to CalDAV DateTime.
| time | a specific date and time |
| gchar* get_etag | ( | gchar * | text | ) |
Fetch the etag element from XML.
| text | String |
| gchar* get_host | ( | gchar * | url | ) |
Fetch host from URL.
| url | URL |
| gchar* get_response_header | ( | const char * | header, | |
| gchar * | headers, | |||
| gboolean | lowcase | |||
| ) |
Find a specific HTTP header from last request.
| header | HTTP header to search for | |
| headers | String of HTTP headers from last request | |
| lowcase | Should string be returned in all lower case. |
| gchar* get_tag | ( | const gchar * | tag, | |
| gchar * | text | |||
| ) |
Fetch any element from XML.
| text | String | |
| tag | The element to look for |
| gchar* get_url | ( | gchar * | text | ) |
Fetch a URL from a XML element.
| text | String |
| void init_caldav_settings | ( | caldav_settings * | settings | ) |
| int my_trace | ( | CURL * | handle, | |
| curl_infotype | type, | |||
| unsigned char * | data, | |||
| size_t | size, | |||
| void * | userp | |||
| ) |
This function is burrowed from the libcurl documentation.
| handle | ||
| type | ||
| data | ||
| size | ||
| userp |
| static void* myrealloc | ( | void * | ptr, | |
| size_t | size | |||
| ) | [static] |
This function is burrowed from the libcurl documentation.
| ptr | ||
| size |
| gchar* parse_caldav_report | ( | char * | report, | |
| const char * | element, | |||
| const char * | type | |||
| ) |
Parse response from CalDAV server.
| report | Response from server | |
| element | XML element to find | |
| type | VCalendar element to find |
| static gchar* parse_caldav_report_wrap | ( | char * | report, | |
| const char * | element, | |||
| const char * | type, | |||
| gboolean | wrap, | |||
| gboolean | recursive | |||
| ) | [static] |
Parse response from CalDAV server.
Internal function.
| report | Response from server | |
| element | XML element to find | |
| type | VCalendar element to find | |
| wrap | Is this the final parsing or just a part | |
| recursive | Stop after first match or not |
| void parse_url | ( | caldav_settings * | settings, | |
| const char * | url | |||
| ) |
Parse URL.
| settings |
| url | String containing URL to collection |
| gchar* random_file_name | ( | gchar * | text | ) |
Create a random text string, using MD5.
| text | some text to randomize |
| gchar* verify_uid | ( | gchar * | object | ) |
Does the event contain a UID element or not.
If not add it.
| object | A specific event |
| size_t WriteHeaderCallback | ( | void * | ptr, | |
| size_t | size, | |||
| size_t | nmemb, | |||
| void * | data | |||
| ) |
This function is burrowed from the libcurl documentation.
| ptr | ||
| size | ||
| nmemb | ||
| data |
| size_t WriteMemoryCallback | ( | void * | ptr, | |
| size_t | size, | |||
| size_t | nmemb, | |||
| void * | data | |||
| ) |
This function is burrowed from the libcurl documentation.
| ptr | ||
| size | ||
| nmemb | ||
| data |
const char* VCAL_FOOT = "END:VCALENDAR" [static] |
const char* VCAL_HEAD [static] |
Initial value:
"BEGIN:VCALENDAR\r\n" "PRODID:-//CalDAV Calendar//NONSGML libcaldav//EN\r\n" "VERSION:2.0\r\n"
1.5.5