1#include <pwd.h> 2#define T(t) (t*)0; 3#define F(t,n) {t *y = &x.n;} 4static void f() 5{ 6T(gid_t) 7T(uid_t) 8T(size_t) 9{ 10struct passwd x; 11F(char*,pw_name) 12F(uid_t,pw_uid) 13F(gid_t,pw_gid) 14F(char*,pw_dir) 15F(char*,pw_shell) 16} 17{struct passwd*(*p)(const char*) = getpwnam;} 18{int(*p)(const char*,struct passwd*,char*,size_t,struct passwd**) = getpwnam_r;} 19{struct passwd*(*p)(uid_t) = getpwuid;} 20{int(*p)(uid_t,struct passwd*,char*,size_t,struct passwd**) = getpwuid_r;} 21#ifdef _XOPEN_SOURCE 22{void(*p)(void) = endpwent;} 23{struct passwd*(*p)(void) = getpwent;} 24{void(*p)(void) = setpwent;} 25#endif 26} 27