Hi Simon, Can we add some documentation here? I don't find that the comment in the implementation is clear enough.
diff -r -c3 --exclude=CVS gnulib-20060614-modified/lib/inet_pton.h gnulib-20060628-modified/lib/inet_pton.h *** gnulib-20060614-modified/lib/inet_pton.h 2006-06-29 01:30:47.000000000 +0200 --- gnulib-20060628-modified/lib/inet_pton.h 2006-06-29 00:32:23.000000000 +0200 *************** *** 21,26 **** --- 21,36 ---- # include <arpa/inet.h> #endif + /* Convert an internet address from a printable, presentable format to internal + format. + AF is an internet address family, such as AF_INET or AF_INET6. + SRC points to a printable representation of the address (in numeric form, not + surrounded by [...], no DNS lookup is done). + DST points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr' + (for AF_INET6). + If the string at SRC is a valid printable representation of an address of the + given family, store the internal format of the address at DST and return 1. + If it is invalid, return 0. Upon error, set errno and return -1. */ #if !HAVE_DECL_INET_PTON extern int inet_pton (int af, const char *restrict src, void *restrict dst); #endif