]> git.sur5r.net Git - openldap/blob - include/ac/termios.h
Update with latest from -devel.
[openldap] / include / ac / termios.h
1 /* Generic termios.h */
2
3 #ifndef _AC_TERMIOS_H
4 #define _AC_TERMIOS_H
5
6 #ifdef HAVE_TERMIOS_H
7 #include <termios.h>
8
9 #define TERMIO_TYPE     struct termios
10 #define TERMFLAG_TYPE   tcflag_t
11 #define GETATTR( fd, tiop )     tcgetattr((fd), (tiop))
12 #define SETATTR( fd, tiop )     tcsetattr((fd), TCSANOW /* 0 */, (tiop))
13 #define GETFLAGS( tio )         ((tio).c_lflag)
14 #define SETFLAGS( tio, flags )  ((tio).c_lflag = (flags))
15
16 #elif defined( HAVE_SGTTY_H )
17 #include <sgtty.h>
18
19 #ifdef HAVE_SYS_IOCTL_H
20 #include <sys/ioctl.h>
21 #endif
22
23 #define TERMIO_TYPE     struct sgttyb
24 #define TERMFLAG_TYPE   int
25 #define GETATTR( fd, tiop )     ioctl((fd), TIOCGETP, (caddr_t)(tiop))
26 #define SETATTR( fd, tiop )     ioctl((fd), TIOCSETP, (caddr_t)(tiop))
27 #define GETFLAGS( tio )     ((tio).sg_flags)
28 #define SETFLAGS( tio, flags )  ((tio).sg_flags = (flags))
29
30 #endif /* HAVE_SGTTY_H */
31
32 #endif /* _AC_TERMIOS_H */