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

Function get_msg_line

win/curses/cursmesg.c:981–1003  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

979/* Returns specified line from message history, or NULL if out of bounds */
980
981static nhprev_mesg *
982get_msg_line(boolean reverse, int mindex)
983{
984 int count;
985 nhprev_mesg *current_mesg;
986
987 if (reverse) {
988 current_mesg = last_mesg;
989 for (count = 0; count < mindex; count++) {
990 if (!current_mesg)
991 break;
992 current_mesg = current_mesg->prev_mesg;
993 }
994 } else {
995 current_mesg = first_mesg;
996 for (count = 0; count < mindex; count++) {
997 if (!current_mesg)
998 break;
999 current_mesg = current_mesg->next_mesg;
1000 }
1001 }
1002 return current_mesg;
1003}
1004
1005/* save/restore code retrieves one ^P message at a time during save and
1006 puts it into save file; if any new messages are added to the list while

Callers 3

curses_last_messagesFunction · 0.85
curses_prev_mesgFunction · 0.85
curses_getmsghistoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected