1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Public Domain
5  * License:   Public Domain
6  * Authors:   Christian Schneider
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  * Source:    Copied/edited from tango.stdc.posix.pwd
9  */
10 module tango.stdc.posix.grp;
11 
12 private import tango.stdc.posix.config;
13 public import tango.stdc.posix.sys.types; // for gid_t, uid_t
14 
15 extern (C):
16 
17 //
18 // Required
19 //
20 /*
21 struct group
22 {
23     char*   gr_name;
24     gid_t   gr_gid;
25     char**  gr_mem;
26 }
27 
28 group* getgrnam(in char*);
29 group* getgrgid(gid_t);
30 */
31 
32 version( linux )
33 {
34     struct group
35     {
36         char*   gr_name;
37         char*   gr_passwd;
38         gid_t   gr_gid;
39         char**  gr_mem;
40     }
41 }
42 else version(OSX)
43 {
44     struct group
45     {
46         char*   gr_name;
47         char*   gr_passwd;
48         gid_t   gr_gid;
49         char**  gr_mem;
50     }
51 }
52 else version( FreeBSD )
53 {
54     struct group
55     {
56         char*   gr_name;
57         char*   gr_passwd;
58         gid_t   gr_gid;
59         char**  gr_mem;
60     }
61 }
62 else version( solaris )
63 {
64     struct group
65     {
66         char*   gr_name;
67         char*   gr_passwd;
68         gid_t   gr_gid;
69         char**  gr_mem;
70     }
71 }
72 group* getgrnam(in char*);
73 group* getgrgid(gid_t);
74 
75 //
76 // Thread-Safe Functions (TSF)
77 //
78 /*
79 int getgrnam_r(in char*, group*, char*, size_t, group**);
80 int getgrgid_r(gid_t, group*, char*, size_t, group**);
81 */
82 
83 version( linux )
84 {
85     int getgrnam_r(in char*, group*, char*, size_t, group**);
86     int getgrgid_r(gid_t, group*, char*, size_t, group**);
87 }
88 else version(OSX)
89 {
90     int getgrnam_r(in char*, group*, char*, size_t, group**);
91     int getgrgid_r(gid_t, group*, char*, size_t, group**);
92 }
93 else version( FreeBSD )
94 {
95     int getgrnam_r(in char*, group*, char*, size_t, group**);
96     int getgrgid_r(gid_t, group*, char*, size_t, group**);
97 }
98 else version( solaris )
99 {
100     int getgrnam_r(in char*, group*, char*, size_t, group**);
101     int getgrgid_r(gid_t, group*, char*, size_t, group**);
102 }
103 //
104 // XOpen (XSI)
105 //
106 /*
107 void    endgrent();
108 passwd* getgrent();
109 void    setgrent();
110 */
111 
112 version( linux )
113 {
114     void    endgrent();
115     group* getgrent();
116     void    setgrent();
117 }
118 else version(OSX)
119 {
120     void    endgrent();
121     group* getgrent();
122     void    setgrent();
123 }
124 else version (FreeBSD)
125 {
126     void    endgrent();
127     group* getgrent();
128     void    setgrent();
129 }
130 else version ( solaris )
131 {
132     void    endgrent();
133     group* getgrent();
134     void    setgrent();
135 }