1#include "erl_nif.h"
2#include "ejson.h"
3
4static int on_load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)
5{
6    return 0;
7}
8
9static int on_reload(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)
10{
11    return 0;
12}
13
14static int on_upgrade(ErlNifEnv* env, void** priv_data, void** old_data, ERL_NIF_TERM info)
15{
16    return 0;
17}
18
19static ErlNifFunc nif_funcs[] =
20{
21    {"final_encode", 1, final_encode},
22    {"reverse_tokens", 1, reverse_tokens},
23    {"validate", 1, validate_doc}
24};
25
26#if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
27__global
28#elif defined __GNUC__
29__attribute__ ((visibility("default")))
30#endif
31ERL_NIF_INIT(ejson, nif_funcs, &on_load, &on_reload, &on_upgrade, NULL)
32