2096
2123
/**************************************************
2125
* ID2SSeqFeatIdsInfoNew()
2127
**************************************************/
2129
ID2SSeqFeatIdsInfoPtr LIBCALL
2130
ID2SSeqFeatIdsInfoNew(void)
2132
ID2SSeqFeatIdsInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqFeatIdsInfo));
2139
/**************************************************
2141
* ID2SSeqFeatIdsInfoFree()
2143
**************************************************/
2145
ID2SSeqFeatIdsInfoPtr LIBCALL
2146
ID2SSeqFeatIdsInfoFree(ID2SSeqFeatIdsInfoPtr ptr)
2152
AsnGenericUserSeqOfFree(ptr -> feat_types, (AsnOptFreeFunc) ID2SFeatTypeInfoFree);
2153
AsnGenericUserSeqOfFree(ptr -> xref_types, (AsnOptFreeFunc) ID2SFeatTypeInfoFree);
2154
AsnGenericBaseSeqOfFree(ptr -> local_ids ,ASNCODE_INTVAL_SLOT);
2155
return MemFree(ptr);
2159
/**************************************************
2161
* ID2SSeqFeatIdsInfoAsnRead()
2163
**************************************************/
2165
ID2SSeqFeatIdsInfoPtr LIBCALL
2166
ID2SSeqFeatIdsInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig)
2170
Boolean isError = FALSE;
2172
ID2SSeqFeatIdsInfoPtr ptr;
2176
if (! id2sgenAsnLoad()) {
2185
if (orig == NULL) { /* ID2SSeqFeatIdsInfo ::= (self contained) */
2186
atp = AsnReadId(aip, amp, ID2S_SEQ_FEAT_IDS_INFO);
2188
atp = AsnLinkType(orig, ID2S_SEQ_FEAT_IDS_INFO);
2190
/* link in local tree */
2195
ptr = ID2SSeqFeatIdsInfoNew();
2199
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
2203
atp = AsnReadId(aip,amp, atp);
2206
if (atp == SEQ_FEAT_IDS_INFO_feat_types) {
2207
ptr -> feat_types = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SFeatTypeInfoAsnRead, (AsnOptFreeFunc) ID2SFeatTypeInfoFree);
2208
if (isError && ptr -> feat_types == NULL) {
2211
atp = AsnReadId(aip,amp, atp);
2213
if (atp == SEQ_FEAT_IDS_INFO_xref_types) {
2214
ptr -> xref_types = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SFeatTypeInfoAsnRead, (AsnOptFreeFunc) ID2SFeatTypeInfoFree);
2215
if (isError && ptr -> xref_types == NULL) {
2218
atp = AsnReadId(aip,amp, atp);
2220
if (atp == SEQ_FEAT_IDS_INFO_local_ids) {
2221
ptr -> local_ids = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError);
2222
if (isError && ptr -> local_ids == NULL) {
2225
atp = AsnReadId(aip,amp, atp);
2228
if (AsnReadVal(aip, atp, &av) <= 0) {
2234
AsnUnlinkType(orig); /* unlink local tree */
2238
aip -> io_failure = TRUE;
2239
ptr = ID2SSeqFeatIdsInfoFree(ptr);
2245
/**************************************************
2247
* ID2SSeqFeatIdsInfoAsnWrite()
2249
**************************************************/
2250
NLM_EXTERN Boolean LIBCALL
2251
ID2SSeqFeatIdsInfoAsnWrite(ID2SSeqFeatIdsInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
2255
Boolean retval = FALSE;
2259
if (! id2sgenAsnLoad()) {
2268
atp = AsnLinkType(orig, ID2S_SEQ_FEAT_IDS_INFO); /* link local tree */
2273
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
2274
if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
2278
AsnGenericUserSeqOfAsnWrite(ptr -> feat_types, (AsnWriteFunc) ID2SFeatTypeInfoAsnWrite, aip, SEQ_FEAT_IDS_INFO_feat_types, SEQ_FEAT_IDS_INFO_feat_types_E);
2279
AsnGenericUserSeqOfAsnWrite(ptr -> xref_types, (AsnWriteFunc) ID2SFeatTypeInfoAsnWrite, aip, SEQ_FEAT_IDS_INFO_xref_types, SEQ_FEAT_IDS_INFO_xref_types_E);
2280
retval = AsnGenericBaseSeqOfAsnWrite(ptr -> local_ids ,ASNCODE_INTVAL_SLOT, aip, SEQ_FEAT_IDS_INFO_local_ids, SEQ_FEAT_IDS_INFO_local_ids_E);
2281
if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
2287
AsnUnlinkType(orig); /* unlink local tree */
2293
/**************************************************
2098
2295
* ID2SBioseqSetIdsFree()
2100
2297
**************************************************/