aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorTuncer Ayaz <[email protected]>2010-05-07 18:05:56 +0200
committerRaimo Niskanen <[email protected]>2010-05-24 14:25:11 +0200
commit08d67b91c5daf5eb5e8d974ca08bb1b634c4ae2a (patch)
tree69adfaefdb7520c7abe519ad8b4cd6406598395e /erts/emulator/beam/erl_nif.c
parent458dcb10f98bffd241a837cbac7c108eb485f706 (diff)
downloadotp-08d67b91c5daf5eb5e8d974ca08bb1b634c4ae2a.tar.gz
otp-08d67b91c5daf5eb5e8d974ca08bb1b634c4ae2a.tar.bz2
otp-08d67b91c5daf5eb5e8d974ca08bb1b634c4ae2a.zip
erl_nif: add enif_is_list and enif_is_tuple
Add new NIF API functions - enif_is_list - enif_is_tuple Signed-off-by: Tuncer Ayaz <[email protected]>
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index cee4df72a2..a07aa2e81f 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -248,6 +248,16 @@ int enif_is_ref(ErlNifEnv* env, ERL_NIF_TERM term)
return is_ref(term);
}
+int enif_is_tuple(ErlNifEnv* env, ERL_NIF_TERM term)
+{
+ return is_tuple(term);
+}
+
+int enif_is_list(ErlNifEnv* env, ERL_NIF_TERM term)
+{
+ return is_list(term) || is_nil(term);
+}
+
static void aligned_binary_dtor(struct enif_tmp_obj_t* obj)
{
erts_free_aligned_binary_bytes_extra((byte*)obj,ERTS_ALC_T_TMP);