diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2001-07-27 21:55:37 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2001-07-27 21:55:37 +0000 |
commit | e07d576a30318fa3e3abe325d8f7a20ffacc0135 (patch) | |
tree | 29728b25bafee96214f486921ca2bf60d21e4d03 /lib/libsectok/sectok.c | |
parent | 0ca28e7501431790453b2b8a3407d95cb0df734f (diff) |
add sectok_friendly_open() - like sectok_open() but accepts
the reader as a string instead of an integer. ok rees@
Diffstat (limited to 'lib/libsectok/sectok.c')
-rw-r--r-- | lib/libsectok/sectok.c | 12 |
1 files changed, 11 insertions, 1 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) { |