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

Function curses_add_wid

win/curses/curswins.c:420–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418/* Add wid to list of known window IDs */
419
420void
421curses_add_wid(winid wid)
422{
423 nethack_wid *new_wid;
424 nethack_wid *widptr = nhwids;
425
426 new_wid = (nethack_wid *) alloc((unsigned) sizeof (nethack_wid));
427 new_wid->nhwid = wid;
428
429 new_wid->next_wid = NULL;
430
431 if (widptr == NULL) {
432 new_wid->prev_wid = NULL;
433 nhwids = new_wid;
434 } else {
435 while (widptr->next_wid != NULL) {
436 widptr = widptr->next_wid;
437 }
438 new_wid->prev_wid = widptr;
439 widptr->next_wid = new_wid;
440 }
441}
442
443
444/* refresh a curses window via given nethack winid */

Callers 1

curses_create_nhwindowFunction · 0.85

Calls 1

allocFunction · 0.50

Tested by

no test coverage detected