/* getlogin for NT/Win95 */

/* $Id$ */

#if defined(__WATCOMC__) || defined(_MSC_VER)
#include <windows.h>
#else
extern GetUserNameA(char *buffer, unsigned long *size);
#endif

char *getlogin()
{
  static char buffer[256];
  unsigned long size = sizeof(buffer);

  if (GetUserNameA(buffer, &size))
    return buffer[0] ? buffer : 0;

  return 0;
}

#ifdef TEST

void main(void)
{
  printf("Win32: <%s>\n", getlogin());
}

#endif
