1 #include "erl_nif.h"
2 #include "ejson.h"
3 
on_load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)4 static int on_load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)
5 {
6     return 0;
7 }
8 
on_reload(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)9 static int on_reload(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM info)
10 {
11     return 0;
12 }
13 
on_upgrade(ErlNifEnv* env, void** priv_data, void** old_data, ERL_NIF_TERM info)14 static int on_upgrade(ErlNifEnv* env, void** priv_data, void** old_data, ERL_NIF_TERM info)
15 {
16     return 0;
17 }
18 
19 static 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
31 ERL_NIF_INIT(ejson, nif_funcs, &on_load, &on_reload, &on_upgrade, NULL)
32