/*
* Amanda, The Advanced Maryland Automatic Network Disk Archiver
* Copyright (c) 1991-1999 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
* All Rights Reserved.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* New interface
*/
-typedef struct file_lock_ {
+typedef struct file_lock {
/* the entire contents of the locked file */
char *data;
size_t len;
*/
int file_lock_lock(file_lock *lock);
+/* Lock the file in write or read mode, the file is not read
+ *
+ * @param lock: the file_lock object @returns: -1 on error, 0 on success, 1 on
+ * a busy lock (see above)
+ */
+int file_lock_lock_wr(file_lock *lock);
+int file_lock_lock_rd(file_lock *lock);
+
+/* Return 1 if the object is already locked
+ */
+int file_lock_locked(file_lock *lock);
+
/* Write the given data to the locked file, and reset the file_lock
* data member to point to a copy of the new data. This does not unlock
* the file.