~ubuntu-branches/ubuntu/precise/ncbi-tools6/precise

« back to all changes in this revision

Viewing changes to object/objfeat.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2005-03-27 12:00:15 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050327120015-embhesp32nj73p9r
Tags: 6.1.20041020-3
* Fix FTBFS under GCC 4.0 caused by inconsistent use of "static" on
  functions.  (Closes: #295110.)
* Add a watch file, now that we can.  (Upstream's layout needs version=3.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
*   
30
30
* Version Creation Date: 4/1/91
31
31
*
32
 
* $Revision: 6.16 $
 
32
* $Revision: 6.23 $
33
33
*
34
34
* File Description:  Object manager for module NCBI-SeqFeat
35
35
*
385
385
*
386
386
*   SeqFeatAsnRead(aip, atp)
387
387
*       atp is the current type (if identifier of a parent struct)
388
 
*            assumption is readIdent has occured
 
388
*            assumption is readIdent has occurred
389
389
*       if atp == NULL, then assumes it stands alone and read ident
390
 
*            has not occured.
 
390
*            has not occurred.
391
391
*
392
392
*****************************************************************************/
393
393
NLM_EXTERN SeqFeatPtr LIBCALL SeqFeatAsnRead (AsnIoPtr aip, AsnTypePtr orig)
512
512
        AsnUnlinkType(orig);       /* unlink local tree */
513
513
        return sfp;
514
514
erret:
 
515
    aip->io_failure = TRUE;
515
516
    sfp = SeqFeatFree(sfp);
516
517
    goto ret;
517
518
}
838
839
*
839
840
*   SeqFeatDataAsnRead(aip, atp, cp)
840
841
*       atp is the current type (if identifier of a parent struct)
841
 
*            assumption is readIdent has occured
 
842
*            assumption is readIdent has occurred
842
843
*       if atp == NULL, then assumes it stands alone and read ident
843
 
*            has not occured.
 
844
*            has not occurred.
844
845
*
845
846
*****************************************************************************/
846
847
NLM_EXTERN Boolean LIBCALL SeqFeatDataAsnRead (AsnIoPtr aip, AsnTypePtr orig, ChoicePtr cp)
1085
1086
*
1086
1087
*   GBQualAsnRead(aip, atp)
1087
1088
*       atp is the current type (if identifier of a parent struct)
1088
 
*            assumption is readIdent has occured
 
1089
*            assumption is readIdent has occurred
1089
1090
*       if atp == NULL, then assumes it stands alone and read ident
1090
 
*            has not occured.
 
1091
*            has not occurred.
1091
1092
*
1092
1093
*****************************************************************************/
1093
1094
NLM_EXTERN GBQualPtr LIBCALL GBQualAsnRead (AsnIoPtr aip, AsnTypePtr orig)
1250
1251
*
1251
1252
*   SeqFeatXrefAsnRead(aip, atp)
1252
1253
*       atp is the current type (if identifier of a parent struct)
1253
 
*            assumption is readIdent has occured
 
1254
*            assumption is readIdent has occurred
1254
1255
*       if atp == NULL, then assumes it stands alone and read ident
1255
 
*            has not occured.
 
1256
*            has not occurred.
1256
1257
*
1257
1258
*****************************************************************************/
1258
1259
NLM_EXTERN SeqFeatXrefPtr LIBCALL SeqFeatXrefAsnRead (AsnIoPtr aip, AsnTypePtr orig)
1424
1425
*
1425
1426
*   CdRegionAsnRead(aip, atp)
1426
1427
*       atp is the current type (if identifier of a parent struct)
1427
 
*            assumption is readIdent has occured
 
1428
*            assumption is readIdent has occurred
1428
1429
*       if atp == NULL, then assumes it stands alone and read ident
1429
 
*            has not occured.
 
1430
*            has not occurred.
1430
1431
*
1431
1432
*****************************************************************************/
1432
1433
NLM_EXTERN CdRegionPtr LIBCALL CdRegionAsnRead (AsnIoPtr aip, AsnTypePtr orig)
1725
1726
*
1726
1727
*   GeneticCodePtr GeneticCodeAsnRead(aip, atp)
1727
1728
*       atp is the current type (if identifier of a parent struct)
1728
 
*            assumption is readIdent has occured
 
1729
*            assumption is readIdent has occurred
1729
1730
*       if atp == NULL, then assumes it stands alone and read ident
1730
 
*            has not occured.
 
1731
*            has not occurred.
1731
1732
*
1732
1733
*****************************************************************************/
1733
1734
NLM_EXTERN GeneticCodePtr LIBCALL GeneticCodeAsnRead (AsnIoPtr aip, AsnTypePtr orig)
1827
1828
"name \"SGC5\" , id 6 ,\n" \
1828
1829
"ncbieaa  \"FFLLSSSSYYQQCC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRVVVVAAAADDEEGGGG\",\n" \
1829
1830
"sncbieaa \"-----------------------------------M----------------------------\" } ,\n" \
1830
 
"{ name \"Echinoderm Mitochondrial\" , name \"SGC8\" , id 9 ,\n" \
 
1831
"{ name \"Echinoderm Mitochondrial; Flatworm Mitochondrial\" , name \"SGC8\" , id 9 ,\n" \
1831
1832
"ncbieaa  \"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG\",\n" \
1832
1833
"sncbieaa \"-----------------------------------M---------------M------------\" } ,\n" \
1833
1834
"{ name \"Euplotid Nuclear\" , name \"SGC9\" , id 10 ,\n" \
1842
1843
"{ name \"Ascidian Mitochondrial\" , id 13 ,\n" \
1843
1844
"ncbieaa  \"FFLLSSSSYY**CCWWLLLLPPPPHHQQRRRRIIMMTTTTNNKKSSGGVVVVAAAADDEEGGGG\",\n" \
1844
1845
"sncbieaa \"-----------------------------------M----------------------------\" } ,\n" \
1845
 
"{ name \"Flatworm Mitochondrial\" , id 14 ,\n" \
 
1846
"{ name \"Alternative Flatworm Mitochondrial\" , id 14 ,\n" \
1846
1847
"ncbieaa  \"FFLLSSSSYYY*CCWWLLLLPPPPHHQQRRRRIIIMTTTTNNNKSSSSVVVVAAAADDEEGGGG\",\n" \
1847
1848
"sncbieaa \"-----------------------------------M----------------------------\" } ,\n" \
1848
1849
"{ name \"Blepharisma Macronuclear\" , id 15 ,\n" \
1886
1887
 
1887
1888
NLM_EXTERN GeneticCodePtr LIBCALL GeneticCodeTableLoad (void)
1888
1889
{
1889
 
    Char buf[80];
 
1890
    Char buf[PATH_MAX];
1890
1891
    AsnIoPtr aip;
1891
1892
 
1892
1893
        if (genetic_codes != NULL)
2017
2018
*
2018
2019
*   GeneticCodePtr GeneticCodeTableAsnRead(aip, atp)
2019
2020
*       atp is the current type (if identifier of a parent struct)
2020
 
*            assumption is readIdent has occured
 
2021
*            assumption is readIdent has occurred
2021
2022
*       if atp == NULL, then assumes it stands alone and read ident
2022
 
*            has not occured.
 
2023
*            has not occurred.
2023
2024
*
2024
2025
*****************************************************************************/
2025
2026
NLM_EXTERN GeneticCodePtr LIBCALL GeneticCodeTableAsnRead (AsnIoPtr aip, AsnTypePtr orig)
2158
2159
*
2159
2160
*   CodeBreakAsnRead(aip, atp)
2160
2161
*       atp is the current type (if identifier of a parent struct)
2161
 
*            assumption is readIdent has occured
 
2162
*            assumption is readIdent has occurred
2162
2163
*       if atp == NULL, then assumes it stands alone and read ident
2163
 
*            has not occured.
 
2164
*            has not occurred.
2164
2165
*
2165
2166
*****************************************************************************/
2166
2167
NLM_EXTERN CodeBreakPtr LIBCALL CodeBreakAsnRead (AsnIoPtr aip, AsnTypePtr orig)
2300
2301
*
2301
2302
*   ImpFeatAsnRead(aip, atp)
2302
2303
*       atp is the current type (if identifier of a parent struct)
2303
 
*            assumption is readIdent has occured
 
2304
*            assumption is readIdent has occurred
2304
2305
*       if atp == NULL, then assumes it stands alone and read ident
2305
 
*            has not occured.
 
2306
*            has not occurred.
2306
2307
*
2307
2308
*****************************************************************************/
2308
2309
NLM_EXTERN ImpFeatPtr LIBCALL ImpFeatAsnRead (AsnIoPtr aip, AsnTypePtr orig)
2501
2502
*
2502
2503
*   RnaRefAsnRead(aip, atp)
2503
2504
*       atp is the current type (if identifier of a parent struct)
2504
 
*            assumption is readIdent has occured
 
2505
*            assumption is readIdent has occurred
2505
2506
*       if atp == NULL, then assumes it stands alone and read ident
2506
 
*            has not occured.
 
2507
*            has not occurred.
2507
2508
*
2508
2509
*****************************************************************************/
2509
2510
NLM_EXTERN RnaRefPtr LIBCALL RnaRefAsnRead (AsnIoPtr aip, AsnTypePtr orig)
2651
2652
        MemFree(anp);
2652
2653
        anp = next;
2653
2654
    }
 
2655
    MemFree (grp->locus_tag);
2654
2656
    return (GeneRefPtr)MemFree(grp);
2655
2657
}
2656
2658
 
2699
2701
        vnp->data.ptrvalue = (Pointer)StringSave((CharPtr)anp->data.ptrvalue);
2700
2702
        anp = anp->next;
2701
2703
    }
 
2704
        if (grp->locus_tag != NULL)
 
2705
                ngp->locus_tag = StringSave(grp->locus_tag);
2702
2706
    return ngp;
2703
2707
}
2704
2708
 
2786
2790
        if (! AsnCloseStruct(aip, GENE_REF_syn, (Pointer)grp->syn))
2787
2791
            goto erret;
2788
2792
    }
 
2793
    if (grp->locus_tag != NULL)
 
2794
    {
 
2795
        av.ptrvalue = grp->locus_tag;
 
2796
        if (! AsnWrite(aip, GENE_REF_locus_tag, &av)) goto erret;
 
2797
    }
2789
2798
    if (! AsnCloseStruct(aip, atp, (Pointer)grp))
2790
2799
        goto erret;
2791
2800
    retval = TRUE;
2798
2807
*
2799
2808
*   GeneRefAsnRead(aip, atp)
2800
2809
*       atp is the current type (if identifier of a parent struct)
2801
 
*            assumption is readIdent has occured
 
2810
*            assumption is readIdent has occurred
2802
2811
*       if atp == NULL, then assumes it stands alone and read ident
2803
 
*            has not occured.
 
2812
*            has not occurred.
2804
2813
*
2805
2814
*****************************************************************************/
2806
2815
NLM_EXTERN GeneRefPtr LIBCALL GeneRefAsnRead (AsnIoPtr aip, AsnTypePtr orig)
2880
2889
                goto erret;
2881
2890
            if (AsnReadVal(aip, atp, &av) <= 0) goto erret;  /* end SET OF */
2882
2891
        }
 
2892
        else if (atp == GENE_REF_locus_tag)
 
2893
            grp->locus_tag = (CharPtr)av.ptrvalue;
2883
2894
    }
2884
2895
    if (AsnReadVal(aip, atp, &av) <= 0) goto erret;   /* end struct */
2885
2896
ret:
2913
2924
    if (orp == NULL)
2914
2925
        return (OrgRefPtr)NULL;
2915
2926
 
2916
 
    MemFree(orp->taxname);
2917
 
    MemFree(orp->common);
 
2927
    orp->taxname = MemFree(orp->taxname);
 
2928
    orp->common = MemFree(orp->common);
2918
2929
    ValNodeFreeData(orp->mod);
 
2930
        orp->mod = NULL;
2919
2931
    anp = orp->db;
2920
2932
    while (anp != NULL)
2921
2933
    {
2924
2936
        MemFree(anp);
2925
2937
        anp = next;
2926
2938
    }
 
2939
        orp->db = NULL;
2927
2940
    ValNodeFreeData(orp->syn);
 
2941
        orp->syn = NULL;
2928
2942
        OrgNameFree(orp->orgname);
 
2943
        orp->orgname = NULL;
2929
2944
    return (OrgRefPtr)MemFree(orp);
2930
2945
}
2931
2946
 
3030
3045
*
3031
3046
*   OrgRefAsnRead(aip, atp)
3032
3047
*       atp is the current type (if identifier of a parent struct)
3033
 
*            assumption is readIdent has occured
 
3048
*            assumption is readIdent has occurred
3034
3049
*       if atp == NULL, then assumes it stands alone and read ident
3035
 
*            has not occured.
 
3050
*            has not occurred.
3036
3051
*
3037
3052
*****************************************************************************/
3038
3053
NLM_EXTERN OrgRefPtr LIBCALL OrgRefAsnRead (AsnIoPtr aip, AsnTypePtr orig)
3309
3324
*
3310
3325
*   OrgNameAsnRead(aip, atp)
3311
3326
*       atp is the current type (if identifier of a parent struct)
3312
 
*            assumption is readIdent has occured
 
3327
*            assumption is readIdent has occurred
3313
3328
*       if atp == NULL, then assumes it stands alone and read ident
3314
 
*            has not occured.
 
3329
*            has not occurred.
3315
3330
*
3316
3331
*****************************************************************************/
3317
3332
NLM_EXTERN OrgNamePtr LIBCALL OrgNameAsnRead (AsnIoPtr aip, AsnTypePtr orig)
3774
3789
*
3775
3790
*   ProtRefAsnRead(aip, atp)
3776
3791
*       atp is the current type (if identifier of a parent struct)
3777
 
*            assumption is readIdent has occured
 
3792
*            assumption is readIdent has occurred
3778
3793
*       if atp == NULL, then assumes it stands alone and read ident
3779
 
*            has not occured.
 
3794
*            has not occurred.
3780
3795
*
3781
3796
*****************************************************************************/
3782
3797
NLM_EXTERN ProtRefPtr LIBCALL ProtRefAsnRead (AsnIoPtr aip, AsnTypePtr orig)
3958
3973
*
3959
3974
*   RsiteRefAsnRead(aip, atp)
3960
3975
*       atp is the current type (if identifier of a parent struct)
3961
 
*            assumption is readIdent has occured
 
3976
*            assumption is readIdent has occurred
3962
3977
*       if atp == NULL, then assumes it stands alone and read ident
3963
 
*            has not occured.
 
3978
*            has not occurred.
3964
3979
*
3965
3980
*****************************************************************************/
3966
3981
NLM_EXTERN RsiteRefPtr LIBCALL RsiteRefAsnRead (AsnIoPtr aip, AsnTypePtr orig)
4144
4159
*
4145
4160
*   SeqFeatIdAsnRead(aip, atp, cp)
4146
4161
*       atp is the current type (if identifier of a parent struct)
4147
 
*            assumption is readIdent has occured
 
4162
*            assumption is readIdent has occurred
4148
4163
*       if atp == NULL, then assumes it stands alone and read ident
4149
 
*            has not occured.
 
4164
*            has not occurred.
4150
4165
*
4151
4166
*****************************************************************************/
4152
4167
NLM_EXTERN Boolean LIBCALL SeqFeatIdAsnRead (AsnIoPtr aip, AsnTypePtr orig, ChoicePtr cp)
4446
4461
*
4447
4462
*   TxinitAsnRead(aip, atp)
4448
4463
*       atp is the current type (if identifier of a parent struct)
4449
 
*            assumption is readIdent has occured
 
4464
*            assumption is readIdent has occurred
4450
4465
*       if atp == NULL, then assumes it stands alone and read ident
4451
 
*            has not occured.
 
4466
*            has not occurred.
4452
4467
*
4453
4468
*****************************************************************************/
4454
4469
NLM_EXTERN TxinitPtr LIBCALL TxinitAsnRead (AsnIoPtr aip, AsnTypePtr orig)
4710
4725
*
4711
4726
*   OrgModAsnRead(aip, atp)
4712
4727
*       atp is the current type (if identifier of a parent struct)
4713
 
*            assumption is readIdent has occured
 
4728
*            assumption is readIdent has occurred
4714
4729
*       if atp == NULL, then assumes it stands alone and read ident
4715
 
*            has not occured.
 
4730
*            has not occurred.
4716
4731
*
4717
4732
*****************************************************************************/
4718
4733
NLM_EXTERN OrgModPtr LIBCALL OrgModAsnRead (AsnIoPtr aip, AsnTypePtr orig)
4952
4967
*
4953
4968
*   TaxElementAsnRead(aip, atp)
4954
4969
*       atp is the current type (if identifier of a parent struct)
4955
 
*            assumption is readIdent has occured
 
4970
*            assumption is readIdent has occurred
4956
4971
*       if atp == NULL, then assumes it stands alone and read ident
4957
 
*            has not occured.
 
4972
*            has not occurred.
4958
4973
*
4959
4974
*****************************************************************************/
4960
4975
NLM_EXTERN TaxElementPtr LIBCALL TaxElementAsnRead (AsnIoPtr aip, AsnTypePtr orig)
5198
5213
*
5199
5214
*   BinomialOrgNameAsnRead(aip, atp)
5200
5215
*       atp is the current type (if identifier of a parent struct)
5201
 
*            assumption is readIdent has occured
 
5216
*            assumption is readIdent has occurred
5202
5217
*       if atp == NULL, then assumes it stands alone and read ident
5203
 
*            has not occured.
 
5218
*            has not occurred.
5204
5219
*
5205
5220
*****************************************************************************/
5206
5221
NLM_EXTERN BinomialOrgNamePtr LIBCALL BinomialOrgNameAsnRead (AsnIoPtr aip, AsnTypePtr orig)
5357
5372
*
5358
5373
*   BioSourceAsnRead(aip, atp)
5359
5374
*       atp is the current type (if identifier of a parent struct)
5360
 
*            assumption is readIdent has occured
 
5375
*            assumption is readIdent has occurred
5361
5376
*       if atp == NULL, then assumes it stands alone and read ident
5362
 
*            has not occured.
 
5377
*            has not occurred.
5363
5378
*
5364
5379
*****************************************************************************/
5365
5380
NLM_EXTERN BioSourcePtr LIBCALL BioSourceAsnRead (AsnIoPtr aip, AsnTypePtr orig)
5509
5524
*
5510
5525
*   SubSourceAsnRead(aip, atp)
5511
5526
*       atp is the current type (if identifier of a parent struct)
5512
 
*            assumption is readIdent has occured
 
5527
*            assumption is readIdent has occurred
5513
5528
*       if atp == NULL, then assumes it stands alone and read ident
5514
 
*            has not occured.
 
5529
*            has not occurred.
5515
5530
*
5516
5531
*****************************************************************************/
5517
5532
NLM_EXTERN SubSourcePtr LIBCALL SubSourceAsnRead (AsnIoPtr aip, AsnTypePtr orig)