ack/lang/basic/src/initialize.c

50 lines
1.1 KiB
C
Raw Normal View History

1988-07-04 11:45:41 +00:00
/*
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*/
#include "bem.h"
#ifndef NORSCID
1994-06-24 11:31:16 +00:00
static char rcs_id[] = "$Id$";
1988-07-04 11:45:41 +00:00
#endif
/* generate temporary files etc */
File *datfile;
initialize()
{
register char *cindex, *cptr;
int result1, result2;
1988-07-04 11:45:41 +00:00
/* Find the basename */
/* Strip leading directories */
cindex= (char *)0;
for ( cptr=program; *cptr; cptr++ ) if ( *cptr=='/' ) cindex=cptr;
if ( !cindex ) cindex= program;
else {
cindex++;
if ( !*cindex ) {
warning("Null program name, assuming \"basic\"");
cindex= "basic";
}
}
cptr=datfname;
while ( *cptr++ = *cindex++ );
/* Strip trailing suffix */
if ( cptr>datfname+3 && cptr[-3]=='.' ) cptr[-3]=0;
strcat(datfname,".d");
C_init((arith)BEMINTSIZE, (arith)BEMPTRSIZE);
result1 = sys_open(inpfile, OP_READ, &yyin);
result2 = C_open(outfile);
1988-07-06 18:18:46 +00:00
if ( result1==0 || result2== 0 )
1988-07-04 11:45:41 +00:00
fatal("Improper file permissions");
1988-07-05 18:27:10 +00:00
C_magic();
1988-07-04 11:45:41 +00:00
fillkex(); /* initialize symbol table */
C_ms_emx((arith)BEMINTSIZE,(arith)BEMPTRSIZE);
initdeftype(); /* set default symbol declarers */
}