diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-10-06 13:19:25 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-10-06 13:19:25 -0400 |
commit | fd0b968b5afe28d9adcfbc9aef17bc83d6eaf84b (patch) | |
tree | f973bb4b424448da6e1c5115819e3fd4f568f2b6 | |
parent | d2d9a751b172edb2b3aee613cf4bbe06ff5a07c8 (diff) | |
download | bfs-fd0b968b5afe28d9adcfbc9aef17bc83d6eaf84b.tar.xz |
pwcache: Adjust some naming conventions
-rw-r--r-- | ctx.c | 8 | ||||
-rw-r--r-- | pwcache.c | 12 | ||||
-rw-r--r-- | pwcache.h | 8 |
3 files changed, 14 insertions, 14 deletions
@@ -72,7 +72,7 @@ const struct bfs_users *bfs_ctx_users(const struct bfs_ctx *ctx) { if (mut->users_error) { errno = mut->users_error; } else if (!mut->users) { - mut->users = bfs_parse_users(); + mut->users = bfs_users_parse(); if (!mut->users) { mut->users_error = errno; } @@ -87,7 +87,7 @@ const struct bfs_groups *bfs_ctx_groups(const struct bfs_ctx *ctx) { if (mut->groups_error) { errno = mut->groups_error; } else if (!mut->groups) { - mut->groups = bfs_parse_groups(); + mut->groups = bfs_groups_parse(); if (!mut->groups) { mut->groups_error = errno; } @@ -186,8 +186,8 @@ int bfs_ctx_free(struct bfs_ctx *ctx) { bfs_mtab_free(ctx->mtab); - bfs_free_groups(ctx->groups); - bfs_free_users(ctx->users); + bfs_groups_free(ctx->groups); + bfs_users_free(ctx->users); struct trie_leaf *leaf; while ((leaf = trie_first_leaf(&ctx->files))) { @@ -32,7 +32,7 @@ struct bfs_users { struct trie by_uid; }; -struct bfs_users *bfs_parse_users(void) { +struct bfs_users *bfs_users_parse(void) { int error; struct bfs_users *users = malloc(sizeof(*users)); @@ -103,7 +103,7 @@ struct bfs_users *bfs_parse_users(void) { fail_end: endpwent(); fail_free: - bfs_free_users(users); + bfs_users_free(users); errno = error; return NULL; } @@ -126,7 +126,7 @@ const struct passwd *bfs_getpwuid(const struct bfs_users *users, uid_t uid) { } } -void bfs_free_users(struct bfs_users *users) { +void bfs_users_free(struct bfs_users *users) { if (users) { trie_destroy(&users->by_uid); trie_destroy(&users->by_name); @@ -163,7 +163,7 @@ static char *next_gr_mem(void **gr_mem) { return mem; } -struct bfs_groups *bfs_parse_groups(void) { +struct bfs_groups *bfs_groups_parse(void) { int error; struct bfs_groups *groups = malloc(sizeof(*groups)); @@ -249,7 +249,7 @@ struct bfs_groups *bfs_parse_groups(void) { fail_end: endgrent(); fail_free: - bfs_free_groups(groups); + bfs_groups_free(groups); errno = error; return NULL; } @@ -272,7 +272,7 @@ const struct group *bfs_getgrgid(const struct bfs_groups *groups, gid_t gid) { } } -void bfs_free_groups(struct bfs_groups *groups) { +void bfs_groups_free(struct bfs_groups *groups) { if (groups) { trie_destroy(&groups->by_gid); trie_destroy(&groups->by_name); @@ -35,7 +35,7 @@ struct bfs_users; * @return * The parsed user table, or NULL on failure. */ -struct bfs_users *bfs_parse_users(void); +struct bfs_users *bfs_users_parse(void); /** * Get a user entry by name. @@ -67,7 +67,7 @@ const struct passwd *bfs_getpwuid(const struct bfs_users *users, uid_t uid); * @param users * The user table to free. */ -void bfs_free_users(struct bfs_users *users); +void bfs_users_free(struct bfs_users *users); /** * The group table. @@ -80,7 +80,7 @@ struct bfs_groups; * @return * The parsed group table, or NULL on failure. */ -struct bfs_groups *bfs_parse_groups(void); +struct bfs_groups *bfs_groups_parse(void); /** * Get a group entry by name. @@ -112,6 +112,6 @@ const struct group *bfs_getgrgid(const struct bfs_groups *groups, gid_t gid); * @param groups * The group table to free. */ -void bfs_free_groups(struct bfs_groups *groups); +void bfs_groups_free(struct bfs_groups *groups); #endif // BFS_PWCACHE_H |