47 static char *workingDirectoryResult = NULL;
50 vuoGetWorkingDirectoryType
vuoGetWorkingDirectory = (vuoGetWorkingDirectoryType) dlsym(RTLD_SELF,
"vuoGetWorkingDirectory");
58 free(compositionState);
63 char currentWorkingDirectory[PATH_MAX+1];
64 getcwd(currentWorkingDirectory, PATH_MAX+1);
65 workingDirectoryResult = strdup(currentWorkingDirectory);
68 return workingDirectoryResult;
86 const struct mach_header_64 *mh = (
const struct mach_header_64 *)mh32;
89 if (mh->flags & MH_DYLIB_IN_CACHE)
93 Dl_info info = {
"", NULL,
"", NULL};
94 dladdr((
void *)vmaddr_slide, &info);
98 char * (^getMatchingPath)(
const char *) = ^(
const char *fragment) {
99 const char *found = strstr(info.dli_fname, fragment);
102 char *pathCandidate = strndup(info.dli_fname, found - info.dli_fname + strlen(fragment));
103 if (access(pathCandidate, 0) == 0)
104 return pathCandidate;
111 char *possibleVuoFramework = getMatchingPath(
"/Vuo.framework");
112 if (possibleVuoFramework)
115 char *possibleVuoRunnerFramework = getMatchingPath(
"/VuoRunner.framework");
116 if (possibleVuoRunnerFramework)