Revision 1157b2e3
Von aquamaniac vor fast 20 Jahren hinzugefügt
ChangeLog | ||
---|---|---|
- declared private functions in banking_p.h as "static": nm (1) shows that
|
||
this makes these symbols local (should in the long run reduce loading
|
||
time)
|
||
- when creating new jobs: drop a note into job log
|
||
|
||
|
||
2005/08/31: Martin Preuss<martin@libchipcard.de>
|
src/libs/aqbanking/job.c | ||
---|---|---|
|
||
|
||
|
||
AB_JOB *AB_Job_new_l(AB_JOB_TYPE jt, AB_ACCOUNT *a){
|
||
AB_JOB *j;
|
||
GWEN_BUFFER *lbuf;
|
||
const char *bankCode;
|
||
const char *accountNumber;
|
||
|
||
j=AB_Job_new(jt, a);
|
||
assert(j);
|
||
|
||
bankCode=AB_Account_GetBankCode(a);
|
||
if (!bankCode || !*bankCode)
|
||
bankCode="[no bankcode]";
|
||
accountNumber=AB_Account_GetAccountNumber(a);
|
||
|
||
lbuf=GWEN_Buffer_new(0, 32, 0, 1);
|
||
GWEN_Buffer_AppendString(lbuf, "Created job for account \"");
|
||
GWEN_Buffer_AppendString(lbuf, accountNumber);
|
||
GWEN_Buffer_AppendString(lbuf, "\" at \"");
|
||
GWEN_Buffer_AppendString(lbuf, bankCode);
|
||
GWEN_Buffer_AppendString(lbuf, "\"");
|
||
|
||
AB_Job_Log(j, AB_Banking_LogLevelInfo, "aqbanking",
|
||
GWEN_Buffer_GetStart(lbuf));
|
||
GWEN_Buffer_free(lbuf);
|
||
|
||
return j;
|
||
}
|
||
|
||
|
||
|
||
int AB_Job_Update(AB_JOB *j){
|
||
AB_PROVIDER *pro;
|
||
|
src/libs/aqbanking/job_l.h | ||
---|---|---|
|
||
AB_JOB *AB_Job_new(AB_JOB_TYPE jt, AB_ACCOUNT *a);
|
||
|
||
AB_JOB *AB_Job_new_l(AB_JOB_TYPE jt, AB_ACCOUNT *a);
|
||
|
||
|
||
int AB_Job_toDb(const AB_JOB *j, GWEN_DB_NODE *db);
|
||
AB_JOB *AB_Job_fromDb(AB_BANKING *ab, GWEN_DB_NODE *db);
|
||
|
src/libs/aqbanking/jobs/jobeutransfer.c | ||
---|---|---|
AB_JOB *j;
|
||
AB_JOBEUTRANSFER *jd;
|
||
|
||
j=AB_Job_new(AB_Job_TypeEuTransfer, a);
|
||
j=AB_Job_new_l(AB_Job_TypeEuTransfer, a);
|
||
GWEN_NEW_OBJECT(AB_JOBEUTRANSFER, jd);
|
||
GWEN_INHERIT_SETDATA(AB_JOB, AB_JOBEUTRANSFER, j, jd,
|
||
AB_JobEuTransfer_FreeData);
|
src/libs/aqbanking/jobs/jobgetbalance.c | ||
---|---|---|
AB_JOB *j;
|
||
AB_JOBGETBALANCE *aj;
|
||
|
||
j=AB_Job_new(AB_Job_TypeGetBalance, a);
|
||
j=AB_Job_new_l(AB_Job_TypeGetBalance, a);
|
||
GWEN_NEW_OBJECT(AB_JOBGETBALANCE, aj);
|
||
GWEN_INHERIT_SETDATA(AB_JOB, AB_JOBGETBALANCE, j, aj,
|
||
AB_JobGetBalance_FreeData);
|
src/libs/aqbanking/jobs/jobgetdatedtransfers.c | ||
---|---|---|
AB_JOB *j;
|
||
AB_JOB_GETDATEDTRANSFERS *aj;
|
||
|
||
j=AB_Job_new(AB_Job_TypeGetDatedTransfers, a);
|
||
j=AB_Job_new_l(AB_Job_TypeGetDatedTransfers, a);
|
||
GWEN_NEW_OBJECT(AB_JOB_GETDATEDTRANSFERS, aj);
|
||
GWEN_INHERIT_SETDATA(AB_JOB, AB_JOB_GETDATEDTRANSFERS, j, aj,
|
||
AB_JobGetDatedTransfers_FreeData);
|
src/libs/aqbanking/jobs/jobgetstandingorders.c | ||
---|---|---|
AB_JOB *j;
|
||
AB_JOB_GETSTANDINGORDERS *aj;
|
||
|
||
j=AB_Job_new(AB_Job_TypeGetStandingOrders, a);
|
||
j=AB_Job_new_l(AB_Job_TypeGetStandingOrders, a);
|
||
GWEN_NEW_OBJECT(AB_JOB_GETSTANDINGORDERS, aj);
|
||
GWEN_INHERIT_SETDATA(AB_JOB, AB_JOB_GETSTANDINGORDERS, j, aj,
|
||
AB_JobGetStandingOrders_FreeData);
|
src/libs/aqbanking/jobs/jobgettransactions.c | ||
---|---|---|
AB_JOB *j;
|
||
AB_JOB_GETTRANSACTIONS *aj;
|
||
|
||
j=AB_Job_new(AB_Job_TypeGetTransactions, a);
|
||
j=AB_Job_new_l(AB_Job_TypeGetTransactions, a);
|
||
GWEN_NEW_OBJECT(AB_JOB_GETTRANSACTIONS, aj);
|
||
GWEN_INHERIT_SETDATA(AB_JOB, AB_JOB_GETTRANSACTIONS, j, aj,
|
||
AB_JobGetTransactions_FreeData);
|
src/libs/aqbanking/jobs/jobtransferbase.c | ||
---|---|---|
AB_JOB *j;
|
||
AB_JOBTRANSFERBASE *jd;
|
||
|
||
j=AB_Job_new(jt, a);
|
||
j=AB_Job_new_l(jt, a);
|
||
GWEN_NEW_OBJECT(AB_JOBTRANSFERBASE, jd);
|
||
GWEN_INHERIT_SETDATA(AB_JOB, AB_JOBTRANSFERBASE, j, jd,
|
||
AB_JobTransferBase_FreeData);
|
src/plugins/backends/aqhbci/plugin/applayer/outbox.c | ||
---|---|---|
|
||
|
||
void AH_Outbox__CBox_HandleQueueError(AH_OUTBOX__CBOX *cbox,
|
||
AH_JOBQUEUE *jq) {
|
||
AH_JOBQUEUE *jq,
|
||
const char *logStr) {
|
||
AH_JOB *j;
|
||
AH_JOB_LIST *jl;
|
||
|
||
... | ... | |
"Setting status of job \"%s\" to ERROR",
|
||
AH_Job_GetName(j));
|
||
AH_Job_SetStatus(j, AH_JobStatusError);
|
||
if (logStr)
|
||
AH_Job_Log(j, AB_Banking_LogLevelError, logStr);
|
||
}
|
||
AH_Job_List_Add(j, cbox->finishedJobs);
|
||
}
|
||
... | ... | |
/* jq now contains all jobs to be executed */
|
||
rv=AH_Outbox__CBox_SendAndRecvQueue(cbox, timeout, dlg, jq);
|
||
if (rv) {
|
||
AH_Outbox__CBox_HandleQueueError(cbox, jq);
|
||
AH_Outbox__CBox_HandleQueueError(cbox, jq,
|
||
"Error performing queue");
|
||
return rv;
|
||
} /* if error */
|
||
} /* for */
|
||
... | ... | |
"Could not begin a dialog for customer \"%s\" (%d)",
|
||
AH_Customer_GetCustomerId(cbox->customer), rv);
|
||
/* finish all queues */
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jql);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jql,
|
||
"Could not begin dialog");
|
||
return rv;
|
||
}
|
||
assert(dlg);
|
||
... | ... | |
DBG_INFO(AQHBCI_LOGDOMAIN, "Could not open dialog");
|
||
AH_HBCI_EndDialog(cbox->hbci, dlg);
|
||
/* finish all queues */
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jql);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jql,
|
||
"Could not open dialog");
|
||
return rv;
|
||
}
|
||
|
||
... | ... | |
|
||
if (rv) {
|
||
/* finish all remaining queues */
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jql);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jql,
|
||
"Could not send ");
|
||
AH_HBCI_EndDialog(cbox->hbci, dlg);
|
||
return rv;
|
||
}
|
||
... | ... | |
"Could not begin a dialog for customer \"%s\" (%d)",
|
||
AH_Customer_GetCustomerId(cbox->customer), rv);
|
||
/* finish all queues */
|
||
AH_Outbox__CBox_HandleQueueError(cbox, jq);
|
||
AH_Outbox__CBox_HandleQueueError(cbox, jq,
|
||
"Could not begin dialog");
|
||
return rv;
|
||
}
|
||
assert(dlg);
|
||
... | ... | |
|
||
|
||
void AH_Outbox__CBox_HandleQueueListError(AH_OUTBOX__CBOX *cbox,
|
||
AH_JOBQUEUE_LIST *jql){
|
||
AH_JOBQUEUE_LIST *jql,
|
||
const char *logStr){
|
||
AH_JOBQUEUE *jq;
|
||
|
||
while((jq=AH_JobQueue_List_First(jql))) {
|
||
AH_JobQueue_List_Del(jq);
|
||
AH_Outbox__CBox_HandleQueueError(cbox, jq);
|
||
AH_Outbox__CBox_HandleQueueError(cbox, jq, logStr);
|
||
} /* while */
|
||
AH_JobQueue_List_free(jql);
|
||
}
|
||
... | ... | |
if (rv) {
|
||
DBG_ERROR(AQHBCI_LOGDOMAIN,
|
||
"Error performing queue (%d)", rv);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jqlWanted);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, cbox->todoQueues);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, jqlWanted,
|
||
"Could not perform "
|
||
"dialog queue");
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, cbox->todoQueues,
|
||
"Could not perform "
|
||
"dialog queue");
|
||
cbox->todoQueues=AH_JobQueue_List_new();
|
||
return rv;
|
||
}
|
||
... | ... | |
if (rv) {
|
||
DBG_ERROR(AQHBCI_LOGDOMAIN,
|
||
"Error performing queue (%d)", rv);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, cbox->todoQueues);
|
||
AH_Outbox__CBox_HandleQueueListError(cbox, cbox->todoQueues,
|
||
"Error performing "
|
||
"selected jobs");
|
||
cbox->todoQueues=AH_JobQueue_List_new();
|
||
return rv;
|
||
} /* while */
|
src/plugins/backends/aqhbci/plugin/applayer/outbox_p.h | ||
---|---|---|
AH_JOBQUEUE *jq,
|
||
int timeout);
|
||
void AH_Outbox__CBox_HandleQueueError(AH_OUTBOX__CBOX *cbox,
|
||
AH_JOBQUEUE *jq);
|
||
AH_JOBQUEUE *jq,
|
||
const char *logStr);
|
||
void AH_Outbox__CBox_HandleQueueListError(AH_OUTBOX__CBOX *cbox,
|
||
AH_JOBQUEUE_LIST *jql);
|
||
AH_JOBQUEUE_LIST *jql,
|
||
const char *logStr);
|
||
|
||
int AH_Outbox__CBox_SendAndRecvQueue(AH_OUTBOX__CBOX *cbox,
|
||
int timeout,
|
Auch abrufbar als: Unified diff
- when creating new jobs: drop a note into job log
git-svn-id: https://devel.aqbanking.de/svn/aqbanking/trunk@586 5c42a225-8b10-0410-9873-89b7810ad06e