| 1 |
/* do not edit automatically generated by mc from termios. */ |
| 2 |
/* termios.def provides a procedural interface to termios. |
| 3 |
|
| 4 |
Copyright (C) 2005-2025 Free Software Foundation, Inc. |
| 5 |
Contributed by Gaius Mulley <[email protected]>. |
| 6 |
|
| 7 |
This file is part of GNU Modula-2. |
| 8 |
|
| 9 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 10 |
it under the terms of the GNU General Public License as published by |
| 11 |
the Free Software Foundation; either version 3, or (at your option) |
| 12 |
any later version. |
| 13 |
|
| 14 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 15 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
General Public License for more details. |
| 18 |
|
| 19 |
Under Section 7 of GPL version 3, you are granted additional |
| 20 |
permissions described in the GCC Runtime Library Exception, version |
| 21 |
3.1, as published by the Free Software Foundation. |
| 22 |
|
| 23 |
You should have received a copy of the GNU General Public License and |
| 24 |
a copy of the GCC Runtime Library Exception along with this program; |
| 25 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 26 |
<http://www.gnu.org/licenses/>. */ |
| 27 |
|
| 28 |
|
| 29 |
#if !defined (_termios_H) |
| 30 |
# define _termios_H |
| 31 |
|
| 32 |
# ifdef __cplusplus |
| 33 |
extern "C" { |
| 34 |
# endif |
| 35 |
#include <stdbool.h> |
| 36 |
# if !defined (PROC_D) |
| 37 |
# define PROC_D |
| 38 |
typedef void (*PROC_t) (void); |
| 39 |
typedef struct { PROC_t proc; } PROC; |
| 40 |
# endif |
| 41 |
|
| 42 |
# include "GSYSTEM.h" |
| 43 |
|
| 44 |
# if defined (_termios_C) |
| 45 |
# define EXTERN |
| 46 |
# else |
| 47 |
# define EXTERN extern |
| 48 |
# endif |
| 49 |
|
| 50 |
typedef void *termios_TERMIOS; |
| 51 |
|
| 52 |
typedef enum {termios_vintr, termios_vquit, termios_verase, termios_vkill, termios_veof, termios_vtime, termios_vmin, termios_vswtc, termios_vstart, termios_vstop, termios_vsusp, termios_veol, termios_vreprint, termios_vdiscard, termios_vwerase, termios_vlnext, termios_veol2} termios_ControlChar; |
| 53 |
|
| 54 |
typedef enum {termios_ignbrk, termios_ibrkint, termios_ignpar, termios_iparmrk, termios_inpck, termios_istrip, termios_inlcr, termios_igncr, termios_icrnl, termios_iuclc, termios_ixon, termios_ixany, termios_ixoff, termios_imaxbel, termios_opost, termios_olcuc, termios_onlcr, termios_ocrnl, termios_onocr, termios_onlret, termios_ofill, termios_ofdel, termios_onl0, termios_onl1, termios_ocr0, termios_ocr1, termios_ocr2, termios_ocr3, termios_otab0, termios_otab1, termios_otab2, termios_otab3, termios_obs0, termios_obs1, termios_off0, termios_off1, termios_ovt0, termios_ovt1, termios_b0, termios_b50, termios_b75, termios_b110, termios_b135, termios_b150, termios_b200, termios_b300, termios_b600, termios_b1200, termios_b1800, termios_b2400, termios_b4800, termios_b9600, termios_b19200, termios_b38400, termios_b57600, termios_b115200, termios_b240400, termios_b460800, termios_b500000, termios_b576000, termios_b921600, termios_b1000000, termios_b1152000, termios_b1500000, termios_b2000000, termios_b2500000, termios_b3000000, termios_b3500000, termios_b4000000, termios_maxbaud, termios_crtscts, termios_cs5, termios_cs6, termios_cs7, termios_cs8, termios_cstopb, termios_cread, termios_parenb, termios_parodd, termios_hupcl, termios_clocal, termios_lisig, termios_licanon, termios_lxcase, termios_lecho, termios_lechoe, termios_lechok, termios_lechonl, termios_lnoflsh, termios_ltopstop, termios_lechoctl, termios_lechoprt, termios_lechoke, termios_lflusho, termios_lpendin, termios_liexten} termios_Flag; |
| 55 |
|
| 56 |
|
| 57 |
/* |
| 58 |
InitTermios - new data structure. |
| 59 |
*/ |
| 60 |
|
| 61 |
EXTERN termios_TERMIOS termios_InitTermios (void); |
| 62 |
|
| 63 |
/* |
| 64 |
KillTermios - delete data structure. |
| 65 |
*/ |
| 66 |
|
| 67 |
EXTERN termios_TERMIOS termios_KillTermios (termios_TERMIOS t); |
| 68 |
|
| 69 |
/* |
| 70 |
cfgetospeed - return output baud rate. |
| 71 |
*/ |
| 72 |
|
| 73 |
EXTERN int termios_cfgetospeed (termios_TERMIOS t); |
| 74 |
|
| 75 |
/* |
| 76 |
cfgetispeed - return input baud rate. |
| 77 |
*/ |
| 78 |
|
| 79 |
EXTERN int termios_cfgetispeed (termios_TERMIOS t); |
| 80 |
|
| 81 |
/* |
| 82 |
cfsetospeed - set output baud rate. |
| 83 |
*/ |
| 84 |
|
| 85 |
EXTERN int termios_cfsetospeed (termios_TERMIOS t, unsigned int b); |
| 86 |
|
| 87 |
/* |
| 88 |
cfsetispeed - set input baud rate. |
| 89 |
*/ |
| 90 |
|
| 91 |
EXTERN int termios_cfsetispeed (termios_TERMIOS t, unsigned int b); |
| 92 |
|
| 93 |
/* |
| 94 |
cfsetspeed - set input and output baud rate. |
| 95 |
*/ |
| 96 |
|
| 97 |
EXTERN int termios_cfsetspeed (termios_TERMIOS t, unsigned int b); |
| 98 |
|
| 99 |
/* |
| 100 |
tcgetattr - get state of, fd, into, t. |
| 101 |
*/ |
| 102 |
|
| 103 |
EXTERN int termios_tcgetattr (int fd, termios_TERMIOS t); |
| 104 |
EXTERN int termios_tcsnow (void); |
| 105 |
EXTERN int termios_tcsdrain (void); |
| 106 |
EXTERN int termios_tcsflush (void); |
| 107 |
|
| 108 |
/* |
| 109 |
tcsetattr - set state of, fd, to, t, using option. |
| 110 |
*/ |
| 111 |
|
| 112 |
EXTERN int termios_tcsetattr (int fd, int option, termios_TERMIOS t); |
| 113 |
|
| 114 |
/* |
| 115 |
cfmakeraw - sets, t, to raw mode. |
| 116 |
*/ |
| 117 |
|
| 118 |
EXTERN void termios_cfmakeraw (termios_TERMIOS t); |
| 119 |
|
| 120 |
/* |
| 121 |
tcsendbreak - send zero bits for duration. |
| 122 |
*/ |
| 123 |
|
| 124 |
EXTERN int termios_tcsendbreak (int fd, int duration); |
| 125 |
|
| 126 |
/* |
| 127 |
tcdrain - waits for pending output to be written on, fd. |
| 128 |
*/ |
| 129 |
|
| 130 |
EXTERN int termios_tcdrain (int fd); |
| 131 |
|
| 132 |
/* |
| 133 |
tcflushi - flush input. |
| 134 |
*/ |
| 135 |
|
| 136 |
EXTERN int termios_tcflushi (int fd); |
| 137 |
|
| 138 |
/* |
| 139 |
tcflusho - flush output. |
| 140 |
*/ |
| 141 |
|
| 142 |
EXTERN int termios_tcflusho (int fd); |
| 143 |
|
| 144 |
/* |
| 145 |
tcflushio - flush input and output. |
| 146 |
*/ |
| 147 |
|
| 148 |
EXTERN int termios_tcflushio (int fd); |
| 149 |
|
| 150 |
/* |
| 151 |
tcflowoni - restart input on, fd. |
| 152 |
*/ |
| 153 |
|
| 154 |
EXTERN int termios_tcflowoni (int fd); |
| 155 |
|
| 156 |
/* |
| 157 |
tcflowoffi - stop input on, fd. |
| 158 |
*/ |
| 159 |
|
| 160 |
EXTERN int termios_tcflowoffi (int fd); |
| 161 |
|
| 162 |
/* |
| 163 |
tcflowono - restart output on, fd. |
| 164 |
*/ |
| 165 |
|
| 166 |
EXTERN int termios_tcflowono (int fd); |
| 167 |
|
| 168 |
/* |
| 169 |
tcflowoffo - stop output on, fd. |
| 170 |
*/ |
| 171 |
|
| 172 |
EXTERN int termios_tcflowoffo (int fd); |
| 173 |
|
| 174 |
/* |
| 175 |
GetFlag - sets a flag value from, t, in, b, and returns TRUE |
| 176 |
if, t, supports, f. |
| 177 |
*/ |
| 178 |
|
| 179 |
EXTERN bool termios_GetFlag (termios_TERMIOS t, termios_Flag f, bool *b); |
| 180 |
|
| 181 |
/* |
| 182 |
SetFlag - sets a flag value in, t, to, b, and returns TRUE if |
| 183 |
this flag value is supported. |
| 184 |
*/ |
| 185 |
|
| 186 |
EXTERN bool termios_SetFlag (termios_TERMIOS t, termios_Flag f, bool b); |
| 187 |
|
| 188 |
/* |
| 189 |
GetChar - sets a CHAR, ch, value from, t, and returns TRUE if |
| 190 |
this value is supported. |
| 191 |
*/ |
| 192 |
|
| 193 |
EXTERN bool termios_GetChar (termios_TERMIOS t, termios_ControlChar c, char *ch); |
| 194 |
|
| 195 |
/* |
| 196 |
SetChar - sets a CHAR value in, t, and returns TRUE if, c, |
| 197 |
is supported. |
| 198 |
*/ |
| 199 |
|
| 200 |
EXTERN bool termios_SetChar (termios_TERMIOS t, termios_ControlChar c, char ch); |
| 201 |
# ifdef __cplusplus |
| 202 |
} |
| 203 |
# endif |
| 204 |
|
| 205 |
# undef EXTERN |
| 206 |
#endif |