Commit in rosapps/tests/gethostbyname on MAIN
gethostbyname.c+21added 1.1
makefile+22added 1.1
+43
2 added files
simple gethostbyname test case

rosapps/tests/gethostbyname
gethostbyname.c added at 1.1
diff -N gethostbyname.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ gethostbyname.c	24 Nov 2004 04:08:44 -0000	1.1
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include <winsock2.h>
+
+int main( int argc, char **argv ) {
+  WSADATA wdata;
+
+  WSAStartup( 0x0101, &wdata );
+
+  if( argc > 1 ) {
+    struct hostent *he = gethostbyname( argv[1] );
+    if( !he ) {
+      printf( "lookup of host %s failed: %d\n", argv[1], WSAGetLastError() );
+      return 1;
+    } else {
+      printf( "Lookup of host %s returned %s\n", 
+	      argv[1], inet_ntoa(*((struct in_addr *)he->h_addr_list[0])) );
+      return 0;
+    }
+  } else
+    return 1;
+}

rosapps/tests/gethostbyname
makefile added at 1.1
diff -N makefile
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ makefile	24 Nov 2004 04:08:44 -0000	1.1
@@ -0,0 +1,22 @@
+
+PATH_TO_TOP = ../../../reactos
+
+TARGET_NORC = yes
+
+TARGET_TYPE = program
+
+TARGET_APPTYPE = console
+
+TARGET_NAME = gethostbyname
+
+TARGET_SDKLIBS = ws2_32.a kernel32.a
+
+TARGET_OBJECTS = $(TARGET_NAME).o
+
+TARGET_CFLAGS = -D__USE_W32API -Wall -Werror -g
+
+include $(PATH_TO_TOP)/rules.mak
+
+include $(TOOLS_PATH)/helper.mk
+
+# EOF
CVSspam 0.2.8