Back to index

openldap  2.4.31
termios.h
Go to the documentation of this file.
00001 /* Generic termios.h */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 1998-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #ifndef _AC_TERMIOS_H
00018 #define _AC_TERMIOS_H
00019 
00020 #ifdef HAVE_TERMIOS_H
00021 #include <termios.h>
00022 
00023 #ifdef GCWINSZ_IN_SYS_IOCTL
00024 #include <sys/ioctl.h>
00025 #endif
00026 
00027 #define TERMIO_TYPE  struct termios
00028 #define TERMFLAG_TYPE       tcflag_t
00029 #define GETATTR( fd, tiop ) tcgetattr((fd), (tiop))
00030 #define SETATTR( fd, tiop ) tcsetattr((fd), TCSANOW /* 0 */, (tiop))
00031 #define GETFLAGS( tio )            ((tio).c_lflag)
00032 #define SETFLAGS( tio, flags )     ((tio).c_lflag = (flags))
00033 
00034 #elif defined( HAVE_SGTTY_H )
00035 #include <sgtty.h>
00036 
00037 #ifdef HAVE_SYS_IOCTL_H
00038 #include <sys/ioctl.h>
00039 #endif
00040 
00041 #define TERMIO_TYPE  struct sgttyb
00042 #define TERMFLAG_TYPE       int
00043 #define GETATTR( fd, tiop ) ioctl((fd), TIOCGETP, (caddr_t)(tiop))
00044 #define SETATTR( fd, tiop ) ioctl((fd), TIOCSETP, (caddr_t)(tiop))
00045 #define GETFLAGS( tio )     ((tio).sg_flags)
00046 #define SETFLAGS( tio, flags )  ((tio).sg_flags = (flags))
00047 
00048 #endif /* HAVE_SGTTY_H */
00049 
00050 #endif /* _AC_TERMIOS_H */