Ignore:
Timestamp:
Oct 23, 2008, 9:50:38 AM (11 years ago)
Author:
gb
Message:

Add GET-ENCODED-CSTRING.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-unicode.lisp

    r10355 r11203  
    48354835                 string)
    48364836        string))))
    4837        
     4837
     4838
     4839(defun get-encoded-cstring (encoding-name pointer)
     4840  (let* ((encoding (ensure-character-encoding encoding-name)))
     4841    (get-encoded-string
     4842     encoding
     4843     pointer
     4844     (ecase (character-encoding-code-unit-size encoding)
     4845       (8 (%cstrlen pointer))
     4846       (16 (do* ((i 0 (+ i 2)))
     4847                ((= 0 (%get-unsigned-word pointer i))
     4848                 (return i))
     4849             (declare (fixnum i))))
     4850       (32 (do* ((i 0 (+ i 4)))
     4851                ((= 0 (%get-unsigned-long pointer i))
     4852                 (return i))
     4853             (declare (fixnum i))))))))
     4854   
    48384855
    48394856     
Note: See TracChangeset for help on using the changeset viewer.