Compare commits
No commits in common. "2252b7d7324454560f15286feb2e59f8deee0dc2" and "4cd660ffd59f013d2199fc690a1bd5b02b2e3a7f" have entirely different histories.
2252b7d732
...
4cd660ffd5
11 changed files with 123 additions and 170 deletions
110
src/archiver.c
110
src/archiver.c
|
@ -39,9 +39,9 @@
|
|||
|
||||
#include "helpers.h"
|
||||
|
||||
#define TEMP_FILENAME_CMP "%s%ssimple_archiver_compressed_%lu.tmp"
|
||||
#define FILE_COUNTS_OUTPUT_FORMAT_STR_0 "\nFile %%%lulu of %%%lulu.\n"
|
||||
#define FILE_COUNTS_OUTPUT_FORMAT_STR_1 "[%%%lulu/%%%lulu]\n"
|
||||
#define TEMP_FILENAME_CMP "%s%ssimple_archiver_compressed_%u.tmp"
|
||||
#define FILE_COUNTS_OUTPUT_FORMAT_STR_0 "\nFile %%%uu of %%%uu.\n"
|
||||
#define FILE_COUNTS_OUTPUT_FORMAT_STR_1 "[%%%uu/%%%uu]\n"
|
||||
|
||||
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
|
||||
|
@ -158,8 +158,8 @@ int write_files_fn(void *data, void *ud) {
|
|||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
|
||||
// Use temp file to store compressed data.
|
||||
char temp_filename[512];
|
||||
size_t idx = 0;
|
||||
size_t temp_dir_end = strlen(state->parsed->temp_dir);
|
||||
unsigned int idx = 0;
|
||||
unsigned int temp_dir_end = strlen(state->parsed->temp_dir);
|
||||
snprintf(temp_filename, 512, TEMP_FILENAME_CMP, state->parsed->temp_dir,
|
||||
state->parsed->temp_dir[temp_dir_end - 1] == '/' ? "" : "/",
|
||||
idx);
|
||||
|
@ -341,7 +341,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
if (!read_done) {
|
||||
ret = read(pipe_outof_cmd[0], read_buf, 1024);
|
||||
if (ret > 0) {
|
||||
read_count = fwrite(read_buf, 1, (size_t)ret, tmp_fd);
|
||||
read_count = fwrite(read_buf, 1, ret, tmp_fd);
|
||||
if (read_count != (size_t)ret) {
|
||||
// Write to tmp_fd error.
|
||||
fprintf(stderr,
|
||||
|
@ -384,12 +384,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
uint16_t u16;
|
||||
uint64_t u64;
|
||||
|
||||
size_t temp_size = strlen(file_info->filename);
|
||||
if (temp_size > 0xFFFF) {
|
||||
fprintf(stderr, "ERROR: Filename size is too large to store!\n");
|
||||
return 1;
|
||||
}
|
||||
u16 = (uint16_t)temp_size;
|
||||
u16 = strlen(file_info->filename);
|
||||
|
||||
// Write filename length.
|
||||
simple_archiver_helper_16_bit_be(&u16);
|
||||
|
@ -411,7 +406,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
temp_to_write = malloc(sizeof(SDArchiverInternalToWrite));
|
||||
temp_to_write->buf = malloc(4);
|
||||
temp_to_write->size = 4;
|
||||
for (size_t idx = 0; idx < temp_to_write->size; ++idx) {
|
||||
for (unsigned int idx = 0; idx < temp_to_write->size; ++idx) {
|
||||
((unsigned char *)temp_to_write->buf)[idx] = 0;
|
||||
}
|
||||
|
||||
|
@ -479,7 +474,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
}
|
||||
|
||||
// Write file length.
|
||||
u64 = (uint64_t)end;
|
||||
u64 = end;
|
||||
simple_archiver_helper_64_bit_be(&u64);
|
||||
temp_to_write = malloc(sizeof(SDArchiverInternalToWrite));
|
||||
temp_to_write->buf = malloc(8);
|
||||
|
@ -516,12 +511,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
uint16_t u16;
|
||||
uint64_t u64;
|
||||
|
||||
size_t temp_size = strlen(file_info->filename);
|
||||
if (temp_size > 0xFFFF) {
|
||||
fprintf(stderr, "ERROR: Filename is too large to store!\n");
|
||||
return 1;
|
||||
}
|
||||
u16 = (uint16_t)temp_size;
|
||||
u16 = strlen(file_info->filename);
|
||||
|
||||
// Write filename length.
|
||||
simple_archiver_helper_16_bit_be(&u16);
|
||||
|
@ -543,7 +533,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
temp_to_write = malloc(sizeof(SDArchiverInternalToWrite));
|
||||
temp_to_write->buf = malloc(4);
|
||||
temp_to_write->size = 4;
|
||||
for (size_t idx = 0; idx < temp_to_write->size; ++idx) {
|
||||
for (unsigned int idx = 0; idx < temp_to_write->size; ++idx) {
|
||||
((unsigned char *)temp_to_write->buf)[idx] = 0;
|
||||
}
|
||||
|
||||
|
@ -616,7 +606,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
// Error.
|
||||
return 1;
|
||||
}
|
||||
u64 = (uint64_t)end;
|
||||
u64 = end;
|
||||
simple_archiver_helper_64_bit_be(&u64);
|
||||
temp_to_write = malloc(sizeof(SDArchiverInternalToWrite));
|
||||
temp_to_write->buf = malloc(8);
|
||||
|
@ -657,12 +647,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
// A symblic link.
|
||||
uint16_t u16;
|
||||
|
||||
size_t temp_size = strlen(file_info->filename);
|
||||
if (temp_size > 0xFFFF) {
|
||||
fprintf(stderr, "ERROR: Filename is too large to store!\n");
|
||||
return 1;
|
||||
}
|
||||
u16 = (uint16_t)temp_size;
|
||||
u16 = strlen(file_info->filename);
|
||||
|
||||
// Write filename length.
|
||||
simple_archiver_helper_16_bit_be(&u16);
|
||||
|
@ -684,7 +669,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
temp_to_write = malloc(sizeof(SDArchiverInternalToWrite));
|
||||
temp_to_write->buf = malloc(4);
|
||||
temp_to_write->size = 4;
|
||||
for (size_t idx = 0; idx < temp_to_write->size; ++idx) {
|
||||
for (unsigned int idx = 0; idx < temp_to_write->size; ++idx) {
|
||||
((unsigned char *)temp_to_write->buf)[idx] = 0;
|
||||
}
|
||||
|
||||
|
@ -761,8 +746,8 @@ int write_files_fn(void *data, void *ud) {
|
|||
|
||||
// Compare paths to get relative path.
|
||||
// Get first non-common char.
|
||||
size_t idx;
|
||||
size_t last_slash;
|
||||
unsigned int idx;
|
||||
unsigned int last_slash;
|
||||
for (idx = 0, last_slash = 0;
|
||||
idx < strlen(abs_path) && idx < strlen(link_abs_path); ++idx) {
|
||||
if (((const char *)abs_path)[idx] !=
|
||||
|
@ -827,12 +812,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
simple_archiver_list_add(to_write, temp_to_write, free_internal_to_write);
|
||||
} else if ((state->parsed->flags & 0x20) == 0) {
|
||||
// Write absolute path length.
|
||||
size_t temp_size = strlen(abs_path);
|
||||
if (temp_size > 0xFFFF) {
|
||||
fprintf(stderr, "ERROR: Absolute path name is too large!\n");
|
||||
return 1;
|
||||
}
|
||||
u16 = (uint16_t)temp_size;
|
||||
u16 = strlen(abs_path);
|
||||
simple_archiver_helper_16_bit_be(&u16);
|
||||
|
||||
temp_to_write = malloc(sizeof(SDArchiverInternalToWrite));
|
||||
|
@ -861,12 +841,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
|
||||
if (rel_path) {
|
||||
// Write relative path length.
|
||||
size_t temp_size = strlen(rel_path);
|
||||
if (temp_size > 0xFFFF) {
|
||||
fprintf(stderr, "ERROR: Relative path name is too large!\n");
|
||||
return 1;
|
||||
}
|
||||
u16 = (uint16_t)temp_size;
|
||||
u16 = strlen(rel_path);
|
||||
simple_archiver_helper_16_bit_be(&u16);
|
||||
temp_to_write = malloc(sizeof(SDArchiverInternalToWrite));
|
||||
temp_to_write->buf = malloc(2);
|
||||
|
@ -909,7 +884,7 @@ int write_files_fn(void *data, void *ud) {
|
|||
int filenames_to_abs_map_fn(void *data, void *ud) {
|
||||
SDArchiverFileInfo *file_info = data;
|
||||
void **ptr_array = ud;
|
||||
SDArchiverHashMap *abs_filenames = ptr_array[0];
|
||||
SDArchiverHashMap **abs_filenames = ptr_array[0];
|
||||
const char *user_cwd = ptr_array[1];
|
||||
__attribute__((cleanup(
|
||||
simple_archiver_helper_cleanup_chdir_back))) char *original_cwd = NULL;
|
||||
|
@ -1036,7 +1011,7 @@ int simple_archiver_write_all(FILE *out_f, SDArchiverState *state,
|
|||
__attribute__((cleanup(simple_archiver_hash_map_free)))
|
||||
SDArchiverHashMap *abs_filenames = simple_archiver_hash_map_init();
|
||||
void **ptr_array = malloc(sizeof(void *) * 2);
|
||||
ptr_array[0] = abs_filenames;
|
||||
ptr_array[0] = &abs_filenames;
|
||||
ptr_array[1] = (void *)state->parsed->user_cwd;
|
||||
if (simple_archiver_list_get(filenames, filenames_to_abs_map_fn, ptr_array)) {
|
||||
free(ptr_array);
|
||||
|
@ -1068,19 +1043,14 @@ int simple_archiver_write_all(FILE *out_f, SDArchiverState *state,
|
|||
return SDAS_FAILED_TO_WRITE;
|
||||
}
|
||||
c = 0;
|
||||
for (size_t i = 0; i < 3; ++i) {
|
||||
for (unsigned int i = 0; i < 3; ++i) {
|
||||
if (fwrite(&c, 1, 1, out_f) != 1) {
|
||||
return SDAS_FAILED_TO_WRITE;
|
||||
}
|
||||
}
|
||||
|
||||
// De/compressor bytes.
|
||||
size_t temp_size = strlen(state->parsed->compressor);
|
||||
if (temp_size > 0xFFFF) {
|
||||
fprintf(stderr, "ERROR: Compressor cmd string is too large!\n");
|
||||
return SDAS_NO_COMPRESSOR;
|
||||
}
|
||||
u16 = (uint16_t)temp_size;
|
||||
u16 = strlen(state->parsed->compressor);
|
||||
// To big-endian.
|
||||
simple_archiver_helper_16_bit_be(&u16);
|
||||
// Write the size in big-endian.
|
||||
|
@ -1095,12 +1065,7 @@ int simple_archiver_write_all(FILE *out_f, SDArchiverState *state,
|
|||
return SDAS_FAILED_TO_WRITE;
|
||||
}
|
||||
|
||||
temp_size = strlen(state->parsed->decompressor);
|
||||
if (temp_size > 0xFFFF) {
|
||||
fprintf(stderr, "ERROR: Decompressor cmd string is too large!\n");
|
||||
return SDAS_NO_DECOMPRESSOR;
|
||||
}
|
||||
u16 = (uint16_t)temp_size;
|
||||
u16 = strlen(state->parsed->decompressor);
|
||||
// To big-endian.
|
||||
simple_archiver_helper_16_bit_be(&u16);
|
||||
// Write the size in big-endian.
|
||||
|
@ -1117,7 +1082,7 @@ int simple_archiver_write_all(FILE *out_f, SDArchiverState *state,
|
|||
} else {
|
||||
// Write the four flag bytes with first bit NOT set.
|
||||
unsigned char c = 0;
|
||||
for (size_t i = 0; i < 4; ++i) {
|
||||
for (unsigned int i = 0; i < 4; ++i) {
|
||||
if (fwrite(&c, 1, 1, out_f) != 1) {
|
||||
return SDAS_FAILED_TO_WRITE;
|
||||
}
|
||||
|
@ -1126,11 +1091,7 @@ int simple_archiver_write_all(FILE *out_f, SDArchiverState *state,
|
|||
|
||||
// Write file count.
|
||||
{
|
||||
if (filenames->count > 0xFFFFFFFF) {
|
||||
fprintf(stderr, "ERROR: Filenames count is too large!\n");
|
||||
return SDAS_INTERNAL_ERROR;
|
||||
}
|
||||
uint32_t u32 = (uint32_t)filenames->count;
|
||||
uint32_t u32 = filenames->count;
|
||||
simple_archiver_helper_32_bit_be(&u32);
|
||||
if (fwrite(&u32, 1, 4, out_f) != 4) {
|
||||
return SDAS_FAILED_TO_WRITE;
|
||||
|
@ -1271,7 +1232,7 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
fprintf(stderr, "File count is %u\n", u32);
|
||||
|
||||
const uint32_t size = u32;
|
||||
const size_t digits = simple_archiver_helper_num_digits(size);
|
||||
const unsigned int digits = simple_archiver_helper_num_digits(size);
|
||||
char format_str[128];
|
||||
snprintf(format_str, 128, FILE_COUNTS_OUTPUT_FORMAT_STR_0, digits, digits);
|
||||
int skip = 0;
|
||||
|
@ -1281,12 +1242,12 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
state->parsed->working_files[0] != NULL) {
|
||||
hash_map = simple_archiver_hash_map_init();
|
||||
for (char **iter = state->parsed->working_files; *iter != NULL; ++iter) {
|
||||
size_t len = strlen(*iter) + 1;
|
||||
int len = strlen(*iter) + 1;
|
||||
char *key = malloc(len);
|
||||
memcpy(key, *iter, len);
|
||||
key[len - 1] = 0;
|
||||
simple_archiver_hash_map_insert(
|
||||
hash_map, key, key, len,
|
||||
&hash_map, key, key, len,
|
||||
simple_archiver_helper_datastructure_cleanup_nop, NULL);
|
||||
// fprintf(stderr, "\"%s\" put in map\n", key);
|
||||
}
|
||||
|
@ -1365,7 +1326,7 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
return SDAS_INVALID_FILE;
|
||||
}
|
||||
|
||||
mode_t permissions = 0;
|
||||
unsigned int permissions = 0;
|
||||
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX
|
||||
|
@ -1576,7 +1537,7 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
int write_again = 0;
|
||||
int write_pipe_done = 0;
|
||||
int read_pipe_done = 0;
|
||||
size_t fread_ret;
|
||||
ssize_t fread_ret;
|
||||
char recv_buf[1024];
|
||||
size_t amount_to_read;
|
||||
while (!write_pipe_done || !read_pipe_done) {
|
||||
|
@ -1604,7 +1565,7 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
// Send over pipe to decompressor.
|
||||
if (fread_ret > 0) {
|
||||
ssize_t write_ret = write(pipe_into_cmd[1], buf, fread_ret);
|
||||
if (write_ret > 0 && (size_t)write_ret == fread_ret) {
|
||||
if (write_ret == fread_ret) {
|
||||
// Successful write.
|
||||
write_again = 0;
|
||||
if (compressed_file_size == 0) {
|
||||
|
@ -1635,8 +1596,7 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
if (!read_pipe_done) {
|
||||
ssize_t read_ret = read(pipe_outof_cmd[0], recv_buf, 1024);
|
||||
if (read_ret > 0) {
|
||||
size_t fwrite_ret =
|
||||
fwrite(recv_buf, 1, (size_t)read_ret, out_f);
|
||||
size_t fwrite_ret = fwrite(recv_buf, 1, read_ret, out_f);
|
||||
if (fwrite_ret == (size_t)read_ret) {
|
||||
// Success.
|
||||
} else if (ferror(out_f)) {
|
||||
|
@ -1687,7 +1647,7 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
waitpid(decompressor_pid, NULL, 0);
|
||||
} else {
|
||||
uint64_t compressed_file_size = u64;
|
||||
size_t fread_ret;
|
||||
ssize_t fread_ret;
|
||||
while (compressed_file_size != 0) {
|
||||
if (compressed_file_size > 1024) {
|
||||
fread_ret = fread(buf, 1, 1024, in_f);
|
||||
|
@ -1728,14 +1688,14 @@ int simple_archiver_parse_archive_info(FILE *in_f, int do_extract,
|
|||
} else {
|
||||
while (u64 != 0) {
|
||||
if (u64 > 1024) {
|
||||
size_t read_ret = fread(buf, 1, 1024, in_f);
|
||||
ssize_t read_ret = fread(buf, 1, 1024, in_f);
|
||||
if (read_ret > 0) {
|
||||
u64 -= read_ret;
|
||||
} else if (ferror(in_f)) {
|
||||
return SDAS_INTERNAL_ERROR;
|
||||
}
|
||||
} else {
|
||||
size_t read_ret = fread(buf, 1, u64, in_f);
|
||||
ssize_t read_ret = fread(buf, 1, u64, in_f);
|
||||
if (read_ret > 0) {
|
||||
u64 -= read_ret;
|
||||
} else if (ferror(in_f)) {
|
||||
|
|
|
@ -32,9 +32,9 @@ typedef struct SDArchiverState {
|
|||
const SDArchiverParsed *parsed;
|
||||
FILE *out_f;
|
||||
SDArchiverHashMap *map;
|
||||
size_t count;
|
||||
size_t max;
|
||||
size_t digits;
|
||||
unsigned int count;
|
||||
unsigned int max;
|
||||
unsigned int digits;
|
||||
} SDArchiverState;
|
||||
|
||||
enum SDArchiverStateReturns {
|
||||
|
|
|
@ -26,18 +26,18 @@
|
|||
typedef struct SDArchiverHashMapData {
|
||||
void *value;
|
||||
void *key;
|
||||
size_t key_size;
|
||||
unsigned int key_size;
|
||||
void (*value_cleanup_fn)(void *);
|
||||
void (*key_cleanup_fn)(void *);
|
||||
} SDArchiverHashMapData;
|
||||
|
||||
typedef struct SDArchiverHashMapKeyData {
|
||||
void *key;
|
||||
size_t key_size;
|
||||
unsigned int key_size;
|
||||
} SDArchiverHashMapKeyData;
|
||||
|
||||
typedef struct SDArchiverInternalIterContext {
|
||||
int (*iter_check_fn)(const void *, size_t, const void *, void *);
|
||||
int (*iter_check_fn)(const void *, unsigned int, const void *, void *);
|
||||
int ret;
|
||||
void *user_data;
|
||||
} SDArchiverInternalIterContext;
|
||||
|
@ -75,11 +75,11 @@ int simple_archiver_hash_map_internal_pick_in_list(void *data, void *ud) {
|
|||
}
|
||||
|
||||
unsigned long long simple_archiver_hash_map_internal_key_to_hash(
|
||||
const void *key, size_t key_size) {
|
||||
const void *key, unsigned int key_size) {
|
||||
unsigned long long seed = 0;
|
||||
unsigned long long temp = 0;
|
||||
size_t count = 0;
|
||||
for (size_t idx = 0; idx < key_size; ++idx) {
|
||||
unsigned int count = 0;
|
||||
for (unsigned int idx = 0; idx < key_size; ++idx) {
|
||||
temp |= ((unsigned long long)*((unsigned char *)key + idx)) << (8 * count);
|
||||
++count;
|
||||
if (count >= 8) {
|
||||
|
@ -101,27 +101,28 @@ void simple_archiver_hash_map_internal_no_free_fn(
|
|||
}
|
||||
|
||||
/// Returns 0 on success.
|
||||
int simple_archiver_hash_map_internal_rehash(SDArchiverHashMap *hash_map) {
|
||||
if (!hash_map) {
|
||||
int simple_archiver_hash_map_internal_rehash(SDArchiverHashMap **hash_map) {
|
||||
if (!hash_map || !*hash_map) {
|
||||
return 1;
|
||||
}
|
||||
SDArchiverHashMap new_hash_map;
|
||||
new_hash_map.buckets_size = hash_map->buckets_size * 2;
|
||||
SDArchiverHashMap *new_hash_map = malloc(sizeof(SDArchiverHashMap));
|
||||
new_hash_map->buckets_size = (*hash_map)->buckets_size * 2;
|
||||
// Pointers have the same size (at least on the same machine), so
|
||||
// sizeof(void*) should be ok.
|
||||
new_hash_map.buckets = malloc(sizeof(void *) * new_hash_map.buckets_size);
|
||||
for (size_t idx = 0; idx < new_hash_map.buckets_size; ++idx) {
|
||||
new_hash_map.buckets[idx] = simple_archiver_list_init();
|
||||
new_hash_map->buckets = malloc(sizeof(void *) * new_hash_map->buckets_size);
|
||||
for (unsigned int idx = 0; idx < new_hash_map->buckets_size; ++idx) {
|
||||
new_hash_map->buckets[idx] = simple_archiver_list_init();
|
||||
}
|
||||
new_hash_map.count = 0;
|
||||
new_hash_map->count = 0;
|
||||
|
||||
// Iterate through the old hash map to populate the new hash map.
|
||||
for (size_t bucket_idx = 0; bucket_idx < hash_map->buckets_size;
|
||||
for (unsigned int bucket_idx = 0; bucket_idx < (*hash_map)->buckets_size;
|
||||
++bucket_idx) {
|
||||
SDArchiverLLNode *node = hash_map->buckets[bucket_idx]->head;
|
||||
SDArchiverLLNode *node = (*hash_map)->buckets[bucket_idx]->head;
|
||||
while (node) {
|
||||
node = node->next;
|
||||
if (node && node != hash_map->buckets[bucket_idx]->tail && node->data) {
|
||||
if (node && node != (*hash_map)->buckets[bucket_idx]->tail &&
|
||||
node->data) {
|
||||
SDArchiverHashMapData *data = node->data;
|
||||
simple_archiver_hash_map_insert(&new_hash_map, data->value, data->key,
|
||||
data->key_size, data->value_cleanup_fn,
|
||||
|
@ -132,14 +133,7 @@ int simple_archiver_hash_map_internal_rehash(SDArchiverHashMap *hash_map) {
|
|||
}
|
||||
}
|
||||
|
||||
// Free the buckets in the old hash_map.
|
||||
for (size_t idx = 0; idx < hash_map->buckets_size; ++idx) {
|
||||
SDArchiverLinkedList **linked_list = hash_map->buckets + idx;
|
||||
simple_archiver_list_free(linked_list);
|
||||
}
|
||||
free(hash_map->buckets);
|
||||
|
||||
// Move the new buckets and related data into the old hash_map.
|
||||
simple_archiver_hash_map_free(hash_map);
|
||||
*hash_map = new_hash_map;
|
||||
|
||||
return 0;
|
||||
|
@ -151,7 +145,7 @@ SDArchiverHashMap *simple_archiver_hash_map_init(void) {
|
|||
// Pointers have the same size (at least on the same machine), so
|
||||
// sizeof(void*) should be ok.
|
||||
hash_map->buckets = malloc(sizeof(void *) * hash_map->buckets_size);
|
||||
for (size_t idx = 0; idx < hash_map->buckets_size; ++idx) {
|
||||
for (unsigned int idx = 0; idx < hash_map->buckets_size; ++idx) {
|
||||
hash_map->buckets[idx] = simple_archiver_list_init();
|
||||
}
|
||||
hash_map->count = 0;
|
||||
|
@ -161,7 +155,7 @@ SDArchiverHashMap *simple_archiver_hash_map_init(void) {
|
|||
|
||||
void simple_archiver_hash_map_free(SDArchiverHashMap **hash_map) {
|
||||
if (hash_map && *hash_map) {
|
||||
for (size_t idx = 0; idx < (*hash_map)->buckets_size; ++idx) {
|
||||
for (unsigned int idx = 0; idx < (*hash_map)->buckets_size; ++idx) {
|
||||
SDArchiverLinkedList **linked_list = (*hash_map)->buckets + idx;
|
||||
simple_archiver_list_free(linked_list);
|
||||
}
|
||||
|
@ -173,11 +167,11 @@ void simple_archiver_hash_map_free(SDArchiverHashMap **hash_map) {
|
|||
}
|
||||
}
|
||||
|
||||
int simple_archiver_hash_map_insert(SDArchiverHashMap *hash_map, void *value,
|
||||
void *key, size_t key_size,
|
||||
int simple_archiver_hash_map_insert(SDArchiverHashMap **hash_map, void *value,
|
||||
void *key, unsigned int key_size,
|
||||
void (*value_cleanup_fn)(void *),
|
||||
void (*key_cleanup_fn)(void *)) {
|
||||
if (hash_map->buckets_size <= hash_map->count) {
|
||||
if ((*hash_map)->buckets_size <= (*hash_map)->count) {
|
||||
simple_archiver_hash_map_internal_rehash(hash_map);
|
||||
}
|
||||
|
||||
|
@ -190,13 +184,13 @@ int simple_archiver_hash_map_insert(SDArchiverHashMap *hash_map, void *value,
|
|||
|
||||
unsigned long long hash =
|
||||
simple_archiver_hash_map_internal_key_to_hash(key, key_size) %
|
||||
hash_map->buckets_size;
|
||||
(*hash_map)->buckets_size;
|
||||
int result = simple_archiver_list_add_front(
|
||||
hash_map->buckets[hash], data,
|
||||
(*hash_map)->buckets[hash], data,
|
||||
simple_archiver_hash_map_internal_cleanup_data);
|
||||
|
||||
if (result == 0) {
|
||||
++hash_map->count;
|
||||
++(*hash_map)->count;
|
||||
return 0;
|
||||
} else {
|
||||
if (value) {
|
||||
|
@ -220,7 +214,7 @@ int simple_archiver_hash_map_insert(SDArchiverHashMap *hash_map, void *value,
|
|||
}
|
||||
|
||||
void *simple_archiver_hash_map_get(const SDArchiverHashMap *hash_map,
|
||||
const void *key, size_t key_size) {
|
||||
const void *key, unsigned int key_size) {
|
||||
unsigned long long hash =
|
||||
simple_archiver_hash_map_internal_key_to_hash(key, key_size) %
|
||||
hash_map->buckets_size;
|
||||
|
@ -240,7 +234,7 @@ void *simple_archiver_hash_map_get(const SDArchiverHashMap *hash_map,
|
|||
}
|
||||
|
||||
int simple_archiver_hash_map_remove(SDArchiverHashMap *hash_map, void *key,
|
||||
size_t key_size) {
|
||||
unsigned int key_size) {
|
||||
unsigned long long hash =
|
||||
simple_archiver_hash_map_internal_key_to_hash(key, key_size) %
|
||||
hash_map->buckets_size;
|
||||
|
@ -275,14 +269,15 @@ int simple_archiver_internal_hash_map_bucket_iter_fn(void *data, void *ud) {
|
|||
}
|
||||
|
||||
int simple_archiver_hash_map_iter(const SDArchiverHashMap *hash_map,
|
||||
int (*iter_check_fn)(const void *, size_t,
|
||||
int (*iter_check_fn)(const void *,
|
||||
unsigned int,
|
||||
const void *, void *),
|
||||
void *user_data) {
|
||||
SDArchiverInternalIterContext ctx;
|
||||
ctx.iter_check_fn = iter_check_fn;
|
||||
ctx.ret = 0;
|
||||
ctx.user_data = user_data;
|
||||
for (size_t idx = 0; idx < hash_map->buckets_size; ++idx) {
|
||||
for (unsigned int idx = 0; idx < hash_map->buckets_size; ++idx) {
|
||||
if (simple_archiver_list_get(
|
||||
hash_map->buckets[idx],
|
||||
simple_archiver_internal_hash_map_bucket_iter_fn, &ctx) != 0) {
|
||||
|
|
|
@ -21,14 +21,12 @@
|
|||
|
||||
#define SC_SA_DS_HASH_MAP_START_BUCKET_SIZE 32
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "linked_list.h"
|
||||
|
||||
typedef struct SDArchiverHashMap {
|
||||
SDArchiverLinkedList **buckets;
|
||||
size_t buckets_size;
|
||||
size_t count;
|
||||
unsigned int buckets_size;
|
||||
unsigned int count;
|
||||
} SDArchiverHashMap;
|
||||
|
||||
SDArchiverHashMap *simple_archiver_hash_map_init(void);
|
||||
|
@ -41,19 +39,19 @@ void simple_archiver_hash_map_free(SDArchiverHashMap **hash_map);
|
|||
/// If key_cleanup_fn is NULL, then "free" is used instead.
|
||||
/// NOTICE: You must not pass NULL to value, otherwise all "get" checks will
|
||||
/// fail for the inserted key.
|
||||
int simple_archiver_hash_map_insert(SDArchiverHashMap *hash_map, void *value,
|
||||
void *key, size_t key_size,
|
||||
int simple_archiver_hash_map_insert(SDArchiverHashMap **hash_map, void *value,
|
||||
void *key, unsigned int key_size,
|
||||
void (*value_cleanup_fn)(void *),
|
||||
void (*key_cleanup_fn)(void *));
|
||||
|
||||
/// Returns NULL if not found.
|
||||
void *simple_archiver_hash_map_get(const SDArchiverHashMap *hash_map,
|
||||
const void *key, size_t key_size);
|
||||
const void *key, unsigned int key_size);
|
||||
|
||||
/// Returns zero on success. Returns one if more than one entry was removed.
|
||||
/// Otherwise returns non-zero and non-one value on error.
|
||||
int simple_archiver_hash_map_remove(SDArchiverHashMap *hash_map, void *key,
|
||||
size_t key_size);
|
||||
unsigned int key_size);
|
||||
|
||||
/// Iterates through the hash map with the "iter_check_fn", which is passed the
|
||||
/// key, key-size, value, and user_data. This function will call "iter_check_fn"
|
||||
|
@ -62,7 +60,8 @@ int simple_archiver_hash_map_remove(SDArchiverHashMap *hash_map, void *key,
|
|||
/// "iter_check_fn" returns zero for every call, then this function will return
|
||||
/// zero after having iterated through every key-value pair.
|
||||
int simple_archiver_hash_map_iter(const SDArchiverHashMap *hash_map,
|
||||
int (*iter_check_fn)(const void *, size_t,
|
||||
int (*iter_check_fn)(const void *,
|
||||
unsigned int,
|
||||
const void *, void *),
|
||||
void *user_data);
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#ifndef SEODISPARATE_COM_SIMPLE_ARCHIVER_DATA_STRUCTURE_LINKED_LIST_H_
|
||||
#define SEODISPARATE_COM_SIMPLE_ARCHIVER_DATA_STRUCTURE_LINKED_LIST_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
typedef struct SDArchiverLLNode {
|
||||
struct SDArchiverLLNode *next;
|
||||
struct SDArchiverLLNode *prev;
|
||||
|
@ -31,7 +29,7 @@ typedef struct SDArchiverLLNode {
|
|||
typedef struct SDArchiverLinkedList {
|
||||
SDArchiverLLNode *head;
|
||||
SDArchiverLLNode *tail;
|
||||
size_t count;
|
||||
unsigned int count;
|
||||
} SDArchiverLinkedList;
|
||||
|
||||
SDArchiverLinkedList *simple_archiver_list_init(void);
|
||||
|
|
|
@ -31,7 +31,7 @@ void simple_archiver_priority_heap_internal_realloc(
|
|||
new_priority_heap->nodes =
|
||||
calloc(new_priority_heap->capacity, sizeof(SDArchiverPHNode));
|
||||
|
||||
for (size_t idx = 1; idx < (*priority_heap)->size + 1; ++idx) {
|
||||
for (unsigned int idx = 1; idx < (*priority_heap)->size + 1; ++idx) {
|
||||
if ((*priority_heap)->nodes[idx].is_valid != 0) {
|
||||
simple_archiver_priority_heap_insert(
|
||||
&new_priority_heap, (*priority_heap)->nodes[idx].priority,
|
||||
|
@ -79,7 +79,7 @@ SDArchiverPHeap *simple_archiver_priority_heap_init_less_fn(
|
|||
|
||||
void simple_archiver_priority_heap_free(SDArchiverPHeap **priority_heap) {
|
||||
if (priority_heap && *priority_heap) {
|
||||
for (size_t idx = 1; idx < (*priority_heap)->size + 1; ++idx) {
|
||||
for (unsigned int idx = 1; idx < (*priority_heap)->size + 1; ++idx) {
|
||||
if ((*priority_heap)->nodes[idx].is_valid != 0) {
|
||||
if ((*priority_heap)->nodes[idx].data_cleanup_fn) {
|
||||
(*priority_heap)
|
||||
|
@ -109,7 +109,7 @@ void simple_archiver_priority_heap_insert(SDArchiverPHeap **priority_heap,
|
|||
simple_archiver_priority_heap_internal_realloc(priority_heap);
|
||||
}
|
||||
|
||||
size_t hole = (*priority_heap)->size + 1;
|
||||
unsigned int hole = (*priority_heap)->size + 1;
|
||||
|
||||
while (hole > 1 &&
|
||||
(*priority_heap)
|
||||
|
@ -146,7 +146,7 @@ void *simple_archiver_priority_heap_pop(SDArchiverPHeap *priority_heap) {
|
|||
SDArchiverPHNode end = priority_heap->nodes[priority_heap->size];
|
||||
priority_heap->nodes[priority_heap->size].is_valid = 0;
|
||||
|
||||
size_t hole = 1;
|
||||
unsigned int hole = 1;
|
||||
while (hole * 2 + 1 <= priority_heap->size) {
|
||||
if (priority_heap->nodes[hole * 2].is_valid != 0 &&
|
||||
priority_heap->nodes[hole * 2 + 1].is_valid != 0) {
|
||||
|
|
|
@ -66,7 +66,7 @@ int get_three_fn(void *data, __attribute__((unused)) void *ud) {
|
|||
int more_fn(long long a, long long b) { return a > b ? 1 : 0; }
|
||||
|
||||
int hash_map_iter_check_fn(__attribute__((unused)) const void *key,
|
||||
__attribute__((unused)) size_t key_size,
|
||||
__attribute__((unused)) unsigned int key_size,
|
||||
const void *value, void *ud) {
|
||||
char *found_buf = ud;
|
||||
const size_t real_value = (const size_t)value;
|
||||
|
@ -79,7 +79,7 @@ int hash_map_iter_check_fn(__attribute__((unused)) const void *key,
|
|||
}
|
||||
|
||||
int hash_map_iter_check_fn2(__attribute__((unused)) const void *key,
|
||||
__attribute__((unused)) size_t key_size,
|
||||
__attribute__((unused)) unsigned int key_size,
|
||||
__attribute__((unused)) const void *value,
|
||||
__attribute__((unused)) void *ud) {
|
||||
return 2;
|
||||
|
@ -145,8 +145,8 @@ int main(void) {
|
|||
key = malloc(sizeof(int));
|
||||
*value = idx;
|
||||
*key = idx;
|
||||
simple_archiver_hash_map_insert(hash_map, value, key, sizeof(int), NULL,
|
||||
NULL);
|
||||
simple_archiver_hash_map_insert(&hash_map, value, key, sizeof(int),
|
||||
NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ int main(void) {
|
|||
*copy_value = idx;
|
||||
unsigned int *copy_key = malloc(sizeof(unsigned int));
|
||||
*copy_key = idx;
|
||||
simple_archiver_hash_map_insert(hash_map, copy_value, copy_key,
|
||||
simple_archiver_hash_map_insert(&hash_map, copy_value, copy_key,
|
||||
sizeof(unsigned int), NULL, NULL);
|
||||
}
|
||||
simple_archiver_hash_map_free(&hash_map);
|
||||
|
@ -193,7 +193,7 @@ int main(void) {
|
|||
hash_map = simple_archiver_hash_map_init();
|
||||
|
||||
for (size_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE; ++idx) {
|
||||
simple_archiver_hash_map_insert(hash_map, (void *)idx, &idx,
|
||||
simple_archiver_hash_map_insert(&hash_map, (void *)idx, &idx,
|
||||
sizeof(size_t), no_free_fn, no_free_fn);
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ void simple_archiver_helper_cleanup_chdir_back(char **original) {
|
|||
#if SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_LINUX || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_MAC || \
|
||||
SIMPLE_ARCHIVER_PLATFORM == SIMPLE_ARCHIVER_PLATFORM_COSMOPOLITAN
|
||||
__attribute__((unused)) int unused_ret = chdir(*original);
|
||||
chdir(*original);
|
||||
#endif
|
||||
free(*original);
|
||||
*original = NULL;
|
||||
|
@ -221,9 +221,9 @@ int simple_archiver_helper_make_dirs(const char *file_path) {
|
|||
#endif
|
||||
}
|
||||
|
||||
char *simple_archiver_helper_cut_substr(const char *s, size_t start_idx,
|
||||
size_t end_idx) {
|
||||
size_t s_len = strlen(s);
|
||||
char *simple_archiver_helper_cut_substr(const char *s, unsigned int start_idx,
|
||||
unsigned int end_idx) {
|
||||
unsigned int s_len = strlen(s);
|
||||
if (start_idx > end_idx || start_idx >= s_len || end_idx > s_len) {
|
||||
return NULL;
|
||||
} else if (end_idx == s_len) {
|
||||
|
@ -246,8 +246,8 @@ char *simple_archiver_helper_cut_substr(const char *s, size_t start_idx,
|
|||
}
|
||||
}
|
||||
|
||||
size_t simple_archiver_helper_num_digits(size_t value) {
|
||||
size_t digits = 0;
|
||||
unsigned int simple_archiver_helper_num_digits(unsigned int value) {
|
||||
unsigned int digits = 0;
|
||||
do {
|
||||
++digits;
|
||||
value /= 10;
|
||||
|
|
|
@ -50,10 +50,10 @@ int simple_archiver_helper_make_dirs(const char *file_path);
|
|||
/// Returns non-NULL on success.
|
||||
/// Must be free'd with "free()" if non-NULL.
|
||||
/// start_idx is inclusive and end_idx is exclusive.
|
||||
char *simple_archiver_helper_cut_substr(const char *s, size_t start_idx,
|
||||
size_t end_idx);
|
||||
char *simple_archiver_helper_cut_substr(const char *s, unsigned int start_idx,
|
||||
unsigned int end_idx);
|
||||
|
||||
size_t simple_archiver_helper_num_digits(size_t value);
|
||||
unsigned int simple_archiver_helper_num_digits(unsigned int value);
|
||||
|
||||
void simple_archiver_helper_cleanup_FILE(FILE **fd);
|
||||
void simple_archiver_helper_cleanup_malloced(void **data);
|
||||
|
|
47
src/parser.c
47
src/parser.c
|
@ -39,15 +39,15 @@
|
|||
#include "parser_internal.h"
|
||||
|
||||
/// Gets the first non "./"-like character in the filename.
|
||||
size_t simple_archiver_parser_internal_get_first_non_current_idx(
|
||||
unsigned int simple_archiver_parser_internal_get_first_non_current_idx(
|
||||
const char *filename) {
|
||||
size_t idx = 0;
|
||||
size_t known_good_idx = 0;
|
||||
const size_t length = strlen(filename);
|
||||
unsigned int idx = 0;
|
||||
unsigned int known_good_idx = 0;
|
||||
const unsigned int length = strlen(filename);
|
||||
|
||||
// 0b0001 - checked that idx char is '.'
|
||||
// 0b0010 - checked that idx char is '/'
|
||||
size_t flags = 0;
|
||||
unsigned int flags = 0;
|
||||
|
||||
for (; idx < length; ++idx) {
|
||||
if ((flags & 3) == 0) {
|
||||
|
@ -90,8 +90,8 @@ size_t simple_archiver_parser_internal_get_first_non_current_idx(
|
|||
}
|
||||
|
||||
void simple_archiver_parser_internal_remove_end_slash(char *filename) {
|
||||
size_t len = strlen(filename);
|
||||
size_t idx;
|
||||
int len = strlen(filename);
|
||||
int idx;
|
||||
for (idx = len; idx-- > 0;) {
|
||||
if (filename[idx] != '/') {
|
||||
++idx;
|
||||
|
@ -236,7 +236,7 @@ int simple_archiver_parse_args(int argc, const char **argv,
|
|||
out->filename = NULL;
|
||||
} else {
|
||||
out->flags &= 0xFFFFFFEF;
|
||||
size_t size = strlen(argv[1]) + 1;
|
||||
int size = strlen(argv[1]) + 1;
|
||||
out->filename = malloc(size);
|
||||
strncpy(out->filename, argv[1], size);
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ int simple_archiver_parse_args(int argc, const char **argv,
|
|||
simple_archiver_print_usage();
|
||||
return 1;
|
||||
}
|
||||
size_t size = strlen(argv[1]) + 1;
|
||||
int size = strlen(argv[1]) + 1;
|
||||
out->compressor = malloc(size);
|
||||
strncpy(out->compressor, argv[1], size);
|
||||
--argc;
|
||||
|
@ -268,7 +268,7 @@ int simple_archiver_parse_args(int argc, const char **argv,
|
|||
simple_archiver_print_usage();
|
||||
return 1;
|
||||
}
|
||||
size_t size = strlen(argv[1]) + 1;
|
||||
int size = strlen(argv[1]) + 1;
|
||||
out->decompressor = malloc(size);
|
||||
strncpy(out->decompressor, argv[1], size);
|
||||
--argc;
|
||||
|
@ -297,15 +297,15 @@ int simple_archiver_parse_args(int argc, const char **argv,
|
|||
} else {
|
||||
if (out->working_files == NULL) {
|
||||
out->working_files = malloc(sizeof(char *) * 2);
|
||||
size_t arg_idx =
|
||||
unsigned int arg_idx =
|
||||
simple_archiver_parser_internal_get_first_non_current_idx(argv[0]);
|
||||
size_t arg_length = strlen(argv[0] + arg_idx) + 1;
|
||||
unsigned int arg_length = strlen(argv[0] + arg_idx) + 1;
|
||||
out->working_files[0] = malloc(arg_length);
|
||||
strncpy(out->working_files[0], argv[0] + arg_idx, arg_length);
|
||||
simple_archiver_parser_internal_remove_end_slash(out->working_files[0]);
|
||||
out->working_files[1] = NULL;
|
||||
} else {
|
||||
size_t working_size = 1;
|
||||
int working_size = 1;
|
||||
char **ptr = out->working_files;
|
||||
while (ptr && *ptr) {
|
||||
++working_size;
|
||||
|
@ -318,9 +318,9 @@ int simple_archiver_parse_args(int argc, const char **argv,
|
|||
|
||||
// Set new actual last element to NULL.
|
||||
out->working_files[working_size] = NULL;
|
||||
size_t arg_idx =
|
||||
unsigned int arg_idx =
|
||||
simple_archiver_parser_internal_get_first_non_current_idx(argv[0]);
|
||||
size_t size = strlen(argv[0] + arg_idx) + 1;
|
||||
int size = strlen(argv[0] + arg_idx) + 1;
|
||||
// Set last element to the arg.
|
||||
out->working_files[working_size - 1] = malloc(size);
|
||||
strncpy(out->working_files[working_size - 1], argv[0] + arg_idx, size);
|
||||
|
@ -392,7 +392,7 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
|
|||
fstatat(AT_FDCWD, file_path, &st, AT_SYMLINK_NOFOLLOW);
|
||||
if ((st.st_mode & S_IFMT) == S_IFREG || (st.st_mode & S_IFMT) == S_IFLNK) {
|
||||
// Is a regular file or a symbolic link.
|
||||
size_t len = strlen(file_path) + 1;
|
||||
int len = strlen(file_path) + 1;
|
||||
char *filename = malloc(len);
|
||||
strncpy(filename, file_path, len);
|
||||
if (simple_archiver_hash_map_get(hash_map, filename, len - 1) == NULL) {
|
||||
|
@ -442,7 +442,7 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
|
|||
simple_archiver_list_add(files_list, file_info,
|
||||
simple_archiver_internal_free_file_info_fn);
|
||||
simple_archiver_hash_map_insert(
|
||||
hash_map, &hash_map_sentinel, filename, len - 1,
|
||||
&hash_map, &hash_map_sentinel, filename, len - 1,
|
||||
simple_archiver_helper_datastructure_cleanup_nop,
|
||||
simple_archiver_helper_datastructure_cleanup_nop);
|
||||
} else {
|
||||
|
@ -472,11 +472,11 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
|
|||
}
|
||||
// fprintf(stderr, "dir entry in %s is %s\n", next,
|
||||
// dir_entry->d_name);
|
||||
size_t combined_size = strlen(next) + strlen(dir_entry->d_name) + 2;
|
||||
int combined_size = strlen(next) + strlen(dir_entry->d_name) + 2;
|
||||
char *combined_path = malloc(combined_size);
|
||||
snprintf(combined_path, combined_size, "%s/%s", next,
|
||||
dir_entry->d_name);
|
||||
size_t valid_idx =
|
||||
unsigned int valid_idx =
|
||||
simple_archiver_parser_internal_get_first_non_current_idx(
|
||||
combined_path);
|
||||
if (valid_idx > 0) {
|
||||
|
@ -541,7 +541,7 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
|
|||
files_list, file_info,
|
||||
simple_archiver_internal_free_file_info_fn);
|
||||
simple_archiver_hash_map_insert(
|
||||
hash_map, &hash_map_sentinel, combined_path,
|
||||
&hash_map, &hash_map_sentinel, combined_path,
|
||||
combined_size - 1,
|
||||
simple_archiver_helper_datastructure_cleanup_nop,
|
||||
simple_archiver_helper_datastructure_cleanup_nop);
|
||||
|
@ -574,10 +574,11 @@ SDArchiverLinkedList *simple_archiver_parsed_to_filenames(
|
|||
SDArchiverFileInfo *file_info = iter->data;
|
||||
|
||||
// Remove leading "./" entries from files_list.
|
||||
size_t idx = simple_archiver_parser_internal_get_first_non_current_idx(
|
||||
file_info->filename);
|
||||
unsigned int idx =
|
||||
simple_archiver_parser_internal_get_first_non_current_idx(
|
||||
file_info->filename);
|
||||
if (idx > 0) {
|
||||
size_t len = strlen(file_info->filename) + 1 - idx;
|
||||
int len = strlen(file_info->filename) + 1 - idx;
|
||||
char *substr = malloc(len);
|
||||
strncpy(substr, file_info->filename + idx, len);
|
||||
free(file_info->filename);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include "parser.h"
|
||||
|
||||
size_t simple_archiver_parser_internal_get_first_non_current_idx(
|
||||
unsigned int simple_archiver_parser_internal_get_first_non_current_idx(
|
||||
const char *filename);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue