<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 9, 2016 at 1:54 PM, Constantin Kulikov <span dir="ltr"><<a href="mailto:zxnotdead@gmail.com" target="_blank">zxnotdead@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">If I want to add a new datastructure to erlang(my local fork of the erlang-otp from github), what should I do? Yes, I mean a C-level module realization.<div><br></div><div>Let's say I want to add a double linked list(just for simplicity) module with an interface like that:</div><div>dlist:new() -> ?some king of reference to a list?</div><div>dlist:push(item) -> ?reference to a list?</div><div>dlist:pop() -> {item, ?reference to a list?}</div><div>etc...</div><div><br></div><div><div>Is it possible at all? Has anyone ever tried to do something like this?</div></div><div>What definitions to what files should I add? How must I allocate my data structure? How must I reference items in it?<br></div><div>Can someone point me to source locations where erlang's list/ets table/tuple operations(creating a new, storing a reference to objects) defined?</div></div></blockquote><div><br></div><div>See</div><div><br></div><div><a href="http://erlang.org/doc/tutorial/nif.html">http://erlang.org/doc/tutorial/nif.html</a><br></div><div><a href="http://erlang.org/doc/man/erl_nif.html">http://erlang.org/doc/man/erl_nif.html</a></div><div><br></div><div>--steve</div></div></div></div>