ccanlint: enhance and streamline "output" testing lines. 1) Require "" around input 2) Make them optional around output: if not there, loose match whitespace 3) Handle \n in output. 4) Document that "Given xxx" is optional. 5) Reject any non-matching comment lines starting with "given" or "outputs" 6) Fix missed test in ccan/cast Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan: Correct some poor conventions in _info includes There are a couple of small problems with the includes used in most of ccan's _info files. * _info routinely uses printf(), and so should include <stdio.h>, but only some of them do. We get away with it, because they do include <string.h>, which apparently includes <stdio.h> indirectly, but we should be explicit about it. * Most _info files were including config.h after the system headers. That _seems_ sensible, but actually causes problems. Because config.h defines _GNU_SOURCE it can change the behaviour of the system headers. More specifically it can make them behave differently to how the individual module headers (which have included config.h) expects them to behave. This patch adjusts all the existing _info files and, more importantly, the template constructed by ccanlint. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> 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>
Relicense all public domain modules to CC0. I wrote all of most of them, for the others, here's the CCAN mailing list thread authorizing it: From: Timothy B. Terriberry <tterribe@xiph.org> Subject: Re: [ccan] Changing from Public Domain to CC0 To: Rusty Russell <rusty@rustcorp.com.au> Cc: ccan@ozlabs.org Date: Wed, 31 Oct 2012 02:53:50 -0400 Rusty Russell <rusty@rustcorp.com.au> wrote: > I want to change the License string (and add a symlink) to the following > trivial modules. Please Ack. > isaac Ack. From: Alessandro Guido <ag@alessandroguido.name> Subject: Re: Changing from Public Domain to CC0 To: Rusty Russell <rusty@rustcorp.com.au> Date: Wed, 31 Oct 2012 10:59:53 +0100 Acked-by: Alessandro Guido <ag@alessandroguido.name> From: Brad Hards <bradh@frogmouth.net> Subject: Re: Changing from Public Domain to CC0 To: Rusty Russell <rusty@rustcorp.com.au> Cc: Joey Adams <joeyadams3.14159@gmail.com>, Alessandro Guido <ag@alessandroguido.name>, Andreas Schlick <schlick@lavabit.com>, ccan@ozlabs.org Date: Wed, 31 Oct 2012 23:43:24 +1100 On 31/10/12 17:43, Rusty Russell wrote: > Damn lawyers! > > Since Public Domain is a slippery concept outside certain countries, it > has been suggested that I formalize it to Creative Commons Zero. > > I want to change the License string (and add a symlink) to the following > trivial modules. Please Ack. Ack. More generally, anything I've put into CCAN is so trivial that you can relicense it (to any Free / Open Source license) as part of any relicensing you can otherwise get agreement to. Brad [Sorry if this comes out in HTML - I'm stuck with unsat tools while travelling]. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
strset, strmap: invert iterator function meaning. Make a false return abort the iteration, not true. The old way makes sense for search functions (true == I found it), but other kinds of iteration are more common (brute force search is probably dumb).
setset: fix API to match strmap and common sense. strset_set -> strset_add strset_clear -> strset_del strset_test -> strset_get strset_destroy -> strset_clear
strset: new module using critbit trees. Not as fast as using htable, but simple and provides order and prefix ops.