minmax: New module, safe min and max macros

Add a 'minmax' module with typesafe macros to compute minimum, maximum and
clamping.  Inspired by the versions used in the Linux kernel, but using
a different implementation based on __builtin_types_compatible_p() and the
build_assert module.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
jacobson_karels: New module

A straightforward implementation of the Jacobson/Karels algorithm for
estimating round-trip time on a network link.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
idtree: use ccan/tal instead of talloc

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: fix tal_check description

Cut & paste bug.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal/link: remove incorrect references to talloc

Showing its origins in talloc_link.

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

It's a prototype unused by anything else.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal/grab_file: new module

tal variant of grab_file (which uses talloc).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
crcsync: use tal/grab_file in _info example.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
strset: update ccan/time usage in tools

Broken since commit 2012d45e273c3016dbd09b2606efc9ffab07c57f
which switched to timespec.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
strset: update tools for new ABI

Broken since commit 7c69053bd418bf0abd21f29e8cb11164684310ca
which normalized API.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
strset: use tal instead of talloc in examples and tools.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools: use tal/grab_file

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
htable: tools: use tal instead of talloc.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
grab_file: don't use str_talloc for tests.

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

All the cool kids are using tal/str now...

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal/talloc: fix overflow on 64 bit systems

Arguably a bug in talloc_realloc_array, which uses an unsigned for 
size, resulting in silent truncation and a memcpy into a too-small
buffer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal/talloc: include all ccan dependencies.

ccanlint now detects more missing dependencies.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
time: split absolute and relative times.

As suggested by David Gibson.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
io failtest timer tools: fallout from time changes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
time: time_mono() helpers.

From patch by David Gibson, rewritten on new ccan/time.

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