Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
vcardparser.h File Reference

Line-oriented parsing vCard format. More...

Go to the source code of this file.

Typedefs

typedef vcardvalue_kind(* vcard_xprop_value_kind_func) (const char *name, void *data)
 Callback function pointer to define x-property default value types.

Functions

const char * vcardparser_errstr (int err)
vcardcomponent * vcardparser_parse_string (const char *str)
void vcardparser_set_xprop_value_kind (vcard_xprop_value_kind_func func, void *data)
 Registers a parser callback to override the default value type of an x-property.

Detailed Description

Line-oriented parsing vCard format.

Definition in file vcardparser.h.

Typedef Documentation

◆ vcard_xprop_value_kind_func

typedef vcardvalue_kind(* vcard_xprop_value_kind_func) (const char *name, void *data)

Callback function pointer to define x-property default value types.

This typedef defines a pointer to a function that the vCard parser calls to determine the default value type of an x-property.

Parameters
nameThe name of the x-property currently parsed. This is the name as it appears in the vCard data except that it already is unfolded, e.g. it is not normalized to upper case.
dataA pointer to some user-defined callback data. Can be NULL.
Returns
The default value type. Return VCARD_X_VALUE if unknown.
See also
vcardparser_set_xprop_value_kind() how to set the callback.

Definition at line 39 of file vcardparser.h.

Function Documentation

◆ vcardparser_errstr()

const char * vcardparser_errstr ( int err)

Definition at line 960 of file vcardparser.c.

◆ vcardparser_parse_string()

vcardcomponent * vcardparser_parse_string ( const char * str)

Definition at line 1003 of file vcardparser.c.

◆ vcardparser_set_xprop_value_kind()

void vcardparser_set_xprop_value_kind ( vcard_xprop_value_kind_func func,
void * data )

Registers a parser callback to override the default value type of an x-property.

Extended properties ("x-properties") in vCard do not have a default value type. Instead, they are parsed as unknown values and preserved verbatim. This function allows to register a callback to define the default value type for some x-property. Any VALUE parameter set on the property overrides the default value.

Parameters
funcThe function pointer to the callback. Use NULL to disable a previously registered callback.
dataSome callback-specific data. Can be NULL.

For example, the callback might return VCARD_TEXT_VALUE when parsing an x-property named "X-ABLabel".

This function is not reentrant. Depending on libical is built, the callback either is registered as a process-global or thread-local variable.

Definition at line 1030 of file vcardparser.c.