Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / openldap / dist / include / ac / termios.h
blob67a117fbd6814dde7088b96028e4c04c34786573
1 /* Generic termios.h */
2 /* $OpenLDAP: pkg/ldap/include/ac/termios.h,v 1.18.2.3 2008/02/11 23:26:40 kurt Exp $ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2008 The OpenLDAP Foundation.
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
10 * Public License.
12 * A copy of this license is available in file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
17 #ifndef _AC_TERMIOS_H
18 #define _AC_TERMIOS_H
20 #ifdef HAVE_TERMIOS_H
21 #include <termios.h>
23 #ifdef GCWINSZ_IN_SYS_IOCTL
24 #include <sys/ioctl.h>
25 #endif
27 #define TERMIO_TYPE struct termios
28 #define TERMFLAG_TYPE tcflag_t
29 #define GETATTR( fd, tiop ) tcgetattr((fd), (tiop))
30 #define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop))
31 #define GETFLAGS( tio ) ((tio).c_lflag)
32 #define SETFLAGS( tio, flags ) ((tio).c_lflag = (flags))
34 #elif defined( HAVE_SGTTY_H )
35 #include <sgtty.h>
37 #ifdef HAVE_SYS_IOCTL_H
38 #include <sys/ioctl.h>
39 #endif
41 #define TERMIO_TYPE struct sgttyb
42 #define TERMFLAG_TYPE int
43 #define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
44 #define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop))
45 #define GETFLAGS( tio ) ((tio).sg_flags)
46 #define SETFLAGS( tio, flags ) ((tio).sg_flags = (flags))
48 #endif /* HAVE_SGTTY_H */
50 #endif /* _AC_TERMIOS_H */