Support (out caller-allocates)
authorColin Walters <walters@verbum.org>
Wed, 16 Dec 2009 16:47:19 +0000 (11:47 -0500)
committerColin Walters <walters@verbum.org>
Wed, 26 May 2010 17:00:56 +0000 (13:00 -0400)
commit5589687a1fa5d4c7f15213ee3cd6860a03587ced
treefcd147f09b04edd06af55ea8c28c6b7320e8e7b5
parent786da5cdd2dfc775c08d127c5e855eb091d24974
Support (out caller-allocates)

People have wanted support for marking (out) on functions of the
form:

/**
 * clutter_color_from_pixel:
 * @pixel: A pixel
 * @color: (out): Color to initialize with value of @pixel
 */
void
clutter_color_from_pixel (guint32 pixel, ClutterColor *color);

Where the caller is supposed to have allocated the argument; the
C function just initializes it.  This patch adds support for this
argument passing style to introspection.  In this case, we see the
(out), and notice that there's only a single indirection (*) on
the argument, and assume that this means (out caller-allocates).

https://bugzilla.gnome.org/show_bug.cgi?id=604749
18 files changed:
gir/Everything-1.0-expected.gir
gir/GIMarshallingTests-1.0-expected.gir
gir/everything.c
girepository/ginfo.c
girepository/girepository.h
girepository/girnode.c
girepository/girnode.h
girepository/girparser.c
girepository/gtypelib.h
giscanner/annotationparser.py
giscanner/ast.py
giscanner/girwriter.py
tests/invoke/testfns-1.0.gir
tests/scanner/annotation-1.0-expected.gir
tests/scanner/annotation-1.0-expected.tgir
tests/scanner/drawable-1.0-expected.gir
tests/scanner/drawable-1.0-expected.tgir
tools/generate.c