Modernised usage of system header files. Changed the patch buffer (which allowed the library path to be modified with a hex editor) to an environment variable instead.

This commit is contained in:
dtrg 2006-02-03 22:23:11 +00:00
parent 4c0b3bb40f
commit c39e85da63

View file

@ -16,6 +16,8 @@
* Machine dependant things * Machine dependant things
*/ */
#include <stdlib.h>
#include <string.h>
# include "types.h" # include "types.h"
# ifndef NORCSID # ifndef NORCSID
@ -49,9 +51,6 @@ RENAME(x,y) string x,y; {
#endif #endif
} }
/* to make it easier to patch ... */
char libdir[256] = LIBDIR;
string string
libpath(s) string s; { libpath(s) string s; {
/* Must deliver a full pathname to the library file "s" */ /* Must deliver a full pathname to the library file "s" */
@ -61,6 +60,9 @@ libpath(s) string s; {
p_mem alloc(); p_mem alloc();
string strcpy(), strcat(); string strcpy(), strcat();
char* libdir = getenv("LLGEN_LIB_DIR");
if (!libdir)
libdir = LIBDIR;
length = strlen(libdir) + strlen(s) + 2; length = strlen(libdir) + strlen(s) + 2;
p = (string) alloc((unsigned) length); p = (string) alloc((unsigned) length);
strcpy(p,libdir); strcpy(p,libdir);