Commit 7d1f0c73 authored by Rusty Russell's avatar Rusty Russell

crypto/shachain/tools: update to new rbuf API.

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 8e6c2fec
......@@ -5,7 +5,7 @@ CFLAGS=-Wall -Werror -O3 -I$(CCANDIR) -DSHACHAIN_BITS=48
#CFLAGS=-Wall -Werror -g3 -I$(CCANDIR) -DSHACHAIN_BITS=48
# 48 bit index for shachain. This is what lightning uses.
CCAN_OBJS:=ccan-str.o ccan-err.o ccan-hex.o ccan-shachain.o ccan-sha256.o ccan-rbuf.o
CCAN_OBJS:=ccan-str.o ccan-err.o ccan-hex.o ccan-shachain.o ccan-sha256.o ccan-rbuf.o ccan-membuf.o
all: shachain48
......@@ -15,6 +15,7 @@ shachain48.o: $(CCANDIR)/ccan/crypto/shachain/shachain.h \
$(CCANDIR)/ccan/str/hex/hex.h \
$(CCANDIR)/ccan/str/str.h \
$(CCANDIR)/ccan/err/err.h \
$(CCANDIR)/ccan/membuf/membuf.h \
$(CCANDIR)/ccan/rbuf/rbuf.h
shachain48.o $(CCAN_OBJS): $(CCANDIR)/config.h
......@@ -37,3 +38,5 @@ ccan-sha256.o: $(CCANDIR)/ccan/crypto/sha256/sha256.c
$(CC) $(CFLAGS) -c -o $@ $<
ccan-rbuf.o: $(CCANDIR)/ccan/rbuf/rbuf.c
$(CC) $(CFLAGS) -c -o $@ $<
ccan-membuf.o: $(CCANDIR)/ccan/membuf/membuf.c
$(CC) $(CFLAGS) -c -o $@ $<
......@@ -16,9 +16,9 @@ int main(int argc, char *argv[])
char *p;
shachain_init(&s);
rbuf_init(&rbuf, STDIN_FILENO, malloc(size), size);
rbuf_init(&rbuf, STDIN_FILENO, malloc(size), size, membuf_realloc);
while ((p = rbuf_read_str(&rbuf, '\n', realloc)) != NULL) {
while ((p = rbuf_read_str(&rbuf, '\n')) != NULL) {
struct sha256 hash;
unsigned long long idx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment