commit 3d4cf639d759c4ea4f04142474946fa585959d77 from: Omar Polo date: Fri Apr 03 17:50:50 2020 UTC added config file only the PROMPT is configurable as of now tho. commit - c5b63edc72c15c4d9274768a67a0b65438cd4998 commit + 3d4cf639d759c4ea4f04142474946fa585959d77 blob - b3d136dbe2a00bee894bfc26f797a67cbb086893 blob + 92b8f27997fd3c7a32f5a32ec18c69b91e1c2f6c --- Makefile +++ Makefile @@ -9,7 +9,11 @@ all: adventure OBJ = match.o parseexec.o toggle.c inventory.o \ misc.o object.o io.o adventure.o -adventure: object.h ${OBJ} +# making every object depending on object.h may be too aggressive, +# but will surely avoid some nasty bugs (I hope at least.) +${OBJ}: adventure.h config.h object.h + +adventure: ${OBJ} ${CC} -o adventure ${OBJ} ${LDFLAGS} object.c: object.data data_to_c.awk blob - a90e0d0ed0c4c829142d3bd19c00b6e035f6dfee blob + 846be847d3726e9457eabed7f851477745194db2 --- adventure.h +++ adventure.h @@ -3,6 +3,8 @@ #include +#include "config.h" + enum distance { dist_player, dist_held, blob - /dev/null blob + 14fe6609fb8f3d606bc3f74d74f1c87ae07e90da (mode 644) --- /dev/null +++ config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#ifndef PROMPT +#define PROMPT "~> " +#endif + +#endif blob - af13159b22b7fada1cfb596d3ac691c64951307f blob + 14790a6a214698e4f196e554bd34c5670fb26266 --- io.c +++ io.c @@ -11,7 +11,7 @@ char *line = NULL; int getinput() { - line = readline("~> "); + line = readline(PROMPT); if (line && *line) add_history(line); return line != NULL;