Updated to fedora-glibc-20090424T0747
[glibc/history.git] / gshadow / gshadow.h
blobd0b28aeaa39d2b0603f669ebef68b102ed3faafa
1 /* Copyright (C) 2009 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, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 /* Declaration of types and functions for shadow group suite. */
21 #ifndef _GSHADOW_H
22 #define _GSHADOW_H 1
24 #include <features.h>
26 #include <paths.h>
28 #define __need_FILE
29 #include <stdio.h>
30 #define __need_size_t
31 #include <stddef.h>
33 /* Path to the user database files. */
34 #define GSHADOW _PATH_GSHADOW
37 __BEGIN_DECLS
39 /* Structure of the group file. */
40 struct sgrp
42 char *sg_namp; /* Group name. */
43 char *sg_passwd; /* Encrypted password. */
44 char **sg_adm; /* Group administrator list. */
45 char **sg_mem; /* Group member list. */
49 /* Open database for reading.
51 This function is not part of POSIX and therefore no official
52 cancellation point. But due to similarity with an POSIX interface
53 or due to the implementation it is a cancellation point and
54 therefore not marked with __THROW. */
55 extern void setsgent (void);
57 /* Close database.
59 This function is not part of POSIX and therefore no official
60 cancellation point. But due to similarity with an POSIX interface
61 or due to the implementation it is a cancellation point and
62 therefore not marked with __THROW. */
63 extern void endsgent (void);
65 /* Get next entry from database, perhaps after opening the file.
67 This function is not part of POSIX and therefore no official
68 cancellation point. But due to similarity with an POSIX interface
69 or due to the implementation it is a cancellation point and
70 therefore not marked with __THROW. */
71 extern struct sgrp *getsgent (void);
73 /* Get shadow entry matching NAME.
75 This function is not part of POSIX and therefore no official
76 cancellation point. But due to similarity with an POSIX interface
77 or due to the implementation it is a cancellation point and
78 therefore not marked with __THROW. */
79 extern struct sgrp *getsgnam (__const char *__name);
81 /* Read shadow entry from STRING.
83 This function is not part of POSIX and therefore no official
84 cancellation point. But due to similarity with an POSIX interface
85 or due to the implementation it is a cancellation point and
86 therefore not marked with __THROW. */
87 extern struct sgrp *sgetsgent (__const char *__string);
89 /* Read next shadow entry from STREAM.
91 This function is not part of POSIX and therefore no official
92 cancellation point. But due to similarity with an POSIX interface
93 or due to the implementation it is a cancellation point and
94 therefore not marked with __THROW. */
95 extern struct sgrp *fgetsgent (FILE *__stream);
97 /* Write line containing shadow password entry to stream.
99 This function is not part of POSIX and therefore no official
100 cancellation point. But due to similarity with an POSIX interface
101 or due to the implementation it is a cancellation point and
102 therefore not marked with __THROW. */
103 extern int putsgent (__const struct sgrp *__g, FILE *__stream);
106 #ifdef __USE_MISC
107 /* Reentrant versions of some of the functions above.
109 These functions are not part of POSIX and therefore no official
110 cancellation point. But due to similarity with an POSIX interface
111 or due to the implementation they are cancellation points and
112 therefore not marked with __THROW. */
113 extern int getsgent_r (struct sgrp *__result_buf, char *__buffer,
114 size_t __buflen, struct sgrp **__result);
116 extern int getsgnam_r (__const char *__name, struct sgrp *__result_buf,
117 char *__buffer, size_t __buflen,
118 struct sgrp **__result);
120 extern int sgetsgent_r (__const char *__string, struct sgrp *__result_buf,
121 char *__buffer, size_t __buflen,
122 struct sgrp **__result);
124 extern int fgetsgent_r (FILE *__stream, struct sgrp *__result_buf,
125 char *__buffer, size_t __buflen,
126 struct sgrp **__result);
127 #endif /* misc */
129 __END_DECLS
131 #endif /* gshadow.h */