[Pcsclite-git-commit] [PCSC] 01/01: Doxygen: add a sample code of multi-string use
Ludovic Rousseau
rousseau at moszumanska.debian.org
Thu May 18 16:50:20 UTC 2017
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository PCSC.
commit 8edd183ec82c826b228fd599d5529a0f111cd97b
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date: Thu May 18 13:14:58 2017 +0200
Doxygen: add a sample code of multi-string use
Add a sample code of how to parse the multi-string returned by
SCardListReaders().
---
src/winscard_clnt.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/winscard_clnt.c b/src/winscard_clnt.c
index 77bb5ff..9080905 100644
--- a/src/winscard_clnt.c
+++ b/src/winscard_clnt.c
@@ -2800,19 +2800,28 @@ end:
* LPSTR mszReaders;
* DWORD dwReaders;
* LONG rv;
- * ...
+ *
* rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
* rv = SCardListReaders(hContext, NULL, NULL, &dwReaders);
* mszReaders = malloc(sizeof(char)*dwReaders);
* rv = SCardListReaders(hContext, NULL, mszReaders, &dwReaders);
+ *
+ * char *p = mszReaders;
+ * while (*p)
+ * {
+ * printf("Reader: %s\n", p);
+ * p += strlen(p) +1;
+ * }
* @endcode
*
+ * or, with auto allocation:
+ *
* @code
* SCARDCONTEXT hContext;
* LPSTR mszReaders;
* DWORD dwReaders;
* LONG rv;
- * ...
+ *
* rv = SCardEstablishContext(SCARD_SCOPE_SYSTEM, NULL, NULL, &hContext);
* dwReaders = SCARD_AUTOALLOCATE;
* rv = SCardListReaders(hContext, NULL, (LPSTR)&mszReaders, &dwReaders);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git
More information about the Pcsclite-cvs-commit
mailing list