$darkmode
Defines the data structure representing vCard parameters. More...
Go to the source code of this file.
Functions | |
| void | vcardparameter_add_value_from_string (vcardparameter *param, const char *val) |
| char * | vcardparameter_as_vcard_string (vcardparameter *parameter) |
| Converts vcardparameter into a string representation. More... | |
| char * | vcardparameter_as_vcard_string_r (vcardparameter *parameter) |
| Converts vcardparameter into an string representation according to RFC5445/RFC6868. More... | |
| vcardparameter * | vcardparameter_clone (const vcardparameter *old) |
| Creates new vcardparameter as a clone of the given one. More... | |
| void | vcardparameter_free (vcardparameter *parameter) |
| Frees an vcardparameter object. More... | |
| const char * | vcardparameter_get_iana_name (const vcardparameter *param) |
| Returns the IANA name of param. More... | |
| const char * | vcardparameter_get_iana_value (const vcardparameter *param) |
| Returns the IANA value of param. More... | |
| const char * | vcardparameter_get_xname (const vcardparameter *param) |
| Returns the X-name of param. More... | |
| const char * | vcardparameter_get_xvalue (const vcardparameter *param) |
| Returns the X-value of param. More... | |
| bool | vcardparameter_has_same_name (const vcardparameter *param1, const vcardparameter *param2) |
| Determines if two parameters have the same name. More... | |
| bool | vcardparameter_is_multivalued (const vcardparameter *param) |
| bool | vcardparameter_is_structured (const vcardparameter *param) |
| vcardparameter_kind | vcardparameter_isa (const vcardparameter *parameter) |
| bool | vcardparameter_isa_parameter (void *param) |
| bool | vcardparameter_kind_is_valid (const vcardparameter_kind kind) |
| Checks the validity of a vcardparameter_kind. More... | |
| const char * | vcardparameter_kind_to_string (vcardparameter_kind kind) |
| Returns a string representing the given vcardparameter_kind. More... | |
| vcardvalue_kind | vcardparameter_kind_value_kind (const vcardparameter_kind kind, int *is_multivalued) |
| vcardparameter * | vcardparameter_new (vcardparameter_kind kind) |
| Creates new vcardparameter object. More... | |
| vcardparameter * | vcardparameter_new_from_string (const char *str) |
| Creates new vcardparameter object from string. More... | |
| vcardparameter * | vcardparameter_new_from_value_string (vcardparameter_kind kind, const char *value) |
| Creates new vcardparameter of a given kind with a given value. More... | |
| void | vcardparameter_set_iana_name (vcardparameter *param, const char *v) |
| Sets the IANA name of param to v. More... | |
| void | vcardparameter_set_iana_value (vcardparameter *param, const char *v) |
| Sets the IANA value of param to v. More... | |
| void | vcardparameter_set_value_from_string (vcardparameter *param, const char *val) |
| void | vcardparameter_set_xname (vcardparameter *param, const char *v) |
| Sets the X-name of param to v. More... | |
| void | vcardparameter_set_xvalue (vcardparameter *param, const char *v) |
| Sets the X-value of param to v. More... | |
| vcardparameter_kind | vcardparameter_string_to_kind (const char *string) |
| Returns the vcardparameter_kind for a given string. More... | |
Defines the data structure representing vCard parameters.
Definition in file vcardparameter.h.
| char* vcardparameter_as_vcard_string | ( | vcardparameter * | parameter | ) |
Converts vcardparameter into a string representation.
| parameter | The vcardparameter to convert |
NULL. Furthermore, if parameter is NULL, it also sets icalerrno to ICAL_BADARG_ERROR. If it doesn't recognize the kind of the parameter, it sets icalerrno it ICAL_BADARG_ERROR. If the parameter is otherwise malformed, it sets icalerrno to ICAL_MALFORMEDDATA_ERROR.```c vcardparameter *param = vcardparameter_new_from_string("ROLE=CHAIR");
if(param) { printf("%s\n", vcardparameter_as_ical_string(param)); }
vcardparameter_free(param);
Definition at line 173 of file vcardparameter.c.
| char* vcardparameter_as_vcard_string_r | ( | vcardparameter * | parameter | ) |
Converts vcardparameter into an string representation according to RFC5445/RFC6868.
| parameter | The vcardparameter to convert |
NULL. Furthermore, if parameter is NULL, it also sets icalerrno to ICAL_BADARG_ERROR. If it doesn't recognize the kind of the parameter, it sets icalerrno to ICAL_BADARG_ERROR. If the parameter is otherwise malformed, it sets icalerrno to ICAL_MALFORMEDDATA_ERROR.icalmemory_free_buffer()d after use. A version of this function which returns strings that do not need to be freed manually is vcardparameter_as_ical_string().```c vcardparameter *param = vcardparameter_new_from_string("ROLE=CHAIR");
if(param) { char *str = vcardparameter_as_ical_string(param); printf("%s\n", str); icalmemory_free_buffer(str); }
vcardparameter_free(param);
Definition at line 191 of file vcardparameter.c.
| vcardparameter* vcardparameter_clone | ( | const vcardparameter * | old | ) |
Creates new vcardparameter as a clone of the given one.
| old | The existing, non-NULL parameter to clone. |
NULL, it returns NULL and sets icalerrno to ICAL_BADARG_ERROR. If there was an internal error cloning the data, it returns NULL without reporting any error in icalerrno.```x // create an vcardparameter vcardparameter *param = vcardparameter_new_from_string("ROLE=CHAIR");
// clone the parameter vcardparameter *clone = vcardparameter_clone(param);
if(clone) { // use clone ... }
// release parameters vcardparameter_free(param); vcardparameter_free(clone);
Definition at line 80 of file vcardparameter.c.
| void vcardparameter_free | ( | vcardparameter * | parameter | ) |
Frees an vcardparameter object.
| parameter | The vcardparameter to free |
This method needs to be used on all parameter objects returned from any of the _new() methods including vcardparameter_new(), vcardparameter_new_from_string() and vcardparameter_new_from_value_string() and on cloned parameter objects returned by vcardparameter_clone() when these object are not needed anymore and to be released.
```c vcardparameter *param = vcardparameter_new();
if(param) { // use param... }
// after use, release it vcardparameter_free(param);
Definition at line 51 of file vcardparameter.c.
| const char* vcardparameter_get_iana_name | ( | const vcardparameter * | param | ) |
Returns the IANA name of param.
| param | The vcardparameter whose IANA name is to be returned |
NULL and sets icalerrno to ICAL_BADARG_ERROR when a NULL is passed instead of an vcardparameter.```c // creates new parameter vcardparameter *param = vcardparameter_new();
// sets iana name vcardparameter_set_iana_name(param, "X-TEST");
// compare iana name assert(0 == strcmp(vcardparameter_get_iana_name(param), "X-TEST"));
vcardparameter_free(param);
Definition at line 373 of file vcardparameter.c.
| const char* vcardparameter_get_iana_value | ( | const vcardparameter * | param | ) |
Returns the IANA value of param.
| param | The vcardparameter whose value is to be returned |
NULL and sets icalerrno to ICAL_BADARG_ERROR when a NULL is passed instead of an vcardparameter.```c // create new parameter vcardparameter *param = vcardparameter_new_from_string("ROLE=ATTENDEE");
// set role to chair vcardparameter_set_iana_value(param, "CHAIR");
// check that it worked assert(0 == strcmp(vcardparameter_get_iana_value(param), "SUCCESS"));
// release memory vcardparameter_free(param);
Definition at line 363 of file vcardparameter.c.
| const char* vcardparameter_get_xname | ( | const vcardparameter * | param | ) |
Returns the X-name of param.
| param | The vcardparameter whose X-name is to be returned |
NULL and sets icalerrno to ICAL_BADARG_ERROR when a NULL is passed instead of an vcardparameter.```c // creates new parameter vcardparameter *param = vcardparameter_new();
// sets xname vcardparameter_set_xname(param, "X-TEST");
// compare xname assert(0 == strcmp(vcardparameter_get_xname(param), "X-TEST"));
vcardparameter_free(param);
Definition at line 328 of file vcardparameter.c.
| const char* vcardparameter_get_xvalue | ( | const vcardparameter * | param | ) |
Returns the X-value of param.
| param | The vcardparameter whose X-value is to be returned |
NULL and sets icalerrno to ICAL_BADARG_ERROR when a NULL is passed instead of an vcardparameter.```c // create new parameter vcardparameter *param = vcardparameter_new_from_string("X-TEST=FAIL");
// set test to success vcardparameter_set_xvalue(param, "SUCCESS");
// check that it worked assert(0 == strcmp(vcardparameter_get_xvalue(param), "SUCCESS"));
// release memory vcardparameter_free(param);
Definition at line 351 of file vcardparameter.c.
| bool vcardparameter_has_same_name | ( | const vcardparameter * | param1, |
| const vcardparameter * | param2 | ||
| ) |
Determines if two parameters have the same name.
| param1 | First parameter to compare |
| param2 | Second parameter to compare |
NULL, it returns 0 and sets icalerrno to ICAL_BADARG_ERROR.```c // create two parameters vcardparameter *param1 = vcardparameter_new_from_string("ROLE=CHAIR"); vcardparameter *param2 = vcardparameter_new_from_string("EMAIL=mailto@example.com");
// compare parameter names for equality assert(vcardparameter_has_same_name(param1, param2) == 0);
// release memory vcardparameter_free(param1); vcardparameter_free(param2);
Definition at line 392 of file vcardparameter.c.
| vcardparameter_kind vcardparameter_isa | ( | const vcardparameter * | parameter | ) |
Returns the vcardparameter_kind of parameter.
| parameter | The vcardparameter whose kind to determine |
Error handling Returns ICAL_NO_PARAMETER when passed NULL.
Usage
Definition at line 292 of file vcardparameter.c.
| bool vcardparameter_isa_parameter | ( | void * | param | ) |
Determines if the given param is an vcardparameter
| param | The libical-originated object to check |
Error handling When given a NULL object, it returns 0.
Usage
```c // create parameter vcardparameter *param = vcardparameter_new_from_string("ROLE=CHAIR");
// check if it's a parameter assert(vcardparameter_isa_parameter(param));
// release memory vcardparameter_free(param);
Definition at line 301 of file vcardparameter.c.
| bool vcardparameter_kind_is_valid | ( | const vcardparameter_kind | kind | ) |
Checks the validity of a vcardparameter_kind.
| kind | The vcardparameter_kind |
| const char* vcardparameter_kind_to_string | ( | vcardparameter_kind | kind | ) |
Returns a string representing the given vcardparameter_kind.
| kind | The vcardparameter_kind |
NULL.| vcardparameter* vcardparameter_new | ( | vcardparameter_kind | kind | ) |
Creates new vcardparameter object.
| kind | The kind of vcardparameter to create. |
NULL and sets icalerrno to ICAL_NEWFAILED_ERROR.```c // create new parameter vcardparameter *parameter = vcardparameter_new();
if(parameter) { // use parameter ... }
// release parameter vcardparameter_free(parameter);
Definition at line 44 of file vcardparameter.c.
| vcardparameter* vcardparameter_new_from_string | ( | const char * | str | ) |
Creates new vcardparameter object from string.
| str | The string from which to create the vcardparameter, in the form "PARAMNAME=VALUE" |
NULL and sets icalerrno to ICAL_NEWFAILED_ERROR. If str was NULL, it returns NULL and sets icalerrno to ICAL_BADARG_ERROR. If str was malformed, it returns NULL and sets icalerrno to ICAL_MALFORMEDDATA_ERROR.```c vcardparameter *param = vcardparameter_new_from_string("ROLE=CHAIR");
if(param) { // use param ... }
vcardparameter_free(param);
Definition at line 124 of file vcardparameter.c.
| vcardparameter* vcardparameter_new_from_value_string | ( | vcardparameter_kind | kind, |
| const char * | value | ||
| ) |
Creates new vcardparameter of a given kind with a given value.
| kind | The kind of vcardparameter to create |
| value | The value of the parameter |
NULL, it returns NULL and sets icalerrno to ICAL_BADARG_ERROR.```c // create new parameter vcardparameter *param; param = vcardparameter_new_from_value_string(ICAL_ROLE_PARAMETER, "CHAIR");
// check parameter assert(0 == strcmp(vcardparameter_get_iana_name(param), "ROLE")); assert(0 == strcmp(vcardparameter_get_iana_value(param), "CHAIR"));
// release memory vcardparameter_free(param);
| void vcardparameter_set_iana_name | ( | vcardparameter * | param, |
| const char * | v | ||
| ) |
Sets the IANA name of param to v.
| param | The vcardparameter to change |
| v | The IANA name to set param to |
NULL, it sets :calerrno to ICAL_BARARG_ERROR. If there is an error acquiring memory, it sets errno to ENOMEM.```c // creates new parameter vcardparameter *param = vcardparameter_new();
// sets iana name vcardparameter_set_iana_name(param, "ROLE");
// compare iana name assert(0 == strcmp(vcardparameter_get_iana_name(param), "X-TEST"));
vcardparameter_free(param);
Definition at line 368 of file vcardparameter.c.
| void vcardparameter_set_iana_value | ( | vcardparameter * | param, |
| const char * | v | ||
| ) |
Sets the IANA value of param to v.
| param | The vcardparameter to change |
| v | The IANA value to set param to |
NULL, it sets icalerrno to ICAL_BARARG_ERROR. If there is an error acquiring memory, it sets errno to ENOMEM.```c // create new parameter vcardparameter *param = vcardparameter_new_from_string("ROLE=ATTENDEE");
// set role to chair vcardparameter_set_iana_value(param, "CHAIR");
// check that it worked assert(0 == strcmp(vcardparameter_get_iana_value(param), "SUCCESS"));
// release memory vcardparameter_free(param);
Definition at line 358 of file vcardparameter.c.
| void vcardparameter_set_xname | ( | vcardparameter * | param, |
| const char * | v | ||
| ) |
Sets the X-name of param to v.
| param | The vcardparameter to change |
| v | The X-name to set param to |
NULL, it sets icalerrno to ICAL_BARARG_ERROR. If there is an error acquiring memory, it sets errno to ENOMEM.```c // creates new parameter vcardparameter *param = vcardparameter_new();
// sets xname vcardparameter_set_xname(param, "X-TEST");
// compare xname assert(0 == strcmp(vcardparameter_get_xname(param), "X-TEST"));
vcardparameter_free(param);
Definition at line 312 of file vcardparameter.c.
| void vcardparameter_set_xvalue | ( | vcardparameter * | param, |
| const char * | v | ||
| ) |
Sets the X-value of param to v.
| param | The vcardparameter to change |
| v | The X-value to set param to |
NULL, it sets icalerrno to ICAL_BARARG_ERROR. If there is an error acquiring memory, it sets errno to ENOMEM.```c // create new parameter vcardparameter *param = vcardparameter_new_from_string("X-TEST=FAIL");
// set test to success vcardparameter_set_xvalue(param, "SUCCESS");
// check that it worked assert(0 == strcmp(vcardparameter_get_xvalue(param), "SUCCESS"));
// release memory vcardparameter_free(param);
Definition at line 335 of file vcardparameter.c.
| vcardparameter_kind vcardparameter_string_to_kind | ( | const char * | string | ) |
Returns the vcardparameter_kind for a given string.
| string | A string describing an vcardparameter_kind |
NULL. If it can't find the parameter, depending on the ical_get_unknown_token_handling_setting(), it returns either ICAL_NO_PARAMETER or ICAL_IANA_PARAMETER.
1.8.10