|
|
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 a
Length: 1603 (0x643)
Types: TextFile
Names: »artio.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec1/rn/artio.c«
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
└─⟦97f3ac3f8⟧ »EurOpenD3/news/rn.tar.Z«
└─⟦df9cf1b54⟧
└─⟦this⟧ »artio.c«
/* $Header: artio.c,v 4.3 85/05/01 11:35:39 lwall Exp $
*
* $Log: artio.c,v $
* Revision 4.3 85/05/01 11:35:39 lwall
* Baseline for release with 4.3bsd.
*
*/
#include "EXTERN.h"
#include "common.h"
#include "INTERN.h"
#include "artio.h"
void
artio_init()
{
;
}
/* open an article, unless it's already open */
FILE *
artopen(artnum)
ART_NUM artnum;
{
char artname[8]; /* filename of current article */
if (artnum < 1)
return Nullfp;
if (openart == artnum) { /* this article is already open? */
fseek(artfp,0L,0); /* just get to the beginning */
return artfp; /* and say we succeeded */
}
if (artfp != Nullfp) { /* it was somebody else? */
fclose(artfp); /* put them out of their misery */
openart = 0; /* and remember them no more */
}
sprintf(artname,"%ld",(long)artnum);
/* produce the name of the article */
if (artfp = fopen(artname,"r")) /* if we can open it */
openart = artnum; /* remember what we did here */
#ifdef LINKART
{
char tmpbuf[256];
char *s;
if (fstat(artfp->_file,&filestat))
return artfp;
if (filestat.st_size < (sizeof tmpbuf)) {
fgets(tmpbuf,(sizeof tmpbuf),artfp);
if (*tmpbuf == '/') { /* is a "link" to another article */
fclose(artfp);
if (s=index(tmpbuf,'\n'))
*s = '\0';
if (!(artfp = fopen(tmpbuf,"r")))
openart = 0;
else {
if (*linkartname)
free(linkartname);
linkartname = savestr(tmpbuf);
}
}
else
fseek(artfp,0L,0); /* get back to the beginning */
}
}
#endif
return artfp; /* and return either fp or NULL */
}