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

Comparing trunk/xyz2pov/src/xyz2pov.c (file contents):
Revision 648 by gezelter, Thu Jul 17 18:07:36 2003 UTC vs.
Revision 649 by mmeineke, Thu Jul 24 15:50:41 2003 UTC

# Line 51 | Line 51 | int main(argc, argv)
51    double diagonal; /* the diagonal length of the sim box */
52  
53    unsigned int n_atoms; /*the number of atoms in each time step */
54 <  char read_buffer[120]; /*the line buffer for reading */
54 >  char read_buffer[2000]; /*the line buffer for reading */
55    char *eof_test; /*ptr to see when we reach the end of the file */
56    char *foo; /*the pointer to the current string token */
57    FILE *in_file; /* the input file */
# Line 271 | Line 271 | int main(argc, argv)
271      out_prefix = strtok(in_name, ".");
272    }
273  
274 <  sprintf( out_format, "%s%s%%0%dd.pov", pov_dir, out_prefix, nZeroes );
274 >  sprintf( out_format, "%s%s-%%0%dd.pov", pov_dir, out_prefix, nZeroes );
275  
276    // start reading the first frame
277  
# Line 303 | Line 303 | int main(argc, argv)
303      if( draw_box ){
304        foo = strtok(read_buffer, " ,;\t");
305        if(foo == NULL){
306 <        printf("error in reading file\n");
306 >        printf("error in reading file time\n");
307          exit(8);
308        }
309        
310        foo = strtok(NULL, " ,;\t");
311        if(foo == NULL){
312 <        printf("error in reading file\n");
312 >        printf("error in reading file h00\n");
313          exit(8);
314        }
315        current_frame->Hmat[0][0] = atof( foo );
316  
317        foo = strtok(NULL, " ,;\t");
318        if(foo == NULL){
319 <        printf("error in reading file\n");
319 >        printf("error in reading file h10\n");
320          exit(8);
321        }
322        current_frame->Hmat[1][0] = atof( foo );
323  
324        foo = strtok(NULL, " ,;\t");
325        if(foo == NULL){
326 <        printf("error in reading file\n");
326 >        printf("error in reading file h20\n");
327          exit(8);
328        }
329        current_frame->Hmat[2][0] = atof( foo );
330  
331        foo = strtok(NULL, " ,;\t");
332        if(foo == NULL){
333 <        printf("error in reading file\n");
333 >        printf("error in reading file h01\n");
334          exit(8);
335        }
336        current_frame->Hmat[0][1] = atof( foo );
337  
338        foo = strtok(NULL, " ,;\t");
339        if(foo == NULL){
340 <        printf("error in reading file\n");
340 >        printf("error in reading file h11\n");
341          exit(8);
342        }
343        current_frame->Hmat[1][1] = atof( foo );
344  
345        foo = strtok(NULL, " ,;\t");
346        if(foo == NULL){
347 <        printf("error in reading file\n");
347 >        printf("error in reading file h21\n");
348          exit(8);
349        }
350        current_frame->Hmat[2][1] = atof( foo );
351  
352        foo = strtok(NULL, " ,;\t");
353        if(foo == NULL){
354 <        printf("error in reading file\n");
354 >        printf("error in reading file h02\n");
355          exit(8);
356        }
357        current_frame->Hmat[0][2] = atof( foo );
358  
359        foo = strtok(NULL, " ,;\t");
360        if(foo == NULL){
361 <        printf("error in reading file\n");
361 >        printf("error in reading file h12\n");
362          exit(8);
363        }
364        current_frame->Hmat[1][2] = atof( foo );
365  
366        foo = strtok(NULL, " ,;\t");
367        if(foo == NULL){
368 <        printf("error in reading file\n");
368 >        printf("error in reading file h22\n");
369          exit(8);
370        }
371        current_frame->Hmat[2][2] = atof( foo );
# Line 376 | Line 376 | int main(argc, argv)
376        
377        eof_test = fgets(read_buffer, sizeof(read_buffer), in_file);
378        if(eof_test == NULL){
379 <        printf("error in reading file\n");
379 >        printf("error in reading file line at atom %d\n", i);
380          exit(8);
381        }
382  
383        foo = strtok(read_buffer, " ,;\t");
384        if(foo == NULL){
385 <        printf("error in reading file\n");
385 >        printf("error in reading atom %d name\n", i);
386          exit(8);
387        }
388        (void)strcpy(current_frame->r[i].name, foo); /*copy the atom name */
# Line 391 | Line 391 | int main(argc, argv)
391        
392        foo = strtok(NULL, " ,;\t");
393        if(foo == NULL){
394 <        printf("error in reading file\n");
394 >        printf("error in reading atom %d position x\n", i);
395          exit(8);
396        }
397        (void)sscanf(foo, "%lf",&current_frame->r[i].x);
# Line 401 | Line 401 | int main(argc, argv)
401    
402        foo = strtok(NULL, " ,;\t");
403        if(foo == NULL){
404 <        printf("error in reading file\n");
404 >        printf("error in reading atom %d position y\n", i);
405          exit(8);
406        }
407        (void)sscanf(foo, "%lf", &current_frame->r[i].y);
# Line 411 | Line 411 | int main(argc, argv)
411  
412        foo = strtok(NULL, " ,;\t");
413        if(foo == NULL){
414 <        printf("error in reading file\n");
414 >        printf("error in reading atom %d position z\n", i);
415          exit(8);
416        }
417        (void)sscanf(foo, "%lf", &current_frame->r[i].z);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines