aboutsummaryrefslogtreecommitdiff
path: root/src/gsql_lib.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2001-12-06 17:36:21 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2001-12-06 17:36:21 +0000
commit9339b8ad47f5ae70ac1567a3b87caadd78ed022a (patch)
tree46ee93b378bebbef132154a237a735cf3eb4f7d8 /src/gsql_lib.c
downloadgamma-9339b8ad47f5ae70ac1567a3b87caadd78ed022a.tar.gz
gamma-9339b8ad47f5ae70ac1567a3b87caadd78ed022a.tar.bz2
Initial revision
Diffstat (limited to 'src/gsql_lib.c')
-rw-r--r--src/gsql_lib.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/gsql_lib.c b/src/gsql_lib.c
new file mode 100644
index 0000000..fa28047
--- /dev/null
+++ b/src/gsql_lib.c
@@ -0,0 +1,47 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <guile-sql.h>
+#include <app.h>
+
+SCM
+scm_makenum (unsigned long val)
+{
+ if (SCM_FIXABLE ((long) val))
+ return SCM_MAKINUM (val);
+
+#ifdef SCM_BIGDIG
+ return scm_long2big (val);
+#else /* SCM_BIGDIG */
+ return scm_make_real ((double) val);
+#endif /* SCM_BIGDIG */
+}
+
+/*
+ * Chop off trailing whitespace. Return length of the resulting string
+ */
+int
+chop(char *str)
+{
+ int len;
+
+ for (len = strlen(str); len > 0 && isspace(str[len-1]); len--)
+ ;
+ str[len] = 0;
+ return len;
+}
+
+
+
+extern void
+gsql_init()
+{
+ gsql_conn_init();
+#ifdef USE_SQL_MYSQL
+ sql_register_iface(&mysql_iface);
+#endif
+#ifdef USE_SQL_PGSQL
+ sql_register_iface(&pgsql_iface);
+#endif
+}
+

Return to:

Send suggestions and report system problems to the System administrator.