DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T i

⟦db3f149f5⟧ TextFile

    Length: 1019 (0x3fb)
    Types: TextFile
    Names: »include.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec1/graph/include.c« 

TextFile

/*
 * Copyright (C) 1986   Alan Kent
 *
 * Permission is granted to freely distribute part or
 * all of this code as long as it is not for profit
 * and this message is retained in the code.
 *
 * No resposibility is taken for any damage or incorect
 * results this program generates.
 * 
 */


#include <stdio.h>


/* This is possibly a bit dangerous as i am not sure how yacc will take */
/* to being called recursively */


extern FILE *yyin;
extern int linenum;
extern char *infilename;


include ( filename )
char *filename;
{
    FILE *old_fp , *fp;
    int old_linenum;
    char *old_filename;

    if ( filename == NULL )
	return;
    if ( ( fp = fopen ( filename , "r" ) ) == NULL )
	abort ( "failed to open include file '%s'" , filename );
    old_fp = yyin;
    old_filename = infilename;
    old_linenum = linenum;
    yyin = fp;
    infilename = filename;
    linenum = 1;
    yyparse ();
    fclose ( yyin );
    yyin = old_fp;
    infilename = old_filename;
    linenum = old_linenum;
    yyparse ();
}