#define BLOCK_SIZE 16384
struct block {
+ size_t index;
unsigned char hash[crypto_hash_sha256_BYTES];
struct block *next;
};
struct file {
char *name;
char *path;
- unsigned char root[crypto_hash_sha256_BYTES];
+
+ struct block *root;
struct block *piece_layers;
+ struct block *blocks;
+
uint64_t size;
};
return -1;
}
+ (*p)->index = 0;
memset((*p)->hash,0,crypto_hash_sha256_BYTES);
(*p)->next = NULL;
(*p)->name = strdup(b);
- memset((*p)->root,0,crypto_hash_sha256_BYTES);
+ (*p)->root = NULL;
(*p)->piece_layers = NULL;
+ (*p)->blocks = NULL;
+
(*p)->size = 0;
return 1;