Update of /cvsroot/pure-data/externals/hcs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4087
Modified Files:
classpath.c classpath-help.pd import.c
Log Message:
made [classpath] function like the new [import]
Index: import.c
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/import.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** import.c 26 Nov 2006 06:01:14 -0000 1.1
--- import.c 26 Nov 2006 06:37:34 -0000 1.2
***************
*** 99,102 ****
--- 99,105 ----
char buffer[MAXPDSTRING];
+ /* TODO: think about using x->x_current->nl_next so that if [import] is at
+ * the end of its list, and another element gets added to the local
+ * namespace, [import] will output the new element on the next bang. */
if(x->x_current)
{
Index: classpath.c
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/classpath.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** classpath.c 20 Nov 2006 04:30:47 -0000 1.2
--- classpath.c 26 Nov 2006 06:37:34 -0000 1.3
***************
*** 24,30 ****
/* --------------------------------------------------------------------------*/
! #include <m_pd.h>
! #include <s_stuff.h>
#ifdef _WIN32
#define _WIN32_WINNT 0x0400
--- 24,33 ----
/* --------------------------------------------------------------------------*/
! #include "m_pd.h"
! #include "s_stuff.h"
!
! #include <string.h>
+ /*
#ifdef _WIN32
#define _WIN32_WINNT 0x0400
***************
*** 34,39 ****
#include <stdlib.h>
#endif
!
! #include <string.h>
static char *version = "$Revision$";
--- 37,41 ----
#include <stdlib.h>
#endif
! */
static char *version = "$Revision$";
***************
*** 65,68 ****
--- 67,73 ----
DEBUG(post("classpath_output"););
+ /* TODO: think about using x->x_current->nl_next so that if [classlist] is at
+ * the end of its list, and another element gets added to the global
+ * classpath, [classpath] will output the new element on the next bang. */
if(x->x_current)
{
***************
*** 75,82 ****
! static void classpath_rewind(t_classpath* x)
{
DEBUG(post("classpath_output"););
x->x_current = x->x_top;
}
--- 80,92 ----
! static void classpath_reset(t_classpath* x)
{
DEBUG(post("classpath_output"););
+ char buffer[MAXPDSTRING];
+ strncpy(buffer, sys_libdir->s_name, MAXPDSTRING - 6);
+ strcat(buffer, "/extra");
+ x->x_top = namelist_append(NULL, buffer, 0);
+ x->x_top->nl_next = sys_searchpath;
x->x_current = x->x_top;
}
***************
*** 92,99 ****
{
DEBUG(post("classpath_new"););
-
t_classpath *x = (t_classpath *)pd_new(classpath_class);
- t_symbol *currentdir;
- char buffer[MAXPDSTRING];
if(!classpath_instance_count)
--- 102,106 ----
***************
*** 102,117 ****
post("\twritten by Hans-Christoph Steiner <hans(a)at.or.at>");
post("\tcompiled on "__DATE__" at "__TIME__ " ");
}
classpath_instance_count++;
- strncpy(buffer, sys_libdir->s_name, MAXPDSTRING);
- strcat(buffer, "/extra");
- x->x_top = namelist_append_files(NULL,buffer);
- x->x_top->nl_next = sys_searchpath;
- x->x_current = x->x_top;
-
x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol);
x->x_status_outlet = outlet_new(&x->x_obj, 0);
return (x);
}
--- 109,122 ----
post("\twritten by Hans-Christoph Steiner <hans(a)at.or.at>");
post("\tcompiled on "__DATE__" at "__TIME__ " ");
+ post("\tcompiled against Pd version %d.%d.%d", PD_MAJOR_VERSION,
+ PD_MINOR_VERSION, PD_BUGFIX_VERSION);
}
classpath_instance_count++;
x->x_data_outlet = outlet_new(&x->x_obj, &s_symbol);
x->x_status_outlet = outlet_new(&x->x_obj, 0);
+ classpath_reset(x);
+
return (x);
}
***************
*** 136,141 ****
/* add inlet message methods */
! class_addmethod(classpath_class,(t_method) classpath_rewind,
! gensym("rewind"), 0);
class_addmethod(classpath_class,(t_method) classpath_add,gensym("add"),
A_DEFSYMBOL, 0);
--- 141,146 ----
/* add inlet message methods */
! class_addmethod(classpath_class,(t_method) classpath_reset,
! gensym("reset"), 0);
class_addmethod(classpath_class,(t_method) classpath_add,gensym("add"),
A_DEFSYMBOL, 0);
Index: classpath-help.pd
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/classpath-help.pd,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** classpath-help.pd 17 Nov 2006 06:03:15 -0000 1.1
--- classpath-help.pd 26 Nov 2006 06:37:34 -0000 1.2
***************
*** 1,10 ****
! #N canvas 375 22 462 312 10;
! #X obj 85 99 classpath;
! #X msg 82 68 bang;
! #X obj 99 145 print;
! #X symbolatom 74 182 0 0 0 0 - - -;
! #X obj 146 120 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
! #X msg 124 71 rewind;
#X connect 0 0 2 0;
#X connect 0 0 3 0;
--- 1,18 ----
! #N canvas 375 22 466 316 10;
! #X obj 40 130 classpath;
! #X msg 37 99 bang;
! #X obj 54 176 print;
! #X symbolatom 29 213 0 0 0 0 - - -;
! #X obj 101 151 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
! #X msg 79 102 reset;
! #X text 19 22 This object returns each path in the global classpath
! one at a time with each bang. [reset( refreshs the classpath data and
! starts again at the top of the list \, like [textfile] or [qlist]'s
! [reset(.;
! #X text 124 153 <-- banged when the end of the list is reached;
! #X text 234 294 released under the GNU GPL;
! #X text 18 281 (C) Copyright 2006 Hans-Christoph Steiner <hans(a)at.or.at>
! ;
#X connect 0 0 2 0;
#X connect 0 0 3 0;