Code

store: Added sdb_store_get_host().
[sysdb.git] / src / core / store.c
index 5a36e29eef5817e2988d445accd19b352fbe6f61..e8d14a079679a12d5a76ef58735b44920065755d 100644 (file)
@@ -460,6 +460,22 @@ sdb_store_has_host(const char *name)
        return host != NULL;
 } /* sdb_store_has_host */
 
+sdb_store_base_t *
+sdb_store_get_host(const char *name)
+{
+       sdb_store_obj_t *host;
+
+       if (! name)
+               return NULL;
+
+       host = sdb_store_lookup(SDB_HOST, name);
+       if (! host)
+               return NULL;
+
+       sdb_object_ref(SDB_OBJ(host));
+       return STORE_BASE(host);
+} /* sdb_store_get_host */
+
 int
 sdb_store_attribute(const char *hostname, const char *key, const char *value,
                sdb_time_t last_update)