summaryrefslogtreecommitdiffabout
path: root/src/ellinika/cgi.scm4
Side-by-side diff
Diffstat (limited to 'src/ellinika/cgi.scm4') (more/less context) (ignore whitespace changes)
-rw-r--r--src/ellinika/cgi.scm425
1 files changed, 20 insertions, 5 deletions
diff --git a/src/ellinika/cgi.scm4 b/src/ellinika/cgi.scm4
index 8c9b54d..51f9570 100644
--- a/src/ellinika/cgi.scm4
+++ b/src/ellinika/cgi.scm4
@@ -1,6 +1,5 @@
-;;;; -*- scheme -*-
-;;;; Greek Dictionary Web Engine
-;;;; Copyright (C) 2005, 2007, 2010 Sergey Poznyakoff
+;;;; Greek Dictionary Web Engine -*- scheme -*-
+;;;; Copyright (C) 2005, 2007, 2010, 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
@@ -19,12 +18,28 @@
#:use-module (ellinika config)
#:use-module (ellinika i18n)
#:use-module ifelse(IFACE,[CGI],(www cgi),(guile-user))
+ #:use-module (ice-9 iconv)
+ #:use-module (rnrs bytevectors)
#:re-export (base-dir html-dir sysconf-dir locale-path
ellinika-sql-connection
config-file-name ))
-ifelse(IFACE,[CGI],,dnl
+ifelse(IFACE,[CGI],[
+(define-public cgi-script-name
+ (cgi:getenv 'script-name))
+(define-public cgi-server-hostname
+ (cgi:getenv 'server-hostname))
+(define-public cgi-server-protocol-name
+ (cgi:getenv 'server-protocol-name))
+(define-public cgi-server-protocol-version
+ (cgi:getenv 'server-protocol-version))
+(define-public (cgi:value-u8 key)
+ (let ((x (cgi:value key)))
+ (if x
+ (utf8->string (string->bytevector x "ISO-8859-1"))
+ x)))
+],[
(define form-data
(append
(parse-form-data
@@ -59,7 +74,7 @@ ifelse(IFACE,[CGI],,dnl
(set! cgi-server-protocol-version (substring server-protocol
(1+ slash))))))
-)
+])
;;; User-definable variables

Return to:

Send suggestions and report system problems to the System administrator.