You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`pack(arg1, arg2, ..., argn)` - pack any number of lua objects into one msgpack stream. returns: msgpack
56
+
-`unpack(msgpack)` - unpack all objects in msgpack to individual return values. returns: object1, object2, ..., objectN
57
+
-`unpack_one(msgpack); unpack_one(msgpack, offset)` - unpacks the first object after offset. returns: offset, object
58
+
-`unpack_limit(msgpack, limit); unpack_limit(msgpack, limit, offset)` - unpacks the first `limit` objects and returns: offset, object1, objet2, ..., objectN (up to limit, but may return fewer than limit if not that many objects remain to be unpacked)
59
+
60
+
When you reach the end of your input stream with `unpack_one` or `unpack_limit`, an offset of `-1` is returned.
61
+
62
+
You may `require "msgpack"` or you may `require "msgpack.safe"`. The safe version returns errors as (nil, errstring).
40
63
41
64
However because of the nature of Lua numerical and table type a few behavior
42
65
of the library must be well understood to avoid problems:
@@ -50,6 +73,16 @@ maps.
50
73
* When a Lua number is converted to float or double, the former is preferred if there is no loss of precision compared to the double representation.
51
74
* When a MessagePack big integer (64 bit) is converted to a Lua number it is possible that the resulting number will not represent the original number but just an approximation. This is unavoidable because the Lua numerical type is usually a double precision floating point type.
52
75
76
+
TESTING
77
+
---
78
+
79
+
Build and test:
80
+
81
+
mkdir build; cd build
82
+
cmake ..
83
+
make
84
+
lua ../test.lua
85
+
53
86
NESTED TABLES
54
87
---
55
88
Nested tables are handled correctly up to `LUACMSGPACK_MAX_NESTING` levels of
0 commit comments