From: Richard Levitte Date: Tue, 30 Jun 2009 09:56:01 +0000 (+0000) Subject: Add a function to fetch the core configuration from the ykpers configuration X-Git-Tag: yubikey-personalisation_1.3.5-1~4^2~128 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5f542157fa20aa11b7f5ef1167898d721db5aac;p=yubikey-personalization Add a function to fetch the core configuration from the ykpers configuration --- diff --git a/ykpers.c b/ykpers.c index 26b61ee..72b2574 100644 --- a/ykpers.c +++ b/ykpers.c @@ -406,6 +406,14 @@ int ykp_read_config(YKP_CONFIG *cfg, return 0; } +YK_CONFIG *ykp_core_config(YKP_CONFIG *cfg) +{ + if (cfg) + return &cfg->ykcore_config; + ykp_errno = YKP_ENOCFG; + return 0; +} + int * const _ykp_errno_location(void) { static int tsd_init = 0; diff --git a/ykpers.h b/ykpers.h index 6e0dc8f..9c676dd 100644 --- a/ykpers.h +++ b/ykpers.h @@ -77,6 +77,8 @@ int ykp_read_config(YKP_CONFIG *cfg, void *userdata), void *userdata); +YK_CONFIG *ykp_core_config(YKP_CONFIG *cfg); + extern int * const _ykp_errno_location(void); #define ykp_errno (*_ykp_errno_location()) const char *ykp_strerror(int errnum);