refactor: remove dead API, rename to_disk/config_is_remote_dest, fix perror newlines

- Delete unused public array_list_extend (made static)
- Delete legacy 16-parameter parallel_scanner_create wrapper; migrate test to parallel_scanner_create_with_options
- Rename to_disk -> file_write_to_disk and is_remote_dest -> config_is_remote_dest for module_action naming convention
- Remove stray newlines in perror calls (perror already appends one)
This commit is contained in:
2026-08-30 13:50:42 +02:00
parent 1abc17142f
commit f2917eb163
19 changed files with 59 additions and 81 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ void array_list_delete(ArrayList* array_list) {
free(array_list);
}
bool array_list_extend(ArrayList* array_list) {
static bool array_list_extend(ArrayList* array_list) {
if (array_list == NULL)
return false;
int new_capacity = array_list->capacity * 2;
-1
View File
@@ -14,7 +14,6 @@ typedef struct ArrayList {
ArrayList* array_list_create(void (*item_destroyer)(void* item));
void array_list_delete(ArrayList* array_list);
bool array_list_extend(ArrayList* array_list);
bool array_list_add(ArrayList* array_list, void* item);
void** array_list_to_array(const ArrayList* array_list);
+2 -2
View File
@@ -108,7 +108,7 @@ Config* config_create(void) {
return config;
}
bool is_remote_dest(const char* s) {
bool config_is_remote_dest(const char* s) {
if (s == NULL)
return false;
const char* colon = strchr(s, ':');
@@ -124,7 +124,7 @@ bool is_remote_dest(const char* s) {
}
void config_parse_ssh_dest(Config* config) {
if (!is_remote_dest(config->receive_root_directory))
if (!config_is_remote_dest(config->receive_root_directory))
return;
config->transport = TRANSPORT_SSH;
config->ssh_destination = str_dup(config->receive_root_directory);
+1 -1
View File
@@ -135,7 +135,7 @@ Config* config_create(void);
void config_delete(Config* config);
bool config_send(int file_descriptor, const Config* config);
Config* config_receive(int file_descriptor);
bool is_remote_dest(const char* s);
bool config_is_remote_dest(const char* s);
void config_parse_ssh_dest(Config* config);
#endif
+1 -1
View File
@@ -647,7 +647,7 @@ File* receive_incremental_check(int fd, const Config* config, bool* skipped) {
return file;
}
bool to_disk(const char* path, const void* data, unsigned long long data_size, bool inplace,
bool file_write_to_disk(const char* path, const void* data, unsigned long long data_size, bool inplace,
bool sparse) {
if (!path || (!data && data_size != 0) || has_path_traversal(path))
return false;
+1 -1
View File
@@ -35,7 +35,7 @@ bool file_send_sendfile(File* file, int file_descriptor, bool use_metadata, int
size_t file_content_to_buffer(File* file);
FileMetadata* file_metadata_create(const struct stat* stats);
void file_metadata_destroy(void* metadata);
bool to_disk(const char* path, const void* data, unsigned long long data_size, bool inplace,
bool file_write_to_disk(const char* path, const void* data, unsigned long long data_size, bool inplace,
bool sparse);
bool file_save_to_disk(const char* root_directory, const File* file, const Config* config);
bool file_set_authorized_root(int fd, const char* canonical_path);