Annotation of libaitio/example/test_n2.c, revision 1.2
1.2 ! misho 1: #include <stdio.h>
! 2: #include <aitio.h>
! 3:
! 4:
! 5: int
! 6: main(int argc, char **argv)
! 7: {
! 8: io_sockaddr_t addr = { 0 };
! 9: ait_val_t v;
! 10:
! 11: if (!io_gethostbyname(argv[1], 1234, &addr)) {
! 12: printf("Error:: #%d - %s\n", io_GetErrno(), io_GetError());
! 13: return 1;
! 14: }
! 15:
! 16: if (!io_n2addr(&addr, &v)) {
! 17: printf("Error:: #%d - %s\n", io_GetErrno(), io_GetError());
! 18: return 2;
! 19: }
! 20:
! 21: printf("Address is %s port is %u\n", AIT_GET_STR(&v), io_n2port(&addr));
! 22:
! 23: AIT_FREE_VAL(&v);
! 24: return 0;
! 25: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>