From ad427424f55ea1a2c9a8f6c9089947ea77f13c4d Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Sat, 29 Mar 2025 07:55:24 -0400 Subject: [PATCH] Use rou_alert witin feeder.c --- Makefile | 3 ++- app/feeder.c | 26 +++++++++++++------------- lib/subrou.c | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 257e39c..c79f11b 100644 --- a/Makefile +++ b/Makefile @@ -42,10 +42,11 @@ FEEDPAR = \ onefeed : debug @ bin/feeder \ + -f \ -d3 \ $(TESTIP) \ $(TESTPORT) \ - $(DATATST)/feed*.tst + $(DATATST)/feed00.tst #direct test tstfeed : debug diff --git a/app/feeder.c b/app/feeder.c index 9a98dc6..aa85499 100644 --- a/app/feeder.c +++ b/app/feeder.c @@ -58,8 +58,8 @@ static void report(int numline,char *line,char *trouble) { -(void) fprintf(stdout,"line %d %s\n",numline,trouble); -(void) fprintf(stdout,"\t'%s'\n",line); +(void) rou_alert(0,"line %d %s",numline,trouble); +(void) rou_alert(0,"\t'%s'",line); } /* @@ -101,7 +101,7 @@ tocheck=strlen(line); phase=0; proceed=true; while (proceed==true) { - //(void) fprintf(stdout,"JMPDBG %s, phase='%d'\n",OPEP,phase); + //(void) rou_alert(0,"JMPDBG %s, phase='%d'",OPEP,phase); switch (phase) { case 0 : //do we have a "..." sequence at the end if (tocheck>0) { @@ -122,15 +122,15 @@ while (proceed==true) { break; case 2 : //get available character if (strncmp(line,received,tocheck)!=0) { - (void) fprintf(stdout,"Line %04d: Error!\n",numline); - (void) fprintf(stdout,"expecting\t'%s'\n",line); - (void) fprintf(stdout,"found\t\t'%s'\n",received); + (void) rou_alert(0,"Line %04d: Error!",numline); + (void) rou_alert(0,"expecting\t'%s'",line); + (void) rou_alert(0,"found\t\t'%s'",received); phase=999; } received=rou_freestr(received); break; case 3 : //everything fine - //(void) fprintf(stdout,"JMPDBG line <%s> OK!\n",line); + //(void) rou_alert(0,"JMPDBG line <%s> OK!",line); status=true; break; default : //SAFE Guard @@ -159,7 +159,7 @@ _Bool proceed; status=true; phase=0; proceed=true; -//(void) fprintf(stdout,"JMPDBG phase='%d' line=<%s>\n",phase,line); +(void) rou_alert(0,"JMPDBG phase='%d' line=<%s>",phase,line); while (proceed==true) { switch (phase) { case 0 : //removing first space @@ -222,13 +222,13 @@ numline=0; phase=0; proceed=true; while (proceed==true) { - //(void) fprintf(stdout,"JMPDBG scanfile phase='%d'\n",phase); + //(void) rou_alert(0,"JMPDBG scanfile phase='%d'",phase); switch (phase) { case 0 : //checking parameters (void) fprintf(stdout,"Scanning file <%s>\n",filename); if ((fichier=fopen(filename,"r"))==(FILE *)0) { - (void) fprintf(stdout,"Unable to open file <%s> (error=<%s>\n", - filename,strerror(errno)); + (void) rou_alert(0,"Unable to open file <%s> (error=<%s>", + filename,strerror(errno)); proceed=false; } break; @@ -281,7 +281,7 @@ while (nextargc,params->argv); if (numfile==(params->argc-2)) - (void) fprintf(stdout,"%d file successfully transmitted to <%s.%s>\n", + (void) rou_alert(0,"%d file successfully transmitted to <%s.%s>", numfile,params->argv[0],params->argv[1]); (void) closelog(); break; diff --git a/lib/subrou.c b/lib/subrou.c index a6c0d81..6224b1a 100644 --- a/lib/subrou.c +++ b/lib/subrou.c @@ -21,7 +21,7 @@ //version definition #define VERSION "0.6" -#define RELEASE "25" +#define RELEASE "26" //Public variables PUBLIC int debug=0; //debug level -- 2.47.3