Skip to content
Snippets Groups Projects
Commit 6bf2f0bb authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*updated jasch_lib in hope it will address an error Albert pointed out during...

*updated jasch_lib in hope it will address an error Albert pointed out during the launchpad build, updated pd-l2ork TODO for externals
parent 1b5c39f1
No related branches found
No related tags found
No related merge requests found
/*__________________________________________________________________________ strlen strlen c-string function Copyright (C) 2003 jan schacher This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA initial build 20030507 ____________________________________________________________________________*/ #include "m_pd.h" #include <strings.h> typedef struct strlen { t_object ob; void *s_outlet; float s_length; } t_strlen; void *strlen_class; void *strlen_new(t_symbol *s, long n); void strlen_anything(t_strlen *x, t_symbol *s, long argc, t_atom *argv); void strlen_free(t_strlen *x); void strlen_setup(void) { strlen_class = class_new(gensym("strlen"), (t_newmethod)strlen_new, (t_method)strlen_free, sizeof(t_strlen), 0, A_GIMME, 0); class_addsymbol(strlen_class, (t_method)strlen_anything); post(". strlen . jasch . "__DATE__" ",0); } void *strlen_new(t_symbol *s, long n) { t_strlen *x; x = (t_strlen *)pd_new(strlen_class); x->s_outlet = outlet_new(&x->ob, gensym("float")); return (x); } void strlen_anything(t_strlen *x, t_symbol *s, long argc, t_atom *argv) { x->s_length = strlen(s->s_name); outlet_float(x->s_outlet,x->s_length); } void strlen_free(t_strlen *x) { // notify_free((t_object *)x); } /*__________________________________________________________________________ strlen strlen c-string function Copyright (C) 2003 jan schacher This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA initial build 20030507 ____________________________________________________________________________*/ #include "m_pd.h" #include <string.h> typedef struct strlen { t_object ob; void *s_outlet; float s_length; } t_strlen; void *strlen_class; void *strlen_new(t_symbol *s, long n); void strlen_anything(t_strlen *x, t_symbol *s, long argc, t_atom *argv); void strlen_free(t_strlen *x); void strlen_setup(void) { strlen_class = class_new(gensym("strlen"), (t_newmethod)strlen_new, (t_method)strlen_free, sizeof(t_strlen), 0, A_GIMME, 0); class_addsymbol(strlen_class, (t_method)strlen_anything); post(". strlen . jasch . "__DATE__" ",0); } void *strlen_new(t_symbol *s, long n) { t_strlen *x; x = (t_strlen *)pd_new(strlen_class); x->s_outlet = outlet_new(&x->ob, gensym("float")); return (x); } void strlen_anything(t_strlen *x, t_symbol *s, long argc, t_atom *argv) { x->s_length = strlen(s->s_name); outlet_float(x->s_outlet,x->s_length); } void strlen_free(t_strlen *x) { // notify_free((t_object *)x); }
\ No newline at end of file \ No newline at end of file
......
/*__________________________________________________________________________ strtok strtok c-string function wrapper Copyright (C) 2003 jan schacher This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA initial build 20030507 ____________________________________________________________________________*/ #include "m_pd.h" #include <strings.h> typedef struct strtok { t_object ob; void *s_outlet; char s_tempstring[4096]; } t_strtok; void *strtok_class; void *strtok_new(t_symbol *s, long argc, t_atom *argv); void strtok_free(t_strtok *x); //void strtok_assist(t_strtok *x, void *b, long msg, long arg, char *dst); void strtok_anything(t_strtok *x, t_symbol *s, long argc, t_atom *argv); void strtok_set(t_strtok *x, t_symbol *s, long argc, t_atom *argv); void strtok_setup(void) { strtok_class = class_new(gensym("strtok"), (t_newmethod)strtok_new, (t_method)strtok_free, sizeof(t_strtok), 0, A_GIMME, 0); class_addsymbol(strtok_class, (t_method)strtok_anything); class_addmethod(strtok_class, (t_method)strtok_set, gensym("set"), A_GIMME, 0); post(". strtok . jasch . "__DATE__" ",0); } void *strtok_new(t_symbol *s, long argc, t_atom *argv) { t_strtok *x; x = (t_strtok *)pd_new(strtok_class); x->s_outlet = outlet_new(&x->ob, gensym("list")); if((argc >= 1)&&(argv[0].a_type == A_SYMBOL)){ strcpy(x->s_tempstring, argv[0].a_w.w_symbol->s_name); // post("argument is %s", argv[0].a_w.w_symbol->s_name); }else{ strcpy(x->s_tempstring, "/"); // post("defualt-argument is %s", x->s_tempstring); } return (x); } void strtok_anything(t_strtok *x, t_symbol *s, long argc, t_atom *argv) { char *ptr; char local[4096]; long status = 0; short i, j; t_atom result[256]; t_atom head; i = 0; strcpy(local, s->s_name); ptr = strtok(local,x->s_tempstring); while (ptr != NULL){ result[i].a_type = A_SYMBOL; result[i].a_w.w_symbol = gensym(ptr); ptr = strtok (NULL, x->s_tempstring); i++; } j = i; head.a_w.w_symbol = result[0].a_w.w_symbol; for(j=0;j<i;j++) result[j] = result[j+1]; outlet_anything(x->s_outlet,head.a_w.w_symbol,i-1,result); return; } void strtok_set(t_strtok *x, t_symbol *s, long argc, t_atom *argv) { switch (argv[0].a_type) { case A_FLOAT: error("wrong argument type for set");break; // case A_LONG:error("wrong argument type for set"); break; case A_SYMBOL: strcpy(x->s_tempstring, argv[0].a_w.w_symbol->s_name); break; } } void strtok_free(t_strtok *x) { // notify_free((t_object *)x); } /*__________________________________________________________________________
\ No newline at end of file
strtok strtok c-string function wrapper
Copyright (C) 2003 jan schacher
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
initial build 20030507
____________________________________________________________________________*/
#include "m_pd.h"
#include <string.h>
typedef struct strtok
{
t_object ob;
void *s_outlet;
char s_tempstring[4096];
} t_strtok;
void *strtok_class;
void *strtok_new(t_symbol *s, long argc, t_atom *argv);
void strtok_free(t_strtok *x);
//void strtok_assist(t_strtok *x, void *b, long msg, long arg, char *dst);
void strtok_anything(t_strtok *x, t_symbol *s, long argc, t_atom *argv);
void strtok_set(t_strtok *x, t_symbol *s, long argc, t_atom *argv);
void strtok_setup(void)
{
strtok_class = class_new(gensym("strtok"), (t_newmethod)strtok_new,
(t_method)strtok_free, sizeof(t_strtok), 0, A_GIMME, 0);
class_addsymbol(strtok_class, (t_method)strtok_anything);
class_addmethod(strtok_class, (t_method)strtok_set, gensym("set"), A_GIMME, 0);
post(". strtok . jasch . "__DATE__" ",0);
}
void *strtok_new(t_symbol *s, long argc, t_atom *argv)
{
t_strtok *x;
x = (t_strtok *)pd_new(strtok_class);
x->s_outlet = outlet_new(&x->ob, gensym("list"));
if((argc >= 1)&&(argv[0].a_type == A_SYMBOL)){
strcpy(x->s_tempstring, argv[0].a_w.w_symbol->s_name);
// post("argument is %s", argv[0].a_w.w_symbol->s_name);
}else{
strcpy(x->s_tempstring, "/");
// post("defualt-argument is %s", x->s_tempstring);
}
return (x);
}
void strtok_anything(t_strtok *x, t_symbol *s, long argc, t_atom *argv)
{
char *ptr;
char local[4096];
long status = 0;
short i, j;
t_atom result[256];
t_atom head;
i = 0;
strcpy(local, s->s_name);
ptr = strtok(local,x->s_tempstring);
while (ptr != NULL){
result[i].a_type = A_SYMBOL;
result[i].a_w.w_symbol = gensym(ptr);
ptr = strtok (NULL, x->s_tempstring);
i++;
}
j = i;
head.a_w.w_symbol = result[0].a_w.w_symbol;
for(j=0;j<i;j++) result[j] = result[j+1];
outlet_anything(x->s_outlet,head.a_w.w_symbol,i-1,result);
return;
}
void strtok_set(t_strtok *x, t_symbol *s, long argc, t_atom *argv)
{
switch (argv[0].a_type) {
case A_FLOAT: error("wrong argument type for set");break;
// case A_LONG:error("wrong argument type for set"); break;
case A_SYMBOL: strcpy(x->s_tempstring, argv[0].a_w.w_symbol->s_name); break;
}
}
void strtok_free(t_strtok *x)
{
// notify_free((t_object *)x);
}
Diff status between pd-l2ork externals source tree and main community pd svn Diff status between pd-l2ork externals source tree and main community pd svn
AS OF October 8, 2014 AS OF November 14, 2014
DONE: (*denotes unique changes) DONE: (*denotes unique changes)
creb creb
...@@ -7,6 +7,7 @@ flatgui (disabled, as all externals have various problems) ...@@ -7,6 +7,7 @@ flatgui (disabled, as all externals have various problems)
gem2pdp gem2pdp
hcs hcs
iemlib iemlib
jasch_lib
markex markex
maxli4 maxli4
moonlib moonlib
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment