dexpect

Undocumented in source.

Members

Classes

Expect
class Expect
Undocumented in source.
ExpectException
class ExpectException

Exceptions thrown during expecting data.

ExpectImpl
class ExpectImpl(OutputRange)

ExpectImpl spawns a process in a Spawn object. You then call expect("desired output"); sendLine("desired Input"); to interact with said process

Functions

CreateNamedPipeA
HANDLE CreateNamedPipeA(LPCTSTR lpName, DWORD dwOpenMode, DWORD dwPipeMode, DWORD nMaxInstances, DWORD nOutBufferSize, DWORD nInBufferSize, DWORD nDefaultTimeOut, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Undocumented in source but is binding to Windows. You might be able to learn more by searching the web for its name.
PostThreadMessageA
BOOL PostThreadMessageA(DWORD , UINT , WPARAM , LPARAM )
Undocumented in source but is binding to Windows. You might be able to learn more by searching the web for its name.
ReadFileEx
BOOL ReadFileEx(HANDLE , LPVOID , DWORD , OVERLAPPED* , void* )

Reads from an IO device (https://msdn.microsoft.com/en-us/library/windows/desktop/aa365468%28v=vs.85%29.aspx)

RegisterWaitForSingleObject
BOOL RegisterWaitForSingleObject(PHANDLE phNewWaitObject, HANDLE hObject, void* Callback, PVOID Context, ULONG dwMilliseconds, ULONG dwFlags)
Undocumented in source but is binding to Windows. You might be able to learn more by searching the web for its name.
SetHandleInformation
BOOL SetHandleInformation(HANDLE , DWORD , DWORD )
Undocumented in source but is binding to Windows. You might be able to learn more by searching the web for its name.
SetLastError
void SetLastError(DWORD )
Undocumented in source but is binding to Windows. You might be able to learn more by searching the web for its name.
UnregisterWait
BOOL UnregisterWait(HANDLE )
Undocumented in source but is binding to Windows. You might be able to learn more by searching the web for its name.
childCallback
void childCallback(void* tidp, bool )
Undocumented in source. Be warned that the author may not have intended to support it.
constructPathToExe
string constructPathToExe(string exe)

Searches all dirs on path for exe if required, or simply calls it if it's a relative or absolute path

readFromPty
string readFromPty(Pty pty)

Reads from a pty session Returns the string that was read

sendToPty
void sendToPty(Pty pty, string data)

Sends a string to a pty.

setNonBlocking
void setNonBlocking(Pty pty)

Sets the Pty session to non-blocking mode

spawnProcessInPty
Pty spawnProcessInPty(string program, string[] args)

Spawns a process in a pty session By convention the first arg in args should be == program

startChild
auto startChild(string program, string commandLine)

this is good. best to call it with plink.exe so it can talk to unix note that plink asks for the password out of band, so it won't actually work like that. thus specify the password on the command line or better yet, use a private key file e.g. startChild!something("plink.exe", "plink.exe user@server -i key.ppk \"/home/user/terminal-emulator/serverside\"");

Static functions

forkpty
int forkpty(int* master, char* name, void* termp, void* winp)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
ttyname
char* ttyname(int fd)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Static variables

childDead
bool childDead;
Undocumented in source.
waitHandle
HANDLE waitHandle;
Undocumented in source.

Structs

ExpectSink
struct ExpectSink
Undocumented in source.
Pty
struct Pty

A data structure to hold information on a Pty session Holds its fd and a utility property to get its name

Spawn
struct Spawn

Holds information on how to spawn off subprocesses On Linux systems, it uses forkpty On Windows systems, it uses OVERLAPPED io on named pipes

Variables

toRead
auto toRead;
Undocumented in source.

Meta