MCPcopy Create free account
hub / github.com/NetHack/NetHack / X11_getmsghistory

Function X11_getmsghistory

win/X11/winX.c:223–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223char *
224X11_getmsghistory(boolean init)
225{
226 if (WIN_MESSAGE != WIN_ERR) {
227 static struct line_element *curr = (struct line_element *) 0;
228 static int numlines = 0;
229 struct xwindow *wp = &window_list[WIN_MESSAGE];
230
231 if (init)
232 curr = (struct line_element *) 0;
233
234 if (!curr) {
235 curr = wp->mesg_information->head;
236 numlines = 0;
237 }
238
239 if (numlines < wp->mesg_information->num_lines) {
240 curr = curr->next;
241 numlines++;
242 debugpline2("X11_getmsghistory(%i)='%s'", init, curr->line);
243 return curr->line;
244 }
245 }
246 return (char *) 0;
247}
248
249/*
250 * Find the window structure that corresponds to the given widget. Note

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected