aboutsummaryrefslogtreecommitdiff
path: root/src/pdj-osx.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2008-03-22 02:15:12 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2008-03-22 02:15:12 +0000
commita764e59e1d3a8e330f0d484fdb26b35ca3f0b2e4 (patch)
treec4ecadccdecf2809b99c0da0545f255a6ad25bb5 /src/pdj-osx.c
bringing pdj-0.8.3 into the main branchsvn2git-root
svn path=/trunk/externals/loaders/pdj/; revision=9621
Diffstat (limited to 'src/pdj-osx.c')
-rw-r--r--src/pdj-osx.c37
1 files changed, 37 insertions, 0 deletions
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 <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <CoreFoundation/CoreFoundation.h>
+
+#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