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