~ubuntu-branches/ubuntu/saucy/ncbi-tools6/saucy-proposed

« back to all changes in this revision

Viewing changes to access/objentgene.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2009-08-11 22:03:47 UTC
  • mfrom: (1.4.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20090811220347-g4b6lzdvphvvbpiu
* New upstream release.
* debian/libncbi6.symbols: update accordingly.
* debian/control: clean up obsolete or redundant relationship declarations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
/**************************************************
34
34
*    Generated object loaders for Module NCBI-Entrezgene
35
 
*    Generated using ASNCODE Revision: 6.16 at Apr 19, 2005 10:50 AM
 
35
*    Generated using ASNCODE Revision: 6.16 at Apr 24, 2009 11:11 AM
36
36
*
37
37
**************************************************/
38
38
 
405
405
EntrezgeneSetPtr LIBCALL
406
406
EntrezgeneSetAsnRead(AsnIoPtr aip, AsnTypePtr orig)
407
407
{
 
408
   DataVal av;
408
409
   AsnTypePtr atp;
409
410
   Boolean isError = FALSE;
410
411
   AsnReadFunc func;
460
461
NLM_EXTERN Boolean LIBCALL 
461
462
EntrezgeneSetAsnWrite(EntrezgeneSetPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
462
463
{
 
464
   DataVal av;
463
465
   AsnTypePtr atp;
464
466
   Boolean retval = FALSE;
465
467
 
702
704
 
703
705
/**************************************************
704
706
*
 
707
*    GeneCommentaryNew()
 
708
*
 
709
**************************************************/
 
710
NLM_EXTERN 
 
711
GeneCommentaryPtr LIBCALL
 
712
GeneCommentaryNew(void)
 
713
{
 
714
   GeneCommentaryPtr ptr = MemNew((size_t) sizeof(GeneCommentary));
 
715
 
 
716
   return ptr;
 
717
 
 
718
}
 
719
 
 
720
 
 
721
/**************************************************
 
722
*
 
723
*    GeneCommentaryFree()
 
724
*
 
725
**************************************************/
 
726
NLM_EXTERN 
 
727
GeneCommentaryPtr LIBCALL
 
728
GeneCommentaryFree(GeneCommentaryPtr ptr)
 
729
{
 
730
 
 
731
   if(ptr == NULL) {
 
732
      return NULL;
 
733
   }
 
734
   MemFree(ptr -> heading);
 
735
   MemFree(ptr -> label);
 
736
   MemFree(ptr -> text);
 
737
   MemFree(ptr -> accession);
 
738
   AsnGenericUserSeqOfFree(ptr -> xtra_properties, (AsnOptFreeFunc) XtraTermsFree);
 
739
   AsnGenericChoiceSeqOfFree(ptr -> refs, (AsnOptFreeFunc) PubFree);
 
740
   AsnGenericUserSeqOfFree(ptr -> source, (AsnOptFreeFunc) OtherSourceFree);
 
741
   AsnGenericChoiceSeqOfFree(ptr -> genomic_coords, (AsnOptFreeFunc) SeqLocFree);
 
742
   AsnGenericChoiceSeqOfFree(ptr -> seqs, (AsnOptFreeFunc) SeqLocFree);
 
743
   AsnGenericUserSeqOfFree(ptr -> products, (AsnOptFreeFunc) GeneCommentaryFree);
 
744
   AsnGenericUserSeqOfFree(ptr -> properties, (AsnOptFreeFunc) GeneCommentaryFree);
 
745
   AsnGenericUserSeqOfFree(ptr -> comment, (AsnOptFreeFunc) GeneCommentaryFree);
 
746
   DateFree(ptr -> create_date);
 
747
   DateFree(ptr -> update_date);
 
748
   return MemFree(ptr);
 
749
}
 
750
 
 
751
 
 
752
/**************************************************
 
753
*
 
754
*    GeneCommentaryAsnRead()
 
755
*
 
756
**************************************************/
 
757
NLM_EXTERN 
 
758
GeneCommentaryPtr LIBCALL
 
759
GeneCommentaryAsnRead(AsnIoPtr aip, AsnTypePtr orig)
 
760
{
 
761
   DataVal av;
 
762
   AsnTypePtr atp;
 
763
   Boolean isError = FALSE;
 
764
   AsnReadFunc func;
 
765
   GeneCommentaryPtr ptr;
 
766
 
 
767
   if (! loaded)
 
768
   {
 
769
      if (! objentgeneAsnLoad()) {
 
770
         return NULL;
 
771
      }
 
772
   }
 
773
 
 
774
   if (aip == NULL) {
 
775
      return NULL;
 
776
   }
 
777
 
 
778
   if (orig == NULL) {         /* GeneCommentary ::= (self contained) */
 
779
      atp = AsnReadId(aip, amp, GENE_COMMENTARY);
 
780
   } else {
 
781
      atp = AsnLinkType(orig, GENE_COMMENTARY);
 
782
   }
 
783
   /* link in local tree */
 
784
   if (atp == NULL) {
 
785
      return NULL;
 
786
   }
 
787
 
 
788
   ptr = GeneCommentaryNew();
 
789
   if (ptr == NULL) {
 
790
      goto erret;
 
791
   }
 
792
   if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
 
793
      goto erret;
 
794
   }
 
795
 
 
796
   atp = AsnReadId(aip,amp, atp);
 
797
   func = NULL;
 
798
 
 
799
   if (atp == GENE_COMMENTARY_type) {
 
800
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
801
         goto erret;
 
802
      }
 
803
      ptr -> type = av.intvalue;
 
804
      atp = AsnReadId(aip,amp, atp);
 
805
   }
 
806
   if (atp == GENE_COMMENTARY_heading) {
 
807
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
808
         goto erret;
 
809
      }
 
810
      ptr -> heading = av.ptrvalue;
 
811
      atp = AsnReadId(aip,amp, atp);
 
812
   }
 
813
   if (atp == GENE_COMMENTARY_label) {
 
814
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
815
         goto erret;
 
816
      }
 
817
      ptr -> label = av.ptrvalue;
 
818
      atp = AsnReadId(aip,amp, atp);
 
819
   }
 
820
   if (atp == GENE_COMMENTARY_text) {
 
821
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
822
         goto erret;
 
823
      }
 
824
      ptr -> text = av.ptrvalue;
 
825
      atp = AsnReadId(aip,amp, atp);
 
826
   }
 
827
   if (atp == GENE_COMMENTARY_accession) {
 
828
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
829
         goto erret;
 
830
      }
 
831
      ptr -> accession = av.ptrvalue;
 
832
      atp = AsnReadId(aip,amp, atp);
 
833
   }
 
834
   if (atp == GENE_COMMENTARY_version) {
 
835
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
836
         goto erret;
 
837
      }
 
838
      ptr -> version = av.intvalue;
 
839
      atp = AsnReadId(aip,amp, atp);
 
840
   }
 
841
   if (atp == GENE_COMMENTARY_xtra_properties) {
 
842
      ptr -> xtra_properties = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) XtraTermsAsnRead, (AsnOptFreeFunc) XtraTermsFree);
 
843
      if (isError && ptr -> xtra_properties == NULL) {
 
844
         goto erret;
 
845
      }
 
846
      atp = AsnReadId(aip,amp, atp);
 
847
   }
 
848
   if (atp == GENE_COMMENTARY_refs) {
 
849
      ptr -> refs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) PubAsnRead, (AsnOptFreeFunc) PubFree);
 
850
      if (isError && ptr -> refs == NULL) {
 
851
         goto erret;
 
852
      }
 
853
      atp = AsnReadId(aip,amp, atp);
 
854
   }
 
855
   if (atp == GENE_COMMENTARY_source) {
 
856
      ptr -> source = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) OtherSourceAsnRead, (AsnOptFreeFunc) OtherSourceFree);
 
857
      if (isError && ptr -> source == NULL) {
 
858
         goto erret;
 
859
      }
 
860
      atp = AsnReadId(aip,amp, atp);
 
861
   }
 
862
   if (atp == GENE_COMMENTARY_genomic_coords) {
 
863
      ptr -> genomic_coords = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLocAsnRead, (AsnOptFreeFunc) SeqLocFree);
 
864
      if (isError && ptr -> genomic_coords == NULL) {
 
865
         goto erret;
 
866
      }
 
867
      atp = AsnReadId(aip,amp, atp);
 
868
   }
 
869
   if (atp == GENE_COMMENTARY_seqs) {
 
870
      ptr -> seqs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLocAsnRead, (AsnOptFreeFunc) SeqLocFree);
 
871
      if (isError && ptr -> seqs == NULL) {
 
872
         goto erret;
 
873
      }
 
874
      atp = AsnReadId(aip,amp, atp);
 
875
   }
 
876
   if (atp == GENE_COMMENTARY_products) {
 
877
      ptr -> products = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
 
878
      if (isError && ptr -> products == NULL) {
 
879
         goto erret;
 
880
      }
 
881
      atp = AsnReadId(aip,amp, atp);
 
882
   }
 
883
   if (atp == GENE_COMMENTARY_properties) {
 
884
      ptr -> properties = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
 
885
      if (isError && ptr -> properties == NULL) {
 
886
         goto erret;
 
887
      }
 
888
      atp = AsnReadId(aip,amp, atp);
 
889
   }
 
890
   if (atp == GENE_COMMENTARY_comment) {
 
891
      ptr -> comment = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
 
892
      if (isError && ptr -> comment == NULL) {
 
893
         goto erret;
 
894
      }
 
895
      atp = AsnReadId(aip,amp, atp);
 
896
   }
 
897
   if (atp == GENE_COMMENTARY_create_date) {
 
898
      ptr -> create_date = DateAsnRead(aip, atp);
 
899
      if (aip -> io_failure) {
 
900
         goto erret;
 
901
      }
 
902
      atp = AsnReadId(aip,amp, atp);
 
903
   }
 
904
   if (atp == GENE_COMMENTARY_update_date) {
 
905
      ptr -> update_date = DateAsnRead(aip, atp);
 
906
      if (aip -> io_failure) {
 
907
         goto erret;
 
908
      }
 
909
      atp = AsnReadId(aip,amp, atp);
 
910
   }
 
911
 
 
912
   if (AsnReadVal(aip, atp, &av) <= 0) {
 
913
      goto erret;
 
914
   }
 
915
   /* end struct */
 
916
 
 
917
ret:
 
918
   AsnUnlinkType(orig);       /* unlink local tree */
 
919
   return ptr;
 
920
 
 
921
erret:
 
922
   aip -> io_failure = TRUE;
 
923
   ptr = GeneCommentaryFree(ptr);
 
924
   goto ret;
 
925
}
 
926
 
 
927
 
 
928
 
 
929
/**************************************************
 
930
*
 
931
*    GeneCommentaryAsnWrite()
 
932
*
 
933
**************************************************/
 
934
NLM_EXTERN Boolean LIBCALL 
 
935
GeneCommentaryAsnWrite(GeneCommentaryPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
 
936
{
 
937
   DataVal av;
 
938
   AsnTypePtr atp;
 
939
   Boolean retval = FALSE;
 
940
 
 
941
   if (! loaded)
 
942
   {
 
943
      if (! objentgeneAsnLoad()) {
 
944
         return FALSE;
 
945
      }
 
946
   }
 
947
 
 
948
   if (aip == NULL) {
 
949
      return FALSE;
 
950
   }
 
951
 
 
952
   atp = AsnLinkType(orig, GENE_COMMENTARY);   /* link local tree */
 
953
   if (atp == NULL) {
 
954
      return FALSE;
 
955
   }
 
956
 
 
957
   if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
 
958
   if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
 
959
      goto erret;
 
960
   }
 
961
 
 
962
   av.intvalue = ptr -> type;
 
963
   retval = AsnWrite(aip, GENE_COMMENTARY_type,  &av);
 
964
   if (ptr -> heading != NULL) {
 
965
      av.ptrvalue = ptr -> heading;
 
966
      retval = AsnWrite(aip, GENE_COMMENTARY_heading,  &av);
 
967
   }
 
968
   if (ptr -> label != NULL) {
 
969
      av.ptrvalue = ptr -> label;
 
970
      retval = AsnWrite(aip, GENE_COMMENTARY_label,  &av);
 
971
   }
 
972
   if (ptr -> text != NULL) {
 
973
      av.ptrvalue = ptr -> text;
 
974
      retval = AsnWrite(aip, GENE_COMMENTARY_text,  &av);
 
975
   }
 
976
   if (ptr -> accession != NULL) {
 
977
      av.ptrvalue = ptr -> accession;
 
978
      retval = AsnWrite(aip, GENE_COMMENTARY_accession,  &av);
 
979
   }
 
980
   av.intvalue = ptr -> version;
 
981
   retval = AsnWrite(aip, GENE_COMMENTARY_version,  &av);
 
982
   AsnGenericUserSeqOfAsnWrite(ptr -> xtra_properties, (AsnWriteFunc) XtraTermsAsnWrite, aip, GENE_COMMENTARY_xtra_properties, COMMENTARY_xtra_properties_E);
 
983
   AsnGenericChoiceSeqOfAsnWrite(ptr -> refs, (AsnWriteFunc) PubAsnWrite, aip, GENE_COMMENTARY_refs, GENE_COMMENTARY_refs_E);
 
984
   AsnGenericUserSeqOfAsnWrite(ptr -> source, (AsnWriteFunc) OtherSourceAsnWrite, aip, GENE_COMMENTARY_source, GENE_COMMENTARY_source_E);
 
985
   AsnGenericChoiceSeqOfAsnWrite(ptr -> genomic_coords, (AsnWriteFunc) SeqLocAsnWrite, aip, GENE_COMMENTARY_genomic_coords, COMMENTARY_genomic_coords_E);
 
986
   AsnGenericChoiceSeqOfAsnWrite(ptr -> seqs, (AsnWriteFunc) SeqLocAsnWrite, aip, GENE_COMMENTARY_seqs, GENE_COMMENTARY_seqs_E);
 
987
   AsnGenericUserSeqOfAsnWrite(ptr -> products, (AsnWriteFunc) GeneCommentaryAsnWrite, aip, GENE_COMMENTARY_products, GENE_COMMENTARY_products_E);
 
988
   AsnGenericUserSeqOfAsnWrite(ptr -> properties, (AsnWriteFunc) GeneCommentaryAsnWrite, aip, GENE_COMMENTARY_properties, GENE_COMMENTARY_properties_E);
 
989
   AsnGenericUserSeqOfAsnWrite(ptr -> comment, (AsnWriteFunc) GeneCommentaryAsnWrite, aip, GENE_COMMENTARY_comment, GENE_COMMENTARY_comment_E);
 
990
   if (ptr -> create_date != NULL) {
 
991
      if ( ! DateAsnWrite(ptr -> create_date, aip, GENE_COMMENTARY_create_date)) {
 
992
         goto erret;
 
993
      }
 
994
   }
 
995
   if (ptr -> update_date != NULL) {
 
996
      if ( ! DateAsnWrite(ptr -> update_date, aip, GENE_COMMENTARY_update_date)) {
 
997
         goto erret;
 
998
      }
 
999
   }
 
1000
   if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
 
1001
      goto erret;
 
1002
   }
 
1003
   retval = TRUE;
 
1004
 
 
1005
erret:
 
1006
   AsnUnlinkType(orig);       /* unlink local tree */
 
1007
   return retval;
 
1008
}
 
1009
 
 
1010
 
 
1011
 
 
1012
/**************************************************
 
1013
*
705
1014
*    MapsNew()
706
1015
*
707
1016
**************************************************/
1265
1574
 
1266
1575
/**************************************************
1267
1576
*
1268
 
*    GeneCommentaryNew()
1269
 
*
1270
 
**************************************************/
1271
 
NLM_EXTERN 
1272
 
GeneCommentaryPtr LIBCALL
1273
 
GeneCommentaryNew(void)
1274
 
{
1275
 
   GeneCommentaryPtr ptr = MemNew((size_t) sizeof(GeneCommentary));
1276
 
 
1277
 
   return ptr;
1278
 
 
1279
 
}
1280
 
 
1281
 
 
1282
 
/**************************************************
1283
 
*
1284
 
*    GeneCommentaryFree()
1285
 
*
1286
 
**************************************************/
1287
 
NLM_EXTERN 
1288
 
GeneCommentaryPtr LIBCALL
1289
 
GeneCommentaryFree(GeneCommentaryPtr ptr)
1290
 
{
1291
 
 
1292
 
   if(ptr == NULL) {
1293
 
      return NULL;
1294
 
   }
1295
 
   MemFree(ptr -> heading);
1296
 
   MemFree(ptr -> label);
1297
 
   MemFree(ptr -> text);
1298
 
   MemFree(ptr -> accession);
1299
 
   AsnGenericUserSeqOfFree(ptr -> xtra_properties, (AsnOptFreeFunc) XtraTermsFree);
1300
 
   AsnGenericChoiceSeqOfFree(ptr -> refs, (AsnOptFreeFunc) PubFree);
1301
 
   AsnGenericUserSeqOfFree(ptr -> source, (AsnOptFreeFunc) OtherSourceFree);
1302
 
   AsnGenericChoiceSeqOfFree(ptr -> genomic_coords, (AsnOptFreeFunc) SeqLocFree);
1303
 
   AsnGenericChoiceSeqOfFree(ptr -> seqs, (AsnOptFreeFunc) SeqLocFree);
1304
 
   AsnGenericUserSeqOfFree(ptr -> products, (AsnOptFreeFunc) GeneCommentaryFree);
1305
 
   AsnGenericUserSeqOfFree(ptr -> properties, (AsnOptFreeFunc) GeneCommentaryFree);
1306
 
   AsnGenericUserSeqOfFree(ptr -> comment, (AsnOptFreeFunc) GeneCommentaryFree);
1307
 
   DateFree(ptr -> create_date);
1308
 
   DateFree(ptr -> update_date);
1309
 
   return MemFree(ptr);
1310
 
}
1311
 
 
1312
 
 
1313
 
/**************************************************
1314
 
*
1315
 
*    GeneCommentaryAsnRead()
1316
 
*
1317
 
**************************************************/
1318
 
NLM_EXTERN 
1319
 
GeneCommentaryPtr LIBCALL
1320
 
GeneCommentaryAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1321
 
{
1322
 
   DataVal av;
1323
 
   AsnTypePtr atp;
1324
 
   Boolean isError = FALSE;
1325
 
   AsnReadFunc func;
1326
 
   GeneCommentaryPtr ptr;
1327
 
 
1328
 
   if (! loaded)
1329
 
   {
1330
 
      if (! objentgeneAsnLoad()) {
1331
 
         return NULL;
1332
 
      }
1333
 
   }
1334
 
 
1335
 
   if (aip == NULL) {
1336
 
      return NULL;
1337
 
   }
1338
 
 
1339
 
   if (orig == NULL) {         /* GeneCommentary ::= (self contained) */
1340
 
      atp = AsnReadId(aip, amp, GENE_COMMENTARY);
1341
 
   } else {
1342
 
      atp = AsnLinkType(orig, GENE_COMMENTARY);
1343
 
   }
1344
 
   /* link in local tree */
1345
 
   if (atp == NULL) {
1346
 
      return NULL;
1347
 
   }
1348
 
 
1349
 
   ptr = GeneCommentaryNew();
1350
 
   if (ptr == NULL) {
1351
 
      goto erret;
1352
 
   }
1353
 
   if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
1354
 
      goto erret;
1355
 
   }
1356
 
 
1357
 
   atp = AsnReadId(aip,amp, atp);
1358
 
   func = NULL;
1359
 
 
1360
 
   if (atp == GENE_COMMENTARY_type) {
1361
 
      if ( AsnReadVal(aip, atp, &av) <= 0) {
1362
 
         goto erret;
1363
 
      }
1364
 
      ptr -> type = av.intvalue;
1365
 
      atp = AsnReadId(aip,amp, atp);
1366
 
   }
1367
 
   if (atp == GENE_COMMENTARY_heading) {
1368
 
      if ( AsnReadVal(aip, atp, &av) <= 0) {
1369
 
         goto erret;
1370
 
      }
1371
 
      ptr -> heading = av.ptrvalue;
1372
 
      atp = AsnReadId(aip,amp, atp);
1373
 
   }
1374
 
   if (atp == GENE_COMMENTARY_label) {
1375
 
      if ( AsnReadVal(aip, atp, &av) <= 0) {
1376
 
         goto erret;
1377
 
      }
1378
 
      ptr -> label = av.ptrvalue;
1379
 
      atp = AsnReadId(aip,amp, atp);
1380
 
   }
1381
 
   if (atp == GENE_COMMENTARY_text) {
1382
 
      if ( AsnReadVal(aip, atp, &av) <= 0) {
1383
 
         goto erret;
1384
 
      }
1385
 
      ptr -> text = av.ptrvalue;
1386
 
      atp = AsnReadId(aip,amp, atp);
1387
 
   }
1388
 
   if (atp == GENE_COMMENTARY_accession) {
1389
 
      if ( AsnReadVal(aip, atp, &av) <= 0) {
1390
 
         goto erret;
1391
 
      }
1392
 
      ptr -> accession = av.ptrvalue;
1393
 
      atp = AsnReadId(aip,amp, atp);
1394
 
   }
1395
 
   if (atp == GENE_COMMENTARY_version) {
1396
 
      if ( AsnReadVal(aip, atp, &av) <= 0) {
1397
 
         goto erret;
1398
 
      }
1399
 
      ptr -> version = av.intvalue;
1400
 
      atp = AsnReadId(aip,amp, atp);
1401
 
   }
1402
 
   if (atp == GENE_COMMENTARY_xtra_properties) {
1403
 
      ptr -> xtra_properties = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) XtraTermsAsnRead, (AsnOptFreeFunc) XtraTermsFree);
1404
 
      if (isError && ptr -> xtra_properties == NULL) {
1405
 
         goto erret;
1406
 
      }
1407
 
      atp = AsnReadId(aip,amp, atp);
1408
 
   }
1409
 
   if (atp == GENE_COMMENTARY_refs) {
1410
 
      ptr -> refs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) PubAsnRead, (AsnOptFreeFunc) PubFree);
1411
 
      if (isError && ptr -> refs == NULL) {
1412
 
         goto erret;
1413
 
      }
1414
 
      atp = AsnReadId(aip,amp, atp);
1415
 
   }
1416
 
   if (atp == GENE_COMMENTARY_source) {
1417
 
      ptr -> source = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) OtherSourceAsnRead, (AsnOptFreeFunc) OtherSourceFree);
1418
 
      if (isError && ptr -> source == NULL) {
1419
 
         goto erret;
1420
 
      }
1421
 
      atp = AsnReadId(aip,amp, atp);
1422
 
   }
1423
 
   if (atp == GENE_COMMENTARY_genomic_coords) {
1424
 
      ptr -> genomic_coords = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLocAsnRead, (AsnOptFreeFunc) SeqLocFree);
1425
 
      if (isError && ptr -> genomic_coords == NULL) {
1426
 
         goto erret;
1427
 
      }
1428
 
      atp = AsnReadId(aip,amp, atp);
1429
 
   }
1430
 
   if (atp == GENE_COMMENTARY_seqs) {
1431
 
      ptr -> seqs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLocAsnRead, (AsnOptFreeFunc) SeqLocFree);
1432
 
      if (isError && ptr -> seqs == NULL) {
1433
 
         goto erret;
1434
 
      }
1435
 
      atp = AsnReadId(aip,amp, atp);
1436
 
   }
1437
 
   if (atp == GENE_COMMENTARY_products) {
1438
 
      ptr -> products = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
1439
 
      if (isError && ptr -> products == NULL) {
1440
 
         goto erret;
1441
 
      }
1442
 
      atp = AsnReadId(aip,amp, atp);
1443
 
   }
1444
 
   if (atp == GENE_COMMENTARY_properties) {
1445
 
      ptr -> properties = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
1446
 
      if (isError && ptr -> properties == NULL) {
1447
 
         goto erret;
1448
 
      }
1449
 
      atp = AsnReadId(aip,amp, atp);
1450
 
   }
1451
 
   if (atp == GENE_COMMENTARY_comment) {
1452
 
      ptr -> comment = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
1453
 
      if (isError && ptr -> comment == NULL) {
1454
 
         goto erret;
1455
 
      }
1456
 
      atp = AsnReadId(aip,amp, atp);
1457
 
   }
1458
 
   if (atp == GENE_COMMENTARY_create_date) {
1459
 
      ptr -> create_date = DateAsnRead(aip, atp);
1460
 
      if (aip -> io_failure) {
1461
 
         goto erret;
1462
 
      }
1463
 
      atp = AsnReadId(aip,amp, atp);
1464
 
   }
1465
 
   if (atp == GENE_COMMENTARY_update_date) {
1466
 
      ptr -> update_date = DateAsnRead(aip, atp);
1467
 
      if (aip -> io_failure) {
1468
 
         goto erret;
1469
 
      }
1470
 
      atp = AsnReadId(aip,amp, atp);
1471
 
   }
1472
 
 
1473
 
   if (AsnReadVal(aip, atp, &av) <= 0) {
1474
 
      goto erret;
1475
 
   }
1476
 
   /* end struct */
1477
 
 
1478
 
ret:
1479
 
   AsnUnlinkType(orig);       /* unlink local tree */
1480
 
   return ptr;
1481
 
 
1482
 
erret:
1483
 
   aip -> io_failure = TRUE;
1484
 
   ptr = GeneCommentaryFree(ptr);
1485
 
   goto ret;
1486
 
}
1487
 
 
1488
 
 
1489
 
 
1490
 
/**************************************************
1491
 
*
1492
 
*    GeneCommentaryAsnWrite()
1493
 
*
1494
 
**************************************************/
1495
 
NLM_EXTERN Boolean LIBCALL 
1496
 
GeneCommentaryAsnWrite(GeneCommentaryPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
1497
 
{
1498
 
   DataVal av;
1499
 
   AsnTypePtr atp;
1500
 
   Boolean retval = FALSE;
1501
 
 
1502
 
   if (! loaded)
1503
 
   {
1504
 
      if (! objentgeneAsnLoad()) {
1505
 
         return FALSE;
1506
 
      }
1507
 
   }
1508
 
 
1509
 
   if (aip == NULL) {
1510
 
      return FALSE;
1511
 
   }
1512
 
 
1513
 
   atp = AsnLinkType(orig, GENE_COMMENTARY);   /* link local tree */
1514
 
   if (atp == NULL) {
1515
 
      return FALSE;
1516
 
   }
1517
 
 
1518
 
   if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
1519
 
   if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
1520
 
      goto erret;
1521
 
   }
1522
 
 
1523
 
   av.intvalue = ptr -> type;
1524
 
   retval = AsnWrite(aip, GENE_COMMENTARY_type,  &av);
1525
 
   if (ptr -> heading != NULL) {
1526
 
      av.ptrvalue = ptr -> heading;
1527
 
      retval = AsnWrite(aip, GENE_COMMENTARY_heading,  &av);
1528
 
   }
1529
 
   if (ptr -> label != NULL) {
1530
 
      av.ptrvalue = ptr -> label;
1531
 
      retval = AsnWrite(aip, GENE_COMMENTARY_label,  &av);
1532
 
   }
1533
 
   if (ptr -> text != NULL) {
1534
 
      av.ptrvalue = ptr -> text;
1535
 
      retval = AsnWrite(aip, GENE_COMMENTARY_text,  &av);
1536
 
   }
1537
 
   if (ptr -> accession != NULL) {
1538
 
      av.ptrvalue = ptr -> accession;
1539
 
      retval = AsnWrite(aip, GENE_COMMENTARY_accession,  &av);
1540
 
   }
1541
 
   av.intvalue = ptr -> version;
1542
 
   retval = AsnWrite(aip, GENE_COMMENTARY_version,  &av);
1543
 
   AsnGenericUserSeqOfAsnWrite(ptr -> xtra_properties, (AsnWriteFunc) XtraTermsAsnWrite, aip, GENE_COMMENTARY_xtra_properties, COMMENTARY_xtra_properties_E);
1544
 
   AsnGenericChoiceSeqOfAsnWrite(ptr -> refs, (AsnWriteFunc) PubAsnWrite, aip, GENE_COMMENTARY_refs, GENE_COMMENTARY_refs_E);
1545
 
   AsnGenericUserSeqOfAsnWrite(ptr -> source, (AsnWriteFunc) OtherSourceAsnWrite, aip, GENE_COMMENTARY_source, GENE_COMMENTARY_source_E);
1546
 
   AsnGenericChoiceSeqOfAsnWrite(ptr -> genomic_coords, (AsnWriteFunc) SeqLocAsnWrite, aip, GENE_COMMENTARY_genomic_coords, COMMENTARY_genomic_coords_E);
1547
 
   AsnGenericChoiceSeqOfAsnWrite(ptr -> seqs, (AsnWriteFunc) SeqLocAsnWrite, aip, GENE_COMMENTARY_seqs, GENE_COMMENTARY_seqs_E);
1548
 
   AsnGenericUserSeqOfAsnWrite(ptr -> products, (AsnWriteFunc) GeneCommentaryAsnWrite, aip, GENE_COMMENTARY_products, GENE_COMMENTARY_products_E);
1549
 
   AsnGenericUserSeqOfAsnWrite(ptr -> properties, (AsnWriteFunc) GeneCommentaryAsnWrite, aip, GENE_COMMENTARY_properties, GENE_COMMENTARY_properties_E);
1550
 
   AsnGenericUserSeqOfAsnWrite(ptr -> comment, (AsnWriteFunc) GeneCommentaryAsnWrite, aip, GENE_COMMENTARY_comment, GENE_COMMENTARY_comment_E);
1551
 
   if (ptr -> create_date != NULL) {
1552
 
      if ( ! DateAsnWrite(ptr -> create_date, aip, GENE_COMMENTARY_create_date)) {
1553
 
         goto erret;
1554
 
      }
1555
 
   }
1556
 
   if (ptr -> update_date != NULL) {
1557
 
      if ( ! DateAsnWrite(ptr -> update_date, aip, GENE_COMMENTARY_update_date)) {
1558
 
         goto erret;
1559
 
      }
1560
 
   }
1561
 
   if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1562
 
      goto erret;
1563
 
   }
1564
 
   retval = TRUE;
1565
 
 
1566
 
erret:
1567
 
   AsnUnlinkType(orig);       /* unlink local tree */
1568
 
   return retval;
1569
 
}
1570
 
 
1571
 
 
1572
 
 
1573
 
/**************************************************
1574
 
*
1575
1577
*    XtraTermsNew()
1576
1578
*
1577
1579
**************************************************/