#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
*/
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
}
ptr++;
}
- (void)eml_update_tradb(trans);
+ trans=eml_freeall_tra(trans);
fname=(char **)rou_freelist((void *)fname,(genfree_t)rou_freestr);
}
break;
/* command. */
/* */
/********************************************************/
-PUBLIC SQLRES *dropresult(SQLPTR *sqlptr,SQLRES *rs)
+PUBLIC SQLRES *sql_droptupple(SQLPTR *sqlptr,SQLRES *rs)
{
#define OPEP "devsql.c:sql_dropresult,"
/* 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,"
*/
/********************************************************/
/* */
+/* 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.*/
//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);