c4aeed9f4d
- Extract chunk_serialize/chunk_deserialize from chunk_compress/chunk_decompress - Add STATUS_CHUNK to wire protocol for chunk-mode transfers - Client: -s sends chunk via STATUS_CHUNK (serialized or compressed+serialized) - Server: handle STATUS_CHUNK in both single-threaded and multithreaded paths - Fix memory leak in receive_file_receive (free->data_destroy) - Remove dead declarations: file_receive_from_buffer, file_receive_decompress, file_compress, chunk_data_to_disk, unused #defines
29 lines
577 B
C
29 lines
577 B
C
#ifndef FILE_H
|
|
#define FILE_H
|
|
|
|
#include "data.h"
|
|
#include <sys/stat.h>
|
|
|
|
typedef struct {
|
|
char *path;
|
|
struct stat stats;
|
|
Data *data;
|
|
} File;
|
|
|
|
typedef struct {
|
|
char *path;
|
|
Data *data;
|
|
} FileReceive;
|
|
|
|
File *file_create(const char *path, struct stat *stats);
|
|
void file_destroy(void *item);
|
|
void file_load_data(File *file);
|
|
void file_print(void *item);
|
|
void file_send_single_calls(File *file, int file_descriptor);
|
|
size_t file_content_to_buffer(File *file);
|
|
|
|
FileReceive *file_receive_create(char *path, Data *data);
|
|
void file_receive_destroy(void *file_receive);
|
|
|
|
#endif
|