comparison src/terminfo.c @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents b8cc9ab3f761
children 11054d720c21
comparison
equal deleted inserted replaced
411:12e008d41344 412:697ef44129c6
46 like their termcap counterparts except for tparm, which replaces 46 like their termcap counterparts except for tparm, which replaces
47 tgoto. Not only is the calling sequence different, but the string 47 tgoto. Not only is the calling sequence different, but the string
48 format is different too. 48 format is different too.
49 */ 49 */
50 50
51 #include CURSES_H_FILE 51 #include CURSES_H_PATH
52 /* Sun, in their infinite lameness, supplies (possibly) broken headers 52 /* Sun, in their infinite lameness, supplies (possibly) broken headers
53 even under Solaris. GCC feels it necessary to correct things by 53 even under Solaris. GCC feels it necessary to correct things by
54 supplying its own headers. Unfortunately, if you build GCC under 54 supplying its own headers. Unfortunately, if you build GCC under
55 one version of Solaris and then upgrade your Solaris, you may get 55 one version of Solaris and then upgrade your Solaris, you may get
56 screwed because Sun in their continuing lameness changes curses.h 56 screwed because Sun in their continuing lameness changes curses.h
57 in such a way that the "fixed" GCC headers are now broken. (GCC 57 in such a way that the "fixed" GCC headers are now broken. (GCC
58 is equally lame in that it supplies "fixed" headers for curses.h 58 is equally lame in that it supplies "fixed" headers for curses.h
59 but not term.h.) However, it seems to work to just not include 59 but not term.h.) However, it seems to work to just not include
60 term.h under Solaris, so we try that. KLUDGE! */ 60 term.h under Solaris, so we try that. KLUDGE! */
61 #if !(defined (__GNUC__) && defined (SOLARIS2)) 61 #if !(defined (__GNUC__) && defined (SOLARIS2))
62 #include TERM_H_FILE 62 #include TERM_H_PATH
63 #endif 63 #endif
64 64
65 extern void *xmalloc (int size); 65 extern void *xmalloc (int size);
66 66
67 #if 0 /* If this isn't declared somewhere, too bad */ 67 #if 0 /* If this isn't declared somewhere, too bad */
68 extern char * tparm (const char *string, int arg1, int arg2, int arg3, 68 extern char * tparm (CONST char *string, int arg1, int arg2, int arg3,
69 int arg4, int arg5, int arg6, int arg7, int arg8, 69 int arg4, int arg5, int arg6, int arg7, int arg8,
70 int arg9); 70 int arg9);
71 #endif 71 #endif
72 /* XEmacs: renamed this function because just tparam() conflicts with 72 /* XEmacs: renamed this function because just tparam() conflicts with
73 ncurses (We don't use this function anyway!) */ 73 ncurses (We don't use this function anyway!) */
74 char * 74 char *
75 emacs_tparam (const char *string, char *outstring, int len, int arg1, 75 emacs_tparam (CONST char *string, char *outstring, int len, int arg1,
76 int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, 76 int arg2, int arg3, int arg4, int arg5, int arg6, int arg7,
77 int arg8, int arg9) 77 int arg8, int arg9)
78 { 78 {
79 char *temp; 79 char *temp;
80 80
81 temp = (char *) tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7, 81 temp = (char *) tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7,
82 arg8, arg9); 82 arg8, arg9);
83 if (outstring == 0) 83 if (outstring == 0)
84 outstring = (char *) xmalloc (strlen (temp) + 1); 84 outstring = ((char *) (xmalloc ((strlen (temp)) + 1)));
85 strcpy (outstring, temp); 85 strcpy (outstring, temp);
86 return outstring; 86 return outstring;
87 } 87 }
88 88
89 #endif /* not HAVE_TERMIOS */ 89 #endif /* not HAVE_TERMIOS */