comparison srogue/options.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 aa582a02eb5d
children 94a0d9dd5ce1
comparison
equal deleted inserted replaced
118:8d1dfc5a912c 119:458df24e973d
12 * All rights reserved. 12 * All rights reserved.
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 <termios.h>
18 #include <ctype.h> 17 #include <ctype.h>
19 #include <string.h> 18 #include <string.h>
20 #include "rogue.h" 19 #include "rogue.h"
21 #include "rogue.ext" 20 #include "rogue.ext"
22
23 extern struct termios terminal;
24 21
25 /* 22 /*
26 * description of an option and what to do with it 23 * description of an option and what to do with it
27 */ 24 */
28 struct optstruct { 25 struct optstruct {
135 draw(awin); 132 draw(awin);
136 return NORM; 133 return NORM;
137 } 134 }
138 if (c == -1) 135 if (c == -1)
139 continue; 136 continue;
140 else if(c == terminal.c_cc[VERASE]) { /* process erase char */ 137 else if(c == md_erasechar()) { /* process erase char */
141 if (sp > buf) { 138 if (sp > buf) {
142 reg int i; 139 reg int i;
143 140
144 sp--; 141 sp--;
145 for (i = strlen(unctrl(*sp)); i; i--) 142 for (i = strlen(unctrl(*sp)); i; i--)
146 waddch(awin, '\b'); 143 waddch(awin, '\b');
147 } 144 }
148 continue; 145 continue;
149 } 146 }
150 else if (c == terminal.c_cc[VKILL]) { /* process kill character */ 147 else if (c == md_killchar()) { /* process kill character */
151 sp = buf; 148 sp = buf;
152 wmove(awin, oy, ox); 149 wmove(awin, oy, ox);
153 continue; 150 continue;
154 } 151 }
155 else if (sp == buf) { 152 else if (sp == buf) {