summaryrefslogtreecommitdiffabout
path: root/scm/dictrans.scm
authorSergey Poznyakoff <gray@gnu.org.ua>2010-03-09 22:31:34 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2010-03-09 22:31:34 (GMT)
commit150f2f64e4e580c0d6ab75d4bee150a4369cc4f1 (patch) (side-by-side diff)
tree8fdccbaafe764302ff42d9657dd0170d4d2c7e3f /scm/dictrans.scm
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 'scm/dictrans.scm') (more/less context) (ignore whitespace changes)
-rw-r--r--scm/dictrans.scm34
1 files changed, 16 insertions, 18 deletions
diff --git a/scm/dictrans.scm b/scm/dictrans.scm
index ae9b3f5..d76479e 100644
--- a/scm/dictrans.scm
+++ b/scm/dictrans.scm
@@ -2,7 +2,7 @@
=AUTOGENERATED=
!#
;;;; This file is part of Ellinika
-;;;; Copyright (C) 2004, 2005, 2007 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2007, 2010 Sergey Poznyakoff
;;;;
;;;; Ellinika is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
@@ -96,12 +96,7 @@
(define cleanup-option #f)
(define preserve-option #f)
-(define sql-iface "mysql")
-(define sql-host "localhost")
-(define sql-database "ellinika")
-(define sql-port 3306)
-(define sql-password #f)
-(define sql-username #f)
+(define ellinika-sql-connection '())
(define verbose-option #f)
(define debug-level 0)
(define input-files '())
@@ -125,6 +120,9 @@
rest)
(newline))))
+(define (add-conn-param key val)
+ (set! ellinika-sql-connection (cons (cons key val) ellinika-sql-connection)))
+
(define pos-xlat #f)
@@ -669,7 +667,8 @@
WHERE p.word = d.word AND p.type != 'CLOSED'")
(run-query
conn
- (if (string=? sql-iface "mysql")
+ (if (string=? (let ((x (assoc #:iface ellinika-sql-connection)))
+ (if x (cdr x) "")) "mysql")
"UPDATE pending_links p, dict d SET p.type='CLOSED' WHERE p.word = d.word"
;; Else assume SQL92
"UPDATE pending_links SET type='CLOSED' \
@@ -967,17 +966,17 @@ Informational options:
((cleanup)
(set! cleanup-option #t))
((database)
- (set! sql-database (cdr x)))
+ (add-conn-param #:db (cdr x)))
((host)
- (set! sql-host (cdr x)))
+ (add-conn-param #:host (cdr x)))
((port)
- (set! sql-port (string->number (cdr x))))
+ (add-conn-param #:port (string->number (cdr x))))
((password)
- (set! sql-password (cdr x)))
+ (add-conn-param #:pass (cdr x)))
((user)
- (set! sql-username (cdr x)))
+ (add-conn-param #:user (cdr x)))
((interface)
- (set! sql-iface (cdr x)))
+ (add-conn-param #:iface (cdr x)))
((verbose)
(set! verbose-option #t))
((preserve)
@@ -1006,8 +1005,7 @@ Informational options:
input-files)
(exit 0)))
-(let ((conn (sql-connect sql-iface sql-host sql-port sql-database
- sql-username sql-password)))
+(let ((conn (sql-open-connection ellinika-sql-connection)))
(if (not conn)
(begin
(display "Cannot connect to the database\n" (current-error-port))
@@ -1029,7 +1027,7 @@ Informational options:
(if (null? input-files)
(begin
- (sql-connect-close conn)
+ (sql-close-connection conn)
(exit 0)))
(get-dict-index conn)
@@ -1054,7 +1052,7 @@ Informational options:
(pending-fixup conn)
(update-stat conn)
- (sql-connect-close conn))
+ (sql-close-connection conn))
(exit 0)

Return to:

Send suggestions and report system problems to the System administrator.