1 ///////////////////////////////////////////////////////////////////////////////
2 //Telnet Win32 : an ANSI telnet client.
3 //Copyright (C) 1998-2000 Paul Brannan
4 //Copyright (C) 1998 I.Ioannou
5 //Copyright (C) 1997 Brad Johnson
7 //This program is free software; you can redistribute it and/or
8 //modify it under the terms of the GNU General Public License
9 //as published by the Free Software Foundation; either version 2
10 //of the License, or (at your option) any later version.
12 //This program is distributed in the hope that it will be useful,
13 //but WITHOUT ANY WARRANTY; without even the implied warranty of
14 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 //GNU General Public License for more details.
17 //You should have received a copy of the GNU General Public License
18 //along with this program; if not, write to the Free Software
19 //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 ///////////////////////////////////////////////////////////////////////////
28 // FIX ME!! This code not yet functional.
30 #define TERMINATOR '~'
31 #define SPACE_HOLDER '_'
33 // processScript by Bryan Montgomery
34 // modified to handle script file by Paul Brannan
35 BOOL
TScript::processScript (char* data
) {
36 /* char* end = strchr(script,TERMINATOR);
40 char* current = new char(sizeof(char)*strlen(script));
41 strncpy(current,script,(int)(end-script));
42 current[(int)(end-script)]=0;
44 if (strstr(data,current) != 0) {
46 end = strchr(script,TERMINATOR);
47 while ((ptr = strchr(ptr,SPACE_HOLDER)) != 0 && ptr < end) {
50 Network.WriteString(script,(int)(end-script));
51 Network.WriteString("\r\n",2);
59 void TScript::initScript (char *filename
) {
61 fp
= fopen(filename
, "rt");