Commit 43cf6489 43cf6489867bbcb70212a497a12ca24782bff9c7 by Sergey Poznyakoff

(mu_property_sget_value,mu_property_aget_value): New functions

1 parent 4c1fb17f
......@@ -34,6 +34,10 @@ 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 *);
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 *);
......
......@@ -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;
......