]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - user_list.c
server: Rename functions related to user lists.
[paraslash.git] / user_list.c
index 23fe086f189e89b3a729aa5afe145006446371bb..c9d265e55af7cdcddcb03fcb8dbfaeba86a92906 100644 (file)
@@ -1,8 +1,4 @@
-/*
- * Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /** \file user_list.c User handling for para_server. */
 
@@ -25,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");
@@ -98,14 +94,14 @@ err:
 }
 
 /**
- * Initialize the list of users allowed to connect to to para_server.
+ * Initialize the list of users allowed to connect to para_server.
  *
  * \param user_list_file The file containing access information.
  *
  * 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;
@@ -120,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);
 }
 
 /**
@@ -131,9 +127,9 @@ void init_user_list(char *user_list_file)
  * \return A pointer to the corresponding user struct if the user was found, \p
  * NULL otherwise.
  */
-struct user *lookup_user(const char *name)
+const struct user *user_list_lookup(const char *name)
 {
-       struct user *u;
+       const struct user *u;
        list_for_each_entry(u, &user_list, node) {
                if (strcmp(u->name, name))
                        continue;