summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Schlyter <jakob@cvs.openbsd.org>2001-07-27 21:55:37 +0000
committerJakob Schlyter <jakob@cvs.openbsd.org>2001-07-27 21:55:37 +0000
commite07d576a30318fa3e3abe325d8f7a20ffacc0135 (patch)
tree29728b25bafee96214f486921ca2bf60d21e4d03
parent0ca28e7501431790453b2b8a3407d95cb0df734f (diff)
add sectok_friendly_open() - like sectok_open() but accepts
the reader as a string instead of an integer. ok rees@
-rw-r--r--lib/libsectok/sectok.c12
-rw-r--r--lib/libsectok/sectok.h3
-rw-r--r--lib/libsectok/shlib_version2
3 files changed, 14 insertions, 3 deletions
diff --git a/lib/libsectok/sectok.c b/lib/libsectok/sectok.c
index d92147b1947..27d5395b84c 100644
--- a/lib/libsectok/sectok.c
+++ b/lib/libsectok/sectok.c
@@ -1,4 +1,4 @@
-/* $Id: sectok.c,v 1.7 2001/07/26 22:15:04 rees Exp $ */
+/* $Id: sectok.c,v 1.8 2001/07/27 21:55:36 jakob Exp $ */
/*
copyright 2000
@@ -180,6 +180,16 @@ int sectok_open(int rn, int flags, int *swp)
return sectok_xopen(rn, flags, NULL, NULL, swp);
}
+int sectok_friendly_open(const char *rn, int flags, int *swp)
+{
+ /* just convert the reader to a integer for now */
+ if (rn != NULL) {
+ return sectok_xopen(atoi(rn), flags, NULL, NULL, swp);
+ } else {
+ return -1;
+ }
+}
+
static int
openReader(int readerNum, int flags)
{
diff --git a/lib/libsectok/sectok.h b/lib/libsectok/sectok.h
index c2955ff1125..87fc526b3aa 100644
--- a/lib/libsectok/sectok.h
+++ b/lib/libsectok/sectok.h
@@ -1,4 +1,4 @@
-/* $Id: sectok.h,v 1.13 2001/07/26 22:15:04 rees Exp $ */
+/* $Id: sectok.h,v 1.14 2001/07/27 21:55:36 jakob Exp $ */
/*
copyright 2001
@@ -70,6 +70,7 @@ extern unsigned char root_fid[];
/* Common card functions */
int sectok_open(int rn, int flags, int *swp);
+int sectok_friendly_open(const char *rn, int flags, int *swp);
int sectok_xopen(int rn, int flags, char *config_path, char *driver_path, int *swp);
int sectok_reset(int fd, int flags, unsigned char *atr, int *swp);
int sectok_apdu(int fd, int cla, int ins, int p1, int p2,
diff --git a/lib/libsectok/shlib_version b/lib/libsectok/shlib_version
index 012c14171d3..3f0196ebf4a 100644
--- a/lib/libsectok/shlib_version
+++ b/lib/libsectok/shlib_version
@@ -1,2 +1,2 @@
major=3
-minor=0
+minor=1