aboutsummaryrefslogtreecommitdiff
path: root/pd/src/m_binbuf.c
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-15 04:54:15 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-15 04:54:15 +0000
commit067d2611b9e1041318f605091dc6e93936fa9ce5 (patch)
treedba59fccb6d070232ff0e17dbbdf1cefe752647f /pd/src/m_binbuf.c
parent7c232a7d3a14391fd4d4f58892cf89e294c87d62 (diff)
0.40 test 01 commit ... although the "about" dialog thinks it's test02 :)
svn path=/trunk/; revision=5604
Diffstat (limited to 'pd/src/m_binbuf.c')
-rw-r--r--pd/src/m_binbuf.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/pd/src/m_binbuf.c b/pd/src/m_binbuf.c
index 9e96d68b..fbae4be5 100644
--- a/pd/src/m_binbuf.c
+++ b/pd/src/m_binbuf.c
@@ -757,6 +757,25 @@ int binbuf_read(t_binbuf *b, char *filename, char *dirname, int crflag)
return (0);
}
+ /* read a binbuf from a file, via the search patch of a canvas */
+int binbuf_read_via_canvas(t_binbuf *b, char *filename, t_canvas *canvas,
+ int crflag)
+{
+ int filedesc;
+ char buf[MAXPDSTRING], *bufptr;
+ if ((filedesc = canvas_open(canvas, filename, "",
+ buf, &bufptr, MAXPDSTRING, 0)) < 0)
+ {
+ error("%s: can't open", filename);
+ return (1);
+ }
+ else close (filedesc);
+ if (binbuf_read(b, bufptr, buf, crflag))
+ return (1);
+ else return (0);
+}
+
+ /* old version */
int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname,
int crflag)
{