X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fexternal-formats%2Fucs-2.lisp;fp=src%2Fcode%2Fexternal-formats%2Fucs-2.lisp;h=8eefcef7c9ea891272126e414bf9a5940c382a66;hb=f2db6743b1fadeea9e72cb583d857851c87efcd4;hp=fc1d4bd4546be63e5fcc79e71416935d58b6c4bf;hpb=7be799a096f8be64365dfd5b566f667f9ea0314a;p=sbcl.git diff --git a/src/code/external-formats/ucs-2.lisp b/src/code/external-formats/ucs-2.lisp index fc1d4bd..8eefcef 100644 --- a/src/code/external-formats/ucs-2.lisp +++ b/src/code/external-formats/ucs-2.lisp @@ -34,26 +34,6 @@ (sap-ref-8 sap offset) (ldb (byte 8 8) value))) ;;; -;;; Define external format: fd-stream -;;; -(define-external-format/variable-width (:ucs-2le :ucs2le #!+win32 :ucs2 #!+win32 :ucs-2) nil - 2 - (if (< bits #x10000) - (setf (sap-ref-16le sap tail) bits) - (external-format-encoding-error stream bits)) - 2 - (code-char (sap-ref-16le sap head))) - -(define-external-format/variable-width (:ucs-2be :ucs2be) nil - 2 - (if (< bits #x10000) - (setf (sap-ref-16be sap tail) bits) - (external-format-encoding-error stream bits)) - 2 - (code-char (sap-ref-16be sap head))) - - -;;; ;;; octets ;;; @@ -209,8 +189,22 @@ (instantiate-octets-definition define-ucs-2->string) -(add-external-format-funs '(:ucs-2le :ucs2le #!+win32 :ucs2 #!+win32 :ucs-2) - '(ucs-2le->string-aref string->ucs-2le)) +(define-external-format/variable-width (:ucs-2le :ucs2le #!+win32 :ucs2 #!+win32 :ucs-2) nil + 2 + (if (< bits #x10000) + (setf (sap-ref-16le sap tail) bits) + (external-format-encoding-error stream bits)) + 2 + (code-char (sap-ref-16le sap head)) + ucs-2le->string-aref + string->ucs-2le) -(add-external-format-funs '(:ucs-2be :ucs2be) - '(ucs-2be->string-aref string->ucs-2be)) +(define-external-format/variable-width (:ucs-2be :ucs2be) nil + 2 + (if (< bits #x10000) + (setf (sap-ref-16be sap tail) bits) + (external-format-encoding-error stream bits)) + 2 + (code-char (sap-ref-16be sap head)) + ucs-2be->string-aref + string->ucs-2be)