The function to convert signatures into erlang terms was returning ok
with the rest of the tuple which geef_sig expects. We do not want the
ok there, so let that function give us the four terms and decide what to
do in each case.
The signature functions still want to return with ok before it, but the
reflog wants them together with the other parameters.
For now it simply includes reading in the reflog as a list of
entries. This does mean that the drop/append functions don't need to be
wrapped, as we can use erlang's list handling.
It however also means that we cannot write this back out, as there is
currently no way to create an empty reflog that we can fill with our own
list.
There is still now way to access what the flags mean, and the times
need to be in pure timestamp form, rather than erlang's.
Non-essential fields are allowed to be 'undefined' and then the
entry's field will remain zeroed.
This means we no longer accept any iolist in some of the functions,
but we might bring it back later.
There is also a new function, geef_ref:create_symbolic() to create
symbolic references, since we can no longer differentiate between a
name and an OID.
Refernces contain three pieces of data which we already keep in the
erlang record. Keep the repository it belongs to in the record as well
and remove resource in the NIF. This makes the code easier to reason
about, as we don't need to keep any reference counts or GC the C
struct.
This does mean we cannot re-use references across geef_repo restarts,
but that's probably a good thing.
Use erlang's allocator and simplify the code by writing into the
buffer we're going to give back anyway.
Also introduce a function to NUL-terminate iolist buffers, which can
avoid memory copying.