prg_env_user_name_get()
Abstract
Returns the current user's account name.
Syntax
prg_env_user_name_get (user_name_str)
| Argument | Type | Description |
|---|---|---|
user_name_str |
char * |
A character array that will receive the user's account name. |
Return Type
PrgT_Compcode
PrgC_Compcode_Failure if the user's account name could not be obtained from the operating system; PrgC_Compcode_Success otherwise.
Header
prg_env.h
Example
char user_name_str [128];
...
prg_env_user_name_get (user_name_str);
printf ("The user's account name is %s\n", user_name_str);
Details
The account name is obtained from the operating system (usually by fetching the value of the USER environment variable or equivalent). Because the details vary from system to system, this function is provided as a convenience.
Purpose
Provides a mechanism to obtain the account name of the current user.
Errors
- None
Reference
- None