sysdb.h 735 B

123456789101112131415161718192021222324252627282930
  1. /** @file sysdb.h
  2. * @brief Public interface for faux system database (passwd, group etc) functions.
  3. */
  4. #ifndef _faux_sysdb_h
  5. #define _faux_sysdb_h
  6. #include <stddef.h>
  7. #include <sys/types.h>
  8. #include <pwd.h>
  9. #include <grp.h>
  10. #include "faux/faux.h"
  11. C_DECL_BEGIN
  12. // Wrappers for ugly getpwnam_r()-like functions
  13. struct passwd *faux_sysdb_getpwnam(const char *name);
  14. struct passwd *faux_sysdb_getpwuid(uid_t uid);
  15. int faux_sysdb_uid_by_name(const char *name, uid_t *uid);
  16. char *faux_sysdb_name_by_uid(uid_t uid);
  17. struct group *faux_sysdb_getgrnam(const char *name);
  18. struct group *faux_sysdb_getgrgid(gid_t gid);
  19. int faux_sysdb_gid_by_name(const char *name, gid_t *gid);
  20. char *faux_sysdb_name_by_gid(gid_t gid);
  21. C_DECL_END
  22. #endif