Sfoglia il codice sorgente

kdb: kdb_load_scheme(), kdb_deploy_scheme()

Serj Kalichev 3 anni fa
parent
commit
6240b54ec1
1 ha cambiato i file con 25 aggiunte e 1 eliminazioni
  1. 25 1
      klish/kscheme/kdb.c

+ 25 - 1
klish/kscheme/kdb.c

@@ -22,7 +22,7 @@ struct kdb_s {
 	kdb_init_fn init_fn;
 	kdb_fini_fn fini_fn;
 	kdb_load_fn load_fn;
-	kdb_load_fn deploy_fn;
+	kdb_deploy_fn deploy_fn;
 	void *udata; // User data
 };
 
@@ -198,3 +198,27 @@ bool_t kdb_fini(kdb_t *db)
 
 	return db->fini_fn(db);
 }
+
+
+kscheme_t *kdb_load_scheme(kdb_t *db)
+{
+	assert(db);
+	if (!db)
+		return NULL;
+	if (!db->load_fn)
+		return NULL;
+
+	return db->load_fn(db);
+}
+
+
+bool_t kdb_deploy_scheme(kdb_t *db, const kscheme_t *scheme)
+{
+	assert(db);
+	if (!db)
+		return BOOL_FALSE;
+	if (!db->deploy_fn)
+		return BOOL_FALSE;
+
+	return db->deploy_fn(db, scheme);
+}