| 1 |
maya |
3227 |
#ifndef __TTPLUG_H |
| 2 |
|
|
#define __TTPLUG_H |
| 3 |
|
|
|
| 4 |
|
|
#ifdef __cplusplus |
| 5 |
|
|
extern "C" { |
| 6 |
|
|
#endif |
| 7 |
|
|
|
| 8 |
|
|
#include "ttplugin.h" |
| 9 |
|
|
|
| 10 |
|
|
/* This function initializes the extensions and is called at the beginning |
| 11 |
|
|
of the program. */ |
| 12 |
|
|
void PASCAL FAR TTXInit(PTTSet ts, PComVar cv); |
| 13 |
|
|
|
| 14 |
|
|
/* This function is called when a TCP connection is about to be opened. |
| 15 |
|
|
This macro stuff is to make sure that the functions in the caller's |
| 16 |
|
|
EXE or DLL are hooked. */ |
| 17 |
|
|
void PASCAL FAR TTXInternalOpenTCP(TTXSockHooks FAR * hooks); |
| 18 |
|
|
#define TTXOpenTCP() \ |
| 19 |
|
|
do { \ |
| 20 |
|
|
static TTXSockHooks SockHooks = { \ |
| 21 |
|
|
&Pclosesocket, &Pconnect, &Phtonl, &Phtons, &Pinet_addr, \ |
| 22 |
|
|
&Pioctlsocket, &Precv, &Pselect, &Psend, &Psetsockopt, \ |
| 23 |
|
|
&Psocket, &PWSAAsyncSelect, &PWSAAsyncGetHostByName, \ |
| 24 |
|
|
&PWSACancelAsyncRequest, &PWSAGetLastError \ |
| 25 |
|
|
}; \ |
| 26 |
|
|
TTXInternalOpenTCP(&SockHooks); \ |
| 27 |
|
|
} while (0) |
| 28 |
|
|
|
| 29 |
|
|
/* This function is called when a TCP connection has been closed. |
| 30 |
|
|
This macro stuff is to make sure that the functions in the caller's |
| 31 |
|
|
EXE or DLL are hooked. */ |
| 32 |
|
|
void PASCAL FAR TTXInternalCloseTCP(TTXSockHooks FAR * hooks); |
| 33 |
|
|
#define TTXCloseTCP() \ |
| 34 |
|
|
do { \ |
| 35 |
|
|
static TTXSockHooks SockHooks = { \ |
| 36 |
|
|
&Pclosesocket, &Pconnect, &Phtonl, &Phtons, &Pinet_addr, \ |
| 37 |
|
|
&Pioctlsocket, &Precv, &Pselect, &Psend, &Psetsockopt, \ |
| 38 |
|
|
&Psocket, &PWSAAsyncSelect, &PWSAAsyncGetHostByName, \ |
| 39 |
|
|
&PWSACancelAsyncRequest, &PWSAGetLastError \ |
| 40 |
|
|
}; \ |
| 41 |
|
|
TTXInternalCloseTCP(&SockHooks); \ |
| 42 |
|
|
} while (0) |
| 43 |
|
|
|
| 44 |
|
|
void PASCAL FAR TTXInternalOpenFile(TTXFileHooks FAR * hooks); |
| 45 |
|
|
#define TTXOpenFile() \ |
| 46 |
|
|
do { \ |
| 47 |
|
|
static TTXFileHooks FileHooks = { \ |
| 48 |
|
|
&PCreateFile, &PCloseFile, &PReadFile, &PWriteFile \ |
| 49 |
|
|
}; \ |
| 50 |
|
|
TTXInternalOpenFile(&FileHooks); \ |
| 51 |
|
|
} while (0) |
| 52 |
|
|
|
| 53 |
|
|
void PASCAL FAR TTXInternalCloseFile(TTXFileHooks FAR * hooks); |
| 54 |
|
|
#define TTXCloseFile() \ |
| 55 |
|
|
do { \ |
| 56 |
|
|
static TTXFileHooks FileHooks = { \ |
| 57 |
|
|
&PCreateFile, &PCloseFile, &PReadFile, &PWriteFile \ |
| 58 |
|
|
}; \ |
| 59 |
|
|
TTXInternalCloseFile(&FileHooks); \ |
| 60 |
|
|
} while (0) |
| 61 |
|
|
|
| 62 |
|
|
/* This function is called after the TTDLG DLL has been loaded. |
| 63 |
|
|
This macro stuff is to make sure that the functions in the caller's |
| 64 |
|
|
EXE or DLL are hooked. */ |
| 65 |
|
|
void PASCAL FAR TTXInternalGetUIHooks(TTXUIHooks FAR * hooks); |
| 66 |
|
|
#define TTXGetUIHooks() \ |
| 67 |
|
|
do { \ |
| 68 |
|
|
static TTXUIHooks UIHooks = { \ |
| 69 |
|
|
&SetupTerminal, &SetupWin, &SetupKeyboard, &SetupSerialPort, \ |
| 70 |
|
|
&SetupTCPIP, &GetHostName, &ChangeDirectory, &AboutDialog, \ |
| 71 |
|
|
&ChooseFontDlg, &SetupGeneral, &WindowWindow \ |
| 72 |
|
|
}; \ |
| 73 |
|
|
TTXInternalGetUIHooks(&UIHooks); \ |
| 74 |
|
|
} while (0) |
| 75 |
|
|
|
| 76 |
|
|
/* This function is called after the TTSET DLL has been loaded. |
| 77 |
|
|
This macro stuff is to make sure that the functions in the caller's |
| 78 |
|
|
EXE or DLL are hooked. */ |
| 79 |
|
|
void PASCAL FAR TTXInternalGetSetupHooks(TTXSetupHooks FAR * hooks); |
| 80 |
|
|
#define TTXGetSetupHooks() \ |
| 81 |
|
|
do { \ |
| 82 |
|
|
static TTXSetupHooks SetupHooks = { \ |
| 83 |
|
|
&ReadIniFile, &WriteIniFile, &ReadKeyboardCnf, &CopyHostList, \ |
| 84 |
|
|
&AddHostToList, &ParseParam \ |
| 85 |
|
|
}; \ |
| 86 |
|
|
TTXInternalGetSetupHooks(&SetupHooks); \ |
| 87 |
|
|
} while (0) |
| 88 |
|
|
|
| 89 |
|
|
/* This function is called when the window size has changed. */ |
| 90 |
|
|
void PASCAL FAR TTXSetWinSize(int rows, int cols); |
| 91 |
|
|
|
| 92 |
|
|
/* This function adds the extensions' entries to the menu, which is the |
| 93 |
|
|
handle for the program's menubar. */ |
| 94 |
|
|
void PASCAL FAR TTXModifyMenu(HMENU menu); |
| 95 |
|
|
|
| 96 |
|
|
/* This function is called when a popup menu is about to be displayed. |
| 97 |
|
|
The status of the entries is set appropriately. */ |
| 98 |
|
|
void PASCAL FAR TTXModifyPopupMenu(HMENU menu); |
| 99 |
|
|
|
| 100 |
|
|
/* This function calls on the extensions to handle a command. It returns |
| 101 |
|
|
TRUE if they handle it, otherwise FALSE. */ |
| 102 |
|
|
BOOL PASCAL FAR TTXProcessCommand(HWND hWin, WORD cmd); |
| 103 |
|
|
|
| 104 |
|
|
/* This function is called to see whether Telnet mode can be turned on when |
| 105 |
|
|
Tera Term thinks it has detected a telnetd */ |
| 106 |
|
|
void PASCAL FAR TTXEnd(void); |
| 107 |
|
|
|
| 108 |
|
|
/* This function is called when a new Tera Term is being started with certain |
| 109 |
|
|
settings and the extension may wish to add some options to the command line */ |
| 110 |
|
|
void PASCAL FAR TTXSetCommandLine(PCHAR cmd, int cmdlen, PGetHNRec rec); |
| 111 |
|
|
#ifdef __cplusplus |
| 112 |
|
|
} |
| 113 |
|
|
#endif |
| 114 |
|
|
|
| 115 |
|
|
#endif |