From 3075700fe36cc99e2081fac39c9a23255ca2d539 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Mon, 27 Apr 2009 21:06:10 +0000 Subject: added option -stdout (similar to -stderr) svn path=/trunk/; revision=11180 --- desiredata/src/desire.c | 4 ++-- desiredata/src/s_main.c | 10 +++++----- desiredata/src/s_stuff.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'desiredata') diff --git a/desiredata/src/desire.c b/desiredata/src/desire.c index 35ebf470..f03b3775 100644 --- a/desiredata/src/desire.c +++ b/desiredata/src/desire.c @@ -7184,11 +7184,11 @@ extern "C" void glob_init () { /* formerly s_print.c */ t_printhook sys_printhook; -int sys_printtostderr; +int sys_printtofh = -1; /* send to console by default */ static void dopost(const char *s) { if (sys_printhook) sys_printhook(s); - else if (sys_printtostderr) fprintf(stderr, "%s", s); + else if (sys_printtofh<0) fprintf(stderr, "%s", s); else { std::ostringstream t; for(int i=0; s[i]; i++) { diff --git a/desiredata/src/s_main.c b/desiredata/src/s_main.c index 7c9c27cb..05228d7c 100644 --- a/desiredata/src/s_main.c +++ b/desiredata/src/s_main.c @@ -268,7 +268,8 @@ static const char *(usagemessage[]) = { "-version -- don't run Pd; just print out which version it is", "-d -- specify debug level", "-noloadbang -- suppress all loadbangs", -"-stderr -- send printout to standard error instead of GUI", +"-stdout -- send printout to standard output (1>) instead of GUI", +"-stderr -- send printout to standard error (2>) instead of GUI", "-guiport -- set port that the GUI should connect to", "-send \"msg...\" -- send a message at startup, after patches are loaded", #ifdef UNISTD @@ -519,15 +520,14 @@ int sys_argparse(int argc, char **argv) { if (ARG("-version",1)) {sys_version = 1; NEXT(1);} if (ARG("-noloadbang",1)) {sys_noloadbang = 1; NEXT(1);} if (ARG("-nogui",1)) { - sys_printtostderr = 1; fprintf(stderr,"Warning: -nogui is obsolete: nowadays it does just like -stderr instead\n"); - NEXT(1); - } + sys_printtofh = 2; NEXT(1);} if (ARG("-guiport",2)) { if (sscanf(argv[1], "%d", &sys_guisetportnumber)<1) goto usage; NEXT(2); } - if (ARG("-stderr",1)) {sys_printtostderr = 1; NEXT(1);} + if (ARG("-stdout",1)) {sys_printtofh = 1; NEXT(1);} + if (ARG("-stderr",1)) {sys_printtofh = 2; NEXT(1);} if (ARG("-guicmd",2)) { fprintf(stderr,"Warning: -guicmd ignored"); NEXT(2); diff --git a/desiredata/src/s_stuff.h b/desiredata/src/s_stuff.h index 5757df5e..aa5f8a4d 100644 --- a/desiredata/src/s_stuff.h +++ b/desiredata/src/s_stuff.h @@ -267,7 +267,7 @@ void sys_save_audio_params(t_audiodevs *in, t_audiodevs *out, int rate, int d /* s_file.c */ typedef void (*t_printhook)(const char *s); extern t_printhook sys_printhook; /* set this to override printing */ -extern int sys_printtostderr; +extern int sys_printtofh; #ifdef MSW #define vsnprintf _vsnprintf /* jsarlo -- alias this name for msw */ #endif -- cgit v1.2.1