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 >
Wrap
C/C++ Source or Header
|
1996-11-18
|
829b
|
32 lines
#include <stdio.h>
#include "lock.h"
void getlock(lop,lock)
FILE **lop; /*file was opened in caller */
struct lockst *lock;
{
/*
this subroutine reads structure data into
the structure pointed to by lock. the file
that is read was opened by the caller via fopen
and lop is the file structure returned from that
fopen
*/
if(fscanf(*lop,LFMT,&lock->day) == EOF)
{
lock->day=0;
return;
}
fscanf(*lop,LFMT,&lock->fday);
fscanf(*lop," %d", &lock->mode);
fscanf(*lop," %le",&lock->x);
fscanf(*lop," %le",&lock->y);
fscanf(*lop," %le",&lock->d);
fscanf(*lop," %d",&lock->flags);
fscanf(*lop," %d",&lock->waitn);
fscanf(*lop," %d",&lock->waitx);
fscanf(*lop," %le",&lock->errx);
fscanf(*lop," %le",&lock->ybar);
fscanf(*lop," %le",&lock->sumerr);
while(fgetc(*lop) != '\n') ; /*skip to end of line*/
}