mirror of
https://github.com/reactos/reactos.git
synced 2024-11-19 05:22:59 +00:00
29 lines
503 B
C
29 lines
503 B
C
#define WIN32_NO_STATUS
|
|
#define _INC_WINDOWS
|
|
#include <windef.h>
|
|
#include <winsock2.h>
|
|
|
|
const char *
|
|
WSAAPI
|
|
inet_ntop (int af,
|
|
const void *src,
|
|
char *dst,
|
|
size_t cnt)
|
|
{
|
|
struct in_addr in;
|
|
char *text_addr;
|
|
|
|
if (af == AF_INET)
|
|
{
|
|
memcpy(&in.s_addr, src, sizeof(in.s_addr));
|
|
text_addr = inet_ntoa(in);
|
|
if (text_addr && dst)
|
|
{
|
|
strncpy(dst, text_addr, cnt);
|
|
return dst;
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|