diff options
Diffstat (limited to 'src/gsql_conn.c')
-rw-r--r-- | src/gsql_conn.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gsql_conn.c b/src/gsql_conn.c index 77fc60e..4a48de7 100644 --- a/src/gsql_conn.c +++ b/src/gsql_conn.c @@ -1,5 +1,5 @@ /* This file is part of guile-sql. - Copyright (C) 2002 Sergey Poznyakoff + Copyright (C) 2002, 2005 Sergey Poznyakoff This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,9 @@ int num_iface; struct sql_iface sql_iftab[MAX_IFACES]; +SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error"); + + long sql_connect_tag; /* SMOB functions: */ @@ -120,7 +123,8 @@ SCM_DEFINE (sql_connect, "sql-connect", 5, 1, 0, char *user; char *pass; int iface; - + struct sql_connect *conn; + if (SCM_IMP(IFACE) && SCM_INUMP(IFACE)) iface = SCM_INUM(IFACE); else if (SCM_STRINGP(IFACE)) @@ -157,13 +161,13 @@ SCM_DEFINE (sql_connect, "sql-connect", 5, 1, 0, smob = sql_iftab[iface].connect(hostname, port, dbname, user, pass, FUNC_NAME); - if (smob != SCM_BOOL_F) { - struct sql_connect *conn = (struct sql_connect *)SCM_CDR(smob); - conn->hostname = strdup(hostname); - conn->port = port; - conn->username = strdup(user); - conn->database = strdup(dbname); - } + + conn = (struct sql_connect *)SCM_CDR(smob); + conn->hostname = strdup(hostname); + conn->port = port; + conn->username = strdup(user); + conn->database = strdup(dbname); + return smob; } #undef FUNC_NAME |