home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / autolock / getautolock.c < prev    next >
C/C++ Source or Header  |  2003-12-09  |  1KB  |  37 lines

  1. #include <stdio.h>
  2. void getautolock(lop,autolock)
  3. FILE **lop;        /*file was opened in caller */
  4. struct autolockst *autolock;
  5. {
  6. #include "autolock.h"
  7. /*
  8.     this subroutine reads structure data into 
  9.     the structure pointed to by autolock.  the file
  10.     that is read was opened by the caller via fopen
  11.     and lop is the file structure returned from that
  12.     fopen
  13. */
  14.     if(fscanf(*lop,LFMT,&autolock->day) == EOF)
  15.        {
  16.        autolock->day=0;
  17.        return;
  18.     }
  19.     fscanf(*lop,LFMT,&autolock->fday);
  20.     fscanf(*lop," %d", &autolock->mode);
  21.     fscanf(*lop," %le",&autolock->x);
  22.     fscanf(*lop," %e",&autolock->rms);
  23.     fscanf(*lop," %e",&autolock->rms_avg);
  24.     fscanf(*lop," %d",&autolock->nval);
  25.     fscanf(*lop," %le",&autolock->y);
  26.     fscanf(*lop," %le",&autolock->d);
  27.     fscanf(*lop," %d",&autolock->srv);
  28.     fscanf(*lop," %d",&autolock->flags);
  29.     fscanf(*lop," %d",&autolock->waitn);
  30.     fscanf(*lop," %d",&autolock->waitx);
  31.     fscanf(*lop," %le",&autolock->errx);
  32.     fscanf(*lop," %le",&autolock->ybar);
  33.     fscanf(*lop," %d", &autolock->fcon);
  34.     fscanf(*lop," %le",&autolock->sumerr);
  35.     while(fgetc(*lop) != '\n') ;    /*skip to end of line*/
  36. }
  37.