[merge] merging master
This commit is contained in:
@@ -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) |
|
||||
|
||||
Reference in New Issue
Block a user