diff options
author | Aaron M. Ucko <ucko@debian.org> | 2005-03-24 17:57:54 +0000 |
---|---|---|
committer | Aaron M. Ucko <ucko@debian.org> | 2005-03-24 17:57:54 +0000 |
commit | 9dd1ccc4b3f1bac2a7dda6ff84c690c05aaca0af (patch) | |
tree | 90701a363bcd56ba5c0cfc0a82a3a1b1aad2b29c /network | |
parent | f22906b4b2a6ff3f8a318fec92d95baf9e9965a6 (diff) |
Load ncbi (6.1.20040505) into ncbi-tools6/branches/upstream/current.
Diffstat (limited to 'network')
25 files changed, 6224 insertions, 4870 deletions
diff --git a/network/blast3/client/.NETBLAST_VERSION b/network/blast3/client/.NETBLAST_VERSION deleted file mode 100644 index bda8fbec..00000000 --- a/network/blast3/client/.NETBLAST_VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2.6 diff --git a/network/id1arch/accid1.c b/network/id1arch/accid1.c index fa8b070f..6cb3885f 100644 --- a/network/id1arch/accid1.c +++ b/network/id1arch/accid1.c @@ -257,6 +257,8 @@ s_ID1BioseqFetchFunc(Pointer data) BioseqPtr bsp; SeqIdPtr sip; Int4 gi=0; + Int4 ent=0; + CharPtr sat=NULL; Int2 retcode=0; ompcp = (OMProcControlPtr)data; @@ -287,6 +289,13 @@ s_ID1BioseqFetchFunc(Pointer data) return OM_MSG_RET_ERROR; if(sip->choice != SEQID_GI){ + if(sip->choice==SEQID_GENERAL){ + Dbtag *db = (Dbtag*)sip->data.ptrvalue; + sat=db->db; + gi=ent=db->tag->str?atoi(db->tag->str):db->tag->id; + sep=ID1ArchSeqEntryGet(gi,sat,ent,0,0); + if(sep) goto GOTIT; + } gi = ID1FindSeqId(sip); } else { gi = sip->data.intvalue; @@ -298,7 +307,7 @@ s_ID1BioseqFetchFunc(Pointer data) sep = ID1SeqEntryGet(gi,0);/*** always get a whole blob in anticipation of following requests ***/ if(sep == NULL) return OM_MSG_RET_ERROR; - +GOTIT: sip = (SeqIdPtr)(ompcp->input_data); bsp = BioseqFindInSeqEntry(sip, sep); ompcp->output_data = (Pointer)bsp; diff --git a/network/id1arch/idfetch.c b/network/id1arch/idfetch.c index 9ba87b96..09660d5d 100644 --- a/network/id1arch/idfetch.c +++ b/network/id1arch/idfetch.c @@ -25,6 +25,9 @@ * Author Karl Sirotkin * $Log: idfetch.c,v $ + Revision 1.31 2004/02/18 22:18:45 yaschenk + adding recognition of gnl|sat_name|ent seqids + Revision 1.30 2004/02/03 21:25:16 yaschenk relaxing ranges for -g and -e @@ -602,9 +605,15 @@ Int2 Main() gi = ID1ArchGIGet (sip); if(gi <= 0) { - SeqIdPrint(sip, tbuf, PRINTID_FASTA_SHORT); - ErrPostEx(SEV_ERROR, 0, 0, "Couldn't find SeqId [%s]", tbuf); - goto FATAL; + if(sip->choice==SEQID_GENERAL){ + Dbtag *db = (Dbtag*)sip->data.ptrvalue; + gi=myargs[entarg].intvalue=db->tag->str?atoi(db->tag->str):db->tag->id; + myargs[dbarg].strvalue=StringSave(db->db); + } else { + SeqIdPrint(sip, tbuf, PRINTID_FASTA_SHORT); + ErrPostEx(SEV_ERROR, 0, 0, "Couldn't find SeqId [%s]", tbuf); + goto FATAL; + } } } else if(fp_in) @@ -744,7 +753,10 @@ static Boolean IdFetch_func1(CharPtr data, Int2 maxplex) if(seqIdParse) { SeqIdPtr sip; - Int4 gi; + Int4 gi,ent=0; + CharPtr sat=NULL; + + sip = SeqIdParse(data); if(sip == NULL) { @@ -754,11 +766,17 @@ static Boolean IdFetch_func1(CharPtr data, Int2 maxplex) gi = ID1ArchGIGet(sip); if(gi <= 0) { - SeqIdPrint(sip, data, PRINTID_FASTA_SHORT); - ErrPostEx(SEV_ERROR, 0, 0, "Couldn't find SeqId [%s]", data); - exit(1); + if(sip->choice==SEQID_GENERAL){ + Dbtag *db = (Dbtag*)sip->data.ptrvalue; + gi=ent=db->tag->str?atoi(db->tag->str):db->tag->id; + sat=StringSave(db->db); + } else { + SeqIdPrint(sip, data, PRINTID_FASTA_SHORT); + ErrPostEx(SEV_ERROR, 0, 0, "Couldn't find SeqId [%s]", data); + exit(1); + } } - return IdFetch_func(gi, NULL, 0, maxplex); + return IdFetch_func(gi, sat, ent, maxplex); } else if(hasVersion || accession) { @@ -996,13 +1014,9 @@ static Boolean IdFetch_func(Int4 gi,CharPtr db, Int4 ent,Int2 maxplex) } break; case 3: -#if 0 - if(!SeqEntryToFlat(sep, fp, GENBANK_FMT, RELEASE_MODE)){ -#else AssignIDsInEntity(0,OBJ_SEQENTRY,sep); if(!SeqEntryToGnbk(sep,NULL,GENBANK_FMT,ENTREZ_MODE,0,SHOW_CONTIG_FEATURES|ONLY_NEAR_FEATURES, LOOKUP_FAR_COMPONENTS|LOOKUP_FAR_LOCATIONS|LOOKUP_FAR_PRODUCTS|LOOKUP_FAR_HISTORY|STREAM_SEQ_PORT_FIRST,0,NULL,fp)){ -#endif ErrPostEx(SEV_WARNING,0,0, "GenBank Format does not exist for this sequence "); retval=FALSE; @@ -1010,13 +1024,9 @@ static Boolean IdFetch_func(Int4 gi,CharPtr db, Int4 ent,Int2 maxplex) } break; case 4: -#if 0 - if(!SeqEntryToFlat(sep, fp, GENPEPT_FMT, RELEASE_MODE)) -#else AssignIDsInEntity(0,OBJ_SEQENTRY,sep); if(!SeqEntryToGnbk(sep,NULL,GENPEPT_FMT,ENTREZ_MODE,0,SHOW_CONTIG_FEATURES|ONLY_NEAR_FEATURES, LOOKUP_FAR_COMPONENTS|LOOKUP_FAR_LOCATIONS|LOOKUP_FAR_PRODUCTS|LOOKUP_FAR_HISTORY|STREAM_SEQ_PORT_FIRST,0,NULL,fp)) -#endif { ErrPostEx(SEV_WARNING,0,0, "GenPept Format does not exist for this sequence"); @@ -1031,21 +1041,11 @@ static Boolean IdFetch_func(Int4 gi,CharPtr db, Int4 ent,Int2 maxplex) switch(myargs[infotypearg].intvalue){ case 0: if(bsp){ -#if 0 - SeqEntrysToFasta (sep, fp, ISA_na (bsp->mol), group_segs); -#else MyBioseqToFasta(bsp,(Pointer)fp); -#endif } else { -#if 0 - SeqEntryToFasta(sep, fp, TRUE); /* nuc acids */ - SeqEntryToFasta(sep, fp, FALSE); /* proteins */ -#else VisitBioseqsInSep(sep,(Pointer)fp, MyBioseqToFasta); - -#endif } break; case 2: diff --git a/network/id2arch/id2.asn b/network/id2arch/id2.asn index f85764af..739be22f 100644 --- a/network/id2arch/id2.asn +++ b/network/id2arch/id2.asn @@ -1,4 +1,4 @@ ---$Revision: 1.6 $ +--$Revision: 1.11 $ --******************************************************************** -- -- Network Id server network access @@ -16,14 +16,17 @@ NCBI-ID2Access DEFINITIONS ::= BEGIN -IMPORTS Seq-id, Seq-loc FROM NCBI-Seqloc - ID2S-Chunk-Id FROM NCBI-Seq-split; +IMPORTS Seq-id, Seq-loc FROM NCBI-Seqloc + ID2S-Chunk-Id, ID2S-Seq-annot-Info FROM NCBI-Seq-split; ---------------------------------------------------------------------------- -- request types ---------------------------------------------------------------------------- +-- Requests are sent in packets to allow sending several requests at once +-- to avoid network latency, without possiblity of deadlock with server. +-- Server will not start sending replies until it will read the whole packet. ID2-Request-Packet ::= SEQUENCE OF ID2-Request @@ -37,16 +40,17 @@ ID2-Request ::= SEQUENCE { request CHOICE { init NULL, get-packages ID2-Request-Get-Packages, - string-to-gi ID2-Request-String-To-Gi, - seq-id-to-gi ID2-Request-Seq-id-To-Gi, - gi-to-tse-id ID2-Request-Gi-To-TSE-Id, - get-tse ID2-Request-Get-TSE, - reget-tse ID2-Request-ReGet-TSE, + get-seq-id ID2-Request-Get-Seq-id, + get-blob-id ID2-Request-Get-Blob-Id, + get-blob-info ID2-Request-Get-Blob-Info, + reget-blob ID2-Request-ReGet-Blob, get-chunks ID2S-Request-Get-Chunks } } +-- Request for set of params packages know by server. +-- Packages can be used to abbreviate parameters of request. ID2-Request-Get-Packages ::= SEQUENCE { -- return known packages from this list -- if unset - return all known packages @@ -56,93 +60,125 @@ ID2-Request-Get-Packages ::= SEQUENCE { no-contents NULL OPTIONAL } - -ID2-Request-String-To-Gi ::= SEQUENCE { - -- requested sequence ID, can be any string - id VisibleString +-- Requested sequence ID, can be any string or Seq-id. +-- This request will be replied with one or more ID2-Reply-Get-Seq-id. +ID2-Request-Get-Seq-id ::= SEQUENCE { + seq-id ID2-Seq-id, + seq-id-type INTEGER { + any (0), -- return any one Seq-id + gi (1), -- gi is preferred + text (2), -- text Seq-id (accession etc) is preferred + general (4), -- general Seq-id is preferred + all (127) -- return all Seq-ids of the sequence + } DEFAULT any } -ID2-Request-Seq-id-To-Gi ::= SEQUENCE { - -- requested sequence ID, can be any ID +ID2-Seq-id ::= CHOICE { + string VisibleString, seq-id Seq-id } -ID2-Request-Gi-To-TSE-Id ::= SEQUENCE { +-- Return blob-id with specified seq-id. +-- This request with be replied with one or more ID2-Reply-Get-Blob-Id. +ID2-Request-Get-Blob-Id ::= SEQUENCE { -- id can be supplied by inner request - gi CHOICE { - gi INTEGER, - string ID2-Request-String-To-Gi, - seq-id ID2-Request-Seq-id-To-Gi - }, - - -- return id of tse with sequence - sources SET OF VisibleString OPTIONAL, + seq-id ID2-Request-Get-Seq-id, - -- return TSE-Ids with external references to this gi - external NULL OPTIONAL, + -- return id of blob with sequence + sources SEQUENCE OF VisibleString OPTIONAL, - -- return in addition list of gis also resolving to this tse - current-gis NULL OPTIONAL + -- return Blob-Ids with external features on this Seq-id + external NULL OPTIONAL } -ID2-Request-Get-TSE ::= SEQUENCE { +-- Return some information related to the blob. +-- This request with be replied with one or more of: +-- ID2-Reply-Get-Blob-Seq-ids - if requested by get-seq-ids field +-- ID2-Reply-Get-Blob - if requested by get-data field +-- ID2S-Reply-Get-Split-Info +-- ID2S-Reply-Get-Chunk +-- Last two can be sent in addition to ID2-Reply-Get-Blob +-- if the blob is split on the server. +-- The replies are made separate to allow server to create replies easier +-- from precalculated data. Each of these replies have ID2-Reply-Data field. +ID2-Request-Get-Blob-Info ::= SEQUENCE { -- id can be supplied by inner request - tse-id CHOICE { - tse-id ID2-TSE-Id, - gi SEQUENCE { - request ID2-Request-Gi-To-TSE-Id, - - -- if this field is set, then server will not send - -- tses listed here - exclude-tses SET OF ID2-TSE-Id OPTIONAL + blob-id CHOICE { + -- id can be supplied by inner request + blob-id ID2-Blob-Id, + + -- generate blob-ids from request + resolve SEQUENCE { + request ID2-Request-Get-Blob-Id, + + -- server will not send blobs listed here + exclude-blobs SEQUENCE OF ID2-Blob-Id OPTIONAL } }, + -- return in addition list of Seq-ids also resolving to this blob + get-seq-ids NULL OPTIONAL, + -- level of details requested immediately - -- server will send relevant chunks if TSE is splitted - details ID2-Get-TSE-Details OPTIONAL + -- server will send relevant chunks if blob is splitted + get-data ID2-Get-Blob-Details OPTIONAL } -ID2-Request-ReGet-TSE ::= SEQUENCE { - tse-id ID2-TSE-Id, +-- This is similar to FTP reget command. +-- It may be unsupported by server. +-- It's defined only for plain blobs (returned in ID2-Reply-Get-Blob) +-- as all split data comes in small chunks, so reget doesn't make sense. +ID2-Request-ReGet-Blob ::= SEQUENCE { + blob-id ID2-Blob-Id, - -- level of details requested - details ID2-Get-TSE-Details OPTIONAL, + -- blob split version to resend + split-version INTEGER, -- start offset of data to get offset INTEGER } - +-- Request for specific chunks. +-- Server will reply with one or more ID2S-Reply-Get-Chunk. ID2S-Request-Get-Chunks ::= SEQUENCE { - tse-id ID2-TSE-Id, + blob-id ID2-Blob-Id, -- requests for specific chunks of splitted blob - chunks SET OF ID2S-Chunk-Id + chunks SEQUENCE OF ID2S-Chunk-Id } -ID2-Get-TSE-Details ::= SEQUENCE { - location Seq-loc, +-- The following structure describes what parts of blob are required +-- immediately after ID2-Request-Get-Blob-Info in case blob is split. +-- Seq-entry level will have probably the same values as Entry-complexities. +ID2-Get-Blob-Details ::= SEQUENCE { + -- reference location for details - can be only part of sequence + location Seq-loc OPTIONAL, + -- Seq-entry level for all data except descriptors (sequnence, annots) seq-class-level INTEGER DEFAULT 1, + -- Seq-entry level for descriptors descr-level INTEGER DEFAULT 1, + -- mask of descriptor types - see Seqdesc for variants' values descr-type-mask INTEGER DEFAULT 0, + -- mask of annotation types - see Seq-annot.data for values annot-type-mask INTEGER DEFAULT 0, + -- mask of feature types - see SeqFeatData for values feat-type-mask INTEGER DEFAULT 0, + -- level of sequence data to load sequence-level ENUMERATED { - none (0) , - seq-map (1) , - seq-data (2) + none (0), -- not required + seq-map (1), -- at least seq-map + seq-data (2) -- include seq-data } DEFAULT none } @@ -158,22 +194,38 @@ ID2-Reply ::= SEQUENCE { params ID2-Params OPTIONAL, + error SEQUENCE OF ID2-Error OPTIONAL, + + -- true if this reply is the last one for the request + -- false if more replies will follow + end-of-reply NULL OPTIONAL, + + -- reply data moved at the end to make it easier to construct + -- the reply data manually from precalculated data reply CHOICE { init NULL, + empty NULL, get-package ID2-Reply-Get-Package, - -- string-to-gi ID2-Reply-String-To-Gi, - seq-id-to-gi ID2-Reply-Seq-id-To-Gi, - gi-to-tse-id ID2-Reply-Gi-To-TSE-Id, - get-tse ID2-Reply-Get-TSE, - get-tse-info ID2S-Reply-Get-TSE-Info, + get-seq-id ID2-Reply-Get-Seq-id, + get-blob-id ID2-Reply-Get-Blob-Id, + get-blob-seq-ids ID2-Reply-Get-Blob-Seq-ids, + get-blob ID2-Reply-Get-Blob, + reget-blob ID2-Reply-ReGet-Blob, + get-split-info ID2S-Reply-Get-Split-Info, get-chunk ID2S-Reply-Get-Chunk }, - error SEQUENCE OF ID2-Error OPTIONAL, - - -- true if this reply is the last one for the request - -- false if more replies will follow - end-of-reply BOOLEAN + -- additional error flag if the reply is broken in the middle + -- of transfer. + -- 'last-octet-string', and 'nothing' mean that + -- client may use ReGet request to get the remaining data. + discard ENUMERATED { + reply (0), -- whole reply should be discarded + last-octet-string (1), -- all data in embedded ID2-Reply-Data + -- except last OCTET STRING is correct + nothing (2) -- all data in embedded ID2-Reply-Data + -- is correct, but is incomplete + } OPTIONAL } @@ -212,6 +264,7 @@ ID2-Error ::= SEQUENCE { } +-- Reply to ID2-Request-Get-Packages. ID2-Reply-Get-Package ::= SEQUENCE { name VisibleString, @@ -219,85 +272,146 @@ ID2-Reply-Get-Package ::= SEQUENCE { } -ID2-Reply-Seq-id-To-Gi ::= SEQUENCE { - -- request sequence ID, copy from request - seq-id Seq-id, +-- Reply to ID2-Request-Get-Seq-id. +ID2-Reply-Get-Seq-id ::= SEQUENCE { + -- copy of request + request ID2-Request-Get-Seq-id, - -- gi of requested Seq-id - -- not set if error occured - gi INTEGER OPTIONAL + -- resolved Seq-id + -- not set if error occurred + seq-id SEQUENCE OF Seq-id OPTIONAL } -ID2-Reply-Gi-To-TSE-Id ::= SEQUENCE { - gi INTEGER, +-- Reply to ID2-Request-Get-Blob-Id. +ID2-Reply-Get-Blob-Id ::= SEQUENCE { + -- requested Seq-id + seq-id Seq-id, + + -- result + blob-id ID2-Blob-Id, - -- source name of this tse set - -- "" for native tse - tse with sequence - source VisibleString DEFAULT "", + -- version of split data + -- (0 for non split) + split-version INTEGER DEFAULT 0, - -- tse set with requested gi - -- not set if error occured - tses SET OF ID2-TSE-Id-Info OPTIONAL + -- annotation types in this blob + -- annotation are unknown if this field is omitted + annot-info SEQUENCE OF ID2S-Seq-annot-Info OPTIONAL } -ID2-TSE-Id-Info ::= SEQUENCE { - tse-id ID2-TSE-Id, +-- Reply to ID2-Request-Get-Blob-Info. +ID2-Reply-Get-Blob-Seq-ids ::= SEQUENCE { + blob-id ID2-Blob-Id, + + -- list of Seq-id resolving to this Blob-Id + -- in compressed format + ids ID2-Reply-Data OPTIONAL +} + + +-- Reply to ID2-Request-Get-Blob-Info. +ID2-Reply-Get-Blob ::= SEQUENCE { + blob-id ID2-Blob-Id, -- version of split data -- (0 for non split) - split-version INTEGER DEFAULT 0 + split-version INTEGER DEFAULT 0, + + -- whole blob or blob skeleton + -- not set if error occurred + data ID2-Reply-Data OPTIONAL } -ID2-Reply-Get-TSE ::= SEQUENCE { - tse-id ID2-TSE-Id, +-- Reply to ID2-Request-Get-Blob-Info. +ID2S-Reply-Get-Split-Info ::= SEQUENCE { + blob-id ID2-Blob-Id, - -- whole tse or tse skeleton - -- not set if error occured + -- version of split data + split-version INTEGER, + + -- blob split info + -- not set if error occurred data ID2-Reply-Data OPTIONAL } -ID2S-Reply-Get-TSE-Info ::= SEQUENCE { - tse-id ID2-TSE-Id, +-- Reply to ID2-Request-ReGet-Blob. +ID2-Reply-ReGet-Blob ::= SEQUENCE { + blob-id ID2-Blob-Id, - -- version of split data + -- version of data split split-version INTEGER, - -- tse split info - -- not set if error occured - info ID2-Reply-Data OPTIONAL + -- offset of data + offset INTEGER, + + -- blob split info + -- not set if error occurred + data ID2-Reply-Data OPTIONAL } +-- Reply to ID2S-Request-Get-Chunks. ID2S-Reply-Get-Chunk ::= SEQUENCE { - tse-id ID2-TSE-Id, + blob-id ID2-Blob-Id, + -- id of chunk to send chunk-id ID2S-Chunk-Id, -- chunk data - -- not set if error occured + -- not set if error occurred data ID2-Reply-Data OPTIONAL } +-- Data packing. ID2-Reply-Data ::= SEQUENCE { - data-type INTEGER, -- index of negotiated types + -- index of negotiated types -- recommended types -- Seq-entry, -- ID2S-Split-Info, -- ID2S-Chunk + data-type INTEGER { + seq-entry (0), + seq-annot (1), + id2s-split-info (2), + id2s-chunk (3) + } DEFAULT seq-entry, -- serialization format (ASN.1 binary, ASN.1 text) - data-format INTEGER, -- index of negotiated formats + -- index of negotiated formats + data-format INTEGER { + asn-binary (0), + asn-text (1), + xml (2) + } DEFAULT asn-binary, -- post serialization compression (plain, gzip, etc.) - data-compression INTEGER, -- index of negotiated formats + -- index of negotiated compressions + data-compression INTEGER { + none (0), + gzip (1), + nlmzip (2), + bzip2 (3) + } DEFAULT none, -- data blob - data SEQUENCE OF OCTET STRING + data SEQUENCE OF OCTET STRING +} + + +-- Data packed within ID2-Reply-Get-Blob-Seq-ids reply. +ID2-Blob-Seq-ids ::= SEQUENCE OF ID2-Blob-Seq-id + + +ID2-Blob-Seq-id ::= SEQUENCE { + seq-id Seq-id, + + -- this Seq-id is replaced by sequence in another blob + replaced NULL OPTIONAL } @@ -306,9 +420,16 @@ ID2-Reply-Data ::= SEQUENCE { ---------------------------------------------------------------------------- -ID2-TSE-Id ::= SEQUENCE { +ID2-Blob-Id ::= SEQUENCE { sat INTEGER, - sat-key INTEGER + sub-sat INTEGER { + main (0), + snp (1), + mgc (16) + } DEFAULT main, + sat-key INTEGER, + -- version of blob, optional in some requests + version INTEGER OPTIONAL } @@ -320,17 +441,17 @@ ID2-Param ::= SEQUENCE { value SEQUENCE OF VisibleString OPTIONAL, type ENUMERATED { -- no response expected - set-value (1) , + set-value (1), -- this option is for client only -- server replies with its value of param if known -- server omits this param in reply if unknown to server - get-value (2) , + get-value (2), -- no direct response expected, -- but if the param or its value is not supported -- an error is reported and the request is not be completed - force-value (3) , + force-value (3), -- use named package -- value should be unset diff --git a/network/id2arch/id2.c b/network/id2arch/id2.c index 8a96fe8d..fe8c90a7 100644 --- a/network/id2arch/id2.c +++ b/network/id2arch/id2.c @@ -32,7 +32,7 @@ id2genAsnLoad(void) /************************************************** * Generated object loaders for Module NCBI-ID2Access -* Generated using ASNCODE Revision: 6.0 at Dec 15, 2003 5:08 PM +* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM * **************************************************/ @@ -209,20 +209,17 @@ Request_requestFree(ValNodePtr anp) case Request_request_get_packages: ID2RequestGetPackagesFree(anp -> data.ptrvalue); break; - case Request_request_string_to_gi: - ID2RequestStringToGiFree(anp -> data.ptrvalue); + case Request_request_get_seq_id: + ID2RequestGetSeqIdFree(anp -> data.ptrvalue); break; - case Request_request_seq_id_to_gi: - ID2RequestSeqIdToGiFree(anp -> data.ptrvalue); + case Request_request_get_blob_id: + ID2RequestGetBlobIdFree(anp -> data.ptrvalue); break; - case Request_request_gi_to_tse_id: - ID2RequestGiToTSEIdFree(anp -> data.ptrvalue); + case Request_request_get_blob_info: + ID2RequestGetBlobInfoFree(anp -> data.ptrvalue); break; - case Request_request_get_tse: - ID2RequestGetTSEFree(anp -> data.ptrvalue); - break; - case Request_request_reget_tse: - ID2RequestReGetTSEFree(anp -> data.ptrvalue); + case Request_request_reget_blob: + ID2RequestReGetBlobFree(anp -> data.ptrvalue); break; case Request_request_get_chunks: ID2SRequestGetChunksFree(anp -> data.ptrvalue); @@ -380,25 +377,21 @@ Request_requestAsnRead(AsnIoPtr aip, AsnTypePtr orig) choice = Request_request_get_packages; func = (AsnReadFunc) ID2RequestGetPackagesAsnRead; } - else if (atp == REQUEST_request_string_to_gi) { - choice = Request_request_string_to_gi; - func = (AsnReadFunc) ID2RequestStringToGiAsnRead; - } - else if (atp == REQUEST_request_seq_id_to_gi) { - choice = Request_request_seq_id_to_gi; - func = (AsnReadFunc) ID2RequestSeqIdToGiAsnRead; + else if (atp == ID2_REQUEST_request_get_seq_id) { + choice = Request_request_get_seq_id; + func = (AsnReadFunc) ID2RequestGetSeqIdAsnRead; } - else if (atp == REQUEST_request_gi_to_tse_id) { - choice = Request_request_gi_to_tse_id; - func = (AsnReadFunc) ID2RequestGiToTSEIdAsnRead; + else if (atp == ID2_REQUEST_request_get_blob_id) { + choice = Request_request_get_blob_id; + func = (AsnReadFunc) ID2RequestGetBlobIdAsnRead; } - else if (atp == ID2_REQUEST_request_get_tse) { - choice = Request_request_get_tse; - func = (AsnReadFunc) ID2RequestGetTSEAsnRead; + else if (atp == REQUEST_request_get_blob_info) { + choice = Request_request_get_blob_info; + func = (AsnReadFunc) ID2RequestGetBlobInfoAsnRead; } - else if (atp == ID2_REQUEST_request_reget_tse) { - choice = Request_request_reget_tse; - func = (AsnReadFunc) ID2RequestReGetTSEAsnRead; + else if (atp == ID2_REQUEST_request_reget_blob) { + choice = Request_request_reget_blob; + func = (AsnReadFunc) ID2RequestReGetBlobAsnRead; } else if (atp == ID2_REQUEST_request_get_chunks) { choice = Request_request_get_chunks; @@ -530,25 +523,21 @@ Request_requestAsnWrite(Request_requestPtr anp, AsnIoPtr aip, AsnTypePtr orig) writetype = REQUEST_request_get_packages; func = (AsnWriteFunc) ID2RequestGetPackagesAsnWrite; break; - case Request_request_string_to_gi: - writetype = REQUEST_request_string_to_gi; - func = (AsnWriteFunc) ID2RequestStringToGiAsnWrite; - break; - case Request_request_seq_id_to_gi: - writetype = REQUEST_request_seq_id_to_gi; - func = (AsnWriteFunc) ID2RequestSeqIdToGiAsnWrite; + case Request_request_get_seq_id: + writetype = ID2_REQUEST_request_get_seq_id; + func = (AsnWriteFunc) ID2RequestGetSeqIdAsnWrite; break; - case Request_request_gi_to_tse_id: - writetype = REQUEST_request_gi_to_tse_id; - func = (AsnWriteFunc) ID2RequestGiToTSEIdAsnWrite; + case Request_request_get_blob_id: + writetype = ID2_REQUEST_request_get_blob_id; + func = (AsnWriteFunc) ID2RequestGetBlobIdAsnWrite; break; - case Request_request_get_tse: - writetype = ID2_REQUEST_request_get_tse; - func = (AsnWriteFunc) ID2RequestGetTSEAsnWrite; + case Request_request_get_blob_info: + writetype = REQUEST_request_get_blob_info; + func = (AsnWriteFunc) ID2RequestGetBlobInfoAsnWrite; break; - case Request_request_reget_tse: - writetype = ID2_REQUEST_request_reget_tse; - func = (AsnWriteFunc) ID2RequestReGetTSEAsnWrite; + case Request_request_reget_blob: + writetype = ID2_REQUEST_request_reget_blob; + func = (AsnWriteFunc) ID2RequestReGetBlobAsnWrite; break; case Request_request_get_chunks: writetype = ID2_REQUEST_request_get_chunks; @@ -846,15 +835,16 @@ erret: /************************************************** * -* ID2RequestStringToGiNew() +* ID2RequestGetSeqIdNew() * **************************************************/ NLM_EXTERN -ID2RequestStringToGiPtr LIBCALL -ID2RequestStringToGiNew(void) +ID2RequestGetSeqIdPtr LIBCALL +ID2RequestGetSeqIdNew(void) { - ID2RequestStringToGiPtr ptr = MemNew((size_t) sizeof(ID2RequestStringToGi)); + ID2RequestGetSeqIdPtr ptr = MemNew((size_t) sizeof(ID2RequestGetSeqId)); + ptr -> seq_id_type = 0; return ptr; } @@ -862,36 +852,36 @@ ID2RequestStringToGiNew(void) /************************************************** * -* ID2RequestStringToGiFree() +* ID2RequestGetSeqIdFree() * **************************************************/ NLM_EXTERN -ID2RequestStringToGiPtr LIBCALL -ID2RequestStringToGiFree(ID2RequestStringToGiPtr ptr) +ID2RequestGetSeqIdPtr LIBCALL +ID2RequestGetSeqIdFree(ID2RequestGetSeqIdPtr ptr) { if(ptr == NULL) { return NULL; } - MemFree(ptr -> id); + ID2SeqIdFree(ptr -> seq_id); return MemFree(ptr); } /************************************************** * -* ID2RequestStringToGiAsnRead() +* ID2RequestGetSeqIdAsnRead() * **************************************************/ NLM_EXTERN -ID2RequestStringToGiPtr LIBCALL -ID2RequestStringToGiAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2RequestGetSeqIdPtr LIBCALL +ID2RequestGetSeqIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2RequestStringToGiPtr ptr; + ID2RequestGetSeqIdPtr ptr; if (! loaded) { @@ -904,17 +894,17 @@ ID2RequestStringToGiAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2RequestStringToGi ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_STRING_TO_GI); + if (orig == NULL) { /* ID2RequestGetSeqId ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REQUEST_GET_SEQ_ID); } else { - atp = AsnLinkType(orig, ID2_REQUEST_STRING_TO_GI); + atp = AsnLinkType(orig, ID2_REQUEST_GET_SEQ_ID); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2RequestStringToGiNew(); + ptr = ID2RequestGetSeqIdNew(); if (ptr == NULL) { goto erret; } @@ -925,166 +915,18 @@ ID2RequestStringToGiAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_REQUEST_STRING_TO_GI_id) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == ID2_REQUEST_GET_SEQ_ID_seq_id) { + ptr -> seq_id = ID2SeqIdAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } - ptr -> id = av.ptrvalue; atp = AsnReadId(aip,amp, atp); } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2RequestStringToGiFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2RequestStringToGiAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2RequestStringToGiAsnWrite(ID2RequestStringToGiPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2_REQUEST_STRING_TO_GI); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - if (ptr -> id != NULL) { - av.ptrvalue = ptr -> id; - retval = AsnWrite(aip, ID2_REQUEST_STRING_TO_GI_id, &av); - } - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2RequestSeqIdToGiNew() -* -**************************************************/ -NLM_EXTERN -ID2RequestSeqIdToGiPtr LIBCALL -ID2RequestSeqIdToGiNew(void) -{ - ID2RequestSeqIdToGiPtr ptr = MemNew((size_t) sizeof(ID2RequestSeqIdToGi)); - - return ptr; - -} - - -/************************************************** -* -* ID2RequestSeqIdToGiFree() -* -**************************************************/ -NLM_EXTERN -ID2RequestSeqIdToGiPtr LIBCALL -ID2RequestSeqIdToGiFree(ID2RequestSeqIdToGiPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - SeqIdFree(ptr -> seq_id); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2RequestSeqIdToGiAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2RequestSeqIdToGiPtr LIBCALL -ID2RequestSeqIdToGiAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2RequestSeqIdToGiPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2RequestSeqIdToGi ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_SEQ_ID_TO_GI); - } else { - atp = AsnLinkType(orig, ID2_REQUEST_SEQ_ID_TO_GI); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2RequestSeqIdToGiNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2_REQUEST_SEQ_ID_TO_GI_seq_id) { - ptr -> seq_id = SeqIdAsnRead(aip, atp); - if (aip -> io_failure) { + if (atp == REQUEST_GET_SEQ_ID_seq_id_type) { + if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } + ptr -> seq_id_type = av.intvalue; atp = AsnReadId(aip,amp, atp); } @@ -1099,7 +941,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2RequestSeqIdToGiFree(ptr); + ptr = ID2RequestGetSeqIdFree(ptr); goto ret; } @@ -1107,11 +949,11 @@ erret: /************************************************** * -* ID2RequestSeqIdToGiAsnWrite() +* ID2RequestGetSeqIdAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2RequestSeqIdToGiAsnWrite(ID2RequestSeqIdToGiPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2RequestGetSeqIdAsnWrite(ID2RequestGetSeqIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -1128,7 +970,7 @@ ID2RequestSeqIdToGiAsnWrite(ID2RequestSeqIdToGiPtr ptr, AsnIoPtr aip, AsnTypePtr return FALSE; } - atp = AsnLinkType(orig, ID2_REQUEST_SEQ_ID_TO_GI); /* link local tree */ + atp = AsnLinkType(orig, ID2_REQUEST_GET_SEQ_ID); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -1139,10 +981,12 @@ ID2RequestSeqIdToGiAsnWrite(ID2RequestSeqIdToGiPtr ptr, AsnIoPtr aip, AsnTypePtr } if (ptr -> seq_id != NULL) { - if ( ! SeqIdAsnWrite(ptr -> seq_id, aip, ID2_REQUEST_SEQ_ID_TO_GI_seq_id)) { + if ( ! ID2SeqIdAsnWrite(ptr -> seq_id, aip, ID2_REQUEST_GET_SEQ_ID_seq_id)) { goto erret; } } + av.intvalue = ptr -> seq_id_type; + retval = AsnWrite(aip, REQUEST_GET_SEQ_ID_seq_id_type, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -1157,14 +1001,14 @@ erret: /************************************************** * -* ID2RequestGiToTSEIdNew() +* ID2RequestGetBlobIdNew() * **************************************************/ NLM_EXTERN -ID2RequestGiToTSEIdPtr LIBCALL -ID2RequestGiToTSEIdNew(void) +ID2RequestGetBlobIdPtr LIBCALL +ID2RequestGetBlobIdNew(void) { - ID2RequestGiToTSEIdPtr ptr = MemNew((size_t) sizeof(ID2RequestGiToTSEId)); + ID2RequestGetBlobIdPtr ptr = MemNew((size_t) sizeof(ID2RequestGetBlobId)); return ptr; @@ -1173,18 +1017,18 @@ ID2RequestGiToTSEIdNew(void) /************************************************** * -* ID2RequestGiToTSEIdFree() +* ID2RequestGetBlobIdFree() * **************************************************/ NLM_EXTERN -ID2RequestGiToTSEIdPtr LIBCALL -ID2RequestGiToTSEIdFree(ID2RequestGiToTSEIdPtr ptr) +ID2RequestGetBlobIdPtr LIBCALL +ID2RequestGetBlobIdFree(ID2RequestGetBlobIdPtr ptr) { if(ptr == NULL) { return NULL; } - Gi_giFree(ptr -> Gi_gi); + ID2RequestGetSeqIdFree(ptr -> seq_id); AsnGenericBaseSeqOfFree(ptr -> sources ,ASNCODE_PTRVAL_SLOT); return MemFree(ptr); } @@ -1192,49 +1036,18 @@ ID2RequestGiToTSEIdFree(ID2RequestGiToTSEIdPtr ptr) /************************************************** * -* Gi_giFree() -* -**************************************************/ -static -Gi_giPtr LIBCALL -Gi_giFree(ValNodePtr anp) -{ - Pointer pnt; - - if (anp == NULL) { - return NULL; - } - - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - default: - break; - case Gi_gi_string: - ID2RequestStringToGiFree(anp -> data.ptrvalue); - break; - case Gi_gi_seq_id: - ID2RequestSeqIdToGiFree(anp -> data.ptrvalue); - break; - } - return MemFree(anp); -} - - -/************************************************** -* -* ID2RequestGiToTSEIdAsnRead() +* ID2RequestGetBlobIdAsnRead() * **************************************************/ NLM_EXTERN -ID2RequestGiToTSEIdPtr LIBCALL -ID2RequestGiToTSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2RequestGetBlobIdPtr LIBCALL +ID2RequestGetBlobIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2RequestGiToTSEIdPtr ptr; + ID2RequestGetBlobIdPtr ptr; if (! loaded) { @@ -1247,17 +1060,17 @@ ID2RequestGiToTSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2RequestGiToTSEId ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_GI_TO_TSE_ID); + if (orig == NULL) { /* ID2RequestGetBlobId ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REQUEST_GET_BLOB_ID); } else { - atp = AsnLinkType(orig, ID2_REQUEST_GI_TO_TSE_ID); + atp = AsnLinkType(orig, ID2_REQUEST_GET_BLOB_ID); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2RequestGiToTSEIdNew(); + ptr = ID2RequestGetBlobIdNew(); if (ptr == NULL) { goto erret; } @@ -1268,34 +1081,27 @@ ID2RequestGiToTSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_REQUEST_GI_TO_TSE_ID_gi) { - ptr -> Gi_gi = Gi_giAsnRead(aip, atp); + if (atp == ID2_REQUEST_GET_BLOB_ID_seq_id) { + ptr -> seq_id = ID2RequestGetSeqIdAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - if (atp == REQUEST_GI_TO_TSE_ID_sources) { + if (atp == ID2_REQUEST_GET_BLOB_ID_sources) { ptr -> sources = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError); if (isError && ptr -> sources == NULL) { goto erret; } atp = AsnReadId(aip,amp, atp); } - if (atp == REQUEST_GI_TO_TSE_ID_external) { + if (atp == REQUEST_GET_BLOB_ID_external) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } ptr -> external = av.boolvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == GI_TO_TSE_ID_current_gis) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> current_gis = av.boolvalue; - atp = AsnReadId(aip,amp, atp); - } if (AsnReadVal(aip, atp, &av) <= 0) { goto erret; @@ -1308,7 +1114,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2RequestGiToTSEIdFree(ptr); + ptr = ID2RequestGetBlobIdFree(ptr); goto ret; } @@ -1316,99 +1122,11 @@ erret: /************************************************** * -* Gi_giAsnRead() -* -**************************************************/ -static -Gi_giPtr LIBCALL -Gi_giAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - ValNodePtr anp; - Uint1 choice; - Boolean isError = FALSE; - Boolean nullIsError = FALSE; - AsnReadFunc func; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* Gi_gi ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_GI_TO_TSE_ID_gi); - } else { - atp = AsnLinkType(orig, ID2_REQUEST_GI_TO_TSE_ID_gi); /* link in local tree */ - } - if (atp == NULL) { - return NULL; - } - - anp = ValNodeNew(NULL); - if (anp == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ - goto erret; - } - - func = NULL; - - atp = AsnReadId(aip, amp, atp); /* find the choice */ - if (atp == NULL) { - goto erret; - } - if (atp == ID2_REQUEST_GI_TO_TSE_ID_gi_gi) { - choice = Gi_gi_gi; - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - anp->data.intvalue = av.intvalue; - } - else if (atp == REQUEST_GI_TO_TSE_ID_gi_string) { - choice = Gi_gi_string; - func = (AsnReadFunc) ID2RequestStringToGiAsnRead; - } - else if (atp == REQUEST_GI_TO_TSE_ID_gi_seq_id) { - choice = Gi_gi_seq_id; - func = (AsnReadFunc) ID2RequestSeqIdToGiAsnRead; - } - anp->choice = choice; - if (func != NULL) - { - anp->data.ptrvalue = (* func)(aip, atp); - if (aip -> io_failure) goto erret; - - if (nullIsError && anp->data.ptrvalue == NULL) { - goto erret; - } - } - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return anp; - -erret: - anp = MemFree(anp); - aip -> io_failure = TRUE; - goto ret; -} - - -/************************************************** -* -* ID2RequestGiToTSEIdAsnWrite() +* ID2RequestGetBlobIdAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2RequestGiToTSEIdAsnWrite(ID2RequestGiToTSEIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2RequestGetBlobIdAsnWrite(ID2RequestGetBlobIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -1425,7 +1143,7 @@ ID2RequestGiToTSEIdAsnWrite(ID2RequestGiToTSEIdPtr ptr, AsnIoPtr aip, AsnTypePtr return FALSE; } - atp = AsnLinkType(orig, ID2_REQUEST_GI_TO_TSE_ID); /* link local tree */ + atp = AsnLinkType(orig, ID2_REQUEST_GET_BLOB_ID); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -1435,16 +1153,14 @@ ID2RequestGiToTSEIdAsnWrite(ID2RequestGiToTSEIdPtr ptr, AsnIoPtr aip, AsnTypePtr goto erret; } - if (ptr -> Gi_gi != NULL) { - if ( ! Gi_giAsnWrite(ptr -> Gi_gi, aip, ID2_REQUEST_GI_TO_TSE_ID_gi)) { + if (ptr -> seq_id != NULL) { + if ( ! ID2RequestGetSeqIdAsnWrite(ptr -> seq_id, aip, ID2_REQUEST_GET_BLOB_ID_seq_id)) { goto erret; } } - retval = AsnGenericBaseSeqOfAsnWrite(ptr -> sources ,ASNCODE_PTRVAL_SLOT, aip, REQUEST_GI_TO_TSE_ID_sources, REQUEST_GI_TO_TSE_ID_sources_E); + retval = AsnGenericBaseSeqOfAsnWrite(ptr -> sources ,ASNCODE_PTRVAL_SLOT, aip, ID2_REQUEST_GET_BLOB_ID_sources, REQUEST_GET_BLOB_ID_sources_E); av.boolvalue = ptr -> external; - retval = AsnWrite(aip, REQUEST_GI_TO_TSE_ID_external, &av); - av.boolvalue = ptr -> current_gis; - retval = AsnWrite(aip, GI_TO_TSE_ID_current_gis, &av); + retval = AsnWrite(aip, REQUEST_GET_BLOB_ID_external, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -1459,80 +1175,14 @@ erret: /************************************************** * -* Gi_giAsnWrite() -* -**************************************************/ -static Boolean LIBCALL -Gi_giAsnWrite(Gi_giPtr anp, AsnIoPtr aip, AsnTypePtr orig) - -{ - DataVal av; - AsnTypePtr atp, writetype = NULL; - Pointer pnt; - AsnWriteFunc func = NULL; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) - return FALSE; - } - - if (aip == NULL) - return FALSE; - - atp = AsnLinkType(orig, ID2_REQUEST_GI_TO_TSE_ID_gi); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - - av.ptrvalue = (Pointer)anp; - if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { - goto erret; - } - - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - case Gi_gi_gi: - av.intvalue = anp->data.intvalue; - retval = AsnWrite(aip, ID2_REQUEST_GI_TO_TSE_ID_gi_gi, &av); - break; - case Gi_gi_string: - writetype = REQUEST_GI_TO_TSE_ID_gi_string; - func = (AsnWriteFunc) ID2RequestStringToGiAsnWrite; - break; - case Gi_gi_seq_id: - writetype = REQUEST_GI_TO_TSE_ID_gi_seq_id; - func = (AsnWriteFunc) ID2RequestSeqIdToGiAsnWrite; - break; - } - if (writetype != NULL) { - retval = (* func)(pnt, aip, writetype); /* write it out */ - } - if (!retval) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - -/************************************************** -* -* ID2RequestGetTSENew() +* ID2RequestGetBlobInfoNew() * **************************************************/ NLM_EXTERN -ID2RequestGetTSEPtr LIBCALL -ID2RequestGetTSENew(void) +ID2RequestGetBlobInfoPtr LIBCALL +ID2RequestGetBlobInfoNew(void) { - ID2RequestGetTSEPtr ptr = MemNew((size_t) sizeof(ID2RequestGetTSE)); + ID2RequestGetBlobInfoPtr ptr = MemNew((size_t) sizeof(ID2RequestGetBlobInfo)); return ptr; @@ -1541,14 +1191,14 @@ ID2RequestGetTSENew(void) /************************************************** * -* TseId_giNew() +* BlobId_resolveNew() * **************************************************/ static -TseId_giPtr LIBCALL -TseId_giNew(void) +BlobId_resolvePtr LIBCALL +BlobId_resolveNew(void) { - TseId_giPtr ptr = MemNew((size_t) sizeof(TseId_gi)); + BlobId_resolvePtr ptr = MemNew((size_t) sizeof(BlobId_resolve)); return ptr; @@ -1557,31 +1207,31 @@ TseId_giNew(void) /************************************************** * -* ID2RequestGetTSEFree() +* ID2RequestGetBlobInfoFree() * **************************************************/ NLM_EXTERN -ID2RequestGetTSEPtr LIBCALL -ID2RequestGetTSEFree(ID2RequestGetTSEPtr ptr) +ID2RequestGetBlobInfoPtr LIBCALL +ID2RequestGetBlobInfoFree(ID2RequestGetBlobInfoPtr ptr) { if(ptr == NULL) { return NULL; } - TseId_tse_idFree(ptr -> TseId_tse_id); - ID2GetTSEDetailsFree(ptr -> details); + BlobId_blob_idFree(ptr -> BlobId_blob_id); + ID2GetBlobDetailsFree(ptr -> get_data); return MemFree(ptr); } /************************************************** * -* TseId_tse_idFree() +* BlobId_blob_idFree() * **************************************************/ static -TseId_tse_idPtr LIBCALL -TseId_tse_idFree(ValNodePtr anp) +BlobId_blob_idPtr LIBCALL +BlobId_blob_idFree(ValNodePtr anp) { Pointer pnt; @@ -1594,11 +1244,11 @@ TseId_tse_idFree(ValNodePtr anp) { default: break; - case TseId_tse_id_tse_id: - ID2TSEIdFree(anp -> data.ptrvalue); + case BlobId_blob_id_blob_id: + ID2BlobIdFree(anp -> data.ptrvalue); break; - case TseId_tse_id_TseId_Gi: - TseId_giFree(anp -> data.ptrvalue); + case BlobId_blob_id_BlobId_Resolve: + BlobId_resolveFree(anp -> data.ptrvalue); break; } return MemFree(anp); @@ -1607,37 +1257,37 @@ TseId_tse_idFree(ValNodePtr anp) /************************************************** * -* TseId_giFree() +* BlobId_resolveFree() * **************************************************/ static -TseId_giPtr LIBCALL -TseId_giFree(TseId_giPtr ptr) +BlobId_resolvePtr LIBCALL +BlobId_resolveFree(BlobId_resolvePtr ptr) { if(ptr == NULL) { return NULL; } - ID2RequestGiToTSEIdFree(ptr -> request); - AsnGenericUserSeqOfFree(ptr -> exclude_tses, (AsnOptFreeFunc) ID2TSEIdFree); + ID2RequestGetBlobIdFree(ptr -> request); + AsnGenericUserSeqOfFree(ptr -> exclude_blobs, (AsnOptFreeFunc) ID2BlobIdFree); return MemFree(ptr); } /************************************************** * -* ID2RequestGetTSEAsnRead() +* ID2RequestGetBlobInfoAsnRead() * **************************************************/ NLM_EXTERN -ID2RequestGetTSEPtr LIBCALL -ID2RequestGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2RequestGetBlobInfoPtr LIBCALL +ID2RequestGetBlobInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2RequestGetTSEPtr ptr; + ID2RequestGetBlobInfoPtr ptr; if (! loaded) { @@ -1650,17 +1300,17 @@ ID2RequestGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2RequestGetTSE ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_GET_TSE); + if (orig == NULL) { /* ID2RequestGetBlobInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REQUEST_GET_BLOB_INFO); } else { - atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE); + atp = AsnLinkType(orig, ID2_REQUEST_GET_BLOB_INFO); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2RequestGetTSENew(); + ptr = ID2RequestGetBlobInfoNew(); if (ptr == NULL) { goto erret; } @@ -1671,15 +1321,22 @@ ID2RequestGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_REQUEST_GET_TSE_tse_id) { - ptr -> TseId_tse_id = TseId_tse_idAsnRead(aip, atp); + if (atp == REQUEST_GET_BLOB_INFO_blob_id) { + ptr -> BlobId_blob_id = BlobId_blob_idAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_REQUEST_GET_TSE_details) { - ptr -> details = ID2GetTSEDetailsAsnRead(aip, atp); + if (atp == GET_BLOB_INFO_get_seq_ids) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> get_seq_ids = av.boolvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == REQUEST_GET_BLOB_INFO_get_data) { + ptr -> get_data = ID2GetBlobDetailsAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } @@ -1697,7 +1354,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2RequestGetTSEFree(ptr); + ptr = ID2RequestGetBlobInfoFree(ptr); goto ret; } @@ -1705,12 +1362,12 @@ erret: /************************************************** * -* TseId_tse_idAsnRead() +* BlobId_blob_idAsnRead() * **************************************************/ static -TseId_tse_idPtr LIBCALL -TseId_tse_idAsnRead(AsnIoPtr aip, AsnTypePtr orig) +BlobId_blob_idPtr LIBCALL +BlobId_blob_idAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -1731,10 +1388,10 @@ TseId_tse_idAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* TseId_tse_id ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_GET_TSE_tse_id); + if (orig == NULL) { /* BlobId_blob_id ::= (self contained) */ + atp = AsnReadId(aip, amp, REQUEST_GET_BLOB_INFO_blob_id); } else { - atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE_tse_id); /* link in local tree */ + atp = AsnLinkType(orig, REQUEST_GET_BLOB_INFO_blob_id); /* link in local tree */ } if (atp == NULL) { return NULL; @@ -1754,13 +1411,13 @@ TseId_tse_idAsnRead(AsnIoPtr aip, AsnTypePtr orig) if (atp == NULL) { goto erret; } - if (atp == REQUEST_GET_TSE_tse_id_tse_id) { - choice = TseId_tse_id_tse_id; - func = (AsnReadFunc) ID2TSEIdAsnRead; + if (atp == GET_BLOB_INFO_blob_id_blob_id) { + choice = BlobId_blob_id_blob_id; + func = (AsnReadFunc) ID2BlobIdAsnRead; } - else if (atp == ID2_REQUEST_GET_TSE_tse_id_gi) { - choice = TseId_tse_id_TseId_Gi; - func = (AsnReadFunc) TseId_giAsnRead; + else if (atp == GET_BLOB_INFO_blob_id_resolve) { + choice = BlobId_blob_id_BlobId_Resolve; + func = (AsnReadFunc) BlobId_resolveAsnRead; } anp->choice = choice; if (func != NULL) @@ -1786,18 +1443,18 @@ erret: /************************************************** * -* TseId_giAsnRead() +* BlobId_resolveAsnRead() * **************************************************/ static -TseId_giPtr LIBCALL -TseId_giAsnRead(AsnIoPtr aip, AsnTypePtr orig) +BlobId_resolvePtr LIBCALL +BlobId_resolveAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - TseId_giPtr ptr; + BlobId_resolvePtr ptr; if (! loaded) { @@ -1810,17 +1467,17 @@ TseId_giAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* TseId_gi ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_GET_TSE_tse_id_gi); + if (orig == NULL) { /* BlobId_resolve ::= (self contained) */ + atp = AsnReadId(aip, amp, GET_BLOB_INFO_blob_id_resolve); } else { - atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE_tse_id_gi); + atp = AsnLinkType(orig, GET_BLOB_INFO_blob_id_resolve); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = TseId_giNew(); + ptr = BlobId_resolveNew(); if (ptr == NULL) { goto erret; } @@ -1831,16 +1488,16 @@ TseId_giAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == GET_TSE_tse_id_gi_request) { - ptr -> request = ID2RequestGiToTSEIdAsnRead(aip, atp); + if (atp == INFO_blob_id_resolve_request) { + ptr -> request = ID2RequestGetBlobIdAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - if (atp == GET_TSE_tse_id_gi_exclude_tses) { - ptr -> exclude_tses = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2TSEIdAsnRead, (AsnOptFreeFunc) ID2TSEIdFree); - if (isError && ptr -> exclude_tses == NULL) { + if (atp == blob_id_resolve_exclude_blobs) { + ptr -> exclude_blobs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2BlobIdAsnRead, (AsnOptFreeFunc) ID2BlobIdFree); + if (isError && ptr -> exclude_blobs == NULL) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -1857,7 +1514,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = TseId_giFree(ptr); + ptr = BlobId_resolveFree(ptr); goto ret; } @@ -1865,11 +1522,11 @@ erret: /************************************************** * -* ID2RequestGetTSEAsnWrite() +* ID2RequestGetBlobInfoAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2RequestGetTSEAsnWrite(ID2RequestGetTSEPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2RequestGetBlobInfoAsnWrite(ID2RequestGetBlobInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -1886,7 +1543,7 @@ ID2RequestGetTSEAsnWrite(ID2RequestGetTSEPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE); /* link local tree */ + atp = AsnLinkType(orig, ID2_REQUEST_GET_BLOB_INFO); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -1896,13 +1553,15 @@ ID2RequestGetTSEAsnWrite(ID2RequestGetTSEPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - if (ptr -> TseId_tse_id != NULL) { - if ( ! TseId_tse_idAsnWrite(ptr -> TseId_tse_id, aip, ID2_REQUEST_GET_TSE_tse_id)) { + if (ptr -> BlobId_blob_id != NULL) { + if ( ! BlobId_blob_idAsnWrite(ptr -> BlobId_blob_id, aip, REQUEST_GET_BLOB_INFO_blob_id)) { goto erret; } } - if (ptr -> details != NULL) { - if ( ! ID2GetTSEDetailsAsnWrite(ptr -> details, aip, ID2_REQUEST_GET_TSE_details)) { + av.boolvalue = ptr -> get_seq_ids; + retval = AsnWrite(aip, GET_BLOB_INFO_get_seq_ids, &av); + if (ptr -> get_data != NULL) { + if ( ! ID2GetBlobDetailsAsnWrite(ptr -> get_data, aip, REQUEST_GET_BLOB_INFO_get_data)) { goto erret; } } @@ -1920,11 +1579,11 @@ erret: /************************************************** * -* TseId_tse_idAsnWrite() +* BlobId_blob_idAsnWrite() * **************************************************/ static Boolean LIBCALL -TseId_tse_idAsnWrite(TseId_tse_idPtr anp, AsnIoPtr aip, AsnTypePtr orig) +BlobId_blob_idAsnWrite(BlobId_blob_idPtr anp, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; @@ -1942,7 +1601,7 @@ TseId_tse_idAsnWrite(TseId_tse_idPtr anp, AsnIoPtr aip, AsnTypePtr orig) if (aip == NULL) return FALSE; - atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE_tse_id); /* link local tree */ + atp = AsnLinkType(orig, REQUEST_GET_BLOB_INFO_blob_id); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -1957,13 +1616,13 @@ TseId_tse_idAsnWrite(TseId_tse_idPtr anp, AsnIoPtr aip, AsnTypePtr orig) pnt = anp->data.ptrvalue; switch (anp->choice) { - case TseId_tse_id_tse_id: - writetype = REQUEST_GET_TSE_tse_id_tse_id; - func = (AsnWriteFunc) ID2TSEIdAsnWrite; + case BlobId_blob_id_blob_id: + writetype = GET_BLOB_INFO_blob_id_blob_id; + func = (AsnWriteFunc) ID2BlobIdAsnWrite; break; - case TseId_tse_id_TseId_Gi: - writetype = ID2_REQUEST_GET_TSE_tse_id_gi; - func = (AsnWriteFunc) TseId_giAsnWrite; + case BlobId_blob_id_BlobId_Resolve: + writetype = GET_BLOB_INFO_blob_id_resolve; + func = (AsnWriteFunc) BlobId_resolveAsnWrite; break; } if (writetype != NULL) { @@ -1982,11 +1641,11 @@ erret: /************************************************** * -* TseId_giAsnWrite() +* BlobId_resolveAsnWrite() * **************************************************/ static Boolean LIBCALL -TseId_giAsnWrite(TseId_giPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +BlobId_resolveAsnWrite(BlobId_resolvePtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -2003,7 +1662,7 @@ TseId_giAsnWrite(TseId_giPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE_tse_id_gi); /* link local tree */ + atp = AsnLinkType(orig, GET_BLOB_INFO_blob_id_resolve); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -2014,11 +1673,11 @@ TseId_giAsnWrite(TseId_giPtr ptr, AsnIoPtr aip, AsnTypePtr orig) } if (ptr -> request != NULL) { - if ( ! ID2RequestGiToTSEIdAsnWrite(ptr -> request, aip, GET_TSE_tse_id_gi_request)) { + if ( ! ID2RequestGetBlobIdAsnWrite(ptr -> request, aip, INFO_blob_id_resolve_request)) { goto erret; } } - AsnGenericUserSeqOfAsnWrite(ptr -> exclude_tses, (AsnWriteFunc) ID2TSEIdAsnWrite, aip, GET_TSE_tse_id_gi_exclude_tses, TSE_tse_id_gi_exclude_tses_E); + AsnGenericUserSeqOfAsnWrite(ptr -> exclude_blobs, (AsnWriteFunc) ID2BlobIdAsnWrite, aip, blob_id_resolve_exclude_blobs, blob_id_resolve_exclude_blobs_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -2033,14 +1692,14 @@ erret: /************************************************** * -* ID2RequestReGetTSENew() +* ID2RequestReGetBlobNew() * **************************************************/ NLM_EXTERN -ID2RequestReGetTSEPtr LIBCALL -ID2RequestReGetTSENew(void) +ID2RequestReGetBlobPtr LIBCALL +ID2RequestReGetBlobNew(void) { - ID2RequestReGetTSEPtr ptr = MemNew((size_t) sizeof(ID2RequestReGetTSE)); + ID2RequestReGetBlobPtr ptr = MemNew((size_t) sizeof(ID2RequestReGetBlob)); return ptr; @@ -2049,37 +1708,36 @@ ID2RequestReGetTSENew(void) /************************************************** * -* ID2RequestReGetTSEFree() +* ID2RequestReGetBlobFree() * **************************************************/ NLM_EXTERN -ID2RequestReGetTSEPtr LIBCALL -ID2RequestReGetTSEFree(ID2RequestReGetTSEPtr ptr) +ID2RequestReGetBlobPtr LIBCALL +ID2RequestReGetBlobFree(ID2RequestReGetBlobPtr ptr) { if(ptr == NULL) { return NULL; } - ID2TSEIdFree(ptr -> tse_id); - ID2GetTSEDetailsFree(ptr -> details); + ID2BlobIdFree(ptr -> blob_id); return MemFree(ptr); } /************************************************** * -* ID2RequestReGetTSEAsnRead() +* ID2RequestReGetBlobAsnRead() * **************************************************/ NLM_EXTERN -ID2RequestReGetTSEPtr LIBCALL -ID2RequestReGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2RequestReGetBlobPtr LIBCALL +ID2RequestReGetBlobAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2RequestReGetTSEPtr ptr; + ID2RequestReGetBlobPtr ptr; if (! loaded) { @@ -2092,17 +1750,17 @@ ID2RequestReGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2RequestReGetTSE ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REQUEST_REGET_TSE); + if (orig == NULL) { /* ID2RequestReGetBlob ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REQUEST_REGET_BLOB); } else { - atp = AsnLinkType(orig, ID2_REQUEST_REGET_TSE); + atp = AsnLinkType(orig, ID2_REQUEST_REGET_BLOB); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2RequestReGetTSENew(); + ptr = ID2RequestReGetBlobNew(); if (ptr == NULL) { goto erret; } @@ -2113,21 +1771,21 @@ ID2RequestReGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_REQUEST_REGET_TSE_tse_id) { - ptr -> tse_id = ID2TSEIdAsnRead(aip, atp); + if (atp == ID2_REQUEST_REGET_BLOB_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_REQUEST_REGET_TSE_details) { - ptr -> details = ID2GetTSEDetailsAsnRead(aip, atp); - if (aip -> io_failure) { + if (atp == REGET_BLOB_split_version) { + if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } + ptr -> split_version = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_REQUEST_REGET_TSE_offset) { + if (atp == ID2_REQUEST_REGET_BLOB_offset) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } @@ -2146,7 +1804,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2RequestReGetTSEFree(ptr); + ptr = ID2RequestReGetBlobFree(ptr); goto ret; } @@ -2154,11 +1812,11 @@ erret: /************************************************** * -* ID2RequestReGetTSEAsnWrite() +* ID2RequestReGetBlobAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2RequestReGetTSEAsnWrite(ID2RequestReGetTSEPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2RequestReGetBlobAsnWrite(ID2RequestReGetBlobPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -2175,7 +1833,7 @@ ID2RequestReGetTSEAsnWrite(ID2RequestReGetTSEPtr ptr, AsnIoPtr aip, AsnTypePtr o return FALSE; } - atp = AsnLinkType(orig, ID2_REQUEST_REGET_TSE); /* link local tree */ + atp = AsnLinkType(orig, ID2_REQUEST_REGET_BLOB); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -2185,18 +1843,15 @@ ID2RequestReGetTSEAsnWrite(ID2RequestReGetTSEPtr ptr, AsnIoPtr aip, AsnTypePtr o goto erret; } - if (ptr -> tse_id != NULL) { - if ( ! ID2TSEIdAsnWrite(ptr -> tse_id, aip, ID2_REQUEST_REGET_TSE_tse_id)) { - goto erret; - } - } - if (ptr -> details != NULL) { - if ( ! ID2GetTSEDetailsAsnWrite(ptr -> details, aip, ID2_REQUEST_REGET_TSE_details)) { + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, ID2_REQUEST_REGET_BLOB_blob_id)) { goto erret; } } + av.intvalue = ptr -> split_version; + retval = AsnWrite(aip, REGET_BLOB_split_version, &av); av.intvalue = ptr -> offset; - retval = AsnWrite(aip, ID2_REQUEST_REGET_TSE_offset, &av); + retval = AsnWrite(aip, ID2_REQUEST_REGET_BLOB_offset, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -2238,7 +1893,7 @@ ID2SRequestGetChunksFree(ID2SRequestGetChunksPtr ptr) if(ptr == NULL) { return NULL; } - ID2TSEIdFree(ptr -> tse_id); + ID2BlobIdFree(ptr -> blob_id); AsnGenericBaseSeqOfFree(ptr -> chunks ,ASNCODE_INTVAL_SLOT); return MemFree(ptr); } @@ -2291,8 +1946,8 @@ ID2SRequestGetChunksAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2S_REQUEST_GET_CHUNKS_tse_id) { - ptr -> tse_id = ID2TSEIdAsnRead(aip, atp); + if (atp == ID2S_REQUEST_GET_CHUNKS_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } @@ -2356,8 +2011,8 @@ ID2SRequestGetChunksAsnWrite(ID2SRequestGetChunksPtr ptr, AsnIoPtr aip, AsnTypeP goto erret; } - if (ptr -> tse_id != NULL) { - if ( ! ID2TSEIdAsnWrite(ptr -> tse_id, aip, ID2S_REQUEST_GET_CHUNKS_tse_id)) { + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, ID2S_REQUEST_GET_CHUNKS_blob_id)) { goto erret; } } @@ -2376,51 +2031,51 @@ erret: /************************************************** * -* ID2TSEIdNew() -* -**************************************************/ -NLM_EXTERN -ID2TSEIdPtr LIBCALL -ID2TSEIdNew(void) -{ - ID2TSEIdPtr ptr = MemNew((size_t) sizeof(ID2TSEId)); - - return ptr; - -} - - -/************************************************** -* -* ID2TSEIdFree() +* ID2SeqIdFree() * **************************************************/ NLM_EXTERN -ID2TSEIdPtr LIBCALL -ID2TSEIdFree(ID2TSEIdPtr ptr) +ID2SeqIdPtr LIBCALL +ID2SeqIdFree(ValNodePtr anp) { + Pointer pnt; - if(ptr == NULL) { + if (anp == NULL) { return NULL; } - return MemFree(ptr); + + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + default: + break; + case ID2SeqId_string: + MemFree(anp -> data.ptrvalue); + break; + case ID2SeqId_seq_id: + SeqIdFree(anp -> data.ptrvalue); + break; + } + return MemFree(anp); } /************************************************** * -* ID2TSEIdAsnRead() +* ID2SeqIdAsnRead() * **************************************************/ NLM_EXTERN -ID2TSEIdPtr LIBCALL -ID2TSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2SeqIdPtr LIBCALL +ID2SeqIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; + ValNodePtr anp; + Uint1 choice; Boolean isError = FALSE; + Boolean nullIsError = FALSE; AsnReadFunc func; - ID2TSEIdPtr ptr; if (! loaded) { @@ -2433,97 +2088,114 @@ ID2TSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2TSEId ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_TSE_ID); + if (orig == NULL) { /* ID2SeqId ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_SEQ_ID); } else { - atp = AsnLinkType(orig, ID2_TSE_ID); + atp = AsnLinkType(orig, ID2_SEQ_ID); /* link in local tree */ } - /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2TSEIdNew(); - if (ptr == NULL) { + anp = ValNodeNew(NULL); + if (anp == NULL) { goto erret; } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ goto erret; } - atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_TSE_ID_sat) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> sat = av.intvalue; - atp = AsnReadId(aip,amp, atp); + atp = AsnReadId(aip, amp, atp); /* find the choice */ + if (atp == NULL) { + goto erret; } - if (atp == ID2_TSE_ID_sat_key) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == ID2_SEQ_ID_string) { + choice = ID2SeqId_string; + if (AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> sat_key = av.intvalue; - atp = AsnReadId(aip,amp, atp); + anp->data.ptrvalue = av.ptrvalue; + } + else if (atp == ID2_SEQ_ID_seq_id) { + choice = ID2SeqId_seq_id; + func = (AsnReadFunc) SeqIdAsnRead; } + anp->choice = choice; + if (func != NULL) + { + anp->data.ptrvalue = (* func)(aip, atp); + if (aip -> io_failure) goto erret; - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; + if (nullIsError && anp->data.ptrvalue == NULL) { + goto erret; + } } - /* end struct */ ret: AsnUnlinkType(orig); /* unlink local tree */ - return ptr; + return anp; erret: + anp = MemFree(anp); aip -> io_failure = TRUE; - ptr = ID2TSEIdFree(ptr); goto ret; } - /************************************************** * -* ID2TSEIdAsnWrite() +* ID2SeqIdAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2TSEIdAsnWrite(ID2TSEIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2SeqIdAsnWrite(ID2SeqIdPtr anp, AsnIoPtr aip, AsnTypePtr orig) + { DataVal av; - AsnTypePtr atp; + AsnTypePtr atp, writetype = NULL; + Pointer pnt; + AsnWriteFunc func = NULL; Boolean retval = FALSE; if (! loaded) { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { + if (! id2genAsnLoad()) return FALSE; } - atp = AsnLinkType(orig, ID2_TSE_ID); /* link local tree */ + if (aip == NULL) + return FALSE; + + atp = AsnLinkType(orig, ID2_SEQ_ID); /* link local tree */ if (atp == NULL) { return FALSE; } - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + + av.ptrvalue = (Pointer)anp; + if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { goto erret; } - av.intvalue = ptr -> sat; - retval = AsnWrite(aip, ID2_TSE_ID_sat, &av); - av.intvalue = ptr -> sat_key; - retval = AsnWrite(aip, ID2_TSE_ID_sat_key, &av); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + case ID2SeqId_string: + av.ptrvalue = anp->data.ptrvalue; + retval = AsnWrite(aip, ID2_SEQ_ID_string, &av); + break; + case ID2SeqId_seq_id: + writetype = ID2_SEQ_ID_seq_id; + func = (AsnWriteFunc) SeqIdAsnWrite; + break; + } + if (writetype != NULL) { + retval = (* func)(pnt, aip, writetype); /* write it out */ + } + if (!retval) { goto erret; } retval = TRUE; @@ -2534,24 +2206,18 @@ erret: } - /************************************************** * -* ID2GetTSEDetailsNew() +* ID2BlobIdNew() * **************************************************/ NLM_EXTERN -ID2GetTSEDetailsPtr LIBCALL -ID2GetTSEDetailsNew(void) +ID2BlobIdPtr LIBCALL +ID2BlobIdNew(void) { - ID2GetTSEDetailsPtr ptr = MemNew((size_t) sizeof(ID2GetTSEDetails)); + ID2BlobIdPtr ptr = MemNew((size_t) sizeof(ID2BlobId)); - ptr -> seq_class_level = 1; - ptr -> descr_level = 1; - ptr -> descr_type_mask = 0; - ptr -> annot_type_mask = 0; - ptr -> feat_type_mask = 0; - ptr -> sequence_level = 0; + ptr -> sub_sat = 0; return ptr; } @@ -2559,36 +2225,35 @@ ID2GetTSEDetailsNew(void) /************************************************** * -* ID2GetTSEDetailsFree() +* ID2BlobIdFree() * **************************************************/ NLM_EXTERN -ID2GetTSEDetailsPtr LIBCALL -ID2GetTSEDetailsFree(ID2GetTSEDetailsPtr ptr) +ID2BlobIdPtr LIBCALL +ID2BlobIdFree(ID2BlobIdPtr ptr) { if(ptr == NULL) { return NULL; } - ID2SeqLocFree(ptr -> location); return MemFree(ptr); } /************************************************** * -* ID2GetTSEDetailsAsnRead() +* ID2BlobIdAsnRead() * **************************************************/ NLM_EXTERN -ID2GetTSEDetailsPtr LIBCALL -ID2GetTSEDetailsAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2BlobIdPtr LIBCALL +ID2BlobIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2GetTSEDetailsPtr ptr; + ID2BlobIdPtr ptr; if (! loaded) { @@ -2601,17 +2266,17 @@ ID2GetTSEDetailsAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2GetTSEDetails ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_GET_TSE_DETAILS); + if (orig == NULL) { /* ID2BlobId ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_BLOB_ID); } else { - atp = AsnLinkType(orig, ID2_GET_TSE_DETAILS); + atp = AsnLinkType(orig, ID2_BLOB_ID); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2GetTSEDetailsNew(); + ptr = ID2BlobIdNew(); if (ptr == NULL) { goto erret; } @@ -2622,53 +2287,32 @@ ID2GetTSEDetailsAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_GET_TSE_DETAILS_location) { - ptr -> location = ID2SeqLocAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == TSE_DETAILS_seq_class_level) { + if (atp == ID2_BLOB_ID_sat) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> seq_class_level = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_GET_TSE_DETAILS_descr_level) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> descr_level = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == TSE_DETAILS_descr_type_mask) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> descr_type_mask = av.intvalue; + ptr -> sat = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == TSE_DETAILS_annot_type_mask) { + if (atp == ID2_BLOB_ID_sub_sat) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> annot_type_mask = av.intvalue; + ptr -> sub_sat = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == GET_TSE_DETAILS_feat_type_mask) { + if (atp == ID2_BLOB_ID_sat_key) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> feat_type_mask = av.intvalue; + ptr -> sat_key = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == GET_TSE_DETAILS_sequence_level) { + if (atp == ID2_BLOB_ID_version) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> sequence_level = av.intvalue; + ptr -> version = av.intvalue; atp = AsnReadId(aip,amp, atp); } @@ -2683,7 +2327,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2GetTSEDetailsFree(ptr); + ptr = ID2BlobIdFree(ptr); goto ret; } @@ -2691,11 +2335,11 @@ erret: /************************************************** * -* ID2GetTSEDetailsAsnWrite() +* ID2BlobIdAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2GetTSEDetailsAsnWrite(ID2GetTSEDetailsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2BlobIdAsnWrite(ID2BlobIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -2712,7 +2356,7 @@ ID2GetTSEDetailsAsnWrite(ID2GetTSEDetailsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_GET_TSE_DETAILS); /* link local tree */ + atp = AsnLinkType(orig, ID2_BLOB_ID); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -2722,23 +2366,14 @@ ID2GetTSEDetailsAsnWrite(ID2GetTSEDetailsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - if (ptr -> location != NULL) { - if ( ! ID2SeqLocAsnWrite(ptr -> location, aip, ID2_GET_TSE_DETAILS_location)) { - goto erret; - } - } - av.intvalue = ptr -> seq_class_level; - retval = AsnWrite(aip, TSE_DETAILS_seq_class_level, &av); - av.intvalue = ptr -> descr_level; - retval = AsnWrite(aip, ID2_GET_TSE_DETAILS_descr_level, &av); - av.intvalue = ptr -> descr_type_mask; - retval = AsnWrite(aip, TSE_DETAILS_descr_type_mask, &av); - av.intvalue = ptr -> annot_type_mask; - retval = AsnWrite(aip, TSE_DETAILS_annot_type_mask, &av); - av.intvalue = ptr -> feat_type_mask; - retval = AsnWrite(aip, GET_TSE_DETAILS_feat_type_mask, &av); - av.intvalue = ptr -> sequence_level; - retval = AsnWrite(aip, GET_TSE_DETAILS_sequence_level, &av); + av.intvalue = ptr -> sat; + retval = AsnWrite(aip, ID2_BLOB_ID_sat, &av); + av.intvalue = ptr -> sub_sat; + retval = AsnWrite(aip, ID2_BLOB_ID_sub_sat, &av); + av.intvalue = ptr -> sat_key; + retval = AsnWrite(aip, ID2_BLOB_ID_sat_key, &av); + av.intvalue = ptr -> version; + retval = AsnWrite(aip, ID2_BLOB_ID_version, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -2753,57 +2388,58 @@ erret: /************************************************** * -* ID2SeqLocFree() +* ID2GetBlobDetailsNew() * **************************************************/ NLM_EXTERN -ID2SeqLocPtr LIBCALL -ID2SeqLocFree(ValNodePtr anp) +ID2GetBlobDetailsPtr LIBCALL +ID2GetBlobDetailsNew(void) { - Pointer pnt; + ID2GetBlobDetailsPtr ptr = MemNew((size_t) sizeof(ID2GetBlobDetails)); - if (anp == NULL) { - return NULL; - } + ptr -> seq_class_level = 1; + ptr -> descr_level = 1; + ptr -> descr_type_mask = 0; + ptr -> annot_type_mask = 0; + ptr -> feat_type_mask = 0; + ptr -> sequence_level = 0; + return ptr; - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - default: - break; - case ID2SeqLoc_int__: - ID2IntervalFree(anp -> data.ptrvalue); - break; - case ID2SeqLoc_int_set: - ID2PackedSeqIntsFree(anp -> data.ptrvalue); - break; - case ID2SeqLoc_whole_range: - ID2IdRangeFree(anp -> data.ptrvalue); - break; - case ID2SeqLoc_loc_set: - AsnGenericChoiceSeqOfFree((Pointer) pnt, (AsnOptFreeFunc) ID2SeqLocFree); - break; +} + + +/************************************************** +* +* ID2GetBlobDetailsFree() +* +**************************************************/ +NLM_EXTERN +ID2GetBlobDetailsPtr LIBCALL +ID2GetBlobDetailsFree(ID2GetBlobDetailsPtr ptr) +{ + + if(ptr == NULL) { + return NULL; } - return MemFree(anp); + SeqLocFree(ptr -> location); + return MemFree(ptr); } /************************************************** * -* ID2SeqLocAsnRead() +* ID2GetBlobDetailsAsnRead() * **************************************************/ NLM_EXTERN -ID2SeqLocPtr LIBCALL -ID2SeqLocAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2GetBlobDetailsPtr LIBCALL +ID2GetBlobDetailsAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; - ValNodePtr anp; - Uint1 choice; Boolean isError = FALSE; - Boolean nullIsError = FALSE; AsnReadFunc func; + ID2GetBlobDetailsPtr ptr; if (! loaded) { @@ -2816,141 +2452,145 @@ ID2SeqLocAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SeqLoc ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_SEQ_LOC); + if (orig == NULL) { /* ID2GetBlobDetails ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_GET_BLOB_DETAILS); } else { - atp = AsnLinkType(orig, ID2_SEQ_LOC); /* link in local tree */ + atp = AsnLinkType(orig, ID2_GET_BLOB_DETAILS); } + /* link in local tree */ if (atp == NULL) { return NULL; } - anp = ValNodeNew(NULL); - if (anp == NULL) { + ptr = ID2GetBlobDetailsNew(); + if (ptr == NULL) { goto erret; } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ goto erret; } + atp = AsnReadId(aip,amp, atp); func = NULL; - atp = AsnReadId(aip, amp, atp); /* find the choice */ - if (atp == NULL) { - goto erret; + if (atp == ID2_GET_BLOB_DETAILS_location) { + ptr -> location = SeqLocAsnRead(aip, atp); + if (aip -> io_failure) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_SEQ_LOC_whole) { - choice = ID2SeqLoc_whole; - if (AsnReadVal(aip, atp, &av) <= 0) { + if (atp == BLOB_DETAILS_seq_class_level) { + if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - anp->data.intvalue = av.intvalue; + ptr -> seq_class_level = av.intvalue; + atp = AsnReadId(aip,amp, atp); } - else if (atp == ID2_SEQ_LOC_int__) { - choice = ID2SeqLoc_int__; - func = (AsnReadFunc) ID2IntervalAsnRead; + if (atp == GET_BLOB_DETAILS_descr_level) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> descr_level = av.intvalue; + atp = AsnReadId(aip,amp, atp); } - else if (atp == ID2_SEQ_LOC_int_set) { - choice = ID2SeqLoc_int_set; - func = (AsnReadFunc) ID2PackedSeqIntsAsnRead; + if (atp == BLOB_DETAILS_descr_type_mask) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> descr_type_mask = av.intvalue; + atp = AsnReadId(aip,amp, atp); } - else if (atp == ID2_SEQ_LOC_whole_range) { - choice = ID2SeqLoc_whole_range; - func = (AsnReadFunc) ID2IdRangeAsnRead; + if (atp == BLOB_DETAILS_annot_type_mask) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> annot_type_mask = av.intvalue; + atp = AsnReadId(aip,amp, atp); } - else if (atp == ID2_SEQ_LOC_loc_set) { - choice = ID2SeqLoc_loc_set; - anp -> data.ptrvalue = - AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SeqLocAsnRead, (AsnOptFreeFunc) ID2SeqLocFree); - if (isError && anp -> data.ptrvalue == NULL) { + if (atp == BLOB_DETAILS_feat_type_mask) { + if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } + ptr -> feat_type_mask = av.intvalue; + atp = AsnReadId(aip,amp, atp); } - anp->choice = choice; - if (func != NULL) - { - anp->data.ptrvalue = (* func)(aip, atp); - if (aip -> io_failure) goto erret; - - if (nullIsError && anp->data.ptrvalue == NULL) { + if (atp == BLOB_DETAILS_sequence_level) { + if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } + ptr -> sequence_level = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; } + /* end struct */ ret: AsnUnlinkType(orig); /* unlink local tree */ - return anp; + return ptr; erret: - anp = MemFree(anp); aip -> io_failure = TRUE; + ptr = ID2GetBlobDetailsFree(ptr); goto ret; } + /************************************************** * -* ID2SeqLocAsnWrite() +* ID2GetBlobDetailsAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SeqLocAsnWrite(ID2SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr orig) - +ID2GetBlobDetailsAsnWrite(ID2GetBlobDetailsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; - AsnTypePtr atp, writetype = NULL; - Pointer pnt; - AsnWriteFunc func = NULL; + AsnTypePtr atp; Boolean retval = FALSE; if (! loaded) { - if (! id2genAsnLoad()) - return FALSE; + if (! id2genAsnLoad()) { + return FALSE; + } } - if (aip == NULL) - return FALSE; + if (aip == NULL) { + return FALSE; + } - atp = AsnLinkType(orig, ID2_SEQ_LOC); /* link local tree */ + atp = AsnLinkType(orig, ID2_GET_BLOB_DETAILS); /* link local tree */ if (atp == NULL) { return FALSE; } - if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - - av.ptrvalue = (Pointer)anp; - if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { goto erret; } - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - case ID2SeqLoc_whole: - av.intvalue = anp->data.intvalue; - retval = AsnWrite(aip, ID2_SEQ_LOC_whole, &av); - break; - case ID2SeqLoc_int__: - writetype = ID2_SEQ_LOC_int__; - func = (AsnWriteFunc) ID2IntervalAsnWrite; - break; - case ID2SeqLoc_int_set: - writetype = ID2_SEQ_LOC_int_set; - func = (AsnWriteFunc) ID2PackedSeqIntsAsnWrite; - break; - case ID2SeqLoc_whole_range: - writetype = ID2_SEQ_LOC_whole_range; - func = (AsnWriteFunc) ID2IdRangeAsnWrite; - break; - case ID2SeqLoc_loc_set: - retval = AsnGenericChoiceSeqOfAsnWrite((Pointer) pnt, (AsnWriteFunc) ID2SeqLocAsnWrite, aip, ID2_SEQ_LOC_loc_set, ID2_SEQ_LOC_loc_set_E); - break; - } - if (writetype != NULL) { - retval = (* func)(pnt, aip, writetype); /* write it out */ + if (ptr -> location != NULL) { + if ( ! SeqLocAsnWrite(ptr -> location, aip, ID2_GET_BLOB_DETAILS_location)) { + goto erret; + } } - if (!retval) { + av.intvalue = ptr -> seq_class_level; + retval = AsnWrite(aip, BLOB_DETAILS_seq_class_level, &av); + av.intvalue = ptr -> descr_level; + retval = AsnWrite(aip, GET_BLOB_DETAILS_descr_level, &av); + av.intvalue = ptr -> descr_type_mask; + retval = AsnWrite(aip, BLOB_DETAILS_descr_type_mask, &av); + av.intvalue = ptr -> annot_type_mask; + retval = AsnWrite(aip, BLOB_DETAILS_annot_type_mask, &av); + av.intvalue = ptr -> feat_type_mask; + retval = AsnWrite(aip, BLOB_DETAILS_feat_type_mask, &av); + av.intvalue = ptr -> sequence_level; + retval = AsnWrite(aip, BLOB_DETAILS_sequence_level, &av); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } retval = TRUE; @@ -2961,6 +2601,7 @@ erret: } + /************************************************** * * ID2ReplyNew() @@ -2991,8 +2632,8 @@ ID2ReplyFree(ID2ReplyPtr ptr) return NULL; } ID2ParamsFree(ptr -> params); - Reply_replyFree(ptr -> Reply_reply); AsnGenericUserSeqOfFree(ptr -> error, (AsnOptFreeFunc) ID2ErrorFree); + Reply_replyFree(ptr -> Reply_reply); return MemFree(ptr); } @@ -3020,17 +2661,23 @@ Reply_replyFree(ValNodePtr anp) case Reply_reply_get_package: ID2ReplyGetPackageFree(anp -> data.ptrvalue); break; - case Reply_reply_seq_id_to_gi: - ID2ReplySeqIdToGiFree(anp -> data.ptrvalue); + case Reply_reply_get_seq_id: + ID2ReplyGetSeqIdFree(anp -> data.ptrvalue); break; - case Reply_reply_gi_to_tse_id: - ID2ReplyGiToTSEIdFree(anp -> data.ptrvalue); + case Reply_reply_get_blob_id: + ID2ReplyGetBlobIdFree(anp -> data.ptrvalue); break; - case Reply_reply_get_tse: - ID2ReplyGetTSEFree(anp -> data.ptrvalue); + case Reply_reply_get_blob_seq_ids: + ID2ReplyGetBlobSeqIdsFree(anp -> data.ptrvalue); break; - case Reply_reply_get_tse_info: - ID2SReplyGetTSEInfoFree(anp -> data.ptrvalue); + case Reply_reply_get_blob: + ID2ReplyGetBlobFree(anp -> data.ptrvalue); + break; + case Reply_reply_reget_blob: + ID2ReplyReGetBlobFree(anp -> data.ptrvalue); + break; + case Reply_reply_get_split_info: + ID2SReplyGetSplitInfoFree(anp -> data.ptrvalue); break; case Reply_reply_get_chunk: ID2SReplyGetChunkFree(anp -> data.ptrvalue); @@ -3101,13 +2748,6 @@ ID2ReplyAsnRead(AsnIoPtr aip, AsnTypePtr orig) } atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_REPLY_reply) { - ptr -> Reply_reply = Reply_replyAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } if (atp == ID2_REPLY_error) { ptr -> error = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2ErrorAsnRead, (AsnOptFreeFunc) ID2ErrorFree); if (isError && ptr -> error == NULL) { @@ -3122,6 +2762,13 @@ ID2ReplyAsnRead(AsnIoPtr aip, AsnTypePtr orig) ptr -> end_of_reply = av.boolvalue; atp = AsnReadId(aip,amp, atp); } + if (atp == ID2_REPLY_reply) { + ptr -> Reply_reply = Reply_replyAsnRead(aip, atp); + if (aip -> io_failure) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } if (AsnReadVal(aip, atp, &av) <= 0) { goto erret; @@ -3198,25 +2845,40 @@ Reply_replyAsnRead(AsnIoPtr aip, AsnTypePtr orig) } anp->data.boolvalue = av.boolvalue; } + else if (atp == ID2_REPLY_reply_empty) { + choice = Reply_reply_empty; + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + anp->data.boolvalue = av.boolvalue; + } else if (atp == ID2_REPLY_reply_get_package) { choice = Reply_reply_get_package; func = (AsnReadFunc) ID2ReplyGetPackageAsnRead; } - else if (atp == ID2_REPLY_reply_seq_id_to_gi) { - choice = Reply_reply_seq_id_to_gi; - func = (AsnReadFunc) ID2ReplySeqIdToGiAsnRead; + else if (atp == ID2_REPLY_reply_get_seq_id) { + choice = Reply_reply_get_seq_id; + func = (AsnReadFunc) ID2ReplyGetSeqIdAsnRead; + } + else if (atp == ID2_REPLY_reply_get_blob_id) { + choice = Reply_reply_get_blob_id; + func = (AsnReadFunc) ID2ReplyGetBlobIdAsnRead; + } + else if (atp == REPLY_reply_get_blob_seq_ids) { + choice = Reply_reply_get_blob_seq_ids; + func = (AsnReadFunc) ID2ReplyGetBlobSeqIdsAsnRead; } - else if (atp == ID2_REPLY_reply_gi_to_tse_id) { - choice = Reply_reply_gi_to_tse_id; - func = (AsnReadFunc) ID2ReplyGiToTSEIdAsnRead; + else if (atp == ID2_REPLY_reply_get_blob) { + choice = Reply_reply_get_blob; + func = (AsnReadFunc) ID2ReplyGetBlobAsnRead; } - else if (atp == ID2_REPLY_reply_get_tse) { - choice = Reply_reply_get_tse; - func = (AsnReadFunc) ID2ReplyGetTSEAsnRead; + else if (atp == ID2_REPLY_reply_reget_blob) { + choice = Reply_reply_reget_blob; + func = (AsnReadFunc) ID2ReplyReGetBlobAsnRead; } - else if (atp == ID2_REPLY_reply_get_tse_info) { - choice = Reply_reply_get_tse_info; - func = (AsnReadFunc) ID2SReplyGetTSEInfoAsnRead; + else if (atp == ID2_REPLY_reply_get_split_info) { + choice = Reply_reply_get_split_info; + func = (AsnReadFunc) ID2SReplyGetSplitInfoAsnRead; } else if (atp == ID2_REPLY_reply_get_chunk) { choice = Reply_reply_get_chunk; @@ -3284,14 +2946,14 @@ ID2ReplyAsnWrite(ID2ReplyPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } } + AsnGenericUserSeqOfAsnWrite(ptr -> error, (AsnWriteFunc) ID2ErrorAsnWrite, aip, ID2_REPLY_error, ID2_REPLY_error_E); + av.boolvalue = ptr -> end_of_reply; + retval = AsnWrite(aip, ID2_REPLY_end_of_reply, &av); if (ptr -> Reply_reply != NULL) { if ( ! Reply_replyAsnWrite(ptr -> Reply_reply, aip, ID2_REPLY_reply)) { goto erret; } } - AsnGenericUserSeqOfAsnWrite(ptr -> error, (AsnWriteFunc) ID2ErrorAsnWrite, aip, ID2_REPLY_error, ID2_REPLY_error_E); - av.boolvalue = ptr -> end_of_reply; - retval = AsnWrite(aip, ID2_REPLY_end_of_reply, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -3347,25 +3009,37 @@ Reply_replyAsnWrite(Reply_replyPtr anp, AsnIoPtr aip, AsnTypePtr orig) av.boolvalue = anp->data.boolvalue; retval = AsnWrite(aip, ID2_REPLY_reply_init, &av); break; + case Reply_reply_empty: + av.boolvalue = anp->data.boolvalue; + retval = AsnWrite(aip, ID2_REPLY_reply_empty, &av); + break; case Reply_reply_get_package: writetype = ID2_REPLY_reply_get_package; func = (AsnWriteFunc) ID2ReplyGetPackageAsnWrite; break; - case Reply_reply_seq_id_to_gi: - writetype = ID2_REPLY_reply_seq_id_to_gi; - func = (AsnWriteFunc) ID2ReplySeqIdToGiAsnWrite; + case Reply_reply_get_seq_id: + writetype = ID2_REPLY_reply_get_seq_id; + func = (AsnWriteFunc) ID2ReplyGetSeqIdAsnWrite; break; - case Reply_reply_gi_to_tse_id: - writetype = ID2_REPLY_reply_gi_to_tse_id; - func = (AsnWriteFunc) ID2ReplyGiToTSEIdAsnWrite; + case Reply_reply_get_blob_id: + writetype = ID2_REPLY_reply_get_blob_id; + func = (AsnWriteFunc) ID2ReplyGetBlobIdAsnWrite; break; - case Reply_reply_get_tse: - writetype = ID2_REPLY_reply_get_tse; - func = (AsnWriteFunc) ID2ReplyGetTSEAsnWrite; + case Reply_reply_get_blob_seq_ids: + writetype = REPLY_reply_get_blob_seq_ids; + func = (AsnWriteFunc) ID2ReplyGetBlobSeqIdsAsnWrite; break; - case Reply_reply_get_tse_info: - writetype = ID2_REPLY_reply_get_tse_info; - func = (AsnWriteFunc) ID2SReplyGetTSEInfoAsnWrite; + case Reply_reply_get_blob: + writetype = ID2_REPLY_reply_get_blob; + func = (AsnWriteFunc) ID2ReplyGetBlobAsnWrite; + break; + case Reply_reply_reget_blob: + writetype = ID2_REPLY_reply_reget_blob; + func = (AsnWriteFunc) ID2ReplyReGetBlobAsnWrite; + break; + case Reply_reply_get_split_info: + writetype = ID2_REPLY_reply_get_split_info; + func = (AsnWriteFunc) ID2SReplyGetSplitInfoAsnWrite; break; case Reply_reply_get_chunk: writetype = ID2_REPLY_reply_get_chunk; @@ -3388,1038 +3062,6 @@ erret: /************************************************** * -* ID2ReplyGetPackageNew() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGetPackagePtr LIBCALL -ID2ReplyGetPackageNew(void) -{ - ID2ReplyGetPackagePtr ptr = MemNew((size_t) sizeof(ID2ReplyGetPackage)); - - return ptr; - -} - - -/************************************************** -* -* ID2ReplyGetPackageFree() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGetPackagePtr LIBCALL -ID2ReplyGetPackageFree(ID2ReplyGetPackagePtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - MemFree(ptr -> name); - ID2ParamsFree(ptr -> params); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2ReplyGetPackageAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGetPackagePtr LIBCALL -ID2ReplyGetPackageAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2ReplyGetPackagePtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2ReplyGetPackage ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REPLY_GET_PACKAGE); - } else { - atp = AsnLinkType(orig, ID2_REPLY_GET_PACKAGE); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2ReplyGetPackageNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2_REPLY_GET_PACKAGE_name) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> name = av.ptrvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_REPLY_GET_PACKAGE_params) { - ptr -> params = ID2ParamsAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2ReplyGetPackageFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2ReplyGetPackageAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2ReplyGetPackageAsnWrite(ID2ReplyGetPackagePtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2_REPLY_GET_PACKAGE); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - if (ptr -> name != NULL) { - av.ptrvalue = ptr -> name; - retval = AsnWrite(aip, ID2_REPLY_GET_PACKAGE_name, &av); - } - if (ptr -> params != NULL) { - if ( ! ID2ParamsAsnWrite(ptr -> params, aip, ID2_REPLY_GET_PACKAGE_params)) { - goto erret; - } - } - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2ReplySeqIdToGiNew() -* -**************************************************/ -NLM_EXTERN -ID2ReplySeqIdToGiPtr LIBCALL -ID2ReplySeqIdToGiNew(void) -{ - ID2ReplySeqIdToGiPtr ptr = MemNew((size_t) sizeof(ID2ReplySeqIdToGi)); - - return ptr; - -} - - -/************************************************** -* -* ID2ReplySeqIdToGiFree() -* -**************************************************/ -NLM_EXTERN -ID2ReplySeqIdToGiPtr LIBCALL -ID2ReplySeqIdToGiFree(ID2ReplySeqIdToGiPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - SeqIdFree(ptr -> seq_id); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2ReplySeqIdToGiAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2ReplySeqIdToGiPtr LIBCALL -ID2ReplySeqIdToGiAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2ReplySeqIdToGiPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2ReplySeqIdToGi ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REPLY_SEQ_ID_TO_GI); - } else { - atp = AsnLinkType(orig, ID2_REPLY_SEQ_ID_TO_GI); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2ReplySeqIdToGiNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2_REPLY_SEQ_ID_TO_GI_seq_id) { - ptr -> seq_id = SeqIdAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_REPLY_SEQ_ID_TO_GI_gi) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> gi = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2ReplySeqIdToGiFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2ReplySeqIdToGiAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2ReplySeqIdToGiAsnWrite(ID2ReplySeqIdToGiPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2_REPLY_SEQ_ID_TO_GI); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - if (ptr -> seq_id != NULL) { - if ( ! SeqIdAsnWrite(ptr -> seq_id, aip, ID2_REPLY_SEQ_ID_TO_GI_seq_id)) { - goto erret; - } - } - av.intvalue = ptr -> gi; - retval = AsnWrite(aip, ID2_REPLY_SEQ_ID_TO_GI_gi, &av); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2ReplyGiToTSEIdNew() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGiToTSEIdPtr LIBCALL -ID2ReplyGiToTSEIdNew(void) -{ - ID2ReplyGiToTSEIdPtr ptr = MemNew((size_t) sizeof(ID2ReplyGiToTSEId)); - - ptr -> source = "0"; - return ptr; - -} - - -/************************************************** -* -* ID2ReplyGiToTSEIdFree() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGiToTSEIdPtr LIBCALL -ID2ReplyGiToTSEIdFree(ID2ReplyGiToTSEIdPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - MemFree(ptr -> source); - AsnGenericUserSeqOfFree(ptr -> tses, (AsnOptFreeFunc) ID2TSEIdInfoFree); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2ReplyGiToTSEIdAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGiToTSEIdPtr LIBCALL -ID2ReplyGiToTSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2ReplyGiToTSEIdPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2ReplyGiToTSEId ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REPLY_GI_TO_TSE_ID); - } else { - atp = AsnLinkType(orig, ID2_REPLY_GI_TO_TSE_ID); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2ReplyGiToTSEIdNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2_REPLY_GI_TO_TSE_ID_gi) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> gi = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_REPLY_GI_TO_TSE_ID_source) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> source = av.ptrvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_REPLY_GI_TO_TSE_ID_tses) { - ptr -> tses = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2TSEIdInfoAsnRead, (AsnOptFreeFunc) ID2TSEIdInfoFree); - if (isError && ptr -> tses == NULL) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2ReplyGiToTSEIdFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2ReplyGiToTSEIdAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2ReplyGiToTSEIdAsnWrite(ID2ReplyGiToTSEIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2_REPLY_GI_TO_TSE_ID); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - av.intvalue = ptr -> gi; - retval = AsnWrite(aip, ID2_REPLY_GI_TO_TSE_ID_gi, &av); - if (ptr -> source != NULL) { - av.ptrvalue = ptr -> source; - retval = AsnWrite(aip, ID2_REPLY_GI_TO_TSE_ID_source, &av); - } - AsnGenericUserSeqOfAsnWrite(ptr -> tses, (AsnWriteFunc) ID2TSEIdInfoAsnWrite, aip, ID2_REPLY_GI_TO_TSE_ID_tses, ID2_REPLY_GI_TO_TSE_ID_tses_E); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2ReplyGetTSENew() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGetTSEPtr LIBCALL -ID2ReplyGetTSENew(void) -{ - ID2ReplyGetTSEPtr ptr = MemNew((size_t) sizeof(ID2ReplyGetTSE)); - - return ptr; - -} - - -/************************************************** -* -* ID2ReplyGetTSEFree() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGetTSEPtr LIBCALL -ID2ReplyGetTSEFree(ID2ReplyGetTSEPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - ID2TSEIdFree(ptr -> tse_id); - ID2ReplyDataFree(ptr -> data); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2ReplyGetTSEAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2ReplyGetTSEPtr LIBCALL -ID2ReplyGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2ReplyGetTSEPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2ReplyGetTSE ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REPLY_GET_TSE); - } else { - atp = AsnLinkType(orig, ID2_REPLY_GET_TSE); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2ReplyGetTSENew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2_REPLY_GET_TSE_tse_id) { - ptr -> tse_id = ID2TSEIdAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_REPLY_GET_TSE_data) { - ptr -> data = ID2ReplyDataAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2ReplyGetTSEFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2ReplyGetTSEAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2ReplyGetTSEAsnWrite(ID2ReplyGetTSEPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2_REPLY_GET_TSE); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - if (ptr -> tse_id != NULL) { - if ( ! ID2TSEIdAsnWrite(ptr -> tse_id, aip, ID2_REPLY_GET_TSE_tse_id)) { - goto erret; - } - } - if (ptr -> data != NULL) { - if ( ! ID2ReplyDataAsnWrite(ptr -> data, aip, ID2_REPLY_GET_TSE_data)) { - goto erret; - } - } - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2SReplyGetTSEInfoNew() -* -**************************************************/ -NLM_EXTERN -ID2SReplyGetTSEInfoPtr LIBCALL -ID2SReplyGetTSEInfoNew(void) -{ - ID2SReplyGetTSEInfoPtr ptr = MemNew((size_t) sizeof(ID2SReplyGetTSEInfo)); - - return ptr; - -} - - -/************************************************** -* -* ID2SReplyGetTSEInfoFree() -* -**************************************************/ -NLM_EXTERN -ID2SReplyGetTSEInfoPtr LIBCALL -ID2SReplyGetTSEInfoFree(ID2SReplyGetTSEInfoPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - ID2TSEIdFree(ptr -> tse_id); - ID2ReplyDataFree(ptr -> info); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2SReplyGetTSEInfoAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SReplyGetTSEInfoPtr LIBCALL -ID2SReplyGetTSEInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2SReplyGetTSEInfoPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SReplyGetTSEInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_REPLY_GET_TSE_INFO); - } else { - atp = AsnLinkType(orig, ID2S_REPLY_GET_TSE_INFO); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2SReplyGetTSEInfoNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2S_REPLY_GET_TSE_INFO_tse_id) { - ptr -> tse_id = ID2TSEIdAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == GET_TSE_INFO_split_version) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> split_version = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_REPLY_GET_TSE_INFO_info) { - ptr -> info = ID2ReplyDataAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2SReplyGetTSEInfoFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2SReplyGetTSEInfoAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SReplyGetTSEInfoAsnWrite(ID2SReplyGetTSEInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2S_REPLY_GET_TSE_INFO); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - if (ptr -> tse_id != NULL) { - if ( ! ID2TSEIdAsnWrite(ptr -> tse_id, aip, ID2S_REPLY_GET_TSE_INFO_tse_id)) { - goto erret; - } - } - av.intvalue = ptr -> split_version; - retval = AsnWrite(aip, GET_TSE_INFO_split_version, &av); - if (ptr -> info != NULL) { - if ( ! ID2ReplyDataAsnWrite(ptr -> info, aip, ID2S_REPLY_GET_TSE_INFO_info)) { - goto erret; - } - } - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2SReplyGetChunkNew() -* -**************************************************/ -NLM_EXTERN -ID2SReplyGetChunkPtr LIBCALL -ID2SReplyGetChunkNew(void) -{ - ID2SReplyGetChunkPtr ptr = MemNew((size_t) sizeof(ID2SReplyGetChunk)); - - return ptr; - -} - - -/************************************************** -* -* ID2SReplyGetChunkFree() -* -**************************************************/ -NLM_EXTERN -ID2SReplyGetChunkPtr LIBCALL -ID2SReplyGetChunkFree(ID2SReplyGetChunkPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - ID2TSEIdFree(ptr -> tse_id); - ID2ReplyDataFree(ptr -> data); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2SReplyGetChunkAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SReplyGetChunkPtr LIBCALL -ID2SReplyGetChunkAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2SReplyGetChunkPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SReplyGetChunk ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_REPLY_GET_CHUNK); - } else { - atp = AsnLinkType(orig, ID2S_REPLY_GET_CHUNK); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2SReplyGetChunkNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2S_REPLY_GET_CHUNK_tse_id) { - ptr -> tse_id = ID2TSEIdAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_REPLY_GET_CHUNK_chunk_id) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> chunk_id = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_REPLY_GET_CHUNK_data) { - ptr -> data = ID2ReplyDataAsnRead(aip, atp); - if (aip -> io_failure) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2SReplyGetChunkFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2SReplyGetChunkAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SReplyGetChunkAsnWrite(ID2SReplyGetChunkPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2S_REPLY_GET_CHUNK); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - if (ptr -> tse_id != NULL) { - if ( ! ID2TSEIdAsnWrite(ptr -> tse_id, aip, ID2S_REPLY_GET_CHUNK_tse_id)) { - goto erret; - } - } - av.intvalue = ptr -> chunk_id; - retval = AsnWrite(aip, ID2S_REPLY_GET_CHUNK_chunk_id, &av); - if (ptr -> data != NULL) { - if ( ! ID2ReplyDataAsnWrite(ptr -> data, aip, ID2S_REPLY_GET_CHUNK_data)) { - goto erret; - } - } - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* * ID2ErrorNew() * **************************************************/ @@ -4593,16 +3235,15 @@ erret: /************************************************** * -* ID2TSEIdInfoNew() +* ID2ReplyGetPackageNew() * **************************************************/ NLM_EXTERN -ID2TSEIdInfoPtr LIBCALL -ID2TSEIdInfoNew(void) +ID2ReplyGetPackagePtr LIBCALL +ID2ReplyGetPackageNew(void) { - ID2TSEIdInfoPtr ptr = MemNew((size_t) sizeof(ID2TSEIdInfo)); + ID2ReplyGetPackagePtr ptr = MemNew((size_t) sizeof(ID2ReplyGetPackage)); - ptr -> split_version = 0; return ptr; } @@ -4610,36 +3251,37 @@ ID2TSEIdInfoNew(void) /************************************************** * -* ID2TSEIdInfoFree() +* ID2ReplyGetPackageFree() * **************************************************/ NLM_EXTERN -ID2TSEIdInfoPtr LIBCALL -ID2TSEIdInfoFree(ID2TSEIdInfoPtr ptr) +ID2ReplyGetPackagePtr LIBCALL +ID2ReplyGetPackageFree(ID2ReplyGetPackagePtr ptr) { if(ptr == NULL) { return NULL; } - ID2TSEIdFree(ptr -> tse_id); + MemFree(ptr -> name); + ID2ParamsFree(ptr -> params); return MemFree(ptr); } /************************************************** * -* ID2TSEIdInfoAsnRead() +* ID2ReplyGetPackageAsnRead() * **************************************************/ NLM_EXTERN -ID2TSEIdInfoPtr LIBCALL -ID2TSEIdInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetPackagePtr LIBCALL +ID2ReplyGetPackageAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2TSEIdInfoPtr ptr; + ID2ReplyGetPackagePtr ptr; if (! loaded) { @@ -4652,17 +3294,17 @@ ID2TSEIdInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2TSEIdInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_TSE_ID_INFO); + if (orig == NULL) { /* ID2ReplyGetPackage ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REPLY_GET_PACKAGE); } else { - atp = AsnLinkType(orig, ID2_TSE_ID_INFO); + atp = AsnLinkType(orig, ID2_REPLY_GET_PACKAGE); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2TSEIdInfoNew(); + ptr = ID2ReplyGetPackageNew(); if (ptr == NULL) { goto erret; } @@ -4673,18 +3315,18 @@ ID2TSEIdInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_TSE_ID_INFO_tse_id) { - ptr -> tse_id = ID2TSEIdAsnRead(aip, atp); - if (aip -> io_failure) { + if (atp == ID2_REPLY_GET_PACKAGE_name) { + if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } + ptr -> name = av.ptrvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_TSE_ID_INFO_split_version) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == ID2_REPLY_GET_PACKAGE_params) { + ptr -> params = ID2ParamsAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } - ptr -> split_version = av.intvalue; atp = AsnReadId(aip,amp, atp); } @@ -4699,7 +3341,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2TSEIdInfoFree(ptr); + ptr = ID2ReplyGetPackageFree(ptr); goto ret; } @@ -4707,11 +3349,11 @@ erret: /************************************************** * -* ID2TSEIdInfoAsnWrite() +* ID2ReplyGetPackageAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2TSEIdInfoAsnWrite(ID2TSEIdInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetPackageAsnWrite(ID2ReplyGetPackagePtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -4728,7 +3370,7 @@ ID2TSEIdInfoAsnWrite(ID2TSEIdInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_TSE_ID_INFO); /* link local tree */ + atp = AsnLinkType(orig, ID2_REPLY_GET_PACKAGE); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -4738,13 +3380,15 @@ ID2TSEIdInfoAsnWrite(ID2TSEIdInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - if (ptr -> tse_id != NULL) { - if ( ! ID2TSEIdAsnWrite(ptr -> tse_id, aip, ID2_TSE_ID_INFO_tse_id)) { + if (ptr -> name != NULL) { + av.ptrvalue = ptr -> name; + retval = AsnWrite(aip, ID2_REPLY_GET_PACKAGE_name, &av); + } + if (ptr -> params != NULL) { + if ( ! ID2ParamsAsnWrite(ptr -> params, aip, ID2_REPLY_GET_PACKAGE_params)) { goto erret; } } - av.intvalue = ptr -> split_version; - retval = AsnWrite(aip, ID2_TSE_ID_INFO_split_version, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -4759,14 +3403,14 @@ erret: /************************************************** * -* ID2ReplyDataNew() +* ID2ReplyGetSeqIdNew() * **************************************************/ NLM_EXTERN -ID2ReplyDataPtr LIBCALL -ID2ReplyDataNew(void) +ID2ReplyGetSeqIdPtr LIBCALL +ID2ReplyGetSeqIdNew(void) { - ID2ReplyDataPtr ptr = MemNew((size_t) sizeof(ID2ReplyData)); + ID2ReplyGetSeqIdPtr ptr = MemNew((size_t) sizeof(ID2ReplyGetSeqId)); return ptr; @@ -4775,36 +3419,37 @@ ID2ReplyDataNew(void) /************************************************** * -* ID2ReplyDataFree() +* ID2ReplyGetSeqIdFree() * **************************************************/ NLM_EXTERN -ID2ReplyDataPtr LIBCALL -ID2ReplyDataFree(ID2ReplyDataPtr ptr) +ID2ReplyGetSeqIdPtr LIBCALL +ID2ReplyGetSeqIdFree(ID2ReplyGetSeqIdPtr ptr) { if(ptr == NULL) { return NULL; } - AsnGenericBaseSeqOfFree(ptr -> data ,ASNCODE_BYTEVAL_SLOT); + ID2RequestGetSeqIdFree(ptr -> request); + AsnGenericChoiceSeqOfFree(ptr -> seq_id, (AsnOptFreeFunc) SeqIdFree); return MemFree(ptr); } /************************************************** * -* ID2ReplyDataAsnRead() +* ID2ReplyGetSeqIdAsnRead() * **************************************************/ NLM_EXTERN -ID2ReplyDataPtr LIBCALL -ID2ReplyDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetSeqIdPtr LIBCALL +ID2ReplyGetSeqIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2ReplyDataPtr ptr; + ID2ReplyGetSeqIdPtr ptr; if (! loaded) { @@ -4817,17 +3462,17 @@ ID2ReplyDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2ReplyData ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_REPLY_DATA); + if (orig == NULL) { /* ID2ReplyGetSeqId ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REPLY_GET_SEQ_ID); } else { - atp = AsnLinkType(orig, ID2_REPLY_DATA); + atp = AsnLinkType(orig, ID2_REPLY_GET_SEQ_ID); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2ReplyDataNew(); + ptr = ID2ReplyGetSeqIdNew(); if (ptr == NULL) { goto erret; } @@ -4838,30 +3483,16 @@ ID2ReplyDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_REPLY_DATA_data_type) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> data_type = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_REPLY_DATA_data_format) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> data_format = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_REPLY_DATA_data_compression) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == ID2_REPLY_GET_SEQ_ID_request) { + ptr -> request = ID2RequestGetSeqIdAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } - ptr -> data_compression = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_REPLY_DATA_data) { - ptr -> data = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_BYTEVAL_SLOT, &isError); - if (isError && ptr -> data == NULL) { + if (atp == ID2_REPLY_GET_SEQ_ID_seq_id) { + ptr -> seq_id = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqIdAsnRead, (AsnOptFreeFunc) SeqIdFree); + if (isError && ptr -> seq_id == NULL) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -4878,7 +3509,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2ReplyDataFree(ptr); + ptr = ID2ReplyGetSeqIdFree(ptr); goto ret; } @@ -4886,11 +3517,11 @@ erret: /************************************************** * -* ID2ReplyDataAsnWrite() +* ID2ReplyGetSeqIdAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2ReplyDataAsnWrite(ID2ReplyDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetSeqIdAsnWrite(ID2ReplyGetSeqIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -4907,7 +3538,7 @@ ID2ReplyDataAsnWrite(ID2ReplyDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_REPLY_DATA); /* link local tree */ + atp = AsnLinkType(orig, ID2_REPLY_GET_SEQ_ID); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -4917,174 +3548,12 @@ ID2ReplyDataAsnWrite(ID2ReplyDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - av.intvalue = ptr -> data_type; - retval = AsnWrite(aip, ID2_REPLY_DATA_data_type, &av); - av.intvalue = ptr -> data_format; - retval = AsnWrite(aip, ID2_REPLY_DATA_data_format, &av); - av.intvalue = ptr -> data_compression; - retval = AsnWrite(aip, ID2_REPLY_DATA_data_compression, &av); - retval = AsnGenericBaseSeqOfAsnWrite(ptr -> data ,ASNCODE_BYTEVAL_SLOT, aip, ID2_REPLY_DATA_data, ID2_REPLY_DATA_data_E); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2SSplitInfoNew() -* -**************************************************/ -NLM_EXTERN -ID2SSplitInfoPtr LIBCALL -ID2SSplitInfoNew(void) -{ - ID2SSplitInfoPtr ptr = MemNew((size_t) sizeof(ID2SSplitInfo)); - - return ptr; - -} - - -/************************************************** -* -* ID2SSplitInfoFree() -* -**************************************************/ -NLM_EXTERN -ID2SSplitInfoPtr LIBCALL -ID2SSplitInfoFree(ID2SSplitInfoPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - AsnGenericUserSeqOfFree(ptr -> bioseqs_info, (AsnOptFreeFunc) ID2SBioseqsInfoFree); - AsnGenericUserSeqOfFree(ptr -> chunks, (AsnOptFreeFunc) ID2SChunkInfoFree); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2SSplitInfoAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SSplitInfoPtr LIBCALL -ID2SSplitInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2SSplitInfoPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SSplitInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_SPLIT_INFO); - } else { - atp = AsnLinkType(orig, ID2S_SPLIT_INFO); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2SSplitInfoNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2S_SPLIT_INFO_bioseqs_info) { - ptr -> bioseqs_info = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SBioseqsInfoAsnRead, (AsnOptFreeFunc) ID2SBioseqsInfoFree); - if (isError && ptr -> bioseqs_info == NULL) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_SPLIT_INFO_chunks) { - ptr -> chunks = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SChunkInfoAsnRead, (AsnOptFreeFunc) ID2SChunkInfoFree); - if (isError && ptr -> chunks == NULL) { + if (ptr -> request != NULL) { + if ( ! ID2RequestGetSeqIdAsnWrite(ptr -> request, aip, ID2_REPLY_GET_SEQ_ID_request)) { goto erret; } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2SSplitInfoFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2SSplitInfoAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SSplitInfoAsnWrite(ID2SSplitInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2S_SPLIT_INFO); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs_info, (AsnWriteFunc) ID2SBioseqsInfoAsnWrite, aip, ID2S_SPLIT_INFO_bioseqs_info, ID2S_SPLIT_INFO_bioseqs_info_E); - AsnGenericUserSeqOfAsnWrite(ptr -> chunks, (AsnWriteFunc) ID2SChunkInfoAsnWrite, aip, ID2S_SPLIT_INFO_chunks, ID2S_SPLIT_INFO_chunks_E); + AsnGenericChoiceSeqOfAsnWrite(ptr -> seq_id, (AsnWriteFunc) SeqIdAsnWrite, aip, ID2_REPLY_GET_SEQ_ID_seq_id, ID2_REPLY_GET_SEQ_ID_seq_id_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -5099,15 +3568,16 @@ erret: /************************************************** * -* ID2SBioseqsInfoNew() +* ID2ReplyGetBlobIdNew() * **************************************************/ NLM_EXTERN -ID2SBioseqsInfoPtr LIBCALL -ID2SBioseqsInfoNew(void) +ID2ReplyGetBlobIdPtr LIBCALL +ID2ReplyGetBlobIdNew(void) { - ID2SBioseqsInfoPtr ptr = MemNew((size_t) sizeof(ID2SBioseqsInfo)); + ID2ReplyGetBlobIdPtr ptr = MemNew((size_t) sizeof(ID2ReplyGetBlobId)); + ptr -> split_version = 0; return ptr; } @@ -5115,37 +3585,38 @@ ID2SBioseqsInfoNew(void) /************************************************** * -* ID2SBioseqsInfoFree() +* ID2ReplyGetBlobIdFree() * **************************************************/ NLM_EXTERN -ID2SBioseqsInfoPtr LIBCALL -ID2SBioseqsInfoFree(ID2SBioseqsInfoPtr ptr) +ID2ReplyGetBlobIdPtr LIBCALL +ID2ReplyGetBlobIdFree(ID2ReplyGetBlobIdPtr ptr) { if(ptr == NULL) { return NULL; } - ID2SBioseqInfoFree(ptr -> info); - ID2IdRangeFree(ptr -> bioseqs); + SeqIdFree(ptr -> seq_id); + ID2BlobIdFree(ptr -> blob_id); + AsnGenericUserSeqOfFree(ptr -> annot_info, (AsnOptFreeFunc) ID2SSeqAnnotInfoFree); return MemFree(ptr); } /************************************************** * -* ID2SBioseqsInfoAsnRead() +* ID2ReplyGetBlobIdAsnRead() * **************************************************/ NLM_EXTERN -ID2SBioseqsInfoPtr LIBCALL -ID2SBioseqsInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetBlobIdPtr LIBCALL +ID2ReplyGetBlobIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2SBioseqsInfoPtr ptr; + ID2ReplyGetBlobIdPtr ptr; if (! loaded) { @@ -5158,17 +3629,17 @@ ID2SBioseqsInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SBioseqsInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_BIOSEQS_INFO); + if (orig == NULL) { /* ID2ReplyGetBlobId ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REPLY_GET_BLOB_ID); } else { - atp = AsnLinkType(orig, ID2S_BIOSEQS_INFO); + atp = AsnLinkType(orig, ID2_REPLY_GET_BLOB_ID); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2SBioseqsInfoNew(); + ptr = ID2ReplyGetBlobIdNew(); if (ptr == NULL) { goto erret; } @@ -5179,184 +3650,30 @@ ID2SBioseqsInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2S_BIOSEQS_INFO_info) { - ptr -> info = ID2SBioseqInfoAsnRead(aip, atp); + if (atp == ID2_REPLY_GET_BLOB_ID_seq_id) { + ptr -> seq_id = SeqIdAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_BIOSEQS_INFO_bioseqs) { - ptr -> bioseqs = ID2IdRangeAsnRead(aip, atp); + if (atp == ID2_REPLY_GET_BLOB_ID_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2SBioseqsInfoFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2SBioseqsInfoAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SBioseqsInfoAsnWrite(ID2SBioseqsInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2S_BIOSEQS_INFO); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - if (ptr -> info != NULL) { - if ( ! ID2SBioseqInfoAsnWrite(ptr -> info, aip, ID2S_BIOSEQS_INFO_info)) { - goto erret; - } - } - if (ptr -> bioseqs != NULL) { - if ( ! ID2IdRangeAsnWrite(ptr -> bioseqs, aip, ID2S_BIOSEQS_INFO_bioseqs)) { - goto erret; - } - } - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2SChunkInfoNew() -* -**************************************************/ -NLM_EXTERN -ID2SChunkInfoPtr LIBCALL -ID2SChunkInfoNew(void) -{ - ID2SChunkInfoPtr ptr = MemNew((size_t) sizeof(ID2SChunkInfo)); - - return ptr; - -} - - -/************************************************** -* -* ID2SChunkInfoFree() -* -**************************************************/ -NLM_EXTERN -ID2SChunkInfoPtr LIBCALL -ID2SChunkInfoFree(ID2SChunkInfoPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - AsnGenericChoiceSeqOfFree(ptr -> content, (AsnOptFreeFunc) ID2SChunkContentFree); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2SChunkInfoAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SChunkInfoPtr LIBCALL -ID2SChunkInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2SChunkInfoPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SChunkInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_CHUNK_INFO); - } else { - atp = AsnLinkType(orig, ID2S_CHUNK_INFO); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2SChunkInfoNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2S_CHUNK_INFO_id) { + if (atp == GET_BLOB_ID_split_version) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> id = av.intvalue; + ptr -> split_version = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_CHUNK_INFO_content) { - ptr -> content = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SChunkContentAsnRead, (AsnOptFreeFunc) ID2SChunkContentFree); - if (isError && ptr -> content == NULL) { + if (atp == REPLY_GET_BLOB_ID_annot_info) { + ptr -> annot_info = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SSeqAnnotInfoAsnRead, (AsnOptFreeFunc) ID2SSeqAnnotInfoFree); + if (isError && ptr -> annot_info == NULL) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -5373,7 +3690,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2SChunkInfoFree(ptr); + ptr = ID2ReplyGetBlobIdFree(ptr); goto ret; } @@ -5381,11 +3698,11 @@ erret: /************************************************** * -* ID2SChunkInfoAsnWrite() +* ID2ReplyGetBlobIdAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SChunkInfoAsnWrite(ID2SChunkInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetBlobIdAsnWrite(ID2ReplyGetBlobIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -5402,7 +3719,7 @@ ID2SChunkInfoAsnWrite(ID2SChunkInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2S_CHUNK_INFO); /* link local tree */ + atp = AsnLinkType(orig, ID2_REPLY_GET_BLOB_ID); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -5412,9 +3729,19 @@ ID2SChunkInfoAsnWrite(ID2SChunkInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - av.intvalue = ptr -> id; - retval = AsnWrite(aip, ID2S_CHUNK_INFO_id, &av); - AsnGenericChoiceSeqOfAsnWrite(ptr -> content, (AsnWriteFunc) ID2SChunkContentAsnWrite, aip, ID2S_CHUNK_INFO_content, ID2S_CHUNK_INFO_content_E); + if (ptr -> seq_id != NULL) { + if ( ! SeqIdAsnWrite(ptr -> seq_id, aip, ID2_REPLY_GET_BLOB_ID_seq_id)) { + goto erret; + } + } + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, ID2_REPLY_GET_BLOB_ID_blob_id)) { + goto erret; + } + } + av.intvalue = ptr -> split_version; + retval = AsnWrite(aip, GET_BLOB_ID_split_version, &av); + AsnGenericUserSeqOfAsnWrite(ptr -> annot_info, (AsnWriteFunc) ID2SSeqAnnotInfoAsnWrite, aip, REPLY_GET_BLOB_ID_annot_info, REPLY_GET_BLOB_ID_annot_info_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -5429,14 +3756,14 @@ erret: /************************************************** * -* ID2SBioseqInfoNew() +* ID2ReplyGetBlobSeqIdsNew() * **************************************************/ NLM_EXTERN -ID2SBioseqInfoPtr LIBCALL -ID2SBioseqInfoNew(void) +ID2ReplyGetBlobSeqIdsPtr LIBCALL +ID2ReplyGetBlobSeqIdsNew(void) { - ID2SBioseqInfoPtr ptr = MemNew((size_t) sizeof(ID2SBioseqInfo)); + ID2ReplyGetBlobSeqIdsPtr ptr = MemNew((size_t) sizeof(ID2ReplyGetBlobSeqIds)); return ptr; @@ -5445,36 +3772,37 @@ ID2SBioseqInfoNew(void) /************************************************** * -* ID2SBioseqInfoFree() +* ID2ReplyGetBlobSeqIdsFree() * **************************************************/ NLM_EXTERN -ID2SBioseqInfoPtr LIBCALL -ID2SBioseqInfoFree(ID2SBioseqInfoPtr ptr) +ID2ReplyGetBlobSeqIdsPtr LIBCALL +ID2ReplyGetBlobSeqIdsFree(ID2ReplyGetBlobSeqIdsPtr ptr) { if(ptr == NULL) { return NULL; } - ID2SSequenceSplitInfoFree(ptr -> sequence_split); + ID2BlobIdFree(ptr -> blob_id); + ID2ReplyDataFree(ptr -> ids); return MemFree(ptr); } /************************************************** * -* ID2SBioseqInfoAsnRead() +* ID2ReplyGetBlobSeqIdsAsnRead() * **************************************************/ NLM_EXTERN -ID2SBioseqInfoPtr LIBCALL -ID2SBioseqInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetBlobSeqIdsPtr LIBCALL +ID2ReplyGetBlobSeqIdsAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2SBioseqInfoPtr ptr; + ID2ReplyGetBlobSeqIdsPtr ptr; if (! loaded) { @@ -5487,17 +3815,17 @@ ID2SBioseqInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SBioseqInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_BIOSEQ_INFO); + if (orig == NULL) { /* ID2ReplyGetBlobSeqIds ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REPLY_GET_BLOB_SEQ_IDS); } else { - atp = AsnLinkType(orig, ID2S_BIOSEQ_INFO); + atp = AsnLinkType(orig, ID2_REPLY_GET_BLOB_SEQ_IDS); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2SBioseqInfoNew(); + ptr = ID2ReplyGetBlobSeqIdsNew(); if (ptr == NULL) { goto erret; } @@ -5508,22 +3836,15 @@ ID2SBioseqInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2S_BIOSEQ_INFO_gap_count) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> gap_count = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == BIOSEQ_INFO_seq_map_has_ref) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == REPLY_GET_BLOB_SEQ_IDS_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } - ptr -> seq_map_has_ref = av.boolvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_BIOSEQ_INFO_sequence_split) { - ptr -> sequence_split = ID2SSequenceSplitInfoAsnRead(aip, atp); + if (atp == ID2_REPLY_GET_BLOB_SEQ_IDS_ids) { + ptr -> ids = ID2ReplyDataAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } @@ -5541,7 +3862,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2SBioseqInfoFree(ptr); + ptr = ID2ReplyGetBlobSeqIdsFree(ptr); goto ret; } @@ -5549,11 +3870,11 @@ erret: /************************************************** * -* ID2SBioseqInfoAsnWrite() +* ID2ReplyGetBlobSeqIdsAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SBioseqInfoAsnWrite(ID2SBioseqInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetBlobSeqIdsAsnWrite(ID2ReplyGetBlobSeqIdsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -5570,7 +3891,7 @@ ID2SBioseqInfoAsnWrite(ID2SBioseqInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2S_BIOSEQ_INFO); /* link local tree */ + atp = AsnLinkType(orig, ID2_REPLY_GET_BLOB_SEQ_IDS); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -5580,177 +3901,16 @@ ID2SBioseqInfoAsnWrite(ID2SBioseqInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - av.intvalue = ptr -> gap_count; - retval = AsnWrite(aip, ID2S_BIOSEQ_INFO_gap_count, &av); - av.boolvalue = ptr -> seq_map_has_ref; - retval = AsnWrite(aip, BIOSEQ_INFO_seq_map_has_ref, &av); - if (ptr -> sequence_split != NULL) { - if ( ! ID2SSequenceSplitInfoAsnWrite(ptr -> sequence_split, aip, ID2S_BIOSEQ_INFO_sequence_split)) { - goto erret; - } - } - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2IdRangeNew() -* -**************************************************/ -NLM_EXTERN -ID2IdRangePtr LIBCALL -ID2IdRangeNew(void) -{ - ID2IdRangePtr ptr = MemNew((size_t) sizeof(ID2IdRange)); - - ptr -> count = 1; - return ptr; - -} - - -/************************************************** -* -* ID2IdRangeFree() -* -**************************************************/ -NLM_EXTERN -ID2IdRangePtr LIBCALL -ID2IdRangeFree(ID2IdRangePtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - return MemFree(ptr); -} - - -/************************************************** -* -* ID2IdRangeAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2IdRangePtr LIBCALL -ID2IdRangeAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2IdRangePtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2IdRange ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_ID_RANGE); - } else { - atp = AsnLinkType(orig, ID2_ID_RANGE); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2IdRangeNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2_ID_RANGE_start) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, REPLY_GET_BLOB_SEQ_IDS_blob_id)) { goto erret; } - ptr -> start = av.intvalue; - atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_ID_RANGE_count) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (ptr -> ids != NULL) { + if ( ! ID2ReplyDataAsnWrite(ptr -> ids, aip, ID2_REPLY_GET_BLOB_SEQ_IDS_ids)) { goto erret; } - ptr -> count = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2IdRangeFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2IdRangeAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2IdRangeAsnWrite(ID2IdRangePtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2_ID_RANGE); /* link local tree */ - if (atp == NULL) { - return FALSE; } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - av.intvalue = ptr -> start; - retval = AsnWrite(aip, ID2_ID_RANGE_start, &av); - av.intvalue = ptr -> count; - retval = AsnWrite(aip, ID2_ID_RANGE_count, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -5765,15 +3925,16 @@ erret: /************************************************** * -* ID2SSequenceSplitInfoNew() +* ID2ReplyGetBlobNew() * **************************************************/ NLM_EXTERN -ID2SSequenceSplitInfoPtr LIBCALL -ID2SSequenceSplitInfoNew(void) +ID2ReplyGetBlobPtr LIBCALL +ID2ReplyGetBlobNew(void) { - ID2SSequenceSplitInfoPtr ptr = MemNew((size_t) sizeof(ID2SSequenceSplitInfo)); + ID2ReplyGetBlobPtr ptr = MemNew((size_t) sizeof(ID2ReplyGetBlob)); + ptr -> split_version = 0; return ptr; } @@ -5781,36 +3942,37 @@ ID2SSequenceSplitInfoNew(void) /************************************************** * -* ID2SSequenceSplitInfoFree() +* ID2ReplyGetBlobFree() * **************************************************/ NLM_EXTERN -ID2SSequenceSplitInfoPtr LIBCALL -ID2SSequenceSplitInfoFree(ID2SSequenceSplitInfoPtr ptr) +ID2ReplyGetBlobPtr LIBCALL +ID2ReplyGetBlobFree(ID2ReplyGetBlobPtr ptr) { if(ptr == NULL) { return NULL; } - AsnGenericBaseSeqOfFree(ptr -> chunk_blocks ,ASNCODE_INTVAL_SLOT); + ID2BlobIdFree(ptr -> blob_id); + ID2ReplyDataFree(ptr -> data); return MemFree(ptr); } /************************************************** * -* ID2SSequenceSplitInfoAsnRead() +* ID2ReplyGetBlobAsnRead() * **************************************************/ NLM_EXTERN -ID2SSequenceSplitInfoPtr LIBCALL -ID2SSequenceSplitInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetBlobPtr LIBCALL +ID2ReplyGetBlobAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2SSequenceSplitInfoPtr ptr; + ID2ReplyGetBlobPtr ptr; if (! loaded) { @@ -5823,17 +3985,17 @@ ID2SSequenceSplitInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SSequenceSplitInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_SEQUENCE_SPLIT_INFO); + if (orig == NULL) { /* ID2ReplyGetBlob ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REPLY_GET_BLOB); } else { - atp = AsnLinkType(orig, ID2S_SEQUENCE_SPLIT_INFO); + atp = AsnLinkType(orig, ID2_REPLY_GET_BLOB); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2SSequenceSplitInfoNew(); + ptr = ID2ReplyGetBlobNew(); if (ptr == NULL) { goto erret; } @@ -5844,23 +4006,23 @@ ID2SSequenceSplitInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == SEQUENCE_SPLIT_INFO_block_size) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == ID2_REPLY_GET_BLOB_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } - ptr -> block_size = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == SPLIT_INFO_chunk_start) { + if (atp == REPLY_GET_BLOB_split_version) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> chunk_start = av.intvalue; + ptr -> split_version = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == SPLIT_INFO_chunk_blocks) { - ptr -> chunk_blocks = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError); - if (isError && ptr -> chunk_blocks == NULL) { + if (atp == ID2_REPLY_GET_BLOB_data) { + ptr -> data = ID2ReplyDataAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -5877,7 +4039,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2SSequenceSplitInfoFree(ptr); + ptr = ID2ReplyGetBlobFree(ptr); goto ret; } @@ -5885,11 +4047,11 @@ erret: /************************************************** * -* ID2SSequenceSplitInfoAsnWrite() +* ID2ReplyGetBlobAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SSequenceSplitInfoAsnWrite(ID2SSequenceSplitInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyGetBlobAsnWrite(ID2ReplyGetBlobPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -5906,7 +4068,7 @@ ID2SSequenceSplitInfoAsnWrite(ID2SSequenceSplitInfoPtr ptr, AsnIoPtr aip, AsnTyp return FALSE; } - atp = AsnLinkType(orig, ID2S_SEQUENCE_SPLIT_INFO); /* link local tree */ + atp = AsnLinkType(orig, ID2_REPLY_GET_BLOB); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -5916,388 +4078,18 @@ ID2SSequenceSplitInfoAsnWrite(ID2SSequenceSplitInfoPtr ptr, AsnIoPtr aip, AsnTyp goto erret; } - av.intvalue = ptr -> block_size; - retval = AsnWrite(aip, SEQUENCE_SPLIT_INFO_block_size, &av); - av.intvalue = ptr -> chunk_start; - retval = AsnWrite(aip, SPLIT_INFO_chunk_start, &av); - retval = AsnGenericBaseSeqOfAsnWrite(ptr -> chunk_blocks ,ASNCODE_INTVAL_SLOT, aip, SPLIT_INFO_chunk_blocks, SPLIT_INFO_chunk_blocks_E); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2SChunkContentFree() -* -**************************************************/ -NLM_EXTERN -ID2SChunkContentPtr LIBCALL -ID2SChunkContentFree(ValNodePtr anp) -{ - Pointer pnt; - - if (anp == NULL) { - return NULL; - } - - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - default: - break; - case ID2SChunkContent_seq_descr: - ID2SSeqDescrInfoFree(anp -> data.ptrvalue); - break; - case ID2SChunkContent_seq_annot: - ID2SSeqAnnotInfoFree(anp -> data.ptrvalue); - break; - case ID2SChunkContent_seq_assembly: - ID2SSeqAssemblyInfoFree(anp -> data.ptrvalue); - break; - case ID2SChunkContent_seq_map: - ID2SeqLocFree(anp -> data.ptrvalue); - break; - case ID2SChunkContent_seq_data: - ID2SeqLocFree(anp -> data.ptrvalue); - break; - } - return MemFree(anp); -} - - -/************************************************** -* -* ID2SChunkContentAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SChunkContentPtr LIBCALL -ID2SChunkContentAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - ValNodePtr anp; - Uint1 choice; - Boolean isError = FALSE; - Boolean nullIsError = FALSE; - AsnReadFunc func; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SChunkContent ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_CHUNK_CONTENT); - } else { - atp = AsnLinkType(orig, ID2S_CHUNK_CONTENT); /* link in local tree */ - } - if (atp == NULL) { - return NULL; - } - - anp = ValNodeNew(NULL); - if (anp == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ - goto erret; - } - - func = NULL; - - atp = AsnReadId(aip, amp, atp); /* find the choice */ - if (atp == NULL) { - goto erret; - } - if (atp == ID2S_CHUNK_CONTENT_seq_descr) { - choice = ID2SChunkContent_seq_descr; - func = (AsnReadFunc) ID2SSeqDescrInfoAsnRead; - } - else if (atp == ID2S_CHUNK_CONTENT_seq_annot) { - choice = ID2SChunkContent_seq_annot; - func = (AsnReadFunc) ID2SSeqAnnotInfoAsnRead; - } - else if (atp == ID2S_CHUNK_CONTENT_seq_assembly) { - choice = ID2SChunkContent_seq_assembly; - func = (AsnReadFunc) ID2SSeqAssemblyInfoAsnRead; - } - else if (atp == ID2S_CHUNK_CONTENT_seq_map) { - choice = ID2SChunkContent_seq_map; - func = (AsnReadFunc) ID2SeqLocAsnRead; - } - else if (atp == ID2S_CHUNK_CONTENT_seq_data) { - choice = ID2SChunkContent_seq_data; - func = (AsnReadFunc) ID2SeqLocAsnRead; - } - anp->choice = choice; - if (func != NULL) - { - anp->data.ptrvalue = (* func)(aip, atp); - if (aip -> io_failure) goto erret; - - if (nullIsError && anp->data.ptrvalue == NULL) { - goto erret; - } - } - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return anp; - -erret: - anp = MemFree(anp); - aip -> io_failure = TRUE; - goto ret; -} - - -/************************************************** -* -* ID2SChunkContentAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SChunkContentAsnWrite(ID2SChunkContentPtr anp, AsnIoPtr aip, AsnTypePtr orig) - -{ - DataVal av; - AsnTypePtr atp, writetype = NULL; - Pointer pnt; - AsnWriteFunc func = NULL; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) - return FALSE; - } - - if (aip == NULL) - return FALSE; - - atp = AsnLinkType(orig, ID2S_CHUNK_CONTENT); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - - av.ptrvalue = (Pointer)anp; - if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { - goto erret; - } - - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - case ID2SChunkContent_seq_descr: - writetype = ID2S_CHUNK_CONTENT_seq_descr; - func = (AsnWriteFunc) ID2SSeqDescrInfoAsnWrite; - break; - case ID2SChunkContent_seq_annot: - writetype = ID2S_CHUNK_CONTENT_seq_annot; - func = (AsnWriteFunc) ID2SSeqAnnotInfoAsnWrite; - break; - case ID2SChunkContent_seq_assembly: - writetype = ID2S_CHUNK_CONTENT_seq_assembly; - func = (AsnWriteFunc) ID2SSeqAssemblyInfoAsnWrite; - break; - case ID2SChunkContent_seq_map: - writetype = ID2S_CHUNK_CONTENT_seq_map; - func = (AsnWriteFunc) ID2SeqLocAsnWrite; - break; - case ID2SChunkContent_seq_data: - writetype = ID2S_CHUNK_CONTENT_seq_data; - func = (AsnWriteFunc) ID2SeqLocAsnWrite; - break; - } - if (writetype != NULL) { - retval = (* func)(pnt, aip, writetype); /* write it out */ - } - if (!retval) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - -/************************************************** -* -* ID2SSeqDescrInfoNew() -* -**************************************************/ -NLM_EXTERN -ID2SSeqDescrInfoPtr LIBCALL -ID2SSeqDescrInfoNew(void) -{ - ID2SSeqDescrInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqDescrInfo)); - - return ptr; - -} - - -/************************************************** -* -* ID2SSeqDescrInfoFree() -* -**************************************************/ -NLM_EXTERN -ID2SSeqDescrInfoPtr LIBCALL -ID2SSeqDescrInfoFree(ID2SSeqDescrInfoPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); - AsnGenericUserSeqOfFree(ptr -> bioseq_sets, (AsnOptFreeFunc) ID2IdRangeFree); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2SSeqDescrInfoAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SSeqDescrInfoPtr LIBCALL -ID2SSeqDescrInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2SSeqDescrInfoPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SSeqDescrInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_SEQ_DESCR_INFO); - } else { - atp = AsnLinkType(orig, ID2S_SEQ_DESCR_INFO); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2SSeqDescrInfoNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2S_SEQ_DESCR_INFO_type_mask) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, ID2_REPLY_GET_BLOB_blob_id)) { goto erret; } - ptr -> type_mask = av.intvalue; - atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_SEQ_DESCR_INFO_bioseqs) { - ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseqs == NULL) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_SEQ_DESCR_INFO_bioseq_sets) { - ptr -> bioseq_sets = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseq_sets == NULL) { + av.intvalue = ptr -> split_version; + retval = AsnWrite(aip, REPLY_GET_BLOB_split_version, &av); + if (ptr -> data != NULL) { + if ( ! ID2ReplyDataAsnWrite(ptr -> data, aip, ID2_REPLY_GET_BLOB_data)) { goto erret; } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2SSeqDescrInfoFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2SSeqDescrInfoAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SSeqDescrInfoAsnWrite(ID2SSeqDescrInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2S_SEQ_DESCR_INFO); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - av.intvalue = ptr -> type_mask; - retval = AsnWrite(aip, ID2S_SEQ_DESCR_INFO_type_mask, &av); - AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_DESCR_INFO_bioseqs, ID2S_SEQ_DESCR_INFO_bioseqs_E); - AsnGenericUserSeqOfAsnWrite(ptr -> bioseq_sets, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_DESCR_INFO_bioseq_sets, SEQ_DESCR_INFO_bioseq_sets_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -6312,14 +4104,14 @@ erret: /************************************************** * -* ID2SSeqAnnotInfoNew() +* ID2ReplyReGetBlobNew() * **************************************************/ NLM_EXTERN -ID2SSeqAnnotInfoPtr LIBCALL -ID2SSeqAnnotInfoNew(void) +ID2ReplyReGetBlobPtr LIBCALL +ID2ReplyReGetBlobNew(void) { - ID2SSeqAnnotInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqAnnotInfo)); + ID2ReplyReGetBlobPtr ptr = MemNew((size_t) sizeof(ID2ReplyReGetBlob)); return ptr; @@ -6328,38 +4120,37 @@ ID2SSeqAnnotInfoNew(void) /************************************************** * -* ID2SSeqAnnotInfoFree() +* ID2ReplyReGetBlobFree() * **************************************************/ NLM_EXTERN -ID2SSeqAnnotInfoPtr LIBCALL -ID2SSeqAnnotInfoFree(ID2SSeqAnnotInfoPtr ptr) +ID2ReplyReGetBlobPtr LIBCALL +ID2ReplyReGetBlobFree(ID2ReplyReGetBlobPtr ptr) { if(ptr == NULL) { return NULL; } - MemFree(ptr -> name); - AsnGenericUserSeqOfFree(ptr -> feat, (AsnOptFreeFunc) ID2SFeatTypeInfoFree); - ID2SeqLocFree(ptr -> seq_loc); + ID2BlobIdFree(ptr -> blob_id); + ID2ReplyDataFree(ptr -> data); return MemFree(ptr); } /************************************************** * -* ID2SSeqAnnotInfoAsnRead() +* ID2ReplyReGetBlobAsnRead() * **************************************************/ NLM_EXTERN -ID2SSeqAnnotInfoPtr LIBCALL -ID2SSeqAnnotInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyReGetBlobPtr LIBCALL +ID2ReplyReGetBlobAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2SSeqAnnotInfoPtr ptr; + ID2ReplyReGetBlobPtr ptr; if (! loaded) { @@ -6372,17 +4163,17 @@ ID2SSeqAnnotInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SSeqAnnotInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_SEQ_ANNOT_INFO); + if (orig == NULL) { /* ID2ReplyReGetBlob ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REPLY_REGET_BLOB); } else { - atp = AsnLinkType(orig, ID2S_SEQ_ANNOT_INFO); + atp = AsnLinkType(orig, ID2_REPLY_REGET_BLOB); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2SSeqAnnotInfoNew(); + ptr = ID2ReplyReGetBlobNew(); if (ptr == NULL) { goto erret; } @@ -6393,36 +4184,29 @@ ID2SSeqAnnotInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2S_SEQ_ANNOT_INFO_name) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == ID2_REPLY_REGET_BLOB_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } - ptr -> name = av.ptrvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_SEQ_ANNOT_INFO_align) { + if (atp == REPLY_REGET_BLOB_split_version) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> align = av.boolvalue; + ptr -> split_version = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_SEQ_ANNOT_INFO_graph) { + if (atp == ID2_REPLY_REGET_BLOB_offset) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> graph = av.boolvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_SEQ_ANNOT_INFO_feat) { - ptr -> feat = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SFeatTypeInfoAsnRead, (AsnOptFreeFunc) ID2SFeatTypeInfoFree); - if (isError && ptr -> feat == NULL) { - goto erret; - } + ptr -> offset = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_SEQ_ANNOT_INFO_seq_loc) { - ptr -> seq_loc = ID2SeqLocAsnRead(aip, atp); + if (atp == ID2_REPLY_REGET_BLOB_data) { + ptr -> data = ID2ReplyDataAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } @@ -6440,7 +4224,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2SSeqAnnotInfoFree(ptr); + ptr = ID2ReplyReGetBlobFree(ptr); goto ret; } @@ -6448,11 +4232,11 @@ erret: /************************************************** * -* ID2SSeqAnnotInfoAsnWrite() +* ID2ReplyReGetBlobAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SSeqAnnotInfoAsnWrite(ID2SSeqAnnotInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyReGetBlobAsnWrite(ID2ReplyReGetBlobPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -6469,7 +4253,7 @@ ID2SSeqAnnotInfoAsnWrite(ID2SSeqAnnotInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2S_SEQ_ANNOT_INFO); /* link local tree */ + atp = AsnLinkType(orig, ID2_REPLY_REGET_BLOB); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -6479,17 +4263,17 @@ ID2SSeqAnnotInfoAsnWrite(ID2SSeqAnnotInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - if (ptr -> name != NULL) { - av.ptrvalue = ptr -> name; - retval = AsnWrite(aip, ID2S_SEQ_ANNOT_INFO_name, &av); - } - av.boolvalue = ptr -> align; - retval = AsnWrite(aip, ID2S_SEQ_ANNOT_INFO_align, &av); - av.boolvalue = ptr -> graph; - retval = AsnWrite(aip, ID2S_SEQ_ANNOT_INFO_graph, &av); - AsnGenericUserSeqOfAsnWrite(ptr -> feat, (AsnWriteFunc) ID2SFeatTypeInfoAsnWrite, aip, ID2S_SEQ_ANNOT_INFO_feat, ID2S_SEQ_ANNOT_INFO_feat_E); - if (ptr -> seq_loc != NULL) { - if ( ! ID2SeqLocAsnWrite(ptr -> seq_loc, aip, ID2S_SEQ_ANNOT_INFO_seq_loc)) { + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, ID2_REPLY_REGET_BLOB_blob_id)) { + goto erret; + } + } + av.intvalue = ptr -> split_version; + retval = AsnWrite(aip, REPLY_REGET_BLOB_split_version, &av); + av.intvalue = ptr -> offset; + retval = AsnWrite(aip, ID2_REPLY_REGET_BLOB_offset, &av); + if (ptr -> data != NULL) { + if ( ! ID2ReplyDataAsnWrite(ptr -> data, aip, ID2_REPLY_REGET_BLOB_data)) { goto erret; } } @@ -6507,14 +4291,14 @@ erret: /************************************************** * -* ID2SSeqAssemblyInfoNew() +* ID2SReplyGetSplitInfoNew() * **************************************************/ NLM_EXTERN -ID2SSeqAssemblyInfoPtr LIBCALL -ID2SSeqAssemblyInfoNew(void) +ID2SReplyGetSplitInfoPtr LIBCALL +ID2SReplyGetSplitInfoNew(void) { - ID2SSeqAssemblyInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqAssemblyInfo)); + ID2SReplyGetSplitInfoPtr ptr = MemNew((size_t) sizeof(ID2SReplyGetSplitInfo)); return ptr; @@ -6523,36 +4307,37 @@ ID2SSeqAssemblyInfoNew(void) /************************************************** * -* ID2SSeqAssemblyInfoFree() +* ID2SReplyGetSplitInfoFree() * **************************************************/ NLM_EXTERN -ID2SSeqAssemblyInfoPtr LIBCALL -ID2SSeqAssemblyInfoFree(ID2SSeqAssemblyInfoPtr ptr) +ID2SReplyGetSplitInfoPtr LIBCALL +ID2SReplyGetSplitInfoFree(ID2SReplyGetSplitInfoPtr ptr) { if(ptr == NULL) { return NULL; } - AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); + ID2BlobIdFree(ptr -> blob_id); + ID2ReplyDataFree(ptr -> data); return MemFree(ptr); } /************************************************** * -* ID2SSeqAssemblyInfoAsnRead() +* ID2SReplyGetSplitInfoAsnRead() * **************************************************/ NLM_EXTERN -ID2SSeqAssemblyInfoPtr LIBCALL -ID2SSeqAssemblyInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2SReplyGetSplitInfoPtr LIBCALL +ID2SReplyGetSplitInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2SSeqAssemblyInfoPtr ptr; + ID2SReplyGetSplitInfoPtr ptr; if (! loaded) { @@ -6565,17 +4350,17 @@ ID2SSeqAssemblyInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SSeqAssemblyInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_SEQ_ASSEMBLY_INFO); + if (orig == NULL) { /* ID2SReplyGetSplitInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_REPLY_GET_SPLIT_INFO); } else { - atp = AsnLinkType(orig, ID2S_SEQ_ASSEMBLY_INFO); + atp = AsnLinkType(orig, ID2S_REPLY_GET_SPLIT_INFO); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2SSeqAssemblyInfoNew(); + ptr = ID2SReplyGetSplitInfoNew(); if (ptr == NULL) { goto erret; } @@ -6586,168 +4371,23 @@ ID2SSeqAssemblyInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2S_SEQ_ASSEMBLY_INFO_bioseqs) { - ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); - if (isError && ptr -> bioseqs == NULL) { + if (atp == REPLY_GET_SPLIT_INFO_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2SSeqAssemblyInfoFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2SSeqAssemblyInfoAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SSeqAssemblyInfoAsnWrite(ID2SSeqAssemblyInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; - } - } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2S_SEQ_ASSEMBLY_INFO); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_ASSEMBLY_INFO_bioseqs, SEQ_ASSEMBLY_INFO_bioseqs_E); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2SFeatTypeInfoNew() -* -**************************************************/ -NLM_EXTERN -ID2SFeatTypeInfoPtr LIBCALL -ID2SFeatTypeInfoNew(void) -{ - ID2SFeatTypeInfoPtr ptr = MemNew((size_t) sizeof(ID2SFeatTypeInfo)); - - return ptr; - -} - - -/************************************************** -* -* ID2SFeatTypeInfoFree() -* -**************************************************/ -NLM_EXTERN -ID2SFeatTypeInfoPtr LIBCALL -ID2SFeatTypeInfoFree(ID2SFeatTypeInfoPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - AsnGenericBaseSeqOfFree(ptr -> subtypes ,ASNCODE_INTVAL_SLOT); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2SFeatTypeInfoAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SFeatTypeInfoPtr LIBCALL -ID2SFeatTypeInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2SFeatTypeInfoPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SFeatTypeInfo ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_FEAT_TYPE_INFO); - } else { - atp = AsnLinkType(orig, ID2S_FEAT_TYPE_INFO); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2SFeatTypeInfoNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2S_FEAT_TYPE_INFO_type) { + if (atp == GET_SPLIT_INFO_split_version) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> type = av.intvalue; + ptr -> split_version = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_FEAT_TYPE_INFO_subtypes) { - ptr -> subtypes = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError); - if (isError && ptr -> subtypes == NULL) { + if (atp == ID2S_REPLY_GET_SPLIT_INFO_data) { + ptr -> data = ID2ReplyDataAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -6764,7 +4404,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2SFeatTypeInfoFree(ptr); + ptr = ID2SReplyGetSplitInfoFree(ptr); goto ret; } @@ -6772,11 +4412,11 @@ erret: /************************************************** * -* ID2SFeatTypeInfoAsnWrite() +* ID2SReplyGetSplitInfoAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SFeatTypeInfoAsnWrite(ID2SFeatTypeInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2SReplyGetSplitInfoAsnWrite(ID2SReplyGetSplitInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -6793,7 +4433,7 @@ ID2SFeatTypeInfoAsnWrite(ID2SFeatTypeInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2S_FEAT_TYPE_INFO); /* link local tree */ + atp = AsnLinkType(orig, ID2S_REPLY_GET_SPLIT_INFO); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -6803,161 +4443,18 @@ ID2SFeatTypeInfoAsnWrite(ID2SFeatTypeInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - av.intvalue = ptr -> type; - retval = AsnWrite(aip, ID2S_FEAT_TYPE_INFO_type, &av); - retval = AsnGenericBaseSeqOfAsnWrite(ptr -> subtypes ,ASNCODE_INTVAL_SLOT, aip, ID2S_FEAT_TYPE_INFO_subtypes, ID2S_FEAT_TYPE_INFO_subtypes_E); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - - -/************************************************** -* -* ID2SChunkNew() -* -**************************************************/ -NLM_EXTERN -ID2SChunkPtr LIBCALL -ID2SChunkNew(void) -{ - ID2SChunkPtr ptr = MemNew((size_t) sizeof(ID2SChunk)); - - return ptr; - -} - - -/************************************************** -* -* ID2SChunkFree() -* -**************************************************/ -NLM_EXTERN -ID2SChunkPtr LIBCALL -ID2SChunkFree(ID2SChunkPtr ptr) -{ - - if(ptr == NULL) { - return NULL; - } - AsnGenericUserSeqOfFree(ptr -> data, (AsnOptFreeFunc) ID2SChunkDataFree); - return MemFree(ptr); -} - - -/************************************************** -* -* ID2SChunkAsnRead() -* -**************************************************/ -NLM_EXTERN -ID2SChunkPtr LIBCALL -ID2SChunkAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean isError = FALSE; - AsnReadFunc func; - ID2SChunkPtr ptr; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* ID2SChunk ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_CHUNK); - } else { - atp = AsnLinkType(orig, ID2S_CHUNK); - } - /* link in local tree */ - if (atp == NULL) { - return NULL; - } - - ptr = ID2SChunkNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); - func = NULL; - - if (atp == ID2S_CHUNK_data) { - ptr -> data = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SChunkDataAsnRead, (AsnOptFreeFunc) ID2SChunkDataFree); - if (isError && ptr -> data == NULL) { + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, REPLY_GET_SPLIT_INFO_blob_id)) { goto erret; } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; } - /* end struct */ - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return ptr; - -erret: - aip -> io_failure = TRUE; - ptr = ID2SChunkFree(ptr); - goto ret; -} - - - -/************************************************** -* -* ID2SChunkAsnWrite() -* -**************************************************/ -NLM_EXTERN Boolean LIBCALL -ID2SChunkAsnWrite(ID2SChunkPtr ptr, AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return FALSE; + av.intvalue = ptr -> split_version; + retval = AsnWrite(aip, GET_SPLIT_INFO_split_version, &av); + if (ptr -> data != NULL) { + if ( ! ID2ReplyDataAsnWrite(ptr -> data, aip, ID2S_REPLY_GET_SPLIT_INFO_data)) { + goto erret; } } - - if (aip == NULL) { - return FALSE; - } - - atp = AsnLinkType(orig, ID2S_CHUNK); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - AsnGenericUserSeqOfAsnWrite(ptr -> data, (AsnWriteFunc) ID2SChunkDataAsnWrite, aip, ID2S_CHUNK_data, ID2S_CHUNK_data_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -6972,14 +4469,14 @@ erret: /************************************************** * -* ID2SChunkDataNew() +* ID2SReplyGetChunkNew() * **************************************************/ NLM_EXTERN -ID2SChunkDataPtr LIBCALL -ID2SChunkDataNew(void) +ID2SReplyGetChunkPtr LIBCALL +ID2SReplyGetChunkNew(void) { - ID2SChunkDataPtr ptr = MemNew((size_t) sizeof(ID2SChunkData)); + ID2SReplyGetChunkPtr ptr = MemNew((size_t) sizeof(ID2SReplyGetChunk)); return ptr; @@ -6988,66 +4485,37 @@ ID2SChunkDataNew(void) /************************************************** * -* ID2SChunkDataFree() +* ID2SReplyGetChunkFree() * **************************************************/ NLM_EXTERN -ID2SChunkDataPtr LIBCALL -ID2SChunkDataFree(ID2SChunkDataPtr ptr) +ID2SReplyGetChunkPtr LIBCALL +ID2SReplyGetChunkFree(ID2SReplyGetChunkPtr ptr) { if(ptr == NULL) { return NULL; } - Id_idFree(ptr -> Id_id); - AsnGenericChoiceSeqOfFree(ptr -> descrs, (AsnOptFreeFunc) SeqDescrFree); - AsnGenericUserSeqOfFree(ptr -> annots, (AsnOptFreeFunc) SeqAnnotFree); - AsnGenericUserSeqOfFree(ptr -> assembly, (AsnOptFreeFunc) SeqAlignFree); - AsnGenericUserSeqOfFree(ptr -> seq_map, (AsnOptFreeFunc) SeqLiteralFree); - AsnGenericUserSeqOfFree(ptr -> seq_data, (AsnOptFreeFunc) SeqLiteralFree); + ID2BlobIdFree(ptr -> blob_id); + ID2ReplyDataFree(ptr -> data); return MemFree(ptr); } /************************************************** * -* Id_idFree() -* -**************************************************/ -static -Id_idPtr LIBCALL -Id_idFree(ValNodePtr anp) -{ - Pointer pnt; - - if (anp == NULL) { - return NULL; - } - - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - default: - break; - } - return MemFree(anp); -} - - -/************************************************** -* -* ID2SChunkDataAsnRead() +* ID2SReplyGetChunkAsnRead() * **************************************************/ NLM_EXTERN -ID2SChunkDataPtr LIBCALL -ID2SChunkDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2SReplyGetChunkPtr LIBCALL +ID2SReplyGetChunkAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2SChunkDataPtr ptr; + ID2SReplyGetChunkPtr ptr; if (! loaded) { @@ -7060,17 +4528,17 @@ ID2SChunkDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SChunkData ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_CHUNK_DATA); + if (orig == NULL) { /* ID2SReplyGetChunk ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_REPLY_GET_CHUNK); } else { - atp = AsnLinkType(orig, ID2S_CHUNK_DATA); + atp = AsnLinkType(orig, ID2S_REPLY_GET_CHUNK); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2SChunkDataNew(); + ptr = ID2SReplyGetChunkNew(); if (ptr == NULL) { goto erret; } @@ -7081,44 +4549,23 @@ ID2SChunkDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2S_CHUNK_DATA_id) { - ptr -> Id_id = Id_idAsnRead(aip, atp); + if (atp == ID2S_REPLY_GET_CHUNK_blob_id) { + ptr -> blob_id = ID2BlobIdAsnRead(aip, atp); if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_CHUNK_DATA_descrs) { - ptr -> descrs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqDescrAsnRead, (AsnOptFreeFunc) SeqDescrFree); - if (isError && ptr -> descrs == NULL) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_CHUNK_DATA_annots) { - ptr -> annots = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqAnnotAsnRead, (AsnOptFreeFunc) SeqAnnotFree); - if (isError && ptr -> annots == NULL) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_CHUNK_DATA_assembly) { - ptr -> assembly = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqAlignAsnRead, (AsnOptFreeFunc) SeqAlignFree); - if (isError && ptr -> assembly == NULL) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2S_CHUNK_DATA_seq_map) { - ptr -> seq_map = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLiteralAsnRead, (AsnOptFreeFunc) SeqLiteralFree); - if (isError && ptr -> seq_map == NULL) { + if (atp == ID2S_REPLY_GET_CHUNK_chunk_id) { + if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } + ptr -> chunk_id = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2S_CHUNK_DATA_seq_data) { - ptr -> seq_data = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLiteralAsnRead, (AsnOptFreeFunc) SeqLiteralFree); - if (isError && ptr -> seq_data == NULL) { + if (atp == ID2S_REPLY_GET_CHUNK_data) { + ptr -> data = ID2ReplyDataAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } atp = AsnReadId(aip,amp, atp); @@ -7135,7 +4582,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2SChunkDataFree(ptr); + ptr = ID2SReplyGetChunkFree(ptr); goto ret; } @@ -7143,98 +4590,11 @@ erret: /************************************************** * -* Id_idAsnRead() -* -**************************************************/ -static -Id_idPtr LIBCALL -Id_idAsnRead(AsnIoPtr aip, AsnTypePtr orig) -{ - DataVal av; - AsnTypePtr atp; - ValNodePtr anp; - Uint1 choice; - Boolean isError = FALSE; - Boolean nullIsError = FALSE; - AsnReadFunc func; - - if (! loaded) - { - if (! id2genAsnLoad()) { - return NULL; - } - } - - if (aip == NULL) { - return NULL; - } - - if (orig == NULL) { /* Id_id ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2S_CHUNK_DATA_id); - } else { - atp = AsnLinkType(orig, ID2S_CHUNK_DATA_id); /* link in local tree */ - } - if (atp == NULL) { - return NULL; - } - - anp = ValNodeNew(NULL); - if (anp == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ - goto erret; - } - - func = NULL; - - atp = AsnReadId(aip, amp, atp); /* find the choice */ - if (atp == NULL) { - goto erret; - } - if (atp == ID2S_CHUNK_DATA_id_bioseq_set) { - choice = Id_id_bioseq_set; - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - anp->data.intvalue = av.intvalue; - } - else if (atp == ID2S_CHUNK_DATA_id_gi) { - choice = Id_id_gi; - if (AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - anp->data.intvalue = av.intvalue; - } - anp->choice = choice; - if (func != NULL) - { - anp->data.ptrvalue = (* func)(aip, atp); - if (aip -> io_failure) goto erret; - - if (nullIsError && anp->data.ptrvalue == NULL) { - goto erret; - } - } - -ret: - AsnUnlinkType(orig); /* unlink local tree */ - return anp; - -erret: - anp = MemFree(anp); - aip -> io_failure = TRUE; - goto ret; -} - - -/************************************************** -* -* ID2SChunkDataAsnWrite() +* ID2SReplyGetChunkAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SChunkDataAsnWrite(ID2SChunkDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2SReplyGetChunkAsnWrite(ID2SReplyGetChunkPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -7251,7 +4611,7 @@ ID2SChunkDataAsnWrite(ID2SChunkDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2S_CHUNK_DATA); /* link local tree */ + atp = AsnLinkType(orig, ID2S_REPLY_GET_CHUNK); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -7261,16 +4621,18 @@ ID2SChunkDataAsnWrite(ID2SChunkDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - if (ptr -> Id_id != NULL) { - if ( ! Id_idAsnWrite(ptr -> Id_id, aip, ID2S_CHUNK_DATA_id)) { + if (ptr -> blob_id != NULL) { + if ( ! ID2BlobIdAsnWrite(ptr -> blob_id, aip, ID2S_REPLY_GET_CHUNK_blob_id)) { + goto erret; + } + } + av.intvalue = ptr -> chunk_id; + retval = AsnWrite(aip, ID2S_REPLY_GET_CHUNK_chunk_id, &av); + if (ptr -> data != NULL) { + if ( ! ID2ReplyDataAsnWrite(ptr -> data, aip, ID2S_REPLY_GET_CHUNK_data)) { goto erret; } } - AsnGenericChoiceSeqOfAsnWrite(ptr -> descrs, (AsnWriteFunc) SeqDescrAsnWrite, aip, ID2S_CHUNK_DATA_descrs, ID2S_CHUNK_DATA_descrs_E); - AsnGenericUserSeqOfAsnWrite(ptr -> annots, (AsnWriteFunc) SeqAnnotAsnWrite, aip, ID2S_CHUNK_DATA_annots, ID2S_CHUNK_DATA_annots_E); - AsnGenericUserSeqOfAsnWrite(ptr -> assembly, (AsnWriteFunc) SeqAlignAsnWrite, aip, ID2S_CHUNK_DATA_assembly, ID2S_CHUNK_DATA_assembly_E); - AsnGenericUserSeqOfAsnWrite(ptr -> seq_map, (AsnWriteFunc) SeqLiteralAsnWrite, aip, ID2S_CHUNK_DATA_seq_map, ID2S_CHUNK_DATA_seq_map_E); - AsnGenericUserSeqOfAsnWrite(ptr -> seq_data, (AsnWriteFunc) SeqLiteralAsnWrite, aip, ID2S_CHUNK_DATA_seq_data, ID2S_CHUNK_DATA_seq_data_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -7285,78 +4647,18 @@ erret: /************************************************** * -* Id_idAsnWrite() -* -**************************************************/ -static Boolean LIBCALL -Id_idAsnWrite(Id_idPtr anp, AsnIoPtr aip, AsnTypePtr orig) - -{ - DataVal av; - AsnTypePtr atp, writetype = NULL; - Pointer pnt; - AsnWriteFunc func = NULL; - Boolean retval = FALSE; - - if (! loaded) - { - if (! id2genAsnLoad()) - return FALSE; - } - - if (aip == NULL) - return FALSE; - - atp = AsnLinkType(orig, ID2S_CHUNK_DATA_id); /* link local tree */ - if (atp == NULL) { - return FALSE; - } - - if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - - av.ptrvalue = (Pointer)anp; - if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { - goto erret; - } - - pnt = anp->data.ptrvalue; - switch (anp->choice) - { - case Id_id_bioseq_set: - av.intvalue = anp->data.intvalue; - retval = AsnWrite(aip, ID2S_CHUNK_DATA_id_bioseq_set, &av); - break; - case Id_id_gi: - av.intvalue = anp->data.intvalue; - retval = AsnWrite(aip, ID2S_CHUNK_DATA_id_gi, &av); - break; - } - if (writetype != NULL) { - retval = (* func)(pnt, aip, writetype); /* write it out */ - } - if (!retval) { - goto erret; - } - retval = TRUE; - -erret: - AsnUnlinkType(orig); /* unlink local tree */ - return retval; -} - - -/************************************************** -* -* ID2IntervalNew() +* ID2ReplyDataNew() * **************************************************/ NLM_EXTERN -ID2IntervalPtr LIBCALL -ID2IntervalNew(void) +ID2ReplyDataPtr LIBCALL +ID2ReplyDataNew(void) { - ID2IntervalPtr ptr = MemNew((size_t) sizeof(ID2Interval)); + ID2ReplyDataPtr ptr = MemNew((size_t) sizeof(ID2ReplyData)); - ptr -> length = 1; + ptr -> data_type = 0; + ptr -> data_format = 0; + ptr -> data_compression = 0; return ptr; } @@ -7364,35 +4666,36 @@ ID2IntervalNew(void) /************************************************** * -* ID2IntervalFree() +* ID2ReplyDataFree() * **************************************************/ NLM_EXTERN -ID2IntervalPtr LIBCALL -ID2IntervalFree(ID2IntervalPtr ptr) +ID2ReplyDataPtr LIBCALL +ID2ReplyDataFree(ID2ReplyDataPtr ptr) { if(ptr == NULL) { return NULL; } + AsnGenericBaseSeqOfFree(ptr -> data ,ASNCODE_BYTEVAL_SLOT); return MemFree(ptr); } /************************************************** * -* ID2IntervalAsnRead() +* ID2ReplyDataAsnRead() * **************************************************/ NLM_EXTERN -ID2IntervalPtr LIBCALL -ID2IntervalAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyDataPtr LIBCALL +ID2ReplyDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2IntervalPtr ptr; + ID2ReplyDataPtr ptr; if (! loaded) { @@ -7405,17 +4708,17 @@ ID2IntervalAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2Interval ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_INTERVAL); + if (orig == NULL) { /* ID2ReplyData ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_REPLY_DATA); } else { - atp = AsnLinkType(orig, ID2_INTERVAL); + atp = AsnLinkType(orig, ID2_REPLY_DATA); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2IntervalNew(); + ptr = ID2ReplyDataNew(); if (ptr == NULL) { goto erret; } @@ -7426,25 +4729,32 @@ ID2IntervalAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_INTERVAL_gi) { + if (atp == ID2_REPLY_DATA_data_type) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> gi = av.intvalue; + ptr -> data_type = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_INTERVAL_start) { + if (atp == ID2_REPLY_DATA_data_format) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> start = av.intvalue; + ptr -> data_format = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_INTERVAL_length) { + if (atp == ID2_REPLY_DATA_data_compression) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> length = av.intvalue; + ptr -> data_compression = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2_REPLY_DATA_data) { + ptr -> data = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_BYTEVAL_SLOT, &isError); + if (isError && ptr -> data == NULL) { + goto erret; + } atp = AsnReadId(aip,amp, atp); } @@ -7459,7 +4769,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2IntervalFree(ptr); + ptr = ID2ReplyDataFree(ptr); goto ret; } @@ -7467,11 +4777,11 @@ erret: /************************************************** * -* ID2IntervalAsnWrite() +* ID2ReplyDataAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2IntervalAsnWrite(ID2IntervalPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2ReplyDataAsnWrite(ID2ReplyDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -7488,7 +4798,7 @@ ID2IntervalAsnWrite(ID2IntervalPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_INTERVAL); /* link local tree */ + atp = AsnLinkType(orig, ID2_REPLY_DATA); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -7498,12 +4808,13 @@ ID2IntervalAsnWrite(ID2IntervalPtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - av.intvalue = ptr -> gi; - retval = AsnWrite(aip, ID2_INTERVAL_gi, &av); - av.intvalue = ptr -> start; - retval = AsnWrite(aip, ID2_INTERVAL_start, &av); - av.intvalue = ptr -> length; - retval = AsnWrite(aip, ID2_INTERVAL_length, &av); + av.intvalue = ptr -> data_type; + retval = AsnWrite(aip, ID2_REPLY_DATA_data_type, &av); + av.intvalue = ptr -> data_format; + retval = AsnWrite(aip, ID2_REPLY_DATA_data_format, &av); + av.intvalue = ptr -> data_compression; + retval = AsnWrite(aip, ID2_REPLY_DATA_data_compression, &av); + retval = AsnGenericBaseSeqOfAsnWrite(ptr -> data ,ASNCODE_BYTEVAL_SLOT, aip, ID2_REPLY_DATA_data, ID2_REPLY_DATA_data_E); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } @@ -7518,52 +4829,36 @@ erret: /************************************************** * -* ID2PackedSeqIntsNew() -* -**************************************************/ -NLM_EXTERN -ID2PackedSeqIntsPtr LIBCALL -ID2PackedSeqIntsNew(void) -{ - ID2PackedSeqIntsPtr ptr = MemNew((size_t) sizeof(ID2PackedSeqInts)); - - return ptr; - -} - - -/************************************************** -* -* ID2PackedSeqIntsFree() +* ID2BlobSeqIdsFree() * **************************************************/ NLM_EXTERN -ID2PackedSeqIntsPtr LIBCALL -ID2PackedSeqIntsFree(ID2PackedSeqIntsPtr ptr) +ID2BlobSeqIdsPtr LIBCALL +ID2BlobSeqIdsFree(ID2BlobSeqIdsPtr ptr) { if(ptr == NULL) { return NULL; } - AsnGenericUserSeqOfFree(ptr -> ints, (AsnOptFreeFunc) ID2SeqRangeFree); - return MemFree(ptr); + AsnGenericUserSeqOfFree(ptr, (AsnOptFreeFunc) ID2BlobSeqIdFree); + return NULL; } /************************************************** * -* ID2PackedSeqIntsAsnRead() +* ID2BlobSeqIdsAsnRead() * **************************************************/ NLM_EXTERN -ID2PackedSeqIntsPtr LIBCALL -ID2PackedSeqIntsAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2BlobSeqIdsPtr LIBCALL +ID2BlobSeqIdsAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2PackedSeqIntsPtr ptr; + ID2BlobSeqIdsPtr ptr; if (! loaded) { @@ -7576,46 +4871,24 @@ ID2PackedSeqIntsAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2PackedSeqInts ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_PACKED_SEQ_INTS); + if (orig == NULL) { /* ID2BlobSeqIds ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_BLOB_SEQ_IDS); } else { - atp = AsnLinkType(orig, ID2_PACKED_SEQ_INTS); + atp = AsnLinkType(orig, ID2_BLOB_SEQ_IDS); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2PackedSeqIntsNew(); - if (ptr == NULL) { - goto erret; - } - if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ - goto erret; - } - - atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_PACKED_SEQ_INTS_gi) { - if ( AsnReadVal(aip, atp, &av) <= 0) { - goto erret; - } - ptr -> gi = av.intvalue; - atp = AsnReadId(aip,amp, atp); - } - if (atp == ID2_PACKED_SEQ_INTS_ints) { - ptr -> ints = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SeqRangeAsnRead, (AsnOptFreeFunc) ID2SeqRangeFree); - if (isError && ptr -> ints == NULL) { - goto erret; - } - atp = AsnReadId(aip,amp, atp); - } - - if (AsnReadVal(aip, atp, &av) <= 0) { + ptr = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2BlobSeqIdAsnRead, (AsnOptFreeFunc) ID2BlobSeqIdFree); + if (isError && ptr == NULL) { goto erret; } - /* end struct */ + + ret: AsnUnlinkType(orig); /* unlink local tree */ @@ -7623,7 +4896,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2PackedSeqIntsFree(ptr); + ptr = ID2BlobSeqIdsFree(ptr); goto ret; } @@ -7631,11 +4904,11 @@ erret: /************************************************** * -* ID2PackedSeqIntsAsnWrite() +* ID2BlobSeqIdsAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2PackedSeqIntsAsnWrite(ID2PackedSeqIntsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2BlobSeqIdsAsnWrite(ID2BlobSeqIdsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -7652,22 +4925,13 @@ ID2PackedSeqIntsAsnWrite(ID2PackedSeqIntsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_PACKED_SEQ_INTS); /* link local tree */ + atp = AsnLinkType(orig, ID2_BLOB_SEQ_IDS); /* link local tree */ if (atp == NULL) { return FALSE; } if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } - if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { - goto erret; - } - - av.intvalue = ptr -> gi; - retval = AsnWrite(aip, ID2_PACKED_SEQ_INTS_gi, &av); - AsnGenericUserSeqOfAsnWrite(ptr -> ints, (AsnWriteFunc) ID2SeqRangeAsnWrite, aip, ID2_PACKED_SEQ_INTS_ints, ID2_PACKED_SEQ_INTS_ints_E); - if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { - goto erret; - } + retval = AsnGenericUserSeqOfAsnWrite(ptr , (AsnWriteFunc) ID2BlobSeqIdAsnWrite, aip, atp, ID2_BLOB_SEQ_IDS_E); retval = TRUE; erret: @@ -7679,16 +4943,15 @@ erret: /************************************************** * -* ID2SeqRangeNew() +* ID2BlobSeqIdNew() * **************************************************/ NLM_EXTERN -ID2SeqRangePtr LIBCALL -ID2SeqRangeNew(void) +ID2BlobSeqIdPtr LIBCALL +ID2BlobSeqIdNew(void) { - ID2SeqRangePtr ptr = MemNew((size_t) sizeof(ID2SeqRange)); + ID2BlobSeqIdPtr ptr = MemNew((size_t) sizeof(ID2BlobSeqId)); - ptr -> length = 1; return ptr; } @@ -7696,35 +4959,36 @@ ID2SeqRangeNew(void) /************************************************** * -* ID2SeqRangeFree() +* ID2BlobSeqIdFree() * **************************************************/ NLM_EXTERN -ID2SeqRangePtr LIBCALL -ID2SeqRangeFree(ID2SeqRangePtr ptr) +ID2BlobSeqIdPtr LIBCALL +ID2BlobSeqIdFree(ID2BlobSeqIdPtr ptr) { if(ptr == NULL) { return NULL; } + SeqIdFree(ptr -> seq_id); return MemFree(ptr); } /************************************************** * -* ID2SeqRangeAsnRead() +* ID2BlobSeqIdAsnRead() * **************************************************/ NLM_EXTERN -ID2SeqRangePtr LIBCALL -ID2SeqRangeAsnRead(AsnIoPtr aip, AsnTypePtr orig) +ID2BlobSeqIdPtr LIBCALL +ID2BlobSeqIdAsnRead(AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; Boolean isError = FALSE; AsnReadFunc func; - ID2SeqRangePtr ptr; + ID2BlobSeqIdPtr ptr; if (! loaded) { @@ -7737,17 +5001,17 @@ ID2SeqRangeAsnRead(AsnIoPtr aip, AsnTypePtr orig) return NULL; } - if (orig == NULL) { /* ID2SeqRange ::= (self contained) */ - atp = AsnReadId(aip, amp, ID2_SEQ_RANGE); + if (orig == NULL) { /* ID2BlobSeqId ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_BLOB_SEQ_ID); } else { - atp = AsnLinkType(orig, ID2_SEQ_RANGE); + atp = AsnLinkType(orig, ID2_BLOB_SEQ_ID); } /* link in local tree */ if (atp == NULL) { return NULL; } - ptr = ID2SeqRangeNew(); + ptr = ID2BlobSeqIdNew(); if (ptr == NULL) { goto erret; } @@ -7758,18 +5022,18 @@ ID2SeqRangeAsnRead(AsnIoPtr aip, AsnTypePtr orig) atp = AsnReadId(aip,amp, atp); func = NULL; - if (atp == ID2_SEQ_RANGE_start) { - if ( AsnReadVal(aip, atp, &av) <= 0) { + if (atp == ID2_BLOB_SEQ_ID_seq_id) { + ptr -> seq_id = SeqIdAsnRead(aip, atp); + if (aip -> io_failure) { goto erret; } - ptr -> start = av.intvalue; atp = AsnReadId(aip,amp, atp); } - if (atp == ID2_SEQ_RANGE_length) { + if (atp == ID2_BLOB_SEQ_ID_replaced) { if ( AsnReadVal(aip, atp, &av) <= 0) { goto erret; } - ptr -> length = av.intvalue; + ptr -> replaced = av.boolvalue; atp = AsnReadId(aip,amp, atp); } @@ -7784,7 +5048,7 @@ ret: erret: aip -> io_failure = TRUE; - ptr = ID2SeqRangeFree(ptr); + ptr = ID2BlobSeqIdFree(ptr); goto ret; } @@ -7792,11 +5056,11 @@ erret: /************************************************** * -* ID2SeqRangeAsnWrite() +* ID2BlobSeqIdAsnWrite() * **************************************************/ NLM_EXTERN Boolean LIBCALL -ID2SeqRangeAsnWrite(ID2SeqRangePtr ptr, AsnIoPtr aip, AsnTypePtr orig) +ID2BlobSeqIdAsnWrite(ID2BlobSeqIdPtr ptr, AsnIoPtr aip, AsnTypePtr orig) { DataVal av; AsnTypePtr atp; @@ -7813,7 +5077,7 @@ ID2SeqRangeAsnWrite(ID2SeqRangePtr ptr, AsnIoPtr aip, AsnTypePtr orig) return FALSE; } - atp = AsnLinkType(orig, ID2_SEQ_RANGE); /* link local tree */ + atp = AsnLinkType(orig, ID2_BLOB_SEQ_ID); /* link local tree */ if (atp == NULL) { return FALSE; } @@ -7823,10 +5087,13 @@ ID2SeqRangeAsnWrite(ID2SeqRangePtr ptr, AsnIoPtr aip, AsnTypePtr orig) goto erret; } - av.intvalue = ptr -> start; - retval = AsnWrite(aip, ID2_SEQ_RANGE_start, &av); - av.intvalue = ptr -> length; - retval = AsnWrite(aip, ID2_SEQ_RANGE_length, &av); + if (ptr -> seq_id != NULL) { + if ( ! SeqIdAsnWrite(ptr -> seq_id, aip, ID2_BLOB_SEQ_ID_seq_id)) { + goto erret; + } + } + av.boolvalue = ptr -> replaced; + retval = AsnWrite(aip, ID2_BLOB_SEQ_ID_replaced, &av); if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { goto erret; } diff --git a/network/id2arch/id2.h b/network/id2arch/id2.h index affa3533..874c3e2c 100644 --- a/network/id2arch/id2.h +++ b/network/id2arch/id2.h @@ -9,257 +9,203 @@ #include <asn.h> #endif -static char * asnfilename = "id2.h14"; -static AsnValxNode avnx[27] = { +static char * asnfilename = "id2.h10"; +static AsnValxNode avnx[48] = { {20,"set-value" ,1,0.0,&avnx[1] } , {20,"get-value" ,2,0.0,&avnx[2] } , {20,"force-value" ,3,0.0,&avnx[3] } , {20,"use-package" ,4,0.0,NULL } , {3,NULL,1,0.0,NULL } , - {3,NULL,1,0.0,NULL } , - {3,NULL,1,0.0,NULL } , - {3,NULL,1,0.0,NULL } , + {20,"any" ,0,0.0,&avnx[6] } , + {20,"gi" ,1,0.0,&avnx[7] } , + {20,"text" ,2,0.0,&avnx[8] } , + {20,"general" ,4,0.0,&avnx[9] } , + {20,"all" ,127,0.0,NULL } , + {3,NULL,0,0.0,NULL } , + {20,"main" ,0,0.0,&avnx[12] } , + {20,"snp" ,1,0.0,&avnx[13] } , + {20,"mgc" ,16,0.0,NULL } , + {3,NULL,0,0.0,NULL } , {3,NULL,1,0.0,NULL } , {3,NULL,1,0.0,NULL } , {3,NULL,0,0.0,NULL } , {3,NULL,0,0.0,NULL } , {3,NULL,0,0.0,NULL } , - {20,"none" ,0,0.0,&avnx[14] } , - {20,"seq-map" ,1,0.0,&avnx[15] } , + {20,"none" ,0,0.0,&avnx[21] } , + {20,"seq-map" ,1,0.0,&avnx[22] } , {20,"seq-data" ,2,0.0,NULL } , {3,NULL,0,0.0,NULL } , - {1,"" ,0,0.0,NULL } , + {20,"warning" ,1,0.0,&avnx[25] } , + {20,"failed-command" ,2,0.0,&avnx[26] } , + {20,"failed-connection" ,3,0.0,&avnx[27] } , + {20,"failed-server" ,4,0.0,&avnx[28] } , + {20,"no-data" ,5,0.0,&avnx[29] } , + {20,"restricted-data" ,6,0.0,&avnx[30] } , + {20,"unsupported-command" ,7,0.0,&avnx[31] } , + {20,"invalid-arguments" ,8,0.0,NULL } , + {3,NULL,0,0.0,NULL } , + {20,"seq-entry" ,0,0.0,&avnx[34] } , + {20,"seq-annot" ,1,0.0,&avnx[35] } , + {20,"id2s-split-info" ,2,0.0,&avnx[36] } , + {20,"id2s-chunk" ,3,0.0,NULL } , {3,NULL,0,0.0,NULL } , - {20,"warning" ,1,0.0,&avnx[20] } , - {20,"failed-command" ,2,0.0,&avnx[21] } , - {20,"failed-connection" ,3,0.0,&avnx[22] } , - {20,"failed-server" ,4,0.0,&avnx[23] } , - {20,"no-data" ,5,0.0,&avnx[24] } , - {20,"restricted-data" ,6,0.0,&avnx[25] } , - {20,"unsupported-command" ,7,0.0,&avnx[26] } , - {20,"invalid-arguments" ,8,0.0,NULL } }; - -static AsnType atx[217] = { + {20,"asn-binary" ,0,0.0,&avnx[39] } , + {20,"asn-text" ,1,0.0,&avnx[40] } , + {20,"xml" ,2,0.0,NULL } , + {3,NULL,0,0.0,NULL } , + {20,"none" ,0,0.0,&avnx[43] } , + {20,"gzip" ,1,0.0,&avnx[44] } , + {20,"nlmzip" ,2,0.0,&avnx[45] } , + {20,"bzip2" ,3,0.0,NULL } , + {3,NULL,0,0.0,NULL } , + {3,NULL,0,0.0,NULL } }; + +static AsnType atx[142] = { {401, "Seq-id" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[1]} , - {402, "Seq-annot" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[2]} , - {403, "Seq-descr" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[3]} , - {404, "Seq-literal" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[4]} , - {405, "Seq-align" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[5]} , - {406, "ID2-Request-Packet" ,1,0,0,0,0,0,0,0,NULL,&atx[18],&atx[6],0,&atx[7]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[7],NULL,0,NULL} , - {407, "ID2-Request" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[8],0,&atx[11]} , - {0, "serial-number" ,128,0,0,1,0,0,0,0,NULL,&atx[9],NULL,0,&atx[10]} , + {402, "Seq-loc" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[2]} , + {403, "ID2S-Chunk-Id" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[3]} , + {404, "ID2S-Seq-annot-Info" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[4]} , + {405, "ID2-Request-Packet" ,1,0,0,0,0,0,0,0,NULL,&atx[17],&atx[5],0,&atx[6]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[6],NULL,0,NULL} , + {406, "ID2-Request" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[7],0,&atx[10]} , + {0, "serial-number" ,128,0,0,1,0,0,0,0,NULL,&atx[8],NULL,0,&atx[9]} , {302, "INTEGER" ,0,2,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[11],NULL,0,&atx[22]} , - {408, "ID2-Params" ,1,0,0,0,0,0,0,0,NULL,&atx[18],&atx[12],0,&atx[26]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[13],NULL,0,NULL} , - {448, "ID2-Param" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[14],0,NULL} , - {0, "name" ,128,0,0,0,0,0,0,0,NULL,&atx[15],NULL,0,&atx[16]} , + {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[10],NULL,0,&atx[21]} , + {407, "ID2-Params" ,1,0,0,0,0,0,0,0,NULL,&atx[17],&atx[11],0,&atx[25]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[12],NULL,0,NULL} , + {430, "ID2-Param" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[13],0,NULL} , + {0, "name" ,128,0,0,0,0,0,0,0,NULL,&atx[14],NULL,0,&atx[15]} , {323, "VisibleString" ,0,26,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "value" ,128,1,0,1,0,0,0,0,NULL,&atx[18],&atx[17],0,&atx[19]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[15],NULL,0,NULL} , + {0, "value" ,128,1,0,1,0,0,0,0,NULL,&atx[17],&atx[16],0,&atx[18]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[14],NULL,0,NULL} , {312, "SEQUENCE OF" ,0,16,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "type" ,128,2,0,0,1,0,0,0,&avnx[4],&atx[20],&avnx[0],0,NULL} , + {0, "type" ,128,2,0,0,1,0,0,0,&avnx[4],&atx[19],&avnx[0],0,NULL} , {310, "ENUMERATED" ,0,10,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , {311, "SEQUENCE" ,0,16,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "request" ,128,2,0,0,0,0,0,0,NULL,&atx[42],&atx[23],0,NULL} , - {0, "init" ,128,0,0,0,0,0,0,0,NULL,&atx[24],NULL,0,&atx[25]} , + {0, "request" ,128,2,0,0,0,0,0,0,NULL,&atx[35],&atx[22],0,NULL} , + {0, "init" ,128,0,0,0,0,0,0,0,NULL,&atx[23],NULL,0,&atx[24]} , {305, "NULL" ,0,5,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "get-packages" ,128,1,0,0,0,0,0,0,NULL,&atx[26],NULL,0,&atx[30]} , - {409, "ID2-Request-Get-Packages" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[27],0,&atx[31]} , - {0, "names" ,128,0,0,1,0,0,0,0,NULL,&atx[18],&atx[28],0,&atx[29]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[15],NULL,0,NULL} , - {0, "no-contents" ,128,1,0,1,0,0,0,0,NULL,&atx[24],NULL,0,NULL} , - {0, "string-to-gi" ,128,2,0,0,0,0,0,0,NULL,&atx[31],NULL,0,&atx[33]} , - {410, "ID2-Request-String-To-Gi" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[32],0,&atx[34]} , - {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[15],NULL,0,NULL} , - {0, "seq-id-to-gi" ,128,3,0,0,0,0,0,0,NULL,&atx[34],NULL,0,&atx[36]} , - {411, "ID2-Request-Seq-id-To-Gi" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[35],0,&atx[37]} , - {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,NULL} , - {0, "gi-to-tse-id" ,128,4,0,0,0,0,0,0,NULL,&atx[37],NULL,0,&atx[48]} , - {412, "ID2-Request-Gi-To-TSE-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[38],0,&atx[49]} , - {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[42],&atx[39],0,&atx[43]} , - {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[40]} , - {0, "string" ,128,1,0,0,0,0,0,0,NULL,&atx[31],NULL,0,&atx[41]} , - {0, "seq-id" ,128,2,0,0,0,0,0,0,NULL,&atx[34],NULL,0,NULL} , + {0, "get-packages" ,128,1,0,0,0,0,0,0,NULL,&atx[25],NULL,0,&atx[29]} , + {408, "ID2-Request-Get-Packages" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[26],0,&atx[30]} , + {0, "names" ,128,0,0,1,0,0,0,0,NULL,&atx[17],&atx[27],0,&atx[28]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[14],NULL,0,NULL} , + {0, "no-contents" ,128,1,0,1,0,0,0,0,NULL,&atx[23],NULL,0,NULL} , + {0, "get-seq-id" ,128,2,0,0,0,0,0,0,NULL,&atx[30],NULL,0,&atx[37]} , + {409, "ID2-Request-Get-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[31],0,&atx[38]} , + {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[32],NULL,0,&atx[36]} , + {414, "ID2-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[35],&atx[33],0,&atx[47]} , + {0, "string" ,128,0,0,0,0,0,0,0,NULL,&atx[14],NULL,0,&atx[34]} , + {0, "seq-id" ,128,1,0,0,0,0,0,0,NULL,&atx[0],NULL,0,NULL} , {315, "CHOICE" ,0,-1,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "sources" ,128,1,0,1,0,0,0,0,NULL,&atx[45],&atx[44],0,&atx[46]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[15],NULL,0,NULL} , - {314, "SET OF" ,0,17,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "external" ,128,2,0,1,0,0,0,0,NULL,&atx[24],NULL,0,&atx[47]} , - {0, "current-gis" ,128,3,0,1,0,0,0,0,NULL,&atx[24],NULL,0,NULL} , - {0, "get-tse" ,128,5,0,0,0,0,0,0,NULL,&atx[49],NULL,0,&atx[89]} , - {413, "ID2-Request-Get-TSE" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[50],0,&atx[90]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[42],&atx[51],0,&atx[59]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[55]} , - {416, "ID2-TSE-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[53],0,&atx[60]} , - {0, "sat" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[54]} , - {0, "sat-key" ,128,1,0,0,0,0,0,0,NULL,&atx[9],NULL,0,NULL} , - {0, "gi" ,128,1,0,0,0,0,0,0,NULL,&atx[21],&atx[56],0,NULL} , - {0, "request" ,128,0,0,0,0,0,0,0,NULL,&atx[37],NULL,0,&atx[57]} , - {0, "exclude-tses" ,128,1,0,1,0,0,0,0,NULL,&atx[45],&atx[58],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[52],NULL,0,NULL} , - {0, "details" ,128,1,0,1,0,0,0,0,NULL,&atx[60],NULL,0,NULL} , - {417, "ID2-Get-TSE-Details" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[61],0,&atx[99]} , - {0, "location" ,128,0,0,0,0,0,0,0,NULL,&atx[62],NULL,0,&atx[83]} , - {419, "ID2-Seq-loc" ,1,0,0,0,0,0,0,0,NULL,&atx[42],&atx[63],0,&atx[100]} , - {0, "whole" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[64]} , - {0, "int" ,128,1,0,0,0,0,0,0,NULL,&atx[65],NULL,0,&atx[69]} , - {445, "ID2-Interval" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[66],0,&atx[70]} , - {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[67]} , - {0, "start" ,128,1,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[68]} , - {0, "length" ,128,2,0,0,1,0,0,0,&avnx[5],&atx[9],NULL,0,NULL} , - {0, "int-set" ,128,2,0,0,0,0,0,0,NULL,&atx[70],NULL,0,&atx[77]} , - {446, "ID2-Packed-Seq-ints" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[71],0,&atx[74]} , - {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[72]} , - {0, "ints" ,128,1,0,0,0,0,0,0,NULL,&atx[45],&atx[73],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[74],NULL,0,NULL} , - {447, "ID2-Seq-range" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[75],0,&atx[13]} , - {0, "start" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[76]} , - {0, "length" ,128,1,0,0,1,0,0,0,&avnx[6],&atx[9],NULL,0,NULL} , - {0, "whole-range" ,128,3,0,0,0,0,0,0,NULL,&atx[78],NULL,0,&atx[81]} , - {434, "ID2-Id-Range" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[79],0,&atx[160]} , - {0, "start" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[80]} , - {0, "count" ,128,1,0,0,1,0,0,0,&avnx[7],&atx[9],NULL,0,NULL} , - {0, "loc-set" ,128,4,0,0,0,0,0,0,NULL,&atx[45],&atx[82],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[62],NULL,0,NULL} , - {0, "seq-class-level" ,128,1,0,0,1,0,0,0,&avnx[8],&atx[9],NULL,0,&atx[84]} , - {0, "descr-level" ,128,2,0,0,1,0,0,0,&avnx[9],&atx[9],NULL,0,&atx[85]} , - {0, "descr-type-mask" ,128,3,0,0,1,0,0,0,&avnx[10],&atx[9],NULL,0,&atx[86]} , - {0, "annot-type-mask" ,128,4,0,0,1,0,0,0,&avnx[11],&atx[9],NULL,0,&atx[87]} , - {0, "feat-type-mask" ,128,5,0,0,1,0,0,0,&avnx[12],&atx[9],NULL,0,&atx[88]} , - {0, "sequence-level" ,128,6,0,0,1,0,0,0,&avnx[16],&atx[20],&avnx[13],0,NULL} , - {0, "reget-tse" ,128,6,0,0,0,0,0,0,NULL,&atx[90],NULL,0,&atx[94]} , - {414, "ID2-Request-ReGet-TSE" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[91],0,&atx[95]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[92]} , - {0, "details" ,128,1,0,1,0,0,0,0,NULL,&atx[60],NULL,0,&atx[93]} , - {0, "offset" ,128,2,0,0,0,0,0,0,NULL,&atx[9],NULL,0,NULL} , - {0, "get-chunks" ,128,7,0,0,0,0,0,0,NULL,&atx[95],NULL,0,NULL} , - {415, "ID2S-Request-Get-Chunks" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[96],0,&atx[52]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[97]} , - {0, "chunks" ,128,1,0,0,0,0,0,0,NULL,&atx[45],&atx[98],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[99],NULL,0,NULL} , - {418, "ID2S-Chunk-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[62]} , - {420, "ID2-Reply" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[101],0,&atx[106]} , - {0, "serial-number" ,128,0,0,1,0,0,0,0,NULL,&atx[9],NULL,0,&atx[102]} , - {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[11],NULL,0,&atx[103]} , - {0, "reply" ,128,2,0,0,0,0,0,0,NULL,&atx[42],&atx[104],0,&atx[143]} , - {0, "init" ,128,0,0,0,0,0,0,0,NULL,&atx[24],NULL,0,&atx[105]} , - {0, "get-package" ,128,1,0,0,0,0,0,0,NULL,&atx[106],NULL,0,&atx[109]} , - {421, "ID2-Reply-Get-Package" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[107],0,&atx[110]} , - {0, "name" ,128,0,0,0,0,0,0,0,NULL,&atx[15],NULL,0,&atx[108]} , - {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[11],NULL,0,NULL} , - {0, "seq-id-to-gi" ,128,2,0,0,0,0,0,0,NULL,&atx[110],NULL,0,&atx[113]} , - {422, "ID2-Reply-Seq-id-To-Gi" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[111],0,&atx[114]} , - {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[112]} , - {0, "gi" ,128,1,0,1,0,0,0,0,NULL,&atx[9],NULL,0,NULL} , - {0, "gi-to-tse-id" ,128,3,0,0,0,0,0,0,NULL,&atx[114],NULL,0,&atx[122]} , - {423, "ID2-Reply-Gi-To-TSE-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[115],0,&atx[123]} , - {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[116]} , - {0, "source" ,128,1,0,0,1,0,0,0,&avnx[17],&atx[15],NULL,0,&atx[117]} , - {0, "tses" ,128,2,0,1,0,0,0,0,NULL,&atx[45],&atx[118],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[119],NULL,0,NULL} , - {428, "ID2-TSE-Id-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[120],0,&atx[126]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[121]} , - {0, "split-version" ,128,1,0,0,1,0,0,0,&avnx[18],&atx[9],NULL,0,NULL} , - {0, "get-tse" ,128,4,0,0,0,0,0,0,NULL,&atx[123],NULL,0,&atx[133]} , - {424, "ID2-Reply-Get-TSE" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[124],0,&atx[134]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[125]} , - {0, "data" ,128,1,0,1,0,0,0,0,NULL,&atx[126],NULL,0,NULL} , - {429, "ID2-Reply-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[127],0,&atx[151]} , - {0, "data-type" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[128]} , - {0, "data-format" ,128,1,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[129]} , - {0, "data-compression" ,128,2,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[130]} , - {0, "data" ,128,3,0,0,0,0,0,0,NULL,&atx[18],&atx[131],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[132],NULL,0,NULL} , - {304, "OCTET STRING" ,0,4,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {0, "get-tse-info" ,128,5,0,0,0,0,0,0,NULL,&atx[134],NULL,0,&atx[138]} , - {425, "ID2S-Reply-Get-TSE-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[135],0,&atx[139]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[136]} , - {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[137]} , - {0, "info" ,128,2,0,1,0,0,0,0,NULL,&atx[126],NULL,0,NULL} , - {0, "get-chunk" ,128,6,0,0,0,0,0,0,NULL,&atx[139],NULL,0,NULL} , - {426, "ID2S-Reply-Get-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[140],0,&atx[145]} , - {0, "tse-id" ,128,0,0,0,0,0,0,0,NULL,&atx[52],NULL,0,&atx[141]} , - {0, "chunk-id" ,128,1,0,0,0,0,0,0,NULL,&atx[99],NULL,0,&atx[142]} , - {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[126],NULL,0,NULL} , - {0, "error" ,128,3,0,1,0,0,0,0,NULL,&atx[18],&atx[144],0,&atx[149]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[145],NULL,0,NULL} , - {427, "ID2-Error" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[146],0,&atx[119]} , - {0, "severity" ,128,0,0,0,0,0,0,0,NULL,&atx[20],&avnx[19],0,&atx[147]} , - {0, "retry-delay" ,128,1,0,1,0,0,0,0,NULL,&atx[9],NULL,0,&atx[148]} , - {0, "message" ,128,2,0,1,0,0,0,0,NULL,&atx[15],NULL,0,NULL} , - {0, "end-of-reply" ,128,4,0,0,0,0,0,0,NULL,&atx[150],NULL,0,NULL} , - {301, "BOOLEAN" ,0,1,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , - {430, "ID2S-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[152],0,&atx[154]} , - {0, "bioseqs-info" ,128,0,0,1,0,0,0,0,NULL,&atx[45],&atx[153],0,&atx[166]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[154],NULL,0,NULL} , - {431, "ID2S-Bioseqs-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[155],0,&atx[168]} , - {0, "info" ,128,0,0,0,0,0,0,0,NULL,&atx[156],NULL,0,&atx[165]} , - {433, "ID2S-Bioseq-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[157],0,&atx[78]} , - {0, "gap-count" ,128,0,0,1,0,0,0,0,NULL,&atx[9],NULL,0,&atx[158]} , - {0, "seq-map-has-ref" ,128,1,0,1,0,0,0,0,NULL,&atx[150],NULL,0,&atx[159]} , - {0, "sequence-split" ,128,2,0,1,0,0,0,0,NULL,&atx[160],NULL,0,NULL} , - {435, "ID2S-Sequence-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[161],0,&atx[172]} , - {0, "block-size" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[162]} , - {0, "chunk-start" ,128,1,0,0,0,0,0,0,NULL,&atx[99],NULL,0,&atx[163]} , - {0, "chunk-blocks" ,128,2,0,0,0,0,0,0,NULL,&atx[18],&atx[164],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[9],NULL,0,NULL} , - {0, "bioseqs" ,128,1,0,0,0,0,0,0,NULL,&atx[78],NULL,0,NULL} , - {0, "chunks" ,128,1,0,0,0,0,0,0,NULL,&atx[45],&atx[167],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[168],NULL,0,NULL} , - {432, "ID2S-Chunk-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[169],0,&atx[156]} , - {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[99],NULL,0,&atx[170]} , - {0, "content" ,128,1,0,0,0,0,0,0,NULL,&atx[45],&atx[171],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[172],NULL,0,NULL} , - {436, "ID2S-Chunk-Content" ,1,0,0,0,0,0,0,0,NULL,&atx[42],&atx[173],0,&atx[174]} , - {0, "seq-descr" ,128,0,0,0,0,0,0,0,NULL,&atx[174],NULL,0,&atx[180]} , - {437, "ID2S-Seq-descr-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[175],0,&atx[181]} , - {0, "type-mask" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[176]} , - {0, "bioseqs" ,128,1,0,1,0,0,0,0,NULL,&atx[45],&atx[177],0,&atx[178]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[78],NULL,0,NULL} , - {0, "bioseq-sets" ,128,2,0,1,0,0,0,0,NULL,&atx[45],&atx[179],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[78],NULL,0,NULL} , - {0, "seq-annot" ,128,1,0,0,0,0,0,0,NULL,&atx[181],NULL,0,&atx[192]} , - {438, "ID2S-Seq-annot-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[182],0,&atx[193]} , - {0, "name" ,128,0,0,1,0,0,0,0,NULL,&atx[15],NULL,0,&atx[183]} , - {0, "align" ,128,1,0,1,0,0,0,0,NULL,&atx[24],NULL,0,&atx[184]} , - {0, "graph" ,128,2,0,1,0,0,0,0,NULL,&atx[24],NULL,0,&atx[185]} , - {0, "feat" ,128,3,0,1,0,0,0,0,NULL,&atx[45],&atx[186],0,&atx[191]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[187],NULL,0,NULL} , - {442, "ID2S-Feat-type-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[188],0,&atx[200]} , - {0, "type" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[189]} , - {0, "subtypes" ,128,1,0,1,0,0,0,0,NULL,&atx[45],&atx[190],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[9],NULL,0,NULL} , - {0, "seq-loc" ,128,4,0,0,0,0,0,0,NULL,&atx[62],NULL,0,NULL} , - {0, "seq-assembly" ,128,2,0,0,0,0,0,0,NULL,&atx[193],NULL,0,&atx[196]} , - {439, "ID2S-Seq-assembly-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[194],0,&atx[197]} , - {0, "bioseqs" ,128,0,0,0,0,0,0,0,NULL,&atx[45],&atx[195],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[78],NULL,0,NULL} , - {0, "seq-map" ,128,3,0,0,0,0,0,0,NULL,&atx[197],NULL,0,&atx[198]} , - {440, "ID2S-Seq-map-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[62],NULL,0,&atx[199]} , - {0, "seq-data" ,128,4,0,0,0,0,0,0,NULL,&atx[199],NULL,0,NULL} , - {441, "ID2S-Seq-data-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[62],NULL,0,&atx[187]} , - {443, "ID2S-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[201],0,&atx[203]} , - {0, "data" ,128,0,0,0,0,0,0,0,NULL,&atx[45],&atx[202],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[203],NULL,0,NULL} , - {444, "ID2S-Chunk-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[21],&atx[204],0,&atx[65]} , - {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[42],&atx[205],0,&atx[207]} , - {0, "bioseq-set" ,128,0,0,0,0,0,0,0,NULL,&atx[9],NULL,0,&atx[206]} , - {0, "gi" ,128,1,0,0,0,0,0,0,NULL,&atx[9],NULL,0,NULL} , - {0, "descrs" ,128,1,0,1,0,0,0,0,NULL,&atx[45],&atx[208],0,&atx[209]} , + {0, "seq-id-type" ,128,1,0,0,1,0,0,0,&avnx[10],&atx[8],&avnx[5],0,NULL} , + {0, "get-blob-id" ,128,3,0,0,0,0,0,0,NULL,&atx[38],NULL,0,&atx[43]} , + {410, "ID2-Request-Get-Blob-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[39],0,&atx[44]} , + {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[30],NULL,0,&atx[40]} , + {0, "sources" ,128,1,0,1,0,0,0,0,NULL,&atx[17],&atx[41],0,&atx[42]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[14],NULL,0,NULL} , + {0, "external" ,128,2,0,1,0,0,0,0,NULL,&atx[23],NULL,0,NULL} , + {0, "get-blob-info" ,128,4,0,0,0,0,0,0,NULL,&atx[44],NULL,0,&atx[66]} , + {411, "ID2-Request-Get-Blob-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[45],0,&atx[67]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[35],&atx[46],0,&atx[56]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[52]} , + {415, "ID2-Blob-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[48],0,&atx[58]} , + {0, "sat" ,128,0,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[49]} , + {0, "sub-sat" ,128,1,0,0,1,0,0,0,&avnx[14],&atx[8],&avnx[11],0,&atx[50]} , + {0, "sat-key" ,128,2,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[51]} , + {0, "version" ,128,3,0,1,0,0,0,0,NULL,&atx[8],NULL,0,NULL} , + {0, "resolve" ,128,1,0,0,0,0,0,0,NULL,&atx[20],&atx[53],0,NULL} , + {0, "request" ,128,0,0,0,0,0,0,0,NULL,&atx[38],NULL,0,&atx[54]} , + {0, "exclude-blobs" ,128,1,0,1,0,0,0,0,NULL,&atx[17],&atx[55],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[47],NULL,0,NULL} , + {0, "get-seq-ids" ,128,1,0,1,0,0,0,0,NULL,&atx[23],NULL,0,&atx[57]} , + {0, "get-data" ,128,2,0,1,0,0,0,0,NULL,&atx[58],NULL,0,NULL} , + {416, "ID2-Get-Blob-Details" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[59],0,&atx[76]} , + {0, "location" ,128,0,0,1,0,0,0,0,NULL,&atx[1],NULL,0,&atx[60]} , + {0, "seq-class-level" ,128,1,0,0,1,0,0,0,&avnx[15],&atx[8],NULL,0,&atx[61]} , + {0, "descr-level" ,128,2,0,0,1,0,0,0,&avnx[16],&atx[8],NULL,0,&atx[62]} , + {0, "descr-type-mask" ,128,3,0,0,1,0,0,0,&avnx[17],&atx[8],NULL,0,&atx[63]} , + {0, "annot-type-mask" ,128,4,0,0,1,0,0,0,&avnx[18],&atx[8],NULL,0,&atx[64]} , + {0, "feat-type-mask" ,128,5,0,0,1,0,0,0,&avnx[19],&atx[8],NULL,0,&atx[65]} , + {0, "sequence-level" ,128,6,0,0,1,0,0,0,&avnx[23],&atx[19],&avnx[20],0,NULL} , + {0, "reget-blob" ,128,5,0,0,0,0,0,0,NULL,&atx[67],NULL,0,&atx[71]} , + {412, "ID2-Request-ReGet-Blob" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[68],0,&atx[72]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[69]} , + {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[70]} , + {0, "offset" ,128,2,0,0,0,0,0,0,NULL,&atx[8],NULL,0,NULL} , + {0, "get-chunks" ,128,6,0,0,0,0,0,0,NULL,&atx[72],NULL,0,NULL} , + {413, "ID2S-Request-Get-Chunks" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[73],0,&atx[32]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[74]} , + {0, "chunks" ,128,1,0,0,0,0,0,0,NULL,&atx[17],&atx[75],0,NULL} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[2],NULL,0,NULL} , - {0, "annots" ,128,2,0,1,0,0,0,0,NULL,&atx[45],&atx[210],0,&atx[211]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , - {0, "assembly" ,128,3,0,1,0,0,0,0,NULL,&atx[45],&atx[212],0,&atx[213]} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[4],NULL,0,NULL} , - {0, "seq-map" ,128,4,0,1,0,0,0,0,NULL,&atx[18],&atx[214],0,&atx[215]} , + {417, "ID2-Reply" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[77],0,&atx[81]} , + {0, "serial-number" ,128,0,0,1,0,0,0,0,NULL,&atx[8],NULL,0,&atx[78]} , + {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[10],NULL,0,&atx[79]} , + {0, "error" ,128,2,0,1,0,0,0,0,NULL,&atx[17],&atx[80],0,&atx[85]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[81],NULL,0,NULL} , + {418, "ID2-Error" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[82],0,&atx[90]} , + {0, "severity" ,128,0,0,0,0,0,0,0,NULL,&atx[19],&avnx[24],0,&atx[83]} , + {0, "retry-delay" ,128,1,0,1,0,0,0,0,NULL,&atx[8],NULL,0,&atx[84]} , + {0, "message" ,128,2,0,1,0,0,0,0,NULL,&atx[14],NULL,0,NULL} , + {0, "end-of-reply" ,128,3,0,1,0,0,0,0,NULL,&atx[23],NULL,0,&atx[86]} , + {0, "reply" ,128,4,0,0,0,0,0,0,NULL,&atx[35],&atx[87],0,NULL} , + {0, "init" ,128,0,0,0,0,0,0,0,NULL,&atx[23],NULL,0,&atx[88]} , + {0, "empty" ,128,1,0,0,0,0,0,0,NULL,&atx[23],NULL,0,&atx[89]} , + {0, "get-package" ,128,2,0,0,0,0,0,0,NULL,&atx[90],NULL,0,&atx[93]} , + {419, "ID2-Reply-Get-Package" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[91],0,&atx[94]} , + {0, "name" ,128,0,0,0,0,0,0,0,NULL,&atx[14],NULL,0,&atx[92]} , + {0, "params" ,128,1,0,1,0,0,0,0,NULL,&atx[10],NULL,0,NULL} , + {0, "get-seq-id" ,128,3,0,0,0,0,0,0,NULL,&atx[94],NULL,0,&atx[98]} , + {420, "ID2-Reply-Get-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[95],0,&atx[99]} , + {0, "request" ,128,0,0,0,0,0,0,0,NULL,&atx[30],NULL,0,&atx[96]} , + {0, "seq-id" ,128,1,0,1,0,0,0,0,NULL,&atx[17],&atx[97],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[0],NULL,0,NULL} , + {0, "get-blob-id" ,128,4,0,0,0,0,0,0,NULL,&atx[99],NULL,0,&atx[105]} , + {421, "ID2-Reply-Get-Blob-Id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[100],0,&atx[106]} , + {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[101]} , + {0, "blob-id" ,128,1,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[102]} , + {0, "split-version" ,128,2,0,0,1,0,0,0,&avnx[32],&atx[8],NULL,0,&atx[103]} , + {0, "annot-info" ,128,3,0,1,0,0,0,0,NULL,&atx[17],&atx[104],0,NULL} , {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[3],NULL,0,NULL} , - {0, "seq-data" ,128,5,0,1,0,0,0,0,NULL,&atx[18],&atx[216],0,NULL} , - {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[3],NULL,0,NULL} }; + {0, "get-blob-seq-ids" ,128,5,0,0,0,0,0,0,NULL,&atx[106],NULL,0,&atx[116]} , + {422, "ID2-Reply-Get-Blob-Seq-ids" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[107],0,&atx[117]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[108]} , + {0, "ids" ,128,1,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , + {427, "ID2-Reply-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[110],0,&atx[137]} , + {0, "data-type" ,128,0,0,0,1,0,0,0,&avnx[37],&atx[8],&avnx[33],0,&atx[111]} , + {0, "data-format" ,128,1,0,0,1,0,0,0,&avnx[41],&atx[8],&avnx[38],0,&atx[112]} , + {0, "data-compression" ,128,2,0,0,1,0,0,0,&avnx[46],&atx[8],&avnx[42],0,&atx[113]} , + {0, "data" ,128,3,0,0,0,0,0,0,NULL,&atx[17],&atx[114],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[115],NULL,0,NULL} , + {304, "OCTET STRING" ,0,4,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {0, "get-blob" ,128,6,0,0,0,0,0,0,NULL,&atx[117],NULL,0,&atx[121]} , + {423, "ID2-Reply-Get-Blob" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[118],0,&atx[122]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[119]} , + {0, "split-version" ,128,1,0,0,1,0,0,0,&avnx[47],&atx[8],NULL,0,&atx[120]} , + {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , + {0, "reget-blob" ,128,7,0,0,0,0,0,0,NULL,&atx[122],NULL,0,&atx[127]} , + {424, "ID2-Reply-ReGet-Blob" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[123],0,&atx[128]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[124]} , + {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[125]} , + {0, "offset" ,128,2,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[126]} , + {0, "data" ,128,3,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , + {0, "get-split-info" ,128,8,0,0,0,0,0,0,NULL,&atx[128],NULL,0,&atx[132]} , + {425, "ID2S-Reply-Get-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[129],0,&atx[133]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[130]} , + {0, "split-version" ,128,1,0,0,0,0,0,0,NULL,&atx[8],NULL,0,&atx[131]} , + {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , + {0, "get-chunk" ,128,9,0,0,0,0,0,0,NULL,&atx[133],NULL,0,NULL} , + {426, "ID2S-Reply-Get-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[134],0,&atx[109]} , + {0, "blob-id" ,128,0,0,0,0,0,0,0,NULL,&atx[47],NULL,0,&atx[135]} , + {0, "chunk-id" ,128,1,0,0,0,0,0,0,NULL,&atx[2],NULL,0,&atx[136]} , + {0, "data" ,128,2,0,1,0,0,0,0,NULL,&atx[109],NULL,0,NULL} , + {428, "ID2-Blob-Seq-ids" ,1,0,0,0,0,0,0,0,NULL,&atx[17],&atx[138],0,&atx[139]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[139],NULL,0,NULL} , + {429, "ID2-Blob-Seq-id" ,1,0,0,0,0,0,0,0,NULL,&atx[20],&atx[140],0,&atx[12]} , + {0, "seq-id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[141]} , + {0, "replaced" ,128,1,0,1,0,0,0,0,NULL,&atx[23],NULL,0,NULL} }; static AsnModule ampx[1] = { - { "NCBI-ID2Access" , "id2.h14",&atx[0],NULL,NULL,0,0} }; + { "NCBI-ID2Access" , "id2.h10",&atx[0],NULL,NULL,0,0} }; static AsnValxNodePtr avn = avnx; static AsnTypePtr at = atx; @@ -273,247 +219,158 @@ static AsnModulePtr amp = ampx; * **************************************************/ -#define ID2_REQUEST_PACKET &at[5] -#define ID2_REQUEST_PACKET_E &at[6] - -#define ID2_REQUEST &at[7] -#define ID2_REQUEST_serial_number &at[8] -#define ID2_REQUEST_params &at[10] -#define ID2_REQUEST_request &at[22] -#define ID2_REQUEST_request_init &at[23] -#define REQUEST_request_get_packages &at[25] -#define REQUEST_request_string_to_gi &at[30] -#define REQUEST_request_seq_id_to_gi &at[33] -#define REQUEST_request_gi_to_tse_id &at[36] -#define ID2_REQUEST_request_get_tse &at[48] -#define ID2_REQUEST_request_reget_tse &at[89] -#define ID2_REQUEST_request_get_chunks &at[94] - -#define ID2_PARAMS &at[11] -#define ID2_PARAMS_E &at[12] - -#define ID2_REQUEST_GET_PACKAGES &at[26] -#define ID2_REQUEST_GET_PACKAGES_names &at[27] -#define REQUEST_GET_PACKAGES_names_E &at[28] -#define GET_PACKAGES_no_contents &at[29] - -#define ID2_REQUEST_STRING_TO_GI &at[31] -#define ID2_REQUEST_STRING_TO_GI_id &at[32] - -#define ID2_REQUEST_SEQ_ID_TO_GI &at[34] -#define ID2_REQUEST_SEQ_ID_TO_GI_seq_id &at[35] - -#define ID2_REQUEST_GI_TO_TSE_ID &at[37] -#define ID2_REQUEST_GI_TO_TSE_ID_gi &at[38] -#define ID2_REQUEST_GI_TO_TSE_ID_gi_gi &at[39] -#define REQUEST_GI_TO_TSE_ID_gi_string &at[40] -#define REQUEST_GI_TO_TSE_ID_gi_seq_id &at[41] -#define REQUEST_GI_TO_TSE_ID_sources &at[43] -#define REQUEST_GI_TO_TSE_ID_sources_E &at[44] -#define REQUEST_GI_TO_TSE_ID_external &at[46] -#define GI_TO_TSE_ID_current_gis &at[47] - -#define ID2_REQUEST_GET_TSE &at[49] -#define ID2_REQUEST_GET_TSE_tse_id &at[50] -#define REQUEST_GET_TSE_tse_id_tse_id &at[51] -#define ID2_REQUEST_GET_TSE_tse_id_gi &at[55] -#define GET_TSE_tse_id_gi_request &at[56] -#define GET_TSE_tse_id_gi_exclude_tses &at[57] -#define TSE_tse_id_gi_exclude_tses_E &at[58] -#define ID2_REQUEST_GET_TSE_details &at[59] - -#define ID2_REQUEST_REGET_TSE &at[90] -#define ID2_REQUEST_REGET_TSE_tse_id &at[91] -#define ID2_REQUEST_REGET_TSE_details &at[92] -#define ID2_REQUEST_REGET_TSE_offset &at[93] - -#define ID2S_REQUEST_GET_CHUNKS &at[95] -#define ID2S_REQUEST_GET_CHUNKS_tse_id &at[96] -#define ID2S_REQUEST_GET_CHUNKS_chunks &at[97] -#define REQUEST_GET_CHUNKS_chunks_E &at[98] - -#define ID2_TSE_ID &at[52] -#define ID2_TSE_ID_sat &at[53] -#define ID2_TSE_ID_sat_key &at[54] - -#define ID2_GET_TSE_DETAILS &at[60] -#define ID2_GET_TSE_DETAILS_location &at[61] -#define TSE_DETAILS_seq_class_level &at[83] -#define ID2_GET_TSE_DETAILS_descr_level &at[84] -#define TSE_DETAILS_descr_type_mask &at[85] -#define TSE_DETAILS_annot_type_mask &at[86] -#define GET_TSE_DETAILS_feat_type_mask &at[87] -#define GET_TSE_DETAILS_sequence_level &at[88] - -#define ID2S_CHUNK_ID &at[99] - -#define ID2_SEQ_LOC &at[62] -#define ID2_SEQ_LOC_whole &at[63] -#define ID2_SEQ_LOC_int &at[64] -#define ID2_SEQ_LOC_int_set &at[69] -#define ID2_SEQ_LOC_whole_range &at[77] -#define ID2_SEQ_LOC_loc_set &at[81] -#define ID2_SEQ_LOC_loc_set_E &at[82] - -#define ID2_REPLY &at[100] -#define ID2_REPLY_serial_number &at[101] -#define ID2_REPLY_params &at[102] -#define ID2_REPLY_reply &at[103] -#define ID2_REPLY_reply_init &at[104] -#define ID2_REPLY_reply_get_package &at[105] -#define ID2_REPLY_reply_seq_id_to_gi &at[109] -#define ID2_REPLY_reply_gi_to_tse_id &at[113] -#define ID2_REPLY_reply_get_tse &at[122] -#define ID2_REPLY_reply_get_tse_info &at[133] -#define ID2_REPLY_reply_get_chunk &at[138] -#define ID2_REPLY_error &at[143] -#define ID2_REPLY_error_E &at[144] -#define ID2_REPLY_end_of_reply &at[149] - -#define ID2_REPLY_GET_PACKAGE &at[106] -#define ID2_REPLY_GET_PACKAGE_name &at[107] -#define ID2_REPLY_GET_PACKAGE_params &at[108] - -#define ID2_REPLY_SEQ_ID_TO_GI &at[110] -#define ID2_REPLY_SEQ_ID_TO_GI_seq_id &at[111] -#define ID2_REPLY_SEQ_ID_TO_GI_gi &at[112] - -#define ID2_REPLY_GI_TO_TSE_ID &at[114] -#define ID2_REPLY_GI_TO_TSE_ID_gi &at[115] -#define ID2_REPLY_GI_TO_TSE_ID_source &at[116] -#define ID2_REPLY_GI_TO_TSE_ID_tses &at[117] -#define ID2_REPLY_GI_TO_TSE_ID_tses_E &at[118] - -#define ID2_REPLY_GET_TSE &at[123] -#define ID2_REPLY_GET_TSE_tse_id &at[124] -#define ID2_REPLY_GET_TSE_data &at[125] - -#define ID2S_REPLY_GET_TSE_INFO &at[134] -#define ID2S_REPLY_GET_TSE_INFO_tse_id &at[135] -#define GET_TSE_INFO_split_version &at[136] -#define ID2S_REPLY_GET_TSE_INFO_info &at[137] - -#define ID2S_REPLY_GET_CHUNK &at[139] -#define ID2S_REPLY_GET_CHUNK_tse_id &at[140] -#define ID2S_REPLY_GET_CHUNK_chunk_id &at[141] -#define ID2S_REPLY_GET_CHUNK_data &at[142] - -#define ID2_ERROR &at[145] -#define ID2_ERROR_severity &at[146] -#define ID2_ERROR_retry_delay &at[147] -#define ID2_ERROR_message &at[148] - -#define ID2_TSE_ID_INFO &at[119] -#define ID2_TSE_ID_INFO_tse_id &at[120] -#define ID2_TSE_ID_INFO_split_version &at[121] - -#define ID2_REPLY_DATA &at[126] -#define ID2_REPLY_DATA_data_type &at[127] -#define ID2_REPLY_DATA_data_format &at[128] -#define ID2_REPLY_DATA_data_compression &at[129] -#define ID2_REPLY_DATA_data &at[130] -#define ID2_REPLY_DATA_data_E &at[131] - -#define ID2S_SPLIT_INFO &at[151] -#define ID2S_SPLIT_INFO_bioseqs_info &at[152] -#define ID2S_SPLIT_INFO_bioseqs_info_E &at[153] -#define ID2S_SPLIT_INFO_chunks &at[166] -#define ID2S_SPLIT_INFO_chunks_E &at[167] - -#define ID2S_BIOSEQS_INFO &at[154] -#define ID2S_BIOSEQS_INFO_info &at[155] -#define ID2S_BIOSEQS_INFO_bioseqs &at[165] - -#define ID2S_CHUNK_INFO &at[168] -#define ID2S_CHUNK_INFO_id &at[169] -#define ID2S_CHUNK_INFO_content &at[170] -#define ID2S_CHUNK_INFO_content_E &at[171] - -#define ID2S_BIOSEQ_INFO &at[156] -#define ID2S_BIOSEQ_INFO_gap_count &at[157] -#define BIOSEQ_INFO_seq_map_has_ref &at[158] -#define ID2S_BIOSEQ_INFO_sequence_split &at[159] - -#define ID2_ID_RANGE &at[78] -#define ID2_ID_RANGE_start &at[79] -#define ID2_ID_RANGE_count &at[80] - -#define ID2S_SEQUENCE_SPLIT_INFO &at[160] -#define SEQUENCE_SPLIT_INFO_block_size &at[161] -#define SPLIT_INFO_chunk_start &at[162] -#define SPLIT_INFO_chunk_blocks &at[163] -#define SPLIT_INFO_chunk_blocks_E &at[164] - -#define ID2S_CHUNK_CONTENT &at[172] -#define ID2S_CHUNK_CONTENT_seq_descr &at[173] -#define ID2S_CHUNK_CONTENT_seq_annot &at[180] -#define ID2S_CHUNK_CONTENT_seq_assembly &at[192] -#define ID2S_CHUNK_CONTENT_seq_map &at[196] -#define ID2S_CHUNK_CONTENT_seq_data &at[198] - -#define ID2S_SEQ_DESCR_INFO &at[174] -#define ID2S_SEQ_DESCR_INFO_type_mask &at[175] -#define ID2S_SEQ_DESCR_INFO_bioseqs &at[176] -#define ID2S_SEQ_DESCR_INFO_bioseqs_E &at[177] -#define ID2S_SEQ_DESCR_INFO_bioseq_sets &at[178] -#define SEQ_DESCR_INFO_bioseq_sets_E &at[179] - -#define ID2S_SEQ_ANNOT_INFO &at[181] -#define ID2S_SEQ_ANNOT_INFO_name &at[182] -#define ID2S_SEQ_ANNOT_INFO_align &at[183] -#define ID2S_SEQ_ANNOT_INFO_graph &at[184] -#define ID2S_SEQ_ANNOT_INFO_feat &at[185] -#define ID2S_SEQ_ANNOT_INFO_feat_E &at[186] -#define ID2S_SEQ_ANNOT_INFO_seq_loc &at[191] - -#define ID2S_SEQ_ASSEMBLY_INFO &at[193] -#define ID2S_SEQ_ASSEMBLY_INFO_bioseqs &at[194] -#define SEQ_ASSEMBLY_INFO_bioseqs_E &at[195] - -#define ID2S_SEQ_MAP_INFO &at[197] - -#define ID2S_SEQ_DATA_INFO &at[199] - -#define ID2S_FEAT_TYPE_INFO &at[187] -#define ID2S_FEAT_TYPE_INFO_type &at[188] -#define ID2S_FEAT_TYPE_INFO_subtypes &at[189] -#define ID2S_FEAT_TYPE_INFO_subtypes_E &at[190] - -#define ID2S_CHUNK &at[200] -#define ID2S_CHUNK_data &at[201] -#define ID2S_CHUNK_data_E &at[202] - -#define ID2S_CHUNK_DATA &at[203] -#define ID2S_CHUNK_DATA_id &at[204] -#define ID2S_CHUNK_DATA_id_bioseq_set &at[205] -#define ID2S_CHUNK_DATA_id_gi &at[206] -#define ID2S_CHUNK_DATA_descrs &at[207] -#define ID2S_CHUNK_DATA_descrs_E &at[208] -#define ID2S_CHUNK_DATA_annots &at[209] -#define ID2S_CHUNK_DATA_annots_E &at[210] -#define ID2S_CHUNK_DATA_assembly &at[211] -#define ID2S_CHUNK_DATA_assembly_E &at[212] -#define ID2S_CHUNK_DATA_seq_map &at[213] -#define ID2S_CHUNK_DATA_seq_map_E &at[214] -#define ID2S_CHUNK_DATA_seq_data &at[215] -#define ID2S_CHUNK_DATA_seq_data_E &at[216] - -#define ID2_INTERVAL &at[65] -#define ID2_INTERVAL_gi &at[66] -#define ID2_INTERVAL_start &at[67] -#define ID2_INTERVAL_length &at[68] - -#define ID2_PACKED_SEQ_INTS &at[70] -#define ID2_PACKED_SEQ_INTS_gi &at[71] -#define ID2_PACKED_SEQ_INTS_ints &at[72] -#define ID2_PACKED_SEQ_INTS_ints_E &at[73] - -#define ID2_SEQ_RANGE &at[74] -#define ID2_SEQ_RANGE_start &at[75] -#define ID2_SEQ_RANGE_length &at[76] - -#define ID2_PARAM &at[13] -#define ID2_PARAM_name &at[14] -#define ID2_PARAM_value &at[16] -#define ID2_PARAM_value_E &at[17] -#define ID2_PARAM_type &at[19] +#define ID2_REQUEST_PACKET &at[4] +#define ID2_REQUEST_PACKET_E &at[5] + +#define ID2_REQUEST &at[6] +#define ID2_REQUEST_serial_number &at[7] +#define ID2_REQUEST_params &at[9] +#define ID2_REQUEST_request &at[21] +#define ID2_REQUEST_request_init &at[22] +#define REQUEST_request_get_packages &at[24] +#define ID2_REQUEST_request_get_seq_id &at[29] +#define ID2_REQUEST_request_get_blob_id &at[37] +#define REQUEST_request_get_blob_info &at[43] +#define ID2_REQUEST_request_reget_blob &at[66] +#define ID2_REQUEST_request_get_chunks &at[71] + +#define ID2_PARAMS &at[10] +#define ID2_PARAMS_E &at[11] + +#define ID2_REQUEST_GET_PACKAGES &at[25] +#define ID2_REQUEST_GET_PACKAGES_names &at[26] +#define REQUEST_GET_PACKAGES_names_E &at[27] +#define GET_PACKAGES_no_contents &at[28] + +#define ID2_REQUEST_GET_SEQ_ID &at[30] +#define ID2_REQUEST_GET_SEQ_ID_seq_id &at[31] +#define REQUEST_GET_SEQ_ID_seq_id_type &at[36] + +#define ID2_REQUEST_GET_BLOB_ID &at[38] +#define ID2_REQUEST_GET_BLOB_ID_seq_id &at[39] +#define ID2_REQUEST_GET_BLOB_ID_sources &at[40] +#define REQUEST_GET_BLOB_ID_sources_E &at[41] +#define REQUEST_GET_BLOB_ID_external &at[42] + +#define ID2_REQUEST_GET_BLOB_INFO &at[44] +#define REQUEST_GET_BLOB_INFO_blob_id &at[45] +#define GET_BLOB_INFO_blob_id_blob_id &at[46] +#define GET_BLOB_INFO_blob_id_resolve &at[52] +#define INFO_blob_id_resolve_request &at[53] +#define blob_id_resolve_exclude_blobs &at[54] +#define id_resolve_exclude_blobs_E &at[55] +#define GET_BLOB_INFO_get_seq_ids &at[56] +#define REQUEST_GET_BLOB_INFO_get_data &at[57] + +#define ID2_REQUEST_REGET_BLOB &at[67] +#define ID2_REQUEST_REGET_BLOB_blob_id &at[68] +#define REGET_BLOB_split_version &at[69] +#define ID2_REQUEST_REGET_BLOB_offset &at[70] + +#define ID2S_REQUEST_GET_CHUNKS &at[72] +#define ID2S_REQUEST_GET_CHUNKS_blob_id &at[73] +#define ID2S_REQUEST_GET_CHUNKS_chunks &at[74] +#define REQUEST_GET_CHUNKS_chunks_E &at[75] + +#define ID2_SEQ_ID &at[32] +#define ID2_SEQ_ID_string &at[33] +#define ID2_SEQ_ID_seq_id &at[34] + +#define ID2_BLOB_ID &at[47] +#define ID2_BLOB_ID_sat &at[48] +#define ID2_BLOB_ID_sub_sat &at[49] +#define ID2_BLOB_ID_sat_key &at[50] +#define ID2_BLOB_ID_version &at[51] + +#define ID2_GET_BLOB_DETAILS &at[58] +#define ID2_GET_BLOB_DETAILS_location &at[59] +#define BLOB_DETAILS_seq_class_level &at[60] +#define GET_BLOB_DETAILS_descr_level &at[61] +#define BLOB_DETAILS_descr_type_mask &at[62] +#define BLOB_DETAILS_annot_type_mask &at[63] +#define BLOB_DETAILS_feat_type_mask &at[64] +#define BLOB_DETAILS_sequence_level &at[65] + +#define ID2_REPLY &at[76] +#define ID2_REPLY_serial_number &at[77] +#define ID2_REPLY_params &at[78] +#define ID2_REPLY_error &at[79] +#define ID2_REPLY_error_E &at[80] +#define ID2_REPLY_end_of_reply &at[85] +#define ID2_REPLY_reply &at[86] +#define ID2_REPLY_reply_init &at[87] +#define ID2_REPLY_reply_empty &at[88] +#define ID2_REPLY_reply_get_package &at[89] +#define ID2_REPLY_reply_get_seq_id &at[93] +#define ID2_REPLY_reply_get_blob_id &at[98] +#define REPLY_reply_get_blob_seq_ids &at[105] +#define ID2_REPLY_reply_get_blob &at[116] +#define ID2_REPLY_reply_reget_blob &at[121] +#define ID2_REPLY_reply_get_split_info &at[127] +#define ID2_REPLY_reply_get_chunk &at[132] + +#define ID2_ERROR &at[81] +#define ID2_ERROR_severity &at[82] +#define ID2_ERROR_retry_delay &at[83] +#define ID2_ERROR_message &at[84] + +#define ID2_REPLY_GET_PACKAGE &at[90] +#define ID2_REPLY_GET_PACKAGE_name &at[91] +#define ID2_REPLY_GET_PACKAGE_params &at[92] + +#define ID2_REPLY_GET_SEQ_ID &at[94] +#define ID2_REPLY_GET_SEQ_ID_request &at[95] +#define ID2_REPLY_GET_SEQ_ID_seq_id &at[96] +#define ID2_REPLY_GET_SEQ_ID_seq_id_E &at[97] + +#define ID2_REPLY_GET_BLOB_ID &at[99] +#define ID2_REPLY_GET_BLOB_ID_seq_id &at[100] +#define ID2_REPLY_GET_BLOB_ID_blob_id &at[101] +#define GET_BLOB_ID_split_version &at[102] +#define REPLY_GET_BLOB_ID_annot_info &at[103] +#define REPLY_GET_BLOB_ID_annot_info_E &at[104] + +#define ID2_REPLY_GET_BLOB_SEQ_IDS &at[106] +#define REPLY_GET_BLOB_SEQ_IDS_blob_id &at[107] +#define ID2_REPLY_GET_BLOB_SEQ_IDS_ids &at[108] + +#define ID2_REPLY_GET_BLOB &at[117] +#define ID2_REPLY_GET_BLOB_blob_id &at[118] +#define REPLY_GET_BLOB_split_version &at[119] +#define ID2_REPLY_GET_BLOB_data &at[120] + +#define ID2_REPLY_REGET_BLOB &at[122] +#define ID2_REPLY_REGET_BLOB_blob_id &at[123] +#define REPLY_REGET_BLOB_split_version &at[124] +#define ID2_REPLY_REGET_BLOB_offset &at[125] +#define ID2_REPLY_REGET_BLOB_data &at[126] + +#define ID2S_REPLY_GET_SPLIT_INFO &at[128] +#define REPLY_GET_SPLIT_INFO_blob_id &at[129] +#define GET_SPLIT_INFO_split_version &at[130] +#define ID2S_REPLY_GET_SPLIT_INFO_data &at[131] + +#define ID2S_REPLY_GET_CHUNK &at[133] +#define ID2S_REPLY_GET_CHUNK_blob_id &at[134] +#define ID2S_REPLY_GET_CHUNK_chunk_id &at[135] +#define ID2S_REPLY_GET_CHUNK_data &at[136] + +#define ID2_REPLY_DATA &at[109] +#define ID2_REPLY_DATA_data_type &at[110] +#define ID2_REPLY_DATA_data_format &at[111] +#define ID2_REPLY_DATA_data_compression &at[112] +#define ID2_REPLY_DATA_data &at[113] +#define ID2_REPLY_DATA_data_E &at[114] + +#define ID2_BLOB_SEQ_IDS &at[137] +#define ID2_BLOB_SEQ_IDS_E &at[138] + +#define ID2_BLOB_SEQ_ID &at[139] +#define ID2_BLOB_SEQ_ID_seq_id &at[140] +#define ID2_BLOB_SEQ_ID_replaced &at[141] + +#define ID2_PARAM &at[12] +#define ID2_PARAM_name &at[13] +#define ID2_PARAM_value &at[15] +#define ID2_PARAM_value_E &at[16] +#define ID2_PARAM_type &at[18] diff --git a/network/id2arch/id2gen.h b/network/id2arch/id2gen.h index c17237b4..c88e6c92 100644 --- a/network/id2arch/id2gen.h +++ b/network/id2arch/id2gen.h @@ -17,7 +17,7 @@ extern "C" { /* } */ /************************************************** * * Generated objects for Module NCBI-ID2Access -* Generated using ASNCODE Revision: 6.0 at Dec 15, 2003 5:08 PM +* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM * **************************************************/ @@ -73,12 +73,11 @@ typedef ValNode Request_request; #define Request_request_init 1 #define Request_request_get_packages 2 -#define Request_request_string_to_gi 3 -#define Request_request_seq_id_to_gi 4 -#define Request_request_gi_to_tse_id 5 -#define Request_request_get_tse 6 -#define Request_request_reget_tse 7 -#define Request_request_get_chunks 8 +#define Request_request_get_seq_id 3 +#define Request_request_get_blob_id 4 +#define Request_request_get_blob_info 5 +#define Request_request_reget_blob 6 +#define Request_request_get_chunks 7 #ifdef NLM_GENERATED_CODE_PROTO @@ -130,110 +129,74 @@ NLM_EXTERN Boolean LIBCALL ID2RequestGetPackagesAsnWrite PROTO (( ID2RequestGetP /************************************************** * -* ID2RequestStringToGi +* ID2RequestGetSeqId * **************************************************/ -typedef struct struct_ID2_Request_String_To_Gi { - CharPtr id; -} ID2RequestStringToGi, PNTR ID2RequestStringToGiPtr; - - -NLM_EXTERN ID2RequestStringToGiPtr LIBCALL ID2RequestStringToGiFree PROTO ((ID2RequestStringToGiPtr )); -NLM_EXTERN ID2RequestStringToGiPtr LIBCALL ID2RequestStringToGiNew PROTO (( void )); -NLM_EXTERN ID2RequestStringToGiPtr LIBCALL ID2RequestStringToGiAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2RequestStringToGiAsnWrite PROTO (( ID2RequestStringToGiPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2RequestSeqIdToGi -* -**************************************************/ -typedef struct struct_ID2_Request_Seq_id_To_Gi { +typedef struct struct_ID2_Request_Get_Seq_id { ValNodePtr seq_id; -} ID2RequestSeqIdToGi, PNTR ID2RequestSeqIdToGiPtr; + Int4 seq_id_type; +} ID2RequestGetSeqId, PNTR ID2RequestGetSeqIdPtr; -NLM_EXTERN ID2RequestSeqIdToGiPtr LIBCALL ID2RequestSeqIdToGiFree PROTO ((ID2RequestSeqIdToGiPtr )); -NLM_EXTERN ID2RequestSeqIdToGiPtr LIBCALL ID2RequestSeqIdToGiNew PROTO (( void )); -NLM_EXTERN ID2RequestSeqIdToGiPtr LIBCALL ID2RequestSeqIdToGiAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2RequestSeqIdToGiAsnWrite PROTO (( ID2RequestSeqIdToGiPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2RequestGetSeqIdPtr LIBCALL ID2RequestGetSeqIdFree PROTO ((ID2RequestGetSeqIdPtr )); +NLM_EXTERN ID2RequestGetSeqIdPtr LIBCALL ID2RequestGetSeqIdNew PROTO (( void )); +NLM_EXTERN ID2RequestGetSeqIdPtr LIBCALL ID2RequestGetSeqIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2RequestGetSeqIdAsnWrite PROTO (( ID2RequestGetSeqIdPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2RequestGiToTSEId +* ID2RequestGetBlobId * **************************************************/ -typedef struct struct_ID2_Request_Gi_To_TSE_Id { - ValNodePtr Gi_gi; +typedef struct struct_ID2_Request_Get_Blob_Id { + struct struct_ID2_Request_Get_Seq_id PNTR seq_id; ValNodePtr sources; Uint1 external; - Uint1 current_gis; -} ID2RequestGiToTSEId, PNTR ID2RequestGiToTSEIdPtr; - - -NLM_EXTERN ID2RequestGiToTSEIdPtr LIBCALL ID2RequestGiToTSEIdFree PROTO ((ID2RequestGiToTSEIdPtr )); -NLM_EXTERN ID2RequestGiToTSEIdPtr LIBCALL ID2RequestGiToTSEIdNew PROTO (( void )); -NLM_EXTERN ID2RequestGiToTSEIdPtr LIBCALL ID2RequestGiToTSEIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2RequestGiToTSEIdAsnWrite PROTO (( ID2RequestGiToTSEIdPtr , AsnIoPtr, AsnTypePtr)); - - -#ifdef NLM_GENERATED_CODE_PROTO - -typedef ValNodePtr Gi_giPtr; -typedef ValNode Gi_gi; +} ID2RequestGetBlobId, PNTR ID2RequestGetBlobIdPtr; -#endif /* NLM_GENERATED_CODE_PROTO */ - -#define Gi_gi_gi 1 -#define Gi_gi_string 2 -#define Gi_gi_seq_id 3 - -#ifdef NLM_GENERATED_CODE_PROTO -static Gi_giPtr LIBCALL Gi_giFree PROTO ((Gi_giPtr )); -static Gi_giPtr LIBCALL Gi_giAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -static Boolean LIBCALL Gi_giAsnWrite PROTO (( Gi_giPtr , AsnIoPtr, AsnTypePtr)); - -#endif /* NLM_GENERATED_CODE_PROTO */ +NLM_EXTERN ID2RequestGetBlobIdPtr LIBCALL ID2RequestGetBlobIdFree PROTO ((ID2RequestGetBlobIdPtr )); +NLM_EXTERN ID2RequestGetBlobIdPtr LIBCALL ID2RequestGetBlobIdNew PROTO (( void )); +NLM_EXTERN ID2RequestGetBlobIdPtr LIBCALL ID2RequestGetBlobIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2RequestGetBlobIdAsnWrite PROTO (( ID2RequestGetBlobIdPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2RequestGetTSE +* ID2RequestGetBlobInfo * **************************************************/ -typedef struct struct_ID2_Request_Get_TSE { - ValNodePtr TseId_tse_id; - struct struct_ID2_Get_TSE_Details PNTR details; -} ID2RequestGetTSE, PNTR ID2RequestGetTSEPtr; +typedef struct struct_ID2_Request_Get_Blob_Info { + ValNodePtr BlobId_blob_id; + Uint1 get_seq_ids; + struct struct_ID2_Get_Blob_Details PNTR get_data; +} ID2RequestGetBlobInfo, PNTR ID2RequestGetBlobInfoPtr; -NLM_EXTERN ID2RequestGetTSEPtr LIBCALL ID2RequestGetTSEFree PROTO ((ID2RequestGetTSEPtr )); -NLM_EXTERN ID2RequestGetTSEPtr LIBCALL ID2RequestGetTSENew PROTO (( void )); -NLM_EXTERN ID2RequestGetTSEPtr LIBCALL ID2RequestGetTSEAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2RequestGetTSEAsnWrite PROTO (( ID2RequestGetTSEPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2RequestGetBlobInfoPtr LIBCALL ID2RequestGetBlobInfoFree PROTO ((ID2RequestGetBlobInfoPtr )); +NLM_EXTERN ID2RequestGetBlobInfoPtr LIBCALL ID2RequestGetBlobInfoNew PROTO (( void )); +NLM_EXTERN ID2RequestGetBlobInfoPtr LIBCALL ID2RequestGetBlobInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2RequestGetBlobInfoAsnWrite PROTO (( ID2RequestGetBlobInfoPtr , AsnIoPtr, AsnTypePtr)); #ifdef NLM_GENERATED_CODE_PROTO -typedef ValNodePtr TseId_tse_idPtr; -typedef ValNode TseId_tse_id; +typedef ValNodePtr BlobId_blob_idPtr; +typedef ValNode BlobId_blob_id; #endif /* NLM_GENERATED_CODE_PROTO */ -#define TseId_tse_id_tse_id 1 -#define TseId_tse_id_TseId_Gi 2 +#define BlobId_blob_id_blob_id 1 +#define BlobId_blob_id_BlobId_Resolve 2 #ifdef NLM_GENERATED_CODE_PROTO -static TseId_tse_idPtr LIBCALL TseId_tse_idFree PROTO ((TseId_tse_idPtr )); -static TseId_tse_idPtr LIBCALL TseId_tse_idAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -static Boolean LIBCALL TseId_tse_idAsnWrite PROTO (( TseId_tse_idPtr , AsnIoPtr, AsnTypePtr)); +static BlobId_blob_idPtr LIBCALL BlobId_blob_idFree PROTO ((BlobId_blob_idPtr )); +static BlobId_blob_idPtr LIBCALL BlobId_blob_idAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +static Boolean LIBCALL BlobId_blob_idAsnWrite PROTO (( BlobId_blob_idPtr , AsnIoPtr, AsnTypePtr)); #endif /* NLM_GENERATED_CODE_PROTO */ @@ -241,24 +204,24 @@ static Boolean LIBCALL TseId_tse_idAsnWrite PROTO (( TseId_tse_idPtr , AsnIoPtr, /************************************************** * -* TseId_gi +* BlobId_resolve * **************************************************/ #ifdef NLM_GENERATED_CODE_PROTO -typedef struct struct_TseId_Gi { - struct struct_ID2_Request_Gi_To_TSE_Id PNTR request; - struct struct_ID2_TSE_Id PNTR exclude_tses; -} TseId_gi, PNTR TseId_giPtr; +typedef struct struct_BlobId_Resolve { + struct struct_ID2_Request_Get_Blob_Id PNTR request; + struct struct_ID2_Blob_Id PNTR exclude_blobs; +} BlobId_resolve, PNTR BlobId_resolvePtr; #endif /* NLM_GENERATED_CODE_PROTO */ #ifdef NLM_GENERATED_CODE_PROTO -static TseId_giPtr LIBCALL TseId_giFree PROTO ((TseId_giPtr )); -static TseId_giPtr LIBCALL TseId_giNew PROTO (( void )); -static TseId_giPtr LIBCALL TseId_giAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -static Boolean LIBCALL TseId_giAsnWrite PROTO (( TseId_giPtr , AsnIoPtr, AsnTypePtr)); +static BlobId_resolvePtr LIBCALL BlobId_resolveFree PROTO ((BlobId_resolvePtr )); +static BlobId_resolvePtr LIBCALL BlobId_resolveNew PROTO (( void )); +static BlobId_resolvePtr LIBCALL BlobId_resolveAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +static Boolean LIBCALL BlobId_resolveAsnWrite PROTO (( BlobId_resolvePtr , AsnIoPtr, AsnTypePtr)); #endif /* NLM_GENERATED_CODE_PROTO */ @@ -266,20 +229,20 @@ static Boolean LIBCALL TseId_giAsnWrite PROTO (( TseId_giPtr , AsnIoPtr, AsnType /************************************************** * -* ID2RequestReGetTSE +* ID2RequestReGetBlob * **************************************************/ -typedef struct struct_ID2_Request_ReGet_TSE { - struct struct_ID2_TSE_Id PNTR tse_id; - struct struct_ID2_Get_TSE_Details PNTR details; +typedef struct struct_ID2_Request_ReGet_Blob { + struct struct_ID2_Blob_Id PNTR blob_id; + Int4 split_version; Int4 offset; -} ID2RequestReGetTSE, PNTR ID2RequestReGetTSEPtr; +} ID2RequestReGetBlob, PNTR ID2RequestReGetBlobPtr; -NLM_EXTERN ID2RequestReGetTSEPtr LIBCALL ID2RequestReGetTSEFree PROTO ((ID2RequestReGetTSEPtr )); -NLM_EXTERN ID2RequestReGetTSEPtr LIBCALL ID2RequestReGetTSENew PROTO (( void )); -NLM_EXTERN ID2RequestReGetTSEPtr LIBCALL ID2RequestReGetTSEAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2RequestReGetTSEAsnWrite PROTO (( ID2RequestReGetTSEPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2RequestReGetBlobPtr LIBCALL ID2RequestReGetBlobFree PROTO ((ID2RequestReGetBlobPtr )); +NLM_EXTERN ID2RequestReGetBlobPtr LIBCALL ID2RequestReGetBlobNew PROTO (( void )); +NLM_EXTERN ID2RequestReGetBlobPtr LIBCALL ID2RequestReGetBlobAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2RequestReGetBlobAsnWrite PROTO (( ID2RequestReGetBlobPtr , AsnIoPtr, AsnTypePtr)); @@ -289,7 +252,7 @@ NLM_EXTERN Boolean LIBCALL ID2RequestReGetTSEAsnWrite PROTO (( ID2RequestReGetTS * **************************************************/ typedef struct struct_ID2S_Request_Get_Chunks { - struct struct_ID2_TSE_Id PNTR tse_id; + struct struct_ID2_Blob_Id PNTR blob_id; ValNodePtr chunks; } ID2SRequestGetChunks, PNTR ID2SRequestGetChunksPtr; @@ -299,33 +262,45 @@ NLM_EXTERN ID2SRequestGetChunksPtr LIBCALL ID2SRequestGetChunksNew PROTO (( void NLM_EXTERN ID2SRequestGetChunksPtr LIBCALL ID2SRequestGetChunksAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); NLM_EXTERN Boolean LIBCALL ID2SRequestGetChunksAsnWrite PROTO (( ID2SRequestGetChunksPtr , AsnIoPtr, AsnTypePtr)); +typedef ValNodePtr ID2SeqIdPtr; +typedef ValNode ID2SeqId; +#define ID2SeqId_string 1 +#define ID2SeqId_seq_id 2 + + +NLM_EXTERN ID2SeqIdPtr LIBCALL ID2SeqIdFree PROTO ((ID2SeqIdPtr )); +NLM_EXTERN ID2SeqIdPtr LIBCALL ID2SeqIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SeqIdAsnWrite PROTO (( ID2SeqIdPtr , AsnIoPtr, AsnTypePtr)); + /************************************************** * -* ID2TSEId +* ID2BlobId * **************************************************/ -typedef struct struct_ID2_TSE_Id { - struct struct_ID2_TSE_Id PNTR next; +typedef struct struct_ID2_Blob_Id { + struct struct_ID2_Blob_Id PNTR next; Int4 sat; + Int4 sub_sat; Int4 sat_key; -} ID2TSEId, PNTR ID2TSEIdPtr; + Int4 version; +} ID2BlobId, PNTR ID2BlobIdPtr; -NLM_EXTERN ID2TSEIdPtr LIBCALL ID2TSEIdFree PROTO ((ID2TSEIdPtr )); -NLM_EXTERN ID2TSEIdPtr LIBCALL ID2TSEIdNew PROTO (( void )); -NLM_EXTERN ID2TSEIdPtr LIBCALL ID2TSEIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2TSEIdAsnWrite PROTO (( ID2TSEIdPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2BlobIdPtr LIBCALL ID2BlobIdFree PROTO ((ID2BlobIdPtr )); +NLM_EXTERN ID2BlobIdPtr LIBCALL ID2BlobIdNew PROTO (( void )); +NLM_EXTERN ID2BlobIdPtr LIBCALL ID2BlobIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2BlobIdAsnWrite PROTO (( ID2BlobIdPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2GetTSEDetails +* ID2GetBlobDetails * **************************************************/ -typedef struct struct_ID2_Get_TSE_Details { +typedef struct struct_ID2_Get_Blob_Details { ValNodePtr location; Int4 seq_class_level; Int4 descr_level; @@ -334,30 +309,17 @@ typedef struct struct_ID2_Get_TSE_Details { Int4 feat_type_mask; Uint2 sequence_level; /* following #defines are for enumerated type, not used by object loaders */ -#define ID2_Get_TSE_Details_sequence_level_none 0 -#define ID2_Get_TSE_Details_sequence_level_seq_map 1 -#define ID2_Get_TSE_Details_sequence_level_seq_data 2 - -} ID2GetTSEDetails, PNTR ID2GetTSEDetailsPtr; - +#define ID2_Get_Blob_Details_sequence_level_none 0 +#define ID2_Get_Blob_Details_sequence_level_seq_map 1 +#define ID2_Get_Blob_Details_sequence_level_seq_data 2 -NLM_EXTERN ID2GetTSEDetailsPtr LIBCALL ID2GetTSEDetailsFree PROTO ((ID2GetTSEDetailsPtr )); -NLM_EXTERN ID2GetTSEDetailsPtr LIBCALL ID2GetTSEDetailsNew PROTO (( void )); -NLM_EXTERN ID2GetTSEDetailsPtr LIBCALL ID2GetTSEDetailsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2GetTSEDetailsAsnWrite PROTO (( ID2GetTSEDetailsPtr , AsnIoPtr, AsnTypePtr)); +} ID2GetBlobDetails, PNTR ID2GetBlobDetailsPtr; -typedef ValNodePtr ID2SeqLocPtr; -typedef ValNode ID2SeqLoc; -#define ID2SeqLoc_whole 1 -#define ID2SeqLoc_int__ 2 -#define ID2SeqLoc_int_set 3 -#define ID2SeqLoc_whole_range 4 -#define ID2SeqLoc_loc_set 5 - -NLM_EXTERN ID2SeqLocPtr LIBCALL ID2SeqLocFree PROTO ((ID2SeqLocPtr )); -NLM_EXTERN ID2SeqLocPtr LIBCALL ID2SeqLocAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SeqLocAsnWrite PROTO (( ID2SeqLocPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2GetBlobDetailsPtr LIBCALL ID2GetBlobDetailsFree PROTO ((ID2GetBlobDetailsPtr )); +NLM_EXTERN ID2GetBlobDetailsPtr LIBCALL ID2GetBlobDetailsNew PROTO (( void )); +NLM_EXTERN ID2GetBlobDetailsPtr LIBCALL ID2GetBlobDetailsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2GetBlobDetailsAsnWrite PROTO (( ID2GetBlobDetailsPtr , AsnIoPtr, AsnTypePtr)); @@ -369,9 +331,9 @@ NLM_EXTERN Boolean LIBCALL ID2SeqLocAsnWrite PROTO (( ID2SeqLocPtr , AsnIoPtr, A typedef struct struct_ID2_Reply { Int4 serial_number; struct struct_ID2_Param PNTR params; - ValNodePtr Reply_reply; struct struct_ID2_Error PNTR error; Uint1 end_of_reply; + ValNodePtr Reply_reply; } ID2Reply, PNTR ID2ReplyPtr; @@ -389,12 +351,15 @@ typedef ValNode Reply_reply; #endif /* NLM_GENERATED_CODE_PROTO */ #define Reply_reply_init 1 -#define Reply_reply_get_package 2 -#define Reply_reply_seq_id_to_gi 3 -#define Reply_reply_gi_to_tse_id 4 -#define Reply_reply_get_tse 5 -#define Reply_reply_get_tse_info 6 -#define Reply_reply_get_chunk 7 +#define Reply_reply_empty 2 +#define Reply_reply_get_package 3 +#define Reply_reply_get_seq_id 4 +#define Reply_reply_get_blob_id 5 +#define Reply_reply_get_blob_seq_ids 6 +#define Reply_reply_get_blob 7 +#define Reply_reply_reget_blob 8 +#define Reply_reply_get_split_info 9 +#define Reply_reply_get_chunk 10 #ifdef NLM_GENERATED_CODE_PROTO @@ -408,117 +373,6 @@ static Boolean LIBCALL Reply_replyAsnWrite PROTO (( Reply_replyPtr , AsnIoPtr, A /************************************************** * -* ID2ReplyGetPackage -* -**************************************************/ -typedef struct struct_ID2_Reply_Get_Package { - CharPtr name; - struct struct_ID2_Param PNTR params; -} ID2ReplyGetPackage, PNTR ID2ReplyGetPackagePtr; - - -NLM_EXTERN ID2ReplyGetPackagePtr LIBCALL ID2ReplyGetPackageFree PROTO ((ID2ReplyGetPackagePtr )); -NLM_EXTERN ID2ReplyGetPackagePtr LIBCALL ID2ReplyGetPackageNew PROTO (( void )); -NLM_EXTERN ID2ReplyGetPackagePtr LIBCALL ID2ReplyGetPackageAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2ReplyGetPackageAsnWrite PROTO (( ID2ReplyGetPackagePtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2ReplySeqIdToGi -* -**************************************************/ -typedef struct struct_ID2_Reply_Seq_id_To_Gi { - ValNodePtr seq_id; - Int4 gi; -} ID2ReplySeqIdToGi, PNTR ID2ReplySeqIdToGiPtr; - - -NLM_EXTERN ID2ReplySeqIdToGiPtr LIBCALL ID2ReplySeqIdToGiFree PROTO ((ID2ReplySeqIdToGiPtr )); -NLM_EXTERN ID2ReplySeqIdToGiPtr LIBCALL ID2ReplySeqIdToGiNew PROTO (( void )); -NLM_EXTERN ID2ReplySeqIdToGiPtr LIBCALL ID2ReplySeqIdToGiAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2ReplySeqIdToGiAsnWrite PROTO (( ID2ReplySeqIdToGiPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2ReplyGiToTSEId -* -**************************************************/ -typedef struct struct_ID2_Reply_Gi_To_TSE_Id { - Int4 gi; - CharPtr source; - struct struct_ID2_TSE_Id_Info PNTR tses; -} ID2ReplyGiToTSEId, PNTR ID2ReplyGiToTSEIdPtr; - - -NLM_EXTERN ID2ReplyGiToTSEIdPtr LIBCALL ID2ReplyGiToTSEIdFree PROTO ((ID2ReplyGiToTSEIdPtr )); -NLM_EXTERN ID2ReplyGiToTSEIdPtr LIBCALL ID2ReplyGiToTSEIdNew PROTO (( void )); -NLM_EXTERN ID2ReplyGiToTSEIdPtr LIBCALL ID2ReplyGiToTSEIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2ReplyGiToTSEIdAsnWrite PROTO (( ID2ReplyGiToTSEIdPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2ReplyGetTSE -* -**************************************************/ -typedef struct struct_ID2_Reply_Get_TSE { - struct struct_ID2_TSE_Id PNTR tse_id; - struct struct_ID2_Reply_Data PNTR data; -} ID2ReplyGetTSE, PNTR ID2ReplyGetTSEPtr; - - -NLM_EXTERN ID2ReplyGetTSEPtr LIBCALL ID2ReplyGetTSEFree PROTO ((ID2ReplyGetTSEPtr )); -NLM_EXTERN ID2ReplyGetTSEPtr LIBCALL ID2ReplyGetTSENew PROTO (( void )); -NLM_EXTERN ID2ReplyGetTSEPtr LIBCALL ID2ReplyGetTSEAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2ReplyGetTSEAsnWrite PROTO (( ID2ReplyGetTSEPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2SReplyGetTSEInfo -* -**************************************************/ -typedef struct struct_ID2S_Reply_Get_TSE_Info { - struct struct_ID2_TSE_Id PNTR tse_id; - Int4 split_version; - struct struct_ID2_Reply_Data PNTR info; -} ID2SReplyGetTSEInfo, PNTR ID2SReplyGetTSEInfoPtr; - - -NLM_EXTERN ID2SReplyGetTSEInfoPtr LIBCALL ID2SReplyGetTSEInfoFree PROTO ((ID2SReplyGetTSEInfoPtr )); -NLM_EXTERN ID2SReplyGetTSEInfoPtr LIBCALL ID2SReplyGetTSEInfoNew PROTO (( void )); -NLM_EXTERN ID2SReplyGetTSEInfoPtr LIBCALL ID2SReplyGetTSEInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SReplyGetTSEInfoAsnWrite PROTO (( ID2SReplyGetTSEInfoPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2SReplyGetChunk -* -**************************************************/ -typedef struct struct_ID2S_Reply_Get_Chunk { - struct struct_ID2_TSE_Id PNTR tse_id; - Int4 chunk_id; - struct struct_ID2_Reply_Data PNTR data; -} ID2SReplyGetChunk, PNTR ID2SReplyGetChunkPtr; - - -NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkFree PROTO ((ID2SReplyGetChunkPtr )); -NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkNew PROTO (( void )); -NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SReplyGetChunkAsnWrite PROTO (( ID2SReplyGetChunkPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* * ID2Error * **************************************************/ @@ -549,325 +403,190 @@ NLM_EXTERN Boolean LIBCALL ID2ErrorAsnWrite PROTO (( ID2ErrorPtr , AsnIoPtr, Asn /************************************************** * -* ID2TSEIdInfo -* -**************************************************/ -typedef struct struct_ID2_TSE_Id_Info { - struct struct_ID2_TSE_Id_Info PNTR next; - struct struct_ID2_TSE_Id PNTR tse_id; - Int4 split_version; -} ID2TSEIdInfo, PNTR ID2TSEIdInfoPtr; - - -NLM_EXTERN ID2TSEIdInfoPtr LIBCALL ID2TSEIdInfoFree PROTO ((ID2TSEIdInfoPtr )); -NLM_EXTERN ID2TSEIdInfoPtr LIBCALL ID2TSEIdInfoNew PROTO (( void )); -NLM_EXTERN ID2TSEIdInfoPtr LIBCALL ID2TSEIdInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2TSEIdInfoAsnWrite PROTO (( ID2TSEIdInfoPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2ReplyData -* -**************************************************/ -typedef struct struct_ID2_Reply_Data { - Int4 data_type; - Int4 data_format; - Int4 data_compression; - ValNodePtr data; -} ID2ReplyData, PNTR ID2ReplyDataPtr; - - -NLM_EXTERN ID2ReplyDataPtr LIBCALL ID2ReplyDataFree PROTO ((ID2ReplyDataPtr )); -NLM_EXTERN ID2ReplyDataPtr LIBCALL ID2ReplyDataNew PROTO (( void )); -NLM_EXTERN ID2ReplyDataPtr LIBCALL ID2ReplyDataAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2ReplyDataAsnWrite PROTO (( ID2ReplyDataPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2SSplitInfo -* -**************************************************/ -typedef struct struct_ID2S_Split_Info { - struct struct_ID2S_Bioseqs_Info PNTR bioseqs_info; - struct struct_ID2S_Chunk_Info PNTR chunks; -} ID2SSplitInfo, PNTR ID2SSplitInfoPtr; - - -NLM_EXTERN ID2SSplitInfoPtr LIBCALL ID2SSplitInfoFree PROTO ((ID2SSplitInfoPtr )); -NLM_EXTERN ID2SSplitInfoPtr LIBCALL ID2SSplitInfoNew PROTO (( void )); -NLM_EXTERN ID2SSplitInfoPtr LIBCALL ID2SSplitInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SSplitInfoAsnWrite PROTO (( ID2SSplitInfoPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2SBioseqsInfo -* -**************************************************/ -typedef struct struct_ID2S_Bioseqs_Info { - struct struct_ID2S_Bioseqs_Info PNTR next; - struct struct_ID2S_Bioseq_Info PNTR info; - struct struct_ID2_Id_Range PNTR bioseqs; -} ID2SBioseqsInfo, PNTR ID2SBioseqsInfoPtr; - - -NLM_EXTERN ID2SBioseqsInfoPtr LIBCALL ID2SBioseqsInfoFree PROTO ((ID2SBioseqsInfoPtr )); -NLM_EXTERN ID2SBioseqsInfoPtr LIBCALL ID2SBioseqsInfoNew PROTO (( void )); -NLM_EXTERN ID2SBioseqsInfoPtr LIBCALL ID2SBioseqsInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SBioseqsInfoAsnWrite PROTO (( ID2SBioseqsInfoPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2SChunkInfo +* ID2ReplyGetPackage * **************************************************/ -typedef struct struct_ID2S_Chunk_Info { - struct struct_ID2S_Chunk_Info PNTR next; - Int4 id; - ValNodePtr content; -} ID2SChunkInfo, PNTR ID2SChunkInfoPtr; +typedef struct struct_ID2_Reply_Get_Package { + CharPtr name; + struct struct_ID2_Param PNTR params; +} ID2ReplyGetPackage, PNTR ID2ReplyGetPackagePtr; -NLM_EXTERN ID2SChunkInfoPtr LIBCALL ID2SChunkInfoFree PROTO ((ID2SChunkInfoPtr )); -NLM_EXTERN ID2SChunkInfoPtr LIBCALL ID2SChunkInfoNew PROTO (( void )); -NLM_EXTERN ID2SChunkInfoPtr LIBCALL ID2SChunkInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SChunkInfoAsnWrite PROTO (( ID2SChunkInfoPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2ReplyGetPackagePtr LIBCALL ID2ReplyGetPackageFree PROTO ((ID2ReplyGetPackagePtr )); +NLM_EXTERN ID2ReplyGetPackagePtr LIBCALL ID2ReplyGetPackageNew PROTO (( void )); +NLM_EXTERN ID2ReplyGetPackagePtr LIBCALL ID2ReplyGetPackageAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2ReplyGetPackageAsnWrite PROTO (( ID2ReplyGetPackagePtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2SBioseqInfo +* ID2ReplyGetSeqId * **************************************************/ -typedef struct struct_ID2S_Bioseq_Info { - Int4 gap_count; - Uint1 seq_map_has_ref; - struct struct_ID2S_Sequence_Split_Info PNTR sequence_split; -} ID2SBioseqInfo, PNTR ID2SBioseqInfoPtr; +typedef struct struct_ID2_Reply_Get_Seq_id { + struct struct_ID2_Request_Get_Seq_id PNTR request; + ValNodePtr seq_id; +} ID2ReplyGetSeqId, PNTR ID2ReplyGetSeqIdPtr; -NLM_EXTERN ID2SBioseqInfoPtr LIBCALL ID2SBioseqInfoFree PROTO ((ID2SBioseqInfoPtr )); -NLM_EXTERN ID2SBioseqInfoPtr LIBCALL ID2SBioseqInfoNew PROTO (( void )); -NLM_EXTERN ID2SBioseqInfoPtr LIBCALL ID2SBioseqInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SBioseqInfoAsnWrite PROTO (( ID2SBioseqInfoPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2ReplyGetSeqIdPtr LIBCALL ID2ReplyGetSeqIdFree PROTO ((ID2ReplyGetSeqIdPtr )); +NLM_EXTERN ID2ReplyGetSeqIdPtr LIBCALL ID2ReplyGetSeqIdNew PROTO (( void )); +NLM_EXTERN ID2ReplyGetSeqIdPtr LIBCALL ID2ReplyGetSeqIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2ReplyGetSeqIdAsnWrite PROTO (( ID2ReplyGetSeqIdPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2IdRange +* ID2ReplyGetBlobId * **************************************************/ -typedef struct struct_ID2_Id_Range { - struct struct_ID2_Id_Range PNTR next; - Int4 start; - Int4 count; -} ID2IdRange, PNTR ID2IdRangePtr; +typedef struct struct_ID2_Reply_Get_Blob_Id { + ValNodePtr seq_id; + struct struct_ID2_Blob_Id PNTR blob_id; + Int4 split_version; + struct struct_ID2S_Seq_annot_Info PNTR annot_info; +} ID2ReplyGetBlobId, PNTR ID2ReplyGetBlobIdPtr; -NLM_EXTERN ID2IdRangePtr LIBCALL ID2IdRangeFree PROTO ((ID2IdRangePtr )); -NLM_EXTERN ID2IdRangePtr LIBCALL ID2IdRangeNew PROTO (( void )); -NLM_EXTERN ID2IdRangePtr LIBCALL ID2IdRangeAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2IdRangeAsnWrite PROTO (( ID2IdRangePtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2ReplyGetBlobIdPtr LIBCALL ID2ReplyGetBlobIdFree PROTO ((ID2ReplyGetBlobIdPtr )); +NLM_EXTERN ID2ReplyGetBlobIdPtr LIBCALL ID2ReplyGetBlobIdNew PROTO (( void )); +NLM_EXTERN ID2ReplyGetBlobIdPtr LIBCALL ID2ReplyGetBlobIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2ReplyGetBlobIdAsnWrite PROTO (( ID2ReplyGetBlobIdPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2SSequenceSplitInfo +* ID2ReplyGetBlobSeqIds * **************************************************/ -typedef struct struct_ID2S_Sequence_Split_Info { - Int4 block_size; - Int4 chunk_start; - ValNodePtr chunk_blocks; -} ID2SSequenceSplitInfo, PNTR ID2SSequenceSplitInfoPtr; - - -NLM_EXTERN ID2SSequenceSplitInfoPtr LIBCALL ID2SSequenceSplitInfoFree PROTO ((ID2SSequenceSplitInfoPtr )); -NLM_EXTERN ID2SSequenceSplitInfoPtr LIBCALL ID2SSequenceSplitInfoNew PROTO (( void )); -NLM_EXTERN ID2SSequenceSplitInfoPtr LIBCALL ID2SSequenceSplitInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SSequenceSplitInfoAsnWrite PROTO (( ID2SSequenceSplitInfoPtr , AsnIoPtr, AsnTypePtr)); +typedef struct struct_ID2_Reply_Get_Blob_Seq_ids { + struct struct_ID2_Blob_Id PNTR blob_id; + struct struct_ID2_Reply_Data PNTR ids; +} ID2ReplyGetBlobSeqIds, PNTR ID2ReplyGetBlobSeqIdsPtr; -typedef ValNodePtr ID2SChunkContentPtr; -typedef ValNode ID2SChunkContent; -#define ID2SChunkContent_seq_descr 1 -#define ID2SChunkContent_seq_annot 2 -#define ID2SChunkContent_seq_assembly 3 -#define ID2SChunkContent_seq_map 4 -#define ID2SChunkContent_seq_data 5 - -NLM_EXTERN ID2SChunkContentPtr LIBCALL ID2SChunkContentFree PROTO ((ID2SChunkContentPtr )); -NLM_EXTERN ID2SChunkContentPtr LIBCALL ID2SChunkContentAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SChunkContentAsnWrite PROTO (( ID2SChunkContentPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2ReplyGetBlobSeqIdsPtr LIBCALL ID2ReplyGetBlobSeqIdsFree PROTO ((ID2ReplyGetBlobSeqIdsPtr )); +NLM_EXTERN ID2ReplyGetBlobSeqIdsPtr LIBCALL ID2ReplyGetBlobSeqIdsNew PROTO (( void )); +NLM_EXTERN ID2ReplyGetBlobSeqIdsPtr LIBCALL ID2ReplyGetBlobSeqIdsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2ReplyGetBlobSeqIdsAsnWrite PROTO (( ID2ReplyGetBlobSeqIdsPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2SSeqDescrInfo +* ID2ReplyGetBlob * **************************************************/ -typedef struct struct_ID2S_Seq_descr_Info { - Int4 type_mask; - struct struct_ID2_Id_Range PNTR bioseqs; - struct struct_ID2_Id_Range PNTR bioseq_sets; -} ID2SSeqDescrInfo, PNTR ID2SSeqDescrInfoPtr; +typedef struct struct_ID2_Reply_Get_Blob { + struct struct_ID2_Blob_Id PNTR blob_id; + Int4 split_version; + struct struct_ID2_Reply_Data PNTR data; +} ID2ReplyGetBlob, PNTR ID2ReplyGetBlobPtr; -NLM_EXTERN ID2SSeqDescrInfoPtr LIBCALL ID2SSeqDescrInfoFree PROTO ((ID2SSeqDescrInfoPtr )); -NLM_EXTERN ID2SSeqDescrInfoPtr LIBCALL ID2SSeqDescrInfoNew PROTO (( void )); -NLM_EXTERN ID2SSeqDescrInfoPtr LIBCALL ID2SSeqDescrInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SSeqDescrInfoAsnWrite PROTO (( ID2SSeqDescrInfoPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2ReplyGetBlobPtr LIBCALL ID2ReplyGetBlobFree PROTO ((ID2ReplyGetBlobPtr )); +NLM_EXTERN ID2ReplyGetBlobPtr LIBCALL ID2ReplyGetBlobNew PROTO (( void )); +NLM_EXTERN ID2ReplyGetBlobPtr LIBCALL ID2ReplyGetBlobAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2ReplyGetBlobAsnWrite PROTO (( ID2ReplyGetBlobPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2SSeqAnnotInfo +* ID2ReplyReGetBlob * **************************************************/ -typedef struct struct_ID2S_Seq_annot_Info { - CharPtr name; - Uint1 align; - Uint1 graph; - struct struct_ID2S_Feat_type_Info PNTR feat; - ValNodePtr seq_loc; -} ID2SSeqAnnotInfo, PNTR ID2SSeqAnnotInfoPtr; +typedef struct struct_ID2_Reply_ReGet_Blob { + struct struct_ID2_Blob_Id PNTR blob_id; + Int4 split_version; + Int4 offset; + struct struct_ID2_Reply_Data PNTR data; +} ID2ReplyReGetBlob, PNTR ID2ReplyReGetBlobPtr; -NLM_EXTERN ID2SSeqAnnotInfoPtr LIBCALL ID2SSeqAnnotInfoFree PROTO ((ID2SSeqAnnotInfoPtr )); -NLM_EXTERN ID2SSeqAnnotInfoPtr LIBCALL ID2SSeqAnnotInfoNew PROTO (( void )); -NLM_EXTERN ID2SSeqAnnotInfoPtr LIBCALL ID2SSeqAnnotInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SSeqAnnotInfoAsnWrite PROTO (( ID2SSeqAnnotInfoPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2ReplyReGetBlobPtr LIBCALL ID2ReplyReGetBlobFree PROTO ((ID2ReplyReGetBlobPtr )); +NLM_EXTERN ID2ReplyReGetBlobPtr LIBCALL ID2ReplyReGetBlobNew PROTO (( void )); +NLM_EXTERN ID2ReplyReGetBlobPtr LIBCALL ID2ReplyReGetBlobAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2ReplyReGetBlobAsnWrite PROTO (( ID2ReplyReGetBlobPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2SSeqAssemblyInfo +* ID2SReplyGetSplitInfo * **************************************************/ -typedef struct struct_ID2S_Seq_assembly_Info { - struct struct_ID2_Id_Range PNTR bioseqs; -} ID2SSeqAssemblyInfo, PNTR ID2SSeqAssemblyInfoPtr; - - -NLM_EXTERN ID2SSeqAssemblyInfoPtr LIBCALL ID2SSeqAssemblyInfoFree PROTO ((ID2SSeqAssemblyInfoPtr )); -NLM_EXTERN ID2SSeqAssemblyInfoPtr LIBCALL ID2SSeqAssemblyInfoNew PROTO (( void )); -NLM_EXTERN ID2SSeqAssemblyInfoPtr LIBCALL ID2SSeqAssemblyInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SSeqAssemblyInfoAsnWrite PROTO (( ID2SSeqAssemblyInfoPtr , AsnIoPtr, AsnTypePtr)); - +typedef struct struct_ID2S_Reply_Get_Split_Info { + struct struct_ID2_Blob_Id PNTR blob_id; + Int4 split_version; + struct struct_ID2_Reply_Data PNTR data; +} ID2SReplyGetSplitInfo, PNTR ID2SReplyGetSplitInfoPtr; -/************************************************** -* -* ID2SSeqMapInfo -* -**************************************************/ -#define ID2SSeqMapInfo ValNode -#define ID2SSeqMapInfoPtr ValNodePtr -#define ID2SSeqMapInfoFree ValNodeFree -#define ID2SSeqMapInfoNew ValNodeNew -#define ID2SSeqMapInfoAsnRead ValNodeAsnRead -#define ID2SSeqMapInfoAsnWrite ValNodeAsnWrite +NLM_EXTERN ID2SReplyGetSplitInfoPtr LIBCALL ID2SReplyGetSplitInfoFree PROTO ((ID2SReplyGetSplitInfoPtr )); +NLM_EXTERN ID2SReplyGetSplitInfoPtr LIBCALL ID2SReplyGetSplitInfoNew PROTO (( void )); +NLM_EXTERN ID2SReplyGetSplitInfoPtr LIBCALL ID2SReplyGetSplitInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SReplyGetSplitInfoAsnWrite PROTO (( ID2SReplyGetSplitInfoPtr , AsnIoPtr, AsnTypePtr)); -/************************************************** -* -* ID2SSeqDataInfo -* -**************************************************/ -#define ID2SSeqDataInfo ValNode -#define ID2SSeqDataInfoPtr ValNodePtr -#define ID2SSeqDataInfoFree ValNodeFree -#define ID2SSeqDataInfoNew ValNodeNew -#define ID2SSeqDataInfoAsnRead ValNodeAsnRead -#define ID2SSeqDataInfoAsnWrite ValNodeAsnWrite - /************************************************** * -* ID2SFeatTypeInfo +* ID2SReplyGetChunk * **************************************************/ -typedef struct struct_ID2S_Feat_type_Info { - struct struct_ID2S_Feat_type_Info PNTR next; - Int4 type; - ValNodePtr subtypes; -} ID2SFeatTypeInfo, PNTR ID2SFeatTypeInfoPtr; +typedef struct struct_ID2S_Reply_Get_Chunk { + struct struct_ID2_Blob_Id PNTR blob_id; + Int4 chunk_id; + struct struct_ID2_Reply_Data PNTR data; +} ID2SReplyGetChunk, PNTR ID2SReplyGetChunkPtr; -NLM_EXTERN ID2SFeatTypeInfoPtr LIBCALL ID2SFeatTypeInfoFree PROTO ((ID2SFeatTypeInfoPtr )); -NLM_EXTERN ID2SFeatTypeInfoPtr LIBCALL ID2SFeatTypeInfoNew PROTO (( void )); -NLM_EXTERN ID2SFeatTypeInfoPtr LIBCALL ID2SFeatTypeInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SFeatTypeInfoAsnWrite PROTO (( ID2SFeatTypeInfoPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkFree PROTO ((ID2SReplyGetChunkPtr )); +NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkNew PROTO (( void )); +NLM_EXTERN ID2SReplyGetChunkPtr LIBCALL ID2SReplyGetChunkAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SReplyGetChunkAsnWrite PROTO (( ID2SReplyGetChunkPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2SChunk +* ID2ReplyData * **************************************************/ -typedef struct struct_ID2S_Chunk { - struct struct_ID2S_Chunk_Data PNTR data; -} ID2SChunk, PNTR ID2SChunkPtr; +typedef struct struct_ID2_Reply_Data { + Int4 data_type; + Int4 data_format; + Int4 data_compression; + ValNodePtr data; +} ID2ReplyData, PNTR ID2ReplyDataPtr; -NLM_EXTERN ID2SChunkPtr LIBCALL ID2SChunkFree PROTO ((ID2SChunkPtr )); -NLM_EXTERN ID2SChunkPtr LIBCALL ID2SChunkNew PROTO (( void )); -NLM_EXTERN ID2SChunkPtr LIBCALL ID2SChunkAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SChunkAsnWrite PROTO (( ID2SChunkPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2ReplyDataPtr LIBCALL ID2ReplyDataFree PROTO ((ID2ReplyDataPtr )); +NLM_EXTERN ID2ReplyDataPtr LIBCALL ID2ReplyDataNew PROTO (( void )); +NLM_EXTERN ID2ReplyDataPtr LIBCALL ID2ReplyDataAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2ReplyDataAsnWrite PROTO (( ID2ReplyDataPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2SChunkData +* ID2BlobSeqIds * **************************************************/ -typedef struct struct_ID2S_Chunk_Data { - struct struct_ID2S_Chunk_Data PNTR next; - ValNodePtr Id_id; - ValNodePtr descrs; - struct struct_Seq_annot PNTR annots; - struct struct_Seq_align PNTR assembly; - struct struct_Seq_literal PNTR seq_map; - struct struct_Seq_literal PNTR seq_data; -} ID2SChunkData, PNTR ID2SChunkDataPtr; - - -NLM_EXTERN ID2SChunkDataPtr LIBCALL ID2SChunkDataFree PROTO ((ID2SChunkDataPtr )); -NLM_EXTERN ID2SChunkDataPtr LIBCALL ID2SChunkDataNew PROTO (( void )); -NLM_EXTERN ID2SChunkDataPtr LIBCALL ID2SChunkDataAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SChunkDataAsnWrite PROTO (( ID2SChunkDataPtr , AsnIoPtr, AsnTypePtr)); - +typedef struct struct_ID2BlobSeqId ID2BlobSeqIds; +typedef struct struct_ID2BlobSeqId PNTR ID2BlobSeqIdsPtr; +#define ID2BlobSeqIdsNew() ID2BlobSeqIdNew() #ifdef NLM_GENERATED_CODE_PROTO -typedef ValNodePtr Id_idPtr; -typedef ValNode Id_id; - -#endif /* NLM_GENERATED_CODE_PROTO */ - -#define Id_id_bioseq_set 1 -#define Id_id_gi 2 - -#ifdef NLM_GENERATED_CODE_PROTO - -static Id_idPtr LIBCALL Id_idFree PROTO ((Id_idPtr )); -static Id_idPtr LIBCALL Id_idAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -static Boolean LIBCALL Id_idAsnWrite PROTO (( Id_idPtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2BlobSeqIdsPtr LIBCALL ID2BlobSeqIdsFree PROTO ((ID2BlobSeqIdsPtr )); +NLM_EXTERN ID2BlobSeqIdsPtr LIBCALL ID2BlobSeqIdsNew PROTO (( void )); +NLM_EXTERN ID2BlobSeqIdsPtr LIBCALL ID2BlobSeqIdsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2BlobSeqIdsAsnWrite PROTO (( ID2BlobSeqIdsPtr , AsnIoPtr, AsnTypePtr)); #endif /* NLM_GENERATED_CODE_PROTO */ @@ -875,57 +594,20 @@ static Boolean LIBCALL Id_idAsnWrite PROTO (( Id_idPtr , AsnIoPtr, AsnTypePtr)); /************************************************** * -* ID2Interval +* ID2BlobSeqId * **************************************************/ -typedef struct struct_ID2_Interval { - Int4 gi; - Int4 start; - Int4 length; -} ID2Interval, PNTR ID2IntervalPtr; - - -NLM_EXTERN ID2IntervalPtr LIBCALL ID2IntervalFree PROTO ((ID2IntervalPtr )); -NLM_EXTERN ID2IntervalPtr LIBCALL ID2IntervalNew PROTO (( void )); -NLM_EXTERN ID2IntervalPtr LIBCALL ID2IntervalAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2IntervalAsnWrite PROTO (( ID2IntervalPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2PackedSeqInts -* -**************************************************/ -typedef struct struct_ID2_Packed_Seq_ints { - Int4 gi; - struct struct_ID2_Seq_range PNTR ints; -} ID2PackedSeqInts, PNTR ID2PackedSeqIntsPtr; - - -NLM_EXTERN ID2PackedSeqIntsPtr LIBCALL ID2PackedSeqIntsFree PROTO ((ID2PackedSeqIntsPtr )); -NLM_EXTERN ID2PackedSeqIntsPtr LIBCALL ID2PackedSeqIntsNew PROTO (( void )); -NLM_EXTERN ID2PackedSeqIntsPtr LIBCALL ID2PackedSeqIntsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2PackedSeqIntsAsnWrite PROTO (( ID2PackedSeqIntsPtr , AsnIoPtr, AsnTypePtr)); - - - -/************************************************** -* -* ID2SeqRange -* -**************************************************/ -typedef struct struct_ID2_Seq_range { - struct struct_ID2_Seq_range PNTR next; - Int4 start; - Int4 length; -} ID2SeqRange, PNTR ID2SeqRangePtr; +typedef struct struct_ID2_Blob_Seq_id { + struct struct_ID2_Blob_Seq_id PNTR next; + ValNodePtr seq_id; + Uint1 replaced; +} ID2BlobSeqId, PNTR ID2BlobSeqIdPtr; -NLM_EXTERN ID2SeqRangePtr LIBCALL ID2SeqRangeFree PROTO ((ID2SeqRangePtr )); -NLM_EXTERN ID2SeqRangePtr LIBCALL ID2SeqRangeNew PROTO (( void )); -NLM_EXTERN ID2SeqRangePtr LIBCALL ID2SeqRangeAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); -NLM_EXTERN Boolean LIBCALL ID2SeqRangeAsnWrite PROTO (( ID2SeqRangePtr , AsnIoPtr, AsnTypePtr)); +NLM_EXTERN ID2BlobSeqIdPtr LIBCALL ID2BlobSeqIdFree PROTO ((ID2BlobSeqIdPtr )); +NLM_EXTERN ID2BlobSeqIdPtr LIBCALL ID2BlobSeqIdNew PROTO (( void )); +NLM_EXTERN ID2BlobSeqIdPtr LIBCALL ID2BlobSeqIdAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2BlobSeqIdAsnWrite PROTO (( ID2BlobSeqIdPtr , AsnIoPtr, AsnTypePtr)); diff --git a/network/id2arch/id2map.h b/network/id2arch/id2map.h index 937324db..98ef3926 100644 --- a/network/id2arch/id2map.h +++ b/network/id2arch/id2map.h @@ -1,10 +1,17 @@ +#ifndef __id2map_h__ +#define __id2map_h__ + #include <objsset.h> -#define NLM_EXTERN_LOADS {if (! SeqSetAsnLoad())return FALSE; \ - } -#define struct_Seq_hist seqhist +#define NLM_EXTERN_LOADS {if (! SeqSetAsnLoad())return FALSE; } + +#define struct_ID2Param struct_ID2_Param +#define struct_ID2Request struct_ID2_Request +#define blob_id_resolve_exclude_blobs_E id_resolve_exclude_blobs_E +#define SeqLiteralFree SeqLitFree #define SeqLiteralAsnRead SeqLitAsnRead #define SeqLiteralAsnWrite SeqLitAsnWrite -#define SeqLiteralFree SeqLitFree -#define struct_ID2Param struct_ID2_Param -#define ID2_SEQ_LOC_int__ ID2_SEQ_LOC_int + +#include <id2sgen.h> + +#endif diff --git a/network/id2arch/id2sgen.c b/network/id2arch/id2sgen.c new file mode 100644 index 00000000..c6c866df --- /dev/null +++ b/network/id2arch/id2sgen.c @@ -0,0 +1,3345 @@ +#include <asn.h> + +#define NLM_GENERATED_CODE_PROTO + +#include <id2map.h> +#include <id2sgen.h> + +static Boolean loaded = FALSE; + +#include <seqsplit.h> + +#ifndef NLM_EXTERN_LOADS +#define NLM_EXTERN_LOADS {} +#endif + +NLM_EXTERN Boolean LIBCALL +id2sgenAsnLoad(void) +{ + + if ( ! loaded) { + NLM_EXTERN_LOADS + + if ( ! AsnLoad ()) + return FALSE; + loaded = TRUE; + } + + return TRUE; +} + + + +/************************************************** +* Generated object loaders for Module NCBI-Seq-split +* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM +* +**************************************************/ + + +/************************************************** +* +* ID2SSeqAnnotInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAnnotInfoPtr LIBCALL +ID2SSeqAnnotInfoNew(void) +{ + ID2SSeqAnnotInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqAnnotInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SSeqAnnotInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAnnotInfoPtr LIBCALL +ID2SSeqAnnotInfoFree(ID2SSeqAnnotInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + MemFree(ptr -> name); + AsnGenericUserSeqOfFree(ptr -> feat, (AsnOptFreeFunc) ID2SFeatTypeInfoFree); + ID2SeqLocFree(ptr -> seq_loc); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SSeqAnnotInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAnnotInfoPtr LIBCALL +ID2SSeqAnnotInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SSeqAnnotInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SSeqAnnotInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_SEQ_ANNOT_INFO); + } else { + atp = AsnLinkType(orig, ID2S_SEQ_ANNOT_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SSeqAnnotInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_SEQ_ANNOT_INFO_name) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> name = av.ptrvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SEQ_ANNOT_INFO_align) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> align = av.boolvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SEQ_ANNOT_INFO_graph) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> graph = av.boolvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SEQ_ANNOT_INFO_feat) { + ptr -> feat = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SFeatTypeInfoAsnRead, (AsnOptFreeFunc) ID2SFeatTypeInfoFree); + if (isError && ptr -> feat == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SEQ_ANNOT_INFO_seq_loc) { + ptr -> seq_loc = ID2SeqLocAsnRead(aip, atp); + if (aip -> io_failure) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SSeqAnnotInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SSeqAnnotInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SSeqAnnotInfoAsnWrite(ID2SSeqAnnotInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_SEQ_ANNOT_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + if (ptr -> name != NULL) { + av.ptrvalue = ptr -> name; + retval = AsnWrite(aip, ID2S_SEQ_ANNOT_INFO_name, &av); + } + av.boolvalue = ptr -> align; + retval = AsnWrite(aip, ID2S_SEQ_ANNOT_INFO_align, &av); + av.boolvalue = ptr -> graph; + retval = AsnWrite(aip, ID2S_SEQ_ANNOT_INFO_graph, &av); + AsnGenericUserSeqOfAsnWrite(ptr -> feat, (AsnWriteFunc) ID2SFeatTypeInfoAsnWrite, aip, ID2S_SEQ_ANNOT_INFO_feat, ID2S_SEQ_ANNOT_INFO_feat_E); + if (ptr -> seq_loc != NULL) { + if ( ! ID2SeqLocAsnWrite(ptr -> seq_loc, aip, ID2S_SEQ_ANNOT_INFO_seq_loc)) { + goto erret; + } + } + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SSplitInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SSplitInfoPtr LIBCALL +ID2SSplitInfoNew(void) +{ + ID2SSplitInfoPtr ptr = MemNew((size_t) sizeof(ID2SSplitInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SSplitInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SSplitInfoPtr LIBCALL +ID2SSplitInfoFree(ID2SSplitInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericUserSeqOfFree(ptr -> bioseqs_info, (AsnOptFreeFunc) ID2SBioseqsInfoFree); + AsnGenericUserSeqOfFree(ptr -> chunks, (AsnOptFreeFunc) ID2SChunkInfoFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SSplitInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SSplitInfoPtr LIBCALL +ID2SSplitInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SSplitInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SSplitInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_SPLIT_INFO); + } else { + atp = AsnLinkType(orig, ID2S_SPLIT_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SSplitInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_SPLIT_INFO_bioseqs_info) { + ptr -> bioseqs_info = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SBioseqsInfoAsnRead, (AsnOptFreeFunc) ID2SBioseqsInfoFree); + if (isError && ptr -> bioseqs_info == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SPLIT_INFO_chunks) { + ptr -> chunks = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SChunkInfoAsnRead, (AsnOptFreeFunc) ID2SChunkInfoFree); + if (isError && ptr -> chunks == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SSplitInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SSplitInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SSplitInfoAsnWrite(ID2SSplitInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_SPLIT_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs_info, (AsnWriteFunc) ID2SBioseqsInfoAsnWrite, aip, ID2S_SPLIT_INFO_bioseqs_info, ID2S_SPLIT_INFO_bioseqs_info_E); + AsnGenericUserSeqOfAsnWrite(ptr -> chunks, (AsnWriteFunc) ID2SChunkInfoAsnWrite, aip, ID2S_SPLIT_INFO_chunks, ID2S_SPLIT_INFO_chunks_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SBioseqsInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqsInfoPtr LIBCALL +ID2SBioseqsInfoNew(void) +{ + ID2SBioseqsInfoPtr ptr = MemNew((size_t) sizeof(ID2SBioseqsInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SBioseqsInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqsInfoPtr LIBCALL +ID2SBioseqsInfoFree(ID2SBioseqsInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + ID2SBioseqInfoFree(ptr -> info); + ID2IdRangeFree(ptr -> bioseqs); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SBioseqsInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqsInfoPtr LIBCALL +ID2SBioseqsInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SBioseqsInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SBioseqsInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_BIOSEQS_INFO); + } else { + atp = AsnLinkType(orig, ID2S_BIOSEQS_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SBioseqsInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_BIOSEQS_INFO_info) { + ptr -> info = ID2SBioseqInfoAsnRead(aip, atp); + if (aip -> io_failure) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_BIOSEQS_INFO_bioseqs) { + ptr -> bioseqs = ID2IdRangeAsnRead(aip, atp); + if (aip -> io_failure) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SBioseqsInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SBioseqsInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SBioseqsInfoAsnWrite(ID2SBioseqsInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_BIOSEQS_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + if (ptr -> info != NULL) { + if ( ! ID2SBioseqInfoAsnWrite(ptr -> info, aip, ID2S_BIOSEQS_INFO_info)) { + goto erret; + } + } + if (ptr -> bioseqs != NULL) { + if ( ! ID2IdRangeAsnWrite(ptr -> bioseqs, aip, ID2S_BIOSEQS_INFO_bioseqs)) { + goto erret; + } + } + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SChunkInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SChunkInfoPtr LIBCALL +ID2SChunkInfoNew(void) +{ + ID2SChunkInfoPtr ptr = MemNew((size_t) sizeof(ID2SChunkInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SChunkInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SChunkInfoPtr LIBCALL +ID2SChunkInfoFree(ID2SChunkInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericChoiceSeqOfFree(ptr -> content, (AsnOptFreeFunc) ID2SChunkContentFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SChunkInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SChunkInfoPtr LIBCALL +ID2SChunkInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SChunkInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SChunkInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_CHUNK_INFO); + } else { + atp = AsnLinkType(orig, ID2S_CHUNK_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SChunkInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_CHUNK_INFO_id) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> id = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_CHUNK_INFO_content) { + ptr -> content = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SChunkContentAsnRead, (AsnOptFreeFunc) ID2SChunkContentFree); + if (isError && ptr -> content == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SChunkInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SChunkInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SChunkInfoAsnWrite(ID2SChunkInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_CHUNK_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> id; + retval = AsnWrite(aip, ID2S_CHUNK_INFO_id, &av); + AsnGenericChoiceSeqOfAsnWrite(ptr -> content, (AsnWriteFunc) ID2SChunkContentAsnWrite, aip, ID2S_CHUNK_INFO_content, ID2S_CHUNK_INFO_content_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SBioseqInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqInfoPtr LIBCALL +ID2SBioseqInfoNew(void) +{ + ID2SBioseqInfoPtr ptr = MemNew((size_t) sizeof(ID2SBioseqInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SBioseqInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqInfoPtr LIBCALL +ID2SBioseqInfoFree(ID2SBioseqInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + ID2SSequenceSplitInfoFree(ptr -> sequence_split); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SBioseqInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SBioseqInfoPtr LIBCALL +ID2SBioseqInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SBioseqInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SBioseqInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_BIOSEQ_INFO); + } else { + atp = AsnLinkType(orig, ID2S_BIOSEQ_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SBioseqInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_BIOSEQ_INFO_gap_count) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> gap_count = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == BIOSEQ_INFO_seq_map_has_ref) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> seq_map_has_ref = av.boolvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_BIOSEQ_INFO_sequence_split) { + ptr -> sequence_split = ID2SSequenceSplitInfoAsnRead(aip, atp); + if (aip -> io_failure) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SBioseqInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SBioseqInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SBioseqInfoAsnWrite(ID2SBioseqInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_BIOSEQ_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> gap_count; + retval = AsnWrite(aip, ID2S_BIOSEQ_INFO_gap_count, &av); + av.boolvalue = ptr -> seq_map_has_ref; + retval = AsnWrite(aip, BIOSEQ_INFO_seq_map_has_ref, &av); + if (ptr -> sequence_split != NULL) { + if ( ! ID2SSequenceSplitInfoAsnWrite(ptr -> sequence_split, aip, ID2S_BIOSEQ_INFO_sequence_split)) { + goto erret; + } + } + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2IdRangeNew() +* +**************************************************/ +NLM_EXTERN +ID2IdRangePtr LIBCALL +ID2IdRangeNew(void) +{ + ID2IdRangePtr ptr = MemNew((size_t) sizeof(ID2IdRange)); + + ptr -> count = 1; + return ptr; + +} + + +/************************************************** +* +* ID2IdRangeFree() +* +**************************************************/ +NLM_EXTERN +ID2IdRangePtr LIBCALL +ID2IdRangeFree(ID2IdRangePtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + return MemFree(ptr); +} + + +/************************************************** +* +* ID2IdRangeAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2IdRangePtr LIBCALL +ID2IdRangeAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2IdRangePtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2IdRange ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_ID_RANGE); + } else { + atp = AsnLinkType(orig, ID2_ID_RANGE); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2IdRangeNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2_ID_RANGE_start) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> start = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2_ID_RANGE_count) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> count = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2IdRangeFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2IdRangeAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2IdRangeAsnWrite(ID2IdRangePtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2_ID_RANGE); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> start; + retval = AsnWrite(aip, ID2_ID_RANGE_start, &av); + av.intvalue = ptr -> count; + retval = AsnWrite(aip, ID2_ID_RANGE_count, &av); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SSequenceSplitInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SSequenceSplitInfoPtr LIBCALL +ID2SSequenceSplitInfoNew(void) +{ + ID2SSequenceSplitInfoPtr ptr = MemNew((size_t) sizeof(ID2SSequenceSplitInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SSequenceSplitInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SSequenceSplitInfoPtr LIBCALL +ID2SSequenceSplitInfoFree(ID2SSequenceSplitInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericBaseSeqOfFree(ptr -> chunk_blocks ,ASNCODE_INTVAL_SLOT); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SSequenceSplitInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SSequenceSplitInfoPtr LIBCALL +ID2SSequenceSplitInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SSequenceSplitInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SSequenceSplitInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_SEQUENCE_SPLIT_INFO); + } else { + atp = AsnLinkType(orig, ID2S_SEQUENCE_SPLIT_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SSequenceSplitInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == SEQUENCE_SPLIT_INFO_block_size) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> block_size = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == SPLIT_INFO_chunk_start) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> chunk_start = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == SPLIT_INFO_chunk_blocks) { + ptr -> chunk_blocks = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError); + if (isError && ptr -> chunk_blocks == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SSequenceSplitInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SSequenceSplitInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SSequenceSplitInfoAsnWrite(ID2SSequenceSplitInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_SEQUENCE_SPLIT_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> block_size; + retval = AsnWrite(aip, SEQUENCE_SPLIT_INFO_block_size, &av); + av.intvalue = ptr -> chunk_start; + retval = AsnWrite(aip, SPLIT_INFO_chunk_start, &av); + retval = AsnGenericBaseSeqOfAsnWrite(ptr -> chunk_blocks ,ASNCODE_INTVAL_SLOT, aip, SPLIT_INFO_chunk_blocks, SPLIT_INFO_chunk_blocks_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SChunkContentFree() +* +**************************************************/ +NLM_EXTERN +ID2SChunkContentPtr LIBCALL +ID2SChunkContentFree(ValNodePtr anp) +{ + Pointer pnt; + + if (anp == NULL) { + return NULL; + } + + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + default: + break; + case ID2SChunkContent_seq_descr: + ID2SSeqDescrInfoFree(anp -> data.ptrvalue); + break; + case ID2SChunkContent_seq_annot: + ID2SSeqAnnotInfoFree(anp -> data.ptrvalue); + break; + case ID2SChunkContent_seq_assembly: + ID2SSeqAssemblyInfoFree(anp -> data.ptrvalue); + break; + case ID2SChunkContent_seq_map: + ID2SeqLocFree(anp -> data.ptrvalue); + break; + case ID2SChunkContent_seq_data: + ID2SeqLocFree(anp -> data.ptrvalue); + break; + case ID2SChunkContent_seq_annot_place: + ID2SSeqAnnotPlaceInfoFree(anp -> data.ptrvalue); + break; + } + return MemFree(anp); +} + + +/************************************************** +* +* ID2SChunkContentAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SChunkContentPtr LIBCALL +ID2SChunkContentAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + ValNodePtr anp; + Uint1 choice; + Boolean isError = FALSE; + Boolean nullIsError = FALSE; + AsnReadFunc func; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SChunkContent ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_CHUNK_CONTENT); + } else { + atp = AsnLinkType(orig, ID2S_CHUNK_CONTENT); /* link in local tree */ + } + if (atp == NULL) { + return NULL; + } + + anp = ValNodeNew(NULL); + if (anp == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ + goto erret; + } + + func = NULL; + + atp = AsnReadId(aip, amp, atp); /* find the choice */ + if (atp == NULL) { + goto erret; + } + if (atp == ID2S_CHUNK_CONTENT_seq_descr) { + choice = ID2SChunkContent_seq_descr; + func = (AsnReadFunc) ID2SSeqDescrInfoAsnRead; + } + else if (atp == ID2S_CHUNK_CONTENT_seq_annot) { + choice = ID2SChunkContent_seq_annot; + func = (AsnReadFunc) ID2SSeqAnnotInfoAsnRead; + } + else if (atp == ID2S_CHUNK_CONTENT_seq_assembly) { + choice = ID2SChunkContent_seq_assembly; + func = (AsnReadFunc) ID2SSeqAssemblyInfoAsnRead; + } + else if (atp == ID2S_CHUNK_CONTENT_seq_map) { + choice = ID2SChunkContent_seq_map; + func = (AsnReadFunc) ID2SeqLocAsnRead; + } + else if (atp == ID2S_CHUNK_CONTENT_seq_data) { + choice = ID2SChunkContent_seq_data; + func = (AsnReadFunc) ID2SeqLocAsnRead; + } + else if (atp == CHUNK_CONTENT_seq_annot_place) { + choice = ID2SChunkContent_seq_annot_place; + func = (AsnReadFunc) ID2SSeqAnnotPlaceInfoAsnRead; + } + anp->choice = choice; + if (func != NULL) + { + anp->data.ptrvalue = (* func)(aip, atp); + if (aip -> io_failure) goto erret; + + if (nullIsError && anp->data.ptrvalue == NULL) { + goto erret; + } + } + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return anp; + +erret: + anp = MemFree(anp); + aip -> io_failure = TRUE; + goto ret; +} + + +/************************************************** +* +* ID2SChunkContentAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SChunkContentAsnWrite(ID2SChunkContentPtr anp, AsnIoPtr aip, AsnTypePtr orig) + +{ + DataVal av; + AsnTypePtr atp, writetype = NULL; + Pointer pnt; + AsnWriteFunc func = NULL; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) + return FALSE; + } + + if (aip == NULL) + return FALSE; + + atp = AsnLinkType(orig, ID2S_CHUNK_CONTENT); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + + av.ptrvalue = (Pointer)anp; + if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { + goto erret; + } + + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + case ID2SChunkContent_seq_descr: + writetype = ID2S_CHUNK_CONTENT_seq_descr; + func = (AsnWriteFunc) ID2SSeqDescrInfoAsnWrite; + break; + case ID2SChunkContent_seq_annot: + writetype = ID2S_CHUNK_CONTENT_seq_annot; + func = (AsnWriteFunc) ID2SSeqAnnotInfoAsnWrite; + break; + case ID2SChunkContent_seq_assembly: + writetype = ID2S_CHUNK_CONTENT_seq_assembly; + func = (AsnWriteFunc) ID2SSeqAssemblyInfoAsnWrite; + break; + case ID2SChunkContent_seq_map: + writetype = ID2S_CHUNK_CONTENT_seq_map; + func = (AsnWriteFunc) ID2SeqLocAsnWrite; + break; + case ID2SChunkContent_seq_data: + writetype = ID2S_CHUNK_CONTENT_seq_data; + func = (AsnWriteFunc) ID2SeqLocAsnWrite; + break; + case ID2SChunkContent_seq_annot_place: + writetype = CHUNK_CONTENT_seq_annot_place; + func = (AsnWriteFunc) ID2SSeqAnnotPlaceInfoAsnWrite; + break; + } + if (writetype != NULL) { + retval = (* func)(pnt, aip, writetype); /* write it out */ + } + if (!retval) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + +/************************************************** +* +* ID2SSeqDescrInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SSeqDescrInfoPtr LIBCALL +ID2SSeqDescrInfoNew(void) +{ + ID2SSeqDescrInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqDescrInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SSeqDescrInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SSeqDescrInfoPtr LIBCALL +ID2SSeqDescrInfoFree(ID2SSeqDescrInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); + AsnGenericUserSeqOfFree(ptr -> bioseq_sets, (AsnOptFreeFunc) ID2IdRangeFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SSeqDescrInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SSeqDescrInfoPtr LIBCALL +ID2SSeqDescrInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SSeqDescrInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SSeqDescrInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_SEQ_DESCR_INFO); + } else { + atp = AsnLinkType(orig, ID2S_SEQ_DESCR_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SSeqDescrInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_SEQ_DESCR_INFO_type_mask) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> type_mask = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SEQ_DESCR_INFO_bioseqs) { + ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); + if (isError && ptr -> bioseqs == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_SEQ_DESCR_INFO_bioseq_sets) { + ptr -> bioseq_sets = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); + if (isError && ptr -> bioseq_sets == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SSeqDescrInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SSeqDescrInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SSeqDescrInfoAsnWrite(ID2SSeqDescrInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_SEQ_DESCR_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> type_mask; + retval = AsnWrite(aip, ID2S_SEQ_DESCR_INFO_type_mask, &av); + AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_DESCR_INFO_bioseqs, ID2S_SEQ_DESCR_INFO_bioseqs_E); + AsnGenericUserSeqOfAsnWrite(ptr -> bioseq_sets, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_DESCR_INFO_bioseq_sets, SEQ_DESCR_INFO_bioseq_sets_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SSeqAssemblyInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAssemblyInfoPtr LIBCALL +ID2SSeqAssemblyInfoNew(void) +{ + ID2SSeqAssemblyInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqAssemblyInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SSeqAssemblyInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAssemblyInfoPtr LIBCALL +ID2SSeqAssemblyInfoFree(ID2SSeqAssemblyInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SSeqAssemblyInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAssemblyInfoPtr LIBCALL +ID2SSeqAssemblyInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SSeqAssemblyInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SSeqAssemblyInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_SEQ_ASSEMBLY_INFO); + } else { + atp = AsnLinkType(orig, ID2S_SEQ_ASSEMBLY_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SSeqAssemblyInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_SEQ_ASSEMBLY_INFO_bioseqs) { + ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); + if (isError && ptr -> bioseqs == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SSeqAssemblyInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SSeqAssemblyInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SSeqAssemblyInfoAsnWrite(ID2SSeqAssemblyInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_SEQ_ASSEMBLY_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ID2S_SEQ_ASSEMBLY_INFO_bioseqs, SEQ_ASSEMBLY_INFO_bioseqs_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SSeqAnnotPlaceInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAnnotPlaceInfoPtr LIBCALL +ID2SSeqAnnotPlaceInfoNew(void) +{ + ID2SSeqAnnotPlaceInfoPtr ptr = MemNew((size_t) sizeof(ID2SSeqAnnotPlaceInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SSeqAnnotPlaceInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAnnotPlaceInfoPtr LIBCALL +ID2SSeqAnnotPlaceInfoFree(ID2SSeqAnnotPlaceInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + MemFree(ptr -> name); + AsnGenericUserSeqOfFree(ptr -> bioseqs, (AsnOptFreeFunc) ID2IdRangeFree); + AsnGenericUserSeqOfFree(ptr -> bioseq_sets, (AsnOptFreeFunc) ID2IdRangeFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SSeqAnnotPlaceInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SSeqAnnotPlaceInfoPtr LIBCALL +ID2SSeqAnnotPlaceInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SSeqAnnotPlaceInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SSeqAnnotPlaceInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_SEQ_ANNOT_PLACE_INFO); + } else { + atp = AsnLinkType(orig, ID2S_SEQ_ANNOT_PLACE_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SSeqAnnotPlaceInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_SEQ_ANNOT_PLACE_INFO_name) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> name = av.ptrvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == SEQ_ANNOT_PLACE_INFO_bioseqs) { + ptr -> bioseqs = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); + if (isError && ptr -> bioseqs == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ANNOT_PLACE_INFO_bioseq_sets) { + ptr -> bioseq_sets = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2IdRangeAsnRead, (AsnOptFreeFunc) ID2IdRangeFree); + if (isError && ptr -> bioseq_sets == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SSeqAnnotPlaceInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SSeqAnnotPlaceInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SSeqAnnotPlaceInfoAsnWrite(ID2SSeqAnnotPlaceInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_SEQ_ANNOT_PLACE_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + if (ptr -> name != NULL) { + av.ptrvalue = ptr -> name; + retval = AsnWrite(aip, ID2S_SEQ_ANNOT_PLACE_INFO_name, &av); + } + AsnGenericUserSeqOfAsnWrite(ptr -> bioseqs, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, SEQ_ANNOT_PLACE_INFO_bioseqs, SEQ_ANNOT_PLACE_INFO_bioseqs_E); + AsnGenericUserSeqOfAsnWrite(ptr -> bioseq_sets, (AsnWriteFunc) ID2IdRangeAsnWrite, aip, ANNOT_PLACE_INFO_bioseq_sets, ANNOT_PLACE_INFO_bioseq_sets_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SFeatTypeInfoNew() +* +**************************************************/ +NLM_EXTERN +ID2SFeatTypeInfoPtr LIBCALL +ID2SFeatTypeInfoNew(void) +{ + ID2SFeatTypeInfoPtr ptr = MemNew((size_t) sizeof(ID2SFeatTypeInfo)); + + return ptr; + +} + + +/************************************************** +* +* ID2SFeatTypeInfoFree() +* +**************************************************/ +NLM_EXTERN +ID2SFeatTypeInfoPtr LIBCALL +ID2SFeatTypeInfoFree(ID2SFeatTypeInfoPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericBaseSeqOfFree(ptr -> subtypes ,ASNCODE_INTVAL_SLOT); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SFeatTypeInfoAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SFeatTypeInfoPtr LIBCALL +ID2SFeatTypeInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SFeatTypeInfoPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SFeatTypeInfo ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_FEAT_TYPE_INFO); + } else { + atp = AsnLinkType(orig, ID2S_FEAT_TYPE_INFO); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SFeatTypeInfoNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_FEAT_TYPE_INFO_type) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> type = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_FEAT_TYPE_INFO_subtypes) { + ptr -> subtypes = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError); + if (isError && ptr -> subtypes == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SFeatTypeInfoFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SFeatTypeInfoAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SFeatTypeInfoAsnWrite(ID2SFeatTypeInfoPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_FEAT_TYPE_INFO); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> type; + retval = AsnWrite(aip, ID2S_FEAT_TYPE_INFO_type, &av); + retval = AsnGenericBaseSeqOfAsnWrite(ptr -> subtypes ,ASNCODE_INTVAL_SLOT, aip, ID2S_FEAT_TYPE_INFO_subtypes, ID2S_FEAT_TYPE_INFO_subtypes_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SeqLocFree() +* +**************************************************/ +NLM_EXTERN +ID2SeqLocPtr LIBCALL +ID2SeqLocFree(ValNodePtr anp) +{ + Pointer pnt; + + if (anp == NULL) { + return NULL; + } + + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + default: + break; + case ID2SeqLoc_interval: + ID2IntervalFree(anp -> data.ptrvalue); + break; + case ID2SeqLoc_packed_ints: + ID2PackedSeqIntsFree(anp -> data.ptrvalue); + break; + case ID2SeqLoc_gi_whole_range: + ID2IdRangeFree(anp -> data.ptrvalue); + break; + case ID2SeqLoc_loc_set: + AsnGenericChoiceSeqOfFree((Pointer) pnt, (AsnOptFreeFunc) ID2SeqLocFree); + break; + case ID2SeqLoc_seq_loc: + SeqLocFree(anp -> data.ptrvalue); + break; + } + return MemFree(anp); +} + + +/************************************************** +* +* ID2SeqLocAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SeqLocPtr LIBCALL +ID2SeqLocAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + ValNodePtr anp; + Uint1 choice; + Boolean isError = FALSE; + Boolean nullIsError = FALSE; + AsnReadFunc func; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SeqLoc ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_SEQ_LOC); + } else { + atp = AsnLinkType(orig, ID2_SEQ_LOC); /* link in local tree */ + } + if (atp == NULL) { + return NULL; + } + + anp = ValNodeNew(NULL); + if (anp == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ + goto erret; + } + + func = NULL; + + atp = AsnReadId(aip, amp, atp); /* find the choice */ + if (atp == NULL) { + goto erret; + } + if (atp == ID2_SEQ_LOC_gi_whole) { + choice = ID2SeqLoc_gi_whole; + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + anp->data.intvalue = av.intvalue; + } + else if (atp == ID2_SEQ_LOC_interval) { + choice = ID2SeqLoc_interval; + func = (AsnReadFunc) ID2IntervalAsnRead; + } + else if (atp == ID2_SEQ_LOC_packed_ints) { + choice = ID2SeqLoc_packed_ints; + func = (AsnReadFunc) ID2PackedSeqIntsAsnRead; + } + else if (atp == ID2_SEQ_LOC_gi_whole_range) { + choice = ID2SeqLoc_gi_whole_range; + func = (AsnReadFunc) ID2IdRangeAsnRead; + } + else if (atp == ID2_SEQ_LOC_loc_set) { + choice = ID2SeqLoc_loc_set; + anp -> data.ptrvalue = + AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SeqLocAsnRead, (AsnOptFreeFunc) ID2SeqLocFree); + if (isError && anp -> data.ptrvalue == NULL) { + goto erret; + } + } + else if (atp == ID2_SEQ_LOC_seq_loc) { + choice = ID2SeqLoc_seq_loc; + func = (AsnReadFunc) SeqLocAsnRead; + } + anp->choice = choice; + if (func != NULL) + { + anp->data.ptrvalue = (* func)(aip, atp); + if (aip -> io_failure) goto erret; + + if (nullIsError && anp->data.ptrvalue == NULL) { + goto erret; + } + } + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return anp; + +erret: + anp = MemFree(anp); + aip -> io_failure = TRUE; + goto ret; +} + + +/************************************************** +* +* ID2SeqLocAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SeqLocAsnWrite(ID2SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr orig) + +{ + DataVal av; + AsnTypePtr atp, writetype = NULL; + Pointer pnt; + AsnWriteFunc func = NULL; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) + return FALSE; + } + + if (aip == NULL) + return FALSE; + + atp = AsnLinkType(orig, ID2_SEQ_LOC); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + + av.ptrvalue = (Pointer)anp; + if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { + goto erret; + } + + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + case ID2SeqLoc_gi_whole: + av.intvalue = anp->data.intvalue; + retval = AsnWrite(aip, ID2_SEQ_LOC_gi_whole, &av); + break; + case ID2SeqLoc_interval: + writetype = ID2_SEQ_LOC_interval; + func = (AsnWriteFunc) ID2IntervalAsnWrite; + break; + case ID2SeqLoc_packed_ints: + writetype = ID2_SEQ_LOC_packed_ints; + func = (AsnWriteFunc) ID2PackedSeqIntsAsnWrite; + break; + case ID2SeqLoc_gi_whole_range: + writetype = ID2_SEQ_LOC_gi_whole_range; + func = (AsnWriteFunc) ID2IdRangeAsnWrite; + break; + case ID2SeqLoc_loc_set: + retval = AsnGenericChoiceSeqOfAsnWrite((Pointer) pnt, (AsnWriteFunc) ID2SeqLocAsnWrite, aip, ID2_SEQ_LOC_loc_set, ID2_SEQ_LOC_loc_set_E); + break; + case ID2SeqLoc_seq_loc: + writetype = ID2_SEQ_LOC_seq_loc; + func = (AsnWriteFunc) SeqLocAsnWrite; + break; + } + if (writetype != NULL) { + retval = (* func)(pnt, aip, writetype); /* write it out */ + } + if (!retval) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + +/************************************************** +* +* ID2SChunkNew() +* +**************************************************/ +NLM_EXTERN +ID2SChunkPtr LIBCALL +ID2SChunkNew(void) +{ + ID2SChunkPtr ptr = MemNew((size_t) sizeof(ID2SChunk)); + + return ptr; + +} + + +/************************************************** +* +* ID2SChunkFree() +* +**************************************************/ +NLM_EXTERN +ID2SChunkPtr LIBCALL +ID2SChunkFree(ID2SChunkPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericUserSeqOfFree(ptr -> data, (AsnOptFreeFunc) ID2SChunkDataFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SChunkAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SChunkPtr LIBCALL +ID2SChunkAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SChunkPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SChunk ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_CHUNK); + } else { + atp = AsnLinkType(orig, ID2S_CHUNK); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SChunkNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_CHUNK_data) { + ptr -> data = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SChunkDataAsnRead, (AsnOptFreeFunc) ID2SChunkDataFree); + if (isError && ptr -> data == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SChunkFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SChunkAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SChunkAsnWrite(ID2SChunkPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_CHUNK); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + AsnGenericUserSeqOfAsnWrite(ptr -> data, (AsnWriteFunc) ID2SChunkDataAsnWrite, aip, ID2S_CHUNK_data, ID2S_CHUNK_data_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SChunkDataNew() +* +**************************************************/ +NLM_EXTERN +ID2SChunkDataPtr LIBCALL +ID2SChunkDataNew(void) +{ + ID2SChunkDataPtr ptr = MemNew((size_t) sizeof(ID2SChunkData)); + + return ptr; + +} + + +/************************************************** +* +* ID2SChunkDataFree() +* +**************************************************/ +NLM_EXTERN +ID2SChunkDataPtr LIBCALL +ID2SChunkDataFree(ID2SChunkDataPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + Id_idFree(ptr -> Id_id); + AsnGenericChoiceSeqOfFree(ptr -> descrs, (AsnOptFreeFunc) SeqDescrFree); + AsnGenericUserSeqOfFree(ptr -> annots, (AsnOptFreeFunc) SeqAnnotFree); + AsnGenericUserSeqOfFree(ptr -> assembly, (AsnOptFreeFunc) SeqAlignFree); + AsnGenericUserSeqOfFree(ptr -> seq_map, (AsnOptFreeFunc) SeqLiteralFree); + AsnGenericUserSeqOfFree(ptr -> seq_data, (AsnOptFreeFunc) SeqLiteralFree); + return MemFree(ptr); +} + + +/************************************************** +* +* Id_idFree() +* +**************************************************/ +static +Id_idPtr LIBCALL +Id_idFree(ValNodePtr anp) +{ + Pointer pnt; + + if (anp == NULL) { + return NULL; + } + + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + default: + break; + } + return MemFree(anp); +} + + +/************************************************** +* +* ID2SChunkDataAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SChunkDataPtr LIBCALL +ID2SChunkDataAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SChunkDataPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SChunkData ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_CHUNK_DATA); + } else { + atp = AsnLinkType(orig, ID2S_CHUNK_DATA); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SChunkDataNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2S_CHUNK_DATA_id) { + ptr -> Id_id = Id_idAsnRead(aip, atp); + if (aip -> io_failure) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_CHUNK_DATA_descrs) { + ptr -> descrs = AsnGenericChoiceSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqDescrAsnRead, (AsnOptFreeFunc) SeqDescrFree); + if (isError && ptr -> descrs == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_CHUNK_DATA_annots) { + ptr -> annots = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqAnnotAsnRead, (AsnOptFreeFunc) SeqAnnotFree); + if (isError && ptr -> annots == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_CHUNK_DATA_assembly) { + ptr -> assembly = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqAlignAsnRead, (AsnOptFreeFunc) SeqAlignFree); + if (isError && ptr -> assembly == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_CHUNK_DATA_seq_map) { + ptr -> seq_map = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLiteralAsnRead, (AsnOptFreeFunc) SeqLiteralFree); + if (isError && ptr -> seq_map == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2S_CHUNK_DATA_seq_data) { + ptr -> seq_data = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) SeqLiteralAsnRead, (AsnOptFreeFunc) SeqLiteralFree); + if (isError && ptr -> seq_data == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SChunkDataFree(ptr); + goto ret; +} + + + +/************************************************** +* +* Id_idAsnRead() +* +**************************************************/ +static +Id_idPtr LIBCALL +Id_idAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + ValNodePtr anp; + Uint1 choice; + Boolean isError = FALSE; + Boolean nullIsError = FALSE; + AsnReadFunc func; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* Id_id ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2S_CHUNK_DATA_id); + } else { + atp = AsnLinkType(orig, ID2S_CHUNK_DATA_id); /* link in local tree */ + } + if (atp == NULL) { + return NULL; + } + + anp = ValNodeNew(NULL); + if (anp == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */ + goto erret; + } + + func = NULL; + + atp = AsnReadId(aip, amp, atp); /* find the choice */ + if (atp == NULL) { + goto erret; + } + if (atp == ID2S_CHUNK_DATA_id_bioseq_set) { + choice = Id_id_bioseq_set; + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + anp->data.intvalue = av.intvalue; + } + else if (atp == ID2S_CHUNK_DATA_id_gi) { + choice = Id_id_gi; + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + anp->data.intvalue = av.intvalue; + } + anp->choice = choice; + if (func != NULL) + { + anp->data.ptrvalue = (* func)(aip, atp); + if (aip -> io_failure) goto erret; + + if (nullIsError && anp->data.ptrvalue == NULL) { + goto erret; + } + } + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return anp; + +erret: + anp = MemFree(anp); + aip -> io_failure = TRUE; + goto ret; +} + + +/************************************************** +* +* ID2SChunkDataAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SChunkDataAsnWrite(ID2SChunkDataPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2S_CHUNK_DATA); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + if (ptr -> Id_id != NULL) { + if ( ! Id_idAsnWrite(ptr -> Id_id, aip, ID2S_CHUNK_DATA_id)) { + goto erret; + } + } + AsnGenericChoiceSeqOfAsnWrite(ptr -> descrs, (AsnWriteFunc) SeqDescrAsnWrite, aip, ID2S_CHUNK_DATA_descrs, ID2S_CHUNK_DATA_descrs_E); + AsnGenericUserSeqOfAsnWrite(ptr -> annots, (AsnWriteFunc) SeqAnnotAsnWrite, aip, ID2S_CHUNK_DATA_annots, ID2S_CHUNK_DATA_annots_E); + AsnGenericUserSeqOfAsnWrite(ptr -> assembly, (AsnWriteFunc) SeqAlignAsnWrite, aip, ID2S_CHUNK_DATA_assembly, ID2S_CHUNK_DATA_assembly_E); + AsnGenericUserSeqOfAsnWrite(ptr -> seq_map, (AsnWriteFunc) SeqLiteralAsnWrite, aip, ID2S_CHUNK_DATA_seq_map, ID2S_CHUNK_DATA_seq_map_E); + AsnGenericUserSeqOfAsnWrite(ptr -> seq_data, (AsnWriteFunc) SeqLiteralAsnWrite, aip, ID2S_CHUNK_DATA_seq_data, ID2S_CHUNK_DATA_seq_data_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* Id_idAsnWrite() +* +**************************************************/ +static Boolean LIBCALL +Id_idAsnWrite(Id_idPtr anp, AsnIoPtr aip, AsnTypePtr orig) + +{ + DataVal av; + AsnTypePtr atp, writetype = NULL; + Pointer pnt; + AsnWriteFunc func = NULL; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) + return FALSE; + } + + if (aip == NULL) + return FALSE; + + atp = AsnLinkType(orig, ID2S_CHUNK_DATA_id); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + + av.ptrvalue = (Pointer)anp; + if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) { + goto erret; + } + + pnt = anp->data.ptrvalue; + switch (anp->choice) + { + case Id_id_bioseq_set: + av.intvalue = anp->data.intvalue; + retval = AsnWrite(aip, ID2S_CHUNK_DATA_id_bioseq_set, &av); + break; + case Id_id_gi: + av.intvalue = anp->data.intvalue; + retval = AsnWrite(aip, ID2S_CHUNK_DATA_id_gi, &av); + break; + } + if (writetype != NULL) { + retval = (* func)(pnt, aip, writetype); /* write it out */ + } + if (!retval) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + +/************************************************** +* +* ID2IntervalNew() +* +**************************************************/ +NLM_EXTERN +ID2IntervalPtr LIBCALL +ID2IntervalNew(void) +{ + ID2IntervalPtr ptr = MemNew((size_t) sizeof(ID2Interval)); + + ptr -> length = 1; + return ptr; + +} + + +/************************************************** +* +* ID2IntervalFree() +* +**************************************************/ +NLM_EXTERN +ID2IntervalPtr LIBCALL +ID2IntervalFree(ID2IntervalPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + return MemFree(ptr); +} + + +/************************************************** +* +* ID2IntervalAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2IntervalPtr LIBCALL +ID2IntervalAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2IntervalPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2Interval ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_INTERVAL); + } else { + atp = AsnLinkType(orig, ID2_INTERVAL); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2IntervalNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2_INTERVAL_gi) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> gi = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2_INTERVAL_start) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> start = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2_INTERVAL_length) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> length = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2IntervalFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2IntervalAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2IntervalAsnWrite(ID2IntervalPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2_INTERVAL); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> gi; + retval = AsnWrite(aip, ID2_INTERVAL_gi, &av); + av.intvalue = ptr -> start; + retval = AsnWrite(aip, ID2_INTERVAL_start, &av); + av.intvalue = ptr -> length; + retval = AsnWrite(aip, ID2_INTERVAL_length, &av); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2PackedSeqIntsNew() +* +**************************************************/ +NLM_EXTERN +ID2PackedSeqIntsPtr LIBCALL +ID2PackedSeqIntsNew(void) +{ + ID2PackedSeqIntsPtr ptr = MemNew((size_t) sizeof(ID2PackedSeqInts)); + + return ptr; + +} + + +/************************************************** +* +* ID2PackedSeqIntsFree() +* +**************************************************/ +NLM_EXTERN +ID2PackedSeqIntsPtr LIBCALL +ID2PackedSeqIntsFree(ID2PackedSeqIntsPtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + AsnGenericUserSeqOfFree(ptr -> intervals, (AsnOptFreeFunc) ID2SeqRangeFree); + return MemFree(ptr); +} + + +/************************************************** +* +* ID2PackedSeqIntsAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2PackedSeqIntsPtr LIBCALL +ID2PackedSeqIntsAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2PackedSeqIntsPtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2PackedSeqInts ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_PACKED_SEQ_INTS); + } else { + atp = AsnLinkType(orig, ID2_PACKED_SEQ_INTS); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2PackedSeqIntsNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2_PACKED_SEQ_INTS_gi) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> gi = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2_PACKED_SEQ_INTS_intervals) { + ptr -> intervals = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2SeqRangeAsnRead, (AsnOptFreeFunc) ID2SeqRangeFree); + if (isError && ptr -> intervals == NULL) { + goto erret; + } + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2PackedSeqIntsFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2PackedSeqIntsAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2PackedSeqIntsAsnWrite(ID2PackedSeqIntsPtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2_PACKED_SEQ_INTS); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> gi; + retval = AsnWrite(aip, ID2_PACKED_SEQ_INTS_gi, &av); + AsnGenericUserSeqOfAsnWrite(ptr -> intervals, (AsnWriteFunc) ID2SeqRangeAsnWrite, aip, ID2_PACKED_SEQ_INTS_intervals, ID2_PACKED_SEQ_INTS_intervals_E); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + + + +/************************************************** +* +* ID2SeqRangeNew() +* +**************************************************/ +NLM_EXTERN +ID2SeqRangePtr LIBCALL +ID2SeqRangeNew(void) +{ + ID2SeqRangePtr ptr = MemNew((size_t) sizeof(ID2SeqRange)); + + ptr -> length = 1; + return ptr; + +} + + +/************************************************** +* +* ID2SeqRangeFree() +* +**************************************************/ +NLM_EXTERN +ID2SeqRangePtr LIBCALL +ID2SeqRangeFree(ID2SeqRangePtr ptr) +{ + + if(ptr == NULL) { + return NULL; + } + return MemFree(ptr); +} + + +/************************************************** +* +* ID2SeqRangeAsnRead() +* +**************************************************/ +NLM_EXTERN +ID2SeqRangePtr LIBCALL +ID2SeqRangeAsnRead(AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean isError = FALSE; + AsnReadFunc func; + ID2SeqRangePtr ptr; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return NULL; + } + } + + if (aip == NULL) { + return NULL; + } + + if (orig == NULL) { /* ID2SeqRange ::= (self contained) */ + atp = AsnReadId(aip, amp, ID2_SEQ_RANGE); + } else { + atp = AsnLinkType(orig, ID2_SEQ_RANGE); + } + /* link in local tree */ + if (atp == NULL) { + return NULL; + } + + ptr = ID2SeqRangeNew(); + if (ptr == NULL) { + goto erret; + } + if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */ + goto erret; + } + + atp = AsnReadId(aip,amp, atp); + func = NULL; + + if (atp == ID2_SEQ_RANGE_start) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> start = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + if (atp == ID2_SEQ_RANGE_length) { + if ( AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + ptr -> length = av.intvalue; + atp = AsnReadId(aip,amp, atp); + } + + if (AsnReadVal(aip, atp, &av) <= 0) { + goto erret; + } + /* end struct */ + +ret: + AsnUnlinkType(orig); /* unlink local tree */ + return ptr; + +erret: + aip -> io_failure = TRUE; + ptr = ID2SeqRangeFree(ptr); + goto ret; +} + + + +/************************************************** +* +* ID2SeqRangeAsnWrite() +* +**************************************************/ +NLM_EXTERN Boolean LIBCALL +ID2SeqRangeAsnWrite(ID2SeqRangePtr ptr, AsnIoPtr aip, AsnTypePtr orig) +{ + DataVal av; + AsnTypePtr atp; + Boolean retval = FALSE; + + if (! loaded) + { + if (! id2sgenAsnLoad()) { + return FALSE; + } + } + + if (aip == NULL) { + return FALSE; + } + + atp = AsnLinkType(orig, ID2_SEQ_RANGE); /* link local tree */ + if (atp == NULL) { + return FALSE; + } + + if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; } + if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) { + goto erret; + } + + av.intvalue = ptr -> start; + retval = AsnWrite(aip, ID2_SEQ_RANGE_start, &av); + av.intvalue = ptr -> length; + retval = AsnWrite(aip, ID2_SEQ_RANGE_length, &av); + if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) { + goto erret; + } + retval = TRUE; + +erret: + AsnUnlinkType(orig); /* unlink local tree */ + return retval; +} + diff --git a/network/id2arch/id2sgen.h b/network/id2arch/id2sgen.h new file mode 100644 index 00000000..77c3d001 --- /dev/null +++ b/network/id2arch/id2sgen.h @@ -0,0 +1,415 @@ +#ifndef _id2sgen_ +#define _id2sgen_ + +#undef NLM_EXTERN +#ifdef NLM_IMPORT +#define NLM_EXTERN NLM_IMPORT +#else +#define NLM_EXTERN extern +#endif + + +#ifdef __cplusplus +extern "C" { /* } */ +#endif + + +/************************************************** +* +* Generated objects for Module NCBI-Seq-split +* Generated using ASNCODE Revision: 6.0 at May 3, 2004 6:18 PM +* +**************************************************/ + +NLM_EXTERN Boolean LIBCALL +id2sgenAsnLoad PROTO((void)); + + +/************************************************** +* +* ID2SSeqAnnotInfo +* +**************************************************/ +typedef struct struct_ID2S_Seq_annot_Info { + CharPtr name; + Uint1 align; + Uint1 graph; + struct struct_ID2S_Feat_type_Info PNTR feat; + ValNodePtr seq_loc; +} ID2SSeqAnnotInfo, PNTR ID2SSeqAnnotInfoPtr; + + +NLM_EXTERN ID2SSeqAnnotInfoPtr LIBCALL ID2SSeqAnnotInfoFree PROTO ((ID2SSeqAnnotInfoPtr )); +NLM_EXTERN ID2SSeqAnnotInfoPtr LIBCALL ID2SSeqAnnotInfoNew PROTO (( void )); +NLM_EXTERN ID2SSeqAnnotInfoPtr LIBCALL ID2SSeqAnnotInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SSeqAnnotInfoAsnWrite PROTO (( ID2SSeqAnnotInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SSplitInfo +* +**************************************************/ +typedef struct struct_ID2S_Split_Info { + struct struct_ID2S_Bioseqs_Info PNTR bioseqs_info; + struct struct_ID2S_Chunk_Info PNTR chunks; +} ID2SSplitInfo, PNTR ID2SSplitInfoPtr; + + +NLM_EXTERN ID2SSplitInfoPtr LIBCALL ID2SSplitInfoFree PROTO ((ID2SSplitInfoPtr )); +NLM_EXTERN ID2SSplitInfoPtr LIBCALL ID2SSplitInfoNew PROTO (( void )); +NLM_EXTERN ID2SSplitInfoPtr LIBCALL ID2SSplitInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SSplitInfoAsnWrite PROTO (( ID2SSplitInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SBioseqsInfo +* +**************************************************/ +typedef struct struct_ID2S_Bioseqs_Info { + struct struct_ID2S_Bioseqs_Info PNTR next; + struct struct_ID2S_Bioseq_Info PNTR info; + struct struct_ID2_Id_Range PNTR bioseqs; +} ID2SBioseqsInfo, PNTR ID2SBioseqsInfoPtr; + + +NLM_EXTERN ID2SBioseqsInfoPtr LIBCALL ID2SBioseqsInfoFree PROTO ((ID2SBioseqsInfoPtr )); +NLM_EXTERN ID2SBioseqsInfoPtr LIBCALL ID2SBioseqsInfoNew PROTO (( void )); +NLM_EXTERN ID2SBioseqsInfoPtr LIBCALL ID2SBioseqsInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SBioseqsInfoAsnWrite PROTO (( ID2SBioseqsInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SChunkInfo +* +**************************************************/ +typedef struct struct_ID2S_Chunk_Info { + struct struct_ID2S_Chunk_Info PNTR next; + Int4 id; + ValNodePtr content; +} ID2SChunkInfo, PNTR ID2SChunkInfoPtr; + + +NLM_EXTERN ID2SChunkInfoPtr LIBCALL ID2SChunkInfoFree PROTO ((ID2SChunkInfoPtr )); +NLM_EXTERN ID2SChunkInfoPtr LIBCALL ID2SChunkInfoNew PROTO (( void )); +NLM_EXTERN ID2SChunkInfoPtr LIBCALL ID2SChunkInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SChunkInfoAsnWrite PROTO (( ID2SChunkInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SBioseqInfo +* +**************************************************/ +typedef struct struct_ID2S_Bioseq_Info { + Int4 gap_count; + Uint1 seq_map_has_ref; + struct struct_ID2S_Sequence_Split_Info PNTR sequence_split; +} ID2SBioseqInfo, PNTR ID2SBioseqInfoPtr; + + +NLM_EXTERN ID2SBioseqInfoPtr LIBCALL ID2SBioseqInfoFree PROTO ((ID2SBioseqInfoPtr )); +NLM_EXTERN ID2SBioseqInfoPtr LIBCALL ID2SBioseqInfoNew PROTO (( void )); +NLM_EXTERN ID2SBioseqInfoPtr LIBCALL ID2SBioseqInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SBioseqInfoAsnWrite PROTO (( ID2SBioseqInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2IdRange +* +**************************************************/ +typedef struct struct_ID2_Id_Range { + struct struct_ID2_Id_Range PNTR next; + Int4 start; + Int4 count; +} ID2IdRange, PNTR ID2IdRangePtr; + + +NLM_EXTERN ID2IdRangePtr LIBCALL ID2IdRangeFree PROTO ((ID2IdRangePtr )); +NLM_EXTERN ID2IdRangePtr LIBCALL ID2IdRangeNew PROTO (( void )); +NLM_EXTERN ID2IdRangePtr LIBCALL ID2IdRangeAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2IdRangeAsnWrite PROTO (( ID2IdRangePtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SSequenceSplitInfo +* +**************************************************/ +typedef struct struct_ID2S_Sequence_Split_Info { + Int4 block_size; + Int4 chunk_start; + ValNodePtr chunk_blocks; +} ID2SSequenceSplitInfo, PNTR ID2SSequenceSplitInfoPtr; + + +NLM_EXTERN ID2SSequenceSplitInfoPtr LIBCALL ID2SSequenceSplitInfoFree PROTO ((ID2SSequenceSplitInfoPtr )); +NLM_EXTERN ID2SSequenceSplitInfoPtr LIBCALL ID2SSequenceSplitInfoNew PROTO (( void )); +NLM_EXTERN ID2SSequenceSplitInfoPtr LIBCALL ID2SSequenceSplitInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SSequenceSplitInfoAsnWrite PROTO (( ID2SSequenceSplitInfoPtr , AsnIoPtr, AsnTypePtr)); + +typedef ValNodePtr ID2SChunkContentPtr; +typedef ValNode ID2SChunkContent; +#define ID2SChunkContent_seq_descr 1 +#define ID2SChunkContent_seq_annot 2 +#define ID2SChunkContent_seq_assembly 3 +#define ID2SChunkContent_seq_map 4 +#define ID2SChunkContent_seq_data 5 +#define ID2SChunkContent_seq_annot_place 6 + + +NLM_EXTERN ID2SChunkContentPtr LIBCALL ID2SChunkContentFree PROTO ((ID2SChunkContentPtr )); +NLM_EXTERN ID2SChunkContentPtr LIBCALL ID2SChunkContentAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SChunkContentAsnWrite PROTO (( ID2SChunkContentPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SSeqDescrInfo +* +**************************************************/ +typedef struct struct_ID2S_Seq_descr_Info { + Int4 type_mask; + struct struct_ID2_Id_Range PNTR bioseqs; + struct struct_ID2_Id_Range PNTR bioseq_sets; +} ID2SSeqDescrInfo, PNTR ID2SSeqDescrInfoPtr; + + +NLM_EXTERN ID2SSeqDescrInfoPtr LIBCALL ID2SSeqDescrInfoFree PROTO ((ID2SSeqDescrInfoPtr )); +NLM_EXTERN ID2SSeqDescrInfoPtr LIBCALL ID2SSeqDescrInfoNew PROTO (( void )); +NLM_EXTERN ID2SSeqDescrInfoPtr LIBCALL ID2SSeqDescrInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SSeqDescrInfoAsnWrite PROTO (( ID2SSeqDescrInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SSeqAssemblyInfo +* +**************************************************/ +typedef struct struct_ID2S_Seq_assembly_Info { + struct struct_ID2_Id_Range PNTR bioseqs; +} ID2SSeqAssemblyInfo, PNTR ID2SSeqAssemblyInfoPtr; + + +NLM_EXTERN ID2SSeqAssemblyInfoPtr LIBCALL ID2SSeqAssemblyInfoFree PROTO ((ID2SSeqAssemblyInfoPtr )); +NLM_EXTERN ID2SSeqAssemblyInfoPtr LIBCALL ID2SSeqAssemblyInfoNew PROTO (( void )); +NLM_EXTERN ID2SSeqAssemblyInfoPtr LIBCALL ID2SSeqAssemblyInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SSeqAssemblyInfoAsnWrite PROTO (( ID2SSeqAssemblyInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SSeqMapInfo +* +**************************************************/ +#define ID2SSeqMapInfo ValNode +#define ID2SSeqMapInfoPtr ValNodePtr +#define ID2SSeqMapInfoFree ValNodeFree +#define ID2SSeqMapInfoNew ValNodeNew +#define ID2SSeqMapInfoAsnRead ValNodeAsnRead +#define ID2SSeqMapInfoAsnWrite ValNodeAsnWrite + + +/************************************************** +* +* ID2SSeqDataInfo +* +**************************************************/ +#define ID2SSeqDataInfo ValNode +#define ID2SSeqDataInfoPtr ValNodePtr +#define ID2SSeqDataInfoFree ValNodeFree +#define ID2SSeqDataInfoNew ValNodeNew +#define ID2SSeqDataInfoAsnRead ValNodeAsnRead +#define ID2SSeqDataInfoAsnWrite ValNodeAsnWrite + + +/************************************************** +* +* ID2SSeqAnnotPlaceInfo +* +**************************************************/ +typedef struct struct_ID2S_Seq_annot_place_Info { + CharPtr name; + struct struct_ID2_Id_Range PNTR bioseqs; + struct struct_ID2_Id_Range PNTR bioseq_sets; +} ID2SSeqAnnotPlaceInfo, PNTR ID2SSeqAnnotPlaceInfoPtr; + + +NLM_EXTERN ID2SSeqAnnotPlaceInfoPtr LIBCALL ID2SSeqAnnotPlaceInfoFree PROTO ((ID2SSeqAnnotPlaceInfoPtr )); +NLM_EXTERN ID2SSeqAnnotPlaceInfoPtr LIBCALL ID2SSeqAnnotPlaceInfoNew PROTO (( void )); +NLM_EXTERN ID2SSeqAnnotPlaceInfoPtr LIBCALL ID2SSeqAnnotPlaceInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SSeqAnnotPlaceInfoAsnWrite PROTO (( ID2SSeqAnnotPlaceInfoPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SFeatTypeInfo +* +**************************************************/ +typedef struct struct_ID2S_Feat_type_Info { + struct struct_ID2S_Feat_type_Info PNTR next; + Int4 type; + ValNodePtr subtypes; +} ID2SFeatTypeInfo, PNTR ID2SFeatTypeInfoPtr; + + +NLM_EXTERN ID2SFeatTypeInfoPtr LIBCALL ID2SFeatTypeInfoFree PROTO ((ID2SFeatTypeInfoPtr )); +NLM_EXTERN ID2SFeatTypeInfoPtr LIBCALL ID2SFeatTypeInfoNew PROTO (( void )); +NLM_EXTERN ID2SFeatTypeInfoPtr LIBCALL ID2SFeatTypeInfoAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SFeatTypeInfoAsnWrite PROTO (( ID2SFeatTypeInfoPtr , AsnIoPtr, AsnTypePtr)); + +typedef ValNodePtr ID2SeqLocPtr; +typedef ValNode ID2SeqLoc; +#define ID2SeqLoc_gi_whole 1 +#define ID2SeqLoc_interval 2 +#define ID2SeqLoc_packed_ints 3 +#define ID2SeqLoc_gi_whole_range 4 +#define ID2SeqLoc_loc_set 5 +#define ID2SeqLoc_seq_loc 6 + + +NLM_EXTERN ID2SeqLocPtr LIBCALL ID2SeqLocFree PROTO ((ID2SeqLocPtr )); +NLM_EXTERN ID2SeqLocPtr LIBCALL ID2SeqLocAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SeqLocAsnWrite PROTO (( ID2SeqLocPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SChunk +* +**************************************************/ +typedef struct struct_ID2S_Chunk { + struct struct_ID2S_Chunk_Data PNTR data; +} ID2SChunk, PNTR ID2SChunkPtr; + + +NLM_EXTERN ID2SChunkPtr LIBCALL ID2SChunkFree PROTO ((ID2SChunkPtr )); +NLM_EXTERN ID2SChunkPtr LIBCALL ID2SChunkNew PROTO (( void )); +NLM_EXTERN ID2SChunkPtr LIBCALL ID2SChunkAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SChunkAsnWrite PROTO (( ID2SChunkPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SChunkData +* +**************************************************/ +typedef struct struct_ID2S_Chunk_Data { + struct struct_ID2S_Chunk_Data PNTR next; + ValNodePtr Id_id; + ValNodePtr descrs; + struct struct_Seq_annot PNTR annots; + struct struct_Seq_align PNTR assembly; + struct struct_Seq_literal PNTR seq_map; + struct struct_Seq_literal PNTR seq_data; +} ID2SChunkData, PNTR ID2SChunkDataPtr; + + +NLM_EXTERN ID2SChunkDataPtr LIBCALL ID2SChunkDataFree PROTO ((ID2SChunkDataPtr )); +NLM_EXTERN ID2SChunkDataPtr LIBCALL ID2SChunkDataNew PROTO (( void )); +NLM_EXTERN ID2SChunkDataPtr LIBCALL ID2SChunkDataAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SChunkDataAsnWrite PROTO (( ID2SChunkDataPtr , AsnIoPtr, AsnTypePtr)); + + +#ifdef NLM_GENERATED_CODE_PROTO + +typedef ValNodePtr Id_idPtr; +typedef ValNode Id_id; + +#endif /* NLM_GENERATED_CODE_PROTO */ + +#define Id_id_bioseq_set 1 +#define Id_id_gi 2 + +#ifdef NLM_GENERATED_CODE_PROTO + +static Id_idPtr LIBCALL Id_idFree PROTO ((Id_idPtr )); +static Id_idPtr LIBCALL Id_idAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +static Boolean LIBCALL Id_idAsnWrite PROTO (( Id_idPtr , AsnIoPtr, AsnTypePtr)); + +#endif /* NLM_GENERATED_CODE_PROTO */ + + + +/************************************************** +* +* ID2Interval +* +**************************************************/ +typedef struct struct_ID2_Interval { + Int4 gi; + Int4 start; + Int4 length; +} ID2Interval, PNTR ID2IntervalPtr; + + +NLM_EXTERN ID2IntervalPtr LIBCALL ID2IntervalFree PROTO ((ID2IntervalPtr )); +NLM_EXTERN ID2IntervalPtr LIBCALL ID2IntervalNew PROTO (( void )); +NLM_EXTERN ID2IntervalPtr LIBCALL ID2IntervalAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2IntervalAsnWrite PROTO (( ID2IntervalPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2PackedSeqInts +* +**************************************************/ +typedef struct struct_ID2_Packed_Seq_ints { + Int4 gi; + struct struct_ID2_Seq_range PNTR intervals; +} ID2PackedSeqInts, PNTR ID2PackedSeqIntsPtr; + + +NLM_EXTERN ID2PackedSeqIntsPtr LIBCALL ID2PackedSeqIntsFree PROTO ((ID2PackedSeqIntsPtr )); +NLM_EXTERN ID2PackedSeqIntsPtr LIBCALL ID2PackedSeqIntsNew PROTO (( void )); +NLM_EXTERN ID2PackedSeqIntsPtr LIBCALL ID2PackedSeqIntsAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2PackedSeqIntsAsnWrite PROTO (( ID2PackedSeqIntsPtr , AsnIoPtr, AsnTypePtr)); + + + +/************************************************** +* +* ID2SeqRange +* +**************************************************/ +typedef struct struct_ID2_Seq_range { + struct struct_ID2_Seq_range PNTR next; + Int4 start; + Int4 length; +} ID2SeqRange, PNTR ID2SeqRangePtr; + + +NLM_EXTERN ID2SeqRangePtr LIBCALL ID2SeqRangeFree PROTO ((ID2SeqRangePtr )); +NLM_EXTERN ID2SeqRangePtr LIBCALL ID2SeqRangeNew PROTO (( void )); +NLM_EXTERN ID2SeqRangePtr LIBCALL ID2SeqRangeAsnRead PROTO (( AsnIoPtr, AsnTypePtr)); +NLM_EXTERN Boolean LIBCALL ID2SeqRangeAsnWrite PROTO (( ID2SeqRangePtr , AsnIoPtr, AsnTypePtr)); + +#ifdef __cplusplus +/* { */ } +#endif + +#endif /* _id2sgen_ */ + +#undef NLM_EXTERN +#ifdef NLM_EXPORT +#define NLM_EXTERN NLM_EXPORT +#else +#define NLM_EXTERN +#endif + diff --git a/network/id2arch/makefile b/network/id2arch/makefile new file mode 100644 index 00000000..7935ef0d --- /dev/null +++ b/network/id2arch/makefile @@ -0,0 +1,57 @@ +include $(NCBI)/ncbi.mk + +INCLUDES = -I . -I$(NCBI_INCDIR) +CCOPT= -g -DSYSV=1 +CFLAGS=$(CCOPT) $(INCLUDES) #-DDEBUG_ASN_PRINT + +CODEGEN=$(NCBI)/bin/asncode +ASNTOOL=$(NCBI)/bin/asntool + +NCBI_USED=/am/ncbiapdata/asn/seqset.asn +NCBI_REFS=/am/ncbiapdata/asn/seq.asn,/am/ncbiapdata/asn/seqfeat.asn,/am/ncbiapdata/asn/seqloc.asn,/am/ncbiapdata/asn/general.asn,/am/ncbiapdata/asn/seqalign.asn,/am/ncbiapdata/asn/seqcode.asn,/am/ncbiapdata/asn/seqres.asn + +all: libncbiid2.a +#id2.o: id2.c id2.h +# cpp -C -P -D_DEBUG -I. -I$(NCBI)/include id2.c >id2.i +# cc -xildoff -c -g -D_DEBUG -I. -I$(NCBI)/include id2.c +# $(NCBI_CC) -g -xildoff -c id2.i +libncbiid2.a : id2.o id2sgen.o + rm -f $@ + ar -q $@ id2.o + - rm -f *.l + +id2.o: id2.c id2gen.h id2map.h id2sgen.h +id2sgen.o: id2sgen.c id2sgen.h id2map.h seqsplit.h + +id2sgen.c id2sgen.h: seqsplit.l all.l + $(CODEGEN) -i id2map.h -l seqsplit.l,all.l -o id2sgen -d . + +id2.c: id2.l id2.h all.l seqsplit.l + $(CODEGEN) -i id2map.h -l id2.l,seqsplit.l,all.l -o id2gen -d . + mv id2gen.c id2.c + +id2.l : id2.asn + $(ASNTOOL) -m id2.asn -l x.h + cat x.l* | sed 's/x[.]l[0-9]*/id2.l/g' >id2.l + rm -f x.* + +seqsplit.l : seqsplit.asn + $(ASNTOOL) -m seqsplit.asn -l x.h + cat x.l* | sed 's/x[.]l[0-9]*/seqsplit.l/g' >seqsplit.l + rm -f x.* + +all.l : + cat $(NCBI_USED) >x.asn + $(ASNTOOL) -m x.asn -M $(NCBI_REFS) -l x.h + cat x.l* | sed 's/x[.]l[0-9]*/all.l/g' >all.l + rm -f x.* + +id2.h : id2.asn + $(ASNTOOL) -m id2.asn -o id2.h +seqsplit.h : seqsplit.asn + $(ASNTOOL) -m seqsplit.asn -o seqsplit.h + +clean: + - rm -f *.l* *.c *.o *.a + - rm -f id2.h id2gen.h id2sgen.h seqsplit.h + - rm -f id2generr id2genout diff --git a/network/id2arch/seqsplit.asn b/network/id2arch/seqsplit.asn new file mode 100644 index 00000000..46932fe8 --- /dev/null +++ b/network/id2arch/seqsplit.asn @@ -0,0 +1,175 @@ +--$Revision: 1.3 $ +--******************************************************************** +-- +-- Network Id server network access +-- Vasilchenko 2003 +-- +-- +--********************************************************************* +-- +-- ID2.asn +-- +-- messages for id server network access +-- +--********************************************************************* + +NCBI-Seq-split DEFINITIONS ::= +BEGIN + +EXPORTS ID2S-Chunk-Id, ID2S-Seq-annot-Info; + +IMPORTS Seq-loc FROM NCBI-Seqloc + Seq-annot, Seq-descr, Seq-literal FROM NCBI-Sequence + Seq-align FROM NCBI-Seqalign; + +---------------------------------------------------------------------------- +-- Blob split info types +---------------------------------------------------------------------------- + + +ID2S-Split-Info ::= SEQUENCE { + bioseqs-info SET OF ID2S-Bioseqs-Info OPTIONAL, + chunks SET OF ID2S-Chunk-Info +} + + +ID2S-Bioseqs-Info ::= SEQUENCE { + info ID2S-Bioseq-Info, + bioseqs ID2-Id-Range +} + + +ID2S-Bioseq-Info ::= SEQUENCE { + gap-count INTEGER OPTIONAL, + seq-map-has-ref BOOLEAN OPTIONAL, + sequence-split ID2S-Sequence-Split-Info OPTIONAL +} + + +ID2S-Sequence-Split-Info ::= SEQUENCE { + block-size INTEGER, + chunk-start ID2S-Chunk-Id, + chunk-blocks SEQUENCE OF INTEGER +} + + +ID2S-Chunk-Info ::= SEQUENCE { + id ID2S-Chunk-Id, + content SET OF ID2S-Chunk-Content +} + + +ID2S-Chunk-Content ::= CHOICE { + seq-descr ID2S-Seq-descr-Info, + seq-annot ID2S-Seq-annot-Info, + seq-assembly ID2S-Seq-assembly-Info, + seq-map ID2S-Seq-map-Info, + seq-data ID2S-Seq-data-Info, + seq-annot-place ID2S-Seq-annot-place-Info +} + + +ID2S-Seq-descr-Info ::= SEQUENCE { + type-mask INTEGER, -- mask of Seq-descr types, + bioseqs SET OF ID2-Id-Range OPTIONAL, + bioseq-sets SET OF ID2-Id-Range OPTIONAL +} + + +ID2S-Seq-annot-Info ::= SEQUENCE { + -- name is set if this is named annot + -- name may be empty which differ from unnamed annot + name VisibleString OPTIONAL, + align NULL OPTIONAL, + graph NULL OPTIONAL, + feat SET OF ID2S-Feat-type-Info OPTIONAL, + seq-loc ID2-Seq-loc OPTIONAL +} + + +ID2S-Seq-annot-place-Info ::= SEQUENCE { + name VisibleString OPTIONAL, + bioseqs SET OF ID2-Id-Range OPTIONAL, + bioseq-sets SET OF ID2-Id-Range OPTIONAL +} + + +ID2S-Feat-type-Info ::= SEQUENCE { + type INTEGER, + subtypes SET OF INTEGER OPTIONAL +} + + +ID2S-Seq-assembly-Info ::= SEQUENCE { + bioseqs SET OF ID2-Id-Range +} + + +ID2S-Seq-map-Info ::= ID2-Seq-loc + + +ID2S-Seq-data-Info ::= ID2-Seq-loc + + +ID2S-Chunk ::= SEQUENCE { + data SET OF ID2S-Chunk-Data +} + + +ID2S-Chunk-Data ::= SEQUENCE { + id CHOICE { + bioseq-set INTEGER, + gi INTEGER + }, + descrs SET OF Seq-descr OPTIONAL, + annots SET OF Seq-annot OPTIONAL, + assembly SET OF Seq-align OPTIONAL, + seq-map SEQUENCE OF Seq-literal OPTIONAL, + seq-data SEQUENCE OF Seq-literal OPTIONAL +} + + +---------------------------------------------------------------------------- +-- utility types +---------------------------------------------------------------------------- + + +ID2S-Chunk-Id ::= INTEGER + + +ID2-Id-Range ::= SEQUENCE { + start INTEGER, -- gi for Bioseq, local id for Bioseq-set + count INTEGER DEFAULT 1 +} + + +ID2-Seq-loc ::= CHOICE { + gi-whole INTEGER, + interval ID2-Interval, + packed-ints ID2-Packed-Seq-ints, + gi-whole-range ID2-Id-Range, + loc-set SET OF ID2-Seq-loc, + seq-loc Seq-loc +} + + +ID2-Interval ::= SEQUENCE { + gi INTEGER, + start INTEGER, + length INTEGER DEFAULT 1 +} + + +ID2-Seq-range ::= SEQUENCE { + start INTEGER, + length INTEGER DEFAULT 1 +} + + +ID2-Packed-Seq-ints ::= SEQUENCE { + gi INTEGER, + intervals SET OF ID2-Seq-range +} + + +END diff --git a/network/id2arch/seqsplit.h b/network/id2arch/seqsplit.h new file mode 100644 index 00000000..1a6dbde2 --- /dev/null +++ b/network/id2arch/seqsplit.h @@ -0,0 +1,259 @@ +/*********************************************************************** +* +** +* Automatic header module from ASNTOOL +* +************************************************************************/ + +#ifndef _ASNTOOL_ +#include <asn.h> +#endif + +static char * asnfilename = "seqsplit.h13"; +static AsnValxNode avnx[3] = { + {3,NULL,1,0.0,NULL } , + {3,NULL,1,0.0,NULL } , + {3,NULL,1,0.0,NULL } }; + +static AsnType atx[109] = { + {401, "ID2S-Chunk-Id" ,1,0,0,0,0,1,0,0,NULL,&atx[1],NULL,0,&atx[2]} , + {302, "INTEGER" ,0,2,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {402, "ID2S-Seq-annot-Info" ,1,0,0,0,0,1,0,0,NULL,&atx[15],&atx[3],0,&atx[39]} , + {0, "name" ,128,0,0,1,0,0,0,0,NULL,&atx[4],NULL,0,&atx[5]} , + {323, "VisibleString" ,0,26,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {0, "align" ,128,1,0,1,0,0,0,0,NULL,&atx[6],NULL,0,&atx[7]} , + {305, "NULL" ,0,5,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {0, "graph" ,128,2,0,1,0,0,0,0,NULL,&atx[6],NULL,0,&atx[8]} , + {0, "feat" ,128,3,0,1,0,0,0,0,NULL,&atx[14],&atx[9],0,&atx[16]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[10],NULL,0,NULL} , + {420, "ID2S-Feat-type-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[11],0,&atx[17]} , + {0, "type" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[12]} , + {0, "subtypes" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[13],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , + {314, "SET OF" ,0,17,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {311, "SEQUENCE" ,0,16,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {0, "seq-loc" ,128,4,0,1,0,0,0,0,NULL,&atx[17],NULL,0,NULL} , + {421, "ID2-Seq-loc" ,1,0,0,0,0,0,0,0,NULL,&atx[40],&atx[18],0,&atx[92]} , + {0, "gi-whole" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[19]} , + {0, "interval" ,128,1,0,0,0,0,0,0,NULL,&atx[20],NULL,0,&atx[24]} , + {424, "ID2-Interval" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[21],0,&atx[25]} , + {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[22]} , + {0, "start" ,128,1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[23]} , + {0, "length" ,128,2,0,0,1,0,0,0,&avnx[0],&atx[1],NULL,0,NULL} , + {0, "packed-ints" ,128,2,0,0,0,0,0,0,NULL,&atx[25],NULL,0,&atx[32]} , + {425, "ID2-Packed-Seq-ints" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[26],0,&atx[29]} , + {0, "gi" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[27]} , + {0, "intervals" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[28],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[29],NULL,0,NULL} , + {426, "ID2-Seq-range" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[30],0,NULL} , + {0, "start" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[31]} , + {0, "length" ,128,1,0,0,1,0,0,0,&avnx[1],&atx[1],NULL,0,NULL} , + {0, "gi-whole-range" ,128,3,0,0,0,0,0,0,NULL,&atx[33],NULL,0,&atx[36]} , + {412, "ID2-Id-Range" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[34],0,&atx[55]} , + {0, "start" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[35]} , + {0, "count" ,128,1,0,0,1,0,0,0,&avnx[2],&atx[1],NULL,0,NULL} , + {0, "loc-set" ,128,4,0,0,0,0,0,0,NULL,&atx[14],&atx[37],0,&atx[38]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[17],NULL,0,NULL} , + {0, "seq-loc" ,128,5,0,0,0,0,0,0,NULL,&atx[39],NULL,0,NULL} , + {403, "Seq-loc" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[41]} , + {315, "CHOICE" ,0,-1,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {404, "Seq-annot" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[42]} , + {405, "Seq-descr" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[43]} , + {406, "Seq-literal" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[44]} , + {407, "Seq-align" ,1,0,0,0,0,0,1,0,NULL,NULL,NULL,0,&atx[45]} , + {408, "ID2S-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[46],0,&atx[48]} , + {0, "bioseqs-info" ,128,0,0,1,0,0,0,0,NULL,&atx[14],&atx[47],0,&atx[62]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[48],NULL,0,NULL} , + {409, "ID2S-Bioseqs-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[49],0,&atx[64]} , + {0, "info" ,128,0,0,0,0,0,0,0,NULL,&atx[50],NULL,0,&atx[61]} , + {411, "ID2S-Bioseq-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[51],0,&atx[33]} , + {0, "gap-count" ,128,0,0,1,0,0,0,0,NULL,&atx[1],NULL,0,&atx[52]} , + {0, "seq-map-has-ref" ,128,1,0,1,0,0,0,0,NULL,&atx[53],NULL,0,&atx[54]} , + {301, "BOOLEAN" ,0,1,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {0, "sequence-split" ,128,2,0,1,0,0,0,0,NULL,&atx[55],NULL,0,NULL} , + {413, "ID2S-Sequence-Split-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[56],0,&atx[68]} , + {0, "block-size" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[57]} , + {0, "chunk-start" ,128,1,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[58]} , + {0, "chunk-blocks" ,128,2,0,0,0,0,0,0,NULL,&atx[60],&atx[59],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , + {312, "SEQUENCE OF" ,0,16,0,0,0,0,0,0,NULL,NULL,NULL,0,NULL} , + {0, "bioseqs" ,128,1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , + {0, "chunks" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[63],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[64],NULL,0,NULL} , + {410, "ID2S-Chunk-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[65],0,&atx[50]} , + {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[0],NULL,0,&atx[66]} , + {0, "content" ,128,1,0,0,0,0,0,0,NULL,&atx[14],&atx[67],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[68],NULL,0,NULL} , + {414, "ID2S-Chunk-Content" ,1,0,0,0,0,0,0,0,NULL,&atx[40],&atx[69],0,&atx[70]} , + {0, "seq-descr" ,128,0,0,0,0,0,0,0,NULL,&atx[70],NULL,0,&atx[76]} , + {415, "ID2S-Seq-descr-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[71],0,&atx[78]} , + {0, "type-mask" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[72]} , + {0, "bioseqs" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[73],0,&atx[74]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , + {0, "bioseq-sets" ,128,2,0,1,0,0,0,0,NULL,&atx[14],&atx[75],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , + {0, "seq-annot" ,128,1,0,0,0,0,0,0,NULL,&atx[2],NULL,0,&atx[77]} , + {0, "seq-assembly" ,128,2,0,0,0,0,0,0,NULL,&atx[78],NULL,0,&atx[81]} , + {416, "ID2S-Seq-assembly-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[79],0,&atx[82]} , + {0, "bioseqs" ,128,0,0,0,0,0,0,0,NULL,&atx[14],&atx[80],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , + {0, "seq-map" ,128,3,0,0,0,0,0,0,NULL,&atx[82],NULL,0,&atx[83]} , + {417, "ID2S-Seq-map-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[17],NULL,0,&atx[84]} , + {0, "seq-data" ,128,4,0,0,0,0,0,0,NULL,&atx[84],NULL,0,&atx[85]} , + {418, "ID2S-Seq-data-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[17],NULL,0,&atx[86]} , + {0, "seq-annot-place" ,128,5,0,0,0,0,0,0,NULL,&atx[86],NULL,0,NULL} , + {419, "ID2S-Seq-annot-place-Info" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[87],0,&atx[10]} , + {0, "name" ,128,0,0,1,0,0,0,0,NULL,&atx[4],NULL,0,&atx[88]} , + {0, "bioseqs" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[89],0,&atx[90]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , + {0, "bioseq-sets" ,128,2,0,1,0,0,0,0,NULL,&atx[14],&atx[91],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[33],NULL,0,NULL} , + {422, "ID2S-Chunk" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[93],0,&atx[95]} , + {0, "data" ,128,0,0,0,0,0,0,0,NULL,&atx[14],&atx[94],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[95],NULL,0,NULL} , + {423, "ID2S-Chunk-Data" ,1,0,0,0,0,0,0,0,NULL,&atx[15],&atx[96],0,&atx[20]} , + {0, "id" ,128,0,0,0,0,0,0,0,NULL,&atx[40],&atx[97],0,&atx[99]} , + {0, "bioseq-set" ,128,0,0,0,0,0,0,0,NULL,&atx[1],NULL,0,&atx[98]} , + {0, "gi" ,128,1,0,0,0,0,0,0,NULL,&atx[1],NULL,0,NULL} , + {0, "descrs" ,128,1,0,1,0,0,0,0,NULL,&atx[14],&atx[100],0,&atx[101]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[42],NULL,0,NULL} , + {0, "annots" ,128,2,0,1,0,0,0,0,NULL,&atx[14],&atx[102],0,&atx[103]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[41],NULL,0,NULL} , + {0, "assembly" ,128,3,0,1,0,0,0,0,NULL,&atx[14],&atx[104],0,&atx[105]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[44],NULL,0,NULL} , + {0, "seq-map" ,128,4,0,1,0,0,0,0,NULL,&atx[60],&atx[106],0,&atx[107]} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[43],NULL,0,NULL} , + {0, "seq-data" ,128,5,0,1,0,0,0,0,NULL,&atx[60],&atx[108],0,NULL} , + {0, NULL,1,-1,0,0,0,0,0,0,NULL,&atx[43],NULL,0,NULL} }; + +static AsnModule ampx[1] = { + { "NCBI-Seq-split" , "seqsplit.h13",&atx[0],NULL,NULL,0,0} }; + +static AsnValxNodePtr avn = avnx; +static AsnTypePtr at = atx; +static AsnModulePtr amp = ampx; + + + +/************************************************** +* +* Defines for Module NCBI-Seq-split +* +**************************************************/ + +#define ID2S_CHUNK_ID &at[0] + +#define ID2S_SEQ_ANNOT_INFO &at[2] +#define ID2S_SEQ_ANNOT_INFO_name &at[3] +#define ID2S_SEQ_ANNOT_INFO_align &at[5] +#define ID2S_SEQ_ANNOT_INFO_graph &at[7] +#define ID2S_SEQ_ANNOT_INFO_feat &at[8] +#define ID2S_SEQ_ANNOT_INFO_feat_E &at[9] +#define ID2S_SEQ_ANNOT_INFO_seq_loc &at[16] + +#define ID2S_SPLIT_INFO &at[45] +#define ID2S_SPLIT_INFO_bioseqs_info &at[46] +#define ID2S_SPLIT_INFO_bioseqs_info_E &at[47] +#define ID2S_SPLIT_INFO_chunks &at[62] +#define ID2S_SPLIT_INFO_chunks_E &at[63] + +#define ID2S_BIOSEQS_INFO &at[48] +#define ID2S_BIOSEQS_INFO_info &at[49] +#define ID2S_BIOSEQS_INFO_bioseqs &at[61] + +#define ID2S_CHUNK_INFO &at[64] +#define ID2S_CHUNK_INFO_id &at[65] +#define ID2S_CHUNK_INFO_content &at[66] +#define ID2S_CHUNK_INFO_content_E &at[67] + +#define ID2S_BIOSEQ_INFO &at[50] +#define ID2S_BIOSEQ_INFO_gap_count &at[51] +#define BIOSEQ_INFO_seq_map_has_ref &at[52] +#define ID2S_BIOSEQ_INFO_sequence_split &at[54] + +#define ID2_ID_RANGE &at[33] +#define ID2_ID_RANGE_start &at[34] +#define ID2_ID_RANGE_count &at[35] + +#define ID2S_SEQUENCE_SPLIT_INFO &at[55] +#define SEQUENCE_SPLIT_INFO_block_size &at[56] +#define SPLIT_INFO_chunk_start &at[57] +#define SPLIT_INFO_chunk_blocks &at[58] +#define SPLIT_INFO_chunk_blocks_E &at[59] + +#define ID2S_CHUNK_CONTENT &at[68] +#define ID2S_CHUNK_CONTENT_seq_descr &at[69] +#define ID2S_CHUNK_CONTENT_seq_annot &at[76] +#define ID2S_CHUNK_CONTENT_seq_assembly &at[77] +#define ID2S_CHUNK_CONTENT_seq_map &at[81] +#define ID2S_CHUNK_CONTENT_seq_data &at[83] +#define CHUNK_CONTENT_seq_annot_place &at[85] + +#define ID2S_SEQ_DESCR_INFO &at[70] +#define ID2S_SEQ_DESCR_INFO_type_mask &at[71] +#define ID2S_SEQ_DESCR_INFO_bioseqs &at[72] +#define ID2S_SEQ_DESCR_INFO_bioseqs_E &at[73] +#define ID2S_SEQ_DESCR_INFO_bioseq_sets &at[74] +#define SEQ_DESCR_INFO_bioseq_sets_E &at[75] + +#define ID2S_SEQ_ASSEMBLY_INFO &at[78] +#define ID2S_SEQ_ASSEMBLY_INFO_bioseqs &at[79] +#define SEQ_ASSEMBLY_INFO_bioseqs_E &at[80] + +#define ID2S_SEQ_MAP_INFO &at[82] + +#define ID2S_SEQ_DATA_INFO &at[84] + +#define ID2S_SEQ_ANNOT_PLACE_INFO &at[86] +#define ID2S_SEQ_ANNOT_PLACE_INFO_name &at[87] +#define SEQ_ANNOT_PLACE_INFO_bioseqs &at[88] +#define SEQ_ANNOT_PLACE_INFO_bioseqs_E &at[89] +#define ANNOT_PLACE_INFO_bioseq_sets &at[90] +#define ANNOT_PLACE_INFO_bioseq_sets_E &at[91] + +#define ID2S_FEAT_TYPE_INFO &at[10] +#define ID2S_FEAT_TYPE_INFO_type &at[11] +#define ID2S_FEAT_TYPE_INFO_subtypes &at[12] +#define ID2S_FEAT_TYPE_INFO_subtypes_E &at[13] + +#define ID2_SEQ_LOC &at[17] +#define ID2_SEQ_LOC_gi_whole &at[18] +#define ID2_SEQ_LOC_interval &at[19] +#define ID2_SEQ_LOC_packed_ints &at[24] +#define ID2_SEQ_LOC_gi_whole_range &at[32] +#define ID2_SEQ_LOC_loc_set &at[36] +#define ID2_SEQ_LOC_loc_set_E &at[37] +#define ID2_SEQ_LOC_seq_loc &at[38] + +#define ID2S_CHUNK &at[92] +#define ID2S_CHUNK_data &at[93] +#define ID2S_CHUNK_data_E &at[94] + +#define ID2S_CHUNK_DATA &at[95] +#define ID2S_CHUNK_DATA_id &at[96] +#define ID2S_CHUNK_DATA_id_bioseq_set &at[97] +#define ID2S_CHUNK_DATA_id_gi &at[98] +#define ID2S_CHUNK_DATA_descrs &at[99] +#define ID2S_CHUNK_DATA_descrs_E &at[100] +#define ID2S_CHUNK_DATA_annots &at[101] +#define ID2S_CHUNK_DATA_annots_E &at[102] +#define ID2S_CHUNK_DATA_assembly &at[103] +#define ID2S_CHUNK_DATA_assembly_E &at[104] +#define ID2S_CHUNK_DATA_seq_map &at[105] +#define ID2S_CHUNK_DATA_seq_map_E &at[106] +#define ID2S_CHUNK_DATA_seq_data &at[107] +#define ID2S_CHUNK_DATA_seq_data_E &at[108] + +#define ID2_INTERVAL &at[20] +#define ID2_INTERVAL_gi &at[21] +#define ID2_INTERVAL_start &at[22] +#define ID2_INTERVAL_length &at[23] + +#define ID2_PACKED_SEQ_INTS &at[25] +#define ID2_PACKED_SEQ_INTS_gi &at[26] +#define ID2_PACKED_SEQ_INTS_intervals &at[27] +#define ID2_PACKED_SEQ_INTS_intervals_E &at[28] + +#define ID2_SEQ_RANGE &at[29] +#define ID2_SEQ_RANGE_start &at[30] +#define ID2_SEQ_RANGE_length &at[31] diff --git a/network/medarch/client/medarch.c b/network/medarch/client/medarch.c index 7a683bc8..3c686c24 100644 --- a/network/medarch/client/medarch.c +++ b/network/medarch/client/medarch.c @@ -29,7 +29,7 @@ * * Version Creation Date: 03/31/93 * -* $Revision: 6.0 $ +* $Revision: 6.1 $ * * File Description: * API for Medline Archive service @@ -53,6 +53,9 @@ * * RCS Modification History: * $Log: medarch.c,v $ +* Revision 6.1 2004/04/01 13:43:07 lavr +* Spell "occurred", "occurrence", and "occurring" +* * Revision 6.0 1997/08/25 18:35:40 madden * Revision changed to 6.0 * @@ -1110,7 +1113,7 @@ ValNodePtr s_MedArchGetMriPmids ( This function call MedArch server and sends accession/xref code, it recives list of Medline IDs. plAccNum is an optional argument in accordance with Medline-si definition. Set it to NULL if accession code is unknown. - It returns NULL if there are no entries found or if some error occured. + It returns NULL if there are no entries found or if some error occurred. -*/ /******************************************************************************/ static @@ -1154,7 +1157,7 @@ ValNodePtr s_MedArchGetAccUids ( list of PubMed IDs. plAccNum is an optional argument in accordance with Medline-si definition. Set it to NULL if accession code is unknown. - It returns NULL if there are no entries found or if some error occured. + It returns NULL if there are no entries found or if some error occurred. -*/ /******************************************************************************/ static @@ -1979,7 +1982,7 @@ ValNodePtr Server will return list of articles(MuId's) that are present in this issue. plAccNum is an optional argument in accordance with Medline-si definition. Set it to NULL if accession code is unknown. - It returns NULL if there are no entries found or if some error occured.-*/ + It returns NULL if there are no entries found or if some error occurred.-*/ /******************************************************************************/ ValNodePtr /*FCN*/MedArchGetAccUids ( @@ -2019,7 +2022,7 @@ ValNodePtr Server will return list of PmIds that are present in this issue. plAccNum is an optional argument in accordance with Medline-si definition. Set it to NULL if accession code is unknown. - It returns NULL if there are no entries found or if some error occured.-*/ + It returns NULL if there are no entries found or if some error occurred.-*/ /******************************************************************************/ ValNodePtr /*FCN*/MedArchGetAccPmids ( diff --git a/network/medarch/client/medutil.c b/network/medarch/client/medutil.c index 1ebed5c2..fc6b5199 100644 --- a/network/medarch/client/medutil.c +++ b/network/medarch/client/medutil.c @@ -28,7 +28,7 @@ * * Version Creation Date: 8/31/93 * -* $Revision: 6.10 $ +* $Revision: 6.14 $ * * File Description: Medline Utilities for MedArch * Assumes user calls MedArchInit and Fini @@ -44,6 +44,25 @@ * * RCS Modification History: * $Log: medutil.c,v $ +* Revision 6.14 2004/03/19 18:32:03 bazhin +* One more patch related to the previous one. +* +* Revision 6.13 2004/03/19 14:53:18 bazhin +* Added function PropogateInPress(), which is called from FixPubEquiv(). +* It sets Imprint.prepub value to "in-press" if input Cit-art was flagged +* as "in-press", but had Medline or/and Pubmed id(s) and successful lookup +* returned Cit-art with no article references, such as volume and page +* numbers. +* +* Revision 6.12 2004/03/17 16:59:35 bazhin +* Slight modification in ten_authors() function. If the number of input +* authors greater than 10 and number of MedArch ones less or equal 11, +* or input has more than 25 and MedArch has less or equal 26, then +* it will take input set instead of MedArch one. +* +* Revision 6.11 2004/03/16 18:53:37 bazhin +* Now does not ignore in-press'ed Cit-arts for lookup. +* * Revision 6.10 2003/10/01 13:08:33 bazhin * Modified ten_authors() function to handle consortiums properly. * @@ -334,6 +353,7 @@ Boolean ten_authors(CitArtPtr art, CitArtPtr art_tmp) CharPtr newcon; Int2 num; Int2 numnew; + Int2 numtmp; Int2 i; Int2 match; @@ -367,14 +387,14 @@ Boolean ten_authors(CitArtPtr art, CitArtPtr art_tmp) oldcon = aup->name->data; } - for(newcon = NULL, v = art_tmp->authors->names; v != NULL; v = v->next) + newcon = NULL; + for(numtmp = 0, v = art_tmp->authors->names; v != NULL; v = v->next) { aup = v->data.ptrvalue; - if(aup->name->choice == 5) - { + if(aup->name->choice == 2) + numtmp++; + else if(aup->name->choice == 5) newcon = aup->name->data; - break; - } } if(oldcon != NULL) @@ -435,7 +455,7 @@ Boolean ten_authors(CitArtPtr art, CitArtPtr art_tmp) if(i > 3 * match) return(FALSE); - if(num > 10 || numnew == 0) + if(numtmp == 0 || (num > 10 && numtmp < 12) || (num > 25 && numtmp < 27)) { AuthListFree(art_tmp->authors); art_tmp->authors = art->authors; @@ -677,6 +697,58 @@ ValNodePtr SplitMedlineEntry(MedlineEntryPtr mep) return uid; } +/**********************************************************/ +static Boolean if_inpress_set(CitArtPtr cap) +{ + CitJourPtr jour; + CitBookPtr book; + + if(cap == NULL || cap->fromptr == NULL) + return(FALSE); + + if(cap->from == 1) + { + jour = cap->fromptr; + if(jour->imp != NULL && jour->imp->prepub == 2) + return(TRUE); + } + else if(cap->from == 2 || cap->from == 3) + { + book = cap->fromptr; + if(book->imp != NULL && book->imp->prepub == 2) + return(TRUE); + } + return(FALSE); +} + +/**********************************************************/ +static void PropogateInPress(Boolean inpress, ValNodePtr vnp) +{ + CitJourPtr jour; + CitBookPtr book; + CitArtPtr cap; + + if(inpress == FALSE || vnp == NULL || vnp->data.ptrvalue == NULL) + return; + + cap = vnp->data.ptrvalue; + if(in_press(cap) == FALSE || cap->fromptr == NULL) + return; + + if(cap->from == 1) + { + jour = cap->fromptr; + if(jour->imp != NULL) + jour->imp->prepub = 2; + } + else if(cap->from == 2 || cap->from == 3) + { + book = cap->fromptr; + if(book->imp != NULL) + book->imp->prepub = 2; + } +} + /***************************************************************************** * * FixPubEquiv() @@ -689,9 +761,20 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) Int2 muidctr = 0, pmidctr = 0, citartctr = 0, mepctr = 0, otherctr = 0; Int4 muid = 0, oldmuid=0, pmid = 0, oldpmid=0; CitArtPtr cit; + Boolean got; + Boolean inpress; if (pube == NULL) return NULL; + for(got = FALSE, tmp = pube; tmp != NULL; tmp = tmp->next) + { + if(tmp->choice == PUB_Muid || tmp->choice == PUB_PMid) + { + got = TRUE; + break; + } + } + for (tmp = pube; tmp != NULL; tmp = next) { next = tmp->next; @@ -722,7 +805,7 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) break; case PUB_Article: cit = tmp->data.ptrvalue; - if (cit->from == 2 || in_press(cit)) { + if (cit->from == 2 || (in_press(cit) && got == FALSE)) { otherctr++; if (otherptr == NULL) otherptr = tmp; @@ -892,6 +975,7 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) citartptr->next = PubEquivFree(citartptr->next); } + inpress = if_inpress_set(citartptr->data.ptrvalue); fpop->lookups_attempted++; muid = MedArchCitMatch(citartptr); if (muid != 0) /* success */ @@ -933,6 +1017,7 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) tmp->next = new; PubFree(citartptr); + citartptr = new; } else { print_pub(citartptr, FALSE, TRUE, muid); PubFree(new); @@ -979,6 +1064,7 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) tmp->next = citartptr; MedlineToISO(citartptr); } + PropogateInPress(inpress, citartptr); return pube; } @@ -1024,6 +1110,7 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) tmp->next = new; PubFree(citartptr); + citartptr = new; } else { print_pub(citartptr, FALSE, TRUE, pmid); PubFree(new); @@ -1070,6 +1157,7 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) tmp->next = citartptr; MedlineToISO(citartptr); } + PropogateInPress(inpress, citartptr); return pube; } @@ -1080,6 +1168,7 @@ ValNodePtr FixPubEquiv(ValNodePtr pube, FindPubOptionPtr fpop) tmp2->next = citartptr; if (muidptr != NULL) /* ditch the mismatched muid */ PubFree(muidptr); + PropogateInPress(inpress, citartptr); return pube; } diff --git a/network/nsclilib/ni_msg.c b/network/nsclilib/ni_msg.c index 326392e7..322f0b5d 100644 --- a/network/nsclilib/ni_msg.c +++ b/network/nsclilib/ni_msg.c @@ -29,7 +29,7 @@ * * Version Creation Date: 1/1/92 * -* $Revision: 6.3 $ +* $Revision: 6.4 $ * * File Description: * This file consists mostly of functions for creating, destroying, reading, @@ -138,6 +138,9 @@ * * RCS Modification History: * $Log: ni_msg.c,v $ +* Revision 6.4 2004/04/01 13:43:07 lavr +* Spell "occurred", "occurrence", and "occurring" +* * Revision 6.3 2002/12/17 23:01:36 kans * support for OS_UNIX_DARWIN for Mach-O executables (RGS) * @@ -3914,7 +3917,7 @@ NLM_EXTERN Int2 LIBCALLBACK NI_AsnRead(Pointer p, CharPtr buf, Uint2 len) * It is relatively unlikely that "writing" will block, thus * causing the calling application to block. For "writing" to * block, there would need to be flow control imposed in the - * TCP/IP protocol suite, which is an unlikely occurance when + * TCP/IP protocol suite, which is an unlikely occurrence when * passing small quantities of data. */ diff --git a/network/nsclilib/ni_service.c b/network/nsclilib/ni_service.c index d56b8511..ed78575b 100644 --- a/network/nsclilib/ni_service.c +++ b/network/nsclilib/ni_service.c @@ -1,4 +1,4 @@ -/* $RCSfile: ni_service.c,v $ $Revision: 6.16 $ $Date: 2003/10/27 14:10:49 $ +/* $RCSfile: ni_service.c,v $ $Revision: 6.18 $ $Date: 2004/02/23 17:00:39 $ * ========================================================================== * * PUBLIC DOMAIN NOTICE @@ -30,6 +30,12 @@ * * -------------------------------------------------------------------------- * $Log: ni_service.c,v $ + * Revision 6.18 2004/02/23 17:00:39 lavr + * Fix n_written variable name typo + * + * Revision 6.17 2004/02/23 15:30:21 lavr + * New (last) parameter "how" added in CONN_Write() API call + * * Revision 6.16 2003/10/27 14:10:49 lavr * Better flow control in s_AsnWrite() * @@ -124,20 +130,8 @@ static Int2 LIBCALLBACK s_AsnRead(Pointer p, CharPtr buf, Uint2 len) static Int2 LIBCALLBACK s_AsnWrite(Pointer p, CharPtr buf, Uint2 len) { - CONN conn = (CONN) p; - size_t n_written = 0; - for (;;) { - size_t x_written; - EIO_Status status = CONN_Write(conn, buf, len, &x_written); - n_written += x_written; - if (len == x_written || status != eIO_Success || - CONN_Wait(conn, eIO_Write, - CONN_GetTimeout(conn, eIO_Write)) != eIO_Success) { - break; - } - buf += x_written; - len -= x_written; - } + size_t n_written; + CONN_Write((CONN) p, buf, len, &n_written, eIO_WritePersist); return (Int2) n_written; } diff --git a/network/suggest/client/suggapi.c b/network/suggest/client/suggapi.c index c17db3cb..5a2ff98d 100644 --- a/network/suggest/client/suggapi.c +++ b/network/suggest/client/suggapi.c @@ -29,7 +29,7 @@ * * Version Creation Date: 08/14/95 * -* $Revision: 6.0 $ +* $Revision: 6.1 $ * * File Description: * Implementation of API for Suggest service @@ -210,7 +210,7 @@ SuggestFini(void) * * Return: * pointer to SeqAnnot structure which will contain the result of - * the processing or NULL if error occured. + * the processing or NULL if error occurred. * * Note: * SuggestResponse structure can contain an error from Suggest Server, so @@ -250,7 +250,7 @@ SeqAnnotPtr SuggestFindIntervals(SuggestIntervalsPtr pIntervals) return NULL; if (pResp->choice == SuggestResponse_error) { - /* Error occured on server's side, report it + /* Error occurred on server's side, report it */ ErrorFromServer(pResp->data.ptrvalue); SuggestResponseFree(pResp); diff --git a/network/suggest/server/suggsrv.c b/network/suggest/server/suggsrv.c index 7e74ad45..b31545ac 100644 --- a/network/suggest/server/suggsrv.c +++ b/network/suggest/server/suggsrv.c @@ -29,7 +29,7 @@ * * Version Creation Date: 08/14/95 * -* $Revision: 6.0 $ +* $Revision: 6.1 $ * * File Description: * Implementation of Suggest server. Here it is only server specific @@ -47,6 +47,9 @@ * * RCS Modification History: * $Log: suggsrv.c,v $ +* Revision 6.1 2004/04/01 13:43:07 lavr +* Spell "occurred", "occurrence", and "occurring" +* * Revision 6.0 1997/08/25 18:40:59 madden * Revision changed to 6.0 * @@ -188,7 +191,7 @@ main(int argc, char *argv[]) * pAsnIoOut - output file to which * * Return: - * FALSE if nothing more to process or error occured and farther + * FALSE if nothing more to process or error occurred and farther * processing is not possible, otherwise TRUE. * \*****************************************************************************/ @@ -204,7 +207,7 @@ ServeClient(AsnIoPtr pAsnIn, AsnIoPtr pAsnOut) SuggestResponsePtr pResp; SuggestIntervalsPtr pSIntervals; - /* Encountering EOF on reading is a "normal" occurence, + /* Encountering EOF on reading is a "normal" occurrence, * and does not merit an error message */ ErrGetOpts(&iErrAct, NULL); diff --git a/network/taxon1/taxon2/tc2proc.c b/network/taxon1/taxon2/tc2proc.c index 91632731..0b2ca9f1 100644 --- a/network/taxon1/taxon2/tc2proc.c +++ b/network/taxon1/taxon2/tc2proc.c @@ -1,5 +1,5 @@ /*----------------*/ -/* $Id: tc2proc.c,v 1.33 2003/07/29 20:06:05 soussov Exp $ */ +/* $Id: tc2proc.c,v 1.34 2004/02/25 19:21:21 soussov Exp $ */ /*----------------*/ #include <stdlib.h> @@ -316,31 +316,37 @@ int tax1_getChildren(Int4 id_tax, Int4** ids_out) /* find last common ancestor for two nodes */ Int4 tax1_join(Int4 taxid1, Int4 taxid2) { - TreeNodeId nid; - Int4 aid= 0; - TreeCursorPtr cursor1= tree_openCursor(tax_tree, NULL, NULL); - TreeCursorPtr cursor2= tree_openCursor(tax_tree, NULL, NULL); - - if((cursor1 == NULL) || (cursor2 == NULL) || - (!tc2_toNode(cursor1, taxid1)) || (!tc2_toNode(cursor2, taxid2))) { - if(cursor1 != NULL) tree_closeCursor(cursor1); - if(cursor2 != NULL) tree_closeCursor(cursor2); - return -1; + if(taxid1 == taxid2) { + taxid2= getLiveId(taxid1); + return (taxid2 > 0)? taxid2 : -1; } - - nid= tree_getAncestor(cursor1, cursor2); - - if(tree_toNode(cursor1, nid)) { - TXC_TreeNodePtr tnp; - Uint2 s; + else { + TreeNodeId nid; + Int4 aid= 0; + TreeCursorPtr cursor1= tree_openCursor(tax_tree, NULL, NULL); + TreeCursorPtr cursor2= tree_openCursor(tax_tree, NULL, NULL); + + if((cursor1 == NULL) || (cursor2 == NULL) || + (!tc2_toNode(cursor1, taxid1)) || (!tc2_toNode(cursor2, taxid2))) { + if(cursor1 != NULL) tree_closeCursor(cursor1); + if(cursor2 != NULL) tree_closeCursor(cursor2); + return -1; + } - tnp= tree_getNodeData(cursor1, &s); - if(tnp != NULL) aid= tnp->tax_id; + nid= tree_getAncestor(cursor1, cursor2); + + if(tree_toNode(cursor1, nid)) { + TXC_TreeNodePtr tnp; + Uint2 s; + + tnp= tree_getNodeData(cursor1, &s); + if(tnp != NULL) aid= tnp->tax_id; + } + + tree_closeCursor(cursor1); + tree_closeCursor(cursor2); + return aid; } - - tree_closeCursor(cursor1); - tree_closeCursor(cursor2); - return aid; } diff --git a/network/vibnet/trmlst.c b/network/vibnet/trmlst.c index 24cdf201..664a01ed 100644 --- a/network/vibnet/trmlst.c +++ b/network/vibnet/trmlst.c @@ -29,7 +29,7 @@ * * Version Creation Date: 8/5/96 * -* $Revision: 6.25 $ +* $Revision: 6.26 $ * * File Description: * @@ -2489,9 +2489,9 @@ static Boolean InsertAdvText (TermFormPtr tfp, CharPtr str) CharPtr finalstr; Int2 i; Boolean retval = TRUE; - Int2 begin; - Int2 end; - Int2 curstrLen; + Int4 begin; + Int4 end; + Int4 curstrLen; Char textObjectReturnStr [3]; Int2 strLen; ValNodePtr head = NULL, vnp; diff --git a/network/wwwblast/.WWWBLAST_VERSION b/network/wwwblast/.WWWBLAST_VERSION deleted file mode 100644 index bda8fbec..00000000 --- a/network/wwwblast/.WWWBLAST_VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2.6 diff --git a/network/wwwblast/Src/wwwblast.c b/network/wwwblast/Src/wwwblast.c index 504c6527..458858e9 100644 --- a/network/wwwblast/Src/wwwblast.c +++ b/network/wwwblast/Src/wwwblast.c @@ -1,4 +1,4 @@ -/* $Id: wwwblast.c,v 1.13 2004/01/16 17:35:20 dondosha Exp $ +/* $Id: wwwblast.c,v 1.15 2004/05/03 15:11:46 dondosha Exp $ * =========================================================================== * * PUBLIC DOMAIN NOTICE @@ -29,12 +29,18 @@ * * Initial Creation Date: 03/15/2000 * -* $Revision: 1.13 $ +* $Revision: 1.15 $ * * File Description: * Standalone WWW Blast CGI program. * * $Log: wwwblast.c,v $ +* Revision 1.15 2004/05/03 15:11:46 dondosha +* Added support for masking query in XML output +* +* Revision 1.14 2004/03/02 16:44:11 dondosha +* Do not print closing </form> for XML output +* * Revision 1.13 2004/01/16 17:35:20 dondosha * Fixed mouseover problems * @@ -287,7 +293,9 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt SeqAlignPtr seqalign = NULL, sap, next_seqalign; SeqAnnotPtr seqannot=NULL; TxDfDbInfoPtr tx_dbinfo=NULL, tx_dbinfo_head; - ValNodePtr mask_loc, mask_loc_start, other_returns, error_returns, vnp, vnp1=NULL; + ValNodePtr mask_loc = NULL, mask_loc_start, next_mask_loc = NULL; + SeqLocPtr mask_slp = NULL; + ValNodePtr other_returns, error_returns, vnp, vnp1=NULL; Uint1 align_type; Uint1 f_order[FEATDEF_ANY], g_order[FEATDEF_ANY]; /* Variables for multiple query output */ @@ -332,7 +340,7 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt BlastErrorPrintExtra(error_returns, TRUE, stdout); - mask_loc = NULL; + mask_loc = next_mask_loc = NULL; matrix = NULL; txmatrix = NULL; for (vnp=other_returns; vnp; vnp = vnp->next) { @@ -365,14 +373,15 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt case SEQLOC_MASKING_MINUS1: case SEQLOC_MASKING_MINUS2: case SEQLOC_MASKING_MINUS3: - if (!options->is_megablast_search) - ValNodeAddPointer(&mask_loc, vnp->choice, vnp->data.ptrvalue); + ValNodeAddPointer(&mask_loc, vnp->choice, vnp->data.ptrvalue); break; default: break; } } + mask_loc_start = mask_loc; + /* If results come as alignment endpoints only from Mega BLAST */ if (mb_results) { MegaBlastHitPtr mb_hit = mb_results->mbhits, next_hit; @@ -415,23 +424,22 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt if (!options->is_megablast_search) next_seqalign = NULL; else { + SeqIdPtr seqid = TxGetQueryIdFromSeqAlign(seqalign); sap = seqalign; while (sap != NULL) { if (sap->next != NULL) { - dsp = (DenseSegPtr) (sap->segs); - next_dsp = (DenseSegPtr) (sap->next->segs); - - if (SeqIdComp(dsp->ids, next_dsp->ids) != SIC_YES) { + if (SeqIdComp(seqid, TxGetQueryIdFromSeqAlign(sap->next) + != SIC_YES)) { next_seqalign = sap->next; sap->next = NULL; } - } else + } else { next_seqalign = NULL; + } sap = sap->next; } - - dsp = (DenseSegPtr) (seqalign->segs); - while (tmp_slp && SeqIdComp(dsp->ids, SeqLocId(tmp_slp)) != SIC_YES) + /* Find this query's SeqLoc and Bioseq */ + while (tmp_slp && SeqIdComp(seqid, SeqLocId(tmp_slp)) != SIC_YES) tmp_slp = tmp_slp->next; if (tmp_slp == NULL) /* Should never happen */ break; @@ -441,13 +449,28 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt AcknowledgeBlastQuery(bsp, 70, stdout, FALSE, TRUE); free_buff(); BioseqUnlock(bsp); + + /* Separate the mask locations list for this query. */ + if (mask_loc) { + mask_slp = (SeqLocPtr) mask_loc->data.ptrvalue; + while (SeqIdComp(SeqLocId(mask_slp), seqid) != SIC_YES) { + mask_loc = mask_loc->next; + if (!mask_loc) + break; + mask_slp = (SeqLocPtr) mask_loc->data.ptrvalue; + } + if (mask_loc) { + next_mask_loc = mask_loc->next; + mask_loc->next = NULL; + } + } } if(theInfo->xml_output) { printf("<PRE>"); BXMLPrintOutput(xml_aip, seqalign, options, program, database, - bsp, other_returns, 0, NULL); + bsp, other_returns, 0, NULL, mask_loc); AsnIoReset(xml_aip); printf("</PRE>"); @@ -533,8 +556,16 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt ObjMgrFreeCache(0); } /* If else xml_output */ - if (options->is_megablast_search) + if (options->is_megablast_search) { tmp_slp = tmp_slp->next; + + /* Reconnect the mask locations */ + if (next_mask_loc) { + mask_loc->next = next_mask_loc; + mask_loc = next_mask_loc; + } + } + if (seqannot) seqannot = SeqAnnotFree(seqannot); seqalign = next_seqalign; @@ -555,7 +586,7 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt BXMLPrintOutput(xml_aip, NULL, options, program, database, - bsp, other_returns, 0, message); + bsp, other_returns, 0, message, NULL); if (error_returns != NULL) { MemFree(error_msg->msg); @@ -575,10 +606,8 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt if (txmatrix) txmatrix = TxMatrixDestruct(txmatrix); - mask_loc_start = mask_loc; - while (mask_loc) { + for (mask_loc = mask_loc_start; mask_loc; mask_loc = mask_loc->next) { SeqLocSetFree(mask_loc->data.ptrvalue); - mask_loc = mask_loc->next; } ValNodeFree(mask_loc_start); @@ -784,7 +813,9 @@ AppendMegaBlastHit(VoidPtr ptr) Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) { SeqAlignPtr seqalign = NULL; - ValNodePtr mask_loc, mask_loc_start, vnp, other_returns, error_returns; + ValNodePtr mask_loc = NULL, mask_loc_start, next_mask_loc = NULL; + SeqLocPtr mask_slp = NULL; + ValNodePtr vnp, other_returns, error_returns; TxDfDbInfoPtr dbinfo=NULL, dbinfo_head; BLAST_KarlinBlkPtr ka_params=NULL, ka_params_gap=NULL; BLAST_MatrixPtr matrix; @@ -906,8 +937,7 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) case SEQLOC_MASKING_MINUS1: case SEQLOC_MASKING_MINUS2: case SEQLOC_MASKING_MINUS3: - if (!is_megablast) - ValNodeAddPointer(&mask_loc, vnp->choice, vnp->data.ptrvalue); + ValNodeAddPointer(&mask_loc, vnp->choice, vnp->data.ptrvalue); break; case BlastResponse_mbalign: mb_results = (MegaBlastResultsPtr) vnp->data.ptrvalue; @@ -946,17 +976,35 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) ReadDBBioseqSetDbGeneticCode(theInfo->options->db_genetic_code); query_number = 1; + mask_loc_start = mask_loc; + for (index=0; !done; index++) { if (is_megablast) seqalign = seqalignp[index]; else done = TRUE; if (seqalign) { + /* Separate the mask locations list for this query, if there + are multiple queries. */ + if (mask_loc) { + SeqIdPtr seqid = TxGetQueryIdFromSeqAlign(seqalign); + mask_slp = (SeqLocPtr) mask_loc->data.ptrvalue; + while (SeqIdComp(SeqLocId(mask_slp), seqid) != SIC_YES) { + mask_loc = mask_loc->next; + if (!mask_loc) + break; + mask_slp = (SeqLocPtr) mask_loc->data.ptrvalue; + } + if (mask_loc) { + next_mask_loc = mask_loc->next; + mask_loc->next = NULL; + } + } if(theInfo->xml_output) { if (!is_megablast) { BXMLPrintOutput(xml_aip, seqalign, options, theInfo->program, theInfo->database, - theInfo->fake_bsp, other_returns, 0, NULL); + theInfo->fake_bsp, other_returns, 0, NULL, mask_loc); AsnIoReset(xml_aip); } else { IterationPtr iterp; @@ -965,7 +1013,7 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) iterp = BXMLBuildOneQueryIteration(seqalign, NULL, FALSE, !options->gapped_calculation, index, - NULL, bsp); + NULL, bsp, mask_loc); IterationAsnWrite(iterp, mbxp->aip, mbxp->atp); AsnIoFlush(mbxp->aip); IterationFree(iterp); @@ -1084,6 +1132,11 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) ObjMgrClearHold(); ObjMgrFreeCache(0); } + /* Reconnect the mask locations, in case of multiple queries */ + if (next_mask_loc) { + mask_loc->next = next_mask_loc; + mask_loc = next_mask_loc; + } } else if (!is_megablast) { /* while(seqalign) */ /* seqalign == NULL */ @@ -1102,7 +1155,7 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) options, theInfo->program, theInfo->database, theInfo->fake_bsp, other_returns, - 0, message); + 0, message, NULL); if (error_returns != NULL) { MemFree(error_msg->msg); @@ -1121,9 +1174,10 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) if (!query_slp) done = TRUE; } - if(!theInfo->xml_output && seqannot != NULL) + if(!theInfo->xml_output) { seqannot = SeqAnnotFree(seqannot); - fprintf(stdout, "</form>\n"); + fprintf(stdout, "</form>\n"); + } } matrix = BLAST_MatrixDestruct(matrix); @@ -1190,10 +1244,8 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo) MemFree(params_buffer); free_buff(); - mask_loc_start = mask_loc; - while (mask_loc) { + for (mask_loc = mask_loc_start; mask_loc; mask_loc = mask_loc->next) { SeqLocSetFree(mask_loc->data.ptrvalue); - mask_loc = mask_loc->next; } ValNodeFree(mask_loc_start); diff --git a/network/wwwblast/readme.html b/network/wwwblast/readme.html index c23b298f..450ce9b9 100644 --- a/network/wwwblast/readme.html +++ b/network/wwwblast/readme.html @@ -1,4 +1,4 @@ -<!-- $Id: readme.html,v 1.11 2004/01/30 22:29:05 dondosha Exp $ --> +<!-- $Id: readme.html,v 1.12 2004/05/03 15:47:03 dondosha Exp $ --> <HTML> <HEAD> <TITLE>Introduction to the Standalone WWW Blast server</TITLE> @@ -35,6 +35,13 @@ <TABLE BORDER=1> <TR VALIGN=top> +<TD> May 10, 2004 +<TD> +<UL> +<LI> XML output brought in sync with the text output, masking filtered locations in query sequences. +</UL> +</TR> +<TR VALIGN=top> <TD> February 2, 2004 <TD> <UL> diff --git a/network/wwwblast/readme.txt b/network/wwwblast/readme.txt index 690f1dd8..1e9fecae 100644 --- a/network/wwwblast/readme.txt +++ b/network/wwwblast/readme.txt @@ -56,6 +56,11 @@ executables are: wwwblast.c, wwwbutl.c, psiblast.c, wblast2.c. What's new in this revision? +May 10, 2004 + + * XML output brought in sync with the text output, masking filtered +locations in query sequences. + February 2, 2004 * All source code moved to the NCBI C toolkit. |