2024-08-25 04:08:24 +00: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 05:07:56 +00:00
|
|
|
#include "../libmiqt/libmiqt.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
class QLockFile;
|
|
|
|
#else
|
|
|
|
typedef struct QLockFile QLockFile;
|
|
|
|
#endif
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QLockFile* QLockFile_new(struct miqt_string fileName);
|
2024-08-25 04:08:24 +00: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 05:41:09 +00:00
|
|
|
int QLockFile_StaleLockTime(const QLockFile* self);
|
|
|
|
bool QLockFile_IsLocked(const QLockFile* self);
|
2024-08-25 04:08:24 +00:00
|
|
|
bool QLockFile_RemoveStaleLockFile(QLockFile* self);
|
2024-09-18 00:12:02 +00:00
|
|
|
int QLockFile_Error(const QLockFile* self);
|
2024-08-25 04:08:24 +00:00
|
|
|
bool QLockFile_TryLock1(QLockFile* self, int timeout);
|
|
|
|
void QLockFile_Delete(QLockFile* self);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern C */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|