1.0.27.31: repeatable fasl header and debug-source
[sbcl.git] / src / code / external-formats / enc-iso.lisp
index dba365b..a6f446c 100644 (file)
@@ -1,4 +1,4 @@
-(in-package #:sb!impl)
+(in-package "SB!IMPL")
 
 (define-unibyte-mapper iso-8859-2->code-mapper code->iso-8859-2-mapper
   (#xA1 #x0104) ; LATIN CAPITAL LETTER A WITH OGONEK
 )
 
 (declaim (inline get-iso-8859-2-bytes))
-(defun get-iso-8859-2-bytes(string pos end)
+(defun get-iso-8859-2-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-2-mapper :iso-8859-2 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-2-mapper :iso-8859-2 string pos))
 
 (defun string->iso-8859-2 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-2->string)
 
-(push '((:iso-8859-2 :|iso-8859-2| :latin-2 :|latin-2|)
-        iso-8859-2->string-aref string->iso-8859-2)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-2 :|iso-8859-2| :latin-2 :|latin-2|)
+                          '(iso-8859-2->string-aref string->iso-8859-2))
 
 (define-external-format (:iso-8859-2 :|iso-8859-2| :latin-2 :|latin-2|)
     1 t
     (let ((iso-8859-2-byte (code->iso-8859-2-mapper bits)))
       (if iso-8859-2-byte
           (setf (sap-ref-8 sap tail) iso-8859-2-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-2->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-3->code-mapper code->iso-8859-3-mapper
   (#xA1 #x0126) ; LATIN CAPITAL LETTER H WITH STROKE
 )
 
 (declaim (inline get-iso-8859-3-bytes))
-(defun get-iso-8859-3-bytes(string pos end)
+(defun get-iso-8859-3-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-3-mapper :iso-8859-3 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-3-mapper :iso-8859-3 string pos))
 
 (defun string->iso-8859-3 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-3->string)
 
-(push '((:iso-8859-3 :|iso-8859-3| :latin-3 :|latin-3|)
-        iso-8859-3->string-aref string->iso-8859-3)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-3 :|iso-8859-3| :latin-3 :|latin-3|)
+                          '(iso-8859-3->string-aref string->iso-8859-3))
 
 (define-external-format (:iso-8859-3 :|iso-8859-3| :latin-3 :|latin-3|)
     1 t
     (let ((iso-8859-3-byte (code->iso-8859-3-mapper bits)))
       (if iso-8859-3-byte
           (setf (sap-ref-8 sap tail) iso-8859-3-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-3->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-4->code-mapper code->iso-8859-4-mapper
   (#xA1 #x0104) ; LATIN CAPITAL LETTER A WITH OGONEK
 )
 
 (declaim (inline get-iso-8859-4-bytes))
-(defun get-iso-8859-4-bytes(string pos end)
+(defun get-iso-8859-4-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-4-mapper :iso-8859-4 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-4-mapper :iso-8859-4 string pos))
 
 (defun string->iso-8859-4 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-4->string)
 
-(push '((:iso-8859-4 :|iso-8859-4| :latin-4 :|latin-4|)
-        iso-8859-4->string-aref string->iso-8859-4)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-4 :|iso-8859-4| :latin-4 :|latin-4|)
+                          '(iso-8859-4->string-aref string->iso-8859-4))
 
 (define-external-format (:iso-8859-4 :|iso-8859-4| :latin-4 :|latin-4|)
     1 t
     (let ((iso-8859-4-byte (code->iso-8859-4-mapper bits)))
       (if iso-8859-4-byte
           (setf (sap-ref-8 sap tail) iso-8859-4-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-4->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-5->code-mapper code->iso-8859-5-mapper
   (#xA1 #x0401) ; CYRILLIC CAPITAL LETTER IO
 )
 
 (declaim (inline get-iso-8859-5-bytes))
-(defun get-iso-8859-5-bytes(string pos end)
+(defun get-iso-8859-5-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-5-mapper :iso-8859-5 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-5-mapper :iso-8859-5 string pos))
 
 (defun string->iso-8859-5 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-5->string)
 
-(push '((:iso-8859-5 :|iso-8859-5|)
-        iso-8859-5->string-aref string->iso-8859-5)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-5 :|iso-8859-5|)
+                          '(iso-8859-5->string-aref string->iso-8859-5))
 
 (define-external-format (:iso-8859-5 :|iso-8859-5|)
     1 t
     (let ((iso-8859-5-byte (code->iso-8859-5-mapper bits)))
       (if iso-8859-5-byte
           (setf (sap-ref-8 sap tail) iso-8859-5-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-5->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-6->code-mapper code->iso-8859-6-mapper
   (#xA1 nil)
 )
 
 (declaim (inline get-iso-8859-6-bytes))
-(defun get-iso-8859-6-bytes(string pos end)
+(defun get-iso-8859-6-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-6-mapper :iso-8859-6 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-6-mapper :iso-8859-6 string pos))
 
 (defun string->iso-8859-6 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-6->string)
 
-(push '((:iso-8859-6 :|iso-8859-6|)
-        iso-8859-6->string-aref string->iso-8859-6)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-6 :|iso-8859-6|)
+                          '(iso-8859-6->string-aref string->iso-8859-6))
 
 (define-external-format (:iso-8859-6 :|iso-8859-6|)
     1 t
     (let ((iso-8859-6-byte (code->iso-8859-6-mapper bits)))
       (if iso-8859-6-byte
           (setf (sap-ref-8 sap tail) iso-8859-6-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-6->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-7->code-mapper code->iso-8859-7-mapper
   (#xA1 #x02BD) ; MODIFIER LETTER REVERSED COMMA
 )
 
 (declaim (inline get-iso-8859-7-bytes))
-(defun get-iso-8859-7-bytes(string pos end)
+(defun get-iso-8859-7-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-7-mapper :iso-8859-7 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-7-mapper :iso-8859-7 string pos))
 
 (defun string->iso-8859-7 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-7->string)
 
-(push '((:iso-8859-7 :|iso-8859-7|)
-        iso-8859-7->string-aref string->iso-8859-7)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-7 :|iso-8859-7|)
+                          '(iso-8859-7->string-aref string->iso-8859-7))
 
 (define-external-format (:iso-8859-7 :|iso-8859-7|)
     1 t
     (let ((iso-8859-7-byte (code->iso-8859-7-mapper bits)))
       (if iso-8859-7-byte
           (setf (sap-ref-8 sap tail) iso-8859-7-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-7->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-8->code-mapper code->iso-8859-8-mapper
   (#xA1 nil)
 )
 
 (declaim (inline get-iso-8859-8-bytes))
-(defun get-iso-8859-8-bytes(string pos end)
+(defun get-iso-8859-8-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-8-mapper :iso-8859-8 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-8-mapper :iso-8859-8 string pos))
 
 (defun string->iso-8859-8 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-8->string)
 
-(push '((:iso-8859-8 :|iso-8859-8|)
-        iso-8859-8->string-aref string->iso-8859-8)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-8 :|iso-8859-8|)
+                          '(iso-8859-8->string-aref string->iso-8859-8))
 
 (define-external-format (:iso-8859-8 :|iso-8859-8|)
     1 t
     (let ((iso-8859-8-byte (code->iso-8859-8-mapper bits)))
       (if iso-8859-8-byte
           (setf (sap-ref-8 sap tail) iso-8859-8-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-8->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-9->code-mapper code->iso-8859-9-mapper
   (#xD0 #x011E) ; LATIN CAPITAL LETTER G WITH BREVE
 )
 
 (declaim (inline get-iso-8859-9-bytes))
-(defun get-iso-8859-9-bytes(string pos end)
+(defun get-iso-8859-9-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-9-mapper :iso-8859-9 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-9-mapper :iso-8859-9 string pos))
 
 (defun string->iso-8859-9 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-9->string)
 
-(push '((:iso-8859-9 :|iso-8859-9| :latin-5 :|latin-5|)
-        iso-8859-9->string-aref string->iso-8859-9)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-9 :|iso-8859-9| :latin-5 :|latin-5|)
+                          '(iso-8859-9->string-aref string->iso-8859-9))
 
 (define-external-format (:iso-8859-9 :|iso-8859-9| :latin-5 :|latin-5|)
     1 t
     (let ((iso-8859-9-byte (code->iso-8859-9-mapper bits)))
       (if iso-8859-9-byte
           (setf (sap-ref-8 sap tail) iso-8859-9-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-9->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-10->code-mapper code->iso-8859-10-mapper
   (#xA1 #x0104) ; LATIN CAPITAL LETTER A WITH OGONEK
 )
 
 (declaim (inline get-iso-8859-10-bytes))
-(defun get-iso-8859-10-bytes(string pos end)
+(defun get-iso-8859-10-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-10-mapper :iso-8859-10 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-10-mapper :iso-8859-10 string pos))
 
 (defun string->iso-8859-10 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-10->string)
 
-(push '((:iso-8859-10 :|iso-8859-10| :latin-6 :|latin-6|)
-        iso-8859-10->string-aref string->iso-8859-10)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-10 :|iso-8859-10| :latin-6 :|latin-6|)
+                          '(iso-8859-10->string-aref string->iso-8859-10))
 
 (define-external-format (:iso-8859-10 :|iso-8859-10| :latin-6 :|latin-6|)
     1 t
     (let ((iso-8859-10-byte (code->iso-8859-10-mapper bits)))
       (if iso-8859-10-byte
           (setf (sap-ref-8 sap tail) iso-8859-10-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-10->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-11->code-mapper code->iso-8859-11-mapper
   (#xA1 #x0E01) ; THAI CHARACTER KO KAI
 )
 
 (declaim (inline get-iso-8859-11-bytes))
-(defun get-iso-8859-11-bytes(string pos end)
+(defun get-iso-8859-11-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-11-mapper :iso-8859-11 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-11-mapper :iso-8859-11 string pos))
 
 (defun string->iso-8859-11 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-11->string)
 
-(push '((:iso-8859-11 :|iso-8859-11|)
-        iso-8859-11->string-aref string->iso-8859-11)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-11 :|iso-8859-11|)
+                          '(iso-8859-11->string-aref string->iso-8859-11))
 
 (define-external-format (:iso-8859-11 :|iso-8859-11|)
     1 t
     (let ((iso-8859-11-byte (code->iso-8859-11-mapper bits)))
       (if iso-8859-11-byte
           (setf (sap-ref-8 sap tail) iso-8859-11-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-11->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-13->code-mapper code->iso-8859-13-mapper
   (#xA1 #x201D) ; RIGHT DOUBLE QUOTATION MARK
 )
 
 (declaim (inline get-iso-8859-13-bytes))
-(defun get-iso-8859-13-bytes(string pos end)
+(defun get-iso-8859-13-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-13-mapper :iso-8859-13 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-13-mapper :iso-8859-13 string pos))
 
 (defun string->iso-8859-13 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-13->string)
 
-(push '((:iso-8859-13 :|iso-8859-13| :latin-7 :|latin-7|)
-        iso-8859-13->string-aref string->iso-8859-13)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-13 :|iso-8859-13| :latin-7 :|latin-7|)
+                          '(iso-8859-13->string-aref string->iso-8859-13))
 
 (define-external-format (:iso-8859-13 :|iso-8859-13| :latin-7 :|latin-7|)
     1 t
     (let ((iso-8859-13-byte (code->iso-8859-13-mapper bits)))
       (if iso-8859-13-byte
           (setf (sap-ref-8 sap tail) iso-8859-13-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-13->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check
 
 (define-unibyte-mapper iso-8859-14->code-mapper code->iso-8859-14-mapper
   (#xA1 #x1E02) ; LATIN CAPITAL LETTER B WITH DOT ABOVE
 )
 
 (declaim (inline get-iso-8859-14-bytes))
-(defun get-iso-8859-14-bytes(string pos end)
+(defun get-iso-8859-14-bytes (string pos)
   (declare (optimize speed (safety 0))
            (type simple-string string)
-           (type array-range pos end))
-  (get-latin-bytes #'code->iso-8859-14-mapper :iso-8859-14 string pos end))
+           (type array-range pos))
+  (get-latin-bytes #'code->iso-8859-14-mapper :iso-8859-14 string pos))
 
 (defun string->iso-8859-14 (string sstart send null-padding)
   (declare (optimize speed (safety 0))
 
 (instantiate-octets-definition define-iso-8859-14->string)
 
-(push '((:iso-8859-14 :|iso-8859-14| :latin-8 :|latin-8|)
-        iso-8859-14->string-aref string->iso-8859-14)
-      *external-format-functions*)
+(add-external-format-funs '(:iso-8859-14 :|iso-8859-14| :latin-8 :|latin-8|)
+                          '(iso-8859-14->string-aref string->iso-8859-14))
 
 (define-external-format (:iso-8859-14 :|iso-8859-14| :latin-8 :|latin-8|)
     1 t
     (let ((iso-8859-14-byte (code->iso-8859-14-mapper bits)))
       (if iso-8859-14-byte
           (setf (sap-ref-8 sap tail) iso-8859-14-byte)
-          (stream-encoding-error-and-handle stream bits)))
+          (external-format-encoding-error stream bits)))
     (let ((code (iso-8859-14->code-mapper byte)))
       (if code
           (code-char code)
-          (stream-decoding-error stream byte)))) ;; TODO -- error check
+          (external-format-decoding-error stream byte)))) ;; TODO -- error check