]> git.sur5r.net Git - openldap/blob - include/ac/termios.h
s/Id/OpenLDAP/ in RCSids
[openldap] / include / ac / termios.h
1 /* Generic termios.h */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms are permitted only
8  * as authorized by the OpenLDAP Public License.  A copy of this
9  * license is available at http://www.OpenLDAP.org/license.html or
10  * in file LICENSE in the top-level directory of the distribution.
11  */
12
13 #ifndef _AC_TERMIOS_H
14 #define _AC_TERMIOS_H
15
16 #ifdef HAVE_POSIX_TERMIOS
17 #include <termios.h>
18
19 #ifdef GCWINSZ_IN_SYS_IOCTL
20 #include <sys/ioctl.h>
21 #endif
22
23 #define TERMIO_TYPE     struct termios
24 #define TERMFLAG_TYPE   tcflag_t
25 #define GETATTR( fd, tiop )     tcgetattr((fd), (tiop))
26 #define SETATTR( fd, tiop )     tcsetattr((fd), TCSANOW /* 0 */, (tiop))
27 #define GETFLAGS( tio )         ((tio).c_lflag)
28 #define SETFLAGS( tio, flags )  ((tio).c_lflag = (flags))
29
30 #elif defined( HAVE_SGTTY_H )
31 #include <sgtty.h>
32
33 #ifdef HAVE_SYS_IOCTL_H
34 #include <sys/ioctl.h>
35 #endif
36
37 #define TERMIO_TYPE     struct sgttyb
38 #define TERMFLAG_TYPE   int
39 #define GETATTR( fd, tiop )     ioctl((fd), TIOCGETP, (caddr_t)(tiop))
40 #define SETATTR( fd, tiop )     ioctl((fd), TIOCSETP, (caddr_t)(tiop))
41 #define GETFLAGS( tio )     ((tio).sg_flags)
42 #define SETFLAGS( tio, flags )  ((tio).sg_flags = (flags))
43
44 #endif /* HAVE_SGTTY_H */
45
46 #endif /* _AC_TERMIOS_H */