|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T b
Length: 2062 (0x80e)
Types: TextFile
Names: »backpage.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec1/rn/backpage.c«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
└─⟦97f3ac3f8⟧ »EurOpenD3/news/rn.tar.Z«
└─⟦df9cf1b54⟧
└─⟦this⟧ »backpage.c«
/* $Header: backpage.c,v 4.3 85/05/01 11:36:03 lwall Exp $
*
* $Log: backpage.c,v $
* Revision 4.3 85/05/01 11:36:03 lwall
* Baseline for release with 4.3bsd.
*
*/
#include "EXTERN.h"
#include "common.h"
#include "intrp.h"
#include "final.h"
#include "INTERN.h"
#include "backpage.h"
ART_LINE maxindx = -1;
long lseek();
void
backpage_init()
{
char *varyname;
varyname = filexp(VARYNAME);
close(creat(varyname,0600));
varyfd = open(varyname,2);
UNLINK(varyname);
if (varyfd < 0) {
printf(cantopen,varyname) FLUSH;
sig_catcher(0);
}
}
/* virtual array read */
ART_POS
vrdary(indx)
ART_LINE indx;
{
int subindx;
long offset;
#ifdef DEBUGGING
if (indx > maxindx) {
printf("vrdary(%ld) > %ld\n",(long)indx, (long)maxindx) FLUSH;
return 0;
}
#endif
if (indx < 0)
return 0;
subindx = indx % VARYSIZE;
offset = (indx - subindx) * sizeof(varybuf[0]);
if (offset != oldoffset) {
if (oldoffset >= 0) {
#ifndef lint
(void)lseek(varyfd,oldoffset,0);
write(varyfd, (char *)varybuf,sizeof(varybuf));
#endif lint
}
#ifndef lint
(void)lseek(varyfd,offset,0);
read(varyfd,(char *)varybuf,sizeof(varybuf));
#endif lint
oldoffset = offset;
}
return varybuf[subindx];
}
/* write to virtual array */
void
vwtary(indx,newvalue)
ART_LINE indx;
ART_POS newvalue;
{
int subindx;
long offset;
#ifdef DEBUGGING
if (indx < 0)
printf("vwtary(%ld)\n",(long)indx) FLUSH;
if (!indx)
maxindx = 0;
if (indx > maxindx) {
if (indx != maxindx + 1)
printf("indx skipped %d-%d\n",maxindx+1,indx-1) FLUSH;
maxindx = indx;
}
#endif
subindx = indx % VARYSIZE;
offset = (indx - subindx) * sizeof(varybuf[0]);
if (offset != oldoffset) {
if (oldoffset >= 0) {
#ifndef lint
(void)lseek(varyfd,oldoffset,0);
write(varyfd,(char *)varybuf,sizeof(varybuf));
#endif lint
}
#ifndef lint
(void)lseek(varyfd,offset,0);
read(varyfd,(char *)varybuf,sizeof(varybuf));
#endif lint
oldoffset = offset;
}
varybuf[subindx] = newvalue;
}