From: Andre Noll Date: Sat, 12 Aug 2017 23:10:01 +0000 (+0200) Subject: server: Rename functions related to user lists. X-Git-Tag: v0.6.2~4^2~16 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=85f77d8944779bfac7f65271a7f5c5986700b648 server: Rename functions related to user lists. The common user_list prefix of the two public functions declared in user_list.h indicates that these functions are defined in user_list.c. --- diff --git a/command.c b/command.c index 74e13635..aea48146 100644 --- a/command.c +++ b/command.c @@ -818,7 +818,7 @@ static int parse_auth_request(char *buf, int len, const struct user **u, } } PARA_DEBUG_LOG("received auth request for user %s\n", username); - *u = lookup_user(username); + *u = user_list_lookup(username); ret = 1; out: free_argv(features); diff --git a/server.c b/server.c index 593d92c5..20019ef6 100644 --- a/server.c +++ b/server.c @@ -283,7 +283,7 @@ success: daemon_set_flag(DF_LOG_TIMING); daemon_set_priority(OPT_UINT32_VAL(PRIORITY)); if (user_list_file) - init_user_list(user_list_file); + user_list_init(user_list_file); ret = 1; free_cf: free(cf); diff --git a/user_list.c b/user_list.c index cf53c0fa..c9d265e5 100644 --- a/user_list.c +++ b/user_list.c @@ -21,7 +21,7 @@ static struct list_head user_list; * Populates a linked list of all users in \a user_list_file. Returns on * success, calls exit() on errors. */ -static void populate_user_list(char *user_list_file) +static void populate(char *user_list_file) { int ret = -E_USERLIST; FILE *file_ptr = fopen(user_list_file, "r"); @@ -101,7 +101,7 @@ err: * If this function is called for the second time, the contents of the * previous call are discarded, i.e. the user list is reloaded. */ -void init_user_list(char *user_list_file) +void user_list_init(char *user_list_file) { struct user *u, *tmp; static int initialized; @@ -116,7 +116,7 @@ void init_user_list(char *user_list_file) } else INIT_LIST_HEAD(&user_list); initialized = 1; - populate_user_list(user_list_file); + populate(user_list_file); } /** @@ -127,7 +127,7 @@ void init_user_list(char *user_list_file) * \return A pointer to the corresponding user struct if the user was found, \p * NULL otherwise. */ -const struct user *lookup_user(const char *name) +const struct user *user_list_lookup(const char *name) { const struct user *u; list_for_each_entry(u, &user_list, node) { diff --git a/user_list.h b/user_list.h index e4fbd466..3ef62170 100644 --- a/user_list.h +++ b/user_list.h @@ -32,5 +32,5 @@ struct user { unsigned int perms; }; -void init_user_list(char *user_list_file); -const struct user *lookup_user(const char *name); +void user_list_init(char *user_list_file); +const struct user *user_list_lookup(const char *name);