aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-03-09 22:31:34 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2010-03-09 22:31:34 +0000
commit150f2f64e4e580c0d6ab75d4bee150a4369cc4f1 (patch)
tree8fdccbaafe764302ff42d9657dd0170d4d2c7e3f /src
parent7968cb70a5dcbf57af5884f28dafe188fc6415c5 (diff)
downloadellinika-150f2f64e4e580c0d6ab75d4bee150a4369cc4f1.tar.gz
ellinika-150f2f64e4e580c0d6ab75d4bee150a4369cc4f1.tar.bz2
Update for newer Gamma.
* scm/dictrans.scm: Use Gamma 1.99 syntax. * scm/neatrans.scm: Likewise. * src/ellinika/dico.scm: Likewise. * src/cgi-bin/dict.scm4: Likewise. * src/cgi-bin/nea.scm4: Likewise. * src/ellinika/cgi.scm4 (sql-iface) (sql-host,sql-port,sql-database) (sql-username,sql-password): Remove reexports. (ellinika-sql-connection): New reexport. * src/ellinika/config.scm4 (sql-iface) (sql-host,sql-port,sql-database) (sql-username,sql-password): Remove variables. (ellinika-sql-connection): New variable. git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@541 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'src')
-rw-r--r--src/cgi-bin/dict.scm49
-rw-r--r--src/cgi-bin/nea.scm48
-rw-r--r--src/ellinika/cgi.scm45
-rw-r--r--src/ellinika/config.scm412
-rw-r--r--src/ellinika/dico.scm9
5 files changed, 15 insertions, 28 deletions
diff --git a/src/cgi-bin/dict.scm4 b/src/cgi-bin/dict.scm4
index c9f895b..4d301fb 100644
--- a/src/cgi-bin/dict.scm4
+++ b/src/cgi-bin/dict.scm4
@@ -1,5 +1,5 @@
;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2004, 2005, 2006, 2007 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010 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
@@ -51,14 +51,13 @@ ifelse(IFACE,[CGI],(cgi:init))
(if (not db-connection)
(begin
(set! db-connection
- (sql-connect
- sql-iface sql-host sql-port sql-database
- sql-username sql-password))
+ (sql-open-connection
+ ellinika-sql-connection))
(sql-query db-connection "SET NAMES utf8")
)))
(else
(if db-connection
- (sql-connect-close db-connection))
+ (sql-close-connection db-connection))
(set! db-connection #f)))
db-connection)))
diff --git a/src/cgi-bin/nea.scm4 b/src/cgi-bin/nea.scm4
index e490a59..b5a9af0 100644
--- a/src/cgi-bin/nea.scm4
+++ b/src/cgi-bin/nea.scm4
@@ -1,5 +1,5 @@
;;;; News page for Ellinika
-;;;; Copyright (C) 2004, 2005, 2006, 2007 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010 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
@@ -380,9 +380,7 @@ ifelse(IFACE,[CGI],(cgi:init))
</rss>"))
(define (nea-sql-connect)
- (let ((conn (sql-connect
- sql-iface sql-host sql-port sql-database
- sql-username sql-password)))
+ (let ((conn (sql-open-connection ellinika-sql-connection)))
(sql-query conn "SET NAMES utf8")
conn))
@@ -507,7 +505,7 @@ ifelse(IFACE,[CGI],(cgi:init))
(template-file target-language tmpl)
nea-html)
- (sql-connect-close conn))
+ (sql-close-connection conn))
(lambda (key err descr)
(with-input-from-file
diff --git a/src/ellinika/cgi.scm4 b/src/ellinika/cgi.scm4
index 38fd3de..c7fbdb6 100644
--- a/src/ellinika/cgi.scm4
+++ b/src/ellinika/cgi.scm4
@@ -1,6 +1,6 @@
;;;; -*- scheme -*-
;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2005, 2007 Sergey Poznyakoff
+;;;; Copyright (C) 2005, 2007, 2010 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
@@ -20,8 +20,7 @@
#:use-module (ellinika i18n)
#:use-module ifelse(IFACE,[CGI],(www cgi),(guile-user))
#:re-export (base-dir html-dir sysconf-dir locale-path
- sql-iface sql-host sql-port sql-database
- sql-username sql-password
+ ellinika-sql-connection
config-file-name ))
diff --git a/src/ellinika/config.scm4 b/src/ellinika/config.scm4
index 8032409..3b2bcbe 100644
--- a/src/ellinika/config.scm4
+++ b/src/ellinika/config.scm4
@@ -1,6 +1,6 @@
;;;; -*- scheme -*-
;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2005, 2007, 2008 Sergey Poznyakoff
+;;;; Copyright (C) 2005, 2007, 2008, 2010 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
@@ -22,15 +22,7 @@
(define-public html-dir "HTMLDIR")
(define-public sysconf-dir "SYSCONFDIR")
(define-public locale-path "LOCALEDIR:/usr/share/locale:/usr/local/share/locale")
-(define-public sql-iface "mysql") ;; SQL interface ("mysql" or "postgres")
-;; SQL server hostname or a path to the UNIX socket
-(define-public sql-host "localhost")
-(define-public sql-port 3306) ;; SQL port number (0 for sockaddr_un
- ;; connection)
-(define-public sql-database "ellinika") ;; Name of the database
-(define-public sql-username "gray") ;; Database user name
-(define-public sql-password "") ;; Password for that user name
-
+(define-public ellinika-sql-connection '())
(define-public config-file-name "ellinika.conf")
(define-public (ellinika-config-setup)
diff --git a/src/ellinika/dico.scm b/src/ellinika/dico.scm
index de564c2..7c04db2 100644
--- a/src/ellinika/dico.scm
+++ b/src/ellinika/dico.scm
@@ -1,5 +1,5 @@
;;;; A Dico module for Greek Dictionary Web Engine -*- scheme -*-
-;;;; Copyright (C) 2008 Sergey Poznyakoff
+;;;; Copyright (C) 2008, 2010 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
@@ -75,9 +75,8 @@
(else
(dico-error "Unknown option " (car av))))))
rest)
- (let ((db-connection (sql-connect
- sql-iface sql-host sql-port sql-database
- sql-username sql-password)))
+ (let ((db-connection (sql-open-connection
+ ellinika-sql-connection)))
(sql-query db-connection "SET NAMES utf8")
(list db-connection target-language type))))
@@ -86,7 +85,7 @@
(defmacro dbh:type (dbh) `(list-ref ,dbh 2))
(define (close-module dbh)
- (sql-connect-close (dbh:conn dbh)))
+ (sql-close-connection (dbh:conn dbh)))
(define descr-list
'(("pl" . "Słownik grecko-polski")

Return to:

Send suggestions and report system problems to the System administrator.