summaryrefslogtreecommitdiffhomepage
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/object.c b/object.c
index 4e49ac4..c0a5227 100644
--- a/object.c
+++ b/object.c
@@ -316,6 +316,18 @@ uc_prototype_new(uc_prototype *parent)
return proto;
}
+json_object *
+uc_prototype_lookup(uc_prototype *proto, const char *key)
+{
+ json_object *val;
+
+ for (; proto; proto = proto->parent)
+ if (json_object_object_get_ex(proto->header.jso, key, &val))
+ return val;
+
+ return NULL;
+}
+
uc_prototype *
uc_protoref_new(json_object *value, uc_prototype *proto)
{