[][src]Function libreauth::oath::libreauth_hotp_init

#[no_mangle]
pub extern "C" fn libreauth_hotp_init(cfg: *mut HOTPcfg) -> ErrorCode

[C binding] Initialize a struct libreauth_hotp_cfg with the default values.

Examples

struct libreauth_hotp_cfg cfg;
const char key[] = "12345678901234567890";

uint32_t ret = libreauth_hotp_init(&cfg);
if (ret != LIBREAUTH_OATH_SUCCESS) {
    // Handle the error.
}
cfg.key = key;
cfg.key_len = strlen(key);