breakpoint: new module.

Thanks to Jeremy Kerr for the idea!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal/path: fix unset vars in error paths.

Compiling with optimization FTW.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan: Fix calling memset with zero length parameter

Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
bitmap: Add first cut at a bitmap module

This adds a module for manipulating bitmaps, based on the API from the
Linux kernel's bitmap.h.  So far it's missing the trickier bits, but is
a little more flexible, allowing bitmaps that don't have to be contained
in an integer number of unsigned longs.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
list: add list_next and list_prev helpers.

Some way towards iterating in the middle of the list.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
bitmap: Use a typesafe(ish) parameters instead of void *

This also fixes a bug which will hit on platforms where it's not safe to
dereference a (long *) which is not correctly aligned.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
bitmap: Rework types and sizing macros

Go with "words" rather than explicitly referencing longs in the macros

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
bitmap: Rework to assume always multiple of words storage length

Handling bitmaps which extend some odd number of bits, and assuring they
don't clobber partially overlapped variables is not worth the bother.

Also avoid namespace pollution.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
bitmap: Add helper macro to statically declare bitmaps

For use as direct locals, or when the size is a constant, inside
structure definitions.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
endian/short_types: sparse support.

If you're doing endian work, sparse's bitwise annotation is extremely useful.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
short_types: update documentation on be32/le32 etc.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
endian: add documentation on endian typedefs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tal: add tal_resizez for zero-padded expansion.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ilog: relicense to Public Domain.

I noted to Timothy in 2011:
   I finally got around to implementing license checking in ccanlint,
   and it shows that your public domain ccan/isaac module uses your LGPL
   ccan/ilog module, which partially defeats the point.

   You and I are the only ones who did anything significant to ilog; I'm
   happy to relicense to PD or whatever else you want.  Or leave it, in
   which case I'll need to document it clearly.

He finally got back to me, and I sent him this patch, to which he replied:

     Ack.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ilog: reformat so webpage doesn't get confused.

The extra spaces make my web formatter think they're literal text, which
looks weird.

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

Signed-off-by: Emilio G. Cota <cota@braap.org>
heap: add example on empty heap check

Suggested-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Merge https://github.com/dgibson/ccan
Add bitmap module to Makefile.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Merge branch 'master' of ozlabs.org:ccan