home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / shadow-3.1.4 / pwd.h.m4 < prev    next >
Encoding:
Text File  |  1992-04-05  |  2.6 KB  |  105 lines

  1. /*
  2.  * Copyright 1990, 1991, 1992, John F. Haugh II and Steve Simmons
  3.  * All rights reserved.
  4.  *
  5.  * Permission is granted to copy and create derivative works for any
  6.  * non-commercial purpose, provided this copyright notice is preserved
  7.  * in all copies of source code, or included in human readable form
  8.  * and conspicuously displayed on all copies of object code or
  9.  * distribution media.
  10.  */
  11.  
  12. /*
  13.  * Standard definitions for password files.  This is an independant
  14.  * reimplementation of the definitions used by AT&T, BSD, and POSIX.
  15.  * It is not derived from any of those sources.  Note that it can be
  16.  * site-defined to have non-POSIX features as well.  Ideally this file
  17.  * is simply replaced by the standard system supplied /usr/include/pwd.h
  18.  * file.
  19.  *
  20.  *    @(#)pwd.h.m4    3.4    13:22:36    3/9/92
  21.  */
  22.  
  23. #ifndef    PWD_H
  24. #define    PWD_H
  25.  
  26. #ifdef    M_XENIX
  27. typedef int uid_t;
  28. typedef int gid_t;
  29. #endif
  30.  
  31. #if defined(SUN) || defined(SUN4)
  32. #include <sys/types.h>
  33. #endif
  34.  
  35. #ifdef    SVR4
  36. #include <sys/types.h>
  37. #include <limits.h>
  38. #define NGROUPS NGROUPS_MAX
  39. #endif
  40.  
  41. ifdef(`SUN4', `#define    ATT_AGE')
  42. ifdef(`SUN4', `#define  ATT_COMMENT')
  43. ifdef(`SUN', `#define    BSD_QUOTAS')
  44. ifdef(`BSD', `#define    BSD_QUOTAS')
  45. ifdef(`USG', `#define    ATT_AGE')
  46. ifdef(`USG', `#define    ATT_COMMENT')
  47.  
  48. /*
  49.  * This is the data structure returned by the getpw* functions.  The
  50.  * names of the elements and the structure are taken from traditional
  51.  * usage.
  52.  */
  53.  
  54. struct passwd    {
  55.     char    *pw_name ;    /* User login name */
  56.     char    *pw_passwd ;    /* Encrypted passwd or dummy field */
  57.     uid_t    pw_uid ;    /* User uid number */
  58.     gid_t    pw_gid ;    /* User group id number */
  59. #ifdef    BSD_QUOTAS
  60.     /* Most BSD systems have quotas, most USG ones don't    */
  61.     int    pw_quota ;    /* The BSD magic doodah */
  62. #endif
  63. #ifdef    ATT_AGE
  64.     /* Use ATT-style password aging    */
  65.     char    *pw_age ;    /* ATT radix-64 encoded data */
  66. #endif
  67. #ifdef    ATT_COMMENT
  68.     /* Provide the unused comment field */
  69.     char    *pw_comment;    /* Unused comment field */
  70. #endif
  71.     char    *pw_gecos ;    /* ASCII user name, other data */
  72.     char    *pw_dir ;    /* User home directory */
  73.     char    *pw_shell ;    /* User startup shell */
  74. } ;
  75.  
  76. #ifdef    ATT_COMMENT
  77. /* Provide the unused comment structure */
  78. struct comment {
  79.     char    *c_dept;
  80.     char    *c_name;
  81.     char    *c_acct;
  82.     char    *c_bin;
  83. };
  84. #endif
  85.  
  86. #if    __STDC__
  87.  
  88. extern    struct    passwd    *getpwent( void ) ;
  89. extern    struct    passwd    *getpwuid( uid_t user_uid ) ;
  90. extern    struct    passwd    *getpwnam( char *name ) ;
  91. int    setpwent( void );
  92. int    endpwent( void );
  93.  
  94. #else
  95.  
  96. extern    struct    passwd    *getpwent();
  97. extern    struct    passwd    *getpwuid();
  98. extern    struct    passwd    *getpwnam();
  99. int    setpwent();
  100. int    endpwent();
  101.  
  102. #endif    /* of if __STDC__ */
  103.  
  104. #endif    /* of ifdef PWD_H */
  105.