From 10372725c04ac866d50273f991ddfb03bef0e16e Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 19 Feb 2011 19:51:27 +0100 Subject: [PATCH] Changing to autotools to create include dir. --- Makefile.am | 2 +- configure.ac | 22 ++++--- src/Makefile.am | 9 ++- src/gdaex.c | 6 +- src/gdaex.h | 144 ++++++++++++++++++++++++++++++++++++++++++++++ src/libgdaex.h | 131 +++-------------------------------------- src/queryeditor.h | 2 + 7 files changed, 179 insertions(+), 137 deletions(-) create mode 100644 src/gdaex.h diff --git a/Makefile.am b/Makefile.am index d0a7c6f..8f61381 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc -SUBDIRS = src docs tests +SUBDIRS = src data docs tests ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac index 1c1b691..b7e616b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([libgdaex], [0.2.2], [azagli@libero.it]) +AC_INIT([libgdaex], [0.3.0], [azagli@libero.it]) AC_CONFIG_SRCDIR([src/gdaex.c]) AM_CONFIG_HEADER([config.h]) @@ -28,7 +28,8 @@ GTK_DOC_CHECK(1.0) # Checks for libraries. PKG_CHECK_MODULES(GDAEX, [libgda-4.0 >= 4 - gio-2.0 >= 2.24]) + gio-2.0 >= 2.24 + gtk+-2.0 >= 2.20]) AC_SUBST(GDAEX_CFLAGS) AC_SUBST(GDAEX_LIBS) @@ -44,12 +45,15 @@ AC_C_CONST AC_CHECK_FUNCS([strchr strcasecmp]) AC_CONFIG_FILES([ - libgdaex.pc - Makefile - src/Makefile - docs/Makefile - docs/reference/Makefile - docs/reference/version.xml - tests/Makefile + libgdaex.pc + Makefile + src/Makefile + data/Makefile + data/libgdaex/Makefile + data/libgdaex/gui/Makefile + docs/Makefile + docs/reference/Makefile + docs/reference/version.xml + tests/Makefile ]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 51393df..d35f53d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,8 +6,13 @@ LIBS = $(GDAEX_LIBS) lib_LTLIBRARIES = libgdaex.la -libgdaex_la_SOURCES = gdaex.c +libgdaex_la_SOURCES = gdaex.c \ + queryeditor.c libgdaex_la_LDFLAGS = -no-undefined -include_HEADERS = libgdaex.h +include_HEADERS = libgdaex.h \ + gdaex.h \ + queryeditor.h + +libgdaex_includedir = $(includedir)/libgdaex diff --git a/src/gdaex.c b/src/gdaex.c index a06f796..692a52f 100644 --- a/src/gdaex.c +++ b/src/gdaex.c @@ -1,7 +1,7 @@ /* * gdaex.c * - * Copyright (C) 2005-2010 Andrea Zagli + * Copyright (C) 2005-2011 Andrea Zagli * * This file is part of libgdaex. * @@ -16,7 +16,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with libgdaexbj; if not, write to the Free Software + * along with libgdaex; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ @@ -30,7 +30,7 @@ #include #include -#include "libgdaex.h" +#include "gdaex.h" static guint debug; static gchar *log_file; diff --git a/src/gdaex.h b/src/gdaex.h new file mode 100644 index 0000000..078a69e --- /dev/null +++ b/src/gdaex.h @@ -0,0 +1,144 @@ +/* + * gdaex.h + * + * Copyright (C) 2005-2011 Andrea Zagli + * + * This file is part of libgdaex. + * + * libgdaex is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * libgdaex 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with libgdaex; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include +#include +#include +#include + +#ifndef __GDAEX_H__ +#define __GDAEX_H__ + +G_BEGIN_DECLS + + +#define TYPE_GDAEX (gdaex_get_type ()) +#define GDAEX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDAEX, GdaEx)) +#define GDAEX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDAEX, GdaExClass)) +#define IS_GDAEX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDAEX)) +#define IS_GDAEX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDAEX)) +#define GDAEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDAEX, GdaExClass)) + + +typedef struct _GdaEx GdaEx; +typedef struct _GdaExClass GdaExClass; + +struct _GdaEx + { + GObject parent; + }; + +struct _GdaExClass + { + GObjectClass parent_class; + + guint before_execute_signal_id; + guint after_execute_signal_id; + }; + +GType gdaex_get_type (void) G_GNUC_CONST; + + +GdaEx *gdaex_new_from_dsn (const gchar *dsn, + const gchar *username, + const gchar *password); +GdaEx *gdaex_new_from_string (const gchar *cnc_string); +GdaEx *gdaex_new_from_connection (GdaConnection *conn); + +GOptionGroup *gdaex_get_option_group (GdaEx *gdaex); + +const GdaConnection *gdaex_get_gdaconnection (GdaEx *gdaex); +const gchar *gdaex_get_provider (GdaEx *gdaex); + +const gchar *gdaex_get_tables_name_prefix (GdaEx *gdaex); +void gdaex_set_tables_name_prefix (GdaEx *gdaex, const gchar *tables_name_prefix); + +GdaDataModel *gdaex_query (GdaEx *gdaex, const gchar *sql); + +gchar *gdaex_data_model_get_field_value_stringify_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); +gint gdaex_data_model_get_field_value_integer_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); +gfloat gdaex_data_model_get_field_value_float_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); +gdouble gdaex_data_model_get_field_value_double_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); +gboolean gdaex_data_model_get_field_value_boolean_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); +GdaTimestamp *gdaex_data_model_get_field_value_gdatimestamp_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); +GDate *gdaex_data_model_get_field_value_gdate_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); +struct tm *gdaex_data_model_get_field_value_tm_at (GdaDataModel *data_model, + gint row, + const gchar *field_name); + +gchar *gdaex_data_model_get_value_stringify_at (GdaDataModel *data_model, + gint row, + gint col); +gint gdaex_data_model_get_value_integer_at (GdaDataModel *data_model, + gint row, + gint col); +gfloat gdaex_data_model_get_value_float_at (GdaDataModel *data_model, + gint row, + gint col); +gdouble gdaex_data_model_get_value_double_at (GdaDataModel *data_model, + gint row, + gint col); +gboolean gdaex_data_model_get_value_boolean_at (GdaDataModel *data_model, + gint row, + gint col); +GdaTimestamp *gdaex_data_model_get_value_gdatimestamp_at (GdaDataModel *data_model, + gint row, + gint col); +GDate *gdaex_data_model_get_value_gdate_at (GdaDataModel *data_model, + gint row, + gint col); +struct tm *gdaex_data_model_get_value_tm_at (GdaDataModel *data_model, + gint row, + gint col); + +gboolean gdaex_begin (GdaEx *gdaex); + +gint gdaex_execute (GdaEx *gdaex, const gchar *sql); + +gboolean gdaex_commit (GdaEx *gdaex); +gboolean gdaex_rollback (GdaEx *gdaex); + +void gdaex_free (GdaEx *gdaex); + +gchar *gdaex_strescape (const gchar *source, const gchar *exceptions); + +gchar gdaex_get_chr_quoting (GdaEx *gdaex); + + +G_END_DECLS + +#endif /* __GDAEX_H__ */ diff --git a/src/libgdaex.h b/src/libgdaex.h index 0a903b6..65aab8d 100644 --- a/src/libgdaex.h +++ b/src/libgdaex.h @@ -1,144 +1,31 @@ /* * libgdaex.h * - * Copyright (C) 2005-2010 Andrea Zagli + * Copyright (C) 2005-2011 Andrea Zagli * * This file is part of libgdaex. - * + * * libgdaex is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * libgdaex 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 General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with libgdaexbj; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * */ -#include -#include -#include -#include - -#ifndef __GDAEX_H__ -#define __GDAEX_H__ - -G_BEGIN_DECLS - - -#define TYPE_GDAEX (gdaex_get_type ()) -#define GDAEX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GDAEX, GdaEx)) -#define GDAEX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GDAEX, GdaExClass)) -#define IS_GDAEX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GDAEX)) -#define IS_GDAEX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GDAEX)) -#define GDAEX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GDAEX, GdaExClass)) - - -typedef struct _GdaEx GdaEx; -typedef struct _GdaExClass GdaExClass; - -struct _GdaEx - { - GObject parent; - }; - -struct _GdaExClass - { - GObjectClass parent_class; - - guint before_execute_signal_id; - guint after_execute_signal_id; - }; - -GType gdaex_get_type (void) G_GNUC_CONST; - - -GdaEx *gdaex_new_from_dsn (const gchar *dsn, - const gchar *username, - const gchar *password); -GdaEx *gdaex_new_from_string (const gchar *cnc_string); -GdaEx *gdaex_new_from_connection (GdaConnection *conn); - -GOptionGroup *gdaex_get_option_group (GdaEx *gdaex); - -const GdaConnection *gdaex_get_gdaconnection (GdaEx *gdaex); -const gchar *gdaex_get_provider (GdaEx *gdaex); - -const gchar *gdaex_get_tables_name_prefix (GdaEx *gdaex); -void gdaex_set_tables_name_prefix (GdaEx *gdaex, const gchar *tables_name_prefix); - -GdaDataModel *gdaex_query (GdaEx *gdaex, const gchar *sql); - -gchar *gdaex_data_model_get_field_value_stringify_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); -gint gdaex_data_model_get_field_value_integer_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); -gfloat gdaex_data_model_get_field_value_float_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); -gdouble gdaex_data_model_get_field_value_double_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); -gboolean gdaex_data_model_get_field_value_boolean_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); -GdaTimestamp *gdaex_data_model_get_field_value_gdatimestamp_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); -GDate *gdaex_data_model_get_field_value_gdate_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); -struct tm *gdaex_data_model_get_field_value_tm_at (GdaDataModel *data_model, - gint row, - const gchar *field_name); - -gchar *gdaex_data_model_get_value_stringify_at (GdaDataModel *data_model, - gint row, - gint col); -gint gdaex_data_model_get_value_integer_at (GdaDataModel *data_model, - gint row, - gint col); -gfloat gdaex_data_model_get_value_float_at (GdaDataModel *data_model, - gint row, - gint col); -gdouble gdaex_data_model_get_value_double_at (GdaDataModel *data_model, - gint row, - gint col); -gboolean gdaex_data_model_get_value_boolean_at (GdaDataModel *data_model, - gint row, - gint col); -GdaTimestamp *gdaex_data_model_get_value_gdatimestamp_at (GdaDataModel *data_model, - gint row, - gint col); -GDate *gdaex_data_model_get_value_gdate_at (GdaDataModel *data_model, - gint row, - gint col); -struct tm *gdaex_data_model_get_value_tm_at (GdaDataModel *data_model, - gint row, - gint col); - -gboolean gdaex_begin (GdaEx *gdaex); - -gint gdaex_execute (GdaEx *gdaex, const gchar *sql); - -gboolean gdaex_commit (GdaEx *gdaex); -gboolean gdaex_rollback (GdaEx *gdaex); - -void gdaex_free (GdaEx *gdaex); - -gchar *gdaex_strescape (const gchar *source, const gchar *exceptions); +#ifndef __LIBGDAEX_H__ +#define __LIBGDAEX_H__ -gchar gdaex_get_chr_quoting (GdaEx *gdaex); +#include "gdaex.h" +#include "queryeditor.h" -G_END_DECLS -#endif /* __GDAEX_H__ */ +#endif /* __LIBGDAEX_H__ */ diff --git a/src/queryeditor.h b/src/queryeditor.h index 7fb5e47..1030015 100644 --- a/src/queryeditor.h +++ b/src/queryeditor.h @@ -22,6 +22,8 @@ #include #include +#include + #include -- 2.49.0