summaryrefslogtreecommitdiffstats
path: root/src/pwcache.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pwcache.h')
-rw-r--r--src/pwcache.h52
1 files changed, 28 insertions, 24 deletions
diff --git a/src/pwcache.h b/src/pwcache.h
index f1a1db3..6ae8bea 100644
--- a/src/pwcache.h
+++ b/src/pwcache.h
@@ -25,92 +25,96 @@
#include <pwd.h>
/**
- * The user table.
+ * A user cache.
*/
struct bfs_users;
/**
- * Parse the user table.
+ * Create a user cache.
*
* @return
- * The parsed user table, or NULL on failure.
+ * A new user cache, or NULL on failure.
*/
-struct bfs_users *bfs_users_parse(void);
+struct bfs_users *bfs_users_new(void);
/**
* Get a user entry by name.
*
* @param users
- * The user table.
+ * The user cache.
* @param name
* The username to look up.
* @return
- * The matching user, or NULL if not found.
+ * The matching user, or NULL if not found (errno == 0) or an error
+ * occurred (errno != 0).
*/
-const struct passwd *bfs_getpwnam(const struct bfs_users *users, const char *name);
+const struct passwd *bfs_getpwnam(struct bfs_users *users, const char *name);
/**
* Get a user entry by ID.
*
* @param users
- * The user table.
+ * The user cache.
* @param uid
* The ID to look up.
* @return
- * The matching user, or NULL if not found.
+ * The matching user, or NULL if not found (errno == 0) or an error
+ * occurred (errno != 0).
*/
-const struct passwd *bfs_getpwuid(const struct bfs_users *users, uid_t uid);
+const struct passwd *bfs_getpwuid(struct bfs_users *users, uid_t uid);
/**
- * Free a user table.
+ * Free a user cache.
*
* @param users
- * The user table to free.
+ * The user cache to free.
*/
void bfs_users_free(struct bfs_users *users);
/**
- * The group table.
+ * A group cache.
*/
struct bfs_groups;
/**
- * Parse the group table.
+ * Create a group cache.
*
* @return
- * The parsed group table, or NULL on failure.
+ * A new group cache, or NULL on failure.
*/
-struct bfs_groups *bfs_groups_parse(void);
+struct bfs_groups *bfs_groups_new(void);
/**
* Get a group entry by name.
*
* @param groups
- * The group table.
+ * The group cache.
* @param name
* The group name to look up.
* @return
- * The matching group, or NULL if not found.
+ * The matching group, or NULL if not found (errno == 0) or an error
+ * occurred (errno != 0).
*/
-const struct group *bfs_getgrnam(const struct bfs_groups *groups, const char *name);
+const struct group *bfs_getgrnam(struct bfs_groups *groups, const char *name);
/**
* Get a group entry by ID.
*
* @param groups
- * The group table.
+ * The group cache.
* @param uid
* The ID to look up.
* @return
- * The matching group, or NULL if not found.
+ * The matching group, or NULL if not found (errno == 0) or an error
+ * occurred (errno != 0).
*/
-const struct group *bfs_getgrgid(const struct bfs_groups *groups, gid_t gid);
+const struct group *bfs_getgrgid(struct bfs_groups *groups, gid_t gid);
/**
- * Free a group table.
+ * Free a group cache.
*
* @param groups
- * The group table to free.
+ * The group cache to free.
*/
void bfs_groups_free(struct bfs_groups *groups);