diff options
author | Kjetil S. Matheussen <ksvalast@users.sourceforge.net> | 2004-08-09 13:55:42 +0000 |
---|---|---|
committer | Kjetil S. Matheussen <ksvalast@users.sourceforge.net> | 2004-08-09 13:55:42 +0000 |
commit | 0cbcf38135f02af8ba9a8bb1aadc4093061bf818 (patch) | |
tree | 0528c3c07db23b623bc288068977830899d0c4d0 | |
parent | 50f8aee458a8495f5078bfb7aaa8d14399964dbc (diff) |
Fixed strings.
svn path=/trunk/externals/k_cext/; revision=1925
-rw-r--r-- | help-string.pd | 5 | ||||
-rw-r--r-- | k_cext_generatecode.c | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/help-string.pd b/help-string.pd new file mode 100644 index 0000000..b303b4f --- /dev/null +++ b/help-string.pd @@ -0,0 +1,5 @@ +#N canvas 0 0 450 300 10; +#X msg 31 84 bang; +#X obj 30 125 k_cext \; system(s<echo something>s) \;; +#X text 26 40 Strings are started with s< and ended with >s; +#X connect 0 0 1 0; diff --git a/k_cext_generatecode.c b/k_cext_generatecode.c index 254eb9f..93023a4 100644 --- a/k_cext_generatecode.c +++ b/k_cext_generatecode.c @@ -193,10 +193,28 @@ static void k_cext_gen_mainfunccode(t_k_cext *x,int argc, t_atom* argv,int i, st break; case A_SYMBOL: sprintf(string,"%s",atom_getsymbolarg(i,argc,argv)->s_name); + + printf("string: \"%s\"\n",string); + + if(strstr(string,"s<")!=NULL){ + char *pos=strstr(string,"s<"); + pos[0]=' '; + pos[1]='\"'; + printf("japp\n"); + } + + if(strstr(string,">s")!=NULL){ + char *pos=strstr(string,">s"); + pos[0]='\"'; + pos[1]=' '; + printf("japp2n"); + } + if(!strcmp(".",string)){ sprintf(string," "); k->indentation++; - + + }else{if(!strcmp("DO",string)){ k->set_indentation[k->indentation]=1; sprintf(string,"BEGIN"); @@ -253,6 +271,7 @@ static void k_cext_gen_mainfunccode(t_k_cext *x,int argc, t_atom* argv,int i, st */ } } + fprintf(k->file,"%s",string); if(string[strlen(string)-1]!='\n') fprintf(k->file," "); break; |