start moving code to the library, and add error codes

This commit is contained in:
Klas Lindfors
2014-06-16 13:19:48 +02:00
parent fe5632e603
commit 0d4dd2fea1
8 changed files with 222 additions and 24 deletions
+14 -2
View File
@@ -37,8 +37,20 @@ extern "C"
typedef struct ykpiv_state ykpiv_state;
int ykpiv_init(ykpiv_state **state);
int ykpiv_done(ykpiv_state *state);
typedef enum {
YKPIV_OK = 0,
YKPIV_MEMORY_ERROR = -1,
YKPIV_PCSC_ERROR = -2,
} ykpiv_rc;
const char *ykpiv_strerror(ykpiv_rc err);
const char *ykpiv_strerror_name(ykpiv_rc err);
ykpiv_rc ykpiv_init(ykpiv_state **state, int verbose);
ykpiv_rc ykpiv_done(ykpiv_state *state);
ykpiv_rc ykpiv_connect(ykpiv_state *state, const char *wanted);
#ifdef __cplusplus
}