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
/
putautolock.c
< prev
next >
Wrap
C/C++ Source or Header
|
2003-12-09
|
2KB
|
48 lines
#include <stdio.h>
#include "autolock.h"
void putautolock(FILE **lop,struct autolockst autolock[])
{
int j;
/*
this subroutine writes structure data from
the structure pointed to by autolock to the output
file. the destination file was opened by the caller
via fopen and lop is the file structure returned from
that fopen
if this subroutine finds a record with a day number of 0,
then it writes that record out and returns immediately,
since there are data records after that. There is no
point writing out lots and lots of zeroes.
*/
for(j=0; j<NUMSTATES; j++)
{
fprintf(*lop,L5FMT,autolock[j].day);
if(autolock[j].day == 0)
autolock[j].fday =autolock[j].mode =autolock[j].x=
autolock[j].rms =autolock[j].rms_avg = autolock[j].nval =
autolock[j].y=
autolock[j].d =autolock[j].srv =autolock[j].flags=
autolock[j].waitn=
autolock[j].waitx =autolock[j].errx=autolock[j].ybar=
autolock[j].fcon=autolock[j].sumerr=0;
fprintf(*lop,L8FMT,autolock[j].fday);
fprintf(*lop," %2d", autolock[j].mode);
fprintf(*lop," % .3le",autolock[j].x);
fprintf(*lop," % .3e", autolock[j].rms);
fprintf(*lop," % .3e", autolock[j].rms_avg);
fprintf(*lop," %2d", autolock[j].nval);
fprintf(*lop," % .5le",autolock[j].y);
fprintf(*lop," % .5le",autolock[j].d);
fprintf(*lop," %4d", autolock[j].srv);
fprintf(*lop," %4d", autolock[j].flags);
fprintf(*lop," %5d", autolock[j].waitn);
fprintf(*lop," %5d", autolock[j].waitx);
fprintf(*lop," % .3le",autolock[j].errx);
fprintf(*lop," % .3le",autolock[j].ybar);
fprintf(*lop," %5d", autolock[j].fcon);
fprintf(*lop," % .3le",autolock[j].sumerr);
fprintf(*lop,"\n");
if(autolock[j].day == 0) break; /*that's all folks*/
}
}