kdecore Library API Documentation

KPty Class Reference

Provides a high level representation of a pseudo tty pair, including utmp support. More...

#include <kpty.h>

List of all members.

Public Member Functions

 KPty ()
 ~KPty ()
bool open ()
void close ()
void setCTty ()
void login (const char *user=0, const char *remotehost=0)
void logout ()
void setWinSize (int lines, int columns)
void setXonXoff (bool useXonXoff)
const char * ttyName () const
int masterFd () const
int slaveFd () const


Detailed Description

Provides a high level representation of a pseudo tty pair, including utmp support.

...

Since:
3.2

Definition at line 35 of file kpty.h.


Constructor & Destructor Documentation

KPty::KPty  ) 
 

Constructor.

Definition at line 185 of file kpty.cpp.

KPty::~KPty  ) 
 

Destructor:.

If the pty is still open, it will be closed. Note, however, that an utmp registration is not undone.

Definition at line 190 of file kpty.cpp.

References close().


Member Function Documentation

bool KPty::open  ) 
 

Create a pty master/slave pair.

Returns:
true if a pty pair was successfully opened

Definition at line 196 of file kpty.cpp.

References KIO::chmod(), endl(), QCString::sprintf(), and KIO::stat().

void KPty::close  ) 
 

Close the pty master/slave pair.

Definition at line 340 of file kpty.cpp.

References KIO::chmod(), and KIO::stat().

Referenced by ~KPty().

void KPty::setCTty  ) 
 

Creates a new session and process group and makes this pty the controlling tty.

Definition at line 362 of file kpty.cpp.

void KPty::login const char *  user = 0,
const char *  remotehost = 0
 

Creates an utmp entry for the tty.

This function must be called after calling

See also:
setCTty and making this pty the stdin.
Parameters:
user the user to be logged on
remotehost the host from which the login is coming. This is not the local host. For remote logins it should be the hostname of the client. For local logins from inside an X session it should be the name of the X display. Otherwise it should be empty.

Definition at line 387 of file kpty.cpp.

References KProcess::Block.

void KPty::logout  ) 
 

Removes the utmp entry for this tty.

Definition at line 430 of file kpty.cpp.

References KProcess::Block.

void KPty::setWinSize int  lines,
int  columns
 

Change the logical (screen) size of the pty.

The default is 24 lines by 80 columns.

Parameters:
lines the number of rows
columns the number of columns

Definition at line 452 of file kpty.cpp.

void KPty::setXonXoff bool  useXonXoff  ) 
 

Set whether the pty should honor Xon/Xoff flow control.

Xon/Xoff flow control is off by default.

Parameters:
useXonXoff true if Xon/Xoff flow control should be used.

Definition at line 460 of file kpty.cpp.

const char * KPty::ttyName  )  const
 

Returns:
the name of the slave pty device.
This function should be called only while the pty is open.

Definition at line 480 of file kpty.cpp.

int KPty::masterFd  )  const
 

Returns:
the file descriptor of the master pty
This function should be called only while the pty is open.

Definition at line 485 of file kpty.cpp.

int KPty::slaveFd  )  const
 

Returns:
the file descriptor of the slave pty
This function should be called only while the pty is open.

Definition at line 490 of file kpty.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdecore Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 30 05:16:17 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2003