lockmanager_l.h File Reference
#include <gwenhywfar/types.h>
Go to the source code of this file.
Typedefs |
typedef struct LCS_LOCKMANAGER | LCS_LOCKMANAGER |
Functions |
LCS_LOCKMANAGER * | LCS_LockManager_new (const char *objectTypeName) |
void | LCS_LockManager_free (LCS_LOCKMANAGER *lm) |
const char * | LCS_LockManager_GetObjectTypeName (const LCS_LOCKMANAGER *lm) |
uint32_t | LCS_LockManager_RequestLock (LCS_LOCKMANAGER *lm, uint32_t clid, int duration, int maxLocks) |
int | LCS_LockManager_RequestLockWithId (LCS_LOCKMANAGER *lm, uint32_t lockid, uint32_t clid, int duration, int maxLocks) |
uint32_t | LCS_LockManager_GetNextRequestId () |
int | LCS_LockManager_CheckRequest (LCS_LOCKMANAGER *lm, uint32_t reqid) |
int | LCS_LockManager_Unlock (LCS_LOCKMANAGER *lm, uint32_t reqid) |
int | LCS_LockManager_RemoveRequest (LCS_LOCKMANAGER *lm, uint32_t reqid) |
void | LCS_LockManager_RemoveAllClientRequests (LCS_LOCKMANAGER *lm, uint32_t clid) |
int | LCS_LockManager_HasLockRequests (const LCS_LOCKMANAGER *lm) |
int | LCS_LockManager_CheckAccess (LCS_LOCKMANAGER *lm, uint32_t reqid) |
Typedef Documentation
Function Documentation
- Parameters:
-
| objectTypeName | just for debugging (e.g. "Reader", "Card") |
const char* LCS_LockManager_GetObjectTypeName |
( |
const LCS_LOCKMANAGER * |
lm |
) |
|
uint32_t LCS_LockManager_RequestLock |
( |
LCS_LOCKMANAGER * |
lm, |
|
|
uint32_t |
clid, |
|
|
int |
duration, |
|
|
int |
maxLocks | |
|
) |
| | |
Request a lock on the card. The locking time will be at most the number of seconds given in the parameter duration.
- Returns:
- 0 on error, lock request id otherwise
- Parameters:
-
| duration | maximum number of seconds the lock will hold |
| maxLocks | maximum number of locks allowed for this client |
int LCS_LockManager_RequestLockWithId |
( |
LCS_LOCKMANAGER * |
lm, |
|
|
uint32_t |
lockid, |
|
|
uint32_t |
clid, |
|
|
int |
duration, |
|
|
int |
maxLocks | |
|
) |
| | |
Request a lock on the card. The locking time will be at most the number of seconds given in the parameter duration.
- Returns:
- -1 on error, o if ok
- Parameters:
-
| duration | maximum number of seconds the lock will hold |
| maxLocks | maximum number of locks allowed for this client |
uint32_t LCS_LockManager_GetNextRequestId |
( |
|
) |
|
- Returns:
- -1 on error, 0 if request granted, 1 of not
Removes a lock request from the list of waiting requests. The request to be removed MUST NOT be the currently active one (use LCS_LockManager_Unlock in this case).
- Returns:
- 0 if ok, !=0 on error
void LCS_LockManager_RemoveAllClientRequests |
( |
LCS_LOCKMANAGER * |
lm, |
|
|
uint32_t |
clid | |
|
) |
| | |
Removes all lock requests for the given client. If the client already acquired a lock on this card then it will be removed (thus unlocking the card for use by other clients).