[merge] merging master

This commit is contained in:
Al
2017-01-13 19:58:49 -05:00
27 changed files with 181 additions and 55 deletions

View File

@@ -36,6 +36,21 @@ bool is_relative_path(struct dirent *ent) {
return strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0;
}
char *path_vjoin(int n, va_list args) {
char_array *path = char_array_new();
if (path == NULL) return NULL;
char_array_add_vjoined(path, PATH_SEPARATOR, true, n, args);
return char_array_to_string(path);
}
char *path_join(int n, ...) {
va_list args;
va_start(args, n);
char *path = path_vjoin(n, args);
va_end(args);
return path;
}
inline uint64_t file_deserialize_uint64(unsigned char *buf) {
return ((uint64_t)buf[0] << 56) |
((uint64_t)buf[1] << 48) |