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