summaryrefslogtreecommitdiffabout
path: root/src/gsql_conn.c
Side-by-side diff
Diffstat (limited to 'src/gsql_conn.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/gsql_conn.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/gsql_conn.c b/src/gsql_conn.c
index 4d53a03..64cec27 100644
--- a/src/gsql_conn.c
+++ b/src/gsql_conn.c
@@ -31,18 +31,18 @@ static long sql_connect_tag = -1;
/* SMOB functions: */
static SCM
-sql_connect_mark (SCM connect_smob)
+sql_connect_mark(SCM connect_smob)
{
struct sql_connect *conn = (struct sql_connect *)SCM_CDR(connect_smob);
- return sql_iftab[conn->iface].mark(conn);
+ if (sql_iftab[conn->iface].mark)
+ return sql_iftab[conn->iface].mark(conn);
}
-static scm_sizet
-sql_connect_free (SCM connect_smob)
+static size_t
+sql_connect_free(SCM connect_smob)
{
- scm_sizet size = sizeof(struct sql_connect);
struct sql_connect *conn = (struct sql_connect *)SCM_CDR(connect_smob);
- size += sql_iftab[conn->iface].free(conn);
+ sql_iftab[conn->iface].free(conn);
if (conn->hostname)
free(conn->hostname);
if (conn->username)
@@ -50,7 +50,7 @@ sql_connect_free (SCM connect_smob)
if (conn->database)
free(conn->database);
scm_gc_free(conn, sizeof *conn, "SQL connection");
- return size;
+ return 0;
}
static int
@@ -88,7 +88,7 @@ sql_find_iface(const char *name)
}
SCM
-sql_connect_create (char *name)
+sql_connect_create(char *name)
{
struct sql_connect *conn;
int iface = sql_find_iface(name);
@@ -97,16 +97,16 @@ sql_connect_create (char *name)
"Unknown SQL interface ~S",
scm_list_1(scm_from_locale_string(name)));
- conn = scm_gc_malloc (sizeof (*conn), "sql_connect");
+ conn = scm_gc_malloc(sizeof (*conn), "sql_connect");
memset(conn, 0, sizeof *conn);
conn->iface = iface;
- SCM_RETURN_NEWSMOB (sql_connect_tag, conn);
+ SCM_RETURN_NEWSMOB(sql_connect_tag, conn);
}
static int
-scm_is_sql_connect (SCM scm)
+scm_is_sql_connect(SCM scm)
{
- return SCM_NIMP (scm) && SCM_CAR (scm) == (SCM) sql_connect_tag;
+ return SCM_NIMP(scm) && SCM_CAR (scm) == (SCM) sql_connect_tag;
}
/* Interface */
@@ -134,7 +134,7 @@ gamma_cvt_iface(SCM inval, void *outval, const char *func_name)
}
-SCM_DEFINE_PUBLIC (sql_open_connection, "sql-open-connection", 1, 0, 0,
+SCM_DEFINE_PUBLIC(sql_open_connection, "sql-open-connection", 1, 0, 0,
(SCM param),
"Connect to a database. Take connection parameters from @var{param}, "
"which must be a list of conses. In each cons, the @samp{car} contains "
@@ -185,7 +185,7 @@ SCM_DEFINE_PUBLIC (sql_open_connection, "sql-open-connection", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE_PUBLIC (sql_close_connection, "sql-close-connection", 1, 0, 0,
+SCM_DEFINE_PUBLIC(sql_close_connection, "sql-close-connection", 1, 0, 0,
(SCM conn),
"Close connection to a database.")
#define FUNC_NAME s_sql_close_connection
@@ -198,7 +198,7 @@ SCM_DEFINE_PUBLIC (sql_close_connection, "sql-close-connection", 1, 0, 0,
}
#undef FUNC_NAME
-SCM_DEFINE_PUBLIC (sql_query, "sql-query", 2, 0, 0,
+SCM_DEFINE_PUBLIC(sql_query, "sql-query", 2, 0, 0,
(SCM conn, SCM query),
"Send the SQL query @var{query} to the server using connection @var{conn} \
and return the result.\n\

Return to:

Send suggestions and report system problems to the System administrator.