2017-04-25 14:41:48 +02:00
|
|
|
/*
|
|
|
|
|
* magsgtty.h --
|
|
|
|
|
*
|
|
|
|
|
* Magic's own sgtty.h file. For porting
|
|
|
|
|
*
|
2020-05-23 23:13:14 +02:00
|
|
|
* *********************************************************************
|
|
|
|
|
* * Copyright (C) 1985, 1990 Regents of the University of California. *
|
|
|
|
|
* * Permission to use, copy, modify, and distribute this *
|
|
|
|
|
* * software and its documentation for any purpose and without *
|
|
|
|
|
* * fee is hereby granted, provided that the above copyright *
|
|
|
|
|
* * notice appear in all copies. The University of California *
|
|
|
|
|
* * makes no representations about the suitability of this *
|
|
|
|
|
* * software for any purpose. It is provided "as is" without *
|
|
|
|
|
* * express or implied warranty. Export of this software outside *
|
|
|
|
|
* * of the United States of America may require an export license. *
|
2017-04-25 14:41:48 +02:00
|
|
|
* *********************************************************************
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2024-10-16 08:38:41 +02:00
|
|
|
#ifndef _MAGIC__UTILS__MAGSGTTY_H
|
|
|
|
|
#define _MAGIC__UTILS__MAGSGTTY_H
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2019-07-22 01:32:45 +02:00
|
|
|
|
2025-07-31 23:59:00 +02:00
|
|
|
#if defined(HAVE_TERMIOS_H)
|
|
|
|
|
/* In modern times everything has POSIX */
|
|
|
|
|
#include <termios.h>
|
2019-07-22 01:32:45 +02:00
|
|
|
|
2025-07-31 23:59:00 +02:00
|
|
|
#ifdef HAVE_SYS_IOCTL_H
|
|
|
|
|
/* Linux glibx 2.x - present
|
|
|
|
|
* FreeBSD 14.3-RELEASE - present
|
|
|
|
|
* Solaris 11.4 - present
|
|
|
|
|
*/
|
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
|
#endif
|
2022-09-03 05:52:34 +02:00
|
|
|
|
2025-07-31 23:59:00 +02:00
|
|
|
#elif defined(HAVE_TERMIO_H)
|
|
|
|
|
/* Linux glibx 2.x - present (just includes termios.h & sys/ioctl.h)
|
|
|
|
|
* Linux glibc 2.45+ - not present
|
|
|
|
|
* FreeBSD 14.3-RELEASE - not present
|
|
|
|
|
* Solaris 11.4 - present
|
|
|
|
|
*/
|
|
|
|
|
#include <termio.h>
|
|
|
|
|
#else /* sgtty */
|
|
|
|
|
#if defined(HAVE_SYS_IOCTL_COMPAT_H)
|
|
|
|
|
/* Linux glibc2.x - not present
|
|
|
|
|
* FreeBSD 14.3-RELEASE - not present
|
|
|
|
|
* Solaris 11.4 - not present
|
|
|
|
|
*/
|
|
|
|
|
#include <sys/ioctl_compat.h> /* replaced sgtty.h */
|
|
|
|
|
#elif defined(HAVE_SGTTY_H)
|
|
|
|
|
/* Linux glibc2.x - present (includes sys/ioctl.h)
|
|
|
|
|
* FreeBSD 14.3-RELEASE - not present
|
|
|
|
|
* Solaris 11.4 - present
|
|
|
|
|
*/
|
|
|
|
|
#include <sgtty.h> /* legacy - struct sgttyb{} defn */
|
|
|
|
|
#endif
|
2022-09-03 05:52:34 +02:00
|
|
|
#endif
|
2019-07-22 01:32:45 +02:00
|
|
|
|
2025-07-17 21:57:25 +02:00
|
|
|
|
2025-07-31 23:59:00 +02:00
|
|
|
/* all of the state associated with a tty terminal */
|
|
|
|
|
typedef struct {
|
|
|
|
|
#if defined(HAVE_TERMIOS_H)
|
|
|
|
|
struct termios termios;
|
|
|
|
|
#elif defined(HAVE_TERMIO_H)
|
|
|
|
|
struct termio termio;
|
|
|
|
|
#else /* sgtty */
|
|
|
|
|
struct sgttyb tx_i_sgtty;
|
|
|
|
|
struct tchars tx_i_tchars;
|
2017-04-25 14:41:48 +02:00
|
|
|
#endif
|
2025-07-31 23:59:00 +02:00
|
|
|
} txTermState;
|
2017-04-25 14:41:48 +02:00
|
|
|
|
2025-07-17 21:57:25 +02:00
|
|
|
|
2024-10-16 08:38:41 +02:00
|
|
|
#endif /* _MAGIC__UTILS__MAGSGTTY_H */
|