Added reentrant versions of inet_ntoa/ipaddr_ntoa inet_ntoa_r/ipaddr_ntoa_r

This commit is contained in:
goldsimon
2010-02-08 20:14:21 +00:00
parent ececc3ca45
commit 79e6b4c819
4 changed files with 33 additions and 5 deletions

View File

@@ -96,6 +96,7 @@ struct in_addr {
#define inet_addr(cp) ipaddr_addr(cp)
#define inet_aton(cp, addr) ipaddr_aton(cp, (ip_addr_t*)addr)
#define inet_ntoa(addr) ipaddr_ntoa((ip_addr_t*)&(addr))
#define inet_ntoa_r(addr, buf, buflen) ipaddr_ntoa_r((ip_addr_t*)&(addr), buf, buflen)
#ifdef __cplusplus
}

View File

@@ -204,6 +204,7 @@ u32_t ipaddr_addr(const char *cp);
int ipaddr_aton(const char *cp, ip_addr_t *addr);
/** returns ptr to static buffer; not reentrant! */
char *ipaddr_ntoa(ip_addr_t *addr);
char *ipaddr_ntoa_r(ip_addr_t *addr, char *buf, int buflen);
#ifdef __cplusplus
}