]> granicus.if.org Git - shadow/blobdiff - lib/commonio.h
* src/newusers.c: Fix typo.
[shadow] / lib / commonio.h
index 668318abbca3d55c00e18f98288f6808c735be23..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;
 };
 
@@ -112,20 +113,21 @@ struct commonio_db {
        /*
         * Operations from above.
         */
-       struct commonio_ops *ops;
+       /*@observer@*/const struct commonio_ops *ops;
 
        /*
         * Currently open file stream.
         */
-       /*@null@*/FILE *fp;
+       /*@dependent@*/ /*@null@*/FILE *fp;
 
 #ifdef WITH_SELINUX
-       security_context_t scontext;
+       /*@null@*/security_context_t scontext;
 #endif
        /*
         * Head, tail, current position in linked list.
         */
-       /*@null@*/struct commonio_entry *head, *tail, *cursor;
+       /*@owned@*/ /*@null@*/struct commonio_entry *head, *tail;
+       /*@dependent@*/ /*@null@*/struct commonio_entry *cursor;
 
        /*
         * Various flags.
@@ -139,20 +141,20 @@ 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 /*@null@*/const void *commonio_locate (struct commonio_db *, const char *);
+extern /*@observer@*/ /*@null@*/const void *commonio_locate (struct commonio_db *, const char *);
 extern int commonio_update (struct commonio_db *, const void *);
 extern int commonio_remove (struct commonio_db *, const char *);
 extern int commonio_rewind (struct commonio_db *);
-extern /*@null@*/const void *commonio_next (struct commonio_db *);
+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