~ubuntu-branches/ubuntu/edgy/ncbi-tools6/edgy

« back to all changes in this revision

Viewing changes to object/objinsdseq.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
/**************************************************
33
33
*    Generated object loaders for Module INSD-INSDSeq
34
 
*    Generated using ASNCODE Revision: 6.14 at Jun 1, 2004 11:01 AM
 
34
*    Generated using ASNCODE Revision: 6.14 at Dec 14, 2005  4:58 PM
35
35
*
36
36
**************************************************/
37
37
 
80
80
   MemFree(ptr -> accession_version);
81
81
   AsnGenericBaseSeqOfFree(ptr -> other_seqids ,ASNCODE_PTRVAL_SLOT);
82
82
   AsnGenericBaseSeqOfFree(ptr -> secondary_accessions ,ASNCODE_PTRVAL_SLOT);
 
83
   MemFree(ptr -> project);
83
84
   AsnGenericBaseSeqOfFree(ptr -> keywords ,ASNCODE_PTRVAL_SLOT);
84
85
   MemFree(ptr -> segment);
85
86
   MemFree(ptr -> source);
256
257
      }
257
258
      atp = AsnReadId(aip,amp, atp);
258
259
   }
 
260
   if (atp == INSDSEQ_project) {
 
261
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
262
         goto erret;
 
263
      }
 
264
      ptr -> project = av.ptrvalue;
 
265
      atp = AsnReadId(aip,amp, atp);
 
266
   }
259
267
   if (atp == INSDSEQ_keywords) {
260
268
      ptr -> keywords = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
261
269
      if (isError && ptr -> keywords == NULL) {
454
462
   }
455
463
   retval = AsnGenericBaseSeqOfAsnWrite(ptr -> other_seqids ,ASNCODE_PTRVAL_SLOT, aip, INSDSEQ_other_seqids, INSDSEQ_other_seqids_E);
456
464
   retval = AsnGenericBaseSeqOfAsnWrite(ptr -> secondary_accessions ,ASNCODE_PTRVAL_SLOT, aip, INSDSEQ_secondary_accessions, INSDSEQ_secondary_accessions_E);
 
465
   if (ptr -> project != NULL) {
 
466
      av.ptrvalue = ptr -> project;
 
467
      retval = AsnWrite(aip, INSDSEQ_project,  &av);
 
468
   }
457
469
   retval = AsnGenericBaseSeqOfAsnWrite(ptr -> keywords ,ASNCODE_PTRVAL_SLOT, aip, INSDSEQ_keywords, INSDSEQ_keywords_E);
458
470
   if (ptr -> segment != NULL) {
459
471
      av.ptrvalue = ptr -> segment;
539
551
      return NULL;
540
552
   }
541
553
   MemFree(ptr -> reference);
 
554
   MemFree(ptr -> position);
542
555
   AsnGenericBaseSeqOfFree(ptr -> authors ,ASNCODE_PTRVAL_SLOT);
543
556
   MemFree(ptr -> consortium);
544
557
   MemFree(ptr -> title);
545
558
   MemFree(ptr -> journal);
 
559
   AsnGenericUserSeqOfFree(ptr -> xref, (AsnOptFreeFunc) INSDXrefFree);
546
560
   MemFree(ptr -> remark);
547
561
   return MemFree(ptr);
548
562
}
602
616
      ptr -> reference = av.ptrvalue;
603
617
      atp = AsnReadId(aip,amp, atp);
604
618
   }
 
619
   if (atp == INSDREFERENCE_position) {
 
620
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
621
         goto erret;
 
622
      }
 
623
      ptr -> position = av.ptrvalue;
 
624
      atp = AsnReadId(aip,amp, atp);
 
625
   }
605
626
   if (atp == INSDREFERENCE_authors) {
606
627
      ptr -> authors = AsnGenericBaseSeqOfAsnRead(aip, amp, atp, ASNCODE_PTRVAL_SLOT, &isError);
607
628
      if (isError && ptr -> authors == NULL) {
630
651
      ptr -> journal = av.ptrvalue;
631
652
      atp = AsnReadId(aip,amp, atp);
632
653
   }
633
 
   if (atp == INSDREFERENCE_medline) {
634
 
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
654
   if (atp == INSDREFERENCE_xref) {
 
655
      ptr -> xref = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) INSDXrefAsnRead, (AsnOptFreeFunc) INSDXrefFree);
 
656
      if (isError && ptr -> xref == NULL) {
635
657
         goto erret;
636
658
      }
637
 
      ptr -> medline = av.intvalue;
638
 
      ptr -> OBbits__ |= 1<<0;
639
659
      atp = AsnReadId(aip,amp, atp);
640
660
   }
641
661
   if (atp == INSDREFERENCE_pubmed) {
643
663
         goto erret;
644
664
      }
645
665
      ptr -> pubmed = av.intvalue;
646
 
      ptr -> OBbits__ |= 1<<1;
 
666
      ptr -> OBbits__ |= 1<<0;
647
667
      atp = AsnReadId(aip,amp, atp);
648
668
   }
649
669
   if (atp == INSDREFERENCE_remark) {
708
728
      av.ptrvalue = ptr -> reference;
709
729
      retval = AsnWrite(aip, INSDREFERENCE_reference,  &av);
710
730
   }
 
731
   if (ptr -> position != NULL) {
 
732
      av.ptrvalue = ptr -> position;
 
733
      retval = AsnWrite(aip, INSDREFERENCE_position,  &av);
 
734
   }
711
735
   retval = AsnGenericBaseSeqOfAsnWrite(ptr -> authors ,ASNCODE_PTRVAL_SLOT, aip, INSDREFERENCE_authors, INSDREFERENCE_authors_E);
712
736
   if (ptr -> consortium != NULL) {
713
737
      av.ptrvalue = ptr -> consortium;
721
745
      av.ptrvalue = ptr -> journal;
722
746
      retval = AsnWrite(aip, INSDREFERENCE_journal,  &av);
723
747
   }
724
 
   if (ptr -> medline || (ptr -> OBbits__ & (1<<0) )){   av.intvalue = ptr -> medline;
725
 
      retval = AsnWrite(aip, INSDREFERENCE_medline,  &av);
726
 
   }
727
 
   if (ptr -> pubmed || (ptr -> OBbits__ & (1<<1) )){   av.intvalue = ptr -> pubmed;
 
748
   AsnGenericUserSeqOfAsnWrite(ptr -> xref, (AsnWriteFunc) INSDXrefAsnWrite, aip, INSDREFERENCE_xref, INSDREFERENCE_xref_E);
 
749
   if (ptr -> pubmed || (ptr -> OBbits__ & (1<<0) )){   av.intvalue = ptr -> pubmed;
728
750
      retval = AsnWrite(aip, INSDREFERENCE_pubmed,  &av);
729
751
   }
730
752
   if (ptr -> remark != NULL) {
775
797
   MemFree(ptr -> key);
776
798
   MemFree(ptr -> location);
777
799
   AsnGenericUserSeqOfFree(ptr -> intervals, (AsnOptFreeFunc) INSDIntervalFree);
 
800
   MemFree(ptr -> operator__);
778
801
   AsnGenericUserSeqOfFree(ptr -> quals, (AsnOptFreeFunc) INSDQualifierFree);
779
802
   return MemFree(ptr);
780
803
}
848
871
      }
849
872
      atp = AsnReadId(aip,amp, atp);
850
873
   }
 
874
   if (atp == INSDFEATURE_operator) {
 
875
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
876
         goto erret;
 
877
      }
 
878
      ptr -> operator__ = av.ptrvalue;
 
879
      atp = AsnReadId(aip,amp, atp);
 
880
   }
 
881
   if (atp == INSDFEATURE_partial5) {
 
882
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
883
         goto erret;
 
884
      }
 
885
      ptr -> partial5 = av.boolvalue;
 
886
      ptr -> OBbits__ |= 1<<0;
 
887
      atp = AsnReadId(aip,amp, atp);
 
888
   }
 
889
   if (atp == INSDFEATURE_partial3) {
 
890
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
891
         goto erret;
 
892
      }
 
893
      ptr -> partial3 = av.boolvalue;
 
894
      ptr -> OBbits__ |= 1<<1;
 
895
      atp = AsnReadId(aip,amp, atp);
 
896
   }
851
897
   if (atp == INSDFEATURE_quals) {
852
898
      ptr -> quals = AsnGenericUserSeqOfAsnRead(aip, amp, atp, &isError, (AsnReadFunc) INSDQualifierAsnRead, (AsnOptFreeFunc) INSDQualifierFree);
853
899
      if (isError && ptr -> quals == NULL) {
915
961
      retval = AsnWrite(aip, INSDFEATURE_location,  &av);
916
962
   }
917
963
   AsnGenericUserSeqOfAsnWrite(ptr -> intervals, (AsnWriteFunc) INSDIntervalAsnWrite, aip, INSDFEATURE_intervals, INSDFEATURE_intervals_E);
 
964
   if (ptr -> operator__ != NULL) {
 
965
      av.ptrvalue = ptr -> operator__;
 
966
      retval = AsnWrite(aip, INSDFEATURE_operator,  &av);
 
967
   }
 
968
   if (ptr -> partial5 || (ptr -> OBbits__ & (1<<0) )){   av.boolvalue = ptr -> partial5;
 
969
      retval = AsnWrite(aip, INSDFEATURE_partial5,  &av);
 
970
   }
 
971
   if (ptr -> partial3 || (ptr -> OBbits__ & (1<<1) )){   av.boolvalue = ptr -> partial3;
 
972
      retval = AsnWrite(aip, INSDFEATURE_partial3,  &av);
 
973
   }
918
974
   AsnGenericUserSeqOfAsnWrite(ptr -> quals, (AsnWriteFunc) INSDQualifierAsnWrite, aip, INSDFEATURE_quals, INSDFEATURE_quals_E);
919
975
   if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
920
976
      goto erret;
930
986
 
931
987
/**************************************************
932
988
*
 
989
*    INSDXrefNew()
 
990
*
 
991
**************************************************/
 
992
NLM_EXTERN 
 
993
INSDXrefPtr LIBCALL
 
994
INSDXrefNew(void)
 
995
{
 
996
   INSDXrefPtr ptr = MemNew((size_t) sizeof(INSDXref));
 
997
 
 
998
   return ptr;
 
999
 
 
1000
}
 
1001
 
 
1002
 
 
1003
/**************************************************
 
1004
*
 
1005
*    INSDXrefFree()
 
1006
*
 
1007
**************************************************/
 
1008
NLM_EXTERN 
 
1009
INSDXrefPtr LIBCALL
 
1010
INSDXrefFree(INSDXrefPtr ptr)
 
1011
{
 
1012
 
 
1013
   if(ptr == NULL) {
 
1014
      return NULL;
 
1015
   }
 
1016
   MemFree(ptr -> dbname);
 
1017
   MemFree(ptr -> id);
 
1018
   return MemFree(ptr);
 
1019
}
 
1020
 
 
1021
 
 
1022
/**************************************************
 
1023
*
 
1024
*    INSDXrefAsnRead()
 
1025
*
 
1026
**************************************************/
 
1027
NLM_EXTERN 
 
1028
INSDXrefPtr LIBCALL
 
1029
INSDXrefAsnRead(AsnIoPtr aip, AsnTypePtr orig)
 
1030
{
 
1031
   DataVal av;
 
1032
   AsnTypePtr atp;
 
1033
   Boolean isError = FALSE;
 
1034
   AsnReadFunc func;
 
1035
   INSDXrefPtr ptr;
 
1036
 
 
1037
   if (! loaded)
 
1038
   {
 
1039
      if (! objinsdseqAsnLoad()) {
 
1040
         return NULL;
 
1041
      }
 
1042
   }
 
1043
 
 
1044
   if (aip == NULL) {
 
1045
      return NULL;
 
1046
   }
 
1047
 
 
1048
   if (orig == NULL) {         /* INSDXref ::= (self contained) */
 
1049
      atp = AsnReadId(aip, amp, INSDXREF);
 
1050
   } else {
 
1051
      atp = AsnLinkType(orig, INSDXREF);
 
1052
   }
 
1053
   /* link in local tree */
 
1054
   if (atp == NULL) {
 
1055
      return NULL;
 
1056
   }
 
1057
 
 
1058
   ptr = INSDXrefNew();
 
1059
   if (ptr == NULL) {
 
1060
      goto erret;
 
1061
   }
 
1062
   if (AsnReadVal(aip, atp, &av) <= 0) { /* read the start struct */
 
1063
      goto erret;
 
1064
   }
 
1065
 
 
1066
   atp = AsnReadId(aip,amp, atp);
 
1067
   func = NULL;
 
1068
 
 
1069
   if (atp == INSDXREF_dbname) {
 
1070
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
1071
         goto erret;
 
1072
      }
 
1073
      ptr -> dbname = av.ptrvalue;
 
1074
      atp = AsnReadId(aip,amp, atp);
 
1075
   }
 
1076
   if (atp == INSDXREF_id) {
 
1077
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
1078
         goto erret;
 
1079
      }
 
1080
      ptr -> id = av.ptrvalue;
 
1081
      atp = AsnReadId(aip,amp, atp);
 
1082
   }
 
1083
 
 
1084
   if (AsnReadVal(aip, atp, &av) <= 0) {
 
1085
      goto erret;
 
1086
   }
 
1087
   /* end struct */
 
1088
 
 
1089
ret:
 
1090
   AsnUnlinkType(orig);       /* unlink local tree */
 
1091
   return ptr;
 
1092
 
 
1093
erret:
 
1094
   aip -> io_failure = TRUE;
 
1095
   ptr = INSDXrefFree(ptr);
 
1096
   goto ret;
 
1097
}
 
1098
 
 
1099
 
 
1100
 
 
1101
/**************************************************
 
1102
*
 
1103
*    INSDXrefAsnWrite()
 
1104
*
 
1105
**************************************************/
 
1106
NLM_EXTERN Boolean LIBCALL 
 
1107
INSDXrefAsnWrite(INSDXrefPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
 
1108
{
 
1109
   DataVal av;
 
1110
   AsnTypePtr atp;
 
1111
   Boolean retval = FALSE;
 
1112
 
 
1113
   if (! loaded)
 
1114
   {
 
1115
      if (! objinsdseqAsnLoad()) {
 
1116
         return FALSE;
 
1117
      }
 
1118
   }
 
1119
 
 
1120
   if (aip == NULL) {
 
1121
      return FALSE;
 
1122
   }
 
1123
 
 
1124
   atp = AsnLinkType(orig, INSDXREF);   /* link local tree */
 
1125
   if (atp == NULL) {
 
1126
      return FALSE;
 
1127
   }
 
1128
 
 
1129
   if (ptr == NULL) { AsnNullValueMsg(aip, atp); goto erret; }
 
1130
   if (! AsnOpenStruct(aip, atp, (Pointer) ptr)) {
 
1131
      goto erret;
 
1132
   }
 
1133
 
 
1134
   if (ptr -> dbname != NULL) {
 
1135
      av.ptrvalue = ptr -> dbname;
 
1136
      retval = AsnWrite(aip, INSDXREF_dbname,  &av);
 
1137
   }
 
1138
   if (ptr -> id != NULL) {
 
1139
      av.ptrvalue = ptr -> id;
 
1140
      retval = AsnWrite(aip, INSDXREF_id,  &av);
 
1141
   }
 
1142
   if (! AsnCloseStruct(aip, atp, (Pointer)ptr)) {
 
1143
      goto erret;
 
1144
   }
 
1145
   retval = TRUE;
 
1146
 
 
1147
erret:
 
1148
   AsnUnlinkType(orig);       /* unlink local tree */
 
1149
   return retval;
 
1150
}
 
1151
 
 
1152
 
 
1153
 
 
1154
/**************************************************
 
1155
*
933
1156
*    INSDIntervalNew()
934
1157
*
935
1158
**************************************************/
1033
1256
      ptr -> OBbits__ |= 1<<2;
1034
1257
      atp = AsnReadId(aip,amp, atp);
1035
1258
   }
 
1259
   if (atp == INSDINTERVAL_iscomp) {
 
1260
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
1261
         goto erret;
 
1262
      }
 
1263
      ptr -> iscomp = av.boolvalue;
 
1264
      ptr -> OBbits__ |= 1<<3;
 
1265
      atp = AsnReadId(aip,amp, atp);
 
1266
   }
 
1267
   if (atp == INSDINTERVAL_interbp) {
 
1268
      if ( AsnReadVal(aip, atp, &av) <= 0) {
 
1269
         goto erret;
 
1270
      }
 
1271
      ptr -> interbp = av.boolvalue;
 
1272
      ptr -> OBbits__ |= 1<<4;
 
1273
      atp = AsnReadId(aip,amp, atp);
 
1274
   }
1036
1275
   if (atp == INSDINTERVAL_accession) {
1037
1276
      if ( AsnReadVal(aip, atp, &av) <= 0) {
1038
1277
         goto erret;
1100
1339
   if (ptr -> point || (ptr -> OBbits__ & (1<<2) )){   av.intvalue = ptr -> point;
1101
1340
      retval = AsnWrite(aip, INSDINTERVAL_point,  &av);
1102
1341
   }
 
1342
   if (ptr -> iscomp || (ptr -> OBbits__ & (1<<3) )){   av.boolvalue = ptr -> iscomp;
 
1343
      retval = AsnWrite(aip, INSDINTERVAL_iscomp,  &av);
 
1344
   }
 
1345
   if (ptr -> interbp || (ptr -> OBbits__ & (1<<4) )){   av.boolvalue = ptr -> interbp;
 
1346
      retval = AsnWrite(aip, INSDINTERVAL_interbp,  &av);
 
1347
   }
1103
1348
   if (ptr -> accession != NULL) {
1104
1349
      av.ptrvalue = ptr -> accession;
1105
1350
      retval = AsnWrite(aip, INSDINTERVAL_accession,  &av);
1310
1555
INSDSetPtr LIBCALL
1311
1556
INSDSetAsnRead(AsnIoPtr aip, AsnTypePtr orig)
1312
1557
{
 
1558
   DataVal av;
1313
1559
   AsnTypePtr atp;
1314
1560
   Boolean isError = FALSE;
1315
1561
   AsnReadFunc func;
1365
1611
NLM_EXTERN Boolean LIBCALL 
1366
1612
INSDSetAsnWrite(INSDSetPtr ptr, AsnIoPtr aip, AsnTypePtr orig)
1367
1613
{
 
1614
   DataVal av;
1368
1615
   AsnTypePtr atp;
1369
1616
   Boolean retval = FALSE;
1370
1617