Changeset 5720


Ignore:
Timestamp:
Jan 18, 2007, 3:00:49 AM (18 years ago)
Author:
Gary Byers
Message:

Handle the case of an encoded structure type as a return value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/db-io.lisp

    r5568 r5720  
    560560
    561561(defun decode-arguments (string)
    562   (let* ((result (cdr (assoc (schar string 0) *arg-spec-encoding*)))
    563          (args ()))
    564     (do* ((i 1 (1+ i)))
    565          ((= i (length string)) (values (nreverse args) result))
    566       (declare (fixnum i))
    567       (let* ((ch (schar string i))
    568              (val (if (or (eql ch #\r) (eql ch #\R) (eql ch #\t))
    569                     (let* ((namelen (char-code (schar string (incf i))))
    570                            (name (make-string namelen)))
    571                       (dotimes (k namelen)
    572                         (setf (schar name k)
    573                               (schar string (incf i))))
    574                       (if (eql ch #\R)
    575                          name
    576                          (escape-foreign-name name)))
    577                     (cdr (assoc ch *arg-spec-encoding*)))))
    578       (push val args)))))
     562  (let* ((result nil))
     563    (collect ((args))
     564      (do* ((i 0 (1+ i)))
     565           ((= i (length string)) (values (args) result))
     566        (declare (fixnum i))
     567        (let* ((ch (schar string i))
     568               (val (if (or (eql ch #\r) (eql ch #\R) (eql ch #\t))
     569                      (let* ((namelen (char-code (schar string (incf i))))
     570                             (name (make-string namelen)))
     571                        (dotimes (k namelen)
     572                          (setf (schar name k)
     573                                (schar string (incf i))))
     574                        (if (eql ch #\R)
     575                          name
     576                          (escape-foreign-name name)))
     577                      (cdr (assoc ch *arg-spec-encoding*)))))
     578          (if result
     579            (args val)
     580            (setq result val)))))))
     581
    579582
    580583;;; encoded external function looks like:
     
    840843  ambiguous-methods                     ; partitioned by signature
    841844  req-args
    842   flags)
     845  flags
     846  protocol-methods)
    843847
    844848(defstruct objc-method-info
Note: See TracChangeset for help on using the changeset viewer.