aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.cvsignore3
-rw-r--r--src/Makefile.am19
-rw-r--r--src/app.h13
-rw-r--r--src/gettext.scm29
-rw-r--r--src/gsql_conn.c88
-rw-r--r--src/gsql_lib.c29
-rw-r--r--src/guile-sql.h22
-rw-r--r--src/mysql.c48
-rw-r--r--src/pgsql.c44
9 files changed, 140 insertions, 155 deletions
diff --git a/src/.cvsignore b/src/.cvsignore
index cff4dcc..822742d 100644
--- a/src/.cvsignore
+++ b/src/.cvsignore
@@ -10,6 +10,3 @@ guile-procedures.txt
10gsql_conn.inc 10gsql_conn.inc
11gsql_lib.inc 11gsql_lib.inc
12sql.scm 12sql.scm
13gettext.inc
14gettext.scm
15
diff --git a/src/Makefile.am b/src/Makefile.am
index 8b44d37..c5d713b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
1# This file is part of guile-sql. 1# This file is part of guile-sql.
2# Copyright (C) 2002, Sergey Poznyakoff 2# Copyright (C) 2002, 2007, Sergey Poznyakoff
3# 3#
4# This file is free software; as a special exception the author gives 4# This file is free software; as a special exception the author gives
5# unlimited permission to copy and/or distribute it, with or without 5# unlimited permission to copy and/or distribute it, with or without
@@ -12,9 +12,8 @@
12INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @GUILE_INCLUDES@ @INCLUDEPATH@ 12INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @GUILE_INCLUDES@ @INCLUDEPATH@
13 13
14LIB_SQL=libguile-sql.la 14LIB_SQL=libguile-sql.la
15LIB_GETTEXT=libguile-gettext.la
16 15
17EXTRA_LTLIBRARIES=libguile-sql.la libguile-gettext.la 16EXTRA_LTLIBRARIES=libguile-sql.la
18 17
19lib_LTLIBRARIES=@BUILD_LIBS@ 18lib_LTLIBRARIES=@BUILD_LIBS@
20libguile_sql_la_LIBADD = @LTLIBOBJS@ @GUILE_LIBS@ 19libguile_sql_la_LIBADD = @LTLIBOBJS@ @GUILE_LIBS@
@@ -24,30 +23,22 @@ libguile_sql_la_SOURCES=\
24 23
25libguile_sql_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0 24libguile_sql_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0
26 25
27libguile_gettext_la_LIBADD = @GUILE_LIBS@ @LTLIBINTL@ 26noinst_HEADERS=guile-sql.h app.h
28libguile_gettext_la_SOURCES = gettext.c 27EXTRA_DIST=sql.sci gettext.scm
29
30libguile_gettext_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0
31
32
33noinst_HEADERS=guile-sql.h app.h gettext.h
34EXTRA_DIST=sql.sci gettext.sci
35 28
36.sci.scm: 29.sci.scm:
37 m4 -DVERSION=$(VERSION) -DLIBDIR=$(libdir) \ 30 m4 -DVERSION=$(VERSION) -DLIBDIR=$(libdir) \
38 -DBUILDDIR="`pwd`" $< > $@ 31 -DBUILDDIR="`pwd`" $< > $@
39 32
40sql.scm: Makefile $(libguile_sql_la_SOURCES:.c=.inc) 33sql.scm: Makefile $(libguile_sql_la_SOURCES:.c=.inc)
41gettext.scm: Makefile $(libguile_gettext_la_SOURCES:.c=.inc)
42 34
43SCM_SQL=sql.scm 35SCM_SQL=sql.scm
44X_SQL=gsql_conn.x 36X_SQL=gsql_conn.x
45 37
46SCM_GETTEXT=gettext.scm 38SCM_GETTEXT=gettext.scm
47X_GETTEXT=gettext.x
48 39
49guiledir=$(GUILE_SITE)/$(PACKAGE) 40guiledir=$(GUILE_SITE)/$(PACKAGE)
50guile_DATA=guile-procedures.txt @BUILD_DATA@ 41guile_DATA=guile-procedures.txt @BUILD_DATA@
51DOT_X_FILES=@BUILD_X@ 42DOT_X_FILES=@BUILD_X@
52DOT_DOC_FILES=$(DOT_X_FILES:.x=.doc) 43DOT_DOC_FILES=$(DOT_X_FILES:.x=.doc)
53CLEANFILES=*.inc *.x *.doc 44CLEANFILES=*.inc *.x *.doc
diff --git a/src/app.h b/src/app.h
index 56100c5..6b205ee 100644
--- a/src/app.h
+++ b/src/app.h
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002 Sergey Poznyakoff 2 Copyright (C) 2002 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#ifdef USE_SQL_MYSQL 17#ifdef USE_SQL_MYSQL
19extern struct sql_iface mysql_iface; 18extern struct sql_iface mysql_iface;
diff --git a/src/gettext.scm b/src/gettext.scm
new file mode 100644
index 0000000..a60bd59
--- /dev/null
+++ b/src/gettext.scm
@@ -0,0 +1,29 @@
1;;;; This file is part of gettext interface for guile.
2;;;; Copyright (C) 2004, 2007 Sergey Poznyakoff
3;;;;
4;;;; This program is free software; you can redistribute it and/or modify it
5;;;; under the terms of the GNU General Public License as published by the
6;;;; Free Software Foundation; either version 3 of the License, or (at your
7;;;; option) any later version.
8;;;;
9;;;; This program is distributed in the hope that it will be useful,
10;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12;;;; GNU General Public License for more details.
13;;;;
14;;;; You should have received a copy of the GNU General Public License along
15;;;; with this program. If not, see <http://www.gnu.org/licenses/>.
16
17
18(define-module (gamma gettext))
19
20(define (_ msgid)
21 (gettext msgid))
22
23(define (N_ msgid)
24 msgid)
25
26(export _)
27(export N_)
28
29;;;; EOF
diff --git a/src/gsql_conn.c b/src/gsql_conn.c
index 3a44c18..4a78094 100644
--- a/src/gsql_conn.c
+++ b/src/gsql_conn.c
@@ -1,19 +1,18 @@
1/* This file is part of guile-sql. 1/* This file is part of guile-sql.
2 Copyright (C) 2002, 2005 Sergey Poznyakoff 2 Copyright (C) 2002, 2005 Sergey Poznyakoff
3 3
4 This program is free software; you can redistribute it and/or modify 4 This program is free software; you can redistribute it and/or modify it
5 it under the terms of the GNU General Public License as published by 5 under the terms of the GNU General Public License as published by the
6 the Free Software Foundation; either version 2 of the License, or 6 Free Software Foundation; either version 3 of the License, or (at your
7 (at your option) any later version. 7 option) any later version.
8 8
9 This program is distributed in the hope that it will be useful, 9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. 12 GNU General Public License for more details.
13 13
14 You should have received a copy of the GNU General Public License 14 You should have received a copy of the GNU General Public License along
15 along with this program; if not, write to the Free Software Foundation, Inc., 15 with this program. If not, see <http://www.gnu.org/licenses/>. */
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
17 16
18#ifdef HAVE_CONFIG_H 17#ifdef HAVE_CONFIG_H
19# include <config.h> 18# include <config.h>
@@ -21,14 +20,14 @@
21#include <string.h> 20#include <string.h>
22#include <guile-sql.h> 21#include <guile-sql.h>
23#include <app.h> 22#include <app.h>
23#include <stdio.h>
24 24
25static int num_iface; 25static int num_iface;
26struct sql_iface sql_iftab[MAX_IFACES]; 26static struct sql_iface sql_iftab[MAX_IFACES];
27 27
28SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error"); 28SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error");
29 29
30 30static long sql_connect_tag = -1;
31long sql_connect_tag;
32 31
33/* SMOB functions: */ 32/* SMOB functions: */
34static SCM 33static SCM
@@ -50,7 +49,7 @@ sql_connect_free (SCM connect_smob)
50 free(conn->username); 49 free(conn->username);
51 if (conn->database) 50 if (conn->database)
52 free(conn->database); 51 free(conn->database);
53 free(conn); 52 scm_gc_free(conn, sizeof *conn, "SQL connection");
54 return size; 53 return size;
55} 54}
56 55
@@ -76,8 +75,8 @@ sql_connect_print (SCM connect_smob, SCM port, scm_print_state * pstate)
76 return 1; 75 return 1;
77} 76}
78 77
79int 78static int
80sql_find_iface(char *name) 79sql_find_iface(const char *name)
81{ 80{
82 int iface; 81 int iface;
83 82
@@ -95,15 +94,15 @@ sql_connect_create (char *name)
95 if (iface < 0) 94 if (iface < 0)
96 scm_misc_error("sql_connect_create", 95 scm_misc_error("sql_connect_create",
97 "Unknown SQL interface ~S", 96 "Unknown SQL interface ~S",
98 SCM_LIST1(scm_makfrom0str(name))); 97 scm_list_1(scm_makfrom0str(name)));
99 98
100 conn = scm_must_malloc (sizeof (*conn), "sql_connect"); 99 conn = scm_gc_malloc (sizeof (*conn), "sql_connect");
101 memset(conn, 0, sizeof *conn); 100 memset(conn, 0, sizeof *conn);
102 conn->iface = iface; 101 conn->iface = iface;
103 SCM_RETURN_NEWSMOB (sql_connect_tag, conn); 102 SCM_RETURN_NEWSMOB (sql_connect_tag, conn);
104} 103}
105 104