add upgrade and unload handlers

This commit is contained in:
Bryan Paxton 2020-07-28 18:30:59 -05:00
parent e18f9b7337
commit 0351de9882

View File

@ -48,6 +48,17 @@ static int enacl_crypto_load(ErlNifEnv *env, void **priv_data,
return 0; return 0;
} }
static int enacl_crypto_upgrade(ErlNifEnv* env, void **priv_data,
void **old_priv_data,
ERL_NIF_TERM load_info) {
return 0;
}
static int enacl_crypto_unload(ErlNifEnv* env, void **priv_data,
ERL_NIF_TERM load_info) {
return 0;
}
/* GENERAL ROUTINES /* GENERAL ROUTINES
* *
* These don't generally fit somewhere else nicely, so we keep them in the main * These don't generally fit somewhere else nicely, so we keep them in the main
@ -421,4 +432,4 @@ static ErlNifFunc nif_funcs[] = {
"crypto_secretstream_xchacha20poly1305_pull", 3, "crypto_secretstream_xchacha20poly1305_pull", 3,
enacl_crypto_secretstream_xchacha20poly1305_pull)}; enacl_crypto_secretstream_xchacha20poly1305_pull)};
ERL_NIF_INIT(enacl_nif, nif_funcs, enacl_crypto_load, NULL, NULL, NULL); ERL_NIF_INIT(enacl_nif, nif_funcs, enacl_crypto_load, NULL, enacl_crypto_upgrade, enacl_crypto_unload);