]> granicus.if.org Git - shadow/commitdiff
Document add_one_entry_nis(), write_all(), commonio_remove(),
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 1 Jan 2008 20:34:47 +0000 (20:34 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Tue, 1 Jan 2008 20:34:47 +0000 (20:34 +0000)
commonio_locate(), and commonio_rewind().

ChangeLog
lib/commonio.c

index fc73a551ea8673b4d0c8559fefd322ea6110c308..07696454408c092e6bccd6e6b867eef7a865f911 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-01  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * lib/commonio.c: Document add_one_entry_nis(), write_all(),
+       commonio_remove(), commonio_locate(), and commonio_rewind().
+
 2008-01-01  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/pwck.c: Avoid implicit brackets.
index 50197f97dd6a9d84dfe1b4d6f8d6453748731094..58b4b562a32e57a03527f52927b75e818e9e1921 100644 (file)
@@ -395,6 +395,9 @@ static int name_is_nis (const char *n)
 #if KEEP_NIS_AT_END
 static void add_one_entry_nis (struct commonio_db *, struct commonio_entry *);
 
+/*
+ * Insert an entry between the regular entries, and the NIS entries.
+ */
 static void
 add_one_entry_nis (struct commonio_db *db, struct commonio_entry *newp)
 {
@@ -633,6 +636,11 @@ int commonio_sort_wrt (struct commonio_db *shadow, struct commonio_db *passwd)
        return 0;
 }
 
+/*
+ * write_all - Write the database to its file.
+ *
+ * It returns 0 if all the entries could be writen correctly.
+ */
 static int write_all (const struct commonio_db *db)
 {
        const struct commonio_entry *p;
@@ -868,7 +876,9 @@ void commonio_del_entry (struct commonio_db *db, const struct commonio_entry *p)
        db->changed = 1;
 }
 
-
+/*
+ * commonio_remove - Remove the entry of the given name from the database.
+ */
 int commonio_remove (struct commonio_db *db, const char *name)
 {
        struct commonio_entry *p;
@@ -894,7 +904,15 @@ int commonio_remove (struct commonio_db *db, const char *name)
        return 1;
 }
 
-
+/*
+ * commonio_locate - Find the first entry with the specified name in
+ *                   the database.
+ *
+ *     If found, it returns the entry and set the cursor of the database to
+ *     that entry.
+ *
+ *     Otherwise, it returns NULL.
+ */
 const void *commonio_locate (struct commonio_db *db, const char *name)
 {
        struct commonio_entry *p;
@@ -912,7 +930,11 @@ const void *commonio_locate (struct commonio_db *db, const char *name)
        return p->eptr;
 }
 
-
+/*
+ * commonio_rewind - Restore the database cursor to the first entry.
+ *
+ * It returns 0 on error, 1 on success.
+ */
 int commonio_rewind (struct commonio_db *db)
 {
        if (!db->isopen) {
@@ -923,7 +945,11 @@ int commonio_rewind (struct commonio_db *db)
        return 1;
 }
 
-
+/*
+ * commonio_next - Return the next entry of the specified database
+ *
+ * It returns the next entry, or NULL if no other entries could be found.
+ */
 const void *commonio_next (struct commonio_db *db)
 {
        void *eptr;