Fix bug #9221 with memory leak in bidi display.
[bpt/emacs.git] / src / terminfo.c
CommitLineData
d427b66a 1/* Interface from Emacs to terminfo.
73b0cd50 2 Copyright (C) 1985-1986, 2001-2011 Free Software Foundation, Inc.
d427b66a
JB
3
4This file is part of GNU Emacs.
5
9ec0b715 6GNU Emacs is free software: you can redistribute it and/or modify
d427b66a 7it under the terms of the GNU General Public License as published by
9ec0b715
GM
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
d427b66a
JB
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
9ec0b715 17along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
d427b66a 18
d676eef3 19#include <config.h>
af8a867c
PE
20#include "tparam.h"
21
d7306fe6 22#include <setjmp.h>
495de6e9 23#include "lisp.h"
d676eef3 24
d427b66a
JB
25/* Define these variables that serve as global parameters to termcap,
26 so that we do not need to conditionalize the places in Emacs
27 that set them. */
28
29char *UP, *BC, PC;
d676eef3 30
d427b66a
JB
31/* Interface to curses/terminfo library.
32 Turns out that all of the terminfo-level routines look
33 like their termcap counterparts except for tparm, which replaces
34 tgoto. Not only is the calling sequence different, but the string
35 format is different too.
36*/
37
af8a867c
PE
38extern char *tparm (const char *str, ...);
39
40
d427b66a 41char *
af8a867c
PE
42tparam (const char *string, char *outstring, int len,
43 int arg1, int arg2, int arg3, int arg4)
d427b66a
JB
44{
45 char *temp;
d427b66a 46
af8a867c
PE
47 /* Emacs always should pass a null OUTSTRING and zero LEN. */
48 if (outstring || len)
49 abort ();
ab5796a9 50
af8a867c
PE
51 temp = tparm (string, arg1, arg2, arg3, arg4);
52 return xstrdup (temp);
53}