summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorAaron M. Ucko <ucko@debian.org>2005-03-24 02:38:02 +0000
committerAaron M. Ucko <ucko@debian.org>2005-03-24 02:38:02 +0000
commit9d90590695bd2617a7cffd14904e1264c531ed17 (patch)
tree9d110c3704bc00918a0f86c5e82e7592176aea21 /network
parent20e9c62b7433047567eb3a8bf3647582e12671bd (diff)
Load ncbi (6.1.20040202) into ncbi-tools6/branches/upstream/current.
Diffstat (limited to 'network')
-rw-r--r--network/blast3/client/netblap3.c8
-rw-r--r--network/id1arch/idfetch.c18
-rw-r--r--network/id2arch/id2.asn341
-rw-r--r--network/id2arch/id2.c8013
-rw-r--r--network/id2arch/id2.h519
-rw-r--r--network/id2arch/id2gen.h968
-rw-r--r--network/id2arch/id2map.h10
-rw-r--r--network/nsclilib/readme6
-rw-r--r--network/spell/client/objspell.c425
-rw-r--r--network/spell/client/objspell.h57
-rw-r--r--network/spell/client/spell.asn27
-rw-r--r--network/spell/client/spellapi.c453
-rw-r--r--network/spell/client/spellapi.h27
-rw-r--r--network/spell/server/fmspell.c136
-rw-r--r--network/spell/server/spellsrv.c414
-rw-r--r--network/taxon1/taxon2/txcdproc.c6
-rw-r--r--network/vibnet/docsum.c11
-rw-r--r--network/wwwblast/Src/Makefile36
-rw-r--r--network/wwwblast/Src/XML/Makefile2
-rw-r--r--network/wwwblast/Src/psiblast.c9
-rw-r--r--network/wwwblast/Src/wblast2.c15
-rw-r--r--network/wwwblast/Src/wwwblast.c98
-rw-r--r--network/wwwblast/Src/wwwbutl.c48
-rw-r--r--network/wwwblast/readme.html28
-rw-r--r--network/wwwblast/readme.txt43
25 files changed, 11623 insertions, 95 deletions
diff --git a/network/blast3/client/netblap3.c b/network/blast3/client/netblap3.c
index 191d5b13..0748f819 100644
--- a/network/blast3/client/netblap3.c
+++ b/network/blast3/client/netblap3.c
@@ -34,6 +34,9 @@
*
* RCS Modification History:
* $Log: netblap3.c,v $
+* Revision 1.105 2004/01/27 20:53:12 dondosha
+* Value of no_traceback megablast option is now Uint1 instead of Boolean
+*
* Revision 1.104 2003/01/13 18:08:26 bealer
* - Replace nonstandard snprintf() function with strcpy/strcat/strlen.
*
@@ -800,7 +803,7 @@ BlastOptionsToParameters (BLAST_OptionsBlkPtr options)
parameters->smith_waterman = options->smith_waterman;
parameters->is_megablast = options->is_megablast_search;
parameters->query_lcase_mask = (ValNodePtr) options->query_lcase_mask;
- parameters->endpoint_results = options->no_traceback;
+ parameters->endpoint_results = (Boolean) options->no_traceback;
parameters->percent_identity = (FloatHi) options->perc_identity;
parameters->first_db_seq = options->first_db_seq;
parameters->final_db_seq = options->final_db_seq;
@@ -2768,7 +2771,8 @@ parametersToOptions (BlastParametersPtr parameters, CharPtr program, ValNodePtr
options->is_megablast_search = parameters->is_megablast;
options->query_lcase_mask =
(SeqLocPtr) parameters->query_lcase_mask;
- options->no_traceback = parameters->endpoint_results;
+ if (parameters->endpoint_results)
+ options->no_traceback = 1;
options->perc_identity = (FloatLo) parameters->percent_identity;
options->first_db_seq = parameters->first_db_seq;
options->final_db_seq = parameters->final_db_seq;
diff --git a/network/id1arch/idfetch.c b/network/id1arch/idfetch.c
index ce439e7a..5d9afa05 100644
--- a/network/id1arch/idfetch.c
+++ b/network/id1arch/idfetch.c
@@ -25,6 +25,12 @@
* Author Karl Sirotkin
*
$Log: idfetch.c,v $
+ Revision 1.29 2003/12/17 20:35:38 kans
+ initialize status, send NORMAL_STYLE to SeqEntrytoGnbk instead of 0 (also fixed in asn2gnbk), pass lookup flags
+
+ Revision 1.28 2003/11/19 16:35:19 yaschenk
+ relaxing ranges for -g and -c
+
Revision 1.27 2003/03/28 18:48:39 yaschenk
tuning ObjMgr, adding STREAM_SEQ_PORT_FIRST to SeqEntryToGnbk
@@ -190,14 +196,14 @@ Args myargs[] = {
2 - get SeqIds\n\t\t\t\
3 - get gi historyn (sequence change only)\n\t\t\t\
4 - get gi revision history (any change to asn.1)\n", "0","0","4",TRUE,'i',ARG_INT,0.0,0,NULL},
- {"GI id for single Entity to dump" ,"0","0","99999999",TRUE,'g',ARG_INT,0.0,0,NULL},
+ {"GI id for single Entity to dump" ,"0","0","999999999",TRUE,'g',ARG_INT,0.0,0,NULL},
{"File with list of gi's, accessions, accession.version's, fasta seqid's to dump",NULL,NULL,NULL,TRUE,'G',ARG_FILE_IN,0.0,0,NULL},
{"Max complexity:\t\
0 - get the whole blob\n\t\t\t\
1 - get the bioseq of interest\n\t\t\t\
2 - get the minimal bioseq-set containing the bioseq of interest\n\t\t\t\
3 - get the minimal nuc-prot containing the bioseq of interest\n\t\t\t\
-4 - get the minimal pub-set containing the bioseq of interest\n" ,"0","0","4",TRUE,'c',ARG_INT,0.0,0,NULL},
+4 - get the minimal pub-set containing the bioseq of interest\n" ,"0",NULL,NULL,TRUE,'c',ARG_INT,0.0,0,NULL},
{"flaTtened SeqId, format: \n \'type(name,accession,release,version)\'\n as \'5(HUMHBB)\' or \n type=accession, or \n type:number ",
NULL,NULL,NULL,TRUE,'f',ARG_STRING,0.0,0,NULL},
{"Fasta style SeqId ENCLOSED IN QUOTES:\n\t\t\t\
@@ -857,7 +863,7 @@ static Boolean ProcessOneDocSum (Int4 num, Int4Ptr uids)
static Boolean IdFetch_func(Int4 gi,CharPtr db, Int4 ent,Int2 maxplex)
{
SeqEntryPtr sep=NULL;
- Int4 status,gi_state;
+ Int4 status = 0,gi_state;
SeqIdPtr sip_ret=NULL;
SeqId si={SEQID_GI,0,0};
ID1SeqHistPtr ishp=NULL;
@@ -991,7 +997,8 @@ static Boolean IdFetch_func(Int4 gi,CharPtr db, Int4 ent,Int2 maxplex)
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,STREAM_SEQ_PORT_FIRST,0,NULL,fp)){
+ 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 ");
@@ -1004,7 +1011,8 @@ static Boolean IdFetch_func(Int4 gi,CharPtr db, Int4 ent,Int2 maxplex)
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,STREAM_SEQ_PORT_FIRST,0,NULL,fp))
+ 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,
diff --git a/network/id2arch/id2.asn b/network/id2arch/id2.asn
new file mode 100644
index 00000000..f85764af
--- /dev/null
+++ b/network/id2arch/id2.asn
@@ -0,0 +1,341 @@
+--$Revision: 1.6 $
+--********************************************************************
+--
+-- Network Id server network access
+-- Vasilchenko 2003
+--
+--
+--*********************************************************************
+--
+-- ID2.asn
+--
+-- messages for id server network access
+--
+--*********************************************************************
+
+NCBI-ID2Access DEFINITIONS ::=
+BEGIN
+
+IMPORTS Seq-id, Seq-loc FROM NCBI-Seqloc
+ ID2S-Chunk-Id FROM NCBI-Seq-split;
+
+
+----------------------------------------------------------------------------
+-- request types
+----------------------------------------------------------------------------
+
+ID2-Request-Packet ::= SEQUENCE OF ID2-Request
+
+
+ID2-Request ::= SEQUENCE {
+ -- request's serial number, can be used in asynchronic clients
+ -- server should copy it to corresponding field in reply
+ serial-number INTEGER OPTIONAL,
+
+ params ID2-Params OPTIONAL,
+
+ 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-chunks ID2S-Request-Get-Chunks
+ }
+}
+
+
+ID2-Request-Get-Packages ::= SEQUENCE {
+ -- return known packages from this list
+ -- if unset - return all known packages
+ names SEQUENCE OF VisibleString OPTIONAL,
+
+ -- return packages' names only
+ no-contents NULL OPTIONAL
+}
+
+
+ID2-Request-String-To-Gi ::= SEQUENCE {
+ -- requested sequence ID, can be any string
+ id VisibleString
+}
+
+
+ID2-Request-Seq-id-To-Gi ::= SEQUENCE {
+ -- requested sequence ID, can be any ID
+ seq-id Seq-id
+}
+
+
+ID2-Request-Gi-To-TSE-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,
+
+ -- return TSE-Ids with external references to this gi
+ external NULL OPTIONAL,
+
+ -- return in addition list of gis also resolving to this tse
+ current-gis NULL OPTIONAL
+}
+
+
+ID2-Request-Get-TSE ::= 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
+ }
+ },
+
+ -- level of details requested immediately
+ -- server will send relevant chunks if TSE is splitted
+ details ID2-Get-TSE-Details OPTIONAL
+}
+
+
+ID2-Request-ReGet-TSE ::= SEQUENCE {
+ tse-id ID2-TSE-Id,
+
+ -- level of details requested
+ details ID2-Get-TSE-Details OPTIONAL,
+
+ -- start offset of data to get
+ offset INTEGER
+}
+
+
+ID2S-Request-Get-Chunks ::= SEQUENCE {
+ tse-id ID2-TSE-Id,
+
+ -- requests for specific chunks of splitted blob
+ chunks SET OF ID2S-Chunk-Id
+}
+
+
+ID2-Get-TSE-Details ::= SEQUENCE {
+ location Seq-loc,
+
+ seq-class-level INTEGER DEFAULT 1,
+
+ descr-level INTEGER DEFAULT 1,
+
+ descr-type-mask INTEGER DEFAULT 0,
+
+ annot-type-mask INTEGER DEFAULT 0,
+
+ feat-type-mask INTEGER DEFAULT 0,
+
+ sequence-level ENUMERATED {
+ none (0) ,
+ seq-map (1) ,
+ seq-data (2)
+ } DEFAULT none
+}
+
+
+----------------------------------------------------------------------------
+-- reply types
+----------------------------------------------------------------------------
+
+
+ID2-Reply ::= SEQUENCE {
+ -- request's serial number, copy from request
+ serial-number INTEGER OPTIONAL,
+
+ params ID2-Params OPTIONAL,
+
+ reply CHOICE {
+ init 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-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
+}
+
+
+ID2-Error ::= SEQUENCE {
+ severity ENUMERATED {
+ -- nothing harmful happened
+ warning (1) ,
+
+ -- command cannot be completed this time
+ failed-command (2) ,
+
+ -- connection cannot be reused, reconnect is required
+ failed-connection (3) ,
+
+ -- server cannot be used for a while
+ failed-server (4) ,
+
+ -- resolve request gives no data
+ -- probably temporarily (see retry-delay field)
+ no-data (5) ,
+
+ -- data exists but client doesn't have permission to get it
+ restricted-data (6) ,
+
+ -- this request type is not supported by server
+ unsupported-command (7) ,
+
+ -- error in request packet, cannot retry
+ invalid-arguments (8)
+ },
+
+ -- client may retry the request after specified time in seconds
+ retry-delay INTEGER OPTIONAL,
+
+ message VisibleString OPTIONAL
+}
+
+
+ID2-Reply-Get-Package ::= SEQUENCE {
+ name VisibleString,
+
+ params ID2-Params OPTIONAL
+}
+
+
+ID2-Reply-Seq-id-To-Gi ::= SEQUENCE {
+ -- request sequence ID, copy from request
+ seq-id Seq-id,
+
+ -- gi of requested Seq-id
+ -- not set if error occured
+ gi INTEGER OPTIONAL
+}
+
+
+ID2-Reply-Gi-To-TSE-Id ::= SEQUENCE {
+ gi INTEGER,
+
+ -- source name of this tse set
+ -- "" for native tse - tse with sequence
+ source VisibleString DEFAULT "",
+
+ -- tse set with requested gi
+ -- not set if error occured
+ tses SET OF ID2-TSE-Id-Info OPTIONAL
+}
+
+
+ID2-TSE-Id-Info ::= SEQUENCE {
+ tse-id ID2-TSE-Id,
+
+ -- version of split data
+ -- (0 for non split)
+ split-version INTEGER DEFAULT 0
+}
+
+
+ID2-Reply-Get-TSE ::= SEQUENCE {
+ tse-id ID2-TSE-Id,
+
+ -- whole tse or tse skeleton
+ -- not set if error occured
+ data ID2-Reply-Data OPTIONAL
+}
+
+
+ID2S-Reply-Get-TSE-Info ::= SEQUENCE {
+ tse-id ID2-TSE-Id,
+
+ -- version of split data
+ split-version INTEGER,
+
+ -- tse split info
+ -- not set if error occured
+ info ID2-Reply-Data OPTIONAL
+}
+
+
+ID2S-Reply-Get-Chunk ::= SEQUENCE {
+ tse-id ID2-TSE-Id,
+
+ chunk-id ID2S-Chunk-Id,
+
+ -- chunk data
+ -- not set if error occured
+ data ID2-Reply-Data OPTIONAL
+}
+
+
+ID2-Reply-Data ::= SEQUENCE {
+ data-type INTEGER, -- index of negotiated types
+ -- recommended types
+ -- Seq-entry,
+ -- ID2S-Split-Info,
+ -- ID2S-Chunk
+
+ -- serialization format (ASN.1 binary, ASN.1 text)
+ data-format INTEGER, -- index of negotiated formats
+
+ -- post serialization compression (plain, gzip, etc.)
+ data-compression INTEGER, -- index of negotiated formats
+
+ -- data blob
+ data SEQUENCE OF OCTET STRING
+}
+
+
+----------------------------------------------------------------------------
+-- utility types
+----------------------------------------------------------------------------
+
+
+ID2-TSE-Id ::= SEQUENCE {
+ sat INTEGER,
+ sat-key INTEGER
+}
+
+
+ID2-Params ::= SEQUENCE OF ID2-Param
+
+
+ID2-Param ::= SEQUENCE {
+ name VisibleString,
+ value SEQUENCE OF VisibleString OPTIONAL,
+ type ENUMERATED {
+ -- no response expected
+ 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) ,
+
+ -- 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) ,
+
+ -- use named package
+ -- value should be unset
+ use-package (4)
+ } DEFAULT set-value
+}
+
+END
diff --git a/network/id2arch/id2.c b/network/id2arch/id2.c
new file mode 100644
index 00000000..8a96fe8d
--- /dev/null
+++ b/network/id2arch/id2.c
@@ -0,0 +1,8013 @@
+#include <asn.h>
+
+#define NLM_GENERATED_CODE_PROTO
+
+#include <id2map.h>
+#include <id2gen.h>
+
+static Boolean loaded = FALSE;
+
+#include <id2.h>
+
+#ifndef NLM_EXTERN_LOADS
+#define NLM_EXTERN_LOADS {}
+#endif
+
+NLM_EXTERN Boolean LIBCALL
+id2genAsnLoad(void)
+{
+
+ if ( ! loaded) {
+ NLM_EXTERN_LOADS
+
+ if ( ! AsnLoad ())
+ return FALSE;
+ loaded = TRUE;
+ }
+
+ return TRUE;
+}
+
+
+
+/**************************************************
+* Generated object loaders for Module NCBI-ID2Access
+* Generated using ASNCODE Revision: 6.0 at Dec 15, 2003 5:08 PM
+*
+**************************************************/
+
+
+/**************************************************
+*
+* ID2RequestPacketFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestPacketPtr LIBCALL
+ID2RequestPacketFree(ID2RequestPacketPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ AsnGenericUserSeqOfFree(ptr, (AsnOptFreeFunc) ID2RequestFree);
+ return NULL;
+}
+
+
+/**************************************************
+*
+* ID2RequestPacketAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestPacketPtr LIBCALL
+ID2RequestPacketAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2RequestPacketPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2RequestPacket ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_PACKET);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_PACKET);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ func = NULL;
+
+ ptr = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2RequestAsnRead, (AsnOptFreeFunc) ID2RequestFree);
+ if (isError && ptr == NULL) {
+ goto erret;
+ }
+
+
+
+ret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return ptr;
+
+erret:
+ aip -> io_failure = TRUE;
+ ptr = ID2RequestPacketFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestPacketAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2RequestPacketAsnWrite(ID2RequestPacketPtr 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_PACKET); /* link local tree */
+ if (atp == NULL) {
+ return FALSE;
+ }
+
+ if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
+ retval = AsnGenericUserSeqOfAsnWrite(ptr , (AsnWriteFunc) ID2RequestAsnWrite, aip, atp, ID2_REQUEST_PACKET_E);
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestPtr LIBCALL
+ID2RequestNew(void)
+{
+ ID2RequestPtr ptr = MemNew((size_t) sizeof(ID2Request));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2RequestFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestPtr LIBCALL
+ID2RequestFree(ID2RequestPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ ID2ParamsFree(ptr -> params);
+ Request_requestFree(ptr -> Request_request);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* Request_requestFree()
+*
+**************************************************/
+static
+Request_requestPtr LIBCALL
+Request_requestFree(ValNodePtr anp)
+{
+ Pointer pnt;
+
+ if (anp == NULL) {
+ return NULL;
+ }
+
+ pnt = anp->data.ptrvalue;
+ switch (anp->choice)
+ {
+ default:
+ break;
+ case Request_request_get_packages:
+ ID2RequestGetPackagesFree(anp -> data.ptrvalue);
+ break;
+ case Request_request_string_to_gi:
+ ID2RequestStringToGiFree(anp -> data.ptrvalue);
+ break;
+ case Request_request_seq_id_to_gi:
+ ID2RequestSeqIdToGiFree(anp -> data.ptrvalue);
+ break;
+ case Request_request_gi_to_tse_id:
+ ID2RequestGiToTSEIdFree(anp -> data.ptrvalue);
+ break;
+ case Request_request_get_tse:
+ ID2RequestGetTSEFree(anp -> data.ptrvalue);
+ break;
+ case Request_request_reget_tse:
+ ID2RequestReGetTSEFree(anp -> data.ptrvalue);
+ break;
+ case Request_request_get_chunks:
+ ID2SRequestGetChunksFree(anp -> data.ptrvalue);
+ break;
+ }
+ return MemFree(anp);
+}
+
+
+/**************************************************
+*
+* ID2RequestAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestPtr LIBCALL
+ID2RequestAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2RequestPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2Request ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2RequestNew();
+ 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_serial_number) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> serial_number = av.intvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_REQUEST_params) {
+ ptr -> params = ID2ParamsAsnRead(aip, atp);
+ if (aip -> io_failure) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_REQUEST_request) {
+ ptr -> Request_request = Request_requestAsnRead(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 = ID2RequestFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* Request_requestAsnRead()
+*
+**************************************************/
+static
+Request_requestPtr LIBCALL
+Request_requestAsnRead(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) { /* Request_request ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_request);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_request); /* 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_request_init) {
+ choice = Request_request_init;
+ if (AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ anp->data.boolvalue = av.boolvalue;
+ }
+ else if (atp == REQUEST_request_get_packages) {
+ 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 == REQUEST_request_gi_to_tse_id) {
+ choice = Request_request_gi_to_tse_id;
+ func = (AsnReadFunc) ID2RequestGiToTSEIdAsnRead;
+ }
+ else if (atp == ID2_REQUEST_request_get_tse) {
+ choice = Request_request_get_tse;
+ func = (AsnReadFunc) ID2RequestGetTSEAsnRead;
+ }
+ else if (atp == ID2_REQUEST_request_reget_tse) {
+ choice = Request_request_reget_tse;
+ func = (AsnReadFunc) ID2RequestReGetTSEAsnRead;
+ }
+ else if (atp == ID2_REQUEST_request_get_chunks) {
+ choice = Request_request_get_chunks;
+ func = (AsnReadFunc) ID2SRequestGetChunksAsnRead;
+ }
+ 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;
+}
+
+
+/**************************************************
+*
+* ID2RequestAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2RequestAsnWrite(ID2RequestPtr 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); /* 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 -> serial_number;
+ retval = AsnWrite(aip, ID2_REQUEST_serial_number, &av);
+ if (ptr -> params != NULL) {
+ if ( ! ID2ParamsAsnWrite(ptr -> params, aip, ID2_REQUEST_params)) {
+ goto erret;
+ }
+ }
+ if (ptr -> Request_request != NULL) {
+ if ( ! Request_requestAsnWrite(ptr -> Request_request, aip, ID2_REQUEST_request)) {
+ goto erret;
+ }
+ }
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* Request_requestAsnWrite()
+*
+**************************************************/
+static Boolean LIBCALL
+Request_requestAsnWrite(Request_requestPtr 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_request); /* 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 Request_request_init:
+ av.boolvalue = anp->data.boolvalue;
+ retval = AsnWrite(aip, ID2_REQUEST_request_init, &av);
+ break;
+ case Request_request_get_packages:
+ 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;
+ break;
+ case Request_request_gi_to_tse_id:
+ writetype = REQUEST_request_gi_to_tse_id;
+ func = (AsnWriteFunc) ID2RequestGiToTSEIdAsnWrite;
+ break;
+ case Request_request_get_tse:
+ writetype = ID2_REQUEST_request_get_tse;
+ func = (AsnWriteFunc) ID2RequestGetTSEAsnWrite;
+ break;
+ case Request_request_reget_tse:
+ writetype = ID2_REQUEST_request_reget_tse;
+ func = (AsnWriteFunc) ID2RequestReGetTSEAsnWrite;
+ break;
+ case Request_request_get_chunks:
+ writetype = ID2_REQUEST_request_get_chunks;
+ func = (AsnWriteFunc) ID2SRequestGetChunksAsnWrite;
+ 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;
+}
+
+
+/**************************************************
+*
+* ID2ParamsFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2ParamsPtr LIBCALL
+ID2ParamsFree(ID2ParamsPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ AsnGenericUserSeqOfFree(ptr, (AsnOptFreeFunc) ID2ParamFree);
+ return NULL;
+}
+
+
+/**************************************************
+*
+* ID2ParamsAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2ParamsPtr LIBCALL
+ID2ParamsAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2ParamsPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2Params ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_PARAMS);
+ } else {
+ atp = AsnLinkType(orig, ID2_PARAMS);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ func = NULL;
+
+ ptr = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) ID2ParamAsnRead, (AsnOptFreeFunc) ID2ParamFree);
+ if (isError && ptr == NULL) {
+ goto erret;
+ }
+
+
+
+ret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return ptr;
+
+erret:
+ aip -> io_failure = TRUE;
+ ptr = ID2ParamsFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2ParamsAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2ParamsAsnWrite(ID2ParamsPtr 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_PARAMS); /* link local tree */
+ if (atp == NULL) {
+ return FALSE;
+ }
+
+ if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
+ retval = AsnGenericUserSeqOfAsnWrite(ptr , (AsnWriteFunc) ID2ParamAsnWrite, aip, atp, ID2_PARAMS_E);
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestGetPackagesNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGetPackagesPtr LIBCALL
+ID2RequestGetPackagesNew(void)
+{
+ ID2RequestGetPackagesPtr ptr = MemNew((size_t) sizeof(ID2RequestGetPackages));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2RequestGetPackagesFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGetPackagesPtr LIBCALL
+ID2RequestGetPackagesFree(ID2RequestGetPackagesPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ AsnGenericBaseSeqOfFree(ptr -> names ,ASNCODE_PTRVAL_SLOT);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2RequestGetPackagesAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGetPackagesPtr LIBCALL
+ID2RequestGetPackagesAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2RequestGetPackagesPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2RequestGetPackages ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_GET_PACKAGES);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_GET_PACKAGES);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2RequestGetPackagesNew();
+ 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_GET_PACKAGES_names) {
+ ptr -> names = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
+ if (isError && ptr -> names == NULL) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == GET_PACKAGES_no_contents) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> no_contents = av.boolvalue;
+ 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 = ID2RequestGetPackagesFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestGetPackagesAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2RequestGetPackagesAsnWrite(ID2RequestGetPackagesPtr 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_GET_PACKAGES); /* link local tree */
+ if (atp == NULL) {
+ return FALSE;
+ }
+
+ if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
+ if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
+ goto erret;
+ }
+
+ retval = AsnGenericBaseSeqOfAsnWrite(ptr -> names ,ASNCODE_PTRVAL_SLOT, aip, ID2_REQUEST_GET_PACKAGES_names, REQUEST_GET_PACKAGES_names_E);
+ av.boolvalue = ptr -> no_contents;
+ retval = AsnWrite(aip, GET_PACKAGES_no_contents, &av);
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestStringToGiNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestStringToGiPtr LIBCALL
+ID2RequestStringToGiNew(void)
+{
+ ID2RequestStringToGiPtr ptr = MemNew((size_t) sizeof(ID2RequestStringToGi));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2RequestStringToGiFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestStringToGiPtr LIBCALL
+ID2RequestStringToGiFree(ID2RequestStringToGiPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ MemFree(ptr -> id);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2RequestStringToGiAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestStringToGiPtr LIBCALL
+ID2RequestStringToGiAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2RequestStringToGiPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2RequestStringToGi ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_STRING_TO_GI);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_STRING_TO_GI);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2RequestStringToGiNew();
+ 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_STRING_TO_GI_id) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ 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) {
+ 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 = ID2RequestSeqIdToGiFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestSeqIdToGiAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2RequestSeqIdToGiAsnWrite(ID2RequestSeqIdToGiPtr 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_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_REQUEST_SEQ_ID_TO_GI_seq_id)) {
+ goto erret;
+ }
+ }
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestGiToTSEIdNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGiToTSEIdPtr LIBCALL
+ID2RequestGiToTSEIdNew(void)
+{
+ ID2RequestGiToTSEIdPtr ptr = MemNew((size_t) sizeof(ID2RequestGiToTSEId));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2RequestGiToTSEIdFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGiToTSEIdPtr LIBCALL
+ID2RequestGiToTSEIdFree(ID2RequestGiToTSEIdPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ Gi_giFree(ptr -> Gi_gi);
+ AsnGenericBaseSeqOfFree(ptr -> sources ,ASNCODE_PTRVAL_SLOT);
+ return MemFree(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()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGiToTSEIdPtr LIBCALL
+ID2RequestGiToTSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2RequestGiToTSEIdPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2RequestGiToTSEId ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_GI_TO_TSE_ID);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_GI_TO_TSE_ID);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2RequestGiToTSEIdNew();
+ 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_GI_TO_TSE_ID_gi) {
+ ptr -> Gi_gi = Gi_giAsnRead(aip, atp);
+ if (aip -> io_failure) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == REQUEST_GI_TO_TSE_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 ( 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;
+ }
+ /* end struct */
+
+ret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return ptr;
+
+erret:
+ aip -> io_failure = TRUE;
+ ptr = ID2RequestGiToTSEIdFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* 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()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2RequestGiToTSEIdAsnWrite(ID2RequestGiToTSEIdPtr 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_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;
+ }
+
+ if (ptr -> Gi_gi != NULL) {
+ if ( ! Gi_giAsnWrite(ptr -> Gi_gi, aip, ID2_REQUEST_GI_TO_TSE_ID_gi)) {
+ goto erret;
+ }
+ }
+ retval = AsnGenericBaseSeqOfAsnWrite(ptr -> sources ,ASNCODE_PTRVAL_SLOT, aip, REQUEST_GI_TO_TSE_ID_sources, REQUEST_GI_TO_TSE_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);
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* 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()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGetTSEPtr LIBCALL
+ID2RequestGetTSENew(void)
+{
+ ID2RequestGetTSEPtr ptr = MemNew((size_t) sizeof(ID2RequestGetTSE));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* TseId_giNew()
+*
+**************************************************/
+static
+TseId_giPtr LIBCALL
+TseId_giNew(void)
+{
+ TseId_giPtr ptr = MemNew((size_t) sizeof(TseId_gi));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2RequestGetTSEFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGetTSEPtr LIBCALL
+ID2RequestGetTSEFree(ID2RequestGetTSEPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ TseId_tse_idFree(ptr -> TseId_tse_id);
+ ID2GetTSEDetailsFree(ptr -> details);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* TseId_tse_idFree()
+*
+**************************************************/
+static
+TseId_tse_idPtr LIBCALL
+TseId_tse_idFree(ValNodePtr anp)
+{
+ Pointer pnt;
+
+ if (anp == NULL) {
+ return NULL;
+ }
+
+ pnt = anp->data.ptrvalue;
+ switch (anp->choice)
+ {
+ default:
+ break;
+ case TseId_tse_id_tse_id:
+ ID2TSEIdFree(anp -> data.ptrvalue);
+ break;
+ case TseId_tse_id_TseId_Gi:
+ TseId_giFree(anp -> data.ptrvalue);
+ break;
+ }
+ return MemFree(anp);
+}
+
+
+/**************************************************
+*
+* TseId_giFree()
+*
+**************************************************/
+static
+TseId_giPtr LIBCALL
+TseId_giFree(TseId_giPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ ID2RequestGiToTSEIdFree(ptr -> request);
+ AsnGenericUserSeqOfFree(ptr -> exclude_tses, (AsnOptFreeFunc) ID2TSEIdFree);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2RequestGetTSEAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestGetTSEPtr LIBCALL
+ID2RequestGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2RequestGetTSEPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2RequestGetTSE ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_GET_TSE);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2RequestGetTSENew();
+ 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_GET_TSE_tse_id) {
+ ptr -> TseId_tse_id = TseId_tse_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 (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 = ID2RequestGetTSEFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* TseId_tse_idAsnRead()
+*
+**************************************************/
+static
+TseId_tse_idPtr LIBCALL
+TseId_tse_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) { /* TseId_tse_id ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_GET_TSE_tse_id);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE_tse_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 == REQUEST_GET_TSE_tse_id_tse_id) {
+ choice = TseId_tse_id_tse_id;
+ func = (AsnReadFunc) ID2TSEIdAsnRead;
+ }
+ else if (atp == ID2_REQUEST_GET_TSE_tse_id_gi) {
+ choice = TseId_tse_id_TseId_Gi;
+ func = (AsnReadFunc) TseId_giAsnRead;
+ }
+ 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;
+}
+
+
+/**************************************************
+*
+* TseId_giAsnRead()
+*
+**************************************************/
+static
+TseId_giPtr LIBCALL
+TseId_giAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ TseId_giPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* TseId_gi ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_GET_TSE_tse_id_gi);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_GET_TSE_tse_id_gi);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = TseId_giNew();
+ 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 == GET_TSE_tse_id_gi_request) {
+ ptr -> request = ID2RequestGiToTSEIdAsnRead(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) {
+ 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 = TseId_giFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestGetTSEAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2RequestGetTSEAsnWrite(ID2RequestGetTSEPtr 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_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 -> TseId_tse_id != NULL) {
+ if ( ! TseId_tse_idAsnWrite(ptr -> TseId_tse_id, aip, ID2_REQUEST_GET_TSE_tse_id)) {
+ goto erret;
+ }
+ }
+ if (ptr -> details != NULL) {
+ if ( ! ID2GetTSEDetailsAsnWrite(ptr -> details, aip, ID2_REQUEST_GET_TSE_details)) {
+ goto erret;
+ }
+ }
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* TseId_tse_idAsnWrite()
+*
+**************************************************/
+static Boolean LIBCALL
+TseId_tse_idAsnWrite(TseId_tse_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, ID2_REQUEST_GET_TSE_tse_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 TseId_tse_id_tse_id:
+ writetype = REQUEST_GET_TSE_tse_id_tse_id;
+ func = (AsnWriteFunc) ID2TSEIdAsnWrite;
+ break;
+ case TseId_tse_id_TseId_Gi:
+ writetype = ID2_REQUEST_GET_TSE_tse_id_gi;
+ func = (AsnWriteFunc) TseId_giAsnWrite;
+ 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;
+}
+
+
+/**************************************************
+*
+* TseId_giAsnWrite()
+*
+**************************************************/
+static Boolean LIBCALL
+TseId_giAsnWrite(TseId_giPtr 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_GET_TSE_tse_id_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 -> request != NULL) {
+ if ( ! ID2RequestGiToTSEIdAsnWrite(ptr -> request, aip, GET_TSE_tse_id_gi_request)) {
+ goto erret;
+ }
+ }
+ AsnGenericUserSeqOfAsnWrite(ptr -> exclude_tses, (AsnWriteFunc) ID2TSEIdAsnWrite, aip, GET_TSE_tse_id_gi_exclude_tses, TSE_tse_id_gi_exclude_tses_E);
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestReGetTSENew()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestReGetTSEPtr LIBCALL
+ID2RequestReGetTSENew(void)
+{
+ ID2RequestReGetTSEPtr ptr = MemNew((size_t) sizeof(ID2RequestReGetTSE));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2RequestReGetTSEFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestReGetTSEPtr LIBCALL
+ID2RequestReGetTSEFree(ID2RequestReGetTSEPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ ID2TSEIdFree(ptr -> tse_id);
+ ID2GetTSEDetailsFree(ptr -> details);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2RequestReGetTSEAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2RequestReGetTSEPtr LIBCALL
+ID2RequestReGetTSEAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2RequestReGetTSEPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2RequestReGetTSE ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REQUEST_REGET_TSE);
+ } else {
+ atp = AsnLinkType(orig, ID2_REQUEST_REGET_TSE);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2RequestReGetTSENew();
+ 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_REGET_TSE_tse_id) {
+ ptr -> tse_id = ID2TSEIdAsnRead(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) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_REQUEST_REGET_TSE_offset) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> offset = 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 = ID2RequestReGetTSEFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2RequestReGetTSEAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2RequestReGetTSEAsnWrite(ID2RequestReGetTSEPtr 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_REGET_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_REQUEST_REGET_TSE_tse_id)) {
+ goto erret;
+ }
+ }
+ if (ptr -> details != NULL) {
+ if ( ! ID2GetTSEDetailsAsnWrite(ptr -> details, aip, ID2_REQUEST_REGET_TSE_details)) {
+ goto erret;
+ }
+ }
+ av.intvalue = ptr -> offset;
+ retval = AsnWrite(aip, ID2_REQUEST_REGET_TSE_offset, &av);
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2SRequestGetChunksNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2SRequestGetChunksPtr LIBCALL
+ID2SRequestGetChunksNew(void)
+{
+ ID2SRequestGetChunksPtr ptr = MemNew((size_t) sizeof(ID2SRequestGetChunks));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2SRequestGetChunksFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2SRequestGetChunksPtr LIBCALL
+ID2SRequestGetChunksFree(ID2SRequestGetChunksPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ ID2TSEIdFree(ptr -> tse_id);
+ AsnGenericBaseSeqOfFree(ptr -> chunks ,ASNCODE_INTVAL_SLOT);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2SRequestGetChunksAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2SRequestGetChunksPtr LIBCALL
+ID2SRequestGetChunksAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2SRequestGetChunksPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2SRequestGetChunks ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2S_REQUEST_GET_CHUNKS);
+ } else {
+ atp = AsnLinkType(orig, ID2S_REQUEST_GET_CHUNKS);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2SRequestGetChunksNew();
+ 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_REQUEST_GET_CHUNKS_tse_id) {
+ ptr -> tse_id = ID2TSEIdAsnRead(aip, atp);
+ if (aip -> io_failure) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2S_REQUEST_GET_CHUNKS_chunks) {
+ ptr -> chunks = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_INTVAL_SLOT, &isError);
+ 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 = ID2SRequestGetChunksFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2SRequestGetChunksAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2SRequestGetChunksAsnWrite(ID2SRequestGetChunksPtr 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_REQUEST_GET_CHUNKS); /* 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_REQUEST_GET_CHUNKS_tse_id)) {
+ goto erret;
+ }
+ }
+ retval = AsnGenericBaseSeqOfAsnWrite(ptr -> chunks ,ASNCODE_INTVAL_SLOT, aip, ID2S_REQUEST_GET_CHUNKS_chunks, REQUEST_GET_CHUNKS_chunks_E);
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2TSEIdNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2TSEIdPtr LIBCALL
+ID2TSEIdNew(void)
+{
+ ID2TSEIdPtr ptr = MemNew((size_t) sizeof(ID2TSEId));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2TSEIdFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2TSEIdPtr LIBCALL
+ID2TSEIdFree(ID2TSEIdPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2TSEIdAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2TSEIdPtr LIBCALL
+ID2TSEIdAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2TSEIdPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2TSEId ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_TSE_ID);
+ } else {
+ atp = AsnLinkType(orig, ID2_TSE_ID);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2TSEIdNew();
+ 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_TSE_ID_sat) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> sat = av.intvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_TSE_ID_sat_key) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> sat_key = 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 = ID2TSEIdFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2TSEIdAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2TSEIdAsnWrite(ID2TSEIdPtr 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_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 -> 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)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2GetTSEDetailsNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2GetTSEDetailsPtr LIBCALL
+ID2GetTSEDetailsNew(void)
+{
+ ID2GetTSEDetailsPtr ptr = MemNew((size_t) sizeof(ID2GetTSEDetails));
+
+ 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;
+
+}
+
+
+/**************************************************
+*
+* ID2GetTSEDetailsFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2GetTSEDetailsPtr LIBCALL
+ID2GetTSEDetailsFree(ID2GetTSEDetailsPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ ID2SeqLocFree(ptr -> location);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2GetTSEDetailsAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2GetTSEDetailsPtr LIBCALL
+ID2GetTSEDetailsAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2GetTSEDetailsPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2GetTSEDetails ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_GET_TSE_DETAILS);
+ } else {
+ atp = AsnLinkType(orig, ID2_GET_TSE_DETAILS);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2GetTSEDetailsNew();
+ 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_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 ( 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;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == TSE_DETAILS_annot_type_mask) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> annot_type_mask = av.intvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == GET_TSE_DETAILS_feat_type_mask) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> feat_type_mask = av.intvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == GET_TSE_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 ptr;
+
+erret:
+ aip -> io_failure = TRUE;
+ ptr = ID2GetTSEDetailsFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2GetTSEDetailsAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2GetTSEDetailsAsnWrite(ID2GetTSEDetailsPtr 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_GET_TSE_DETAILS); /* 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 -> 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);
+ 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_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;
+ }
+ 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 (! id2genAsnLoad()) {
+ 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_whole) {
+ choice = ID2SeqLoc_whole;
+ if (AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ anp->data.intvalue = av.intvalue;
+ }
+ else if (atp == ID2_SEQ_LOC_int__) {
+ choice = ID2SeqLoc_int__;
+ func = (AsnReadFunc) ID2IntervalAsnRead;
+ }
+ else if (atp == ID2_SEQ_LOC_int_set) {
+ choice = ID2SeqLoc_int_set;
+ func = (AsnReadFunc) ID2PackedSeqIntsAsnRead;
+ }
+ else if (atp == ID2_SEQ_LOC_whole_range) {
+ choice = ID2SeqLoc_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;
+ }
+ }
+ 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 (! id2genAsnLoad())
+ 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_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 (!retval) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+/**************************************************
+*
+* ID2ReplyNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2ReplyPtr LIBCALL
+ID2ReplyNew(void)
+{
+ ID2ReplyPtr ptr = MemNew((size_t) sizeof(ID2Reply));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2ReplyFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2ReplyPtr LIBCALL
+ID2ReplyFree(ID2ReplyPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ ID2ParamsFree(ptr -> params);
+ Reply_replyFree(ptr -> Reply_reply);
+ AsnGenericUserSeqOfFree(ptr -> error, (AsnOptFreeFunc) ID2ErrorFree);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* Reply_replyFree()
+*
+**************************************************/
+static
+Reply_replyPtr LIBCALL
+Reply_replyFree(ValNodePtr anp)
+{
+ Pointer pnt;
+
+ if (anp == NULL) {
+ return NULL;
+ }
+
+ pnt = anp->data.ptrvalue;
+ switch (anp->choice)
+ {
+ default:
+ break;
+ case Reply_reply_get_package:
+ ID2ReplyGetPackageFree(anp -> data.ptrvalue);
+ break;
+ case Reply_reply_seq_id_to_gi:
+ ID2ReplySeqIdToGiFree(anp -> data.ptrvalue);
+ break;
+ case Reply_reply_gi_to_tse_id:
+ ID2ReplyGiToTSEIdFree(anp -> data.ptrvalue);
+ break;
+ case Reply_reply_get_tse:
+ ID2ReplyGetTSEFree(anp -> data.ptrvalue);
+ break;
+ case Reply_reply_get_tse_info:
+ ID2SReplyGetTSEInfoFree(anp -> data.ptrvalue);
+ break;
+ case Reply_reply_get_chunk:
+ ID2SReplyGetChunkFree(anp -> data.ptrvalue);
+ break;
+ }
+ return MemFree(anp);
+}
+
+
+/**************************************************
+*
+* ID2ReplyAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2ReplyPtr LIBCALL
+ID2ReplyAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2ReplyPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2Reply ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REPLY);
+ } else {
+ atp = AsnLinkType(orig, ID2_REPLY);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2ReplyNew();
+ 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_serial_number) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> serial_number = av.intvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_REPLY_params) {
+ ptr -> params = ID2ParamsAsnRead(aip, atp);
+ if (aip -> io_failure) {
+ goto erret;
+ }
+ 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) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_REPLY_end_of_reply) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> end_of_reply = av.boolvalue;
+ 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 = ID2ReplyFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* Reply_replyAsnRead()
+*
+**************************************************/
+static
+Reply_replyPtr LIBCALL
+Reply_replyAsnRead(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) { /* Reply_reply ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REPLY_reply);
+ } else {
+ atp = AsnLinkType(orig, ID2_REPLY_reply); /* 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_REPLY_reply_init) {
+ choice = Reply_reply_init;
+ 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_gi_to_tse_id) {
+ choice = Reply_reply_gi_to_tse_id;
+ func = (AsnReadFunc) ID2ReplyGiToTSEIdAsnRead;
+ }
+ else if (atp == ID2_REPLY_reply_get_tse) {
+ choice = Reply_reply_get_tse;
+ func = (AsnReadFunc) ID2ReplyGetTSEAsnRead;
+ }
+ 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_chunk) {
+ choice = Reply_reply_get_chunk;
+ func = (AsnReadFunc) ID2SReplyGetChunkAsnRead;
+ }
+ 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;
+}
+
+
+/**************************************************
+*
+* ID2ReplyAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2ReplyAsnWrite(ID2ReplyPtr 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); /* 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 -> serial_number;
+ retval = AsnWrite(aip, ID2_REPLY_serial_number, &av);
+ if (ptr -> params != NULL) {
+ if ( ! ID2ParamsAsnWrite(ptr -> params, aip, ID2_REPLY_params)) {
+ goto erret;
+ }
+ }
+ 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;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* Reply_replyAsnWrite()
+*
+**************************************************/
+static Boolean LIBCALL
+Reply_replyAsnWrite(Reply_replyPtr 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_REPLY_reply); /* 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 Reply_reply_init:
+ av.boolvalue = anp->data.boolvalue;
+ retval = AsnWrite(aip, ID2_REPLY_reply_init, &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;
+ break;
+ case Reply_reply_gi_to_tse_id:
+ writetype = ID2_REPLY_reply_gi_to_tse_id;
+ func = (AsnWriteFunc) ID2ReplyGiToTSEIdAsnWrite;
+ break;
+ case Reply_reply_get_tse:
+ writetype = ID2_REPLY_reply_get_tse;
+ func = (AsnWriteFunc) ID2ReplyGetTSEAsnWrite;
+ break;
+ case Reply_reply_get_tse_info:
+ writetype = ID2_REPLY_reply_get_tse_info;
+ func = (AsnWriteFunc) ID2SReplyGetTSEInfoAsnWrite;
+ break;
+ case Reply_reply_get_chunk:
+ writetype = ID2_REPLY_reply_get_chunk;
+ func = (AsnWriteFunc) ID2SReplyGetChunkAsnWrite;
+ 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;
+}
+
+
+/**************************************************
+*
+* 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()
+*
+**************************************************/
+NLM_EXTERN
+ID2ErrorPtr LIBCALL
+ID2ErrorNew(void)
+{
+ ID2ErrorPtr ptr = MemNew((size_t) sizeof(ID2Error));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2ErrorFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2ErrorPtr LIBCALL
+ID2ErrorFree(ID2ErrorPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ MemFree(ptr -> message);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2ErrorAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2ErrorPtr LIBCALL
+ID2ErrorAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2ErrorPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2Error ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_ERROR);
+ } else {
+ atp = AsnLinkType(orig, ID2_ERROR);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2ErrorNew();
+ 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_ERROR_severity) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> severity = av.intvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_ERROR_retry_delay) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> retry_delay = av.intvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_ERROR_message) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> message = 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 = ID2ErrorFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2ErrorAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2ErrorAsnWrite(ID2ErrorPtr 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_ERROR); /* 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 -> severity;
+ retval = AsnWrite(aip, ID2_ERROR_severity, &av);
+ av.intvalue = ptr -> retry_delay;
+ retval = AsnWrite(aip, ID2_ERROR_retry_delay, &av);
+ if (ptr -> message != NULL) {
+ av.ptrvalue = ptr -> message;
+ retval = AsnWrite(aip, ID2_ERROR_message, &av);
+ }
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2TSEIdInfoNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2TSEIdInfoPtr LIBCALL
+ID2TSEIdInfoNew(void)
+{
+ ID2TSEIdInfoPtr ptr = MemNew((size_t) sizeof(ID2TSEIdInfo));
+
+ ptr -> split_version = 0;
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2TSEIdInfoFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2TSEIdInfoPtr LIBCALL
+ID2TSEIdInfoFree(ID2TSEIdInfoPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ ID2TSEIdFree(ptr -> tse_id);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2TSEIdInfoAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2TSEIdInfoPtr LIBCALL
+ID2TSEIdInfoAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2TSEIdInfoPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2TSEIdInfo ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_TSE_ID_INFO);
+ } else {
+ atp = AsnLinkType(orig, ID2_TSE_ID_INFO);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2TSEIdInfoNew();
+ 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_TSE_ID_INFO_tse_id) {
+ ptr -> tse_id = ID2TSEIdAsnRead(aip, atp);
+ if (aip -> io_failure) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_TSE_ID_INFO_split_version) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> split_version = 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 = ID2TSEIdInfoFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2TSEIdInfoAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2TSEIdInfoAsnWrite(ID2TSEIdInfoPtr 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_TSE_ID_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, ID2_TSE_ID_INFO_tse_id)) {
+ 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;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* ID2ReplyDataNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2ReplyDataPtr LIBCALL
+ID2ReplyDataNew(void)
+{
+ ID2ReplyDataPtr ptr = MemNew((size_t) sizeof(ID2ReplyData));
+
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2ReplyDataFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2ReplyDataPtr LIBCALL
+ID2ReplyDataFree(ID2ReplyDataPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ AsnGenericBaseSeqOfFree(ptr -> data ,ASNCODE_BYTEVAL_SLOT);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2ReplyDataAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2ReplyDataPtr LIBCALL
+ID2ReplyDataAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2ReplyDataPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2ReplyData ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_REPLY_DATA);
+ } else {
+ atp = AsnLinkType(orig, ID2_REPLY_DATA);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2ReplyDataNew();
+ 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_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) {
+ 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) {
+ 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 = ID2ReplyDataFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2ReplyDataAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2ReplyDataAsnWrite(ID2ReplyDataPtr 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_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;
+ }
+
+ 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) {
+ 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);
+ 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 (! id2genAsnLoad()) {
+ 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 (! 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 ( 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 (! id2genAsnLoad()) {
+ 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 (! id2genAsnLoad()) {
+ 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 (! id2genAsnLoad()) {
+ 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 (! 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) {
+ 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 (! 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;
+ }
+ 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 (! id2genAsnLoad()) {
+ 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 (! id2genAsnLoad()) {
+ 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;
+ }
+ 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) {
+ 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 (! 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;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
+
+
+/**************************************************
+*
+* 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 (! id2genAsnLoad()) {
+ 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 (! id2genAsnLoad()) {
+ 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;
+}
+
+
+
+/**************************************************
+*
+* 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 (! id2genAsnLoad()) {
+ 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 (! 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 ( 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 (! id2genAsnLoad()) {
+ 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;
+}
+
+
+
+/**************************************************
+*
+* 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) {
+ 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;
+ }
+ }
+
+ 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 (! id2genAsnLoad()) {
+ 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 (! 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()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2SChunkDataAsnWrite(ID2SChunkDataPtr 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_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 (! 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()
+*
+**************************************************/
+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 (! id2genAsnLoad()) {
+ 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 (! id2genAsnLoad()) {
+ 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 -> ints, (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 (! id2genAsnLoad()) {
+ 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_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) {
+ 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 (! id2genAsnLoad()) {
+ 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 -> ints, (AsnWriteFunc) ID2SeqRangeAsnWrite, aip, ID2_PACKED_SEQ_INTS_ints, ID2_PACKED_SEQ_INTS_ints_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 (! id2genAsnLoad()) {
+ 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 (! id2genAsnLoad()) {
+ 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;
+}
+
+
+
+/**************************************************
+*
+* ID2ParamNew()
+*
+**************************************************/
+NLM_EXTERN
+ID2ParamPtr LIBCALL
+ID2ParamNew(void)
+{
+ ID2ParamPtr ptr = MemNew((size_t) sizeof(ID2Param));
+
+ ptr -> type = 1;
+ return ptr;
+
+}
+
+
+/**************************************************
+*
+* ID2ParamFree()
+*
+**************************************************/
+NLM_EXTERN
+ID2ParamPtr LIBCALL
+ID2ParamFree(ID2ParamPtr ptr)
+{
+
+ if(ptr == NULL) {
+ return NULL;
+ }
+ MemFree(ptr -> name);
+ AsnGenericBaseSeqOfFree(ptr -> value ,ASNCODE_PTRVAL_SLOT);
+ return MemFree(ptr);
+}
+
+
+/**************************************************
+*
+* ID2ParamAsnRead()
+*
+**************************************************/
+NLM_EXTERN
+ID2ParamPtr LIBCALL
+ID2ParamAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ Boolean isError = FALSE;
+ AsnReadFunc func;
+ ID2ParamPtr ptr;
+
+ if (! loaded)
+ {
+ if (! id2genAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* ID2Param ::= (self contained) */
+ atp = AsnReadId(aip, amp, ID2_PARAM);
+ } else {
+ atp = AsnLinkType(orig, ID2_PARAM);
+ }
+ /* link in local tree */
+ if (atp == NULL) {
+ return NULL;
+ }
+
+ ptr = ID2ParamNew();
+ 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_PARAM_name) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> name = av.ptrvalue;
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_PARAM_value) {
+ ptr -> value = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
+ if (isError && ptr -> value == NULL) {
+ goto erret;
+ }
+ atp = AsnReadId(aip,amp, atp);
+ }
+ if (atp == ID2_PARAM_type) {
+ if ( AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ ptr -> type = 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 = ID2ParamFree(ptr);
+ goto ret;
+}
+
+
+
+/**************************************************
+*
+* ID2ParamAsnWrite()
+*
+**************************************************/
+NLM_EXTERN Boolean LIBCALL
+ID2ParamAsnWrite(ID2ParamPtr 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_PARAM); /* 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_PARAM_name, &av);
+ }
+ retval = AsnGenericBaseSeqOfAsnWrite(ptr -> value ,ASNCODE_PTRVAL_SLOT, aip, ID2_PARAM_value, ID2_PARAM_value_E);
+ av.intvalue = ptr -> type;
+ retval = AsnWrite(aip, ID2_PARAM_type, &av);
+ if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
+ goto erret;
+ }
+ retval = TRUE;
+
+erret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return retval;
+}
+
diff --git a/network/id2arch/id2.h b/network/id2arch/id2.h
new file mode 100644
index 00000000..affa3533
--- /dev/null
+++ b/network/id2arch/id2.h
@@ -0,0 +1,519 @@
+/***********************************************************************
+*
+**
+* Automatic header module from ASNTOOL
+*
+************************************************************************/
+
+#ifndef _ASNTOOL_
+#include <asn.h>
+#endif
+
+static char * asnfilename = "id2.h14";
+static AsnValxNode avnx[27] = {
+ {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 } ,
+ {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,"seq-data" ,2,0.0,NULL } ,
+ {3,NULL,0,0.0,NULL } ,
+ {1,"" ,0,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] = {
+ {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]} ,
+ {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]} ,
+ {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} ,
+ {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} ,
+ {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]} ,
+ {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} ,
+ {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, 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]} ,
+ {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} };
+
+static AsnModule ampx[1] = {
+ { "NCBI-ID2Access" , "id2.h14",&atx[0],NULL,NULL,0,0} };
+
+static AsnValxNodePtr avn = avnx;
+static AsnTypePtr at = atx;
+static AsnModulePtr amp = ampx;
+
+
+
+/**************************************************
+*
+* Defines for Module NCBI-ID2Access
+*
+**************************************************/
+
+#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]
diff --git a/network/id2arch/id2gen.h b/network/id2arch/id2gen.h
new file mode 100644
index 00000000..c17237b4
--- /dev/null
+++ b/network/id2arch/id2gen.h
@@ -0,0 +1,968 @@
+#ifndef _id2gen_
+#define _id2gen_
+
+#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-ID2Access
+* Generated using ASNCODE Revision: 6.0 at Dec 15, 2003 5:08 PM
+*
+**************************************************/
+
+NLM_EXTERN Boolean LIBCALL
+id2genAsnLoad PROTO((void));
+
+
+/**************************************************
+*
+* ID2RequestPacket
+*
+**************************************************/
+typedef struct struct_ID2Request ID2RequestPacket;
+typedef struct struct_ID2Request PNTR ID2RequestPacketPtr;
+#define ID2RequestPacketNew() ID2RequestNew()
+
+#ifdef NLM_GENERATED_CODE_PROTO
+
+NLM_EXTERN ID2RequestPacketPtr LIBCALL ID2RequestPacketFree PROTO ((ID2RequestPacketPtr ));
+NLM_EXTERN ID2RequestPacketPtr LIBCALL ID2RequestPacketNew PROTO (( void ));
+NLM_EXTERN ID2RequestPacketPtr LIBCALL ID2RequestPacketAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2RequestPacketAsnWrite PROTO (( ID2RequestPacketPtr , AsnIoPtr, AsnTypePtr));
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+
+
+/**************************************************
+*
+* ID2Request
+*
+**************************************************/
+typedef struct struct_ID2_Request {
+ struct struct_ID2_Request PNTR next;
+ Int4 serial_number;
+ struct struct_ID2_Param PNTR params;
+ ValNodePtr Request_request;
+} ID2Request, PNTR ID2RequestPtr;
+
+
+NLM_EXTERN ID2RequestPtr LIBCALL ID2RequestFree PROTO ((ID2RequestPtr ));
+NLM_EXTERN ID2RequestPtr LIBCALL ID2RequestNew PROTO (( void ));
+NLM_EXTERN ID2RequestPtr LIBCALL ID2RequestAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2RequestAsnWrite PROTO (( ID2RequestPtr , AsnIoPtr, AsnTypePtr));
+
+
+#ifdef NLM_GENERATED_CODE_PROTO
+
+typedef ValNodePtr Request_requestPtr;
+typedef ValNode Request_request;
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+#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
+
+#ifdef NLM_GENERATED_CODE_PROTO
+
+static Request_requestPtr LIBCALL Request_requestFree PROTO ((Request_requestPtr ));
+static Request_requestPtr LIBCALL Request_requestAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+static Boolean LIBCALL Request_requestAsnWrite PROTO (( Request_requestPtr , AsnIoPtr, AsnTypePtr));
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+
+
+/**************************************************
+*
+* ID2Params
+*
+**************************************************/
+typedef struct struct_ID2Param ID2Params;
+typedef struct struct_ID2Param PNTR ID2ParamsPtr;
+#define ID2ParamsNew() ID2ParamNew()
+
+#ifdef NLM_GENERATED_CODE_PROTO
+
+NLM_EXTERN ID2ParamsPtr LIBCALL ID2ParamsFree PROTO ((ID2ParamsPtr ));
+NLM_EXTERN ID2ParamsPtr LIBCALL ID2ParamsNew PROTO (( void ));
+NLM_EXTERN ID2ParamsPtr LIBCALL ID2ParamsAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2ParamsAsnWrite PROTO (( ID2ParamsPtr , AsnIoPtr, AsnTypePtr));
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+
+
+/**************************************************
+*
+* ID2RequestGetPackages
+*
+**************************************************/
+typedef struct struct_ID2_Request_Get_Packages {
+ ValNodePtr names;
+ Uint1 no_contents;
+} ID2RequestGetPackages, PNTR ID2RequestGetPackagesPtr;
+
+
+NLM_EXTERN ID2RequestGetPackagesPtr LIBCALL ID2RequestGetPackagesFree PROTO ((ID2RequestGetPackagesPtr ));
+NLM_EXTERN ID2RequestGetPackagesPtr LIBCALL ID2RequestGetPackagesNew PROTO (( void ));
+NLM_EXTERN ID2RequestGetPackagesPtr LIBCALL ID2RequestGetPackagesAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2RequestGetPackagesAsnWrite PROTO (( ID2RequestGetPackagesPtr , AsnIoPtr, AsnTypePtr));
+
+
+
+/**************************************************
+*
+* ID2RequestStringToGi
+*
+**************************************************/
+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 {
+ ValNodePtr seq_id;
+} ID2RequestSeqIdToGi, PNTR ID2RequestSeqIdToGiPtr;
+
+
+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));
+
+
+
+/**************************************************
+*
+* ID2RequestGiToTSEId
+*
+**************************************************/
+typedef struct struct_ID2_Request_Gi_To_TSE_Id {
+ ValNodePtr Gi_gi;
+ 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;
+
+#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 */
+
+
+
+/**************************************************
+*
+* ID2RequestGetTSE
+*
+**************************************************/
+typedef struct struct_ID2_Request_Get_TSE {
+ ValNodePtr TseId_tse_id;
+ struct struct_ID2_Get_TSE_Details PNTR details;
+} ID2RequestGetTSE, PNTR ID2RequestGetTSEPtr;
+
+
+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));
+
+
+#ifdef NLM_GENERATED_CODE_PROTO
+
+typedef ValNodePtr TseId_tse_idPtr;
+typedef ValNode TseId_tse_id;
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+#define TseId_tse_id_tse_id 1
+#define TseId_tse_id_TseId_Gi 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));
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+
+
+/**************************************************
+*
+* TseId_gi
+*
+**************************************************/
+
+#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;
+#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));
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+
+
+/**************************************************
+*
+* ID2RequestReGetTSE
+*
+**************************************************/
+typedef struct struct_ID2_Request_ReGet_TSE {
+ struct struct_ID2_TSE_Id PNTR tse_id;
+ struct struct_ID2_Get_TSE_Details PNTR details;
+ Int4 offset;
+} ID2RequestReGetTSE, PNTR ID2RequestReGetTSEPtr;
+
+
+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));
+
+
+
+/**************************************************
+*
+* ID2SRequestGetChunks
+*
+**************************************************/
+typedef struct struct_ID2S_Request_Get_Chunks {
+ struct struct_ID2_TSE_Id PNTR tse_id;
+ ValNodePtr chunks;
+} ID2SRequestGetChunks, PNTR ID2SRequestGetChunksPtr;
+
+
+NLM_EXTERN ID2SRequestGetChunksPtr LIBCALL ID2SRequestGetChunksFree PROTO ((ID2SRequestGetChunksPtr ));
+NLM_EXTERN ID2SRequestGetChunksPtr LIBCALL ID2SRequestGetChunksNew PROTO (( void ));
+NLM_EXTERN ID2SRequestGetChunksPtr LIBCALL ID2SRequestGetChunksAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2SRequestGetChunksAsnWrite PROTO (( ID2SRequestGetChunksPtr , AsnIoPtr, AsnTypePtr));
+
+
+
+/**************************************************
+*
+* ID2TSEId
+*
+**************************************************/
+typedef struct struct_ID2_TSE_Id {
+ struct struct_ID2_TSE_Id PNTR next;
+ Int4 sat;
+ Int4 sat_key;
+} ID2TSEId, PNTR ID2TSEIdPtr;
+
+
+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));
+
+
+
+/**************************************************
+*
+* ID2GetTSEDetails
+*
+**************************************************/
+typedef struct struct_ID2_Get_TSE_Details {
+ ValNodePtr location;
+ Int4 seq_class_level;
+ Int4 descr_level;
+ Int4 descr_type_mask;
+ Int4 annot_type_mask;
+ 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;
+
+
+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));
+
+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));
+
+
+
+/**************************************************
+*
+* ID2Reply
+*
+**************************************************/
+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;
+} ID2Reply, PNTR ID2ReplyPtr;
+
+
+NLM_EXTERN ID2ReplyPtr LIBCALL ID2ReplyFree PROTO ((ID2ReplyPtr ));
+NLM_EXTERN ID2ReplyPtr LIBCALL ID2ReplyNew PROTO (( void ));
+NLM_EXTERN ID2ReplyPtr LIBCALL ID2ReplyAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2ReplyAsnWrite PROTO (( ID2ReplyPtr , AsnIoPtr, AsnTypePtr));
+
+
+#ifdef NLM_GENERATED_CODE_PROTO
+
+typedef ValNodePtr Reply_replyPtr;
+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
+
+#ifdef NLM_GENERATED_CODE_PROTO
+
+static Reply_replyPtr LIBCALL Reply_replyFree PROTO ((Reply_replyPtr ));
+static Reply_replyPtr LIBCALL Reply_replyAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+static Boolean LIBCALL Reply_replyAsnWrite PROTO (( Reply_replyPtr , AsnIoPtr, AsnTypePtr));
+
+#endif /* NLM_GENERATED_CODE_PROTO */
+
+
+
+/**************************************************
+*
+* 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
+*
+**************************************************/
+typedef struct struct_ID2_Error {
+ struct struct_ID2_Error PNTR next;
+ Uint2 severity;
+ /* following #defines are for enumerated type, not used by object loaders */
+#define ID2_Error_severity_warning 1
+#define ID2_Error_severity_failed_command 2
+#define ID2_Error_severity_failed_connection 3
+#define ID2_Error_severity_failed_server 4
+#define ID2_Error_severity_no_data 5
+#define ID2_Error_severity_restricted_data 6
+#define ID2_Error_severity_unsupported_command 7
+#define ID2_Error_severity_invalid_arguments 8
+
+ Int4 retry_delay;
+ CharPtr message;
+} ID2Error, PNTR ID2ErrorPtr;
+
+
+NLM_EXTERN ID2ErrorPtr LIBCALL ID2ErrorFree PROTO ((ID2ErrorPtr ));
+NLM_EXTERN ID2ErrorPtr LIBCALL ID2ErrorNew PROTO (( void ));
+NLM_EXTERN ID2ErrorPtr LIBCALL ID2ErrorAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2ErrorAsnWrite PROTO (( ID2ErrorPtr , AsnIoPtr, AsnTypePtr));
+
+
+
+/**************************************************
+*
+* 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
+*
+**************************************************/
+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
+
+
+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));
+
+
+
+/**************************************************
+*
+* 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));
+
+
+
+/**************************************************
+*
+* 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
+
+
+/**************************************************
+*
+* 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));
+
+
+
+/**************************************************
+*
+* 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 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;
+
+
+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));
+
+
+
+/**************************************************
+*
+* ID2Param
+*
+**************************************************/
+typedef struct struct_ID2_Param {
+ struct struct_ID2_Param PNTR next;
+ CharPtr name;
+ ValNodePtr value;
+ Uint2 type;
+ /* following #defines are for enumerated type, not used by object loaders */
+#define ID2_Param_type_set_value 1
+#define ID2_Param_type_get_value 2
+#define ID2_Param_type_force_value 3
+#define ID2_Param_type_use_package 4
+
+} ID2Param, PNTR ID2ParamPtr;
+
+
+NLM_EXTERN ID2ParamPtr LIBCALL ID2ParamFree PROTO ((ID2ParamPtr ));
+NLM_EXTERN ID2ParamPtr LIBCALL ID2ParamNew PROTO (( void ));
+NLM_EXTERN ID2ParamPtr LIBCALL ID2ParamAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+NLM_EXTERN Boolean LIBCALL ID2ParamAsnWrite PROTO (( ID2ParamPtr , AsnIoPtr, AsnTypePtr));
+
+#ifdef __cplusplus
+/* { */ }
+#endif
+
+#endif /* _id2gen_ */
+
+#undef NLM_EXTERN
+#ifdef NLM_EXPORT
+#define NLM_EXTERN NLM_EXPORT
+#else
+#define NLM_EXTERN
+#endif
+
diff --git a/network/id2arch/id2map.h b/network/id2arch/id2map.h
new file mode 100644
index 00000000..937324db
--- /dev/null
+++ b/network/id2arch/id2map.h
@@ -0,0 +1,10 @@
+#include <objsset.h>
+
+#define NLM_EXTERN_LOADS {if (! SeqSetAsnLoad())return FALSE; \
+ }
+#define struct_Seq_hist seqhist
+#define SeqLiteralAsnRead SeqLitAsnRead
+#define SeqLiteralAsnWrite SeqLitAsnWrite
+#define SeqLiteralFree SeqLitFree
+#define struct_ID2Param struct_ID2_Param
+#define ID2_SEQ_LOC_int__ ID2_SEQ_LOC_int
diff --git a/network/nsclilib/readme b/network/nsclilib/readme
index c68748ad..2e716917 100644
--- a/network/nsclilib/readme
+++ b/network/nsclilib/readme
@@ -87,9 +87,9 @@ Value:
| SRV_PROXY_HOST:5859 --> 130.14.22.2:5859 RETIRED -- DO NOT USE!
| SRV_PROXY_HOST:5840 --> 130.14.22.8:5840 RETIRED -- DO NOT USE!
| SRV_PROXY_HOST:5810 --> 130.14.22.30:5810 RETIRED -- DO NOT USE!
+| SRV_PROXY_HOST:5812 --> 130.14.22.31:5812 RETIRED -- DO NOT USE!
+| SRV_PROXY_HOST:5811 --> 130.14.22.32:5811 RETIRED -- DO NOT USE!
| SRV_PROXY_HOST:5845 --> 130.14.22.12:5845 INTERNAL
-| SRV_PROXY_HOST:5812 --> 130.14.22.31:5812 OBSOLESCENT
-| SRV_PROXY_HOST:5811 --> 130.14.22.32:5811 OBSOLESCENT
| SRV_PROXY_HOST:5850..5860 --> 130.14.29.112:5850..5860
|
| NOTE: It's pretty rare (if ever) when you have to use
@@ -189,4 +189,4 @@ Solaris or IRIX. Then, the client must run on the host that:
a) belongs to one of NCBI subnets and
b) has "lbdaemon"(load-balance daemon) application running on it.
-$Date: 2003/09/29 15:05:10 $
+$Date: 2004/01/16 19:03:45 $
diff --git a/network/spell/client/objspell.c b/network/spell/client/objspell.c
new file mode 100644
index 00000000..5c7a496b
--- /dev/null
+++ b/network/spell/client/objspell.c
@@ -0,0 +1,425 @@
+/*
+*
+*
+* RCS Modification History:
+* $Log: objspell.c,v $
+* Revision 6.0 1997/08/25 18:40:24 madden
+* Revision changed to 6.0
+*
+* Revision 4.0 1995/07/26 13:55:42 ostell
+* force revision to 4.0
+*
+ * Revision 1.2 1995/05/17 17:59:51 epstein
+ * add RCS log revision history
+ *
+*/
+
+#include <asn.h>
+
+#define NLM_GENERATED_CODE_PROTO
+
+#include "objspell.h"
+
+static Boolean loaded = FALSE;
+
+#include "spell.h"
+
+#ifndef NLM_EXTERN_LOADS
+#define NLM_EXTERN_LOADS {}
+#endif
+
+static Boolean
+objspellAsnLoad(void)
+{
+
+ if ( ! loaded) {
+ NLM_EXTERN_LOADS
+
+ if ( ! AsnLoad ())
+ return FALSE;
+ loaded = TRUE;
+ }
+
+ return TRUE;
+}
+
+
+
+/**************************************************
+* Generated object loaders for Module NCBI-SPELL
+*
+**************************************************/
+
+
+/**************************************************
+*
+* SpellRequestFree()
+*
+**************************************************/
+
+SpellRequestPtr LIBCALL
+SpellRequestFree(ValNodePtr anp)
+{
+ Pointer pnt;
+
+ if (anp == NULL) {
+ return NULL;
+ }
+
+ pnt = anp->data.ptrvalue;
+ switch (anp->choice)
+ {
+ default:
+ break;
+ case SpellRequest_spelltext:
+ MemFree(anp -> data.ptrvalue);
+ break;
+ }
+ return MemFree(anp);
+}
+
+
+/**************************************************
+*
+* SpellRequestAsnRead()
+*
+**************************************************/
+
+SpellRequestPtr LIBCALL
+SpellRequestAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ ValNodePtr anp;
+ Uint1 choice;
+ Boolean isError;
+ AsnReadFunc func;
+
+ if (! loaded)
+ {
+ if (! objspellAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* SpellRequest ::= (self contained) */
+ atp = AsnReadId(aip, amp, SPELL_REQUEST);
+ } else {
+ atp = AsnLinkType(orig, SPELL_REQUEST); /* 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 == SPELL_REQUEST_init) {
+ choice = SpellRequest_init;
+ if (AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ anp->data.intvalue = av.intvalue;
+ }
+ else if (atp == SPELL_REQUEST_spelltext) {
+ choice = SpellRequest_spelltext;
+ if (AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ anp->data.ptrvalue = av.ptrvalue;
+ }
+ else if (atp == SPELL_REQUEST_fini) {
+ choice = SpellRequest_fini;
+ 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 (anp->data.ptrvalue == NULL) {
+ goto erret;
+ }
+ }
+
+ret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return anp;
+
+erret:
+ anp = MemFree(anp);
+ goto ret;
+}
+
+
+/**************************************************
+*
+* SpellRequestAsnWrite()
+*
+**************************************************/
+Boolean LIBCALL
+SpellRequestAsnWrite(SpellRequestPtr anp, AsnIoPtr aip, AsnTypePtr orig)
+
+{
+ DataVal av;
+ AsnTypePtr atp, writetype = NULL;
+ Pointer pnt;
+ AsnWriteFunc func = NULL;
+ Boolean retval = FALSE;
+
+ if (! loaded)
+ {
+ if (! objspellAsnLoad())
+ return FALSE;
+ }
+
+ if (aip == NULL)
+ return FALSE;
+
+ atp = AsnLinkType(orig, SPELL_REQUEST); /* 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;
+ av.intvalue = anp->data.intvalue;
+ switch (anp->choice)
+ {
+ case SpellRequest_init:
+ retval = AsnWrite(aip, SPELL_REQUEST_init, &av);
+ break;
+ case SpellRequest_spelltext:
+ retval = AsnWrite(aip, SPELL_REQUEST_spelltext, &av);
+ break;
+ case SpellRequest_fini:
+ retval = AsnWrite(aip, SPELL_REQUEST_fini, &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;
+}
+
+
+/**************************************************
+*
+* SpellResponseFree()
+*
+**************************************************/
+
+SpellResponsePtr LIBCALL
+SpellResponseFree(ValNodePtr anp)
+{
+ Pointer pnt;
+
+ if (anp == NULL) {
+ return NULL;
+ }
+
+ pnt = anp->data.ptrvalue;
+ switch (anp->choice)
+ {
+ default:
+ break;
+ case SpellResponse_spelltext:
+ AsnGenericBaseSeqOfFree((ValNodePtr) pnt,ASNCODE_PTRVAL_SLOT);
+ break;
+ }
+ return MemFree(anp);
+}
+
+
+/**************************************************
+*
+* SpellResponseAsnRead()
+*
+**************************************************/
+
+SpellResponsePtr LIBCALL
+SpellResponseAsnRead(AsnIoPtr aip, AsnTypePtr orig)
+{
+ DataVal av;
+ AsnTypePtr atp;
+ ValNodePtr anp;
+ Uint1 choice;
+ Boolean isError;
+ AsnReadFunc func;
+
+ if (! loaded)
+ {
+ if (! objspellAsnLoad()) {
+ return NULL;
+ }
+ }
+
+ if (aip == NULL) {
+ return NULL;
+ }
+
+ if (orig == NULL) { /* SpellResponse ::= (self contained) */
+ atp = AsnReadId(aip, amp, SPELL_RESPONSE);
+ } else {
+ atp = AsnLinkType(orig, SPELL_RESPONSE); /* 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 == SPELL_RESPONSE_error) {
+ choice = SpellResponse_error;
+ if (AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ anp->data.intvalue = av.intvalue;
+ }
+ else if (atp == SPELL_RESPONSE_init) {
+ choice = SpellResponse_init;
+ if (AsnReadVal(aip, atp, &av) <= 0) {
+ goto erret;
+ }
+ anp->data.intvalue = av.intvalue;
+ }
+ else if (atp == SPELL_RESPONSE_spelltext) {
+ choice = SpellResponse_spelltext;
+ anp -> data.ptrvalue =
+ AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
+ if (isError && anp -> data.ptrvalue == NULL) {
+ goto erret;
+ }
+ }
+ else if (atp == SPELL_RESPONSE_fini) {
+ choice = SpellResponse_fini;
+ 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 (anp->data.ptrvalue == NULL) {
+ goto erret;
+ }
+ }
+
+ret:
+ AsnUnlinkType(orig); /* unlink local tree */
+ return anp;
+
+erret:
+ anp = MemFree(anp);
+ goto ret;
+}
+
+
+/**************************************************
+*
+* SpellResponseAsnWrite()
+*
+**************************************************/
+Boolean LIBCALL
+SpellResponseAsnWrite(SpellResponsePtr anp, AsnIoPtr aip, AsnTypePtr orig)
+
+{
+ DataVal av;
+ AsnTypePtr atp, writetype = NULL;
+ Pointer pnt;
+ AsnWriteFunc func = NULL;
+ Boolean retval = FALSE;
+
+ if (! loaded)
+ {
+ if (! objspellAsnLoad())
+ return FALSE;
+ }
+
+ if (aip == NULL)
+ return FALSE;
+
+ atp = AsnLinkType(orig, SPELL_RESPONSE); /* 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;
+ av.intvalue = anp->data.intvalue;
+ switch (anp->choice)
+ {
+ case SpellResponse_error:
+ retval = AsnWrite(aip, SPELL_RESPONSE_error, &av);
+ break;
+ case SpellResponse_init:
+ retval = AsnWrite(aip, SPELL_RESPONSE_init, &av);
+ break;
+ case SpellResponse_spelltext:
+ retval = AsnGenericBaseSeqOfAsnWrite((Pointer) pnt,ASNCODE_PTRVAL_SLOT, aip, SPELL_RESPONSE_spelltext, SPELL_RESPONSE_spelltext_E); break;
+ case SpellResponse_fini:
+ retval = AsnWrite(aip, SPELL_RESPONSE_fini, &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;
+}
diff --git a/network/spell/client/objspell.h b/network/spell/client/objspell.h
new file mode 100644
index 00000000..607d3c6d
--- /dev/null
+++ b/network/spell/client/objspell.h
@@ -0,0 +1,57 @@
+/*
+*
+*
+* RCS Modification History:
+* $Log: objspell.h,v $
+* Revision 6.0 1997/08/25 18:40:26 madden
+* Revision changed to 6.0
+*
+* Revision 4.0 1995/07/26 13:55:42 ostell
+* force revision to 4.0
+*
+ * Revision 1.2 1995/05/17 17:59:53 epstein
+ * add RCS log revision history
+ *
+*/
+
+#ifndef _objspell_
+#define _objspell_
+
+#ifdef __cplusplus
+extern "C" { /* } */
+#endif
+
+
+/**************************************************
+*
+* Generated objects for Module NCBI-SPELL
+*
+**************************************************/
+typedef ValNodePtr SpellRequestPtr;
+typedef ValNode SpellRequest;
+#define SpellRequest_init 1
+#define SpellRequest_spelltext 2
+#define SpellRequest_fini 3
+
+
+SpellRequestPtr LIBCALL SpellRequestFree PROTO ((SpellRequestPtr ));
+SpellRequestPtr LIBCALL SpellRequestAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+Boolean LIBCALL SpellRequestAsnWrite PROTO (( SpellRequestPtr , AsnIoPtr, AsnTypePtr));
+
+typedef ValNodePtr SpellResponsePtr;
+typedef ValNode SpellResponse;
+#define SpellResponse_error 1
+#define SpellResponse_init 2
+#define SpellResponse_spelltext 3
+#define SpellResponse_fini 4
+
+
+SpellResponsePtr LIBCALL SpellResponseFree PROTO ((SpellResponsePtr ));
+SpellResponsePtr LIBCALL SpellResponseAsnRead PROTO (( AsnIoPtr, AsnTypePtr));
+Boolean LIBCALL SpellResponseAsnWrite PROTO (( SpellResponsePtr , AsnIoPtr, AsnTypePtr));
+
+#ifdef __cplusplus
+/* { */ }
+#endif
+
+#endif
diff --git a/network/spell/client/spell.asn b/network/spell/client/spell.asn
new file mode 100644
index 00000000..af69260e
--- /dev/null
+++ b/network/spell/client/spell.asn
@@ -0,0 +1,27 @@
+--
+--********************************************************************
+--
+-- Spell checker for MEDLINE
+-- Jonathan Epstein
+-- June 1994
+--
+--
+--********************************************************************
+
+NCBI-SPELL DEFINITIONS ::=
+BEGIN
+
+Spell-request ::= CHOICE {
+ init NULL ,
+ spelltext VisibleString ,
+ fini NULL
+}
+
+Spell-response ::= CHOICE {
+ error INTEGER ,
+ init NULL ,
+ spelltext SEQUENCE OF VisibleString ,
+ fini NULL
+}
+
+END
diff --git a/network/spell/client/spellapi.c b/network/spell/client/spellapi.c
new file mode 100644
index 00000000..42fadaad
--- /dev/null
+++ b/network/spell/client/spellapi.c
@@ -0,0 +1,453 @@
+/*
+*
+*
+* RCS Modification History:
+* $Log: spellapi.c,v $
+* Revision 6.1 1998/02/03 16:51:12 shavirin
+* Removed some memory leaks.
+*
+* Revision 6.0 1997/08/25 18:40:31 madden
+* Revision changed to 6.0
+*
+* Revision 4.0 1995/07/26 13:55:42 ostell
+* force revision to 4.0
+*
+ * Revision 1.7 1995/05/31 21:12:10 ostell
+ * added SpellCheckData() to return user supplied data ptr and eliminate
+ * the need for global static variables by calling functions
+ *
+ * Revision 1.6 1995/05/17 17:59:56 epstein
+ * add RCS log revision history
+ *
+*/
+
+#include <ncbinet.h>
+#include "spellapi.h"
+#include "objspell.h"
+
+static SpellResponsePtr NetSpellReadAsn PROTO((void));
+static Boolean ReestablishNetSpell PROTO((void));
+static Boolean NetInit PROTO((void));
+static Boolean ForceNetInit PROTO((void));
+static Boolean NetFini PROTO((void));
+static Boolean GenericReestablishNet PROTO((CharPtr svcName, Boolean showErrs));
+static NI_HandPtr svcp = NULL;
+static AsnIoPtr asnin = NULL;
+static AsnIoPtr asnout = NULL;
+SpellRequestPtr sprp;
+SpellResponsePtr spbp;
+static Boolean num_attached = 0;
+static Boolean reallyFinal = TRUE;
+static NI_DispatcherPtr dispatcher;
+static Boolean (*myNetInit) PROTO((void));
+
+
+
+
+/*****************************************************************************
+*
+* SpellInit ()
+*
+*****************************************************************************/
+
+Boolean SpellInit (void)
+
+{
+ DataVal av;
+
+ myNetInit = SpellInit;
+
+ if (! NetInit())
+ return FALSE;
+
+ svcp = NI_GenericGetService(dispatcher, NULL, "SPELL", "Spell", TRUE);
+ if (svcp == NULL)
+ {
+ ErrPostEx(SEV_ERROR, 0, 0, "NI_ServiceGet [%s] (%s)", ni_errlist[ni_errno], ni_errtext);
+ SpellFini();
+ return FALSE;
+ }
+
+ asnin = svcp->raip;
+ asnout = svcp->waip;
+
+ /**********************************************************/
+
+ sprp = ValNodeNew(NULL);
+ sprp->choice = SpellRequest_init;
+ SpellRequestAsnWrite (sprp, asnout, NULL);
+ AsnIoReset(asnout);
+ SpellRequestFree (sprp);
+
+ if ((spbp = NetSpellReadAsn()) == NULL)
+ {
+ return FALSE;
+ }
+ else
+ {
+ spbp->data.ptrvalue = NULL;
+ SpellResponseFree (spbp);
+ return TRUE;
+ }
+}
+
+/*****************************************************************************
+*
+* SpellFini ()
+*
+*****************************************************************************/
+
+static Boolean s_SpellFini (void)
+
+{
+ Boolean retval = TRUE;
+
+ if (asnout != NULL && asnin != NULL)
+ {
+ sprp = ValNodeNew(NULL);
+ sprp->choice = SpellRequest_fini;
+ SpellRequestAsnWrite (sprp, asnout, NULL);
+ AsnIoReset(asnout);
+ SpellRequestFree (sprp);
+
+ if ((spbp = NetSpellReadAsn()) == NULL)
+ {
+ retval = FALSE;
+ }
+ else
+ {
+ spbp->data.ptrvalue = NULL;
+ SpellResponseFree (spbp);
+ retval = TRUE;
+ }
+ }
+
+ NetFini();
+ return retval;
+}
+
+/* the only thing done here is to suppress errors */
+
+Boolean SpellFini (void)
+
+{
+ short erract;
+ ErrDesc err;
+ Boolean retval;
+
+ ErrGetOpts(&erract, NULL);
+ ErrSetOpts(ERR_IGNORE, 0);
+ ErrFetch(&err);
+
+ retval = s_SpellFini();
+
+ ErrSetOpts(erract, 0);
+ ErrFetch(&err);
+
+ return retval;
+}
+
+static ValNodePtr
+s_SpellCheck(CharPtr str)
+{
+ SpellRequestPtr sprp;
+ ValNodePtr retval;
+
+ sprp = ValNodeNew(NULL);
+ sprp->choice = SpellRequest_spelltext;
+ sprp->data.ptrvalue = str;
+ SpellRequestAsnWrite(sprp, asnout, NULL);
+ AsnIoReset(asnout);
+ sprp->data.ptrvalue = NULL;
+
+ if ((spbp = NetSpellReadAsn()) == NULL )
+ return NULL;
+
+ if (spbp->choice != SpellResponse_spelltext)
+ {
+ SpellResponseFree( sprp );
+ return NULL;
+ }
+ retval = (ValNodePtr) spbp->data.ptrvalue;
+ spbp->data.ptrvalue = NULL;
+
+ SpellResponseFree(sprp);
+ SpellResponseFree(spbp);
+
+ return retval;
+}
+
+int SpellCheck(CharPtr str, void (*CallBack)(CharPtr))
+{
+ Int4 i;
+ short erract;
+ ErrDesc err;
+ ValNodePtr vnp = NULL;
+ ValNodePtr v;
+ int retval = 0;
+ CharPtr p;
+ CharPtr str2;
+
+ if (str == NULL)
+ return 0;
+
+ /* convert the string, converting characters which may not appear in */
+ /* a VisibleString to blanks */
+ str2 = StringSave(str);
+ for (p = str2; *p; p++)
+ {
+ if (*p < ' ' || *p >= 0x7f)
+ *p = ' ';
+ }
+
+ for (i = 0; i < SPELL_SERV_RETRIES; i++)
+ {
+ if (i > 0)
+ {
+ if (! ReestablishNetSpell())
+ break;
+ }
+
+ ErrGetOpts(&erract, NULL);
+ ErrSetOpts(ERR_IGNORE, 0);
+ ErrFetch(&err);
+
+ vnp = s_SpellCheck(str2);
+
+ ErrSetOpts(erract, 0);
+ if (! ErrFetch(&err))
+ break; /* success */
+ }
+
+ for (v = vnp; v != NULL; v = v->next)
+ {
+ if (CallBack != NULL)
+ CallBack((CharPtr) v->data.ptrvalue);
+ retval++;
+ }
+ ValNodeFreeData(vnp);
+
+ MemFree(str2);
+
+ return retval;
+}
+
+int SpellCheckData(CharPtr str, void (*CallBack)(CharPtr, Pointer), Pointer userdata)
+{
+ Int4 i;
+ short erract;
+ ErrDesc err;
+ ValNodePtr vnp = NULL;
+ ValNodePtr v;
+ int retval = 0;
+ CharPtr p;
+ CharPtr str2;
+
+ if (str == NULL)
+ return 0;
+
+ /* convert the string, converting characters which may not appear in */
+ /* a VisibleString to blanks */
+ str2 = StringSave(str);
+ for (p = str2; *p; p++)
+ {
+ if (*p < ' ' || *p >= 0x7f)
+ *p = ' ';
+ }
+
+ for (i = 0; i < SPELL_SERV_RETRIES; i++)
+ {
+ if (i > 0)
+ {
+ if (! ReestablishNetSpell())
+ break;
+ }
+
+ ErrGetOpts(&erract, NULL);
+ ErrSetOpts(ERR_IGNORE, 0);
+ ErrFetch(&err);
+
+ vnp = s_SpellCheck(str2);
+
+ ErrSetOpts(erract, 0);
+ if (! ErrFetch(&err))
+ break; /* success */
+ }
+
+ for (v = vnp; v != NULL; v = v->next)
+ {
+ if (CallBack != NULL)
+ CallBack((CharPtr) v->data.ptrvalue, userdata);
+ retval++;
+ }
+ ValNodeFreeData(vnp);
+
+ return retval;
+}
+
+int StringInMedline(CharPtr String, void (*CallBack)(CharPtr))
+{
+ int retval;
+
+ if (! SpellInit())
+ {
+ return 0;
+ }
+ retval = SpellCheck(String, CallBack);
+ SpellFini();
+
+ return retval;
+}
+
+
+/*****************************************************************************
+*
+* NetSpellReadAsn ()
+*
+*****************************************************************************/
+
+static SpellResponsePtr NetSpellReadAsn(void)
+{
+ SpellResponsePtr spbp;
+ short erract;
+ ErrDesc err;
+
+ ErrGetOpts(&erract, NULL);
+ ErrSetOpts(ERR_IGNORE, 0);
+ ErrFetch(&err); /* clear any pending error */
+
+ spbp = SpellResponseAsnRead(asnin, NULL);
+
+ if (ErrFetch(&err))
+ {
+ ErrPost(CTX_UNKNOWN, 1, "Null message read from server");
+ }
+ ErrSetOpts(erract, 0);
+
+ return spbp;
+}
+
+/*****************************************************************************
+*
+* ReestablishNetSpell ()
+*
+*****************************************************************************/
+
+static Boolean ReestablishNetSpell(void)
+{
+ return GenericReestablishNet("Spell", TRUE);
+}
+
+/*****************************************************************************
+*
+* GenericReestablishNet ()
+*
+*****************************************************************************/
+
+static Boolean GenericReestablishNet(CharPtr svcName, Boolean showErrs)
+{
+ Handle mon = NULL;
+ Boolean retval;
+ CharPtr buf;
+
+ buf = MemNew(2 * StrLen(svcName) + 60);
+
+ if (showErrs) {
+ sprintf (buf, "Re-establishing %s Service", svcName);
+ mon = MonitorStrNew(buf, 40);
+ sprintf (buf, "Requesting %s service", svcName);
+ MonitorStrValue(mon, buf);
+ }
+ NetFini();
+ retval = TRUE;
+
+ if (! myNetInit())
+ {
+ sprintf (buf, "%s get failed; re-contacting dispatcher", svcName);
+ MonitorStrValue(mon, buf);
+ retval = FALSE;
+ if (ForceNetInit())
+ { /* successfully established contact w/dispatcher */
+ sprintf (buf, "%s get failed; re-requesting %s service",
+ svcName, svcName);
+ MonitorStrValue(mon, buf);
+ retval = myNetInit();
+ }
+ else {
+ ErrPost(CTX_UNKNOWN, 1, "Unable to re-contact dispatcher");
+ if (showErrs) {
+ ErrShow();
+ }
+ }
+ }
+
+ MonitorFree(mon);
+
+ if (! retval )
+ {
+ sprintf (buf, "Unable to re-establish %s service", svcName);
+ ErrPost(CTX_UNKNOWN, 1, buf);
+ if (showErrs) {
+ ErrShow();
+ }
+ }
+
+ MemFree(buf);
+ return retval;
+}
+
+/*****************************************************************************
+*
+* NetInit ()
+*
+*****************************************************************************/
+
+static Boolean
+NetInit(void)
+{
+ if (num_attached++ > 0)
+ return TRUE;
+
+ return ((dispatcher = NI_GenericInit(NULL, NULL, TRUE, NULL, 0)) != NULL);
+}
+
+
+/*****************************************************************************
+*
+* ForceNetInit ()
+*
+*****************************************************************************/
+
+static Boolean ForceNetInit(void)
+{
+ Boolean retval;
+
+ reallyFinal = FALSE;
+ num_attached = 0; /* force re-attempt to contact dispatcher */
+ retval = NetInit();
+ reallyFinal = TRUE;
+
+ return retval;
+}
+
+/*****************************************************************************
+*
+* NetFini ()
+*
+*****************************************************************************/
+
+static Boolean NetFini(void)
+{
+ if (num_attached > 0)
+ num_attached--;
+
+ if (num_attached == 0)
+ {
+ NI_ServiceDisconnect(svcp);
+ svcp = NULL;
+ NI_EndServices (dispatcher);
+ dispatcher = NULL;
+ }
+
+ return TRUE;
+}
diff --git a/network/spell/client/spellapi.h b/network/spell/client/spellapi.h
new file mode 100644
index 00000000..6c2ce0e5
--- /dev/null
+++ b/network/spell/client/spellapi.h
@@ -0,0 +1,27 @@
+/*
+*
+*
+* RCS Modification History:
+* $Log: spellapi.h,v $
+* Revision 6.0 1997/08/25 18:40:34 madden
+* Revision changed to 6.0
+*
+* Revision 4.0 1995/07/26 13:55:42 ostell
+* force revision to 4.0
+*
+ * Revision 1.3 1995/05/31 21:12:10 ostell
+ * added SpellCheckData() to return user supplied data ptr and eliminate
+ * the need for global static variables by calling functions
+ *
+ * Revision 1.2 1995/05/17 17:59:58 epstein
+ * add RCS log revision history
+ *
+*/
+
+Boolean SpellInit PROTO((void));
+Boolean SpellFini PROTO((void));
+int SpellCheck PROTO((CharPtr String, void (*CallBack)(CharPtr)));
+int SpellCheckData PROTO((CharPtr String, void (*CallBack)(CharPtr,Pointer), Pointer userdata));
+int StringInMedline PROTO((CharPtr String, void (*CallBack)(CharPtr)));
+
+#define SPELL_SERV_RETRIES 2
diff --git a/network/spell/server/fmspell.c b/network/spell/server/fmspell.c
new file mode 100644
index 00000000..ce5e21c4
--- /dev/null
+++ b/network/spell/server/fmspell.c
@@ -0,0 +1,136 @@
+/* $Id: fmspell.c,v 1.1 1998/02/24 21:01:22 shavirin Exp $
+* ===========================================================================
+*
+* PUBLIC DOMAIN NOTICE
+* National Center for Biotechnology Information
+*
+* This software/database is a "United States Government Work" under the
+* terms of the United States Copyright Act. It was written as part of
+* the author's official duties as a United States Government employee and
+* thus cannot be copyrighted. This software/database is freely available
+* to the public for use. The National Library of Medicine and the U.S.
+* Government have not placed any restriction on its use or reproduction.
+*
+* Although all reasonable efforts have been taken to ensure the accuracy
+* and reliability of the software and data, the NLM and the U.S.
+* Government do not and cannot warrant the performance or results that
+* may be obtained by using this software or data. The NLM and the U.S.
+* Government disclaim all warranties, express or implied, including
+* warranties of performance, merchantability or fitness for any particular
+* purpose.
+*
+* Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* File Name: $RCSfile: fmspell.c,v $
+*
+* Author: Sergei Shavirin
+*
+* Initial Version Creation Date: 02/24/1998
+*
+* $Revision: 1.1 $
+*
+* File Description:
+* Database formatter for NCBI SPELL Service
+*
+* $Log: fmspell.c,v $
+* Revision 1.1 1998/02/24 21:01:22 shavirin
+* Initial revision
+*
+*
+* ==========================================================================
+*/
+
+#include <ncbi.h>
+#include <ncbisort.h>
+#include <ncbisam.h>
+
+#define NUMARG 3
+
+Args fmspell_args[NUMARG] = {
+ { "Input file name for spell database",
+ "termlist", NULL, NULL, FALSE, 'd', ARG_STRING, 0.0, 0, NULL},
+ {"Input file anme for stop words",
+ "stopwords", NULL,NULL,FALSE,'s',ARG_FILE_IN, 0.0,0,NULL},
+ {"Logfile name:",
+ "fmspell.log", NULL,NULL,TRUE,'l',ARG_FILE_OUT, 0.0,0,NULL}
+};
+
+#define DB_filename (CharPtr) fmspell_args[0].strvalue
+#define STOP_filename (CharPtr) fmspell_args[1].strvalue
+#define LogFileName (CharPtr) fmspell_args[2].strvalue
+
+static Boolean FMSpellCreateIndex(CharPtr db_name)
+{
+ SORTObjectPtr sop;
+ Char filenamebuf[FILENAME_MAX], DBName[FILENAME_MAX];
+ Char ext1[8], ext2[8], ext3[8], ext4[8];
+ FILE *fd_out;
+ CharPtr files;
+ ISAMErrorCode error;
+ ISAMObjectPtr isamp;
+
+ /* object for unique sorting */
+
+ if((sop = SORTObjectNew(NULL, '\0', 0,
+ FALSE, TRUE)) == NULL) {
+ ErrPostEx(SEV_ERROR, 0, 0, "Failed to create SORT Object");
+ return FALSE;
+ }
+
+ sprintf(filenamebuf, "%s.tmp", db_name);
+
+ if((fd_out = FileOpen(filenamebuf, "w")) == NULL)
+ return FALSE;
+
+ files = db_name;
+
+ SORTFiles(&files, 1, fd_out, sop);
+ SORTObjectFree(sop);
+
+ FileClose(fd_out);
+ FileRename(filenamebuf, db_name);
+
+ sprintf(filenamebuf, "%s.idx", db_name);
+
+ if((isamp = ISAMObjectNew(ISAMString, db_name,
+ filenamebuf)) == NULL) {
+ ErrPostEx(SEV_ERROR, 0, 0, "Creating of ISAM object failed");
+ return FALSE;
+ }
+
+ if((error = ISAMMakeIndex(isamp, 0)) != ISAMNoError) {
+ ErrPostEx(SEV_ERROR, 0, 0, "Creating of index failed with "
+ "error code %ld\n", (long) error);
+ ISAMObjectFree(isamp);
+ return FALSE;
+ }
+
+ ISAMObjectFree(isamp);
+
+ return TRUE;
+}
+
+Int2 Main(void)
+{
+
+ if ( !GetArgs ("fmspell", NUMARG, fmspell_args) ) {
+ return -1;
+ }
+ if ( !ErrSetLog (LogFileName) ) {
+ ErrShow();
+ } else {
+ ErrSetOpts (ERR_CONTINUE, ERR_LOG_ON);
+ }
+
+ if(!FMSpellCreateIndex(DB_filename))
+ return 1;
+
+ if(!FMSpellCreateIndex(STOP_filename))
+ return 1;
+
+ ErrPostEx(SEV_INFO, 0, 0, "Formating finished successfuly");
+
+ return 0;
+}
diff --git a/network/spell/server/spellsrv.c b/network/spell/server/spellsrv.c
new file mode 100644
index 00000000..fcc169d2
--- /dev/null
+++ b/network/spell/server/spellsrv.c
@@ -0,0 +1,414 @@
+/* $Id: spellsrv.c,v 1.2 1998/02/25 19:33:01 shavirin Exp $
+* ===========================================================================
+*
+* PUBLIC DOMAIN NOTICE
+* National Center for Biotechnology Information
+*
+* This software/database is a "United States Government Work" under the
+* terms of the United States Copyright Act. It was written as part of
+* the author's official duties as a United States Government employee and
+* thus cannot be copyrighted. This software/database is freely available
+* to the public for use. The National Library of Medicine and the U.S.
+* Government have not placed any restriction on its use or reproduction.
+*
+* Although all reasonable efforts have been taken to ensure the accuracy
+* and reliability of the software and data, the NLM and the U.S.
+* Government do not and cannot warrant the performance or results that
+* may be obtained by using this software or data. The NLM and the U.S.
+* Government disclaim all warranties, express or implied, including
+* warranties of performance, merchantability or fitness for any particular
+* purpose.
+*
+* Please cite the author in any work or product based on this material.
+*
+* ===========================================================================
+*
+* File Name: $RCSfile: spellsrv.c,v $
+*
+* Author: Sergei Shavirin
+*
+* Initial Version Creation Date: 02/24/1998
+*
+* $Revision: 1.2 $
+*
+* File Description:
+* Main file for NCBI SPELL Service
+*
+* $Log: spellsrv.c,v $
+* Revision 1.2 1998/02/25 19:33:01 shavirin
+* Added additional filtering of words.
+*
+*
+* ==========================================================================
+*/
+#include <ncbi.h>
+#include <ncbinet.h>
+#include <objspell.h>
+#include <ncbisam.h>
+
+#define SPELL_MAX_WORD_SIZE 512
+#define NUMARG 5
+
+#define IS_VALID(c) (isalnum(c) || ((c) == '-') || ((c) == '+') || ((c) == '_') || ((c) == '&') || ((c) == '\'') || ((c) == '`'))
+
+Args spellsrv_args[NUMARG] = {
+ { "Input file name for spell database",
+ "termlist", NULL, NULL, TRUE, 't', ARG_STRING, 0.0, 0, NULL},
+ {"Input file anme for stop words",
+ "stopwords", NULL,NULL, TRUE,'s',ARG_FILE_IN, 0.0,0,NULL},
+ {"Logfile name:",
+ "/dev/null", NULL,NULL,TRUE,'l',ARG_FILE_OUT, 0.0,0,NULL},
+ {"Debug mode",
+ NULL, NULL,NULL,TRUE,'d',ARG_BOOLEAN, 0.0,0,NULL},
+ {"Standalone mode",
+ NULL, NULL,NULL,TRUE,'z',ARG_BOOLEAN, 0.0,0,NULL}
+};
+
+#define DB_filename (CharPtr) spellsrv_args[0].strvalue
+#define STOP_filename (CharPtr) spellsrv_args[1].strvalue
+#define LogFileName (CharPtr) spellsrv_args[2].strvalue
+#define DebugMode (CharPtr) spellsrv_args[3].intvalue
+#define StandAlone (CharPtr) spellsrv_args[4].intvalue
+
+typedef struct SPELLData
+{
+ ISAMObjectPtr term_isamp;
+ ISAMObjectPtr stop_isamp;
+} SPELLData, PNTR SPELLDataPtr;
+
+Boolean SPELLSendResponse(Pointer ptr, AsnIoPtr asnout, Int4 error)
+{
+ SpellResponsePtr srp;
+
+ srp = ValNodeNew(NULL);
+
+ if (error != NULL) {
+ srp->choice = SpellResponse_error;
+ srp->data.intvalue = error;
+ } else {
+ srp->choice = SpellResponse_spelltext;
+ srp->data.ptrvalue = ptr;
+ }
+
+ SpellResponseAsnWrite(srp, asnout, NULL);
+
+ srp->data.ptrvalue = NULL;
+ SpellResponseFree(srp);
+}
+
+static Int4 SPELLFindWord(SPELLDataPtr spellp, CharPtr word)
+{
+ Uint4 index;
+ ISAMErrorCode error;
+
+ if((error = SISAMSearch(spellp->stop_isamp, word, 0, NULL,
+ NULL, &index)) < 0) {
+ ErrPostEx(SEV_FATAL, 0, 0, "Failed to search string index "
+ "ISAM Error code is %d\n", error);
+ return error;
+ }
+
+ /* If word found in "stopwords" - skip main search */
+
+ if(error == ISAMNoError)
+ return 1;
+
+ if((error = SISAMSearch(spellp->term_isamp, word, 0, NULL,
+ NULL, &index)) < 0) {
+ ErrPostEx(SEV_FATAL, 0, 0, "Failed to search string index "
+ "ISAM Error code is %d\n", error);
+ return error;
+ }
+
+ if(error == ISAMNoError)
+ return 1;
+
+ return 0;
+}
+
+static void SPELLGetWord(CharPtr word, CharPtr line, Int4 wordsize)
+{
+ Int4 x = 0, y = 0;
+
+ /* Looking for alphanumeric in the beginning of the word */
+
+ for(x = 0; line[x] && !isalnum(line[x]); x++)
+ continue;
+
+ while(TRUE && y < wordsize) {
+ if(!(word[y] = line[x]))
+ break;
+ if(!IS_VALID(line[x]))
+ break;
+ ++y; ++x;
+ }
+
+ word[y] = '\0';
+
+ while(line[x] && !isalnum(line[x])) ++x;
+
+ for(y=0;(line[y] = line[x]);++x,++y);
+}
+
+Boolean SPELLFixWord(CharPtr word)
+{
+ Int4 i, len;
+
+ StrLower(word);
+ len = StringLen(word);
+
+ /* Testing for all numerics and accessions */
+
+ if(len == 1)
+ return FALSE;
+
+ if(isdigit(*word)) {
+ for(i = 1; i < len; i++) {
+ if(!(isdigit(word[i]) || ispunct(word[i])))
+ break;
+ }
+
+ if(i == len) return FALSE; /* This is number */
+
+ }
+
+ /* Testing, that this is 6 length accession */
+
+ if(len == 6 && isalpha(word[0])) {
+ for(i = 1; i < len; i++) {
+ if(!isdigit(word[i]))
+ break;
+ }
+
+ if (i == len) return FALSE; /* This is accession */
+
+ }
+
+ if(len == 8 && isalpha(word[0]) && isalpha(word[1])) {
+ for(i = 2; i < len; i++) {
+ if(!isdigit(word[i])) {
+ break;
+ }
+ }
+
+ if (i == len) return FALSE; /* This is accession */
+
+ }
+
+ return TRUE;
+}
+
+static ValNodePtr SPELLCheckString(SPELLDataPtr spellp, CharPtr string)
+{
+ Int4 len, i, result;
+ Char word[SPELL_MAX_WORD_SIZE];
+ CharPtr p, chptr, strtmp;
+ ValNodePtr head = NULL, vnp, vnp_l;
+
+ chptr = strtmp = StringSave(string);
+
+ /* Some usefull filtering */
+
+ for (p = strtmp; *p; p++) {
+ if (*p < ' ' || *p >= 0x7f)
+ *p = ' ';
+ }
+
+ /* Removing punctuation in the end of the string */
+
+ do {
+ SPELLGetWord(word, strtmp, SPELL_MAX_WORD_SIZE);
+
+ if(!SPELLFixWord(word)) /* FALSE will filter the word */
+ continue;
+
+ if((result = SPELLFindWord(spellp, word)) == 0) { /* not found */
+ if(head == NULL) {
+ head = ValNodeNew(NULL);
+ head->data.ptrvalue = StringSave(word);
+ vnp_l = head;
+ } else {
+ vnp = ValNodeNew(NULL);
+ vnp->data.ptrvalue = StringSave(word);
+ vnp_l->next = vnp;
+ vnp_l = vnp;
+ }
+ } else if(result < 0) {
+ break;
+ } else {
+ continue;
+ }
+ } while (*strtmp != NULLB);
+
+ MemFree(chptr);
+
+ return head;
+}
+
+static SPELLDataPtr SPELLInit(CharPtr db_name, CharPtr stop_name)
+{
+ SPELLDataPtr spellp;
+ Char buffer[PATH_MAX], buffer1[PATH_MAX];
+ CharPtr path;
+
+ spellp = MemNew(sizeof(SPELLData));
+
+ if((path = getenv("SPELLCHECKDIR")) == NULL)
+ path = ".";
+
+ /* Initializing termlist */
+
+
+ sprintf(buffer1, "%s/%s", path, db_name);
+ sprintf(buffer, "%s/%s.idx", path, db_name);
+
+ if(FileLength(buffer) != 0 && FileLength(buffer1) != 0) {
+ if((spellp->term_isamp = ISAMObjectNew(ISAMString,
+ buffer1, buffer)) == NULL) {
+ ErrPostEx(SEV_ERROR, 993, 1, "Failed to create SISAM object");
+ return NULL;
+ }
+ } else {
+ ErrPostEx(SEV_ERROR, 993, 1,
+ "Database or index term files do not exists");
+ return NULL;
+ }
+ /* Initializing stopwords list */
+
+ sprintf(buffer1, "%s/%s", path, stop_name);
+ sprintf(buffer, "%s/%s.idx", path, stop_name);
+ if(FileLength(buffer) != 0 && FileLength(buffer1) != 0) {
+ if((spellp->stop_isamp = ISAMObjectNew(ISAMString,
+ buffer1, buffer)) == NULL) {
+ ErrPostEx(SEV_ERROR, 993, 1, "Failed to create SISAM object");
+ return NULL;
+ }
+ } else {
+ ErrPostEx(SEV_ERROR, 993, 1,
+ "Database or index term files do not exists");
+ return NULL;
+ }
+
+ return spellp;
+}
+static void SPELLFree(SPELLDataPtr spellp)
+{
+ ISAMObjectFree(spellp->term_isamp);
+ ISAMObjectFree(spellp->stop_isamp);
+
+ MemFree(spellp);
+ return;
+}
+
+Int2 Main(void)
+{
+ SpellRequestPtr splrp;
+ SpellResponsePtr splbp;
+ Boolean done = FALSE;
+ short erract;
+ ErrDesc err;
+ NI_HandPtr hp;
+ Char buf[100];
+ AsnIoPtr asnin;
+ AsnIoPtr asnout;
+ int read_timeout;
+ SPELLDataPtr spellp;
+ ValNodePtr vnp;
+
+ if (!GetArgs ("spellsrv", NUMARG, spellsrv_args) ) {
+ return -1;
+ }
+ if (!ErrSetLog (LogFileName) ) {
+ ErrShow();
+ } else {
+ ErrSetOpts (ERR_CONTINUE, ERR_LOG_ON);
+ }
+
+ if((spellp = SPELLInit(DB_filename, STOP_filename)) == NULL)
+ return 1;
+
+ if (!StandAlone && !DebugMode) {
+ NI_ServerACK();
+
+ hp = NI_OpenASNIO();
+
+ /* this read-timeout is effectively an idle timeout for */
+ /* the server process; the process will terminate upon */
+ /* read-timeout */
+ GetAppParam("NCBI", "NET_SERV", "SERV_INACT_TIMER", "10",
+ buf, sizeof buf);
+ read_timeout = atoi(buf) * 60; /* param is minutes */
+ MsgSetReadTimeout(hp, read_timeout);
+
+ asnin = hp->raip;
+ asnout = hp->waip;
+ } else if (StandAlone) {
+ asnin = AsnIoNew(ASNIO_BIN_IN, stdin, NULL, NULL, NULL);
+ asnout = AsnIoNew(ASNIO_BIN_OUT, stdout, NULL, NULL, NULL);
+ } else {
+ asnin = AsnIoOpen("spellserv.inp", "r");
+ asnout = AsnIoOpen("spellserv.out", "w");
+ }
+
+ while (!done) {
+ /* encountering EOF on reading is a "normal" occurrence, */
+ /* and does not merit an error message */
+ ErrGetOpts(&erract, NULL);
+ ErrSetOpts(ERR_IGNORE, 0);
+ ErrFetch(&err); /* clear any pending error, which can be ignored */
+
+ splrp = SpellRequestAsnRead(asnin, NULL);
+
+ if (ErrFetch(&err))
+ {
+ done = TRUE;
+ Message(MSG_POST, "Error encountered on AsnReadId %d", err);
+ break; /* client terminated */
+ }
+ ErrSetOpts(erract, 0);
+
+ if (splrp == NULL)
+ {
+ done = TRUE;
+ Message(MSG_POST, "Null AsnReadId");
+ break; /* client terminated */
+ }
+
+ switch (splrp->choice) {
+
+ case SpellRequest_init:
+
+ splbp = ValNodeNew(NULL);
+ splbp->choice = SpellResponse_init;
+ splbp->data.ptrvalue = NULL;
+ SpellResponseAsnWrite (splbp, asnout, NULL);
+ SpellResponseFree (splbp);
+ splrp->data.ptrvalue = NULL;
+ break;
+
+ case SpellRequest_spelltext:
+
+ vnp = SPELLCheckString(spellp, (CharPtr) splrp->data.ptrvalue);
+ SPELLSendResponse((Pointer) vnp, asnout, 0);
+ break;
+
+ case SpellRequest_fini:
+
+ done = TRUE;
+ splbp = ValNodeNew(NULL);
+ splbp->choice = SpellResponse_fini;
+ splbp->data.ptrvalue = NULL;
+
+ SpellResponseAsnWrite (splbp, asnout, NULL);
+ SpellResponseFree (splbp);
+ splrp->data.ptrvalue = NULL;
+ break;
+ }
+
+ AsnIoReset (asnout);
+ SpellRequestFree (splrp);
+ }
+
+ AsnIoClose (asnin);
+ AsnIoClose (asnout);
+}
diff --git a/network/taxon1/taxon2/txcdproc.c b/network/taxon1/taxon2/txcdproc.c
index 2aab690f..f8055068 100644
--- a/network/taxon1/taxon2/txcdproc.c
+++ b/network/taxon1/taxon2/txcdproc.c
@@ -29,7 +29,7 @@
*
* Version Creation Date: 07/15/97
*
-* $Revision: 1.15 $
+* $Revision: 1.16 $
*
* File Description:
* API for Taxonomy service
@@ -44,6 +44,9 @@
*
* RCS Modification History:
* $Log: txcdproc.c,v $
+* Revision 1.16 2003/11/04 17:13:58 soussov
+* adds NetFini() call if service can not start properly
+*
* Revision 1.15 2003/06/12 16:46:25 soussov
* changes severity for AsnRead failures
*
@@ -215,6 +218,7 @@ static Boolean TaxServInit(void)
Taxon1ReqFree (taxrp);
if((taxbp = NetTaxArchReadAsn()) == NULL) {
+ NetFini();
return FALSE;
}
else {
diff --git a/network/vibnet/docsum.c b/network/vibnet/docsum.c
index e2b282a0..be09ca80 100644
--- a/network/vibnet/docsum.c
+++ b/network/vibnet/docsum.c
@@ -29,13 +29,16 @@
*
* Version Creation Date: 9/13/96
*
-* $Revision: 6.55 $
+* $Revision: 6.56 $
*
* File Description:
*
* Modifications:
* --------------------------------------------------------------------------
* $Log: docsum.c,v $
+* Revision 6.56 2003/12/02 20:42:06 kans
+* fixed sprintf calls in SetDefaultFailureMessae
+*
* Revision 6.55 2002/11/06 21:30:57 ucko
* ChangeViewerLinkData: when extracting a string from vnp->data, use
* ptrvalue rather than intvalue (which may be the wrong width)
@@ -672,16 +675,16 @@ static CharPtr SetDefaultFailureMessage (SummFormPtr sfp, Int2 item, CharPtr pre
} else if (sfp->simple != NULL && sfp->uids == NULL) {
ssp = sfp->simple [item - 1];
if (ssp == NULL) {
- sprintf ("%sIncorrect seq-entry for database %s", prefix, dbname);
+ sprintf (tmp, "%sIncorrect seq-entry for database %s", prefix, dbname);
} else {
StringCpy (buf, "?");
if (ssp->numid > 0 && ssp->bestid < ssp->numid) {
StringNCpy_0 (buf, ssp->id [ssp->bestid], sizeof (buf));
}
- sprintf ("%sProblem with sequence %s in %s database", prefix, buf, dbname);
+ sprintf (tmp, "%sProblem with sequence %s in %s database", prefix, buf, dbname);
}
} else {
- sprintf ("%sInternal confusion for database %s", prefix, dbname);
+ sprintf (tmp, "%sInternal confusion for database %s", prefix, dbname);
}
return StringSave (tmp);
}
diff --git a/network/wwwblast/Src/Makefile b/network/wwwblast/Src/Makefile
index 8ea0c4c3..62186b24 100644
--- a/network/wwwblast/Src/Makefile
+++ b/network/wwwblast/Src/Makefile
@@ -14,10 +14,9 @@ THREAD_LIBS = -lpthread
#NCBI_OTHERLIBS += -lposix4 -lresolv -lsocket -lrpcsvc -lnsl -lgen
# Solaris Sparc
#NCBI_OTHERLIBS += -lposix4 -lresolv -lsocket -lrpcsvc -lnsl
-# Darwin
+# MacOS
#NCBI_OTHERLIBS = -lc
#THREAD_LIBS =
-#DEFINE = -DDARWIN
#
CC=cc
@@ -46,6 +45,8 @@ DEBUG_FLAG = -g
#OPTIMIZED compilation
LIBS = $(NCBI_LIBDIR)
DEBUG_FLAG = -O
+# For MacOS, use the following line:
+#DEBUG_FLAG = -O2 -g
OBJ_FILES = wwwbutl.c $(LIBS)/ncbithr.o
@@ -60,49 +61,58 @@ INCDIR = -I. -I$(NCBI_INCDIR)
#BLASTQUE = /home/dondosha/BlastQueue
#INCDIR = -I$(BLASTQUE)/Client -I$(BLASTQUE)/ASN.1 -I. -I$(NCBI_INCDIR)
+CFLAGS = -c $(DEBUG_FLAG) $(INCDIR)
+#For MacOS, add the following line:
+#CFLAGS += -no-cpp-precomp -Wno-long-double
+
# For standalone model
-CFLAGS= $(DEBUG_FLAG) $(INCDIR)
+LDFLAGS = $(DEBUG_FLAG) $(INCDIR)
+#For MacOS, add the following line:
+#LDFLAGS += -framework CoreServices
# Use client/server for gi/accession lookups
-CFLAGS_CS = $(DEBUG_FLAG) $(INCDIR) -DNCBI_ENTREZ_CLIENT
+LDFLAGS_CS = $(DEBUG_FLAG) $(INCDIR) -DNCBI_ENTREZ_CLIENT
+#For MacOS, add the following line:
+#LDFLAGS_CS += -framework CoreServices
# For full NCBI Client-server model
-#CFLAGS_FCS= -c $(DEBUG_FLAG) $(INCDIR) -DNCBI_CLIENT_SERVER
+#CFLAGS += -DNCBI_CLIENT_SERVER
+#LDFLAGS_CS += -DNCBI_CLIENT_SERVER
.c.o: Makefile
- $(CC) -c $(CFLAGS) $<
+ $(CC) $(CFLAGS) $<
all: psiblast.REAL psiblast_cs.REAL blast.REAL blast_cs.REAL nph-viewgif.cgi wblast2.REAL wblast2_cs.REAL bl2bag.cgi
blast.REAL: wwwblast.c $(OBJ_FILES) Makefile
- $(CC) $(CFLAGS) wwwblast.c $(OBJ_FILES) \
+ $(CC) $(LDFLAGS) wwwblast.c $(OBJ_FILES) \
-L$(LIBS) $(ALL_LIBS) -o ./blast.REAL
mv ./blast.REAL ..
blast_cs.REAL: wwwblast.c $(OBJ_FILES) Makefile
- $(CC) $(CFLAGS_CS) wwwblast.c $(OBJ_FILES) \
+ $(CC) $(LDFLAGS_CS) wwwblast.c $(OBJ_FILES) \
-L$(LIBS) $(ALL_LIBS_CS) -o ./blast_cs.REAL
mv ./blast_cs.REAL ..
psiblast.REAL: psiblast.o $(OBJ_FILES) Makefile
- $(CC) $(CFLAGS) psiblast.o $(OBJ_FILES) \
+ $(CC) $(LDFLAGS) psiblast.o $(OBJ_FILES) \
-L$(LIBS) $(ALL_LIBS) -o ./psiblast.REAL
mv ./psiblast.REAL ../psiblast.REAL
psiblast_cs.REAL: psiblast.o $(OBJ_FILES) Makefile
- $(CC) $(CFLAGS_CS) psiblast.o $(OBJ_FILES) \
+ $(CC) $(LDFLAGS_CS) psiblast.o $(OBJ_FILES) \
-L$(LIBS) $(ALL_LIBS_CS) -o ./psiblast_cs.REAL
mv ./psiblast_cs.REAL ../psiblast_cs.REAL
nph-viewgif.cgi: viewgif.o
$(CC) viewgif.o -o nph-viewgif.cgi
mv nph-viewgif.cgi ..
wblast2.REAL : wblast2.c
- $(CC) $(CFLAGS) $(BL2_DEFINE) wblast2.c \
+ $(CC) $(LDFLAGS) $(BL2_DEFINE) wblast2.c \
-L$(LIBS) $(BL2_LIBS) -o ./wblast2.REAL
mv wblast2.REAL ..
wblast2_cs.REAL : wblast2.c $(BL2_OBJ)
- $(CC) $(CFLAGS_CS) $(BL2_DEFINE) wblast2.c $(BL2_OBJ) \
+ $(CC) $(LDFLAGS_CS) $(BL2_DEFINE) wblast2.c $(BL2_OBJ) \
-L$(LIBS) $(BL2_LIBS_CS) -o ./wblast2_cs.REAL
mv wblast2_cs.REAL ..
bl2bag.cgi : bl2bag.o
- $(CC) bl2bag.o -L$(LIBS) -lncbi -lm -o bl2bag.cgi
+ $(CC) $(LDFLAGS) bl2bag.o -L$(LIBS) -lncbi -lm -o bl2bag.cgi
mv bl2bag.cgi ..
xml:
diff --git a/network/wwwblast/Src/XML/Makefile b/network/wwwblast/Src/XML/Makefile
index 8e2d221c..ddfc14c4 100644
--- a/network/wwwblast/Src/XML/Makefile
+++ b/network/wwwblast/Src/XML/Makefile
@@ -24,7 +24,7 @@ LDFLAGS = -I./ -I$(INCPATH) $(OPTFLAGS) -L$(LIBPATH) $(VIBFLAG) $(NEWASN2FF) -g
bxmlobj.c: $(NCBI_ASNALL) blstxml.asn
$(ASNTOOL) -m blstxml.asn -M $(NCBI_ASNALL) -B bxmlobj -G -w100 -Z
$(ASNTOOL) -m blstxml.asn -o blstxml.h -w 100 -Z
- $(ASNTOOL) -m blstxml.asn -X NCBI_BlastOutput.mod
+# $(ASNTOOL) -m blstxml.asn -X NCBI_BlastOutput.mod
# mv bxmlobj.c ..
# mv blstxml.h ..
# mv bxmlobj.h ..
diff --git a/network/wwwblast/Src/psiblast.c b/network/wwwblast/Src/psiblast.c
index c192d0a3..b316a80e 100644
--- a/network/wwwblast/Src/psiblast.c
+++ b/network/wwwblast/Src/psiblast.c
@@ -1,4 +1,4 @@
-/* $Id: psiblast.c,v 1.3 2003/07/15 19:57:11 coulouri Exp $
+/* $Id: psiblast.c,v 1.4 2003/11/21 17:51:32 dondosha Exp $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
@@ -29,12 +29,15 @@
*
* Initial Version Creation Date: 04/21/2000
*
-* $Revision: 1.3 $
+* $Revision: 1.4 $
*
* File Description:
* WWW PSI BLAST Main file
*
* $Log: psiblast.c,v $
+* Revision 1.4 2003/11/21 17:51:32 dondosha
+* Minor bug fix
+*
* Revision 1.3 2003/07/15 19:57:11 coulouri
* use sigaction()
*
@@ -349,7 +352,7 @@ Int2 Main (void)
}
fprintf(stdout, "<FORM NAME=\"PSI_BLAST\" METHOD=\"POST\" "
- "ACTION=\"%s/step%d\" ENCTYPE= \"multipart/form-data\">\n",
+ "ACTION=\"%s?step%d\" ENCTYPE= \"multipart/form-data\">\n",
getenv("SCRIPT_NAME") == NULL ? "" : getenv("SCRIPT_NAME"),
/* WWWGetPort(theInfo->info), */ psidata->StepNumber);
diff --git a/network/wwwblast/Src/wblast2.c b/network/wwwblast/Src/wblast2.c
index e0270302..95fbbf20 100644
--- a/network/wwwblast/Src/wblast2.c
+++ b/network/wwwblast/Src/wblast2.c
@@ -1,4 +1,4 @@
-/* $Id: wblast2.c,v 1.7 2003/07/14 18:43:17 dondosha Exp $
+/* $Id: wblast2.c,v 1.8 2003/12/19 18:12:37 coulouri Exp $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
@@ -27,12 +27,15 @@
*
* Initial Creation Date: 10/23/2000
*
-* $Revision: 1.7 $
+* $Revision: 1.8 $
*
* File Description:
* BLAST 2 Sequences CGI program
*
* $Log: wblast2.c,v $
+* Revision 1.8 2003/12/19 18:12:37 coulouri
+* fix name collision in aix
+*
* Revision 1.7 2003/07/14 18:43:17 dondosha
* Changed Entrez references syntax
*
@@ -452,7 +455,7 @@ static Boolean run_status;
/* Flag to indicate which signals were received */
static Uint8 sigflag = 0;
/* set of signal masks */
-static Uint8 sigmask[64];
+static Uint8 wb2_sigmask[64];
#define WBLAST2_SEARCH 0
#define WBLAST2_FORMAT 1
@@ -463,7 +466,7 @@ void PrepareSigmask(void)
{
int ii;
for( ii = 0; ii < 64; ii++ ) {
- sigmask[ii] = 1 << ii;
+ wb2_sigmask[ii] = 1 << ii;
}
}
@@ -472,7 +475,7 @@ static int GetSignal()
{
int ii;
for( ii = 0; ii < 64; ii++ ) {
- if( sigflag & sigmask[ii] ) {
+ if( sigflag & wb2_sigmask[ii] ) {
break;
}
}
@@ -483,7 +486,7 @@ static int GetSignal()
/** set signal flag */
static void sighandler(int sig)
{
- sigflag |= sigmask[sig];
+ sigflag |= wb2_sigmask[sig];
}
static void Blast2SeqMainPage(CharPtr warning, CharPtr seq1, CharPtr seq2, CharPtr one, CharPtr two, ValNodePtr error, Boolean is_prot, BLAST_OptionsBlkPtr options, Int2 mtrx, Int4 from, Int4 to, Int4 ffrom, Int4 tto, Int2 filter, Int2 pagecount) {
diff --git a/network/wwwblast/Src/wwwblast.c b/network/wwwblast/Src/wwwblast.c
index 9582e926..504c6527 100644
--- a/network/wwwblast/Src/wwwblast.c
+++ b/network/wwwblast/Src/wwwblast.c
@@ -1,4 +1,4 @@
-/* $Id: wwwblast.c,v 1.8 2003/06/04 16:12:51 dondosha Exp $
+/* $Id: wwwblast.c,v 1.13 2004/01/16 17:35:20 dondosha Exp $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
@@ -29,12 +29,27 @@
*
* Initial Creation Date: 03/15/2000
*
-* $Revision: 1.8 $
+* $Revision: 1.13 $
*
* File Description:
* Standalone WWW Blast CGI program.
*
* $Log: wwwblast.c,v $
+* Revision 1.13 2004/01/16 17:35:20 dondosha
+* Fixed mouseover problems
+*
+* Revision 1.12 2003/11/20 22:19:35 dondosha
+* Pass www_root_path to the PrintDefLines... function
+*
+* Revision 1.11 2003/11/20 20:10:52 dondosha
+* Decide whether to print header only after the output type is determined
+*
+* Revision 1.10 2003/11/20 19:10:33 dondosha
+* Do not print progress messages if XML output requested
+*
+* Revision 1.9 2003/11/05 22:40:28 dondosha
+* Do not shift coordinates for tabular output if query is a subsequence - they are already shifted in the seqalign
+*
* Revision 1.8 2003/06/04 16:12:51 dondosha
* Set db genetic code for formatting
*
@@ -179,6 +194,19 @@ static int LIBCALLBACK WWWTickCallback(Int4 sequence_number,
return 1;
}
+
+/* Callback in case of XML output should not print anything to the stdout */
+static int LIBCALLBACK WWWXMLTickCallback(Int4 sequence_number,
+ Int4 number_of_positive_hits)
+{
+ if(!TestSTDOut()) {
+ return -1;
+ }
+ fflush(stdout);
+
+ return 1;
+}
+
static Int4 get_number_alignment(SeqAlignPtr align)
{
Int4 num = 0;
@@ -378,10 +406,11 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt
theInfo->number_of_alignments,
program,
!theInfo->options->gapped_calculation,
- FALSE, SeqLocStart(slp), 0, stdout,
+ FALSE, 0, 0, stdout,
(theInfo->align_view == HitTableWithHeader));
SeqAlignSetFree(seqalign);
} else {
+ Int4 query_number = 1;
while (seqalign) {
if (!options->is_megablast_search)
next_seqalign = NULL;
@@ -430,7 +459,7 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt
seqannot->data = seqalign;
if(theInfo->show_overview) {
- Char f_name[64], title[1024], href[64];
+ Char f_name[64], title[1024], href[64], form_name[16];
Int4 align_num;
sprintf(f_name, "%ld%ld.gif", (long)random(), (long)getpid());
@@ -443,18 +472,23 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt
"</H3>\n", theInfo->www_root_path, (long)align_num);
/* Open HTML form */
- fprintf(stdout, "<FORM NAME=\"BLASTFORM\">\n");
+ sprintf(form_name, "BLASTFORM%ld", query_number);
+ fprintf(stdout, "<FORM NAME=\"%s\">\n", form_name);
fflush(stdout);
- PrintAlignmentOverview(seqannot, stdout,
- "BLASTFORM", href, f_name, title);
+ PrintOneAlignmentOverview(seqannot, stdout, form_name, href, f_name,
+ title, query_number);
+ ++query_number;
}
prune = BlastPruneHitsFromSeqAlign(seqalign, theInfo->number_of_descriptions, NULL);
ObjMgrSetHold();
init_buff_ex(85);
- PrintDefLinesFromSeqAlignEx2(prune->sap, 80, stdout, theInfo->print_options, FIRST_PASS, NULL, theInfo->number_of_descriptions, database, theInfo->www_blast_type);
+ PrintDefLinesFromSeqAlignWithPath(prune->sap, 80, stdout,
+ theInfo->print_options, FIRST_PASS, NULL,
+ theInfo->number_of_descriptions, database,
+ theInfo->www_blast_type, theInfo->www_root_path);
free_buff();
prune = BlastPruneHitsFromSeqAlign(seqalign, theInfo->number_of_alignments, prune);
@@ -504,7 +538,7 @@ TraditionalBlastReportEngineWithImage(SeqLocPtr slp, BioseqPtr bsp, BlastNet3Hpt
if (seqannot)
seqannot = SeqAnnotFree(seqannot);
seqalign = next_seqalign;
- fprintf(stdout, "<PRE>\n");
+ fprintf(stdout, "<PRE>\n</form>\n");
}
} /* End if not hit table */
if (!done) { /* seqalign == NULL */
@@ -768,6 +802,8 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
Boolean tabular_output = (theInfo->align_view == HitTable ||
theInfo->align_view == HitTableWithHeader);
MBXmlPtr mbxp = NULL;
+ int LIBCALLBACK (*callback)(Int4, Int4);
+ Int4 query_number;
if(theInfo == NULL)
return FALSE;
@@ -805,8 +841,12 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
other_returns = NULL;
error_returns = NULL;
- if(!theInfo->xml_output)
+ if(!theInfo->xml_output) {
printf("</PRE>\n");
+ callback = WWWTickCallback;
+ } else {
+ callback = WWWXMLTickCallback;
+ }
if (!is_megablast) {
if (SeqIdComp(SeqLocId(lcase_mask), SeqLocId(query_slp)) ==
@@ -817,15 +857,15 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
lcase_mask = lcase_mask->next;
}
if (query_slp) {
- seqalign = BioseqBlastEngineByLocEx(query_slp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, WWWTickCallback, NULL, theInfo->gi_list, theInfo->gi_list_total);
+ seqalign = BioseqBlastEngineByLocEx(query_slp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, callback, NULL, theInfo->gi_list, theInfo->gi_list_total);
} else {
- seqalign = BioseqBlastEngineEx(theInfo->fake_bsp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, WWWTickCallback, NULL, theInfo->gi_list, theInfo->gi_list_total);
+ seqalign = BioseqBlastEngineEx(theInfo->fake_bsp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, callback, NULL, theInfo->gi_list, theInfo->gi_list_total);
}
} else {
if (options->no_traceback)
- seqalignp = BioseqMegaBlastEngineByLoc(query_slp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, WWWTickCallback, NULL, theInfo->gi_list, theInfo->gi_list_total, AppendMegaBlastHit);
+ seqalignp = BioseqMegaBlastEngineByLoc(query_slp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, callback, NULL, theInfo->gi_list, theInfo->gi_list_total, AppendMegaBlastHit);
else
- seqalignp = BioseqMegaBlastEngineByLoc(query_slp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, WWWTickCallback, NULL, theInfo->gi_list, theInfo->gi_list_total, NULL);
+ seqalignp = BioseqMegaBlastEngineByLoc(query_slp, theInfo->program, theInfo->database, options, &other_returns, &error_returns, callback, NULL, theInfo->gi_list, theInfo->gi_list_total, NULL);
}
if(!theInfo->xml_output)
@@ -904,6 +944,7 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
}
ReadDBBioseqSetDbGeneticCode(theInfo->options->db_genetic_code);
+ query_number = 1;
for (index=0; !done; index++) {
if (is_megablast)
@@ -943,8 +984,8 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
query_slp, theInfo->number_of_alignments,
theInfo->program,
!theInfo->options->gapped_calculation, FALSE,
- (query_slp ? SeqLocStart(query_slp) : 0), 0,
- stdout, (theInfo->align_view == HitTableWithHeader));
+ 0, 0, stdout,
+ (theInfo->align_view == HitTableWithHeader));
} else {
seqannot = SeqAnnotNew();
seqannot->type = 2;
@@ -969,7 +1010,7 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
/* Now printing nice gif with alignment overview */
if(theInfo->show_overview) {
- Char f_name[64], title[1024], href[64];
+ Char f_name[64], title[1024], href[64], form_name[16];
Int4 align_num;
sprintf(f_name, "%ld%ld.gif", (long)random(), (long)getpid());
@@ -984,19 +1025,21 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
/* Open HTML form */
- fprintf(stdout, "<FORM NAME=\"BLASTFORM\">\n");
+ sprintf(form_name, "BLASTFORM%ld", query_number);
+ fprintf(stdout, "<FORM NAME=\"%s\">\n", form_name);
fflush(stdout);
- PrintAlignmentOverview(seqannot, stdout,
- "BLASTFORM", href, f_name, title);
+ PrintOneAlignmentOverview(seqannot, stdout, form_name, href,
+ f_name, title, query_number);
+ ++query_number;
}
prune = BlastPruneHitsFromSeqAlign(seqalign, theInfo->number_of_descriptions, NULL);
ObjMgrSetHold();
init_buff_ex(85);
- PrintDefLinesFromSeqAlignEx2(prune->sap, 80, stdout,
+ PrintDefLinesFromSeqAlignWithPath(prune->sap, 80, stdout,
theInfo->print_options, FIRST_PASS, NULL, -1,
- NULL, theInfo->www_blast_type);
+ NULL, theInfo->www_blast_type, theInfo->www_root_path);
free_buff();
prune = BlastPruneHitsFromSeqAlign(seqalign, theInfo->number_of_alignments, prune);
@@ -1080,6 +1123,7 @@ Boolean WWWBlastDoSearch(WWWBlastInfoPtr theInfo)
}
if(!theInfo->xml_output && seqannot != NULL)
seqannot = SeqAnnotFree(seqannot);
+ fprintf(stdout, "</form>\n");
}
matrix = BLAST_MatrixDestruct(matrix);
@@ -1184,7 +1228,7 @@ static void WWWBlastPrintTopHeader(WWWBlastInfoPtr theInfo)
fprintf(stdout, "<BODY BGCOLOR=\"#FFFFFF\" LINK=\"#0000FF\" "
"VLINK=\"#660099\" ALINK=\"#660099\">\n");
- fprintf(stdout, "<map name=img_map1>\n");
+ fprintf(stdout, "<map name=img_map0>\n");
fprintf(stdout, "<area shape=rect coords=2,1,48,21 "
"href=\"http://www.ncbi.nlm.nih.gov\">\n");
fprintf(stdout, "<area shape=rect coords=385,1,435,21 "
@@ -1194,7 +1238,7 @@ static void WWWBlastPrintTopHeader(WWWBlastInfoPtr theInfo)
fprintf(stdout, "<area shape=rect coords=487,1,508,21 "
"href=\"%s/blast/docs/blast_help.html\">\n", theInfo->www_root_path);
fprintf(stdout, "</map>\n");
- fprintf(stdout, "<IMG USEMAP=#img_map1 WIDTH=509 HEIGHT=22 "
+ fprintf(stdout, "<IMG USEMAP=#img_map0 WIDTH=509 HEIGHT=22 "
"SRC=\"%s/blast/images/blast_results.gif\" ISMAP> \n",
theInfo->www_root_path);
}
@@ -1241,14 +1285,14 @@ Int2 Main(void)
if((theInfo = WWWBlastReadArgs(NULL)) == NULL)
return 1;
- if (!theInfo->xml_output)
- WWWBlastPrintTopHeader(theInfo);
-
/* Read options into structure */
if(!WWWCreateSearchOptions(theInfo)) {
return 1;
}
+ if (!theInfo->xml_output)
+ WWWBlastPrintTopHeader(theInfo);
+
/* validate them */
if(!WWWValidateOptions(theInfo)) {
return 1;
diff --git a/network/wwwblast/Src/wwwbutl.c b/network/wwwblast/Src/wwwbutl.c
index 9f734288..94387037 100644
--- a/network/wwwblast/Src/wwwbutl.c
+++ b/network/wwwblast/Src/wwwbutl.c
@@ -1,4 +1,4 @@
-/* $Id: wwwbutl.c,v 1.18 2003/08/13 14:35:33 dondosha Exp $
+/* $Id: wwwbutl.c,v 1.21 2004/01/16 17:35:20 dondosha Exp $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
@@ -29,12 +29,21 @@
*
* Initial Version Creation Date: 04/21/2000
*
-* $Revision: 1.18 $
+* $Revision: 1.21 $
*
* File Description:
* WWW BLAST/PSI/PHI utilities
*
* $Log: wwwbutl.c,v $
+* Revision 1.21 2004/01/16 17:35:20 dondosha
+* Fixed mouseover problems
+*
+* Revision 1.20 2003/11/20 22:19:35 dondosha
+* Pass www_root_path to the PrintDefLines... function
+*
+* Revision 1.19 2003/11/20 19:10:01 dondosha
+* Never print header for XML output
+*
* Revision 1.18 2003/08/13 14:35:33 dondosha
* When no percent identity cutoff, default value for mismatch penalty is -3 for blastn
*
@@ -1920,7 +1929,7 @@ static void PrintRequestHeader(WWWBlastInfoPtr theInfo)
printf("</HEAD>\n");
printf("<BODY BGCOLOR=\"#FFFFFF\" LINK=\"#0000FF\" "
"VLINK=\"#660099\" ALINK=\"#660099\">\n");
- fprintf(stdout, "<map name=img_map1>\n");
+ fprintf(stdout, "<map name=img_map0>\n");
fprintf(stdout, "<area shape=rect coords=2,1,48,21 "
"href=\"http://www.ncbi.nlm.nih.gov\">\n");
fprintf(stdout, "<area shape=rect coords=385,1,435,21 "
@@ -1930,7 +1939,7 @@ static void PrintRequestHeader(WWWBlastInfoPtr theInfo)
fprintf(stdout, "<area shape=rect coords=487,1,508,21 "
"href=\"%s/blast/docs/blast_help.html\">\n", theInfo->www_root_path);
fprintf(stdout, "</map>\n");
- fprintf(stdout, "<IMG USEMAP=#img_map1 WIDTH=509 HEIGHT=22 "
+ fprintf(stdout, "<IMG USEMAP=#img_map0 WIDTH=509 HEIGHT=22 "
"SRC=\"%s/blast/images/psi_blast.gif\" ISMAP> \n",
theInfo->www_root_path);
printf("<BR><BR><PRE>\n");
@@ -2336,7 +2345,9 @@ BLASTPrintDataPtr PSIBlastSearch(WWWBlastInfoPtr theInfo)
if(theInfo == NULL)
return NULL;
- PrintRequestHeader(theInfo);
+ if (!theInfo->xml_output)
+ PrintRequestHeader(theInfo);
+
print_data = (BLASTPrintDataPtr) MemNew(sizeof(BLASTPrintData));
psidata = MemNew(sizeof(PSIData));
@@ -2480,7 +2491,9 @@ BLASTPrintDataPtr PHIBlastSearch(WWWBlastInfoPtr theInfo)
if(theInfo == NULL)
return NULL;
- PrintRequestHeader(theInfo);
+ if (!theInfo->xml_output)
+ PrintRequestHeader(theInfo);
+
print_data = (BLASTPrintDataPtr) MemNew(sizeof(BLASTPrintData));
psidata = MemNew(sizeof(PSIData));
@@ -2742,8 +2755,11 @@ the alignment was checked on the previous iteration \
fflush(stdout);
print_options += TXALIGN_CHECK_BOX_CHECKED;
- PrintDefLinesFromSeqAlignEx(GoodSeqAlignments, 80, stdout, print_options, FIRST_PASS, marks, theInfo->number_of_descriptions);
-
+ PrintDefLinesFromSeqAlignWithPath(GoodSeqAlignments, 80, stdout,
+ print_options, FIRST_PASS, marks,
+ theInfo->number_of_descriptions, theInfo->database,
+ theInfo->www_blast_type, theInfo->www_root_path);
+
print_options -= TXALIGN_CHECK_BOX_CHECKED;
if (print_data->psidata->StepNumber == 0)
@@ -2757,7 +2773,11 @@ the alignment was checked on the previous iteration \
"Sequences with pattern at position %d and E-value WORSE than threshold</FONT></b></CENTER>\n",
SeqLocStart(seqloc)+1);
- PrintDefLinesFromSeqAlignEx(BadSeqAlignments, 80, stdout, print_options, FIRST_PASS, &marks[countGood], theInfo->number_of_descriptions - countGood);
+ PrintDefLinesFromSeqAlignWithPath(BadSeqAlignments, 80, stdout,
+ print_options, FIRST_PASS, &marks[countGood],
+ theInfo->number_of_descriptions - countGood,
+ theInfo->database, theInfo->www_blast_type,
+ theInfo->www_root_path);
}
marks = MemFree(marks);
@@ -2979,8 +2999,9 @@ the alignment was checked on the previous iteration \
printf(" (bits) Value\n\n");
}
- PrintDefLinesFromSeqAlignEx(GoodSeqAlignments, 80, stdout,
- print_options, FIRST_PASS, marks, theInfo->number_of_descriptions);
+ PrintDefLinesFromSeqAlignWithPath(GoodSeqAlignments, 80, stdout,
+ print_options, FIRST_PASS, marks, theInfo->number_of_descriptions,
+ theInfo->database, theInfo->www_blast_type, theInfo->www_root_path);
print_options -= TXALIGN_CHECK_BOX_CHECKED;
@@ -2995,7 +3016,10 @@ the alignment was checked on the previous iteration \
printf("<HR><CENTER><b><FONT color=\"green\">"
"Sequences with E-value WORSE than threshold </FONT></b></CENTER>\n");
- PrintDefLinesFromSeqAlignEx(BadSeqAlignments, 80, stdout, print_options, FIRST_PASS, &marks[countGood], theInfo->number_of_descriptions - countGood);
+ PrintDefLinesFromSeqAlignWithPath(BadSeqAlignments, 80, stdout,
+ print_options, FIRST_PASS, &marks[countGood],
+ theInfo->number_of_descriptions - countGood, theInfo->database,
+ theInfo->www_blast_type, theInfo->www_root_path);
}
if (theInfo->number_of_descriptions) {
diff --git a/network/wwwblast/readme.html b/network/wwwblast/readme.html
index 114e70a2..c23b298f 100644
--- a/network/wwwblast/readme.html
+++ b/network/wwwblast/readme.html
@@ -1,4 +1,4 @@
-<!-- $Id: readme.html,v 1.9 2003/06/24 21:53:54 dondosha Exp $ -->
+<!-- $Id: readme.html,v 1.11 2004/01/30 22:29:05 dondosha Exp $ -->
<HTML>
<HEAD>
<TITLE>Introduction to the Standalone WWW Blast server</TITLE>
@@ -29,12 +29,34 @@
</UL>
<H3><A NAME="Inroduction">Introduction</A> </H3>
-<P>This standalone WWW BLAST server suite of programs was designed similar to the regular NCBI BLAST server and such command-line NCBI BLAST programs like "blastall", "blastpgp", "rpsblast" and "megablast". It incorporates most features, which exist in NCBI BLAST programs and should be relatively easy to use. This server does not support any request queuing and load balancing. As soon as the user hits a "Search" button, BLAST starts immediately if entered information is valid. So, this server is not intended to handle large load, which may exist in public service. Such queueing and loadbalancing however may be implemented using such products as Load Sharing Facility - "LSF" from <a href="http://www.platform.com">Platform Computing Corporation</a>. Interface to "LSF" was implemented in NCBI, however this was not included in this suite. Standalone server assumes that users have their own BLAST or RPS-BLAST database(s), that should be searched and want to have a simple WWW interface to such search. It is STRONLY recommended that user has experience in installation and running standalone NCBI BLAST programs. </P>
-<P>After files are uncompressed, server is ready to be used immediately. Any customizations to the program are welcomed and may be done by experienced programmers using source code, which is also provided. <P>Recompilation of the server executables requires that programmer has compiled NCBI toolkit libraries. This toolkit can be downloaded from the NCBI FTP web site: <A HREF="ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/README.htm">ftp://ftp.ncbi.nih.gov</A> <BR>After the NCBI toolkit is compiled, user needs to edit the Makefile in the blast/Src directory, and define the NCBI variable in the top line of the Makefile, so it points to the root directory where the NCBI toolkit is located.</P>
+<P>This standalone WWW BLAST server suite of programs was designed similar to the regular NCBI BLAST server and such command-line NCBI BLAST programs like "blastall", "blastpgp", "rpsblast" and "megablast". It incorporates most features, which exist in NCBI BLAST programs and should be relatively easy to use. This server does not support any request queuing and load balancing. As soon as the user hits a "Search" button, BLAST starts immediately if entered information is valid. So, this server is not intended to handle large load, which may exist in public service. Such queueing and loadbalancing however may be implemented using such products as Load Sharing Facility - "LSF" from <a href="http://www.platform.com">Platform Computing Corporation</a>. Interface to "LSF" was implemented in NCBI, however this was not included in this suite. Standalone server assumes that users have their own BLAST or RPS-BLAST database(s), that should be searched and want to have a simple WWW interface to such search. It is STRONLY recommended that user have experience in installation and running standalone NCBI BLAST programs. </P>
+<P>After files are uncompressed, server is ready to be used immediately. Any customizations to the program are welcomed. The source code for WWW BLAST is now part of the NCBI C toolkit, which can be downloaded from the NCBI FTP web site: <A HREF="ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/README.htm">ftp://ftp.ncbi.nih.gov</A> <BR>The compilation of the NCBI C toolkit includes the WWW BLAST executables. The files in the C toolkit most relevant for the WWW BLAST executables are: wwwblast.c, wwwbutl.c, psiblast.c, wblast2.c.</P>
<H3><A NAME="Whatsnew">What's new in this revision?</A></H3>
<TABLE BORDER=1>
<TR VALIGN=top>
+<TD> February 2, 2004
+<TD>
+<UL>
+<LI> All source code moved to the NCBI C toolkit.
+<LI> Mouseover feature fixed in graphical overview.
+<LI> All binaries synchronized with the latest NCBI C toolkit release. All future
+releases will be automatically synchronized with future toolkit releases.
+<LI> Recompilation procedure changed. WWW BLAST binaries are now compiled as part
+of the C toolkit.
+</UL>
+</TR>
+<TR VALIGN=top>
+<TD> November 21, 2003
+<TD>
+<UL>
+<LI> Fixed a bug with absent images on PSI-BLAST iterations.
+<LI> Removed header and progress messages from XML output.
+<LI> All binaries recompiled with the newest version of the NCBI C toolkit libra
+ries.
+</UL>
+</TR>
+<TR VALIGN=top>
<TD> May 9, 2003
<TD>
<UL>
diff --git a/network/wwwblast/readme.txt b/network/wwwblast/readme.txt
index a4d89b55..690f1dd8 100644
--- a/network/wwwblast/readme.txt
+++ b/network/wwwblast/readme.txt
@@ -41,25 +41,38 @@ Platform Computing Corporation <http://www.platform.com>. Interface to
"LSF" was implemented in NCBI, however this was not included in this
suite. Standalone server assumes that users have their own BLAST or
RPS-BLAST database(s), that should be searched and want to have a simple
-WWW interface to such search. It is STRONLY recommended that user has
+WWW interface to such search. It is STRONLY recommended that user have
experience in installation and running standalone NCBI BLAST programs.
After files are uncompressed, server is ready to be used immediately.
-Any customizations to the program are welcomed and may be done by
-experienced programmers using source code, which is also provided.
-
-Recompilation of the server executables requires that programmer has
-compiled NCBI toolkit libraries. This toolkit can be downloaded from the
-NCBI FTP web site: ftp://ftp.ncbi.nih.gov
+Any customizations to the program are welcomed. The source code for WWW
+BLAST is now part of the NCBI C toolkit, which can be downloaded from
+the NCBI FTP web site: ftp://ftp.ncbi.nih.gov
<ftp://ftp.ncbi.nih.gov/toolbox/ncbi_tools/README.htm>
-After the NCBI toolkit is compiled, user needs to edit the Makefile in
-the blast/Src directory, and define the NCBI variable in the top line of
-the Makefile, so it points to the root directory where the NCBI toolkit
-is located.
+The compilation of the NCBI C toolkit includes the WWW BLAST
+executables. The files in the C toolkit most relevant for the WWW BLAST
+executables are: wwwblast.c, wwwbutl.c, psiblast.c, wblast2.c.
What's new in this revision?
+February 2, 2004
+
+ * All source code moved to the NCBI C toolkit.
+ * Mouseover feature fixed in graphical overview.
+ * All binaries synchronized with the latest NCBI C toolkit release.
+ All future releases will be automatically synchronized with future
+ toolkit releases.
+ * Recompilation procedure changed. WWW BLAST binaries are now
+compiled as part of the C toolkit.
+
+November 21, 2003
+
+ * Fixed a bug with absent images on PSI-BLAST iterations.
+ * Removed header and progress messages from XML output.
+ * All binaries recompiled with the newest version of the NCBI C
+toolkit libra ries.
+
May 9, 2003
* Cleaned the Makefile for recompiling the sources.
@@ -487,10 +500,10 @@ the description of a configuration file.
Server configuration file and logfile
Default configuration file is "blast.rc" and logfile "wwwblast.log".
-Setting tag BLAST_TYPE to specific value may change these names.
-This is useful if few different search input pages use the same CGI
-search engine, but significantly different by content and priorities. A
-sample configuration file comes with this distribution:
+Setting tag BLAST_TYPE to specific value may change these names. This is
+useful if few different search input pages use the same CGI search
+engine, but significantly different by content and priorities. A sample
+configuration file comes with this distribution:
This file will set how many CPUs will be used in the BLAST search and
what databases may be used with what programs. Logfile currently stores