1987-03-10 11:49:39 +00:00
|
|
|
/* $Header$ */
|
1987-03-09 19:15: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".
|
|
|
|
*/
|
1987-01-06 15:16:53 +00:00
|
|
|
#include "file_info.h"
|
|
|
|
#include "input.h"
|
|
|
|
#define INP_TYPE struct file_info
|
|
|
|
#define INP_VAR finfo
|
|
|
|
struct file_info finfo;
|
|
|
|
#include <inp_pkg.body>
|
|
|
|
|
|
|
|
char *
|
|
|
|
getwdir(fn)
|
|
|
|
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 "";
|
|
|
|
else
|
|
|
|
if (p) {
|
|
|
|
*p = '\0';
|
|
|
|
fn = Salloc(fn, p - &fn[0] + 1);
|
|
|
|
*p = '/';
|
|
|
|
return fn;
|
|
|
|
}
|
|
|
|
else return ".";
|
|
|
|
}
|
|
|
|
|
|
|
|
int NoUnstack;
|
|
|
|
int Unstacked;
|
|
|
|
|
|
|
|
AtEoIT()
|
|
|
|
{
|
1987-08-07 19:54:45 +00:00
|
|
|
if (NoUnstack) warning("unexpected EOF");
|
1987-01-06 15:16:53 +00:00
|
|
|
DoUnstack();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
AtEoIF()
|
|
|
|
{
|
1987-08-07 19:54:45 +00:00
|
|
|
|
|
|
|
if (nestlevel != -1) warning("missing #endif");
|
|
|
|
else if (NoUnstack) warning("unexpected EOF");
|
1987-01-06 15:16:53 +00:00
|
|
|
return 0;
|
|
|
|
}
|