Update copyright notices with scripts/update-copyrights
[glibc.git] / gshadow / gshadow.h
blobfc21c42f7e116c5641351243c4e5cbab6ad05b45
1 /* Copyright (C) 2009-2014 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
18 /* Declaration of types and functions for shadow group suite. */
20 #ifndef _GSHADOW_H
21 #define _GSHADOW_H 1
23 #include <features.h>
25 #include <paths.h>
27 #define __need_FILE
28 #include <stdio.h>
29 #define __need_size_t
30 #include <stddef.h>
32 /* Path to the user database files. */
33 #define GSHADOW _PATH_GSHADOW
36 __BEGIN_DECLS
38 /* Structure of the group file. */
39 struct sgrp
41 char *sg_namp; /* Group name. */
42 char *sg_passwd; /* Encrypted password. */
43 char **sg_adm; /* Group administrator list. */
44 char **sg_mem; /* Group member list. */
48 /* Open database for reading.
50 This function is not part of POSIX and therefore no official
51 cancellation point. But due to similarity with an POSIX interface
52 or due to the implementation it is a cancellation point and
53 therefore not marked with __THROW. */
54 extern void setsgent (void);
56 /* Close database.
58 This function is not part of POSIX and therefore no official
59 cancellation point. But due to similarity with an POSIX interface
60 or due to the implementation it is a cancellation point and
61 therefore not marked with __THROW. */
62 extern void endsgent (void);
64 /* Get next entry from database, perhaps after opening the file.
66 This function is not part of POSIX and therefore no official
67 cancellation point. But due to similarity with an POSIX interface
68 or due to the implementation it is a cancellation point and
69 therefore not marked with __THROW. */
70 extern struct sgrp *getsgent (void);
72 /* Get shadow entry matching NAME.
74 This function is not part of POSIX and therefore no official
75 cancellation point. But due to similarity with an POSIX interface
76 or due to the implementation it is a cancellation point and
77 therefore not marked with __THROW. */
78 extern struct sgrp *getsgnam (const char *__name);
80 /* Read shadow entry from STRING.
82 This function is not part of POSIX and therefore no official
83 cancellation point. But due to similarity with an POSIX interface
84 or due to the implementation it is a cancellation point and
85 therefore not marked with __THROW. */
86 extern struct sgrp *sgetsgent (const char *__string);
88 /* Read next shadow entry from STREAM.
90 This function is not part of POSIX and therefore no official
91 cancellation point. But due to similarity with an POSIX interface
92 or due to the implementation it is a cancellation point and
93 therefore not marked with __THROW. */
94 extern struct sgrp *fgetsgent (FILE *__stream);
96 /* Write line containing shadow password entry to stream.
98 This function is not part of POSIX and therefore no official
99 cancellation point. But due to similarity with an POSIX interface
100 or due to the implementation it is a cancellation point and
101 therefore not marked with __THROW. */
102 extern int putsgent (const struct sgrp *__g, FILE *__stream);
105 #ifdef __USE_MISC
106 /* Reentrant versions of some of the functions above.
108 These functions are not part of POSIX and therefore no official
109 cancellation point. But due to similarity with an POSIX interface
110 or due to the implementation they are cancellation points and
111 therefore not marked with __THROW. */
112 extern int getsgent_r (struct sgrp *__result_buf, char *__buffer,
113 size_t __buflen, struct sgrp **__result);
115 extern int getsgnam_r (const char *__name, struct sgrp *__result_buf,
116 char *__buffer, size_t __buflen,
117 struct sgrp **__result);
119 extern int sgetsgent_r (const char *__string, struct sgrp *__result_buf,
120 char *__buffer, size_t __buflen,
121 struct sgrp **__result);
123 extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf,
124 char *__buffer, size_t __buflen,
125 struct sgrp **__result);
126 #endif /* misc */
128 __END_DECLS
130 #endif /* gshadow.h */