23b1d6660c
CI / lint (push) Failing after 16s
CI / build-and-test (push) Has been skipped
CI / sanitizers (address) (push) Has been skipped
CI / sanitizers (thread) (push) Has been skipped
CI / lint (pull_request) Failing after 44s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (thread) (pull_request) Has been skipped
- Reformat all C/H files to match .clang-format (LLVM style) - Fix 26 cppcheck const-correctness warnings (constParameterPointer, constVariablePointer, constVariable) - Update function declarations in headers to match const parameters
25 lines
587 B
C
25 lines
587 B
C
#ifndef CHUNK_H
|
|
#define CHUNK_H
|
|
|
|
#include "config.h"
|
|
#include "data.h"
|
|
#include "file.h"
|
|
#include <stdbool.h>
|
|
#include <sys/stat.h>
|
|
|
|
#define DESIRED_CHUNK_SIZE (10 * 1024 * 1024)
|
|
|
|
typedef struct {
|
|
File** items;
|
|
int element_count;
|
|
} Chunk;
|
|
|
|
Chunk* chunk_create(File** items, int element_count);
|
|
void chunk_destroy(void* chunk);
|
|
Data* chunk_serialize(Chunk* chunk, bool use_metadata);
|
|
Chunk* chunk_deserialize(Data* data, bool use_metadata);
|
|
Data* chunk_compress(Chunk* chunk, int compression_level, bool use_metadata);
|
|
Chunk* receive_chunk_data(int fd, const Config* config);
|
|
|
|
#endif
|