Revision: 9915
http://pure-data.svn.sourceforge.net/pure-data/?rev=9915&view=rev
Author: eighthave
Date: 2008-05-25 15:44:13 -0700 (Sun, 25 May 2008)
Log Message:
-----------
created a global namelist to keep track of the libraries that [import] has loaded into the canvas-local namespace
Modified Paths:
--------------
branches/pd-extended/v0-40/pd/src/import.c
Modified: branches/pd-extended/v0-40/pd/src/import.c
===================================================================
--- branches/pd-extended/v0-40/pd/src/import.c 2008-05-25 21:53:49 UTC (rev 9914)
+++ branches/pd-extended/v0-40/pd/src/import.c 2008-05-25 22:44:13 UTC (rev 9915)
@@ -33,9 +33,11 @@
t_int import_instance_count;
-//#define DEBUG(x)
-#define DEBUG(x) x
+t_namelist *loaded_libs = NULL;
+#define DEBUG(x)
+//#define DEBUG(x) x
+
/*------------------------------------------------------------------------------
* CLASS DEF
*/
@@ -80,7 +82,10 @@
pd_error(x, "[import]: ERROR: can't load library in %s",
library_name->s_name);
else
- post("[import] loaded library: %s",library_name->s_name);
+ {
+ loaded_libs = namelist_append(loaded_libs, library_name->s_name, 0);
+ post("[import] loaded library: %s",library_name->s_name);
+ }
break;
default:
pd_error(x, "[import] ERROR: Unsupported atom type");
@@ -100,11 +105,8 @@
* namespace, [import] will output the new element on the next bang. */
if(x->x_current)
{
- post("current string: %s", x->x_current->nl_string);
strncpy(buffer, x->x_current->nl_string, MAXPDSTRING);
- post("current string buffer: %s", buffer);
outlet_symbol( x->x_data_outlet, gensym(buffer));
-// outlet_symbol( x->x_data_outlet, gensym(strrchr(buffer, '/') + 1) );
x->x_current = x->x_current->nl_next;
}
else
@@ -114,8 +116,7 @@
static void import_reset(t_import* x)
{
- x->x_top = canvas_getenv(x->x_canvas)->ce_path;
- x->x_current = x->x_top;
+ x->x_current = loaded_libs;
}
@@ -146,10 +147,9 @@
static void import_free(t_import *x)
{
- /* TODO: look into freeing the namelist. It probably does not need to
- * happen, since this class is just copying the pointer of an existing
- * namelist that is handled elsewhere. */
-
+ import_instance_count--;
+ if(import_instance_count == 0)
+ namelist_free(loaded_libs);
/* TODO: perhaps this should remove any libs that this instance had added to
* the namespace */
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 9914
http://pure-data.svn.sourceforge.net/pure-data/?rev=9914&view=rev
Author: eighthave
Date: 2008-05-25 14:53:49 -0700 (Sun, 25 May 2008)
Log Message:
-----------
removed patch 1930733 since it seems wrong as was causing an erroneous error message: pd_vmess: only 5 allowed
Modified Paths:
--------------
branches/pd-extended/v0-40/pd/src/m_class.c
Modified: branches/pd-extended/v0-40/pd/src/m_class.c
===================================================================
--- branches/pd-extended/v0-40/pd/src/m_class.c 2008-05-25 21:51:21 UTC (rev 9913)
+++ branches/pd-extended/v0-40/pd/src/m_class.c 2008-05-25 21:53:49 UTC (rev 9914)
@@ -810,7 +810,7 @@
va_start(ap, fmt);
while (1)
{
- if (nargs >= MAXPDARG)
+ if (nargs > MAXPDARG)
{
pd_error(x, "pd_vmess: only %d allowed", MAXPDARG);
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 9910
http://pure-data.svn.sourceforge.net/pure-data/?rev=9910&view=rev
Author: eighthave
Date: 2008-05-25 12:28:42 -0700 (Sun, 25 May 2008)
Log Message:
-----------
corrected comment
Modified Paths:
--------------
branches/pd-extended/v0-40/pd/src/g_canvas.c
Modified: branches/pd-extended/v0-40/pd/src/g_canvas.c
===================================================================
--- branches/pd-extended/v0-40/pd/src/g_canvas.c 2008-05-25 10:35:12 UTC (rev 9909)
+++ branches/pd-extended/v0-40/pd/src/g_canvas.c 2008-05-25 19:28:42 UTC (rev 9910)
@@ -1629,7 +1629,7 @@
realname[0] = '\0';
}
else
- { // if not absolute path, append Pd lib dir
+ { // if not absolute path, append parent canvas' current dir
strncpy(realname, dir, FILENAME_MAX);
realname[FILENAME_MAX-3] = 0;
strcat(realname, "/");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.