]> git.llucax.com Git - software/druntime.git/blob - import/stdc/posix/pwd.d
First commit of the D Runtime Project. This includes a fully functional runtime...
[software/druntime.git] / import / stdc / posix / pwd.d
1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Public Domain
5  * License:   Public Domain
6  * Authors:   Sean Kelly
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  */
9 module stdc.posix.pwd;
10
11 private import stdc.posix.config;
12 public import stdc.posix.sys.types; // for gid_t, uid_t
13
14 extern (C):
15
16 //
17 // Required
18 //
19 /*
20 struct passwd
21 {
22     char*   pw_name;
23     uid_t   pw_uid;
24     gid_t   pw_gid;
25     char*   pw_dir;
26     char*   pw_shell;
27 }
28
29 passwd* getpwnam(in char*);
30 passwd* getpwuid(uid_t);
31 */
32
33 version( linux )
34 {
35     struct passwd
36     {
37         char*   pw_name;
38         char*   pw_passwd;
39         uid_t   pw_uid;
40         gid_t   pw_gid;
41         char*   pw_gecos;
42         char*   pw_dir;
43         char*   pw_shell;
44     }
45 }
46 else version( darwin )
47 {
48     struct passwd
49     {
50         char*   pw_name;
51         char*   pw_passwd;
52         uid_t   pw_uid;
53         gid_t   pw_gid;
54         time_t  pw_change;
55         char*   pw_class;
56         char*   pw_gecos;
57         char*   pw_dir;
58         char*   pw_shell;
59         time_t  pw_expire;
60     }
61 }
62 else version( freebsd )
63 {
64     struct passwd
65     {
66         char*   pw_name;        /* user name */
67         char*   pw_passwd;      /* encrypted password */
68         uid_t   pw_uid;         /* user uid */
69         gid_t   pw_gid;         /* user gid */
70         time_t  pw_change;      /* password change time */
71         char*   pw_class;       /* user access class */
72         char*   pw_gecos;       /* Honeywell login info */
73         char*   pw_dir;     /* home directory */
74         char*   pw_shell;       /* default shell */
75         time_t  pw_expire;      /* account expiration */
76         int pw_fields;      /* internal: fields filled in */
77     }
78 }
79
80 passwd* getpwnam(in char*);
81 passwd* getpwuid(uid_t);
82
83 //
84 // Thread-Safe Functions (TSF)
85 //
86 /*
87 int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
88 int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
89 */
90
91 version( linux )
92 {
93     int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
94     int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
95 }
96 else version( darwin )
97 {
98     int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
99     int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
100 }
101 else version( freebsd )
102 {
103     int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
104     int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
105 }
106 //
107 // XOpen (XSI)
108 //
109 /*
110 void    endpwent();
111 passwd* getpwent();
112 void    setpwent();
113 */
114
115 version( linux )
116 {
117     void    endpwent();
118     passwd* getpwent();
119     void    setpwent();
120 }
121 else version ( darwin )
122 {
123     void    endpwent();
124     passwd* getpwent();
125     void    setpwent();
126 }
127 else version ( freebsd )
128 {
129     void    endpwent();
130     passwd* getpwent();
131     void    setpwent();
132 }