Skip to content

Commit

Permalink
Add upgrade hook
Browse files Browse the repository at this point in the history
  • Loading branch information
William Cummings authored and hlieberman committed Nov 6, 2014
1 parent 8900558 commit 544f3e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion c_src/cberl_nif.c
Expand Up @@ -18,6 +18,11 @@ static int load(ErlNifEnv* env, void** priv, ERL_NIF_TERM load_info)
return 0;
}

static int upgrade(ErlNifEnv* env, void** priv, void** old_priv_data, ERL_NIF_TERM load_info)
{
return load(env, priv, load_info);
}

NIF(cberl_nif_new)
{
handle_t* handle = enif_alloc_resource(cberl_handle, sizeof(handle_t));
Expand Down Expand Up @@ -143,4 +148,4 @@ static ErlNifFunc nif_funcs[] = {
{"destroy", 1, cberl_nif_destroy}
};

ERL_NIF_INIT(cberl_nif, nif_funcs, load, NULL, NULL, NULL);
ERL_NIF_INIT(cberl_nif, nif_funcs, load, NULL, upgrade, NULL);

0 comments on commit 544f3e6

Please sign in to comment.