summaryrefslogtreecommitdiff
path: root/src/lib/evil/pwd.h
blob: fd422eb0adc006456cc5ed2b3879cc246fd11fb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef __EVIL_PWD_H__
#define __EVIL_PWD_H__


/**
 * @file pwd.h
 * @brief The file that provides functions ported from Unix in pwd.h.
 * @defgroup Evil_Pwd_Group Pwd.h functions
 * @ingroup Evil
 *
 * This header provides functions ported from Unix in pwd.h.
 *
 * @{
 */


#include <time.h>

#include <Evil.h>

#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


#ifdef __cplusplus
extern "C" {
#endif


/**
 * @struct passwd
 * @brief A structure that describes a password.
 */
struct passwd {
   char    *pw_name;       /**< user name */
   char    *pw_passwd;     /**< encrypted password (always @c NULL) */
   uid_t    pw_uid;        /**< user uid (always 0) */
   gid_t    pw_gid;        /**< user gid (always 0) */
   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 */
   time_t   pw_expire;     /**< account expiration (always 0) */
   int      pw_fields;     /**< internal: fields filled in (always 0) */
};

/**
 * @brief Return a passwd structure.
 *
 * @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.
 * @return A stacally allocated passwd structure.
 *
 * This function fills a static buffer @ref passwd with @p uid and the
 * user name.
 *
 * Conformity: None.
 *
 * Supported OS: Windows XP.
 */
EAPI struct passwd *getpwuid (uid_t uid);


#ifdef __cplusplus
}
#endif

#undef EAPI
#define EAPI


/**
 * @}
 */


#endif /* __EVIL_PWD_H__ */