Browse Source

Move klish/kdb to db dir

Serj Kalichev 3 years ago
parent
commit
4eb28a23d7

+ 2 - 16
Makefile.am

@@ -24,25 +24,11 @@ noinst_HEADERS =
 
 EXTRA_DIST =
 	klish/Makefile.am \
+	db/Makefile.am \
 	bin/Makefile.am
 
-#	bin/module.am \
-#	clish/module.am \
-#	tinyrl/module.am \
-#	konf/module.am \
-#	plugins/module.am \
-#	libc/module.am \
-#	doc/module.am \
-#	contrib \
-#	xml-examples \
-#	debian \
-#	clish.xsd \
-#	LICENCE \
-#	README \
-#	CHANGES \
-#	ISSUES
-
 include $(top_srcdir)/klish/Makefile.am
+include $(top_srcdir)/db/Makefile.am
 include $(top_srcdir)/bin/Makefile.am
 
 define CONTROL

+ 17 - 0
db/Makefile.am

@@ -0,0 +1,17 @@
+dbdir = ${pkglibdir}/db
+db_LTLIBRARIES =
+
+EXTRA_DIST += \
+	db/libxml2/Makefile.am \
+	db/roxml/Makefile.am \
+	db/expat/Makefile.am
+
+if WITH_LIBXML2
+include $(top_srcdir)/db/libxml2/Makefile.am
+endif
+if WITH_ROXML
+include $(top_srcdir)/db/roxml/Makefile.am
+endif
+if WITH_EXPAT
+include $(top_srcdir)/db/expat/Makefile.am
+endif

+ 1 - 1
klish/kdb/expat/Makefile.am → db/expat/Makefile.am

@@ -6,4 +6,4 @@ kdb_expat_la_CFLAGS = $(AM_LDFLAGS) $(EXPAT_CFLAGS)
 kdb_expat_la_LIBADD = libklish-helper-xml.la
 
 kdb_expat_la_SOURCES += \
-	klish/kdb/expat/expat_api.c
+	db/expat/expat_api.c

+ 0 - 0
klish/kdb/expat/expat_api.c → db/expat/expat_api.c


+ 2 - 2
klish/kdb/libxml2/Makefile.am → db/libxml2/Makefile.am

@@ -6,5 +6,5 @@ kdb_libxml2_la_CFLAGS = $(AM_LDFLAGS) $(LIBXML2_CFLAGS)
 kdb_libxml2_la_LIBADD = libklish-helper-xml.la
 
 kdb_libxml2_la_SOURCES += \
-	klish/kdb/libxml2/libxml2_api.c \
-	klish/kdb/libxml2/libxml2_plugin.c
+	db/libxml2/libxml2_api.c \
+	db/libxml2/libxml2_plugin.c

+ 0 - 0
klish/kdb/libxml2/libxml2_api.c → db/libxml2/libxml2_api.c


+ 0 - 0
klish/kdb/libxml2/libxml2_plugin.c → db/libxml2/libxml2_plugin.c


+ 1 - 1
klish/kdb/roxml/Makefile.am → db/roxml/Makefile.am

@@ -6,4 +6,4 @@ kdb_roxml_la_CFLAGS = $(AM_LDFLAGS) $(ROXML_CFLAGS)
 kdb_roxml_la_LIBADD = libklish-helper-xml.la
 
 kdb_roxml_la_SOURCES += \
-	klish/kdb/roxml/roxml_api.c
+	db/roxml/roxml_api.c

+ 0 - 0
klish/kdb/roxml/roxml_api.c → db/roxml/roxml_api.c


+ 7 - 1
klish/Makefile.am

@@ -31,6 +31,10 @@ nobase_include_HEADERS += \
 	klish/kudata.h \
 	klish/kustore.h
 
+# XML-helper
+nobase_include_HEADERS += \
+	klish/kxml.h
+
 #noinst_HEADERS += \
 #	klish/khelper.h
 
@@ -39,13 +43,15 @@ EXTRA_DIST += \
 	klish/kscheme/Makefile.am \
 	klish/ischeme/Makefile.am \
 	klish/ksession/Makefile.am \
-	klish/kdb/Makefile.am
+	klish/kdb/Makefile.am \
+	klish/xml-helper/Makefile.am
 
 include $(top_srcdir)/klish/ktp/Makefile.am
 include $(top_srcdir)/klish/kscheme/Makefile.am
 include $(top_srcdir)/klish/ischeme/Makefile.am
 include $(top_srcdir)/klish/ksession/Makefile.am
 include $(top_srcdir)/klish/kdb/Makefile.am
+include $(top_srcdir)/klish/xml-helper/Makefile.am
 
 #if TESTC
 #include $(top_srcdir)/klish/testc_module/Makefile.am

+ 0 - 23
klish/kdb/Makefile.am

@@ -1,23 +0,0 @@
-lib_LTLIBRARIES += libklish-helper-xml.la
-libklish_helper_xml_la_SOURCES = \
-	klish/kdb/xml-common/load.c
-libklish_helper_xml_la_CFLAGS = $(AM_CFLAGS) -fPIC
-libklish_helper_xml_la_LDFLAGS = -static
-
-dbdir = ${pkglibdir}/db
-db_LTLIBRARIES =
-
-EXTRA_DIST += \
-	klish/kdb/libxml2/Makefile.am \
-	klish/kdb/roxml/Makefile.am \
-	klish/kdb/expat/Makefile.am
-
-if WITH_LIBXML2
-include $(top_srcdir)/klish/kdb/libxml2/Makefile.am
-endif
-if WITH_ROXML
-include $(top_srcdir)/klish/kdb/roxml/Makefile.am
-endif
-if WITH_EXPAT
-include $(top_srcdir)/klish/kdb/expat/Makefile.am
-endif

+ 6 - 0
klish/kxml.h

@@ -8,6 +8,7 @@
 #ifndef _klish_kxml_h
 #define _klish_kxml_h
 
+#include <klish/kscheme.h>
 
 /** @brief XML document (opaque type).
  *
@@ -114,4 +115,9 @@ char *kxml_node_attr(const kxml_node_t *node, const char *attrname);
 void kxml_node_attr_free(char *str);
 
 
+/** @brief XML-helper
+ */
+kscheme_t *kxml_load_scheme(const char *xml_path, faux_error_t *error);
+
+
 #endif // _klish_kxml_h

+ 5 - 0
klish/xml-helper/Makefile.am

@@ -0,0 +1,5 @@
+lib_LTLIBRARIES += libklish-helper-xml.la
+libklish_helper_xml_la_SOURCES = \
+	klish/xml-helper/load.c
+libklish_helper_xml_la_CFLAGS = $(AM_CFLAGS) -fPIC
+libklish_helper_xml_la_LDFLAGS = -static

+ 1 - 1
klish/kdb/xml-common/load.c → klish/xml-helper/load.c

@@ -153,7 +153,7 @@ static bool_t kxml_load_file(kscheme_t *scheme, const char *filename,
 
 /** @brief Default path to get XML files from.
  */
-const char *default_path = "/etc/klish;~/.klish";
+static const char *default_path = "/etc/klish;~/.klish";
 static const char *path_separators = ":;";