From a764e59e1d3a8e330f0d484fdb26b35ca3f0b2e4 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 22 Mar 2008 02:15:12 +0000 Subject: bringing pdj-0.8.3 into the main branch svn path=/trunk/externals/loaders/pdj/; revision=9621 --- src/pdj-osx.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/pdj-osx.c (limited to 'src/pdj-osx.c') diff --git a/src/pdj-osx.c b/src/pdj-osx.c new file mode 100644 index 0000000..bd2be18 --- /dev/null +++ b/src/pdj-osx.c @@ -0,0 +1,37 @@ +#include +#include +#include +#include + +#include "pdj.h" + +int getuglylibpath(char *path) { + char fullpath[MAXPDSTRING], *pfullpath; + FILE *fd; + + fd = (FILE *) open_via_path("", "pdj.properties", "", fullpath, &pfullpath, MAXPDSTRING, 0); + if ( fd != NULL ) { + close(fd); + if ( fullpath[0] != 0 ) { + if ( pfullpath == ((char *) &fullpath) ) { + getcwd(path, MAXPDSTRING); + } else { + strcpy(path, fullpath); + } + return 0; + } + } + + error("unable to find pdj directory, please add it in your pure-data path settings"); + return 1; +} + +JNI_CreateJavaVM_func *linkjvm(char *vmtype) { + char *jvmVersion = pdj_getProperty("pdj.osx.JAVA_JVM_VERSION"); + + if ( jvmVersion != NULL ) { + setenv("JAVA_JVM_VERSION", jvmVersion, 1); + } + + return (JNI_CreateJavaVM_func *) &JNI_CreateJavaVM; +} \ No newline at end of file -- cgit v1.2.1