home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / src / terminfo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-25  |  2.1 KB  |  70 lines

  1. /* Interface from Emacs to terminfo.
  2.    Copyright (C) 1985, 1986, 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of XEmacs.
  5.  
  6. XEmacs is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU General Public License as published by the
  8. Free Software Foundation; either version 2, or (at your option) any
  9. later version.
  10.  
  11. XEmacs is distributed in the hope that it will be useful, but WITHOUT
  12. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14. for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with XEmacs; see the file COPYING.  If not, write to the Free
  18. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* Synched up with: FSF 19.28. */
  21.  
  22. #include <config.h>
  23.  
  24. #include <string.h>
  25.  
  26. /* Define these variables that serve as global parameters to termcap,
  27.    so that we do not need to conditionalize the places in Emacs
  28.    that set them.  */
  29.  
  30. char *UP, *BC, PC;
  31. #if defined (HAVE_TERMIOS) && !(defined (USG) && (defined (sparc) || defined(INTEL386)))
  32. #include <termios.h>
  33. speed_t ospeed;
  34. #else
  35. short ospeed;
  36. #endif
  37.  
  38. #ifdef AIX
  39. #include <termio.h>
  40. #endif /* AIX */
  41.  
  42. /* Interface to curses/terminfo library.
  43.    Turns out that all of the terminfo-level routines look
  44.    like their termcap counterparts except for tparm, which replaces
  45.    tgoto.  Not only is the calling sequence different, but the string
  46.    format is different too.
  47. */
  48.  
  49. #include <curses.h>
  50. #include <term.h>
  51.  
  52. extern void *xmalloc (int size);
  53.  
  54. char * tparam (CONST char *string, char *outstring, int len, int arg1,
  55.            int arg2, int arg3, int arg4, int arg5, int arg6, int arg7,
  56.            int arg8, int arg9);
  57. char *
  58. tparam (CONST char *string, char *outstring, int len, int arg1, int arg2,
  59.     int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9)
  60. {
  61.   char *temp;
  62.  
  63.   temp = (char *) tparm (string, arg1, arg2, arg3, arg4, arg5, arg6, arg7,
  64.              arg8, arg9);
  65.   if (outstring == 0)
  66.     outstring = ((char *) (xmalloc ((strlen (temp)) + 1)));
  67.   strcpy (outstring, temp);
  68.   return outstring;
  69. }
  70.