Commit 43cf6489 43cf6489867bbcb70212a497a12ca24782bff9c7 by Sergey Poznyakoff

(mu_property_sget_value,mu_property_aget_value): New functions

1 parent 4c1fb17f
......@@ -33,7 +33,11 @@ extern void *mu_property_get_owner (mu_property_t);
extern int mu_property_set_value (mu_property_t, const char *, const char *, int);
extern int mu_property_get_value (mu_property_t, const char *, char *, size_t,
size_t *);
size_t *);
extern int mu_property_sget_value (mu_property_t prop, const char *key,
const char **buffer);
extern int mu_property_aget_value (mu_property_t prop, const char *key,
char **buffer);
/* Helper functions. */
extern int mu_property_set (mu_property_t, const char *);
......
......@@ -82,7 +82,7 @@ mu_property_get_owner (mu_property_t prop)
int
mu_property_set_value (mu_property_t prop, const char *key, const char *value,
int overwrite)
int overwrite)
{
struct property_item *item;
int status = property_find (prop, key, &item);
......@@ -123,7 +123,7 @@ mu_property_set_value (mu_property_t prop, const char *key, const char *value,
int
mu_property_get_value (mu_property_t prop, const char *key, char *buffer,
size_t buflen, size_t *n)
size_t buflen, size_t *n)
{
struct property_item *item = NULL;
int status;
......@@ -146,6 +146,36 @@ mu_property_get_value (mu_property_t prop, const char *key, char *buffer,
}
int
mu_property_sget_value (mu_property_t prop, const char *key,
const char **buffer)
{
struct property_item *item = NULL;
int status;
status = property_find (prop, key, &item);
if (status == 0)
*buffer = item->value;
return status;
}
int
mu_property_aget_value (mu_property_t prop, const char *key,
char **buffer)
{
struct property_item *item = NULL;
int status;
status = property_find (prop, key, &item);
if (status == 0)
{
*buffer = strdup (item->value);
if (!*buffer)
status = ENOMEM;
}
return status;
}
int
mu_property_set (mu_property_t prop, const char *k)
{
struct property_item *item = NULL;
......