gwenhywfar  4.6.0beta
ct_context.c
Go to the documentation of this file.
1 /**********************************************************
2  * This file has been automatically created by "typemaker2"
3  * from the file "ct_context.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 "ct_context_p.h"
13 
14 #include <gwenhywfar/misc.h>
15 #include <gwenhywfar/debug.h>
16 
17 /* code headers */
18 
19 /* macro functions */
20 GWEN_LIST_FUNCTIONS(GWEN_CRYPT_TOKEN_CONTEXT, GWEN_Crypt_Token_Context)
21 GWEN_LIST2_FUNCTIONS(GWEN_CRYPT_TOKEN_CONTEXT, GWEN_Crypt_Token_Context)
22 GWEN_INHERIT_FUNCTIONS(GWEN_CRYPT_TOKEN_CONTEXT)
23 
24 
25 GWEN_CRYPT_TOKEN_CONTEXT *GWEN_Crypt_Token_Context_new(void) {
26  GWEN_CRYPT_TOKEN_CONTEXT *p_struct;
27 
28  GWEN_NEW_OBJECT(GWEN_CRYPT_TOKEN_CONTEXT, p_struct)
29  p_struct->_refCount=1;
30  GWEN_INHERIT_INIT(GWEN_CRYPT_TOKEN_CONTEXT, p_struct)
31  GWEN_LIST_INIT(GWEN_CRYPT_TOKEN_CONTEXT, p_struct)
32  /* members */
33  p_struct->id=0;
34  p_struct->signKeyId=0;
35  p_struct->verifyKeyId=0;
36  p_struct->encipherKeyId=0;
37  p_struct->decipherKeyId=0;
38  p_struct->authSignKeyId=0;
39  p_struct->authVerifyKeyId=0;
40  p_struct->tempSignKeyId=0;
41  p_struct->serviceId=NULL;
42  p_struct->userId=NULL;
43  p_struct->customerId=NULL;
44  p_struct->userName=NULL;
45  p_struct->peerId=NULL;
46  p_struct->peerName=NULL;
47  p_struct->address=NULL;
48  p_struct->port=0;
49  p_struct->systemId=NULL;
50 
51  return p_struct;
52 }
53 
55  if (p_struct) {
56  assert(p_struct->_refCount);
57  if (p_struct->_refCount==1) {
60  /* members */
61  free(p_struct->serviceId);
62  free(p_struct->userId);
63  free(p_struct->customerId);
64  free(p_struct->userName);
65  free(p_struct->peerId);
66  free(p_struct->peerName);
67  free(p_struct->address);
68  free(p_struct->systemId);
69  p_struct->_refCount=0;
70  GWEN_FREE_OBJECT(p_struct);
71  }
72  else
73  p_struct->_refCount--;
74  }
75 }
76 
78  assert(p_struct);
79  assert(p_struct->_refCount);
80  p_struct->_refCount++;
81 }
82 
84  GWEN_CRYPT_TOKEN_CONTEXT *p_struct;
85 
86  assert(p_src);
88  /* member "id" */
89  p_struct->id=p_src->id;
90 
91  /* member "signKeyId" */
92  p_struct->signKeyId=p_src->signKeyId;
93 
94  /* member "verifyKeyId" */
95  p_struct->verifyKeyId=p_src->verifyKeyId;
96 
97  /* member "encipherKeyId" */
98  p_struct->encipherKeyId=p_src->encipherKeyId;
99 
100  /* member "decipherKeyId" */
101  p_struct->decipherKeyId=p_src->decipherKeyId;
102 
103  /* member "authSignKeyId" */
104  p_struct->authSignKeyId=p_src->authSignKeyId;
105 
106  /* member "authVerifyKeyId" */
107  p_struct->authVerifyKeyId=p_src->authVerifyKeyId;
108 
109  /* member "tempSignKeyId" */
110  p_struct->tempSignKeyId=p_src->tempSignKeyId;
111 
112  /* member "serviceId" */
113  if (p_struct->serviceId) {
114  free(p_struct->serviceId);
115  p_struct->serviceId=NULL;
116  }
117  if (p_src->serviceId) {
118  p_struct->serviceId=strdup(p_src->serviceId);
119  }
120 
121  /* member "userId" */
122  if (p_struct->userId) {
123  free(p_struct->userId);
124  p_struct->userId=NULL;
125  }
126  if (p_src->userId) {
127  p_struct->userId=strdup(p_src->userId);
128  }
129 
130  /* member "customerId" */
131  if (p_struct->customerId) {
132  free(p_struct->customerId);
133  p_struct->customerId=NULL;
134  }
135  if (p_src->customerId) {
136  p_struct->customerId=strdup(p_src->customerId);
137  }
138 
139  /* member "userName" */
140  if (p_struct->userName) {
141  free(p_struct->userName);
142  p_struct->userName=NULL;
143  }
144  if (p_src->userName) {
145  p_struct->userName=strdup(p_src->userName);
146  }
147 
148  /* member "peerId" */
149  if (p_struct->peerId) {
150  free(p_struct->peerId);
151  p_struct->peerId=NULL;
152  }
153  if (p_src->peerId) {
154  p_struct->peerId=strdup(p_src->peerId);
155  }
156 
157  /* member "peerName" */
158  if (p_struct->peerName) {
159  free(p_struct->peerName);
160  p_struct->peerName=NULL;
161  }
162  if (p_src->peerName) {
163  p_struct->peerName=strdup(p_src->peerName);
164  }
165 
166  /* member "address" */
167  if (p_struct->address) {
168  free(p_struct->address);
169  p_struct->address=NULL;
170  }
171  if (p_src->address) {
172  p_struct->address=strdup(p_src->address);
173  }
174 
175  /* member "port" */
176  p_struct->port=p_src->port;
177 
178  /* member "systemId" */
179  if (p_struct->systemId) {
180  free(p_struct->systemId);
181  p_struct->systemId=NULL;
182  }
183  if (p_src->systemId) {
184  p_struct->systemId=strdup(p_src->systemId);
185  }
186 
187  return p_struct;
188 }
189 
191  assert(p_struct);
192  return p_struct->id;
193 }
194 
196  assert(p_struct);
197  return p_struct->signKeyId;
198 }
199 
201  assert(p_struct);
202  return p_struct->verifyKeyId;
203 }
204 
206  assert(p_struct);
207  return p_struct->encipherKeyId;
208 }
209 
211  assert(p_struct);
212  return p_struct->decipherKeyId;
213 }
214 
216  assert(p_struct);
217  return p_struct->authSignKeyId;
218 }
219 
221  assert(p_struct);
222  return p_struct->authVerifyKeyId;
223 }
224 
226  assert(p_struct);
227  return p_struct->tempSignKeyId;
228 }
229 
231  assert(p_struct);
232  return p_struct->serviceId;
233 }
234 
236  assert(p_struct);
237  return p_struct->userId;
238 }
239 
241  assert(p_struct);
242  return p_struct->customerId;
243 }
244 
246  assert(p_struct);
247  return p_struct->userName;
248 }
249 
251  assert(p_struct);
252  return p_struct->peerId;
253 }
254 
256  assert(p_struct);
257  return p_struct->peerName;
258 }
259 
261  assert(p_struct);
262  return p_struct->address;
263 }
264 
266  assert(p_struct);
267  return p_struct->port;
268 }
269 
271  assert(p_struct);
272  return p_struct->systemId;
273 }
274 
276  assert(p_struct);
277  p_struct->id=p_src;
278 }
279 
281  assert(p_struct);
282  p_struct->signKeyId=p_src;
283 }
284 
286  assert(p_struct);
287  p_struct->verifyKeyId=p_src;
288 }
289 
291  assert(p_struct);
292  p_struct->encipherKeyId=p_src;
293 }
294 
296  assert(p_struct);
297  p_struct->decipherKeyId=p_src;
298 }
299 
301  assert(p_struct);
302  p_struct->authSignKeyId=p_src;
303 }
304 
306  assert(p_struct);
307  p_struct->authVerifyKeyId=p_src;
308 }
309 
311  assert(p_struct);
312  p_struct->tempSignKeyId=p_src;
313 }
314 
316  assert(p_struct);
317  if (p_struct->serviceId) {
318  free(p_struct->serviceId);
319  }
320  if (p_src) {
321  p_struct->serviceId=strdup(p_src);
322  }
323  else {
324  p_struct->serviceId=NULL;
325  }
326 }
327 
329  assert(p_struct);
330  if (p_struct->userId) {
331  free(p_struct->userId);
332  }
333  if (p_src) {
334  p_struct->userId=strdup(p_src);
335  }
336  else {
337  p_struct->userId=NULL;
338  }
339 }
340 
342  assert(p_struct);
343  if (p_struct->customerId) {
344  free(p_struct->customerId);
345  }
346  if (p_src) {
347  p_struct->customerId=strdup(p_src);
348  }
349  else {
350  p_struct->customerId=NULL;
351  }
352 }
353 
355  assert(p_struct);
356  if (p_struct->userName) {
357  free(p_struct->userName);
358  }
359  if (p_src) {
360  p_struct->userName=strdup(p_src);
361  }
362  else {
363  p_struct->userName=NULL;
364  }
365 }
366 
368  assert(p_struct);
369  if (p_struct->peerId) {
370  free(p_struct->peerId);
371  }
372  if (p_src) {
373  p_struct->peerId=strdup(p_src);
374  }
375  else {
376  p_struct->peerId=NULL;
377  }
378 }
379 
381  assert(p_struct);
382  if (p_struct->peerName) {
383  free(p_struct->peerName);
384  }
385  if (p_src) {
386  p_struct->peerName=strdup(p_src);
387  }
388  else {
389  p_struct->peerName=NULL;
390  }
391 }
392 
394  assert(p_struct);
395  if (p_struct->address) {
396  free(p_struct->address);
397  }
398  if (p_src) {
399  p_struct->address=strdup(p_src);
400  }
401  else {
402  p_struct->address=NULL;
403  }
404 }
405 
407  assert(p_struct);
408  p_struct->port=p_src;
409 }
410 
412  assert(p_struct);
413  if (p_struct->systemId) {
414  free(p_struct->systemId);
415  }
416  if (p_src) {
417  p_struct->systemId=strdup(p_src);
418  }
419  else {
420  p_struct->systemId=NULL;
421  }
422 }
423 
424 GWEN_CRYPT_TOKEN_CONTEXT_LIST *GWEN_Crypt_Token_Context_List_dup(const GWEN_CRYPT_TOKEN_CONTEXT_LIST *p_src) {
425  GWEN_CRYPT_TOKEN_CONTEXT_LIST *p_dest;
426  GWEN_CRYPT_TOKEN_CONTEXT *p_elem;
427 
428  assert(p_src);
429  p_dest=GWEN_Crypt_Token_Context_List_new();
430  p_elem=GWEN_Crypt_Token_Context_List_First(p_src);
431  while(p_elem) {
433 
434  p_cpy=GWEN_Crypt_Token_Context_dup(p_elem);
435  GWEN_Crypt_Token_Context_List_Add(p_cpy, p_dest);
436  p_elem=GWEN_Crypt_Token_Context_List_Next(p_elem);
437  }
438 
439  return p_dest;
440 }
441 
443  assert(p_struct);
444  /* member "id" */
445  p_struct->id=GWEN_DB_GetIntValue(p_db, "id", 0, 0);
446 
447  /* member "signKeyId" */
448  p_struct->signKeyId=GWEN_DB_GetIntValue(p_db, "signKeyId", 0, 0);
449 
450  /* member "verifyKeyId" */
451  p_struct->verifyKeyId=GWEN_DB_GetIntValue(p_db, "verifyKeyId", 0, 0);
452 
453  /* member "encipherKeyId" */
454  p_struct->encipherKeyId=GWEN_DB_GetIntValue(p_db, "encipherKeyId", 0, 0);
455 
456  /* member "decipherKeyId" */
457  p_struct->decipherKeyId=GWEN_DB_GetIntValue(p_db, "decipherKeyId", 0, 0);
458 
459  /* member "authSignKeyId" */
460  p_struct->authSignKeyId=GWEN_DB_GetIntValue(p_db, "authSignKeyId", 0, 0);
461 
462  /* member "authVerifyKeyId" */
463  p_struct->authVerifyKeyId=GWEN_DB_GetIntValue(p_db, "authVerifyKeyId", 0, 0);
464 
465  /* member "tempSignKeyId" */
466  p_struct->tempSignKeyId=GWEN_DB_GetIntValue(p_db, "tempSignKeyId", 0, 0);
467 
468  /* member "serviceId" */
469  if (p_struct->serviceId) {
470  free(p_struct->serviceId);
471  }
472  { const char *s; s=GWEN_DB_GetCharValue(p_db, "serviceId", 0, NULL); if (s) p_struct->serviceId=strdup(s); }
473  if (p_struct->serviceId==NULL) { p_struct->serviceId=NULL;
474  }
475 
476  /* member "userId" */
477  if (p_struct->userId) {
478  free(p_struct->userId);
479  }
480  { const char *s; s=GWEN_DB_GetCharValue(p_db, "userId", 0, NULL); if (s) p_struct->userId=strdup(s); }
481  if (p_struct->userId==NULL) { p_struct->userId=NULL;
482  }
483 
484  /* member "customerId" */
485  if (p_struct->customerId) {
486  free(p_struct->customerId);
487  }
488  { const char *s; s=GWEN_DB_GetCharValue(p_db, "customerId", 0, NULL); if (s) p_struct->customerId=strdup(s); }
489  if (p_struct->customerId==NULL) { p_struct->customerId=NULL;
490  }
491 
492  /* member "userName" */
493  if (p_struct->userName) {
494  free(p_struct->userName);
495  }
496  { const char *s; s=GWEN_DB_GetCharValue(p_db, "userName", 0, NULL); if (s) p_struct->userName=strdup(s); }
497  if (p_struct->userName==NULL) { p_struct->userName=NULL;
498  }
499 
500  /* member "peerId" */
501  if (p_struct->peerId) {
502  free(p_struct->peerId);
503  }
504  { const char *s; s=GWEN_DB_GetCharValue(p_db, "peerId", 0, NULL); if (s) p_struct->peerId=strdup(s); }
505  if (p_struct->peerId==NULL) { p_struct->peerId=NULL;
506  }
507 
508  /* member "peerName" */
509  if (p_struct->peerName) {
510  free(p_struct->peerName);
511  }
512  { const char *s; s=GWEN_DB_GetCharValue(p_db, "peerName", 0, NULL); if (s) p_struct->peerName=strdup(s); }
513  if (p_struct->peerName==NULL) { p_struct->peerName=NULL;
514  }
515 
516  /* member "address" */
517  if (p_struct->address) {
518  free(p_struct->address);
519  }
520  { const char *s; s=GWEN_DB_GetCharValue(p_db, "address", 0, NULL); if (s) p_struct->address=strdup(s); }
521  if (p_struct->address==NULL) { p_struct->address=NULL;
522  }
523 
524  /* member "port" */
525  p_struct->port=GWEN_DB_GetIntValue(p_db, "port", 0, 0);
526 
527  /* member "systemId" */
528  if (p_struct->systemId) {
529  free(p_struct->systemId);
530  }
531  { const char *s; s=GWEN_DB_GetCharValue(p_db, "systemId", 0, NULL); if (s) p_struct->systemId=strdup(s); }
532  if (p_struct->systemId==NULL) { p_struct->systemId=NULL;
533  }
534 
535 }
536 
538  int p_rv;
539 
540  assert(p_struct);
541  /* member "id" */
542  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "id", p_struct->id);
543  if (p_rv<0) {
544  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
545  return p_rv;
546  }
547 
548  /* member "signKeyId" */
549  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "signKeyId", p_struct->signKeyId);
550  if (p_rv<0) {
551  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
552  return p_rv;
553  }
554 
555  /* member "verifyKeyId" */
556  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "verifyKeyId", p_struct->verifyKeyId);
557  if (p_rv<0) {
558  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
559  return p_rv;
560  }
561 
562  /* member "encipherKeyId" */
563  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "encipherKeyId", p_struct->encipherKeyId);
564  if (p_rv<0) {
565  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
566  return p_rv;
567  }
568 
569  /* member "decipherKeyId" */
570  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "decipherKeyId", p_struct->decipherKeyId);
571  if (p_rv<0) {
572  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
573  return p_rv;
574  }
575 
576  /* member "authSignKeyId" */
577  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "authSignKeyId", p_struct->authSignKeyId);
578  if (p_rv<0) {
579  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
580  return p_rv;
581  }
582 
583  /* member "authVerifyKeyId" */
584  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "authVerifyKeyId", p_struct->authVerifyKeyId);
585  if (p_rv<0) {
586  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
587  return p_rv;
588  }
589 
590  /* member "tempSignKeyId" */
591  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "tempSignKeyId", p_struct->tempSignKeyId);
592  if (p_rv<0) {
593  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
594  return p_rv;
595  }
596 
597  /* member "serviceId" */
598  if (p_struct->serviceId) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "serviceId", p_struct->serviceId); else { GWEN_DB_DeleteVar(p_db, "serviceId"); p_rv=0; }
599  if (p_rv<0) {
600  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
601  return p_rv;
602  }
603 
604  /* member "userId" */
605  if (p_struct->userId) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "userId", p_struct->userId); else { GWEN_DB_DeleteVar(p_db, "userId"); p_rv=0; }
606  if (p_rv<0) {
607  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
608  return p_rv;
609  }
610 
611  /* member "customerId" */
612  if (p_struct->customerId) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "customerId", p_struct->customerId); else { GWEN_DB_DeleteVar(p_db, "customerId"); p_rv=0; }
613  if (p_rv<0) {
614  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
615  return p_rv;
616  }
617 
618  /* member "userName" */
619  if (p_struct->userName) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "userName", p_struct->userName); else { GWEN_DB_DeleteVar(p_db, "userName"); p_rv=0; }
620  if (p_rv<0) {
621  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
622  return p_rv;
623  }
624 
625  /* member "peerId" */
626  if (p_struct->peerId) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "peerId", p_struct->peerId); else { GWEN_DB_DeleteVar(p_db, "peerId"); p_rv=0; }
627  if (p_rv<0) {
628  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
629  return p_rv;
630  }
631 
632  /* member "peerName" */
633  if (p_struct->peerName) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "peerName", p_struct->peerName); else { GWEN_DB_DeleteVar(p_db, "peerName"); p_rv=0; }
634  if (p_rv<0) {
635  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
636  return p_rv;
637  }
638 
639  /* member "address" */
640  if (p_struct->address) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "address", p_struct->address); else { GWEN_DB_DeleteVar(p_db, "address"); p_rv=0; }
641  if (p_rv<0) {
642  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
643  return p_rv;
644  }
645 
646  /* member "port" */
647  p_rv=GWEN_DB_SetIntValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "port", p_struct->port);
648  if (p_rv<0) {
649  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
650  return p_rv;
651  }
652 
653  /* member "systemId" */
654  if (p_struct->systemId) p_rv=GWEN_DB_SetCharValue(p_db, GWEN_DB_FLAGS_OVERWRITE_VARS, "systemId", p_struct->systemId); else { GWEN_DB_DeleteVar(p_db, "systemId"); p_rv=0; }
655  if (p_rv<0) {
656  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)\n", p_rv);
657  return p_rv;
658  }
659 
660  return 0;
661 }
662 
664  GWEN_CRYPT_TOKEN_CONTEXT *p_struct;
665  p_struct=GWEN_Crypt_Token_Context_new();
666  GWEN_Crypt_Token_Context_ReadDb(p_struct, p_db);
667  return p_struct;
668 }
669 
671  return GWEN_Crypt_Token_Context_WriteDb(p_struct, p_db);
672 }
673 
675  assert(p_struct);
676  /* member "id" */
677  p_struct->id=GWEN_XMLNode_GetIntValue(p_db, "id", 0);
678 
679  /* member "signKeyId" */
680  p_struct->signKeyId=GWEN_XMLNode_GetIntValue(p_db, "signKeyId", 0);
681 
682  /* member "verifyKeyId" */
683  p_struct->verifyKeyId=GWEN_XMLNode_GetIntValue(p_db, "verifyKeyId", 0);
684 
685  /* member "encipherKeyId" */
686  p_struct->encipherKeyId=GWEN_XMLNode_GetIntValue(p_db, "encipherKeyId", 0);
687 
688  /* member "decipherKeyId" */
689  p_struct->decipherKeyId=GWEN_XMLNode_GetIntValue(p_db, "decipherKeyId", 0);
690 
691  /* member "authSignKeyId" */
692  p_struct->authSignKeyId=GWEN_XMLNode_GetIntValue(p_db, "authSignKeyId", 0);
693 
694  /* member "authVerifyKeyId" */
695  p_struct->authVerifyKeyId=GWEN_XMLNode_GetIntValue(p_db, "authVerifyKeyId", 0);
696 
697  /* member "tempSignKeyId" */
698  p_struct->tempSignKeyId=GWEN_XMLNode_GetIntValue(p_db, "tempSignKeyId", 0);
699 
700  /* member "serviceId" */
701  if (p_struct->serviceId) {
702  free(p_struct->serviceId);
703  }
704  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "serviceId", NULL); if (s) p_struct->serviceId=strdup(s); }
705  if (p_struct->serviceId==NULL) { /* member "serviceId" is volatile, just presetting */
706  p_struct->serviceId=NULL;
707  }
708 
709  /* member "userId" */
710  if (p_struct->userId) {
711  free(p_struct->userId);
712  }
713  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "userId", NULL); if (s) p_struct->userId=strdup(s); }
714  if (p_struct->userId==NULL) { /* member "userId" is volatile, just presetting */
715  p_struct->userId=NULL;
716  }
717 
718  /* member "customerId" */
719  if (p_struct->customerId) {
720  free(p_struct->customerId);
721  }
722  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "customerId", NULL); if (s) p_struct->customerId=strdup(s); }
723  if (p_struct->customerId==NULL) { /* member "customerId" is volatile, just presetting */
724  p_struct->customerId=NULL;
725  }
726 
727  /* member "userName" */
728  if (p_struct->userName) {
729  free(p_struct->userName);
730  }
731  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "userName", NULL); if (s) p_struct->userName=strdup(s); }
732  if (p_struct->userName==NULL) { /* member "userName" is volatile, just presetting */
733  p_struct->userName=NULL;
734  }
735 
736  /* member "peerId" */
737  if (p_struct->peerId) {
738  free(p_struct->peerId);
739  }
740  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "peerId", NULL); if (s) p_struct->peerId=strdup(s); }
741  if (p_struct->peerId==NULL) { /* member "peerId" is volatile, just presetting */
742  p_struct->peerId=NULL;
743  }
744 
745  /* member "peerName" */
746  if (p_struct->peerName) {
747  free(p_struct->peerName);
748  }
749  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "peerName", NULL); if (s) p_struct->peerName=strdup(s); }
750  if (p_struct->peerName==NULL) { /* member "peerName" is volatile, just presetting */
751  p_struct->peerName=NULL;
752  }
753 
754  /* member "address" */
755  if (p_struct->address) {
756  free(p_struct->address);
757  }
758  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "address", NULL); if (s) p_struct->address=strdup(s); }
759  if (p_struct->address==NULL) { /* member "address" is volatile, just presetting */
760  p_struct->address=NULL;
761  }
762 
763  /* member "port" */
764  p_struct->port=GWEN_XMLNode_GetIntValue(p_db, "port", 0);
765 
766  /* member "systemId" */
767  if (p_struct->systemId) {
768  free(p_struct->systemId);
769  }
770  { const char *s; s=GWEN_XMLNode_GetCharValue(p_db, "systemId", NULL); if (s) p_struct->systemId=strdup(s); }
771  if (p_struct->systemId==NULL) { /* member "systemId" is volatile, just presetting */
772  p_struct->systemId=NULL;
773  }
774 
775 }
776 
778  assert(p_struct);
779  /* member "id" */
780  GWEN_XMLNode_SetIntValue(p_db, "id", p_struct->id);
781 
782  /* member "signKeyId" */
783  GWEN_XMLNode_SetIntValue(p_db, "signKeyId", p_struct->signKeyId);
784 
785  /* member "verifyKeyId" */
786  GWEN_XMLNode_SetIntValue(p_db, "verifyKeyId", p_struct->verifyKeyId);
787 
788  /* member "encipherKeyId" */
789  GWEN_XMLNode_SetIntValue(p_db, "encipherKeyId", p_struct->encipherKeyId);
790 
791  /* member "decipherKeyId" */
792  GWEN_XMLNode_SetIntValue(p_db, "decipherKeyId", p_struct->decipherKeyId);
793 
794  /* member "authSignKeyId" */
795  GWEN_XMLNode_SetIntValue(p_db, "authSignKeyId", p_struct->authSignKeyId);
796 
797  /* member "authVerifyKeyId" */
798  GWEN_XMLNode_SetIntValue(p_db, "authVerifyKeyId", p_struct->authVerifyKeyId);
799 
800  /* member "tempSignKeyId" */
801  GWEN_XMLNode_SetIntValue(p_db, "tempSignKeyId", p_struct->tempSignKeyId);
802 
803  /* member "serviceId" */
804  GWEN_XMLNode_SetCharValue(p_db, "serviceId", p_struct->serviceId);
805 
806  /* member "userId" */
807  GWEN_XMLNode_SetCharValue(p_db, "userId", p_struct->userId);
808 
809  /* member "customerId" */
810  GWEN_XMLNode_SetCharValue(p_db, "customerId", p_struct->customerId);
811 
812  /* member "userName" */
813  GWEN_XMLNode_SetCharValue(p_db, "userName", p_struct->userName);
814 
815  /* member "peerId" */
816  GWEN_XMLNode_SetCharValue(p_db, "peerId", p_struct->peerId);
817 
818  /* member "peerName" */
819  GWEN_XMLNode_SetCharValue(p_db, "peerName", p_struct->peerName);
820 
821  /* member "address" */
822  GWEN_XMLNode_SetCharValue(p_db, "address", p_struct->address);
823 
824  /* member "port" */
825  GWEN_XMLNode_SetIntValue(p_db, "port", p_struct->port);
826 
827  /* member "systemId" */
828  GWEN_XMLNode_SetCharValue(p_db, "systemId", p_struct->systemId);
829 
830 }
831 
833  GWEN_Crypt_Token_Context_WriteXml(p_struct, p_db);
834 }
835 
837  GWEN_CRYPT_TOKEN_CONTEXT *p_struct;
838  p_struct=GWEN_Crypt_Token_Context_new();
839  GWEN_Crypt_Token_Context_ReadXml(p_struct, p_db);
840  return p_struct;
841 }
842 
843 GWEN_CRYPT_TOKEN_CONTEXT *GWEN_Crypt_Token_Context_List_GetById(const GWEN_CRYPT_TOKEN_CONTEXT_LIST *p_list, uint32_t p_cmp) {
844  GWEN_CRYPT_TOKEN_CONTEXT *p_struct;
845 
846  assert(p_list);
847  p_struct = GWEN_Crypt_Token_Context_List_First(p_list);
848  while(p_struct) {
849  int p_rv;
850 
851  if (p_struct->id==p_cmp) p_rv=0; else if (p_cmp<p_struct->id) p_rv=-1; else p_rv=1;
852  if (p_rv == 0)
853  return p_struct;
854  p_struct = GWEN_Crypt_Token_Context_List_Next(p_struct);
855  }
856  return NULL;
857 }
858 
859 
860 /* code headers */
861