aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/test/trace_nif_SUITE_data/trace_nif.c
blob: 26f2420b8b6ef2f22f97483a36ac5c2cf90800c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "erl_nif.h"


static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
{
    return 0;
}

static int reload(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info)
{
    return 0;
}

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

static void unload(ErlNifEnv* env, void* priv_data)
{
}

static ERL_NIF_TERM nif_0(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    return enif_make_tuple(env,2,
		    enif_make_atom(env,"ok"),
		    enif_make_list(env,0));
}

static ERL_NIF_TERM nif_1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
    return enif_make_tuple(env,2,
		    enif_make_atom(env,"ok"),
		    enif_make_list(env,1,argv[0]));
}



static ErlNifFunc nif_funcs[] =
{
    {"nif", 0, nif_0},
    {"nif", 1, nif_1}
};

ERL_NIF_INIT(trace_nif_SUITE,nif_funcs,load,reload,upgrade,unload)