NCBI C Toolkit Cross Reference

C/access/objtax3.c


  1 #include <asn.h>
  2 
  3 #define NLM_GENERATED_CODE_PROTO
  4 
  5 #include <strimprt.h>
  6 #include <objtax3.h>
  7 
  8 static Boolean loaded = FALSE;
  9 
 10 #include <asntax3.h>
 11 
 12 #ifndef NLM_EXTERN_LOADS
 13 #define NLM_EXTERN_LOADS {}
 14 #endif
 15 
 16 NLM_EXTERN Boolean LIBCALL
 17 objtax3AsnLoad(void)
 18 {
 19 
 20    if ( ! loaded) {
 21       NLM_EXTERN_LOADS
 22 
 23       if ( ! AsnLoad ())
 24       return FALSE;
 25       loaded = TRUE;
 26    }
 27 
 28    return TRUE;
 29 }
 30 
 31 
 32 
 33 /**************************************************
 34 *    Generated object loaders for Module NCBI-Taxon3
 35 *    Generated using ASNCODE Revision: 6.17 at Dec 8, 2009  9:36 AM
 36 *
 37 **************************************************/
 38 
 39 
 40 /**************************************************
 41 *
 42 *    Taxon3RequestNew()
 43 *
 44 **************************************************/
 45 NLM_EXTERN 
 46 Taxon3RequestPtr LIBCALL
 47 Taxon3RequestNew(void)
 48 {
 49    Taxon3RequestPtr ptr = MemNew((size_t) sizeof(Taxon3Request));
 50 
 51    return ptr;
 52 
 53 }
 54 
 55 
 56 /**************************************************
 57 *
 58 *    Taxon3RequestFree()
 59 *
 60 **************************************************/
 61 NLM_EXTERN 
 62 Taxon3RequestPtr LIBCALL
 63 Taxon3RequestFree(Taxon3RequestPtr ptr)
 64 {
 65 
 66    if(ptr == NULL) {
 67       return NULL;
 68    }
 69    AsnGenericChoiceSeqOfFree(ptr -> request, (AsnOptFreeFunc) T3RequestFree);
 70    return MemFree(ptr);
 71 }
 72 
 73 
 74 /**************************************************
 75 *
 76 *    Taxon3RequestAsnRead()
 77 *
 78 **************************************************/
 79 NLM_EXTERN 
 80 Taxon3RequestPtr LIBCALL
 81 Taxon3RequestAsnRead(AsnIoPtr aip, AsnTypePtr orig)
 82 {
 83    DataVal av;
 84    AsnTypePtr atp;
 85    Boolean isError = FALSE;
 86    AsnReadFunc func;
 87    Taxon3RequestPtr ptr;
 88 
 89    if (! loaded)
 90    {
 91       if (! objtax3AsnLoad()) {
 92          return NULL;
 93       }
 94    }
 95 
 96    if (aip == NULL) {
 97       return NULL;
 98    }
 99 
100    if (orig == NULL) {         /* Taxon3Request ::= (self contained) */
101       atp = AsnReadId(aip, amp, TAXON3_REQUEST);
102    } else {
103       atp = AsnLinkType(orig, TAXON3_REQUEST);
104    }
105    /* link in local tree */
106    if (atp == NULL) {
107       return NULL;
108    }
109 
110    ptr = Taxon3RequestNew();
111    if (ptr == NULL) {
112       goto erret;
113    }
114    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
115       goto erret;
116    }
117 
118    atp = AsnReadId(aip,amp, atp);
119    func = NULL;
120 
121    if (atp == TAXON3_REQUEST_request) {
122       ptr -> request = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) T3RequestAsnRead, (AsnOptFreeFunc) T3RequestFree);
123       if (isError && ptr -> request == NULL) {
124          goto erret;
125       }
126       atp = AsnReadId(aip,amp, atp);
127    }
128 
129    if (AsnReadVal(aip, atp, &av) <= 0) {
130       goto erret;
131    }
132    /* end struct */
133 
134 ret:
135    AsnUnlinkType(orig);       /* unlink local tree */
136    return ptr;
137 
138 erret:
139    aip -> io_failure = TRUE;
140    ptr = Taxon3RequestFree(ptr);
141    goto ret;
142 }
143 
144 
145 
146 /**************************************************
147 *
148 *    Taxon3RequestAsnWrite()
149 *
150 **************************************************/
151 NLM_EXTERN Boolean LIBCALL 
152 Taxon3RequestAsnWrite(Taxon3RequestPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
153 {
154    AsnTypePtr atp;
155    Boolean retval = FALSE;
156 
157    if (! loaded)
158    {
159       if (! objtax3AsnLoad()) {
160          return FALSE;
161       }
162    }
163 
164    if (aip == NULL) {
165       return FALSE;
166    }
167 
168    atp = AsnLinkType(orig, TAXON3_REQUEST);   /* link local tree */
169    if (atp == NULL) {
170       return FALSE;
171    }
172 
173    if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
174    if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
175       goto erret;
176    }
177 
178    AsnGenericChoiceSeqOfAsnWrite(ptr -> request, (AsnWriteFunc) T3RequestAsnWrite, aip, TAXON3_REQUEST_request, TAXON3_REQUEST_request_E);
179    if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
180       goto erret;
181    }
182    retval = TRUE;
183 
184 erret:
185    AsnUnlinkType(orig);       /* unlink local tree */
186    return retval;
187 }
188 
189 
190 
191 /**************************************************
192 *
193 *    T3RequestFree()
194 *
195 **************************************************/
196 NLM_EXTERN 
197 T3RequestPtr LIBCALL
198 T3RequestFree(ValNodePtr anp)
199 {
200    Pointer pnt;
201 
202    if (anp == NULL) {
203       return NULL;
204    }
205 
206    pnt = anp->data.ptrvalue;
207    switch (anp->choice)
208    {
209    default:
210       break;
211    case T3Request_name:
212       MemFree(anp -> data.ptrvalue);
213       break;
214    case T3Request_org:
215       OrgRefFree(anp -> data.ptrvalue);
216       break;
217    case T3Request_join:
218       SequenceOfIntFree(anp -> data.ptrvalue);
219       break;
220    }
221    return MemFree(anp);
222 }
223 
224 
225 /**************************************************
226 *
227 *    T3RequestAsnRead()
228 *
229 **************************************************/
230 NLM_EXTERN 
231 T3RequestPtr LIBCALL
232 T3RequestAsnRead(AsnIoPtr aip, AsnTypePtr orig)
233 {
234    DataVal av;
235    AsnTypePtr atp;
236    ValNodePtr anp;
237    Uint1 choice;
238    Boolean nullIsError = FALSE;
239    AsnReadFunc func;
240 
241    if (! loaded)
242    {
243       if (! objtax3AsnLoad()) {
244          return NULL;
245       }
246    }
247 
248    if (aip == NULL) {
249       return NULL;
250    }
251 
252    if (orig == NULL) {         /* T3Request ::= (self contained) */
253       atp = AsnReadId(aip, amp, T3REQUEST);
254    } else {
255       atp = AsnLinkType(orig, T3REQUEST);    /* link in local tree */
256    }
257    if (atp == NULL) {
258       return NULL;
259    }
260 
261    anp = ValNodeNew(NULL);
262    if (anp == NULL) {
263       goto erret;
264    }
265    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */
266       goto erret;
267    }
268 
269    func = NULL;
270 
271    atp = AsnReadId(aip, amp, atp);  /* find the choice */
272    if (atp == NULL) {
273       goto erret;
274    }
275    if (atp == T3REQUEST_taxid) {
276       choice = T3Request_taxid;
277       if (AsnReadVal(aip, atp, &av) <= 0) {
278          goto erret;
279       }
280       anp->data.intvalue = av.intvalue;
281    }
282    else if (atp == T3REQUEST_name) {
283       choice = T3Request_name;
284       if (AsnReadVal(aip, atp, &av) <= 0) {
285          goto erret;
286       }
287       anp->data.ptrvalue = av.ptrvalue;
288    }
289    else if (atp == T3REQUEST_org) {
290       choice = T3Request_org;
291       func = (AsnReadFunc) OrgRefAsnRead;
292    }
293    else if (atp == T3REQUEST_join) {
294       choice = T3Request_join;
295       func = (AsnReadFunc) SequenceOfIntAsnRead;
296    }
297    anp->choice = choice;
298    if (func != NULL)
299    {
300       anp->data.ptrvalue = (* func)(aip, atp);
301       if (aip -> io_failure) goto erret;
302 
303       if (nullIsError && anp->data.ptrvalue == NULL) {
304          goto erret;
305       }
306    }
307 
308 ret:
309    AsnUnlinkType(orig);       /* unlink local tree */
310    return anp;
311 
312 erret:
313    anp = MemFree(anp);
314    aip -> io_failure = TRUE;
315    goto ret;
316 }
317 
318 
319 /**************************************************
320 *
321 *    T3RequestAsnWrite()
322 *
323 **************************************************/
324 NLM_EXTERN Boolean LIBCALL 
325 T3RequestAsnWrite(T3RequestPtr anp, AsnIoPtr aip, AsnTypePtr orig)
326 
327 {
328    DataVal av;
329    AsnTypePtr atp, writetype = NULL;
330    Pointer pnt;
331    AsnWriteFunc func = NULL;
332    Boolean retval = FALSE;
333 
334    if (! loaded)
335    {
336       if (! objtax3AsnLoad())
337       return FALSE;
338    }
339 
340    if (aip == NULL)
341    return FALSE;
342 
343    atp = AsnLinkType(orig, T3REQUEST);   /* link local tree */
344    if (atp == NULL) {
345       return FALSE;
346    }
347 
348    if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
349 
350    av.ptrvalue = (Pointer)anp;
351    if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) {
352       goto erret;
353    }
354 
355    pnt = anp->data.ptrvalue;
356    switch (anp->choice)
357    {
358    case T3Request_taxid:
359       av.intvalue = anp->data.intvalue;
360       retval = AsnWrite(aip, T3REQUEST_taxid, &av);
361       break;
362    case T3Request_name:
363       av.ptrvalue = anp->data.ptrvalue;
364       retval = AsnWrite(aip, T3REQUEST_name, &av);
365       break;
366    case T3Request_org:
367       writetype = T3REQUEST_org;
368       func = (AsnWriteFunc) OrgRefAsnWrite;
369       break;
370    case T3Request_join:
371       writetype = T3REQUEST_join;
372       func = (AsnWriteFunc) SequenceOfIntAsnWrite;
373       break;
374    }
375    if (writetype != NULL) {
376       retval = (* func)(pnt, aip, writetype);   /* write it out */
377    }
378    if (!retval) {
379       goto erret;
380    }
381    retval = TRUE;
382 
383 erret:
384    AsnUnlinkType(orig);       /* unlink local tree */
385    return retval;
386 }
387 
388 
389 /**************************************************
390 *
391 *    SequenceOfIntFree()
392 *
393 **************************************************/
394 NLM_EXTERN 
395 SequenceOfIntPtr LIBCALL
396 SequenceOfIntFree(SequenceOfIntPtr ptr)
397 {
398 
399    if(ptr == NULL) {
400       return NULL;
401    }
402    AsnGenericBaseSeqOfFree(ptr,ASNCODE_INTVAL_SLOT);
403    return NULL;
404 }
405 
406 
407 /**************************************************
408 *
409 *    SequenceOfIntAsnRead()
410 *
411 **************************************************/
412 NLM_EXTERN 
413 SequenceOfIntPtr LIBCALL
414 SequenceOfIntAsnRead(AsnIoPtr aip, AsnTypePtr orig)
415 {
416    AsnTypePtr atp;
417    Boolean isError = FALSE;
418    AsnReadFunc func;
419    SequenceOfIntPtr ptr;
420 
421    if (! loaded)
422    {
423       if (! objtax3AsnLoad()) {
424          return NULL;
425       }
426    }
427 
428    if (aip == NULL) {
429       return NULL;
430    }
431 
432    if (orig == NULL) {         /* SequenceOfInt ::= (self contained) */
433       atp = AsnReadId(aip, amp, SEQUENCEOFINT);
434    } else {
435       atp = AsnLinkType(orig, SEQUENCEOFINT);
436    }
437    /* link in local tree */
438    if (atp == NULL) {
439       return NULL;
440    }
441 
442    func = NULL;
443 
444    ptr  = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError);
445    if (isError && ptr  == NULL) {
446       goto erret;
447    }
448 
449 
450 
451 ret:
452    AsnUnlinkType(orig);       /* unlink local tree */
453    return ptr;
454 
455 erret:
456    aip -> io_failure = TRUE;
457    ptr = SequenceOfIntFree(ptr);
458    goto ret;
459 }
460 
461 
462 
463 /**************************************************
464 *
465 *    SequenceOfIntAsnWrite()
466 *
467 **************************************************/
468 NLM_EXTERN Boolean LIBCALL 
469 SequenceOfIntAsnWrite(SequenceOfIntPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
470 {
471    AsnTypePtr atp;
472    Boolean retval = FALSE;
473 
474    if (! loaded)
475    {
476       if (! objtax3AsnLoad()) {
477          return FALSE;
478       }
479    }
480 
481    if (aip == NULL) {
482       return FALSE;
483    }
484 
485    atp = AsnLinkType(orig, SEQUENCEOFINT);   /* link local tree */
486    if (atp == NULL) {
487       return FALSE;
488    }
489 
490    if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
491    retval = AsnGenericBaseSeqOfAsnWrite(ptr, ASNCODE_INTVAL_SLOT, aip, atp, SEQUENCEOFINT_E);
492    retval = TRUE;
493 
494 erret:
495    AsnUnlinkType(orig);       /* unlink local tree */
496    return retval;
497 }
498 
499 
500 
501 /**************************************************
502 *
503 *    Taxon3ReplyNew()
504 *
505 **************************************************/
506 NLM_EXTERN 
507 Taxon3ReplyPtr LIBCALL
508 Taxon3ReplyNew(void)
509 {
510    Taxon3ReplyPtr ptr = MemNew((size_t) sizeof(Taxon3Reply));
511 
512    return ptr;
513 
514 }
515 
516 
517 /**************************************************
518 *
519 *    Taxon3ReplyFree()
520 *
521 **************************************************/
522 NLM_EXTERN 
523 Taxon3ReplyPtr LIBCALL
524 Taxon3ReplyFree(Taxon3ReplyPtr ptr)
525 {
526 
527    if(ptr == NULL) {
528       return NULL;
529    }
530    AsnGenericChoiceSeqOfFree(ptr -> reply, (AsnOptFreeFunc) T3ReplyFree);
531    return MemFree(ptr);
532 }
533 
534 
535 /**************************************************
536 *
537 *    Taxon3ReplyAsnRead()
538 *
539 **************************************************/
540 NLM_EXTERN 
541 Taxon3ReplyPtr LIBCALL
542 Taxon3ReplyAsnRead(AsnIoPtr aip, AsnTypePtr orig)
543 {
544    DataVal av;
545    AsnTypePtr atp;
546    Boolean isError = FALSE;
547    AsnReadFunc func;
548    Taxon3ReplyPtr ptr;
549 
550    if (! loaded)
551    {
552       if (! objtax3AsnLoad()) {
553          return NULL;
554       }
555    }
556 
557    if (aip == NULL) {
558       return NULL;
559    }
560 
561    if (orig == NULL) {         /* Taxon3Reply ::= (self contained) */
562       atp = AsnReadId(aip, amp, TAXON3_REPLY);
563    } else {
564       atp = AsnLinkType(orig, TAXON3_REPLY);
565    }
566    /* link in local tree */
567    if (atp == NULL) {
568       return NULL;
569    }
570 
571    ptr = Taxon3ReplyNew();
572    if (ptr == NULL) {
573       goto erret;
574    }
575    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
576       goto erret;
577    }
578 
579    atp = AsnReadId(aip,amp, atp);
580    func = NULL;
581 
582    if (atp == TAXON3_REPLY_reply) {
583       ptr -> reply = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) T3ReplyAsnRead, (AsnOptFreeFunc) T3ReplyFree);
584       if (isError && ptr -> reply == NULL) {
585          goto erret;
586       }
587       atp = AsnReadId(aip,amp, atp);
588    }
589 
590    if (AsnReadVal(aip, atp, &av) <= 0) {
591       goto erret;
592    }
593    /* end struct */
594 
595 ret:
596    AsnUnlinkType(orig);       /* unlink local tree */
597    return ptr;
598 
599 erret:
600    aip -> io_failure = TRUE;
601    ptr = Taxon3ReplyFree(ptr);
602    goto ret;
603 }
604 
605 
606 
607 /**************************************************
608 *
609 *    Taxon3ReplyAsnWrite()
610 *
611 **************************************************/
612 NLM_EXTERN Boolean LIBCALL 
613 Taxon3ReplyAsnWrite(Taxon3ReplyPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
614 {
615    AsnTypePtr atp;
616    Boolean retval = FALSE;
617 
618    if (! loaded)
619    {
620       if (! objtax3AsnLoad()) {
621          return FALSE;
622       }
623    }
624 
625    if (aip == NULL) {
626       return FALSE;
627    }
628 
629    atp = AsnLinkType(orig, TAXON3_REPLY);   /* link local tree */
630    if (atp == NULL) {
631       return FALSE;
632    }
633 
634    if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
635    if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
636       goto erret;
637    }
638 
639    AsnGenericChoiceSeqOfAsnWrite(ptr -> reply, (AsnWriteFunc) T3ReplyAsnWrite, aip, TAXON3_REPLY_reply, TAXON3_REPLY_reply_E);
640    if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
641       goto erret;
642    }
643    retval = TRUE;
644 
645 erret:
646    AsnUnlinkType(orig);       /* unlink local tree */
647    return retval;
648 }
649 
650 
651 
652 /**************************************************
653 *
654 *    T3ReplyFree()
655 *
656 **************************************************/
657 NLM_EXTERN 
658 T3ReplyPtr LIBCALL
659 T3ReplyFree(ValNodePtr anp)
660 {
661    Pointer pnt;
662 
663    if (anp == NULL) {
664       return NULL;
665    }
666 
667    pnt = anp->data.ptrvalue;
668    switch (anp->choice)
669    {
670    default:
671       break;
672    case T3Reply_error:
673       T3ErrorFree(anp -> data.ptrvalue);
674       break;
675    case T3Reply_data:
676       T3DataFree(anp -> data.ptrvalue);
677       break;
678    }
679    return MemFree(anp);
680 }
681 
682 
683 /**************************************************
684 *
685 *    T3ReplyAsnRead()
686 *
687 **************************************************/
688 NLM_EXTERN 
689 T3ReplyPtr LIBCALL
690 T3ReplyAsnRead(AsnIoPtr aip, AsnTypePtr orig)
691 {
692    DataVal av;
693    AsnTypePtr atp;
694    ValNodePtr anp;
695    Uint1 choice;
696    Boolean nullIsError = FALSE;
697    AsnReadFunc func;
698 
699    if (! loaded)
700    {
701       if (! objtax3AsnLoad()) {
702          return NULL;
703       }
704    }
705 
706    if (aip == NULL) {
707       return NULL;
708    }
709 
710    if (orig == NULL) {         /* T3Reply ::= (self contained) */
711       atp = AsnReadId(aip, amp, T3REPLY);
712    } else {
713       atp = AsnLinkType(orig, T3REPLY);    /* link in local tree */
714    }
715    if (atp == NULL) {
716       return NULL;
717    }
718 
719    anp = ValNodeNew(NULL);
720    if (anp == NULL) {
721       goto erret;
722    }
723    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */
724       goto erret;
725    }
726 
727    func = NULL;
728 
729    atp = AsnReadId(aip, amp, atp);  /* find the choice */
730    if (atp == NULL) {
731       goto erret;
732    }
733    if (atp == T3REPLY_error) {
734       choice = T3Reply_error;
735       func = (AsnReadFunc) T3ErrorAsnRead;
736    }
737    else if (atp == T3REPLY_data) {
738       choice = T3Reply_data;
739       func = (AsnReadFunc) T3DataAsnRead;
740    }
741    anp->choice = choice;
742    if (func != NULL)
743    {
744       anp->data.ptrvalue = (* func)(aip, atp);
745       if (aip -> io_failure) goto erret;
746 
747       if (nullIsError && anp->data.ptrvalue == NULL) {
748          goto erret;
749       }
750    }
751 
752 ret:
753    AsnUnlinkType(orig);       /* unlink local tree */
754    return anp;
755 
756 erret:
757    anp = MemFree(anp);
758    aip -> io_failure = TRUE;
759    goto ret;
760 }
761 
762 
763 /**************************************************
764 *
765 *    T3ReplyAsnWrite()
766 *
767 **************************************************/
768 NLM_EXTERN Boolean LIBCALL 
769 T3ReplyAsnWrite(T3ReplyPtr anp, AsnIoPtr aip, AsnTypePtr orig)
770 
771 {
772    DataVal av;
773    AsnTypePtr atp, writetype = NULL;
774    Pointer pnt;
775    AsnWriteFunc func = NULL;
776    Boolean retval = FALSE;
777 
778    if (! loaded)
779    {
780       if (! objtax3AsnLoad())
781       return FALSE;
782    }
783 
784    if (aip == NULL)
785    return FALSE;
786 
787    atp = AsnLinkType(orig, T3REPLY);   /* link local tree */
788    if (atp == NULL) {
789       return FALSE;
790    }
791 
792    if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
793 
794    av.ptrvalue = (Pointer)anp;
795    if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) {
796       goto erret;
797    }
798 
799    pnt = anp->data.ptrvalue;
800    switch (anp->choice)
801    {
802    case T3Reply_error:
803       writetype = T3REPLY_error;
804       func = (AsnWriteFunc) T3ErrorAsnWrite;
805       break;
806    case T3Reply_data:
807       writetype = T3REPLY_data;
808       func = (AsnWriteFunc) T3DataAsnWrite;
809       break;
810    }
811    if (writetype != NULL) {
812       retval = (* func)(pnt, aip, writetype);   /* write it out */
813    }
814    if (!retval) {
815       goto erret;
816    }
817    retval = TRUE;
818 
819 erret:
820    AsnUnlinkType(orig);       /* unlink local tree */
821    return retval;
822 }
823 
824 
825 /**************************************************
826 *
827 *    T3ErrorNew()
828 *
829 **************************************************/
830 NLM_EXTERN 
831 T3ErrorPtr LIBCALL
832 T3ErrorNew(void)
833 {
834    T3ErrorPtr ptr = MemNew((size_t) sizeof(T3Error));
835 
836    return ptr;
837 
838 }
839 
840 
841 /**************************************************
842 *
843 *    T3ErrorFree()
844 *
845 **************************************************/
846 NLM_EXTERN 
847 T3ErrorPtr LIBCALL
848 T3ErrorFree(T3ErrorPtr ptr)
849 {
850 
851    if(ptr == NULL) {
852       return NULL;
853    }
854    MemFree(ptr -> message);
855    MemFree(ptr -> name);
856    OrgRefFree(ptr -> org);
857    return MemFree(ptr);
858 }
859 
860 
861 /**************************************************
862 *
863 *    T3ErrorAsnRead()
864 *
865 **************************************************/
866 NLM_EXTERN 
867 T3ErrorPtr LIBCALL
868 T3ErrorAsnRead(AsnIoPtr aip, AsnTypePtr orig)
869 {
870    DataVal av;
871    AsnTypePtr atp;
872    AsnReadFunc func;
873    T3ErrorPtr ptr;
874 
875    if (! loaded)
876    {
877       if (! objtax3AsnLoad()) {
878          return NULL;
879       }
880    }
881 
882    if (aip == NULL) {
883       return NULL;
884    }
885 
886    if (orig == NULL) {         /* T3Error ::= (self contained) */
887       atp = AsnReadId(aip, amp, T3ERROR);
888    } else {
889       atp = AsnLinkType(orig, T3ERROR);
890    }
891    /* link in local tree */
892    if (atp == NULL) {
893       return NULL;
894    }
895 
896    ptr = T3ErrorNew();
897    if (ptr == NULL) {
898       goto erret;
899    }
900    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
901       goto erret;
902    }
903 
904    atp = AsnReadId(aip,amp, atp);
905    func = NULL;
906 
907    if (atp == T3ERROR_level) {
908       if ( AsnReadVal(aip, atp, &av) <= 0) {
909          goto erret;
910       }
911       ptr -> level = av.intvalue;
912       atp = AsnReadId(aip,amp, atp);
913    }
914    if (atp == T3ERROR_message) {
915       if ( AsnReadVal(aip, atp, &av) <= 0) {
916          goto erret;
917       }
918       ptr -> message = av.ptrvalue;
919       atp = AsnReadId(aip,amp, atp);
920    }
921    if (atp == T3ERROR_taxid) {
922       if ( AsnReadVal(aip, atp, &av) <= 0) {
923          goto erret;
924       }
925       ptr -> taxid = av.intvalue;
926       atp = AsnReadId(aip,amp, atp);
927    }
928    if (atp == T3ERROR_name) {
929       if ( AsnReadVal(aip, atp, &av) <= 0) {
930          goto erret;
931       }
932       ptr -> name = av.ptrvalue;
933       atp = AsnReadId(aip,amp, atp);
934    }
935    if (atp == T3ERROR_org) {
936       ptr -> org = OrgRefAsnRead(aip, atp);
937       if (aip -> io_failure) {
938          goto erret;
939       }
940       atp = AsnReadId(aip,amp, atp);
941    }
942 
943    if (AsnReadVal(aip, atp, &av) <= 0) {
944       goto erret;
945    }
946    /* end struct */
947 
948 ret:
949    AsnUnlinkType(orig);       /* unlink local tree */
950    return ptr;
951 
952 erret:
953    aip -> io_failure = TRUE;
954    ptr = T3ErrorFree(ptr);
955    goto ret;
956 }
957 
958 
959 
960 /**************************************************
961 *
962 *    T3ErrorAsnWrite()
963 *
964 **************************************************/
965 NLM_EXTERN Boolean LIBCALL 
966 T3ErrorAsnWrite(T3ErrorPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
967 {
968    DataVal av;
969    AsnTypePtr atp;
970    Boolean retval = FALSE;
971 
972    if (! loaded)
973    {
974       if (! objtax3AsnLoad()) {
975          return FALSE;
976       }
977    }
978 
979    if (aip == NULL) {
980       return FALSE;
981    }
982 
983    atp = AsnLinkType(orig, T3ERROR);   /* link local tree */
984    if (atp == NULL) {
985       return FALSE;
986    }
987 
988    if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
989    if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
990       goto erret;
991    }
992 
993    av.intvalue = ptr -> level;
994    retval = AsnWrite(aip, T3ERROR_level,  &av);
995    if (ptr -> message != NULL) {
996       av.ptrvalue = ptr -> message;
997       retval = AsnWrite(aip, T3ERROR_message,  &av);
998    }
999    av.intvalue = ptr -> taxid;
1000    retval = AsnWrite(aip, T3ERROR_taxid,  &av);
1001    if (ptr -> name != NULL) {
1002       av.ptrvalue = ptr -> name;
1003       retval = AsnWrite(aip, T3ERROR_name,  &av);
1004    }
1005    if (ptr -> org != NULL) {
1006       if ( ! OrgRefAsnWrite(ptr -> org, aip, T3ERROR_org)) {
1007          goto erret;
1008       }
1009    }
1010    if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1011       goto erret;
1012    }
1013    retval = TRUE;
1014 
1015 erret:
1016    AsnUnlinkType(orig);       /* unlink local tree */
1017    return retval;
1018 }
1019 
1020 
1021 
1022 /**************************************************
1023 *
1024 *    T3DataNew()
1025 *
1026 **************************************************/
1027 NLM_EXTERN 
1028 T3DataPtr LIBCALL
1029 T3DataNew(void)
1030 {
1031    T3DataPtr ptr = MemNew((size_t) sizeof(T3Data));
1032 
1033    return ptr;
1034 
1035 }
1036 
1037 
1038 /**************************************************
1039 *
1040 *    T3DataFree()
1041 *
1042 **************************************************/
1043 NLM_EXTERN 
1044 T3DataPtr LIBCALL
1045 T3DataFree(T3DataPtr ptr)
1046 {
1047 
1048    if(ptr == NULL) {
1049       return NULL;
1050    }
1051    OrgRefFree(ptr -> org);
1052    AsnGenericBaseSeqOfFree(ptr -> blast_name_lineage ,ASNCODE_PTRVAL_SLOT);
1053    AsnGenericUserSeqOfFree(ptr -> status, (AsnOptFreeFunc) T3StatusFlagsFree);
1054    T3RefreshFlagsFree(ptr -> refresh);
1055    return MemFree(ptr);
1056 }
1057 
1058 
1059 /**************************************************
1060 *
1061 *    T3DataAsnRead()
1062 *
1063 **************************************************/
1064 NLM_EXTERN 
1065 T3DataPtr LIBCALL
1066 T3DataAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1067 {
1068    DataVal av;
1069    AsnTypePtr atp;
1070    Boolean isError = FALSE;
1071    AsnReadFunc func;
1072    T3DataPtr ptr;
1073 
1074    if (! loaded)
1075    {
1076       if (! objtax3AsnLoad()) {
1077          return NULL;
1078       }
1079    }
1080 
1081    if (aip == NULL) {
1082       return NULL;
1083    }
1084 
1085    if (orig == NULL) {         /* T3Data ::= (self contained) */
1086       atp = AsnReadId(aip, amp, T3DATA);
1087    } else {
1088       atp = AsnLinkType(orig, T3DATA);
1089    }
1090    /* link in local tree */
1091    if (atp == NULL) {
1092       return NULL;
1093    }
1094 
1095    ptr = T3DataNew();
1096    if (ptr == NULL) {
1097       goto erret;
1098    }
1099    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
1100       goto erret;
1101    }
1102 
1103    atp = AsnReadId(aip,amp, atp);
1104    func = NULL;
1105 
1106    if (atp == T3DATA_org) {
1107       ptr -> org = OrgRefAsnRead(aip, atp);
1108       if (aip -> io_failure) {
1109          goto erret;
1110       }
1111       atp = AsnReadId(aip,amp, atp);
1112    }
1113    if (atp == T3DATA_blast_name_lineage) {
1114       ptr -> blast_name_lineage = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
1115       if (isError && ptr -> blast_name_lineage == NULL) {
1116          goto erret;
1117       }
1118       atp = AsnReadId(aip,amp, atp);
1119    }
1120    if (atp == T3DATA_status) {
1121       ptr -> status = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) T3StatusFlagsAsnRead, (AsnOptFreeFunc) T3StatusFlagsFree);
1122       if (isError && ptr -> status == NULL) {
1123          goto erret;
1124       }
1125       atp = AsnReadId(aip,amp, atp);
1126    }
1127    if (atp == T3DATA_refresh) {
1128       ptr -> refresh = T3RefreshFlagsAsnRead(aip, atp);
1129       if (aip -> io_failure) {
1130          goto erret;
1131       }
1132       atp = AsnReadId(aip,amp, atp);
1133    }
1134 
1135    if (AsnReadVal(aip, atp, &av) <= 0) {
1136       goto erret;
1137    }
1138    /* end struct */
1139 
1140 ret:
1141    AsnUnlinkType(orig);       /* unlink local tree */
1142    return ptr;
1143 
1144 erret:
1145    aip -> io_failure = TRUE;
1146    ptr = T3DataFree(ptr);
1147    goto ret;
1148 }
1149 
1150 
1151 
1152 /**************************************************
1153 *
1154 *    T3DataAsnWrite()
1155 *
1156 **************************************************/
1157 NLM_EXTERN Boolean LIBCALL 
1158 T3DataAsnWrite(T3DataPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
1159 {
1160    AsnTypePtr atp;
1161    Boolean retval = FALSE;
1162 
1163    if (! loaded)
1164    {
1165       if (! objtax3AsnLoad()) {
1166          return FALSE;
1167       }
1168    }
1169 
1170    if (aip == NULL) {
1171       return FALSE;
1172    }
1173 
1174    atp = AsnLinkType(orig, T3DATA);   /* link local tree */
1175    if (atp == NULL) {
1176       return FALSE;
1177    }
1178 
1179    if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
1180    if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
1181       goto erret;
1182    }
1183 
1184    if (ptr -> org != NULL) {
1185       if ( ! OrgRefAsnWrite(ptr -> org, aip, T3DATA_org)) {
1186          goto erret;
1187       }
1188    }
1189    retval = AsnGenericBaseSeqOfAsnWrite(ptr -> blast_name_lineage ,ASNCODE_PTRVAL_SLOT, aip, T3DATA_blast_name_lineage, T3DATA_blast_name_lineage_E);
1190    AsnGenericUserSeqOfAsnWrite(ptr -> status, (AsnWriteFunc) T3StatusFlagsAsnWrite, aip, T3DATA_status, T3DATA_status_E);
1191    if (ptr -> refresh != NULL) {
1192       if ( ! T3RefreshFlagsAsnWrite(ptr -> refresh, aip, T3DATA_refresh)) {
1193          goto erret;
1194       }
1195    }
1196    if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1197       goto erret;
1198    }
1199    retval = TRUE;
1200 
1201 erret:
1202    AsnUnlinkType(orig);       /* unlink local tree */
1203    return retval;
1204 }
1205 
1206 
1207 
1208 /**************************************************
1209 *
1210 *    T3StatusFlagsNew()
1211 *
1212 **************************************************/
1213 NLM_EXTERN 
1214 T3StatusFlagsPtr LIBCALL
1215 T3StatusFlagsNew(void)
1216 {
1217    T3StatusFlagsPtr ptr = MemNew((size_t) sizeof(T3StatusFlags));
1218 
1219    return ptr;
1220 
1221 }
1222 
1223 
1224 /**************************************************
1225 *
1226 *    T3StatusFlagsFree()
1227 *
1228 **************************************************/
1229 NLM_EXTERN 
1230 T3StatusFlagsPtr LIBCALL
1231 T3StatusFlagsFree(T3StatusFlagsPtr ptr)
1232 {
1233 
1234    if(ptr == NULL) {
1235       return NULL;
1236    }
1237    MemFree(ptr -> property);
1238    Value_valueFree(ptr -> Value_value);
1239    return MemFree(ptr);
1240 }
1241 
1242 
1243 /**************************************************
1244 *
1245 *    Value_valueFree()
1246 *
1247 **************************************************/
1248 static 
1249 Value_valuePtr LIBCALL
1250 Value_valueFree(ValNodePtr anp)
1251 {
1252    Pointer pnt;
1253 
1254    if (anp == NULL) {
1255       return NULL;
1256    }
1257 
1258    pnt = anp->data.ptrvalue;
1259    switch (anp->choice)
1260    {
1261    default:
1262       break;
1263    case Value_value_str:
1264       MemFree(anp -> data.ptrvalue);
1265       break;
1266    }
1267    return MemFree(anp);
1268 }
1269 
1270 
1271 /**************************************************
1272 *
1273 *    T3StatusFlagsAsnRead()
1274 *
1275 **************************************************/
1276 NLM_EXTERN 
1277 T3StatusFlagsPtr LIBCALL
1278 T3StatusFlagsAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1279 {
1280    DataVal av;
1281    AsnTypePtr atp;
1282    AsnReadFunc func;
1283    T3StatusFlagsPtr ptr;
1284 
1285    if (! loaded)
1286    {
1287       if (! objtax3AsnLoad()) {
1288          return NULL;
1289       }
1290    }
1291 
1292    if (aip == NULL) {
1293       return NULL;
1294    }
1295 
1296    if (orig == NULL) {         /* T3StatusFlags ::= (self contained) */
1297       atp = AsnReadId(aip, amp, T3STATUSFLAGS);
1298    } else {
1299       atp = AsnLinkType(orig, T3STATUSFLAGS);
1300    }
1301    /* link in local tree */
1302    if (atp == NULL) {
1303       return NULL;
1304    }
1305 
1306    ptr = T3StatusFlagsNew();
1307    if (ptr == NULL) {
1308       goto erret;
1309    }
1310    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
1311       goto erret;
1312    }
1313 
1314    atp = AsnReadId(aip,amp, atp);
1315    func = NULL;
1316 
1317    if (atp == T3STATUSFLAGS_property) {
1318       if ( AsnReadVal(aip, atp, &av) <= 0) {
1319          goto erret;
1320       }
1321       ptr -> property = av.ptrvalue;
1322       atp = AsnReadId(aip,amp, atp);
1323    }
1324    if (atp == T3STATUSFLAGS_value) {
1325       ptr -> Value_value = Value_valueAsnRead(aip, atp);
1326       if (aip -> io_failure) {
1327          goto erret;
1328       }
1329       atp = AsnReadId(aip,amp, atp);
1330    }
1331 
1332    if (AsnReadVal(aip, atp, &av) <= 0) {
1333       goto erret;
1334    }
1335    /* end struct */
1336 
1337 ret:
1338    AsnUnlinkType(orig);       /* unlink local tree */
1339    return ptr;
1340 
1341 erret:
1342    aip -> io_failure = TRUE;
1343    ptr = T3StatusFlagsFree(ptr);
1344    goto ret;
1345 }
1346 
1347 
1348 
1349 /**************************************************
1350 *
1351 *    Value_valueAsnRead()
1352 *
1353 **************************************************/
1354 static 
1355 Value_valuePtr LIBCALL
1356 Value_valueAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1357 {
1358    DataVal av;
1359    AsnTypePtr atp;
1360    ValNodePtr anp;
1361    Uint1 choice;
1362    Boolean nullIsError = FALSE;
1363    AsnReadFunc func;
1364 
1365    if (! loaded)
1366    {
1367       if (! objtax3AsnLoad()) {
1368          return NULL;
1369       }
1370    }
1371 
1372    if (aip == NULL) {
1373       return NULL;
1374    }
1375 
1376    if (orig == NULL) {         /* Value_value ::= (self contained) */
1377       atp = AsnReadId(aip, amp, T3STATUSFLAGS_value);
1378    } else {
1379       atp = AsnLinkType(orig, T3STATUSFLAGS_value);    /* link in local tree */
1380    }
1381    if (atp == NULL) {
1382       return NULL;
1383    }
1384 
1385    anp = ValNodeNew(NULL);
1386    if (anp == NULL) {
1387       goto erret;
1388    }
1389    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */
1390       goto erret;
1391    }
1392 
1393    func = NULL;
1394 
1395    atp = AsnReadId(aip, amp, atp);  /* find the choice */
1396    if (atp == NULL) {
1397       goto erret;
1398    }
1399    if (atp == T3STATUSFLAGS_value_bool) {
1400       choice = Value_value_bool;
1401       if (AsnReadVal(aip, atp, &av) <= 0) {
1402          goto erret;
1403       }
1404       anp->data.boolvalue = av.boolvalue;
1405    }
1406    else if (atp == T3STATUSFLAGS_value_int) {
1407       choice = Value_value_int__;
1408       if (AsnReadVal(aip, atp, &av) <= 0) {
1409          goto erret;
1410       }
1411       anp->data.intvalue = av.intvalue;
1412    }
1413    else if (atp == T3STATUSFLAGS_value_str) {
1414       choice = Value_value_str;
1415       if (AsnReadVal(aip, atp, &av) <= 0) {
1416          goto erret;
1417       }
1418       anp->data.ptrvalue = av.ptrvalue;
1419    }
1420    anp->choice = choice;
1421    if (func != NULL)
1422    {
1423       anp->data.ptrvalue = (* func)(aip, atp);
1424       if (aip -> io_failure) goto erret;
1425 
1426       if (nullIsError && anp->data.ptrvalue == NULL) {
1427          goto erret;
1428       }
1429    }
1430 
1431 ret:
1432    AsnUnlinkType(orig);       /* unlink local tree */
1433    return anp;
1434 
1435 erret:
1436    anp = MemFree(anp);
1437    aip -> io_failure = TRUE;
1438    goto ret;
1439 }
1440 
1441 
1442 /**************************************************
1443 *
1444 *    T3StatusFlagsAsnWrite()
1445 *
1446 **************************************************/
1447 NLM_EXTERN Boolean LIBCALL 
1448 T3StatusFlagsAsnWrite(T3StatusFlagsPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
1449 {
1450    DataVal av;
1451    AsnTypePtr atp;
1452    Boolean retval = FALSE;
1453 
1454    if (! loaded)
1455    {
1456       if (! objtax3AsnLoad()) {
1457          return FALSE;
1458       }
1459    }
1460 
1461    if (aip == NULL) {
1462       return FALSE;
1463    }
1464 
1465    atp = AsnLinkType(orig, T3STATUSFLAGS);   /* link local tree */
1466    if (atp == NULL) {
1467       return FALSE;
1468    }
1469 
1470    if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
1471    if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
1472       goto erret;
1473    }
1474 
1475    if (ptr -> property != NULL) {
1476       av.ptrvalue = ptr -> property;
1477       retval = AsnWrite(aip, T3STATUSFLAGS_property,  &av);
1478    }
1479    if (ptr -> Value_value != NULL) {
1480       if ( ! Value_valueAsnWrite(ptr -> Value_value, aip, T3STATUSFLAGS_value)) {
1481          goto erret;
1482       }
1483    }
1484    if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1485       goto erret;
1486    }
1487    retval = TRUE;
1488 
1489 erret:
1490    AsnUnlinkType(orig);       /* unlink local tree */
1491    return retval;
1492 }
1493 
1494 
1495 
1496 /**************************************************
1497 *
1498 *    Value_valueAsnWrite()
1499 *
1500 **************************************************/
1501 static Boolean LIBCALL 
1502 Value_valueAsnWrite(Value_valuePtr anp, AsnIoPtr aip, AsnTypePtr orig)
1503 
1504 {
1505    DataVal av;
1506    AsnTypePtr atp, writetype = NULL;
1507    Pointer pnt;
1508    AsnWriteFunc func = NULL;
1509    Boolean retval = FALSE;
1510 
1511    if (! loaded)
1512    {
1513       if (! objtax3AsnLoad())
1514       return FALSE;
1515    }
1516 
1517    if (aip == NULL)
1518    return FALSE;
1519 
1520    atp = AsnLinkType(orig, T3STATUSFLAGS_value);   /* link local tree */
1521    if (atp == NULL) {
1522       return FALSE;
1523    }
1524 
1525    if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
1526 
1527    av.ptrvalue = (Pointer)anp;
1528    if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) {
1529       goto erret;
1530    }
1531 
1532    pnt = anp->data.ptrvalue;
1533    switch (anp->choice)
1534    {
1535    case Value_value_bool:
1536       av.boolvalue = anp->data.boolvalue;
1537       retval = AsnWrite(aip, T3STATUSFLAGS_value_bool, &av);
1538       break;
1539    case Value_value_int__:
1540       av.intvalue = anp->data.intvalue;
1541       retval = AsnWrite(aip, T3STATUSFLAGS_value_int, &av);
1542       break;
1543    case Value_value_str:
1544       av.ptrvalue = anp->data.ptrvalue;
1545       retval = AsnWrite(aip, T3STATUSFLAGS_value_str, &av);
1546       break;
1547    }
1548    if (writetype != NULL) {
1549       retval = (* func)(pnt, aip, writetype);   /* write it out */
1550    }
1551    if (!retval) {
1552       goto erret;
1553    }
1554    retval = TRUE;
1555 
1556 erret:
1557    AsnUnlinkType(orig);       /* unlink local tree */
1558    return retval;
1559 }
1560 
1561 
1562 /**************************************************
1563 *
1564 *    T3RefreshFlagsNew()
1565 *
1566 **************************************************/
1567 NLM_EXTERN 
1568 T3RefreshFlagsPtr LIBCALL
1569 T3RefreshFlagsNew(void)
1570 {
1571    T3RefreshFlagsPtr ptr = MemNew((size_t) sizeof(T3RefreshFlags));
1572 
1573    return ptr;
1574 
1575 }
1576 
1577 
1578 /**************************************************
1579 *
1580 *    T3RefreshFlagsFree()
1581 *
1582 **************************************************/
1583 NLM_EXTERN 
1584 T3RefreshFlagsPtr LIBCALL
1585 T3RefreshFlagsFree(T3RefreshFlagsPtr ptr)
1586 {
1587 
1588    if(ptr == NULL) {
1589       return NULL;
1590    }
1591    return MemFree(ptr);
1592 }
1593 
1594 
1595 /**************************************************
1596 *
1597 *    T3RefreshFlagsAsnRead()
1598 *
1599 **************************************************/
1600 NLM_EXTERN 
1601 T3RefreshFlagsPtr LIBCALL
1602 T3RefreshFlagsAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1603 {
1604    DataVal av;
1605    AsnTypePtr atp;
1606    AsnReadFunc func;
1607    T3RefreshFlagsPtr ptr;
1608 
1609    if (! loaded)
1610    {
1611       if (! objtax3AsnLoad()) {
1612          return NULL;
1613       }
1614    }
1615 
1616    if (aip == NULL) {
1617       return NULL;
1618    }
1619 
1620    if (orig == NULL) {         /* T3RefreshFlags ::= (self contained) */
1621       atp = AsnReadId(aip, amp, T3REFRESHFLAGS);
1622    } else {
1623       atp = AsnLinkType(orig, T3REFRESHFLAGS);
1624    }
1625    /* link in local tree */
1626    if (atp == NULL) {
1627       return NULL;
1628    }
1629 
1630    ptr = T3RefreshFlagsNew();
1631    if (ptr == NULL) {
1632       goto erret;
1633    }
1634    if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
1635       goto erret;
1636    }
1637 
1638    atp = AsnReadId(aip,amp, atp);
1639    func = NULL;
1640 
1641    if (atp == T3REFRESHFLAGS_taxid_changed) {
1642       if ( AsnReadVal(aip, atp, &av) <= 0) {
1643          goto erret;
1644       }
1645       ptr -> taxid_changed = av.boolvalue;
1646       atp = AsnReadId(aip,amp, atp);
1647    }
1648    if (atp == T3REFRESHFLAGS_taxname_changed) {
1649       if ( AsnReadVal(aip, atp, &av) <= 0) {
1650          goto erret;
1651       }
1652       ptr -> taxname_changed = av.boolvalue;
1653       atp = AsnReadId(aip,amp, atp);
1654    }
1655    if (atp == T3REFRESHFLAGS_division_changed) {
1656       if ( AsnReadVal(aip, atp, &av) <= 0) {
1657          goto erret;
1658       }
1659       ptr -> division_changed = av.boolvalue;
1660       atp = AsnReadId(aip,amp, atp);
1661    }
1662    if (atp == T3REFRESHFLAGS_lineage_changed) {
1663       if ( AsnReadVal(aip, atp, &av) <= 0) {
1664          goto erret;
1665       }
1666       ptr -> lineage_changed = av.boolvalue;
1667       atp = AsnReadId(aip,amp, atp);
1668    }
1669    if (atp == T3REFRESHFLAGS_gc_changed) {
1670       if ( AsnReadVal(aip, atp, &av) <= 0) {
1671          goto erret;
1672       }
1673       ptr -> gc_changed = av.boolvalue;
1674       atp = AsnReadId(aip,amp, atp);
1675    }
1676    if (atp == T3REFRESHFLAGS_mgc_changed) {
1677       if ( AsnReadVal(aip, atp, &av) <= 0) {
1678          goto erret;
1679       }
1680       ptr -> mgc_changed = av.boolvalue;
1681       atp = AsnReadId(aip,amp, atp);
1682    }
1683    if (atp == T3REFRESHFLAGS_orgmod_changed) {
1684       if ( AsnReadVal(aip, atp, &av) <= 0) {
1685          goto erret;
1686       }
1687       ptr -> orgmod_changed = av.boolvalue;
1688       atp = AsnReadId(aip,amp, atp);
1689    }
1690 
1691    if (AsnReadVal(aip, atp, &av) <= 0) {
1692       goto erret;
1693    }
1694    /* end struct */
1695 
1696 ret:
1697    AsnUnlinkType(orig);       /* unlink local tree */
1698    return ptr;
1699 
1700 erret:
1701    aip -> io_failure = TRUE;
1702    ptr = T3RefreshFlagsFree(ptr);
1703    goto ret;
1704 }
1705 
1706 
1707 
1708 /**************************************************
1709 *
1710 *    T3RefreshFlagsAsnWrite()
1711 *
1712 **************************************************/
1713 NLM_EXTERN Boolean LIBCALL 
1714 T3RefreshFlagsAsnWrite(T3RefreshFlagsPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
1715 {
1716    DataVal av;
1717    AsnTypePtr atp;
1718    Boolean retval = FALSE;
1719 
1720    if (! loaded)
1721    {
1722       if (! objtax3AsnLoad()) {
1723          return FALSE;
1724       }
1725    }
1726 
1727    if (aip == NULL) {
1728       return FALSE;
1729    }
1730 
1731    atp = AsnLinkType(orig, T3REFRESHFLAGS);   /* link local tree */
1732    if (atp == NULL) {
1733       return FALSE;
1734    }
1735 
1736    if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
1737    if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
1738       goto erret;
1739    }
1740 
1741    av.boolvalue = ptr -> taxid_changed;
1742    retval = AsnWrite(aip, T3REFRESHFLAGS_taxid_changed,  &av);
1743    av.boolvalue = ptr -> taxname_changed;
1744    retval = AsnWrite(aip, T3REFRESHFLAGS_taxname_changed,  &av);
1745    av.boolvalue = ptr -> division_changed;
1746    retval = AsnWrite(aip, T3REFRESHFLAGS_division_changed,  &av);
1747    av.boolvalue = ptr -> lineage_changed;
1748    retval = AsnWrite(aip, T3REFRESHFLAGS_lineage_changed,  &av);
1749    av.boolvalue = ptr -> gc_changed;
1750    retval = AsnWrite(aip, T3REFRESHFLAGS_gc_changed,  &av);
1751    av.boolvalue = ptr -> mgc_changed;
1752    retval = AsnWrite(aip, T3REFRESHFLAGS_mgc_changed,  &av);
1753    av.boolvalue = ptr -> orgmod_changed;
1754    retval = AsnWrite(aip, T3REFRESHFLAGS_orgmod_changed,  &av);
1755    if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1756       goto erret;
1757    }
1758    retval = TRUE;
1759 
1760 erret:
1761    AsnUnlinkType(orig);       /* unlink local tree */
1762    return retval;
1763 }
1764 
1765 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.