1 /**********************************************************
2 * This file has been automatically created by "typemaker2"
3 * from the file "account.xml".
4 * Please do not edit this file, all changes will be lost.
5 * Better edit the mentioned source file instead.
6 **********************************************************/
7
8 #ifdef HAVE_CONFIG_H
9 # include <config.h>
10 #endif
11
12 #include "./account_p.h"
13
14 #include <gwenhywfar/misc.h>
15 #include <gwenhywfar/debug.h>
16
17 /* code headers */
18
19 /* macro functions */
GWEN_LIST_FUNCTIONS(AB_ACCOUNT,AB_Account)20 GWEN_LIST_FUNCTIONS(AB_ACCOUNT, AB_Account)
21 GWEN_LIST2_FUNCTIONS(AB_ACCOUNT, AB_Account)
22 GWEN_INHERIT_FUNCTIONS(AB_ACCOUNT)
23
24
25 AB_ACCOUNT *AB_Account_new(void)
26 {
27 AB_ACCOUNT *p_struct;
28
29 GWEN_NEW_OBJECT(AB_ACCOUNT, p_struct)
30 p_struct->_refCount=1;
31 GWEN_INHERIT_INIT(AB_ACCOUNT, p_struct)
32 GWEN_LIST_INIT(AB_ACCOUNT, p_struct)
33 /* members */
34 p_struct->accountType=AB_AccountType_Unknown;
35 p_struct->uniqueId=0;
36 p_struct->backendName=NULL;
37 p_struct->ownerName=NULL;
38 p_struct->bankName=NULL;
39 p_struct->accountName=NULL;
40 p_struct->currency=NULL;
41 p_struct->memo=NULL;
42 p_struct->iban=NULL;
43 p_struct->bic=NULL;
44 p_struct->country=NULL;
45 p_struct->bankCode=NULL;
46 p_struct->branchId=NULL;
47 p_struct->accountNumber=NULL;
48 p_struct->subAccountId=NULL;
49 p_struct->userId=0;
50 p_struct->provider=NULL;
51 /* virtual functions */
52 p_struct->readFromDbFn=AB_Account__ReadFromDb;
53 p_struct->writeToDbFn=AB_Account__WriteToDb;
54
55 return p_struct;
56 }
57
AB_Account_free(AB_ACCOUNT * p_struct)58 void AB_Account_free(AB_ACCOUNT *p_struct)
59 {
60 if (p_struct) {
61 assert(p_struct->_refCount);
62 if (p_struct->_refCount==1) {
63 GWEN_INHERIT_FINI(AB_ACCOUNT, p_struct)
64 GWEN_LIST_FINI(AB_ACCOUNT, p_struct)
65 /* members */
66 free(p_struct->backendName);
67 p_struct->backendName=NULL;
68 free(p_struct->ownerName);
69 p_struct->ownerName=NULL;
70 free(p_struct->bankName);
71 p_struct->bankName=NULL;
72 free(p_struct->accountName);
73 p_struct->accountName=NULL;
74 free(p_struct->currency);
75 p_struct->currency=NULL;
76 free(p_struct->memo);
77 p_struct->memo=NULL;
78 free(p_struct->iban);
79 p_struct->iban=NULL;
80 free(p_struct->bic);
81 p_struct->bic=NULL;
82 free(p_struct->country);
83 p_struct->country=NULL;
84 free(p_struct->bankCode);
85 p_struct->bankCode=NULL;
86 free(p_struct->branchId);
87 p_struct->branchId=NULL;
88 free(p_struct->accountNumber);
89 p_struct->accountNumber=NULL;
90 free(p_struct->subAccountId);
91 p_struct->subAccountId=NULL;
92 p_struct->_refCount=0;
93 GWEN_FREE_OBJECT(p_struct);
94 }
95 else
96 p_struct->_refCount--;
97 }
98 }
99
AB_Account_Attach(AB_ACCOUNT * p_struct)100 void AB_Account_Attach(AB_ACCOUNT *p_struct)
101 {
102 assert(p_struct);
103 assert(p_struct->_refCount);
104 p_struct->_refCount++;
105 }
106
AB_Account_GetAccountType(const AB_ACCOUNT * p_struct)107 int AB_Account_GetAccountType(const AB_ACCOUNT *p_struct)
108 {
109 assert(p_struct);
110 return p_struct->accountType;
111 }
112
AB_Account_GetUniqueId(const AB_ACCOUNT * p_struct)113 uint32_t AB_Account_GetUniqueId(const AB_ACCOUNT *p_struct)
114 {
115 assert(p_struct);
116 return p_struct->uniqueId;
117 }
118
AB_Account_GetBackendName(const AB_ACCOUNT * p_struct)119 const char *AB_Account_GetBackendName(const AB_ACCOUNT *p_struct)
120 {
121 assert(p_struct);
122 return p_struct->backendName;
123 }
124
AB_Account_GetOwnerName(const AB_ACCOUNT * p_struct)125 const char *AB_Account_GetOwnerName(const AB_ACCOUNT *p_struct)
126 {
127 assert(p_struct);
128 return p_struct->ownerName;
129 }
130
AB_Account_GetBankName(const AB_ACCOUNT * p_struct)131 const char *AB_Account_GetBankName(const AB_ACCOUNT *p_struct)
132 {
133 assert(p_struct);
134 return p_struct->bankName;
135 }
136
AB_Account_GetAccountName(const AB_ACCOUNT * p_struct)137 const char *AB_Account_GetAccountName(const AB_ACCOUNT *p_struct)
138 {
139 assert(p_struct);
140 return p_struct->accountName;
141 }
142
AB_Account_GetCurrency(const AB_ACCOUNT * p_struct)143 const char *AB_Account_GetCurrency(const AB_ACCOUNT *p_struct)
144 {
145 assert(p_struct);
146 return p_struct->currency;
147 }
148
AB_Account_GetMemo(const AB_ACCOUNT * p_struct)149 const char *AB_Account_GetMemo(const AB_ACCOUNT *p_struct)
150 {
151 assert(p_struct);
152 return p_struct->memo;
153 }
154
AB_Account_GetIban(const AB_ACCOUNT * p_struct)155 const char *AB_Account_GetIban(const AB_ACCOUNT *p_struct)
156 {
157 assert(p_struct);
158 return p_struct->iban;
159 }
160
AB_Account_GetBic(const AB_ACCOUNT * p_struct)161 const char *AB_Account_GetBic(const AB_ACCOUNT *p_struct)
162 {
163 assert(p_struct);
164 return p_struct->bic;
165 }
166
AB_Account_GetCountry(const AB_ACCOUNT * p_struct)167 const char *AB_Account_GetCountry(const AB_ACCOUNT *p_struct)
168 {
169 assert(p_struct);
170 return p_struct->country;
171 }
172
AB_Account_GetBankCode(const AB_ACCOUNT * p_struct)173 const char *AB_Account_GetBankCode(const AB_ACCOUNT *p_struct)
174 {
175 assert(p_struct);
176 return p_struct->bankCode;
177 }
178
AB_Account_GetBranchId(const AB_ACCOUNT * p_struct)179 const char *AB_Account_GetBranchId(const AB_ACCOUNT *p_struct)
180 {
181 assert(p_struct);
182 return p_struct->branchId;
183 }
184
AB_Account_GetAccountNumber(const AB_ACCOUNT * p_struct)185 const char *AB_Account_GetAccountNumber(const AB_ACCOUNT *p_struct)
186 {
187 assert(p_struct);
188 return p_struct->accountNumber;
189 }
190
AB_Account_GetSubAccountId(const AB_ACCOUNT * p_struct)191 const char *AB_Account_GetSubAccountId(const AB_ACCOUNT *p_struct)
192 {
193 assert(p_struct);
194 return p_struct->subAccountId;
195 }
196
AB_Account_GetUserId(const AB_ACCOUNT * p_struct)197 uint32_t AB_Account_GetUserId(const AB_ACCOUNT *p_struct)
198 {
199 assert(p_struct);
200 return p_struct->userId;
201 }
202
AB_Account_GetProvider(const AB_ACCOUNT * p_struct)203 AB_PROVIDER *AB_Account_GetProvider(const AB_ACCOUNT *p_struct)
204 {
205 assert(p_struct);
206 return p_struct->provider;
207 }
208
AB_Account_SetAccountType(AB_ACCOUNT * p_struct,int p_src)209 void AB_Account_SetAccountType(AB_ACCOUNT *p_struct, int p_src)
210 {
211 assert(p_struct);
212 p_struct->accountType=p_src;
213 }
214
AB_Account_SetUniqueId(AB_ACCOUNT * p_struct,uint32_t p_src)215 void AB_Account_SetUniqueId(AB_ACCOUNT *p_struct, uint32_t p_src)
216 {
217 assert(p_struct);
218 p_struct->uniqueId=p_src;
219 }
220
AB_Account_SetBackendName(AB_ACCOUNT * p_struct,const char * p_src)221 void AB_Account_SetBackendName(AB_ACCOUNT *p_struct, const char *p_src)
222 {
223 assert(p_struct);
224 if (p_struct->backendName) {
225 free(p_struct->backendName);
226 p_struct->backendName=NULL;
227 }
228 if (p_src) {
229 p_struct->backendName=strdup(p_src);
230 }
231 else {
232 p_struct->backendName=NULL;
233 }
234 }
235
AB_Account_SetOwnerName(AB_ACCOUNT * p_struct,const char * p_src)236 void AB_Account_SetOwnerName(AB_ACCOUNT *p_struct, const char *p_src)
237 {
238 assert(p_struct);
239 if (p_struct->ownerName) {
240 free(p_struct->ownerName);
241 p_struct->ownerName=NULL;
242 }
243 if (p_src) {
244 p_struct->ownerName=strdup(p_src);
245 }
246 else {
247 p_struct->ownerName=NULL;
248 }
249 }
250
AB_Account_SetBankName(AB_ACCOUNT * p_struct,const char * p_src)251 void AB_Account_SetBankName(AB_ACCOUNT *p_struct, const char *p_src)
252 {
253 assert(p_struct);
254 if (p_struct->bankName) {
255 free(p_struct->bankName);
256 p_struct->bankName=NULL;
257 }
258 if (p_src) {
259 p_struct->bankName=strdup(p_src);
260 }
261 else {
262 p_struct->bankName=NULL;
263 }
264 }
265
AB_Account_SetAccountName(AB_ACCOUNT * p_struct,const char * p_src)266 void AB_Account_SetAccountName(AB_ACCOUNT *p_struct, const char *p_src)
267 {
268 assert(p_struct);
269 if (p_struct->accountName) {
270 free(p_struct->accountName);
271 p_struct->accountName=NULL;
272 }
273 if (p_src) {
274 p_struct->accountName=strdup(p_src);
275 }
276 else {
277 p_struct->accountName=NULL;
278 }
279 }
280
AB_Account_SetCurrency(AB_ACCOUNT * p_struct,const char * p_src)281 void AB_Account_SetCurrency(AB_ACCOUNT *p_struct, const char *p_src)
282 {
283 assert(p_struct);
284 if (p_struct->currency) {
285 free(p_struct->currency);
286 p_struct->currency=NULL;
287 }
288 if (p_src) {
289 p_struct->currency=strdup(p_src);
290 }
291 else {
292 p_struct->currency=NULL;
293 }
294 }
295
AB_Account_SetMemo(AB_ACCOUNT * p_struct,const char * p_src)296 void AB_Account_SetMemo(AB_ACCOUNT *p_struct, const char *p_src)
297 {
298 assert(p_struct);
299 if (p_struct->memo) {
300 free(p_struct->memo);
301 p_struct->memo=NULL;
302 }
303 if (p_src) {
304 p_struct->memo=strdup(p_src);
305 }
306 else {
307 p_struct->memo=NULL;
308 }
309 }
310
AB_Account_SetIban(AB_ACCOUNT * p_struct,const char * p_src)311 void AB_Account_SetIban(AB_ACCOUNT *p_struct, const char *p_src)
312 {
313 assert(p_struct);
314 if (p_struct->iban) {
315 free(p_struct->iban);
316 p_struct->iban=NULL;
317 }
318 if (p_src) {
319 p_struct->iban=strdup(p_src);
320 }
321 else {
322 p_struct->iban=NULL;
323 }
324 }
325
AB_Account_SetBic(AB_ACCOUNT * p_struct,const char * p_src)326 void AB_Account_SetBic(AB_ACCOUNT *p_struct, const char *p_src)
327 {
328 assert(p_struct);
329 if (p_struct->bic) {
330 free(p_struct->bic);
331 p_struct->bic=NULL;
332 }
333 if (p_src) {
334 p_struct->bic=strdup(p_src);
335 }
336 else {
337 p_struct->bic=NULL;
338 }
339 }
340
AB_Account_SetCountry(AB_ACCOUNT * p_struct,const char * p_src)341 void AB_Account_SetCountry(AB_ACCOUNT *p_struct, const char *p_src)
342 {
343 assert(p_struct);
344 if (p_struct->country) {
345 free(p_struct->country);
346 p_struct->country=NULL;
347 }
348 if (p_src) {
349 p_struct->country=strdup(p_src);
350 }
351 else {
352 p_struct->country=NULL;
353 }
354 }
355
AB_Account_SetBankCode(AB_ACCOUNT * p_struct,const char * p_src)356 void AB_Account_SetBankCode(AB_ACCOUNT *p_struct, const char *p_src)
357 {
358 assert(p_struct);
359 if (p_struct->bankCode) {
360 free(p_struct->bankCode);
361 p_struct->bankCode=NULL;
362 }
363 if (p_src) {
364 p_struct->bankCode=strdup(p_src);
365 }
366 else {
367 p_struct->bankCode=NULL;
368 }
369 }
370
AB_Account_SetBranchId(AB_ACCOUNT * p_struct,const char * p_src)371 void AB_Account_SetBranchId(AB_ACCOUNT *p_struct, const char *p_src)
372 {
373 assert(p_struct);
374 if (p_struct->branchId) {
375 free(p_struct->branchId);
376 p_struct->branchId=NULL;
377 }
378 if (p_src) {
379 p_struct->branchId=strdup(p_src);
380 }
381 else {
382 p_struct->branchId=NULL;
383 }
384 }
385
AB_Account_SetAccountNumber(AB_ACCOUNT * p_struct,const char * p_src)386 void AB_Account_SetAccountNumber(AB_ACCOUNT *p_struct, const char *p_src)
387 {
388 assert(p_struct);
389 if (p_struct->accountNumber) {
390 free(p_struct->accountNumber);
391 p_struct->accountNumber=NULL;
392 }
393 if (p_src) {
394 p_struct->accountNumber=strdup(p_src);
395 }
396 else {
397 p_struct->accountNumber=NULL;
398 }
399 }
400
AB_Account_SetSubAccountId(AB_ACCOUNT * p_struct,const char * p_src)401 void AB_Account_SetSubAccountId(AB_ACCOUNT *p_struct, const char *p_src)
402 {
403 assert(p_struct);
404 if (p_struct->subAccountId) {
405 free(p_struct->subAccountId);
406 p_struct->subAccountId=NULL;
407 }
408 if (p_src) {
409 p_struct->subAccountId=strdup(p_src);
410 }
411 else {
412 p_struct->subAccountId=NULL;
413 }
414 }
415
AB_Account_SetUserId(AB_ACCOUNT * p_struct,uint32_t p_src)416 void AB_Account_SetUserId(AB_ACCOUNT *p_struct, uint32_t p_src)
417 {
418 assert(p_struct);
419 p_struct->userId=p_src;
420 }
421
AB_Account_SetProvider(AB_ACCOUNT * p_struct,AB_PROVIDER * p_src)422 void AB_Account_SetProvider(AB_ACCOUNT *p_struct, AB_PROVIDER *p_src)
423 {
424 assert(p_struct);
425 p_struct->provider=p_src;
426 }
427
428 /* code for virtual functions */
AB_Account_ReadFromDb(AB_ACCOUNT * p_struct,GWEN_DB_NODE * dbData)429 int AB_Account_ReadFromDb(AB_ACCOUNT *p_struct, GWEN_DB_NODE *dbData)
430 {
431 assert(p_struct);
432 if (p_struct->readFromDbFn)
433 return p_struct->readFromDbFn(p_struct, dbData);
434 else
435 return GWEN_ERROR_NOT_IMPLEMENTED;
436 }
437
AB_Account_WriteToDb(const AB_ACCOUNT * p_struct,GWEN_DB_NODE * dbData)438 int AB_Account_WriteToDb(const AB_ACCOUNT *p_struct, GWEN_DB_NODE *dbData)
439 {
440 assert(p_struct);
441 if (p_struct->writeToDbFn)
442 return p_struct->writeToDbFn(p_struct, dbData);
443 else
444 return GWEN_ERROR_NOT_IMPLEMENTED;
445 }
446
447 /* setters for virtual functions */
AB_Account_SetReadFromDbFn(AB_ACCOUNT * p_struct,AB_ACCOUNT_READFROMDB_FN fn)448 AB_ACCOUNT_READFROMDB_FN AB_Account_SetReadFromDbFn(AB_ACCOUNT *p_struct, AB_ACCOUNT_READFROMDB_FN fn)
449 {
450 AB_ACCOUNT_READFROMDB_FN oldFn;
451
452 assert(p_struct);
453 oldFn=p_struct->readFromDbFn;
454 p_struct->readFromDbFn=fn;
455 return oldFn;
456 }
457
AB_Account_SetWriteToDbFn(AB_ACCOUNT * p_struct,AB_ACCOUNT_WRITETODB_FN fn)458 AB_ACCOUNT_WRITETODB_FN AB_Account_SetWriteToDbFn(AB_ACCOUNT *p_struct, AB_ACCOUNT_WRITETODB_FN fn)
459 {
460 AB_ACCOUNT_WRITETODB_FN oldFn;
461
462 assert(p_struct);
463 oldFn=p_struct->writeToDbFn;
464 p_struct->writeToDbFn=fn;
465 return oldFn;
466 }
467
468 /* getters for virtual functions */
AB_Account_GetReadFromDbFn(const AB_ACCOUNT * p_struct)469 AB_ACCOUNT_READFROMDB_FN AB_Account_GetReadFromDbFn(const AB_ACCOUNT *p_struct)
470 {
471 assert(p_struct);
472 return p_struct->readFromDbFn;
473 }
474
AB_Account_GetWriteToDbFn(const AB_ACCOUNT * p_struct)475 AB_ACCOUNT_WRITETODB_FN AB_Account_GetWriteToDbFn(const AB_ACCOUNT *p_struct)
476 {
477 assert(p_struct);
478 return p_struct->writeToDbFn;
479 }
480
AB_Account_ReadDb(AB_ACCOUNT * p_struct,GWEN_DB_NODE * p_db)481 void AB_Account_ReadDb(AB_ACCOUNT *p_struct, GWEN_DB_NODE *p_db)
482 {
483 assert(p_struct);
484 /* member "accountType" */
485 p_struct->accountType=GWEN_DB_GetIntValue(p_db, "accountType", 0, AB_AccountType_Unknown);
486
487 /* member "uniqueId" */
488 p_struct->uniqueId=GWEN_DB_GetIntValue(p_db, "uniqueId", 0, 0);
489
490 /* member "backendName" */
491 if (p_struct->backendName) {
492 free(p_struct->backendName);
493 p_struct->backendName=NULL;
494 }
495 {
496 const char *s;
497 s=GWEN_DB_GetCharValue(p_db, "backendName", 0, NULL);
498 if (s)
499 p_struct->backendName=strdup(s);
500 }
501 if (p_struct->backendName==NULL) {
502 p_struct->backendName=NULL;
503 }
504
505 /* member "ownerName" */
506 if (p_struct->ownerName) {
507 free(p_struct->ownerName);
508 p_struct->ownerName=NULL;
509 }
510 {
511 const char *s;
512 s=GWEN_DB_GetCharValue(p_db, "ownerName", 0, NULL);
513 if (s)
514 p_struct->ownerName=strdup(s);
515 }
516 if (p_struct->ownerName==NULL) {
517 p_struct->ownerName=NULL;
518 }
519
520 /* member "bankName" */
521 if (p_struct->bankName) {
522 free(p_struct->bankName);
523 p_struct->bankName=NULL;
524 }
525 {
526 const char *s;
527 s=GWEN_DB_GetCharValue(p_db, "bankName", 0, NULL);
528 if (s)
529 p_struct->bankName=strdup(s);
530 }
531 if (p_struct->bankName==NULL) {
532 p_struct->bankName=NULL;
533 }
534
535 /* member "accountName" */
536 if (p_struct->accountName) {
537 free(p_struct->accountName);
538 p_struct->accountName=NULL;
539 }
540 {
541 const char *s;
542 s=GWEN_DB_GetCharValue(p_db, "accountName", 0, NULL);
543 if (s)
544 p_struct->accountName=strdup(s);
545 }
546 if (p_struct->accountName==NULL) {
547 p_struct->accountName=NULL;
548 }
549
550 /* member "currency" */
551 if (p_struct->currency) {
552 free(p_struct->currency);
553 p_struct->currency=NULL;
554 }
555 {
556 const char *s;
557 s=GWEN_DB_GetCharValue(p_db, "currency", 0, NULL);
558 if (s)
559 p_struct->currency=strdup(s);
560 }
561 if (p_struct->currency==NULL) {
562 p_struct->currency=NULL;
563 }
564
565 /* member "memo" */
566 if (p_struct->memo) {
567 free(p_struct->memo);
568 p_struct->memo=NULL;
569 }
570 {
571 const char *s;
572 s=GWEN_DB_GetCharValue(p_db, "memo", 0, NULL);
573 if (s)
574 p_struct->memo=strdup(s);
575 }
576 if (p_struct->memo==NULL) {
577 p_struct->memo=NULL;
578 }
579
580 /* member "iban" */
581 if (p_struct->iban) {
582 free(p_struct->iban);
583 p_struct->iban=NULL;
584 }
585 {
586 const char *s;
587 s=GWEN_DB_GetCharValue(p_db, "iban", 0, NULL);
588 if (s)
589 p_struct->iban=strdup(s);
590 }
591 if (p_struct->iban==NULL) {
592 p_struct->iban=NULL;
593 }
594
595 /* member "bic" */
596 if (p_struct->bic) {
597 free(p_struct->bic);
598 p_struct->bic=NULL;
599 }
600 {
601 const char *s;
602 s=GWEN_DB_GetCharValue(p_db, "bic", 0, NULL);
603 if (s)
604 p_struct->bic=strdup(s);
605 }
606 if (p_struct->bic==NULL) {
607 p_struct->bic=NULL;
608 }
609
610 /* member "country" */
611 if (p_struct->country) {
612 free(p_struct->country);
613 p_struct->country=NULL;
614 }
615 {
616 const char *s;
617 s=GWEN_DB_GetCharValue(p_db, "country", 0, NULL);
618 if (s)
619 p_struct->country=strdup(s);
620 }
621 if (p_struct->country==NULL) {
622 p_struct->country=NULL;
623 }
624
625 /* member "bankCode" */
626 if (p_struct->bankCode) {
627 free(p_struct->bankCode);
628 p_struct->bankCode=NULL;
629 }
630 {
631 const char *s;
632 s=GWEN_DB_GetCharValue(p_db, "bankCode", 0, NULL);
633 if (s)
634 p_struct->bankCode=strdup(s);
635 }
636 if (p_struct->bankCode==NULL) {
637 p_struct->bankCode=NULL;
638 }
639
640 /* member "branchId" */
641 if (p_struct->branchId) {
642 free(p_struct->branchId);
643 p_struct->branchId=NULL;
644 }
645 {
646 const char *s;
647 s=GWEN_DB_GetCharValue(p_db, "branchId", 0, NULL);
648 if (s)
649 p_struct->branchId=strdup(s);
650 }
651 if (p_struct->branchId==NULL) {
652 p_struct->branchId=NULL;
653 }
654
655 /* member "accountNumber" */
656 if (p_struct->accountNumber) {
657 free(p_struct->accountNumber);
658 p_struct->accountNumber=NULL;
659 }
660 {
661 const char *s;
662 s=GWEN_DB_GetCharValue(p_db, "accountNumber", 0, NULL);
663 if (s)
664 p_struct->accountNumber=strdup(s);
665 }
666 if (p_struct->accountNumber==NULL) {
667 p_struct->accountNumber=NULL;
668 }
669
670 /* member "subAccountId" */
671 if (p_struct->subAccountId) {
672 free(p_struct->subAccountId);
673 p_struct->subAccountId=NULL;
674 }
675 {
676 const char *s;
677 s=GWEN_DB_GetCharValue(p_db, "subAccountId", 0, NULL);
678 if (s)
679 p_struct->subAccountId=strdup(s);
680 }
681 if (p_struct->subAccountId==NULL) {
682 p_struct->subAccountId=NULL;
683 }
684
685 /* member "userId" */
686 p_struct->userId=GWEN_DB_GetIntValue(p_db, "userId", 0, 0);
687
688 /* member "provider" */
689 /* member "provider" is volatile, just presetting */
690 p_struct->provider=NULL;
691
692 }
693
AB_Account_WriteDb(const AB_ACCOUNT * p_struct,GWEN_DB_NODE * p_db)694 int AB_Account_WriteDb(const AB_ACCOUNT *p_struct, GWEN_DB_NODE *p_db)
695 {
696 int p_rv;
697
698 assert(p_struct);
699 /* member "accountType" */
700 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "accountType", p_struct->accountType);
701 if (p_rv<0) {
702 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
703 return p_rv;
704 }
705
706 /* member "uniqueId" */
707 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "uniqueId", p_struct->uniqueId);
708 if (p_rv<0) {
709 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
710 return p_rv;
711 }
712
713 /* member "backendName" */
714 if (p_struct->backendName)
715 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "backendName", p_struct->backendName);
716 else {
717 GWEN_DB_DeleteVar(p_db, "backendName");
718 p_rv=0;
719 }
720 if (p_rv<0) {
721 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
722 return p_rv;
723 }
724
725 /* member "ownerName" */
726 if (p_struct->ownerName)
727 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "ownerName", p_struct->ownerName);
728 else {
729 GWEN_DB_DeleteVar(p_db, "ownerName");
730 p_rv=0;
731 }
732 if (p_rv<0) {
733 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
734 return p_rv;
735 }
736
737 /* member "bankName" */
738 if (p_struct->bankName)
739 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "bankName", p_struct->bankName);
740 else {
741 GWEN_DB_DeleteVar(p_db, "bankName");
742 p_rv=0;
743 }
744 if (p_rv<0) {
745 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
746 return p_rv;
747 }
748
749 /* member "accountName" */
750 if (p_struct->accountName)
751 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "accountName", p_struct->accountName);
752 else {
753 GWEN_DB_DeleteVar(p_db, "accountName");
754 p_rv=0;
755 }
756 if (p_rv<0) {
757 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
758 return p_rv;
759 }
760
761 /* member "currency" */
762 if (p_struct->currency)
763 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "currency", p_struct->currency);
764 else {
765 GWEN_DB_DeleteVar(p_db, "currency");
766 p_rv=0;
767 }
768 if (p_rv<0) {
769 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
770 return p_rv;
771 }
772
773 /* member "memo" */
774 if (p_struct->memo)
775 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "memo", p_struct->memo);
776 else {
777 GWEN_DB_DeleteVar(p_db, "memo");
778 p_rv=0;
779 }
780 if (p_rv<0) {
781 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
782 return p_rv;
783 }
784
785 /* member "iban" */
786 if (p_struct->iban)
787 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "iban", p_struct->iban);
788 else {
789 GWEN_DB_DeleteVar(p_db, "iban");
790 p_rv=0;
791 }
792 if (p_rv<0) {
793 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
794 return p_rv;
795 }
796
797 /* member "bic" */
798 if (p_struct->bic)
799 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "bic", p_struct->bic);
800 else {
801 GWEN_DB_DeleteVar(p_db, "bic");
802 p_rv=0;
803 }
804 if (p_rv<0) {
805 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
806 return p_rv;
807 }
808
809 /* member "country" */
810 if (p_struct->country)
811 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "country", p_struct->country);
812 else {
813 GWEN_DB_DeleteVar(p_db, "country");
814 p_rv=0;
815 }
816 if (p_rv<0) {
817 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
818 return p_rv;
819 }
820
821 /* member "bankCode" */
822 if (p_struct->bankCode)
823 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "bankCode", p_struct->bankCode);
824 else {
825 GWEN_DB_DeleteVar(p_db, "bankCode");
826 p_rv=0;
827 }
828 if (p_rv<0) {
829 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
830 return p_rv;
831 }
832
833 /* member "branchId" */
834 if (p_struct->branchId)
835 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "branchId", p_struct->branchId);
836 else {
837 GWEN_DB_DeleteVar(p_db, "branchId");
838 p_rv=0;
839 }
840 if (p_rv<0) {
841 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
842 return p_rv;
843 }
844
845 /* member "accountNumber" */
846 if (p_struct->accountNumber)
847 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "accountNumber", p_struct->accountNumber);
848 else {
849 GWEN_DB_DeleteVar(p_db, "accountNumber");
850 p_rv=0;
851 }
852 if (p_rv<0) {
853 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
854 return p_rv;
855 }
856
857 /* member "subAccountId" */
858 if (p_struct->subAccountId)
859 p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "subAccountId", p_struct->subAccountId);
860 else {
861 GWEN_DB_DeleteVar(p_db, "subAccountId");
862 p_rv=0;
863 }
864 if (p_rv<0) {
865 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
866 return p_rv;
867 }
868
869 /* member "userId" */
870 p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "userId", p_struct->userId);
871 if (p_rv<0) {
872 DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
873 return p_rv;
874 }
875
876 /* member "provider" is volatile, not writing to db */
877
878 return 0;
879 }
880
AB_Account_fromDb(GWEN_DB_NODE * p_db)881 AB_ACCOUNT *AB_Account_fromDb(GWEN_DB_NODE *p_db)
882 {
883 AB_ACCOUNT *p_struct;
884 p_struct=AB_Account_new();
885 AB_Account_ReadDb(p_struct, p_db);
886 return p_struct;
887 }
888
AB_Account_toDb(const AB_ACCOUNT * p_struct,GWEN_DB_NODE * p_db)889 int AB_Account_toDb(const AB_ACCOUNT *p_struct, GWEN_DB_NODE *p_db)
890 {
891 return AB_Account_WriteDb(p_struct, p_db);
892 }
893
AB_Account_ReadXml(AB_ACCOUNT * p_struct,GWEN_XMLNODE * p_db)894 void AB_Account_ReadXml(AB_ACCOUNT *p_struct, GWEN_XMLNODE *p_db)
895 {
896 assert(p_struct);
897 /* member "accountType" */
898 p_struct->accountType=GWEN_XMLNode_GetIntValue(p_db, "accountType", AB_AccountType_Unknown);
899
900 /* member "uniqueId" */
901 p_struct->uniqueId=GWEN_XMLNode_GetIntValue(p_db, "uniqueId", 0);
902
903 /* member "backendName" */
904 if (p_struct->backendName) {
905 free(p_struct->backendName);
906 p_struct->backendName=NULL;
907 }
908 {
909 const char *s;
910 s=GWEN_XMLNode_GetCharValue(p_db, "backendName", NULL);
911 if (s)
912 p_struct->backendName=strdup(s);
913 }
914 if (p_struct->backendName==NULL) { /* preset member "backendName" if empty */
915 p_struct->backendName=NULL;
916 }
917
918 /* member "ownerName" */
919 if (p_struct->ownerName) {
920 free(p_struct->ownerName);
921 p_struct->ownerName=NULL;
922 }
923 {
924 const char *s;
925 s=GWEN_XMLNode_GetCharValue(p_db, "ownerName", NULL);
926 if (s)
927 p_struct->ownerName=strdup(s);
928 }
929 if (p_struct->ownerName==NULL) { /* preset member "ownerName" if empty */
930 p_struct->ownerName=NULL;
931 }
932
933 /* member "bankName" */
934 if (p_struct->bankName) {
935 free(p_struct->bankName);
936 p_struct->bankName=NULL;
937 }
938 {
939 const char *s;
940 s=GWEN_XMLNode_GetCharValue(p_db, "bankName", NULL);
941 if (s)
942 p_struct->bankName=strdup(s);
943 }
944 if (p_struct->bankName==NULL) { /* preset member "bankName" if empty */
945 p_struct->bankName=NULL;
946 }
947
948 /* member "accountName" */
949 if (p_struct->accountName) {
950 free(p_struct->accountName);
951 p_struct->accountName=NULL;
952 }
953 {
954 const char *s;
955 s=GWEN_XMLNode_GetCharValue(p_db, "accountName", NULL);
956 if (s)
957 p_struct->accountName=strdup(s);
958 }
959 if (p_struct->accountName==NULL) { /* preset member "accountName" if empty */
960 p_struct->accountName=NULL;
961 }
962
963 /* member "currency" */
964 if (p_struct->currency) {
965 free(p_struct->currency);
966 p_struct->currency=NULL;
967 }
968 {
969 const char *s;
970 s=GWEN_XMLNode_GetCharValue(p_db, "currency", NULL);
971 if (s)
972 p_struct->currency=strdup(s);
973 }
974 if (p_struct->currency==NULL) { /* preset member "currency" if empty */
975 p_struct->currency=NULL;
976 }
977
978 /* member "memo" */
979 if (p_struct->memo) {
980 free(p_struct->memo);
981 p_struct->memo=NULL;
982 }
983 {
984 const char *s;
985 s=GWEN_XMLNode_GetCharValue(p_db, "memo", NULL);
986 if (s)
987 p_struct->memo=strdup(s);
988 }
989 if (p_struct->memo==NULL) { /* preset member "memo" if empty */
990 p_struct->memo=NULL;
991 }
992
993 /* member "iban" */
994 if (p_struct->iban) {
995 free(p_struct->iban);
996 p_struct->iban=NULL;
997 }
998 {
999 const char *s;
1000 s=GWEN_XMLNode_GetCharValue(p_db, "iban", NULL);
1001 if (s)
1002 p_struct->iban=strdup(s);
1003 }
1004 if (p_struct->iban==NULL) { /* preset member "iban" if empty */
1005 p_struct->iban=NULL;
1006 }
1007
1008 /* member "bic" */
1009 if (p_struct->bic) {
1010 free(p_struct->bic);
1011 p_struct->bic=NULL;
1012 }
1013 {
1014 const char *s;
1015 s=GWEN_XMLNode_GetCharValue(p_db, "bic", NULL);
1016 if (s)
1017 p_struct->bic=strdup(s);
1018 }
1019 if (p_struct->bic==NULL) { /* preset member "bic" if empty */
1020 p_struct->bic=NULL;
1021 }
1022
1023 /* member "country" */
1024 if (p_struct->country) {
1025 free(p_struct->country);
1026 p_struct->country=NULL;
1027 }
1028 {
1029 const char *s;
1030 s=GWEN_XMLNode_GetCharValue(p_db, "country", NULL);
1031 if (s)
1032 p_struct->country=strdup(s);
1033 }
1034 if (p_struct->country==NULL) { /* preset member "country" if empty */
1035 p_struct->country=NULL;
1036 }
1037
1038 /* member "bankCode" */
1039 if (p_struct->bankCode) {
1040 free(p_struct->bankCode);
1041 p_struct->bankCode=NULL;
1042 }
1043 {
1044 const char *s;
1045 s=GWEN_XMLNode_GetCharValue(p_db, "bankCode", NULL);
1046 if (s)
1047 p_struct->bankCode=strdup(s);
1048 }
1049 if (p_struct->bankCode==NULL) { /* preset member "bankCode" if empty */
1050 p_struct->bankCode=NULL;
1051 }
1052
1053 /* member "branchId" */
1054 if (p_struct->branchId) {
1055 free(p_struct->branchId);
1056 p_struct->branchId=NULL;
1057 }
1058 {
1059 const char *s;
1060 s=GWEN_XMLNode_GetCharValue(p_db, "branchId", NULL);
1061 if (s)
1062 p_struct->branchId=strdup(s);
1063 }
1064 if (p_struct->branchId==NULL) { /* preset member "branchId" if empty */
1065 p_struct->branchId=NULL;
1066 }
1067
1068 /* member "accountNumber" */
1069 if (p_struct->accountNumber) {
1070 free(p_struct->accountNumber);
1071 p_struct->accountNumber=NULL;
1072 }
1073 {
1074 const char *s;
1075 s=GWEN_XMLNode_GetCharValue(p_db, "accountNumber", NULL);
1076 if (s)
1077 p_struct->accountNumber=strdup(s);
1078 }
1079 if (p_struct->accountNumber==NULL) { /* preset member "accountNumber" if empty */
1080 p_struct->accountNumber=NULL;
1081 }
1082
1083 /* member "subAccountId" */
1084 if (p_struct->subAccountId) {
1085 free(p_struct->subAccountId);
1086 p_struct->subAccountId=NULL;
1087 }
1088 {
1089 const char *s;
1090 s=GWEN_XMLNode_GetCharValue(p_db, "subAccountId", NULL);
1091 if (s)
1092 p_struct->subAccountId=strdup(s);
1093 }
1094 if (p_struct->subAccountId==NULL) { /* preset member "subAccountId" if empty */
1095 p_struct->subAccountId=NULL;
1096 }
1097
1098 /* member "userId" */
1099 p_struct->userId=GWEN_XMLNode_GetIntValue(p_db, "userId", 0);
1100
1101 /* member "provider" */
1102 /* member "provider" is volatile, just presetting */
1103 p_struct->provider=NULL;
1104
1105 }
1106
AB_Account_WriteXml(const AB_ACCOUNT * p_struct,GWEN_XMLNODE * p_db)1107 void AB_Account_WriteXml(const AB_ACCOUNT *p_struct, GWEN_XMLNODE *p_db)
1108 {
1109 assert(p_struct);
1110 /* member "accountType" */
1111 GWEN_XMLNode_SetIntValue(p_db, "accountType", p_struct->accountType);
1112
1113 /* member "uniqueId" */
1114 GWEN_XMLNode_SetIntValue(p_db, "uniqueId", p_struct->uniqueId);
1115
1116 /* member "backendName" */
1117 GWEN_XMLNode_SetCharValue(p_db, "backendName", p_struct->backendName);
1118
1119 /* member "ownerName" */
1120 GWEN_XMLNode_SetCharValue(p_db, "ownerName", p_struct->ownerName);
1121
1122 /* member "bankName" */
1123 GWEN_XMLNode_SetCharValue(p_db, "bankName", p_struct->bankName);
1124
1125 /* member "accountName" */
1126 GWEN_XMLNode_SetCharValue(p_db, "accountName", p_struct->accountName);
1127
1128 /* member "currency" */
1129 GWEN_XMLNode_SetCharValue(p_db, "currency", p_struct->currency);
1130
1131 /* member "memo" */
1132 GWEN_XMLNode_SetCharValue(p_db, "memo", p_struct->memo);
1133
1134 /* member "iban" */
1135 GWEN_XMLNode_SetCharValue(p_db, "iban", p_struct->iban);
1136
1137 /* member "bic" */
1138 GWEN_XMLNode_SetCharValue(p_db, "bic", p_struct->bic);
1139
1140 /* member "country" */
1141 GWEN_XMLNode_SetCharValue(p_db, "country", p_struct->country);
1142
1143 /* member "bankCode" */
1144 GWEN_XMLNode_SetCharValue(p_db, "bankCode", p_struct->bankCode);
1145
1146 /* member "branchId" */
1147 GWEN_XMLNode_SetCharValue(p_db, "branchId", p_struct->branchId);
1148
1149 /* member "accountNumber" */
1150 GWEN_XMLNode_SetCharValue(p_db, "accountNumber", p_struct->accountNumber);
1151
1152 /* member "subAccountId" */
1153 GWEN_XMLNode_SetCharValue(p_db, "subAccountId", p_struct->subAccountId);
1154
1155 /* member "userId" */
1156 GWEN_XMLNode_SetIntValue(p_db, "userId", p_struct->userId);
1157
1158 /* member "provider" is volatile, not writing to xml */
1159
1160 }
1161
AB_Account_toXml(const AB_ACCOUNT * p_struct,GWEN_XMLNODE * p_db)1162 void AB_Account_toXml(const AB_ACCOUNT *p_struct, GWEN_XMLNODE *p_db)
1163 {
1164 AB_Account_WriteXml(p_struct, p_db);
1165 }
1166
AB_Account_fromXml(GWEN_XMLNODE * p_db)1167 AB_ACCOUNT *AB_Account_fromXml(GWEN_XMLNODE *p_db)
1168 {
1169 AB_ACCOUNT *p_struct;
1170 p_struct=AB_Account_new();
1171 AB_Account_ReadXml(p_struct, p_db);
1172 return p_struct;
1173 }
1174
AB_Account_List_GetByUniqueId(const AB_ACCOUNT_LIST * p_list,uint32_t p_cmp)1175 AB_ACCOUNT *AB_Account_List_GetByUniqueId(const AB_ACCOUNT_LIST *p_list, uint32_t p_cmp)
1176 {
1177 AB_ACCOUNT *p_struct;
1178
1179 assert(p_list);
1180 p_struct = AB_Account_List_First(p_list);
1181 while (p_struct) {
1182 int p_rv;
1183
1184 if (p_struct->uniqueId==p_cmp)
1185 p_rv=0;
1186 else if (p_cmp<p_struct->uniqueId)
1187 p_rv=-1;
1188 else
1189 p_rv=1;
1190 if (p_rv == 0)
1191 return p_struct;
1192 p_struct = AB_Account_List_Next(p_struct);
1193 }
1194 return NULL;
1195 }
1196
AB_Account_Matches(const AB_ACCOUNT * a,const char * backendName,const char * country,const char * bankId,const char * accountNumber,const char * subAccountId,const char * iban,const char * currency,int ty)1197 int AB_Account_Matches(const AB_ACCOUNT *a, const char *backendName, const char *country, const char *bankId,
1198 const char *accountNumber, const char *subAccountId, const char *iban, const char *currency, int ty)
1199 {
1200 const char *lbackendName;
1201 const char *lcountry;
1202 const char *lbankId;
1203 const char *laccountNumber;
1204 const char *lsubAccountId;
1205 const char *liban;
1206 const char *lcurrency;
1207 int lty;
1208 if (!backendName)
1209 backendName="*";
1210 if (!country)
1211 country="*";
1212 if (!bankId)
1213 bankId="*";
1214 if (!accountNumber)
1215 accountNumber="*";
1216 if (!subAccountId)
1217 subAccountId="*";
1218 if (!iban)
1219 iban="*";
1220 if (!currency)
1221 currency="*";
1222 if (ty>=AB_AccountType_Last)
1223 ty=AB_AccountType_Unknown;
1224 lbackendName=AB_Account_GetBackendName(a);
1225 lcountry=AB_Account_GetCountry(a);
1226 lbankId=AB_Account_GetBankCode(a);
1227 laccountNumber=AB_Account_GetAccountNumber(a);
1228 lsubAccountId=AB_Account_GetSubAccountId(a);
1229 liban=AB_Account_GetIban(a);
1230 lcurrency=AB_Account_GetCurrency(a);
1231 lty=AB_Account_GetAccountType(a);
1232 if (!lcountry)
1233 lcountry="";
1234 if (!lbankId)
1235 lbankId="";
1236 if (!laccountNumber)
1237 laccountNumber="";
1238 if (!lsubAccountId)
1239 lsubAccountId="";
1240 if (!liban)
1241 liban="";
1242 if (!lcurrency)
1243 lcurrency="";
1244 if (lty>=AB_AccountType_Last || lty <=AB_AccountType_Unknown)
1245 lty=AB_AccountType_Unknown;
1246 if ((-1!=GWEN_Text_ComparePattern(lbackendName, backendName, 0)) &&
1247 (-1!=GWEN_Text_ComparePattern(lcountry, country, 0)) && (-1!=GWEN_Text_ComparePattern(lbankId, bankId, 0)) &&
1248 (-1!=GWEN_Text_ComparePattern(laccountNumber, accountNumber, 0)) &&
1249 (-1!=GWEN_Text_ComparePattern(lsubAccountId, subAccountId, 0)) && (-1!=GWEN_Text_ComparePattern(liban, iban, 0)) &&
1250 (-1!=GWEN_Text_ComparePattern(lcurrency, currency, 0)) && ((ty==AB_AccountType_Unknown) || (ty==lty)))
1251 return 1;
1252 return 0;
1253 }
AB_Account_List__FindInternal(AB_ACCOUNT * a,const char * backendName,const char * country,const char * bankId,const char * accountNumber,const char * subAccountId,const char * iban,const char * currency,int ty)1254 AB_ACCOUNT *AB_Account_List__FindInternal(AB_ACCOUNT *a, const char *backendName, const char *country,
1255 const char *bankId, const char *accountNumber, const char *subAccountId, const char *iban, const char *currency,
1256 int ty)
1257 {
1258 if (!backendName)
1259 backendName="*";
1260 if (!country)
1261 country="*";
1262 if (!bankId)
1263 bankId="*";
1264 if (!accountNumber)
1265 accountNumber="*";
1266 if (!subAccountId)
1267 subAccountId="*";
1268 if (!iban)
1269 iban="*";
1270 if (!currency)
1271 currency="*";
1272 if (ty>=AB_AccountType_Last)
1273 ty=AB_AccountType_Unknown;
1274 while (a) {
1275 const char *lbackendName;
1276 lbackendName=AB_Account_GetBackendName(a);
1277 if (!(lbackendName && *lbackendName)) {
1278 DBG_ERROR(AQBANKING_LOGDOMAIN, "Account: %s/%s/%s: No backend, ignoring", AB_Account_GetCountry(a),
1279 AB_Account_GetBankCode(a), AB_Account_GetAccountNumber(a));
1280 }
1281 else {
1282 int rv;
1283 rv=AB_Account_Matches(a, backendName, country, bankId, accountNumber, subAccountId, iban, currency, ty);
1284 if (rv==1)
1285 break;
1286 }
1287 a=AB_Account_List_Next(a);
1288 } /* while */ return a;
1289 }
AB_Account_List_FindFirst(AB_ACCOUNT_LIST * al,const char * backendName,const char * country,const char * bankId,const char * accountNumber,const char * subAccountId,const char * iban,const char * currency,int ty)1290 AB_ACCOUNT *AB_Account_List_FindFirst(AB_ACCOUNT_LIST *al, const char *backendName, const char *country,
1291 const char *bankId, const char *accountNumber, const char *subAccountId, const char *iban, const char *currency,
1292 int ty)
1293 {
1294 AB_ACCOUNT *a;
1295 if (AB_Account_List_GetCount(al)==0) {
1296 DBG_INFO(AQBANKING_LOGDOMAIN, "No accounts");
1297 return NULL;
1298 }
1299 a=AB_Account_List_First(al);
1300 assert(a);
1301 return AB_Account_List__FindInternal(a, backendName, country, bankId, accountNumber, subAccountId, iban, currency, ty);
1302 }
AB_Account_List_FindNext(AB_ACCOUNT * a,const char * backendName,const char * country,const char * bankId,const char * accountNumber,const char * subAccountId,const char * iban,const char * currency,int ty)1303 AB_ACCOUNT *AB_Account_List_FindNext(AB_ACCOUNT *a, const char *backendName, const char *country, const char *bankId,
1304 const char *accountNumber, const char *subAccountId, const char *iban, const char *currency, int ty)
1305 {
1306 assert(a);
1307 a=AB_Account_List_Next(a);
1308 if (a==NULL) {
1309 DBG_INFO(AQBANKING_LOGDOMAIN, "No more account specs");
1310 return NULL;
1311 }
1312 return AB_Account_List__FindInternal(a, backendName, country, bankId, accountNumber, subAccountId, iban, currency, ty);
1313 }
AB_Account__ReadFromDb(AB_ACCOUNT * a,GWEN_DB_NODE * db)1314 int AB_Account__ReadFromDb(AB_ACCOUNT *a, GWEN_DB_NODE *db)
1315 {
1316 assert(a);
1317 AB_Account_ReadDb(a, db);
1318 return 0;
1319 }
AB_Account__WriteToDb(const AB_ACCOUNT * a,GWEN_DB_NODE * db)1320 int AB_Account__WriteToDb(const AB_ACCOUNT *a, GWEN_DB_NODE *db)
1321 {
1322 assert(a);
1323 AB_Account_WriteDb(a, db);
1324 return 0;
1325 }
1326
1327 /* code headers */
1328
1329