chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
58d542e
)
Added with-gvalue macro
author
espen
<espen>
Fri, 12 Nov 2004 15:01:42 +0000
(15:01 +0000)
committer
espen
<espen>
Fri, 12 Nov 2004 15:01:42 +0000
(15:01 +0000)
glib/gparam.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/gparam.lisp
b/glib/gparam.lisp
index 028c4f9a2ab11ae2a303c1623843f505e3ae713b..8629d404168395fa90620df3b9e0f9a6ab41d47f 100644
(file)
--- a/
glib/gparam.lisp
+++ b/
glib/gparam.lisp
@@
-15,7
+15,7
@@
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;; License along with this library; if not, write to the Free Software
;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-;; $Id: gparam.lisp,v 1.
9 2004/11/06 21:39:58
espen Exp $
+;; $Id: gparam.lisp,v 1.
10 2004/11/12 15:01:42
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-66,6
+66,15
@@
(defun gvalue-set (gvalue value)
value gvalue +gvalue-value-offset+)
value)
value gvalue +gvalue-value-offset+)
value)
+(defmacro with-gvalue ((gvalue type &optional (value nil value-p)) &body body)
+ `(let ((,gvalue ,(if value-p
+ `(gvalue-new ',type ,value)
+ `(gvalue-new ',type ,value))))
+ (unwind-protect
+ (progn
+ ,@body
+ ,(unless value-p `(gvalue-get ,gvalue)))
+ (gvalue-free ,gvalue))))
(deftype param-flag-type ()
(deftype param-flag-type ()