Make ncurses implementation for sneakers

modified:   Makefile
	modified:   src/nms-ncurses.c
This commit is contained in:
Brian Barto 2017-01-18 00:14:21 -05:00
parent e153046219
commit cffbd272d7
2 changed files with 12 additions and 0 deletions

View File

@ -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 $<

View File

@ -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.