home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3349 / pwd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-05-17  |  2.3 KB  |  99 lines

  1. /*
  2.  * Copyright 1990, 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.
  17.  *
  18.  * $RCSfile$    $Revision$
  19.  *
  20.  * $Author$    $Date$
  21.  *
  22.  * $State$    $Locker$
  23.  *
  24.  * $Log$
  25.  */
  26.  
  27. #ifndef    PWD_H
  28. #define    PWD_H
  29.  
  30. #include    <sys/types.h>
  31.  
  32. /*
  33.  * For now these are defined here.  Later they should be moved to
  34.  * the configuration file or this file should be generated by
  35.  * a configurator.
  36.  */
  37.  
  38. #undef    BSD_QUOTAS
  39. #define    ATT_AGE
  40. #define    ATT_COMMENT
  41.  
  42. /*
  43.  * This is the data structure returned by the getpw* functions.  The
  44.  * names of the elements and the structure are taken from traditional
  45.  * usage.
  46.  */
  47.  
  48. struct passwd    {
  49.     char    *pw_name ;    /* User login name */
  50.     char    *pw_passwd ;    /* Encrypted passwd or dummy field */
  51.     uid_t    pw_uid ;    /* User uid number */
  52.     gid_t    pw_gid ;    /* User group id number */
  53. #ifdef    BSD_QUOTAS
  54.     /* Most BSD systems have quotas, most USG ones don't    */
  55.     int    pw_quota ;    /* The BSD magic doodah */
  56. #endif
  57. #ifdef    ATT_AGE
  58.     /* Use ATT-style password aging    */
  59.     char    *pw_age ;    /* ATT radix-64 encoded data */
  60. #endif
  61. #ifdef    ATT_COMMENT
  62.     /* Provide the unused comment field */
  63.     char    *pw_comment;    /* Unused comment field */
  64. #endif
  65.     char    *pw_gecos ;    /* ASCII user name, other data */
  66.     char    *pw_dir ;    /* User home directory */
  67.     char    *pw_shell ;    /* User startup shell */
  68. } ;
  69.  
  70. #ifdef    ATT_COMMENT
  71. /* Provide the unused comment structure */
  72. struct comment {
  73.     char    *c_dept;
  74.     char    *c_name;
  75.     char    *c_acct;
  76.     char    *c_bin;
  77. };
  78. #endif
  79.  
  80. #ifdef    __STDC__
  81.  
  82. extern    struct    passwd    *getpwent( void ) ;
  83. extern    struct    passwd    *getpwuid( uid_t user_uid ) ;
  84. extern    struct    passwd    *getpwnam( char *name ) ;
  85. int    setpwent( void );
  86. int    endpwent( void );
  87.  
  88. #else
  89.  
  90. extern    struct    passwd    *getpwent();
  91. extern    struct    passwd    *getpwuid();
  92. extern    struct    passwd    *getpwnam();
  93. int    setpwent();
  94. int    endpwent();
  95.  
  96. #endif    /* of ifdef __STDC__ */
  97.  
  98. #endif    /* of ifdef PWD_H */
  99.