Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

username.h File Reference


Detailed Description

Obtain information about the current user.

Go to the source code of this file.

Defines

#define USERNAME_MAX   256
 The maximum size of a user name.

Functions

int username_is_super ()
 Determine if the current user is the super user.
int username_get (char *name)
 Get the name of the current user.
int username_set (const char *name)
 Switch to the named user.
int username_home (char *dir)
 Get the current user's home directory.


Define Documentation

#define USERNAME_MAX   256
 

The maximum size of a user name.


Function Documentation

int username_is_super  ) 
 

Determine if the current user is the super user.

Returns:
True if the current user is root, false otherwise.

int username_get char *  name  ) 
 

Get the name of the current user.

Parameters:
name A string of USERNAME_MAX bytes to hold the username.
Returns:
True if the username could be found, false otherwise.

int username_set const char *  name  ) 
 

Switch to the named user.

Parameters:
name The name of the user to change privilege to.
Returns:
True if the privilege could be changed, false otherwise.

int username_home char *  dir  ) 
 

Get the current user's home directory.

Parameters:
dir A string to hold the home directory.
Returns:
True if the home directory could be found, false otherwise.


Generated on Thu Jul 2 15:49:25 2009 for cctools by  doxygen 1.3.9.1