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

Function leave_topl_mode

outdated/sys/mac/macwin.c:1019–1052  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017}
1018
1019void
1020leave_topl_mode(char *answer)
1021{
1022 /*unsigned*/ char *ap, *bp;
1023
1024 int ans_len = (*top_line)->teLength - topl_query_len;
1025 NhWindow *aWin = theWindows + WIN_MESSAGE;
1026
1027 if (!in_topl_mode())
1028 return;
1029
1030 /* Cap length of reply */
1031 if (ans_len >= BUFSZ)
1032 ans_len = BUFSZ - 1;
1033
1034 /* remove unprintables from the answer */
1035 for (ap = *(*top_line)->hText + topl_query_len, bp = answer; ans_len > 0;
1036 ans_len--, ap++) {
1037 if (*ap >= ' ' && *ap < 128) {
1038 *bp++ = *ap;
1039 }
1040 }
1041 *bp = 0;
1042
1043 if (aWin->windowTextLen
1044 && (*aWin->windowText)[aWin->windowTextLen - 1] == CHAR_CR) {
1045 --aWin->windowTextLen;
1046 --aWin->y_size;
1047 }
1048 putstr(WIN_MESSAGE, ATR_BOLD, answer);
1049
1050 (*top_line)->viewRect.left += 10000;
1051 UndimMenuBar();
1052}
1053
1054/*
1055 * TESetSelect flushes out all the pending key strokes. I hate it.

Callers 2

topl_getlinFunction · 0.85
topl_yn_functionFunction · 0.85

Calls 1

in_topl_modeFunction · 0.85

Tested by

no test coverage detected