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 /* This 'implementation' is conjectured from the use of this functions in 15 the RCS and BASH distributions. Of course these functions don't do too 16 much useful things under MS-DOS, but using them avoids many "#ifdef 17 MSDOS" in ported UN*X code ... */ 18 19 #if 0 20 /* This is taken care of in Windows-NT/config.h. */ 21 typedef int uid_t; 22 #endif 23 24 struct passwd 25 { 26 /* ... */ 27 /* missing stuff */ 28 /* ... */ 29 char *pw_name; /* login user id */ 30 char *pw_dir; /* home directory */ 31 char *pw_shell; /* login shell */ 32 int pw_uid; 33 }; 34 35 struct group 36 { 37 /* ... */ 38 /* missing stuff */ 39 /* ... */ 40 char *gr_name; /* login user id */ 41 int gr_gid; 42 }; 43 44 extern struct passwd *getpwuid (int); 45 extern struct passwd *getpwnam (char *); 46 extern struct group *getgrgid (int); 47 extern struct group *getgrnam (char *); 48 extern char *getlogin (void); 49 extern char *getgr_name (void); 50 extern int getuid (void); 51 extern int getgid (void); 52 extern int geteuid (void); 53 extern int getegid (void); 54 55 extern int *groups; 56 extern int ngroups; 57 extern int getgroups (int, int *); 58 59 extern struct passwd *getpwent (void); 60 extern void setpwent (void); 61 extern void endpwent (void); 62 extern void endgrent (void); 63 64 /* 65 * Local Variables: 66 * mode:C 67 * ChangeLog:ChangeLog 68 * compile-command:make 69 * End: 70 */ 71