Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10404
Modified Files: Tag: devel_0_38 m_pd.h s_main.c s_print.c Log Message: verbose(), for user-defined verbosity
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.4.4.10 retrieving revision 1.4.4.11 diff -C2 -d -r1.4.4.10 -r1.4.4.11 *** m_pd.h 9 Apr 2005 06:49:24 -0000 1.4.4.10 --- m_pd.h 2 May 2005 07:39:49 -0000 1.4.4.11 *************** *** 455,458 **** --- 455,459 ---- EXTERN void endpost(void); EXTERN void error(const char *fmt, ...); + EXTERN void verbose(int level, const char *fmt, ...); EXTERN void bug(const char *fmt, ...); EXTERN void pd_error(void *object, const char *fmt, ...);
Index: s_print.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_print.c,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** s_print.c 6 Sep 2004 20:20:36 -0000 1.2 --- s_print.c 2 May 2005 07:39:50 -0000 1.2.4.1 *************** *** 111,114 **** --- 111,132 ---- }
+ void verbose(int level, const char *fmt, ...) + { + char buf[MAXPDSTRING]; + va_list ap; + t_int arg[8]; + int i; + if(level>sys_verbose)return; + dopost("verbose("); + postfloat((float)level); + dopost("):"); + + va_start(ap, fmt); + vsnprintf(buf, MAXPDSTRING-1, fmt, ap); + va_end(ap); + strcat(buf, "\n"); + dopost(buf); + } + /* here's the good way to log errors -- keep a pointer to the offending or offended object around so the user can search for it
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.14 retrieving revision 1.7.4.15 diff -C2 -d -r1.7.4.14 -r1.7.4.15 *** s_main.c 8 Apr 2005 12:37:48 -0000 1.7.4.14 --- s_main.c 2 May 2005 07:39:49 -0000 1.7.4.15 *************** *** 816,820 **** else if (!strcmp(*argv, "-verbose")) { ! sys_verbose = 1; argc--; argv++; } --- 816,820 ---- else if (!strcmp(*argv, "-verbose")) { ! sys_verbose++; argc--; argv++; }