forked from dystophia/SnowFall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.h
25 lines (21 loc) · 618 Bytes
/
util.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
#ifndef UTIL_HEADER
#define UTIL_HEADER
#define min(a,b) (((a)<(b))?(a):(b))
struct fieldInfo {
int field;
int testnet;
char *name;
char *root;
char *prefix;
char *unit;
uint64_t bytes;
uint32_t gbytes;
int threads;
};
int writep(int fd, unsigned char *buf, int n);
int pwritep(int fd, unsigned char *buf, int n, uint64_t position);
int readp(int fd, unsigned char *buf, int n);
void phex(void* mem, int size);
int openFile(char *directory, struct fieldInfo *info, char *suffix, int read, char *raw);
void getFieldInfo(struct fieldInfo *target, int field, int testnet);
#endif