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