tal: bounds checking fixes.

First, we need to update the bounds for the group property allocated
with the children property, just in case it's at the end of the
allocations.

Second, we need to allow the tal_check() code to accept the pointer to
the null parent's group property.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: neaten child property initialization.

Don't open-code the list_head_init: left over from performance
debugging.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: tal_parent(NULL) should be NULL.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: tal_steal() fix.

We call remove_node() in tal_steal, then re-use the node.  So it's important
that we always unlink the group property from the node for that case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: add test for group growth.

Rusty forgets a git add.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: make sure tal_free() preserves errno.

Always good form to have cleanup functions preserve errno.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: Make tal_resize() easier to use.

Instead of trying to force people to use the return value, pass a pointer.
This makes it easier if you want to handle failure: no overwriting the old
pointer!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: tal_dup()

Sometimes you want to duplicate and enlarge in one step: particularly with
TAL_TAKE.  It's also typesafe, unlike tal_memdup().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
take: new module for parameter ownership.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: remove TAL_TAKE in favor of ccan/take.

TAL_TAKE is awkward to use, particularly on functions which take multiple
arguments.  Instead, record annotations for pointers due to be freed in
the callee.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: take implies NULL passthrough.

This makes error handling much more convenient, since take is usually
used for chaining functions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: make tal_free() return NULL

This makes it convenient to do:

	ptr = tal_free(ptr);

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
TAGS: new Makefile target.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: add -Wundef to the default CFLAGS

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: generate config.h more carefully

Don't risk reading partially-constructed files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccanlint: fix _info documentation addition.

Firstly, we should always ask before altering files.  Secondly, we are
not in the module directory: we need to use m->info_file->fullname.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: fix dependencies.

In particular, we might need the C files for foreach and err.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: list modules explicitly.

Clumsier than using wildcards, but that breaks down with nested modules
anyway.  In the longer term, we want ccantool to do the building, but for
the moment make is a necessary evil.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Makefile: remove FASTTIMEOUT

Far more effective to just skip valgrind and gcov if you want fast
results; that's what we do for the summary already.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: don't assume modules are immediately below ccan/ dir.

Removing this assumption should allow nested modules.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>