core: use string instead of compound literal
[rofl0r-proxychains-ng.git] / tests / test_proxy_gethostbyname.c
blobc735d5cb29285597f13758f3c5a69f8f1bb8ea81
1 #include "../src/core.h"
2 #include "../src/common.h"
3 #include <stdio.h>
5 void printhostent(struct hostent *hp) {
6 char ipbuf[16];
7 pc_stringfromipv4(hp->h_addr_list[0], ipbuf);
8 printf("alias: %p, len: %d, name: %s, addrlist: %p, addrtype: %d, ip: %s\n",
9 hp->h_aliases,
10 hp->h_length,
11 hp->h_name,
12 hp->h_addr_list,
13 hp->h_addrtype,
14 ipbuf
17 int main(int argc, char**argv) {
18 struct hostent* ret;
19 struct gethostbyname_data data;
20 if(argc == 1) return 1;
21 ret = proxy_gethostbyname(argv[1], &data);
22 if(ret) printhostent(ret);
23 return 0;