This commit is contained in:
cvs
2000-04-10 14:33:07 +00:00
parent c70f0b7cb8
commit d4974b94e8
11 changed files with 236 additions and 164 deletions

View File

@@ -45,7 +45,7 @@ int DlogRead(DlogSet *dset, int idx, void *data) {
return(-1);
}
int DlogOpen(DlogSet *dset, char *name, int write) {
int DlogOpenOld(DlogSet *dset, char *name, int write) {
int i, p, np, fd, flags;
time_t tim;
struct tm *timp;
@@ -79,11 +79,22 @@ int DlogOpen(DlogSet *dset, char *name, int write) {
return(-1);
}
int DlogCreate(DlogSet *dset, char *name, time_t start, int nset, int nlen, int period, float undef) {
int fd, i, j, p;
int DlogOpen(DlogSet *dset, char *name) {
return(DlogOpenOld(dset, name, 0));
}
int DlogOpenWrt(DlogSet *dset, char *name, time_t start, int nset, int nlen, int period, float undef) {
int fd, i, j, p, iret;
va_list ap;
float f[DLOG_MAX_SET];
iret=DlogOpenOld(dset, name, 1);
if (iret>=0 && dset->nset==nset
&& dset->nlen==nlen
&& dset->last+nlen*period>start
&& dset->undef == undef) {
return(1); /* take old file only if it matches */
}
fd=0;
if (nset>DLOG_MAX_SET) ERR_MSG("nset too large");
dset->nset=nset;
@@ -208,7 +219,7 @@ int dlog_get_(char *name, int *nset, int *nmax, double *starttime, float x[], fl
int ntot;
/* for compaq unix */
str_trim(buf, name, namlen);
ERR_I(DlogOpen(&dset, buf, 0));
ERR_I(DlogOpen(&dset, buf));
ERR_I(ntot=DlogGetMany(&dset, *nset, *nmax, starttime, x, y, index));
DlogClose(&dset);
return(ntot);
@@ -228,7 +239,7 @@ int DlogUpd(DlogSet *dset) {
dset->pos=sizeof(int);
#ifdef __VMS
close(dset->fd);
DlogOpen(dset, dset->name, 1);
ERR_I(DlogOpenOld(dset, dset->name, 1));
#endif
return(0);
OnError: