X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnetwork%2Fgetaddrinfo.c;h=7d56c2dccf386ce23e3f4a820d6e971453ee9ded;hb=af64d14a00bbaca4c17b7f3feb7399d7a0363f23;hp=ac2d67b819ffea93b9bba7da4394ca35f7562fd7;hpb=5c2490264a2c92be8bdfc58ba988c2cda006165a;p=vlc diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c index ac2d67b819..7d56c2dccf 100644 --- a/src/network/getaddrinfo.c +++ b/src/network/getaddrinfo.c @@ -33,10 +33,9 @@ #include /* strlen(), memcpy(), memset(), strchr() */ #include /* malloc(), free(), strtoul() */ #include +#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #ifdef HAVE_ARPA_INET_H # include #endif @@ -563,6 +562,18 @@ int vlc_getnameinfo( const struct sockaddr *sa, int salen, } +/** + * Resolves a host name to a list of socket addresses (like getaddrinfo()). + * + * @param p_this a VLC object + * @param node host name to resolve (encoded as UTF-8), or NULL + * @param i_port port number for the socket addresses + * @param p_hints parameters (see getaddrinfo() manual page) + * @param res pointer set to the resulting chained list. + * @return 0 on success, a getaddrinfo() error otherwise. + * On failure, *res is undefined. On success, it must be freed with + * vlc_freeaddrinfo(). + */ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node, int i_port, const struct addrinfo *p_hints, struct addrinfo **res ) @@ -676,7 +687,9 @@ int vlc_getaddrinfo( vlc_object_t *p_this, const char *node, #endif ret = getaddrinfo (node, psz_service, &hints, res); +#if defined(AI_IDN) || defined(WIN32) out: +#endif LocaleFree (node); return ret; }