summaryrefslogtreecommitdiff
path: root/include/common.h
diff options
context:
space:
mode:
authorPaweł Szewczyk <p.szewczyk@samsung.com>2019-02-25 16:05:19 +0100
committerMaciej Slodczyk <m.slodczyk2@partner.samsung.com>2019-03-22 16:45:02 +0100
commita8b2bd84bfda64b09e9c0fca728a2dddff624e42 (patch)
treee0a9dbca62de4100dfa3062bbb34be5f95371310 /include/common.h
parent5cf94cd3ef5e7fd330ab6dc29b8b9e4e4f70f925 (diff)
downloadactivationd-a8b2bd84bfda64b09e9c0fca728a2dddff624e42.tar.gz
activationd-a8b2bd84bfda64b09e9c0fca728a2dddff624e42.tar.bz2
activationd-a8b2bd84bfda64b09e9c0fca728a2dddff624e42.zip
add basic vconf listener
Change-Id: I473018b09ecbc9bdec8fbdbe9b64071bff544541 Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
Diffstat (limited to 'include/common.h')
-rw-r--r--include/common.h28
1 files changed, 28 insertions, 0 deletions
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)
{