]> granicus.if.org Git - shadow/blobdiff - lib/commonio.h
* src/newusers.c: Fix typo.
[shadow] / lib / commonio.h
index 3db75d67e38c3d35f588d1d570d87a64f5b37468..cf31ae8c582608b4e3f49e27015aaf9149cc958e 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1990 - 1994, Julianne Frances Haugh
  * Copyright (c) 1996 - 2000, Marek Michałkiewicz
  * Copyright (c) 2001 - 2005, Tomasz Kłoczko
- * Copyright (c) 2007 - 2008, Nicolas François
+ * Copyright (c) 2007 - 2010, Nicolas François
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,8 @@
 struct commonio_entry {
        /*@null@*/char *line;
        /*@null@*/void *eptr;           /* struct passwd, struct spwd, ... */
-       /*@null@*/struct commonio_entry *prev, *next;
+       /*@dependent@*/ /*@null@*/struct commonio_entry *prev;
+       /*@owned@*/ /*@null@*/struct commonio_entry *next;
        bool changed:1;
 };
 
@@ -117,7 +118,7 @@ struct commonio_db {
        /*
         * Currently open file stream.
         */
-       /*@null@*/FILE *fp;
+       /*@dependent@*/ /*@null@*/FILE *fp;
 
 #ifdef WITH_SELINUX
        /*@null@*/security_context_t scontext;
@@ -125,7 +126,8 @@ struct commonio_db {
        /*
         * Head, tail, current position in linked list.
         */
-       /*@owned@*/ /*@null@*/struct commonio_entry *head, *tail, *cursor;
+       /*@owned@*/ /*@null@*/struct commonio_entry *head, *tail;
+       /*@dependent@*/ /*@null@*/struct commonio_entry *cursor;
 
        /*
         * Various flags.
@@ -139,7 +141,7 @@ struct commonio_db {
 extern int commonio_setname (struct commonio_db *, const char *);
 extern bool commonio_present (const struct commonio_db *db);
 extern int commonio_lock (struct commonio_db *);
-extern int commonio_lock_nowait (struct commonio_db *);
+extern int commonio_lock_nowait (struct commonio_db *, bool log);
 extern int commonio_open (struct commonio_db *, int);
 extern /*@observer@*/ /*@null@*/const void *commonio_locate (struct commonio_db *, const char *);
 extern int commonio_update (struct commonio_db *, const void *);
@@ -149,10 +151,10 @@ extern /*@observer@*/ /*@null@*/const void *commonio_next (struct commonio_db *)
 extern int commonio_close (struct commonio_db *);
 extern int commonio_unlock (struct commonio_db *);
 extern void commonio_del_entry (struct commonio_db *,
-                               const struct commonio_entry *);
+                                const struct commonio_entry *);
 extern int commonio_sort_wrt (struct commonio_db *shadow,
-                             struct commonio_db *passwd);
+                              const struct commonio_db *passwd);
 extern int commonio_sort (struct commonio_db *db,
-                         int (*cmp) (const void *, const void *));
+                          int (*cmp) (const void *, const void *));
 
 #endif