00001 /* 00002 Copyright 2003 by Marc J. Rochkind. All rights reserved. 00003 May be copied only for purposes and under conditions described 00004 on the Web page www.basepath.com/aup/copyright.htm. 00005 00006 The Example Files are provided "as is," without any warranty; 00007 without even the implied warranty of merchantability or fitness 00008 for a particular purpose. The author and his publisher are not 00009 responsible for any damages, direct or incidental, resulting 00010 from the use or non-use of these Example Files. 00011 00012 The Example Files may contain defects, and some contain deliberate 00013 coding mistakes that were included for educational reasons. 00014 You are responsible for determining if and how the Example Files 00015 are to be used. 00016 00017 */ 00018 #ifndef _UXPTY_HPP_ 00019 #define _UXPTY_HPP_ 00020 00021 namespace Ux { 00022 00023 /** 00024 \ingroup Ux 00025 Note that ioctl is not included because there's no portable way to handle the arguments 00026 with stdargs (variable arguments). The Pseudo-Terminal Library from AUP2 has not been included, 00027 although it probably ought to be, as it's much easier to use than the low-level functions, and 00028 more portable. 00029 */ 00030 class Pty : public Terminal { 00031 00032 public: 00033 Pty(int f = -1, const char *p = NULL, ssize_t s = -1) 00034 : File(f, p, s) 00035 { } 00036 Pty(const char *p, ssize_t s = -1) 00037 : File(-1, p, s) 00038 { } 00039 void posix_openpt(int oflag = O_RDWR); 00040 void grantpt(void); 00041 void unlockpt(void); 00042 char *ptsname(void); 00043 }; 00044 00045 } // namespace 00046 00047 #endif // _UXPTY_HPP_