diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/.cvsignore | 3 | ||||
-rw-r--r-- | src/Makefile.am | 17 | ||||
-rw-r--r-- | src/app.h | 13 | ||||
-rw-r--r-- | src/gettext.scm | 29 | ||||
-rw-r--r-- | src/gsql_conn.c | 78 | ||||
-rw-r--r-- | src/gsql_lib.c | 29 | ||||
-rw-r--r-- | src/guile-sql.h | 22 | ||||
-rw-r--r-- | src/mysql.c | 46 | ||||
-rw-r--r-- | src/pgsql.c | 44 |
9 files changed, 133 insertions, 148 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 | |||
10 | gsql_conn.inc | 10 | gsql_conn.inc |
11 | gsql_lib.inc | 11 | gsql_lib.inc |
12 | sql.scm | 12 | sql.scm |
13 | gettext.inc | ||
14 | gettext.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 @@ | |||
12 | INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @GUILE_INCLUDES@ @INCLUDEPATH@ | 12 | INCLUDES =-I$(top_builddir) -I$(srcdir) -I. @GUILE_INCLUDES@ @INCLUDEPATH@ |
13 | 13 | ||
14 | LIB_SQL=libguile-sql.la | 14 | LIB_SQL=libguile-sql.la |
15 | LIB_GETTEXT=libguile-gettext.la | ||
16 | 15 | ||
17 | EXTRA_LTLIBRARIES=libguile-sql.la libguile-gettext.la | 16 | EXTRA_LTLIBRARIES=libguile-sql.la |
18 | 17 | ||
19 | lib_LTLIBRARIES=@BUILD_LIBS@ | 18 | lib_LTLIBRARIES=@BUILD_LIBS@ |
20 | libguile_sql_la_LIBADD = @LTLIBOBJS@ @GUILE_LIBS@ | 19 | libguile_sql_la_LIBADD = @LTLIBOBJS@ @GUILE_LIBS@ |
@@ -24,27 +23,19 @@ libguile_sql_la_SOURCES=\ | |||
24 | 23 | ||
25 | libguile_sql_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0 | 24 | libguile_sql_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0 |
26 | 25 | ||
27 | libguile_gettext_la_LIBADD = @GUILE_LIBS@ @LTLIBINTL@ | 26 | noinst_HEADERS=guile-sql.h app.h |
28 | libguile_gettext_la_SOURCES = gettext.c | 27 | EXTRA_DIST=sql.sci gettext.scm |
29 | |||
30 | libguile_gettext_la_LDFLAGS = -rpath $(libdir) -version-info 0:0:0 | ||
31 | |||
32 | |||
33 | noinst_HEADERS=guile-sql.h app.h gettext.h | ||
34 | EXTRA_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 | ||
40 | sql.scm: Makefile $(libguile_sql_la_SOURCES:.c=.inc) | 33 | sql.scm: Makefile $(libguile_sql_la_SOURCES:.c=.inc) |
41 | gettext.scm: Makefile $(libguile_gettext_la_SOURCES:.c=.inc) | ||
42 | 34 | ||
43 | SCM_SQL=sql.scm | 35 | SCM_SQL=sql.scm |
44 | X_SQL=gsql_conn.x | 36 | X_SQL=gsql_conn.x |
45 | 37 | ||
46 | SCM_GETTEXT=gettext.scm | 38 | SCM_GETTEXT=gettext.scm |
47 | X_GETTEXT=gettext.x | ||
48 | 39 | ||
49 | guiledir=$(GUILE_SITE)/$(PACKAGE) | 40 | guiledir=$(GUILE_SITE)/$(PACKAGE) |
50 | guile_DATA=guile-procedures.txt @BUILD_DATA@ | 41 | guile_DATA=guile-procedures.txt @BUILD_DATA@ |
@@ -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 |
19 | extern struct sql_iface mysql_iface; | 18 | extern 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 | ||
25 | static int num_iface; | 25 | static int num_iface; |
26 | struct sql_iface sql_iftab[MAX_IFACES]; | 26 | static struct sql_iface sql_iftab[MAX_IFACES]; |
27 | 27 | ||
28 | SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error"); | 28 | SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error"); |
29 | 29 | ||
30 | 30 | static long sql_connect_tag = -1; | |
31 | long sql_connect_tag; | ||
32 | 31 | ||
33 | /* SMOB functions: */ | 32 | /* SMOB functions: */ |
34 | static SCM | 33 | static 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 | ||
79 | int | 78 | static int |
80 | sql_find_iface(char *name) | 79 | sql_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 | ||
106 | int | 105 | static int |
107 | scm_is_sql_connect (SCM scm) | 106 | scm_is_sql_connect (SCM scm) |
108 | { |