4
* RCS Modification History:
6
* Revision 6.0 1997/08/25 18:40:24 madden
7
* Revision changed to 6.0
9
* Revision 4.0 1995/07/26 13:55:42 ostell
10
* force revision to 4.0
12
* Revision 1.2 1995/05/17 17:59:51 epstein
13
* add RCS log revision history
19
#define NLM_GENERATED_CODE_PROTO
23
static Boolean loaded = FALSE;
27
#ifndef NLM_EXTERN_LOADS
28
#define NLM_EXTERN_LOADS {}
48
/**************************************************
49
* Generated object loaders for Module NCBI-SPELL
51
**************************************************/
54
/**************************************************
58
**************************************************/
60
SpellRequestPtr LIBCALL
61
SpellRequestFree(ValNodePtr anp)
69
pnt = anp->data.ptrvalue;
74
case SpellRequest_spelltext:
75
MemFree(anp -> data.ptrvalue);
82
/**************************************************
84
* SpellRequestAsnRead()
86
**************************************************/
88
SpellRequestPtr LIBCALL
89
SpellRequestAsnRead(AsnIoPtr aip, AsnTypePtr orig)
100
if (! objspellAsnLoad()) {
109
if (orig == NULL) { /* SpellRequest ::= (self contained) */
110
atp = AsnReadId(aip, amp, SPELL_REQUEST);
112
atp = AsnLinkType(orig, SPELL_REQUEST); /* link in local tree */
118
anp = ValNodeNew(NULL);
122
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */
128
atp = AsnReadId(aip, amp, atp); /* find the choice */
132
if (atp == SPELL_REQUEST_init) {
133
choice = SpellRequest_init;
134
if (AsnReadVal(aip, atp, &av) <= 0) {
137
anp->data.intvalue = av.intvalue;
139
else if (atp == SPELL_REQUEST_spelltext) {
140
choice = SpellRequest_spelltext;
141
if (AsnReadVal(aip, atp, &av) <= 0) {
144
anp->data.ptrvalue = av.ptrvalue;
146
else if (atp == SPELL_REQUEST_fini) {
147
choice = SpellRequest_fini;
148
if (AsnReadVal(aip, atp, &av) <= 0) {
151
anp->data.intvalue = av.intvalue;
153
anp->choice = choice;
156
anp->data.ptrvalue = (* func)(aip, atp);
157
if (anp->data.ptrvalue == NULL) {
163
AsnUnlinkType(orig); /* unlink local tree */
172
/**************************************************
174
* SpellRequestAsnWrite()
176
**************************************************/
178
SpellRequestAsnWrite(SpellRequestPtr anp, AsnIoPtr aip, AsnTypePtr orig)
182
AsnTypePtr atp, writetype = NULL;
184
AsnWriteFunc func = NULL;
185
Boolean retval = FALSE;
189
if (! objspellAsnLoad())
196
atp = AsnLinkType(orig, SPELL_REQUEST); /* link local tree */
201
if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
203
av.ptrvalue = (Pointer)anp;
204
if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) {
208
pnt = anp->data.ptrvalue;
209
av.intvalue = anp->data.intvalue;
212
case SpellRequest_init:
213
retval = AsnWrite(aip, SPELL_REQUEST_init, &av);
215
case SpellRequest_spelltext:
216
retval = AsnWrite(aip, SPELL_REQUEST_spelltext, &av);
218
case SpellRequest_fini:
219
retval = AsnWrite(aip, SPELL_REQUEST_fini, &av);
222
if (writetype != NULL) {
223
retval = (* func)(pnt, aip, writetype); /* write it out */
231
AsnUnlinkType(orig); /* unlink local tree */
236
/**************************************************
238
* SpellResponseFree()
240
**************************************************/
242
SpellResponsePtr LIBCALL
243
SpellResponseFree(ValNodePtr anp)
251
pnt = anp->data.ptrvalue;
256
case SpellResponse_spelltext:
257
AsnGenericBaseSeqOfFree((ValNodePtr) pnt,ASNCODE_PTRVAL_SLOT);
264
/**************************************************
266
* SpellResponseAsnRead()
268
**************************************************/
270
SpellResponsePtr LIBCALL
271
SpellResponseAsnRead(AsnIoPtr aip, AsnTypePtr orig)
282
if (! objspellAsnLoad()) {
291
if (orig == NULL) { /* SpellResponse ::= (self contained) */
292
atp = AsnReadId(aip, amp, SPELL_RESPONSE);
294
atp = AsnLinkType(orig, SPELL_RESPONSE); /* link in local tree */
300
anp = ValNodeNew(NULL);
304
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the CHOICE or OpenStruct value (nothing) */
310
atp = AsnReadId(aip, amp, atp); /* find the choice */
314
if (atp == SPELL_RESPONSE_error) {
315
choice = SpellResponse_error;
316
if (AsnReadVal(aip, atp, &av) <= 0) {
319
anp->data.intvalue = av.intvalue;
321
else if (atp == SPELL_RESPONSE_init) {
322
choice = SpellResponse_init;
323
if (AsnReadVal(aip, atp, &av) <= 0) {
326
anp->data.intvalue = av.intvalue;
328
else if (atp == SPELL_RESPONSE_spelltext) {
329
choice = SpellResponse_spelltext;
330
anp -> data.ptrvalue =
331
AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
332
if (isError && anp -> data.ptrvalue == NULL) {
336
else if (atp == SPELL_RESPONSE_fini) {
337
choice = SpellResponse_fini;
338
if (AsnReadVal(aip, atp, &av) <= 0) {
341
anp->data.intvalue = av.intvalue;
343
anp->choice = choice;
346
anp->data.ptrvalue = (* func)(aip, atp);
347
if (anp->data.ptrvalue == NULL) {
353
AsnUnlinkType(orig); /* unlink local tree */
362
/**************************************************
364
* SpellResponseAsnWrite()
366
**************************************************/
368
SpellResponseAsnWrite(SpellResponsePtr anp, AsnIoPtr aip, AsnTypePtr orig)
372
AsnTypePtr atp, writetype = NULL;
374
AsnWriteFunc func = NULL;
375
Boolean retval = FALSE;
379
if (! objspellAsnLoad())
386
atp = AsnLinkType(orig, SPELL_RESPONSE); /* link local tree */
391
if (anp == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
393
av.ptrvalue = (Pointer)anp;
394
if (! AsnWriteChoice(aip, atp, (Int2)anp->choice, &av)) {
398
pnt = anp->data.ptrvalue;
399
av.intvalue = anp->data.intvalue;
402
case SpellResponse_error:
403
retval = AsnWrite(aip, SPELL_RESPONSE_error, &av);
405
case SpellResponse_init:
406
retval = AsnWrite(aip, SPELL_RESPONSE_init, &av);
408
case SpellResponse_spelltext:
409
retval = AsnGenericBaseSeqOfAsnWrite((Pointer) pnt,ASNCODE_PTRVAL_SLOT, aip, SPELL_RESPONSE_spelltext, SPELL_RESPONSE_spelltext_E); break;
410
case SpellResponse_fini:
411
retval = AsnWrite(aip, SPELL_RESPONSE_fini, &av);
414
if (writetype != NULL) {
415
retval = (* func)(pnt, aip, writetype); /* write it out */
423
AsnUnlinkType(orig); /* unlink local tree */