You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mxe/src/neon-test.c

27 lines
727 B

/*
* This file is part of MXE. See LICENSE.md for licensing information.
*/
/* Based on: https://web.archive.org/web/webdav.org/neon/doc/html/refresolve.html */
#include <stdio.h>
#include <neon/ne_basic.h>
int main() {
ne_sock_addr* addr = ne_addr_resolve("yandex.ru", 0);
char buf[256];
if (ne_addr_result(addr)) {
printf("Could not resolve yandex.ru: %s\n",
ne_addr_error(addr, buf, sizeof buf));
} else {
printf("yandex.ru:");
for (const ne_inet_addr* ia = ne_addr_first(addr); ia != NULL; ia = ne_addr_next(addr)) {
printf(" %s", ne_iaddr_print(ia, buf, sizeof buf));
}
printf("\n");
}
ne_addr_destroy(addr);
return 0;
}