home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / cvs-1.8.7-src.tgz / tar.out / fsf / cvs / windows-NT / pwd.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  2KB  |  78 lines

  1. /*  pwd.h - Try to approximate UN*X's getuser...() functions under MS-DOS.
  2.     Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
  3.  
  4.     This program is free software; you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation; either version 1, or (at your option)
  7.     any later version.
  8.  
  9.     This program 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
  12.     GNU General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU General Public License
  15.     along with this program; if not, write to the Free Software
  16.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18.     $Header: /u/src/master/ccvs/windows-NT/pwd.h,v 1.3 1995/08/30 20:44:06 jimb Exp $
  19. */
  20.  
  21. /* This 'implementation' is conjectured from the use of this functions in
  22.    the RCS and BASH distributions.  Of course these functions don't do too
  23.    much useful things under MS-DOS, but using them avoids many "#ifdef
  24.    MSDOS" in ported UN*X code ...  */
  25.  
  26. #if 0
  27. /* This is taken care of in Windows-NT/config.h.  */
  28. typedef int uid_t;
  29. #endif
  30.  
  31. struct passwd
  32. {
  33.   /*    ...        */
  34.   /*    missing stuff    */
  35.   /*    ...        */
  36.   char *pw_name;        /* login user id        */
  37.   char *pw_dir;            /* home directory        */
  38.   char *pw_shell;        /* login shell            */
  39.   int  pw_uid;
  40. };
  41.  
  42. struct group
  43. {
  44.   /*    ...        */
  45.   /*    missing stuff    */
  46.   /*    ...        */
  47.   char *gr_name;        /* login user id        */
  48.   int  gr_gid;
  49. };
  50.  
  51. extern struct passwd *getpwuid (int);
  52. extern struct passwd *getpwnam (char *);
  53. extern struct group *getgrgid (int);
  54. extern struct group *getgrnam (char *);
  55. extern char *getlogin (void);
  56. extern char *getgr_name (void);
  57. extern int getuid (void);
  58. extern int getgid (void);
  59. extern int geteuid (void);
  60. extern int getegid (void);
  61.  
  62. extern int *groups;
  63. extern int ngroups;
  64. extern int getgroups (int, int *);
  65.  
  66. extern struct passwd *getpwent (void);
  67. extern void setpwent (void);
  68. extern void endpwent (void);
  69. extern void endgrent (void);
  70.  
  71. /*
  72.  * Local Variables:
  73.  * mode:C
  74.  * ChangeLog:ChangeLog
  75.  * compile-command:make
  76.  * End:
  77.  */
  78.