Re: [Vala] [RFC, PATCH] add async keyword to vapigen

2009-09-27 Thread Jürg Billeter
On Thu, 2009-09-24 at 22:21 +0200, Philipp Zabel wrote:
 Hi, the following patch adds support for an async attribute to
 vapigen. This can be used in metadata to fix up the binding of
 asynchronous methods that don't end in _async like this:

Thanks, applied to master.

Jürg


___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] [RFC, PATCH] add async keyword to vapigen

2009-09-25 Thread pHilipp Zabel
On Fri, Sep 25, 2009 at 9:23 AM, Jan Hudec b...@ucw.cz wrote:
 On Thu, Sep 24, 2009 at 22:21:36 +0200, Philipp Zabel wrote:
 Or would it be better to make the parser recognize asynchronous
 functions that don't end in _async?

 An async function can be recognized by having a GAsyncReadyCallback argument
 next to last and void * last (that's what vala expects from an async
 function).  So it could probably be detected only by that (and not look at
 _async suffix at all except to strip it).

How can I detect a void pointer correctly? Right now I'm just using
(parse_param(param) is PointerType), which so far seems to work
correctly (on gio-2.0.vapi).

regards
Philipp


vapigen-async.patch
Description: application/empty
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] [RFC, PATCH] add async keyword to vapigen

2009-09-25 Thread Jan Hudec
On Fri, Sep 25, 2009 at 10:17:44 +0200, pHilipp Zabel wrote:
 On Fri, Sep 25, 2009 at 9:23 AM, Jan Hudec b...@ucw.cz wrote:
  On Thu, Sep 24, 2009 at 22:21:36 +0200, Philipp Zabel wrote:
  Or would it be better to make the parser recognize asynchronous
  functions that don't end in _async?
 
  An async function can be recognized by having a GAsyncReadyCallback argument
  next to last and void * last (that's what vala expects from an async
  function).  So it could probably be detected only by that (and not look at
  _async suffix at all except to strip it).
 
 How can I detect a void pointer correctly? Right now I'm just using
 (parse_param(param) is PointerType), which so far seems to work
 correctly (on gio-2.0.vapi).

I think if the GAsyncCallback is detected exactly, the pointer type for
target won't be anything else, so this would be good enough.

-- 
 Jan 'Bulb' Hudec b...@ucw.cz
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list