Adding rostests as part of the tree restructure
[reactos.git] / rostests / tests / gethostbyname / gethostbyname.c
1 #include <stdio.h>
2 #include <winsock2.h>
3
4 int main( int argc, char **argv ) {
5 WSADATA wdata;
6
7 WSAStartup( 0x0101, &wdata );
8
9 if( argc > 1 ) {
10 struct hostent *he = gethostbyname( argv[1] );
11 if( !he ) {
12 printf( "lookup of host %s failed: %d\n", argv[1], WSAGetLastError() );
13 return 1;
14 } else {
15 printf( "Lookup of host %s returned %s\n",
16 argv[1], inet_ntoa(*((struct in_addr *)he->h_addr_list[0])) );
17 return 0;
18 }
19 } else
20 return 1;
21 }