Skip to content

Commit 42f9361

Browse files
committed
ccan: update to get improved grab_file API, and adapt code.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent b676171 commit 42f9361

39 files changed

+180
-114
lines changed

ccan/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CCAN imported from http://ccodearchive.net.
22

3-
CCAN version: init-2602-gfd3fd70c
3+
CCAN version: init-2605-gc47bf0d9

ccan/ccan/cdump/_info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* size_t j;
3434
*
3535
* // Read code from stdin.
36-
* code = grab_file(NULL, NULL);
36+
* code = grab_file_str(NULL, NULL);
3737
*
3838
* defs = cdump_extract(NULL, code, &problems);
3939
* if (!defs)

ccan/ccan/cdump/tools/cdump-enumstr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int main(int argc, char *argv[])
2727
if (argc < 2)
2828
errx(1, "Usage: cdump-enumstr <filename> [<enums>...]");
2929

30-
code = grab_file(NULL, streq(argv[1], "-") ? NULL : argv[1]);
30+
code = grab_file_str(NULL, streq(argv[1], "-") ? NULL : argv[1]);
3131
if (!code)
3232
err(1, "Reading %s", argv[1]);
3333

ccan/ccan/crc32c/benchmark/bench.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int main(int argc, char *argv[])
3131
if (argc < 2 || (runs = atol(argv[1])) == 0)
3232
errx(1, "Usage: bench <num-runs> [<file>]");
3333

34-
p = grab_file(NULL, argv[2]);
34+
p = grab_file_str(NULL, argv[2]);
3535
if (!p)
3636
err(1, "Reading %s", argv[2] ? argv[2] : "<stdin>");
3737
len = tal_count(p) - 1;

ccan/ccan/htable/tools/hsearchspeed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int main(int argc, char *argv[])
2929
char **w;
3030
ENTRY *words, *misswords;
3131

32-
w = tal_strsplit(NULL, grab_file(NULL,
32+
w = tal_strsplit(NULL, grab_file_str(NULL,
3333
argv[1] ? argv[1] : "/usr/share/dict/words"), "\n", STR_NO_EMPTY);
3434
num = tal_count(w) - 1;
3535
printf("%zu words\n", num);

ccan/ccan/htable/tools/stringspeed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
4848
struct htable_str ht;
4949
char **words, **misswords;
5050

51-
words = tal_strsplit(NULL, grab_file(NULL,
51+
words = tal_strsplit(NULL, grab_file_str(NULL,
5252
argv[1] ? argv[1] : "/usr/share/dict/words"), "\n",
5353
STR_NO_EMPTY);
5454
htable_str_init(&ht);

ccan/ccan/rune/test/run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main(void)
3939
mr = rune_new(NULL, secret_zero, sizeof(secret_zero), NULL);
4040

4141
/* Python runes library generates test vectors */
42-
vecs = grab_file(mr, "test/test_vectors.csv");
42+
vecs = grab_file_str(mr, "test/test_vectors.csv");
4343
assert(vecs);
4444
lines = tal_strsplit(mr, take(vecs), "\n", STR_NO_EMPTY);
4545

ccan/ccan/strset/_info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* char *file, *word;
3333
*
3434
* strset_init(&words);
35-
* file = grab_fd(NULL, 0);
35+
* file = grab_fd_str(NULL, 0);
3636
* if (!file)
3737
* err(1, "Reading stdin");
3838
*

ccan/ccan/strset/tools/cbspeed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ int main(int argc, char *argv[])
395395
critbit0_tree ct;
396396
char **words, **misswords;
397397

398-
words = tal_strsplit(NULL, grab_file(NULL,
398+
words = tal_strsplit(NULL, grab_file_str(NULL,
399399
argv[1] ? argv[1] : "/usr/share/dict/words"), "\n", STR_NO_EMPTY);
400400
ct.root = NULL;
401401
num = tal_count(words) - 1;

ccan/ccan/strset/tools/speed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
4646
struct strset set;
4747
char **words, **misswords;
4848

49-
words = tal_strsplit(NULL, grab_file(NULL,
49+
words = tal_strsplit(NULL, grab_file_str(NULL,
5050
argv[1] ? argv[1] : "/usr/share/dict/words"),
5151
"\n", STR_NO_EMPTY);
5252
strset_init(&set);

0 commit comments

Comments
 (0)