113571821Stholo /* pwd.h - Try to approximate UN*X's getuser...() functions under MS-DOS. 213571821Stholo Copyright (C) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet 313571821Stholo 413571821Stholo This program is free software; you can redistribute it and/or modify 513571821Stholo it under the terms of the GNU General Public License as published by 613571821Stholo the Free Software Foundation; either version 1, or (at your option) 713571821Stholo any later version. 813571821Stholo 913571821Stholo This program is distributed in the hope that it will be useful, 1013571821Stholo but WITHOUT ANY WARRANTY; without even the implied warranty of 1113571821Stholo MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12*2286d8edStholo GNU General Public License for more details. */ 1313571821Stholo 1413571821Stholo /* This 'implementation' is conjectured from the use of this functions in 1513571821Stholo the RCS and BASH distributions. Of course these functions don't do too 1613571821Stholo much useful things under MS-DOS, but using them avoids many "#ifdef 1713571821Stholo MSDOS" in ported UN*X code ... */ 1813571821Stholo 1913571821Stholo #if 0 2013571821Stholo /* This is taken care of in Windows-NT/config.h. */ 2113571821Stholo typedef int uid_t; 2213571821Stholo #endif 2313571821Stholo 2413571821Stholo struct passwd 2513571821Stholo { 2613571821Stholo /* ... */ 2713571821Stholo /* missing stuff */ 2813571821Stholo /* ... */ 2913571821Stholo char *pw_name; /* login user id */ 3013571821Stholo char *pw_dir; /* home directory */ 3113571821Stholo char *pw_shell; /* login shell */ 3213571821Stholo int pw_uid; 3313571821Stholo }; 3413571821Stholo 3513571821Stholo struct group 3613571821Stholo { 3713571821Stholo /* ... */ 3813571821Stholo /* missing stuff */ 3913571821Stholo /* ... */ 4013571821Stholo char *gr_name; /* login user id */ 4113571821Stholo int gr_gid; 4213571821Stholo }; 4313571821Stholo 4413571821Stholo extern struct passwd *getpwuid (int); 4513571821Stholo extern struct passwd *getpwnam (char *); 4613571821Stholo extern struct group *getgrgid (int); 4713571821Stholo extern struct group *getgrnam (char *); 4813571821Stholo extern char *getlogin (void); 4913571821Stholo extern char *getgr_name (void); 5013571821Stholo extern int getuid (void); 5113571821Stholo extern int getgid (void); 5213571821Stholo extern int geteuid (void); 5313571821Stholo extern int getegid (void); 5413571821Stholo 5513571821Stholo extern int *groups; 5613571821Stholo extern int ngroups; 5713571821Stholo extern int getgroups (int, int *); 5813571821Stholo 5913571821Stholo extern struct passwd *getpwent (void); 6013571821Stholo extern void setpwent (void); 6113571821Stholo extern void endpwent (void); 6213571821Stholo extern void endgrent (void); 6313571821Stholo 6413571821Stholo /* 6513571821Stholo * Local Variables: 6613571821Stholo * mode:C 6713571821Stholo * ChangeLog:ChangeLog 6813571821Stholo * compile-command:make 6913571821Stholo * End: 7013571821Stholo */ 71