home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue2 / SDL.ARC / !unixlib / source / clib / h / grp < prev    next >
Encoding:
Text File  |  2004-09-05  |  3.0 KB  |  101 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /usr/local/cvsroot/gccsdk/unixlib/source/clib/grp.h,v $
  4.  * $Date: 2004/04/12 13:03:37 $
  5.  * $Revision: 1.6 $
  6.  * $State: Exp $
  7.  * $Author: nick $
  8.  *
  9.  ***************************************************************************/
  10.  
  11. #ifndef __GRP_H
  12. #define __GRP_H 1
  13.  
  14. #ifndef __UNIXLIB_FEATURES_H
  15. #include <unixlib/features.h>
  16. #endif
  17.  
  18. #ifndef __UNIXLIB_TYPES_H
  19. #include <unixlib/types.h>
  20. #endif
  21.  
  22. #define __need_size_t
  23. #include <stddef.h>
  24.  
  25. #if !defined __gid_t_defined
  26. typedef __gid_t gid_t;
  27. #define __gid_t_defined
  28. #endif
  29.  
  30. __BEGIN_DECLS
  31.  
  32. #define __need_FILE
  33. #include <stdio.h>
  34.  
  35. struct group
  36. {
  37.   char *gr_name; /* Group name.  */
  38.   char *gr_passwd; /* Group password.  */
  39.   __gid_t gr_gid; /* Group ID.  */
  40.   char **gr_mem; /* Group members.  */
  41. };
  42.  
  43. /* Rewind the group-file stream.  */
  44. extern void setgrent (void) __THROW;
  45.  
  46. /* Close the group-file stream.  */
  47. extern void endgrent (void) __THROW;
  48.  
  49. /* Read an entry from the group-file stream, opening it if necessary.  */
  50. extern struct group *getgrent (void) __THROW;
  51.  
  52. /* Read an entry from the password-file stream, opening it if
  53.    necessary (re-entrant version).  */
  54. extern int getgrent_r (struct group *__restrict __result_buf,
  55.                char *__restrict __buffer, size_t __buflen,
  56.                struct group **__restrict __result) __THROW;
  57.  
  58. /* Read an entry from stream.  */
  59. extern struct group *fgetgrent (FILE *__stream) __THROW;
  60.  
  61. /* Read an entry from stream (re-entrant version).  */
  62. extern int fgetgrent_r (FILE *__restrict __stream,
  63.             struct group *__restrict __result_buf,
  64.             char *__restrict __buffer, size_t __buflen,
  65.             struct group **__restrict __result) __THROW;
  66.  
  67. /* Search for an entry with a matching group ID.  */
  68. extern struct group *getgrgid (gid_t __gid) __THROW;
  69.  
  70. /* Search for an entry with a matching group ID (re-entrant version).  */
  71. extern int getgrgid_r (gid_t __gid, struct group *__resbuf, char *__buffer,
  72.                size_t __buflen, struct group **__result) __THROW;
  73.  
  74. /* Search for an entry with a matching group name.  */
  75. extern struct group *getgrnam (const char *__name) __THROW;
  76.  
  77. /* Search for an entry with a matching group name (re-entrant version).  */
  78. extern int getgrnam_r (const char *__restrict __name,
  79.                struct group *__restrict __result_buf,
  80.                char *__restrict __buffer, size_t __buflen,
  81.                struct group **__restrict __result) __THROW;
  82.  
  83. /* Get a list of all supplementary groups this user is in */
  84. extern int getgroups (int __gidsetlen, gid_t *__gidset) __THROW;
  85.  
  86. /* Set the list of supplementary groups this user is in */
  87. extern int setgroups (int __ngroups, const gid_t *__gidset) __THROW;
  88.  
  89. /* Build a list of all groups the user is in, then call setgroups on the list*/
  90. extern int initgroups (const char *__name, gid_t __basegid) __THROW;
  91.  
  92. #ifdef __UNIXLIB_INTERNALS
  93. /* UnixLib group implementation function.  */
  94. extern struct group *__grpread (FILE *__stream, struct group *__grp,
  95.                 char *__buf, size_t __buflen) __THROW;
  96. #endif
  97.  
  98. __END_DECLS
  99.  
  100. #endif
  101.