1989-02-07 11:04:05 +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".
|
|
|
|
*/
|
|
|
|
/* $Header$ */
|
|
|
|
|
|
|
|
#include "inputtype.h"
|
|
|
|
#include "file_info.h"
|
|
|
|
#include "input.h"
|
|
|
|
|
|
|
|
#define INP_PUSHBACK 3
|
|
|
|
#define INP_TYPE struct file_info
|
|
|
|
#define INP_VAR finfo
|
|
|
|
struct file_info finfo;
|
|
|
|
extern int nestlevel;
|
|
|
|
#include "nopp.h"
|
|
|
|
#include <inp_pkg.body>
|
|
|
|
|
|
|
|
#ifndef NOPP
|
|
|
|
char *
|
|
|
|
getwdir(fn)
|
|
|
|
register char *fn;
|
|
|
|
{
|
|
|
|
register char *p;
|
|
|
|
char *strrindex();
|
|
|
|
|
|
|
|
p = strrindex(fn, '/');
|
|
|
|
while (p && *(p + 1) == '\0') { /* remove trailing /'s */
|
|
|
|
*p = '\0';
|
|
|
|
p = strrindex(fn, '/');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fn[0] == '\0' || (fn[0] == '/' && p == &fn[0])) /* absolute path */
|
|
|
|
return "";
|
|
|
|
if (p) {
|
|
|
|
*p = '\0';
|
1989-09-19 16:13:23 +00:00
|
|
|
fn = Salloc(fn,(unsigned) (p - &fn[0] + 1));
|
1989-02-07 11:04:05 +00:00
|
|
|
*p = '/';
|
|
|
|
return fn;
|
|
|
|
}
|
1989-02-16 11:46:39 +00:00
|
|
|
return "";
|
1989-02-07 11:04:05 +00:00
|
|
|
}
|
1989-10-12 14:22:35 +00:00
|
|
|
|
|
|
|
int InputLevel;
|
1989-02-07 11:04:05 +00:00
|
|
|
#endif NOPP
|
|
|
|
|
|
|
|
int NoUnstack;
|
|
|
|
|
|
|
|
AtEoIT()
|
|
|
|
{
|
1989-10-12 14:22:35 +00:00
|
|
|
#ifndef NOPP
|
1989-09-19 16:13:23 +00:00
|
|
|
InputLevel--;
|
1989-02-07 11:04:05 +00:00
|
|
|
unstackrepl();
|
1989-10-12 14:22:35 +00:00
|
|
|
#endif NOPP
|
1989-02-07 11:04:05 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1989-10-12 14:22:35 +00:00
|
|
|
|
1989-02-07 11:04:05 +00:00
|
|
|
AtEoIF()
|
|
|
|
{
|
|
|
|
#ifndef NOPP
|
|
|
|
if (nestlevel != nestlow) lexwarning("missing #endif");
|
|
|
|
else
|
|
|
|
#endif NOPP
|
|
|
|
if (NoUnstack) lexerror("unexpected EOF");
|
|
|
|
#ifndef NOPP
|
|
|
|
nestlevel = nestlow;
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|