MCPcopy Create free account
hub / github.com/Entware/Entware / fill_window

Function fill_window

scripts/config/nconf.gui.c:165–182  ·  view source on GitHub ↗

print all lines to the window. */

Source from the content-addressed store, hash-verified

163
164/* print all lines to the window. */
165void fill_window(WINDOW *win, const char *text)
166{
167 int x, y;
168 int total_lines = get_line_no(text);
169 int i;
170
171 getmaxyx(win, y, x);
172 /* do not go over end of line */
173 total_lines = min(total_lines, y);
174 for (i = 0; i < total_lines; i++) {
175 char tmp[x+10];
176 const char *line = get_line(text, i);
177 int len = get_line_length(line);
178 strncpy(tmp, line, min(len, x));
179 tmp[len] = '\0';
180 mvwprintw(win, i, 0, "%s", tmp);
181 }
182}
183
184/* get the message, and buttons.
185 * each button must be a char*

Callers 3

btn_dialogFunction · 0.85
dialog_inputboxFunction · 0.85
show_scroll_win_extFunction · 0.85

Calls 3

get_line_noFunction · 0.85
get_line_lengthFunction · 0.85
get_lineFunction · 0.70

Tested by

no test coverage detected