e2k-properties

e2k-properties — WebDAV properties

Synopsis




E2kProperties* e2k_properties_new           (void);
E2kProperties* e2k_properties_copy          (E2kProperties *props);
gboolean    e2k_properties_empty            (E2kProperties *props);
void        e2k_properties_free             (E2kProperties *props);

gpointer    e2k_properties_get_prop         (E2kProperties *props,
                                             const char *propname);
void        e2k_properties_remove           (E2kProperties *props,
                                             const char *propname);

enum        E2kPropType;
#define     E2K_PROP_TYPE_IS_ARRAY          (t)
void        e2k_properties_set_string       (E2kProperties *props,
                                             const char *propname,
                                             char *value);
void        e2k_properties_set_string_array (E2kProperties *props,
                                             const char *propname,
                                             GPtrArray *value);
void        e2k_properties_set_binary       (E2kProperties *props,
                                             const char *propname,
                                             GByteArray *value);
void        e2k_properties_set_binary_array (E2kProperties *props,
                                             const char *propname,
                                             GPtrArray *value);
void        e2k_properties_set_int          (E2kProperties *props,
                                             const char *propname,
                                             int value);
void        e2k_properties_set_int_array    (E2kProperties *props,
                                             const char *propname,
                                             GPtrArray *value);
void        e2k_properties_set_xml          (E2kProperties *props,
                                             const char *propname,
                                             xmlNode *value);
void        e2k_properties_set_bool         (E2kProperties *props,
                                             const char *propname,
                                             gboolean value);
void        e2k_properties_set_float        (E2kProperties *props,
                                             const char *propname,
                                             float value);
void        e2k_properties_set_date         (E2kProperties *props,
                                             const char *propname,
                                             char *value);
void        e2k_properties_set_type_as_string
                                            (E2kProperties *props,
                                             const char *propname,
                                             E2kPropType type,
                                             char *value);
void        e2k_properties_set_type_as_string_array
                                            (E2kProperties *props,
                                             const char *propname,
                                             E2kPropType type,
                                             GPtrArray *value);

void        (*E2kPropertiesForeachFunc)     (const char *propname,
                                             E2kPropType type,
                                             gpointer value,
                                             gpointer user_data);
void        e2k_properties_foreach          (E2kProperties *props,
                                             E2kPropertiesForeachFunc callback,
                                             gpointer user_data);
void        e2k_properties_foreach_removed  (E2kProperties *props,
                                             E2kPropertiesForeachFunc callback,
                                             gpointer user_data);
void        (*E2kPropertiesForeachNamespaceFunc)
                                            (const char *namespace,
                                             char abbrev,
                                             gpointer user_data);
void        e2k_properties_foreach_namespace
                                            (E2kProperties *props,
                                             E2kPropertiesForeachNamespaceFunc callback,
                                             gpointer user_data);

const char* e2k_prop_namespace_name         (const char *prop);
char        e2k_prop_namespace_abbrev       (const char *prop);
const char* e2k_prop_property_name          (const char *prop);

guint32     e2k_prop_proptag                (const char *prop);
const char* e2k_proptag_prop                (guint32 proptag);
#define     E2K_PROPTAG_TYPE                (proptag)
#define     E2K_PROPTAG_ID                  (proptag)

Description

Details

e2k_properties_new ()

E2kProperties* e2k_properties_new           (void);

Creates a new (empty) E2kProperties structure

Returns : the structure

e2k_properties_copy ()

E2kProperties* e2k_properties_copy          (E2kProperties *props);

Performs a deep copy of props

props : an E2kProperties
Returns : a new copy of props

e2k_properties_empty ()

gboolean    e2k_properties_empty            (E2kProperties *props);

Tests if props is empty.

props : an E2kProperties
Returns : TRUE if props has no properties set, FALSE if it has at least one value set.

e2k_properties_free ()

void        e2k_properties_free             (E2kProperties *props);

Frees props and all of the properties it contains.

props : an E2kProperties

e2k_properties_get_prop ()

gpointer    e2k_properties_get_prop         (E2kProperties *props,
                                             const char *propname);

Retrieves the value of propname in props.

props : an E2kProperties
propname : a property name
Returns : the value of propname in props, or NULL if it is not set. The caller should not free the value; it is owned by props.

e2k_properties_remove ()

void        e2k_properties_remove           (E2kProperties *props,
                                             const char *propname);

Marks propname removed in props, so that the corresponding property will be removed from the object on the server if props is used in a PROPPATCH. If the property was formerly set in props, this frees the old value.

props : an E2kProperties
propname : the name of a property

enum E2kPropType

typedef enum {
	E2K_PROP_TYPE_UNKNOWN,

	E2K_PROP_TYPE_STRING,
	E2K_PROP_TYPE_BINARY,
	E2K_PROP_TYPE_STRING_ARRAY,
	E2K_PROP_TYPE_BINARY_ARRAY,
	E2K_PROP_TYPE_XML,

	/* These are all stored as STRING or STRING_ARRAY */
	E2K_PROP_TYPE_INT,
	E2K_PROP_TYPE_INT_ARRAY,
	E2K_PROP_TYPE_BOOL,
	E2K_PROP_TYPE_FLOAT,
	E2K_PROP_TYPE_DATE
} E2kPropType;

The supported types of properties.

E2K_PROP_TYPE_UNKNOWN
E2K_PROP_TYPE_STRINGstored as a C string
E2K_PROP_TYPE_BINARYstored as a GByteArray
E2K_PROP_TYPE_STRING_ARRAYstored as a GPtrArray of C strings
E2K_PROP_TYPE_BINARY_ARRAYstored as a GPtrArray of GByteArrays
E2K_PROP_TYPE_XMLstored as an xmlNode
E2K_PROP_TYPE_INTstored as a string
E2K_PROP_TYPE_INT_ARRAYstored as a string array
E2K_PROP_TYPE_BOOLstored as a string containing "0" or "1"
E2K_PROP_TYPE_FLOATstored as a string
E2K_PROP_TYPE_DATEstored as a string in e2k_make_timestamp() format

E2K_PROP_TYPE_IS_ARRAY()

#define     E2K_PROP_TYPE_IS_ARRAY(t)

Tests if a property type is an array type

t :the type
Returns :TRUE if t is an array type

e2k_properties_set_string ()

void        e2k_properties_set_string       (E2kProperties *props,
                                             const char *propname,
                                             char *value);

Sets propname in props to value. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
value : an allocated string

e2k_properties_set_string_array ()

void        e2k_properties_set_string_array (E2kProperties *props,
                                             const char *propname,
                                             GPtrArray *value);

Sets propname in props to value. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
value : an array of allocated strings

e2k_properties_set_binary ()

void        e2k_properties_set_binary       (E2kProperties *props,
                                             const char *propname,
                                             GByteArray *value);

Sets propname in props to value. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
value : a byte array

e2k_properties_set_binary_array ()

void        e2k_properties_set_binary_array (E2kProperties *props,
                                             const char *propname,
                                             GPtrArray *value);

Sets propname in props to value. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
value : an array of byte arrays

e2k_properties_set_int ()

void        e2k_properties_set_int          (E2kProperties *props,
                                             const char *propname,
                                             int value);

Sets propname in props to value.

props : an E2kProperties
propname : the name of a property
value : an integer

e2k_properties_set_int_array ()

void        e2k_properties_set_int_array    (E2kProperties *props,
                                             const char *propname,
                                             GPtrArray *value);

Sets propname in props to value. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
value : an array of integers

e2k_properties_set_xml ()

void        e2k_properties_set_xml          (E2kProperties *props,
                                             const char *propname,
                                             xmlNode *value);

Sets propname in props to value. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
value : an xmlNode

e2k_properties_set_bool ()

void        e2k_properties_set_bool         (E2kProperties *props,
                                             const char *propname,
                                             gboolean value);

Sets propname in props to value. value.

props : an E2kProperties
propname : the name of a property
value : a boolean value

e2k_properties_set_float ()

void        e2k_properties_set_float        (E2kProperties *props,
                                             const char *propname,
                                             float value);

Sets propname in props to value.

props : an E2kProperties
propname : the name of a property
value : a floating-point value

e2k_properties_set_date ()

void        e2k_properties_set_date         (E2kProperties *props,
                                             const char *propname,
                                             char *value);

Sets propname in props to value. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
value : an allocated string containing an Exchange timestamp

e2k_properties_set_type_as_string ()

void        e2k_properties_set_type_as_string
                                            (E2kProperties *props,
                                             const char *propname,
                                             E2kPropType type,
                                             char *value);

Sets propname in props to value, but with type type. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
type : the type of value
value : an allocated string

e2k_properties_set_type_as_string_array ()

void        e2k_properties_set_type_as_string_array
                                            (E2kProperties *props,
                                             const char *propname,
                                             E2kPropType type,
                                             GPtrArray *value);

Sets propname in props to value, but with type type. props assumes ownership of value.

props : an E2kProperties
propname : the name of a property
type : the type of value
value : an array of allocated strings

E2kPropertiesForeachFunc ()

void        (*E2kPropertiesForeachFunc)     (const char *propname,
                                             E2kPropType type,
                                             gpointer value,
                                             gpointer user_data);

The callback for e2k_properties_foreach() and e2k_properties_foreach_removed().

propname :property name
type :property type
value :property value
user_data :user data

e2k_properties_foreach ()

void        e2k_properties_foreach          (E2kProperties *props,
                                             E2kPropertiesForeachFunc callback,
                                             gpointer user_data);

Calls callback once for each property that is set in props (in unspecified order), passing it the name of the property, the property's type, its value, and user_data.

props : an E2kProperties
callback : callback function to call for each set property
user_data : data to pass to callback

e2k_properties_foreach_removed ()

void        e2k_properties_foreach_removed  (E2kProperties *props,
                                             E2kPropertiesForeachFunc callback,
                                             gpointer user_data);

Calls callback once for each property marked removed in props (in unspecified order), passing it the name of the property, the property's type (if known), a NULL value, and user_data.

props : an E2kProperties
callback : callback function to call for each set property
user_data : data to pass to callback

E2kPropertiesForeachNamespaceFunc ()

void        (*E2kPropertiesForeachNamespaceFunc)
                                            (const char *namespace,
                                             char abbrev,
                                             gpointer user_data);

The callback for e2k_properties_foreach_namespace()

namespace :namespace name
abbrev :namespace abbreviation
user_data :user data

e2k_properties_foreach_namespace ()

void        e2k_properties_foreach_namespace
                                            (E2kProperties *props,
                                             E2kPropertiesForeachNamespaceFunc callback,
                                             gpointer user_data);

Calls callback once for each unique namespace used by the properties (set or removed) in props, passing it the name of the namespace, its standard abbreviation, and user_data.

props : an E2kProperties
callback : callback function to call for each namespace
user_data : data to pass to callback

e2k_prop_namespace_name ()

const char* e2k_prop_namespace_name         (const char *prop);

Splits out the namespace portion of prop

prop : the name of a property
Returns : the URI of prop's namespace

e2k_prop_namespace_abbrev ()

char        e2k_prop_namespace_abbrev       (const char *prop);

Splits out the namespace portion of prop and assigns a unique abbreviation for it.

prop : the name of a property
Returns : the abbreviation used for prop's namespace

e2k_prop_property_name ()

const char* e2k_prop_property_name          (const char *prop);

Splits out the non-namespace portion of prop

prop : the name of a property
Returns : the non-namespaced name of prop

e2k_prop_proptag ()

guint32     e2k_prop_proptag                (const char *prop);

Computes the MAPI proptag value of prop, which must be the name of a MAPI property.

prop : the name of a MAPI property
Returns : the MAPI proptag value

e2k_proptag_prop ()

const char* e2k_proptag_prop                (guint32 proptag);

Computes the WebDAV property name of the property with the given proptag.

proptag : a MAPI property
Returns : the WebDAV property name associated with proptag

E2K_PROPTAG_TYPE()

#define     E2K_PROPTAG_TYPE(proptag)

Returns the MAPI property type of proptag

proptag :a MAPI proptag
Returns :the MAPI type

E2K_PROPTAG_ID()

#define     E2K_PROPTAG_ID(proptag)

Returns just the ID portion of proptag

proptag :a MAPI proptag
Returns :proptag with the type cleared out