[libgda/LIBGDA_5.2] SqlParser: added header by default



commit ce31940424456e100273ba37dba80bac5e56affc
Author: Daniel Espinosa <esodan gmail com>
Date:   Tue Oct 8 09:40:59 2019 -0500

    SqlParser: added header by default
    
    Fix issue #197

 libgda/libgda.h.in              |  2 ++
 tests/value-holders/Makefile.am |  3 ++
 tests/value-holders/common.c    | 68 -----------------------------------------
 3 files changed, 5 insertions(+), 68 deletions(-)
---
diff --git a/libgda/libgda.h.in b/libgda/libgda.h.in
index 5ff4ec777..f88bda03c 100644
--- a/libgda/libgda.h.in
+++ b/libgda/libgda.h.in
@@ -85,6 +85,8 @@
 #include <libgda/gda-tree-mgr-tables.h> 
 #include <libgda/gda-tree-node.h>
 
+#include <libgda/sql-parser/gda-sql-parser.h>
+
 #include <libgda/gda-sql-builder.h>
 
 #include <libgda/gda-meta-store.h>
diff --git a/tests/value-holders/Makefile.am b/tests/value-holders/Makefile.am
index 9dc736b49..16456821b 100644
--- a/tests/value-holders/Makefile.am
+++ b/tests/value-holders/Makefile.am
@@ -20,16 +20,19 @@ common_sources = \
 check_holder_SOURCES = check_holder.c $(common_sources)
 check_holder_LDADD = $(JSON_GLIB_LIBS) \
        $(top_builddir)/libgda/libgda-5.0.la \
+       $(top_builddir)/libgda/sql-parser/libgda_sql_parser-5.0.la \
        $(COREDEPS_LIBS)
 
 check_set_SOURCES = check_set.c $(common_sources)
 check_set_LDADD = $(JSON_GLIB_LIBS) \
        $(top_builddir)/libgda/libgda-5.0.la \
+       $(top_builddir)/libgda/sql-parser/libgda_sql_parser-5.0.la \
        $(COREDEPS_LIBS)
 
 check_statement_SOURCES = check_statement.c $(common_sources)
 check_statement_LDADD = $(JSON_GLIB_LIBS) \
        $(top_builddir)/libgda/libgda-5.0.la \
+       $(top_builddir)/libgda/sql-parser/libgda_sql_parser-5.0.la \
        $(COREDEPS_LIBS)
 
 
diff --git a/tests/value-holders/common.c b/tests/value-holders/common.c
index ee07ae348..ef6ecd405 100644
--- a/tests/value-holders/common.c
+++ b/tests/value-holders/common.c
@@ -20,8 +20,6 @@
 #include <json-glib/json-glib.h>
 #endif
 
-static gchar *_json_quote_string (const gchar *str);
-
 void
 tests_common_display_value (const gchar *prefix, const GValue *value)
 {
@@ -226,72 +224,6 @@ tests_common_set_serialize (GdaSet *set)
        return str;
 }
 
-gchar *
-_json_quote_string (const gchar *str)
-{
-       gchar *retval, *rptr;
-       const gchar *sptr;
-       gint len;
-
-       if (!str)
-               return g_strdup ("null");
-
-       len = strlen (str);
-       retval = g_new (gchar, 2*len + 3);
-       *retval = '"';
-       for (rptr = retval+1, sptr = str; *sptr; sptr++, rptr++) {
-               switch (*sptr) {
-               case '"':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = *sptr;
-                       break;
-               case '\\':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = *sptr;
-                       break;
-               case '/':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = *sptr;
-                       break;
-               case '\b':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = 'b';
-                       break;
-               case '\f':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = 'f';
-                       break;
-               case '\n':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = 'n';
-                       break;
-               case '\r':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = 'r';
-                       break;
-               case '\t':
-                       *rptr = '\\';
-                       rptr++;
-                       *rptr = 't';
-                       break;
-               default:
-                       *rptr = *sptr;
-                       break;
-               }
-       }
-       *rptr = '"';
-       rptr++;
-       *rptr = 0;
-       return retval;
-}
-
 /*
  * Loads @filename where each line (terminated by a '\n') is in the form <id>|<text>, and lines starting
  * with a '#' will be ignored. The new hash table is indexed on the <id> part.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]