From 0cbcf38135f02af8ba9a8bb1aadc4093061bf818 Mon Sep 17 00:00:00 2001 From: "Kjetil S. Matheussen" Date: Mon, 9 Aug 2004 13:55:42 +0000 Subject: Fixed strings. svn path=/trunk/externals/k_cext/; revision=1925 --- help-string.pd | 5 +++++ k_cext_generatecode.c | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 help-string.pd 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(ss) \;; +#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; -- cgit v1.2.1