generator: Allow generators to take arguments
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 12 Feb 2016 12:49:49 +0000 (23:49 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 25 Feb 2016 11:07:20 +0000 (22:07 +1100)
commitbb88463014092a5550ea4c51a037e12e49446722
treef44e6142078bc65cf8069e5388f711da0a31c714
parent707a8c0a899a4b645bcf778f7ea79565d6f3f13e
generator: Allow generators to take arguments

Using some serious macro magic, this patch extends generators to allow
them to take arbitrary arguments.  The arguments are marshalled into a
structure placed at the far end of the generator's stack when it is
created.  Then, they're unmarshalled back into C parameters when we first
context switch into the generator.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
ccan/generator/_info
ccan/generator/generator.h
ccan/generator/test/api.c
ccan/generator/test/example-gens.c
ccan/generator/test/example-gens.h