xref: /openbsd-src/usr.bin/tic/reset_cmd.h (revision c7ef0cfc17afcba97172c25e1e3a943e893bc632)
1*c7ef0cfcSnicm /****************************************************************************
2*c7ef0cfcSnicm  * Copyright 2020,2021 Thomas E. Dickey                                     *
3*c7ef0cfcSnicm  * Copyright 2016 Free Software Foundation, Inc.                            *
4*c7ef0cfcSnicm  *                                                                          *
5*c7ef0cfcSnicm  * Permission is hereby granted, free of charge, to any person obtaining a  *
6*c7ef0cfcSnicm  * copy of this software and associated documentation files (the            *
7*c7ef0cfcSnicm  * "Software"), to deal in the Software without restriction, including      *
8*c7ef0cfcSnicm  * without limitation the rights to use, copy, modify, merge, publish,      *
9*c7ef0cfcSnicm  * distribute, distribute with modifications, sublicense, and/or sell       *
10*c7ef0cfcSnicm  * copies of the Software, and to permit persons to whom the Software is    *
11*c7ef0cfcSnicm  * furnished to do so, subject to the following conditions:                 *
12*c7ef0cfcSnicm  *                                                                          *
13*c7ef0cfcSnicm  * The above copyright notice and this permission notice shall be included  *
14*c7ef0cfcSnicm  * in all copies or substantial portions of the Software.                   *
15*c7ef0cfcSnicm  *                                                                          *
16*c7ef0cfcSnicm  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
17*c7ef0cfcSnicm  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
18*c7ef0cfcSnicm  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
19*c7ef0cfcSnicm  * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
20*c7ef0cfcSnicm  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
21*c7ef0cfcSnicm  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
22*c7ef0cfcSnicm  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
23*c7ef0cfcSnicm  *                                                                          *
24*c7ef0cfcSnicm  * Except as contained in this notice, the name(s) of the above copyright   *
25*c7ef0cfcSnicm  * holders shall not be used in advertising or otherwise to promote the     *
26*c7ef0cfcSnicm  * sale, use or other dealings in this Software without prior written       *
27*c7ef0cfcSnicm  * authorization.                                                           *
28*c7ef0cfcSnicm  ****************************************************************************/
29*c7ef0cfcSnicm 
30*c7ef0cfcSnicm /****************************************************************************
31*c7ef0cfcSnicm  *  Author: Thomas E Dickey                                                 *
32*c7ef0cfcSnicm  ****************************************************************************/
33*c7ef0cfcSnicm 
34*c7ef0cfcSnicm /*
35*c7ef0cfcSnicm  * $Id: reset_cmd.h,v 1.1 2023/10/17 09:52:10 nicm Exp $
36*c7ef0cfcSnicm  *
37*c7ef0cfcSnicm  * Utility functions for resetting terminal.
38*c7ef0cfcSnicm  */
39*c7ef0cfcSnicm #ifndef RESET_CMD_H
40*c7ef0cfcSnicm #define RESET_CMD_H 1
41*c7ef0cfcSnicm /* *INDENT-OFF* */
42*c7ef0cfcSnicm 
43*c7ef0cfcSnicm #define USE_LIBTINFO
44*c7ef0cfcSnicm #define __INTERNAL_CAPS_VISIBLE	/* we need to see has_hardware_tabs */
45*c7ef0cfcSnicm #include <progs.priv.h>
46*c7ef0cfcSnicm 
47*c7ef0cfcSnicm #undef CTRL
48*c7ef0cfcSnicm #define CTRL(x)	((x) & 0x1f)
49*c7ef0cfcSnicm 
50*c7ef0cfcSnicm extern bool send_init_strings(int /* fd */, TTY * /* old_settings */);
51*c7ef0cfcSnicm extern void print_tty_chars(TTY * /* old_settings */, TTY * /* new_settings */);
52*c7ef0cfcSnicm extern void reset_flush(void);
53*c7ef0cfcSnicm extern void reset_start(FILE * /* fp */, bool /* is_reset */, bool /* is_init */ );
54*c7ef0cfcSnicm extern void reset_tty_settings(int /* fd */, TTY * /* tty_settings */, int /* noset */);
55*c7ef0cfcSnicm extern void set_control_chars(TTY * /* tty_settings */, int /* erase */, int /* intr */, int /* kill */);
56*c7ef0cfcSnicm extern void set_conversions(TTY * /* tty_settings */);
57*c7ef0cfcSnicm 
58*c7ef0cfcSnicm #if HAVE_SIZECHANGE
59*c7ef0cfcSnicm extern void set_window_size(int /* fd */, short * /* high */, short * /* wide */);
60*c7ef0cfcSnicm #endif
61*c7ef0cfcSnicm 
62*c7ef0cfcSnicm extern const char *_nc_progname;
63*c7ef0cfcSnicm 
64*c7ef0cfcSnicm /* *INDENT-ON* */
65*c7ef0cfcSnicm 
66*c7ef0cfcSnicm #endif /* RESET_CMD_H */
67