Properties

#include <mailutils/property.h>

int mu_property_aget_value(mu_property_t prop, const char *key, char **buffer);
int mu_property_create(mu_property_t *prop, void *owner);
int mu_property_destroy(mu_property_t *prop, void *owner);
void *mu_property_get_owner(mu_property_t prop);
int mu_property_get_value(mu_property_t prop, const char *t, char *buffer, size_t buflen, size_t *n);
int mu_property_is_set(mu_property_t prop, const char *key);
int mu_property_set(mu_property_t prop, const char *key);
int mu_property_set_value(mu_property_t prop, const char *key, const char *value, int overwrite);
int mu_property_sget_value(mu_property_t prop, const char *key, const char **buffer);
int mu_property_unset(mu_property_t prop, const char *key);

Maintains an arbitrary collection of keys and their values.

mu_property_t

typedef _mu_property *mu_property_t

This is an opaque data type. None of the fields should be accessed by a user program.

mu_property_aget_value

int mu_property_aget_value(mu_property_t prop, const char *key, char **buffer);

Returns the value associated with key in buffer. The returned pointer should be free'd when no longer required. The function returns 0 is successful or an error code.

mu_property_create

int mu_property_create(mu_property_t *prop, void *owner);

Creates a new property collection. The function returns 0 if successful or an error code.

mu_property_destroy

int mu_property_destroy(mu_property_t *prop, void *owner);

Releases the resources allocated to the property collection. The function returns 0 if successful or an error code.

mu_property_get_owner

void *mu_property_get_owner(mu_property_t prop);

Returns the owner parameter set on the call to mu_property_create.

mu_property_get_value

int mu_property_get_value(mu_property_t prop, const char *t, char *buffer, size_t buflen, size_t *n);

Returns the value associated with key in buffer. The size of buffer is passed in buflen, the number of characters actually copied is returned in n. The value will be truncated if necessary. The function returns 0 is successful or an error code.

mu_property_is_set

int mu_property_is_set(mu_property_t prop, const char *key);

Returns TRUE if key exists in the property collection.

mu_property_set

int mu_property_set(mu_property_t prop, const char *key);

Sets the value associated with key to an empty string. The function returns 0 if successful or an error code.

mu_property_set_value

int mu_property_set_value(mu_property_t prop, const char *key, const char *value, int overwrite);

Sets the key and its associated value. If overwrite is non-zero then if the key exists its current value is replaced by value. The function returns 0 is successful or an error code.

mu_property_sget_value

int mu_property_sget_value(mu_property_t prop, const char *key, const char **buffer);

Returns the value associated with key in buffer. The returned pointer is owned by the property collection and should not be manipulated or free'd/ The function returns 0 is successful or an error code.

mu_property_unset

int mu_property_unset(mu_property_t prop, const char *key);

Removes key from the property collection. The function returns 0 if successful or an error code.

 
properties.txt · Last modified: 2009/06/29 09:29 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki