diff options
author | John Högberg <[email protected]> | 2019-03-06 15:28:30 +0100 |
---|---|---|
committer | John Högberg <[email protected]> | 2019-03-07 09:31:16 +0100 |
commit | f951b3fcc69c195ce04ae1022fa53272cb74f71b (patch) | |
tree | 781e576d1acc8882eca11c789e0eaedb47387f52 /erts/emulator/beam/erl_nif_api_funcs.h | |
parent | 31bff2cdb13a6e2032b7f067d037da0520752fc0 (diff) | |
download | otp-f951b3fcc69c195ce04ae1022fa53272cb74f71b.tar.gz otp-f951b3fcc69c195ce04ae1022fa53272cb74f71b.tar.bz2 otp-f951b3fcc69c195ce04ae1022fa53272cb74f71b.zip |
erts: Add enif_term_type
This helps avoid long sequences of enif_is_xxx in code that
serializes terms (such as JSON encoders) by letting the user
switch on the type.
Diffstat (limited to 'erts/emulator/beam/erl_nif_api_funcs.h')
-rw-r--r-- | erts/emulator/beam/erl_nif_api_funcs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif_api_funcs.h b/erts/emulator/beam/erl_nif_api_funcs.h index 8ab454c8dd..d57f6ec97c 100644 --- a/erts/emulator/beam/erl_nif_api_funcs.h +++ b/erts/emulator/beam/erl_nif_api_funcs.h @@ -215,6 +215,8 @@ ERL_NIF_API_FUNC_DECL(ERL_NIF_TERM,enif_make_monitor_term,(ErlNifEnv* env, const ERL_NIF_API_FUNC_DECL(void,enif_set_pid_undefined,(ErlNifPid* pid)); ERL_NIF_API_FUNC_DECL(int,enif_is_pid_undefined,(const ErlNifPid* pid)); +ERL_NIF_API_FUNC_DECL(ErlNifTermType,enif_term_type,(ErlNifEnv* env, ERL_NIF_TERM term)); + /* ** ADD NEW ENTRIES HERE (before this comment) !!! */ @@ -401,6 +403,7 @@ ERL_NIF_API_FUNC_DECL(int,enif_is_pid_undefined,(const ErlNifPid* pid)); # define enif_make_monitor_term ERL_NIF_API_FUNC_MACRO(enif_make_monitor_term) # define enif_set_pid_undefined ERL_NIF_API_FUNC_MACRO(enif_set_pid_undefined) # define enif_is_pid_undefined ERL_NIF_API_FUNC_MACRO(enif_is_pid_undefined) +# define enif_term_type ERL_NIF_API_FUNC_MACRO(enif_term_type) /* ** ADD NEW ENTRIES HERE (before this comment) |