diff options
author | Sverker Eriksson <[email protected]> | 2015-06-01 15:59:56 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-06-01 15:59:56 +0200 |
commit | 76784c1f41c9138397a63a6cfc1ac3e2a50249ef (patch) | |
tree | e171205c9600ea77bc626e1ba53c48b1e6d10191 /erts/emulator/beam | |
parent | 8260f916c2ab9b9dff9752b47e47d07ac3d95c92 (diff) | |
parent | a519a52617a6a5bbdb8b17bdd892ab012cf8080b (diff) | |
download | otp-76784c1f41c9138397a63a6cfc1ac3e2a50249ef.tar.gz otp-76784c1f41c9138397a63a6cfc1ac3e2a50249ef.tar.bz2 otp-76784c1f41c9138397a63a6cfc1ac3e2a50249ef.zip |
Merge branch 'sverk/nif-map-docs'
* sverk/nif-map-docs:
erts: Cleanup fsummary lines in erl_nif docs
erts: Fix alphabetic order in erl_nif doc
erts: Add docs for map functions in nif API
erts: Rename ErlNifMapIteratorEntry enums
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/erl_nif.c | 8 | ||||
-rw-r--r-- | erts/emulator/beam/erl_nif.h | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c index 426a00304e..4df34e4a06 100644 --- a/erts/emulator/beam/erl_nif.c +++ b/erts/emulator/beam/erl_nif.c @@ -2024,8 +2024,8 @@ int enif_map_iterator_create(ErlNifEnv *env, size_t offset; switch (entry) { - case ERL_NIF_MAP_ITERATOR_HEAD: offset = 0; break; - case ERL_NIF_MAP_ITERATOR_TAIL: offset = flatmap_get_size(mp) - 1; break; + case ERL_NIF_MAP_ITERATOR_FIRST: offset = 0; break; + case ERL_NIF_MAP_ITERATOR_LAST: offset = flatmap_get_size(mp) - 1; break; default: goto error; } @@ -2048,12 +2048,12 @@ int enif_map_iterator_create(ErlNifEnv *env, WSTACK_INIT(iter->u.hash.wstack, ERTS_ALC_T_NIF); switch (entry) { - case ERL_NIF_MAP_ITERATOR_HEAD: + case ERL_NIF_MAP_ITERATOR_FIRST: iter->idx = 1; hashmap_iterator_init(&iter->u.hash.wstack->ws, map, 0); iter->u.hash.kv = hashmap_iterator_next(&iter->u.hash.wstack->ws); break; - case ERL_NIF_MAP_ITERATOR_TAIL: + case ERL_NIF_MAP_ITERATOR_LAST: iter->idx = hashmap_size(map); hashmap_iterator_init(&iter->u.hash.wstack->ws, map, 1); iter->u.hash.kv = hashmap_iterator_prev(&iter->u.hash.wstack->ws); diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h index c4fdfd4187..af806736fd 100644 --- a/erts/emulator/beam/erl_nif.h +++ b/erts/emulator/beam/erl_nif.h @@ -218,8 +218,12 @@ typedef struct /* All fields all internal and may change */ } ErlNifMapIterator; typedef enum { - ERL_NIF_MAP_ITERATOR_HEAD = 1, - ERL_NIF_MAP_ITERATOR_TAIL = 2 + ERL_NIF_MAP_ITERATOR_FIRST = 1, + ERL_NIF_MAP_ITERATOR_LAST = 2, + + /* deprecated synonyms (undocumented in 17 and 18-rc) */ + ERL_NIF_MAP_ITERATOR_HEAD = ERL_NIF_MAP_ITERATOR_FIRST, + ERL_NIF_MAP_ITERATOR_TAIL = ERL_NIF_MAP_ITERATOR_LAST } ErlNifMapIteratorEntry; #if (defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_)) |