Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14323
Modified Files: Tag: impd_0_37 s_print.c Log Message: missing code for pd console (oops)
Index: s_print.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_print.c,v retrieving revision 1.1.1.1.16.2 retrieving revision 1.1.1.1.16.2.2.1 diff -C2 -d -r1.1.1.1.16.2 -r1.1.1.1.16.2.2.1 *** s_print.c 15 Oct 2003 07:55:10 -0000 1.1.1.1.16.2 --- s_print.c 22 Feb 2004 20:10:56 -0000 1.1.1.1.16.2.2.1 *************** *** 202,203 **** --- 202,229 ---- else error("%s", errstring); } + + extern int console_scrollback; + static const int console_ln=2048; + static int console_li=0; + static char console_line[2048]=""; + + void guiprint(char *fmt, va_list ap) { + char *special = "{}[]\"\n"; + int console_li_old = console_li; + console_li += vsnprintf(console_line+console_li, console_ln-console_li, fmt, ap); + console_line[console_ln-1]=0; + if (!strchr(&console_line[console_li_old],'\n')) return; + int countbrace=0, i, n = strlen(console_line); + for (i=n-1; i>=0; i--) if (strchr(special,console_line[i])) countbrace++; + while (n+countbrace>=(int)sizeof(console_line)) n--; + console_line[n+countbrace]=0; + for (i=n-1; i>=0; i--) { + int c=console_line[i]; + if (c=='\n') c='n'; + console_line[i+countbrace]=c; + if (strchr(special,console_line[i])) console_line[i+(--countbrace)]='\'; + } + sys_vgui("post_to_gui "%s"\n",console_line); + console_li=0; + console_line[0]=0; + }