aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Peach <mrpeach@users.sourceforge.net>2010-09-08 20:56:12 +0000
committerMartin Peach <mrpeach@users.sourceforge.net>2010-09-08 20:56:12 +0000
commitb40f538b54124a72c2e6e2287c2bc1ee38ae6e5b (patch)
tree27fb497ce9998bc4963bf92999c838e8182d6d73
parent58ab0883540b6ccf682e410a78c4bb3c4f187de1 (diff)
Cleaned out some useless post statements. Removed sys_lock and sys_unlock since they would freeze everything if nothing was found. If an
object is an internal, it still won't be found by [which] since we don't seem to have access to that list. svn path=/trunk/externals/mrpeach/; revision=14002
-rw-r--r--which/which.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/which/which.c b/which/which.c
index 2714836..ae99302 100644
--- a/which/which.c
+++ b/which/which.c
@@ -105,41 +105,41 @@ static void which_bang(t_which *x)
*/
/* try looking in the path for (objectname).(sys_dllextent) ... */
- sys_lock();
x->x_canvas = canvas_getcurrent();
- post("which_bang: canvas is %p", x->x_canvas);
-//post("name is %s", x->x_object_name->s_name);
-//post("ext is %s", sys_dllextent);
-//post("ext2 is %s", sys_dllextent2);
+//post("which_bang: canvas is %p", x->x_canvas);
+//post("which_bang: name is %s", x->x_object_name->s_name);
+//post("which_bang: ext is %s", sys_dllextent);
+//post("which_bang: ext2 is %s", sys_dllextent2);
fd = canvas_open(x->x_canvas, x->x_object_name->s_name, sys_dllextent,
dirbuf, &nameptr, MAXPDSTRING, 1);
-//post("fd is %d", fd);
- if (fd >= 0) post("1");
+//post("which_bang 1: fd is %d", fd);
+// if (fd >= 0) post("1");
if (fd < 0)
{/* same, with the more generic sys_dllextent2 */
fd = canvas_open(x->x_canvas, x->x_object_name->s_name, sys_dllextent2,
dirbuf, &nameptr, MAXPDSTRING, 1);
-//post("fd is %d", fd);
- if (fd >= 0) post("2");
+//post("which_bang 2: fd is %d", fd);
+// if (fd >= 0) post("2");
}
if (fd < 0)
{
+//post("which_bang: not found");
outlet_symbol(x->x_obj.te_outlet, gensym("not found"));
return;
}
result = close(fd);
-//post("dirbuf: %s", dirbuf);
-//post("nameptr: %s", nameptr);
+//post("which_bang: dirbuf: %s", dirbuf);
+//post("which_bang: nameptr: %s", nameptr);
/* rebuild the absolute pathname */
strncpy(filename, dirbuf, MAXPDSTRING);
filename[MAXPDSTRING-2] = 0;
strcat(filename, "/");
strncat(filename, nameptr, MAXPDSTRING-strlen(filename));
filename[MAXPDSTRING-1] = 0;
+//post("which_bang: filename: %s", filename);
x->x_object_path = gensym(filename);
outlet_symbol(x->x_obj.te_outlet, x->x_object_path);
- sys_unlock();
}
@@ -149,8 +149,8 @@ static void *which_new(t_symbol *s, int argc, t_atom *argv)
x->x_object_name = s;
if ((argc >= 1)&&(argv[0].a_type == A_SYMBOL)) x->x_object_name = argv[0].a_w.w_symbol;
outlet_new(&x->x_obj, &s_anything);
- x->x_canvas = canvas_getcurrent();/* canvas_getcurrent only seems to work in the _new function: why? */
- post("which_new: canvas is %p", x->x_canvas);
+/// x->x_canvas = canvas_getcurrent();/* canvas_getcurrent only seems to work in the _new function: why? */
+/// post("which_new: canvas is %p", x->x_canvas);
return (x);
}