r3088: *** empty log message ***
[kmrcl.git] / web-utils.lisp
index 52d94fb41dffdc907cfef6c9e6e533602ae7de14..f777f218b0dbf998cecd2f1db9153c4b35e9a065 100644 (file)
@@ -7,26 +7,37 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: web-utils.lisp,v 1.2 2002/10/06 13:30:17 kevin Exp $
+;;;; $Id: web-utils.lisp,v 1.8 2002/10/17 22:25:38 kevin Exp $
 ;;;;
-;;;; This file, part of Kmrcl, is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;;
-;;;; Kmrcl users are granted the rights to distribute and use this software
-;;;; as governed by the terms of the GNU General Public License.
+;;;; KMRCL users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;; *************************************************************************
 
 (in-package :kmrcl)
-(declaim (optimize (speed 3) (safety 1)))
+(declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3)))
 
 
 ;;; HTML/XML constants
 
-(defvar *std-xml-header* 
-  (format nil 
-  "<?xml version=\"1.0\" ?>~%<?xml-stylesheet type=\"text/css\" href=\"/umlsclass.css\" ?>~%~%"))
+(defvar *standard-xml-header* 
+  #.(format nil "<?xml version=\"1.0\" ?>~%<?xml-stylesheet type=\"text/css\" href=\"http://b9.com/umlsxml.css\" ?>~%~%"))
 
-(defun std-xml-header ()
-  *std-xml-header*)
+(defvar *standard-html-header* "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">")
+
+(defvar *standard-xhtml-header*
+  #.(format nil "<?xml version=\"1.0\" standalone=\"yes\"?>~%<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"))
+
+
+;;; User agent functions
+
+(defun user-agent-ie-p (agent)
+  "Takes a user-agent string and returns T for Internet Explorer."
+  (when (or (string-equal "Microsoft" (subseq agent 0 (length "Microsoft")))
+           (string-equal "Internet Explore" (subseq agent 0 (length "Internet Explore"))))
+    t))
 
 ;;; URL Functions
 
@@ -46,4 +57,3 @@
                                            (car var) "=" (cadr var) "&")))
                                  vars)))
                 "")))
-