+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.
#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)
{
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;
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;
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;
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) {
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;