mirror of
https://github.com/reactos/reactos.git
synced 2024-10-31 03:48:17 +00:00
30 lines
503 B
C
30 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;
|
|
}
|
|
|