703
705
/**************************************************
707
* GeneCommentaryNew()
709
**************************************************/
711
GeneCommentaryPtr LIBCALL
712
GeneCommentaryNew(void)
714
GeneCommentaryPtr ptr = MemNew((size_t) sizeof(GeneCommentary));
721
/**************************************************
723
* GeneCommentaryFree()
725
**************************************************/
727
GeneCommentaryPtr LIBCALL
728
GeneCommentaryFree(GeneCommentaryPtr ptr)
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);
752
/**************************************************
754
* GeneCommentaryAsnRead()
756
**************************************************/
758
GeneCommentaryPtr LIBCALL
759
GeneCommentaryAsnRead(AsnIoPtr aip, AsnTypePtr orig)
763
Boolean isError = FALSE;
765
GeneCommentaryPtr ptr;
769
if (! objentgeneAsnLoad()) {
778
if (orig == NULL) { /* GeneCommentary ::= (self contained) */
779
atp = AsnReadId(aip, amp, GENE_COMMENTARY);
781
atp = AsnLinkType(orig, GENE_COMMENTARY);
783
/* link in local tree */
788
ptr = GeneCommentaryNew();
792
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
796
atp = AsnReadId(aip,amp, atp);
799
if (atp == GENE_COMMENTARY_type) {
800
if ( AsnReadVal(aip, atp, &av) <= 0) {
803
ptr -> type = av.intvalue;
804
atp = AsnReadId(aip,amp, atp);
806
if (atp == GENE_COMMENTARY_heading) {
807
if ( AsnReadVal(aip, atp, &av) <= 0) {
810
ptr -> heading = av.ptrvalue;
811
atp = AsnReadId(aip,amp, atp);
813
if (atp == GENE_COMMENTARY_label) {
814
if ( AsnReadVal(aip, atp, &av) <= 0) {
817
ptr -> label = av.ptrvalue;
818
atp = AsnReadId(aip,amp, atp);
820
if (atp == GENE_COMMENTARY_text) {
821
if ( AsnReadVal(aip, atp, &av) <= 0) {
824
ptr -> text = av.ptrvalue;
825
atp = AsnReadId(aip,amp, atp);
827
if (atp == GENE_COMMENTARY_accession) {
828
if ( AsnReadVal(aip, atp, &av) <= 0) {
831
ptr -> accession = av.ptrvalue;
832
atp = AsnReadId(aip,amp, atp);
834
if (atp == GENE_COMMENTARY_version) {
835
if ( AsnReadVal(aip, atp, &av) <= 0) {
838
ptr -> version = av.intvalue;
839
atp = AsnReadId(aip,amp, atp);
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) {
846
atp = AsnReadId(aip,amp, atp);
848
if (atp == GENE_COMMENTARY_refs) {
849
ptr -> refs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) PubAsnRead, (AsnOptFreeFunc) PubFree);
850
if (isError && ptr -> refs == NULL) {
853
atp = AsnReadId(aip,amp, atp);
855
if (atp == GENE_COMMENTARY_source) {
856
ptr -> source = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) OtherSourceAsnRead, (AsnOptFreeFunc) OtherSourceFree);
857
if (isError && ptr -> source == NULL) {
860
atp = AsnReadId(aip,amp, atp);
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) {
867
atp = AsnReadId(aip,amp, atp);
869
if (atp == GENE_COMMENTARY_seqs) {
870
ptr -> seqs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLocAsnRead, (AsnOptFreeFunc) SeqLocFree);
871
if (isError && ptr -> seqs == NULL) {
874
atp = AsnReadId(aip,amp, atp);
876
if (atp == GENE_COMMENTARY_products) {
877
ptr -> products = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
878
if (isError && ptr -> products == NULL) {
881
atp = AsnReadId(aip,amp, atp);
883
if (atp == GENE_COMMENTARY_properties) {
884
ptr -> properties = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
885
if (isError && ptr -> properties == NULL) {
888
atp = AsnReadId(aip,amp, atp);
890
if (atp == GENE_COMMENTARY_comment) {
891
ptr -> comment = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
892
if (isError && ptr -> comment == NULL) {
895
atp = AsnReadId(aip,amp, atp);
897
if (atp == GENE_COMMENTARY_create_date) {
898
ptr -> create_date = DateAsnRead(aip, atp);
899
if (aip -> io_failure) {
902
atp = AsnReadId(aip,amp, atp);
904
if (atp == GENE_COMMENTARY_update_date) {
905
ptr -> update_date = DateAsnRead(aip, atp);
906
if (aip -> io_failure) {
909
atp = AsnReadId(aip,amp, atp);
912
if (AsnReadVal(aip, atp, &av) <= 0) {
918
AsnUnlinkType(orig); /* unlink local tree */
922
aip -> io_failure = TRUE;
923
ptr = GeneCommentaryFree(ptr);
929
/**************************************************
931
* GeneCommentaryAsnWrite()
933
**************************************************/
934
NLM_EXTERN Boolean LIBCALL
935
GeneCommentaryAsnWrite(GeneCommentaryPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
939
Boolean retval = FALSE;
943
if (! objentgeneAsnLoad()) {
952
atp = AsnLinkType(orig, GENE_COMMENTARY); /* link local tree */
957
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
958
if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
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);
968
if (ptr -> label != NULL) {
969
av.ptrvalue = ptr -> label;
970
retval = AsnWrite(aip, GENE_COMMENTARY_label, &av);
972
if (ptr -> text != NULL) {
973
av.ptrvalue = ptr -> text;
974
retval = AsnWrite(aip, GENE_COMMENTARY_text, &av);
976
if (ptr -> accession != NULL) {
977
av.ptrvalue = ptr -> accession;
978
retval = AsnWrite(aip, GENE_COMMENTARY_accession, &av);
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)) {
995
if (ptr -> update_date != NULL) {
996
if ( ! DateAsnWrite(ptr -> update_date, aip, GENE_COMMENTARY_update_date)) {
1000
if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1006
AsnUnlinkType(orig); /* unlink local tree */
1012
/**************************************************
707
1016
**************************************************/
1266
1575
/**************************************************
1268
* GeneCommentaryNew()
1270
**************************************************/
1272
GeneCommentaryPtr LIBCALL
1273
GeneCommentaryNew(void)
1275
GeneCommentaryPtr ptr = MemNew((size_t) sizeof(GeneCommentary));
1282
/**************************************************
1284
* GeneCommentaryFree()
1286
**************************************************/
1288
GeneCommentaryPtr LIBCALL
1289
GeneCommentaryFree(GeneCommentaryPtr ptr)
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);
1313
/**************************************************
1315
* GeneCommentaryAsnRead()
1317
**************************************************/
1319
GeneCommentaryPtr LIBCALL
1320
GeneCommentaryAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1324
Boolean isError = FALSE;
1326
GeneCommentaryPtr ptr;
1330
if (! objentgeneAsnLoad()) {
1339
if (orig == NULL) { /* GeneCommentary ::= (self contained) */
1340
atp = AsnReadId(aip, amp, GENE_COMMENTARY);
1342
atp = AsnLinkType(orig, GENE_COMMENTARY);
1344
/* link in local tree */
1349
ptr = GeneCommentaryNew();
1353
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
1357
atp = AsnReadId(aip,amp, atp);
1360
if (atp == GENE_COMMENTARY_type) {
1361
if ( AsnReadVal(aip, atp, &av) <= 0) {
1364
ptr -> type = av.intvalue;
1365
atp = AsnReadId(aip,amp, atp);
1367
if (atp == GENE_COMMENTARY_heading) {
1368
if ( AsnReadVal(aip, atp, &av) <= 0) {
1371
ptr -> heading = av.ptrvalue;
1372
atp = AsnReadId(aip,amp, atp);
1374
if (atp == GENE_COMMENTARY_label) {
1375
if ( AsnReadVal(aip, atp, &av) <= 0) {
1378
ptr -> label = av.ptrvalue;
1379
atp = AsnReadId(aip,amp, atp);
1381
if (atp == GENE_COMMENTARY_text) {
1382
if ( AsnReadVal(aip, atp, &av) <= 0) {
1385
ptr -> text = av.ptrvalue;
1386
atp = AsnReadId(aip,amp, atp);
1388
if (atp == GENE_COMMENTARY_accession) {
1389
if ( AsnReadVal(aip, atp, &av) <= 0) {
1392
ptr -> accession = av.ptrvalue;
1393
atp = AsnReadId(aip,amp, atp);
1395
if (atp == GENE_COMMENTARY_version) {
1396
if ( AsnReadVal(aip, atp, &av) <= 0) {
1399
ptr -> version = av.intvalue;
1400
atp = AsnReadId(aip,amp, atp);
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) {
1407
atp = AsnReadId(aip,amp, atp);
1409
if (atp == GENE_COMMENTARY_refs) {
1410
ptr -> refs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) PubAsnRead, (AsnOptFreeFunc) PubFree);
1411
if (isError && ptr -> refs == NULL) {
1414
atp = AsnReadId(aip,amp, atp);
1416
if (atp == GENE_COMMENTARY_source) {
1417
ptr -> source = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) OtherSourceAsnRead, (AsnOptFreeFunc) OtherSourceFree);
1418
if (isError && ptr -> source == NULL) {
1421
atp = AsnReadId(aip,amp, atp);
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) {
1428
atp = AsnReadId(aip,amp, atp);
1430
if (atp == GENE_COMMENTARY_seqs) {
1431
ptr -> seqs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLocAsnRead, (AsnOptFreeFunc) SeqLocFree);
1432
if (isError && ptr -> seqs == NULL) {
1435
atp = AsnReadId(aip,amp, atp);
1437
if (atp == GENE_COMMENTARY_products) {
1438
ptr -> products = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
1439
if (isError && ptr -> products == NULL) {
1442
atp = AsnReadId(aip,amp, atp);
1444
if (atp == GENE_COMMENTARY_properties) {
1445
ptr -> properties = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
1446
if (isError && ptr -> properties == NULL) {
1449
atp = AsnReadId(aip,amp, atp);
1451
if (atp == GENE_COMMENTARY_comment) {
1452
ptr -> comment = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) GeneCommentaryAsnRead, (AsnOptFreeFunc) GeneCommentaryFree);
1453
if (isError && ptr -> comment == NULL) {
1456
atp = AsnReadId(aip,amp, atp);
1458
if (atp == GENE_COMMENTARY_create_date) {
1459
ptr -> create_date = DateAsnRead(aip, atp);
1460
if (aip -> io_failure) {
1463
atp = AsnReadId(aip,amp, atp);
1465
if (atp == GENE_COMMENTARY_update_date) {
1466
ptr -> update_date = DateAsnRead(aip, atp);
1467
if (aip -> io_failure) {
1470
atp = AsnReadId(aip,amp, atp);
1473
if (AsnReadVal(aip, atp, &av) <= 0) {
1479
AsnUnlinkType(orig); /* unlink local tree */
1483
aip -> io_failure = TRUE;
1484
ptr = GeneCommentaryFree(ptr);
1490
/**************************************************
1492
* GeneCommentaryAsnWrite()
1494
**************************************************/
1495
NLM_EXTERN Boolean LIBCALL
1496
GeneCommentaryAsnWrite(GeneCommentaryPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
1500
Boolean retval = FALSE;
1504
if (! objentgeneAsnLoad()) {
1513
atp = AsnLinkType(orig, GENE_COMMENTARY); /* link local tree */
1518
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
1519
if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
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);
1529
if (ptr -> label != NULL) {
1530
av.ptrvalue = ptr -> label;
1531
retval = AsnWrite(aip, GENE_COMMENTARY_label, &av);
1533
if (ptr -> text != NULL) {
1534
av.ptrvalue = ptr -> text;
1535
retval = AsnWrite(aip, GENE_COMMENTARY_text, &av);
1537
if (ptr -> accession != NULL) {
1538
av.ptrvalue = ptr -> accession;
1539
retval = AsnWrite(aip, GENE_COMMENTARY_accession, &av);
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)) {
1556
if (ptr -> update_date != NULL) {
1557
if ( ! DateAsnWrite(ptr -> update_date, aip, GENE_COMMENTARY_update_date)) {
1561
if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
1567
AsnUnlinkType(orig); /* unlink local tree */
1573
/**************************************************
1575
1577
* XtraTermsNew()
1577
1579
**************************************************/