Changeset 10658


Ignore:
Timestamp:
Sep 8, 2008, 3:27:55 PM (11 years ago)
Author:
gb
Message:

WITH-NATIVE-UTF-16-CSTR[S].
INT-ERRNO-FFCALL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/macros.lisp

    r10514 r10658  
    16411641
    16421642
    1643 
     1643(defmacro with-native-utf-16-cstr ((sym str) &body body)
     1644  (let* ((data (gensym))
     1645         (offset (gensym))
     1646         (string (gensym))
     1647         (len (gensym))
     1648         (noctets (gensym))
     1649         (end (gensym)))
     1650    `(let* ((,string ,str)
     1651            (,len (length ,string)))
     1652      (multiple-value-bind (,data ,offset) (array-data-and-offset ,string)
     1653        (let* ((,end (+ ,offset ,len))
     1654               (,noctets (utf-16-octets-in-string ,data ,offset ,end)))
     1655          (%stack-block ((,sym (1+ ,noctets)))
     1656            (native-utf-16-memory-encode ,data ,sym 0 ,offset ,end)
     1657            (setf (%get-unsigned-word ,sym ,noctets) 0)
     1658            ,@body))))))
    16441659
    16451660(defmacro with-pointers (speclist &body body)
     
    16531668(defmacro with-utf-8-cstrs (speclist &body body)
    16541669   (with-specs-aux 'with-utf-8-cstr speclist body))
     1670
     1671(defmacro with-native-utf-16-cstrs (speclist &body body)
     1672  (with-specs-aux 'with-native-utf-16-cstr speclist body))
    16551673
    16561674(defmacro with-encoded-cstr ((encoding-name (sym string &optional start end))
     
    36613679        ,value))))
    36623680
     3681(defmacro int-errno-ffcall (entry &rest args)
     3682  `(int-errno-call (ff-call ,entry ,@args)))
Note: See TracChangeset for help on using the changeset viewer.