lib.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. *
  5. * Author: Ceriel J.H. Jacobs
  6. */
  7. /* L I B R A R Y */
  8. /* $Id$ */
  9. #include <em_path.h>
  10. #include <alloc.h>
  11. #include "main.h"
  12. #ifdef OTHER_HOME
  13. #undef EM_DIR
  14. #define EM_DIR OTHER_HOME
  15. #endif
  16. static char lib_dir[128] = EM_DIR;
  17. static struct liblist {
  18. int libno;
  19. struct liblist *libnext;
  20. } *lblist;
  21. int
  22. is_library_dir(d)
  23. char *d;
  24. {
  25. /* Check if directory d is a directory containing
  26. "system" definition modules. Return 1 if it is, 0 otherwise.
  27. */
  28. register struct liblist *p = lblist;
  29. while (p) {
  30. if (! strcmp(DEFPATH[p->libno], d)) return 1;
  31. p = p->libnext;
  32. }
  33. return 0;
  34. }
  35. #ifndef DEF_DIR
  36. #define DEF_DIR "lib/m2"
  37. #endif
  38. init_lib()
  39. {
  40. extern char *strcat();
  41. strcat(lib_dir, "/");
  42. strcat(lib_dir, DEF_DIR);
  43. AddLibDir(lib_dir);
  44. }
  45. set_libdir(n)
  46. {
  47. register struct liblist *p =
  48. (struct liblist *) Malloc(sizeof(struct liblist));
  49. p->libnext = lblist;
  50. p->libno = n;
  51. lblist = p;
  52. }