From cffbd272d75504a30f8e05e40f9a411b9c408c29 Mon Sep 17 00:00:00 2001 From: Brian Barto Date: Wed, 18 Jan 2017 00:14:21 -0500 Subject: [PATCH] Make ncurses implementation for sneakers modified: Makefile modified: src/nms-ncurses.c --- Makefile | 3 +++ src/nms-ncurses.c | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 3953217..4465939 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,9 @@ all: nms sneakers nms-ncurses: $(OBJ)/nms-ncurses.o $(OBJ)/main.o | $(BIN) $(CC) $(CFLAGS) -o $(BIN)/nms $^ -lncurses +sneakers-ncurses: $(OBJ)/nms-ncurses.o $(OBJ)/sneakers.o | $(BIN) + $(CC) $(CFLAGS) -o $(BIN)/sneakers $^ -lncurses + $(OBJ)/%.o: $(SRC)/%.c | $(OBJ) $(CC) $(CFLAGS) -o $@ -c $< diff --git a/src/nms-ncurses.c b/src/nms-ncurses.c index 6f6f640..8084893 100644 --- a/src/nms-ncurses.c +++ b/src/nms-ncurses.c @@ -416,6 +416,15 @@ void nms_set_foreground_color(char *color) { foregroundColor = COLOR_BLUE; } +/* + * nms_set_return_opts() takes a character sting and copies it to the + * returnOpts setting used by nms_exec(). + */ +void nms_set_return_opts(char *opts) { + returnOpts = realloc(returnOpts, strlen(opts) + 1); + strcpy(returnOpts, opts); +} + /* * nms_set_auto_decrypt() sets the autoDecrypt flag according to the * true/false value of the 'setting' argument.