From: Jean-Marc Pigeon (Delson) Date: Fri, 11 Jul 2025 12:54:56 +0000 (-0400) Subject: code compile again after improving gessql.c X-Git-Tag: tag-0.14~136 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=32a1b3c7e206cd888d457391d30868165afeb600;p=jmp%2Fmailleur code compile again after improving gessql.c --- diff --git a/app/sender.c b/app/sender.c index 6e4e2c7..a25894b 100644 --- a/app/sender.c +++ b/app/sender.c @@ -22,8 +22,61 @@ #include "uniprc.h" #include "unisig.h" #include "geseml.h" +#include "gessql.h" #include "lvleml.h" +/* +^L +*/ +/********************************************************/ +/* */ +/* Procedure to update the database with respond */ +/* Record associated with TRA. */ +/* Return the number of record stored within the */ +/* database. */ +/* */ +/********************************************************/ +static int update_tradb(TRATYP **tra) + +{ +#define OPEP "geseml.c:eml_update_tradb," + +int num; + +num=0; +if (tra!=(TRATYP **)0) { + SQLPTR *sqlptr; + int phase; + _Bool proceed; + + sqlptr=(SQLPTR *)0; + phase=0; + proceed=(*tra!=(TRATYP *)0); + while (proceed==true) { + switch (phase) { + case 0 : //opening the database + if ((sqlptr=sql_opensql())==(SQLPTR *)0) { + (void) rou_alert(0,"%s Unable to open database (system?)",OPEP); + phase=999; + } + break; + case 1 : //checking all transation + (void) sql_update_tradb(sqlptr,tra); + break; + case 2 : //closing the database + sqlptr=sql_closesql(sqlptr); + break; + default : //SAFE Guard + proceed=false; + break; + } + phase++; + } + } +return num; + +#undef OPEP +} /* */ @@ -123,7 +176,7 @@ while (proceed==true) { break; case 5 : //updating transfile (void) eml_dump_list_tra(qfile,tra); - (void) eml_update_tradb(tra); + (void) update_tradb(tra); tra=eml_freeall_tra(tra); break; case 6 : //closing file diff --git a/app/sorter.c b/app/sorter.c index 461be07..8f5d3a9 100644 --- a/app/sorter.c +++ b/app/sorter.c @@ -69,7 +69,7 @@ while (proceed==true) { } ptr++; } - (void)eml_update_tradb(trans); + trans=eml_freeall_tra(trans); fname=(char **)rou_freelist((void *)fname,(genfree_t)rou_freestr); } break; diff --git a/lib/devsql.c b/lib/devsql.c index 5fcd3be..c996190 100644 --- a/lib/devsql.c +++ b/lib/devsql.c @@ -471,7 +471,7 @@ return numrow; /* command. */ /* */ /********************************************************/ -PUBLIC SQLRES *dropresult(SQLPTR *sqlptr,SQLRES *rs) +PUBLIC SQLRES *sql_droptupple(SQLPTR *sqlptr,SQLRES *rs) { #define OPEP "devsql.c:sql_dropresult," diff --git a/lib/gessql.c b/lib/gessql.c index 2854530..875c978 100644 --- a/lib/gessql.c +++ b/lib/gessql.c @@ -27,7 +27,7 @@ /* emails echange current and last status. */ /* */ /********************************************************/ -PUBLIC _Bool mngact(SQLPTR *sqlptr,ACTTYP *act) +static _Bool mngact(SQLPTR *sqlptr,ACTTYP *act) { #define OPEP "gessql.c:sql_mngact," diff --git a/lib/unieml.c b/lib/unieml.c index 5a6ef9e..3134fe9 100644 --- a/lib/unieml.c +++ b/lib/unieml.c @@ -103,6 +103,19 @@ return tra; */ /********************************************************/ /* */ +/* Procedure to free memory used by a tra list */ +/* */ +/********************************************************/ +PUBLIC TRATYP **eml_freeall_tra(TRATYP **tra) + +{ +return (TRATYP **)rou_freelist((void **)tra,(genfree_t)eml_freetra); +} +/* +^L +*/ +/********************************************************/ +/* */ /* Procedure to store an recipient information */ /* within the contact list. */ /* retuurn RCPTYP ** if successful, NULL otherwise.*/ diff --git a/lib/unieml.h b/lib/unieml.h index d35bc07..d6729fd 100644 --- a/lib/unieml.h +++ b/lib/unieml.h @@ -92,9 +92,12 @@ extern RCPTYP *eml_freerecipient(RCPTYP *info); //procedure to fee memory used by the resp record within TRATYP structure extern void eml_freetra_resp(TRATYP *tra); -//procedure to Free one transaction inf +//procedure to Free one transaction info extern TRATYP *eml_freetra(TRATYP *tra); +//procedure to Free all transaction inf +extern TRATYP **eml_freeall_tra(TRATYP **tra); + //procedure to add recipient to a recipient list extern _Bool eml_addrecipient(RCPTYP ***list,RCPTYP *rcpt);