| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

get_login

#include "sfluid.h"
char *
get_login (void)

Synopsis

Returns the identity of the currently-logged user. The returned string is in a static buffer. Returns NULL if no user is currently logged-in.

Source Code - (sfluid.c)

{
#if (defined (__WINDOWS__))
#   if (defined (WIN32))
    ULONG
        user_name_max = 255;
    static char
        user_name [256];

    if (!GetUserName (user_name, &user_name_max))
        strncpy (user_name, "unknown", sizeof (user_name));
    return (user_name);
#   else
    return ("none");
#   endif
#elif (defined (__UNIX__) || defined (__OS2__) || defined (__VMS__))
    return (getlogin ());
#endif
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation