]>
Commit | Line | Data |
---|---|---|
04277e02 | 1 | /* Copyright (C) 2009-2019 Free Software Foundation, Inc. |
829fea46 UD |
2 | This file is part of the GNU C Library. |
3 | ||
4 | The GNU C Library is free software; you can redistribute it and/or | |
5 | modify it under the terms of the GNU Lesser General Public | |
6 | License as published by the Free Software Foundation; either | |
7 | version 2.1 of the License, or (at your option) any later version. | |
8 | ||
9 | The GNU C Library is distributed in the hope that it will be useful, | |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | Lesser General Public License for more details. | |
13 | ||
14 | You should have received a copy of the GNU Lesser General Public | |
59ba27a6 | 15 | License along with the GNU C Library; if not, see |
5a82c748 | 16 | <https://www.gnu.org/licenses/>. */ |
829fea46 UD |
17 | |
18 | /* Declaration of types and functions for shadow group suite. */ | |
19 | ||
20 | #ifndef _GSHADOW_H | |
21 | #define _GSHADOW_H 1 | |
22 | ||
23 | #include <features.h> | |
829fea46 | 24 | #include <paths.h> |
199fc19d | 25 | #include <bits/types/FILE.h> |
829fea46 | 26 | |
829fea46 UD |
27 | #define __need_size_t |
28 | #include <stddef.h> | |
29 | ||
30 | /* Path to the user database files. */ | |
31 | #define GSHADOW _PATH_GSHADOW | |
32 | ||
33 | ||
34 | __BEGIN_DECLS | |
35 | ||
36 | /* Structure of the group file. */ | |
37 | struct sgrp | |
38 | { | |
39 | char *sg_namp; /* Group name. */ | |
40 | char *sg_passwd; /* Encrypted password. */ | |
41 | char **sg_adm; /* Group administrator list. */ | |
42 | char **sg_mem; /* Group member list. */ | |
43 | }; | |
44 | ||
45 | ||
46 | /* Open database for reading. | |
47 | ||
48 | This function is not part of POSIX and therefore no official | |
49 | cancellation point. But due to similarity with an POSIX interface | |
50 | or due to the implementation it is a cancellation point and | |
51 | therefore not marked with __THROW. */ | |
52 | extern void setsgent (void); | |
53 | ||
54 | /* Close database. | |
55 | ||
56 | This function is not part of POSIX and therefore no official | |
57 | cancellation point. But due to similarity with an POSIX interface | |
58 | or due to the implementation it is a cancellation point and | |
59 | therefore not marked with __THROW. */ | |
60 | extern void endsgent (void); | |
61 | ||
62 | /* Get next entry from database, perhaps after opening the file. | |
63 | ||
64 | This function is not part of POSIX and therefore no official | |
65 | cancellation point. But due to similarity with an POSIX interface | |
66 | or due to the implementation it is a cancellation point and | |
67 | therefore not marked with __THROW. */ | |
68 | extern struct sgrp *getsgent (void); | |
69 | ||
70 | /* Get shadow entry matching NAME. | |
71 | ||
72 | This function is not part of POSIX and therefore no official | |
73 | cancellation point. But due to similarity with an POSIX interface | |
74 | or due to the implementation it is a cancellation point and | |
75 | therefore not marked with __THROW. */ | |
a784e502 | 76 | extern struct sgrp *getsgnam (const char *__name); |
829fea46 UD |
77 | |
78 | /* Read shadow entry from STRING. | |
79 | ||
80 | This function is not part of POSIX and therefore no official | |
81 | cancellation point. But due to similarity with an POSIX interface | |
82 | or due to the implementation it is a cancellation point and | |
83 | therefore not marked with __THROW. */ | |
a784e502 | 84 | extern struct sgrp *sgetsgent (const char *__string); |
829fea46 UD |
85 | |
86 | /* Read next shadow entry from STREAM. | |
87 | ||
88 | This function is not part of POSIX and therefore no official | |
89 | cancellation point. But due to similarity with an POSIX interface | |
90 | or due to the implementation it is a cancellation point and | |
91 | therefore not marked with __THROW. */ | |
92 | extern struct sgrp *fgetsgent (FILE *__stream); | |
93 | ||
94 | /* Write line containing shadow password entry to stream. | |
95 | ||
96 | This function is not part of POSIX and therefore no official | |
97 | cancellation point. But due to similarity with an POSIX interface | |
98 | or due to the implementation it is a cancellation point and | |
99 | therefore not marked with __THROW. */ | |
a784e502 | 100 | extern int putsgent (const struct sgrp *__g, FILE *__stream); |
829fea46 UD |
101 | |
102 | ||
103 | #ifdef __USE_MISC | |
104 | /* Reentrant versions of some of the functions above. | |
105 | ||
106 | These functions are not part of POSIX and therefore no official | |
107 | cancellation point. But due to similarity with an POSIX interface | |
108 | or due to the implementation they are cancellation points and | |
109 | therefore not marked with __THROW. */ | |
110 | extern int getsgent_r (struct sgrp *__result_buf, char *__buffer, | |
111 | size_t __buflen, struct sgrp **__result); | |
112 | ||
a784e502 | 113 | extern int getsgnam_r (const char *__name, struct sgrp *__result_buf, |
829fea46 UD |
114 | char *__buffer, size_t __buflen, |
115 | struct sgrp **__result); | |
116 | ||
a784e502 | 117 | extern int sgetsgent_r (const char *__string, struct sgrp *__result_buf, |
829fea46 UD |
118 | char *__buffer, size_t __buflen, |
119 | struct sgrp **__result); | |
120 | ||
121 | extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf, | |
122 | char *__buffer, size_t __buflen, | |
123 | struct sgrp **__result); | |
124 | #endif /* misc */ | |
125 | ||
126 | __END_DECLS | |
127 | ||
128 | #endif /* gshadow.h */ |