Changeset 452


Ignore:
Timestamp:
Feb 1, 2004, 7:42:52 AM (21 years ago)
Author:
Gary Byers
Message:

Ivar parsing follows different ruls for STRUCT than for *STRUCT; #\B is
for :<BOOL>. Now seems able to parse all Foundation/AppKit classes in
10.3.2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/bridge.lisp

    r444 r452  
    388388       (subseq typestring 1 =pos)))))
    389389
    390 (defun parse-foreign-struct-or-union-spec (typestring startpos record-class)
     390(defun parse-foreign-struct-or-union-spec (typestring
     391                                           startpos
     392                                           record-class
     393                                           from-pointer)
    391394  (flet ((extract-record-name (startpos delimpos)
    392395           (unless (and (= delimpos (1+ startpos))
     
    429432                     typestring
    430433                     (string-input-stream-index string-stream)
    431                      nil)
     434                     from-pointer)
    432435                  (fields `(,(if field-name-string (escape-foreign-name field-name-string))
    433436                            ,typespec))
     
    470473;;; Parse the ivar's type string and return a FOREIGN-TYPE object.
    471474(defun objc-foreign-type-for-ivar
    472     (str &optional (startpos 0) (allow-id-name t))
     475    (str &optional (startpos 0) (allow-id-name t) from-pointer)
    473476  (let* ((endpos (1+ startpos))
    474477         (startchar (schar str startpos))
     
    488491            (#\d :double-float)
    489492            (#\v :void)
     493            (#\B :<BOOL>)
    490494            (#\@ (when allow-id-name
    491495                   (let* ((nextpos (1+ startpos)))
     
    501505            (#\* '(:* :char))
    502506            (#\^ (multiple-value-bind (type end)
    503                      (objc-foreign-type-for-ivar str (1+ startpos) t)
     507                     (objc-foreign-type-for-ivar str (1+ startpos) t t)
    504508                   (setq endpos end)
    505509                   `(:* ,type)))
     
    521525                  str (1+ startpos) (if (eq startchar #\{)
    522526                                      :struct
    523                                       :union))
     527                                      :union)
     528                  from-pointer)
    524529               (setq endpos end)
    525530               type))
Note: See TracChangeset for help on using the changeset viewer.