New upstream version 0.15.4+dfsg1

This commit is contained in:
Sebastian Ramacher 2016-08-28 14:07:43 +02:00
parent 55d5047af0
commit 67704ac59c
359 changed files with 8423 additions and 1050 deletions

View file

@ -49,7 +49,11 @@ void *os_dlopen(const char *path)
return NULL;
dstr_init_copy(&dylib_name, path);
#ifdef __APPLE__
if (!dstr_find(&dylib_name, ".so") && !dstr_find(&dylib_name, ".dylib"))
#else
if (!dstr_find(&dylib_name, ".so"))
#endif
dstr_cat(&dylib_name, ".so");
void *res = dlopen(dylib_name.array, RTLD_LAZY);
@ -68,7 +72,8 @@ void *os_dlsym(void *module, const char *func)
void os_dlclose(void *module)
{
dlclose(module);
if (module)
dlclose(module);
}
#if !defined(__APPLE__)
@ -236,6 +241,20 @@ char *os_get_config_path_ptr(const char *name)
#endif
}
int os_get_program_data_path(char *dst, size_t size, const char *name)
{
return snprintf(dst, size, "/usr/local/share/%s", !!name ? name : "");
}
char *os_get_program_data_path_ptr(const char *name)
{
size_t len = snprintf(NULL, 0, "/usr/local/share/%s", !!name ? name : "");
char *str = bmalloc(len + 1);
snprintf(str, len + 1, "/usr/local/share/%s", !!name ? name : "");
str[len] = 0;
return str;
}
#endif
bool os_file_exists(const char *path)