~ubuntu-branches/ubuntu/dapper/ncbi-tools6/dapper

« back to all changes in this revision

Viewing changes to api/gbparint.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2004-11-01 20:07:56 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20041101200756-74jnpgwky59fev9v
Tags: 6.1.20041020-1
* New upstream release; debian/* resynched as necessary.
  - Fixes Vibrant invisible text bug!
* Take advantage of menu 2.1.8's support for multiple required packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
* Author:  Karl Sirotkin
29
29
*
30
30
* $Log: gbparint.c,v $
 
31
* Revision 6.8  2004/07/22 16:08:35  bazhin
 
32
* Changes to parse gaps of unknown lengths (like "gap(unk100)")
 
33
* within location strings.
 
34
*
31
35
* Revision 6.7  2004/03/03 17:32:19  kans
32
36
* Nlm_gbparselex checks against NULL input
33
37
*
98
102
#define TAKE_FIRST 1
99
103
#define TAKE_SECOND 2
100
104
 
101
 
void Nlm_gbgap PROTO((ValNodePtr PNTR currentPt, ValNodePtr PNTR retval));
 
105
void Nlm_gbgap PROTO((ValNodePtr PNTR currentPt, ValNodePtr PNTR retval,
 
106
                      Boolean unknown));
102
107
 
103
108
/*--------- do_Nlm_gbparse_error () ---------------*/
104
109
 
690
695
 
691
696
/* Interval, occurs on recursion */
692
697
                        case GBPARSE_INT_GAP:
693
 
                                Nlm_gbgap(currentPt, &retval);
 
698
                                Nlm_gbgap(currentPt, &retval, FALSE);
 
699
                                break;
 
700
                        case GBPARSE_INT_UNK_GAP:
 
701
                                Nlm_gbgap(currentPt, &retval, TRUE);
694
702
                                break;
695
703
                        case  GBPARSE_INT_ACCESION :
696
704
                        case  GBPARSE_INT_CARET : case  GBPARSE_INT_GT :
921
929
 
922
930
/* Interval, occurs on recursion */
923
931
                        case GBPARSE_INT_GAP:
924
 
                                Nlm_gbgap(currentPt, &retval);
 
932
                                Nlm_gbgap(currentPt, &retval, FALSE);
 
933
                                break;
 
934
                        case GBPARSE_INT_UNK_GAP:
 
935
                                Nlm_gbgap(currentPt, &retval, TRUE);
925
936
                                break;
926
937
                        case  GBPARSE_INT_ACCESION :
927
938
                        case  GBPARSE_INT_CARET : case  GBPARSE_INT_GT :
1063
1074
}
1064
1075
 
1065
1076
/**********************************************************/
1066
 
void Nlm_gbgap(ValNodePtr PNTR currentPt, ValNodePtr PNTR retval)
 
1077
void Nlm_gbgap(ValNodePtr PNTR currentPt, ValNodePtr PNTR retval,
 
1078
               Boolean unknown)
1067
1079
{
1068
1080
    ValNodePtr vnp_first;
1069
1081
    ValNodePtr vnp_second;
1090
1102
        if(vnp_third == NULL || vnp_third->choice != GBPARSE_INT_RIGHT)
1091
1103
            return;
1092
1104
 
1093
 
        vvv = GapToSeqLoc(atoi((CharPtr) vnp_second->data.ptrvalue));
 
1105
        vvv = GapToSeqLocEx(atoi((CharPtr) vnp_second->data.ptrvalue), unknown);
1094
1106
        if(vvv == NULL)
1095
1107
            return;
1096
1108
 
2033
2045
                                    current_col[3] == '\0'))
2034
2046
                                {
2035
2047
                                    current_token->choice = GBPARSE_INT_GAP;
2036
 
                                    current_col += 2;
2037
2048
                                    current_token->data.ptrvalue = MemNew(4);
2038
2049
                                    StringCpy(current_token->data.ptrvalue, "gap");
 
2050
                                    if(StringNICmp(current_col + 3, "(unk", 4) == 0)
 
2051
                                    {
 
2052
                                        current_token->choice = GBPARSE_INT_UNK_GAP;
 
2053
                                        last_token = current_token;
 
2054
                                        current_token = ValNodeNew(current_token);
 
2055
                                        current_token->choice = GBPARSE_INT_LEFT;
 
2056
                                        current_col += 4;
 
2057
                                    }
 
2058
                                    current_col += 2;
2039
2059
                                    break;
2040
2060
                                }
2041
2061
                                if(StringNCmp(current_col, "gi|", 3) == 0) {
2411
2431
                                    current_col[3] == '\0'))
2412
2432
                                {
2413
2433
                                    current_token->choice = GBPARSE_INT_GAP;
2414
 
                                    current_col += 2;
2415
2434
                                    current_token->data.ptrvalue = MemNew(4);
2416
2435
                                    StringCpy(current_token->data.ptrvalue, "gap");
 
2436
                                    if(StringNICmp(current_col + 3, "(unk", 4) == 0)
 
2437
                                    {
 
2438
                                        current_token->choice = GBPARSE_INT_UNK_GAP;
 
2439
                                        last_token = current_token;
 
2440
                                        current_token = ValNodeNew(current_token);
 
2441
                                        current_token->choice = GBPARSE_INT_LEFT;
 
2442
                                        current_col += 4;
 
2443
                                    }
 
2444
                                    current_col += 2;
2417
2445
                                    break;
2418
2446
                                }
2419
2447
                                if(StringNCmp(current_col, "gi|", 3) == 0) {