MCPcopy Create free account
hub / github.com/cgsecurity/testdisk / ask_string_ncurses

Function ask_string_ncurses

src/intrfn.c:1256–1278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1254}
1255
1256const char *ask_string_ncurses(const char *string)
1257{
1258 WINDOW *local_win;
1259 const int height = 3;
1260 const int width = 60;
1261 const int starty = (LINES - height) / 2; /* Calculating for a center placement */
1262 const int startx = (COLS - width) / 2; /* of the window */
1263 static char response[128];
1264
1265 local_win = newwin(height, width, starty, startx);
1266 keypad(local_win, TRUE); /* Need it to get arrow key */
1267 box(local_win, 0 , 0); /* 0, 0 gives default characters
1268 * for the vertical and horizontal
1269 * lines */
1270 wmove(local_win,1,1);
1271 waddstr(local_win, string);
1272 wrefresh(local_win); /* Show that box */
1273 get_string(local_win, response, 120, NULL);
1274 wborder(local_win, ' ', ' ', ' ',' ',' ',' ',' ',' ');
1275 wrefresh(local_win);
1276 delwin(local_win);
1277 return &response[0];
1278}
1279
1280const char *td_curses_version(void)
1281{

Callers 2

dir_aff_ncursesFunction · 0.85

Calls 1

get_stringFunction · 0.85

Tested by

no test coverage detected