Mercurial > hg > early-roguelike
comparison srogue/wizard.c @ 119:458df24e973d
srogue: use functions from mdport.c.
Shell escape, passwd entries, terminal settings, and most signal
handling is now done with the more portable md_* functions.
author | John "Elwin" Edwards |
---|---|
date | Wed, 30 Apr 2014 14:46:30 -0700 |
parents | 3aa87373c908 |
children | 94a0d9dd5ce1 |
comparison
equal
deleted
inserted
replaced
118:8d1dfc5a912c | 119:458df24e973d |
---|---|
13 * | 13 * |
14 * See the file LICENSE.TXT for full copyright and licensing information. | 14 * See the file LICENSE.TXT for full copyright and licensing information. |
15 */ | 15 */ |
16 | 16 |
17 #include <stdlib.h> | 17 #include <stdlib.h> |
18 #include <termios.h> | |
19 #include <ctype.h> | 18 #include <ctype.h> |
20 #include "rogue.h" | 19 #include "rogue.h" |
21 #include <pwd.h> | |
22 #include "rogue.ext" | 20 #include "rogue.ext" |
23 | |
24 extern struct termios terminal; | |
25 | 21 |
26 /* | 22 /* |
27 * whatis: | 23 * whatis: |
28 * What a certain object is | 24 * What a certain object is |
29 */ | 25 */ |
357 | 353 |
358 msg(wizstr); | 354 msg(wizstr); |
359 mpos = 0; | 355 mpos = 0; |
360 sp = buf; | 356 sp = buf; |
361 while ((c = getchar()) != '\n' && c != '\r' && c != ESCAPE) | 357 while ((c = getchar()) != '\n' && c != '\r' && c != ESCAPE) |
362 if (c == terminal.c_cc[VKILL]) | 358 if (c == md_killchar()) |
363 sp = buf; | 359 sp = buf; |
364 else if (c == terminal.c_cc[VERASE] && sp > buf) | 360 else if (c == md_erasechar() && sp > buf) |
365 sp--; | 361 sp--; |
366 else | 362 else |
367 *sp++ = c; | 363 *sp++ = c; |
368 if (sp == buf) | 364 if (sp == buf) |
369 passok = FALSE; | 365 passok = FALSE; |