(in-package "KPML")

;;; File: copyrights.lisp
;;;
;;; For printing headers for created resources, etc.
;;; 2.1 default is that there is no copyright!
;;;

;;; ----------------------------------------------------------------------
;;; 4.0 following is for parameterizing XML headers...

(defvar xmlns-url "'http://www.fb10.uni-bremen.de/anglistik/langpro/kpml/README.html'")
(defvar xsi-url   "'http://www.w3.org/2001/XMLSchema-instance'")
(defvar xsi-schemaloc-systems 
  "'http://www.fb10.uni-bremen.de/anglistik/langpro/kpml/README.html ../../system_schema.xsd'")
(defvar xsi-schemaloc-choosers 
  "'http://www.fb10.uni-bremen.de/anglistik/langpro/kpml/README.html ../../chooser_schema.xsd'")
(defvar xsi-schemaloc-inquiries
  "'http://www.fb10.uni-bremen.de/anglistik/langpro/kpml/README.html ../../inquiry_schema.xsd'")
(defvar xsi-schemaloc-lexical-items
  "'http://www.fb10.uni-bremen.de/anglistik/langpro/kpml/README.html ../../lexicon_schema.xsd'")
(defvar xsi-schemaloc-examples
  "'http://www.fb10.uni-bremen.de/anglistik/langpro/kpml/README.html ../../examples_schema.xsd'")


(defvar *xml-encoding* "UTF-8")
;;; ----------------------------------------------------------------------

;;;
;;; 4.0 File preludes and postludes...
;;;

;;;
;;; 4.0 utilities for breaking out declarations and conditionalizing
;;;     according to whether we are writing XML or not...

(defun PRINT-OPENER (type &optional (stream T))
  ;; this is done for the moment in the copyright printer. This 
  ;; will have to change.
  
  (case *object-output-mode*
	(:ascii nil)
	(:xml
	 (format stream "<?xml version=\"1.0\" encoding=~S ?>" *xml-encoding* )
	 (case type
	       (:systems
		(format stream 
			"~%<SYSTEMS xmlns=~A xmlns:xsi=~A xsi:schemaLocation=~A >~%"
			xmlns-url xsi-url xsi-schemaloc-systems)
		)
	       (:choosers
		(format stream 
			"~%<CHOOSERS xmlns=~A xmlns:xsi=~A xsi:schemaLocation=~A >~%"
			xmlns-url xsi-url xsi-schemaloc-choosers))
	       (:inquiries
		(format stream 
			"~%<INQUIRIES xmlns=~A xmlns:xsi=~A xsi:schemaLocation=~A >~%"
			xmlns-url xsi-url xsi-schemaloc-inquiries))
	       (:lexemes
		(format stream 
			"~%<LEXICON xmlns=~A xmlns:xsi=~A xsi:schemaLocation=~A >~%"
			xmlns-url xsi-url xsi-schemaloc-lexical-items))
               (:examples
		(format stream 
			"~%<EXAMPLES xmlns=~A xmlns:xsi=~A xsi:schemaLocation=~A >~%"
			xmlns-url xsi-url xsi-schemaloc-examples))
	       (t
		nil
		)))))

(defun PRINT-CLOSER (type &optional (stream T))
  (ecase *object-output-mode*
	 (:xml   
	  (format stream "</~A>" type))
	 (:ascii 
	  (when (ml-p) (format stream "~3%(end-region)~3%")))))

;;; ----------------------------------------------------------------------
;;; Note: there is some fairly gross stuff that happens when ACL-PC 3.0
;;; writes out these copyright strings if they do not have the
;;; PC control-M in them. This will  have to be watched and made
;;; more portably robust at some stage if necessary. 
;;;
;;; 4.0 old copyright strings moved to end of file and ignored.

(defvar *current-copyright-notice* nil)

(defvar *bremen-copyright-notice* "

;;;==========================================================================;;;
;;;                                                                          ;;;
;;;                                                                          ;;;
;;; Copyright (c) John Bateman                                               ;;;
;;; University of Bremen                                                     ;;;
;;; FB-10, Sprach- und Literaturwissenschaften                               ;;;
;;; 1999-2004                                                                ;;;
;;;                                                                          ;;;
;;;    Bremen, Germany                                                       ;;;
;;;                                                                          ;;;
;;; Use and copying of this software/information and preparation of          ;;;
;;; derivative works based upon this software/information are permitted,     ;;;
;;; so long as the following conditions are met:                             ;;;
;;;      o no fees or compensation are charged for use, copies, or           ;;;
;;;        access to this software/information                               ;;;
;;;      o this copyright notice is included intact.                         ;;;
;;; This software is made available AS IS, and no warranty is made about     ;;;
;;; the software, its performance, the linguistic information, or its        ;;;
;;; coverage or accuracy.                                                    ;;;
;;;                                                                          ;;;
;;; Please send bug reports, comments and suggestions to                     ;;;
;;;      bateman@uni-bremen.de                                               ;;;
;;;                                                                          ;;;
;;;==========================================================================;;;

")


  ;; 4.0 added mode to this function for being aware of XML output...
  ;; 
(defun PRINT-MODE-AND-COPYRIGHT 
    (stream &key 
	    (copyright-notice *current-copyright-notice*)
	    (mode *object-output-mode*))
    (case mode 
	  (:ascii
	   (format stream "(in-package \"KPML\")")
	   (when copyright-notice
	     (format stream "~2%~a ~2%" copyright-notice))
	   (format stream "~2%;;; File creation information: 
;;; ~a at ~a.~3%" (time-stamp) (short-site-name)))

	  (:xml
	   (when copyright-notice
	     (format stream "~%<! -- ~a -->" copyright-notice))
	   (format stream "~%<COMMENTS>")
	   (format stream "~%;;; File creation information: ~% ~a at ~a."
		   (time-stamp) (short-site-name))
	   (format stream "~%</COMMENTS>")
	   )))


;;; ======================================================================
;;; OLD COPYRIGHT NOTICES...

(defvar *isi-copyright-notice* "  
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;COPYRIGHT (C) UNIVERSITY OF SOUTHERN CALIFORNIA, 1987, 1988, 1989, 1990,      ;
;                                                 1991, 1992                   ;
;University Of Southern California, Information Sciences Institute             ;
;4676 Admiralty Way                                                            ;
;Marina Del Rey, California 90292                                              ;
;                                                                              ;
;This software was partially developed under National Science Foundation       ;
;Grant IST-8408726, Federal Contract numbers MDA903-81-C-0335,                 ;
;MDA903-87-C-0641, F49620-84-C-0100, and F49620-87-C-0005, and the             ;
;Government holds license rights under DAR 7-104.9 (a)(c)(1).  It is           ;
;transmitted outside of the University of Southern California only under       ;
;written license agreements or software exchange agreements, and its use       ;
;is limited by these agreements.  At no time shall any recipient use this      ;
;software in any manner which conflicts or interferes with the                 ;
;governmental license rights or other provisions of the governing              ;
;agreement under which it is obtained.  It is supplied \"AS IS,\" without        ;
;any warranties of any kind.  It is furnished only on the basis that any       ;
;party who receives it indemnifies and holds harmless the parties who          ;
;furnish and originate it against any claims, demands or liabilities           ;
;connected with using it, furnishing it to others or providing it to a         ;
;third party.  THIS NOTICE MUST NOT BE REMOVED FROM THE SOFTWARE, AND IN       ;
;THE EVENT THAT THE SOFTWARE IS DIVIDED, IT SHOULD BE ATTACHED TO EVERY        ;
;PART.                                                                         ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
")

(defvar *ipsi-copyright-notice* "
;;;==========================================================================;;;
;;;                                                                          ;;;
;;;                                                                          ;;;
;;; Copyright (c) GMD/Institut fuer Integrierte Publikations-                ;;;
;;; und Informationssysteme, 1992, 1994, 1997                                ;;;
;;;                                                                          ;;;
;;;    Projekt KOMET                                                         ;;;
;;;    GMD-IPSI, Dolivostr. 15                                               ;;;
;;;                                                                          ;;;
;;;    D-64293 Darmstadt                                                     ;;;
;;;    Germany                                                               ;;;
;;;                                                                          ;;;
;;; This software  is transmitted outside of GMD-IPSI only under written     ;;;
;;; license agreements or software exchange agreements, and its use is       ;;;
;;; limited by these agreements.  At no time shall any recipient use this    ;;;
;;; software in any manner which conflicts or interferes with the            ;;;
;;; governmental license rights or other provisions of the governing         ;;;
;;; agreement under which it is obtained.  It is supplied as is, without     ;;;
;;; any warranties of any kind.  It is furnished only on the basis that any  ;;;
;;; party who receives it indemnifies and holds harmless the parties who     ;;;
;;; furnish and originate it against any claims, demands or liabilities      ;;;
;;; connected with using it, furnishing it to others or providing it to a    ;;;
;;; third party. This notice must not be removed from the software, and in   ;;;
;;; the event that the software is divided, it should be attached to every   ;;;
;;; part.                                                                    ;;;
;;;==========================================================================;;;
")

(setf *stirling-copyright-notice* "

;;;=========================================================================;;;
;;;                                                                          ;;;
;;;                                                                          ;;;
;;; Copyright (c) University of Stirling,                                    ;;; 
;;; Communication and Language Research                                      ;;;
;;; 1997                                                                     ;;;
;;;                                                                          ;;;
;;;    Stirling, FK9 4LA, Scotland, U.K.                                     ;;;
;;;                                                                          ;;;
;;; This software  is transmitted outside of U.Stirling only under written   ;;;
;;; license agreements or software exchange agreements, and its use is       ;;;
;;; limited by these agreements.  At no time shall any recipient use this    ;;;
;;; software in any manner which conflicts or interferes with the            ;;;
;;; governmental license rights or other provisions of the governing         ;;;
;;; agreement under which it is obtained.  It is supplied as is, without     ;;;
;;; any warranties of any kind.  It is furnished only on the basis that any  ;;;
;;; party who receives it indemnifies and holds harmless the parties who     ;;;
;;; furnish and originate it against any claims, demands or liabilities      ;;;
;;; connected with using it, furnishing it to others or providing it to a    ;;;
;;; third party. This notice must not be removed from the software, and in   ;;;
;;; the event that the software is divided, it should be attached to every   ;;;
;;; part.                                                                    ;;;
;;;==========================================================================;;;
")
