The doc is in edoc format, generated from the source as an html file.
The makefile's default action now also generates the documentation.
I ignored unpack_all/1 and pack(dict()) for now because their future is still uncertain.
Rationale: We only use throw/1 for error handling, never erlang:error/1.
Caller bugs will get a nice {error,...} return while library bugs will
bubble up in all their uglyness; that's the proper way to do things
in erlang.
Ports can send data bit by bit; make sure we read all the port has to offer in one go.
This should fix the "broken pipe" error we sometime got during testing.
We did not previously check the return of compare_all/2, which is why the bug was not noticed.
Incidentally, this change fixes dialyzer warnings too.
Unecessary because unpack_/1 will throw it anyway.
This does mean that we go a tiny bit deeper to find that we don't have enough data,
but that should be a rare code path. Keep the main code path fast and the code clean.
While at it, rename vars to match its sibling function and to avoid thinking that
RestLen is a byte count (it's an item count).
* fix list of invalid bytes was missing 3 possibilities (see type chart section of msgpack format spec)
* fix matching of invalid bytes to look at 1 byte instead of 2
* simplify 'incomplete' case : anything that's not complete or invalid is by definition incomplete
A dict is overkill (code, cpu, memory) in most cases, and proplist<->dict conversion can easily be done by the libray user if desired.
This is in line with other erlang libraries I've seen for various encoding schemes.
The map encoder had a bug until I looked at it (see previous commit), so I guess it wasn't used much yet and a change is ok at this stage.
The chosen representation for maps is a tuple containing the proplist as the only element.