[Pcsclite-cvs-commit] r5943 - in /trunk/PCSC/src: pcsc-spy.c pcsc-spy.py
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Tue Sep 6 13:16:57 UTC 2011
Author: rousseau
Date: Tue Sep 6 13:16:56 2011
New Revision: 5943
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5943
Log:
Add support of multi entries text output
This is used for SCardListReaders() and SCardListReaderGroups()
Modified:
trunk/PCSC/src/pcsc-spy.c
trunk/PCSC/src/pcsc-spy.py
Modified: trunk/PCSC/src/pcsc-spy.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/pcsc-spy.c?rev=5943&op=diff
==============================================================================
--- trunk/PCSC/src/pcsc-spy.c (original)
+++ trunk/PCSC/src/pcsc-spy.c Tue Sep 6 13:16:56 2011
@@ -226,17 +226,18 @@
}
else
{
+ const char *s = str;
+ int length = 0;
+
if (autoallocate)
+ s = *(char **)str;
+
+ do
{
- const char *s;
-
- s = *(char **)str;
spy_line("%s", s);
- }
- else
- {
- spy_line("%s", str);
- }
+ length += strlen(s)+1;
+ s += strlen(s)+1;
+ } while(length < *len);
}
}
}
@@ -498,7 +499,7 @@
{
LONG rv;
int autoallocate = 0;
-
+
if (pcchGroups)
autoallocate = *pcchGroups == SCARD_AUTOALLOCATE;
@@ -515,7 +516,7 @@
{
LONG rv;
int autoallocate = 0;
-
+
if (pcchReaders)
autoallocate = *pcchReaders == SCARD_AUTOALLOCATE;
Modified: trunk/PCSC/src/pcsc-spy.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/pcsc-spy.py?rev=5943&op=diff
==============================================================================
--- trunk/PCSC/src/pcsc-spy.py (original)
+++ trunk/PCSC/src/pcsc-spy.py Tue Sep 6 13:16:56 2011
@@ -74,6 +74,18 @@
data = f.readline().strip()
log_out("%s %s" % (header, data))
+def log_out_n_str(size_name, field_name, f):
+ data = f.readline().strip()
+ log_out("%s %s" % (size_name, data))
+ size = int(data, 16)
+ data_read = 0
+ while data_read < size:
+ data = f.readline().strip()
+ log_out("%s %s" % (field_name, data))
+ if data == 'NULL':
+ break
+ data_read += len(data)+1
+
def log_name(name):
print color_blue + name + color_normal
@@ -101,16 +113,14 @@
log_name("SCardListReaders")
log_in_hContext(f)
log_in2("mszGroups:", f)
- log_out2("pcchReaders:", f)
- log_out2("mszReaders:", f)
+ log_out_n_str("pcchReaders:", "mszReaders:", f)
log_rv(f)
def SCardListReaderGroups(f):
log_name("SCardListReaderGroups")
log_in_hContext(f)
log_in2("pcchGroups:", f)
- log_out2("pcchGroups:", f)
- log_out2("mszGroups:", f)
+ log_out_n_str("pcchGroups:", "mszGroups:", f)
log_rv(f)
def SCardGetStatusChange(f):
More information about the Pcsclite-cvs-commit
mailing list