Mercurial > mplayer.hg
comparison osdep/getch2.c @ 15566:3758536dcef3
DragonFly BSD support
patch by Joerg Sonnenberger <joerg - at - britannica - dot - bec - dot - de>
author | diego |
---|---|
date | Wed, 25 May 2005 08:48:32 +0000 |
parents | cacdfa298d37 |
children | 08cac43f1e38 |
comparison
equal
deleted
inserted
replaced
15565:1c1c7cd29707 | 15566:3758536dcef3 |
---|---|
218 void getch2_enable(){ | 218 void getch2_enable(){ |
219 #ifdef HAVE_TERMIOS | 219 #ifdef HAVE_TERMIOS |
220 struct termios tio_new; | 220 struct termios tio_new; |
221 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) | 221 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) |
222 tcgetattr(0,&tio_orig); | 222 tcgetattr(0,&tio_orig); |
223 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) | 223 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__) |
224 ioctl(0,TIOCGETA,&tio_orig); | 224 ioctl(0,TIOCGETA,&tio_orig); |
225 #else | 225 #else |
226 ioctl(0,TCGETS,&tio_orig); | 226 ioctl(0,TCGETS,&tio_orig); |
227 #endif | 227 #endif |
228 tio_new=tio_orig; | 228 tio_new=tio_orig; |
229 tio_new.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */ | 229 tio_new.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */ |
230 tio_new.c_cc[VMIN] = 1; | 230 tio_new.c_cc[VMIN] = 1; |
231 tio_new.c_cc[VTIME] = 0; | 231 tio_new.c_cc[VTIME] = 0; |
232 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) | 232 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) |
233 tcsetattr(0,TCSANOW,&tio_new); | 233 tcsetattr(0,TCSANOW,&tio_new); |
234 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) | 234 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__) |
235 ioctl(0,TIOCSETA,&tio_new); | 235 ioctl(0,TIOCSETA,&tio_new); |
236 #else | 236 #else |
237 ioctl(0,TCSETS,&tio_new); | 237 ioctl(0,TCSETS,&tio_new); |
238 #endif | 238 #endif |
239 #endif | 239 #endif |
243 void getch2_disable(){ | 243 void getch2_disable(){ |
244 if(!getch2_status) return; // already disabled / never enabled | 244 if(!getch2_status) return; // already disabled / never enabled |
245 #ifdef HAVE_TERMIOS | 245 #ifdef HAVE_TERMIOS |
246 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) | 246 #if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__) |
247 tcsetattr(0,TCSANOW,&tio_orig); | 247 tcsetattr(0,TCSANOW,&tio_orig); |
248 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) | 248 #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__) |
249 ioctl(0,TIOCSETA,&tio_orig); | 249 ioctl(0,TIOCSETA,&tio_orig); |
250 #else | 250 #else |
251 ioctl(0,TCSETS,&tio_orig); | 251 ioctl(0,TCSETS,&tio_orig); |
252 #endif | 252 #endif |
253 #endif | 253 #endif |