1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#[cfg(test)]
#[macro_use]
extern crate quickcheck;

#[macro_use]
extern crate nom;

extern crate clap;

extern crate rand;

extern crate chrono;

extern crate smallvec;
extern crate ctrlc;

extern crate reed_solomon_erasure;

extern crate sha1;
extern crate sha2;
extern crate blake2_c;

mod crc_ccitt;

macro_rules! smallvec {
    [
        $arr:ty => $val:expr; $len:expr
    ] => {{
        let mut v : SmallVec<$arr> = SmallVec::with_capacity($len);
        for _ in 0..$len {
            v.push($val);
        }
        v
    }};
    [
        $val:expr; $len:expr
    ] => {{
        let mut v = SmallVec::with_capacity($len);
        for _ in 0..$len {
            v.push($val);
        }
        v
    }}
}

macro_rules! break_if_eof_seen {
    (
        $read_res:expr
    ) => {
        if $read_res.eof_seen { break; }
    }
}

mod file_error;
mod stdin_error;
mod stdout_error;

mod general_error;
use general_error::Error;
use general_error::ErrorKind;

#[macro_use]
mod json_macros;

#[macro_use]
mod misc_macros;

#[macro_use]
mod cli_macros;

#[macro_use]
mod block_preds;

mod multihash;
mod multihash_tests;
pub mod json_printer;
mod json_utils;
mod misc_utils;
mod misc_utils_tests;
mod file_utils;
mod file_utils_tests;
mod rand_utils;
mod time_utils;
mod time_utils_tests;
mod integer_utils;
mod integer_utils_tests;
mod block_utils;
pub mod output_channel;

pub mod sbx_block;
pub mod sbx_specs;
mod sbx_specs_tests;

mod log;

mod rs_codec;

mod encode_core;
mod decode_core;
mod rescue_core;
mod repair_core;
mod show_core;
mod sort_core;
mod check_core;

mod progress_report;

mod reader;
mod file_reader;
mod writer;
mod file_writer;

mod cli_utils;

pub mod cli_encode;
pub mod cli_decode;
pub mod cli_rescue;
pub mod cli_show;
pub mod cli_repair;
pub mod cli_check;
pub mod cli_sort;
pub mod cli_calc;