1987-09-24 13:01:27 +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".
|
|
|
|
*
|
|
|
|
* Author: Ceriel J.H. Jacobs
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* L I B R A R Y */
|
|
|
|
|
1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1987-09-24 13:01:27 +00:00
|
|
|
|
|
|
|
#include <em_path.h>
|
1988-09-06 11:28:16 +00:00
|
|
|
#include <alloc.h>
|
|
|
|
#include "main.h"
|
1987-09-24 13:01:27 +00:00
|
|
|
|
1989-10-24 16:54:55 +00:00
|
|
|
#ifdef OTHER_HOME
|
|
|
|
#undef EM_DIR
|
|
|
|
#define EM_DIR OTHER_HOME
|
|
|
|
#endif
|
1987-09-24 13:01:27 +00:00
|
|
|
static char lib_dir[128] = EM_DIR;
|
|
|
|
|
1988-09-06 11:28:16 +00:00
|
|
|
static struct liblist {
|
|
|
|
int libno;
|
|
|
|
struct liblist *libnext;
|
|
|
|
} *lblist;
|
|
|
|
|
|
|
|
int
|
1987-09-24 13:01:27 +00:00
|
|
|
is_library_dir(d)
|
|
|
|
char *d;
|
|
|
|
{
|
|
|
|
/* Check if directory d is a directory containing
|
|
|
|
"system" definition modules. Return 1 if it is, 0 otherwise.
|
|
|
|
*/
|
|
|
|
|
1988-09-06 11:28:16 +00:00
|
|
|
register struct liblist *p = lblist;
|
|
|
|
|
|
|
|
while (p) {
|
|
|
|
if (! strcmp(DEFPATH[p->libno], d)) return 1;
|
|
|
|
p = p->libnext;
|
|
|
|
}
|
|
|
|
return 0;
|
1987-09-24 13:01:27 +00:00
|
|
|
}
|
|
|
|
|
1991-04-10 15:10:32 +00:00
|
|
|
#ifndef DEF_DIR
|
|
|
|
#define DEF_DIR "lib/m2"
|
|
|
|
#endif
|
|
|
|
|
1987-09-24 13:01:27 +00:00
|
|
|
init_lib()
|
|
|
|
{
|
|
|
|
extern char *strcat();
|
|
|
|
|
1989-10-24 16:54:55 +00:00
|
|
|
strcat(lib_dir, "/");
|
|
|
|
strcat(lib_dir, DEF_DIR);
|
1988-09-06 11:28:16 +00:00
|
|
|
AddLibDir(lib_dir);
|
|
|
|
}
|
|
|
|
|
|
|
|
set_libdir(n)
|
|
|
|
{
|
|
|
|
register struct liblist *p =
|
|
|
|
(struct liblist *) Malloc(sizeof(struct liblist));
|
|
|
|
|
|
|
|
p->libnext = lblist;
|
|
|
|
p->libno = n;
|
|
|
|
lblist = p;
|
1987-09-24 13:01:27 +00:00
|
|
|
}
|