* 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
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;
};
/*
* Currently open file stream.
*/
- /*@null@*/FILE *fp;
+ /*@dependent@*/ /*@null@*/FILE *fp;
#ifdef WITH_SELINUX
/*@null@*/security_context_t scontext;
/*
* 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.
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 *);
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