2024-08-25 16:08:24 +12:00
|
|
|
#ifndef GEN_QLOCKFILE_H
|
|
|
|
#define GEN_QLOCKFILE_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
|
|
|
|
2024-10-16 18:07:56 +13:00
|
|
|
#include "../libmiqt/libmiqt.h"
|
2024-09-15 10:29:05 +12:00
|
|
|
|
2024-08-25 16:08:24 +12:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
class QLockFile;
|
|
|
|
#else
|
|
|
|
typedef struct QLockFile QLockFile;
|
|
|
|
#endif
|
|
|
|
|
2024-10-19 12:53:33 +13:00
|
|
|
QLockFile* QLockFile_new(struct miqt_string fileName);
|
2024-08-25 16:08:24 +12:00
|
|
|
bool QLockFile_Lock(QLockFile* self);
|
|
|
|
bool QLockFile_TryLock(QLockFile* self);
|
|
|
|
void QLockFile_Unlock(QLockFile* self);
|
|
|
|
void QLockFile_SetStaleLockTime(QLockFile* self, int staleLockTime);
|
2024-09-11 17:41:09 +12:00
|
|
|
int QLockFile_StaleLockTime(const QLockFile* self);
|
|
|
|
bool QLockFile_IsLocked(const QLockFile* self);
|
2024-08-25 16:08:24 +12:00
|
|
|
bool QLockFile_RemoveStaleLockFile(QLockFile* self);
|
2024-09-18 12:12:02 +12:00
|
|
|
int QLockFile_Error(const QLockFile* self);
|
2024-08-25 16:08:24 +12:00
|
|
|
bool QLockFile_TryLock1(QLockFile* self, int timeout);
|
|
|
|
void QLockFile_Delete(QLockFile* self);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern C */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|