1
0

sysdb.h 684 B

12345678910111213141516171819202122232425262728293031323334353637
  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. #ifdef HAVE_CONFIG_H
  8. #include "config.h"
  9. #endif /* HAVE_CONFIG_H */
  10. #ifdef HAVE_PWD_H
  11. #include <pwd.h>
  12. #endif
  13. #ifdef HAVE_GRP_H
  14. #include <grp.h>
  15. #endif
  16. #include "faux/types.h"
  17. C_DECL_BEGIN
  18. // Wrappers for ugly getpwnam_r()-like functions
  19. #ifdef HAVE_PWD_H
  20. struct passwd *faux_sysdb_getpwnam(const char *name);
  21. struct passwd *faux_sysdb_getpwuid(uid_t uid);
  22. #endif
  23. #ifdef HAVE_GRP_H
  24. struct group *faux_sysdb_getgrnam(const char *name);
  25. struct group *faux_sysdb_getgrgid(gid_t gid);
  26. #endif
  27. C_DECL_END
  28. #endif