fslock.h File Reference
`#include <gwenhywfar/gwenhywfarapi.h>`
`#include <gwenhywfar/types.h>`
`#include <gwenhywfar/list1.h>`
`#include <gwenhywfar/list2.h>`
`#include <gwenhywfar/db.h>`
`#include <gwenhywfar/gui.h>`

Go to the source code of this file.

## Typedefs

typedef struct GWEN_FSLOCK | GWEN_FSLOCK

## Enumerations

enum | GWEN_FSLOCK_RESULT { GWEN_FSLock_ResultOk =0 , GWEN_FSLock_ResultError , GWEN_FSLock_ResultTimeout , GWEN_FSLock_ResultBusy , GWEN_FSLock_ResultNoLock , GWEN_FSLock_ResultUserAbort }
enum | GWEN_FSLOCK_TYPE { GWEN_FSLock_TypeUnknown =0 , GWEN_FSLock_TypeFile , GWEN_FSLock_TypeDir }

## Functions

GWENHYWFAR_API void | GWEN_FSLock_Attach (GWEN_FSLOCK *fl)
GWENHYWFAR_API void | GWEN_FSLock_free (GWEN_FSLOCK *fl)
GWENHYWFAR_API const char * | GWEN_FSLock_GetName (const GWEN_FSLOCK *fl)
GWENHYWFAR_API GWEN_FSLOCK_RESULT | GWEN_FSLock_Lock (GWEN_FSLOCK *fl, int timeout, uint32_t gid)
GWENHYWFAR_API GWEN_FSLOCK * | GWEN_FSLock_new (const char *fname, GWEN_FSLOCK_TYPE t)
GWENHYWFAR_API GWEN_FSLOCK_RESULT | GWEN_FSLock_Unlock (GWEN_FSLOCK *fl)

## Typedef Documentation

## GWEN_FSLOCK

typedef struct GWEN_FSLOCK GWEN_FSLOCK

Definition at line 59 of file fslock.h.

## Enumeration Type Documentation

## GWEN_FSLOCK_RESULT

enum GWEN_FSLOCK_RESULT

Enumerator
GWEN_FSLock_ResultOk |
GWEN_FSLock_ResultError |
GWEN_FSLock_ResultTimeout |
GWEN_FSLock_ResultBusy |
GWEN_FSLock_ResultNoLock |
GWEN_FSLock_ResultUserAbort |

Definition at line 71 of file fslock.h.

## GWEN_FSLOCK_TYPE

enum GWEN_FSLOCK_TYPE

Enumerator
GWEN_FSLock_TypeUnknown |
GWEN_FSLock_TypeFile |
GWEN_FSLock_TypeDir |

Definition at line 64 of file fslock.h.

## Function Documentation

## GWEN_FSLock_Attach()

GWENHYWFAR_API void GWEN_FSLock_Attach | ( | GWEN_FSLOCK * | fl | ) |

References GWENHYWFAR_API.

## GWEN_FSLock_free()

GWENHYWFAR_API void GWEN_FSLock_free | ( | GWEN_FSLOCK * | fl | ) |

References GWENHYWFAR_API.

## GWEN_FSLock_GetName()

GWENHYWFAR_API const char * GWEN_FSLock_GetName | ( | const GWEN_FSLOCK * | fl | ) |

## GWEN_FSLock_Lock()

GWENHYWFAR_API GWEN_FSLOCK_RESULT GWEN_FSLock_Lock | ( | GWEN_FSLOCK * | fl,
|  | int | timeout,
|  | uint32_t | gid )

This function tries to acquire a lock for the given file/folder. It waits if necessary (using GWEN_Gui_ProgressStart) while waiting.

Parameters

  fl | fslock object
  timeout | timeout in milliseconds (special values are GWEN_TIMEOUT_NONE (which does not wait at all) and GWEN_TIMEOUT_FOREVER (which waits forever).

References GWENHYWFAR_API.

## GWEN_FSLock_new()

GWENHYWFAR_API GWEN_FSLOCK * GWEN_FSLock_new | ( | const char * | fname,
|  | GWEN_FSLOCK_TYPE | t )

References GWENHYWFAR_API.

## GWEN_FSLock_Unlock()

GWENHYWFAR_API GWEN_FSLOCK_RESULT GWEN_FSLock_Unlock | ( | GWEN_FSLOCK * | fl | ) |

This function removes a lock.

Parameters

  fl | fslock object

References GWENHYWFAR_API.