[Pcsclite-cvs-commit] PCSC/src readerfactory.c,1.35,1.36

sauveron-guest@quantz.debian.org sauveron-guest@quantz.debian.org
Fri, 16 Jan 2004 09:43:12 +0100


Update of /cvsroot/pcsclite/PCSC/src
In directory quantz:/tmp/cvs-serv25517/src

Modified Files:
	readerfactory.c 
Log Message:
Correct the indentation of some lines and add debug information.

Index: readerfactory.c
===================================================================
RCS file: /cvsroot/pcsclite/PCSC/src/readerfactory.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- readerfactory.c	14 Jan 2004 12:05:37 -0000	1.35
+++ readerfactory.c	16 Jan 2004 08:43:09 -0000	1.36
@@ -1721,22 +1721,22 @@
 	 * exit() will call at_exit() 
 	 */
 
-        if (shouldExit) 
-        {
-                exit(0);
-        }
+	if (shouldExit) 
+	{
+		exit(0);
+	}
 }
 
 void RFSuspendAllReaders() 
 {
-        int i;
+	int i;
 
 	for (i = 0; i < PCSCLITE_MAX_READERS_CONTEXTS; i++)
 	{
 		if ((sReadersContexts[i])->vHandle != 0)
 		{
-                        EHDestroyEventHandler(sReadersContexts[i]);
-                        IFDCloseIFD(sReadersContexts[i]);
+			EHDestroyEventHandler(sReadersContexts[i]);
+			IFDCloseIFD(sReadersContexts[i]);
 		}
 	}
 
@@ -1744,48 +1744,46 @@
 
 void RFAwakeAllReaders() 
 {
-        LONG rv = IFD_SUCCESS;
-        int i, j;
-        int initFlag;
+	LONG rv = IFD_SUCCESS;
+	int i, j;
+	int initFlag;
         
-        initFlag = 0;
+	initFlag = 0;
 
 	for (i = 0; i < PCSCLITE_MAX_READERS_CONTEXTS; i++)
 	{
-                /* If the library is loaded and the event handler is not running */
-	        if ( ((sReadersContexts[i])->vHandle   != 0) &&
-                     ((sReadersContexts[i])->pthThread == 0) )
+		/* If the library is loaded and the event handler is not running */
+		if ( ((sReadersContexts[i])->vHandle   != 0) &&
+		     ((sReadersContexts[i])->pthThread == 0) )
 		{
-                
-                        for (j=0; j < i; j++)
-                        {
-                                if (((sReadersContexts[j])->vHandle == (sReadersContexts[i])->vHandle)&&
-                                    ((sReadersContexts[j])->dwPort   == (sReadersContexts[i])->dwPort)) 
-                                    {
-                                            initFlag = 1;
-                                    }
-                        }
+
+			for (j=0; j < i; j++)
+			{
+				if (((sReadersContexts[j])->vHandle == (sReadersContexts[i])->vHandle)&&
+				    ((sReadersContexts[j])->dwPort   == (sReadersContexts[i])->dwPort)) 
+				{
+					initFlag = 1;
+				}
+			}
                         
-                        if (initFlag == 0)
-                        {
-                                rv = IFDOpenIFD(sReadersContexts[i]);
+			if (initFlag == 0)
+			{
+				rv = IFDOpenIFD(sReadersContexts[i]);
 
-                        } else {
-                                initFlag = 0;
-                        }
+			} else {
+				initFlag = 0;
+			}
                         
 
-                                if (rv != IFD_SUCCESS)
-                                {
-                                        DebugLogB("RFInitializeReader: Open Port %X Failed",
-                                                    (sReadersContexts[i])->dwPort);
-                                }
+			if (rv != IFD_SUCCESS)
+			{
+				DebugLogC("RFInitializeReader: Open Port %X Failed (%s)",
+					  (sReadersContexts[i])->dwPort, (sReadersContexts[i])->lpcDevice);
+			}
 
 
-                        EHSpawnEventHandler(sReadersContexts[i]);
-                        RFSetReaderEventState(sReadersContexts[i], SCARD_RESET);
-                        
+			EHSpawnEventHandler(sReadersContexts[i]);
+			RFSetReaderEventState(sReadersContexts[i], SCARD_RESET);
 		}
 	}
-
 }