/[cmucl]/src/code/fd-stream.lisp
ViewVC logotype

Diff of /src/code/fd-stream.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.109 by rtoy, Sat Jul 3 15:20:25 2010 UTC revision 1.110 by rtoy, Sat Jul 3 16:44:37 2010 UTC
# Line 275  Line 275 
275    ;; of octets read so far in decoding; if the function returns it    ;; of octets read so far in decoding; if the function returns it
276    ;; should return the codepoint of the desired replacement character.    ;; should return the codepoint of the desired replacement character.
277    #+unicode    #+unicode
278    (octets-to-char-error nil)    (octets-to-char-error nil :type (or null symbol function))
279    ;;    ;;
280    ;; Like OCTETS-TO-CHAR-ERROR, but for converting characters to    ;; Like OCTETS-TO-CHAR-ERROR, but for converting characters to
281    ;; octets for output.  The function takes two arguments: a message    ;; octets for output.  The function takes two arguments: a message
282    ;; string and the codepoint that cannot be converted.  The function    ;; string and the codepoint that cannot be converted.  The function
283    ;; should return the octet that should be output.    ;; should return the octet that should be output.
284    #+unicode    #+unicode
285    (char-to-octets-error nil))    (char-to-octets-error nil :type (or null symbol function)))
286    
287  (defun %print-fd-stream (fd-stream stream depth)  (defun %print-fd-stream (fd-stream stream depth)
288    (declare (ignore depth) (stream stream))    (declare (ignore depth) (stream stream))
# Line 1819  Line 1819 
1819    Timeout (if true) is the number of seconds to wait for input.  If NIL (the    Timeout (if true) is the number of seconds to wait for input.  If NIL (the
1820      default), then wait forever.  When we time out, we signal IO-TIMEOUT.      default), then wait forever.  When we time out, we signal IO-TIMEOUT.
1821    File is the name of the file (will be returned by PATHNAME).    File is the name of the file (will be returned by PATHNAME).
1822    Name is used to identify the stream when printed."    Name is used to identify the stream when printed.
1823      External-format is the external format to use for the stream.
1824      Decoding-error and Encoding-error indicate how decoding/encoding errors on
1825        the stream should be handled.  The default is to use a replacement character."
1826    (cond ((not (or input-p output-p))    (cond ((not (or input-p output-p))
1827           (setf input t))           (setf input t))
1828          ((not (or input output))          ((not (or input output))
# Line 1842  Line 1845 
1845                                     ((eq t decoding-error)                                     ((eq t decoding-error)
1846                                      #'(lambda (&rest args)                                      #'(lambda (&rest args)
1847                                          (apply 'cerror                                          (apply 'cerror
1848                                                 "Use Unicode replacement character instead"                                                 (intl:gettext "Use Unicode replacement character instead")
1849                                                 args)                                                 args)
1850                                          stream:+replacement-character-code+))                                          stream:+replacement-character-code+))
1851                                     (t                                     (t
# Line 2199  Line 2202 
2202                         :overwrite, :append, :supersede or nil                         :overwrite, :append, :supersede or nil
2203     :if-does-not-exist - one of :error, :create or nil     :if-does-not-exist - one of :error, :create or nil
2204     :external-format - an external format name     :external-format - an external format name
2205       :decoding-error - How to handle decoding errors from the external format.
2206                           Should be a symbol or function of 3 arguments.  If it
2207                           returns, it should return a code point to use as the
2208                           replacment.  NIL means use the default replacement scheme
2209                           specified by the external format.  The function arguments
2210                           are a format message string, the offending octet, and the
2211                           number of octets read in the current encoding.
2212       :encoding-error - Like :decoding-error, but for errors when encoding the
2213                           stream.  The function arguments are a format message
2214                           string and the incorrect codepoint.
2215    
2216    See the manual for details."    See the manual for details."
2217    (declare (ignore element-type external-format input-handle output-handle    (declare (ignore element-type external-format input-handle output-handle
2218                     decoding-error encoding-error))                     decoding-error encoding-error))

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110

  ViewVC Help
Powered by ViewVC 1.1.5