Skip to content

Commit f486070

Browse files
committed
Working on option parsing.
1 parent 126e868 commit f486070

31 files changed

+518
-136
lines changed

src/Makefile.in

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,47 @@ toolname = seedtool
2828
.PHONY: all
2929
all: $(toolname)
3030

31-
OBJS = seedtool.o utils.o generators.o params.o input.o output.o random.o randombytes.o hkdf.o
31+
OBJS = \
32+
seedtool.o \
33+
utils.o \
34+
params.o \
35+
random.o \
36+
randombytes.o \
37+
hkdf.o \
38+
format.o \
39+
format-base6.o \
40+
format-base10.o \
41+
format-bip39.o \
42+
format-bits.o \
43+
format-cards.o \
44+
format-dice.o \
45+
format-hex.o \
46+
format-ints.o \
47+
format-random.o \
48+
format-slip39.o
3249

3350
LDFLAGS = -lbc-crypto-base -lbc-shamir -lbc-slip39 -lbc-bip39 -largp
3451

3552
$(toolname): $(OBJS)
3653

37-
seedtool.o: generators.h params.h
54+
seedtool.o: params.h format.h
3855
utils.o: utils.h
39-
input.o: input.h params.h
40-
output.o: output.h params.h utils.h
41-
params.o: params.h utils.h input.h output.h
42-
generators.o: generators.h utils.h
56+
params.o: params.h utils.h random.h formats-all.h
4357
random.o: random.h randombytes.h hkdf.h
4458
randombytes.o: randombytes.h
4559
hkdf.o: hkdf.h
60+
format.o: format.h utils.h
61+
formats-all.h: format-base6.h format-base10.h format-bip39.h format-bits.h format-cards.h format-dice.h format-hex.h format-ints.h format-random.h format-slip39.h
62+
format-base6.o: format-base6.h format.h params.h
63+
format-base10.o: format-base10.h format.h params.h
64+
format-bip39.o: format-bip39.h format.h params.h
65+
format-bits.o: format-bits.h format.h params.h
66+
format-cards.o: format-cards.h format.h params.h
67+
format-dice.o: format-dice.h format.h params.h
68+
format-hex.o: format-hex.h format.h params.h
69+
format-ints.o: format-ints.h format.h params.h
70+
format-random.o: format-random.h random.h format.h params.h
71+
format-slip39.o: format-slip39.h format.h params.h
4672

4773
bindir = $(DESTDIR)/$(prefix)/bin
4874

@@ -62,7 +88,7 @@ check: $(toolname)
6288

6389
.PHONY: clean
6490
clean:
65-
rm -f $(toolname) $(OBJS)
91+
rm -f $(toolname) *.o
6692
rm -rf *.dSYM
6793

6894
.PHONY: distclean
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
//
2-
// input.h
2+
// format-base10.c
33
//
44
// Copyright © 2020 by Blockchain Commons, LLC
55
// Licensed under the "BSD-2-Clause Plus Patent License"
66
//
77

8-
#ifndef INPUT_H
9-
#define INPUT_H
10-
8+
#include "format-base10.h"
119
#include "params.h"
12-
13-
void random_input_processor(params* p);
14-
15-
#endif /* INPUT_H */

src/format-base10.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// format-base10.h
3+
//
4+
// Copyright © 2020 by Blockchain Commons, LLC
5+
// Licensed under the "BSD-2-Clause Plus Patent License"
6+
//
7+
8+
#ifndef FORMAT_BASE10_H
9+
#define FORMAT_BASE10_H
10+
11+
#include "format.h"
12+
13+
#endif /* FORMAT_BASE10_H */
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
//
2-
// output.h
2+
// format-base6.c
33
//
44
// Copyright © 2020 by Blockchain Commons, LLC
55
// Licensed under the "BSD-2-Clause Plus Patent License"
66
//
77

8-
#ifndef OUTPUT_H
9-
#define OUTPUT_H
10-
8+
#include "format-base6.h"
119
#include "params.h"
12-
13-
void hex_output_processor(params* p);
14-
15-
#endif /* OUTPUT_H */

src/format-base6.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// format-base6.h
3+
//
4+
// Copyright © 2020 by Blockchain Commons, LLC
5+
// Licensed under the "BSD-2-Clause Plus Patent License"
6+
//
7+
8+
#ifndef FORMAT_BASE6_H
9+
#define FORMAT_BASE6_H
10+
11+
#include "format.h"
12+
13+
#endif /* FORMAT_BASE6_H */

src/format-bip39.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// format-bip39.c
3+
//
4+
// Copyright © 2020 by Blockchain Commons, LLC
5+
// Licensed under the "BSD-2-Clause Plus Patent License"
6+
//
7+
8+
#include "format-bip39.h"
9+
#include "params.h"

src/format-bip39.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// format-bip39.h
3+
//
4+
// Copyright © 2020 by Blockchain Commons, LLC
5+
// Licensed under the "BSD-2-Clause Plus Patent License"
6+
//
7+
8+
#ifndef FORMAT_BIP39_H
9+
#define FORMAT_BIP39_H
10+
11+
#include "format.h"
12+
13+
#endif /* FORMAT_BIP39_H */

src/format-bits.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// format-bits.c
3+
//
4+
// Copyright © 2020 by Blockchain Commons, LLC
5+
// Licensed under the "BSD-2-Clause Plus Patent License"
6+
//
7+
8+
#include "format-bits.h"
9+
#include "params.h"

src/format-bits.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// format-bits.h
3+
//
4+
// Copyright © 2020 by Blockchain Commons, LLC
5+
// Licensed under the "BSD-2-Clause Plus Patent License"
6+
//
7+
8+
#ifndef FORMAT_BITS_H
9+
#define FORMAT_BITS_H
10+
11+
#include "format.h"
12+
13+
#endif /* FORMAT_BITS_H */

src/format-cards.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//
2+
// format-cards.c
3+
//
4+
// Copyright © 2020 by Blockchain Commons, LLC
5+
// Licensed under the "BSD-2-Clause Plus Patent License"
6+
//
7+
8+
#include "format-cards.h"
9+
#include "params.h"

0 commit comments

Comments
 (0)