Airframe Application Utilities
libairframe 0.7.2 API documentation

Main Page | Data Structures | File List | Data Fields | Globals

airlock.h

Go to the documentation of this file.
00001 /*
00002 ** airlock.c
00003 ** Airframe lockfile interface
00004 **
00005 ** ------------------------------------------------------------------------
00006 ** Copyright (C) 2005-2007 Carnegie Mellon University. All Rights Reserved.
00007 ** ------------------------------------------------------------------------
00008 ** Authors: Brian Trammell <bht@cert.org>
00009 ** ------------------------------------------------------------------------
00010 ** GNU Lesser GPL Rights pursuant to Version 2.1, February 1999
00011 ** Government Purpose License Rights (GPLR) pursuant to DFARS 252.225-7013
00012 ** ------------------------------------------------------------------------
00013 */
00014 
00022 /* idem hack */
00023 #ifndef _AIR_AIRLOCK_H_
00024 #define _AIR_AIRLOCK_H_
00025 
00026 #include <airframe/autoinc.h>
00027 
00029 #define LOCK_ERROR_DOMAIN g_quark_from_string("airframeLockError")
00030 
00033 #define LOCK_ERROR_LOCK  1
00034 
00039 typedef struct _AirLock {
00041     GString     *lpath;
00043     int         lfd;
00045     gboolean    held;
00046 } AirLock;
00047 
00049 #define AIR_LOCK_INIT { NULL, 0, FALSE }
00050 
00060 gboolean air_lock_acquire(
00061     AirLock     *lock,
00062     const char  *path,
00063     GError      **err);
00064 
00070 void air_lock_release(
00071     AirLock     *lock);
00072 
00079 void air_lock_cleanup(
00080     AirLock     *lock);
00081 
00082 /* end idem */
00083 #endif