]> SAFE projects GIT repository - jmp/mailleur/commitdiff
code compile again after improving gessql.c
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 11 Jul 2025 12:54:56 +0000 (08:54 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Fri, 11 Jul 2025 12:54:56 +0000 (08:54 -0400)
app/sender.c
app/sorter.c
lib/devsql.c
lib/gessql.c
lib/unieml.c
lib/unieml.h

index 6e4e2c776811464d2c194caeddd5907a244f9b3f..a25894bf0b8e870917ba2af96348c59571921eee 100644 (file)
 #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
+}
 /*
 \f
 */
@@ -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
index 461be075420e0bdd5bd6fe4f4cdd865f92807f0f..8f5d3a9e4d76b5f4c82c568b0ec8ba000745e9b3 100644 (file)
@@ -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;
index 5fcd3befb77ea0d4e86bb8c52fcf27743bccecce..c9961902412384be648edeaaced7b07465f7720c 100644 (file)
@@ -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,"
index 2854530d66ddf196fc55fb6e464a7a8953ff62d8..875c978762d1709846bd315c83f59817b1ac8350 100644 (file)
@@ -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,"
index 5a6ef9eab65c00762f4296cbc3842b9831386f4f..3134fe932913f07878d885dcd7f1b1e9e6051d4d 100644 (file)
@@ -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.*/
index d35bc07ab3e222c668e548ebf93caa8640936405..d6729fd0b854770a481d3837a7afc80dc5983ce8 100644 (file)
@@ -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);