2 * compat.h Compability library for systems that don't have some
3 * of the routines that we would like to use...
5 * Version: cache.c 0.99 04-13-1999 jeff@apex.net
13 typedef struct passwd shadow_pwd_t;
14 #define GET_SP_NAME(sp) ((sp)->pw_name)
15 #define GET_SP_PWD(sp) ((sp)->pw_passwd)
19 typedef struct spwd shadow_pwd_t;
20 #define GET_SP_NAME(sp) ((sp)->sp_namp)
21 #define GET_SP_PWD(sp) ((sp)->sp_pwdp)
22 #define GET_SP_LSTCHG(sp) ((sp)->sp_lstchg)
23 #define GET_SP_MIN(sp) ((sp)->sp_min)
24 #define GET_SP_MAX(sp) ((sp)->sp_max)
25 #define GET_SP_WARN(sp) ((sp)->sp_warn)
26 #define GET_SP_INACT(sp) ((sp)->sp_inact)
27 #define GET_SP_EXPIRE(sp) ((sp)->sp_expire)
31 #else /* HAVE_GETSPNAM */
33 typedef struct my_shadow_t {
36 long int sp_lstchg; /* Date of last change. */
43 #define GET_SP_NAME(sp) ((sp)->sp_namp)
44 #define GET_SP_PWD(sp) ((sp)->sp_pwdp)
45 #define GET_SP_LSTCHG(sp) ((sp)->sp_lstchg)
46 #define GET_SP_MIN(sp) ((sp)->sp_min)
47 #define GET_SP_MAX(sp) ((sp)->sp_max)
48 #define GET_SP_WARN(sp) ((sp)->sp_warn)
49 #define GET_SP_INACT(sp) ((sp)->sp_inact)
50 #define GET_SP_EXPIRE(sp) ((sp)->sp_expire)
52 #endif /* HAVE_GETSPNAM */
57 #ifndef HAVE_FGETPWENT
58 extern struct passwd *rad_fgetpwent(FILE *pwhandle);
59 static inline struct passwd *fgetpwent(FILE *pw) {
60 return rad_fgetpwent(pw);
62 #endif /* HAVE_FGETPWENT */
64 #ifndef HAVE_FGETSPENT
65 extern shadow_pwd_t *rad_fgetspent(FILE *sphandle);
66 static inline shadow_pwd_t *fgetspent(FILE *sp) {
67 return rad_fgetspent(sp);
69 #endif /* HAVE_FGETSPENT */
71 #ifndef HAVE_FGETGRENT
72 extern struct group *rad_fgetgrent(FILE *grhandle);
73 static inline struct group *fgetgrent(FILE *gr) {
74 return rad_fgetgrent(gr);
76 #endif /* HAVE_FGETGRENT */
78 #endif /* _COMPAT_H */