1 /*
2  * $Id: usernm.c,v 1.1 2005-09-18 22:05:35 dhmunro Exp $
3  * p_getuser for MS Windows
4  */
5 /* Copyright (c) 2005, The Regents of the University of California.
6  * All rights reserved.
7  * This file is part of yorick (http://yorick.sourceforge.net).
8  * Read the accompanying LICENSE file for details.
9  */
10 
11 #include "pstdlib.h"
12 #include "play.h"
13 
14 /* GetUserName in advapi32.lib */
15 #include <windows.h>
16 
17 char *
p_getuser(void)18 p_getuser(void)
19 {
20   DWORD sz = P_WKSIZ;
21   if (GetUserName(p_wkspc.c, &sz))
22     return p_wkspc.c;
23   else
24     return 0;
25 }
26