-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplib.h
55 lines (45 loc) · 1.31 KB
/
splib.h
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
/*
* Copyright (c) 2017 ltlollo
* Licensed under the MIT license <LICENSE-MIT or
* http://opensource.org/licenses/MIT>. This file may not be copied,
* modified, or distributed except according to those terms.
*/
#ifndef SPLIB_H
#define SPLIB_H
#include <stdint.h>
typedef uint8_t u8;
typedef uint64_t u64;
typedef struct {
u8 fsig;
u8 ele;
u8 n;
u8 m;
u64 size;
} Info;
#define BUFSIZE 4096
#define FLEN 1024
#define EXT ".spl"
#define FSIG 0x80
#define MAXNUM (u8)(0xFFFFFFFFFFFFFFFF)
#ifdef __cplusplus
extern "C" {
#endif
// splitvb(N, PATHS[M], M, IN, RND): splits the IN file in M files such that N
// are needed to recover; the generated files will be named PATHS[0:M);
// the RND file is used to get randomness.
// Returns 0 on sucess
int splitvp(u8, char const* [], u8, const char *, const char *);
// split(N, PATHS[M], M, IN, RND): splits the IN file in M files such that N
// are needed to recover;
// the generated files will be named IN + [0:M) + EXT;
// the RND file is used to get randomness;
// returns 0 on sucess
int split(u8, u8, const char *, const char *);
// join(OUT, PATHS[N], N): joins PATHS[0:N) files in the OUT file as if they
// where generated by split;
// returns 0 on success
int join(const char *, char *const[], u8);
#ifdef __cplusplus
}
#endif
#endif // SPLIB_H