ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/tcProps/readWrite.c
(Generate patch)

Comparing trunk/tcProps/readWrite.c (file contents):
Revision 1052 by mmeineke, Fri Feb 13 22:13:06 2004 UTC vs.
Revision 1053 by mmeineke, Sat Feb 14 02:48:52 2004 UTC

# Line 11 | Line 11 | int isScanned;
11   #include "readWrite.h"
12  
13  
14 + #define BUFFER_SIZE 2000
15   int isScanned;
16   FILE* inFile;
17  
# Line 44 | Line 45 | int setFrames( char* inFile ){
45    struct linkedPos* headPos;
46    struct linkedPos* currPos;
47    fpos_t *currPT;
48 +  char readBuffer[BUFFER_SIZE];
49 +  char* foo;
50 +  int lineNum = 0;
51 +  
52 +  
53  
48
54    inFile = fopen(inName);
55    if(inFile ==NULL){
56      fprintf(stderr,
# Line 55 | Line 60 | int setFrames( char* inFile ){
60    }
61  
62    
63 <  headPos = (struct linkedPos*)malloc(
63 >  headPos = (struct linkedPos*)malloc(sizeof(struct linkedPos));
64    while( !feof( inFile ) ){
65  
66 <    currPT
67 <  
66 >    currPT = (fpos_t *)malloc(sizeof(fpos_t));
67 >    fgetpos(inFile, currPT);
68 >    
69 >    fgets( readBuffer, sizeof( readBuffer ), inFile );
70 >    lineNum++;
71 >    if( feof( inFile ) ){
72 >      fprintf( stderr,
73 >               "File \"%s\" ended unexpectedly at line %d\n",
74 >               inName,
75 >               lineNum );
76 >      exit(0);
77 >    }
78 >    
79 >    i = atoi(readBuffer);
80 >    
81 >    
82 >  }
83  
64
84    isScanned = 1;
85    return nFrames;
86   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines