home *** CD-ROM | disk | FTP | other *** search
/ nisttime.carsoncity.k12.mi.us / nisttime.carsoncity.k12.mi.us.tar / nisttime.carsoncity.k12.mi.us / pub / lockclock / getlock.c < prev    next >
C/C++ Source or Header  |  1996-11-18  |  829b  |  32 lines

  1. #include <stdio.h>
  2. #include "lock.h"
  3. void getlock(lop,lock)
  4. FILE **lop;        /*file was opened in caller */
  5. struct lockst *lock;
  6. {
  7. /*
  8.     this subroutine reads structure data into 
  9.     the structure pointed to by lock.  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,&lock->day) == EOF)
  15.        {
  16.        lock->day=0;
  17.         return;
  18.     }
  19.     fscanf(*lop,LFMT,&lock->fday);
  20.     fscanf(*lop," %d", &lock->mode);
  21.     fscanf(*lop," %le",&lock->x);
  22.     fscanf(*lop," %le",&lock->y);
  23.     fscanf(*lop," %le",&lock->d);
  24.     fscanf(*lop," %d",&lock->flags);
  25.     fscanf(*lop," %d",&lock->waitn);
  26.     fscanf(*lop," %d",&lock->waitx);
  27.     fscanf(*lop," %le",&lock->errx);
  28.     fscanf(*lop," %le",&lock->ybar);
  29.     fscanf(*lop," %le",&lock->sumerr);
  30.     while(fgetc(*lop) != '\n') ;    /*skip to end of line*/
  31. }
  32.