Commit 6b9c5442 authored by rtoy's avatar rtoy
Browse files

code/extfmts.lisp

o Add new ef-macro index for octets-to-string-counted.  (Forgot to do
  that before.)

bootfiles/20a/boot-2010-08-1.lisp:
o Use this to bootstrap the change (using a cross-compile.)
parent 66851579
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
;; Need to add a new ef macro id for OCTETS-TO-STRING-COUNTED.
;;
;; 2010-09 (probably) needs to be cross-compiled from 2010-08 (aka
;; 20b-pre1).  Use something like
;;
;; src/tools/cross-build-world.sh -crl -B src/bootfiles/20a/boot-2010-08-1.lisp target/ cross src/tools/cross-scripts/cross-x86-x86.lisp <20b/bin/lisp>

(in-package "STREAM")

(ext:without-package-locks

  (handler-bind ((error (lambda (c)
			  (declare (ignore c))
			  (invoke-restart 'kernel::continue))))
    (vm::defenum (:prefix "+EF-" :suffix "+" :start 1)
      str				; string length
      cin				; input a character
      cout				; output a character
      sin				; input string
      sout				; output string
      os				; octets to string
      so				; string to octets
      en				; encode
      de				; decode
      flush				; flush state
      copy-state			; copy state
      osc
      max)))
 No newline at end of file
+7 −3
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
;;; domain.
;;; 
(ext:file-comment
 "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.35.4.4 2010/09/02 23:47:31 rtoy Exp $")
 "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.35.4.5 2010/09/06 01:01:27 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
@@ -35,6 +35,9 @@
  "Hash table mapping an external format alias to the actual external
  format implementation")

;; Each time DEF-EF-MACRO is used to define a new external format
;; macro, a unique value must be used for the index.  The mapping
;; between the macro and the index is here.
(vm::defenum (:prefix "+EF-" :suffix "+" :start 1)
  str					; string length
  cin					; input a character
@@ -47,6 +50,7 @@
  de					; decode
  flush					; flush state
  copy-state				; copy state
  osc					; octets to string, counted
  max)

;; Unicode replacement character U+FFFD
@@ -921,7 +925,7 @@ character and illegal outputs are replaced by a question mark.")
      (values (if stringp string (lisp::shrink-vector string pos)) pos last-octet new-state))))


(def-ef-macro ef-octets-to-string-counted (extfmt lisp::lisp +ef-max+ +ef-os+)
(def-ef-macro ef-octets-to-string-counted (extfmt lisp::lisp +ef-max+ +ef-osc+)
  `(lambda (octets ptr end state ocount string s-start s-end error
	    &aux (pos s-start) (last-octet 0))
     (declare (optimize (speed 3) (safety 0) #|(space 0) (debug 0)|#)