Make json_pack/json_unpack() recursive
authorGraeme Smecher <graeme.smecher@mail.mcgill.ca>
Fri, 14 Jan 2011 17:18:42 +0000 (09:18 -0800)
committerPetri Lehtinen <petri@digip.org>
Fri, 14 Jan 2011 19:43:48 +0000 (21:43 +0200)
commit3a7512d2b05af82c43578477941e92db72f0f57b
treeb5e1450f2366c8b1378783e115de95f42d73e21f
parent269e86b72572a6ba546270e8d22409efc40c2fbd
Make json_pack/json_unpack() recursive

Note that we pass va_list pointers around instead of just va_lists, which
would seem more intuitive. This is necessary since the behaviour of va_lists
passed as function parameters is finicky. Quoth stdarg(3):

If ap is passed to a function that uses va_arg(ap,type) then the value
of ap is undefined after the return of that function.

The pointer-passing strategy is used by Python's Py_BuildValue() for the same
purpose.
src/variadic.c
test/suites/api/test_pack.c
test/suites/api/test_unpack.c