/* inetntoa.c (emx+gcc) -- Copyright (c) 1994-1998 by Eberhard Mattes */

#include <stdio.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <emx/thread.h>

char *inet_ntoa (struct in_addr in)
{
#if defined (__MT__)
  struct _thread *tp = _thread ();
#define result (tp->_th_inetntoa)
#else
  static char result[16];
#endif
  unsigned char *t;

  t = (unsigned char *)&in;
  sprintf (result, "%d.%d.%d.%d",
           t[0] & 0xff, t[1] & 0xff, t[2] & 0xff, t[3] & 0xff);
  return result;
}
