lockmanager_l.h File Reference

#include <gwenhywfar/types.h>
Include dependency graph for lockmanager_l.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct LCS_LOCKMANAGER LCS_LOCKMANAGER

Functions

LCS_LOCKMANAGERLCS_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

LCS_LOCKMANAGER* LCS_LockManager_new ( const char *  objectTypeName  ) 
Parameters:
objectTypeName just for debugging (e.g. "Reader", "Card")
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 
)

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 (  ) 
int LCS_LockManager_CheckRequest ( LCS_LOCKMANAGER lm,
uint32_t  reqid 
)
Returns:
-1 on error, 0 if request granted, 1 of not
int LCS_LockManager_Unlock ( LCS_LOCKMANAGER lm,
uint32_t  reqid 
)

Removes a lock applied by the combination of LCS_LockManager_RequestLock and LCS_LockManager_CheckRequest.

int LCS_LockManager_RemoveRequest ( LCS_LOCKMANAGER lm,
uint32_t  reqid 
)

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).

int LCS_LockManager_HasLockRequests ( const LCS_LOCKMANAGER lm  ) 
int LCS_LockManager_CheckAccess ( LCS_LOCKMANAGER lm,
uint32_t  reqid 
)
Generated on Mon Jul 5 23:17:14 2010 for libchipcard by  doxygen 1.6.3