3 ;; A type that it almost like :string but uses g_malloc and g_free
5 (define-foreign-type g-string-type
()
6 ((free-from-foreign :initarg
:fff
:reader g-string-type-fff
:initform nil
)
7 (free-to-foreign :initarg
:ftf
:reader g-string-type-ftf
:initform t
))
8 (:actual-type
:pointer
))
10 (define-parse-method g-string
(&key
(free-from-foreign nil
) (free-to-foreign t
))
11 (make-instance 'g-string-type
:fff free-from-foreign
:ftf free-to-foreign
))
13 (defmethod translate-to-foreign (value (type g-string-type
))
16 (defmethod translate-from-foreign (value (type g-string-type
))
18 (convert-from-foreign value
'(:string
:free-from-foreign nil
))
19 (when (g-string-type-fff type
)