On 10-04-19 01:31 AM, BCS wrote:
Hello Justin Spahr-Summers,
On Mon, 19 Apr 2010 00:12:28 + (UTC), Graham Fawcett
wrote:
Hi folks,
I'd like to wrap a family of C functions that look like this:
gboolean fooXXX(arg1, ..., argN, GError** err)
Their signatures and arities vary, but they a
On Mon, Apr 19, 2010 at 07:43, Justin Spahr-Summers <
justin.spahrsumm...@gmail.com> wrote:
>
> Yes, sorry. That's what I was trying to do originally, but I couldn't
> quite spit it out. Indeed, templating the actual arguments is a horrible
> idea.
>
Sorry to comment on it, then. I'm discovering
On Mon, Apr 19, 2010 at 07:31, BCS wrote:
> Or you can mangel that a bit:
>
> template check(alias func) {
> bool check(EL ...)() {
>
> GError* err;
> bool ok = func(EL, &err);
> if (!ok)
>throw new Exception((*err).message);
> return ok;
> }
> }
>
> that should allow yo
On Mon, 19 Apr 2010 07:28:09 +0200, Philippe Sigaud
wrote:
>
> On Mon, Apr 19, 2010 at 05:21, Justin Spahr-Summers <
> justin.spahrsumm...@gmail.com> wrote:
>
> > You can use some expression tuple magic to accomplish something like
> > that:
> >
> > bool check(alias func, EL ...)() {
> >GEr
Hello Justin Spahr-Summers,
On Mon, 19 Apr 2010 00:12:28 + (UTC), Graham Fawcett
wrote:
Hi folks,
I'd like to wrap a family of C functions that look like this:
gboolean fooXXX(arg1, ..., argN, GError** err)
Their signatures and arities vary, but they all have a GError** as
their last a
Hello Philippe,
Of course, it'd be nice to check the EL at CT to see if they
correspond to func parameters types.
The call inside check will coever that for you as long as you don't mind
getting the error in an odd place.
--
... <
On Mon, Apr 19, 2010 at 05:21, Justin Spahr-Summers <
justin.spahrsumm...@gmail.com> wrote:
> You can use some expression tuple magic to accomplish something like
> that:
>
> bool check(alias func, EL ...)() {
>GError* err;
>bool ok = func(EL, &err);
> if (!ok)
>throw new Excep
http://while-nan.blogspot.com/2007/06/wrapping-functions-for-fun-and-profit.html
It shouldn't be too difficult to inject an extra parameter; just add it
to the end of the call to the wrapped function after args.
On Mon, 19 Apr 2010 00:12:28 + (UTC), Graham Fawcett
wrote:
>
> Hi folks,
>
> I'd like to wrap a family of C functions that look like this:
>
> gboolean fooXXX(arg1, ..., argN, GError** err)
>
> Their signatures and arities vary, but they all have a GError** as
> their last argument
Hi folks,
I'd like to wrap a family of C functions that look like this:
gboolean fooXXX(arg1, ..., argN, GError** err)
Their signatures and arities vary, but they all have a GError** as
their last argument. If a function returns false, then 'err' will be
set to a relevant Error struct.
I
10 matches
Mail list logo