220
221
MemFree(sfp->except_text);
222
for (vnp = sfp->ids; vnp != NULL; vnp = next)
225
SeqFeatIdFree((ChoicePtr)(vnp->data.ptrvalue));
221
229
AsnGenericChoiceSeqOfFree (sfp->ids, (AsnOptFreeFunc) SeqFeatIdFree);
222
AsnGenericUserSeqOfFree (sfp->exts, (AsnOptFreeFunc) UserObjectFree);
231
for (uop = sfp->exts; uop != NULL; uop = unp)
237
AsnGenericUserSeqOfFree (sfp->exts, (AsnOptFreeFunc) UserObjectFree);
224
240
ObjMgrDelete(OBJ_SEQFEAT, (Pointer)sfp);
378
395
if (sfp->ids != NULL)
397
if (! AsnOpenStruct(aip, SEQ_FEAT_ids, (Pointer)sfp->ids))
402
if (! SeqFeatIdAsnWrite((ChoicePtr)(vnp->data.ptrvalue), aip, SEQ_FEAT_ids_E))
406
if (! AsnCloseStruct(aip, SEQ_FEAT_ids, (Pointer)sfp->ids))
380
409
AsnGenericChoiceSeqOfAsnWrite (sfp->ids, (AsnWriteFunc) SeqFeatIdAsnWrite, aip, SEQ_FEAT_ids, SEQ_FEAT_ids_E);
382
412
if (sfp->exts != NULL)
414
if (! AsnOpenStruct(aip, SEQ_FEAT_exts, (Pointer)sfp->exts))
419
if (! UserObjectAsnWrite(uop, aip, SEQ_FEAT_exts_E))
423
if (! AsnCloseStruct(aip, SEQ_FEAT_exts, (Pointer)sfp->exts))
384
426
AsnGenericUserSeqOfAsnWrite (sfp->exts, (AsnWriteFunc) UserObjectAsnWrite, aip, SEQ_FEAT_exts, SEQ_FEAT_exts_E);
386
429
if (! AsnCloseStruct(aip, atp, (Pointer)sfp))
502
547
else if (atp == SEQ_FEAT_ids)
549
atp = AsnLinkType (SEQ_FEAT_ids, FEAT_ID);
550
if (atp == NULL) goto erret;
551
if (AsnReadVal(aip, atp, &av) <= 0) goto erret; /* read the SEQUENCE */
552
while ((atp = AsnReadId(aip, amp, atp)) == SEQ_FEAT_ids_E) {
553
if (! SeqFeatIdAsnRead(aip, atp, &id))
555
cp = (ChoicePtr) MemNew (sizeof (Choice));
556
if (cp == NULL) goto erret;
557
cp->choice = id.choice;
559
cp->value.intvalue = id.value.intvalue;
561
cp->value.ptrvalue = id.value.ptrvalue;
563
ValNodeAddPointer (&(sfp->ids), 0, (Pointer) cp);
565
if (AsnReadVal(aip, atp, &av) <= 0) goto erret; /* read the END STRUCT */
566
AsnUnlinkType (SEQ_FEAT_ids);
504
568
sfp->ids = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqFeatIdAsnRead, (AsnOptFreeFunc) SeqFeatIdFree);
505
569
if (isError && sfp->ids == NULL) {
509
else if (atp == SEQ_FEAT_exts)
574
else if (atp == SEQ_FEAT_exts)
576
atp = AsnLinkType (SEQ_FEAT_exts, FEAT_ID);
577
if (atp == NULL) goto erret;
578
if (AsnReadVal(aip, atp, &av) <= 0) goto erret; /* read the SEQUENCE */
579
while ((atp = AsnReadId(aip, amp, atp)) == SEQ_FEAT_exts_E) {
580
uop = UserObjectAsnRead (aip, atp);
581
if (uop == NULL) goto erret;
585
if (sfp->exts == NULL) {
590
if (AsnReadVal(aip, atp, &av) <= 0) goto erret; /* read the END STRUCT */
591
AsnUnlinkType (SEQ_FEAT_exts);
511
593
sfp->exts = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) UserObjectAsnRead, (AsnOptFreeFunc) UserObjectFree);
512
594
if (isError && sfp->exts == NULL) {