X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Famflock.h;fp=common-src%2Famflock.h;h=649cdf265642ae8b8fc74e47afe97139a259ebe5;hb=cd0b924f27312d57bd42f6c4fae2b795139e2d0b;hp=75661b277f8d344832faef5c0bde568a458935dd;hpb=011a59f5a54864108a16af570a6b287410597cc2;p=debian%2Famanda diff --git a/common-src/amflock.h b/common-src/amflock.h index 75661b2..649cdf2 100644 --- a/common-src/amflock.h +++ b/common-src/amflock.h @@ -77,6 +77,18 @@ void file_lock_free(file_lock *lock); */ 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.