From a8b2bd84bfda64b09e9c0fca728a2dddff624e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Szewczyk?= Date: Mon, 25 Feb 2019 16:05:19 +0100 Subject: add basic vconf listener Change-Id: I473018b09ecbc9bdec8fbdbe9b64071bff544541 Signed-off-by: Maciej Slodczyk --- include/common.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 0817a6d..b905f20 100644 --- a/include/common.h +++ b/include/common.h @@ -76,6 +76,8 @@ enum epc_object_type { TYPE_INT, TYPE_TIMESPEC, TYPE_TIME_T, + TYPE_BOOL, + TYPE_DOUBLE, TYPE_UUID, TYPE_OBJECT, }; @@ -103,6 +105,8 @@ union epc_object_value { int i; struct timespec ts; time_t time; + bool b; + double d; sd_id128_t uuid; struct list_head children; }; @@ -163,6 +167,18 @@ static inline int epc_object_append_int(struct epc_object *obj, return epc_object_append_new(obj, key, TYPE_INT, &val); } +static inline int epc_object_append_bool(struct epc_object *obj, + const char *key, bool val) +{ + return epc_object_append_new(obj, key, TYPE_BOOL, &val); +} + +static inline int epc_object_append_double(struct epc_object *obj, + const char *key, double val) +{ + return epc_object_append_new(obj, key, TYPE_DOUBLE, &val); +} + static inline int epc_object_append_time_t(struct epc_object *obj, const char *key, time_t val) { @@ -192,6 +208,18 @@ static inline int epc_object_get_string(struct epc_object *obj, return epc_object_get_val(obj, key, TYPE_STRING, val); } +static inline int epc_object_get_double(struct epc_object *obj, + const char *key, double *val) +{ + return epc_object_get_val(obj, key, TYPE_DOUBLE, val); +} + +static inline int epc_object_get_bool(struct epc_object *obj, + const char *key, bool *val) +{ + return epc_object_get_val(obj, key, TYPE_BOOL, val); +} + static inline int epc_object_get_oid(struct epc_object *obj, const char *key, epc_oid_t *val) { -- cgit v1.2.3