ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/SHAPE.cpp
(Generate patch)

Comparing trunk/SHAPES/SHAPE.cpp (file contents):
Revision 1290 by gezelter, Wed Jun 23 20:53:17 2004 UTC vs.
Revision 1295 by gezelter, Thu Jun 24 15:31:52 2004 UTC

# Line 35 | Line 35 | void SHAPE::readSHAPEfile(const char *fname) {
35      printf("Could not open SHAPE file %s\n", fname);
36      exit(-1);
37    }
38 <  rewind(shapeFile);
39 <  lineNum = 0;
38 >  
39 >  findBegin( "ShapeInfo" );
40 >
41    eof_test = fgets( readLine, sizeof(readLine), shapeFile );
42 <  lineNum++;
42 <  if( eof_test == NULL ){
43 <    printf("Error in reading SHAPE from SHAPE file at line %d.\n",
44 <           lineNum );
45 <    exit(-1);
46 <  }
47 <  // first find the shape name:
42 >
43    while( eof_test != NULL ){
44      // toss comment lines
45      if( readLine[0] != '!' && readLine[0] != '#' ){
46 +      
47 +      foo = strtok(readLine, " ,;\t");
48 +      if (!strcasecmp(foo, "end")) break;
49  
50        nTokens = count_tokens(readLine, " ,;\t");
51        if (nTokens < 5) {
52 <        printf("Not enough data on information line in SHAPE file.\n");
52 >        printf("Not enough data on shapeInfo line in SHAPE file.\n");
53          exit(-1);
54        }
55  
# Line 68 | Line 66 | void SHAPE::readSHAPEfile(const char *fname) {
66        break;
67      }
68      eof_test = fgets( readLine, sizeof(readLine), shapeFile );
71    lineNum++;
69    }
70  
71    findBegin( "ContactFunctions" );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines