Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15099
Modified Files: Tag: devel_0_39 m_class.c s_main.c desire.tk m_hash.c Log Message: more class browser
Index: m_class.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_class.c,v retrieving revision 1.3.4.7.2.16 retrieving revision 1.3.4.7.2.17 diff -C2 -d -r1.3.4.7.2.16 -r1.3.4.7.2.17 *** m_class.c 22 Apr 2006 00:43:40 -0000 1.3.4.7.2.16 --- m_class.c 22 Apr 2006 01:33:15 -0000 1.3.4.7.2.17 *************** *** 310,313 **** --- 310,316 ---- vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]); #endif + #ifdef DESIRE + hash_set(class_table,s,0); + #endif }
Index: m_hash.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/m_hash.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** m_hash.c 22 Apr 2006 00:43:40 -0000 1.1.2.3 --- m_hash.c 22 Apr 2006 01:33:15 -0000 1.1.2.4 *************** *** 6,9 **** --- 6,10 ---- #include "m_pd.h" #include <malloc.h> + #include<stdio.h>
typedef struct _hashentry { *************** *** 29,32 **** --- 30,34 ---- self->i = 0; self->tab = (t_hashentry **)malloc(capa*sizeof(void*)); + // fprintf(stderr,"hash_set %d\n",capa); for (i=0; i<capa; i++) self->tab[i]=0; return self; *************** *** 37,40 **** --- 39,43 ---- int hash_next(t_hash *self, hashkey *kp, hashvalue *vp) { while (!self->next && self->i<self->capa) self->next = self->tab[self->i++]; + // printf("hash_next found in bin %ld\n",self->i-1); if (self->next) { *kp = self->next->k; *************** *** 46,58 **** }
- void hash_each(t_hash *self, hash_iter f, void *data) { - long i; - for (i=0; i<self->capa; i++) { - t_hashentry *e; - for (e=self->tab[i]; e; e=e->next) f(data,e->k,e->v); - } - } - - static long hash_hash(t_hash *self, hashkey k) { long h = ((long)k*0x54321) & 0x7FFFFFFF; --- 49,52 ---- *************** *** 72,80 **** return 0; } ! #include<stdio.h> void hash_set(t_hash *self, hashkey k, hashvalue v) { long h = hash_hash(self,k); t_hashentry *e; ! printf("hash_set %p %p %p\n",self,k,v); for (e=self->tab[h]; e; e=e->next) {if (e->k==k) {e->v=v; return;}} t_hashentry *nu = malloc(sizeof(t_hashentry)); --- 66,74 ---- return 0; } ! void hash_set(t_hash *self, hashkey k, hashvalue v) { long h = hash_hash(self,k); t_hashentry *e; ! // fprintf(stderr,"hash_set %p %s %p\n",self,((t_symbol*)k)->s_name,v); for (e=self->tab[h]; e; e=e->next) {if (e->k==k) {e->v=v; return;}} t_hashentry *nu = malloc(sizeof(t_hashentry));
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.174 retrieving revision 1.1.2.175 diff -C2 -d -r1.1.2.174 -r1.1.2.175 *** desire.tk 22 Apr 2006 00:43:40 -0000 1.1.2.174 --- desire.tk 22 Apr 2006 01:33:15 -0000 1.1.2.175 *************** *** 3245,3249 **** catch { set xs [glob "$dir/*.pd*"] ! foreach x $xs {lappend class_list "[lindex [file split $x] end] (not loaded)"} } } --- 3245,3254 ---- catch { set xs [glob "$dir/*.pd*"] ! #foreach x $xs {lappend class_list "[lindex [file split $x] end] (not loaded)"} ! foreach x $xs { ! set fn [lindex [file split $x] end] ! set fn [join [lrange [split $fn .] 0 end-1] .] ! lappend class_list $fn ! } } } *************** *** 3252,3259 **** def ClassBrowser list_callback {} { global class_list - - set class_list [luniq [lsort $class_list]] - puts "class_list = [list $class_list]" - puts "([llength $class_list])" $self search_for_externs set class_list [luniq [lsort $class_list]] --- 3257,3260 ---- *************** *** 3877,3878 **** --- 3878,3880 ---- } Thing post_hierarchy +
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.17.2.12 retrieving revision 1.7.4.17.2.13 diff -C2 -d -r1.7.4.17.2.12 -r1.7.4.17.2.13 *** s_main.c 12 Apr 2006 21:05:10 -0000 1.7.4.17.2.12 --- s_main.c 22 Apr 2006 01:33:15 -0000 1.7.4.17.2.13 *************** *** 266,269 **** --- 266,273 ---- static void sys_afterargparse(void);
+ #ifdef DESIRE + EXTERN t_hash *class_table; + #endif + /* this is called from main() in s_entry.c */ int sys_main(int argc, char **argv) *************** *** 271,274 **** --- 275,279 ---- int defeat_presets = 0, i;
+ class_table = hash_new(127); /* jsarlo { */ sys_externalschedlib = 0;