Commit in reactos/apps/tests/oskittcp on MAIN
tcptest.cpp+321.3 -> 1.4
added 'type' command

reactos/apps/tests/oskittcp
tcptest.cpp 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- tcptest.cpp	13 Sep 2004 22:59:22 -0000	1.3
+++ tcptest.cpp	19 Sep 2004 15:55:35 -0000	1.4
@@ -254,6 +254,38 @@
 			}
 			printf( "\n" );
 		    }
+		} else if ( word == "type" ) {
+			std::string therest = &cmdin.str()[word.size()];
+			char* p = &therest[0];
+			p += strspn ( p, " \t" );
+			char* src = p;
+			char* dst = p;
+			while ( *src )
+			{
+				if ( *src == '\\' )
+				{
+					src++;
+					char c = *src++;
+					switch ( c )
+					{
+					case 'b': *dst++ = '\b'; break;
+					case 'n': *dst++ = '\n'; break;
+					case 'r': *dst++ = '\r'; break;
+					case 't': *dst++ = '\t'; break;
+					case 'v': *dst++ = '\v'; break;
+					default: *dst++ = c; break;
+					}
+				}
+				else
+					*dst++ = *src++;
+			}
+			*dst = '\0';
+			if ( (err = OskitTCPSend ( conn, (OSK_PCHAR)p, strlen(p), (OSK_UINT*)&bytin, 0 ))
+				!= 0 ) {
+				fprintf ( stderr, "OskitTCPConnect: error %d\n", err );
+			} else {
+				printf ( "wrote %d bytes\n", bytin );
+			}
 		} else if( word == "send" ) {
 		    off = 0;
 		    while( cmdin >> word ) {
CVSspam 0.2.8