From: Andrea Zagli Date: Sat, 20 Jan 2018 08:32:09 +0000 (+0100) Subject: Starting to change name and namespace. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=88d2a9f01d313c330b631f01d6177b2d84426255;p=libzakdbt Starting to change name and namespace. --- diff --git a/Makefile.am b/Makefile.am index 2d6bb2d..8723926 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,10 +4,10 @@ SUBDIRS = src tests docs ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = libdbtransformer.pc.in +EXTRA_DIST = libzakdbt.pc.in pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libdbtransformer.pc +pkgconfig_DATA = libzakdbt.pc distclean-local: if test "$(srcdir)" = "."; then :; else \ diff --git a/configure.ac b/configure.ac index 64e8829..40980dc 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) -AC_INIT([libdbtransformers], [0.0.1], [azagli@libero.it]) +AC_INIT([libzakdbt], [0.0.1], [azagli@libero.it]) AC_CONFIG_SRCDIR([src/dbtransformer.c]) AC_CONFIG_HEADER([config.h]) @@ -48,7 +48,7 @@ AC_C_CONST # Checks for library functions. AC_CONFIG_FILES([ - libdbtransformer.pc + libzakdbt.pc Makefile src/Makefile tests/Makefile diff --git a/docs/dbtransformer.dtd b/docs/dbtransformer.dtd deleted file mode 100644 index 3f5feca..0000000 --- a/docs/dbtransformer.dtd +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am index 8d64f79..7c6bdf9 100644 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@ -9,7 +9,7 @@ AUTOMAKE_OPTIONS = 1.6 # of using the various options. # The name of the module, e.g. 'glib'. -DOC_MODULE=dbtransformer +DOC_MODULE=zakdbt # Uncomment for versioned docs and specify the version of the module, e.g. '2'. #DOC_MODULE_VERSION=2 @@ -79,7 +79,7 @@ expand_content_files= # e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) GTKDOC_CFLAGS=-I$(top_srcdir)/src $(DBT_CFLAGS) -GTKDOC_LIBS=$(top_builddir)/src/libdbtransformer.la $(DBT_LIBS) +GTKDOC_LIBS=$(top_builddir)/src/libzakdbt.la $(DBT_LIBS) # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make diff --git a/docs/zakdbt.dtd b/docs/zakdbt.dtd new file mode 100644 index 0000000..3f5feca --- /dev/null +++ b/docs/zakdbt.dtd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libdbtransformer.pc.in b/libdbtransformer.pc.in deleted file mode 100644 index da9a23f..0000000 --- a/libdbtransformer.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: @PACKAGE_NAME@ -Description: Class to manage authorizations. -Version: @PACKAGE_VERSION@ -Requires: glib-2.0 -Libs: -L${libdir} -lautoz -Cflags: -I${includedir} diff --git a/libzakdbt.pc.in b/libzakdbt.pc.in new file mode 100644 index 0000000..89ba036 --- /dev/null +++ b/libzakdbt.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: @PACKAGE_NAME@ +Description: Class to manage db changes. +Version: @PACKAGE_VERSION@ +Requires: libgda-5.0 libxslt +Libs: -L${libdir} -lzakdbt +Cflags: -I${includedir} diff --git a/src/Makefile.am b/src/Makefile.am index 41a3c7b..a9d7518 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,12 +2,12 @@ LIBS = $(DBT_LIBS) AM_CPPFLAGS = $(DBT_CFLAGS) -lib_LTLIBRARIES = libdbtransformer.la +lib_LTLIBRARIES = libzakdbt.la -libdbtransformer_la_SOURCES = dbtransformer.c +libzakdbt_la_SOURCES = dbtransformer.c -libdbtransformer_la_LDFLAGS = -no-undefined +libzakdbt_la_LDFLAGS = -no-undefined -libdbtransformer_include_HEADERS = libdbtransformer.h +libzakdbt_include_HEADERS = libzakdbt.h -libdbtransformer_includedir = $(includedir) +libzakdbt_includedir = $(includedir)/$(PACKAGE) diff --git a/src/dbtransformer.c b/src/dbtransformer.c index 7173235..2315772 100644 --- a/src/dbtransformer.c +++ b/src/dbtransformer.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Andrea Zagli + * Copyright (C) 2010-2018 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,7 +31,7 @@ #include -#include "libdbtransformer.h" +#include "libzakdbt.h" static gchar *str_xslt_doc = "\n" @@ -332,7 +332,7 @@ dbt_set_xml_from_filename (Dbt *dbt, const gchar *filename) filen = g_strstrip (g_strdup (filename)); - g_return_if_fail (g_strcmp0 (filen, "") != 0); + g_return_if_fail (g_strcmp0 (filen, "") != 0); /* TODO validate against DTD */ @@ -503,7 +503,7 @@ dbt_check_db (Dbt *dbt, gboolean create_tables) { return ret; } - + /* table doesn't exist */ GdaServerOperation *op; gint i; @@ -520,7 +520,7 @@ dbt_check_db (Dbt *dbt, gboolean create_tables) /* Set parameter's values */ /* table name */ gda_server_operation_set_value_at (op, "dbt_transformations", &error, "/TABLE_DEF_P/TABLE_NAME"); - + /* "id" field */ i = 0; gda_server_operation_set_value_at (op, "id", &error, "/FIELDS_A/@COLUMN_NAME/%d", i); @@ -546,7 +546,7 @@ dbt_check_db (Dbt *dbt, gboolean create_tables) error != NULL && error->message != NULL ? error->message : "no detail"); return ret; } - g_object_unref (op); + g_object_unref (op); } } @@ -918,7 +918,7 @@ dbt_parse_rename_table (Dbt *dbt, xmlNodePtr xnode) error != NULL && error->message != NULL ? error->message : "No detail"); ret = FALSE; } - g_object_unref (op); + g_object_unref (op); } else { @@ -1178,7 +1178,7 @@ g_debug("%s",gda_server_provider_render_operation(priv->gda_provider, priv->gda_ error != NULL && error->message != NULL ? error->message : "no detail"); ret = FALSE; } - g_object_unref (op); + g_object_unref (op); } else { @@ -1240,7 +1240,7 @@ dbt_parse_drop_index (Dbt *dbt, xmlNodePtr xnode) error != NULL && error->message != NULL ? error->message : "No detail"); ret = FALSE; } - g_object_unref (op); + g_object_unref (op); } else { diff --git a/src/libdbtransformer.h b/src/libdbtransformer.h deleted file mode 100644 index c9aeaeb..0000000 --- a/src/libdbtransformer.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2010 Andrea Zagli - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __LIBDBT_H__ -#define __LIBDBT_H__ - -#include -#include -#include - - -G_BEGIN_DECLS - - -#define TYPE_DBT (dbt_get_type ()) -#define DBT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DBT, Dbt)) -#define DBT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DBT, DbtClass)) -#define IS_DBT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DBT)) -#define IS_DBT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DBT)) -#define DBT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DBT, DbtClass)) - - -typedef struct _Dbt Dbt; -typedef struct _DbtClass DbtClass; - -struct _Dbt - { - GObject parent; - }; - -struct _DbtClass - { - GObjectClass parent_class; - }; - -GType dbt_get_type (void) G_GNUC_CONST; - - -Dbt *dbt_new (void); - -void dbt_set_db_connection (Dbt *dbt, GdaConnection *gda_conn); -void dbt_set_db_connection_from_string (Dbt *dbt, const gchar *cnc_string); - -void dbt_set_xml (Dbt *dbt, xmlNodePtr xml_root); -void dbt_set_xml_from_filename (Dbt *dbt, const gchar *filename); - -gboolean dbt_db_is_updated (Dbt *dbt); - -void dbt_transform (Dbt *dbt); - - -G_END_DECLS - - -#endif /* __LIBDBT_H__ */ diff --git a/src/libzakdbt.h b/src/libzakdbt.h new file mode 100644 index 0000000..c9aeaeb --- /dev/null +++ b/src/libzakdbt.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2010 Andrea Zagli + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __LIBDBT_H__ +#define __LIBDBT_H__ + +#include +#include +#include + + +G_BEGIN_DECLS + + +#define TYPE_DBT (dbt_get_type ()) +#define DBT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DBT, Dbt)) +#define DBT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DBT, DbtClass)) +#define IS_DBT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DBT)) +#define IS_DBT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DBT)) +#define DBT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DBT, DbtClass)) + + +typedef struct _Dbt Dbt; +typedef struct _DbtClass DbtClass; + +struct _Dbt + { + GObject parent; + }; + +struct _DbtClass + { + GObjectClass parent_class; + }; + +GType dbt_get_type (void) G_GNUC_CONST; + + +Dbt *dbt_new (void); + +void dbt_set_db_connection (Dbt *dbt, GdaConnection *gda_conn); +void dbt_set_db_connection_from_string (Dbt *dbt, const gchar *cnc_string); + +void dbt_set_xml (Dbt *dbt, xmlNodePtr xml_root); +void dbt_set_xml_from_filename (Dbt *dbt, const gchar *filename); + +gboolean dbt_db_is_updated (Dbt *dbt); + +void dbt_transform (Dbt *dbt); + + +G_END_DECLS + + +#endif /* __LIBDBT_H__ */ diff --git a/tests/Makefile.am b/tests/Makefile.am index f54f871..6d61596 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -6,6 +6,6 @@ AM_CPPFLAGS = $(DBT_CFLAGS) \ noinst_PROGRAMS = test -LDADD = $(top_builddir)/src/libdbtransformer.la +LDADD = $(top_builddir)/src/libzakdbt.la -EXTRA_DIST = +EXTRA_DIST = diff --git a/tests/test.c b/tests/test.c index 41bccca..98a8620 100644 --- a/tests/test.c +++ b/tests/test.c @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "libdbtransformer.h" +#include "libzakdbt.h" Dbt *dbt;