atop3abz
Convert a string to a port number
Usage
#include <abz/atop.h> int atop(in_port_t *port, const char *str);
Libraries
Abz Library (-labz), Debug Library (-ldebug)
Overview
The atop() function converts a string to a port number. The string may either be a service as specified in /etc/services or a port number.
The port number is stored in network byte order.
Return value
The atop() function returns 0 if successful or -1 if some error occurred. Check errno to see what error occurred.
Notes
None of the libabz routines are thread-safe. I'm not planning to change this either! For more information, please see http://threading.2038bug.com/
If the library was compiled without the GETSERVBYNAME flag, only port numbers may be specified.