"d — delete record",
"q - quit",
NULL,
};
int getchoice(char *greet, char *choices[], FILE *in, FILE *out);
int char_to_terminal(int_char_to_write);
int main() {
...
}
int getchoice(char *greet, char* choices[], FILE[]* in, FILE* out) {
int chosen = 0;
int selected;
int screenrow, screencol = 10;
char **option;
char* cursor, *clear;
output_stream = out;
setupterm(NULL, fileno(out), (int*)0);
cursor = tigetstr("cup");
clear = tigetstr("clear");
screenrow =4;
tputs(clear, 1, (int*)char_to_terminal);
tputs(tparm(cursor, screenrow, screencol), 1, char_to_terminal);
fprintf(out, "Choice: %s", greet);
screenrow += 2;
option = choices;
while (*option) {
ftputs(tparm(cursor, screenrow, screencol), 1, char_to_terminal);
fprintf(out, "%s", *option);
screenrow++;
option++