Revision: 9857
http://pure-data.svn.sourceforge.net/pure-data/?rev=9857&view=rev
Author: eighthave
Date: 2008-05-19 15:56:35 -0700 (Mon, 19 May 2008)
Log Message:
-----------
fixed bug where first library loaded had garbage in the path; switched from MAXPDSTRING to FILENAME_MAX, since it is dealing ultimately with filenames
Modified Paths:
--------------
branches/pd-extended/v0-40/externals/loaders/libdir.c
Modified: branches/pd-extended/v0-40/externals/loaders/libdir.c
===================================================================
--- branches/pd-extended/v0-40/externals/loaders/libdir.c 2008-05-19 19:25:03 UTC (rev 9856)
+++ branches/pd-extended/v0-40/externals/loaders/libdir.c 2008-05-19 22:56:35 UTC (rev 9857)
@@ -40,15 +40,15 @@
{
int fd = -1;
unsigned int i;
- char helppathname[MAXPDSTRING];
- char fullclassname[MAXPDSTRING], dirbuf[MAXPDSTRING];
- char reldirbuf[MAXPDSTRING], curdir[MAXPDSTRING], *nameptr;
+ char helppathname[FILENAME_MAX];
+ char fullclassname[FILENAME_MAX], dirbuf[FILENAME_MAX];
+ char reldirbuf[FILENAME_MAX], curdir[FILENAME_MAX], *nameptr;
t_canvasenvironment *canvasenvironment;
/* look for meta file (classname)/(classname)-meta.pd */
- strncpy(fullclassname, classname, MAXPDSTRING - 6);
+ strncpy(fullclassname, classname, FILENAME_MAX - 6);
strcat(fullclassname, "/");
- strncat(fullclassname, classname, MAXPDSTRING - strlen(fullclassname) - 6);
+ strncat(fullclassname, classname, FILENAME_MAX - strlen(fullclassname) - 6);
strcat(fullclassname, "-meta");
/* if this is being called from a canvas, then add the library path to the
@@ -58,45 +58,39 @@
{
canvasenvironment = canvas_getenv(canvas);
if ((fd = canvas_open(0, fullclassname, ".pd",
- dirbuf, &nameptr, MAXPDSTRING, 0)) < 0)
+ dirbuf, &nameptr, FILENAME_MAX, 0)) < 0)
{
return (0);
}
close(fd);
-
-
// G.Holzmann: canvas will look to a relative path to it, so we cannot add
- // the absulote dirbuf path, we have to make it relative to the current canvas
+ // the absulote dirbuf path, we have to make it relative to the current canvas
// (see from line 1561 in g_canvas.c)
-
sys_unbashfilename(canvas_getdir(canvas)->s_name, curdir);
-
+ reldirbuf[0] = '\0';
// count depth of the current dir
for(i=0; i<strlen(curdir); i++)
{
- if(curdir[i] == 47) // 47 is "/" in ascii
- strncat(reldirbuf, "../", MAXPDSTRING);
+ if(curdir[i] == '/')
+ strncat(reldirbuf, "../", FILENAME_MAX);
}
- strncat(reldirbuf, dirbuf, MAXPDSTRING);
-
-
- // TODO: have this add to the canvas-local path only
+ strncat(reldirbuf, dirbuf, FILENAME_MAX);
canvasenvironment->ce_path = namelist_append(canvasenvironment->ce_path,
- reldirbuf, 0);
+ reldirbuf, 0);
post("libdir_loader: added %s to the canvas-local path", classname);
}
else
#endif
{
if ((fd = open_via_path(".", fullclassname, ".pd",
- dirbuf, &nameptr, MAXPDSTRING, 0)) < 0)
+ dirbuf, &nameptr, FILENAME_MAX, 0)) < 0)
{
return (0);
}
close(fd);
sys_searchpath = namelist_append(sys_searchpath, dirbuf, 0);
- strncpy(helppathname, sys_libdir->s_name, MAXPDSTRING-30);
- helppathname[MAXPDSTRING-30] = 0;
+ strncpy(helppathname, sys_libdir->s_name, FILENAME_MAX-30);
+ helppathname[FILENAME_MAX-30] = 0;
strcat(helppathname, "/doc/5.reference/");
strcat(helppathname, classname);
sys_helppath = namelist_append(sys_helppath, helppathname, 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 9850
http://pure-data.svn.sourceforge.net/pure-data/?rev=9850&view=rev
Author: eighthave
Date: 2008-05-18 11:35:45 -0700 (Sun, 18 May 2008)
Log Message:
-----------
- removed old Tcl/Tk hack for setting the LIBQUICKTIME_PLUGIN_DIR and wrote it
in C inside pdp_qt.c, where it is actually needed.
Modified Paths:
--------------
branches/pd-extended/v0-40/externals/pdp/modules/image_io/pdp_qt.c
branches/pd-extended/v0-40/pd/src/u_main.tk
Modified: branches/pd-extended/v0-40/externals/pdp/modules/image_io/pdp_qt.c
===================================================================
--- branches/pd-extended/v0-40/externals/pdp/modules/image_io/pdp_qt.c 2008-05-18 18:02:14 UTC (rev 9849)
+++ branches/pd-extended/v0-40/externals/pdp/modules/image_io/pdp_qt.c 2008-05-18 18:35:45 UTC (rev 9850)
@@ -26,8 +26,8 @@
#include "pdp.h"
#include "pdp_llconv.h"
+#include "s_stuff.h" // need to get sys_libdir for libquicktime plugins
-
#define min(x,y) ((x<y)?(x):(y))
@@ -967,6 +967,19 @@
pdp_qt_setup_common(pdp_qt_tilde_class);
class_addmethod(pdp_qt_tilde_class, (t_method)pdp_qt_dsp, gensym("dsp"), 0);
+
+#ifdef __APPLE__
+ /* this is necessary for pdp_qt to find the embedded libquicktime plugins */
+ char buf[FILENAME_MAX];
+ char realpath_buf[FILENAME_MAX];
+ strncpy(buf, sys_libdir->s_name, FILENAME_MAX - 20);
+ strcat(buf, "/../lib/libquicktime");
+ if(realpath(buf, realpath_buf))
+ {
+ post("[pdp_qt]: setting LIBQUICKTIME_PLUGIN_DIR to:\n %s", realpath_buf);
+ setenv("LIBQUICKTIME_PLUGIN_DIR", realpath_buf, 0); // 0 means don't overwrite existing value
+ }
+#endif
}
#ifdef __cplusplus
Modified: branches/pd-extended/v0-40/pd/src/u_main.tk
===================================================================
--- branches/pd-extended/v0-40/pd/src/u_main.tk 2008-05-18 18:02:14 UTC (rev 9849)
+++ branches/pd-extended/v0-40/pd/src/u_main.tk 2008-05-18 18:35:45 UTC (rev 9850)
@@ -143,11 +143,6 @@
set pd_gui2 [string range $argv0 0 [expr [string last / $argv0 ] - 1]]
set pd_guidir [file normalize $pd_gui2/..]
load $pd_guidir/bin/libPdTcl.dylib
- # this is the embedded libquicktime can find its embedded plugins
- set libquicktime_plugin_dir \
- [file normalize $pd_gui2/../../lib/libquicktime]
- puts stderr "Setting LIBQUICKTIME_PLUGIN_DIR: $libquicktime_plugin_dir"
- set env(LIBQUICKTIME_PLUGIN_DIR) $libquicktime_plugin_dir
set pd_tearoff 0
global pd_macready
set pd_macready 0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.