refresh 6

This commit is contained in:
n64
2020-02-03 00:51:26 -05:00
parent 9273f38df1
commit 9a801cb96d
236 changed files with 17101 additions and 4820 deletions

View File

@@ -169,32 +169,7 @@ int main(int argc, char **argv)
fclose(ifile);
if (coefTable == NULL) {
// Missing codebook, execute tabledesign instead
const char *procDirs[] = {
"/proc/self/exe", // Linux
"/proc/curproc/exe", // FreeBSD
"/proc/self/path/a.out", // Solaris
};
char buf[0x1000 + 0x100];
s32 bufSize = 0x1000, found = 0;
for (s32 i = 0; i < 3; i++) {
ssize_t ret = readlink(procDirs[i], buf, bufSize);
if (ret > 0 && ret < bufSize) {
found = 1;
break;
}
}
if (!found) {
// Not able to determine filename, let's guess
strcpy(buf, "./tools/");
}
char *sep = strrchr(buf, '/');
if (sep == NULL) {
sep = buf + strlen(buf);
}
*sep++ = '/';
strcpy(sep, "tabledesign");
execl(buf, "tabledesign", "-s", "1", infilename, NULL);
execl("./tools/tabledesign", "tabledesign", "-s", "1", infilename, NULL);
} else {
printf("%d\n%d\n", order, npredictors);
for (s32 i = 0; i < npredictors; i++) {