use github repo as central

This commit is contained in:
Jackson Tian
2019-01-09 14:07:33 +08:00
parent 9664fb1b00
commit bc0df2dcec
46 changed files with 1864 additions and 29 deletions

30
test/core/utils.h Normal file
View File

@@ -0,0 +1,30 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
class utUtils {
public:
void get_dir_exec(char* dir, char* exec) {
char* filename = nullptr;
if (readlink("/proc/self/exe", dir, 1024) < 0) {
dir[0] = '\0';
return;
}
filename = strrchr(dir, '/');
if (filename == nullptr) {
dir[0] = '\0';
return;
}
++filename;
if (exec) {
sprintf(exec, "%s", filename);
}
*filename = '\0';
return;
}
};