Mercurial > mplayer.hg
comparison osdep/getch2.c @ 27359:d788e177a35e
Rename some preprocessor directives from CONFIG_* to HAVE_* where appropriate;
CONFIG_ prefix for configurable options, HAVE_ for system-dependent stuff.
author | diego |
---|---|
date | Fri, 01 Aug 2008 20:28:58 +0000 |
parents | e7c989f7a7c9 |
children | 4876c89bafdd |
comparison
equal
deleted
inserted
replaced
27358:e736897cf006 | 27359:d788e177a35e |
---|---|
1 /* GyS-TermIO v2.0 (for GySmail v3) (C) 1999 A'rpi/ESP-team */ | 1 /* GyS-TermIO v2.0 (for GySmail v3) (C) 1999 A'rpi/ESP-team */ |
2 | 2 |
3 #include "config.h" | 3 #include "config.h" |
4 | 4 |
5 //#define CONFIG_TERMCAP | 5 //#define HAVE_TERMCAP |
6 #if !defined(__OS2__) && !defined(__MORPHOS__) | 6 #if !defined(__OS2__) && !defined(__MORPHOS__) |
7 #define CONFIG_IOCTL | 7 #define CONFIG_IOCTL |
8 #endif | 8 #endif |
9 | 9 |
10 #define MAX_KEYS 64 | 10 #define MAX_KEYS 64 |
26 #ifdef HAVE_SYS_TERMIOS_H | 26 #ifdef HAVE_SYS_TERMIOS_H |
27 #include <sys/termios.h> | 27 #include <sys/termios.h> |
28 #endif | 28 #endif |
29 #endif | 29 #endif |
30 | 30 |
31 #if defined(CONFIG_LANGINFO) && defined(CONFIG_ICONV) | 31 #if defined(HAVE_LANGINFO) && defined(HAVE_ICONV) |
32 #include <locale.h> | 32 #include <locale.h> |
33 #include <langinfo.h> | 33 #include <langinfo.h> |
34 #endif | 34 #endif |
35 | 35 |
36 #include <unistd.h> | 36 #include <unistd.h> |
54 char chars[8]; | 54 char chars[8]; |
55 } keycode_st; | 55 } keycode_st; |
56 static keycode_st getch2_keys[MAX_KEYS]; | 56 static keycode_st getch2_keys[MAX_KEYS]; |
57 static int getch2_key_db=0; | 57 static int getch2_key_db=0; |
58 | 58 |
59 #ifdef CONFIG_TERMCAP | 59 #ifdef HAVE_TERMCAP |
60 | 60 |
61 #if 0 | 61 #if 0 |
62 #include <termcap.h> | 62 #include <termcap.h> |
63 #else | 63 #else |
64 extern int tgetent (char *BUFFER, char *TERMTYPE); | 64 extern int tgetent (char *BUFFER, char *TERMTYPE); |
268 tcsetattr(0,TCSANOW,&tio_orig); | 268 tcsetattr(0,TCSANOW,&tio_orig); |
269 #endif | 269 #endif |
270 getch2_status=0; | 270 getch2_status=0; |
271 } | 271 } |
272 | 272 |
273 #ifdef CONFIG_ICONV | 273 #ifdef HAVE_ICONV |
274 char* get_term_charset(void) | 274 char* get_term_charset(void) |
275 { | 275 { |
276 char* charset = NULL; | 276 char* charset = NULL; |
277 #ifdef CONFIG_LANGINFO | 277 #ifdef HAVE_LANGINFO |
278 setlocale(LC_CTYPE, ""); | 278 setlocale(LC_CTYPE, ""); |
279 charset = nl_langinfo(CODESET); | 279 charset = nl_langinfo(CODESET); |
280 setlocale(LC_CTYPE, "C"); | 280 setlocale(LC_CTYPE, "C"); |
281 #endif | 281 #endif |
282 return charset; | 282 return charset; |