X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fexternal-formats%2Fenc-cyr.lisp;h=7883f0649ae25f086a5ed4161fff5d0d767ab043;hb=95591ed483dbb8c0846c129953acac1554f28809;hp=660e38d6865d0d7e85ce8bbb02039ebb41b43f20;hpb=c6b078527eb68acc281dc79c91824c937f9447fe;p=sbcl.git diff --git a/src/code/external-formats/enc-cyr.lisp b/src/code/external-formats/enc-cyr.lisp index 660e38d..7883f06 100644 --- a/src/code/external-formats/enc-cyr.lisp +++ b/src/code/external-formats/enc-cyr.lisp @@ -1,4 +1,4 @@ -(in-package #:sb!impl) +(in-package "SB!IMPL") (define-unibyte-mapper koi8-r->code-mapper code->koi8-r-mapper (#x80 #x2500) ; BOX DRAWINGS LIGHT HORIZONTAL @@ -132,11 +132,11 @@ ) (declaim (inline get-koi8-r-bytes)) -(defun get-koi8-r-bytes(string pos end) +(defun get-koi8-r-bytes (string pos) (declare (optimize speed (safety 0)) (type simple-string string) - (type array-range pos end)) - (get-latin-bytes #'code->koi8-r-mapper :koi8-r string pos end)) + (type array-range pos)) + (get-latin-bytes #'code->koi8-r-mapper :koi8-r string pos)) (defun string->koi8-r (string sstart send null-padding) (declare (optimize speed (safety 0)) @@ -160,20 +160,18 @@ (instantiate-octets-definition define-koi8-r->string) -(push '((:koi8-r :|koi8-r|) - koi8-r->string-aref string->koi8-r) - *external-format-functions*) - (define-external-format (:koi8-r :|koi8-r|) 1 t (let ((koi8-r-byte (code->koi8-r-mapper bits))) (if koi8-r-byte (setf (sap-ref-8 sap tail) koi8-r-byte) - (stream-encoding-error-and-handle stream bits))) + (external-format-encoding-error stream bits))) (let ((code (koi8-r->code-mapper byte))) (if code (code-char code) - (stream-decoding-error stream byte)))) ;; TODO -- error check + (external-format-decoding-error stream byte))) + koi8-r->string-aref + string->koi8-r) ;; TODO -- error check (define-unibyte-mapper koi8-u->code-mapper code->koi8-u-mapper (#x80 #x2500) ; BOX DRAWINGS LIGHT HORIZONTAL @@ -307,11 +305,11 @@ ) (declaim (inline get-koi8-u-bytes)) -(defun get-koi8-u-bytes(string pos end) +(defun get-koi8-u-bytes (string pos) (declare (optimize speed (safety 0)) (type simple-string string) - (type array-range pos end)) - (get-latin-bytes #'code->koi8-u-mapper :koi8-u string pos end)) + (type array-range pos)) + (get-latin-bytes #'code->koi8-u-mapper :koi8-u string pos)) (defun string->koi8-u (string sstart send null-padding) (declare (optimize speed (safety 0)) @@ -335,20 +333,18 @@ (instantiate-octets-definition define-koi8-u->string) -(push '((:koi8-u :|koi8-u|) - koi8-u->string-aref string->koi8-u) - *external-format-functions*) - (define-external-format (:koi8-u :|koi8-u|) 1 t (let ((koi8-u-byte (code->koi8-u-mapper bits))) (if koi8-u-byte (setf (sap-ref-8 sap tail) koi8-u-byte) - (stream-encoding-error-and-handle stream bits))) + (external-format-encoding-error stream bits))) (let ((code (koi8-u->code-mapper byte))) (if code (code-char code) - (stream-decoding-error stream byte)))) ;; TODO -- error check + (external-format-decoding-error stream byte))) + koi8-u->string-aref + string->koi8-u) ;; TODO -- error check (define-unibyte-mapper x-mac-cyrillic->code-mapper code->x-mac-cyrillic-mapper (#x80 #x0410) ; CYRILLIC CAPITAL LETTER A @@ -477,11 +473,11 @@ ) (declaim (inline get-x-mac-cyrillic-bytes)) -(defun get-x-mac-cyrillic-bytes(string pos end) +(defun get-x-mac-cyrillic-bytes (string pos) (declare (optimize speed (safety 0)) (type simple-string string) - (type array-range pos end)) - (get-latin-bytes #'code->x-mac-cyrillic-mapper :x-mac-cyrillic string pos end)) + (type array-range pos)) + (get-latin-bytes #'code->x-mac-cyrillic-mapper :x-mac-cyrillic string pos)) (defun string->x-mac-cyrillic (string sstart send null-padding) (declare (optimize speed (safety 0)) @@ -505,17 +501,15 @@ (instantiate-octets-definition define-x-mac-cyrillic->string) -(push '((:x-mac-cyrillic :|x-mac-cyrillic|) - x-mac-cyrillic->string-aref string->x-mac-cyrillic) - *external-format-functions*) - (define-external-format (:x-mac-cyrillic :|x-mac-cyrillic|) 1 t (let ((x-mac-cyrillic-byte (code->x-mac-cyrillic-mapper bits))) (if x-mac-cyrillic-byte (setf (sap-ref-8 sap tail) x-mac-cyrillic-byte) - (stream-encoding-error-and-handle stream bits))) + (external-format-encoding-error stream bits))) (let ((code (x-mac-cyrillic->code-mapper byte))) (if code (code-char code) - (stream-decoding-error stream byte)))) ;; TODO -- error check + (external-format-decoding-error stream byte))) + x-mac-cyrillic->string-aref + string->x-mac-cyrillic) ;; TODO -- error check