2008-06-29 05:09:48 -07:00
|
|
|
#ifndef __EVIL_PWD_H__
|
|
|
|
#define __EVIL_PWD_H__
|
|
|
|
|
|
|
|
|
2011-11-12 14:31:16 -08:00
|
|
|
/**
|
|
|
|
* @file pwd.h
|
|
|
|
* @brief The file that provides functions ported from Unix in pwd.h.
|
|
|
|
* @defgroup Evil_Pwd_Group Pwd.h functions
|
2012-12-18 10:38:35 -08:00
|
|
|
* @ingroup Evil
|
2011-11-12 14:31:16 -08:00
|
|
|
*
|
|
|
|
* This header provides functions ported from Unix in dirent.h.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-06-29 05:09:48 -07:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
#include <Evil.h>
|
|
|
|
|
2015-10-13 11:45:33 -07:00
|
|
|
#ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
#endif /* EAPI */
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
# ifdef EFL_EVIL_BUILD
|
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2008-06-29 05:09:48 -07:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2011-11-12 14:31:16 -08:00
|
|
|
/**
|
|
|
|
* @struct passwd
|
|
|
|
* @brief A structure that describes a password.
|
|
|
|
*/
|
2008-06-29 05:09:48 -07:00
|
|
|
struct passwd {
|
2011-11-12 14:31:16 -08:00
|
|
|
char *pw_name; /**< user name */
|
|
|
|
char *pw_passwd; /**< encrypted password (always @c NULL) */
|
2014-12-09 11:35:15 -08:00
|
|
|
uid_t pw_uid; /**< user uid (always 0) */
|
|
|
|
gid_t pw_gid; /**< user gid (always 0) */
|
2011-11-12 14:31:16 -08:00
|
|
|
time_t pw_change; /**< password change time (always 0) */
|
|
|
|
char *pw_class; /**< user access class (always @c NULL) */
|
|
|
|
char *pw_gecos; /**< Honeywell login info */
|
|
|
|
char *pw_dir; /**< home directory */
|
|
|
|
char *pw_shell; /**< default shell */
|
2014-12-09 11:35:15 -08:00
|
|
|
time_t pw_expire; /**< account expiration (always 0) */
|
|
|
|
int pw_fields; /**< internal: fields filled in (always 0) */
|
2008-06-29 05:09:48 -07:00
|
|
|
};
|
|
|
|
|
2011-11-12 14:31:16 -08:00
|
|
|
/**
|
|
|
|
* @brief Return a passwd structure.
|
|
|
|
*
|
2014-12-09 11:35:15 -08:00
|
|
|
* @param n The name of the user.
|
|
|
|
* @return A stacally allocated passwd structure.
|
|
|
|
*
|
|
|
|
* This function fills a static buffer @ref passwd with the user name @p n.
|
|
|
|
*
|
|
|
|
* Conformity: None.
|
|
|
|
*
|
|
|
|
* Supported OS: Windows XP.
|
|
|
|
*/
|
|
|
|
EAPI struct passwd *getpwnam(const char *n);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Return a passwd structure.
|
|
|
|
*
|
|
|
|
* @param uid The User ID.
|
2011-11-12 14:31:16 -08:00
|
|
|
* @return A stacally allocated passwd structure.
|
|
|
|
*
|
|
|
|
* This function fills a static buffer @ref passwd with @p uid and the
|
|
|
|
* user name.
|
|
|
|
*
|
|
|
|
* Conformity: None.
|
|
|
|
*
|
2014-12-09 11:35:15 -08:00
|
|
|
* Supported OS: Windows XP.
|
2011-11-12 14:31:16 -08:00
|
|
|
*/
|
|
|
|
EAPI struct passwd *getpwuid (uid_t uid);
|
2008-06-29 05:09:48 -07:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-10-13 11:45:33 -07:00
|
|
|
#undef EAPI
|
|
|
|
#define EAPI
|
2008-06-29 05:09:48 -07:00
|
|
|
|
2011-11-12 14:31:16 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2008-06-29 05:09:48 -07:00
|
|
|
#endif /* __EVIL_PWD_H__ */
|