1 /**********************************************************
2  * This file has been automatically created by "typemaker2"
3  * from the file "tanmethod.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 "./tanmethod_p.h"
13 
14 #include <gwenhywfar/misc.h>
15 #include <gwenhywfar/debug.h>
16 
17 /* code headers */
18 #include <string.h>
19 
20 /* macro functions */
GWEN_LIST_FUNCTIONS(AQFINTS_TANMETHOD,AQFINTS_TanMethod)21 GWEN_LIST_FUNCTIONS(AQFINTS_TANMETHOD, AQFINTS_TanMethod)
22 
23 
24 AQFINTS_TANMETHOD *AQFINTS_TanMethod_new(void)
25 {
26   AQFINTS_TANMETHOD *p_struct;
27 
28   GWEN_NEW_OBJECT(AQFINTS_TANMETHOD, p_struct)
29   p_struct->_refCount=1;
30   GWEN_LIST_INIT(AQFINTS_TANMETHOD, p_struct)
31   /* members */
32   p_struct->flags=0;
33   p_struct->function=0;
34   p_struct->process=0;
35   p_struct->methodId=NULL;
36   p_struct->zkaTanName=NULL;
37   p_struct->zkaTanVersion=NULL;
38   p_struct->methodName=NULL;
39   p_struct->tanMaxLen=0;
40   p_struct->formatId=0;
41   p_struct->prompt=NULL;
42   p_struct->returnMaxLen=0;
43   p_struct->maxActiveLists=0;
44   p_struct->timeShiftAllowed=0;
45   p_struct->tanListMode=0;
46   p_struct->needSmsAccount=0;
47   p_struct->needLocalAccount=0;
48   p_struct->initMode=NULL;
49   p_struct->needTanMediumId=0;
50   p_struct->maxActiveTanMedia=0;
51   p_struct->runtimeFlags=0;
52   /* virtual functions */
53 
54   return p_struct;
55 }
56 
AQFINTS_TanMethod_free(AQFINTS_TANMETHOD * p_struct)57 void AQFINTS_TanMethod_free(AQFINTS_TANMETHOD *p_struct)
58 {
59   if (p_struct) {
60     assert(p_struct->_refCount);
61     if (p_struct->_refCount==1) {
62       GWEN_LIST_FINI(AQFINTS_TANMETHOD, p_struct)
63       /* members */
64       free(p_struct->methodId);
65       p_struct->methodId=NULL;
66       free(p_struct->zkaTanName);
67       p_struct->zkaTanName=NULL;
68       free(p_struct->zkaTanVersion);
69       p_struct->zkaTanVersion=NULL;
70       free(p_struct->methodName);
71       p_struct->methodName=NULL;
72       free(p_struct->prompt);
73       p_struct->prompt=NULL;
74       free(p_struct->initMode);
75       p_struct->initMode=NULL;
76       p_struct->_refCount=0;
77       GWEN_FREE_OBJECT(p_struct);
78     }
79     else
80       p_struct->_refCount--;
81   }
82 }
83 
AQFINTS_TanMethod_Attach(AQFINTS_TANMETHOD * p_struct)84 void AQFINTS_TanMethod_Attach(AQFINTS_TANMETHOD *p_struct)
85 {
86   assert(p_struct);
87   assert(p_struct->_refCount);
88   p_struct->_refCount++;
89 }
90 
AQFINTS_TanMethod_dup(const AQFINTS_TANMETHOD * p_src)91 AQFINTS_TANMETHOD *AQFINTS_TanMethod_dup(const AQFINTS_TANMETHOD *p_src)
92 {
93   AQFINTS_TANMETHOD *p_struct;
94 
95   assert(p_src);
96   p_struct=AQFINTS_TanMethod_new();
97   /* member "flags" */
98   p_struct->flags=p_src->flags;
99 
100   /* member "function" */
101   p_struct->function=p_src->function;
102 
103   /* member "process" */
104   p_struct->process=p_src->process;
105 
106   /* member "methodId" */
107   if (p_struct->methodId) {
108     free(p_struct->methodId);
109     p_struct->methodId=NULL;
110     p_struct->methodId=NULL;
111   }
112   if (p_src->methodId) {
113     p_struct->methodId=strdup(p_src->methodId);
114   }
115 
116   /* member "zkaTanName" */
117   if (p_struct->zkaTanName) {
118     free(p_struct->zkaTanName);
119     p_struct->zkaTanName=NULL;
120     p_struct->zkaTanName=NULL;
121   }
122   if (p_src->zkaTanName) {
123     p_struct->zkaTanName=strdup(p_src->zkaTanName);
124   }
125 
126   /* member "zkaTanVersion" */
127   if (p_struct->zkaTanVersion) {
128     free(p_struct->zkaTanVersion);
129     p_struct->zkaTanVersion=NULL;
130     p_struct->zkaTanVersion=NULL;
131   }
132   if (p_src->zkaTanVersion) {
133     p_struct->zkaTanVersion=strdup(p_src->zkaTanVersion);
134   }
135 
136   /* member "methodName" */
137   if (p_struct->methodName) {
138     free(p_struct->methodName);
139     p_struct->methodName=NULL;
140     p_struct->methodName=NULL;
141   }
142   if (p_src->methodName) {
143     p_struct->methodName=strdup(p_src->methodName);
144   }
145 
146   /* member "tanMaxLen" */
147   p_struct->tanMaxLen=p_src->tanMaxLen;
148 
149   /* member "formatId" */
150   p_struct->formatId=p_src->formatId;
151 
152   /* member "prompt" */
153   if (p_struct->prompt) {
154     free(p_struct->prompt);
155     p_struct->prompt=NULL;
156     p_struct->prompt=NULL;
157   }
158   if (p_src->prompt) {
159     p_struct->prompt=strdup(p_src->prompt);
160   }
161 
162   /* member "returnMaxLen" */
163   p_struct->returnMaxLen=p_src->returnMaxLen;
164 
165   /* member "maxActiveLists" */
166   p_struct->maxActiveLists=p_src->maxActiveLists;
167 
168   /* member "timeShiftAllowed" */
169   p_struct->timeShiftAllowed=p_src->timeShiftAllowed;
170 
171   /* member "tanListMode" */
172   p_struct->tanListMode=p_src->tanListMode;
173 
174   /* member "needSmsAccount" */
175   p_struct->needSmsAccount=p_src->needSmsAccount;
176 
177   /* member "needLocalAccount" */
178   p_struct->needLocalAccount=p_src->needLocalAccount;
179 
180   /* member "initMode" */
181   if (p_struct->initMode) {
182     free(p_struct->initMode);
183     p_struct->initMode=NULL;
184     p_struct->initMode=NULL;
185   }
186   if (p_src->initMode) {
187     p_struct->initMode=strdup(p_src->initMode);
188   }
189 
190   /* member "needTanMediumId" */
191   p_struct->needTanMediumId=p_src->needTanMediumId;
192 
193   /* member "maxActiveTanMedia" */
194   p_struct->maxActiveTanMedia=p_src->maxActiveTanMedia;
195 
196   /* member "runtimeFlags" */
197   p_struct->runtimeFlags=p_src->runtimeFlags;
198 
199   return p_struct;
200 }
201 
AQFINTS_TanMethod_copy(AQFINTS_TANMETHOD * p_struct,const AQFINTS_TANMETHOD * p_src)202 AQFINTS_TANMETHOD *AQFINTS_TanMethod_copy(AQFINTS_TANMETHOD *p_struct, const AQFINTS_TANMETHOD *p_src)
203 {
204   assert(p_struct);
205   assert(p_src);
206   /* member "flags" */
207   p_struct->flags=p_src->flags;
208 
209   /* member "function" */
210   p_struct->function=p_src->function;
211 
212   /* member "process" */
213   p_struct->process=p_src->process;
214 
215   /* member "methodId" */
216   if (p_struct->methodId) {
217     free(p_struct->methodId);
218     p_struct->methodId=NULL;
219     p_struct->methodId=NULL;
220   }
221   if (p_src->methodId) {
222     p_struct->methodId=strdup(p_src->methodId);
223   }
224 
225   /* member "zkaTanName" */
226   if (p_struct->zkaTanName) {
227     free(p_struct->zkaTanName);
228     p_struct->zkaTanName=NULL;
229     p_struct->zkaTanName=NULL;
230   }
231   if (p_src->zkaTanName) {
232     p_struct->zkaTanName=strdup(p_src->zkaTanName);
233   }
234 
235   /* member "zkaTanVersion" */
236   if (p_struct->zkaTanVersion) {
237     free(p_struct->zkaTanVersion);
238     p_struct->zkaTanVersion=NULL;
239     p_struct->zkaTanVersion=NULL;
240   }
241   if (p_src->zkaTanVersion) {
242     p_struct->zkaTanVersion=strdup(p_src->zkaTanVersion);
243   }
244 
245   /* member "methodName" */
246   if (p_struct->methodName) {
247     free(p_struct->methodName);
248     p_struct->methodName=NULL;
249     p_struct->methodName=NULL;
250   }
251   if (p_src->methodName) {
252     p_struct->methodName=strdup(p_src->methodName);
253   }
254 
255   /* member "tanMaxLen" */
256   p_struct->tanMaxLen=p_src->tanMaxLen;
257 
258   /* member "formatId" */
259   p_struct->formatId=p_src->formatId;
260 
261   /* member "prompt" */
262   if (p_struct->prompt) {
263     free(p_struct->prompt);
264     p_struct->prompt=NULL;
265     p_struct->prompt=NULL;
266   }
267   if (p_src->prompt) {
268     p_struct->prompt=strdup(p_src->prompt);
269   }
270 
271   /* member "returnMaxLen" */
272   p_struct->returnMaxLen=p_src->returnMaxLen;
273 
274   /* member "maxActiveLists" */
275   p_struct->maxActiveLists=p_src->maxActiveLists;
276 
277   /* member "timeShiftAllowed" */
278   p_struct->timeShiftAllowed=p_src->timeShiftAllowed;
279 
280   /* member "tanListMode" */
281   p_struct->tanListMode=p_src->tanListMode;
282 
283   /* member "needSmsAccount" */
284   p_struct->needSmsAccount=p_src->needSmsAccount;
285 
286   /* member "needLocalAccount" */
287   p_struct->needLocalAccount=p_src->needLocalAccount;
288 
289   /* member "initMode" */
290   if (p_struct->initMode) {
291     free(p_struct->initMode);
292     p_struct->initMode=NULL;
293     p_struct->initMode=NULL;
294   }
295   if (p_src->initMode) {
296     p_struct->initMode=strdup(p_src->initMode);
297   }
298 
299   /* member "needTanMediumId" */
300   p_struct->needTanMediumId=p_src->needTanMediumId;
301 
302   /* member "maxActiveTanMedia" */
303   p_struct->maxActiveTanMedia=p_src->maxActiveTanMedia;
304 
305   /* member "runtimeFlags" */
306   p_struct->runtimeFlags=p_src->runtimeFlags;
307 
308   return p_struct;
309 }
310 
AQFINTS_TanMethod_GetFlags(const AQFINTS_TANMETHOD * p_struct)311 uint32_t AQFINTS_TanMethod_GetFlags(const AQFINTS_TANMETHOD *p_struct)
312 {
313   assert(p_struct);
314   return p_struct->flags;
315 }
316 
AQFINTS_TanMethod_GetFunction(const AQFINTS_TANMETHOD * p_struct)317 int AQFINTS_TanMethod_GetFunction(const AQFINTS_TANMETHOD *p_struct)
318 {
319   assert(p_struct);
320   return p_struct->function;
321 }
322 
AQFINTS_TanMethod_GetProcess(const AQFINTS_TANMETHOD * p_struct)323 int AQFINTS_TanMethod_GetProcess(const AQFINTS_TANMETHOD *p_struct)
324 {
325   assert(p_struct);
326   return p_struct->process;
327 }
328 
AQFINTS_TanMethod_GetMethodId(const AQFINTS_TANMETHOD * p_struct)329 const char *AQFINTS_TanMethod_GetMethodId(const AQFINTS_TANMETHOD *p_struct)
330 {
331   assert(p_struct);
332   return p_struct->methodId;
333 }
334 
AQFINTS_TanMethod_GetZkaTanName(const AQFINTS_TANMETHOD * p_struct)335 const char *AQFINTS_TanMethod_GetZkaTanName(const AQFINTS_TANMETHOD *p_struct)
336 {
337   assert(p_struct);
338   return p_struct->zkaTanName;
339 }
340 
AQFINTS_TanMethod_GetZkaTanVersion(const AQFINTS_TANMETHOD * p_struct)341 const char *AQFINTS_TanMethod_GetZkaTanVersion(const AQFINTS_TANMETHOD *p_struct)
342 {
343   assert(p_struct);
344   return p_struct->zkaTanVersion;
345 }
346 
AQFINTS_TanMethod_GetMethodName(const AQFINTS_TANMETHOD * p_struct)347 const char *AQFINTS_TanMethod_GetMethodName(const AQFINTS_TANMETHOD *p_struct)
348 {
349   assert(p_struct);
350   return p_struct->methodName;
351 }
352 
AQFINTS_TanMethod_GetTanMaxLen(const AQFINTS_TANMETHOD * p_struct)353 int AQFINTS_TanMethod_GetTanMaxLen(const AQFINTS_TANMETHOD *p_struct)
354 {
355   assert(p_struct);
356   return p_struct->tanMaxLen;
357 }
358 
AQFINTS_TanMethod_GetFormatId(const AQFINTS_TANMETHOD * p_struct)359 int AQFINTS_TanMethod_GetFormatId(const AQFINTS_TANMETHOD *p_struct)
360 {
361   assert(p_struct);
362   return p_struct->formatId;
363 }
364 
AQFINTS_TanMethod_GetPrompt(const AQFINTS_TANMETHOD * p_struct)365 const char *AQFINTS_TanMethod_GetPrompt(const AQFINTS_TANMETHOD *p_struct)
366 {
367   assert(p_struct);
368   return p_struct->prompt;
369 }
370 
AQFINTS_TanMethod_GetReturnMaxLen(const AQFINTS_TANMETHOD * p_struct)371 int AQFINTS_TanMethod_GetReturnMaxLen(const AQFINTS_TANMETHOD *p_struct)
372 {
373   assert(p_struct);
374   return p_struct->returnMaxLen;
375 }
376 
AQFINTS_TanMethod_GetMaxActiveLists(const AQFINTS_TANMETHOD * p_struct)377 int AQFINTS_TanMethod_GetMaxActiveLists(const AQFINTS_TANMETHOD *p_struct)
378 {
379   assert(p_struct);
380   return p_struct->maxActiveLists;
381 }
382 
AQFINTS_TanMethod_GetTimeShiftAllowed(const AQFINTS_TANMETHOD * p_struct)383 int AQFINTS_TanMethod_GetTimeShiftAllowed(const AQFINTS_TANMETHOD *p_struct)
384 {
385   assert(p_struct);
386   return p_struct->timeShiftAllowed;
387 }
388 
AQFINTS_TanMethod_GetTanListMode(const AQFINTS_TANMETHOD * p_struct)389 int AQFINTS_TanMethod_GetTanListMode(const AQFINTS_TANMETHOD *p_struct)
390 {
391   assert(p_struct);
392   return p_struct->tanListMode;
393 }
394 
AQFINTS_TanMethod_GetNeedSmsAccount(const AQFINTS_TANMETHOD * p_struct)395 int AQFINTS_TanMethod_GetNeedSmsAccount(const AQFINTS_TANMETHOD *p_struct)
396 {
397   assert(p_struct);
398   return p_struct->needSmsAccount;
399 }
400 
AQFINTS_TanMethod_GetNeedLocalAccount(const AQFINTS_TANMETHOD * p_struct)401 int AQFINTS_TanMethod_GetNeedLocalAccount(const AQFINTS_TANMETHOD *p_struct)
402 {
403   assert(p_struct);
404   return p_struct->needLocalAccount;
405 }
406 
AQFINTS_TanMethod_GetInitMode(const AQFINTS_TANMETHOD * p_struct)407 const char *AQFINTS_TanMethod_GetInitMode(const AQFINTS_TANMETHOD *p_struct)
408 {
409   assert(p_struct);
410   return p_struct->initMode;
411 }
412 
AQFINTS_TanMethod_GetNeedTanMediumId(const AQFINTS_TANMETHOD * p_struct)413 int AQFINTS_TanMethod_GetNeedTanMediumId(const AQFINTS_TANMETHOD *p_struct)
414 {
415   assert(p_struct);
416   return p_struct->needTanMediumId;
417 }
418 
AQFINTS_TanMethod_GetMaxActiveTanMedia(const AQFINTS_TANMETHOD * p_struct)419 int AQFINTS_TanMethod_GetMaxActiveTanMedia(const AQFINTS_TANMETHOD *p_struct)
420 {
421   assert(p_struct);
422   return p_struct->maxActiveTanMedia;
423 }
424 
AQFINTS_TanMethod_GetRuntimeFlags(const AQFINTS_TANMETHOD * p_struct)425 uint32_t AQFINTS_TanMethod_GetRuntimeFlags(const AQFINTS_TANMETHOD *p_struct)
426 {
427   assert(p_struct);
428   return p_struct->runtimeFlags;
429 }
430 
AQFINTS_TanMethod_SetFlags(AQFINTS_TANMETHOD * p_struct,uint32_t p_src)431 void AQFINTS_TanMethod_SetFlags(AQFINTS_TANMETHOD *p_struct, uint32_t p_src)
432 {
433   assert(p_struct);
434   p_struct->flags=p_src;
435 }
436 
AQFINTS_TanMethod_AddFlags(AQFINTS_TANMETHOD * p_struct,uint32_t p_src)437 void AQFINTS_TanMethod_AddFlags(AQFINTS_TANMETHOD *p_struct, uint32_t p_src)
438 {
439   assert(p_struct);
440   p_struct->flags|=p_src;
441 }
442 
AQFINTS_TanMethod_SubFlags(AQFINTS_TANMETHOD * p_struct,uint32_t p_src)443 void AQFINTS_TanMethod_SubFlags(AQFINTS_TANMETHOD *p_struct, uint32_t p_src)
444 {
445   assert(p_struct);
446   p_struct->flags&=~p_src;
447 }
448 
AQFINTS_TanMethod_SetFunction(AQFINTS_TANMETHOD * p_struct,int p_src)449 void AQFINTS_TanMethod_SetFunction(AQFINTS_TANMETHOD *p_struct, int p_src)
450 {
451   assert(p_struct);
452   p_struct->function=p_src;
453 }
454 
AQFINTS_TanMethod_SetProcess(AQFINTS_TANMETHOD * p_struct,int p_src)455 void AQFINTS_TanMethod_SetProcess(AQFINTS_TANMETHOD *p_struct, int p_src)
456 {
457   assert(p_struct);
458   p_struct->process=p_src;
459 }
460 
AQFINTS_TanMethod_SetMethodId(AQFINTS_TANMETHOD * p_struct,const char * p_src)461 void AQFINTS_TanMethod_SetMethodId(AQFINTS_TANMETHOD *p_struct, const char *p_src)
462 {
463   assert(p_struct);
464   if (p_struct->methodId) {
465     free(p_struct->methodId);
466     p_struct->methodId=NULL;
467   }
468   if (p_src) {
469     p_struct->methodId=strdup(p_src);
470   }
471   else {
472     p_struct->methodId=NULL;
473   }
474 }
475 
AQFINTS_TanMethod_SetZkaTanName(AQFINTS_TANMETHOD * p_struct,const char * p_src)476 void AQFINTS_TanMethod_SetZkaTanName(AQFINTS_TANMETHOD *p_struct, const char *p_src)
477 {
478   assert(p_struct);
479   if (p_struct->zkaTanName) {
480     free(p_struct->zkaTanName);
481     p_struct->zkaTanName=NULL;
482   }
483   if (p_src) {
484     p_struct->zkaTanName=strdup(p_src);
485   }
486   else {
487     p_struct->zkaTanName=NULL;
488   }
489 }
490 
AQFINTS_TanMethod_SetZkaTanVersion(AQFINTS_TANMETHOD * p_struct,const char * p_src)491 void AQFINTS_TanMethod_SetZkaTanVersion(AQFINTS_TANMETHOD *p_struct, const char *p_src)
492 {
493   assert(p_struct);
494   if (p_struct->zkaTanVersion) {
495     free(p_struct->zkaTanVersion);
496     p_struct->zkaTanVersion=NULL;
497   }
498   if (p_src) {
499     p_struct->zkaTanVersion=strdup(p_src);
500   }
501   else {
502     p_struct->zkaTanVersion=NULL;
503   }
504 }
505 
AQFINTS_TanMethod_SetMethodName(AQFINTS_TANMETHOD * p_struct,const char * p_src)506 void AQFINTS_TanMethod_SetMethodName(AQFINTS_TANMETHOD *p_struct, const char *p_src)
507 {
508   assert(p_struct);
509   if (p_struct->methodName) {
510     free(p_struct->methodName);
511     p_struct->methodName=NULL;
512   }
513   if (p_src) {
514     p_struct->methodName=strdup(p_src);
515   }
516   else {
517     p_struct->methodName=NULL;
518   }
519 }
520 
AQFINTS_TanMethod_SetTanMaxLen(AQFINTS_TANMETHOD * p_struct,int p_src)521 void AQFINTS_TanMethod_SetTanMaxLen(AQFINTS_TANMETHOD *p_struct, int p_src)
522 {
523   assert(p_struct);
524   p_struct->tanMaxLen=p_src;
525 }
526 
AQFINTS_TanMethod_SetFormatId(AQFINTS_TANMETHOD * p_struct,int p_src)527 void AQFINTS_TanMethod_SetFormatId(AQFINTS_TANMETHOD *p_struct, int p_src)
528 {
529   assert(p_struct);
530   p_struct->formatId=p_src;
531 }
532 
AQFINTS_TanMethod_SetPrompt(AQFINTS_TANMETHOD * p_struct,const char * p_src)533 void AQFINTS_TanMethod_SetPrompt(AQFINTS_TANMETHOD *p_struct, const char *p_src)
534 {
535   assert(p_struct);
536   if (p_struct->prompt) {
537     free(p_struct->prompt);
538     p_struct->prompt=NULL;
539   }
540   if (p_src) {
541     p_struct->prompt=strdup(p_src);
542   }
543   else {
544     p_struct->prompt=NULL;
545   }
546 }
547 
AQFINTS_TanMethod_SetReturnMaxLen(AQFINTS_TANMETHOD * p_struct,int p_src)548 void AQFINTS_TanMethod_SetReturnMaxLen(AQFINTS_TANMETHOD *p_struct, int p_src)
549 {
550   assert(p_struct);
551   p_struct->returnMaxLen=p_src;
552 }
553 
AQFINTS_TanMethod_SetMaxActiveLists(AQFINTS_TANMETHOD * p_struct,int p_src)554 void AQFINTS_TanMethod_SetMaxActiveLists(AQFINTS_TANMETHOD *p_struct, int p_src)
555 {
556   assert(p_struct);
557   p_struct->maxActiveLists=p_src;
558 }
559 
AQFINTS_TanMethod_SetTimeShiftAllowed(AQFINTS_TANMETHOD * p_struct,int p_src)560 void AQFINTS_TanMethod_SetTimeShiftAllowed(AQFINTS_TANMETHOD *p_struct, int p_src)
561 {
562   assert(p_struct);
563   p_struct->timeShiftAllowed=p_src;
564 }
565 
AQFINTS_TanMethod_SetTanListMode(AQFINTS_TANMETHOD * p_struct,int p_src)566 void AQFINTS_TanMethod_SetTanListMode(AQFINTS_TANMETHOD *p_struct, int p_src)
567 {
568   assert(p_struct);
569   p_struct->tanListMode=p_src;
570 }
571 
AQFINTS_TanMethod_SetNeedSmsAccount(AQFINTS_TANMETHOD * p_struct,int p_src)572 void AQFINTS_TanMethod_SetNeedSmsAccount(AQFINTS_TANMETHOD *p_struct, int p_src)
573 {
574   assert(p_struct);
575   p_struct->needSmsAccount=p_src;
576 }
577 
AQFINTS_TanMethod_SetNeedLocalAccount(AQFINTS_TANMETHOD * p_struct,int p_src)578 void AQFINTS_TanMethod_SetNeedLocalAccount(AQFINTS_TANMETHOD *p_struct, int p_src)
579 {
580   assert(p_struct);
581   p_struct->needLocalAccount=p_src;
582 }
583 
AQFINTS_TanMethod_SetInitMode(AQFINTS_TANMETHOD * p_struct,const char * p_src)584 void AQFINTS_TanMethod_SetInitMode(AQFINTS_TANMETHOD *p_struct, const char *p_src)
585 {
586   assert(p_struct);
587   if (p_struct->initMode) {
588     free(p_struct->initMode);
589     p_struct->initMode=NULL;
590   }
591   if (p_src) {
592     p_struct->initMode=strdup(p_src);
593   }
594   else {
595     p_struct->initMode=NULL;
596   }
597 }
598 
AQFINTS_TanMethod_SetNeedTanMediumId(AQFINTS_TANMETHOD * p_struct,int p_src)599 void AQFINTS_TanMethod_SetNeedTanMediumId(AQFINTS_TANMETHOD *p_struct, int p_src)
600 {
601   assert(p_struct);
602   p_struct->needTanMediumId=p_src;
603 }
604 
AQFINTS_TanMethod_SetMaxActiveTanMedia(AQFINTS_TANMETHOD * p_struct,int p_src)605 void AQFINTS_TanMethod_SetMaxActiveTanMedia(AQFINTS_TANMETHOD *p_struct, int p_src)
606 {
607   assert(p_struct);
608   p_struct->maxActiveTanMedia=p_src;
609 }
610 
AQFINTS_TanMethod_SetRuntimeFlags(AQFINTS_TANMETHOD * p_struct,uint32_t p_src)611 void AQFINTS_TanMethod_SetRuntimeFlags(AQFINTS_TANMETHOD *p_struct, uint32_t p_src)
612 {
613   assert(p_struct);
614   p_struct->runtimeFlags=p_src;
615 }
616 
AQFINTS_TanMethod_AddRuntimeFlags(AQFINTS_TANMETHOD * p_struct,uint32_t p_src)617 void AQFINTS_TanMethod_AddRuntimeFlags(AQFINTS_TANMETHOD *p_struct, uint32_t p_src)
618 {
619   assert(p_struct);
620   p_struct->runtimeFlags|=p_src;
621 }
622 
AQFINTS_TanMethod_SubRuntimeFlags(AQFINTS_TANMETHOD * p_struct,uint32_t p_src)623 void AQFINTS_TanMethod_SubRuntimeFlags(AQFINTS_TANMETHOD *p_struct, uint32_t p_src)
624 {
625   assert(p_struct);
626   p_struct->runtimeFlags&=~p_src;
627 }
628 
629 /* list1 functions */
AQFINTS_TanMethod_List_dup(const AQFINTS_TANMETHOD_LIST * p_src)630 AQFINTS_TANMETHOD_LIST *AQFINTS_TanMethod_List_dup(const AQFINTS_TANMETHOD_LIST *p_src)
631 {
632   AQFINTS_TANMETHOD_LIST *p_dest;
633   AQFINTS_TANMETHOD *p_elem;
634 
635   assert(p_src);
636   p_dest=AQFINTS_TanMethod_List_new();
637   p_elem=AQFINTS_TanMethod_List_First(p_src);
638   while (p_elem) {
639     AQFINTS_TANMETHOD *p_cpy;
640 
641     p_cpy=AQFINTS_TanMethod_dup(p_elem);
642     AQFINTS_TanMethod_List_Add(p_cpy, p_dest);
643     p_elem=AQFINTS_TanMethod_List_Next(p_elem);
644   }
645 
646   return p_dest;
647 }
648 
AQFINTS_TanMethod_ReadDb(AQFINTS_TANMETHOD * p_struct,GWEN_DB_NODE * p_db)649 void AQFINTS_TanMethod_ReadDb(AQFINTS_TANMETHOD *p_struct, GWEN_DB_NODE *p_db)
650 {
651   assert(p_struct);
652   /* member "flags" */
653   p_struct->flags=GWEN_DB_GetIntValue(p_db, "flags", 0, 0);
654 
655   /* member "function" */
656   p_struct->function=GWEN_DB_GetIntValue(p_db, "function", 0, 0);
657 
658   /* member "process" */
659   p_struct->process=GWEN_DB_GetIntValue(p_db, "process", 0, 0);
660 
661   /* member "methodId" */
662   if (p_struct->methodId) {
663     free(p_struct->methodId);
664     p_struct->methodId=NULL;
665   }
666   {
667     const char *s;
668     s=GWEN_DB_GetCharValue(p_db, "methodId", 0, NULL);
669     if (s)
670       p_struct->methodId=strdup(s);
671   }
672   if (p_struct->methodId==NULL) {
673     p_struct->methodId=NULL;
674   }
675 
676   /* member "zkaTanName" */
677   if (p_struct->zkaTanName) {
678     free(p_struct->zkaTanName);
679     p_struct->zkaTanName=NULL;
680   }
681   {
682     const char *s;
683     s=GWEN_DB_GetCharValue(p_db, "zkaTanName", 0, NULL);
684     if (s)
685       p_struct->zkaTanName=strdup(s);
686   }
687   if (p_struct->zkaTanName==NULL) {
688     p_struct->zkaTanName=NULL;
689   }
690 
691   /* member "zkaTanVersion" */
692   if (p_struct->zkaTanVersion) {
693     free(p_struct->zkaTanVersion);
694     p_struct->zkaTanVersion=NULL;
695   }
696   {
697     const char *s;
698     s=GWEN_DB_GetCharValue(p_db, "zkaTanVersion", 0, NULL);
699     if (s)
700       p_struct->zkaTanVersion=strdup(s);
701   }
702   if (p_struct->zkaTanVersion==NULL) {
703     p_struct->zkaTanVersion=NULL;
704   }
705 
706   /* member "methodName" */
707   if (p_struct->methodName) {
708     free(p_struct->methodName);
709     p_struct->methodName=NULL;
710   }
711   {
712     const char *s;
713     s=GWEN_DB_GetCharValue(p_db, "methodName", 0, NULL);
714     if (s)
715       p_struct->methodName=strdup(s);
716   }
717   if (p_struct->methodName==NULL) {
718     p_struct->methodName=NULL;
719   }
720 
721   /* member "tanMaxLen" */
722   p_struct->tanMaxLen=GWEN_DB_GetIntValue(p_db, "tanMaxLen", 0, 0);
723 
724   /* member "formatId" */
725   p_struct->formatId=GWEN_DB_GetIntValue(p_db, "formatId", 0, 0);
726 
727   /* member "prompt" */
728   if (p_struct->prompt) {
729     free(p_struct->prompt);
730     p_struct->prompt=NULL;
731   }
732   {
733     const char *s;
734     s=GWEN_DB_GetCharValue(p_db, "prompt", 0, NULL);
735     if (s)
736       p_struct->prompt=strdup(s);
737   }
738   if (p_struct->prompt==NULL) {
739     p_struct->prompt=NULL;
740   }
741 
742   /* member "returnMaxLen" */
743   p_struct->returnMaxLen=GWEN_DB_GetIntValue(p_db, "returnMaxLen", 0, 0);
744 
745   /* member "maxActiveLists" */
746   p_struct->maxActiveLists=GWEN_DB_GetIntValue(p_db, "maxActiveLists", 0, 0);
747 
748   /* member "timeShiftAllowed" */
749   p_struct->timeShiftAllowed=GWEN_DB_GetIntValue(p_db, "timeShiftAllowed", 0, 0);
750 
751   /* member "tanListMode" */
752   p_struct->tanListMode=GWEN_DB_GetIntValue(p_db, "tanListMode", 0, 0);
753 
754   /* member "needSmsAccount" */
755   p_struct->needSmsAccount=GWEN_DB_GetIntValue(p_db, "needSmsAccount", 0, 0);
756 
757   /* member "needLocalAccount" */
758   p_struct->needLocalAccount=GWEN_DB_GetIntValue(p_db, "needLocalAccount", 0, 0);
759 
760   /* member "initMode" */
761   if (p_struct->initMode) {
762     free(p_struct->initMode);
763     p_struct->initMode=NULL;
764   }
765   {
766     const char *s;
767     s=GWEN_DB_GetCharValue(p_db, "initMode", 0, NULL);
768     if (s)
769       p_struct->initMode=strdup(s);
770   }
771   if (p_struct->initMode==NULL) {
772     p_struct->initMode=NULL;
773   }
774 
775   /* member "needTanMediumId" */
776   p_struct->needTanMediumId=GWEN_DB_GetIntValue(p_db, "needTanMediumId", 0, 0);
777 
778   /* member "maxActiveTanMedia" */
779   p_struct->maxActiveTanMedia=GWEN_DB_GetIntValue(p_db, "maxActiveTanMedia", 0, 0);
780 
781   /* member "runtimeFlags" */
782   /* member "runtimeFlags" is volatile, just presetting */
783   p_struct->runtimeFlags=0;
784 
785 }
786 
AQFINTS_TanMethod_WriteDb(const AQFINTS_TANMETHOD * p_struct,GWEN_DB_NODE * p_db)787 int AQFINTS_TanMethod_WriteDb(const AQFINTS_TANMETHOD *p_struct, GWEN_DB_NODE *p_db)
788 {
789   int p_rv;
790 
791   assert(p_struct);
792   /* member "flags" */
793   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "flags", p_struct->flags);
794   if (p_rv<0) {
795     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
796     return p_rv;
797   }
798 
799   /* member "function" */
800   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "function", p_struct->function);
801   if (p_rv<0) {
802     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
803     return p_rv;
804   }
805 
806   /* member "process" */
807   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "process", p_struct->process);
808   if (p_rv<0) {
809     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
810     return p_rv;
811   }
812 
813   /* member "methodId" */
814   if (p_struct->methodId)
815     p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "methodId", p_struct->methodId);
816   else {
817     GWEN_DB_DeleteVar(p_db, "methodId");
818     p_rv=0;
819   }
820   if (p_rv<0) {
821     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
822     return p_rv;
823   }
824 
825   /* member "zkaTanName" */
826   if (p_struct->zkaTanName)
827     p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "zkaTanName", p_struct->zkaTanName);
828   else {
829     GWEN_DB_DeleteVar(p_db, "zkaTanName");
830     p_rv=0;
831   }
832   if (p_rv<0) {
833     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
834     return p_rv;
835   }
836 
837   /* member "zkaTanVersion" */
838   if (p_struct->zkaTanVersion)
839     p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "zkaTanVersion", p_struct->zkaTanVersion);
840   else {
841     GWEN_DB_DeleteVar(p_db, "zkaTanVersion");
842     p_rv=0;
843   }
844   if (p_rv<0) {
845     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
846     return p_rv;
847   }
848 
849   /* member "methodName" */
850   if (p_struct->methodName)
851     p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "methodName", p_struct->methodName);
852   else {
853     GWEN_DB_DeleteVar(p_db, "methodName");
854     p_rv=0;
855   }
856   if (p_rv<0) {
857     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
858     return p_rv;
859   }
860 
861   /* member "tanMaxLen" */
862   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "tanMaxLen", p_struct->tanMaxLen);
863   if (p_rv<0) {
864     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
865     return p_rv;
866   }
867 
868   /* member "formatId" */
869   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "formatId", p_struct->formatId);
870   if (p_rv<0) {
871     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
872     return p_rv;
873   }
874 
875   /* member "prompt" */
876   if (p_struct->prompt)
877     p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "prompt", p_struct->prompt);
878   else {
879     GWEN_DB_DeleteVar(p_db, "prompt");
880     p_rv=0;
881   }
882   if (p_rv<0) {
883     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
884     return p_rv;
885   }
886 
887   /* member "returnMaxLen" */
888   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "returnMaxLen", p_struct->returnMaxLen);
889   if (p_rv<0) {
890     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
891     return p_rv;
892   }
893 
894   /* member "maxActiveLists" */
895   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxActiveLists", p_struct->maxActiveLists);
896   if (p_rv<0) {
897     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
898     return p_rv;
899   }
900 
901   /* member "timeShiftAllowed" */
902   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "timeShiftAllowed", p_struct->timeShiftAllowed);
903   if (p_rv<0) {
904     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
905     return p_rv;
906   }
907 
908   /* member "tanListMode" */
909   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "tanListMode", p_struct->tanListMode);
910   if (p_rv<0) {
911     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
912     return p_rv;
913   }
914 
915   /* member "needSmsAccount" */
916   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needSmsAccount", p_struct->needSmsAccount);
917   if (p_rv<0) {
918     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
919     return p_rv;
920   }
921 
922   /* member "needLocalAccount" */
923   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needLocalAccount", p_struct->needLocalAccount);
924   if (p_rv<0) {
925     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
926     return p_rv;
927   }
928 
929   /* member "initMode" */
930   if (p_struct->initMode)
931     p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "initMode", p_struct->initMode);
932   else {
933     GWEN_DB_DeleteVar(p_db, "initMode");
934     p_rv=0;
935   }
936   if (p_rv<0) {
937     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
938     return p_rv;
939   }
940 
941   /* member "needTanMediumId" */
942   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needTanMediumId", p_struct->needTanMediumId);
943   if (p_rv<0) {
944     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
945     return p_rv;
946   }
947 
948   /* member "maxActiveTanMedia" */
949   p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxActiveTanMedia", p_struct->maxActiveTanMedia);
950   if (p_rv<0) {
951     DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
952     return p_rv;
953   }
954 
955   /* member "runtimeFlags" is volatile, not writing to db */
956 
957   return 0;
958 }
959 
AQFINTS_TanMethod_fromDb(GWEN_DB_NODE * p_db)960 AQFINTS_TANMETHOD *AQFINTS_TanMethod_fromDb(GWEN_DB_NODE *p_db)
961 {
962   AQFINTS_TANMETHOD *p_struct;
963   p_struct=AQFINTS_TanMethod_new();
964   AQFINTS_TanMethod_ReadDb(p_struct, p_db);
965   return p_struct;
966 }
967 
AQFINTS_TanMethod_toDb(const AQFINTS_TANMETHOD * p_struct,GWEN_DB_NODE * p_db)968 int AQFINTS_TanMethod_toDb(const AQFINTS_TANMETHOD *p_struct, GWEN_DB_NODE *p_db)
969 {
970   return AQFINTS_TanMethod_WriteDb(p_struct, p_db);
971 }
972 
AQFINTS_TanMethod_List_GetByFunction(const AQFINTS_TANMETHOD_LIST * p_list,int p_cmp)973 AQFINTS_TANMETHOD *AQFINTS_TanMethod_List_GetByFunction(const AQFINTS_TANMETHOD_LIST *p_list, int p_cmp)
974 {
975   AQFINTS_TANMETHOD *p_struct;
976 
977   assert(p_list);
978   p_struct = AQFINTS_TanMethod_List_First(p_list);
979   while (p_struct) {
980     int p_rv;
981 
982     if (p_struct->function==p_cmp)
983       p_rv=0;
984     else if (p_cmp<p_struct->function)
985       p_rv=-1;
986     else
987       p_rv=1;
988     if (p_rv == 0)
989       return p_struct;
990     p_struct = AQFINTS_TanMethod_List_Next(p_struct);
991   }
992   return NULL;
993 }
994 
995 
996 /* code headers */
997 
998