3
#define NLM_GENERATED_CODE_PROTO
7
static Boolean loaded = FALSE;
11
#ifndef NLM_EXTERN_LOADS
12
#define NLM_EXTERN_LOADS {}
15
NLM_EXTERN Boolean LIBCALL
32
/**************************************************
33
* Generated object loaders for Module NCBI-Structured-comment-validation
34
* Generated using ASNCODE Revision: 6.16 at Apr 7, 2009 1:38 PM
36
**************************************************/
39
/**************************************************
43
**************************************************/
48
FieldRulePtr ptr = MemNew((size_t) sizeof(FieldRule));
56
/**************************************************
60
**************************************************/
63
FieldRuleFree(FieldRulePtr ptr)
69
MemFree(ptr -> field_name);
70
MemFree(ptr -> match_expression);
75
/**************************************************
79
**************************************************/
82
FieldRuleAsnRead(AsnIoPtr aip, AsnTypePtr orig)
86
Boolean isError = FALSE;
92
if (! objvalidAsnLoad()) {
101
if (orig == NULL) { /* FieldRule ::= (self contained) */
102
atp = AsnReadId(aip, amp, FIELD_RULE);
104
atp = AsnLinkType(orig, FIELD_RULE);
106
/* link in local tree */
111
ptr = FieldRuleNew();
115
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
119
atp = AsnReadId(aip,amp, atp);
122
if (atp == FIELD_RULE_field_name) {
123
if ( AsnReadVal(aip, atp, &av) <= 0) {
126
ptr -> field_name = av.ptrvalue;
127
atp = AsnReadId(aip,amp, atp);
129
if (atp == FIELD_RULE_match_expression) {
130
if ( AsnReadVal(aip, atp, &av) <= 0) {
133
ptr -> match_expression = av.ptrvalue;
134
atp = AsnReadId(aip,amp, atp);
136
if (atp == FIELD_RULE_required) {
137
if ( AsnReadVal(aip, atp, &av) <= 0) {
140
ptr -> required = av.boolvalue;
141
atp = AsnReadId(aip,amp, atp);
144
if (AsnReadVal(aip, atp, &av) <= 0) {
150
AsnUnlinkType(orig); /* unlink local tree */
154
aip -> io_failure = TRUE;
155
ptr = FieldRuleFree(ptr);
161
/**************************************************
163
* FieldRuleAsnWrite()
165
**************************************************/
166
NLM_EXTERN Boolean LIBCALL
167
FieldRuleAsnWrite(FieldRulePtr ptr, AsnIoPtr aip, AsnTypePtr orig)
171
Boolean retval = FALSE;
175
if (! objvalidAsnLoad()) {
184
atp = AsnLinkType(orig, FIELD_RULE); /* link local tree */
189
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
190
if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
194
if (ptr -> field_name != NULL) {
195
av.ptrvalue = ptr -> field_name;
196
retval = AsnWrite(aip, FIELD_RULE_field_name, &av);
198
if (ptr -> match_expression != NULL) {
199
av.ptrvalue = ptr -> match_expression;
200
retval = AsnWrite(aip, FIELD_RULE_match_expression, &av);
202
av.boolvalue = ptr -> required;
203
retval = AsnWrite(aip, FIELD_RULE_required, &av);
204
if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
210
AsnUnlinkType(orig); /* unlink local tree */
216
/**************************************************
220
**************************************************/
223
FieldSetFree(FieldSetPtr ptr)
229
AsnGenericUserSeqOfFree(ptr, (AsnOptFreeFunc) FieldRuleFree);
234
/**************************************************
238
**************************************************/
241
FieldSetAsnRead(AsnIoPtr aip, AsnTypePtr orig)
245
Boolean isError = FALSE;
251
if (! objvalidAsnLoad()) {
260
if (orig == NULL) { /* FieldSet ::= (self contained) */
261
atp = AsnReadId(aip, amp, FIELD_SET);
263
atp = AsnLinkType(orig, FIELD_SET);
265
/* link in local tree */
272
ptr = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) FieldRuleAsnRead, (AsnOptFreeFunc) FieldRuleFree);
273
if (isError && ptr == NULL) {
280
AsnUnlinkType(orig); /* unlink local tree */
284
aip -> io_failure = TRUE;
285
ptr = FieldSetFree(ptr);
291
/**************************************************
295
**************************************************/
296
NLM_EXTERN Boolean LIBCALL
297
FieldSetAsnWrite(FieldSetPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
301
Boolean retval = FALSE;
305
if (! objvalidAsnLoad()) {
314
atp = AsnLinkType(orig, FIELD_SET); /* link local tree */
319
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
320
retval = AsnGenericUserSeqOfAsnWrite(ptr , (AsnWriteFunc) FieldRuleAsnWrite, aip, atp, FIELD_SET_E);
324
AsnUnlinkType(orig); /* unlink local tree */
330
/**************************************************
334
**************************************************/
336
CommentRulePtr LIBCALL
339
CommentRulePtr ptr = MemNew((size_t) sizeof(CommentRule));
347
/**************************************************
351
**************************************************/
353
CommentRulePtr LIBCALL
354
CommentRuleFree(CommentRulePtr ptr)
360
MemFree(ptr -> prefix);
361
FieldSetFree(ptr -> fields);
366
/**************************************************
368
* CommentRuleAsnRead()
370
**************************************************/
372
CommentRulePtr LIBCALL
373
CommentRuleAsnRead(AsnIoPtr aip, AsnTypePtr orig)
377
Boolean isError = FALSE;
383
if (! objvalidAsnLoad()) {
392
if (orig == NULL) { /* CommentRule ::= (self contained) */
393
atp = AsnReadId(aip, amp, COMMENT_RULE);
395
atp = AsnLinkType(orig, COMMENT_RULE);
397
/* link in local tree */
402
ptr = CommentRuleNew();
406
if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
410
atp = AsnReadId(aip,amp, atp);
413
if (atp == COMMENT_RULE_prefix) {
414
if ( AsnReadVal(aip, atp, &av) <= 0) {
417
ptr -> prefix = av.ptrvalue;
418
atp = AsnReadId(aip,amp, atp);
420
if (atp == COMMENT_RULE_updated) {
421
if ( AsnReadVal(aip, atp, &av) <= 0) {
424
ptr -> updated = av.boolvalue;
425
atp = AsnReadId(aip,amp, atp);
427
if (atp == COMMENT_RULE_fields) {
428
ptr -> fields = FieldSetAsnRead(aip, atp);
429
if (aip -> io_failure) {
432
atp = AsnReadId(aip,amp, atp);
435
if (AsnReadVal(aip, atp, &av) <= 0) {
441
AsnUnlinkType(orig); /* unlink local tree */
445
aip -> io_failure = TRUE;
446
ptr = CommentRuleFree(ptr);
452
/**************************************************
454
* CommentRuleAsnWrite()
456
**************************************************/
457
NLM_EXTERN Boolean LIBCALL
458
CommentRuleAsnWrite(CommentRulePtr ptr, AsnIoPtr aip, AsnTypePtr orig)
462
Boolean retval = FALSE;
466
if (! objvalidAsnLoad()) {
475
atp = AsnLinkType(orig, COMMENT_RULE); /* link local tree */
480
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
481
if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
485
if (ptr -> prefix != NULL) {
486
av.ptrvalue = ptr -> prefix;
487
retval = AsnWrite(aip, COMMENT_RULE_prefix, &av);
489
av.boolvalue = ptr -> updated;
490
retval = AsnWrite(aip, COMMENT_RULE_updated, &av);
491
if (ptr -> fields != NULL) {
492
if ( ! FieldSetAsnWrite(ptr -> fields, aip, COMMENT_RULE_fields)) {
496
if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
502
AsnUnlinkType(orig); /* unlink local tree */
508
/**************************************************
512
**************************************************/
514
CommentSetPtr LIBCALL
515
CommentSetFree(CommentSetPtr ptr)
521
AsnGenericUserSeqOfFree(ptr, (AsnOptFreeFunc) CommentRuleFree);
526
/**************************************************
528
* CommentSetAsnRead()
530
**************************************************/
532
CommentSetPtr LIBCALL
533
CommentSetAsnRead(AsnIoPtr aip, AsnTypePtr orig)
537
Boolean isError = FALSE;
543
if (! objvalidAsnLoad()) {
552
if (orig == NULL) { /* CommentSet ::= (self contained) */
553
atp = AsnReadId(aip, amp, COMMENT_SET);
555
atp = AsnLinkType(orig, COMMENT_SET);
557
/* link in local tree */
564
ptr = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) CommentRuleAsnRead, (AsnOptFreeFunc) CommentRuleFree);
565
if (isError && ptr == NULL) {
572
AsnUnlinkType(orig); /* unlink local tree */
576
aip -> io_failure = TRUE;
577
ptr = CommentSetFree(ptr);
583
/**************************************************
585
* CommentSetAsnWrite()
587
**************************************************/
588
NLM_EXTERN Boolean LIBCALL
589
CommentSetAsnWrite(CommentSetPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
593
Boolean retval = FALSE;
597
if (! objvalidAsnLoad()) {
606
atp = AsnLinkType(orig, COMMENT_SET); /* link local tree */
611
if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
612
retval = AsnGenericUserSeqOfAsnWrite(ptr , (AsnWriteFunc) CommentRuleAsnWrite, aip, atp, COMMENT_SET_E);
616
AsnUnlinkType(orig); /* unlink local tree */