00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef GWEN_FSLOCK_H
00030 #define GWEN_FSLOCK_H
00031
00047
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051
00052
00053 #define GWEN_FSLOCK_CBID_IO "GWEN_FSLOCK_CBID_IO"
00054
00055 #define GWEN_FSLOCK_TIMEOUT_NONE (0)
00056 #define GWEN_FSLOCK_TIMEOUT_FOREVER (-1)
00057
00058
00059 typedef struct GWEN_FSLOCK GWEN_FSLOCK;
00060
00061 typedef enum {
00062 GWEN_FSLock_TypeUnknown=0,
00063 GWEN_FSLock_TypeFile,
00064 GWEN_FSLock_TypeDir,
00065 } GWEN_FSLOCK_TYPE;
00066
00067
00068 typedef enum {
00069 GWEN_FSLock_ResultOk=0,
00070 GWEN_FSLock_ResultError,
00071 GWEN_FSLock_ResultTimeout,
00072 GWEN_FSLock_ResultBusy,
00073 GWEN_FSLock_ResultNoLock,
00074 GWEN_FSLock_ResultUserAbort
00075 } GWEN_FSLOCK_RESULT;
00076
00077
00078 #include <gwenhywfar/gwenhywfarapi.h>
00079 #include <gwenhywfar/types.h>
00080 #include <gwenhywfar/db.h>
00081
00082
00083 GWENHYWFAR_API
00084 GWEN_FSLOCK *GWEN_FSLock_new(const char *fname, GWEN_FSLOCK_TYPE t);
00085 GWENHYWFAR_API
00086 void GWEN_FSLock_free(GWEN_FSLOCK *fl);
00087
00098 GWENHYWFAR_API
00099 GWEN_FSLOCK_RESULT GWEN_FSLock_Lock(GWEN_FSLOCK *fl, int timeout);
00100
00105 GWENHYWFAR_API
00106 GWEN_FSLOCK_RESULT GWEN_FSLock_Unlock(GWEN_FSLOCK *fl);
00107
00108
00109 #ifdef __cplusplus
00110 }
00111 #endif
00112
00114
00115 #endif
00116
00117
00118
00119
00120
00121
00122