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)
GWEN_TYPE_UINT32 LCS_LockManager_RequestLock (LCS_LOCKMANAGER *lm, GWEN_TYPE_UINT32 clid, int duration, int maxLocks)
int LCS_LockManager_RequestLockWithId (LCS_LOCKMANAGER *lm, GWEN_TYPE_UINT32 lockid, GWEN_TYPE_UINT32 clid, int duration, int maxLocks)
GWEN_TYPE_UINT32 LCS_LockManager_GetNextRequestId ()
int LCS_LockManager_CheckRequest (LCS_LOCKMANAGER *lm, GWEN_TYPE_UINT32 reqid)
int LCS_LockManager_Unlock (LCS_LOCKMANAGER *lm, GWEN_TYPE_UINT32 reqid)
int LCS_LockManager_RemoveRequest (LCS_LOCKMANAGER *lm, GWEN_TYPE_UINT32 reqid)
void LCS_LockManager_RemoveAllClientRequests (LCS_LOCKMANAGER *lm, GWEN_TYPE_UINT32 clid)
int LCS_LockManager_HasLockRequests (const LCS_LOCKMANAGER *lm)
int LCS_LockManager_CheckAccess (LCS_LOCKMANAGER *lm, GWEN_TYPE_UINT32 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  ) 

GWEN_TYPE_UINT32 LCS_LockManager_RequestLock ( LCS_LOCKMANAGER lm,
GWEN_TYPE_UINT32  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,
GWEN_TYPE_UINT32  lockid,
GWEN_TYPE_UINT32  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

GWEN_TYPE_UINT32 LCS_LockManager_GetNextRequestId (  ) 

int LCS_LockManager_CheckRequest ( LCS_LOCKMANAGER lm,
GWEN_TYPE_UINT32  reqid 
)

Returns:
-1 on error, 0 if request granted, 1 of not

int LCS_LockManager_Unlock ( LCS_LOCKMANAGER lm,
GWEN_TYPE_UINT32  reqid 
)

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

int LCS_LockManager_RemoveRequest ( LCS_LOCKMANAGER lm,
GWEN_TYPE_UINT32  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,
GWEN_TYPE_UINT32  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,
GWEN_TYPE_UINT32  reqid 
)


Generated on Wed Feb 25 17:18:27 2009 for libchipcard2 by  doxygen 1.5.6