Changeset 8848


Ignore:
Timestamp:
Mar 21, 2008, 10:39:57 AM (11 years ago)
Author:
gb
Message:

WITH-NATIVE-UTF-16-CSTR(s).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/win64/lib/macros.lisp

    r8825 r8848  
    16221622            ,@body))))))
    16231623
     1624(defmacro with-native-utf-16-cstr ((sym str) &body body)
     1625  (let* ((data (gensym))
     1626         (offset (gensym))
     1627         (string (gensym))
     1628         (len (gensym))
     1629         (noctets (gensym))
     1630         (end (gensym)))
     1631    `(let* ((,string ,str)
     1632            (,len (length ,string)))
     1633      (multiple-value-bind (,data ,offset) (array-data-and-offset ,string)
     1634        (let* ((,end (+ ,offset ,len))
     1635               (,noctets (utf-16-octets-in-string ,data ,offset ,end)))
     1636          (%stack-block ((,sym (1+ ,noctets)))
     1637            (native-utf-16-memory-encode ,data ,sym 0 ,offset ,end)
     1638            (setf (%get-unsigned-word ,sym ,noctets) 0)
     1639            ,@body))))))
     1640
    16241641
    16251642
     
    16321649
    16331650(defmacro with-cstrs (speclist &body body)
    1634    (with-specs-aux 'with-cstr speclist body))
     1651  (with-specs-aux 'with-cstr speclist body))
    16351652
    16361653(defmacro with-utf-8-cstrs (speclist &body body)
    1637    (with-specs-aux 'with-utf-8-cstr speclist body))
     1654  (with-specs-aux 'with-utf-8-cstr speclist body))
     1655
     1656(defmacro with-native-utf-16-cstrs (speclist &body body)
     1657  (with-specs-aux 'with-native-utf-16-cstr speclist body))
    16381658
    16391659(defmacro with-encoded-cstr ((encoding-name (sym string &optional start end))
Note: See TracChangeset for help on using the changeset viewer.