Skip to content

Commit

Permalink
Rip out returnopts functionality. Not using it.
Browse files Browse the repository at this point in the history
	modified:   src/nmseffect.c
  • Loading branch information
bartobri committed Oct 25, 2018
1 parent 1cd3657 commit 65901d9
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions src/nmseffect.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#define REVEAL_LOOP_SPEED 50 // miliseconds between each reveal loop

// Behavior settings
static char *returnOpts = NULL; // Return option setting
static int autoDecrypt = 0; // Auto-decrypt flag
static int maskBlank = 0; // Mask blank spaces
static int colorOn = 1; // Terminal color flag
Expand Down Expand Up @@ -278,29 +277,9 @@ char nmseffect_exec(unsigned char *string, int string_len) {
nmseffect_sleep(REVEAL_LOOP_SPEED);
}

// Flush any input up to this point
nmstermio_clear_input();

// Check if user must select from a set of options
if (returnOpts != NULL && strlen(returnOpts) > 0) {

// Position cursor if necessary
if (inputPositionY >= 0 && inputPositionX >= 0) {
nmstermio_move_cursor(inputPositionY, inputPositionX);
}

nmstermio_show_cursor();

// Get and validate user selection
while (strchr(returnOpts, ret = nmstermio_get_char()) == NULL) {
nmstermio_beep();
}

}

// User must press a key to continue when clearSrc is set
// without returnOpts
else if (nmstermio_get_clearscr()) {
if (nmstermio_get_clearscr()) {
nmstermio_get_char();
}

Expand Down Expand Up @@ -329,18 +308,6 @@ void nmseffect_set_foregroundcolor(char *color) {
nmstermio_set_foregroundcolor(color);
}

/*
* Copy the string argument to the 'returnOpts' variable. This string is
* used to determine what character the user must choose from before
* nmseffect_exec() returns execution to the calling function. Normally
* this is left NULL. Use only when you want to present a menu with
* selection choices to the user.
*/
void nmseffect_set_returnopts(char *opts) {
returnOpts = realloc(returnOpts, strlen(opts) + 1);
strcpy(returnOpts, opts);
}

/*
* Set the autoDecrypt flag according to the true/false value of the
* 'setting' argument. When set to true, nmseffect_exec() will not
Expand Down

0 comments on commit 65901d9

Please sign in to comment.