diff --git a/rosapps/tests/gethostbyname/gethostbyname.c b/rosapps/tests/gethostbyname/gethostbyname.c new file mode 100644 index 00000000000..1f9479fd113 --- /dev/null +++ b/rosapps/tests/gethostbyname/gethostbyname.c @@ -0,0 +1,21 @@ +#include +#include + +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; +} diff --git a/rosapps/tests/gethostbyname/makefile b/rosapps/tests/gethostbyname/makefile new file mode 100644 index 00000000000..cae7c6ed463 --- /dev/null +++ b/rosapps/tests/gethostbyname/makefile @@ -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