From fa73496098893e90330040b8f43f2773b42eed12 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 22 Sep 2014 18:15:58 +0200 Subject: usock: add usock_port() for convenient use of numeric ports Add a new helper function usock_port() which converts the given numeric port number into a string using a private static buffer. This way a calling application can conveniently use numeric port arguments without having to convert them before: int fd = usock(USOCK_UDP, "example.org", usock_port(80)); Signed-off-by: Jo-Philipp Wich --- usock.h | 1 + 1 file changed, 1 insertion(+) (limited to 'usock.h') diff --git a/usock.h b/usock.h index 5df4362..8345581 100644 --- a/usock.h +++ b/usock.h @@ -30,6 +30,7 @@ #define USOCK_IPV4ONLY 0x4000 #define USOCK_UNIX 0x8000 +const char *usock_port(int port); int usock(int type, const char *host, const char *service); #endif /* USOCK_H_ */ -- cgit v1.2.3