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

Function vms_getchar

sys/vms/vmstty.c:122–146  ·  view source on GitHub ↗

rename the real vms_getchar and interpose this one in front of it */

Source from the content-addressed store, hash-verified

120
121/* rename the real vms_getchar and interpose this one in front of it */
122int
123vms_getchar(void)
124{
125 static int althack = 0, altprefix;
126 char *nhalthack;
127 int res;
128
129 if (!althack) {
130 /* one-time init */
131 nhalthack = nh_getenv("NH_ALTHACK");
132 althack = nhalthack ? 1 : -1;
133 if (althack > 0)
134 altprefix = *nhalthack;
135 }
136
137#define vms_getchar nh_vms_getchar
138
139 res = vms_getchar();
140 if (althack > 0 && res == altprefix) {
141 res = vms_getchar();
142 if (res != ESC)
143 res = META(res);
144 }
145 return res;
146}
147#endif /*DEBUG*/
148
149int

Callers

nothing calls this directly

Calls 2

parse_function_keyFunction · 0.85
nh_getenvFunction · 0.50

Tested by

no test coverage detected