1905369c9f
- New STATUS_CHECK protocol status (value 6) - Client sends path + size + mtime; server replies OK (skip) or NEXT (send) - config.h/c: use_incremental field sent/received over wire - file.c/h: file_send_single_calls_no_path helper for incremental path - client_cli.c: --incremental flag - client_send.c: per-file check before send in both single and chunk paths - server.c: STATUS_CHECK handling in receive_files() - multiprocessing.c: STATUS_CHECK handling in receive_thread() - test.py: incremental sync test case
36 lines
989 B
C
36 lines
989 B
C
#ifndef FILE_H
|
|
#define FILE_H
|
|
|
|
#include "config.h"
|
|
#include "data.h"
|
|
#include <stdbool.h>
|
|
#include <sys/stat.h>
|
|
|
|
typedef struct {
|
|
mode_t mode;
|
|
uid_t uid;
|
|
gid_t gid;
|
|
time_t mtime_sec;
|
|
long mtime_nsec;
|
|
} FileMetadata;
|
|
|
|
typedef struct {
|
|
char *path;
|
|
Data *data;
|
|
FileMetadata *metadata;
|
|
} File;
|
|
|
|
File *file_create(const char *path);
|
|
void file_destroy(void *item);
|
|
bool file_load_data(File *file);
|
|
File *file_receive(Config *config, int file_descriptor);
|
|
bool file_send_single_calls(File *file, int file_descriptor, bool use_metadata, int compression_level);
|
|
bool file_send_single_calls_no_path(File *file, int file_descriptor, bool use_metadata, int compression_level);
|
|
bool file_send_sendfile(File *file, int file_descriptor, bool use_metadata);
|
|
size_t file_content_to_buffer(File *file);
|
|
FileMetadata *file_metadata_create(struct stat *stats);
|
|
void file_metadata_destroy(void *metadata);
|
|
bool to_disk(const char *path, const void *data, unsigned long long data_size);
|
|
|
|
#endif
|