aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am3
-rw-r--r--am/guile.m4110
-rw-r--r--configure.ac11
-rw-r--r--data/db.struct6
-rw-r--r--data/pl/Makefile.am4
-rw-r--r--data/ru/Makefile.am4
-rw-r--r--scm/dictrans.scm4
-rw-r--r--scm/neatrans.scm2
-rw-r--r--scm/verbop.scm4
-rw-r--r--src/cgi-bin/conj.scm49
-rw-r--r--src/cgi-bin/dict.scm428
-rw-r--r--src/cgi-bin/nea.scm422
-rw-r--r--src/ellinika/cgi.scm425
-rw-r--r--src/ellinika/i18n.scm6
-rw-r--r--xml/ru/ellinika.xml3
-rw-r--r--xml/ru/rhmata.xml8
16 files changed, 91 insertions, 158 deletions
diff --git a/Makefile.am b/Makefile.am
index 521b3e0..7fac923 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -32,25 +32,26 @@ install-html:
cd $(top_srcdir)/html/$$dir; \
if test -d $(DESTDIR)$(HTMLDIR)/$$dir; then \
:; \
else \
$(mkdir_p) $(DESTDIR)$(HTMLDIR)/$$dir; \
fi; \
for file in *.html; do \
${INSTALL} -m 644 $$file $(DESTDIR)$(HTMLDIR)/$$dir/$$file; \
done; \
if test -r $$top_srcdir/xml/$$dir/symlinks; then \
grep -v '^[ \t]*[;#]' $$top_srcdir/xml/$$dir/symlinks | \
sed 's,^/,_,;s,\\.\\./,__/,g' | \
- while read S T; do ln -sf $$S $$T; done; \
+ (cd $(DESTDIR)$(HTMLDIR)/$$dir; \
+ while read S T; do ln -sf $$S $$T; done); \
fi; \
cd $$here; \
fi; \
done
install-data-local: install-html
.PHONY: ChangeLog
ChangeLog:
$(AM_V_GEN)if test -d .git; then \
git log --pretty='format:%ct %an <%ae>%n%n%s%n%n%b%n' | \
awk -f $(top_srcdir)/git2chg.awk \
diff --git a/am/guile.m4 b/am/guile.m4
deleted file mode 100644
index c793a70..0000000
--- a/am/guile.m4
+++ /dev/null
@@ -1,110 +0,0 @@
-dnl This file is part of GNU mailutils.
-dnl Copyright (C) 2001,2004 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-dnl
-
-dnl MU_RESULT_ACTIONS -- generate shell code for the result of a test
-dnl $1 -- CVAR -- cache variable to check
-dnl $2 -- NAME -- if not empty, used to generate a default value TRUE:
-dnl `AC_DEFINE(HAVE_NAME)'
-dnl $2 -- TRUE -- what to do if the CVAR is not `no'
-dnl $3 -- FALSE -- what to do otherwise; defaults to `:'
-dnl
-AC_DEFUN([MU_RESULT_ACTIONS], [
-[if test "$$1" != "" -a "$$1" != no; then
- ]ifelse([$3], ,
- [AC_DEFINE(HAVE_]translit($2, [a-z ./<>], [A-Z___])[,1,[FIXME])],
- [$3])[
-else
- ]ifelse([$4], , [:], [$4])[
-fi]])dnl
-
-AC_DEFUN([MU_CHECK_GUILE],
-[
- if test "x$mu_cv_lib_guile" = x; then
- cached=""
- AC_PATH_PROG(GUILE_CONFIG, guile-config, no, $PATH)
- if test $GUILE_CONFIG = no; then
- mu_cv_lib_guile=no
- else
- GUILE_INCLUDES=`guile-config compile`
- GUILE_LIBS=`guile-config link`
- fi
-
- if test $GUILE_CONFIG != no; then
- AC_MSG_CHECKING(for guile version 1.6 or higher)
- GUILE_VERSION=`($GUILE_CONFIG --version 2>&1; echo '')|sed -n 's/guile-config - Guile version \([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\2/p'`
- case "x$GUILE_VERSION" in
- x[[0-9]]*)
- if test $GUILE_VERSION -lt 16; then
- AC_MSG_RESULT(Nope. Version number too low.)
- mu_cv_lib_guile=no
- else
- AC_DEFINE_UNQUOTED(GUILE_VERSION, $GUILE_VERSION,
- [Guile version number: MAX*10 + MIN])
- AC_MSG_RESULT(OK)
- save_LIBS=$LIBS
- save_CFLAGS=$CFLAGS
- LIBS="$LIBS $GUILE_LIBS"
- CFLAGS="$CFLAGS $GUILE_INCLUDES"
- AC_TRY_LINK([#include <libguile.h>],
- ifelse([$1], , scm_shell(0, NULL);, [$1]),
- [mu_cv_lib_guile=yes],
- [mu_cv_lib_guile=no])
- LIBS=$save_LIBS
- CFLAGS=$save_CFLAGS
- fi ;;
- *) AC_MSG_RESULT(Nope. Unknown version number)
- mu_cv_lib_guile=no;;
- esac
- fi
- else
- cached=" (cached) "
- GUILE_INCLUDES=`$GUILE_CONFIG compile`
- GUILE_LIBS=`$GUILE_CONFIG link`
- fi
- AC_MSG_CHECKING(whether to build guile support)
- MU_RESULT_ACTIONS([mu_cv_lib_guile],[LIBGUILE],[$2],[$3])
- AC_MSG_RESULT(${cached}$mu_cv_lib_guile)
-
- if test $mu_cv_lib_guile = yes; then
- AC_ARG_WITH([guiledir],
- AC_HELP_STRING([--with-guiledir=DIR],
- [Specify the directory to install guile modules to]),
- [case $withval in
- /*) GUILE_SITE=$withval;;
- yes) GUILE_SITE=`$GUILE_CONFIG info pkgdatadir`/site;;
- *) AC_MSG_ERROR([Argument to --with-guiledir must be an absolute directory name]);;
- esac],
- [GUILE_SITE=`$GUILE_CONFIG info pkgdatadir`/site
- pfx=$prefix
- test "x$pfx" = xNONE && pfx=$ac_default_prefix
- case $GUILE_SITE in
- $pfx/*) ;; # OK
- *) AC_MSG_WARN([guile site directory "$GUILE_SITE" lies outside your current prefix ($pfx).])
- GUILE_SITE='$(datadir)/guile/site'
- AC_MSG_WARN([Falling back to ${GUILE_SITE} instead. Use --with-guiledir to force using site directory.])
- ;;
- esac])
- fi
-
- AC_SUBST(GUILE_SITE)
- AC_SUBST(GUILE_INCLUDES)
- AC_SUBST(GUILE_LIBS)
-])
-
-
-
diff --git a/configure.ac b/configure.ac
index e545dfa..302f2df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,25 +8,25 @@
#
# Ellinika is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
AC_PREREQ(2.61)
-AC_REVISION(2015-01-06 14:33:57 gray)
+AC_REVISION(2015-01-07 14:56:15 gray)
AC_INIT(ellinika, 1.99.99, [gray+ellinika@gnu.org.ua])
AC_CONFIG_SRCDIR(src/cgi-bin/dict.scm4)
AC_CONFIG_AUX_DIR([build-aux])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([1.11 silent-rules no-exeext])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Enable silent rules by default:
AM_SILENT_RULES([yes])
## * Checks for programs.
@@ -49,25 +49,34 @@ RA_CHECK_LIB(mysqlclient,
[],
[AC_MSG_FAILURE([The required library libmysqlclient is not found or is unusable])],
[/usr/local/lib/mysql /usr/lib/mysql])
LIBS="$LIBS $ra_cv_lib_mysqlclient"
## **************
## Directories
## **************
AC_SUBST(GUILE_BINDIR)
+
GUILE_BINDIR=`guile-config info bindir`
+if test -z "$GUILE_BINDIR"; then
+ GUILE_BINDIR=`guile-config info prefix`
+ if test -n "$GUILE_BINDIR"; then
+ GUILE_BINDIR="$GUILE_BINDIR/bin"
+ else
+ AC_MSG_ERROR([Cannot determine guile bin directory])
+ fi
+fi
case `guile -c "(display (member \"$GUILE_SITE\" %load-path))(newline)"` in
\#f) GUILE_COMMENT=;;
*) GUILE_COMMENT=";;" ;;
esac
AC_SUBST(GUILE_COMMENT)
AC_SUBST(GUILE_SITE)
HTMLDIR='$(prefix)/ellinika'
AC_ARG_WITH(html-dir,
diff --git a/data/db.struct b/data/db.struct
index 1b2f160..61e3d25 100644
--- a/data/db.struct
+++ b/data/db.struct
@@ -1,14 +1,14 @@
-- This file is part of Ellinika
--- Copyright (C) 2004, 2005, 2007 Sergey Poznyakoff
+-- Copyright (C) 2004, 2005, 2007, 2015 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
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- Ellinika is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
@@ -151,14 +151,14 @@ CREATE TABLE news(
CREATE TABLE newsart(
ident int(32) not null, -- REL 7
lang varchar(8),
header varchar(255),
text blob,
UNIQUE(ident),
INDEX(lang)
);
----
-source dbverb.struct;
- \ No newline at end of file
+source ./dbverb.struct;
+
diff --git a/data/pl/Makefile.am b/data/pl/Makefile.am
index 8707cf2..0965f9b 100644
--- a/data/pl/Makefile.am
+++ b/data/pl/Makefile.am
@@ -1,24 +1,24 @@
# This file is part of Ellinika project.
-# Copyright (C) 2004, 2007 Sergey Poznyakoff
+# Copyright (C) 2004, 2007, 2015 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Ellinika is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
BASEXML=\
setup.xml\
0.xml
dict:
- $(top_builddir)/scm/dictrans $(BASEXML)
+ $(AM_V_GEN)LC_ALL=en_US.UTF-8 $(top_builddir)/scm/dictrans $(BASEXML)
diff --git a/data/ru/Makefile.am b/data/ru/Makefile.am
index 18d1441..b8eb7c7 100644
--- a/data/ru/Makefile.am
+++ b/data/ru/Makefile.am
@@ -1,14 +1,14 @@
# This file is part of Ellinika project.
-# Copyright (C) 2004, 2007 Sergey Poznyakoff
+# Copyright (C) 2004, 2007, 2015 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Ellinika is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
@@ -39,15 +39,15 @@ EXTRA_DIST=\
0.xml\
1.xml\
2.xml\
3.xml\
4.xml\
5.xml\
7.xml\
iliada.xml\
iliada/2.3.xml\
iliada/2.4.xml
dict:
- $(top_builddir)/scm/dictrans $(BASEXML)
+ $(AM_V_GEN)LC_ALL=en_US.UTF-8 $(top_builddir)/scm/dictrans $(BASEXML)
diff --git a/scm/dictrans.scm b/scm/dictrans.scm
index 2148929..9f1cfd5 100644
--- a/scm/dictrans.scm
+++ b/scm/dictrans.scm
@@ -1,17 +1,17 @@
#! =GUILE_BINDIR=/guile -s
=AUTOGENERATED=
!#
;;;; This file is part of Ellinika
-;;;; Copyright (C) 2004, 2005, 2007, 2010 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2007, 2010, 2015 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
;;;; the Free Software Foundation; either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; Ellinika is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
@@ -84,24 +84,26 @@
;;; Tailor this statement to your needs if necessary.
;=GUILE_COMMENT=;(set! %load-path (cons "=GUILE_SITE=" %load-path))
(set! %load-path (cons "/home/gray/linguae/ellinika/" %load-path))
(use-modules (xmltools xmltrans)
(gamma sql)
(ellinika xlat)
(ice-9 getopt-long))
(if (= (string->number (major-version)) 1)
(use-modules (ice-9 syncase)))
+(setlocale LC_ALL "")
+
(define compile-only #f)
(define cleanup-option #f)
(define preserve-option #f)
(define ellinika-sql-connection '())
(define verbose-option #f)
(define debug-level 0)
(define input-files '())
(define sysconf-dir "=SYSCONFDIR=")
(define config-file-name "ellinika.conf")
diff --git a/scm/neatrans.scm b/scm/neatrans.scm
index 333453f..4f0fea3 100644
--- a/scm/neatrans.scm
+++ b/scm/neatrans.scm
@@ -31,24 +31,26 @@
;;; Tailor this statement to your needs if necessary.
;=GUILE_COMMENT=;(set! %load-path (cons "=GUILE_SITE=" %load-path))
(set! %load-path (cons "/home/gray/linguae/ellinika/" %load-path))
(use-modules (xmltools xmltrans)
(gamma sql)
(ellinika xlat)
(ice-9 getopt-long))
(if (= (string->number (major-version)) 1)
(use-modules (ice-9 syncase)))
+(setlocale LC_ALL "")
+
(define compile-only #f)
(define cleanup-option #f)
(define force-option #f)
(define verbose-option #f)
(define debug-level 0)
(define input-files '())
(define sysconf-dir "=SYSCONFDIR=")
(define config-file-name "ellinika.conf")
(define dict-cgi-path #f)
diff --git a/scm/verbop.scm b/scm/verbop.scm
index 0ad0f90..b500213 100644
--- a/scm/verbop.scm
+++ b/scm/verbop.scm
@@ -1,19 +1,19 @@
#! /bin/sh
# aside from this initial boilerplate, this is actually -*- scheme -*- code
main='(module-ref (resolve-module '\''(src verbop)) '\'main')'
exec ${GUILE-guile} -l $0 -c "(apply $main (command-line))" "$@"
!#
;;;; This file is part of Ellinika
-;;;; Copyright (C) 2011 Sergey Poznyakoff
+;;;; Copyright (C) 2011, 2015 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
;;;; the Free Software Foundation; either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; Ellinika is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
@@ -22,24 +22,26 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (command-line))" "$@"
;;; Main procedure
(define-module (src verbop)
:export (verbop))
(use-modules (srfi srfi-1)
(xmltools xmltrans)
(ellinika elmorph)
(ellinika sql)
(ellinika tenses)
(ice-9 getopt-long))
+(setlocale LC_ALL "")
+
(define cleanup-option #f)
(define force-option #f)
(define debug-level 0)
(define input-files '())
(define flect-ident 0)
(define (next-flect-ident)
(set! flect-ident (1+ flect-ident))
flect-ident)
(define class-list '()) ; List of defined verb classes.
diff --git a/src/cgi-bin/conj.scm4 b/src/cgi-bin/conj.scm4
index 83fb846..6a49c62 100644
--- a/src/cgi-bin/conj.scm4
+++ b/src/cgi-bin/conj.scm4
@@ -1,32 +1,33 @@
;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 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
;;;; the Free Software Foundation; either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;;
;;; Tailor this statement to your needs if necessary.
(set! %load-path (cons "GUILE_SITE" %load-path))
+(setlocale LC_ALL "")
(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
(srfi srfi-1)
(ice-9 rdelim)
(ice-9 optargs)
(xmltools dict)
(ellinika config)
(ellinika elmorph)
(ellinika tenses)
(ellinika conjugator)
(ellinika sql)
(ellinika i18n)
(ellinika xlat)
@@ -52,25 +53,25 @@ ifelse(IFACE,[CGI],(cgi:init))
(define (main-form)
(format #t "<form action=\"~A\" method=\"post\">"
(make-cgi-name cgi-script-name))
(display "\
<table class=\"noframe\">
<tr>
<td>")
(display (_"Εισάγετε το ρήμα"))
(display "
</td>
<td>
<input size=\"36\" name=\"key\" tabindex=\"1\"")
- (let ((value (cgi:value "key")))
+ (let ((value (cgi:value-u8 "key")))
(if value
(begin
(display " value=\"")
(display (cgi-protect-quotes value))
(display "\""))))
(display " />
</td>
<td>
<input type=\"submit\" name=\"conjugate\" value=\"")
(display (_"Κλίση"))
(display "\" tabindex=\"2\" />
</td>
@@ -341,25 +342,25 @@ ifelse(IFACE,[CGI],(cgi:init))
((= i lim) #f)
(display "<tr>")
(do ((j i (+ j lim)))
((>= j result-length) #f)
(display "<td>")
(display-cross-reference (car (list-ref result j)))
(display "</td>"))
(display "</tr>")))
(display "</table>")))))
(define (do-conj)
- (let ((keyval (cgi:value "key")))
+ (let ((keyval (cgi:value-u8 "key")))
(if (and keyval (not (string-null? keyval)))
(let ((input (ellinika:translate-input
(let ((keyval keyval))
(cond
((string-suffix? "o'" keyval)
(string-set! keyval
(- (string-length keyval) 2) #\v))
((string-suffix? "o" keyval)
(string-set! keyval
(- (string-length keyval) 1) #\v)))
keyval))))
(cond
@@ -391,25 +392,25 @@ ifelse(IFACE,[CGI],(cgi:init))
(display "</div>"))
(define (conj-html)
(sql-catch-failure
(let ((explist (list
(cons "@@args@@"
(lambda ()
(for-each
(lambda (name)
(cond
((string=? name "lang"))
(else
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(cond ((and v (not (string-null? v)))
(display "&amp;")
(display name)
(display "=")
(display v)))))))
(cgi:names))))
(cons "@@conj@@"
(lambda ()
(dict-connect)
(main-form)
(do-conj)
(if (not (null? unattested))
diff --git a/src/cgi-bin/dict.scm4 b/src/cgi-bin/dict.scm4
index 77c1b3a..3b24367 100644
--- a/src/cgi-bin/dict.scm4
+++ b/src/cgi-bin/dict.scm4
@@ -1,36 +1,39 @@
;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 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
;;;; the Free Software Foundation; either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;;;
;;; Tailor this statement to your needs if necessary.
(set! %load-path (cons "GUILE_SITE" %load-path))
+(setlocale LC_ALL "")
+
(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
(ice-9 rdelim)
(xmltools dict)
(gamma sql)
+ (gamma syslog)
(ellinika elmorph)
(ellinika sql)
(ellinika i18n)
(ellinika xlat)
(ellinika cgi))
ifelse(IFACE,[CGI],(cgi:init))
(ellinika-cgi-init dict-template-file-name)
;; Τα μέρη του λόγου
(define part-of-speech '())
@@ -70,25 +73,25 @@ ifelse(IFACE,[CGI],(cgi:init))
"SELECT ident,title FROM topic WHERE category=~Q ORDER BY title"
(car category))))
(append category (if (null? topics)
'()
(list topics)))))
ctg)))))))
(if (not categories)
(set! categories (or (getcat) '())))
categories)))
(define (join-widget widget-id tabindex)
(let* ((name (string-append "join" widget-id))
- (selected-choice (or (let ((s (cgi:value name)))
+ (selected-choice (or (let ((s (cgi:value-u8 name)))
(if s
(string->number s)
#f))
0)))
(display (string-append "<select name=\""
name
"\" tabindex=\""
tabindex
"\">"))
(display "<option value=\"0\"")
(if (= selected-choice 0)
(display " selected=\"selected\""))
@@ -103,45 +106,45 @@ ifelse(IFACE,[CGI],(cgi:init))
(load-pos)
(display "<form action=\"")
(display (make-cgi-name cgi-script-name))
(display "\" method=\"post\">
<table class=\"noframe\">
<tr>
<td>")
(display (_"Εισάγετε τη λέξη"))
(display "
</td>
<td>
<input size=\"36\" name=\"key\" tabindex=\"1\"")
- (let ((value (cgi:value "key")))
+ (let ((value (cgi:value-u8 "key")))
(if value
(begin
(display " value=\"")
(display (cgi-protect-quotes value))
(display "\""))))
(display " />
</td>
</tr>")
(display "<tr><td colspan=\"3\" align=\"center\">")
(display (_"Συμπληρωματικοί όροι"))
(display "</td></tr>")
(display "
<tr>
<td>")
(display (_"Επιλέξτε το μέρος του λόγου"))
(display "</td><td>")
- (let ((selected-choice (or (let ((s (cgi:value "pos")))
+ (let ((selected-choice (or (let ((s (cgi:value-u8 "pos")))
(if s
(string->number s)
#f))
0))
(index 0))
(display "<select name=\"pos\" tabindex=\"2\">")
(for-each
(lambda (x)
(let ((name (car x)))
(display "<option value=\"")
@@ -157,25 +160,25 @@ ifelse(IFACE,[CGI],(cgi:init))
(display "</select>"))
(display "</td><td>")
(join-widget "pos" "3")
(display "</td></tr>")
(let ((tabindex 4))
(for-each
(lambda (category)
(display "<tr><td>")
(display (list-ref category 1))
(display "</td><td>")
- (let ((selected-choice (or (let ((s (cgi:value (list-ref category 0))))
+ (let ((selected-choice (or (let ((s (cgi:value-u8 (list-ref category 0))))
(if s
(string->number s)
#f))
0)))
(display (string-append
"<select name=\""
(list-ref category 0)
"\" tabindex=\""
(number->string tabindex)
"\">"))
(set! tabindex (1+ tabindex))
@@ -344,25 +347,25 @@ ifelse(IFACE,[CGI],(cgi:init))
(set! where-cond (cons (string-append
" dict.sound LIKE \""
(utf8-escape (ellinika:sounds-like key))
"%\"")
where-cond))))
(cond
((> (string->number pos) 0)
(let ((pos-entry
(list-ref part-of-speech (string->number pos))))
(if (or (not (string-null? key)) (not (null? theme)))
(set! where-cond (cons
- (if (string=? (cgi:value "joinpos") "0")
+ (if (string=? (cgi:value-u8 "joinpos") "0")
" AND"
" OR")
where-cond)))
(set! where-cond (cons
(string-append " (dict.pos & "
(cdr pos-entry)
") = "
(cdr pos-entry))
where-cond)))))
(let ((result
@@ -409,39 +412,38 @@ ifelse(IFACE,[CGI],(cgi:init))
((= i lim) #f)
(display "<tr>")
(do ((j i (+ j lim)))
((>= j result-length) #f)
(display "<td>")
(display-cross-reference (car (list-ref result j)))
(display "</td>"))
(display "</tr>")))
(display "</table>"))))))
(define (dict-search)
- (let ((keyval (if (cgi:value "ident")
- (dict:decode-string (cgi:value "ident"))
- (cgi:value "key")))
+ (let ((keyval (or (cgi:value-u8 "ident")
+ (cgi:value-u8 "key")))
(theme (do ((catlist (get-topic-list) (cdr catlist))
(ret '()))
((null? catlist) ret)
(let ((name (caar catlist)))
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(if (and v (> (string->number v) 0))
(set! ret (append
ret
(list (= (string->number
- (cgi:value (string-append "join" name))) 0)
+ (cgi:value-u8 (string-append "join" name))) 0)
v))))))))
- (pos (or (cgi:value "pos") "0")))
+ (pos (or (cgi:value-u8 "pos") "0")))
(sql-catch-failure
(cond
((and keyval
(not (string-null? keyval))
(null? theme)
(= (string->number pos) 0))
(display "<hr>")
(let* ((key (ellinika:translate-input keyval))
(result (ellinika:sql-query
"SELECT dict.word,dict.ident,pos.abbr,\
dict.forms,articles.subindex,articles.meaning,(dict.pos & conv(\"100000\",16,10))\
@@ -512,25 +514,25 @@ dict.forms,articles.subindex,articles.meaning,(dict.pos & conv(\"100000\",16,10)
(ellinika:sql-connect ellinika-sql-connection)))
(define (dict-html)
(sql-catch-failure
(let ((explist (list
(cons "@@args@@"
(lambda ()
(for-each
(lambda (name)
(cond
((string=? name "lang"))
(else
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(cond ((and v (not (string-null? v)))
(display "&amp;")
(display name)
(display "=")
(display v)))))))
(cgi:names))))
(cons "@@dict@@"
(lambda ()
(dict-connect)
(main-form)
(dict-search)))
(cons "@@stat_updated@@"
diff --git a/src/cgi-bin/nea.scm4 b/src/cgi-bin/nea.scm4
index f64aca2..e366a7c 100644
--- a/src/cgi-bin/nea.scm4
+++ b/src/cgi-bin/nea.scm4
@@ -1,14 +1,14 @@
;;;; News page for Ellinika
-;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011 Sergey Poznyakoff
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2010, 2011, 2015 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
;;;; the Free Software Foundation; either version 3 of the License, or
;;;; (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
@@ -21,25 +21,25 @@
(use-modules ifelse(IFACE,[CGI],(www cgi),(guile-user))
(ice-9 rdelim)
(xmltools dict)
(ellinika elmorph)
(ellinika sql)
(ellinika xlat)
(ellinika cgi)
(ellinika i18n))
ifelse(IFACE,[CGI],(cgi:init))
(define tmpl (if (and monima-nea-template-file-name
- (cgi:value "timestamp"))
+ (cgi:value-u8 "timestamp"))
monima-nea-template-file-name
nea-template-file-name))
(ellinika-cgi-init tmpl)
(define article #f)
(define accepted-lang (map
(lambda (s)
(cond
((string-split s #\;) =>
(lambda (l)
(car l)))
@@ -168,47 +168,47 @@ ifelse(IFACE,[CGI],(cgi:init))
(define (summary)
(catch-sql
(let* ((count (catch #t
(lambda ()
(string->number
(caar (ellinika:sql-query
"SELECT count(*) FROM news"))))
(lambda args
0)))
(from (catch #t
(lambda ()
- (let ((x (string->number (cgi:value "from"))))
+ (let ((x (string->number (cgi:value-u8 "from"))))
(if (< x count)
x
0)))
(lambda args
0)))
- (fwd (let ((dir (cgi:value "dir")))
+ (fwd (let ((dir (cgi:value-u8 "dir")))
(or (not dir)
(string=? dir "1"))))
(entries (collect-entries from fwd)))
(let ((start (car entries))
(result (cdr entries)))
(cond
((null? result)
(display "<div align=\"center\">")
(display (_ "Κανένα νέα"))
(display "</div>"))
(else
(let ((num-entries (length result))
(begin (if fwd from start))
(end (if fwd start from))
- (id (cgi:value "id")))
+ (id (cgi:value-u8 "id")))
(cond
((not (and (= from 0) (< num-entries nea-max-rows)))
(display "<p>")
(format #t (_ "Εγγραφείς ~A - ~A") begin end)
(display "</p>")))
(display "<table class=\"news-summary frame\">\n")
(let ((ctr 0)
(langlist (make-my-lang-list)))
(for-each
(lambda (entry)
@@ -264,25 +264,25 @@ ifelse(IFACE,[CGI],(cgi:init))
'())))
(display "\">")
(display (_ "Ερχόμενες"))
(display "</a></span>")))
(display "</div>"))))))))
(define (display-article-header item)
(display "<div id=\"news-header\">")
(format #t "<span class=\"itemdate\">~A</span>\n" (car item))
(display "<span class=\"itemsubject\">\n")
(display (list-ref item 2))
(display "</span>")
- (if (not (cgi:value "timestamp"))
+ (if (not (cgi:value-u8 "timestamp"))
(permalink "span" (list-ref item 1)))
(display "</div><!-- news-header -->"))
(define (display-article-text item . rest)
(let ((class (and (not (null? rest)) (car rest))))
(cond
(class
(display "\n<div class=\"")
(display class)
(display "\">\n")
(display (list-ref item 3))
(display "</div>\n"))
@@ -328,25 +328,25 @@ ifelse(IFACE,[CGI],(cgi:init))
(lambda ()
(catch-sql
(assert-article
(display-article-header
article)))))
(cons "@@args@@"
(lambda ()
(for-each
(lambda (name)
(cond
((string=? name "lang"))
(else
- (let ((v (cgi:value name)))
+ (let ((v (cgi:value-u8 name)))
(cond ((and v (not (string-null? v)))
(display "&amp;")
(display name)
(display "=")
(display v)))))))
(cgi:names)))))))
(do ((line (read-line) (read-line)))
((eof-object? line) #f)
(expand-template explist line)
(newline))))
@@ -426,45 +426,45 @@ ifelse(IFACE,[CGI],(cgi:init))
AND lang=~Q\
LIMIT 1"
(list-ref res 2) lang)))
(append
(list (list-ref res 0)
(list-ref res 1))
(car art)))))))
;;; Main
(cond
- ((cgi:value "rss")
+ ((cgi:value-u8 "rss")