pcsc-lite 2.3.0
eventhandler.c File Reference

This keeps track of card insertion/removal events and updates ATR, protocol, and status information. More...

#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <pthread.h>
#include "misc.h"
#include "pcscd.h"
#include "debuglog.h"
#include "readerfactory.h"
#include "eventhandler.h"
#include "dyn_generic.h"
#include "sys_generic.h"
#include "ifdwrapper.h"
#include "prothandler.h"
#include "utils.h"
#include "winscard_svc.h"
#include "simclist.h"

Go to the source code of this file.

Functions

static void * EHStatusHandlerThread (READER_CONTEXT *)
 
LONG EHRegisterClientForEvent (int32_t filedes)
 
LONG EHTryToUnregisterClientForEvent (int32_t filedes)
 Try to unregister a client If no client is found then do not log an error.
 
LONG EHUnregisterClientForEvent (int32_t filedes)
 Unregister a client and log an error if the client is not found.
 
void EHSignalEventToClients (void)
 Sends an asynchronous event to any waiting client.
 
LONG EHInitializeEventStructures (void)
 
LONG EHDeinitializeEventStructures (void)
 
void EHDestroyEventHandler (READER_CONTEXT *rContext)
 
LONG EHSpawnEventHandler (READER_CONTEXT *rContext)
 

Variables

static list_t ClientsWaitingForEvent
 list of client file descriptors
 
pthread_mutex_t ClientsWaitingForEvent_lock
 lock for the above list
 

Detailed Description

This keeps track of card insertion/removal events and updates ATR, protocol, and status information.

Definition in file eventhandler.c.

Function Documentation

◆ EHDeinitializeEventStructures()

LONG EHDeinitializeEventStructures ( void )

Definition at line 150 of file eventhandler.c.

◆ EHDestroyEventHandler()

void EHDestroyEventHandler ( READER_CONTEXT * rContext)

Definition at line 158 of file eventhandler.c.

◆ EHInitializeEventStructures()

LONG EHInitializeEventStructures ( void )

Definition at line 135 of file eventhandler.c.

◆ EHRegisterClientForEvent()

LONG EHRegisterClientForEvent ( int32_t filedes)

Definition at line 66 of file eventhandler.c.

◆ EHSignalEventToClients()

void EHSignalEventToClients ( void )

Sends an asynchronous event to any waiting client.

Definition at line 116 of file eventhandler.c.

◆ EHSpawnEventHandler()

LONG EHSpawnEventHandler ( READER_CONTEXT * rContext)

Definition at line 218 of file eventhandler.c.

◆ EHStatusHandlerThread()

static void * EHStatusHandlerThread ( READER_CONTEXT * rContext)
static

Definition at line 242 of file eventhandler.c.

◆ EHTryToUnregisterClientForEvent()

LONG EHTryToUnregisterClientForEvent ( int32_t filedes)

Try to unregister a client If no client is found then do not log an error.

Definition at line 83 of file eventhandler.c.

◆ EHUnregisterClientForEvent()

LONG EHUnregisterClientForEvent ( int32_t filedes)

Unregister a client and log an error if the client is not found.

Definition at line 103 of file eventhandler.c.

Variable Documentation

◆ ClientsWaitingForEvent

list_t ClientsWaitingForEvent
static

list of client file descriptors

Definition at line 61 of file eventhandler.c.

◆ ClientsWaitingForEvent_lock

pthread_mutex_t ClientsWaitingForEvent_lock

lock for the above list

Definition at line 62 of file eventhandler.c.