1 /* This file is auto-generated from "tanmethod.xml" by the typemaker
2    tool of Gwenhywfar.
3    Do not edit this file -- all changes will be lost! */
4 #ifdef HAVE_CONFIG_H
5 # include "config.h"
6 #endif
7 
8 #include "tanmethod_p.h"
9 #include <gwenhywfar/misc.h>
10 #include <gwenhywfar/db.h>
11 #include <gwenhywfar/debug.h>
12 #include <assert.h>
13 #include <stdlib.h>
14 #include <strings.h>
15 
16 GWEN_INHERIT_FUNCTIONS(AH_TAN_METHOD)
GWEN_LIST_FUNCTIONS(AH_TAN_METHOD,AH_TanMethod)17 GWEN_LIST_FUNCTIONS(AH_TAN_METHOD, AH_TanMethod)
18 GWEN_LIST2_FUNCTIONS(AH_TAN_METHOD, AH_TanMethod)
19 
20 
21 
22 
23 AH_TAN_METHOD *AH_TanMethod_new()
24 {
25   AH_TAN_METHOD *st;
26 
27   GWEN_NEW_OBJECT(AH_TAN_METHOD, st)
28   st->_usage=1;
29   GWEN_INHERIT_INIT(AH_TAN_METHOD, st)
30   GWEN_LIST_INIT(AH_TAN_METHOD, st)
31   return st;
32 }
33 
34 
AH_TanMethod_free(AH_TAN_METHOD * st)35 void AH_TanMethod_free(AH_TAN_METHOD *st)
36 {
37   if (st) {
38     assert(st->_usage);
39     if (--(st->_usage)==0) {
40       GWEN_INHERIT_FINI(AH_TAN_METHOD, st)
41       if (st->methodId)
42         free(st->methodId);
43       if (st->methodName)
44         free(st->methodName);
45       if (st->zkaTanName)
46         free(st->zkaTanName);
47       if (st->zkaTanVersion)
48         free(st->zkaTanVersion);
49       if (st->formatId)
50         free(st->formatId);
51       if (st->prompt)
52         free(st->prompt);
53       GWEN_LIST_FINI(AH_TAN_METHOD, st)
54       GWEN_FREE_OBJECT(st);
55     }
56   }
57 
58 }
59 
60 
AH_TanMethod_dup(const AH_TAN_METHOD * d)61 AH_TAN_METHOD *AH_TanMethod_dup(const AH_TAN_METHOD *d)
62 {
63   AH_TAN_METHOD *st;
64 
65   assert(d);
66   st=AH_TanMethod_new();
67   st->function=d->function;
68   st->process=d->process;
69   if (d->methodId)
70     st->methodId=strdup(d->methodId);
71   if (d->methodName)
72     st->methodName=strdup(d->methodName);
73   if (d->zkaTanName)
74     st->zkaTanName=strdup(d->zkaTanName);
75   if (d->zkaTanVersion)
76     st->zkaTanVersion=strdup(d->zkaTanVersion);
77   st->tanMaxLen=d->tanMaxLen;
78   if (d->formatId)
79     st->formatId=strdup(d->formatId);
80   if (d->prompt)
81     st->prompt=strdup(d->prompt);
82   st->returnMaxLen=d->returnMaxLen;
83   st->maxActiveLists=d->maxActiveLists;
84   st->multiTanAllowed=d->multiTanAllowed;
85   st->timeShiftAllowed=d->timeShiftAllowed;
86   st->tanListMode=d->tanListMode;
87   st->stornoAllowed=d->stornoAllowed;
88   st->needSmsAccount=d->needSmsAccount;
89   st->needLocalAccount=d->needLocalAccount;
90   st->needChallengeClass=d->needChallengeClass;
91   st->needChallengeAmount=d->needChallengeAmount;
92   st->challengeIsStructured=d->challengeIsStructured;
93   st->initMode=d->initMode;
94   st->needTanMediumId=d->needTanMediumId;
95   st->maxActiveTanMedia=d->maxActiveTanMedia;
96   st->gvVersion=d->gvVersion;
97   return st;
98 }
99 
100 
AH_TanMethod_toDb(const AH_TAN_METHOD * st,GWEN_DB_NODE * db)101 int AH_TanMethod_toDb(const AH_TAN_METHOD *st, GWEN_DB_NODE *db)
102 {
103   assert(st);
104   assert(db);
105   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "function", st->function))
106     return -1;
107   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "process", st->process))
108     return -1;
109   if (st->methodId)
110     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "methodId", st->methodId))
111       return -1;
112   if (st->methodName)
113     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "methodName", st->methodName))
114       return -1;
115   if (st->zkaTanName)
116     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "zkaTanName", st->zkaTanName))
117       return -1;
118   if (st->zkaTanVersion)
119     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "zkaTanVersion", st->zkaTanVersion))
120       return -1;
121   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "tanMaxLen", st->tanMaxLen))
122     return -1;
123   if (st->formatId)
124     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "formatId", st->formatId))
125       return -1;
126   if (st->prompt)
127     if (GWEN_DB_SetCharValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "prompt", st->prompt))
128       return -1;
129   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "returnMaxLen", st->returnMaxLen))
130     return -1;
131   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxActiveLists", st->maxActiveLists))
132     return -1;
133   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "multiTanAllowed", st->multiTanAllowed))
134     return -1;
135   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "timeShiftAllowed", st->timeShiftAllowed))
136     return -1;
137   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "tanListMode", st->tanListMode))
138     return -1;
139   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "stornoAllowed", st->stornoAllowed))
140     return -1;
141   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needSmsAccount", st->needSmsAccount))
142     return -1;
143   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needLocalAccount", st->needLocalAccount))
144     return -1;
145   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needChallengeClass", st->needChallengeClass))
146     return -1;
147   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needChallengeAmount", st->needChallengeAmount))
148     return -1;
149   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "challengeIsStructured", st->challengeIsStructured))
150     return -1;
151   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "initMode", st->initMode))
152     return -1;
153   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "needTanMediumId", st->needTanMediumId))
154     return -1;
155   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "maxActiveTanMedia", st->maxActiveTanMedia))
156     return -1;
157   if (GWEN_DB_SetIntValue(db, GWEN_DB_FLAGS_OVERWRITE_VARS, "gvVersion", st->gvVersion))
158     return -1;
159   return 0;
160 }
161 
162 
AH_TanMethod_ReadDb(AH_TAN_METHOD * st,GWEN_DB_NODE * db)163 int AH_TanMethod_ReadDb(AH_TAN_METHOD *st, GWEN_DB_NODE *db)
164 {
165   assert(st);
166   assert(db);
167   AH_TanMethod_SetFunction(st, GWEN_DB_GetIntValue(db, "function", 0, 0));
168   AH_TanMethod_SetProcess(st, GWEN_DB_GetIntValue(db, "process", 0, 0));
169   AH_TanMethod_SetMethodId(st, GWEN_DB_GetCharValue(db, "methodId", 0, 0));
170   AH_TanMethod_SetMethodName(st, GWEN_DB_GetCharValue(db, "methodName", 0, 0));
171   AH_TanMethod_SetZkaTanName(st, GWEN_DB_GetCharValue(db, "zkaTanName", 0, 0));
172   AH_TanMethod_SetZkaTanVersion(st, GWEN_DB_GetCharValue(db, "zkaTanVersion", 0, 0));
173   AH_TanMethod_SetTanMaxLen(st, GWEN_DB_GetIntValue(db, "tanMaxLen", 0, 0));
174   AH_TanMethod_SetFormatId(st, GWEN_DB_GetCharValue(db, "formatId", 0, 0));
175   AH_TanMethod_SetPrompt(st, GWEN_DB_GetCharValue(db, "prompt", 0, 0));
176   AH_TanMethod_SetReturnMaxLen(st, GWEN_DB_GetIntValue(db, "returnMaxLen", 0, 0));
177   AH_TanMethod_SetMaxActiveLists(st, GWEN_DB_GetIntValue(db, "maxActiveLists", 0, 0));
178   AH_TanMethod_SetMultiTanAllowed(st, GWEN_DB_GetIntValue(db, "multiTanAllowed", 0, 0));
179   AH_TanMethod_SetTimeShiftAllowed(st, GWEN_DB_GetIntValue(db, "timeShiftAllowed", 0, 0));
180   AH_TanMethod_SetTanListMode(st, GWEN_DB_GetIntValue(db, "tanListMode", 0, 0));
181   AH_TanMethod_SetStornoAllowed(st, GWEN_DB_GetIntValue(db, "stornoAllowed", 0, 0));
182   AH_TanMethod_SetNeedSmsAccount(st, GWEN_DB_GetIntValue(db, "needSmsAccount", 0, 0));
183   AH_TanMethod_SetNeedLocalAccount(st, GWEN_DB_GetIntValue(db, "needLocalAccount", 0, 0));
184   AH_TanMethod_SetNeedChallengeClass(st, GWEN_DB_GetIntValue(db, "needChallengeClass", 0, 0));
185   AH_TanMethod_SetNeedChallengeAmount(st, GWEN_DB_GetIntValue(db, "needChallengeAmount", 0, 0));
186   AH_TanMethod_SetChallengeIsStructured(st, GWEN_DB_GetIntValue(db, "challengeIsStructured", 0, 0));
187   AH_TanMethod_SetInitMode(st, GWEN_DB_GetIntValue(db, "initMode", 0, 0));
188   AH_TanMethod_SetNeedTanMediumId(st, GWEN_DB_GetIntValue(db, "needTanMediumId", 0, 0));
189   AH_TanMethod_SetMaxActiveTanMedia(st, GWEN_DB_GetIntValue(db, "maxActiveTanMedia", 0, 0));
190   AH_TanMethod_SetGvVersion(st, GWEN_DB_GetIntValue(db, "gvVersion", 0, 0));
191   return 0;
192 }
193 
194 
AH_TanMethod_fromDb(GWEN_DB_NODE * db)195 AH_TAN_METHOD *AH_TanMethod_fromDb(GWEN_DB_NODE *db)
196 {
197   AH_TAN_METHOD *st;
198 
199   assert(db);
200   st=AH_TanMethod_new();
201   AH_TanMethod_ReadDb(st, db);
202   st->_modified=0;
203   return st;
204 }
205 
206 
207 
208 
AH_TanMethod_GetFunction(const AH_TAN_METHOD * st)209 int AH_TanMethod_GetFunction(const AH_TAN_METHOD *st)
210 {
211   assert(st);
212   return st->function;
213 }
214 
215 
AH_TanMethod_SetFunction(AH_TAN_METHOD * st,int d)216 void AH_TanMethod_SetFunction(AH_TAN_METHOD *st, int d)
217 {
218   assert(st);
219   st->function=d;
220   st->_modified=1;
221 }
222 
223 
224 
225 
AH_TanMethod_GetProcess(const AH_TAN_METHOD * st)226 int AH_TanMethod_GetProcess(const AH_TAN_METHOD *st)
227 {
228   assert(st);
229   return st->process;
230 }
231 
232 
AH_TanMethod_SetProcess(AH_TAN_METHOD * st,int d)233 void AH_TanMethod_SetProcess(AH_TAN_METHOD *st, int d)
234 {
235   assert(st);
236   st->process=d;
237   st->_modified=1;
238 }
239 
240 
241 
242 
AH_TanMethod_GetMethodId(const AH_TAN_METHOD * st)243 const char *AH_TanMethod_GetMethodId(const AH_TAN_METHOD *st)
244 {
245   assert(st);
246   return st->methodId;
247 }
248 
249 
AH_TanMethod_SetMethodId(AH_TAN_METHOD * st,const char * d)250 void AH_TanMethod_SetMethodId(AH_TAN_METHOD *st, const char *d)
251 {
252   assert(st);
253   if (st->methodId)
254     free(st->methodId);
255   if (d && *d)
256     st->methodId=strdup(d);
257   else
258     st->methodId=0;
259   st->_modified=1;
260 }
261 
262 
263 
264 
AH_TanMethod_GetMethodName(const AH_TAN_METHOD * st)265 const char *AH_TanMethod_GetMethodName(const AH_TAN_METHOD *st)
266 {
267   assert(st);
268   return st->methodName;
269 }
270 
271 
AH_TanMethod_SetMethodName(AH_TAN_METHOD * st,const char * d)272 void AH_TanMethod_SetMethodName(AH_TAN_METHOD *st, const char *d)
273 {
274   assert(st);
275   if (st->methodName)
276     free(st->methodName);
277   if (d && *d)
278     st->methodName=strdup(d);
279   else
280     st->methodName=0;
281   st->_modified=1;
282 }
283 
284 
285 
286 
AH_TanMethod_GetZkaTanName(const AH_TAN_METHOD * st)287 const char *AH_TanMethod_GetZkaTanName(const AH_TAN_METHOD *st)
288 {
289   assert(st);
290   return st->zkaTanName;
291 }
292 
293 
AH_TanMethod_SetZkaTanName(AH_TAN_METHOD * st,const char * d)294 void AH_TanMethod_SetZkaTanName(AH_TAN_METHOD *st, const char *d)
295 {
296   assert(st);
297   if (st->zkaTanName)
298     free(st->zkaTanName);
299   if (d && *d)
300     st->zkaTanName=strdup(d);
301   else
302     st->zkaTanName=0;
303   st->_modified=1;
304 }
305 
306 
307 
308 
AH_TanMethod_GetZkaTanVersion(const AH_TAN_METHOD * st)309 const char *AH_TanMethod_GetZkaTanVersion(const AH_TAN_METHOD *st)
310 {
311   assert(st);
312   return st->zkaTanVersion;
313 }
314 
315 
AH_TanMethod_SetZkaTanVersion(AH_TAN_METHOD * st,const char * d)316 void AH_TanMethod_SetZkaTanVersion(AH_TAN_METHOD *st, const char *d)
317 {
318   assert(st);
319   if (st->zkaTanVersion)
320     free(st->zkaTanVersion);
321   if (d && *d)
322     st->zkaTanVersion=strdup(d);
323   else
324     st->zkaTanVersion=0;
325   st->_modified=1;
326 }
327 
328 
329 
330 
AH_TanMethod_GetTanMaxLen(const AH_TAN_METHOD * st)331 int AH_TanMethod_GetTanMaxLen(const AH_TAN_METHOD *st)
332 {
333   assert(st);
334   return st->tanMaxLen;
335 }
336 
337 
AH_TanMethod_SetTanMaxLen(AH_TAN_METHOD * st,int d)338 void AH_TanMethod_SetTanMaxLen(AH_TAN_METHOD *st, int d)
339 {
340   assert(st);
341   st->tanMaxLen=d;
342   st->_modified=1;
343 }
344 
345 
346 
347 
AH_TanMethod_GetFormatId(const AH_TAN_METHOD * st)348 const char *AH_TanMethod_GetFormatId(const AH_TAN_METHOD *st)
349 {
350   assert(st);
351   return st->formatId;
352 }
353 
354 
AH_TanMethod_SetFormatId(AH_TAN_METHOD * st,const char * d)355 void AH_TanMethod_SetFormatId(AH_TAN_METHOD *st, const char *d)
356 {
357   assert(st);
358   if (st->formatId)
359     free(st->formatId);
360   if (d && *d)
361     st->formatId=strdup(d);
362   else
363     st->formatId=0;
364   st->_modified=1;
365 }
366 
367 
368 
369 
AH_TanMethod_GetPrompt(const AH_TAN_METHOD * st)370 const char *AH_TanMethod_GetPrompt(const AH_TAN_METHOD *st)
371 {
372   assert(st);
373   return st->prompt;
374 }
375 
376 
AH_TanMethod_SetPrompt(AH_TAN_METHOD * st,const char * d)377 void AH_TanMethod_SetPrompt(AH_TAN_METHOD *st, const char *d)
378 {
379   assert(st);
380   if (st->prompt)
381     free(st->prompt);
382   if (d && *d)
383     st->prompt=strdup(d);
384   else
385     st->prompt=0;
386   st->_modified=1;
387 }
388 
389 
390 
391 
AH_TanMethod_GetReturnMaxLen(const AH_TAN_METHOD * st)392 int AH_TanMethod_GetReturnMaxLen(const AH_TAN_METHOD *st)
393 {
394   assert(st);
395   return st->returnMaxLen;
396 }
397 
398 
AH_TanMethod_SetReturnMaxLen(AH_TAN_METHOD * st,int d)399 void AH_TanMethod_SetReturnMaxLen(AH_TAN_METHOD *st, int d)
400 {
401   assert(st);
402   st->returnMaxLen=d;
403   st->_modified=1;
404 }
405 
406 
407 
408 
AH_TanMethod_GetMaxActiveLists(const AH_TAN_METHOD * st)409 int AH_TanMethod_GetMaxActiveLists(const AH_TAN_METHOD *st)
410 {
411   assert(st);
412   return st->maxActiveLists;
413 }
414 
415 
AH_TanMethod_SetMaxActiveLists(AH_TAN_METHOD * st,int d)416 void AH_TanMethod_SetMaxActiveLists(AH_TAN_METHOD *st, int d)
417 {
418   assert(st);
419   st->maxActiveLists=d;
420   st->_modified=1;
421 }
422 
423 
424 
425 
AH_TanMethod_GetMultiTanAllowed(const AH_TAN_METHOD * st)426 int AH_TanMethod_GetMultiTanAllowed(const AH_TAN_METHOD *st)
427 {
428   assert(st);
429   return st->multiTanAllowed;
430 }
431 
432 
AH_TanMethod_SetMultiTanAllowed(AH_TAN_METHOD * st,int d)433 void AH_TanMethod_SetMultiTanAllowed(AH_TAN_METHOD *st, int d)
434 {
435   assert(st);
436   st->multiTanAllowed=d;
437   st->_modified=1;
438 }
439 
440 
441 
442 
AH_TanMethod_GetTimeShiftAllowed(const AH_TAN_METHOD * st)443 int AH_TanMethod_GetTimeShiftAllowed(const AH_TAN_METHOD *st)
444 {
445   assert(st);
446   return st->timeShiftAllowed;
447 }
448 
449 
AH_TanMethod_SetTimeShiftAllowed(AH_TAN_METHOD * st,int d)450 void AH_TanMethod_SetTimeShiftAllowed(AH_TAN_METHOD *st, int d)
451 {
452   assert(st);
453   st->timeShiftAllowed=d;
454   st->_modified=1;
455 }
456 
457 
458 
459 
AH_TanMethod_GetTanListMode(const AH_TAN_METHOD * st)460 int AH_TanMethod_GetTanListMode(const AH_TAN_METHOD *st)
461 {
462   assert(st);
463   return st->tanListMode;
464 }
465 
466 
AH_TanMethod_SetTanListMode(AH_TAN_METHOD * st,int d)467 void AH_TanMethod_SetTanListMode(AH_TAN_METHOD *st, int d)
468 {
469   assert(st);
470   st->tanListMode=d;
471   st->_modified=1;
472 }
473 
474 
475 
476 
AH_TanMethod_GetStornoAllowed(const AH_TAN_METHOD * st)477 int AH_TanMethod_GetStornoAllowed(const AH_TAN_METHOD *st)
478 {
479   assert(st);
480   return st->stornoAllowed;
481 }
482 
483 
AH_TanMethod_SetStornoAllowed(AH_TAN_METHOD * st,int d)484 void AH_TanMethod_SetStornoAllowed(AH_TAN_METHOD *st, int d)
485 {
486   assert(st);
487   st->stornoAllowed=d;
488   st->_modified=1;
489 }
490 
491 
492 
493 
AH_TanMethod_GetNeedSmsAccount(const AH_TAN_METHOD * st)494 int AH_TanMethod_GetNeedSmsAccount(const AH_TAN_METHOD *st)
495 {
496   assert(st);
497   return st->needSmsAccount;
498 }
499 
500 
AH_TanMethod_SetNeedSmsAccount(AH_TAN_METHOD * st,int d)501 void AH_TanMethod_SetNeedSmsAccount(AH_TAN_METHOD *st, int d)
502 {
503   assert(st);
504   st->needSmsAccount=d;
505   st->_modified=1;
506 }
507 
508 
509 
510 
AH_TanMethod_GetNeedLocalAccount(const AH_TAN_METHOD * st)511 int AH_TanMethod_GetNeedLocalAccount(const AH_TAN_METHOD *st)
512 {
513   assert(st);
514   return st->needLocalAccount;
515 }
516 
517 
AH_TanMethod_SetNeedLocalAccount(AH_TAN_METHOD * st,int d)518 void AH_TanMethod_SetNeedLocalAccount(AH_TAN_METHOD *st, int d)
519 {
520   assert(st);
521   st->needLocalAccount=d;
522   st->_modified=1;
523 }
524 
525 
526 
527 
AH_TanMethod_GetNeedChallengeClass(const AH_TAN_METHOD * st)528 int AH_TanMethod_GetNeedChallengeClass(const AH_TAN_METHOD *st)
529 {
530   assert(st);
531   return st->needChallengeClass;
532 }
533 
534 
AH_TanMethod_SetNeedChallengeClass(AH_TAN_METHOD * st,int d)535 void AH_TanMethod_SetNeedChallengeClass(AH_TAN_METHOD *st, int d)
536 {
537   assert(st);
538   st->needChallengeClass=d;
539   st->_modified=1;
540 }
541 
542 
543 
544 
AH_TanMethod_GetNeedChallengeAmount(const AH_TAN_METHOD * st)545 int AH_TanMethod_GetNeedChallengeAmount(const AH_TAN_METHOD *st)
546 {
547   assert(st);
548   return st->needChallengeAmount;
549 }
550 
551 
AH_TanMethod_SetNeedChallengeAmount(AH_TAN_METHOD * st,int d)552 void AH_TanMethod_SetNeedChallengeAmount(AH_TAN_METHOD *st, int d)
553 {
554   assert(st);
555   st->needChallengeAmount=d;
556   st->_modified=1;
557 }
558 
559 
560 
561 
AH_TanMethod_GetChallengeIsStructured(const AH_TAN_METHOD * st)562 int AH_TanMethod_GetChallengeIsStructured(const AH_TAN_METHOD *st)
563 {
564   assert(st);
565   return st->challengeIsStructured;
566 }
567 
568 
AH_TanMethod_SetChallengeIsStructured(AH_TAN_METHOD * st,int d)569 void AH_TanMethod_SetChallengeIsStructured(AH_TAN_METHOD *st, int d)
570 {
571   assert(st);
572   st->challengeIsStructured=d;
573   st->_modified=1;
574 }
575 
576 
577 
578 
AH_TanMethod_GetInitMode(const AH_TAN_METHOD * st)579 int AH_TanMethod_GetInitMode(const AH_TAN_METHOD *st)
580 {
581   assert(st);
582   return st->initMode;
583 }
584 
585 
AH_TanMethod_SetInitMode(AH_TAN_METHOD * st,int d)586 void AH_TanMethod_SetInitMode(AH_TAN_METHOD *st, int d)
587 {
588   assert(st);
589   st->initMode=d;
590   st->_modified=1;
591 }
592 
593 
594 
595 
AH_TanMethod_GetNeedTanMediumId(const AH_TAN_METHOD * st)596 int AH_TanMethod_GetNeedTanMediumId(const AH_TAN_METHOD *st)
597 {
598   assert(st);
599   return st->needTanMediumId;
600 }
601 
602 
AH_TanMethod_SetNeedTanMediumId(AH_TAN_METHOD * st,int d)603 void AH_TanMethod_SetNeedTanMediumId(AH_TAN_METHOD *st, int d)
604 {
605   assert(st);
606   st->needTanMediumId=d;
607   st->_modified=1;
608 }
609 
610 
611 
612 
AH_TanMethod_GetMaxActiveTanMedia(const AH_TAN_METHOD * st)613 int AH_TanMethod_GetMaxActiveTanMedia(const AH_TAN_METHOD *st)
614 {
615   assert(st);
616   return st->maxActiveTanMedia;
617 }
618 
619 
AH_TanMethod_SetMaxActiveTanMedia(AH_TAN_METHOD * st,int d)620 void AH_TanMethod_SetMaxActiveTanMedia(AH_TAN_METHOD *st, int d)
621 {
622   assert(st);
623   st->maxActiveTanMedia=d;
624   st->_modified=1;
625 }
626 
627 
628 
629 
AH_TanMethod_GetGvVersion(const AH_TAN_METHOD * st)630 int AH_TanMethod_GetGvVersion(const AH_TAN_METHOD *st)
631 {
632   assert(st);
633   return st->gvVersion;
634 }
635 
636 
AH_TanMethod_SetGvVersion(AH_TAN_METHOD * st,int d)637 void AH_TanMethod_SetGvVersion(AH_TAN_METHOD *st, int d)
638 {
639   assert(st);
640   st->gvVersion=d;
641   st->_modified=1;
642 }
643 
644 
645 
646 
AH_TanMethod_IsModified(const AH_TAN_METHOD * st)647 int AH_TanMethod_IsModified(const AH_TAN_METHOD *st)
648 {
649   assert(st);
650   return st->_modified;
651 }
652 
653 
AH_TanMethod_SetModified(AH_TAN_METHOD * st,int i)654 void AH_TanMethod_SetModified(AH_TAN_METHOD *st, int i)
655 {
656   assert(st);
657   st->_modified=i;
658 }
659 
660 
AH_TanMethod_Attach(AH_TAN_METHOD * st)661 void AH_TanMethod_Attach(AH_TAN_METHOD *st)
662 {
663   assert(st);
664   st->_usage++;
665 }
AH_TanMethod_List2__freeAll_cb(AH_TAN_METHOD * st,void * user_data)666 AH_TAN_METHOD *AH_TanMethod_List2__freeAll_cb(AH_TAN_METHOD *st, void *user_data)
667 {
668   AH_TanMethod_free(st);
669   return 0;
670 }
671 
672 
AH_TanMethod_List2_freeAll(AH_TAN_METHOD_LIST2 * stl)673 void AH_TanMethod_List2_freeAll(AH_TAN_METHOD_LIST2 *stl)
674 {
675   if (stl) {
676     AH_TanMethod_List2_ForEach(stl, AH_TanMethod_List2__freeAll_cb, 0);
677     AH_TanMethod_List2_free(stl);
678   }
679 }
680 
681 
AH_TanMethod_List_dup(const AH_TAN_METHOD_LIST * stl)682 AH_TAN_METHOD_LIST *AH_TanMethod_List_dup(const AH_TAN_METHOD_LIST *stl)
683 {
684   if (stl) {
685     AH_TAN_METHOD_LIST *nl;
686     AH_TAN_METHOD *e;
687 
688     nl=AH_TanMethod_List_new();
689     e=AH_TanMethod_List_First(stl);
690     while (e) {
691       AH_TAN_METHOD *ne;
692 
693       ne=AH_TanMethod_dup(e);
694       assert(ne);
695       AH_TanMethod_List_Add(ne, nl);
696       e=AH_TanMethod_List_Next(e);
697     } /* while (e) */
698     return nl;
699   }
700   else
701     return 0;
702 }
703 
704 
705 
706 
707