$darkmode
Implements the data structure for iCalendar attachments. More...
Go to the source code of this file.
Functions | |
| unsigned char * | icalattach_get_data (icalattach *attach) |
| Returns the data of the icalattach object. More... | |
| bool | icalattach_get_is_url (const icalattach *attach) |
| Determines if attach is an URL. More... | |
| const char * | icalattach_get_url (icalattach *attach) |
| Returns the URL of the icalattach object. More... | |
| icalattach * | icalattach_new_from_data (const char *data, icalattach_free_fn_t free_fn, void *free_fn_data) |
| Creates new icalattach object from data. More... | |
| icalattach * | icalattach_new_from_url (const char *url) |
| Creates new icalattach object from a URL. More... | |
| void | icalattach_ref (icalattach *attach) |
| Increments reference count of the icalattach. More... | |
| void | icalattach_unref (icalattach *attach) |
| Decrements reference count of the icalattach. More... | |
Implements the data structure for iCalendar attachments.
Definition in file icalattach.c.
| unsigned char* icalattach_get_data | ( | icalattach * | attach | ) |
Returns the data of the icalattach object.
| attach | The object from which to return the data |
Returns the URL of the icalattach object.
NULL and set icalerrno to ICAL_BADARG_ERROR if attach is NULL. Undefined behaviour if the object is a URL (check with icalattach_get_is_url()).Definition at line 130 of file icalattach.c.
| bool icalattach_get_is_url | ( | const icalattach * | attach | ) |
Determines if attach is an URL.
| attach | the icalattach object to check |
Errors if attach is NULL.
```c // creates new icalattach *attach = icalattach_new_from_url("http://example.com");
// checks if it is a URL assert(icalattach_get_is_url(attach));
// release it icalattach_unref(attach);
Definition at line 115 of file icalattach.c.
| const char* icalattach_get_url | ( | icalattach * | attach | ) |
Returns the URL of the icalattach object.
| attach | The object from which to return the URL |
Returns the URL of the icalattach object.
NULL and set icalerrno to ICAL_BADARG_ERROR if attach is NULL. Undefined behaviour if the object is not a URL (check with icalattach_get_is_url()).```c // creates new icalattach *attach = icalattach_new_from_url("http://example.com");
// checks it assert(icalattach_get_is_url(attach)); assert(0 == strcmp(icalattach_get_url(attach), "http://example.com"));
// release it icalattach_unref(attach);
Definition at line 122 of file icalattach.c.
| icalattach* icalattach_new_from_data | ( | const char * | data, |
| icalattach_free_fn_t | free_fn, | ||
| void * | free_fn_data | ||
| ) |
Creates new icalattach object from data.
| data | The data to create the icalattach from |
| free_fn | The function to free the data |
| free_fn_data | Data to pass to the free_fn |
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.Definition at line 56 of file icalattach.c.
| icalattach* icalattach_new_from_url | ( | const char * | url | ) |
Creates new icalattach object from a URL.
| url | The URL to create the object from |
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.```c // creates new icalattach *attach = icalattach_new_from_url("http://example.com");
// checks it assert(icalattach_get_is_url(attach)); assert(0 == strcmp(icalattach_get_url(attach), "http://example.com"));
// release it icalattach_unref(attach);
Definition at line 25 of file icalattach.c.
| void icalattach_ref | ( | icalattach * | attach | ) |
Increments reference count of the icalattach.
| attach | The object to increase the reference count of |
NULL, or the reference count is smaller than 0, it sets icalerrno to ICAL_BADARG_ERROR.Definition at line 87 of file icalattach.c.
| void icalattach_unref | ( | icalattach * | attach | ) |
Decrements reference count of the icalattach.
| attach | The object to decrease the reference count of |
Decreases the reference count of attach. If this was the last user of the object, it is freed.
NULL, or the reference count is smaller than 0, it sets icalerrno to ICAL_BADARG_ERROR.```c // creates new icalattach *attach = icalattach_new_from_url("http://example.com");
// release it icalattach_unref(attach);
Definition at line 95 of file icalattach.c.
1.8.10