Compare commits

...

2396 Commits

Author SHA1 Message Date
Takatoshi Kondo
b0d379a6f2
Update issue templates 2023-02-28 21:27:23 +09:00
Takatoshi Kondo
7d5324f294
Merge pull request #878 from ygj6/master
remove files in master for separating C and C++ libraries
2020-06-08 09:26:18 +09:00
yuangongji
61f8780d59 remove files in master for separating C and C++ libraries 2020-06-05 17:55:42 +08:00
Takatoshi Kondo
6e7deb8091
Merge pull request #875 from redboltz/update_to_330
Update the version to 3.3.0.
2020-06-05 17:04:41 +09:00
Takatoshi Kondo
66fa561256 Update the version to 3.3.0. 2020-06-05 16:22:34 +09:00
Takatoshi Kondo
243fb27c3c
Merge pull request #874 from ygj6/build
fix cannot find boost error
2020-06-05 15:43:07 +09:00
yuangongji
746e983bf3 fix cannot find boost error 2020-06-01 20:02:52 +08:00
Takatoshi Kondo
766afb90ed
Merge pull request #870 from ygj6/json
convert between msgpack and json via cJSON library
2020-05-24 19:12:18 +09:00
yuangongji
403567c1c5 convert between msgpack and json 2020-05-24 17:24:55 +08:00
Takatoshi Kondo
f3fe1b801e
Merge pull request #871 from nicokruithof/master
Fixed warning in Visual Studio
2020-05-23 16:40:35 +09:00
Takatoshi Kondo
4fdbc7518f
Merge pull request #861 from ygj6/build
examples of packing boundary values
2020-05-18 22:29:46 +09:00
Nico Kruithof
0dbdb3d974 Fixed warning in Visual Studio 2020-05-15 07:16:34 +02:00
yuangongji
d7d5be414f examples of packing boundary values 2020-05-08 14:28:45 +08:00
Takatoshi Kondo
4d36456799
Merge pull request #865 from ygj6/buffer
vrefbuffer: set default ref_size and chunk_size
2020-05-01 13:08:32 +09:00
yuangongji
b1725d4007 vrefbuffer: set default ref_size and chunk_size 2020-04-30 19:26:07 +08:00
Takatoshi Kondo
102dba8e24
Merge pull request #860 from ygj6/build
fix github actions failure and use C style casts instead of C++ style casts in zbuffer.h
2020-04-16 23:38:46 +09:00
yuangongji
1a372058a6 Use C style casts instead of C++ style casts 2020-04-16 12:46:16 +08:00
yuangongji
f8b691f622 run apt-get update to fix package installation failure 2020-04-16 11:40:53 +08:00
Takatoshi Kondo
7893d4d8c9
Merge pull request #851 from igor-sadchenko/fix-gnuc-macro-warnings
Fixed many warnings/errors with macro __GNUC__(issue #850)
2020-03-29 09:43:00 +09:00
Igor Sadchenko
9a3cd0c951 Fixed many warnings/errors with macro __GNUC__(issue #850) 2020-03-26 02:03:25 +03:00
Takatoshi Kondo
46684265d5
Merge pull request #846 from ygj6/build
install depends via vcpkg on Windows
2020-03-09 15:02:40 +09:00
Takatoshi Kondo
9e0d87b725
Merge pull request #834 from redboltz/limit_cov_guard
Limited codecov trigger.
2020-03-09 14:50:04 +09:00
Takatoshi Kondo
bbc03b2b0a Limited codecov trigger.
Focused coverage target to library code.

Now, codecov supports tokenless upload.
2020-03-09 11:08:33 +09:00
yuangongji
b4d28c3d9d install depends via vcpkg on Windows 2020-03-07 15:00:28 +08:00
Takatoshi Kondo
cc1098998f
Merge pull request #839 from ygj6/build
add MSGPACK_CXX_ONLY option to build c++ libraries only
2020-02-19 18:22:29 +09:00
yuangongji
d9c5978958 add MSGPACK_CXX_ONLY option to build c++ libraries only 2020-02-19 09:07:16 +08:00
Takatoshi Kondo
d05daa1df6
Merge pull request #842 from ygj6/doc
update the install section
2020-02-18 15:07:17 +09:00
yuangongji
534466894e update the install section 2020-02-13 17:08:46 +08:00
Takatoshi Kondo
d04520044f
Merge pull request #833 from ygj6/master
add coverage target and integrate to github actions
2020-01-14 12:59:29 +09:00
yuangongji
c0fb6b3b8c integrate coverage in github actions 2020-01-11 20:05:15 +08:00
yuangongji
19df3314f4 add coverage target in cmake 2020-01-11 13:23:19 +08:00
Takatoshi Kondo
b530b7f21a
Merge pull request #831 from ygj6/master
use cache in github actions
2020-01-08 11:06:27 +09:00
yuangongji
ed49ea3c95 use cache in github actions 2020-01-07 20:07:37 +08:00
Takatoshi Kondo
7918c19f8f Merge branch 'jamessan-cxx11-32bit' 2020-01-06 15:02:29 +09:00
Takatoshi Kondo
0d7caecdb5 Fixed cmake condition.
If MSGPACK_CXX17 is ON then build MSGPACK_CXX11 target.
2020-01-06 13:04:14 +09:00
James McCoy
f8b0ad1766
Skip timespec_pack_convert_64bit_sec_max_nano on systems where tv_sec <= 32-bit 2020-01-05 21:38:52 -05:00
James McCoy
7ed7af90b6
Fix timespec_object.*_32bit_sec tests on 32-bit platforms
On 32-bit unix platforms, 0xffffffffUL is a 32-bit value so the compiler
complains about converting it to a signed value.

    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: error: constant expression evaluates to 4294967295 which cannot be narrowed to type '__time_t' (aka 'long') [-Wc++11-narrowing]
        timespec val1{ 0xffffffffUL, 0 };
                       ^~~~~~~~~~~~
    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: note: insert an explicit cast to silence this issue
        timespec val1{ 0xffffffffUL, 0 };
                       ^~~~~~~~~~~~
                       static_cast<__time_t>( )
    /home/runner/work/msgpack-c/msgpack-c/test/msgpack_cpp11.cpp:1085:20: warning: implicit conversion changes signedness: 'unsigned long' to '__time_t' (aka 'long') [-Wsign-conversion]
        timespec val1{ 0xffffffffUL, 0 };
                     ~ ^~~~~~~~~~~~

Since we're trying to test how the maximum 32-bit value that fits in
timespec.tv_sec is handled, directly use the maximum 32-bit value for
the appropriate (un)signed type used for timespec.tv_sec.

We don't just cast to the value, as the compiler suggests, because that
would result in an extremely negative value.
2020-01-05 21:38:45 -05:00
Takatoshi Kondo
4a94f836a7
Merge pull request #828 from igor-sadchenko/patch-1
Fixed misprint in README.md
2019-12-28 15:18:59 +09:00
Igor Sadchenko
b36e548db2
Fixed misprint in README.md 2019-12-26 14:05:33 +03:00
Takatoshi Kondo
e6c276edf3
Merge pull request #827 from redboltz/fix_825_minimal
Fixed #825.
2019-12-25 15:38:01 +09:00
Takatoshi Kondo
befc3cdd0c Supressed C4309 on MSVC. 2019-12-25 14:59:40 +09:00
Takatoshi Kondo
2e2e93ba2e Added compiler checking to pragma. 2019-12-25 14:39:57 +09:00
Takatoshi Kondo
3b2bb56243 Fixed #825.
Added verbose option to windows CIs.
Added C compiler flag operation for MSVC.
Fixed invalid /WX flag matching on MSVC at test.
2019-12-25 14:24:24 +09:00
Takatoshi Kondo
9c4562382b
Merge pull request #824 from redboltz/migrate_to_gha
Migrate to gha
2019-12-25 12:16:39 +09:00
Takatoshi Kondo
08b0c88c21 Limited appveyor trigger event. 2019-12-25 10:39:26 +09:00
Takatoshi Kondo
d105f97ea0 Downgraded windows version. 2019-12-25 10:31:48 +09:00
Takatoshi Kondo
bd0665bed3 Removed travis. 2019-12-23 16:55:52 +09:00
Takatoshi Kondo
8dc865d92d Added github actions.
Fixed enum qualifier.
2019-12-23 16:54:14 +09:00
Takatoshi Kondo
8085ab8721
Merge pull request #823 from redboltz/update_to_3.2.1
Updated the version to 3.2.1.
2019-12-10 14:36:16 +09:00
Takatoshi Kondo
b36e75a42e Updated the version to 3.2.1. 2019-12-10 12:44:07 +09:00
Takatoshi Kondo
f17f8d79c4
Merge pull request #804 from herbrechtsmeier/cmake-remove-alias-from-package-config
cmake: Remove alias from package config
2019-12-10 12:33:18 +09:00
Takatoshi Kondo
f89f05b883
Merge pull request #821 from tsundre/fix-msgpack_checked_call
Correctly check return value of snprintf
2019-12-09 15:19:42 +09:00
Takatoshi Kondo
bd5f814cb2
Merge pull request #819 from devnexen/test_warning_fixes
c++11 unit tests silent warning fixes proposal.
2019-12-05 08:28:00 +09:00
Torleiv Sundre
bf6cc035c7 Fix tests for MSVC <= 2013
Use the _TRUNCATE flag for the count parameter to _snprintf_s. Without
this, the tests for MSVC <= 2013 failed on stack corruption!
2019-12-04 20:10:42 +01:00
Torleiv Sundre
a6bf728a5c Correctly check return value of snprintf
In MSGPACK_CHECKED_CALL, the return value of snprintf is incorrectly
assumed to mean success if it is less than or equal to the buffer size.
The call should only be considered a success if the return value is less
than the buffer size.

This commit adds two unit tests that illustrates the issue and fixes the
issue, making the unit tests pass.
2019-12-04 14:20:12 +01:00
David Carlier
698a482b67 c++11 unit tests silent warning fixes proposal. 2019-11-16 13:36:37 +00:00
Takatoshi Kondo
fbf5b9d74c
Merge pull request #817 from BKPepe/add_include
Include <sys/uio.h> in Linux
2019-11-11 07:36:40 +09:00
Josef Schlehofer
65c35caab2
Include <sys/uio.h> in Linux
This is needed when cross-compiling for OpenWrt.
2019-11-10 11:40:13 +01:00
Takatoshi Kondo
ff9f14742b
Merge pull request #812 from redboltz/fix_805
Fixed #805.
2019-09-24 20:10:25 +09:00
Takatoshi Kondo
4b4eb83cd1 Fixed #805.
Fixed fwrite return value comparison.
2019-09-24 16:43:15 +09:00
Stefan Herbrechtsmeier
7761497778 ci: add cmake tests for installed and embedded build 2019-09-21 08:22:26 +02:00
Stefan Herbrechtsmeier
6046d5c666 cmake: Remove alias from package config
The cmake target of an alias may not be an Imported Target.
Always build the msgpackc target and only build the msgpackc-static
target if both should be build to fix issue #801. Thereby the type
(shared or static) of the msgpackc target depends on the build
configuration.
2019-09-20 22:10:40 +02:00
Takatoshi Kondo
83eb70d718
Merge pull request #807 from redboltz/fix_806
Fixed #806.
2019-08-30 07:40:32 +09:00
Takatoshi Kondo
70f950ac05 Fixed #806.
Removed `ss.str().data()` (the type of ss is std::stringstream).
Introduced variable that is const reference of `ss.str()`.
2019-08-29 20:22:10 +09:00
Takatoshi Kondo
3129326432
Merge pull request #800 from redboltz/fix_799
Fixed #799.
2019-07-28 16:09:11 +09:00
Takatoshi Kondo
799cd15107 Fixed #799.
Fixed C++ `int main()` in the documents.
2019-07-28 14:45:38 +09:00
Takatoshi Kondo
942965ee87
Merge pull request #797 from probonopd/patch-1
Add "defined(__HAIKU__)", closes #796
2019-07-14 10:22:13 +09:00
probonopd
a123053823
Add "defined(__HAIKU__)", closes #796 2019-07-13 19:14:37 +00:00
Takatoshi Kondo
c7603fbbd1
Merge pull request #795 from redboltz/fix_794
Fixed #794.
2019-07-12 23:38:13 +09:00
Takatoshi Kondo
6954e01338 Fixed #794.
Buffer is expanded not only Z_OK, but also Z_BUF_ERROR case.
2019-07-12 21:55:50 +09:00
Takatoshi Kondo
7e23ec496a
Merge pull request #793 from Bak-Jin-Hyeong/remove_unnecessary_lines
Remove unnecessary lines from 'parse.hpp'
2019-07-10 21:23:26 +09:00
박진형2 [ungeziefer]
bae148bd76 Remove unnecessary lines from 'parse.hpp' 2019-07-10 19:54:29 +09:00
Takatoshi Kondo
3fcecf7099
Merge pull request #792 from redboltz/cpp_fix_as_776
Replaced integer overflow with efficient way.
2019-07-07 20:38:14 +09:00
Takatoshi Kondo
7d994630d2 Replaced integer overflow with efficient way.
Same fix as #776 on C.
2019-07-07 18:13:31 +09:00
Takatoshi Kondo
29b9505cb7
Merge pull request #785 from redboltz/update_version_3.2.0
Updated the version to 3.2.0.
2019-05-27 22:19:57 +09:00
Takatoshi Kondo
e07d774004
Merge pull request #784 from redboltz/more_warning_fix
Fixed warnings.
2019-05-27 21:34:47 +09:00
Takatoshi Kondo
ff77227e10 Updated the version to 3.2.0. 2019-05-27 18:37:24 +09:00
Takatoshi Kondo
de99222801 Fixed warnings. 2019-05-27 17:35:22 +09:00
Takatoshi Kondo
7cdc5b88e3
Merge pull request #780 from redboltz/fix_774
Fixed #774.
2019-05-27 17:05:55 +09:00
Takatoshi Kondo
fbdf16db09
Merge pull request #783 from wkaluza/pr_header_circular_reference
Fix header circular reference
2019-05-27 17:05:40 +09:00
Wojciech Kaluza
41b2af8884 Fix self-including header 2019-05-22 20:38:36 +01:00
Takatoshi Kondo
9389912eaf
Merge pull request #776 from dcleblanc/master
Fix for issue 775
2019-05-12 21:12:15 +09:00
Takatoshi Kondo
d5242a7d8c
Merge pull request #781 from redboltz/add_timespec_for_cpp
Added timespec support for C++11 or later.
2019-05-09 16:11:10 +09:00
Takatoshi Kondo
d3fecce359 Added timespec support for C++11 or later. 2019-05-09 14:46:45 +09:00
David LeBlanc
7a70d74971 Use a #define to only check for integer overflow when it is actually
possible
2019-05-08 18:49:55 -07:00
David LeBlanc
fcf89fe901 Fix tabs, also attempt work-around for compile time constant conditional
warning
2019-05-08 17:59:10 -07:00
Takatoshi Kondo
ec8c0bc1c1 Fixed #774.
Added checking code for snprintf return value.
2019-05-07 14:00:35 +09:00
David LeBlanc
a2f3689865 Older compilers don't allow declaring variables other than at the top of
the block if it is a C file.
2019-05-06 19:28:25 -07:00
David LeBlanc
2d54c0e918 Change integer overflow check to conform with spec 2019-05-06 17:29:40 -07:00
Takatoshi Kondo
ce088e7e0a
Merge pull request #779 from RPG3D/master
1.fix error on build msgpack with UE4
2019-05-04 19:18:35 -07:00
RPG3D
a1b86507da
keep compatibility 2019-05-04 17:12:15 +08:00
RPG3D
9235d1acae
1.fix error on build msgpack with UE4 2019-05-02 14:57:15 +08:00
Takatoshi Kondo
12172e7dc7
Merge pull request #778 from redboltz/fix_777
Fixed #777.
2019-05-01 05:29:31 -07:00
Takatoshi Kondo
6a08446b3d Removed noexcept overload. 2019-05-01 18:00:07 +09:00
Takatoshi Kondo
c93a42b5f4 Separate C++03 and 11. 2019-05-01 17:20:39 +09:00
Takatoshi Kondo
8febbfd9f5 Fixed noexcept. 2019-05-01 16:42:15 +09:00
Takatoshi Kondo
33a8d8c30f Added noexcept overload for C++11 and later. 2019-05-01 16:08:17 +09:00
Takatoshi Kondo
ef5bcadd95 Fixed #777.
Removed SFINAE. Use size type extractor.
2019-05-01 14:10:34 +09:00
David LeBlanc
fadc615f4e Fix typo 2019-04-19 14:08:09 -07:00
David LeBlanc
eff6f5a2fd Two more tabs 2019-04-11 15:58:49 -07:00
David LeBlanc
ed30252bdc Spaces not tabs 2019-04-11 15:57:25 -07:00
David LeBlanc
2deed25da0 Fix for issue 775
Fix possibly incorrect integer overflow check with an efficient correct check. Not fixing the issue where size == 0, unsure if this is by design, or what error to return if not.
2019-04-11 15:54:12 -07:00
Takatoshi Kondo
419877cf3a
Merge pull request #770 from redboltz/fix_wconversion
Added -Wconversion support for C++.
2019-03-26 08:34:02 +09:00
Takatoshi Kondo
17267ed475 Added -Wconversion support for C++. 2019-03-25 19:48:39 +09:00
Takatoshi Kondo
b759f5bdf7
Merge pull request #764 from redboltz/fix_763
Fix 763
2019-02-12 17:12:13 +09:00
Takatoshi Kondo
f72372314e Fixed #763.
Fixed aligned_zone_size_visitor size passing.
Replaced by value with by reference.
2019-02-12 12:53:07 +09:00
Takatoshi Kondo
530561eec0 Added tests for msgpack::object::clone().
Converting C++ types from cloned object after original zone is destroyed.
2019-02-12 12:53:00 +09:00
Takatoshi Kondo
aec88c06a0
Merge pull request #757 from wbenny/master
Add support for Windows Drivers
2019-01-21 07:26:15 +09:00
Petr Benes
09e06a8cb7 Add support for Windows Drivers 2019-01-17 17:44:57 +01:00
Takatoshi Kondo
084db3fcf1
Merge pull request #755 from redboltz/fix_754
Fixed #754.
2019-01-08 22:42:00 +09:00
Takatoshi Kondo
709d6f4fdd Fixed #754.
Fixed `msgpack::object` packing visitor and equal comparison visitor.

NOTE:
In the function `visit_ext(const char* v, uint32_t size)`, v contains
type and size means buffer `v` size. See #175.
2019-01-05 09:41:58 +09:00
Takatoshi Kondo
27cf578e8c
Merge pull request #753 from redboltz/fix_752
Fixed #752.
2018-12-20 12:59:23 +09:00
Takatoshi Kondo
7001679959 Fixed #752.
Moved reserved_buffer to appropriate location.
2018-12-20 08:16:15 +09:00
Takatoshi Kondo
daa78b4606
Merge pull request #747 from redboltz/fix_746
Fixed #746.
2018-11-23 19:56:16 +09:00
Takatoshi Kondo
b893f7750c Fixed #746.
Eliminated redundant zone allocation in unpacking process.
ARRAY and MAP is construced on the zone.
STR, BIN, and EXT refer to unpack buffer, and the buffer is reference
counted via zone (finalizer).

So zone is only needed if those types are appeared during unpacking
process.

I set zone to NULL by default. And the context has the pointer to
pointer to the zone. If the context meets ARRAY, MAP, STR, BIN, or EXT,
and zone (via pointer) is NULL, then allocate new zone.

It is lazy zone allocation strategy.
2018-11-23 11:08:08 +09:00
Takatoshi Kondo
8792f42f8d
Merge pull request #743 from redboltz/fix_741
Fixed #741.
2018-10-17 09:08:29 +09:00
Takatoshi Kondo
4f9ec65713 Fixed #741.
Fixed msgpack::type::tuple base class conversion.
Fixed C++03 msgpack::type::make_tuple.
2018-10-16 22:42:50 +09:00
Takatoshi Kondo
db54c78ed4
Merge pull request #737 from redboltz/fix_735
Added wstring adaptor.
2018-09-15 18:03:23 +09:00
Takatoshi Kondo
1155babda8 Added wstring adaptor. 2018-09-12 16:17:14 +09:00
Takatoshi Kondo
83a82e3eb5
Merge pull request #727 from redboltz/update_311
Updated the version to 3.1.1.
2018-09-09 15:27:47 +09:00
Takatoshi Kondo
aa9c73352c Added more fixes. 2018-09-09 13:51:43 +09:00
Takatoshi Kondo
df9e003b35
Merge pull request #736 from redboltz/force_set_endian
Added enforcing endian functionality.
2018-09-08 22:06:02 +09:00
Takatoshi Kondo
f6ddc9b85a Added enforcing endian functionality. 2018-09-08 20:06:00 +09:00
Takatoshi Kondo
11cfeeec92
Merge pull request #733 from tbeu/add-int-overflow-check-to-vrefbuffer
Adding int overflow checks to vrefbuffer
2018-09-07 09:04:22 +09:00
tbeu
d72765870a Move overflow check up 2018-09-06 15:09:52 +02:00
jwang
349c133171 Fix malloc size 2018-09-05 10:28:22 +02:00
tbeu
c056026dad Fix memory leaks 2018-09-04 22:24:40 +02:00
jwang
0421dabc1e removing unused vars 2018-09-03 22:23:54 +02:00
jwang
60930f4b12 adding unit tests and fixing same overflow issue in hpp files 2018-09-03 22:23:53 +02:00
jwang
b3dfe28be4 adding int overflow checks to vrefbuffer 2018-09-03 22:23:52 +02:00
jwang
e703d8a2f7 adding int overflow checks to vrefbuffer 2018-09-03 22:23:52 +02:00
Takatoshi Kondo
801f61c12c
Merge pull request #732 from tbeu/fix-static-cast
Fix VS2010 warning C4309: 'static_cast' : truncation of constant value
2018-09-03 17:20:52 +09:00
Takatoshi Kondo
a3e75a0709
Merge pull request #731 from tbeu/fix-return-types
Fix VS2010 build errors on return types
2018-09-03 17:20:24 +09:00
tbeu
92d34cbd79 Fix VS2010 warning C4309: 'static_cast' : truncation of constant value 2018-09-02 20:36:48 +02:00
tbeu
c99fd62ae6 Fix VS2010 build errors on return types 2018-09-02 19:55:33 +02:00
Takatoshi Kondo
a3986b3bdc
Merge pull request #730 from froydnj/update-predef-and-preprocessor
update boost predef and preprocessor from 1.61.0 to 1.68.0
2018-09-01 21:31:58 +09:00
Takatoshi Kondo
7fed49e6fe Merge branch 'froydnj-update-predef-and-preprocessor' 2018-09-01 20:36:18 +09:00
Takatoshi Kondo
005e06e00a Updated appveyor's boost. 2018-09-01 19:45:14 +09:00
Nathan Froyd
b6d4bb5cb0 update boost predef and preprocessor from 1.61.0 to 1.68.0
...via `git submodule foreach git pull origin boost-1.68.0` and
initializing cmake.

Fixes #728.
2018-08-31 14:57:19 -04:00
Takatoshi Kondo
f57bfd998b Updated the version to 3.1.1. 2018-08-28 00:17:42 +09:00
Takatoshi Kondo
e8d3387a04
Merge pull request #726 from redboltz/fix_724
Fixed #724.
2018-08-28 00:13:49 +09:00
Takatoshi Kondo
53d2ea9ad3 Fixed #724.
Fixed type mismatch in msgpack_timestamp.
Added 64bit singed postfix.
2018-08-27 22:40:04 +09:00
Takatoshi Kondo
b6803a5fec
Merge pull request #723 from redboltz/update_readme
Updated readme.
2018-08-21 22:30:54 +09:00
Takatoshi Kondo
210d3ce390 Updated readme. 2018-08-21 07:13:38 +09:00
Takatoshi Kondo
a350e0714e
Merge pull request #716 from redboltz/update_310
Updated the version to 3.1.0
2018-08-21 06:43:27 +09:00
Takatoshi Kondo
72757feae4 Updated the version to 3.1.0 2018-08-20 21:58:54 +09:00
Takatoshi Kondo
fe2346efa1
Merge pull request #721 from dennisklein/master
Export an interface target for the C++ header-only library
2018-08-17 07:41:31 +09:00
Takatoshi Kondo
43ae287be3
Merge pull request #722 from redboltz/fix_build_shared_libs
Fixed BUILD_SHARED_LIBS meaning.
2018-08-17 07:40:53 +09:00
Takatoshi Kondo
b804e12dec Fixed BUILD_SHARED_LIBS meaning.
There are three switches to build static/shared libraries.

Here is the logic.

If BUILD_SHARED_LIBS is defined
   If BUILD_SHARED_LIBS is ON
      build only shared-library
   Else
      build only static-library
   Endif
Else
   If MSGPACK_ENABLE_SHARED is ON (default)
      build shared-library
   Endif
   If MSGPACK_ENABLE_STATIC is ON (default)
      build static-library
   Endif
Endif

Here is common settings:

If you want to build both static/shared libraries, don't set switches.
If you want to build only shared-library, set BUILD_SHARED_LIBS=ON.
If you want to build only static-library, set BUILD_SHARED_LIBS=OFF.
2018-08-15 16:39:21 +09:00
Dennis Klein
99c221ad01
Export an interface target for the C++ header-only library 2018-08-13 20:54:29 +02:00
Takatoshi Kondo
3a615bcf44
Merge pull request #720 from redboltz/fix_711
Removed warnings.
2018-08-12 22:54:28 +09:00
Takatoshi Kondo
87863c1696 Removed warnings. 2018-08-12 20:59:00 +09:00
Takatoshi Kondo
45defd565a
Merge pull request #719 from redboltz/add_byte
Add byte
2018-08-12 20:48:19 +09:00
Takatoshi Kondo
f1726cef0d Updated travis-ci environment. 2018-08-12 18:31:44 +09:00
Takatoshi Kondo
8a788f3a48 Added C++17 std::byte support.
`std::byte` is mapped to
https://github.com/msgpack/msgpack/blob/master/spec.md#int-format-family.

`std::vector<std::byte>` and `std::byte[]` are mapped to https://github.com/msgpack/msgpack/blob/master/spec.md#bin-format-family.
2018-08-12 16:23:39 +09:00
Takatoshi Kondo
7710868556
Merge pull request #718 from seratch/fix-typo
Fix misspelled words in comments
2018-08-11 17:23:35 +09:00
Kazuhiro Sera
0b53833856 Fix misspelled words in comments, detected by github.com/client9/misspell 2018-08-11 11:28:40 +09:00
Takatoshi Kondo
43c643bab6
Merge pull request #717 from redboltz/fix_lack_of_so_version
Added so version if shared object only build.
2018-08-11 09:41:31 +09:00
Takatoshi Kondo
ac64fcace8 Added so version if shared object only build.
Fixed MSGPACK_INSTALLTARGETS list manipulation.
2018-08-10 19:39:43 +09:00
Takatoshi Kondo
84ba0c7b4b
Merge pull request #704 from owent-contrib/master
Fix MSGPACK_DEPRECATED for MSVC 1914 with /Zc:__cplusplus
2018-08-09 17:48:26 +09:00
Takatoshi Kondo
f79606d9ff
Merge pull request #713 from redboltz/fix_703
Fixed #703.
2018-08-08 21:50:37 +09:00
Takatoshi Kondo
3aaadb9b12 Fixed #703.
Added no build static-library option.
2018-08-08 20:14:48 +09:00
Takatoshi Kondo
8a3a11f123
Merge pull request #710 from redboltz/fix_709
Fixed #709.
2018-07-29 09:22:26 +09:00
Takatoshi Kondo
32f1f0edf2 Fixed #709.
Renamed parameter name on macros. It minimizes conflict with
MSGPACK_DEFINE* user defined arguments.
2018-07-29 07:45:57 +09:00
Takatoshi Kondo
5bd75905cb
Merge pull request #707 from redboltz/ts_c
Added timestamp minimal support for C.
2018-07-22 22:06:58 +09:00
Takatoshi Kondo
eebdc007a9 Added timestamp minimal support for C. 2018-07-22 20:38:36 +09:00
Takatoshi Kondo
3aae588a6a
Merge pull request #706 from redboltz/fix_638_3
Implemented #638.
2018-07-22 18:23:35 +09:00
Takatoshi Kondo
cb2dcb19b9 Implemented #638.
Added Time Stamp support.
2018-07-22 16:25:23 +09:00
Takatoshi Kondo
c58a565366
Merge pull request #705 from redboltz/fix_697
Fixed #697.
2018-07-22 10:27:39 +09:00
Takatoshi Kondo
93b944eec4 Fixed #697.
Removed out of range array dereference.
2018-07-21 20:42:40 +09:00
owent
7340f1e9c8 Fix MSGPACK_DEPRECATED for MSVC 1914 with /Zc:__cplusplus, @see https://docs.microsoft.com/cpp/build/reference/zc-cplusplus 2018-07-17 21:25:20 +08:00
Takatoshi Kondo
0a65c443a2
Merge pull request #694 from oleksak/patch-1
Update object.hpp
2018-05-28 07:28:36 +09:00
Oleksandr Kravchenko
bae6a8db57
Update object.hpp
a little bug fix
2018-05-26 19:59:01 +03:00
Takatoshi Kondo
ddb320197a
Merge pull request #689 from derwolfe/san-2
Sanitizer build for fuzzers
2018-05-21 19:25:30 +09:00
Chris Wolfe
dc51f6493b add/modify cmake and travis to get the regression tests built with sanitizers 2018-05-19 10:59:59 -05:00
Chris Wolfe
c027909acc add a test file for regression tests, cmakelist.txt to get it build correctly 2018-05-19 10:58:45 -05:00
Chris Wolfe
2bd56533fa add regression test cases 2018-05-19 10:57:50 -05:00
Takatoshi Kondo
c07452a7a2
Merge pull request #687 from jamessan/doxygen-paths
Strip the build path from generated documentation
2018-05-13 20:55:58 +09:00
James McCoy
8701aeec30 Strip the build path from generated documentation
Since FULL_PATH_NAMES = YES, Doxygen includes the full build path to the
file in the documentation.  This is most prevalent in the <title>
attribute for a file.

Setting STRIP_FROM_PATH = ${CMAKE_CURRENT_SOURCE_DIR}/include means that
only the relevant portion of the path (that which the user would need to
use) is included.

--- a/msgpack_8h.html	2018-05-12 14:03:34.098715879 -0400
+++ b/msgpack_8h.html	2018-05-12 14:04:17.386349607 -0400
@@ -5,7 +5,7 @@
 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
 <meta name="generator" content="Doxygen 1.8.13"/>
 <meta name="viewport" content="width=device-width, initial-scale=1"/>
-<title>MessagePack for C: /home/jamessan/src/debian.org/pkg-vim/msgpack-c/include/msgpack.h File Reference</title>
+<title>MessagePack for C: msgpack.h File Reference</title>
 <link href="tabs.css" rel="stylesheet" type="text/css"/>
 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript" src="dynsections.js"></script>
2018-05-12 14:04:48 -04:00
Takatoshi Kondo
2c4f2b890e
Merge pull request #686 from redboltz/fix_685
Fixed #685.
2018-05-12 16:15:22 +09:00
Takatoshi Kondo
f1acd78e54 Fixed #685.
Added fuzz directory to release tar ball.
2018-05-12 14:48:31 +09:00
Takatoshi Kondo
49d22b7d28
Merge pull request #683 from redboltz/fix_658
Fixed #658.
2018-05-10 22:50:54 +09:00
Takatoshi Kondo
96133c8dd9 Fixed #658.
Added include file checking.
2018-05-10 19:02:24 +09:00
Takatoshi Kondo
bd18a36dae
Merge pull request #681 from redboltz/update_doc_to_v3.0.0
Update the document for the version 3.0.0.
2018-05-09 21:40:30 +09:00
Takatoshi Kondo
3fe630769e Update the document for the version 3.0.0. 2018-05-09 16:16:50 +09:00
Takatoshi Kondo
2f80758889
Merge pull request #677 from komainu8/add_dll_export
Add dll export for msvc
2018-04-30 18:15:59 +09:00
Takatoshi Kondo
9f3efe9e54
Merge pull request #678 from derwolfe/lower-test-limit-oom
Lower limits for the fuzzer inputs
2018-04-30 09:25:24 +09:00
Chris Wolfe
6e44edf290 lower the input limits, I might need to push a config change to oss-fuzz as well to lower the max input size 2018-04-29 10:49:56 -05:00
Yasuhiro Horimoto
d28cbf32b9 Add dll export for msvc 2018-04-27 18:24:17 +09:00
Takatoshi Kondo
48d226e97c
Merge pull request #676 from redboltz/remove_object_pack_recursion
Removed recursion from msgpack::object packing and stringize.
2018-04-27 06:33:51 +09:00
Takatoshi Kondo
64698e8e8c Removed other recursions from msgpack::object.
Fixed start_map_item and start_array_item calling point.
Supported visitor aborting.
2018-04-27 00:54:55 +09:00
Takatoshi Kondo
e0d098641c
Merge pull request #674 from derwolfe/fix-fuzzer
Fix the fuzzer by setting limits for depth and ext.
2018-04-26 21:49:04 +09:00
Takatoshi Kondo
06f4b05487 Removed #if 0 codes. 2018-04-26 20:18:20 +09:00
Takatoshi Kondo
122fce5aee
Merge pull request #675 from derwolfe/add-fuzz-corpus
move the seed corpus in repo
2018-04-26 20:08:58 +09:00
Takatoshi Kondo
e3f5281903 Removed recursion from msgpack::object packing and stringize.
Changed json expected strings.

Before this commit, json output has redundant white space.
The commit remove it. Semantically no difference.
2018-04-26 19:36:48 +09:00
Chris Wolfe
88e94e3776 move the seed corpus in repo 2018-04-25 15:47:53 -05:00
Chris Wolfe
95275ff16e Fix the fuzzer by setting limits for depth and ext.
This is a short lived bug in the fuzzer implementation in which the
limits were not set correctly.

Credit to OSS-Fuzz
2018-04-25 08:00:47 -05:00
Takatoshi Kondo
4cb938ed18
Merge pull request #673 from redboltz/fix_671
Fixed #671.
2018-04-25 12:52:12 +09:00
Takatoshi Kondo
5f3e62461e
Merge pull request #672 from derwolfe/add-fuzzer-and-test
Add the fuzzer from oss-fuzz and a test that exercises it
2018-04-25 11:08:42 +09:00
Takatoshi Kondo
ec239933db Fixed #671.
Added STR type check to define_map.
2018-04-25 10:43:26 +09:00
Chris Wolfe
de59b393c7 conform to project norms and naming conventions 2018-04-24 20:04:54 -05:00
Chris Wolfe
b02371efe5 no reason to have this declaration 2018-04-24 18:09:15 -05:00
Chris Wolfe
f34289fdfd
remove newline that I accidentally added 2018-04-24 17:17:49 -05:00
Chris Wolfe
584478a4f1 fuzzers are cpp11 only at the moment 2018-04-24 15:22:20 -05:00
Chris Wolfe
700ec688f7 add the fuzzer from oss-fuzz and a test that exercises it 2018-04-24 15:05:09 -05:00
Takatoshi Kondo
a133c1d393
Merge pull request #670 from redboltz/fix_variadic_template
Added missing variadic template parameters.
2018-04-12 08:03:02 +09:00
Takatoshi Kondo
6ba9a58648 Added missing variadic template parameters. 2018-04-12 06:36:32 +09:00
Takatoshi Kondo
bb92d326c8
Merge pull request #668 from redboltz/fix_missing_install_files
Fixed #667.
2018-04-11 11:26:12 +09:00
Takatoshi Kondo
1e13dadf1f Added install file comparison script. 2018-04-11 09:49:47 +09:00
Takatoshi Kondo
7b271c2af2 Fixed #667. 2018-04-11 08:52:16 +09:00
Takatoshi Kondo
c3f4e52bdb
Merge pull request #666 from redboltz/fix_663_and_update_to_v3
Fix 663 and update to v3
2018-04-09 06:20:42 +09:00
Takatoshi Kondo
458b4c0363 Removed redundant version namespace qualification. 2018-04-08 23:24:17 +09:00
Takatoshi Kondo
f8dc0f0d04 Fixed #663. 2018-04-08 22:29:36 +09:00
Takatoshi Kondo
347658cdc1 Updated the version to 3.0.0.
See https://github.com/msgpack/msgpack-c/pull/639#issuecomment-353786498
So I updated the version to 3.0.0.
In the version 2.x, it keeps the original behavior.
2018-04-08 22:27:45 +09:00
Takatoshi Kondo
427a6e7313 Revert "Fixed #637."
This reverts commit 5ece2ef2c7e62f77b4d68e1665022c5b0cdbce3d.
2018-04-06 07:38:58 +09:00
Takatoshi Kondo
7f76a3caf0
Merge pull request #661 from Leo3738/master
Small grammatical changes made to README.md
2018-04-04 22:55:39 +09:00
Takatoshi Kondo
40539727e6 Merge branch 'kraj-master' 2018-04-04 22:52:56 +09:00
Takatoshi Kondo
30e56d0a45 Merge branch 'master' of https://github.com/kraj/msgpack-c into kraj-master 2018-04-04 21:11:56 +09:00
Takatoshi Kondo
8eef2a245b Merge branch 'cableramki-master' 2018-04-04 18:23:00 +09:00
Takatoshi Kondo
2bcfe2fdb0 Merge branch 'master' of https://github.com/cableramki/msgpack-c into cableramki-master 2018-04-04 15:55:35 +09:00
Takatoshi Kondo
2b49e62b3c Merge branch 'utkarsh009-master' 2018-04-04 15:54:09 +09:00
Takatoshi Kondo
bf70a36a1d Merge branch 'master' of https://github.com/utkarsh009/msgpack-c into utkarsh009-master 2018-04-04 14:04:00 +09:00
Takatoshi Kondo
eb92058cf4 Merge branch 'Elv13-master' 2018-04-04 14:00:48 +09:00
Takatoshi Kondo
423eaf25fb Removed -O3 -g -Werror options from CmakeLists.txt.
Added -g -Werror options to .travis.yml.
2018-04-04 13:07:21 +09:00
Takatoshi Kondo
280abe852c
Merge pull request #662 from redboltz/update_boost_on_travis
Update boost on travis
2018-04-04 12:18:00 +09:00
Takatoshi Kondo
c91307aaa1 Merge branch 'master' of https://github.com/Elv13/msgpack-c into Elv13-master 2018-04-04 12:13:56 +09:00
Takatoshi Kondo
88ffd08087 Supported boost 1.66.0 or later on the examples. 2018-04-04 07:44:49 +09:00
Takatoshi Kondo
bd337129c6 Updated the boost version to 1.66.0 on travis-ci. 2018-04-04 07:20:08 +09:00
Ramki A
1f5cb86366
Update unpack_decl.hpp 2018-04-02 17:58:04 -07:00
Ramki A
0d39c577d8
Update unpack.hpp 2018-04-02 17:57:52 -07:00
Ramki A
7e66dc28f0
Update unpack_decl.hpp 2018-04-02 17:57:25 -07:00
Ramki A
bec47a59f0
Update unpack.hpp 2018-04-02 17:56:57 -07:00
Leo3738
064f854ddf
Small grammatical changes made to README.md 2018-04-02 15:08:52 -07:00
Khem Raj
a05d92ae85 Fix -Werror=class-memaccess
Casting to void* make gcc happy since its upset about
object types and rightly so

Fixes

'void* memcpy(void*, const void*, size_t)' copying an object of non-trivial type 'struct msgpack::v2::object' from an array of 'const msgpack_object' {aka 'const struct msgpack_object'} [-Werror=class-memaccess]

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2018-04-01 19:55:38 -07:00
Ananthakrishnan
1fdfde5d5f Fixed #elif syntax. 2018-03-30 15:30:49 -07:00
Ananthakrishnan
b1620f1f6a Fixed Travis Mac OS build. 2018-03-30 15:14:59 -07:00
Ramki Ananthakrishnan
f789635ddc Fixed Coverity error due to missing header. 2018-03-29 15:09:19 -07:00
Utkarsh Anand
f65c26e280 Include <sys/uio.h> in NetBSD too.
This was needed for neovim
2018-03-28 20:18:05 +05:30
Emmanuel Lepage Vallée
579212996f
build: Do not set -g, -O3 and -Werror CFLAGS
Hello, here are a few changes to the default CFLAGS

## Why Werror

With each new compiler version, your code "break" and fail to compile. It is true that it's a sometime a "bug" in the code and need visibility to get fixed. However, Werror should *always* be a local CFLAGS and not a project one, see Google for endless people arguing back and forth and removing Werror is now the prevalent winner of that argument. In the latest GCC, it fails to compile because the fwrite result in unchecked. Even if you fix this in new releases, you cannot fix the past and all existing releases used in stable products suddenly fail to compile, wasting everybody time.

## Why -g

This should be decided by the one who compiles the code. Some people want small and pre-stripped binaries and appending this to the CFLAGS breaks the standard way of achieving this. Prepend it if you wish, but please do not append it.

## Why -O3

On many systems with limited cache or higher memory latency, `O3` is slower than `O2`, so IMHO it should not be hardcoded. In my case I used `Os` and it's faster. The `O` value should be left to the system, not hardcoded.
2017-12-12 01:26:22 -05:00
Takatoshi Kondo
208595b262
Merge pull request #639 from redboltz/fix_637
Fixed #637.
2017-11-28 08:05:43 +09:00
Takatoshi Kondo
83a4b89818
Merge pull request #645 from redboltz/fix_644
Fixed #644.
2017-11-14 19:04:03 +09:00
Takatoshi Kondo
d46f220737 Removed unused code. 2017-11-12 12:31:17 +09:00
Takatoshi Kondo
b4db293181 Fixed #644.
Added `as()` checking to MSGPACK_DEFINE family.
2017-11-11 15:44:31 +09:00
Takatoshi Kondo
d1eac600e9
Merge pull request #643 from redboltz/fix_642
Fixed #642.
2017-11-10 12:15:05 +09:00
Takatoshi Kondo
7e758ca053 Fixed #642.
Fixed documentation.
2017-11-09 10:40:43 +09:00
Takatoshi Kondo
db6d4f2003
Merge pull request #641 from redboltz/fix_640
Fixed #640.
2017-11-04 15:43:02 +09:00
Takatoshi Kondo
1ba46a30ce Fixed #640.
Replaced comma with semi colon.
Unified cording style.
2017-11-04 12:55:22 +09:00
Takatoshi Kondo
5ece2ef2c7 Fixed #637.
<<< Breaking change >>>
In the functions unpack() and parse(),
Old behavior: If any parse error is happend, offset is NOT updated.
New behavior: If any parse error is happend, offset is updated to the
position the error happened.

It helps MessagePack format error analysis.

If you want to old behavior, copy the original value of offset and then call unpack()
and/or parse().
2017-10-22 18:22:41 +09:00
Takatoshi Kondo
9513734040 Merge pull request #635 from sztomi/sztomi/objhandle_ops
Added * and -> operators to object_handle
2017-10-14 10:54:28 +09:00
sztomi
d452625ed1 Added * and -> operators to object_handle 2017-10-09 20:23:25 +02:00
Takatoshi Kondo
b02c6beb4d Merge pull request #634 from redboltz/fix_trusty
Fix trusty
2017-10-09 18:39:39 +09:00
Takatoshi Kondo
06c2896def Added symbolic link. 2017-10-09 15:20:29 +09:00
Takatoshi Kondo
724db8ed89 Added zlib1g-dev for 32bit build. 2017-10-09 14:29:47 +09:00
Takatoshi Kondo
fa48078a52 Merge pull request #631 from redboltz/fix_travis
Set `precise` explicitly to fix 32bit zlib missing problem.
2017-10-01 23:38:21 +09:00
Takatoshi Kondo
d8ad85fa8c Set precise explicitly to fix 32bit zlib missing problem. 2017-10-01 21:25:06 +09:00
Takatoshi Kondo
cc3b895449 Merge pull request #630 from samdoshi/patch-1
Don't sudo with brew in QUICKSTART-C.md
2017-10-01 17:45:36 +09:00
Sam Doshi
384242e5eb Don't sudo with brew in QUICKSTART-C.md 2017-10-01 08:29:46 +01:00
Takatoshi Kondo
7a98138f27 Merge pull request #625 from redboltz/update_to_215
Updated the version to 2.1.5.
2017-08-05 00:02:07 +09:00
Takatoshi Kondo
cd4e0bda57 Updated the version to 2.1.5.
Version 2.1.4 will be removed.
See https://github.com/msgpack/msgpack-c/issues/623
2017-08-04 23:07:27 +09:00
Takatoshi Kondo
1ad2db0c42 Merge pull request #624 from mkaes/master
Add defines for QNX build
2017-08-04 22:37:44 +09:00
Michael Kaes
96a76a7a5c Add defines for QNX build 2017-08-04 14:41:37 +02:00
Takatoshi Kondo
bc964bd847 Merge pull request #622 from redboltz/add_version_updater
Added version updating script.
2017-08-04 08:14:43 +09:00
Takatoshi Kondo
12604b5c8e Added version updating script. 2017-08-04 08:13:48 +09:00
Takatoshi Kondo
7c67109396 Updated README. 2017-08-04 07:18:17 +09:00
Takatoshi Kondo
fd4e28f23d Merge pull request #621 from redboltz/v2.1.4
Updated the version to 2.1.4.
2017-08-03 23:59:16 +09:00
Takatoshi Kondo
2098062613 Updated the version to 2.1.4. 2017-08-03 22:46:40 +09:00
Takatoshi Kondo
22bc707035 Merge pull request #619 from msgpack/fix_fusion_conflict
Fixed conflict between boost fusion sequence and std::tuple/std::pair.
2017-07-26 11:30:43 +09:00
Takatoshi Kondo
7ad743f2da Fixed conflict between boost fusion sequence and std::tuple/std::pair. 2017-07-26 10:24:17 +09:00
Takatoshi Kondo
315bbd4b40 Merge branch 'chshaob1-alignment' 2017-07-24 08:13:43 +09:00
Takatoshi Kondo
288a6b2e31 Fixed zone expansion algorithm. 2017-07-23 19:12:17 +09:00
Takatoshi Kondo
a0e4294b5a Set MSGPACK_ZONE_ALIGNOF(char) explicitly.
It makes efficient zone allocation.
If it was omitted, the default alignment was applied. It was inefficient.
2017-07-23 19:11:12 +09:00
Takatoshi Kondo
64baa15f8e Fixed aligned size. 2017-07-22 15:35:02 +09:00
Takatoshi Kondo
354ee5b9a3 Merge branch 'alignment' of https://github.com/chshaob1/msgpack-c into chshaob1-alignment 2017-07-22 15:28:12 +09:00
Takatoshi Kondo
2ddd79499c Merge pull request #617 from redboltz/partial_fix_460
Partially fixed #460.
2017-07-20 14:16:07 +09:00
Takatoshi Kondo
7f0614e998 Merge branch 'clarkli86-master' 2017-07-20 11:24:50 +09:00
Takatoshi Kondo
150d74508e Fixed msgpack_unpack_next(), C interface, return value. 2017-07-20 11:23:01 +09:00
Takatoshi Kondo
8674c821c4 Merge branch 'master' of https://github.com/clarkli86/msgpack-c into clarkli86-master 2017-07-20 11:18:38 +09:00
Takatoshi Kondo
10be66712d Partially fixed #460.
If msgpack-c compiles on "sparc" platform, then define
MSGPACK_ZONE_ALIGN=8 macro.
It allocates 8byte (64bit) alignment memory on zone allocating.
2017-07-20 11:00:16 +09:00
Clark Li
2698cfc254 Fix return type in C quickstart examples 2017-07-18 23:22:56 +09:30
Takatoshi Kondo
333ee98ab2 Merge pull request #613 from redboltz/fix_612
Fixed #612
2017-07-13 18:58:59 +09:00
Takatoshi Kondo
156e315394 Fixed #612
Removed visit_float() and added visit_float32() and visit_float64()
from/to unpack visitor.
2017-07-11 13:51:51 +09:00
Takatoshi Kondo
01fedf847b Merge pull request #611 from redboltz/fix_msvc_warning
Fixed msvc2015.
2017-07-04 08:49:56 +09:00
Takatoshi Kondo
56db4475f2 Fixed msvc2015. 2017-07-04 07:44:03 +09:00
Takatoshi Kondo
f065c2a447 Merge pull request #610 from redboltz/add_asio_examples
Added boost asio examples.
2017-07-03 22:48:55 +09:00
Takatoshi Kondo
ba4d8df63e Added boost asio examples. 2017-07-03 21:41:39 +09:00
Takatoshi Kondo
c00584281f Merge pull request #609 from redboltz/updated_to_2.1.3
Updated to version 2.1.3.
2017-06-15 23:58:21 +09:00
Takatoshi Kondo
45a0124ede Updated to version 2.1.3. 2017-06-15 22:37:33 +09:00
Takatoshi Kondo
ceb27348bd Merge pull request #608 from redboltz/add_cpp17_files
Added C++17 files to build setting.
2017-06-15 20:42:40 +09:00
Takatoshi Kondo
1ad737ee08 Added C++17 files to build setting. 2017-06-15 20:41:52 +09:00
Takatoshi Kondo
7024a1ec2c Merge pull request #607 from redboltz/fix_597
Solved #597.
2017-06-15 20:38:22 +09:00
Takatoshi Kondo
ca4a425a52 Merge pull request #602 from redboltz/fix_600
Fixed #600.
2017-06-15 16:08:24 +09:00
Takatoshi Kondo
a502097fd0 Solved #597.
Added `std::optional` and `std::string_view` adaptors.
2017-06-13 18:22:48 +09:00
Takatoshi Kondo
6b99a0c8b7 Merge branch 'jasperla-openbsd' 2017-06-13 12:51:27 +09:00
Takatoshi Kondo
1a3fcc3a22 Prevent iovec redefinition on C++. 2017-06-13 12:50:53 +09:00
Takatoshi Kondo
111739f8ce Merge branch 'openbsd' of https://github.com/jasperla/msgpack-c into jasperla-openbsd 2017-06-13 12:27:49 +09:00
Takatoshi Kondo
f638e2186b Merge pull request #605 from redboltz/fix_nonnull_warning
Fixed nonnull warnings on gcc 7.1.
2017-06-12 23:38:34 +09:00
Takatoshi Kondo
002376c678 Merge pull request #604 from redboltz/fix_gcc71_warning
Suppressed gcc 7.1 `maybe-uninitialized` warning.
2017-06-12 23:38:21 +09:00
Takatoshi Kondo
09a2f81b5f Merge pull request #603 from redboltz/add_missing_cmake_on_dist
Added a missing cmake file to makedist.sh.
2017-06-12 23:38:06 +09:00
Takatoshi Kondo
ffcaaeb482 Fixed #600.
Added `maybe-uninitialized` warning suppression code.
2017-06-12 15:33:05 +09:00
Takatoshi Kondo
bd511a4bd1 Fixed nonnull warnings on gcc 7.1. 2017-06-12 15:14:37 +09:00
Takatoshi Kondo
684c5e0bb0 Suppressed gcc 7.1 maybe-uninitialized warning.
When I execute cmake `-DMSGPACK_CXX11=OFF`, gcc 7.1 reports the warning.
I've already added the warning suppression pragma, but it doesn't work
in this case. So I added explicit initializing code even if it is redundant.
2017-06-12 14:11:21 +09:00
Takatoshi Kondo
8e74449181 Added a missing cmake file to makedist.sh. 2017-06-12 14:10:08 +09:00
Jasper Lievisse Adriaanse
f2b788e51f Sprinkle __OpenBSD__: include missing headers and prevent iovec redefinition 2017-06-11 18:13:10 +02:00
Takatoshi Kondo
7214b4c73f Merge pull request #599 from redboltz/fix_598
Fixed #598.
2017-06-08 20:44:21 +09:00
Takatoshi Kondo
a7a78bde9b Fixed #598. 2017-06-08 09:26:05 +00:00
Takatoshi Kondo
c50fbe4ce9 Merge pull request #595 from redboltz/ver_2.1.2
Updated the version to 2.1.2.
2017-06-07 13:23:23 +09:00
Takatoshi Kondo
d7d28b6f24 Updated the version to 2.1.2. 2017-06-06 12:26:09 +09:00
Takatoshi Kondo
5ebed34376 Merge pull request #592 from leolchat/master
Do not convert file everytime it is configured
2017-05-29 00:53:19 +09:00
Léonard Gérard
6871a82af7 Do not convert file everytime it is configured 2017-05-22 21:57:21 -07:00
Takatoshi Kondo
3f79968910 Merge branch 'herbrechtsmeier-ci' 2017-05-18 20:25:14 +09:00
Takatoshi Kondo
2e10adabb1 Removed X3_PARSE from osx build. 2017-05-18 19:47:53 +09:00
Takatoshi Kondo
0411ef85e7 Added warning supression pragma. 2017-05-15 16:52:29 +09:00
Takatoshi Kondo
28b6ee0db0 Updated clang version. 2017-05-15 15:55:52 +09:00
Takatoshi Kondo
3d0fa6043c Merge branch 'ci' of https://github.com/herbrechtsmeier/msgpack-c into herbrechtsmeier-ci 2017-05-15 13:57:06 +09:00
Stefan Herbrechtsmeier
ee169c4eb5 appveyor: Disable boost for non default compiler
The appveyor pre-installed software is only compiled with the default
compiler and couldn't be used with other compiler versions.

Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2017-05-13 00:58:10 +02:00
Stefan Herbrechtsmeier
0aaf95608f cmake: Make boost mandatory if MSGPACK_BOOST is ON
Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2017-05-13 00:57:03 +02:00
Stefan Herbrechtsmeier
918e7edba4 cmake: Add Boost library link directory
Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2017-05-13 00:56:19 +02:00
Takatoshi Kondo
88338195c0 Merge branch 'kraj-devtool' 2017-04-26 17:46:27 +09:00
Takatoshi Kondo
e90231c865 Added 'fallthrough' comments to suppress gcc7 warnings. 2017-04-24 17:16:43 +09:00
Khem Raj
15d8bb6792 Comment intentional fallthrough in case statements
Fixes build with gcc7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2017-04-22 08:53:50 -07:00
Takatoshi Kondo
20ef1f925b Merge pull request #586 from jamessan/gcc-7-fix
Comment the intentional fallthrough to default from _fixed_trail_again
2017-04-17 17:22:54 +09:00
Takatoshi Kondo
89b8f4ee13 Merge pull request #580 from herbrechtsmeier/config
Add cmake package config support
2017-04-17 16:38:29 +09:00
James McCoy
304ff96d04 Comment the intentional fallthrough to default from _fixed_trail_again
GCC 7 added a new diagnostic, -Wimplicit-fallthrough, which is enabled
with -Wextra that warns about implicitly falling through a case
statement.

    [  4%] Building C object CMakeFiles/msgpackc-static.dir/src/unpack.c.o
    /usr/lib/gcc-snapshot/bin/gcc   -I/home/jamessan/src/msgpack-c/. -I/home/jamessan/src/msgpack-c/include -I/home/jamessan/src/msgpack-c/build/include  -g -O2 -fdebug-prefix-map=/home/jamessan/src/msgpack-c=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -Wall -Wextra -Werror -g -O3 -o CMakeFiles/msgpackc-static.dir/src/unpack.c.o   -c /home/jamessan/src/msgpack-c/src/unpack.c
    In file included from /home/jamessan/src/msgpack-c/src/unpack.c:283:0:
    /home/jamessan/src/msgpack-c/include/msgpack/unpack_template.h: In function 'template_execute':
    /home/jamessan/src/msgpack-c/include/msgpack/unpack_template.h:238:17: error: this statement may fall through [-Werror=implicit-fallthrough=]
                     ++p;
                     ^~~
    /home/jamessan/src/msgpack-c/include/msgpack/unpack_template.h:240:13: note: here
                 default:
                 ^~~~~~~
    cc1: all warnings being treated as errors

Adding the comment makes it explicit that the fallthrough is
intentional, so gcc doesn't complain.
2017-04-13 11:43:27 -04:00
Takatoshi Kondo
10c1917f22 Merge pull request #582 from qehgt/fix-winsock-already-included
Fix 'WinSock.h has already been included' compiler error.
2017-04-12 20:44:56 +09:00
Takatoshi Kondo
d85e731ab4 Merge pull request #585 from redboltz/fix_584
Fixed #584.
2017-04-12 19:02:24 +09:00
Takatoshi Kondo
d431e25257 Fixed #584.
Reset m_cs to MSGPACK_CS_HEADER after visitor called.
2017-04-11 12:29:12 +09:00
Stefan Herbrechtsmeier
3d82c2d651 Add cmake package config support
Add support for CMake find_package command to msgpack. The package
exports the two targets msgpackc-static and msgpackc if shared is
enabled. The CMake find_package command works after installation
of msgpack and during build of another project which adds msgpack
as sub project via add_subdirectory command.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-04 08:33:18 +02:00
Vasily Titskiy
2cbaa3a7db Fix 'WinSock.h has already been included' compiler error.
Fix compiler error if Boost.Asio & msgpack are used together on Windows
Platform
2017-03-29 11:48:29 -04:00
Takatoshi Kondo
bfc6e45a2f Merge pull request #579 from herbrechtsmeier/boost
Add boost include directories only if MSGPACK_BOOST is enabled
2017-03-25 18:11:53 +09:00
Takatoshi Kondo
e8fa6c1aee Merge pull request #578 from herbrechtsmeier/wildcard
Pass wildcard precision of snprintf as int
2017-03-25 18:10:49 +09:00
Takatoshi Kondo
d49bec4e11 Merge pull request #577 from herbrechtsmeier/posix
Detect POSIX compatiblity explicit
2017-03-25 18:10:01 +09:00
Stefan Herbrechtsmeier
004939e732 Pass wildcard precision of snprintf as int
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-03-22 13:05:47 +01:00
Stefan Herbrechtsmeier
09e8833d53 Add boost include directories only if MSGPACK_BOOST is enabled
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-03-22 13:04:03 +01:00
Stefan Herbrechtsmeier
9ed842c014 Detect POSIX compatiblity explicit
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-03-22 13:03:33 +01:00
Takatoshi Kondo
99c4d37a39 Merge pull request #574 from redboltz/fix_536
Fixed #536.
2017-03-16 08:21:49 +09:00
Takatoshi Kondo
4df2bdecda Fixed #536.
Replaced __GNUC_MINOR__ 6 with 7 for suppress maybe-uninitialized.
2017-03-15 21:30:07 +09:00
Takatoshi Kondo
597cd63121 Merge pull request #572 from speleo3/PATH-alias
CMake <= 2.8.11 compatibility
2017-03-12 11:14:42 +09:00
Thomas Holder
a51f33c02f CMake <= 2.8.11 compatibility
Keep compatible with cmake <= 2.8.11 by using the legacy PATH alias for
DIRECTORY with get_filename_component.
2017-03-08 21:45:13 -05:00
Takatoshi Kondo
88032f37e1 Merge pull request #570 from lluixhi/boost
Enable building against dynamically-linked Boost
2017-03-05 13:02:14 +09:00
Takatoshi Kondo
a76911a72c Merge pull request #569 from lluixhi/master
Make header install obey MSGPACK_ENABLE_CXX
2017-03-05 11:53:56 +09:00
Takatoshi Kondo
1bc27d72cc Merge pull request #568 from dstahlke/fix
Fixed spurious start_map_key/start_array_item calls
2017-03-05 11:02:05 +09:00
Aric Belsito
a6599e5fb4
Enable building against dynamically-linked Boost 2017-03-03 12:31:56 -08:00
Aric Belsito
791f55da35
Make header install obey MSGPACK_ENABLE_CXX 2017-03-03 12:25:55 -08:00
Dan L. Stahlke
e58b00016b Fixed spurious start_map_key/start_array_item calls 2017-03-03 09:00:15 -08:00
Takatoshi Kondo
b4fe698777 Merge pull request #565 from mongi3/patch-1
Minor fix to Quickstart (broke with 2.0)
2017-02-13 15:05:13 +09:00
mongi3
e89045cfcd Minor fix to Quickstart (broke with 2.0)
non reference version won't compile with 2.0 release.
2017-02-11 15:06:42 -07:00
Takatoshi Kondo
c6e6dbc608 Added string view to file list. 2017-02-04 20:17:37 +09:00
Takatoshi Kondo
e271cf2aed Merge pull request #563 from redboltz/ver2.1.1
Updated the version to 2.1.1.
2017-02-04 20:14:37 +09:00
Takatoshi Kondo
53e4bb92fe Updated the version to 2.1.1. 2017-02-04 19:04:14 +09:00
Takatoshi Kondo
303c1000c2 Merge pull request #562 from redboltz/fix_561
Fixed #561
2017-02-04 12:45:51 +09:00
Takatoshi Kondo
088ce946b9 Fixed #561
Fixed unpacker's buffer expansion logic.
2017-02-03 17:11:51 +09:00
Takatoshi Kondo
dc86adbf8e Merge pull request #558 from redboltz/add_boost_string_view
Added boost string_view adaptor.
2017-01-20 09:33:23 +09:00
Takatoshi Kondo
ad0cae30ad Merge pull request #559 from raeraex2/fix_compilation_warning
Fix compilation warnings about possible loss of data
2017-01-19 09:43:32 +09:00
raeraex2
bf3e2abc9e Update appveyor.yml
Updated zlib to 1.2.11
2017-01-17 23:22:18 +01:00
raeraex2
b7543e1386 Fix compilation warnings about possible loss of data 2017-01-17 22:16:05 +01:00
Takatoshi Kondo
1f515b3ae7 Added boost string_view adaptor. 2017-01-15 19:09:31 +09:00
Takatoshi Kondo
a933fa5892 Merge pull request #557 from obache/neatsrc/fix-char-subscripts-warnings
Make sure to pass `unsigned char` to `isprint()`
2017-01-13 14:15:15 +09:00
Takatoshi Kondo
a07622c276 Merge pull request #556 from obache/neatsrc/strip-cr
Strip unwanted CR before EOL
2017-01-12 20:47:35 +09:00
OBATA Akio
c955727d8c Make sure to pass unsigned char to isprint()
This change make safe for `char = signed char`.

As the spec, argment of `isprintf()` must be representabe as an
`unsigned char` (or equal to EOF, not expected here).
Additionally, some implementation define it as a macro using array,
then it cause warning "array subscript has type `char` [-Wchar-subscripts]"
with `char` argments.
2017-01-12 15:01:04 +09:00
OBATA Akio
094b70213a Strip unwanted CR before EOL 2017-01-12 14:35:51 +09:00
Takatoshi Kondo
c0bf8b3aff Merge pull request #555 from redboltz/ver2.1.0
Updated the version to 2.1.0.
2017-01-10 21:34:33 +09:00
Takatoshi Kondo
5be2757216 Updated the version to 2.1.0. 2017-01-10 17:17:24 +09:00
Takatoshi Kondo
c6c31dc5cd Merge pull request #553 from redboltz/x3_parse
X3 parse
2017-01-09 17:59:29 +09:00
Takatoshi Kondo
c704d4bfab Added new example. 2017-01-09 16:18:35 +09:00
Takatoshi Kondo
4466bda819 Updated travis-ci.
Use container based build `sudo: false`.
2017-01-07 01:20:22 +09:00
Takatoshi Kondo
4623654996 Updated include files list. 2017-01-07 01:20:22 +09:00
Takatoshi Kondo
84ad9a2634 Added Spirit.X3 based parse.
It uses iterator pair instead of data and size.
2017-01-05 21:24:25 +09:00
Takatoshi Kondo
9b141fa9b6 Separated parse and unpack on v2. 2017-01-04 11:45:51 +09:00
Takatoshi Kondo
6a1fa2e0fc Merge pull request #552 from redboltz/fix_534
Fixed #534.
2017-01-02 21:53:29 +09:00
Takatoshi Kondo
c55f778198 Fixed #534.
Added conditional [[deprecated]] attribute.
Updated zlib version.
2017-01-02 20:40:34 +09:00
Takatoshi Kondo
b4f2acb945 Merge pull request #550 from redboltz/fix_cpp_array_of
Fixed array and map size overflow.
2016-12-29 13:23:13 +09:00
Takatoshi Kondo
7e139125e2 Fixed array and map size overflow. 2016-12-29 12:13:14 +09:00
Takatoshi Kondo
9d37316b44 Merge pull request #549 from redboltz/fix_redundant_calc
Fixed redundant caluclation.
2016-12-14 12:18:16 +09:00
Takatoshi Kondo
364fc0daf6 Fixed redundant caluclation. 2016-12-14 10:02:49 +09:00
Takatoshi Kondo
f24201f71f Merge pull request #548 from redboltz/fix_c_error_code
Fixed C unpack return code.
2016-12-14 10:00:40 +09:00
Takatoshi Kondo
9a113bb0ca Fixed C unpack return code. 2016-12-14 00:07:43 +09:00
Takatoshi Kondo
2674e34769 Merge pull request #547 from redboltz/fix_overflow
Fixed integer overflow and EXT size problem.
2016-12-13 23:03:19 +09:00
Takatoshi Kondo
c5c3de8f61 Fixed integer overflow and EXT size problem. 2016-12-13 15:47:20 +09:00
Takatoshi Kondo
0b7cabd322 Merge pull request #545 from redboltz/fix_544
Fix 544
2016-12-11 17:43:21 +09:00
Takatoshi Kondo
22780a6808 Suppressed maybe uninitialized warnings. 2016-12-11 15:54:27 +09:00
Takatoshi Kondo
4ec0fdf207 Fixed #544.
Replaced -std=c++03 with -std=c++98.
2016-12-11 15:53:59 +09:00
Takatoshi Kondo
85a0404d8c Merge branch 'pmalhaire-socket_stream_example' 2016-12-11 15:40:33 +09:00
Takatoshi Kondo
ce67c8ed35 Removed valgrind install from osx.
Updated boost.
2016-12-11 14:53:24 +09:00
Takatoshi Kondo
1893a8e31e Updated valgrind version. 2016-12-11 14:37:44 +09:00
pmalhaire
dc8c253577 fix msvc warning 2016-11-30 10:30:26 +01:00
pmalhaire
9c77a0f24a Adding an example of sax like parser using buffered content (could be a socket) 2016-11-30 10:28:57 +01:00
Takatoshi Kondo
61c053d37e Merge pull request #538 from heylouiz/gtest_1_8_0_gcc_5_4_1
Fix compilation with Gtest 1.8.0 and GCC 5.4.1
2016-11-16 23:00:19 +09:00
Luiz Silva
04b549a46b Replace c-Style cast with static_cast 2016-11-16 11:00:28 -02:00
Luiz Silva
4a1db60af8 Fix compilation with Gtest 1.8.0 and GCC 5.4.1 2016-11-10 10:59:26 -02:00
Takatoshi Kondo
55b51c506f Merge pull request #535 from redboltz/add_map_name
Supported any names for MSGPACK_DEFINE_MAP using MSGPACK_NVP.
2016-11-02 13:35:36 +09:00
Takatoshi Kondo
a97c00e463 Added msgpack::object cheking code before covert it. 2016-11-02 08:53:14 +09:00
Takatoshi Kondo
e61cd76310 Supported any names for MSGPACK_DEFINE_MAP using MSGPACK_NVP. 2016-10-30 16:25:19 +09:00
Takatoshi Kondo
c30962da25 Merge branch 'mika-fischer-fix_cmake_cxx_headers' 2016-10-30 14:10:08 +09:00
Takatoshi Kondo
6b7becdef0 Fix typo that caused the C++ headers not to be included in cmake file generating script. 2016-10-30 14:08:56 +09:00
Takatoshi Kondo
cfa1ab38cc Merge branch 'fix_cmake_cxx_headers' of https://github.com/mika-fischer/msgpack-c into mika-fischer-fix_cmake_cxx_headers 2016-10-30 14:05:57 +09:00
Takatoshi Kondo
2f34d22bf5 Merge pull request #533 from Kronuz/patch-1
Save the flags of the stream
2016-10-29 13:28:10 +09:00
Takatoshi Kondo
401460b7d9 Merge pull request #531 from redboltz/fix_521
Fixed #521.
2016-10-29 12:56:49 +09:00
Germán M. Bravo
03b770fdf2 Save the flags of the stream
Changing the stream to `std::hex` mode should only affect the current character; otherwise printing some msgpack with a list like this: `[123, "string\\u0003", 123]` (123 decimal) ends up printing `[123, "string\\u0003", 7b]`, as `std::hex` is sticky.
2016-10-28 15:27:03 -05:00
Mika Fischer
d3cd07987b Fix typo that caused the C++ headers not to be included in CMake project 2016-10-17 17:05:07 +02:00
Beilu Shao
b4786711df alignment: use proper alignment size
Pass proper alignment size when use allocate_align(). This will
fix alignment trap issues on ARM.

Signed-off-by: Beilu Shao <beilushao@gmail.com>
2016-10-16 23:59:13 +02:00
Takatoshi Kondo
ccc9ac5538 Fixed #521.
Introduced new object type `FLOAT32` and `FLOAT64`.
`FLOAT64` is equivalent to `FLOAT`.
The both internal expressions are f64(double).
2016-10-11 23:23:06 +09:00
Takatoshi Kondo
1df97bc37b Merge pull request #530 from mbodmer/master
Removed MSGPACK_ENABLE_GCC_CXX_ATOMIC macro
2016-10-11 20:52:51 +09:00
Marc Bodmer
8d09b7090d Removed MSGPACK_ENABLE_GCC_CXX_ATOMIC macro since this does not exist in user code and this code would not be active then. 2016-10-11 10:33:08 +02:00
Takatoshi Kondo
2a7335ae90 Merge pull request #529 from mbodmer/master
Fixing building with gcc_atomic.hpp
2016-10-10 19:59:27 +09:00
Marc Bodmer
e7eae65ab7 Fixed path of gcc_atomic.h and gcc_atomic.hpp in definition of _msgpack_atomic_counter_header 2016-10-10 10:42:08 +02:00
Marc Bodmer
4e663609ca Fixed name of define as evaluated in CMakeLists.txt 2016-10-10 10:40:45 +02:00
Takatoshi Kondo
98820ec6c7 Merge pull request #528 from redboltz/fix_519
Fixed #519.
2016-10-09 13:34:07 +09:00
Takatoshi Kondo
baea172cc9 Fixed #519.
Suppressed maybe unused warnings.
2016-10-09 12:06:35 +09:00
Takatoshi Kondo
e9e31a2899 Merge pull request #526 from redboltz/fix_525
Fixed #525.
2016-10-09 11:42:14 +09:00
Takatoshi Kondo
8ffb619031 Fixed #525.
Set osx version.
2016-10-09 10:17:50 +09:00
Takatoshi Kondo
a3ed6274c2 Merge pull request #524 from starthal/readme-remove-autotools
Remove autotools instructions from README
2016-10-08 20:29:50 +09:00
Stephen Albert
f795e5d568 Remove autotools instructions from README 2016-10-05 14:41:01 -04:00
Takatoshi Kondo
87ff7e4ccc Merge pull request #515 from edsiper/unpacker_size
unpack: new msgpack_unpacker_next_with_size() function
2016-09-11 19:32:48 +09:00
Eduardo Silva
da46fb1ef7 test: c: add test for new msgpack_unpacker_next_with_size()
Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
2016-09-07 16:24:52 -06:00
Eduardo Silva
b90bcf3c11 unpack: unpacker_next_with_size() update parsed bytes on success or continue
This patch makes unpacker_next_with_size(...), update p_bytes when
unpacker_next() returns MSGPACK_UNPACK_SUCCESS or MSGPACK_UNPACK_CONTINUE.

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
2016-09-06 10:46:30 -06:00
Takatoshi Kondo
c1f19c0e47 Merge pull request #504 from redboltz/fix_503
Fixed #503.
2016-09-06 23:00:17 +09:00
Eduardo Silva
d9a77e220a unpack: new msgpack_unpacker_next_with_size() function
This new function is an extension of the original msgpack_unpacker_next()
where it now adds third argument to store the number of parsed bytes for
the returned buffer upon a MSGPACK_UNPACK_SUCCESS case.

This is useful for cases where the caller needs to optimize memory usage
in the original buffer,s so upon success retrieval of the object, it can
later deprecate the already 'parsed' bytes.

For more details about the origins of this function please refer to the
following issue on github:

  https://github.com/msgpack/msgpack-c/issues/514

Signed-off-by: Eduardo Silva <eduardo@treasure-data.com>
2016-08-31 16:49:14 -06:00
Takatoshi Kondo
894547582b Merge branch 'pkrenz-VariadicC11Fix' 2016-08-30 08:47:21 +09:00
Takatoshi Kondo
3a87cc8826 Merge branch 'VariadicC11Fix' of https://github.com/pkrenz/msgpack-c-1 into pkrenz-VariadicC11Fix 2016-08-30 00:04:09 +09:00
Takatoshi Kondo
6177038fcf Merge branch 'mdrohmann-master' 2016-08-29 23:59:08 +09:00
Takatoshi Kondo
25259dc705 Updated gtest location. 2016-08-29 22:49:12 +09:00
Takatoshi Kondo
5d69c22bf9 Use OR instead of AND for all classes that have multiple types.
Revert example. Combination of has_as and not has_as are move to tests.
2016-08-29 22:12:01 +09:00
Philipp
a9caff538e Fix warning in versioning 2016-08-26 16:56:01 +02:00
Martin C Drohmann
9a2bb0c972 demonstrate the motivation behind the previous patch 2016-08-23 15:09:02 -07:00
Martin C Drohmann
7191a3b014 enable as<map<...> > implementation when the key OR the value have as() 2016-08-23 15:03:14 -07:00
Takatoshi Kondo
b82b58f184 Merge pull request #508 from redboltz/fix_507
Fixed #507.
2016-08-02 22:26:45 +09:00
Takatoshi Kondo
73af452ed8 Fixed #507.
Removed -Wno-mismatched-tags option from g++.
g++ doesn't support the option and doesn't care the mismatch originally.
2016-07-29 19:49:53 +09:00
Takatoshi Kondo
95b31d0d16 Merge pull request #505 from smititelu/buffer-print-bin
Print unprintable characters in memory buffer
2016-07-21 21:10:41 +09:00
Stefan Mititelu
c73d9a9dab Print unprintable characters in memory buffer 2016-07-19 12:17:38 +00:00
Takatoshi Kondo
0164c1efe2 Merge branch 'iphydf-bin-printer' 2016-07-16 10:26:16 +09:00
Takatoshi Kondo
48abfe7aa1 Adusted coding style. 2016-07-16 10:25:38 +09:00
Takatoshi Kondo
8105c33f9d Merge branch 'bin-printer' of https://github.com/iphydf/msgpack-c into iphydf-bin-printer 2016-07-16 10:19:40 +09:00
Takatoshi Kondo
237cf888d8 Merge branch 'smititelu-master' 2016-07-16 09:33:58 +09:00
Takatoshi Kondo
b9bc9d4195 Replaced uint32_t with size_t.
User buffer size is not limited by msgpack-c so size_t is the
appropriate type.
2016-07-16 09:32:19 +09:00
Takatoshi Kondo
aa790ba785 Merge branch 'master' of https://github.com/smititelu/msgpack-c into smititelu-master 2016-07-16 09:20:39 +09:00
iphydf
1da0539a00
Improve bin/ext printer for unprintable characters.
msgpack_object_print used fwrite to write binary data to a stream. The intention
of the function is to produce a human-readable representation of the object for
debugging purposes. Having arbitrary data dumped as is can cause issues with
terminals that interpret it as control sequences.

This change prints printable characters as is and unprintable characters as
hex-escapes ("\xNN"). Note that UTF-8 encoded characters will now be printed as
escaped sequence of UTF-8 bytes. This is an acceptable compromise, as doing
otherwise would require a light form of UTF-8 decoding and BIN-typed objects
should not be used to transport UTF-8 strings anyway (STR should be used
instead).
2016-07-12 13:31:05 +02:00
Takatoshi Kondo
d7a656523b Fixed #503.
Fixed fwrite return value comparison.
2016-07-11 19:34:10 +09:00
Takatoshi Kondo
f573fd6a26 Merge pull request #499 from redboltz/fix_498
Fixed #498.
2016-07-10 09:27:11 +09:00
Stefan Mititelu
4fa661a63d Add msgpack_object_print_buffer() function
In order to print the msgpack object in a memory buffer.
2016-07-07 22:43:48 +03:00
Takatoshi Kondo
2e4de8b65c Fixed #498.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38764
2016-07-06 21:52:08 +09:00
Takatoshi Kondo
42181289ed Merge pull request #492 from redboltz/ver2.0.0
Appended CHANGELOG. Updated version.
2016-06-25 13:42:05 +09:00
Takatoshi Kondo
cd84d04860 Appended CHANGELOG. Updated version. 2016-06-25 13:38:39 +09:00
Takatoshi Kondo
0d1e1787de Merge pull request #491 from redboltz/fix_424
Fix 424
2016-06-22 21:56:12 +09:00
Takatoshi Kondo
45b8d29cc0 Added CMAKE_VERSION checking.
cmake version less than 3.1 doesn't have the policy CMP0054.
2016-06-22 00:20:19 +09:00
Takatoshi Kondo
0bfe4c49b7 Set CMP0054 policy to NEW. 2016-06-21 23:50:33 +09:00
Takatoshi Kondo
3c997edd71 Merge pull request #489 from redboltz/fix_390
Fix 390
2016-06-21 21:07:29 +09:00
Takatoshi Kondo
523e986077 Added size_equal_only support for C++03 msgpack::type::tuple. 2016-06-20 18:39:04 +09:00
Takatoshi Kondo
90c2e35694 Fixed warnings on clang on OSX. 2016-06-20 17:30:51 +09:00
Takatoshi Kondo
4ffdc01135 Added converting support for different size tuples. 2016-06-20 17:12:53 +09:00
Takatoshi Kondo
b398ce9acc Merge pull request #488 from redboltz/fix_485
Improved C-Style array support.
2016-06-20 17:05:32 +09:00
Takatoshi Kondo
1b87018a0a Fixed #390.
Added size_equal_only class template to check converted container size
strictly.
Relaxed std::array size checking by default.
Fixed std::tuple and msgpack::type::tuple size checking problem.
2016-06-20 15:32:24 +09:00
Takatoshi Kondo
755342bb25 Improved C-Style array support.
In the case the target type is char[] or const char[],

If the array is '\0' teminated, msgpack-c packs the characters before
'\0', otherwise packs all characters.

When converting, the array has the size that is greater than
msgpack::object STR's size, msgpack-c adds '\0' to just after converted
characters. Otherwise msgpack-c doesn't add '\0'.
2016-06-19 20:47:42 +09:00
Takatoshi Kondo
438c4ff8ca Merge pull request #479 from aberaud/master
Add msvc project back
2016-06-19 20:20:51 +09:00
Takatoshi Kondo
20e777c1fa Merge pull request #487 from ys-nuem/support-mingw
Add missing platform detection in examples/test
2016-06-19 18:55:43 +09:00
Takatoshi Kondo
3f98327f3b Merge pull request #486 from ys-nuem/support_mingw_cmake
Add support for MinGW platform in CMakeLists.txt
2016-06-19 17:59:55 +09:00
Takatoshi Kondo
224a830ce0 Merge pull request #481 from redboltz/support_msvc_cli
Support MSVC cli.
2016-06-19 08:13:00 +09:00
Yusuke Sasaki
b4c4c213b1 Add missing platform detection in examples/test 2016-06-18 03:38:42 +09:00
Yusuke Sasaki
edc8004985 avoid to install DLLs in lib/ 2016-06-18 02:51:01 +09:00
Yusuke Sasaki
7f37eac04c switch suffix of import library between MSVC and MinGW 2016-06-18 02:50:51 +09:00
Takatoshi Kondo
0f66e144ab Support MSVC cli.
MSVC CLI defined their own nullptr and provides for __nullptr for standard C++11.
https://msdn.microsoft.com/en-us/library/4ex65770.aspx
msgpack-c introduce MSGPACK_NULLPTR for internal use, it is defined as __nullptr only if compiled on C++ CLI otherwise defined as nullptr.
2016-06-08 18:03:51 +09:00
Adrien Béraud
0d475a9dbc Add msvc project back 2016-06-07 12:26:15 -04:00
Takatoshi Kondo
ca5ef097ac Merge pull request #476 from redboltz/remove_autotools
Removed autotools and msvc files.
2016-06-06 14:05:45 +09:00
Takatoshi Kondo
4ee616bbde Removed autotools and msvc files.
Please use cmake.
2016-06-05 21:54:59 +09:00
Takatoshi Kondo
de972fbe0f Merge pull request #471 from redboltz/add_new_packaging_script
Added the new packaging script.
2016-06-05 20:57:26 +09:00
Takatoshi Kondo
585f330694 Merge pull request #475 from redboltz/update_boost_1_56_to_1_61
Updated boost predef and preprocessor from 1.58.0 to 1.61.0
2016-05-30 17:25:29 +09:00
Takatoshi Kondo
89faf6ee9f Updated boost predef and preprocessor from 1.58.0 to 1.61.0 2016-05-30 13:20:58 +09:00
Takatoshi Kondo
83dbe398fd Merge pull request #474 from redboltz/fix_gcc_atomic_hpp_location
Moved gcc_atomic.hpp location.
2016-05-30 13:12:55 +09:00
Takatoshi Kondo
b68c073d1b Moved gcc_atomic.hpp location. 2016-05-30 09:55:16 +09:00
Takatoshi Kondo
7eb8c8221a Merge pull request #473 from redboltz/create_list_of_files
Added msgpack-c library file generation.
2016-05-30 09:46:35 +09:00
Takatoshi Kondo
7094e0872e Added msgpack-c library file generation.
When you add or remove .h .hpp .c files in the msgpack-c library, run
make_file_list.sh. It generates (overwrites) Files.cmake for cmake and
src/files.mk for autotools. They are a part of repository managed
files. Files.cmake is included by CMakeLists.txt and src/files.mk is
included by src/Makefile.am.
2016-05-29 21:09:03 +09:00
Takatoshi Kondo
4b26a82ae8 Added the new packaging script.
It will replace make dist with autotools.
2016-05-28 19:59:17 +09:00
Takatoshi Kondo
22613d4dd0 Merge pull request #464 from redboltz/fix_463
Fixed #463.
2016-05-24 08:22:50 +09:00
Takatoshi Kondo
d15d9220ff Merge pull request #461 from redboltz/add_unpack_visitor_api
Added a visitor version of unpack API,
2016-05-22 22:50:44 +09:00
Takatoshi Kondo
a3f353ef42 Merge pull request #466 from redboltz/fix_465
Fixed #465
2016-05-18 19:00:57 +09:00
Takatoshi Kondo
cc02da0ccf Fixed #465
Added C-Style array support.

Existing mapping:
  convert:
  pack:
    char[N]       => STR
    const char[N] => STR
  object:
    char[N]       => STR (v1 only)
    const char[N] => STR (v1 only)
  object_with_zone:
    char[N]       => STR
    const char[N] => STR

Additional mapping:

  convert:
    STR        => char[N]
    ARRAY      => T[N]
  pack:
    T[N]       => ARRAY
    const T[N] => ARRAY
  object:
  object_with_zone:
    T[N]       => ARRAY
    const T[N] => ARRAY
2016-05-16 23:00:30 +09:00
Takatoshi Kondo
e6f82cf2bb Fixed #463.
Added lacked include files.
Added a test.
Added MSVC build settings on appveyor.
Added old MSVC workaround.
Fixed a variable definition point to meet ANSI-C.
2016-05-14 22:05:10 +09:00
Takatoshi Kondo
6593cba284 Fixed end_map_value() calling point.
Renamed names that related to a visitor.
Renamed test name from json to json_like because I omit escape.
Added end_map_value() and end_map() implementation.
2016-05-05 18:44:56 +09:00
Takatoshi Kondo
d5b515899c Added a visitor version of unpack API,
The current unpacking APIs are constructed on the visitor mechanism.
(Fixed #418)

Updated test condition.
2016-05-01 21:44:03 +09:00
Takatoshi Kondo
068041f05e Merge pull request #458 from redboltz/fix_457
Fixed #457.
2016-04-17 11:28:02 +09:00
Takatoshi Kondo
e21b4ef28d Fixed #457.
JSON doesn't have `nil` but has `null`.
msgpack::object JSON output uses `null` when the object is nil_t.
2016-04-14 14:48:42 +09:00
Takatoshi Kondo
4c9685977b Merge branch 'proller-patch-2' 2016-04-14 14:45:31 +09:00
Takatoshi Kondo
c9814de513 Added -Wno-mismatched-tags to msgpackc-static. 2016-04-14 14:44:01 +09:00
proller
bf7bc19ccb Fix compiling without shared 2016-04-06 21:42:22 +03:00
Takatoshi Kondo
07b5000824 Merge pull request #453 from redboltz/removed_obsolete_unpack
Removed obsolete `unpack()` API.
2016-03-27 17:38:58 +09:00
Takatoshi Kondo
d6ef2bc91d Merge pull request #452 from redboltz/fix_pack_comment
Fixed pack comment.
2016-03-27 14:35:09 +09:00
Takatoshi Kondo
db90ee4283 Removed obsolete unpack() API. 2016-03-26 11:46:45 +09:00
Takatoshi Kondo
a3e868acb8 Fixed pack comment. 2016-03-26 11:18:21 +09:00
Takatoshi Kondo
62048e1aa0 Merge pull request #451 from redboltz/removed_obsolete_apis_from_v2
Removed obsolete APIs form v2.
2016-03-25 20:51:14 +09:00
Takatoshi Kondo
31a06a0682 Removed obsolete APIs form v2.
Removed MSGPACK_DISABLE_LEGACY_CONVERT from v2. Those APIs are removed
from v2.
2016-03-25 09:16:27 +09:00
Takatoshi Kondo
72c7feb2c4 Merge pull request #449 from redboltz/update_version_2_0
Updated the version to 2.0.0.
2016-03-21 19:33:58 +09:00
Takatoshi Kondo
a83e43a52f Merge pull request #448 from redboltz/replace_unpacked_with_object_handle
Replaced msgpack::unpacked with msgpack::object_handle.
2016-03-21 17:27:15 +09:00
Takatoshi Kondo
8b1632dc1d Merge pull request #444 from redboltz/nil_for_v2
type::nil is defined only if MSGPACK_USE_LEGACY_NIL in v2.
2016-03-21 17:26:08 +09:00
Takatoshi Kondo
170d29a13c Updated the version to 2.0.0.
It's not a release. Just inform that the master branch is for the
version 2.0.0.
2016-03-21 16:50:31 +09:00
Takatoshi Kondo
1bfcf55469 Replaced msgpack::unpacked with msgpack::object_handle.
msgpack::unpacked is a typedef of the msgpack::object_handle.
I recommend using msgpack::object_handle. It can be used not only
holding unpacked msgpack objects but also msgpack::objects that are
created by any types.

Replaced unpack() APIs in test codes and examples. They used to use old
APIs.
2016-03-21 15:22:50 +09:00
Takatoshi Kondo
85164687f3 Merge pull request #447 from redboltz/fix_446
Fixed #446.
2016-03-21 15:19:58 +09:00
Takatoshi Kondo
f5f42782be Fixed #446.
Replaced passed by value with passed by rvalue reference on
msgpack::object_handle's constructor.
2016-03-21 00:51:18 +09:00
Takatoshi Kondo
60a4cba6d6 Merge pull request #443 from redboltz/fix_442
Fixed #442.
2016-03-18 14:27:02 +09:00
Takatoshi Kondo
5ecb797d8a type::nil is defined only if MSGPACK_USE_LEGACY_NIL in v2.
Note: In v1, type::nil is defined if NOT defined MSGPACK_DISABLE_LEGACY_NIL.
2016-03-18 09:40:34 +09:00
Takatoshi Kondo
455e0190d1 Fixed #442.
Updated msgpack::v1::operator<< and >> implementation.
Those functions refer to current version of convert, pack, object, and object_with_zone.
2016-03-17 08:43:00 +09:00
Takatoshi Kondo
84932e62e9 Merge pull request #441 from redboltz/fix_440
Fixed #440.
2016-03-15 11:33:52 +09:00
Takatoshi Kondo
fe229d1df0 Fixed #440.
Fixed a pointer operation problem at msgpack::zone::chunk_list::clear().
It was only happened on C++03.
2016-03-12 11:39:38 +09:00
Takatoshi Kondo
b5b865a6ca Merge pull request #436 from al11090/master
Fixed the broken float en/decoder on iOS
2016-03-02 09:58:03 +09:00
Takatoshi Kondo
d8e9941fa9 Merge pull request #434 from redboltz/fix_417
Fix 417
2016-03-02 09:56:53 +09:00
Mizuki Hirata
bab3eea3a8 fixed the broken float en/decoder, caused by dead detector 'TARGET_OS_IPHONE'. 2016-02-29 02:22:58 +09:00
Takatoshi Kondo
07e635f158 Merge pull request #435 from redboltz/fix_433
Fix 433
2016-02-27 08:06:06 +09:00
Takatoshi Kondo
b641065d1f Added a pragma for avoiding maybe-uninitialized warning. 2016-02-26 15:51:35 +09:00
Takatoshi Kondo
60d4b2833d Fixed #433.
Added zero size check before calling std::vector<T>::front().
Added empty checking tests for all containers.
2016-02-26 15:08:18 +09:00
Takatoshi Kondo
1244edeaf1 Removed the test that uses msgpack::object with std::string on version 1.x. 2016-02-26 13:52:14 +09:00
Takatoshi Kondo
acf4ac01fc Fixed #417.
Removed object adaptor specialization for std::string from v2.
2016-02-22 10:06:15 +09:00
Takatoshi Kondo
549c28459e Merge pull request #430 from redboltz/undo_constructor
Undo-ed overly removed constructors.
2016-02-22 09:42:04 +09:00
Takatoshi Kondo
86ac7c6eb7 Undo-ed overly removed constructors. 2016-02-20 23:50:53 +09:00
Takatoshi Kondo
0e53b350d3 Merge pull request #426 from redboltz/fix_422
Fixed #422.
2016-02-20 18:47:42 +09:00
Takatoshi Kondo
db0726fa76 Merge pull request #423 from redboltz/fix_invalid_size_expansion
Fixed zone expansion algorithm.
2016-02-18 22:48:00 +09:00
Takatoshi Kondo
664ab708e4 Fixed #422.
Replaced the inheriting constructor with a forwarding constructor.
Removed the template constructors that are covered by the forwarding constructor.
Added std::forward() to make_tuple.
Added conversion constructor.

Moved msgpack::type::tuple to
include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp from
include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp.
msgpack::type::tuple_cat requires the class template tuple definition.
2016-02-18 16:44:02 +09:00
Takatoshi Kondo
f88e621dca Fixed zone expansion algorithm.
See:
https://github.com/msgpack/msgpack-c/pull/160#commitcomment-16087596
2016-02-16 12:18:38 +09:00
Takatoshi Kondo
0e7345c282 Merge pull request #421 from ibell/patch-1
Replace stdint.h header in check_container_size_decl.hpp
2016-02-15 07:55:52 +09:00
Ian Bell
7b578cc065 Replace stdint.h header in check_container_size_decl.hpp
``#include <stdint.h>`` is invalid in MSVC 9 2008 .  Using the system dependent header does work in my testing with MSVC9, and should be safe for other compilers I think.
2016-02-14 15:15:11 -07:00
Takatoshi Kondo
988f72d5eb Merge pull request #420 from ibell/patch-1
Add signed flags to MSVC integer definitions
2016-02-14 13:27:47 +09:00
Ian Bell
c51e8ace48 Add signed flags to MSVC integer definitions 2016-02-13 19:19:03 -07:00
Takatoshi Kondo
43a86cf5b9 Merge pull request #415 from redboltz/prepare_for_version2
Re-organized tree to prepare for version 2.0.0.
2016-02-13 21:36:22 +09:00
Takatoshi Kondo
54cb4350b3 Re-organized tree to prepare for version 2.0.0.
See https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_versioning
2016-01-31 19:28:31 +09:00
Takatoshi Kondo
cabd8a8a03 Merge pull request #413 from redboltz/version-1.4.0
Release version 1.4.0.
2016-01-22 10:53:12 +09:00
Takatoshi Kondo
8640754417 Release version 1.4.0.
Fixed markdown layouts.
2016-01-22 10:02:59 +09:00
Takatoshi Kondo
7d1be40e10 Merge pull request #410 from redboltz/fix_399
Fixed #399
2016-01-22 00:10:26 +09:00
Takatoshi Kondo
3c271892e3 Fixed #399
If MSGPACK_DISABLE_LEGACY_CONVERT is defined, msgpack::object::convert(T*) is removed.
Added MSGPACK_DISABLE_LEGACY_CONVERT to build system and documents.

Please define MSGPACK_DISABLE_LEGACY_CONVERT and update your code as follows:
Replace
  int i;
  obj.convert(&i); // Removed pointer version
with
  int i;
  obj.convert(i);  // Reference version
2016-01-21 22:28:53 +09:00
Takatoshi Kondo
83ab53ecd4 Merge pull request #412 from redboltz/add_disable_legacy_macros_for_build
Added MSGPACK_DISABLE_LEGACY_NIL to build system and documents.
2016-01-21 22:18:09 +09:00
Takatoshi Kondo
ba73841240 Added MSGPACK_DISABLE_LEGACY_NIL to build system and documents. 2016-01-21 20:47:16 +09:00
Takatoshi Kondo
13afc54ccc Merge pull request #411 from redboltz/change_default_macro
Fixed existing code compile error problem.
2016-01-21 19:34:43 +09:00
Takatoshi Kondo
2865a96ba5 Fixed existing code compile error problem.
Changed macro name from MSGPACK_USE_LEGACY_NIL to
MSGPACK_DISABLE_LEGACY_NIL. msgpack-c shouldn't make compile error on
existing codes by default without major version up.
So if you want to disable msgpack::type::nil, you need to define
MSGPACK_DISABLE_LEGACY_NIL macro.
2016-01-21 17:29:22 +09:00
Takatoshi Kondo
79222b65a3 Merge pull request #409 from redboltz/fix_wshadow
Fixed -Wshadow warning.
2016-01-20 14:58:46 +09:00
Takatoshi Kondo
83f0429db8 Merge pull request #408 from redboltz/replace_nil_with_nil_t
Replaced nil with nil_t.
2016-01-20 14:04:56 +09:00
Takatoshi Kondo
6c035f7d2b Merge pull request #407 from redboltz/add_doc
Added unpack, pack, object, and object_handle documentation.
2016-01-19 09:06:58 +09:00
Takatoshi Kondo
ed5a4123b5 Replaced nil with nil_t.
Added nil typedef for existing codes.
2016-01-18 22:12:38 +09:00
Takatoshi Kondo
b8530e30df Fixed -Wshadow warning. 2016-01-18 21:52:50 +09:00
Takatoshi Kondo
8bf2f33782 Added unpack, pack, object, and object_handle documentation. 2016-01-18 21:49:28 +09:00
Takatoshi Kondo
356fbcf187 Merge pull request #400 from ryochack/fix_fbuffer_warning
Fixed an incompatible type warning
2016-01-15 12:53:15 +09:00
Takatoshi Kondo
1adf90e9df Merge branch 'redboltz-fix_382' 2016-01-15 12:45:07 +09:00
Takatoshi Kondo
c2f523e463 Merge branch 'fix_382' of https://github.com/redboltz/msgpack-c into redboltz-fix_382 2016-01-15 12:44:40 +09:00
Takatoshi Kondo
1e8f5d0d67 Merge pull request #402 from redboltz/fix_395
Fixed #395
2016-01-15 11:11:55 +09:00
Takatoshi Kondo
0a8d25cd35 Merge pull request #404 from jamessan/fix-endian-condition
Check whether MSGPACK_ENDIAN_LITTLE_BYTE is true, not defined.
2016-01-15 11:05:19 +09:00
James McCoy
72e0d1a424 Check whether MSGPACK_ENDIAN_LITTLE_BYTE is true, not defined.
msgpack/predef/other/endian.h always defines both
MSGPACK_ENDIAN_LITTLE_BYTE and MSGPACK_ENDIAN_BIG_BYTE, but they're
defined to a true or false value depending on whether the system is
little/big endian.

Fix this condition to check the truthiness rather than whether it is
defined, like the other locations this macro is checked.

Closes #403

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-01-14 19:31:27 -05:00
Takatoshi Kondo
c06d4d70ef Fixed #395
libmsgpack.[a|so] is the library file for C++.
libmsgpackc.[a|so] is the library file for C.
Since version 1.0.0, the C++ parts of msgpack-c is a header only
library. So libmsgpack.* shouldn't be generated.

On the autotools building environment, removed libmsgpack.*
generation. On the cmake building environment, replaced libmsgpack.*
with libmsgpackc.* and set so-version to 2.0.0.
2016-01-14 07:59:37 +09:00
Takatoshi Kondo
69f588dd36 Merge pull request #401 from redboltz/fix_392
Fixed #392
2016-01-14 07:57:05 +09:00
Takatoshi Kondo
65b47fa032 Merge pull request #397 from redboltz/fix_396
Fixed #396.
2016-01-13 18:33:41 +09:00
Takatoshi Kondo
22fd249b12 Fixed #392
Avoided the warning when `char` does not have sign using template lazy instantiation.
Removed redundant `inline`.
2016-01-13 17:38:51 +09:00
Takatoshi Kondo
96831350b8 Merge pull request #398 from jamessan/unsigned-char-ci
Add CI testing of signed/unsigned char differences
2016-01-13 15:25:55 +09:00
ryochack
5da3c031fd Fix warning of 'msgpack_fbuffer_write' 2016-01-13 12:18:33 +09:00
James McCoy
71eba2406d Add CI testing of signed/unsigned char differences
This should help catch problems like #392 sooner.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-01-12 20:17:43 -05:00
Takatoshi Kondo
892fa8c2bd Fixed #396.
Added Doxyfile to the distribution package.
Generated ChangeLog as a copy of CHANGELOG.md.
2016-01-11 08:57:00 +09:00
Takatoshi Kondo
42e332bb8c Merge pull request #394 from jamessan/cmake-SOVERSION
Set SOVERSION to 4 for CMake builds
2016-01-11 07:45:02 +09:00
James McCoy
40604c3d40 Set SOVERSION to 4 for CMake builds
In aa79fc2f, the SOVERSION was bumped to 4 for autoconf-based builds,
but was left at 3 for CMake builds.  This shouldn't differ based on
which tool is used to build msgpack-c.

Signed-off-by: James McCoy <jamessan@jamessan.com>
2016-01-09 21:31:32 -05:00
Takatoshi Kondo
e183efcce2 Merge pull request #387 from kgrz/update-quick-start-docs-with-new-api
Update install instructions and QUICKSTART-C.md
2015-12-03 23:11:37 +09:00
Kashyap
772e4e01a3 Remove whitespace 2015-12-01 09:27:10 +05:30
Kashyap
3660b495c3 Use post 1.x APIs in Quickstart docs 2015-12-01 09:26:46 +05:30
Kashyap
7a02f03a82 Update install instructions with latest msgpack 2015-12-01 09:26:19 +05:30
Takatoshi Kondo
953077b73f Merge pull request #386 from redboltz/update_license
Version 1.3.0.
2015-11-22 16:26:19 +09:00
Takatoshi Kondo
ba15089d86 Version 1.3.0.
Updated the license from the license from the Apache License Version 2.0
to the Boost Software License, Version 1.0.
Removed unused files.
2015-11-21 12:41:46 +09:00
Takatoshi Kondo
b8ee27c672 Replaced EXPECT_EQ with EXPECT_TRUE to avoid ostream requirement. 2015-11-19 09:22:40 +09:00
Takatoshi Kondo
ee65a319ba Replaced EXPECT_EQ with EXPECT_TRUE to avoid ostream requirement. 2015-11-18 08:29:35 +09:00
Takatoshi Kondo
46502480e9 Replaced EXPECT_EQ with EXPECT_TRUE to avoid ostream requirement. 2015-11-15 12:40:37 +09:00
Takatoshi Kondo
50e1c23941 Removed gcc_atomic.cpp from CMakelist.txt. 2015-11-15 12:40:17 +09:00
Takatoshi Kondo
b76c8aeb83 Merge pull request #384 from jpetso/jpetso_refwrap
Support to-object conversions for std::reference_wrapper<const T>.
2015-11-13 10:23:44 +09:00
Jakob Petsovits
b5599ef3fc Support to-object conversions for std::reference_wrapper<const T>.
Previously the conversion would fail because struct object is not
generally provided for the const version of the type, but because
the wrapper would pass down the type unchanged, it would look for
exactly that missing template specialization unsuccessfully.

This is specifically an issue for std::reference_wrapper because
std::cref() returns an std::reference_wrapper<const T>.
2015-11-11 19:40:22 -05:00
Takatoshi Kondo
39e7856c48 Fixed #382.
Fixed warnings on gcc 4.1.2.
Added gcc version checking for adding -std=c++03 flag.
2015-11-12 00:20:21 +09:00
Takatoshi Kondo
1a7aa5e5ec Merge pull request #383 from bpay/vs2015-cpp11
Fix VS2015 still using C++03 API
2015-11-10 22:33:46 +09:00
Ben Payne
aad5b96083 Fix VS2015 still using C++03 API 2015-11-08 15:58:55 -05:00
Takatoshi Kondo
dea3190d36 Merge pull request #381 from mogemimi/fix-minor-typo
Fix minor typos
2015-11-07 20:41:58 +09:00
mogemimi
c001a52582 Fix minor typos 2015-11-07 15:47:11 +09:00
Takatoshi Kondo
f58eb11fd5 Merge pull request #380 from whoshuu/expand-buffer-tests
Add tests for expanding an unpacker buffer
2015-11-01 12:02:01 +09:00
Takatoshi Kondo
134beee0cd Merge pull request #379 from whoshuu/increase-unpack-coverage
Add coverage for all free unpack codepaths
2015-10-28 11:10:13 +09:00
Huu Nguyen
434dae8424 Add tests for expanding an unpacker buffer 2015-10-26 23:08:43 -04:00
Huu Nguyen
d8dd77884b Add coverage for all free unpack codepaths 2015-10-26 21:27:11 -04:00
Takatoshi Kondo
ea991d5a01 Merge pull request #378 from whoshuu/add-nil-pack-test
Add test for packing/unpacking nil
2015-10-25 19:06:50 +09:00
Huu Nguyen
6a127eb24f Add test for packing/unpacking nil 2015-10-23 08:49:06 -07:00
Takatoshi Kondo
5e57dc5da7 Merge pull request #376 from tbeu/patch-1
Only set MSGPACK_DLLEXPORT if not already defined
2015-10-20 12:50:51 +09:00
Takatoshi Kondo
d23a649427 Merge pull request #375 from whoshuu/test-parse-error
Write test case for parse error when unpacking unused 0xc1
2015-10-20 12:50:09 +09:00
tbeu
12ae60fd77 Only set MSGPACK_DLLEXPORT if not already defined
Allow applications that inlcude msgpack.h to predefine MSGPACK_DLLEXPORT, e.g., to not export any symbols in case of MSVC.
2015-10-18 22:55:32 +02:00
Huu Nguyen
282b0b5927 Write test case for parse error when unpacking unused 0xc1 2015-10-18 15:14:38 -04:00
Takatoshi Kondo
0a261fca42 Merge pull request #373 from redboltz/add_ref_wrapper
Added std::reference_wrapper packing and making object and object_wit…
2015-10-15 11:02:47 +09:00
Takatoshi Kondo
20104301f3 Added convert adaptor support. 2015-10-11 12:16:34 +09:00
Takatoshi Kondo
428780db53 Added std::reference_wrapper packing and making object and object_with_zone support.
Fixed #370.
2015-10-09 15:45:29 +09:00
Takatoshi Kondo
6bf5160bf2 Merge branch 'spatz-patch-4' 2015-09-10 22:12:11 +09:00
Takatoshi Kondo
ef45359d81 Fix warning with -Wconversion at pack_v4raw(). 2015-09-10 22:11:52 +09:00
Dror Levin
3202bb6a2e Fix warning with -Wconversion 2015-09-06 13:07:40 +03:00
Nobuyuki Kubota
63971da5a4 Merge pull request #364 from redboltz/1_2_0_rel
Updated version. Appended CHANGELOG.
2015-09-04 19:34:00 +09:00
Takatoshi Kondo
8a17e7f647 Updated version in README.md 2015-09-04 19:36:46 +09:00
Takatoshi Kondo
69607f4117 Updated version. Appended CHANGELOG. 2015-09-04 19:32:01 +09:00
Takatoshi Kondo
e5948a3450 Merge pull request #363 from nobu-k/add-missing-files
Add missing files to Makefile.am
2015-09-04 19:27:04 +09:00
Nobuyuki Kubota
3fc061b5fd Add unsigned adaptors to CMakeLists.txt 2015-09-04 19:26:08 +09:00
Nobuyuki Kubota
2b38389f68 Add missing files to Makefile.am 2015-09-04 19:18:23 +09:00
Takatoshi Kondo
9e4dfb2484 Merge pull request #362 from nobu-k/osx-warning-fix
Fix some warnings on OS X
2015-09-04 19:07:32 +09:00
Nobuyuki Kubota
356a5ea42d Fix some warnings on OS X 2015-09-04 18:51:53 +09:00
Nobuyuki Kubota
93142323f0 Merge pull request #349 from redboltz/variant
Variant
2015-09-04 18:42:47 +09:00
Nobuyuki Kubota
3352b2f029 Merge pull request #359 from redboltz/fix_243
Fixed #243.
2015-09-04 18:34:19 +09:00
Takatoshi Kondo
364658ea99 Merge pull request #360 from redboltz/fixed_warnings_on_release_build
Fixed warnings on build with CMAKE_BUILD_TYPE=Release.
2015-09-04 18:21:39 +09:00
Takatoshi Kondo
50088365df Merge pull request #361 from redboltz/fix_make_dist
Fixed 'make dist'.
2015-09-04 17:21:12 +09:00
Takatoshi Kondo
d640395765 Fixed 'make dist'. 2015-09-04 15:42:13 +09:00
Takatoshi Kondo
be0f8c280a Fixed warnings on build with CMAKE_BUILD_TYPE=Release.
Added stream outputs to suppress warnings and to help understanding.
2015-09-01 11:06:29 +09:00
Takatoshi Kondo
9b156823ff Merge pull request #358 from redboltz/fix_357
Fixed #357.
2015-09-01 08:35:11 +09:00
Takatoshi Kondo
dc2e1a4ead Fixed indent style. 2015-08-31 16:45:01 +09:00
Takatoshi Kondo
96f145812f Fixed #243.
std::vector<unsigned char> and std::array<unsigned char> are mapped to BIN.
std::vector<uint8_t> and std::array<uint8_t> are mapped to BIN if uint8_t is the same type of unsigned char, otherwise mapped to ARRAY.

Added array_ref. When client wraps BIN mapped types above with array_ref as msgpack::type::array_ref<std::vector<char> >, the type is mapped to ARRAY.
2015-08-31 14:06:39 +09:00
Takatoshi Kondo
33de24239a Fixed #357.
Added a conversion member function to msgpack::object.
If msgpack::object is nil then returns false else returns true and sets a value.
2015-08-31 09:05:09 +09:00
Takatoshi Kondo
d17c70cbb0 Added whitespaces at inheritance. 2015-08-30 19:17:19 +09:00
Takatoshi Kondo
88ab7b6349 Unified variant and variant_ref to basic_variant.
Added is_* and as_* member functions to basic_variant.
Added tests.
2015-08-30 17:05:04 +09:00
Takatoshi Kondo
df5f84d49d Added totally ordered. 2015-08-30 13:08:00 +09:00
Takatoshi Kondo
0609347d82 Fixed typo.
Removed function stype casts for strings.
2015-08-30 12:28:53 +09:00
Takatoshi Kondo
61eb4b1f6e Replaced boost::variant typedef with a class inheriting boost::variant.
Added char const* to std::string conversion constructor.
Added integer familiy constructor. int64_t is only used when an actual value is negative.

Clients no longer need to use casts for std::string and ingeter family.
2015-08-30 12:28:30 +09:00
Takatoshi Kondo
9ee1168cc4 Merge pull request #354 from redboltz/fix_348
Fixed #348.
2015-08-26 16:14:55 +09:00
Takatoshi Kondo
95e0fc5cef Merge pull request #344 from n1tehawk/contrib
refactor example/c/lib_buffer_unpack.c
2015-08-26 16:14:23 +09:00
Takatoshi Kondo
a0b7e7cc27 Merge pull request #353 from jonitis/feature_sbuffer_move_semantics
Add move semantics to sbuffer in c++11 mode
2015-08-19 18:15:17 +09:00
Takatoshi Kondo
92822996e2 Fixed #348.
The parameter 'offset' of unpack() function family, not unpacker family, updates only when the function successfully finished.

The parameter 'offset' used to update even if a caller passes insufficient bytes to the unpack() function family.
2015-08-19 10:52:08 +09:00
Dainis Jonitis
e9eac32238 Fix member initialization order 2015-08-18 17:32:45 +03:00
Dainis Jonitis
c61446b988 operator = should return reference to self 2015-08-18 16:56:35 +03:00
Takatoshi Kondo
294aa52c3a Merge pull request #350 from redboltz/fix_compile_option
-std=c++11 and -std=c++03 flags shouldn't be given in indivitual CMak…
2015-08-18 21:41:42 +09:00
Dainis Jonitis
90f7b9c732 Add move semantics to sbuffer 2015-08-18 14:50:47 +03:00
NiteHawk
720c18bcf8 add missing msgpack_unpacker_free(), and a "clean" assertion avoiding side effects 2015-08-18 12:24:16 +02:00
Takatoshi Kondo
23a040f2e5 Fixed std::map::erase is ambiguous problem in osx, clang, libc++ combination. 2015-08-18 18:15:10 +09:00
Takatoshi Kondo
cd9d6c5940 Added msgpack::type::variant and msgpack::type::variant_ref that is based on boost::variant.
You can convert to those types from any msgpack objects.
2015-08-18 17:47:27 +09:00
Takatoshi Kondo
8cae20ffc4 -std=c++11 and -std=c++03 flags shouldn't be given in indivitual CMakeLists.txt.
cpp03 examples should be compiled both -std=c++03 and -std=c++11.
2015-08-18 13:52:02 +09:00
NiteHawk
1788d6ce01 amend pull request (#344) following the related discussion
There's a small problem remaining if assertions are disabled (with -DNDEBUG).
2015-08-17 21:49:03 +02:00
Nobuyuki Kubota
722143c0de Merge pull request #345 from redboltz/added_has_as_to_pair
Added has_as SFINAE.
2015-08-17 12:21:25 -07:00
Nobuyuki Kubota
57b030a6dd Merge pull request #347 from redboltz/update_comment
Updated comments to describe #if !define(_MSC_VER) reason.
2015-08-17 12:11:04 -07:00
Nobuyuki Kubota
9c0f629c68 Merge pull request #346 from aberaud/master
Make example build optional with cmake
2015-08-17 12:08:31 -07:00
Takatoshi Kondo
018c6c819e Updated comments to describe #if !define(_MSC_VER) reason. 2015-08-18 00:06:36 +09:00
Adrien Béraud
8d3673e7ee Make example build optional with cmake 2015-08-17 10:55:30 -04:00
NiteHawk
871a796037 fix: remove unused variable introduced by previous commit 2015-08-17 16:23:11 +02:00
NiteHawk
4e65bc35ed refactor example/c/lib_buffer_unpack.c
The example has some duplicated code that somewhat distracts from
the main processing loop. I think placing this into a separate
function improves readability of the code.
2015-08-17 15:59:19 +02:00
Takatoshi Kondo
062864a6b7 Added has_as SFINAE. 2015-08-17 22:33:15 +09:00
Takatoshi Kondo
767099a0eb Merge branch 'jonitis-feature_vs2015_support' 2015-08-15 21:15:41 +09:00
Takatoshi Kondo
1c810bcb74 Removed the tests that contain std::tuple with non default constructible class on MSVC2015.
It seems that MSVC2015 requires tuple elements' default constructor during 'as' process.
I don't know why.
2015-08-15 21:01:12 +09:00
Takatoshi Kondo
0fafa7a4b3 Updated boost path. 2015-08-15 14:27:39 +09:00
Takatoshi Kondo
c75009d513 Added explicit MSGPACK_USE_CPP03 on MSVC2015 and leter. 2015-08-15 10:37:00 +09:00
Takatoshi Kondo
a1ca382b2d Added msgpack:: qualifier. 2015-08-14 23:31:51 +09:00
Takatoshi Kondo
8eadc04d37 Merge remote-tracking branch 'boltz/msvc2015_cpp11' into jonitis-feature_vs2015_support 2015-08-14 21:29:31 +09:00
Takatoshi Kondo
849ba867d6 Merge branch 'feature_vs2015_support' of https://github.com/jonitis/msgpack-c into jonitis-feature_vs2015_support 2015-08-14 20:43:50 +09:00
Takatoshi Kondo
11f2f333c6 Supported C++11 mode on MSVC2015. 2015-08-14 17:02:43 +09:00
Takatoshi Kondo
94ddf1ac5d Merge pull request #342 from redboltz/fix_examles
Fix examles
2015-08-13 15:52:45 +09:00
Takatoshi Kondo
5da1abb1ce Added byte stream dump. 2015-08-13 13:23:23 +09:00
Takatoshi Kondo
efc27e8eb4 Fixed the bug that map examples don't use MSGPACK_DEFINE_MAP.
Removed MSGPACK_USE_BOOST requirement from map based serialization.
2015-08-13 13:23:09 +09:00
Takatoshi Kondo
51dd7cbf22 Merge branch 'jen20-cmake-enable-shared' 2015-08-13 12:07:38 +09:00
Takatoshi Kondo
866e73acc3 Merge branch 'cmake-enable-shared' of https://github.com/jen20/msgpack-c into jen20-cmake-enable-shared 2015-08-13 11:13:10 +09:00
Takatoshi Kondo
a1fc7863e9 Merge pull request #341 from redboltz/refine_examples
Refine examples
2015-08-13 10:27:56 +09:00
Takatoshi Kondo
12b5a6235a Added examples to cmake building process.
Set /WX flas that is warnings as errors on MSVC build.
Updated linux, osx, msvc build to refer to appropriate boost libraries.
2015-08-12 17:49:33 +09:00
Takatoshi Kondo
e50cc5d79f Fixed warnings on MSVC. 2015-08-12 13:55:51 +09:00
Takatoshi Kondo
4501551267 Merge pull request #340 from redboltz/add_boost_preprocessor
Added Boost.Preprocessor as a submodule.
2015-08-12 13:50:55 +09:00
Takatoshi Kondo
e719cbbb7a Removed 7zip installation from appveyor. It is pre-installed now. 2015-08-11 20:00:48 +09:00
Takatoshi Kondo
5adea26044 Added install files. 2015-08-11 19:58:54 +09:00
Takatoshi Kondo
4b2b3a18df Added Boost.Preprocessor as a submodule.
Replaced boost/ with msgpack/ and BOOST with MSGPACK in Boost.Preprocessor files.
Renamed existing macron in versioning.hpp to avoid confict with MSGPACK_PP_*.
Removed MSGPACK_USE_BOOST requirement from MSGPACK_DEFINE_MAP.
2015-08-11 16:32:24 +09:00
Dainis Jonitis
8f8d1800bd Add Visual Studio 2015 support 2015-08-11 09:46:17 +03:00
Dainis Jonitis
091715671c Use version from HEAD 2015-08-11 09:39:41 +03:00
Nobuyuki Kubota
41bff7b96d Merge branch 'add_boost_predef' 2015-08-10 11:30:29 -07:00
Nobuyuki Kubota
b13cb13efc Fix compile errors on OS X due to signed-unsigned comparison in tests 2015-08-10 11:29:57 -07:00
Takatoshi Kondo
38f946d2cf Merge pull request #338 from redboltz/fix_travis
Fixed typo.
2015-08-10 12:16:44 +09:00
Takatoshi Kondo
6007f4ea05 Fixed typo. 2015-08-10 10:32:43 +09:00
Takatoshi Kondo
078eb3a436 Merge pull request #335 from redboltz/fix_266
Fixed #266.
2015-08-08 09:32:45 +09:00
Takatoshi Kondo
22b6bb9f78 Fixed #266. 2015-08-06 14:46:41 +09:00
Takatoshi Kondo
4dcd162879 Merge branch 'makiolo-master' 2015-08-05 18:51:07 +09:00
Takatoshi Kondo
cd54ba99fc Removed SET_SOURCE_FILES_PROPERTIES because msgpack-c source files compile as C now.
Added missing header files for installation.
2015-08-05 18:38:25 +09:00
Ricardo Marmolejo García
d437961546 * Changes for compile msgpack with Visual Studio 2012 2015-08-05 17:34:03 +09:00
Takatoshi Kondo
f1679a17a2 Merge pull request #334 from redboltz/add_travis_osx
Add travis osx
2015-08-05 15:45:27 +09:00
Takatoshi Kondo
afc9666760 Remove test cases to reduce travis-ci time using orthgonal table approach. 2015-08-05 14:25:55 +09:00
Takatoshi Kondo
d4199b59f9 Added osx support on travis-ci. 2015-08-05 13:49:15 +09:00
Takatoshi Kondo
7e2076b799 Merge pull request #333 from redboltz/fix_osx_build
Fixed osx compile error.
2015-08-04 22:12:29 +09:00
Takatoshi Kondo
41f27b5d62 Fixed osx compile error. 2015-08-04 15:44:06 +09:00
Takatoshi Kondo
d91c510d8c Merge pull request #328 from redboltz/add_missing_iterator
Added iterator.hpp to the installing files list.
2015-08-04 09:59:08 +09:00
Takatoshi Kondo
ebb7c05bdc Merge pull request #332 from redboltz/add_as_support_for_deque
Added 'as' support for std::deque.
2015-08-04 09:58:56 +09:00
Takatoshi Kondo
78b3e8adad Added 'as' support for std::deque. 2015-08-03 17:57:46 +09:00
Takatoshi Kondo
3dc0e83513 Merge branch 'salford-systems-fixed_cpp11_adaptors_templates' 2015-08-03 17:36:31 +09:00
Takatoshi Kondo
298c97ec08 Added all template parameters support for containers.
e.g.) allocator.
Added tests.
Replaced variadic template parameters with individual template parameters on C++11 unordered containers.
2015-08-03 16:54:05 +09:00
Takatoshi Kondo
0f0598a6b9 Merge branch 'fixed_cpp11_adaptors_templates' of https://github.com/salford-systems/msgpack-c into salford-systems-fixed_cpp11_adaptors_templates 2015-08-03 09:54:06 +09:00
Takatoshi Kondo
fee4faa82f Merge pull request #331 from redboltz/add_as_support_for_boost
Added 'as' support for boost containers.
2015-08-03 09:32:13 +09:00
Takatoshi Kondo
e182b06816 Merge pull request #322 from redboltz/fix_320
Fixed #320. Added gcc version checking.
2015-08-03 09:31:56 +09:00
Takatoshi Kondo
f9a16ad690 Merge pull request #329 from redboltz/add_smart_pointers_support
Added std::shared_ptr and std::unique_ptr adaptors.
2015-08-03 09:31:26 +09:00
Takatoshi Kondo
2034427cfd Added 'as' support for boost containers. 2015-08-02 16:01:55 +09:00
Vladyslav Frolov
f986370634 Improved templates for std::unordered_map and std::unordered_set so they handle all sorts of those 2015-07-31 04:16:14 -07:00
Takatoshi Kondo
db588909b9 Added std::shared_ptr and std::unique_ptr adaptors. 2015-07-31 12:39:11 +09:00
Takatoshi Kondo
7e6a498c14 Merge pull request #323 from jonitis/fix_compilation_warning
Fix compilation warnings about possible loss of data
2015-07-31 12:15:11 +09:00
Takatoshi Kondo
9650def29a Added iterator.hpp to the installing files list.
Makefile.am has it but CMakeLists.txt didn't have it.
2015-07-31 10:30:37 +09:00
Takatoshi Kondo
2a7d9977b1 Merge pull request #327 from redboltz/jonitis-vector_of_non_default_constructible_values_2
Add 'as' support for containers.
2015-07-31 10:20:58 +09:00
Takatoshi Kondo
a746afa7cc Added 'as' support for containers. 2015-07-30 16:18:20 +09:00
Dainis Jonitis
87f0da1ff1 Support vectors of non-default-constructible values in c++11 mode 2015-07-27 12:48:23 +03:00
Dainis Jonitis
14ec30038b Fix compilation warnings about possible loss of data 2015-07-27 12:32:48 +03:00
Jonitis
09722fe540 Merge pull request #1 from jonitis/feature_fix_compilation_warning
Fix compilation warnings about possible loss of data
2015-07-27 11:34:47 +03:00
Jonitis
85b01d28da Merge pull request #2 from jonitis/feature_vector_of_non_default_constructible_values
Support vectors of non-default-constructible values in c++11 mode
2015-07-27 11:34:36 +03:00
Dainis Jonitis
763c2613df Support vectors of non-default-constructible values in c++11 mode 2015-07-27 11:06:20 +03:00
Dainis Jonitis
98c285c679 Fix compilation warnings about possible loss of data 2015-07-27 11:00:43 +03:00
Dainis Jonitis
2164723c86 Allow vectors of non-default-constructible values in c++11 mode 2015-07-27 10:38:46 +03:00
Dainis Jonitis
5cc712ceeb Fix warning about possible loss of value 2015-07-27 10:37:12 +03:00
James Nugent
840101640b Extend CMake CI to build static libs only 2015-07-23 22:15:35 -04:00
James Nugent
60e737f622 Link against msgpack-static when shared disabled
This commit causes the tests to be linked against the msgpack-static
target if MSGPACK_ENABLE_SHARED is set to OFF.
2015-07-23 22:10:41 -04:00
Takatoshi Kondo
4cc1087124 Fixed #320. Added gcc version checking. 2015-07-23 08:38:32 +09:00
Dainis Jonitis
b750b17598 Fix endianness detection on OpenWrt 2015-07-21 14:45:19 +03:00
James Nugent
5f1d5e8722 Add MSGPACK_ENABLE_SHARED option, defaulting to ON
This allows building just static libraries using the CMake build, which
is useful if your product is entirely statically linked. By default
there is no change to the output - MSGPACK_ENABLE_SHARED must be
explicitly set to false to disable building the shared library.
2015-07-15 18:06:59 -05:00
Takatoshi Kondo
1b13523c7f Merge pull request #315 from redboltz/fix_boost_pp_variadics
Added BOOST_PP_VARIADICS checking to avoid multiple definition.
2015-07-15 16:38:01 +09:00
Takatoshi Kondo
a35fe57737 Added BOOST_PP_VARIADICS checking to avoid multiple definition. 2015-07-15 13:54:55 +09:00
Takatoshi Kondo
b8d357c2ad Merge pull request #313 from jonitis/master
c++11 code should use nothrow instead of throw()
2015-07-12 09:53:04 +09:00
Dainis Jonitis
4f1e47aa78 No need for MSGPACK_USE_CPP03 checks in c++11 specific file 2015-07-09 16:13:04 +03:00
Dainis Jonitis
7a131db2a0 c++11 code should use nothrow instead of throw() 2015-07-09 15:37:17 +03:00
Takatoshi Kondo
756d02f8c0 Added Boost.Predef to check environment such as endian.
https://github.com/boostorg/predef.git has been added as a submodule on
external/boost/predef.

In order to avoid macro name conflicts, replaced "BOOST_" with "MSGPACK_"
and "boost/" with "msgpack/" then copy replaced files to include/msgpack.
This process is described in CMakeLists.txt.
Replaced files are included as a part of msgpack-c. So you don't need to
do the converting process each time.

Fixed endian checking logic.
2015-07-08 16:38:12 +09:00
Takatoshi Kondo
d3450c1fce Merge pull request #311 from redboltz/add_map_based_example
Added map based packing and converting example.
2015-07-07 13:35:31 +09:00
Takatoshi Kondo
fa7f840427 Added map based packing and converting example. 2015-07-07 09:55:45 +09:00
Takatoshi Kondo
e25ecc5287 Merge pull request #310 from redboltz/add_examples
Added an example of the non default constructible class.
2015-07-07 09:47:37 +09:00
Takatoshi Kondo
f1504d851a Added an example of the non default constructible class.
Refined an intrusive example. It includes base class serialization. We can switch map based and array based serialization.
2015-07-06 16:01:36 +09:00
Takatoshi Kondo
1a97e761fb Fixed merge mistake. 2015-07-06 16:00:06 +09:00
Takatoshi Kondo
6771302f62 Merge branch 'redboltz-add_define_map' 2015-07-06 14:20:19 +09:00
Takatoshi Kondo
188c0a9a6b Merge branch 'add_define_map' of https://github.com/redboltz/msgpack-c into redboltz-add_define_map 2015-07-06 14:18:21 +09:00
Takatoshi Kondo
62537967fe Merge pull request #308 from redboltz/fix_issue_307
Fix issue 307
2015-07-06 14:10:56 +09:00
Takatoshi Kondo
42df06dd3d Fixed #307.
Added 'inline' keyword to ext's constructor that defined at outside of the class definition.
2015-07-06 12:33:00 +09:00
Takatoshi Kondo
ab438ac9b9 Added multi files that includes msgpack.hpp linking test.
It detects a lack of inline keyword in a function definition.
2015-07-06 12:33:00 +09:00
Takatoshi Kondo
2216fda5ce Merge branch 'redboltz-add_ext_ref' 2015-07-05 21:28:51 +09:00
Takatoshi Kondo
9b655faa64 Merge branch 'add_ext_ref' of https://github.com/redboltz/msgpack-c into redboltz-add_ext_ref 2015-07-05 20:04:30 +09:00
Takatoshi Kondo
a37e7232c7 Merge pull request #305 from redboltz/add_boost_fusion
Added Boost.Fusion support.
2015-07-05 10:34:06 +09:00
Takatoshi Kondo
b559187a7e Merge pull request #302 from redboltz/add_no_defcon_support
Added no default constructible classes support.
2015-07-05 10:32:54 +09:00
Takatoshi Kondo
9e7564c9d7 Merge pull request #304 from redboltz/add_old_raw_pack_support
Added v4(old) raw packing support.
2015-07-05 10:22:08 +09:00
Takatoshi Kondo
584bd8575f Added the comment for BOOST_PP_VARIADICS define. 2015-07-05 09:23:43 +09:00
Takatoshi Kondo
777e5f13f3 Added map-based class pack/convert support. 2015-07-05 09:23:43 +09:00
Takatoshi Kondo
6131e3d747 Fixed double comparison in tests. 2015-07-04 22:49:47 +09:00
Takatoshi Kondo
e0a2c2a4bf Merge pull request #301 from redboltz/json_escape
Added JSON escape for values between 0x00 and 0x1f, and 0x7f.
2015-07-04 17:55:51 +09:00
Takatoshi Kondo
d26e68e3bb Merge pull request #299 from redboltz/add_missing_inline
Added 'inline' to make_define().
2015-07-04 17:55:29 +09:00
Takatoshi Kondo
57ba93a2b2 Added Boost.Fusion support.
Fusion sequences can be serialized.
2015-07-01 15:07:45 +09:00
Takatoshi Kondo
34a42415be Added v4(old) raw packing support. 2015-06-30 15:11:51 +09:00
Takatoshi Kondo
1a6f826f0f Merge pull request #303 from llchan/master
Fix zbuffer empty string writes
2015-06-23 21:16:31 +09:00
Lawrence Chan
22e428b104 Add static inline to zbuffer.h function definitions 2015-06-22 17:17:34 -05:00
Lawrence Chan
89f117fcd9 Destroy zbuffer in C unit test 2015-06-22 15:36:37 -05:00
Lawrence Chan
9a50cc4345 Add zbuffer empty string write tests 2015-06-22 13:00:19 -05:00
Lawrence Chan
addf52e9f0 Fix zbuffer write of empty string
When a zlib stream has avail_in == 0, it will deflate with a Z_BUF_ERROR
to indicate that "no progress is possible". A zbuffer write with an
empty string will trigger this condition, and the write call
returns/raises an error/exception.  The fix is simple: change the
do/while to a while loop, so that it only tries to deflate if there is
actually data to deflate.
2015-06-22 12:58:35 -05:00
Takatoshi Kondo
45b57c292c Added no default constructible classes support. 2015-06-18 16:15:20 +09:00
Takatoshi Kondo
860a5ae06e Added JSON escape for values between 0x00 and 0x1f, and 0x7f. 2015-06-18 14:01:51 +09:00
Takatoshi Kondo
55d09e6c30 Added 'inline' to make_define(). 2015-06-18 12:55:19 +09:00
Takatoshi Kondo
32c42d2f4c Merge branch 'proller-patch-1' 2015-06-02 09:48:32 +09:00
Takatoshi Kondo
1cfee8c347 Added an additional include path for DEBUG build. 2015-06-02 09:46:15 +09:00
Takatoshi Kondo
2893c799bf Removed the post build settings and file. 2015-06-02 09:38:08 +09:00
Takatoshi Kondo
b4e50d54a0 Merge branch 'patch-1' of https://github.com/proller/msgpack-c into proller-patch-1 2015-06-02 09:36:15 +09:00
Takatoshi Kondo
d6c5682ef5 Merge pull request #288 from redboltz/work/add_deep_copy
Added a clone function for msgpack::object.
2015-06-01 17:45:46 +09:00
Takatoshi Kondo
de721af166 Updated: msgpack::unpacked is the typedef of the msgpack::object_handle now.
See the following discussion:
https://github.com/msgpack/msgpack-c/pull/288
2015-05-31 20:40:05 +09:00
Takatoshi Kondo
5f73d3f19f Merge branch 'davidchappelle-master' 2015-05-27 21:21:59 +09:00
Takatoshi Kondo
846016b8b7 Tests added. 2015-05-27 21:19:39 +09:00
Takatoshi Kondo
b225f15f29 Merge branch 'master' of https://github.com/davidchappelle/msgpack-c into davidchappelle-master 2015-05-27 21:18:33 +09:00
proller
b1481b33f8 Update msgpack_vc.postbuild.bat 2015-05-27 13:41:27 +03:00
proller
c230ff7ab8 Update msgpack_vc8.vcproj 2015-05-27 13:39:52 +03:00
Takatoshi Kondo
6edf10cecd Merge pull request #294 from redboltz/support_appveyor
Supported appveyor.
2015-05-27 17:39:26 +09:00
Takatoshi Kondo
d88d6c34b9 Supported appveyor. 2015-05-27 15:35:36 +09:00
Takatoshi Kondo
ff14be8fdb Added EXT type supporting classes. 2015-05-27 13:12:26 +09:00
Takatoshi Kondo
f75da23e1d Separated unpacked from object_handle to preserve the original ABI. 2015-05-26 09:53:55 +09:00
Nobuyuki Kubota
17900625d0 Merge pull request #290 from redboltz/fix_raw_ref_not_equal
Fixed raw_ref::operator!= implementation.
2015-05-25 12:25:56 -07:00
Nobuyuki Kubota
5722ab6b51 Merge pull request #285 from redboltz/add_const_ref
Replaced const msgpack::object with const msgpack::object&.
2015-05-25 12:24:35 -07:00
Nobuyuki Kubota
072f0cd183 Merge pull request #284 from redboltz/fixed_unused_parameter
Fixed unused parameter
2015-05-25 11:59:40 -07:00
Nobuyuki Kubota
4af6d4ddc8 Merge pull request #283 from redboltz/add_l_suffix
Replaced 201103 with 201103L.
2015-05-25 11:32:28 -07:00
Takatoshi Kondo
7359720403 Fixed raw_ref::operator!= implementation. 2015-05-22 14:04:44 +09:00
Takatoshi Kondo
9cb2c91d58 Fixed the lack of msgpack::move() on the self substituion test codes. 2015-05-22 09:36:21 +09:00
Takatoshi Kondo
9e18ac5d2d Reverted msgpack::move() on the C++03. Const-correntness isn't broken now.
Implemented msgpack::object_handle using the same design pattern as std::auto_ptr and std::auto_ptr_ref.
Minimized the uses of #if defined(MSGPACK_USE_CPP03) conditional macro.
2015-05-22 09:21:58 +09:00
Takatoshi Kondo
e18f5b2d52 Added a clone function for msgpack::object.
The function prepares zone's chunk that has minimal size to deep copy.
2015-05-21 14:44:40 +09:00
Takatoshi Kondo
e979f04d75 Replaced const msgpack::object with const msgpack::object&. 2015-05-20 12:49:56 +09:00
Takatoshi Kondo
5002f2cf6a Suppressed 'maybe uninitialized' warnings on g++. 2015-05-20 12:38:56 +09:00
Takatoshi Kondo
b6018f3d57 Fixed an unused parameter warning. 2015-05-20 12:38:10 +09:00
Takatoshi Kondo
aee537099d Added -Wextra and -Werror option for gcc and clang.
Reformatted and untabified configure.in.
2015-05-19 16:03:58 +09:00
Takatoshi Kondo
e37f14fd6a Replaced 201103 with 201103L. 2015-05-19 15:44:47 +09:00
Takatoshi Kondo
432c9cc542 Merge pull request #279 from jpetso/master
Use std::move (C++11) in map and set adaptors where possible.
2015-05-19 08:53:35 +09:00
David Chappelle
9d4da1ad2e Object conversions return the specific type that was converted.
This allows us to easily make function calls that have parameters that are dependent
upon converting from msgpack objects to concrete types. For example:

    void process_args(std::tuple<int,std::string>& args)
    {
        ...
    }

    process_args(obj.convert(std::make_tuple(100,"hello")))

You can get similar behavior by using obj.as<...>() but its performance is highly
dependent upon the specific compiler and whether or not r-value references are
supported.
2015-05-15 16:21:54 -04:00
Jakob Petsovits
9725bac5c4 Use std::move (C++11) in map and set adaptors where possible.
In the std::map adaptor, remove the complicated iterator/insert
code and go with the cpp11/unordered_map.hpp approach instead.
Makes the code more consistent, avoids an extra copy, and the
previous complexity was unnecessary since std::map only maps to
a single element per key, unlike std::multimap.
2015-05-12 23:51:33 -04:00
Nobuyuki Kubota
68e270b029 Merge pull request #278 from redboltz/add_string_ref
Added Boost.StringRef support.
2015-05-08 15:29:41 -07:00
Nobuyuki Kubota
bf859f234e Merge pull request #277 from redboltz/refine_base_class_support
Refined base class pack/unpack support.
2015-05-08 14:13:34 -07:00
Takatoshi Kondo
70fbae3c5f Added Boost.StringRef support. 2015-05-02 11:02:57 +09:00
Takatoshi Kondo
7cd77292fc Refined base class pack/unpack support.
Not only C++11 but also C++03 supported.
2015-05-01 22:05:23 +09:00
Takatoshi Kondo
e8e3052d1a Merge pull request #276 from redboltz/fix_issue_275
Added valgrind version 3.10.1 from source.
2015-04-30 07:32:54 +09:00
Takatoshi Kondo
eb96312b41 Added valgrind version 3.10.1 from source.
Fixed MEMORYCHECK_COMMAND_OPTIONS location and value.
2015-04-29 22:26:30 +09:00
Takatoshi Kondo
ab359b259f Merge pull request #269 from redboltz/add_dot_support
When a target system has 'dot', 'make doxygen' uses 'dot' on cmake.
2015-04-28 15:49:53 +09:00
Nobuyuki Kubota
83ee2c82df Merge pull request #274 from redboltz/fix_issue_273
Fixed #273
2015-04-27 23:47:43 -07:00
Nobuyuki Kubota
0bfbd8dcbd Merge pull request #264 from redboltz/add_protocol_new_example
Added the new protocol example.
2015-04-27 23:11:41 -07:00
Nobuyuki Kubota
a112ebb4df Merge pull request #265 from redboltz/add_base_class_support
Base classes packing/converting/creating object::with_zone support in C+...
2015-04-27 23:06:53 -07:00
Takatoshi Kondo
993d007c4b Changed the type of msgpack::object str index from int to uint32_t. 2015-04-23 08:33:08 +09:00
Takatoshi Kondo
92a7f3f794 Fixed #273
msgpack::object stream outputs became JSON format.
2015-04-22 14:59:02 +09:00
Takatoshi Kondo
2919033f3c Merge pull request #270 from makeroo/master
Inhibited wrong occurrence of ad-hoc encoding of 64bit doubles on iOS
2015-04-20 16:58:15 +09:00
Nobuyuki Kubota
cb9114e31c Merge pull request #268 from redboltz/support_boost
Added the Boost.Optional adaptor.
2015-04-19 18:45:08 -07:00
Simone Pierazzini
2f9912a012 Inhibited wrong occurrence of ad-hoc encoding of 64bit doubles on iOS 2015-04-16 16:02:17 +02:00
Takatoshi Kondo
fc10a3e486 When a target system has 'dot', 'make doxygen' uses 'dot' on cmake. 2015-04-09 15:10:58 +09:00
Takatoshi Kondo
dcdc51ce30 Merge pull request #267 from tbeu/Patch-inttypes-on-MSVC
Make use of MSVC specific macros for format specifiers
2015-04-09 15:07:46 +09:00
Takatoshi Kondo
ef09252dff Added the Boost.Optional adaptor.
It is enables when MSGPACK_USE_BOOST is defined.
2015-04-09 14:46:06 +09:00
tbeu
e3aa02b6af Make use of MSVC specific macros for format specifiers
Where inttypes.h is not availabale for VS<=2012 the MSVC specific macros still can be used.
See msgpack/msgpack-c#257
2015-04-07 22:10:07 +02:00
Takatoshi Kondo
d3e6f017be Base classes packing/converting/creating object::with_zone support in C++11. 2015-04-06 17:14:17 +09:00
Takatoshi Kondo
721700bfe5 Added the new protocol example. 2015-04-06 10:30:43 +09:00
Takatoshi Kondo
a277ea7c64 Updated version to 1.1.0. Updated CHANGELOG.md. 2015-04-03 15:28:05 +09:00
Takatoshi Kondo
285ccfeeea Merge pull request #263 from redboltz/update_wiki_url
Updated the wiki URL.
2015-04-03 15:05:12 +09:00
Takatoshi Kondo
232b8039a0 Merge branch 'redboltz-fix_doxygen_support' 2015-04-03 15:00:09 +09:00
Takatoshi Kondo
10a315e00e Added @cond - @endcond to adaptor_base.hpp. 2015-04-03 14:58:41 +09:00
Takatoshi Kondo
904dd65965 Merge branch 'fix_doxygen_support' of https://github.com/redboltz/msgpack-c into redboltz-fix_doxygen_support
# Conflicts:
#	erb/cpp03_define.hpp.erb
#	erb/cpp03_msgpack_tuple.hpp.erb
#	erb/cpp03_msgpack_tuple_fwd.hpp.erb
#	include/msgpack/adaptor/bool_fwd.hpp
#	include/msgpack/adaptor/char_ptr_fwd.hpp
#	include/msgpack/adaptor/cpp11/array.hpp
#	include/msgpack/adaptor/cpp11/array_char.hpp
#	include/msgpack/adaptor/cpp11/array_char_fwd.hpp
#	include/msgpack/adaptor/cpp11/array_fwd.hpp
#	include/msgpack/adaptor/cpp11/forward_list.hpp
#	include/msgpack/adaptor/cpp11/forward_list_fwd.hpp
#	include/msgpack/adaptor/cpp11/tuple_fwd.hpp
#	include/msgpack/adaptor/cpp11/unordered_map.hpp
#	include/msgpack/adaptor/cpp11/unordered_map_fwd.hpp
#	include/msgpack/adaptor/cpp11/unordered_set.hpp
#	include/msgpack/adaptor/cpp11/unordered_set_fwd.hpp
#	include/msgpack/adaptor/deque_fwd.hpp
#	include/msgpack/adaptor/detail/cpp03_define.hpp
#	include/msgpack/adaptor/detail/cpp03_msgpack_tuple.hpp
#	include/msgpack/adaptor/detail/cpp03_msgpack_tuple_fwd.hpp
#	include/msgpack/adaptor/detail/cpp11_define.hpp
#	include/msgpack/adaptor/detail/cpp11_msgpack_tuple_fwd.hpp
#	include/msgpack/adaptor/fixint_fwd.hpp
#	include/msgpack/adaptor/float_fwd.hpp
#	include/msgpack/adaptor/int_fwd.hpp
#	include/msgpack/adaptor/list_fwd.hpp
#	include/msgpack/adaptor/map_fwd.hpp
#	include/msgpack/adaptor/nil.hpp
#	include/msgpack/adaptor/nil_fwd.hpp
#	include/msgpack/adaptor/pair_fwd.hpp
#	include/msgpack/adaptor/raw.hpp
#	include/msgpack/adaptor/raw_fwd.hpp
#	include/msgpack/adaptor/set_fwd.hpp
#	include/msgpack/adaptor/string_fwd.hpp
#	include/msgpack/adaptor/tr1/unordered_map.hpp
#	include/msgpack/adaptor/tr1/unordered_map_fwd.hpp
#	include/msgpack/adaptor/tr1/unordered_set.hpp
#	include/msgpack/adaptor/tr1/unordered_set_fwd.hpp
#	include/msgpack/adaptor/vector.hpp
#	include/msgpack/adaptor/vector_bool_fwd.hpp
#	include/msgpack/adaptor/vector_char.hpp
#	include/msgpack/adaptor/vector_char_fwd.hpp
#	include/msgpack/adaptor/vector_fwd.hpp
2015-04-03 14:54:55 +09:00
Takatoshi Kondo
dff7af2075 Merge branch 'redboltz-added_vector_bool_size_check' 2015-04-03 14:28:13 +09:00
Takatoshi Kondo
ed91c18af8 Merge branch 'added_vector_bool_size_check' of https://github.com/redboltz/msgpack-c into redboltz-added_vector_bool_size_check
# Conflicts:
#	include/msgpack/adaptor/vector_bool.hpp
2015-04-03 14:28:00 +09:00
Takatoshi Kondo
616b1d8fb0 Updated the wiki URL. 2015-04-03 14:18:27 +09:00
Takatoshi Kondo
ce98964348 Merge pull request #262 from redboltz/fix_issue_249
Fix issue 249
2015-04-03 13:59:50 +09:00
Takatoshi Kondo
07a509a53a Added const char array class template specialization. 2015-04-02 19:29:27 +09:00
Takatoshi Kondo
35483b95ae Refined examples. 2015-04-02 18:24:19 +09:00
Takatoshi Kondo
a2c8154960 Updated examples to support new packing/converting mechanism. 2015-04-02 18:24:10 +09:00
Takatoshi Kondo
e8d3c8d6c5 Re-designed user types dispatching mechanism.
msgpakc-c 0.5.9 or older uses ADL.
msgpack-c 1.0.x uses overloading with header files ordering.
msgpack-c 1.1.x uses functor with class template specialization.
2015-04-02 18:23:37 +09:00
Takatoshi Kondo
ae5734e8d1 Recovered a minimal support for Doxygen.
Removed MSGPACK_API_VERSION_NAMESPACE(v1) from doxygen build.
It seems that Doxygen cannot parse a complicated macro such as MSGPACK_API_VERSION_NAMESPACE.

Added EXTRACT_ALL=YES to Doxyfle.
Added INPUT configuration variable that is point to include directory to Doxyfile.
2015-03-31 16:26:27 +09:00
Takatoshi Kondo
6ec09053b1 Merge pull request #257 from redboltz/fix_issue_255
Fixed #255. MSVC2012(_MSC_VER=1700) doesn't have inttypes.h.
2015-03-30 10:37:30 +09:00
Takatoshi Kondo
5401660b07 Fixed #255. MSVC2012(_MSC_VER=1700) doesn't have inttypes.h. 2015-03-30 09:07:06 +09:00
Takatoshi Kondo
f3caa8e160 Merge pull request #253 from tbeu/Avoid-C99-style-declarations
Do not interleave code and declarations in C files
2015-03-28 10:16:55 +09:00
tbeu
8921f9dcfc Do not interleave code and declarations in C files
Avoid C99 style to interleave code and declarations in order to compile msgpackc with Visual Studion < 2013
2015-03-26 21:48:03 +01:00
Takatoshi Kondo
1911513acb Added a container size checking to vector<bool>.
All other containers have already been added it.
2015-03-26 11:35:47 +09:00
Nobuyuki Kubota
7bee573a72 Merge branch 'release-1.0.1' 2015-03-22 11:57:27 -07:00
Nobuyuki Kubota
5568abb6ab verion 1.0.1 2015-03-22 11:49:09 -07:00
Nobuyuki Kubota
67486480ac Merge pull request #245 from redboltz/fix_issue_244
Fixed #244
2015-03-23 03:18:01 +09:00
Nobuyuki Kubota
0e3bb789b8 Merge pull request #240 from tumdum/master
Small typos in quickstarts.
2015-03-23 03:15:55 +09:00
Nobuyuki Kubota
e1eabbfebf Merge pull request #242 from redboltz/add_1_0_0_changelog
Updated for version 1.0.0 release.
2015-03-23 03:13:07 +09:00
Takatoshi Kondo
e416b534b8 Fixed #244
Fixed an inheriting constructor.
2015-03-21 16:34:35 +09:00
Takatoshi Kondo
212ef8eb2b Updated for version 1.0.0 release. 2015-03-17 11:08:38 +09:00
Tomasz Kłak
7bf06a5885 Update QUICKSTART-CPP.md
Proper english.
2015-03-13 17:17:23 +01:00
Tomasz Kłak
1822523289 Update QUICKSTART-C.md
Fixed typo regarding missing rpc implementation.
2015-03-13 17:15:56 +01:00
Nobuyuki Kubota
156a4403ab Merge pull request #239 from redboltz/add_msgpack_prefix_to_erb
Added msgpack prefix to erb template files.
2015-03-11 11:53:31 +09:00
Takatoshi Kondo
ad5da7f131 Added msgpack prefix to erb template files.
The files that are generated by preprocess have already have the prefix.
2015-03-11 10:35:23 +09:00
Nobuyuki Kubota
62be3f1212 version 1.0.0 2015-03-10 21:42:47 +09:00
Nobuyuki Kubota
8dbe25a51d Add missing headers and files for make dist 2015-03-10 21:35:55 +09:00
Takatoshi Kondo
7cfd4bb1d8 Updated version to 1.0.0 2015-03-10 21:25:34 +09:00
Nobuyuki Kubota
037a108c49 Merge pull request #238 from redboltz/move_serialize_operator
Moved serialize operator.
2015-03-10 21:14:24 +09:00
Takatoshi Kondo
79a127a8b6 Moved serialize operator. 2015-03-10 21:14:20 +09:00
Nobuyuki Kubota
ace27f6238 Merge pull request #237 from redboltz/add_version_revision
Added version revision prototype declaration.
2015-03-10 21:08:37 +09:00
Nobuyuki Kubota
cc2ded6338 Merge pull request #236 from redboltz/add_depth_limit2
Added depth limit on unpack.
2015-03-10 21:08:01 +09:00
Takatoshi Kondo
13a746f6fa Added msgpack prefix. 2015-03-10 21:08:22 +09:00
Nobuyuki Kubota
b0ff2802d2 Add msgpack prefix to type_errors 2015-03-10 20:59:34 +09:00
Nobuyuki Kubota
4b0c90fc90 Merge branch 'add_msgpack_prefix'
Conflicts:
	include/msgpack/adaptor/char_ptr.hpp
	include/msgpack/adaptor/cpp11/array.hpp
	include/msgpack/adaptor/cpp11/array_char.hpp
	include/msgpack/adaptor/cpp11/tuple.hpp
	include/msgpack/adaptor/cpp11/unordered_map.hpp
	include/msgpack/adaptor/cpp11/unordered_set.hpp
	include/msgpack/adaptor/deque.hpp
	include/msgpack/adaptor/list.hpp
	include/msgpack/adaptor/map.hpp
	include/msgpack/adaptor/set.hpp
	include/msgpack/adaptor/string.hpp
	include/msgpack/adaptor/tr1/unordered_map.hpp
	include/msgpack/adaptor/tr1/unordered_set.hpp
	include/msgpack/adaptor/vector.hpp
	include/msgpack/adaptor/vector_char.hpp
	include/msgpack/object.hpp
	include/msgpack/unpack.hpp
2015-03-10 20:57:55 +09:00
Takatoshi Kondo
4b11fb32cd Added version revision prototype declaration. 2015-03-10 20:41:59 +09:00
Nobuyuki Kubota
f707c6b47c Add missing msgpack prefix 2015-03-10 20:38:58 +09:00
Takatoshi Kondo
081ee0e99a Added depth limit on unpack. 2015-03-10 20:30:22 +09:00
Nobuyuki Kubota
8eaa2e9e74 Merge pull request #199 from redboltz/fix_issue_198
Fix issue 198
2015-03-10 19:31:09 +09:00
Nobuyuki Kubota
ac1eb6e1d3 Merge branch 'reference-args' 2015-03-10 19:16:37 +09:00
Nobuyuki Kubota
343ceabe9a Fix msgpack_object to be passed by reference 2015-03-10 19:12:25 +09:00
Takatoshi Kondo
eb765d21f2 Fixed MSVC++ warning about int to bool conversion. 2015-03-10 19:04:51 +09:00
Takatoshi Kondo
2d5c68055c Added explicit cast to vector<bool> internal type. 2015-03-10 19:04:23 +09:00
Nobuyuki Kubota
de68fbd6d0 Merge branch 'support_cpp11_atomic' 2015-03-10 18:53:14 +09:00
Takatoshi Kondo
118cf7270c Fixed a compile error on clang++ 3.4.1 on FreeBSD and Yosemite. 2015-03-10 18:37:36 +09:00
Nobuyuki Kubota
cf1487f8ba Merge branch 'fix_decrement_typo'
Conflicts:
	include/msgpack/unpack.hpp
2015-03-10 18:25:38 +09:00
Nobuyuki Kubota
e4cd479bf3 Merge branch 'master' of github.com:msgpack/msgpack-c 2015-03-10 17:35:39 +09:00
Nobuyuki Kubota
8dae63e4c1 Merge branch 'add_std_prefix'
Conflicts:
	include/msgpack/adaptor/char_ptr.hpp
	include/msgpack/adaptor/string.hpp
2015-03-10 17:34:36 +09:00
Nobuyuki Kubota
a3f350842c Merge pull request #231 from redboltz/remove_double_underscore
Removed double underscore.
2015-03-10 17:23:15 +09:00
Nobuyuki Kubota
c1e9f92d7f Merge branch 'fix_issue_226_author_fixed'
Conflicts:
	include/msgpack/unpack.hpp
2015-03-10 17:21:58 +09:00
Nobuyuki Kubota
582fe38e78 Merge branch 'fix_issue_167' 2015-03-10 16:55:46 +09:00
Nobuyuki Kubota
6443738f66 Add serialization test of non-const char* 2015-03-10 16:54:45 +09:00
Nobuyuki Kubota
45eb2ad0c7 Merge branch 'redboltz_fix_issue_220'
Conflicts:
	include/msgpack/unpack.hpp
2015-03-10 00:48:32 -07:00
Nobuyuki Kubota
37593400c3 Replace a MACRO with const size_t and undef some MACROs 2015-03-10 00:39:56 -07:00
Nobuyuki Kubota
60648fc3a8 Merge pull request #218 from redboltz/replace_embed_stack_with_vector
Replaced m_stack legacy array with std::vector.
2015-03-10 16:03:59 +09:00
Takatoshi Kondo
0482e4fcd1 Supported the C++11 atomic. 2015-03-09 16:02:03 +09:00
Takatoshi Kondo
82a10cba5c Fixed typo.
Replaced 'decl' with 'decr'.
2015-03-09 14:49:18 +09:00
Takatoshi Kondo
0d9a21ea08 Added msgpack prefix to packer. 2015-03-08 20:49:40 +09:00
Takatoshi Kondo
f399ec8c30 Added msgpack prefix to support API versioning. 2015-03-07 22:58:45 +09:00
Takatoshi Kondo
8ad9ce059b Fixed #226.
Suppressed warnings on MSVC++ 64bit environment.
Added container size limit check.
2015-03-05 07:36:56 +09:00
Takatoshi Kondo
a4aa14d1e2 Added std prefix. 2015-03-04 22:50:47 +09:00
Takatoshi Kondo
f7f2d4b990 Removed double underscore. 2015-03-04 22:44:11 +09:00
Takatoshi Kondo
c675881f3b Fixed #220.
Added MSGPACK_ prefix to unpack macros.
2015-02-19 17:44:42 +09:00
Takatoshi Kondo
f6d0cd9a4b Merge pull request #222 from jszakmeister/fix-byteswap-freebsd-and-openbsd
Don't include byteswap.h and FreeBSD and OpenBSD.
2015-02-19 16:53:20 +09:00
John Szakmeister
4ef5894856 Don't include byteswap.h and FreeBSD and OpenBSD. 2015-02-17 17:33:49 -05:00
Nobuyuki Kubota
07ddfa1430 Add a list of contributors in README.md and remove AUTHORS file
This commit also adds AUTHORS and ChangeLog to .gitignore.
ChangeLog is only used by autoconf/automake and it has a quite
strict format. Since msgpack-c's change log is now written in
Markdown, it's difficult to follow the ChangeLog format.
So, unlike README.md, bootstrap doesn't copy CHANGELOG.md
to ChangeLog.
2015-02-15 16:52:27 -08:00
Nobuyuki Kubota
252d66a4b2 Merge branch 'master' of https://github.com/haneefmubarak/msgpack-c into general-repo-clean-up 2015-02-15 16:08:38 -08:00
Takatoshi Kondo
b4eba4ba09 Merge pull request #219 from redboltz/fix_issue_209
Fixed #209
2015-02-07 21:56:00 +09:00
Takatoshi Kondo
2266505eed Fixed #209
Added conditional include stdbool.h based on @equalsraf comment.
2015-02-07 21:25:49 +09:00
Takatoshi Kondo
46e2398e02 Replaced m_stack legacy array with std::vector. 2015-02-04 23:15:32 +09:00
Takatoshi Kondo
3662a17e81 Merge pull request #212 from redboltz/add_zone_reuse_example
Added an unpacking msgpack::object on an existing zone example.
2015-02-03 21:52:09 +09:00
Takatoshi Kondo
66f221d088 Merge pull request #211 from redboltz/add_cpp11_container_example
Added a C++11 container example.
2015-02-03 21:51:56 +09:00
Takatoshi Kondo
9ed4e443fb Added an unpacking msgpack::object on an existing zone example. 2015-02-03 21:20:34 +09:00
Takatoshi Kondo
15aec0493d Added a C++11 container example. 2015-02-03 20:40:44 +09:00
Takatoshi Kondo
d6a7bd1995 Merge pull request #207 from redboltz/refine_examples
Refine examples
2015-02-02 21:56:41 +09:00
Takatoshi Kondo
ff86d61799 Replaced auto& with auto const& for msgpack::object.
Replaced auto with auto const& for msgpack::object.
Avoided msgpack::object conversion in EXPECT_EQ.
2015-02-02 15:27:15 +09:00
Mizuki Hirata
97886c50e7 Fixed iterator test case. 2015-02-02 15:27:15 +09:00
Mizuki Hirata
327b0db626 Added versioning namespace and test case to iterator. 2015-02-02 15:27:15 +09:00
Mizuki Hirata
994144dac2 Add range-based for loop support. 2015-02-02 15:27:15 +09:00
Takatoshi Kondo
023f81ae9c Added char* support. 2015-02-01 22:30:21 +09:00
Takatoshi Kondo
83fac26762 Added enum examples.
Added converting to zone with or without zone.
2015-02-01 22:10:13 +09:00
Takatoshi Kondo
213ba44b65 Added copylight text.
Refined examples.
2015-02-01 21:35:48 +09:00
Takatoshi Kondo
fa231139d7 Merge pull request #205 from redboltz/fix_issue_204
Fixed #204, #202.
2015-02-01 21:20:31 +09:00
Takatoshi Kondo
5cd1c6bfa1 Merge pull request #201 from redboltz/fix_issue_184
Added unpack function using existing zone.
2015-02-01 21:18:05 +09:00
Takatoshi Kondo
c4fb47c00d Fixed #204, #202.
enum support had been incomplete.
This fix made enum support complete.

Replaced int with auto on c++11 scoped enum.
Replaced template specializations with function overloads on operator<< and operator>> for enum.

enum can convert to object with and without zone.

When you want to adapt enum, you need to write as follows:

// NOT msgpack.hpp

enum yourenum {
    elem
};

MSGPACK_ADD_ENUM(yourenum);

// msgpack.hpp should be included after MSGPACK_ADD_ENUM(...)

int main() {
    msgpack::object obj(yourenum::elem);
}
2015-01-31 22:19:31 +09:00
Takatoshi Kondo
70e50d9679 Added unpack function using existing zone.
Removed redundant inline keyword form declarations.
2015-01-30 22:57:27 +09:00
Takatoshi Kondo
978e6b9057 Merge pull request #200 from anton-sergeev/master
Fix cmake for subproject usage
2015-01-30 21:58:32 +09:00
Anton Sergeev
571f1a27a2 Fix cmake for subproject usage
Signed-off-by: Anton Sergeev <Anton.Sergeev@elecard.ru>
2015-01-26 20:32:31 +06:00
Takatoshi Kondo
c3518c0666 Included vector header. 2015-01-25 22:25:35 +09:00
Takatoshi Kondo
64ac09c492 Fixed #198.
Added a conversion support from msgpack::object to std::vector<bool>.
2015-01-25 21:59:39 +09:00
Takatoshi Kondo
414da4e8c6 Merge pull request #195 from nobu-k/configure-version-fix
Support OS X's sed in configure.in
2015-01-17 23:43:20 +09:00
Nobuyuki Kubota
3eadb124fc Support OS X's sed in configure.in 2015-01-16 22:15:05 +09:00
Nobuyuki Kubota
fd9eb26688 Add static inline to msgpack_zone_malloc_no_align 2015-01-16 21:47:49 +09:00
Nobuyuki Kubota
6c59e5195a Merge branch 'fix_issue_191'
Conflicts:
	test/streaming_c.cpp
2015-01-16 21:47:13 +09:00
Nobuyuki Kubota
3bdf646cc6 Merge pull request #192 from redboltz/fix_issue_190
Fixed #190.
2015-01-16 20:05:39 +09:00
Nobuyuki Kubota
2bbf10a324 Merge pull request #181 from redboltz/change_zone_align_default
Modified the default value of MSGPACK_ZONE_ALIGN from sizeof(int) to siz...
2015-01-16 19:53:27 +09:00
Takatoshi Kondo
737e6703df Fixed #191.
The names of float format family are changed.

old                      new
dec                   -> f64
MSGPACK_OBJECT_DOUBLE -> MSGPACK_OBJECT_FLOAT
msgpack::type::DOUBLE -> msgpack::type::FLOAT

Client codes could have compile errors when it use dec, MSGPACK_OBJECT_DOUBLE or msgpack::type::DOUBLE.
The best way to fix such errors, update client code. If it can't, set MSGPACK_USE_LEGACY_NAME_AS_FLOAT macro.
Then both old names and new names are available.
2015-01-16 00:20:43 +09:00
Takatoshi Kondo
7f48ddc85e Fixed #190.
Supressed warnings on MSVC.
2015-01-15 20:42:33 +09:00
Takatoshi Kondo
a84f444ce2 Merge pull request #185 from bajamircea/master
Fix one more memory size calculation.
2015-01-06 10:20:07 +09:00
Mircea Baja
7e597779e4 Fix one more memory size calculation.
See https://github.com/msgpack/msgpack-c/issues/149
and the commit d6cc5494a9dd25fe640c1602cdf1b566690c9ba7
2015-01-05 21:55:57 +00:00
Takatoshi Kondo
bf8c830eef Merge pull request #183 from spatz/patch-3
Comment unused variable name
2015-01-05 09:55:37 +09:00
Dror Levin
5f52ec5030 Comment unused variable name
Prevents unused parameter error from gcc when compiled with -Wextra.
2015-01-04 13:43:55 +02:00
Haneef Mubarak
c71ce9eb49 minor markdown error 2015-01-02 23:14:16 -08:00
Haneef Mubarak
f105b4bbb0 misc top level directory cleanup 2015-01-02 23:09:44 -08:00
Haneef Mubarak
f64be3b2d0 add all contributors to AUTHORS file 2015-01-02 23:05:25 -08:00
Haneef Mubarak
abac9fe90a add links to QUICKSTART 2015-01-02 22:31:59 -08:00
Haneef Mubarak
5798fa0e47 rewrite and cleanup README 2015-01-02 22:27:55 -08:00
Takatoshi Kondo
fe4af1125d Modified the default value of MSGPACK_ZONE_ALIGN from sizeof(int) to sizeof(void*).
On the x64 environment, sizeof(int) == 4 but pointer size is 8. The latter is suitable for the default value.
2015-01-03 10:22:58 +09:00
Nobuyuki Kubota
ce96ca8bfc Merge pull request #175 from redboltz/add_limit
- Added unpack limit.
2015-01-02 12:22:03 -08:00
Nobuyuki Kubota
57732f0c1b Merge pull request #171 from redboltz/fixed_zone_alignment
Fixed zone alignment
2015-01-02 11:37:01 -08:00
Nobuyuki Kubota
7ccef5b787 Merge pull request #170 from redboltz/fixed_typo
Fixed typos.
2015-01-02 11:01:58 -08:00
Takatoshi Kondo
1a116fb644 Merge pull request #180 from spatz/patch-2
Add missing break to prevent segfault
2015-01-02 18:10:06 +09:00
Takatoshi Kondo
f79fd82953 Merge pull request #179 from spatz/patch-1
Move constructors and operator= should be noexcept
2015-01-02 17:53:47 +09:00
Dror Levin
b9a80697bc Add missing break to prevent segfault
When printing objects with extension, falling through to type ARRAY may cause segmentation fault.
2015-01-01 15:15:47 +02:00
Dror Levin
467822c97a Move constructors and operator= should be noexcept 2014-12-30 18:30:11 +02:00
Takatoshi Kondo
7ab7eaf61b Merge pull request #177 from redboltz/fix_issue_176
Fixed https://github.com/msgpack/msgpack-c/issues/176
2014-12-22 11:27:25 +09:00
Takatoshi Kondo
3ed6b673d4 Fixed https://github.com/msgpack/msgpack-c/issues/176
byteswap.h is no longer included on Solaris.
2014-12-20 18:38:49 +09:00
Takatoshi Kondo
469040be6b Fixed exceptions' interface. On the C++11, both const char* and const std::string& are supported.
Updated all exceptions relate to unpack take a message parameter. It is better to explain the exceptional situation in detail. So far, just passing the exceptions name.
2014-12-15 10:12:55 +09:00
Takatoshi Kondo
309e96087a - Added unpack limit.
- Added new exceptions to explain limit over errors.

- Fixed ext maximum size problem.
Problem:
The type of m_trail was uint32_t but when parsing ext, it could be 0xffffffff + 1. +1 means type. See https://github.com/msgpack/msgpack/blob/master/spec.md#ext-format-family

Solution:
Modified the type of m_trail as std::size_t. If sizeof(std::size_t) == 4, 0xffffffff size of ext is an error. If sizeof(std::size_t) == 8, 0xffffffff size of ext is not an error. m_trail is 0xffffffff + 1.

Design cohice:
I chose std::size_t as the m_trail's type instead of uint64_t intentionally. On 64 addressing bit environment, there is no problem. On 32 bit environment, there is no problem except ext with maximum size. There is only one exception in the all msgpack format. Using uint64_t to support that, it's very expensive. On 32 addressing bit environment, allocating 0xffffffff + 1 bytes of memory couldn't succeed, so I believe that throwing an exception is a reasonable design choice in the case.
2014-12-14 19:10:46 +09:00
Takatoshi Kondo
2d61fdf865 Merge pull request #172 from bajamircea/master
Added check for already defined NOMINMAX
2014-12-09 22:40:36 +09:00
Mircea Baja
6e560e345a Added check for already defined NOMINMAX 2014-12-08 21:36:26 +00:00
Takatoshi Kondo
8b796dc788 Added zone alignment tests. 2014-12-05 22:08:31 +09:00
Takatoshi Kondo
240b02174d Fixed zone allocate alignment problem. 2014-12-05 20:46:56 +09:00
Takatoshi Kondo
38a380684e Fixed typos.
The typos have been pointed out by https://github.com/msgpack/msgpack-c/pull/130
Thank you @jpetso !
2014-12-05 17:18:24 +09:00
Nobuyuki Kubota
1a615af437 Merge pull request #169 from redboltz/fix_issue_168
Added adaptors for the C++11 version of unordered containers.
2014-12-05 17:13:51 +09:00
Takatoshi Kondo
9162610682 Added adaptors for the C++11 version of unordered containers.
(Fixed https://github.com/msgpack/msgpack-c/issues/168)
2014-12-05 15:40:33 +09:00
Nobuyuki Kubota
c52a58b322 Merge pull request #163 from redboltz/fix_144
Fixed https://github.com/msgpack/msgpack-c/issues/144
2014-11-26 14:21:50 -08:00
Nobuyuki Kubota
ac3433f5dd Merge pull request #165 from redboltz/implement_non_copyable
Made copy constructors and copy assignment operators private for classes...
2014-11-26 14:10:10 -08:00
Takatoshi Kondo
dab725624e Made copy constructors and copy assignment operators private for classes that should be noncopyable. 2014-11-23 20:42:38 +09:00
Takatoshi Kondo
037b1c22dc Fixed https://github.com/msgpack/msgpack-c/issues/144
This fix is ogirinally from https://github.com/msgpack/msgpack-c/pull/133

I removed raw support and added str, bin, and ext support.
2014-11-17 12:51:34 +09:00
Nobuyuki Kubota
0de0b434b3 Merge branch 'refine_non_intrusive_example' 2014-11-15 17:43:23 -08:00
Nobuyuki Kubota
7eb3d2aa59 Change the type of the return value to a const reference 2014-11-15 17:41:43 -08:00
Nobuyuki Kubota
0827d08cd7 Merge pull request #162 from redboltz/msvc_test_supported
Supported dll export for msvc.
2014-11-15 17:22:51 -08:00
Nobuyuki Kubota
3d20ec6f21 Merge pull request #160 from redboltz/fix_memory_allocation
Fixed memory size caluclation problem.
2014-11-15 17:12:23 -08:00
Takatoshi Kondo
bcdbf78542 Updated infinity test better way.
Added NaN tests.
2014-11-03 10:03:05 +09:00
Takatoshi Kondo
a4af97b32c Supported dll export for msvc.
Supported tests for msvc.
2014-11-02 20:16:20 +09:00
Takatoshi Kondo
e00b299fe0 Refined the non-intrusive example. The target class no longer needs public data members. 2014-11-01 22:42:36 +09:00
Takatoshi Kondo
d6cc5494a9 Fixed memory size caluclation problem.
See https://github.com/msgpack/msgpack-c/issues/149
2014-11-01 19:41:47 +09:00
Takatoshi Kondo
96c688708c Merge pull request #158 from redboltz/update_examples
Moved examples.
2014-11-01 18:28:15 +09:00
Takatoshi Kondo
79e7a9810c Moved examples.
Added intrusive and non-intrusive versions of packing and unpacking examples.
2014-11-01 18:13:52 +09:00
Takatoshi Kondo
a0ae0289dc Merge pull request #157 from redboltz/fix_vc2008_warnings
Added warnings suppress option.
2014-11-01 17:04:51 +09:00
Takatoshi Kondo
31a3d34b49 Added warnings suppress option.
Changed buffer type from char to unsigned char.
2014-11-01 16:36:40 +09:00
Takatoshi Kondo
1c54d804f5 Merge pull request #156 from redboltz/fix_example_issue_155
Fixed return type.
2014-11-01 13:40:14 +09:00
Takatoshi Kondo
111efdf50f Fixed return type. 2014-11-01 13:18:17 +09:00
Takatoshi Kondo
dac8f6290d Merge pull request #154 from redboltz/fix_issue_153
Fixed https://github.com/msgpack/msgpack-c/issues/153
2014-10-31 16:23:23 +09:00
Takatoshi Kondo
3bfd142660 Fixed https://github.com/msgpack/msgpack-c/issues/153 2014-10-31 15:50:57 +09:00
Takatoshi Kondo
d031162d96 Merge pull request #146 from redboltz/fixed_char_pack
Fixed char packing support.
2014-10-31 12:51:53 +09:00
Takatoshi Kondo
8e24d9206a Merge pull request #152 from redboltz/fix_inttypes_on_vc2010
https://github.com/msgpack/msgpack-c/issues/147
Fixed MSVC2010 doesn't have inttypes.h problem.
2014-10-31 11:31:17 +09:00
Takatoshi Kondo
b78b49a7bd Fixed MSVC2010 doesn't have inttypes.h problem. 2014-10-31 10:50:19 +09:00
Takatoshi Kondo
561e9ba105 Merge pull request #150 from redboltz/fix_fprintf_macro
Fixed https://github.com/msgpack/msgpack-c/issues/148
2014-10-31 10:17:24 +09:00
Takatoshi Kondo
6e84266043 Merge pull request #151 from redboltz/fix_build_vc2010
Fixed https://github.com/msgpack/msgpack-c/issues/147
2014-10-31 10:17:13 +09:00
Takatoshi Kondo
151c92d08d Fixed https://github.com/msgpack/msgpack-c/issues/147
On VC9 (Visual Studio 2008) and VC10 (Visual Studio 2010), .c files are compiled as C++. Otherwise the files are compiled as C.
2014-10-31 00:04:44 +09:00
Takatoshi Kondo
1285470c21 Fixed https://github.com/msgpack/msgpack-c/issues/148
Fixed inttypes.h inclusion problem on MSVC.
Fixed msgpack_object_print implementation using PRIi8, PRIi64, and PRIu64.
If 64bit print is not supported on fprintf, dispatch to fallback print.
2014-10-30 23:54:33 +09:00
Takatoshi Kondo
837c5ecfc3 Fixed char packing support.
See https://github.com/msgpack/msgpack-c/issues/57#issuecomment-60670037
2014-10-28 10:48:49 +09:00
Takatoshi Kondo
04aa309f24 Merge pull request #145 from redboltz/add_help_comments_for_compile_error
Added help comments for compile error.
2014-10-27 20:12:44 +09:00
Takatoshi Kondo
69b2ea4002 Added help comments for compile error. 2014-10-27 17:41:06 +09:00
Takatoshi Kondo
8ddc219365 Merge pull request #143 from redboltz/solve_conflicts_on_readme
Solved conflicts on README.md.
2014-10-27 13:00:40 +09:00
Takatoshi Kondo
a9cf916b82 Solved conflicts on README.md. 2014-10-27 11:09:49 +09:00
Takatoshi Kondo
8455a2eb70 Merge branch 'redboltz-poc/0.6' 2014-10-26 15:40:41 +09:00
Takatoshi Kondo
5c0f1db25c Merge branch 'poc/0.6' of https://github.com/redboltz/msgpack-c into redboltz-poc/0.6
Conflicts:
	.travis.yml
	CMakeLists.txt
	README.md
	ci/build_autotools.sh
	ci/build_cmake.sh
	src/msgpack/object.hpp
	src/msgpack/type/fixint.hpp
	src/msgpack/type/int.hpp
	src/msgpack/type/tr1/unordered_map.hpp
	src/msgpack/type/tr1/unordered_set.hpp
	test/msgpack_test.cpp
	test/object.cc
2014-10-26 15:40:22 +09:00
Takatoshi Kondo
466986b519 Merge branch 'redboltz-api_versioning' into poc/0.6 2014-10-26 13:28:03 +09:00
Takatoshi Kondo
a6aac482dd Merge branch 'api_versioning' of https://github.com/redboltz/msgpack-c into redboltz-api_versioning
Conflicts:
	include/msgpack/unpack.hpp
2014-10-26 09:43:36 +09:00
Takatoshi Kondo
bb984d3445 Merge pull request #141 from redboltz/add_32bit_test_for_travisci
Added a 32bit environment tests for travis-ci.
2014-10-26 09:33:05 +09:00
Takatoshi Kondo
f8e2766d28 Added a 32bit environment tests for travis-ci. 2014-10-26 09:06:01 +09:00
Takatoshi Kondo
2d5d12f9a6 Merge pull request #140 from redboltz/fix_issue95_on_poc0.6
Fixed https://github.com/msgpack/msgpack-c/pull/95 on poc/0.6 branch.
2014-10-24 22:37:37 +09:00
Takatoshi Kondo
11a2a1b8ec Fixed https://github.com/msgpack/msgpack-c/pull/95 on poc/0.6 branch. 2014-10-21 22:13:53 +09:00
Takatoshi Kondo
b5e66150e9 Minimized header files dependency.
Added help comments for typical compile error.
2014-10-19 21:18:30 +09:00
Takatoshi Kondo
e21e3245db Merge pull request #138 from redboltz/move_byteswap
Moved include byteswap.h to sysdep.h.
2014-10-19 19:42:38 +09:00
Takatoshi Kondo
07e7ad6b7e Merge pull request #137 from redboltz/remove_tr1_from_test
Removed wrong tr1:: from unordered containers.
2014-10-19 19:37:10 +09:00
Takatoshi Kondo
44b524529d Merge pull request #136 from redboltz/replace_uint64_t_with_apropriate_types
Replaced uint64_t with apropriate types.
2014-10-19 19:26:42 +09:00
Takatoshi Kondo
fc65bc0682 Replaced tuple with std::tuple.
Added include file int_fwd.hpp for MSGPACK_ADD_ENUM.
2014-10-16 14:07:53 +09:00
Takatoshi Kondo
ca12e6d39d Added packer_serializer class template declaration to object_fwd.hpp 2014-10-16 14:06:57 +09:00
Takatoshi Kondo
db8578a62b Separated adaptor functions' definitions and declarations. 2014-10-16 11:21:26 +09:00
Takatoshi Kondo
4a292193f2 Moved include byteswap.h to sysdep.h.
When compiling on Mac, byteswap.h is not included.
2014-10-12 01:22:10 +09:00
Takatoshi Kondo
1e7fbc0349 Removed wrong tr1:: from unordered containers. 2014-10-12 00:20:54 +09:00
Takatoshi Kondo
479d50bd93 Replaced uint64_t with apropriate types. 2014-10-11 23:45:21 +09:00
Nobuyuki Kubota
982787865f Merge pull request #127 from redboltz/clear_set_map
Fixed https://github.com/msgpack/msgpack-c/issues/76
2014-10-06 15:12:20 -07:00
Nobuyuki Kubota
bf4a57da34 Merge branch 'object-with-zone-copy' 2014-10-06 14:07:06 -07:00
Nobuyuki Kubota
2fcbe6116d Replace C-style casts with C++-style ones 2014-10-06 14:06:21 -07:00
Takatoshi Kondo
4c00f448aa Added a minimal forward declaration header file for pack/unpack overloading. 2014-10-01 14:33:02 +09:00
Takatoshi Kondo
3ddeb08e6e Added API versioning. 2014-10-12 23:21:25 +09:00
Takatoshi Kondo
0176dd760a Merge pull request #131 from shafik/master
Fixing undefined behavior introduced by the incorrect use of comma
2014-09-20 17:39:44 +09:00
Jakob Petsovits
d30548af3f Add support for copying an object to an object::with_zone.
With test.
2014-09-20 00:13:40 -04:00
Jakob Petsovits
ab12b2b2b9 Specialize operator<<(packer, T) also for object::with_zone.
It already existed for T = object, but if trying to pass an
object::with_zone it would match the generic operator<<() instead.
That operator calls o.msgpack_pack(), which doesn't exist and
causes a compile error.

(Re-)Using the overload for object is a better way to handle this.
2014-09-19 22:48:24 -04:00
Takatoshi Kondo
7ce69a362f Merge pull request #130 from jpetso/master
Support std::unordered_map/set even if using libstdc++ from GCC.
2014-09-20 00:06:51 +09:00
Takatoshi Kondo
cc08146b1c Merge pull request #132 from redboltz/support_travis_ci
Added travis-ci support.
2014-09-19 23:57:40 +09:00
Takatoshi Kondo
6896cc602f Added travis-ci support. 2014-09-19 23:42:07 +09:00
Shafik Yaghmour
d8f366daf2 Fixing undefined behavior introduced by the incorrect use of comma operator with the conditional operator. The middle expression in a conditional operator between the ? and : is implicitly parenthesized but the end expression is not. Since the comma operator as he lowest precendence( http://en.cppreference.com/w/cpp/language/operator_precedence) this means the conditional operator will be evaluated first and then the expression on the right hand side of the comma operator will be evaluated. This leads to undefined behavior because the last member of the union being updated will not be the member that will be used next which is strictly undefined in C++ although gcc and clang aloow this type punning as an extension but is clearly not portable behavior nor was this the intended behavior. instead of parenthesising the end expression I choose to use an if/else which is not subject to such easy to miss precdence issues. This Coliru live code demonstrates the bug with simple example: http://coliru.stacked-crooked.com/a/1041aaa8380feeaa the code also demonstrates the using the right warning flags gcc will generate a warning for this code. 2014-09-18 14:29:11 -04:00
Jakob Petsovits
ef649009e4 Support std::unordered_map/set even if using libstdc++ from GCC.
When passing the appropriate compiler flags, libstdc++ has
supported std::unordered_map and std::unordered_set for a
long time, even without the tr1 namespace. There's no reason to
limit support of non-tr1 containers to libc++ (clang) and MSVC.
2014-09-17 16:52:33 -04:00
Nobuyuki Kubota
cd03ab62f8 Merge pull request #128 from redboltz/cpp11_unpacked_return
Added additional unpack() APIs to support C++11 style programming.
2014-09-16 10:06:31 -07:00
Nobuyuki Kubota
44e41efa0c Merge pull request #126 from redboltz/add_zero_size_tuple_support
Added zero size tuple support.
2014-09-16 09:23:31 -07:00
Takatoshi Kondo
ecf4b09acd Merge pull request #129 from tarruda/fix-ext-8-16-32
Fix size packing/unpacking for EXT 8/16/32
2014-09-16 08:52:48 +09:00
Thiago de Arruda
d6122b4a18 Fix size packing/unpacking for EXT 8/16/32
For EXT 8/16/32, the "size" field was being incremented by 1 to account for the
type field, but according to the specification the size should only consider the
length of the data field.
2014-09-15 15:37:02 -03:00
Takatoshi Kondo
4fcb4777f3 Added additional unpack() APIs to support C++11 style programming. 2014-09-15 22:33:23 +09:00
Takatoshi Kondo
03ed30ce03 Fixed https://github.com/msgpack/msgpack-c/issues/76
Clear deserialized target containers.
As the result of this fix, all containers' deserialized behaviors become consistent.
2014-09-15 18:16:37 +09:00
Takatoshi Kondo
6e810df2a4 Added zero size tuple support. 2014-09-14 20:50:57 +09:00
Takatoshi Kondo
847a7852e5 Merge branch 'jpetso-master' 2014-09-10 10:59:49 +09:00
Jakob Petsovits
e265beef91 Install version.h even if doing an out-of-source build. 2014-09-09 16:21:38 -04:00
Takatoshi Kondo
0335df55e1 Merge pull request #123 from redboltz/add_memory_check
Add memory check
2014-09-09 14:53:23 +09:00
Takatoshi Kondo
dd4043a616 Removed unused variables. 2014-09-09 14:29:10 +09:00
Takatoshi Kondo
6a8412d6de Separated msgpack_test.cpp.
Renamed test files.
Decreased test's loop counter to avoid travis-ci no output timeout.
The number of loops is not so meaningful.
2014-09-09 14:15:21 +09:00
Takatoshi Kondo
7491c1996a Added memory checking for travis-ci cmake build. 2014-09-09 13:38:07 +09:00
Takatoshi Kondo
0ab14b4138 Merge pull request #121 from redboltz/fix_cmake_binary_dir
Fixed the path of the msgpack.pc to support structured build.
2014-09-09 10:27:52 +09:00
Takatoshi Kondo
6e77c6df11 Merge pull request #122 from redboltz/add_install_test
Added 'make install' as a test target.
2014-09-09 10:14:24 +09:00
Takatoshi Kondo
bcc91d78e9 Merge branch 'tarruda-ext-support-for-c' into poc/0.6 2014-09-09 10:09:02 +09:00
Takatoshi Kondo
32b65dba47 Added 'make install' as a test target. 2014-09-09 07:37:29 +09:00
Takatoshi Kondo
aa75e6ecd3 Fixed the path of the msgpack.pc to support structured build. 2014-09-09 06:28:52 +09:00
Takatoshi Kondo
dc679a2572 Merge pull request #119 from davidchappelle/master
Amendment to cmake changes for out of source builds
2014-09-09 06:21:38 +09:00
David Chappelle
b6bc7f7ecb Merge remote-tracking branch 'upstream/master'
Conflicts:
	CMakeLists.txt
2014-09-08 15:57:43 -04:00
Thiago de Arruda
896dead7cc Adapt msgpack_test.cpp EXT cases to msgpackc_test.cpp 2014-09-08 12:11:39 -03:00
Thiago de Arruda
dfa277a9e0 Add EXT support to C library 2014-09-08 12:11:38 -03:00
Jason Newton
501260eb54 correct paths for x86_64/generic installations 2014-09-08 22:27:38 +09:00
Takatoshi Kondo
370a9251f5 Merge pull request #117 from redboltz/removed_unused_member_variable
Removed unused member variable.
2014-09-08 17:27:16 +09:00
Takatoshi Kondo
7737f1cb77 Removed unused member variable. 2014-09-08 17:14:56 +09:00
Takatoshi Kondo
f72022037c Merge pull request #116 from redboltz/limited_travis_target
Limited branches for travis-ci.
2014-09-08 17:08:16 +09:00
Takatoshi Kondo
865528f778 Limited branches for travis-ci. 2014-09-08 17:01:04 +09:00
Takatoshi Kondo
d54048eabe Merge pull request #114 from redboltz/poc/0.6
Added travis-ci support.
2014-09-08 16:36:12 +09:00
Takatoshi Kondo
103a6c56e4 Added travis-ci support. 2014-09-08 16:38:44 +09:00
Takatoshi Kondo
11f1d5fbbd Fixed https://github.com/msgpack/msgpack-c/pull/113
When the original PR was applied, the resource leak had been fixed, but a dual free problem had been happened.

When msgpack_unpacker_next returns MSGPACK_UNPACK_CONTINUE, msgpack_unpacked::zone is not replaced. Then mespack_zone_free is called twice with the same object. msgpack_unpacked_destroy frees msgpack::zone when it is not NULL and set it to NULL.

Also, fixed memory leak (msgpack_sbuffer) on the test code.
2014-09-07 13:56:07 +09:00
Takatoshi Kondo
7ebdb63131 Merge pull request #113 from tarruda/fix-memory-leak
Fix memory leak in msgpack_unpacker_next
2014-09-07 12:45:23 +09:00
Thiago de Arruda
a186725213 Fix memory leak in msgpack_unpacker_next 2014-09-06 20:01:52 -03:00
David Chappelle
8615358515 Fixed out of source cmake builds to work correctly.
The out of source cmake build was not working correctly. In particular,
the main CMakeLists.txt was not installing from the correct location.
In the case of msgpack.pc, it was trying to install from the top repo
directory instead of from the cmake build directory. So you can now
build as follows:

    $ cd msgpack-c
    $ mkdir build
    $ cd build
    $ cmake ../
    $ make
    $ make install
2014-09-05 19:22:04 +00:00
Takatoshi Kondo
86ad026f11 Renamed the last digit of version string from RELEASE to REVISION.
Added REVISION macro and getting API.
2014-09-03 13:26:34 +09:00
Jason Newton
93d0f0bd00 inline default_reference_func to avoid multiple definition errors 2014-09-03 10:26:09 +09:00
Jason Newton
a0f5392876 correct paths for x86_64/generic installations 2014-09-03 10:26:09 +09:00
Takatoshi Kondo
5896ff3746 Fixed -Wextra warnings on gcc. 2014-09-02 18:15:58 +09:00
Takatoshi Kondo
d15e49cb73 Updated version getting mechanism.
Versions are gotten from version_master.h
2014-09-02 16:42:05 +09:00
Takatoshi Kondo
2103c12e05 Added char* packing support. char* is packed to STR similar as std::string.
See https://github.com/msgpack/msgpack-c/issues/110
2014-09-01 22:42:08 +09:00
Takatoshi Kondo
f0a12a23a1 Merge branch 'tarruda-poc/0.6' into poc/0.6 2014-09-01 13:20:01 +09:00
Thiago de Arruda
30b946ee85 Support out-of-tree builds with cmake
This changes the location of msgpack.pc to support out-of-tree builds.
2014-08-31 10:42:27 -03:00
Takatoshi Kondo
a388000d47 Fixed autotools AC_INIT with external information implemantation.
See:
http://stackoverflow.com/questions/22871340/using-a-variable-in-ac-init
2014-08-31 20:38:52 +09:00
Takatoshi Kondo
4c888294b5 Merge pull request #107 from redboltz/fix_105_for_poc0.6
Fixed operator>>(object const& o, various types& v) return type and valu...
2014-08-31 17:23:18 +09:00
Takatoshi Kondo
68bf4acb4b Fixed operator>>(object const& o, various types& v) return type and value problem.
https://github.com/msgpack/msgpack-c/issues/105
2014-08-29 00:43:18 +09:00
Takatoshi Kondo
2c2df64427 Fixed C++03 and C++11 conditional tests building problem on cmake. 2014-08-29 00:38:44 +09:00
Takatoshi Kondo
4d6e9d6c05 Removed referenced member from msgpack::unpacked.
Added a referenced parameter to msgpack::unpack() and msgpack::unpacker::next().

msgpack::unpacked is a kind of handler that holds msgpack::object and msgpack::zone, so the size of msgpack::unpacked should be small. There is no reason to have referenced in msgpack::unpacked. msgpack user can get the same information using msgpack::unpack() and msgpack::unpacker::next().
2014-08-11 15:50:51 +09:00
Takatoshi Kondo
f969f6f39c Replaced zone* member variable in object with zone&.
Added msgpack::object::with_zone tests.
Added tuples operator<<'s parameter to const.
Fixed array object::with_zone pointer and size unset problem.
Fixed forward_list object::with_zone pointer and size unset problem.
2014-08-11 13:23:27 +09:00
Takatoshi Kondo
8920c49597 Unified test files extension as cpp. 2014-08-11 09:01:17 +09:00
Takatoshi Kondo
e18102d16f Replaced size() with std::distance. 2014-08-11 07:48:30 +09:00
Takatoshi Kondo
ea23bf843e Added std::forward_list support.
Fixed cmake filename typo.
2014-08-10 23:45:50 +09:00
Takatoshi Kondo
e217e72c22 Fixed msgpack::object type EXT comparison problem.
Added msgpack::object type EXT ostream minimal output.
2014-08-10 23:23:52 +09:00
Takatoshi Kondo
0bc4b3f599 Added the C++11 std::array support.
std::array<char, N> is mapped to BIN. That is the same mannar as std::vector.
2014-08-10 23:06:30 +09:00
Takatoshi Kondo
b2f5893669 Added reference to return value. 2014-08-10 22:04:31 +09:00
Takatoshi Kondo
9a1ccaf155 Merge pull request #100 from redboltz/add_vector_char_as_bin
vector<char> is mapped to BIN
2014-08-10 21:52:02 +09:00
Takatoshi Kondo
0201c21b9a Added minimum copy/reference threshold.
Even if ref_size is given on vrefbuffer's constructor, the minimum size of vrefbuffer::ref_buffer is 10.
Because int64, uint64, and double's msgpack expression size equals 9, and those buffer is allocated on the stack internally.
2014-08-08 14:28:03 +09:00
Takatoshi Kondo
dee68403df Replaced obsolete interface with recommended one on the example code. 2014-08-08 12:13:34 +09:00
Takatoshi Kondo
0a99b9f933 Fixed the problem that reference function doesn't pass correctly.
Fixed referenced flag writing timing on next(). It should place before flush.
Added msgpack_tuple test for CMakeLists.txt
Untabified CMakeLists.txt
Added reference function test.
2014-08-07 23:26:09 +09:00
Takatoshi Kondo
17e696fc0d Removed redundant memory allocation from zone.
Removed zone::create and zone::destroy.
We can use zone as follows:
   zone z; // on stack
   zone* z = new zone; // on heap

Fixed a resource leak when zone::push_finalizer(msgpack::unique_ptr<T>) is called.
2014-08-07 15:23:34 +09:00
Takatoshi Kondo
b5b459cfca Reordered unpack selector sequence. 2014-08-07 10:40:21 +09:00
Takatoshi Kondo
7822bc787d Replaced switch-case and bit calculation with a table. 2014-08-07 10:28:18 +09:00
Takatoshi Kondo
1f5d6b9cac Added EXT support.
Removed obsolete unpack functions.
Updated examples that no longer use obsolete functions.
Added reference checking function to unpacked. ( unpacked::referenced() )
Added std:: namespace.
Added reference or copy choice function and default behavior:
  When you use unpacker, default behavior is:
    STR, BIN, EXT types are always held by reference.
  When you don't use unpacker, default behavior is:
    STR, BIN, EXT types are always held by copy.
    The memory is allocated from zone.
  You can customize the behavior passing your custom judging function to unpack() or unpacker's constructor.
2014-08-06 16:18:37 +09:00
Takatoshi Kondo
ce21ab0ebf Fixed zone allocating functions always throw std::bad_alloc() if allocation is failed. 2014-08-06 12:16:28 +09:00
Takatoshi Kondo
5af6d36341 Added a link to wiki. 2014-08-04 16:39:17 +09:00
Takatoshi Kondo
15a0d61a64 Added the new mapping:
std::vector<char> is mapped to BIN.

So, currently BIN, STR, and ARRAY mappings are as follows:
  std::vector<char> is mapped to BIN
  std::string       is mapped to STR
  std::vector<T>    is mapped to ARRAY // T is not char
2014-08-04 15:14:39 +09:00
Takatoshi Kondo
66014eebc0 Updated test codes using recommended interface.
They used to use obsolete interfaces.
2014-08-04 01:08:05 +09:00
Takatoshi Kondo
fd566afeb4 Added reference version of unpacker::next(). 2014-08-04 00:52:04 +09:00
Takatoshi Kondo
e4d32b176e Use const char* version of msgpack::unpack_error to avoid std::string memory allocation when usr C++11 compiler.
See http://www.cplusplus.com/reference/stdexcept/runtime_error/?kw=runtime_error
2014-08-03 17:04:46 +09:00
Takatoshi Kondo
b27c87c9ed Replaced C-Style cast with static_cast. 2014-08-03 16:38:58 +09:00
Takatoshi Kondo
3729f334a1 Replaced size_t with std::size_t. 2014-08-03 16:34:47 +09:00
Takatoshi Kondo
55bf279a7c Removed obsolete unpack interface from test codes. 2014-08-03 08:08:08 +09:00
Takatoshi Kondo
78e8cbdfb5 Cleaned up pointer and reference versions of unpack(). 2014-08-03 07:09:03 +09:00
Nobuyuki Kubota
dd083ca933 Merge pull request #95 from ueno/int-float-test
Fix test failure regarding int->float conversion
2014-07-30 21:25:42 -07:00
Takatoshi Kondo
23d670f3bd Merge pull request #97 from splinterofchaos/ostream
Add inline for ODR compliance.
2014-07-25 09:19:55 +09:00
Scott Prager
6fab3594a2 Add inline for ODR compliance. 2014-07-24 15:04:33 -04:00
Takatoshi Kondo
421aeb5021 Fixed missing copy operation for zone.hpp 2014-07-24 23:49:35 +09:00
Takatoshi Kondo
47f4ffe9f3 Added cpp11 include files to install files.
Sorted C++ install files to avoid overlooking.
2014-07-24 10:54:54 +09:00
Takatoshi Kondo
09325ed846 Re-implemented msgpack::unpacker's move operations.
I refered to the following article and comments.
http://scottmeyers.blogspot.jp/2014/06/the-drawbacks-of-implementing-move.html

msgpack::detail::context back to copiable.
msgpack::detail::context doen't have any resource ownership, so there is
no strong reason to avoid copy.
2014-07-24 10:38:24 +09:00
Takatoshi Kondo
bfa428ab13 Added cpp_config.hpp to install files. 2014-07-24 07:52:20 +09:00
Takatoshi Kondo
ecdeec9948 Fixed the move assign operator implementation. 2014-07-24 07:41:23 +09:00
Takatoshi Kondo
f11a811114 Added a move constructor and a move assign operator for unpacker and context.
https://github.com/msgpack/msgpack-c/issues/96
2014-07-23 21:32:45 +09:00
Daiki Ueno
c203928fae Fix test failure regarding int->float conversion
Supply only small integers (< 1^23) to int->float conversion tests,
so they can roundtrip without error.
2014-07-17 18:51:59 +09:00
Takatoshi Kondo
59b111e026 Removed the contents in 'install from package' section. It is not supported for this branch.
Updated the description of the cmake.
2014-07-16 08:49:27 +09:00
Takatoshi Kondo
2a694f8c20 Fixed markdown format. 2014-07-16 08:26:36 +09:00
Takatoshi Kondo
0380215982 Fixed https://github.com/msgpack/msgpack-c/issues/88
Added examples for the following updated functions:

msgpack_unpack_return msgpack_unpacker_next(msgpack_unpacker* mpac, msgpack_unpacked* result);

msgpack_unpack_return
msgpack_unpack_next(msgpack_unpacked* result,
        const char* data, size_t len, size_t* off);
2014-07-13 09:35:58 +09:00
Takatoshi Kondo
0e48f65a4b Fixed https://github.com/msgpack/msgpack-c/issues/94
Added a private copy assign operator to unpacker.
2014-07-12 00:41:33 +09:00
Takatoshi Kondo
aa79fc2ff4 Updated versions. 2014-07-12 00:33:06 +09:00
Takatoshi Kondo
cc571b8bb1 Replaced std::auto_ptr with msgpack::unique_ptr. 2014-07-12 00:21:35 +09:00
Takatoshi Kondo
b0df21295c Untabified.
Adjust line break positions.
2014-07-12 00:17:31 +09:00
Takatoshi Kondo
0889e6117e Renamed member variables name. 2014-07-11 23:37:43 +09:00
Takatoshi Kondo
212f025f00 Supported the C++11's enum class. 2014-07-08 19:31:02 +09:00
Takatoshi Kondo
f6a5402194 Supported the C++11 tuple. 2014-07-08 19:18:43 +09:00
Takatoshi Kondo
6a349d0b28 Fixed zero size string in the array problem. 2014-07-07 16:31:29 +09:00
Takatoshi Kondo
dac5c60608 Replaced bit shift with memcpy on load. 2014-07-07 16:31:29 +09:00
Takatoshi Kondo
bc33317b7e Reorganized tree. 2014-07-07 16:31:29 +09:00
Takatoshi Kondo
754b1682a5 Replaced C-style casts with C++ style casts. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
cb9eed8ccc Renamed from ct to container_type. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
862905742f Renamed z with zone. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
ba98315f65 The same fix as follows on C++ code.
https://github.com/msgpack/msgpack-c/pull/38
2014-07-07 16:19:31 +09:00
Takatoshi Kondo
124a871923 Removed redundant parameter. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
378f6afccd Mapped std::stirng to STR instead of BIN for benchmark. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
1320863cb3 Replaced function arguments with data members. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
a951ea90b8 Fixed delete free mismatch problem in C++11 version. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
3b7a2f8f32 Updated test codes using reference version of unpack functions. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
038c3e3518 Replaced unsigned int to size_t. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
c08439ff41 Added STR to std::string conversion. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
59d994ea5f Define nullptr macro only if it is not previously defined. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
ed51d23335 Refined tuple implementation. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
2be892bfda Removed a redundant null pointer check. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
723d900098 Added 'template' keyword. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
13404a7444 Supported placement new. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
a20594dfdc Added line breaks. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
bff4cadeff Added C++ separate version and C++11 description. 2014-07-07 16:19:31 +09:00
Takatoshi Kondo
6515577dc3 Added null pointer check for C++ separated code. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
beebccd323 Renamed zone::malloc familiy functions. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
d70c44b723 Added bin and str families support. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
33d3192ca2 Added static_cast to char. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
0d13931844 Fixed freed memory accessing bug in the C++ code.
(Issue #32)
2014-07-07 16:17:59 +09:00
Takatoshi Kondo
293c839a22 Supported 'plain' char.
msgpack used to only support signed char and unsigned char.
2014-07-07 16:17:59 +09:00
Takatoshi Kondo
f187ae35d9 Added a nested array example. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
74013e7e7d Added array of array example. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
e2026c0507 Renamed the classes named template_*.
Removed template_ from them because they are no longer template.
2014-07-07 16:17:59 +09:00
Takatoshi Kondo
c375e14705 Renamed a member function name from setObj to set_obj. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
fade0644c7 Added comments that how to compile and run it. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
5fedaf285b Removed C-style casts. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
fe82444db1 Replaced NULL with nullptr. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
f7692691ca Removed local variables top, cs, and user and access directly member variables top_, cs_, and user_.
The local variable trail is preserved to suppourt register optimization.
Other variables don't contribute increasing speed even though they are on registers.
2014-07-07 16:17:59 +09:00
Takatoshi Kondo
7fba3484c5 Renamed template callback functions.
Moved aggregate unpacking and pushing procedure to the function push_aggregate.
2014-07-07 16:17:59 +09:00
Takatoshi Kondo
561b6b583d Modified data members initialize sequence to fix a warning. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
7675c15fa9 Added a comment. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
99971abc9b Cleaned up template_context::execute(). 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
b7a1ba9ba0 Modified the offset parameter of template_context::execute() from pointer to reference. 2014-07-07 16:17:59 +09:00
Takatoshi Kondo
63c26cd58b Modified return type from bool to void in functions that always return true. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
f8fc03b482 Modified template functions' return value from int to bool. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
b0b1a0e9a7 Removed template_callback_root. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
4d2a9c23af Added inline keyword. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
c41154989a Used the reference version of convert instead of pointer version. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
541ece13c0 Added inline for constructors and a destructor. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
b6b2ef5e57 Removed the last comma at enum definitions to support C++03 strictly. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
4ef69da25d Restored the test cases using pointer based interfaces.
It assures that we can use the same interfaces as the original version(0.5.6).
To support both C++03 and C++11, I introduced msgpack::unique_ptr and msgpack::move() in test codes.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
9bd339baf8 Restored pointer based interfaces to maintain compatibility. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
616be1aa60 Modified type classes' interfaces parameters 'object' from passed by value to passed by reference. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
415b14335f Modified the parameter of object::convert() from pointer to reference. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
1fb707f93f Renamed functions from pack_real_* to pack_imp_*. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
aa4ed82b66 Replaced TAKE8_* macros with inline function named take8_*.
Modified byte stream using char instead of unsigned char.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
7ce8abe5d6 Tabified.
Indent adjusted.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
27629a8dd6 Modified 'unpacked' interface using references instead of pointers.
Added speed test for 'unpacked' based unpack() function.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
521a4f4190 Modified unpack_user* to unpack_user&.
Removed redundant 'static'.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
bad3801eae Modified zone* to zone&. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
72b3064a67 Removed redundant try-catch, zone's constructor never throw.
In the C++11 version, added noexcept.
In the C++03 version, added throw() as comments because actual throw() introduces some overhead.
Untabified.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
7593e5ce0e Removed object copy in implicit conversion class.
Removed redundant function prototype declaration.
Adjusted tab position.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
8a08548f36 Modified passed by value of object to const reference of object.
Removed C function call in operator==.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
56b0ad6809 Modified passed by value of object to const reference of object.
Modified object pointers to object references.
This modification has increased unpack speed.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
f8561fbfd5 Added map packing speed test. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
e80cbd4437 Tests for msgpack::type::tuple C++11 expansion moved to __cplusplus >= 201103. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
da601e4589 Added member fucntion version of msgpack::type::tuple::get().
Added support functions for msgpack::type::tuple as same as std::tuple.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
36a87b6968 Replaced C-style casts with C++ stype casts in C++ codes. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
e0b42939ba Cleaned up include guards. 2014-07-07 16:17:58 +09:00
Takatoshi Kondo
7d731f83a4 Moved the codes in pack_template.h to pack.hpp.
pack_template.h is still needed for the C version of msgpack.
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
40ad7da455 Moved gcc atomic functions from source file to header file.
Moved ostream operator << from object.cpp to object.hpp
Removed object.cpp
Modernize configure.in
2014-07-07 16:17:58 +09:00
Takatoshi Kondo
e0d1e5c722 Modified tuple's get calling from member function to free function. 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
5b3a168b86 Supported C++03. 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
11afd4820f Modified unpack functions to class member functions. 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
ec5c1194fc Removed redundant namespace scope resolutions. 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
7eccd1029a Modified from ::msgpack to msgpack 2014-07-07 16:16:29 +09:00
Takatoshi Kondo
c2ca709d68 Added header files that use c++11 variadic templates instead of ruby code generation.
When the compiler configured to support C++11 (e.g. CXXFLAG contains -std=c++11 is given),
those files are used.
Decoupled unpacker and msgpack_unpacker.
This modification introduced C++11 dependency such as nullptr and unique_ptr.
I will support C++11 and C++03, finally.

Decoupled msgpack.hpp and msgpack.h.

Decoupled sbuffer from msgpack_sbuffer.

Decoupled vrefbuffer from msgpack_vrefbuffer.

Decoupled zbuffer from msgpack_zbuffer.

Added some z_stream initialization.

Removed unpack macros.

Removed CTX_CAST and CTX_REFERENCED.

Embed ctx_ as a member variable (not a pointer).

Modified zone free using C++ way.
2014-07-07 16:16:29 +09:00
Nobuyuki Kubota
197ed8c983 Merge pull request #92 from nobu-k/version0.5.9
version 0.5.9
2014-07-03 11:45:20 +09:00
Nobuyuki Kubota
990860fe65 Change CMAKE_MINIMUM_REQUIRED to 2.8.6 for SET_PROPERTY APPEND_STRING 2014-07-03 11:39:43 +09:00
Nobuyuki Kubota
dbeb6e61c6 version 0.5.9 2014-07-02 18:44:07 +09:00
Nobuyuki Kubota
2b3f37f9e0 Add fbuffer.h and fbuffer.hpp to CMakeLists.txt and msgpack_vc.postbuild.bat 2014-07-02 18:07:07 +09:00
Nobuyuki Kubota
f50148a9cc Merge branch 'fbuffer' 2014-07-02 17:53:18 +09:00
Takatoshi Kondo
9fc8ec5b61 Merge branch 'tbeu-fix-bool-and-inline-for-C-compilation-with-MSVC' 2014-07-02 17:44:18 +09:00
Takatoshi Kondo
751a6f98fe Moved bool and inline definition from msgpack.h to sysdep.h.
Set compile settiong on MSVC. ".c" files are compliled as C, not C++. (msgpack_vc8.vcproj, CMakeLists.txt)
Fixed msgpack root object initialization problem on MSVC. {} initialization is not supported on MSVC.
2014-07-02 17:43:07 +09:00
Nobuyuki Kubota
9d8e6b92fc Add fclose to fbuffer's tests 2014-07-02 17:35:15 +09:00
Nobuyuki Kubota
c868da2879 Fix Makefile.am to install fbuffer.h and fbuffer.hpp 2014-07-02 17:32:41 +09:00
tbeu
e0c40c1c59 fix type bool and inline specifier
For a pure C compilation with MSVC type bool is not available. Not tested with other targets (Mingw, cygwin). Thats why only active of ```_MSC_VER``` is defined. So not sure if the bool fix should be also applied to other targets.

For MSVC the inline specifier is not valid and must be named __inline (or _inline).
2014-07-02 17:13:31 +09:00
Nobuyuki Kubota
f185284776 Merge branch 'mpapierski-cmake' 2014-07-02 16:22:33 +09:00
Takatoshi Kondo
1656ef0111 Merge pull request #90 from tbeu/fix-c-compilation
Fix pure C compilation
2014-06-23 21:43:56 +09:00
tbeu
3cb2e4f7c6 Fix pure C compilation 2014-06-23 13:55:25 +02:00
Takatoshi Kondo
3104f7e451 Added -O3 -g option for gcc and clang. Improved compiler checking method. 2014-06-21 19:00:59 +09:00
Takatoshi Kondo
ab8e7ea822 Added -DPIC option on shared library. 2014-06-21 11:27:33 +09:00
Takatoshi Kondo
6daef66ea7 Added warning flags. 2014-06-21 11:11:32 +09:00
Takatoshi Kondo
04286eb9dc Modified the way to install msgpack headers. 2014-06-12 11:18:06 +09:00
Takatoshi Kondo
d15e30bf4a Fixed major_version and minor_version.
Fixed relase_version.
Added msgpack.pc creating proccess.
2014-06-08 15:25:24 +00:00
Takatoshi Kondo
fb1d480faf Added the SOVERSION same as autotools.
Set CMAKE_MINIMUM_REQUIRED to 2.6.4.
2014-06-08 14:05:33 +00:00
Takatoshi Kondo
c8fa0be345 Supported make install.
Removed vc2008 files from make dist.
2014-06-07 14:39:59 +00:00
Takatoshi Kondo
643b0c9523 Supported shared library on cmake.
Updated the documentation.
2014-06-07 00:13:23 +09:00
Takatoshi Kondo
06930616b2 Added cmake files.
https://github.com/msgpack/msgpack-c/pull/20
Removed 'preprocess' from original CMakeLists.txt.
Removed file copy from original CMakeLists.txt.

Removed 'preprocess' from bootstrap.
Removed file copy from bootstrap.

Added erb generated files. Ruby is no longer required.
Moved cases.mpac, cases_compact.mpa, pack_define.h,
pack_template.h, unpack_define.h, unpack_template.h,
and sysdep.h to apropriate location.

If you want to re-generate zone.hpp, define.hpp, and tuple.hpp,
then you execute preprocess.
2014-06-05 20:49:15 +00:00
Nobuyuki Kubota
6e5fc6d396 Merge pull request #83 from redboltz/fixed_readme
Fixed https://github.com/msgpack/msgpack-c/issues/82
2014-06-01 19:16:10 +09:00
Takatoshi Kondo
17b0753023 Fixed linking order. 2014-06-01 19:03:51 +00:00
Nobuyuki Kubota
7491348d40 Merge branch 'philix-Wconversion' 2014-06-01 19:09:02 +09:00
Nobuyuki Kubota
eef2036c36 Remove implicit type conversions from (un)pack_template.h 2014-06-01 19:06:40 +09:00
Nobuyuki Kubota
fbec8f4470 Merge pull request #80 from redboltz/fix_enum_member_test
Fixed dereferencing type-punned pointer will break strict-aliasing rules warning
2014-06-01 18:22:46 +09:00
Felipe Oliveira Carvalho
8e0137e1d2 Fix to allow projects to compile with -Wconversion
Projects that use -Wconversion don't compile due to errors in msgpack header
files. This commit fixes all the errors in msgpack-c for when -Wconversion is
enabled.

Now I can even compile msgpack-c itself with -Wconversion and all my projects:

    CFLAGS=-Wconversion ./configure
		make
2014-05-19 15:30:14 -03:00
Takatoshi Kondo
1dac3f890a Fixed https://github.com/msgpack/msgpack-c/issues/82 2014-04-24 22:39:01 +00:00
Nobuyuki Kubota
9f33266f23 Merge pull request #81 from watsonsong/master
fix compile error on Linux by gcc 4.7
2014-04-07 10:37:54 +09:00
Frank Watson Song
d8c7fd5161 fix compile error on Linux by gcc 4.7 2014-04-01 17:34:28 +08:00
Nobuyuki Kubota
731bc643d0 Merge pull request #79 from redboltz/add_inline
Fixed https://github.com/msgpack/msgpack-c/issues/77
2014-03-31 17:36:06 +09:00
Takatoshi Kondo
12e8615ac5 Fixed dereferencing type-punned pointer will break strict-aliasing rules warning. 2014-03-31 16:37:29 +09:00
Takatoshi Kondo
22703d2cdb Fixed https://github.com/msgpack/msgpack-c/issues/77 2014-03-30 18:42:15 +00:00
Takatoshi Kondo
cb518f472a Merge pull request #73 from ovz/master
Fixed failing test zone_allocate_constructor.
2014-03-30 18:46:15 +09:00
Takatoshi Kondo
271f1fa319 Merge pull request #75 from mogemimi/fix/typo
Fix typo in QUICKSTART-CPP
2014-03-30 18:21:34 +09:00
mogemimi
9ecc4f0a1e Fix typo in QUICKSTART-CPP 2014-03-24 23:07:10 +09:00
ovz
977eab7c4a Fixed failing test zone_allocate_constructor.
Corrected a typo in definition of myclass constructor with parameters.
2014-03-18 14:25:55 -07:00
Vladimir Volodko
c9f342f4b2 Make fbuffer's constructor explicit. 2014-03-03 10:21:03 +07:00
Nobuyuki Kubota
126e4d8414 Merge pull request #70 from redboltz/remove_cxx11_features
Removed C++11 features
2014-03-02 16:58:16 +09:00
Takatoshi Kondo
14ee1e5827 Removed C++11 features 2014-03-02 14:14:04 +00:00
Nobuyuki Kubota
ecbb9055a2 Merge branch 'vvolodko/improve-define' 2014-02-28 16:15:20 +09:00
Nobuyuki Kubota
862f04104d Changed the format a little 2014-02-28 16:14:49 +09:00
Vladimir Volodko
d47f72be0c Refactor define::msgpack_unpack() to use 'switch' instead of several if's.
convert.benchmark test show some improvement.
2014-02-28 16:14:33 +09:00
Nobuyuki Kubota
98c5767372 Merge branch 'redboltz/add_integer_to_float_conv' 2014-02-28 15:53:11 +09:00
Nobuyuki Kubota
97a7b7545a Refactored test cases with type parameterized test 2014-02-28 15:52:36 +09:00
Nobuyuki Kubota
caf5616573 Merge pull request #69 from redboltz/support_libcpp_and_vcxx_unordered
Support libcpp and vcxx unordered
2014-02-28 15:22:27 +09:00
Takatoshi Kondo
b8076fa71f Supported VC++. Fixed testing macro for tr1 containers. 2014-02-27 23:54:48 +00:00
Takatoshi Kondo
2360466aa9 Added unordered containers support for libc++. 2014-02-22 20:43:18 +00:00
Nobuyuki Kubota
28370b36aa Replaced deprecated functions in example/stream.cc 2014-02-07 20:16:51 +09:00
Nobuyuki Kubota
9d82356ea9 Merge pull request #62 from redboltz/remove_redundant_null_check
Removed a redundant null check.
2014-02-07 20:05:49 +09:00
Nobuyuki Kubota
ca24e040c4 Merge pull request #61 from redboltz/fix_delete_free_mismatch
Fixed the free and delete mismatch problem.
2014-02-07 20:04:57 +09:00
Takatoshi Kondo
0fd629857d Removed a redundant null check. 2014-02-03 09:34:48 +00:00
Takatoshi Kondo
8eff14db11 Removed redundant null check. 2014-02-02 16:22:07 +00:00
Takatoshi Kondo
81e26fe9b9 Fixed the free and delete mismatch problem.
https://github.com/msgpack/msgpack-c/issues/52
2014-02-02 00:07:45 +00:00
Takatoshi Kondo
9eb4583dd5 Merge pull request #59 from redboltz/add_null_check
Added null pointer check.
2014-01-27 17:53:19 -08:00
Takatoshi Kondo
5a23c86dc1 Added null pointer check. 2014-01-28 10:54:57 +09:00
Takatoshi Kondo
ffd0525607 Replaced types of length from unsigned int to size_t. 2014-01-26 11:29:19 +00:00
Drew Crawford
3dc636bf3e This patch fixes a type conversion warning in clang 5 when compiling for arm64 targets.
```
$ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

In file included from /Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/msgpack/pack.h:120:
/Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/msgpack/pack_template.h:773:57: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'unsigned int' [-Wshorten-64-to-32]
        msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/objectc.c:19:
/Users/drew/Dropbox/Code/caffeine-ios/ext/msgpack/src/msgpack/pack.h:118:61: note: expanded from macro 'msgpack_pack_append_buffer'
        return (*(user)->callback)((user)->data, (const char*)buf, len)
                                                                   ^
1 warning generated.
```

This patch is provided under the Apache License version 2.
2014-01-24 12:41:13 -06:00
Takatoshi Kondo
260ce4aa1d Added object that has integer to float and double converter. 2014-01-21 21:12:13 +00:00
Takatoshi Kondo
8bc827ebf5 Merge pull request #51 from xunzhang/master
update type.hpp
2014-01-13 18:10:49 -08:00
xunzhang
a97f764088 update type.hpp, support std::tr1::unordered_map and std::tr1::unordered_set 2014-01-13 14:12:17 +08:00
Nobuyuki Kubota
143b90af3e Merge branch 'claws/readme_overhaul' 2013-12-22 21:12:04 -08:00
Nobuyuki Kubota
4e0a6ae624 Fixed some URL syntaxes 2013-12-22 21:04:53 -08:00
Nobuyuki Kubota
0c60cfc5c0 Merge pull request #47 from nobu-k/version-0.5.8
version 0.5.8
2013-12-22 20:35:16 -08:00
Nobuyuki Kubota
deb6b0e334 version 0.5.8 2013-12-22 20:24:49 -08:00
Nobuyuki Kubota
27777dcd31 Merge pull request #46 from redboltz/fixed_size_type
Fixed size types based on snej's pull request.
2013-12-22 11:55:05 -08:00
Nobuyuki Kubota
bdb397e043 Merge pull request #36 from redboltz/support_plain_char
Supported 'plain' char.
2013-12-22 11:19:19 -08:00
Takatoshi Kondo
cb4d851761 Fixed size types based on snej's pull request.
1784e7a3f3
2013-12-22 15:13:48 +00:00
Chris Laws
17aa517e41 Fix up README, include accurate instructions 2013-12-17 08:53:15 +10:30
Takatoshi Kondo
7ac16f4834 Replaced const [un]signed long long int& with [un]signed long long int in sevral function's arguments to unify the interface. No performance issue is observed. 2013-12-16 13:39:12 +09:00
Takatoshi Kondo
bf7fece440 Merge pull request #43 from redboltz/add_test_and_example_for_37
Added a test and speed test examples for #37.
2013-12-15 20:25:46 -08:00
Takatoshi Kondo
c04ef9efe5 Merge pull request #38 from redboltz/copy_msgpack_object_by_memcpy
Fixed issue #37.
2013-12-15 20:25:15 -08:00
Takatoshi Kondo
b774c07d19 When the compiler is gcc, use memcpy, otherwise use an assignment operator.
The memcpy approach is a workaround for gcc's bug. The speed performance on gcc is the same between both approach. But on clang, the memcpy approach is 10% slower than an assignment approach. Hence I added the switching approach code using compiler checked macro.

Note: __GNUC__ is defined both gcc and clang. So I use __GNUC__ && !__clang__
2013-12-16 13:25:09 +09:00
Takatoshi Kondo
229467cb29 Added a test and speed test examples for #37. 2013-12-08 10:39:13 +00:00
Takatoshi Kondo
949b472f7e Merge pull request #41 from redboltz/old_compiler_bus_error_workaround
Fixed an unused function warning.
2013-11-26 17:31:02 -08:00
Takatoshi Kondo
be67d3e362 Fixed an unused function warning.
This fix is a part of issue #33.
35ba41c245
2013-11-27 10:33:52 +09:00
Vladimir Volodko
2c1a1fd4f8 Add C/C++ FILE* buffer adaptor.
* add function msgpack_fbuffer_write();
* add class msgpack::fbuffer;
* add tests buffer.fbuffer and buffer.fbuffer_c .
2013-11-22 12:57:30 +07:00
Takatoshi Kondo
3e2ae7cc78 Fixed issue #37.
It seems to be gcc's bug.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58416
2013-11-11 09:51:04 +00:00
Nobuyuki Kubota
505660e1fa Merge pull request #35 from redboltz/add_libgtest
Added libgtest.a for make check
2013-10-30 21:44:57 -07:00
Takatoshi Kondo
09d90e1231 Supported 'plain' char.
Note: char, signed char, and unsigned char are three different types.
2013-10-31 13:19:22 +09:00
Takatoshi Kondo
5a9f89ae1f Added libgtest.a for make check 2013-10-29 13:35:26 +09:00
Jens Alfke
6f56345dd8 Fixed unused-function warnings
The function bodies in header files should be declared static inline.
2013-10-22 21:52:13 +00:00
Takatoshi Kondo
edef040688 Merge pull request #34 from redboltz/fix_freed_mem_access
Fixed freed memory accessing bug.
2013-10-22 05:11:42 -07:00
Takatoshi Kondo
9fc196e750 Fixed freed memory accessing bug.
(Issue #32)
2013-10-22 12:46:06 +00:00
Takatoshi Kondo
dc1698eaf4 Merge pull request #31 from redboltz/fix_buffer_leak
Fixed buffer leak bug.

In the case of the function next() returns true:
Whichever the argument result is holding the zone or not, the ownership of the zone always should be delegated from 'unpacker' to 'unpacked'.

In the case of the function next() returns false:
Whichever the argument result is holding the zone or not, the members of 'unpacked' should be reset.
2013-10-14 23:59:04 -07:00
Takatoshi Kondo
53ded063a0 Fixed buffer leak bug. 2013-10-15 11:03:47 +09:00
Takatoshi Kondo
8a2c50c374 Merge pull request #28 from redboltz/solve_narrow_conversion
Added the casts for the byte data.
2013-08-29 21:10:03 -07:00
Takatoshi Kondo
f71148f3a6 Merge pull request #29 from redboltz/add_copyright
Added copyright.
2013-08-29 21:09:08 -07:00
Takatoshi Kondo
172105828c Added copyright. 2013-08-30 13:07:42 +09:00
Takatoshi Kondo
6cca6cb20d Added the casts for the byte data. 2013-08-30 12:57:20 +09:00
Takatoshi Kondo
b7336f817c Merge pull request #27 from redboltz/malloc_free_match
Fixed malloc delete unmatch bug.
2013-08-26 18:56:26 -07:00
Takatoshi Kondo
88356b79be Fixed malloc delete unmatch bug. 2013-08-27 09:37:42 +09:00
Takatoshi Kondo
ce9e543882 Merge pull request #26 from redboltz/add_throw
added return value checking.
2013-08-23 00:34:21 -07:00
Takatoshi Kondo
3ff3ba83f4 added return value checking. 2013-08-23 16:28:02 +09:00
Takatoshi Kondo
edb525a030 Merge pull request #25 from redboltz/typo_fix
fixed a typo in a comment
2013-08-20 17:42:54 -07:00
Takatoshi Kondo
ea5314f076 fixed a typo in a comment 2013-08-21 09:32:51 +09:00
Nobuyuki Kubota
be8e53163b Updated wiki links and removed old message 2013-08-17 19:00:16 +09:00
Nobuyuki Kubota
79151f517f Imported quickstarts from wiki 2013-08-17 18:51:56 +09:00
Nobuyuki Kubota
e8ffe7ef96 Merge pull request #23 from ulikoehler/master
Add README syntax highlighting
2013-08-17 02:32:36 -07:00
Nobuyuki Kubota
b5a7b5e277 Fixed a compile error caused by MSGPACK_ADD_ENUM with msgpack::packer 2013-08-17 18:20:32 +09:00
Nobuyuki Kubota
85b5e1088f str 8 and bin 8/16/32 support in deserializer 2013-08-17 17:24:50 +09:00
Uli Köhler
680ddb1557 Add README syntax highlighting 2013-08-17 03:11:15 +02:00
Nobuyuki Kubota
44fff522bd Merge pull request #17 from grynko/patch-1
Update README.md
2013-07-29 03:33:29 -07:00
grynko
90815f0d27 Update README.md
fix typos
2013-07-02 12:06:14 +03:00
Nobuyuki Kubota
f07950c60a add the same test as commit:764bfdcb9f for __gnu_cxx::__exchange_and_add
refs #8
2013-04-09 18:14:23 -07:00
Nobuyuki Kubota
f8c4125892 Merge branch '__sync_check' of github.com:nori0428/msgpack-c into nori0428-__sync_check 2013-04-09 17:50:08 -07:00
Nobuyuki Kubota
1f30cc203a Temporary fix for a compilation error on OS X
fixes #3
fixes #15
2013-04-09 17:38:49 -07:00
nori0428
764bfdcb9f check whether exists __sync_{sub, add}_and_fetch 2013-03-01 11:08:37 +09:00
Vasily Titskiy
f290814f64 Fix implementation of atomic functions for GCC 3.x
__gnu_cxx::__exchange_and_add returns OLD, not NEW value
2013-01-03 19:28:00 -08:00
Hans Duedal
3a2508545d Fix for mismatched free() / delete / delete[]
When doing streaming deserialization, valgrind complains about mismatched free()...
It's caused by calls to auto_ptr::free for zones that are null pointers.
2013-01-03 19:27:17 -08:00
Nicolas Despres
79a06a338a Remove unused variables. 2013-01-03 19:26:06 -08:00
Nicolas Despres
509f27eee1 cpp: Fix convert.enum_member test (issue #50).
The patch add serialization operator for the given enum to avoid the use
of a cast which leads to strict-aliasing warnings and the test to fail.

Solution suggested by qehgt.
2013-01-03 19:20:07 -08:00
Nobuyuki Kubota
e511c32a36 Imported .gitignore from the original MessagePack git repository
This commit includes a pull request from polrop(ignore-cpp-bootstrapped-files branch).
2013-01-03 19:17:36 -08:00
FURUHASHI Sadayuki
b463d9b687 reorganized tree 2013-01-03 19:13:28 -08:00
FURUHASHI Sadayuki
e96e20ccfd make C/C++ implementation independent from other language implementations 2013-01-03 19:08:11 -08:00
FURUHASHI Sadayuki
06ebdbfd37 updated README.md 2013-01-03 19:04:51 -08:00
FURUHASHI Sadayuki
df9fd047b4 fixed previous commit 2013-01-03 19:00:20 -08:00
FURUHASHI Sadayuki
85d65c59d2 MessagePack for Ruby moved to https://github.com/msgpack/msgpack 2012-12-20 10:39:47 -08:00
FURUHASHI Sadayuki
754126644f ruby: v0.4.8 2012-12-16 17:17:11 -08:00
FURUHASHI Sadayuki
220436f4f9 Merge pull request #123 from brixen/patch-1
Update ruby/compat.h
2012-12-16 16:39:58 -08:00
Brian Ford
b62a6ae1d0 Update ruby/compat.h
The exceptions for Rubinius are unnecessary now and are actually
causing msgpack not to install due to the incorrect function prototypes
that are in this file. In MRI, this is the prototype

  VALUE rb_gc_enable();

Anyway, these are unnecessary for Rubinius.
2012-12-16 16:27:05 -08:00
INADA Naoki
eae0532b8c Split msgpack-php repository. 2012-08-20 22:04:44 +09:00
UENISHI Kota
d642487f99 MessagePack for Erlang moved to https://github.com/msgpack/msgpack-erlang 2012-07-17 22:39:31 +09:00
FURUHASHI Sadayuki
320510506b MessagePack for OCaml moved to https://github.com/msgpack/msgpack-ocaml 2012-07-04 17:40:11 -07:00
FURUHASHI Sadayuki
b2839ac78b MessagePack for Haskell moved to https://github.com/msgpack/msgpack-haskell 2012-07-03 19:14:45 -07:00
FURUHASHI Sadayuki
834d5a0e72 MessagePack for Scala moved to https://github.com/msgpack/msgpack/tree/master/scala 2012-07-03 19:10:28 -07:00
FURUHASHI Sadayuki
13ce808c47 MessagePack for C# was moved to https://github.com/msgpack/msgpack-cli 2012-06-25 18:23:24 -07:00
FURUHASHI Sadayuki
980a6529c1 ruby 0.4.7 2012-05-05 19:40:48 -07:00
FURUHASHI Sadayuki
c92384fe68 ruby: fix ruby/st.h on ruby 1.8 2012-05-05 19:39:50 -07:00
FURUHASHI Sadayuki
9f563f87b9 ruby: fix ruby/st.h on ruby 1.8 2012-05-05 19:26:26 -07:00
INADA Naoki
44f37b8d1b Merge branch 'master' of github.com:msgpack/msgpack 2012-05-01 03:03:21 +09:00
INADA Naoki
5f41c1cf3f Split msgpack-go repository 2012-05-01 03:02:49 +09:00
INADA Naoki
2a664b9ae6 Merge pull request #89 from ngmoco/master
Go string support
2012-04-30 10:05:16 -07:00
INADA Naoki
5456814199 Merge branch 'master' of https://github.com/dgryski/msgpack into go
Conflicts:
	go/pack.go
2012-05-01 01:44:27 +09:00
INADA Naoki
33ceaeb208 Merge pull request #104 from ericliang/master
For go1 release compatiblity with some trivial code refactorations.
2012-04-30 09:37:52 -07:00
FURUHASHI Sadayuki
b33e60b3ae Merge pull request #108 from kou/support-pkg-config
c: supports pkg-config
2012-04-20 19:40:42 -07:00
advect
9dd0a6eb86 php: supported 5.4.x version 2012-04-20 15:29:20 +09:00
Kouhei Sutou
ed6faf4e65 c: supports pkg-config
About pkg-config:

  From http://www.freedesktop.org/wiki/Software/pkg-config

  pkg-config is a helper tool used when compiling applications and
  libraries. It helps you insert the correct compiler options on the
  command line so an application can use gcc -o test test.c
  `pkg-config --libs --cflags glib-2.0` for instance, rather than
  hard-coding values on where to find glib (or other libraries). It is
  language-agnostic, so it can be used for defining the location of
  documentation tools, for instance.

pkg-config is a widely used build helper tool. Major build tools such
as GNU Autoconf, CMake and so on support pkg-config.

MessagePack users can build their software more easily.
2012-04-15 19:21:55 +09:00
Eric Liang
df2ee5de49 fix ENOENT from os to syscall, ditto. 2012-03-31 00:36:47 +08:00
Eric Liang
36fef91a67 fix error for go1 compatiblity 2012-03-31 00:34:23 +08:00
FURUHASHI Sadayuki
3399148d75 Merge pull request #99 from kou/support-mingw
c: supports DLL generation by MinGW
2012-03-21 00:10:49 -07:00
FURUHASHI Sadayuki
0eea92de66 cpp: fixed template generation logic for 0-length classes #101 2012-03-21 00:10:26 -07:00
Masahiro Nakagawa
92975bb21d Merge pull request #103 from dbussink/rubinius_support
Improve Rubinius support for msgpack Ruby gem
2012-03-19 08:12:08 -07:00
Dirkjan Bussink
bf18e04134 Detect whether st.h is present and don't use RUBY_VM as the condition 2012-03-17 12:43:26 +01:00
Dirkjan Bussink
4a0d7f18fd Explicitly state msgpack doesn't modify char* buffers from RSTRING_PTR
From what I could investigate, msgpack doesn't modify char* buffers
obtained from RSTRING_PTR. This means that on Rubinius we don't have to
copy back and forth the buffer to make sure it's also updated on the
Ruby side.

This copying of buffers is a similar problem as the RARRAY_PTR problem,
because it is not safe to expose GC'ed memory on Rubinius to extensions
since it can move due to Rubinius having a moving GC.
2012-03-17 12:40:29 +01:00
Dirkjan Bussink
65c360a2ca Don't use MRI internals in the Ruby extension
Using internals of MRI by using RARRAY_PTR makes it necessary for other
implementations such as Rubinius to continuously copy the structure
returned by RARRAY_PTR back and forth since in Rubinius objects are
layed out differently internally.

Extensions should not depend and use these internal MRI structures if
this is not necessary and when there are API methods that can provide
the same functionality. This makes sure other implementations can also
use the extension without any big problems.

For this reason I also removed the FIXME comment, since that change
would also heavily depend on the internal memory layout of objects on
MRI.
2012-03-17 11:28:19 +01:00
Damian Gryski
71919f7523 go: update unit tests for fixbytes packing bug 2012-02-29 10:36:58 +01:00
Damian Gryski
31a49db68b go: Fix length mask error in []byte packing. 2012-02-28 22:54:54 +01:00
Kouhei Sutou
0d615442ba c: supports DLL generation by MinGW
libtool requires -no-undefined link option to generate a DLL
by MinGW. A DLL should not have any unresolved symbols and
-no-undefined link option declares that the library doesn't
depends on any libraries other than the ones listed on the
command line.

See also: description about -no-undefined option at
http://www.gnu.org/software/libtool/manual/libtool.html#Link-mode
2012-02-27 14:31:37 +09:00
Damian Gryski
8f35dbc306 go: README with installation instructions 2012-02-25 03:11:37 +01:00
Damian Gryski
154bcbc4f7 go: Makefiles not needed any more. 2012-02-25 03:10:06 +01:00
Damian Gryski
c96a39d315 go: Fix unit test for non-deterministic map ordering 2012-02-24 22:52:37 +01:00
Damian Gryski
06ba74c366 go: Updated for weekly.2012-02-22 2012-02-24 22:51:39 +01:00
Muga Nishizawa
8786a8e6e0 deleted .settings directory and .gitignore file 2012-02-09 02:23:25 +09:00
Muga Nishizawa
748236fef0 MessagePack for Java was moved to https://github.com/msgpack/msgpack-java. 2012-02-09 02:21:43 +09:00
INADA Naoki
ae1b06f20b Fix bug on unpacking empty array. 2012-01-28 02:20:39 +09:00
Hideyuki Tanaka
b8aa93ce30 fix decode on bigendian systems 2012-01-26 16:38:27 +09:00
Hideyuki Tanaka
49d40a42f1 fix bug 2011-11-18 17:49:22 +09:00
Hideyuki Tanaka
1845f34b81 change auto-derive behaviour 2011-11-18 16:49:12 +09:00
Hideyuki Tanaka
43903d446a version bump 2011-11-17 18:29:01 +09:00
Hideyuki Tanaka
256da2124b support auto-derive parameterized type 2011-11-17 18:27:37 +09:00
Hideyuki Tanaka
7869e96bac change behaviour of auto-deriver 2011-11-17 17:40:10 +09:00
Hideyuki Tanaka
79b51a6e4b improve and change user data auto-deriver 2011-11-17 17:15:05 +09:00
Hideyuki Tanaka
cad9f6d46e fix dependencies 2011-11-16 14:49:01 +09:00
Scott White
da2960880a adding support for encoding string types and fixed the Pack test. 2011-10-17 13:29:50 -07:00
Fuji Goro
0eacc58e29 Merge branch 'master' of git://github.com/msgpack/msgpack 2011-10-10 16:02:19 -07:00
Fuji Goro
3bec736aee Fix pack/unpack for double on arm-oabi 2011-10-10 10:38:49 -07:00
Hideyuki Tanaka
3241ffd1b4 version bump 2011-08-30 13:58:16 -07:00
INADA Naoki
d0d7b266bc Split msgpack-python to separated repository. 2011-08-21 18:55:16 +09:00
advect
c24948258b php: 0.5.1
Merge pull request #81
Fixed include path for version check. (Contributed by duedal)
2011-08-20 16:40:48 +09:00
Fuji Goro
d36666bd98 Move perl/ to https://github.com/msgpack/msgpack-perl 2011-08-19 12:37:03 +09:00
Fuji Goro
2794b1d310 perl: tiny tweaks 2011-08-19 11:33:46 +09:00
Fuji Goro
f456fa03da perl: encourage to inlining 2011-08-19 11:15:09 +09:00
Fuji Goro
356b7b43f8 perl: add JSON.pm-like interface: Data::MessagePack->new->encode(...) 2011-08-19 10:54:30 +09:00
Fuji Goro
92718e2140 perl: Refactor config vars 2011-08-19 10:49:59 +09:00
Fuji Goro
4021160a64 perl: Performance tweaks for $Canonical 2011-08-19 10:22:28 +09:00
Fuji, Goro
6f043e3326 Merge pull request #82 from cho45/canonical
perl: Implemented canonical mode.
2011-08-18 18:06:54 -07:00
cho45
74b0b1da21 perl: Implemented canonical mode. 2011-08-17 18:32:43 +09:00
Muga Nishizawa
3a5f676687 fixed bug, which is cause of CannotCompileException during compiling primitive-type fields annotated by Nullable 2011-08-09 18:35:42 +09:00
FURUHASHI Sadayuki
4fa7cffc37 fixed sysdep.h 2011-08-09 03:30:56 +09:00
FURUHASHI Sadayuki
79b83e78a5 cpp: version 0.5.7 2011-08-08 23:52:09 +09:00
FURUHASHI Sadayuki
048a3835e7 cpp: -O3 -> -O4 2011-08-08 23:51:12 +09:00
FURUHASHI Sadayuki
4a4891036a ruby: 0.4.6 2011-08-08 23:50:25 +09:00
FURUHASHI Sadayuki
ff00c83f15 ruby: -O4 -> -O3 2011-08-08 23:49:19 +09:00
FURUHASHI Sadayuki
79d31b7452 Merge pull request #76 from bketelsen/master
Update Go support to latest release version (R58)
2011-08-07 12:57:09 -07:00
Fuji, Goro
20cc6f7463 Revert "Changelogging"
This reverts commit ba7183a5b415666a5c7f38e437588ef151be4f8e.
2011-08-07 18:51:34 +09:00
Fuji, Goro
8acabaa135 Revert "SVs with POK and IOK/NOK should be packed as numbers, not strings"
This reverts commit 28f4338a6ca40bff9fb0b0e82f121d395978fa5c.
2011-08-07 18:51:16 +09:00
Fuji, Goro
ba7183a5b4 Changelogging 2011-08-07 18:40:52 +09:00
Fuji, Goro
28f4338a6c SVs with POK and IOK/NOK should be packed as numbers, not strings 2011-08-07 18:36:50 +09:00
Fuji, Goro
800a93a859 Update .gitignore and MANIFEST.SKIP 2011-08-07 18:36:34 +09:00
advect
2e969e3a0a php: 0.5.0
Fix ZEND_DECLARE_MODULE_GLOBALS
Add unpack of template converter (Merge pull request #57 #58 from enfinity/msgpackr)
2011-07-28 08:15:38 +09:00
Muga Nishizawa
3fb31f651d scala: fixed bug within reflection-based beans template builder 2011-07-22 20:36:31 +09:00
Brian Ketelsen
682d25b551 fixed author and updated to r58 or higher 2011-07-21 12:33:44 -04:00
Muga Nishizawa
bcad8d4c4c MSGPACK-27: appended \'synchronized\' to modifiers of TemplateRegistry#unregister ( ) 2011-06-30 10:36:01 +09:00
Muga Nishizawa
96bab8e02e java: Added utilities for unit testing 2011-06-27 11:49:17 +09:00
Muga Nishizawa
fa4a615d0f java: Updated versions of dependencies, which are junit, slf4j-api and slf4j-log4j12 2011-06-27 11:37:48 +09:00
Muga Nishizawa
f1265c4fed java: Merged file in .settings manually 2011-06-27 10:54:32 +09:00
Muga Nishizawa
df01cd9a09 java: changed setting files for Eclipse IDE 2011-06-27 10:51:33 +09:00
FURUHASHI Sadayuki
255bac642d Merge branch 'master' of github.com:msgpack/msgpack 2011-06-26 22:52:06 +09:00
FURUHASHI Sadayuki
6d8c3bd13d use larger buffer size on MessagePack.pack 2011-06-26 22:48:42 +09:00
INADA Naoki
75b8272710 Merge remote-tracking branch 'origin/master' 2011-06-24 00:05:04 +09:00
INADA Naoki
2f80e154f2 (python) Fix typo in ChangeLog 2011-06-24 00:04:43 +09:00
FURUHASHI Sadayuki
cc0114c482 cpp: fixed configure.in for gcc 3.x support 2011-06-12 15:16:13 +09:00
FURUHASHI Sadayuki
e5e2b9095c updated README.md 2011-06-12 14:47:29 +09:00
FURUHASHI Sadayuki
6977edc032 Merge branch 'master' of github.com:msgpack/msgpack 2011-06-12 14:46:39 +09:00
Kazuki Ohta
177cc55ee5 s/msgpack.sourceforge.net/msgpack.org/ 2011-06-12 14:44:57 +09:00
FURUHASHI Sadayuki
feb7ec03ba Merge branch 'master' of github.com:msgpack/msgpack 2011-06-12 14:37:51 +09:00
FURUHASHI Sadayuki
6630a643d3 Merge pull request #51 from polrop/fix-cpp-check-when-builddir-diff-srcdir
Fix make check when builddir != srcdir.
2011-06-11 22:36:25 -07:00
Muga Nishizawa
d70e64a434 Merge branch 'master' of git@github.com:msgpack/msgpack 2011-06-12 02:48:42 +09:00
Muga Nishizawa
896ad51102 java: add missing dependencies for Ant/Ivy builds 2011-06-12 02:48:14 +09:00
inada-n
be6d6560a7 (python) make test pass with Python 2.5 2011-06-01 18:30:43 +09:00
INADA Naoki
709d0cc33e Revert "(python) Change error message for unicode is passed but no encoding is"
This reverts commit bd73742552cf16592662a7ec5ba3608888081131.
2011-05-31 15:40:11 +09:00
INADA Naoki
bd73742552 (python) Change error message for unicode is passed but no encoding is
specified.
2011-05-31 14:10:46 +09:00
INADA Naoki
ed4518e09a Merge branch 'pyunicode' of https://github.com/tailhook/msgpack 2011-05-31 13:03:41 +09:00
Vasily Titskiy
6c8301eae8 Merge branch 'gcc-3.x-support' 2011-05-26 13:31:59 -04:00
Vasily Titskiy
6e30d504e3 Merge branch 'fix-unaligned-access' 2011-05-26 13:31:37 -04:00
Vasily Titskiy
cee09a0261 Add support for GCC 3.x (no _sync* atomic builtins)
Use atomic routines from libstdc++ instead.
2011-05-26 13:27:25 -04:00
Vasily Titskiy
76a72558b3 Fix all unaligned writes on ARM platform 2011-05-26 13:03:57 -04:00
FURUHASHI Sadayuki
22124a33ce java: DefaultTemplate: uses lookupType.toString() instead of lookupType.getClass().getName() 2011-05-18 02:09:29 +09:00
FURUHASHI Sadayuki
3731373de1 ruby: 0.4.5 2011-05-09 22:35:35 +09:00
FURUHASHI Sadayuki
bbaf8c2f67 ruby: FIXNUM_P(self) may be false in Fixnum on JRuby 2011-05-09 22:06:12 +09:00
FURUHASHI Sadayuki
f50694cc96 ruby: improves compatibility with JRuby 2011-05-09 21:59:55 +09:00
Nicolas Despres
4930ea7dab Fix make check when builddir != srcdir.
make check was not able to compile test programs when the builddir is not
the same than the srcdir, because relative path were used.
2011-04-28 16:11:24 +02:00
takeshita
96bb4cf49d pom.xmlを修正 2011-04-27 12:24:47 +09:00
takeshita
5e7563ac5b Merge branch 'master' of git://github.com/msgpack/msgpack
Conflicts:
	java/pom.xml
2011-04-27 01:07:17 +09:00
takeshita
f199b80453 Fix big bug.
I had gotten order of MessagePackObject field from order of reflection methods.But it changes depends on order of calling in some environment(Scala's optimization or Java's specification?).
So I change to get it from order of reflection fields.
2011-04-27 01:04:49 +09:00
Kazuki Oikawa
5de8eec206 Merge branch 'master' of git://github.com/kazuki/msgpack 2011-04-24 02:02:35 +09:00
frsyuki
076bd07f39 cpp: version 0.5.6 2011-04-24 00:23:08 +09:00
FURUHASHI Sadayuki
00e897503b java: fixes typo on CHANGES.txt 2011-04-24 00:11:34 +09:00
FURUHASHI Sadayuki
2f3c47f385 java: version 0.5.2-devel 2011-04-23 23:57:27 +09:00
Muga Nishizawa
2b28211701 MSGPACK-6 added new TemplatePrecompiler function 2011-04-23 22:47:44 +09:00
Muga Nishizawa
46c794fc2e java: added test program for TemplatePrecompiler 2011-04-23 22:37:08 +09:00
Muga Nishizawa
0408738b48 java: write test program for TemplatePrecompiler 2011-04-23 19:19:05 +09:00
Kazuki Oikawa
6cfea98501 csharp: add license, rename filename/namespace. 2011-04-23 14:44:22 +09:00
Kazuki Oikawa
33498d3673 csharp: Refactoring IL code generator & add two compiled packer implementation (dynamic-method, method-builder) 2011-04-23 14:14:12 +09:00
takeshita
ed3ead06fe Implement array message pack 2011-04-20 20:35:23 +09:00
frsyuki
eb8a338a0e cpp: unpacker::release_zone() calls msgpack_unpacker_release_zone() #42 2011-04-17 08:25:55 +09:00
frsyuki
23480bfe8a cpp: fixed missing ctx.user.z = z and release_zone uses pointer swapp instead of copying #42 2011-04-17 08:24:33 +09:00
frsyuki
3384dbc92d cpp: fixes test/streaming_c.cc #42 2011-04-17 08:21:52 +09:00
frsyuki
8446549ed8 Merge branch 'master' of github.com:msgpack/msgpack 2011-04-17 06:49:36 +09:00
frsyuki
6a9f3ae71d c: fixed a double-free problem on msgpack_unpacker_release_zone #42 (aikar++) 2011-04-17 06:48:36 +09:00
Kazuki Oikawa
94e5b0d78f csharp: fix char pack/unpack problem on Mono 2011-04-17 00:33:37 +09:00
Kazuki Oikawa
0812eb1c04 add System.Reflection.Emit based CompiledPacker implementation 2011-04-16 21:12:04 +09:00
tailhook
8cb5ccad99 Implemented encoding for strings
* Packer by default uses `utf-8` encoding by default
* Unpacker uses `None` by default, so no decoding is done
* Both pack and unpack has `encoding` and `unicode_errors` arguments,
  if `encoding` is `None` no encoding/decoding is done, otherwise
  it is python codec. `unicode_errors` is supplied as `errors`
  parameter to codec
2011-04-15 18:39:17 +03:00
takeshita
743d69ec0b Change property ordering based on getter methods to setter methods.
Add test to confirm field order.
2011-04-14 16:34:52 +09:00
takeshita
f6de4c9479 Merge branch 'master' of git://github.com/msgpack/msgpack 2011-04-14 15:44:46 +09:00
takeshita
fb59927d32 scala:Fix bug when companion class does not have apply() method, scala message pack throws exception. 2011-04-14 15:44:22 +09:00
FURUHASHI Sadayuki
c58ce1a975 MSGPACK-7 added -source 1.5 -target 1.5 options to javac 2011-04-12 18:41:08 +09:00
FURUHASHI Sadayuki
c6d9bbd7b0 MSGPACK-7 fixed test cases; iteration order of HashMap is not defined by JDK 5/6 specification 2011-04-12 18:39:54 +09:00
Kazuki Oikawa
08974f00ed Merge branch 'master' of github.com:kazuki/msgpack 2011-04-10 14:24:26 +09:00
Kazuki Oikawa
60643f023f csharp: add ObjectPacker 2011-04-10 12:52:14 +09:00
Muga Nishizawa
65ddd1a455 java: add test program for TemplatePrecompiler 2011-04-10 02:33:46 +09:00
Kazuki Oikawa
68a98d3dd0 csharp: remove reference Microsoft.VisualStudio.QualityTools.UnitTestFramework 2011-04-10 02:03:40 +09:00
Kazuki Oikawa
ca9015452e csharp: add Makefile 2011-04-10 01:38:03 +09:00
Kazuki Oikawa
05ac2603e6 csharp: add BoxingPacker tests 2011-04-10 01:06:26 +09:00
Kazuki Oikawa
8e923777b8 csharp: fix fixraw prefix 2011-04-09 22:16:24 +09:00
Kazuki Oikawa
8949551c2e Add MsgPackReader/MsgPackWriter unit tests 2011-04-09 22:12:44 +09:00
Kazuki Oikawa
0b45e9442b csharp: add type check helper 2011-04-09 21:22:15 +09:00
Kazuki Oikawa
1d1a9d7933 import C# implementation 2011-04-09 21:17:05 +09:00
Muga Nishizawa
58c0fe0f91 java: Refactored template builders again 2011-04-09 21:10:15 +09:00
Muga Nishizawa
b96b62f2ac scala: deleted the AUTHORS file 2011-04-08 16:20:28 +09:00
Muga Nishizawa
43fc0a52a6 scala: added a new AUTHORS file and edited pom.xml 2011-04-08 16:17:25 +09:00
Muga Nishizawa
4f3d9a1ded Refactored programs related to TemplateBuilder.java 2011-04-08 16:13:29 +09:00
FURUHASHI Sadayuki
b50ff920f0 MSGPACK-5 added test cases for Unpacker.unpackXxx() methods 2011-04-07 23:21:56 +09:00
FURUHASHI Sadayuki
983ae0c5a2 MSGPACK-4 BufferedUnapckerImpl.unpackInt: more(4)+advance(4) -> more(5)+advance(5) 2011-04-07 23:21:30 +09:00
FURUHASHI Sadayuki
9d4db84987 MSGPACK-4 BufferedUnpackerImpl.unpackLong: more(4)+advance(4) -> more(5)+advance(5) 2011-04-07 22:32:59 +09:00
takeshita
1f372cf0cc Merge branch 'master' of github.com:geishatokyo/msgpack
Conflicts:
	java/src/main/java/org/msgpack/template/TemplateClassWriter.java
2011-04-07 01:07:10 +09:00
takeshita
c43d597aa9 pom.xmlファイルを修正。 2011-04-07 01:04:29 +09:00
Muga Nishizawa
dfaa281476 java: Fixed TemplateClassWriter.java but, it doesn't work. 2011-04-07 00:38:21 +09:00
takeshita
df14629a25 Fix compile error.
This is a workaround.Please fix correctly in the future.
2011-04-07 00:07:49 +09:00
Muga Nishizawa
c1c25c455c scala: Modified pom.xml. I changed version of 'MessagePack for Java' from 0.5.1-devel to 0.5.2-SNAPSHOT 2011-04-06 08:52:14 +09:00
Muga Nishizawa
e65197f386 Merge branch 'master' of https://github.com/watabiki/msgpack 2011-04-06 01:18:12 +09:00
Muga Nishizawa
ecbb8f8711 java: Merged takezoux2's branch for 'MessagePack for Scala' 2011-04-06 00:50:58 +09:00
Watabiki Naoya
03aa736199 java: update BigDecimalTemplate, TestPackConvert and TestPackUnpack 2011-04-05 23:26:53 +09:00
Muga Nishizawa
821b1f0384 Merge branch 'master' of git@github.com:msgpack/msgpack 2011-04-05 03:35:08 +09:00
Muga Nishizawa
233ad3aaff java: Updated several property files in .settings 2011-04-05 03:34:11 +09:00
Muga Nishizawa
9c4812f4d4 java: Fixed RawType's bug that hash values of same byte arrays (raw data) are different 2011-04-05 03:30:43 +09:00
Muga Nishizawa
337cc9fa78 java: Fixed a bug that NullPointerException occurs within DefaultTemplate.java 2011-04-05 01:27:51 +09:00
Muga Nishizawa
dfe29a0329 Merge branch 'master' of git@github.com:msgpack/msgpack 2011-04-05 00:52:30 +09:00
Muga Nishizawa
85e90aa81e java: Improved DefaultTemplate.java. It allows displaying details of exception messages 2011-04-05 00:51:53 +09:00
Hideyuki Tanaka
86d30fe571 haskell: reduce dependency of template-haskell 2011-04-04 23:33:02 +09:00
mzp
173302267f ocaml: upadte build file 2011-04-04 18:28:37 +09:00
Muga Nishizawa
8e3ea8d26c java: edit TemplateRegistry.java 2011-04-04 02:28:24 +09:00
Muga Nishizawa
cb065563c2 Merge branch 'master' of git@github.com:msgpack/msgpack 2011-04-04 01:59:34 +09:00
Muga Nishizawa
27b89b237b java: prototyped TemplateClassWriter, which is program for writing class file of generated tmplate class 2011-04-04 01:59:13 +09:00
takeshita
21f0d0bfc4 Delete moved class.
(TemplateBuilder.java is moved to org.msgpack.template.builder)
2011-04-04 01:46:29 +09:00
takeshita
d5e583b09e Implement Scala MessagePack.
Change Java MessagePack to fit Scala's.
Minor version up for Java's MessagePack.
2011-04-04 01:37:24 +09:00
UENISHI Kota
15fb9bbcb2 Merge branch 'master' of https://github.com/moriyoshi/msgpack 2011-04-03 19:52:34 +09:00
Muga Nishizawa
a03418ab12 java: edit BuiltInTemplateLoader.java 2011-04-03 19:42:43 +09:00
Muga Nishizawa
035513844d Merge branch 'master' of git@github.com:msgpack/msgpack 2011-04-03 19:11:56 +09:00
Muga Nishizawa
193906b8ce java: insert codes for initializing BigDecimalTemplate and DateTemplate instances to Templates.java 2011-04-03 19:10:34 +09:00
Moriyoshi Koizumi
d354f2e8c2 Documentation. 2011-04-03 19:09:14 +09:00
Watabiki Naoya
24a8ee436f add DateTemplate and BigDecimalTemplate 2011-04-03 18:39:41 +09:00
mzp
6e5f9404b7 ocaml: initial commit 2011-04-03 17:11:53 +09:00
Moriyoshi Koizumi
64fe90aabb Add TestUnpackFloat(). 2011-04-03 15:34:37 +09:00
Moriyoshi Koizumi
7e31d487e0 float type was gone from go language at some time I don't know. 2011-04-03 14:06:08 +09:00
moriyoshi
ee16e2eb30 Handle unsupported typecode 2011-04-03 11:14:49 +09:00
moriyoshi
003fb3392f Byte arrays in Go should not be serialized as arrays. 2011-04-03 11:14:49 +09:00
moriyoshi
0e82278cd5 Fix: InterfaceValue wasnt' correctly unwrapped when passed to PackValue() 2011-04-03 11:14:49 +09:00
moriyoshi
5b544248bc Add new API function UnpackReflected() that returns multiple reflect.Value for unpacked elements of arrays or maps. 2011-04-03 11:14:49 +09:00
moriyoshi
d4d7495c0a Forgot to support map16 / map32 2011-04-03 11:14:48 +09:00
moriyoshi
8325cce44c Adapt to new reflection API (notified by mattn. thanks) 2011-04-03 11:14:48 +09:00
moriyoshi
ee0debc5b3 Add .gitignore 2011-04-03 11:14:48 +09:00
moriyoshi
8f1bd12a17 Improve testsuite. 2011-04-03 11:14:10 +09:00
moriyoshi
fccf1016e4 Fix bugs in unpacker. 2011-04-03 11:14:10 +09:00
moriyoshi
1b010a082b Add go binding. 2011-04-03 11:14:10 +09:00
Hideyuki Tanaka
324f215316 haskell: version bump 2011-03-29 16:17:46 +09:00
Hideyuki Tanaka
ace4f1e7f0 fix encoding unicode strings, and Text support 2011-03-29 16:15:29 +09:00
Hideyuki Tanaka
5c5f16f148 haskell: version bump 2011-03-18 00:46:43 +09:00
Hideyuki Tanaka
f50855d5c0 fix for packing and unpacking Object 2011-03-18 00:44:15 +09:00
Muga Nishizawa
86917b0ba7 improved constructor in JavassistTemplateBuilder class. This improvement is based on https://github.com/msgpack/msgpack-rpc/issues#issue/13. 2011-03-11 12:24:09 +09:00
Hideyuki Tanaka
7201fcbe0f remove Iteratee dependency 2011-03-10 22:17:15 +09:00
Hideyuki Tanaka
83f1735fbb fix description 2011-03-09 18:06:57 +09:00
Hideyuki Tanaka
80fd8e70f0 update library version. 2011-03-09 17:02:01 +09:00
Hideyuki Tanaka
698c1c2b7a Merge git://github.com/xanxys/msgpack into pull-master 2011-03-09 16:19:19 +09:00
Yuto Hayamizu
5d3287f5aa gtest requires pthread 2011-03-03 06:42:14 +09:00
Yuto Hayamizu
6990fe6f51 remove duplicated code 2011-03-03 06:38:09 +09:00
Yuto Hayamizu
0b81068368 /cpp/preprocess: fix string comp. operator 2011-03-03 06:27:31 +09:00
FURUHASHI Sadayuki
5b1851ae22 cpp: version 0.5.5 2011-02-24 00:35:00 +09:00
FURUHASHI Sadayuki
0d5708a01d cpp: fixes problem that InterlockedIncrement/Decrement are not found on _WIN32 platform 2011-02-24 00:21:54 +09:00
FURUHASHI Sadayuki
67ab510b5d cpp: fixes some implicit cast warnings 2011-02-23 23:48:26 +09:00
FURUHASHI Sadayuki
d1264a1289 cpp: fixes msgpack_vc.postbuild.bat 2011-02-23 23:47:33 +09:00
FURUHASHI Sadayuki
3b973021a1 sysdep.h: eliminated #include <winsock2.h> 2011-02-23 23:46:39 +09:00
INADA Naoki
182624895f python: Remove UnpackIterator. Unpacker is iterator of itself. 2011-01-30 10:45:39 +09:00
INADA Naoki
548de3739c python: Disable gc while deserializing. 2011-01-29 23:23:56 +09:00
INADA Naoki
718a3efd64 python: Fix segmentation fault when default returns it's argument. 2011-01-29 23:22:41 +09:00
INADA Naoki
76b8c3250b Merge branch 'master' of github.com:msgpack/msgpack 2011-01-29 07:31:59 +09:00
INADA Naoki
dafaa8bd8c python: 0.1.9 2011-01-29 07:31:06 +09:00
INADA Naoki
9c9b2c25ea python: refactoring. 2011-01-29 07:27:10 +09:00
INADA Naoki
e89cd81022 Add use_list option to unpack and unpackb 2011-01-28 18:59:05 +09:00
advect
5debbd2be8 php: added unpack of class object converter 2011-01-16 17:35:10 +09:00
INADA Naoki
fe26df5355 python: Add memory error check. 2011-01-10 20:47:23 +09:00
INADA Naoki
85778494e4 python: Check if (m|re)alloc's return value is NULL. (Thanks to Mateusz) 2011-01-10 05:07:07 +09:00
INADA Naoki
a94ce3c715 python: Fix typo in docstring. (thanks to Mateusz.) 2011-01-10 05:05:14 +09:00
INADA Naoki
a440ff1117 python: Change URL in setup.py from sf.net to msgpack.org 2011-01-10 00:10:29 +09:00
INADA Naoki
8195137bc5 python: msgpack-python-0.1.8 2011-01-09 23:58:26 +09:00
INADA Naoki
3e2bd25e4e python: Fix another segv. 2011-01-09 23:54:06 +09:00
INADA Naoki
ffd0c2f624 python: Fix segv on unpacking from stream. 2011-01-09 23:40:09 +09:00
INADA Naoki
23333c98d7 python: Add test for issue29. 2011-01-09 23:29:18 +09:00
INADA Naoki
5a12ab98c4 python: Make aliases for API compatibility to pickle.
``dumps`` is alias of ``packb`` and ``loads`` is alias of ``unpacks``.
2011-01-09 23:17:20 +09:00
INADA Naoki
0b327a63fc python: Don't use `from __future__ import unicode_literals`.
Python 2.5 or older doesn't support it.
2011-01-09 23:13:35 +09:00
INADA Naoki
15b28a245c python: Update ChangeLog. 2011-01-09 23:06:56 +09:00
INADA Naoki
6ef5684797 Merge branch 'master' of github.com:msgpack/msgpack 2011-01-08 17:45:13 +09:00
xanxys
d439b1495b haskell: add ObjectFloat to send floats, and Assoc to make map (un)packing explicit 2010-12-28 19:22:37 +09:00
advect
9e096a3f0e php: version 0.3.4: supported Windows building 2010-12-28 16:09:13 +09:00
advect
0acf6ec150 php: version 0.3.3 2010-12-27 11:09:14 +09:00
Muga Nishizawa
4b36340474 java: refactor JavassistTemplateBuilder.java 2010-12-23 15:51:04 +09:00
FURUHASHI Sadayuki
910e642a8b java: version 0.5.1 2010-12-14 18:21:53 +09:00
FURUHASHI Sadayuki
9f571146fb java: fixes cast error on GenericArrayType 2010-12-14 17:47:45 +09:00
FURUHASHI Sadayuki
339725f73d java: throws MessagePackException if target==null on *ArrayTemplate 2010-12-13 18:52:25 +09:00
Muga Nishizawa
aff964c58b java: fixed a bug within CollectionTemplate.java 2010-12-12 00:48:31 +09:00
Muga Nishizawa
0c07e745f8 java: change spec. of pack methods in ListTemplate and MapTemplate as follow: If user passes null object to the pack method, MessageTypeException is thrown. 2010-12-12 00:47:20 +09:00
Muga Nishizawa
419d2e9564 java: change spec. of pack methods in several template classes as follow: If user passes null object to the pack method, MessageTypeException is thrown. 2010-12-12 00:46:05 +09:00
Muga Nishizawa
f936a307c6 java: add test methods for CollectionTemplate and change spec. of several test methods 2010-12-12 00:38:13 +09:00
Muga Nishizawa
4e4678edfa java: add packByteBuffer method in Packer.java because I needed non-nullcheck pack(ByteBuffer) for refining ByteBufferTemplate.java 2010-12-12 00:35:43 +09:00
FURUHASHI Sadayuki
cb7a4b3116 java: version 0.5.0 2010-12-09 23:36:27 +09:00
FURUHASHI Sadayuki
5ca4c42a74 Merge branch 'master' of github.com:msgpack/msgpack 2010-12-09 23:28:23 +09:00
FURUHASHI Sadayuki
1238a7ca07 java: adds AUTHORS file 2010-12-09 23:28:16 +09:00
Muga Nishizawa
a9db60a73d java: replace reflective method calls with base-level method calls in JavassistTemplateBuilder.java 2010-12-09 23:25:11 +09:00
FURUHASHI Sadayuki
bd32ac19d4 java: removes old benchmark codes 2010-12-09 23:01:04 +09:00
FURUHASHI Sadayuki
eaf9944e43 java: added ElementType.PARAMETER to the target of @Ignore, @Index, @Nulable, @Optional and @Required annotations for RPC 2010-12-09 17:31:29 +09:00
FURUHASHI Sadayuki
703fdbc01d java: array type support 2010-12-08 19:38:12 +09:00
FURUHASHI Sadayuki
2daa08b0e7 java: disabled ObjectArrayTempalte - it doesn't work 2010-12-06 00:13:05 +09:00
FURUHASHI Sadayuki
05d9d22d9e java: fixes native zero-copy unpacking routines of ByteBuffer 2010-12-03 22:56:04 +09:00
FURUHASHI Sadayuki
8b7894f9bd java: fixes comments in TemplateBuffer.java 2010-12-03 22:54:20 +09:00
Muga Nishizawa
a71439607f java: performance improvement for ByteBufferTemplate 2010-12-03 21:53:29 +09:00
Muga Nishizawa
aca0d7f969 java: refactor ByteBufferTemplate.java 2010-12-02 01:11:55 +09:00
Muga Nishizawa
310a8e4342 Merge branch 'master' of git@github.com:msgpack/msgpack
Conflicts:
	java/src/main/java/org/msgpack/MessagePack.java
2010-12-02 00:54:28 +09:00
FURUHASHI Sadayuki
24fbe1ef5b java: uses ReflectionTemplateBuilder instead of JavassistTempalteBuilder where System.getProperty("java.vm.name") == "Dalvik" 2010-12-01 23:27:36 +09:00
FURUHASHI Sadayuki
33d8faa35d java: JavassistTemplateBuilder: fixes comments 2010-12-01 23:15:55 +09:00
FURUHASHI Sadayuki
44be714f65 java: adds JavassistTemplateBuilder.addClassLoader method 2010-12-01 22:59:33 +09:00
FURUHASHI Sadayuki
0df3da6b10 java: adds TemplateRegistry.setTemplateBuilder method 2010-12-01 22:59:20 +09:00
FURUHASHI Sadayuki
79197b6ec7 java: more test cases of TemplateBuilder 2010-12-01 22:44:38 +09:00
FURUHASHI Sadayuki
353b6b51cb java: adds TemplateBuildException 2010-12-01 22:44:24 +09:00
FURUHASHI Sadayuki
bd9a2c0d3a java: migrates from util.codegen to TemplateBuilder 2010-12-01 22:42:55 +09:00
Muga Nishizawa
53b0ee6536 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-12-01 21:20:10 +09:00
FURUHASHI Sadayuki
78daac0f1b java: adds type.RawTemplate 2010-12-01 20:49:41 +09:00
FURUHASHI Sadayuki
b970b9b9a8 java: adds JavassistTemplateBuilder 2010-12-01 20:39:11 +09:00
FURUHASHI Sadayuki
0339db57f1 java: adds TemplateBuilder and ReflectionTemplateBUilder 2010-12-01 20:38:58 +09:00
FURUHASHI Sadayuki
461b147897 java: uses TemplateRepostry as default 2010-12-01 20:37:32 +09:00
FURUHASHI Sadayuki
a3cd13b399 java: adds actual generic templates 2010-12-01 20:36:52 +09:00
FURUHASHI Sadayuki
eb5d326a1e java: adds GenericTemplates 2010-12-01 20:34:33 +09:00
FURUHASHI Sadayuki
cce6eb94e2 java: adds DefaultTemplate 2010-12-01 20:34:23 +09:00
FURUHASHI Sadayuki
8311c72c69 java: adds BultInTemplateLoader 2010-12-01 20:33:38 +09:00
FURUHASHI Sadayuki
9a059285d9 java: registers buit-in templates to TemplateRegistry 2010-12-01 20:32:22 +09:00
FURUHASHI Sadayuki
469ac7891d java adds TemplateRegistry that replaces CustomMessage 2010-12-01 20:25:06 +09:00
FURUHASHI Sadayuki
16264a5693 java: adds array templates 2010-12-01 20:24:36 +09:00
FURUHASHI Sadayuki
6eedb50f56 java: adds TemplateBuilder and ReflectionTemplateBuilder 2010-11-30 21:59:07 +09:00
FURUHASHI Sadayuki
5f07215662 java: adds @Requred, @Ignore and @Index annotations 2010-11-30 21:58:24 +09:00
FURUHASHI Sadayuki
d3a02fb2ca java: @MessagePackMessage(default field option) 2010-11-30 21:57:12 +09:00
FURUHASHI Sadayuki
2c823f1aaa java: uses bit shift operations instead of ByteBuffer.putXxx 2010-11-30 21:55:45 +09:00
FURUHASHI Sadayuki
706293aadc java: adds type.Raw 2010-11-30 15:34:32 +09:00
FURUHASHI Sadayuki
dfdceb4258 java: updates VectoredByteBuffer 2010-11-29 18:37:47 +09:00
FURUHASHI Sadayuki
0014b7fdb9 java: adds VectoredByteBuffer 2010-11-29 18:01:39 +09:00
FURUHASHI Sadayuki
3b28f1f8af ruby: buffer size limit (disabled at present) 2010-11-28 23:13:53 +09:00
FURUHASHI Sadayuki
c689d476ca Merge remote branch 'egtra/master' 2010-11-24 18:05:50 +09:00
FURUHASHI Sadayuki
cc534fd21f ruby: adds Unpacker#feed_each 2010-11-24 17:24:55 +09:00
egtra
124efcf247 improve msvc support 2010-11-23 23:32:55 +09:00
Muga Nishizawa
dd452b05e3 java: rollback MessagePack.java 2010-11-19 02:57:42 +09:00
Muga Nishizawa
b5617f7df9 java: refactor register method in MessagePack.java for TemplateProvider 2010-11-19 01:58:30 +09:00
Muga Nishizawa
b73ca1ba3a java: edit MessagePack.java for TemplateProvider 2010-11-19 01:46:31 +09:00
Muga Nishizawa
39ad071c4f java: fixed a bug that javassist cannot find class files that were loaded by custom class loader 2010-11-18 22:26:58 +09:00
Muga Nishizawa
fa0b576a45 java: Fixed a bug that ClassTemplate cannot pack a ByteBuffer object but, it is a temporary impl. 2010-11-11 13:38:15 +09:00
frsyuki
c2c7591987 java: version 0.4.3-devel 2010-11-10 00:54:49 +09:00
frsyuki
3e939e3775 java: fixes MessagePackObject.convert(Template, T) 2010-11-10 00:53:15 +09:00
frsyuki
f6384e10bc java: adds test for DynamicOrdinalEnumTemplate 2010-11-10 00:32:25 +09:00
frsyuki
c283842563 java: MessagePackOptional -> Optional, MessagePackNullable -> Nullable 2010-11-10 00:16:23 +09:00
frsyuki
1135976225 java: adds MessagePack.unpack(Class<?>, FieldList) 2010-11-09 23:51:58 +09:00
frsyuki
76679d33df java: changes Template interface: unpack(Unpacker, Object to = null), convert(MessagePackObject from, Object to = null) 2010-11-09 23:43:16 +09:00
frsyuki
e9d44b90bc java: adds FieldList class 2010-11-09 22:11:47 +09:00
Muga Nishizawa
8a7a391166 java: delete ByteBufferTemplate.java in org.msgpack.util.codegen package 2010-11-09 10:13:55 +09:00
Muga Nishizawa
d6c5a9eece delete a dead code within DynamicCodeGen.java 2010-11-09 09:57:23 +09:00
Muga Nishizawa
56ad6915d0 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-11-09 09:28:38 +09:00
frsyuki
466c260782 java: version 0.4.2-devel 2010-11-09 03:16:00 +09:00
frsyuki
d8e2d1725a java: MessagePack.unpack(InputStream) throws IOException 2010-11-09 02:57:49 +09:00
frsyuki
33b43d03ac java: adds MessagePackNullable annotation 2010-11-09 02:46:23 +09:00
frsyuki
517509db6e java: adds NullableTemplate 2 2010-11-09 02:07:53 +09:00
frsyuki
95f01a5976 java: adds MessagePackObject.unpack(Class<T> klass) 2010-11-09 02:07:50 +09:00
frsyuki
d08d3bf56d java: adds NullableTemplate 2010-11-09 01:07:25 +09:00
frsyuki
587fd669e8 java: adds ByteBufferTemplate 2010-11-08 23:20:27 +09:00
Muga Nishizawa
e3553b87fe java: move ByteBufferTemplate.java to org.msgpack.util.codegen package 2010-11-06 11:31:40 +09:00
Muga Nishizawa
a078d2360c java: add temporal implementation of ByteBufferTemplate.java 2010-11-06 00:59:32 +09:00
frsyuki
2d3abf8e6e java: version 0.4.1-devel 2010-11-05 19:21:27 +09:00
Muga Nishizawa
cacae0fb7d java: refactor DynamicCodeGen.java and Constants.java. Thanks frsyuki for fixing a bug in DynamicCodeGen.java 2010-11-04 02:00:34 +09:00
INADA Naoki
d7fc215c16 python: 0.1.7 2010-11-03 03:43:49 +09:00
INADA Naoki
bb69aa18f2 python: Add ws2_32 library if platform is win32. 2010-11-03 03:35:52 +09:00
INADA Naoki
e4f515166a python: Add ChangeLog.rst 2010-11-03 03:26:33 +09:00
INADA Naoki
f325acb0ea Merge branch 'master' of github.com:msgpack/msgpack 2010-11-03 03:19:28 +09:00
INADA Naoki
d1b6e65dd8 python: Port some tests from 2 to 3. 2010-11-03 03:15:12 +09:00
INADA Naoki
4688252bd4 python: Support old buffer protocol when unpack. (experimental) 2010-11-03 03:11:00 +09:00
INADA Naoki
b1df5d3ad7 python: Add test for unpacking buffer object. 2010-11-02 14:09:50 +09:00
INADA Naoki
09bad2938e python: Add msgpack/_msgpack.c to .gitignore 2010-11-02 14:02:10 +09:00
advect
bad69fd397 php: fiexed unpacker 2010-10-30 16:06:50 +09:00
Fuji, Goro
b4ae6bf82c perl: disable warnings 2010-10-30 13:04:30 +09:00
Fuji, Goro
eac0f83864 perl: check data strictly; which is slow, but required 2010-10-30 12:38:32 +09:00
Fuji, Goro
3f16f080ac perl: add failing tests for PP 2010-10-30 01:09:12 +09:00
Fuji, Goro
5de2b974fb perl: ord(substr(...)) *is* faster than unpack() 2010-10-30 00:42:00 +09:00
Fuji, Goro
6a9cb51828 perl: modify internal names for the next refactoring 2010-10-30 00:31:41 +09:00
Fuji, Goro
f1c294ca50 perl: make error messages compatible with XS 2010-10-30 00:28:53 +09:00
Fuji, Goro
c320e44a23 perl: update Unpacker.pod 2010-10-28 17:26:04 +09:00
Fuji, Goro
ea36ef3107 perl: tests 2010-10-28 17:05:41 +09:00
Fuji, Goro
fedc37d079 Revert "perl: cleanup"
This reverts commit bc8d8ab65a0f0cecfa5af03b4c3b39a13da22a7b.
2010-10-28 16:31:19 +09:00
Fuji, Goro
86ccfcc03c perl: changelogging 2010-10-28 16:25:19 +09:00
Fuji, Goro
bc8d8ab65a Revert "Revert "perl: cleanup""
This reverts commit a7a23d3bc8bb7a5c156becb3b8a43e296986f42e.
2010-10-28 16:17:53 +09:00
Fuji, Goro
a7a23d3bc8 Revert "perl: cleanup"
This reverts commit 82d33944e6f0ee1f98791e41feb06d0d665abfb6.
2010-10-28 16:16:12 +09:00
Fuji, Goro
82d33944e6 perl: cleanup 2010-10-28 16:08:20 +09:00
Fuji, Goro
8a629ad6fb Fix streaming unpacking for splitted packed data 2010-10-28 15:49:22 +09:00
INADA Naoki
e1711ffcf2 Add list_hook option to unpacker. 2010-10-26 02:09:52 +09:00
INADA Naoki
063d51c662 Add check for recursion limit and default hook result. 2010-10-26 01:49:00 +09:00
INADA Naoki
d8e3575a46 Remove unnecessary refcount manipulation. 2010-10-26 01:32:08 +09:00
INADA Naoki
6fa609be3f Add test for Python3. 2010-10-26 01:31:27 +09:00
INADA Naoki
70982e204c Add object_hook option to unpack and default option to pack.
(see simplejson for how to use).
2010-10-26 01:26:06 +09:00
frsyuki
2af7df5865 java: fixes MessagePack.unpack method 2010-10-25 14:49:14 +09:00
frsyuki
59610e81de java: DynamicCodeGen::insertCodeOfUnpackMethodBody unpacks last optional field of classes correctly 2010-10-25 14:18:41 +09:00
Muga Nishizawa
cdfac703ef java: merge CustomMessage.java and DynamicCodeGenBase.java that can be not merged automatically 2010-10-24 23:24:27 +09:00
Muga Nishizawa
ad5ebd007e java: refactor org.msgpack.util.codegen.*.java 2010-10-24 23:10:07 +09:00
frsyuki
1bd347d997 java: fixes CustomMessage class 2010-10-24 21:17:19 +09:00
frsyuki
147056073d java: improves test case of the MessagePack class 2010-10-24 21:04:31 +09:00
frsyuki
1b3231e617 java: improves test case of the MessagePack class 2010-10-24 20:59:19 +09:00
frsyuki
7ac4ad3e38 java: adds MessagePack.register methods 2010-10-24 20:46:22 +09:00
frsyuki
0a345cb12b java: fixes CollectionTemplate 2010-10-24 20:16:37 +09:00
frsyuki
19ff0dd17f java: fixes ListTemplate and MapTemplate 2010-10-24 20:11:39 +09:00
frsyuki
e3bf8a404b java: adds MessagePack class 2010-10-24 19:32:45 +09:00
frsyuki
dbb28d9a8f java: Template extends MessagePacker 2010-10-24 18:46:48 +09:00
frsyuki
19fd4e755c java: removes ReflectionPacker and ReflectionTemplate (replaced by DynamicCodeGen) 2010-10-24 18:45:58 +09:00
Muga Nishizawa
77698cd924 java: change modifiers specified by several methods 2010-10-24 00:59:14 +09:00
Muga Nishizawa
945d279f28 java: fix a bug within a code of DynamicCodeGenBase.java 2010-10-24 00:40:58 +09:00
Muga Nishizawa
645d296841 java: add test programs for org.msgpack.util.codegen.FieldOption.java 2010-10-23 23:13:54 +09:00
Muga Nishizawa
57446de875 java: refactor org.msgpack.util.codegen.*.java 2010-10-23 23:13:17 +09:00
Muga Nishizawa
3473800ab6 java: not use a putIfAbsent method in ConcurrentHashMap class 2010-10-23 23:11:52 +09:00
Muga Nishizawa
7e5c5153a8 java: edit copyright notions in org.msgpack.annotation.*.java and org.msgpack.util.codegen.*.java 2010-10-23 14:50:32 +09:00
Muga Nishizawa
1b8979f285 java: refactor org.msgpack.util.codegen.*.java 2010-10-23 14:39:01 +09:00
Muga Nishizawa
2aac51dd20 java: append getter methods for element templates in org.msgpack.template.ListTemplate.java, MapTemplate.java and OptionalTemplate.java 2010-10-23 14:37:24 +09:00
Muga Nishizawa
69e32d264c java: write test programs for OptionalTemplate.java 2010-10-22 23:23:53 +09:00
frsyuki
71ae75a5bf java: adds OptionalPacker 2010-10-22 16:18:07 +09:00
frsyuki
86043fd87e java: adds OptionalTemplate 2010-10-22 08:31:03 +09:00
Fuji, Goro
d8aaef4f04 perl: tests 2010-10-21 23:35:07 +09:00
Fuji, Goro
7fc34b6369 perl: tweaks 2010-10-21 23:27:26 +09:00
Fuji, Goro
92b346efa7 perl: clean up 2010-10-21 23:26:03 +09:00
Muga Nishizawa
c790735b9f java: add test programs for org.msgpack.util.codegen.*.java 2010-10-21 02:02:23 +09:00
Muga Nishizawa
64711e615e java: write test programs for org.msgpack.util.codegen.*.java 2010-10-20 21:04:37 +09:00
frsyuki
2065affd45 java: adds CollectionTemplate 2010-10-20 16:40:25 +09:00
frsyuki
4067c56b5d java: supports Collection<T> to pack 2010-10-20 16:32:01 +09:00
tokuhirom
65515638aa perl: oops! added settings for shipit 2010-10-19 13:45:44 +09:00
tokuhirom
371ba3ffe3 Checking in changes prior to tagging of version 0.34.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 50177f4..486f1c3 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,6 @@
+0.34
+
+    - do not use the corrupt my_snprintf(%ll[du]) on win32(kazuho)

 0.33
2010-10-18 19:30:08 +09:00
Kazuho Oku
5395b62f2f shorter code, fix comment 2010-10-18 19:26:24 +09:00
Kazuho Oku
3e164eab26 do not use the corrupt my_snprintf(%ll[du]) on win32 2010-10-18 19:22:28 +09:00
Muga Nishizawa
ad85533975 java: add a log4j.properties file for unit testing 2010-10-17 19:23:42 +09:00
Muga Nishizawa
d6c2a97931 java: write test programs for org.msgpack.packer.*.java 2010-10-17 18:57:00 +09:00
Muga Nishizawa
17def94ba4 java: describe test programs for org.msgpack.template.*.java 2010-10-17 18:24:08 +09:00
Muga Nishizawa
cf254ea240 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-10-17 14:37:35 +09:00
Muga Nishizawa
2d05110239 java: refactor DynamicCodeGenBase.java 2010-10-17 14:37:13 +09:00
Fuji, Goro
0017f4fce8 Checking in changes prior to tagging of version 0.33.
Changelog diff is:
2010-10-13 12:46:41 +09:00
Fuji, Goro
02f3dd947a perl: optimize PP 2010-10-13 12:46:11 +09:00
Fuji, Goro
ef0874feba perl: tweaks for PreferInteger 2010-10-13 11:02:57 +09:00
Fuji, Goro
14aa1420f0 perl: comments 2010-10-13 10:54:37 +09:00
Fuji, Goro
c506cd97e0 perl: tests 2010-10-13 10:43:56 +09:00
Fuji, Goro
3761aacb1d perl: cleanup PP 2010-10-13 10:14:31 +09:00
Fuji, Goro
233f13aac5 perl: add tests for unpacking 'float' 2010-10-13 10:03:56 +09:00
Fuji, Goro
0ced3ec2d2 perl: fix tests 2010-10-13 09:38:40 +09:00
Fuji, Goro
5b786f65a4 Checking in changes prior to tagging of version 0.32.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 6e07966..4657079 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,4 +1,8 @@

+0.32
+
+    - add tests to detect Alpha problems reported via CPAN testers (gfx)
+
 0.31

     - update Module::Install::XSUtil for ccache support (gfx)
2010-10-12 23:12:34 +09:00
Fuji, Goro
770542c8c7 perl: add tests 2010-10-12 23:10:59 +09:00
Fuji, Goro
4f1207a38c perl: add a strong assertion 2010-10-12 23:05:58 +09:00
Fuji, Goro
2b65f81e23 Add tests 2010-10-12 22:58:53 +09:00
Muga Nishizawa
c10eb2c17b java: add the code for checking a null pointer to DynamicCodeGen.java 2010-10-11 01:30:42 +09:00
Muga Nishizawa
3f5ac54bf5 java: refactor the programs in a org.msgpack.util.codegen package 2010-10-09 21:53:49 +09:00
Muga Nishizawa
790f9409b1 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-10-07 23:53:22 +09:00
Muga Nishizawa
a3d831b723 java: refactor DynamicCodeGen.java 2010-10-07 23:53:01 +09:00
Fuji, Goro
b9483deea3 Checking in changes prior to tagging of version 0.31.
Changelog diff is:
2010-10-07 17:06:45 +09:00
Fuji, Goro
c211d2ac45 Merge commit 'perl-0.30' 2010-10-07 17:05:37 +09:00
Fuji, Goro
119a03dd5f perl: changelogging 2010-10-07 16:56:36 +09:00
Fuji, Goro
f3fbb7e1f6 perl: Update Makefile.PL using M::I::XSUtil 0.36 (support for ccache) 2010-10-07 16:54:49 +09:00
Fuji, Goro
2be98e8467 perl: changelogging 2010-10-07 16:18:47 +09:00
Fuji, Goro
91b1806e9d perl: add XS_VERSION_BOOTCHECK for safety 2010-10-07 16:16:59 +09:00
Fuji, Goro
8548b3645a perl: cleanup 2010-10-07 16:13:56 +09:00
Muga Nishizawa
4bbfb3f9a3 java: refactor DynamicCodeGen.java 2010-10-07 15:27:11 +09:00
Muga Nishizawa
98eec72522 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-10-07 13:01:33 +09:00
Muga Nishizawa
562d50df4d java: refactor several programs in a org.msgpack.util.codegen package 2010-10-07 13:01:06 +09:00
frsyuki
f3ee5ab372 cpp: fixes ./bootstrap to surely run ./preprocess 2010-10-07 06:28:12 +09:00
INADA Naoki
aa2a3e5b07 Add unicode testcase for Python2. 2010-10-07 03:07:52 +09:00
INADA Naoki
8467307239 Fix testcase for unicode. 2010-10-07 03:04:00 +09:00
INADA Naoki
90da951a6f Use PyUnicode_AsUTF8String() instead of o.encode('utf-8'). 2010-10-07 03:02:02 +09:00
tokuhirom
59f81b331c Checking in changes prior to tagging of version 0.30.
Changelog diff is:
2010-10-06 18:00:00 +09:00
Fuji, Goro
77a7d3d26a perl: Fix utf8 mode not to be reseted by $unpacker->reset method 2010-10-06 17:52:32 +09:00
tokuhirom
4321b80999 Checking in changes prior to tagging of version 0.29.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index b506234..333a824 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.29
+
+    - add $unpacker->utf8 mode, decoding strings as UTF-8.
+
 0.28

     - added more tests(gfx)
2010-10-06 12:29:31 +09:00
tokuhirom
4b93b06323 perl: regenerated README file 2010-10-06 12:27:41 +09:00
tokuhirom
96fb2e4b7c Merge branch 'perl-utf8-mode' of github.com:msgpack/msgpack 2010-10-06 12:24:36 +09:00
Muga Nishizawa
3dc1048dfb Merge branch 'master' of git@github.com:msgpack/msgpack 2010-10-05 20:47:41 +09:00
Muga Nishizawa
28f4bd5a67 java: edit test programs for org.msgpack.util.codegen.* 2010-10-05 20:47:03 +09:00
Muga Nishizawa
b01c270889 java: refactor the programs in a org.msgpack.util.codegen package 2010-10-05 20:45:51 +09:00
Fuji, Goro
7c92f8a90b perl: improve docs 2010-10-05 17:47:27 +09:00
Fuji, Goro
a4a04872a3 perl: add $unpacker->utf8 mode, decoding strings as UTF-8. 2010-10-05 17:10:10 +09:00
Fuji, Goro
f2d13cd647 perl: make test code more simple 2010-10-05 15:58:49 +09:00
Fuji, Goro
9346908485 perl: remove tricky hacks 2010-10-05 15:55:38 +09:00
Fuji, Goro
b3a7ba14f7 Merge branch 'master' of github.com:msgpack/msgpack 2010-10-05 15:53:57 +09:00
frsyuki
524ef9553c Merge branch 'master' of http://github.com/advect/msgpack into advect-master 2010-10-03 16:55:59 +09:00
Muga Nishizawa
a85f6e72fe java: edit DynamicCodeGen.java 2010-10-03 02:09:01 +09:00
Muga Nishizawa
1ae6a41336 java: edit BasicConstants.java in org.msgpack.util.codegen 2010-10-02 23:37:08 +09:00
Muga Nishizawa
3ec55791c6 java: refactor DynamicCodeGen.java 2010-10-02 22:12:40 +09:00
Muga Nishizawa
a3accd28ea java: insert logging codes into CustomConverter.java, CustomPacker.java, CustomUnpacker.java and util.codegen programs 2010-10-02 21:28:21 +09:00
Muga Nishizawa
fc5bc84207 java: add a log4j.properties file in src/main/java/resources 2010-10-02 21:25:30 +09:00
Muga Nishizawa
d8b4051d6d java: edit pom.xml to enable to using slf4j logger 2010-10-02 21:24:22 +09:00
Muga Nishizawa
804a1cc22d Merge branch 'master' of git@github.com:msgpack/msgpack 2010-10-02 17:44:00 +09:00
Muga Nishizawa
cdd60e5f9c add a packer and unpacker for Enum types 2010-10-02 17:43:31 +09:00
frsyuki
7c76f07384 java: adds standard packer classes 2010-10-01 13:12:31 +09:00
frsyuki
a3b1ef9527 java: Packer: supports Set 2010-10-01 12:51:09 +09:00
Muga Nishizawa
0bd4150a80 java: changes several methods declared in a DynamicCodeGen class 2010-09-30 01:17:44 +09:00
Muga Nishizawa
7f7f5253f2 java: adds a test program of the DynamicCodeGen class for packing and unpacking an object that has a field anntated by @MessagePackMessage 2010-09-30 00:55:56 +09:00
advect
2a0a847634 php: update 0.3.0 2010-09-29 08:47:06 +09:00
Muga Nishizawa
92ddb37ed3 java: add test programs for DynamicCodeGenPacker, Unpacker, Converter classes 2010-09-28 22:51:38 +09:00
Fuji, Goro
01f944e6bd perl: tiny tweaks 2010-09-28 20:35:05 +09:00
Muga Nishizawa
732c8d7350 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-09-28 19:12:17 +09:00
Muga Nishizawa
21678aeef5 java: moves a TestDynamicCodeGenPackerTemplate.java file to org.msgpack.util.codegen 2010-09-28 19:11:54 +09:00
tokuhirom
cda1ca35a4 Merge branch 'master' of github.com:msgpack/msgpack 2010-09-28 16:02:29 +09:00
Muga Nishizawa
923580d2cd write a simple test program for a DynamicCodeGenPacker class 2010-09-28 15:31:55 +09:00
Muga Nishizawa
190af1d32b delete old programs: org.msgpack.util.codegen.MessagePackOptional, MessagePackRequired, MessagePackUnpackable, and PackUnpackUtil classes 2010-09-28 15:24:47 +09:00
Muga Nishizawa
bffe0443f9 edit DynamicCodeGenPacker and DynamicCodeGenUnpacker class 2010-09-28 12:17:32 +09:00
Muga Nishizawa
29e99e229b Merge branch 'master' of git@github.com:msgpack/msgpack 2010-09-27 17:56:19 +09:00
Muga Nishizawa
2736b88dd5 edit Packer and Unpacker classes, and move org.msgpack.util.annotation.*.java to org.msgpack.util.codegen.*.java 2010-09-27 17:55:48 +09:00
frsyuki
e739c60e9f java: pom.xml: v0.4 2010-09-27 17:42:22 +09:00
frsyuki
1c0afbc5c5 java: loads template classes when Unpacker, MessagePackObject or ClassTemplate is loaded 2010-09-27 17:42:00 +09:00
Muga Nishizawa
ee1ba5c0f2 java: fixed a bug within a Packer class 2010-09-27 10:16:32 +09:00
Muga Nishizawa
02342ba540 java: refactor a Packer class 2010-09-27 10:10:10 +09:00
Muga Nishizawa
12a130e9bc Merge branch 'master' of git@github.com:msgpack/msgpack 2010-09-27 10:02:03 +09:00
Muga Nishizawa
dfb97e7961 java: adds several annotations in an org.msgpack.annotation package and edits Packer.java and its test program 2010-09-27 10:00:47 +09:00
tokuhirom
54e03a62bd Checking in changes prior to tagging of version 0.28.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 82174fe..b506234 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,8 @@
+0.28
+
+    - added more tests(gfx)
+    - refactor the PP code(gfx)
+
 0.27

     - * 6d9a629 perl: modified trivial codes in PP::Unpacker(makamaka)
2010-09-27 08:35:26 +09:00
tokuhirom
ec9659ff25 Merge branch 'master' of github.com:msgpack/msgpack 2010-09-27 08:32:10 +09:00
frsyuki
0a41b253f3 java: adds templates for primitive types 2010-09-27 04:27:44 +09:00
frsyuki
002b86198c java: adds ReflectionPacker and ReflectionTemplate 2010-09-27 04:17:20 +09:00
frsyuki
7161a235f1 java: uses CustomMessage class on Packer, Unpacker and ClassTemplate 2010-09-27 03:33:21 +09:00
frsyuki
391034a785 java: adds type-conversion mechanisms 2010-09-27 03:06:06 +09:00
frsyuki
446a7fbd67 java: adds CustomMessage class (currently not implemented on Packer, Unpacker and ClassTemplate) 2010-09-27 03:05:32 +09:00
advect
2ccb09434f Merge branch 'master' of http://github.com/msgpack/msgpack 2010-09-26 12:44:05 +09:00
frsyuki
7974060a40 cpp: zone: adds msgpack_zone_swap and msgpack::zone::swap 2010-09-26 11:37:37 +09:00
frsyuki
e8abcc1765 cpp: sbuffer: check initial buffer size != 0 2010-09-26 11:36:57 +09:00
frsyuki
1be1927a1f Merge branch 'master' of github.com:msgpack/msgpack 2010-09-24 16:10:07 +09:00
tanakh
894ff71664 haskell: fix for empty constructor 2010-09-24 03:49:31 +09:00
tanakh
93bed9c5df haskell: finish template-haskell deriving implement 2010-09-24 01:24:13 +09:00
Muga Nishizawa
34c008adce java: refactor annotation-utilities 2010-09-23 20:40:50 +09:00
Muga Nishizawa
22ddd91b1f java: add several API to annotation-utilities 2010-09-23 20:38:54 +09:00
Muga Nishizawa
e121f34407 java: refactor annotation-utilities and edit those test programs 2010-09-23 17:26:31 +09:00
Muga Nishizawa
df8a3e870a java: refactor annotation-utilities 2010-09-23 16:18:23 +09:00
Muga Nishizawa
13b6708a09 java: append a code for generating a messageConvert method to annotation-utilities 2010-09-23 15:24:12 +09:00
tanakh
6aa196cf55 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-09-23 00:06:26 +09:00
tanakh
142493076a haskell: TH support and refactoring 2010-09-23 00:04:34 +09:00
gfx
3d905a7a4f perl: add tests for 'extra bytes' exceptions 2010-09-22 16:14:55 +09:00
gfx
0a8a6ed168 perl: cleanup PP 2010-09-22 15:59:21 +09:00
gfx
68b6fa46e6 perl: add tests for boolean values 2010-09-22 15:28:14 +09:00
gfx
80f7c54e4d perl: make scopes 2010-09-22 15:25:08 +09:00
tokuhirom
c0e2041006 Checking in changes prior to tagging of version 0.27.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index b717a82..82174fe 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,8 @@
+0.27
+
+    - * 6d9a629 perl: modified trivial codes in PP::Unpacker(makamaka)
+    - * ead8edc modified be unpack_(u)int64 in PP(makamaka)
+
 0.26

     - fixed a serious code typo in PP(makamaka)
2010-09-22 15:12:51 +09:00
tokuhirom
f6d2cd7704 Merge branch 'master' of github.com:msgpack/msgpack 2010-09-22 15:09:03 +09:00
makamaka
6d9a629b15 perl: modified trivial codes in PP::Unpacker 2010-09-22 14:19:09 +09:00
makamaka
ead8edc7cd modified be unpack_(u)int64 in PP 2010-09-22 14:12:19 +09:00
tokuhirom
664eefdddb Checking in changes prior to tagging of version 0.26.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 3d455cb..b717a82 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.26
+
+    - fixed a serious code typo in PP(makamaka)
+
 0.25

     (NO FEATURE CHANGES)
2010-09-20 23:40:12 +09:00
tokuhirom
220d76c974 Merge branch 'master' of github.com:msgpack/msgpack 2010-09-20 23:36:50 +09:00
makamaka
d973192b5e perl: modified a serious code typo in PP 2010-09-20 11:49:52 +09:00
tokuhirom
978bb5059f Checking in changes prior to tagging of version 0.25.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index d338cf8..3d455cb 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.25
+
+    (NO FEATURE CHANGES)
+    - oops. I failed releng.

 0.24
     - Fixed a lot of streaming unpacking issues (tokuhirom, gfx)
2010-09-20 09:54:25 +09:00
tokuhirom
f59178bc33 Checking in changes prior to tagging of version 0.24.
Changelog diff is:
2010-09-20 09:30:26 +09:00
gfx
53899cc492 perl: tweaks for Makefile.PL 2010-09-19 22:12:28 +09:00
gfx
6379d0fe0f perl: more tests for nil/true/false entities 2010-09-19 15:53:54 +09:00
gfx
a1c4d8696a Merge branch 'master' of github.com:msgpack/msgpack 2010-09-19 15:49:32 +09:00
gfx
7f42ed86f2 More tests 2010-09-19 15:47:32 +09:00
frsyuki
6bb8b4c994 Merge branch 'master' of github.com:msgpack/msgpack 2010-09-19 15:41:46 +09:00
gfx
afefbe4e56 perl: update .gitignore and MANIFEST.SKIP 2010-09-19 15:21:25 +09:00
gfx
5cd37e5505 perl: always unpacking 64 bit ints as a string on 32 bit perls 2010-09-19 15:20:03 +09:00
gfx
d6a825981d perl: fix unpacking int64_t in PP (based on makamaka's patch) 2010-09-19 15:16:08 +09:00
gfx
a1c01c6722 perl: regen README 2010-09-19 15:15:31 +09:00
gfx
8d182f1d79 perl: Changelogging 2010-09-18 16:30:07 +09:00
gfx
29707bd2ea perl: fix bootstrap 2010-09-18 16:19:16 +09:00
gfx
c2bf2a8174 perl: make pp benchmarks available 2010-09-18 16:16:51 +09:00
gfx
b402849557 perl: docs 2010-09-18 15:54:22 +09:00
gfx
cb85dcfcb8 perl: tweaks for benchmarks 2010-09-18 15:49:25 +09:00
gfx
49379140c7 perl: PERL_ONLY=1 disables XS 2010-09-18 15:14:29 +09:00
gfx
63f6c86b46 perl: add a note about 64 bit integers 2010-09-18 15:05:22 +09:00
gfx
1865898cd4 perl: Fix Makefile.PL 2010-09-18 14:58:32 +09:00
gfx
8935ecfdb8 perl: requires the latest version of Math::BigInt for PP 2010-09-18 14:56:33 +09:00
gfx
4902bed409 perl: more kind testing messages 2010-09-18 14:51:17 +09:00
gfx
e6f6aba207 perl: add portability stuff 2010-09-18 14:50:52 +09:00
gfx
bab622de25 perl: fix max depth checks in PP 2010-09-18 14:46:10 +09:00
gfx
a86c1624a7 perl: More kind error messages in PP 2010-09-18 14:38:35 +09:00
gfx
c707392a5a perl: fix int64_t unpacking in both XS and PP 2010-09-18 14:30:08 +09:00
gfx
1f07721ec4 perl: Scalar::Util is no longer used 2010-09-18 13:33:27 +09:00
gfx
4767e45035 perl: fix a test name 2010-09-18 13:18:25 +09:00
Muga Nishizawa
f2a64ed685 Merge branch 'master' of http://github.com/msgpack/msgpack 2010-09-18 10:02:46 +09:00
tokuhirom
2c9966a0a3 perl: fixed stream deserializer in pp. 2010-09-18 09:44:32 +09:00
tokuhirom
953aa95c64 perl: added failing test case for streaming unpacker with PP. 2010-09-18 06:16:26 +09:00
tokuhirom
446266776e perl: regenerate README file 2010-09-18 06:16:17 +09:00
tokuhirom
845af014dc perl: gfx is a author. 2010-09-18 06:15:51 +09:00
gfx
7c8f8703a1 Add TODOs 2010-09-17 18:26:16 +09:00
gfx
a0c18e4380 Docs 2010-09-17 18:16:33 +09:00
gfx
e8d8099563 Fix a macro redefinition 2010-09-17 18:08:34 +09:00
gfx
2c9d90d463 perl: regen README 2010-09-17 18:08:15 +09:00
tokuhirom
130d2064d5 perl: updated benchmark result! gfx++ # performance tuning 2010-09-17 15:28:24 +09:00
gfx
a10eb2a0d7 Changelogging 2010-09-17 14:02:12 +09:00
gfx
b71cc5d7ee chmod -x 2010-09-17 13:59:52 +09:00
gfx
8512f9eda1 Add .gitignore 2010-09-17 13:49:55 +09:00
gfx
80058083b8 Tweaks 2010-09-17 13:49:08 +09:00
gfx
d5a17a3c25 Fix stddata.t 2010-09-17 13:43:42 +09:00
gfx
eab7c87781 Tidy PP 2010-09-17 13:37:17 +09:00
gfx
d2962d8676 Split the boolean class into an outer module 2010-09-17 13:25:23 +09:00
gfx
5e602fb575 Fix tests 2010-09-17 13:10:54 +09:00
gfx
599964ea5f Comments 2010-09-16 21:45:06 +09:00
gfx
562de7926b More tests; some fails now :( 2010-09-16 21:38:17 +09:00
gfx
8eaed95e02 Fix an use of execute() 2010-09-16 20:44:51 +09:00
gfx
3cffd46008 Fix a comment 2010-09-16 20:41:52 +09:00
gfx
e239bfda8a Make leaktrace.t as a regular test 2010-09-16 20:36:07 +09:00
gfx
bd887b660d Preallocate hv keys 2010-09-16 20:31:34 +09:00
gfx
7c1e0ea95d Add binmode() for stream unpacking 2010-09-16 20:27:25 +09:00
gfx
afbddbfcda Fix the stream unpacker 2010-09-16 20:24:01 +09:00
Muga Nishizawa
9eeb702ca5 change an annotation-utility in Java. it allows users to pack and unpack a List object. 2010-09-15 22:28:46 +09:00
gfx
4cb6d6995f Make the code clearer 2010-09-15 15:27:26 +09:00
gfx
fe7e7a8d07 Add leaktrace tests 2010-09-15 15:26:02 +09:00
gfx
f8ee79ab72 Add failing tests 2010-09-15 15:25:48 +09:00
gfx
a11165830b More useful error messages 2010-09-15 15:06:03 +09:00
gfx
11cde61eab No debug output 2010-09-15 14:38:26 +09:00
gfx
cd862409cc Clean up 2010-09-15 14:25:50 +09:00
gfx
7644555d6b Use sv_mortalcopy() 2010-09-15 14:21:44 +09:00
gfx
07e68aa694 Fix an usage message 2010-09-15 14:20:32 +09:00
gfx
0ae206b1bb Revert "The object root can be NULL"
This reverts commit 5bdac96375f0cc5b75313cc3a9a7bbeb21594a0b.
2010-09-15 14:19:22 +09:00
gfx
5bdac96375 The object root can be NULL 2010-09-15 14:18:38 +09:00
gfx
f0e044ecd8 Cleanup 2010-09-15 14:09:03 +09:00
gfx
f32234291e Remove an useless local variable 2010-09-15 14:07:33 +09:00
gfx
83acd6529f Remove an unused user data: source (sv) 2010-09-15 14:06:10 +09:00
gfx
6a60cb4dc0 Add const 2010-09-15 13:54:18 +09:00
gfx
1de03fbe18 Tweaks for unpacker 2010-09-15 13:41:10 +09:00
gfx
0e0a2aa981 Add various integers to benchmarks 2010-09-15 13:34:18 +09:00
gfx
af73b9d11b Shortcut av_push() 2010-09-15 13:22:39 +09:00
gfx
859969241a Tweaks 2010-09-15 13:20:20 +09:00
gfx
6852a8ca9d Remove an unused function: xs_unpack_limit 2010-09-15 13:16:55 +09:00
gfx
c694f1a4a9 Tweaks 2010-09-15 13:16:13 +09:00
gfx
d36543b204 Micro optimizations 2010-09-15 13:12:17 +09:00
gfx
6981234736 Fix a possible mis-unpack on int64 2010-09-15 13:09:14 +09:00
gfx
10bf3ee9de Avoid compiler's warnings 2010-09-15 13:07:44 +09:00
gfx
9953218de1 Tidy 2010-09-15 13:03:47 +09:00
gfx
50c74103aa Avoid compiler's warnings 2010-09-15 12:56:13 +09:00
gfx
c5e15123fd Add an assertion 2010-09-15 12:52:07 +09:00
gfx
4adcdb5ba8 Remove a duplicated depth check 2010-09-15 12:51:33 +09:00
gfx
60b36ffaa3 Micro optimizations 2010-09-15 12:50:11 +09:00
gfx
d86104ed5d Tweaks 2010-09-15 12:48:23 +09:00
gfx
0f02ef20a9 Improve benchmarks 2010-09-15 12:46:11 +09:00
gfx
0768cf17b6 Taking NULL is a bug 2010-09-15 12:36:43 +09:00
gfx
197205853f Use newSV(). NEWSV() is deprecated. 2010-09-15 12:35:10 +09:00
gfx
bebcc24ab8 Depends on XSUtil 0.32 2010-09-15 12:32:01 +09:00
gfx
987248ccbb Use xshelper.h in all the C files 2010-09-15 12:31:01 +09:00
Muga Nishizawa
56ece4db0f fixed a bug the program for packing and unpacking byte[] in annotation-utility 2010-09-14 23:23:09 +09:00
Muga Nishizawa
c7f8b94ccd fixed several bugs of a verify error within annotation-utilities 2010-09-14 22:26:04 +09:00
Muga Nishizawa
95b820305a add a new test program for annotation-utilities 2010-09-14 13:34:11 +09:00
Muga Nishizawa
599b200ca5 change the version of javassist 3.12.1.GA 2010-09-12 23:04:23 +09:00
Muga Nishizawa
a9566b31be add annotation utilities for Java 2010-09-12 22:21:33 +09:00
Muga Nishizawa
f30837d726 Merge branch 'master' of http://github.com/msgpack/msgpack 2010-09-12 09:02:40 +09:00
tokuhirom
1242ffa4c6 Checking in changes prior to tagging of version 0.23.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index dd47b98..4120376 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,10 +1,15 @@
+0.23
+
+    (NO FEATURE CHANGES)
+    - fixed english docs(hanekomu++)
+
 0.22

     - fixed issue on ithreads(broken from 0.21)

 0.21

-    - doc enhancment
+    - doc enhancments
     - micro performance tuning.

 0.20
2010-09-12 05:38:15 +09:00
Muga Nishizawa
37c0347c47 Merge branch 'master' of http://github.com/msgpack/msgpack 2010-09-12 00:50:26 +09:00
tokuhirom
65befb84a0 Checking in changes prior to tagging of version 0.22.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 5d5a5e2..dd47b98 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.22
+
+    - fixed issue on ithreads(broken from 0.21)
+
 0.21

     - doc enhancment
2010-09-12 00:11:31 +09:00
tokuhirom
a41f7ce3bd oops. 0.21 breakes ithreads support! 2010-09-12 00:09:44 +09:00
Muga Nishizawa
81ced6bf2a Merge branch 'master' of git@github.com:muga/msgpack 2010-09-11 12:13:24 +09:00
Muga Nishizawa
fa8033f998 Merge branch 'master' of http://github.com/msgpack/msgpack 2010-09-11 12:12:16 +09:00
Muga Nishizawa
19e3178d0c Merge branch 'master' of http://github.com/msgpack/msgpack 2010-09-10 22:17:06 +09:00
tokuhirom
1e6262f24f Checking in changes prior to tagging of version 0.21.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index dc3dd5c..5d5a5e2 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,8 @@
+0.21
+
+    - doc enhancment
+    - micro performance tuning.
+
 0.20

     - first production ready release with PP driver.
2010-09-10 21:27:38 +09:00
tokuhirom
beb2284440 perl: added docs for circular reference and blessed object. 2010-09-10 21:25:46 +09:00
tokuhirom
0c4f0de13d perl: inlining the small functions 2010-09-10 21:18:45 +09:00
tokuhirom
0cd31a4b96 perl: inlining utility functions 2010-09-10 21:00:27 +09:00
tokuhirom
ef0a86e7cc perl: more inline 2010-09-10 20:45:17 +09:00
tokuhirom
b79c1345b9 use gfx's standard header. 2010-09-10 20:42:40 +09:00
tokuhirom
5bb8b6f16c perl: ugpraded benchmarking script. and added result to docs. 2010-09-10 20:38:37 +09:00
tokuhirom
f6f675d1e1 updated benchmark script 2010-09-10 20:27:11 +09:00
tokuhirom
9f684e7670 Checking in changes prior to tagging of version 0.20.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 7910882..dc3dd5c 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.20
+
+    - first production ready release with PP driver.
+
 0.16_04

     - no feature changes
2010-09-10 09:35:39 +09:00
tanakh
a998706452 haskell: update cabal file 2010-09-08 13:36:45 +09:00
tanakh
5e19bc6f84 haskell: Object is Eq, Ord, Typeable. 2010-09-07 17:35:24 +09:00
tanakh
169f287970 haskell: Now, Object is an instance of NFData. 2010-09-07 16:14:29 +09:00
tanakh
c56926428c haskell: add packToHandle' 2010-09-07 16:14:00 +09:00
tanakh
43eab5c4e5 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-09-06 23:29:10 +09:00
tanakh
c6424c2ce7 haskell: nonblocking enumerator 2010-09-06 23:27:50 +09:00
tanakh
dfe19d308c haskell: add overlapping instances 2010-09-06 18:14:47 +09:00
tanakh
b75db110dc haskell: add Iteratee interface 2010-09-06 17:00:22 +09:00
tanakh
9e50ba6ec6 haskell: instance tupples and String and lazy ByteString 2010-09-06 16:33:36 +09:00
tanakh
aca2ba13c2 haskell: refactoring 2010-09-06 15:37:55 +09:00
tokuhirom
c5afe7a573 Checking in changes prior to tagging of version 0.16_04.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index a4a3e36..7910882 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,4 +1,4 @@
-0.16_03
+0.16_04

     - no feature changes
2010-09-06 14:35:41 +09:00
tokuhirom
8b90968cb1 Checking in changes prior to tagging of version 0.16_03.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 68b58ba..a4a3e36 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.16_03
+
+    - no feature changes
+
 0.16_02

     - document enhancement(tokuhirom)
2010-09-06 14:34:48 +09:00
tokuhirom
9281dba896 Checking in changes prior to tagging of version 0.16_02.
Changelog diff is:

diff --git a/perl/Changes b/perl/Changes
index 9b061cf..68b58ba 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,8 @@
+0.16_02
+
+    - document enhancement(tokuhirom)
+    - M::I::XSUtil 0.26 is broken. use 0.27.
+
 0.16_01

     - added PP version (used in cases PERL_DATA_MESSAGEPACK=pp or fail to load XS).
2010-09-06 14:34:04 +09:00
tokuhirom
c7555f1c3c Perl: added link to git repository. 2010-09-06 14:31:53 +09:00
tokuhirom
e781831032 upgraded docs 2010-09-06 14:20:54 +09:00
tokuhirom
8025895168 Checking in changes prior to tagging of version 0.16_01.
Changelog diff is:
2010-09-06 14:20:54 +09:00
tanakh
799935e44c haskel: incr version and update infos. 2010-09-06 14:03:47 +09:00
tanakh
209d8d058c forgot to remove file 2010-09-06 13:57:47 +09:00
tanakh
0368a70dd7 forgot to add file 2010-09-06 13:55:34 +09:00
Hideyuki Tanaka
c3603426de Merge branch 'master' of github.com:msgpack/msgpack 2010-09-06 01:51:18 +09:00
Hideyuki Tanaka
80db9971b5 pure haskell implementation. 2010-09-06 01:50:22 +09:00
tokuhirom
e3e771708e Merge branch 'master' of git://github.com/makamaka/msgpack
Conflicts:
	perl/Changes
2010-09-05 16:18:57 +09:00
tokuhirom
b9bca2a19f bump to 0.16 2010-09-05 16:17:19 +09:00
Muga Nishizawa
ffae70a99a Merge branch 'master' of git@github.com:muga/msgpack 2010-09-05 15:49:42 +09:00
makamaka
10ec1e48b0 modified begin process about byte order 2010-09-05 01:54:44 +09:00
makamaka
84123f5445 fallback PP configuration with c99 unspport compiler 2010-09-04 20:02:46 +09:00
makamaka
25531d8393 modified t/05_preferred_int.t for Win32 2010-09-04 19:54:12 +09:00
makamaka
adfadc542a enable PP to pack/unpack int64 in less than Perl 5.10 2010-09-04 14:35:24 +09:00
makamaka
7682e1cb57 Merge branch 'master' of git://github.com/msgpack/msgpack
Conflicts:
	perl/t/05_preferred_int.t
2010-09-03 15:09:49 +09:00
tokuhirom
1fe4109a42 fixed tests on 64bit machines with -Duselongdouble #60625 2010-09-03 14:50:01 +09:00
makamaka
b97baf4d47 added some comments in Data::MessagePack::PP 2010-09-03 12:53:56 +09:00
makamaka
f91728561f ouch, modified pod 2010-09-02 23:58:40 +09:00
makamaka
2b75d54ce1 modified pod 2010-09-02 23:56:55 +09:00
makamaka
cdc09a7d30 Changes 2010-09-02 23:52:36 +09:00
makamaka
4cc6c3e535 modified t/05_preferred_int.t for Win32 2010-09-02 23:48:57 +09:00
makamaka
8f43e033a4 removed dependency on Data::Float 2010-09-02 23:45:05 +09:00
makamaka
918dbd1926 made Makefile.PL XS/PP configurable 2010-09-02 14:37:22 +09:00
makamaka
8fc86ce7fa removed commented out codes 2010-09-02 14:33:59 +09:00
INADA Naoki
bf0cb40586 python: Add python3 category. 2010-09-02 10:13:49 +09:00
INADA Naoki
a62aefe74b python: Release 0.1.6 - Fix wrong version string. 2010-09-02 10:10:34 +09:00
INADA Naoki
138d232149 python: vesion 0.1.5 2010-09-02 09:58:50 +09:00
INADA Naoki
8fa64e3ab2 Add msgpack.version as version tuple. 2010-09-02 09:54:38 +09:00
INADA Naoki
8d0d2bd3fc python: Add test for python3 and fix found problems. 2010-09-02 02:16:28 +09:00
INADA Naoki
2146f5f623 python: Fix Unpacker.feed doesn't accept bytes on Python3. 2010-09-02 02:02:47 +09:00
INADA Naoki
623df23570 Merge branch 'master' of github.com:msgpack/msgpack 2010-09-02 01:30:32 +09:00
INADA Naoki
4a15d8b6d2 python: Support Python3. 2010-09-02 01:29:57 +09:00
makamaka
af83a62474 modified some codes for test warnings 2010-09-01 16:04:25 +09:00
makamaka
a0705a6c67 added PP backend switch into Data::MessagePack 2010-09-01 11:59:01 +09:00
makamaka
712b8eec3d added pp version 2010-09-01 11:22:43 +09:00
tokuhirom
558e9c21ed Perl: 0.15 2010-09-01 08:19:05 +09:00
tokuhirom
23a7137e6a Perl: better argument validation(patch from dankogai) 2010-08-31 23:42:32 +09:00
frsyuki
71a1cb0184 fixes compatibility with Rubinius 2010-08-31 09:29:01 +09:00
frsyuki
09b47cc536 ruby: fixes compatibility with ruby-1.8.5 2010-08-31 07:00:19 +09:00
frsyuki
b5c78de2dd ruby: converts encodings into UTF-8 on Ruby 1.9 2010-08-31 06:30:16 +09:00
frsyuki
a1bd14e516 template: casts integer types explicitly 2010-08-31 06:27:15 +09:00
frsyuki
9684c8664f cpp: version 0.5.4 2010-08-29 18:27:10 +09:00
frsyuki
3c75361e5a cpp: updates README.md 2010-08-29 18:24:32 +09:00
frsyuki
c44c9ab74d cpp: adds msgpack_vc2008.vcproj file in source package 2010-08-29 18:23:16 +09:00
frsyuki
8cc9c871b7 Merge branch 'master' of github.com:msgpack/msgpack 2010-08-28 11:40:45 +09:00
UENISHI Kota
31d211cded Merge branch 'master' of ssh://github.com/msgpack/msgpack 2010-08-28 00:36:54 +09:00
UENISHI Kota
c42cba1d54 erlang: fixed bug around error case when serializing atom. 2010-08-27 23:02:16 +09:00
frsyuki
c87f7cb9ac cpp: fixes fix_int; updates test/fixint.cc 2010-08-27 20:52:40 +09:00
frsyuki
421bee3871 cpp: version 0.5.3 2010-08-27 17:53:19 +09:00
frsyuki
2c7573a032 cpp: updates msgpack_vc8.postbuild.bat 2010-08-27 17:53:02 +09:00
frsyuki
fe2a0f5089 cpp: adds fixed length serialization for integers 2010-08-27 17:42:05 +09:00
frsyuki
59ba8dec4e cpp: fixes include paths 2010-08-27 16:45:48 +09:00
Muga Nishizawa
ff0e1bbbc0 change the part for creating a new constructor within DynamicCodeGenerator 2010-08-26 17:53:29 +09:00
Muga Nishizawa
18c712cd99 object serialization with reflection and with dynamic code generation 2010-08-25 21:35:52 +09:00
tokuhirom
8de1f764fd Perl: bump up version to 0.14 2010-08-21 16:09:30 +09:00
tokuhirom
a91c1ec6d9 fixed segv on cyclic reference(patch by dankogai) 2010-08-21 16:02:23 +09:00
frsyuki
c8e351b31e java: adds TestMessageUnpackable test 2010-08-21 03:36:44 +09:00
frsyuki
b4c98584db java: adds Unpacker.unpackBigInteger() 2010-08-19 01:19:34 +09:00
frsyuki
1d17836b7d java: NilType::create() returns NilType's one and only instance 2010-08-19 00:54:23 +09:00
frsyuki
193a739749 java: updates TestDirectConversion 2010-08-19 00:05:48 +09:00
frsyuki
48da2b8353 java: adds Packer.pack(<primitive types>) 2010-08-18 23:47:31 +09:00
frsyuki
40dc9de6c9 java: supports packing/unpacking of BigInteger less than 0xffffffffffffffff 2010-08-18 23:37:47 +09:00
frsyuki
d7469e4694 java: fixes cross-language test case 2010-08-18 22:55:50 +09:00
frsyuki
fdfabc9f88 java: adds cross-language test case 2010-08-18 22:51:23 +09:00
frsyuki
5658ca5b90 java: adds ObjectEquals test 2010-08-18 22:24:51 +09:00
frsyuki
8b79e6d3c7 java: uses MessagePackObject instead of Object for type of deserialized objects 2010-08-18 18:10:30 +09:00
frsyuki
8c67087a15 java: adds MessagePackObject.bigIntegerValue(), asBigInteger() and equals() 2010-08-18 16:32:42 +09:00
frsyuki
057f73a73e java: implements MessagePackObject::hashCode() 2010-08-10 14:11:44 +09:00
frsyuki
d3bb37d113 java: fixes MapSchema 2010-08-10 14:11:25 +09:00
frsyuki
6c91b862c9 java: MessagePackObject implements Cloneable and MessagePackable interfaces 2010-07-28 01:17:20 +09:00
frsyuki
cba47b635a java: changed deploy path to ./target/website/maven2 directory. 2010-07-27 09:50:57 +09:00
Kazuki Ohta
cd83388f8b java: fixed repository location. msgpack.sourceforge.net => msgpack.org 2010-07-27 08:59:09 +09:00
frsyuki
02ae247536 java: adds MessagePackObject class 2 2010-07-24 18:20:00 +09:00
frsyuki
1621a68191 Merge branch 'master' of github.com:msgpack/msgpack 2010-07-24 18:08:19 +09:00
frsyuki
2aef495d62 java: adds MessagePackObject class 2010-07-24 18:08:00 +09:00
frsyuki
227c168b65 java: fixes fatal offset calculation bugs on BufferedUnpackerIMPL.unpackInt() 2010-07-24 18:07:22 +09:00
UENISHI Kota
dcbcf5842f erlang: msgpack:unpack_all/1 doc. 2010-07-18 23:55:07 +09:00
UENISHI Kota
8a3ac6d9bd erlang: omake menus added. 2010-07-18 23:50:29 +09:00
UENISHI Kota
6cabad19d5 erlang: unpack_all/1 improve, error handling added. 2010-07-18 23:48:20 +09:00
UENISHI Kota
dad7a03d19 erlang: stopped support for dict() type. 2010-07-18 23:42:23 +09:00
UENISHI Kota
7b152640d9 erlang: 'edoc' document generation 2010-07-18 23:40:25 +09:00
UENISHI Kota
78fddff34e erlang: merged vincent's contribution 2010-07-18 23:01:43 +09:00
advect
78f542f6c0 Update PHP Extension 2010-07-17 18:46:28 +09:00
frsyuki
f8a016edb5 Merge branch 'master' of github.com:msgpack/msgpack 2010-07-14 17:09:34 +09:00
frsyuki
f5453d38ec cpp: version 0.5.2 2010-07-14 17:06:16 +09:00
frsyuki
331bf0af21 cpp: type::raw_ref::str(), operator==, operator!=, operator< and operator> are now const 2010-07-14 17:04:41 +09:00
tokuhirom
9ac69337e8 perl: bump up version to 0.13! 2010-07-14 09:58:41 +09:00
tokuhirom
ca0c844f32 clearly specified this distribution requires requires C99. 2010-07-14 09:58:05 +09:00
Vincent de Phily
e629e8784f erlang: Improve documentation
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.
2010-07-12 14:08:22 +02:00
Vincent de Phily
e944c1ee93 erlang: Only handle throw() in pack/1 and unpack/1
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.
2010-07-09 20:37:06 +02:00
Vincent de Phily
02c882bda3 erlang: Make pack_map/1 api private 2010-07-09 20:34:38 +02:00
Vincent de Phily
2c29377abf erlang: s/short/incomplete/ and s/badarg/{badarg,Term}/
Nicer error returns.
2010-07-09 20:30:17 +02:00
Vincent de Phily
21992f1b9e erlang: fix receiving from port_command in unit tests
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.
2010-07-09 18:53:24 +02:00
Vincent de Phily
8a3f090684 erlang: Fix some existing specs and add a few other.
dialyzer still complains about dict() and ?assert(false), but I don't think they're real issues.
2010-07-09 17:36:36 +02:00
UENISHI Kota
a4258505a9 erlang: modified wrong testcase. 2010-07-09 23:23:00 +09:00
Vincent de Phily
ba4a971bfa erlang: Remove unecessary 'throw(short)' clause for unpack_{array,map}_/1
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).
2010-07-09 13:44:02 +02:00
Vincent de Phily
6abc120279 erlang: Fix incomplete/invalid cases of unpack_/1
* 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
2010-07-09 13:29:47 +02:00
Vincent de Phily
64c36b7a8f Remove a couple of superfluous 'when' clauses.
The when clause for unpack_/1 has been moved to unpack/1 so that it is performed only once.
2010-07-09 13:06:57 +02:00
Vincent de Phily
64b9f0762c Merge branch 'master' of git://github.com/msgpack/msgpack
Reseting msgpack.erl to upstream version.
2010-07-09 12:35:22 +02:00
UENISHI Kota
e799082e5c erlang: better test cases, except 'Broken pipe' 2010-07-09 01:21:35 +09:00
UENISHI Kota
eab66a022e erlang: added try-catch clause for easy error handling 2010-07-09 01:04:09 +09:00
UENISHI Kota
485915c27a erlang: added simple performance test description. 2010-07-08 23:39:47 +09:00
UENISHI Kota
45fb482ab4 erlang: added simple performance test. 2010-07-08 23:36:18 +09:00
frsyuki
167e2475d8 cpp: generate version.h using AC_OUTPUT macro in ./configure 2010-07-06 23:30:15 +09:00
frsyuki
fe77251242 cpp: fixes missing dependency to generate version.h 2010-07-06 19:16:49 +09:00
frsyuki
0c331d2887 cpp: updates vcproj 2010-07-06 18:18:28 +09:00
frsyuki
39facd5dc6 cpp: version 0.5.1 2010-07-06 17:59:07 +09:00
frsyuki
a2bd5ae638 cpp: ./configure supports --disable-cxx option not to build/install C++ API 2010-07-06 17:45:15 +09:00
frsyuki
c57f616141 cpp: adds MSGPACK_VERSION{,_MAJOR,_MINOR} macros and msgpack{,_major,_minor} functions 2010-07-06 17:10:25 +09:00
frsyuki
3af10a1d00 cpp: adds MSGPACK_VERSION{,_MAJOR,_MINOR} macros and msgpack{,_major,_minor} functions 2010-07-06 17:00:58 +09:00
frsyuki
b3987e2402 Merge branch 'master' of github.com:msgpack/msgpack 2010-07-06 12:26:30 +09:00
frsyuki
71dd44f430 cpp: adds operator<<(std::ostream&, const tuple<Type...>&) (experimental) 2010-07-06 12:26:21 +09:00
UENISHI Kota
584462f9b9 erlang: improved spec. 2010-07-01 01:16:25 +09:00
UENISHI Kota
ff5d5d7cbc erlang: updated the comments 2010-07-01 01:14:38 +09:00
UENISHI Kota
370e92b1a6 erlang: just a golf. 2010-07-01 01:14:20 +09:00
UENISHI Kota
2469768a85 erlang: reducing unnecessary binary matching in unpack_/2
* more efficient unpack_/1 by Vincent de Phille's code. thanks.
2010-07-01 01:07:56 +09:00
UENISHI Kota
acb8fa613e erlang: adding shorthand fix for {more, undefined} problem 2010-07-01 01:02:19 +09:00
UENISHI Kota
83b4b7d83d erlang: more suitable variable name and removing unnecessary guards. 2010-07-01 00:58:48 +09:00
Vincent de Phily
33a7d56042 * Return {more,undefined} instead of {more,integer()}, as we can only know the "minimum bytes needed to continue" instead of the actually usefull "total packet size".
* Merge all {more,...} clauses of unpack_/1 into one.
* Reformat unpack_/1 for readability.
* Fix some specs, error values, and documentation.
2010-06-29 11:59:56 +02:00
frsyuki
20de730541 ruby: 0.4.3 2010-06-29 15:39:47 +09:00
frsyuki
134c27c900 Merge branch 'master' of github.com:msgpack/msgpack 2010-06-29 15:13:21 +09:00
frsyuki
123ae024c6 ruby: MessagePack::VERSION constant 2010-06-29 15:12:52 +09:00
frsyuki
34a29cd0a5 ruby: fixes SEGV problem caused by GC bug at MessagePack_Unpacker_mark. 2010-06-29 14:56:23 +09:00
frsyuki
9fffa9800a ruby: fixes RDoc of Unpacker#execute and Unpacker#execute_impl 2010-06-29 14:54:09 +09:00
Vincent de Phily
8f7f23a0e5 Rewrite unpack_/1 using pattern matching to get a 30-40% speedup.
Simplify pack_* and unpack_{array,map} function clauses to get more readability and a minor speedup.
2010-06-28 18:11:52 +02:00
UENISHI Kota
358457f49d erlang: bad wrong export.. 2010-06-29 00:25:58 +09:00
UENISHI Kota
90e305d789 erlang: explicit API for serializing proplists,
so as not to make wrong call of pack({proplists()}).
2010-06-29 00:23:49 +09:00
UENISHI Kota
b471e52e28 erlang: explicit API for serializing proplists,
so as not to make wrong call of pack({proplists()}).
2010-06-29 00:21:47 +09:00
UENISHI Kota
9b5fc37399 Merge branch 'master' of http://github.com/vincentdephily/msgpack 2010-06-29 00:10:10 +09:00
Vincent de Phily
537322e3b5 Big speedup (around 40%) of maps and arrays encoding by using proper tail recursion. 2010-06-28 14:17:44 +02:00
Vincent de Phily
279121f87f erlang: Use a simple proplist instead of a dict.
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.
2010-06-28 11:56:12 +02:00
UENISHI Kota
a1b2b41cdc erlang: bugfix(serialization of -234 goes <<208,22>> while it should go int16 <<0xD1, ...>>) 2010-06-26 08:40:36 +09:00
Vincent de Phily
0cca90c21d Fix encoding of fixmap type.
The tag value was wrong, and a missing /binary flag caused an error.
2010-06-25 17:32:11 +02:00
UENISHI Kota
ad052cb510 updated readme 2010-06-25 01:26:57 +09:00
UENISHI Kota
57f0598373 erlang: code refined and tests added 2010-06-25 00:44:14 +09:00
UENISHI Kota
92d192277e erlang: unpack_map's silly bug fixed. use dict:store/3.... 2010-06-25 00:22:53 +09:00
UENISHI Kota
2cdfbd8970 erlang: testing pack_map/unpack_map with a silly bug 2010-06-24 07:26:34 +09:00
UENISHI Kota
bc0c5f0cdc erlang: (un)pack_map improved, incremental unpacking 2010-06-23 09:02:53 +09:00
UENISHI Kota
230ee3a03b erlang: too short binary to decode causes error {more, Int}. 2010-06-23 01:26:10 +09:00
UENISHI Kota
ab0bf37d30 Merge branch 'master' of ssh://github.com/msgpack/msgpack 2010-06-22 11:44:25 +09:00
UENISHI Kota
b1e66256ce erlang: external APIs' type/specs. 2010-06-22 11:28:36 +09:00
UENISHI Kota
fd80693420 erlang: tests improved and code refined. 2010-06-22 11:15:18 +09:00
Naoki INADA
f222f5ed9b Python: 0.1.4 2010-06-15 18:06:58 +09:00
INADA Naoki
59603b902a Python: add "load(s)/dump(s)" alias for compatibility to simplejson/marshal/pickle. 2010-06-15 17:51:24 +09:00
frsyuki
82a5dd6cf9 java: update 2010-06-10 14:02:58 -07:00
frsyuki
a97f9081a3 Merge branch 'master' of github.com:msgpack/msgpack 2010-06-03 22:04:36 +09:00
frsyuki
b3e0ad1303 ruby: 0.4.2 2010-06-03 22:00:15 +09:00
frsyuki
251090406a ruby: adds a test case for buffering 2010-06-03 21:52:01 +09:00
frsyuki
9c3ed173b1 ruby: fixes buffering routine 2010-06-03 21:51:40 +09:00
UENISHI Kota
7cd41aeb72 erlang: tracing crosslang.rb moving to ../test 2010-06-03 00:17:17 +09:00
UENISHI Kota
8ecaf7ad4c Merge branch 'master' of ssh://github.com/msgpack/msgpack 2010-06-03 00:14:19 +09:00
frsyuki
d4049fe593 ruby: add test/test_cases.rb 2010-06-01 16:35:21 +09:00
frsyuki
989b14b519 update test/README.md 2010-06-01 15:58:44 +09:00
frsyuki
fb3e11408c add test/cases.json 2010-06-01 15:56:29 +09:00
frsyuki
3d3af3284e cpp: adds Doxyfile 2010-06-01 08:43:30 +09:00
frsyuki
eabcf15790 cpp: update tests 2010-06-01 07:16:25 +09:00
frsyuki
684bca203a cpp: adds msgpack_unpacker_next and msgpack_unpack_next 2010-06-01 07:15:58 +09:00
frsyuki
d42ecccf6f cpp: msgpack::unpack returns void 2010-06-01 07:13:47 +09:00
frsyuki
5a92c861e3 cpp: adds msgpack_vrefbuffer_new and msgpack_vrefbuffer_free 2010-06-01 07:11:01 +09:00
frsyuki
103b14ea3c cpp: adds msgpack_zbuffer_new and msgpack_zbuffer_free 2010-06-01 07:10:39 +09:00
frsyuki
e49f091b4e cpp: adds msgpack_sbuffer_new and msgpack_sbuffer_free 2010-06-01 07:10:17 +09:00
frsyuki
6056f93910 cpp: add cases.mpac test 2010-06-01 05:15:36 +09:00
frsyuki
18fa2d1af4 Merge branch 'master' of github.com:msgpack/msgpack 2010-06-01 04:47:37 +09:00
frsyuki
062ed8a4c4 add test/cases.mpac and test/cases_compact.mpac 2010-06-01 04:47:28 +09:00
UENISHI Kota
49f3872d04 erlang: temporary documentation and .gitignore 2010-06-01 00:31:12 +09:00
UENISHI Kota
d9b467098a erlang: added more cross-language tests. better type specification. 2010-05-31 23:56:06 +09:00
UENISHI Kota
7d1e51437e erlang: added usage of cross-language test. 2010-05-31 23:13:32 +09:00
frsyuki
f5a7d444e2 Merge branch 'master' of github.com:msgpack/msgpack 2010-05-31 17:32:51 +09:00
frsyuki
a0071c2f9f add crosslang.rb 2010-05-31 17:27:51 +09:00
frsyuki
98a5e43883 add crosslang.cc 2010-05-31 17:16:40 +09:00
UENISHI Kota
f40ebe5b43 Merge branch 'master' of ssh://github.com/msgpack/msgpack 2010-05-31 00:26:49 +09:00
UENISHI Kota
d7d78d9a2b added more tests,
and OMake continuous building.
2010-05-31 00:25:53 +09:00
Hideyuki Tanaka
5a12d36a0a incr version 2010-05-30 19:45:00 +09:00
Hideyuki Tanaka
e61dc76ae1 fix peek object 2010-05-30 19:11:04 +09:00
Hideyuki Tanaka
0da22193bd fix typo 2010-05-30 17:20:49 +09:00
Hideyuki Tanaka
d43921823e fix initialize pointer 2010-05-30 17:19:43 +09:00
UENISHI Kota
6b5b76b0c9 initial import from http://bitbucket.org/kuenishi/messagepack-for-erlang 2010-05-30 15:01:10 +09:00
frsyuki
602971408b cpp: move source files into src/ directory 2010-05-30 03:02:40 +09:00
frsyuki
2f5d83f07d cpp: type::tuple& operator>>: fix conversion type 2010-05-30 01:45:07 +09:00
frsyuki
81b0c316cd java: Unpacker: rewind internal buffer on filled <= offset 2010-05-30 01:39:48 +09:00
frsyuki
6df86384ca java: update javadoc 2010-05-29 07:54:49 +09:00
frsyuki
3fbcde4bd7 ruby: don't use rb_enc_set/get on ruby 1.8 2010-05-26 18:11:09 +09:00
frsyuki
293293c23c ruby: set mp->user.source = Qnil before tempalte_execute_do on Unpacker#each 2010-05-26 18:01:27 +09:00
frsyuki
47185d757e ruby: version 0.4.0 2010-05-26 07:55:02 +09:00
frsyuki
94c3998507 ruby: update gemspec 2010-05-26 07:43:05 +09:00
frsyuki
5fa589691c ruby: use malloc/realloc for stream buffer 2010-05-26 07:01:28 +09:00
frsyuki
26bc835c7e ruby: buffer rewinding 2010-05-26 04:30:49 +09:00
frsyuki
fc7da17fa2 cpp: add sbuffer::clear() and vrefbuffer::clear() 2010-05-25 02:57:37 +09:00
frsyuki
dbebe9771b ruby: update rdoc 2010-05-25 02:55:58 +09:00
frsyuki
d0af8aa9f1 ruby: rdoc 2010-05-23 21:10:49 +09:00
Kazuki Ohta
f8173e93f5 java: version 0.3 (added CHANGES.txt and LICENSE.txt) 2010-05-23 01:48:20 +09:00
frsyuki
fa6ea6848f java: fixed problem that empty array and empty map don't check Schema 2010-05-23 01:38:01 +09:00
frsyuki
5982970e21 java: fixed problem that empty array and empty map don't check Schema 2010-05-23 01:34:45 +09:00
Kazuki Ohta
c43e5e0c95 java: added testcases for empty array and empty map 2010-05-23 01:31:15 +09:00
frsyuki
b4fc79c38e java: fixes compile error 2010-05-22 17:05:17 +09:00
frsyuki
b9cb270b8f java: add Unpacker.unpack(MessageUnpackable) and Unpacker.tryUnpackNil() 2010-05-22 03:34:43 +09:00
frsyuki
1fe35d7efe java: fix Packer.packByte 2010-05-22 03:34:17 +09:00
frsyuki
ec8c19b1f0 java: javadoc 2010-05-20 17:32:15 +09:00
frsyuki
c2525bcc05 java: add Unpacker.wrap method 2010-05-20 06:19:26 +09:00
frsyuki
985c31b378 java: add Unpacker.wrap method 2010-05-20 06:18:32 +09:00
frsyuki
135a9f5586 java: fix direct conversion API 2010-05-20 05:44:44 +09:00
frsyuki
979ff80982 java: redesign 2010-05-20 03:49:26 +09:00
frsyuki
6cde9f3a9d Merge branch 'master' of github.com:msgpack/msgpack 2010-05-19 16:31:16 +09:00
frsyuki
5cad81bf4c cpp: fix return type mismatch in zone.c 2010-05-18 14:48:36 +09:00
frsyuki
18967162cf cpp: fix return type mismatch in unpack.c 2010-05-18 14:48:23 +09:00
tokuhirom
6ea75f3a9f Perl: do not use done_testing 2010-05-17 05:52:32 +09:00
tokuhirom
f51123d009 oops 2010-05-17 05:49:39 +09:00
tokuhirom
be6376ee2d Perl: build_requires and requires are duped. 2010-05-08 12:02:31 +09:00
tokuhirom
120a85a3e5 Perl: releng for 0.12 2010-05-05 17:28:38 +09:00
tokuhirom
262fe96c29 Perl: PERL_NO_GET_CONTEXT makes horrible dTHXs. remove it. 2010-05-05 17:25:45 +09:00
tokuhirom
1864df5ed0 Perl: cleanup Makefile.PL 2010-05-05 17:25:25 +09:00
tokuhirom
09bae0a9e8 Perl: Test::Requires is not needed for this test. 2010-05-05 17:25:08 +09:00
tokuhirom
ebe41a24f1 perl: releng for data-messagepack 0.11 2010-05-05 16:59:31 +09:00
tokuhirom
f0f574a15b Perl: releng for 0.10 2010-05-05 16:55:06 +09:00
tokuhirom
9420436c09 Perl: added test case 2010-05-05 16:22:40 +09:00
tokuhirom
2b8f853b96 Perl: fixed some issues. thanks to gfx++
http://gist.github.com/387743
2010-05-05 16:17:57 +09:00
tokuhirom
2c2bf60d0c Perl: added README file. 2010-05-05 15:50:07 +09:00
Hideyuki Tanaka
62b82448d5 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-05-05 04:33:11 +09:00
Hideyuki Tanaka
2f12e6c3d0 remove compiler warnings 2010-05-05 04:28:04 +09:00
Kazuki Ohta
8ce23f8e3e java: fixed pom.xml to work "mvn deploy" command 2010-05-04 18:33:29 +09:00
Hideyuki Tanaka
dbe760d6e2 make () to OBJECT instance (Nil) 2010-05-04 16:24:45 +09:00
Hideyuki Tanaka
674c26d9c7 fix feed function from Handle 2010-05-04 16:22:04 +09:00
tokuhirom
7b68b04efd Perl: change for release Data-MessagePack-0.09_01 2010-05-03 01:36:48 +09:00
tokuhirom
e0b65bf196 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-05-03 01:20:00 +09:00
tokuhirom
77f5cb1f1f Perl: updated docs. 2010-05-03 01:09:21 +09:00
tokuhirom
2a222737f8 Merge branch 'master' of git@github.com:msgpack/msgpack 2010-05-03 01:04:50 +09:00
tokuhirom
77d48f9cee Perl: fixed memory leak issue 2010-05-03 00:46:15 +09:00
tokuhirom
c77eac325e Perl: added failing test case for memory leaks 2010-05-03 00:22:16 +09:00
tokuhirom
517ced2a54 Perl: added more test case for streaming unpacker 2010-05-03 00:08:02 +09:00
tokuhirom
70d2c47367 perl: added more test case for streaming deserializer. 2010-05-02 22:09:18 +09:00
frsyuki
e57084f6df cpp: update ChangeLog 2010-04-29 23:45:48 +09:00
frsyuki
8783cf8ec3 cpp: fixes unpacker::next 2010-04-29 22:32:43 +09:00
frsyuki
2af7a7c6ac Merge branch 'master' of github.com:msgpack/msgpack 2010-04-29 22:15:17 +09:00
frsyuki
91a1f8d9e1 cpp: new streaming deserialier API. 2010-04-29 22:15:03 +09:00
Kazuki Ohta
fc5e8ddca1 java: add Unpacker.feed() function for java.nio.ByteBuffer 2010-04-29 21:27:41 +09:00
frsyuki
6352472c5f python: sourceforge.jp -> sourceforge.net 2010-04-29 09:06:46 +09:00
Naoki INADA
833ee6484c Release msgpack-python 0.1.3 2010-04-29 07:52:32 +09:00
Naoki INADA
dda3d24bca Add download url. 2010-04-29 07:08:41 +09:00
Naoki INADA
f77d76a320 Add COPYING file to python package. 2010-04-29 07:01:16 +09:00
frsyuki
c51fabf6ed msgpack/pack_template.h: don't evaluate undefined macro 2010-04-29 02:39:53 +09:00
frsyuki
b10cb658ca pack_template.h: template_unsigned_long:
wrong size checking on !defined(SIZEOF_SHORT) && !defined(SHRT_MAX)"
2010-04-29 00:39:45 +09:00
frsyuki
68f60568ac cpp: build libmsgpackc.so for backward compatibility. 2010-04-26 21:52:19 +09:00
frsyuki
9fbca83ac0 cpp: add test/{zone,pack_unpack,streaming,object,convert,buffer}.cc 2010-04-25 18:08:14 +09:00
frsyuki
d19bfaa2cb cpp: fixes msgpack_vc8.vcproj 2010-04-25 09:09:06 +09:00
frsyuki
53d5ddb345 cpp: fixes operator<<(packer<Stream>&, const object&) 2010-04-25 08:26:42 +09:00
frsyuki
0a5c2e7ab9 c,cpp: MSGPACK_OBJECT_NIL = 0x00 2010-04-25 08:16:12 +09:00
frsyuki
35802ba949 cpp: msgpack_object_equal 2010-04-25 08:00:04 +09:00
frsyuki
72160aac9a cpp: combines libmsgpackc and libmsgpack into libmsgpack 2010-04-25 07:56:19 +09:00
frsyuki
9df6916029 cpp: object::object(const T& v, zone* z) 2 2010-04-25 06:39:12 +09:00
frsyuki
9bfa2354ff cpp: fixes serialization of object::type == DOUBLE 2010-04-25 02:37:04 +09:00
frsyuki
7d945d3c8e cpp: explicit object(const T& v) 2010-04-25 02:30:53 +09:00
frsyuki
05e28752f1 cpp: MSGPACK_DEFINE defines T::msgpack_object(object*, zone*) 2010-04-25 01:57:05 +09:00
frsyuki
01b6673528 cpp: bool operator==(object& x, const T& y) 2010-04-25 01:24:24 +09:00
frsyuki
4e85ebbf98 cpp: object::object(const T& v, zone* z) 2010-04-25 01:12:25 +09:00
frsyuki
120e8bffd7 cpp: object::object(const T& v) and object::operator=(const T& v) 2010-04-25 00:03:09 +09:00
frsyuki
8335823748 ruby-0.3.9 2010-04-23 20:24:36 +09:00
frsyuki
c9fcf4020f ruby: streaming deserializer test 2010-04-23 20:18:48 +09:00
frsyuki
b10a736744 ruby: fixese backward compatibility of streaming deserializer 2010-04-23 18:13:36 +09:00
frsyuki
60fbaf7612 ruby: 0.3.8 2010-04-22 14:56:25 +09:00
frsyuki
d24193630e reverts variable-length stack: avoids memory leak 2010-04-22 14:46:54 +09:00
frsyuki
354af69f62 ruby: fixes SEGV on MessagePack_Unpacker_each 2010-04-22 14:38:10 +09:00
Taro L. Saito
bccac610a4 changed the src/test folder 2010-04-20 00:05:26 +09:00
Taro L. Saito
5aa6209664 add README 2010-04-19 23:52:40 +09:00
Taro L. Saito
d693d92702 removed unnecessary settings 2010-04-19 23:34:18 +09:00
Taro L. Saito
f2622e54e3 moved src and test codes to src/{main,test}/java 2010-04-19 23:05:00 +09:00
Taro L. Saito
20fe9b6dde added pom.xml 2010-04-19 22:39:53 +09:00
Kazuki Ohta
11f7aa4212 cpp: fixed small typo in configure.in 2010-04-18 15:11:50 +09:00
Hideyuki Tanaka
f53c351fd2 haskell binding 2010-04-18 02:17:49 +09:00
Kazuki Ohta
fb96617377 java: add javadoc,javadoc-jar,pom,dist,mvn-install,mvn-deploy ANT tasks.
Now maven2 repository for msgpack is created at the following URL.
  - http://msgpack.sourceforge.net/maven2/
2010-04-18 01:18:40 +09:00
frsyuki
05b8c00ee7 cpp: fixes windows compatibility 2010-04-18 00:39:45 +09:00
frsyuki
58854fdae9 cpp: add cpp/README.md 2010-04-18 00:39:23 +09:00
frsyuki
fd31ff772f Merge branch 'master' of github.com:msgpack/msgpack 2010-04-18 00:08:17 +09:00
frsyuki
ab8e0c9e31 c,cpp: reforms source tree 2010-04-18 00:08:03 +09:00
Kazuki Ohta
abeed3be84 java: add tests for array and map 2010-04-17 23:25:42 +09:00
Kazuki Ohta
a65438c6fe java: skip building jar file for the faster testing 2010-04-17 22:53:56 +09:00
frsyuki
c3f43fb0cf template_execute: fixes embed stack 2010-04-17 22:43:11 +09:00
Kazuki Ohta
2807504a81 java: add tests for float, double, nil, boolean, string 2010-04-17 22:10:41 +09:00
Kazuki Ohta
08b716c96d java: add TestPackUnpack for int 2010-04-17 21:16:32 +09:00
Kazuki Ohta
b4b1f0a2c9 introduce JUnit framework for testing. 2010-04-17 20:17:43 +09:00
frsyuki
228f742b2f ruby: set encoding to 'ASCII-8BIT' before deserializing on ruby-1.9 2010-04-17 20:02:47 +09:00
frsyuki
a55affe4d5 ruby: add Symbol#to_msgpack 2010-04-17 16:16:56 +09:00
frsyuki
a6ec726ed7 malloc/realloc the stack when its length becomes > MSGPACK_EMBED_STACK_SIZE 2010-04-14 21:11:31 +09:00
frsyuki
87835a4e60 ruby: remove init_stack, adopt rb_gc_mark_maybe 2010-04-14 21:08:06 +09:00
Masahiro Nakagawa
1f18af4395 c: fixes comment in pack_template.h 2010-04-08 23:01:19 +09:00
frsyuki
e79747a600 cpp: msgpack/pack.hpp: fixes header 2010-04-07 20:02:00 +09:00
Masahiro Nakagawa
bd36ac2c0c cpp: fixes argument type of pack_int* methods 2010-04-07 19:54:14 +09:00
frsyuki
c6186f2c01 ruby: version 0.3.7 2010-04-06 17:59:34 +09:00
frsyuki
d639f57470 ruby: fixes Segmentation fault on MessagePack.unpack(nil) 2010-04-06 17:46:38 +09:00
Hideyuki TAKEI
99a2d28592 import MessagePack for PHP 2010-04-05 00:10:28 +09:00
frsyuki
254ee80c16 c: fixes msgpack_zbuffer_write: error checking 2010-04-04 22:11:16 +09:00
frsyuki
e43f57fe1a c: fixes msgpack_zbuffer_flush: error checking 2010-04-04 22:06:27 +09:00
Masahiro Nakagawa
f88c029a4c c: fixes msgpack_zbuffer_flush 2010-04-04 21:55:00 +09:00
frsyuki
93c3cbeaef ruby fixes gemspec: require_paths = ["lib"] 2010-04-04 21:45:56 +09:00
frsyuki
88c77b793f Merge branch 'master' of github.com:msgpack/msgpack 2010-04-04 21:40:19 +09:00
frsyuki
11286524a5 ruby: fixes 'File not found: lib' message on gem installation 2010-04-02 03:22:29 +09:00
frsyuki
7c863c341e ruby: use gem-compile gem instead of some scripts to create binary gems 2010-04-02 02:19:41 +09:00
moaikids
3416cf984e fix: org.msgpack.impl.UnpackerImpl.java CS_MAP_16 deserialize bug(line.388) 2010-04-01 23:15:36 +09:00
moaikids
1784746e7e fix: CS_MAP_16 deserialize bug(line.388) 2010-04-01 23:13:56 +09:00
Keiji Muraishi
6c6df1adaf should raise TypeError on find unsupported value 2010-03-31 17:29:07 +09:00
Keiji Muraishi
f91e1c17c0 fix typo in Makefile 2010-03-31 17:09:00 +09:00
frsyuki
58201b95f2 ruby: version 0.3.4 2010-03-31 13:46:28 +09:00
frsyuki
fcce8f6d51 ruby: use 'readpartial' instead of 'sysread' if !io.respond_to?(:sysread) 2010-03-31 12:00:26 +09:00
frsyuki
f7bdda8828 cpp: fixes pack_short(int) -> pack_short(short) 2010-03-29 21:18:01 +09:00
frsyuki
df5a60fd5b ruby: append_buffer calls "<<" method if the buffer object.class != String 2010-03-26 15:16:13 +09:00
frsyuki
5782ab7ccc c,cpp: add msgpack_zbuffer and msgpack::zbuffer 2010-03-26 14:33:49 +09:00
frsyuki
72e3f98213 cpp: alias pack(Stream* s, const T& v) -> pack(Stream& const T& v) 2010-03-26 14:30:50 +09:00
frsyuki
1b1433a664 ruby: copy the deserialized string if length <= RSTRING_EMBED_LEN_MAX 2010-03-26 14:29:49 +09:00
frsyuki
568704ed22 fixes Visual C++ compatibility 2010-03-19 13:34:53 +09:00
frsyuki
05a7e4eb64 ruby: add msgpack.mingw.{gemspec,sh} 2010-03-02 17:09:59 +09:00
frsyuki
7a0acf2838 Merge branch 'master' of frsyuki@git.sourceforge.jp:/gitroot/msgpack/msgpack 2010-03-01 18:00:16 +09:00
frsyuki
27787505e0 strict-aliasing rule 2 2010-02-27 02:37:01 +09:00
frsyuki
2c8048115d Merge branch 'master' of frsyuki@git.sourceforge.jp:/gitroot/msgpack/msgpack 2010-02-18 14:31:41 +09:00
frsyuki
7df1780853 ruby: makegem.sh 2010-02-06 21:31:16 +09:00
frsyuki
d5609f3207 ruby: makegem.sh 2010-02-06 21:28:27 +09:00
frsyuki
cd10fbc1fe removed symbolic links 2010-02-06 20:09:41 +09:00
firewood
ca0b085d15 add a blanc after Japanese comment 2010-02-05 22:50:05 +09:00
firewood
9a034234d8 add vc2005 project file. 2010-02-05 22:49:28 +09:00
firewood
66ef6c9e4c undef after including winsock2.h. 2010-02-05 22:49:00 +09:00
frsyuki
7df60b259b MSVC2005 compatibility (@hotpepsi++) 2010-02-02 10:52:42 +09:00
frsyuki
34b3bbc883 ruby: add Unpacker#each 2010-01-29 17:23:48 +09:00
Naoki INADA
e02d20dd74 replace setup by setup_dev. 2010-01-25 20:52:48 +09:00
Naoki INADA
1a11608f1f cythoning *.pyx when sdist. 2010-01-25 20:51:55 +09:00
Naoki INADA
9e2c9d7812 Tiny fix in README 2010-01-25 12:21:46 +09:00
Kazuki Ohta
404a393315 c, cpp: fix test problem
- using LDADD instead of LDFLAGS
- fix include path in test.cpp
2010-01-21 21:55:06 +09:00
frsyuki
c69092e110 configure.in: fix message 2010-01-21 17:25:32 +09:00
frsyuki
ebc0eeac79 c,cpp: 0.4.1 2010-01-20 15:17:33 +09:00
frsyuki
2b72f35c32 configure.in: show error message if __sync_* atomic operations are not supported 2010-01-20 14:49:51 +09:00
frsyuki
d8212ad620 strict-aliasing rule 2010-01-20 14:46:54 +09:00
Kazuki Ohta
1066bb38a8 add tests for multi[map, set] and tr1::unordered_[multi][map, set] 2010-01-16 02:03:11 +09:00
frsyuki
2bf3f1856f c,cpp: configure.in: version 0.4.0 2010-01-15 14:45:52 +09:00
frsyuki
f145129f6e c,cpp: optimize msgpack_vrefbuffer 2010-01-15 05:29:41 +09:00
frsyuki
8d365458d5 c,cpp: optimize msgpack_zone: variable-length array of chunk -> list of chunk 2010-01-15 05:27:44 +09:00
frsyuki
55cfbf378e cpp: add msgpack/type/tr1/unordered_{map,set}.hpp 2010-01-14 21:20:32 +09:00
frsyuki
d76093b148 import MessagePack for Java 2010-01-08 17:34:14 +09:00
tokuhirom
7873e41e00 Perl: change for release Data-MessagePack-0.09 2010-01-04 12:10:46 +09:00
tokuhirom
9817e9b18d Perl: support NVTYPE=="long double" or IVTYPE="long long" environment. 2010-01-04 11:59:52 +09:00
tokuhirom
519716bbe4 Merge branch 'master' of git://git.sourceforge.jp/gitroot/msgpack/msgpack 2010-01-04 11:23:40 +09:00
frsyuki
c2dd22ec10 c,cpp: add msgpack_vrefbuffer_migrate, msgpack::vrefbuffer::migrate 2009-12-19 22:09:29 +09:00
Naoki INADA
232aced926 Update gitignore. 2009-12-17 18:03:33 +09:00
Naoki INADA
63b9a876b0 Fix tests. 2009-12-17 17:58:41 +09:00
inada-n
5cf85a82d3 Add .gitignore for Python. 2009-12-17 15:20:20 +09:00
inada-n
b9f78821d4 Make tuple default. 2009-12-17 15:19:18 +09:00
Naoki INADA
f4c5b15cc6 Add use_tuple option that returns tuple for array object to Unpacker. 2009-12-17 11:13:47 +09:00
Naoki INADA
4d33bd456c Update new headers. 2009-12-17 10:43:22 +09:00
Naoki INADA
3a5f7f53ff Start 0.2.0 2009-12-17 10:43:01 +09:00
inada-n
1ed4236bcf Make new Python release. 2009-12-16 22:18:17 +09:00
inada-n
5ff2c6be74 Fix bug come from previous commit 2009-12-16 22:14:13 +09:00
inada-n
dd18402737 Fix stream unpacker broken. 2009-12-16 22:05:31 +09:00
frsyuki
686e8ca0f0 c,cpp: fix unpacker 2009-12-16 04:08:36 +09:00
frsyuki
5aa47d6677 cpp: zone::push_finalizer supports std::auto_ptr<T> 2009-12-16 03:52:14 +09:00
frsyuki
0d44348c7d ruby: version 0.3.2 2009-12-11 04:13:24 +09:00
frsyuki
35929b46ae add msgpack/sysdep.h 2009-12-10 07:22:39 +09:00
frsyuki
ba3ba0367c msgpack template: macros for compilers that doesn't not support Case Ranges 2009-12-10 06:40:29 +09:00
frsyuki
7ce866ad7c msgpack template: architecture specific endian conversion 2009-12-10 06:19:53 +09:00
frsyuki
0ae1965f6b ruby: fixes MessagePack_Unpacker_mark marks uninitialized map_key 2009-12-10 04:32:33 +09:00
frsyuki
eb9e892491 import MessagePack for Java implementation plan 3 2009-11-26 11:22:08 +09:00
frsyuki
e39e1d4f60 import MessagePack for Java implementation plan 2 2009-11-12 01:10:36 +09:00
Naoki INADA
93a95725fc Fix Makefile 2009-11-05 14:26:12 +09:00
Naoki INADA
4758d9f04b Fix to use MANIEFST.in. 2009-11-05 14:24:47 +09:00
frsyuki
d39c016e1d java: fix streaming de/serializer 2009-10-25 02:41:55 +09:00
frsyuki
5393a0df16 import MessagePack for Java implementation plan 1 2009-10-25 01:27:09 +09:00
Tokuhiro Matsuno
68176e10f5 added some pattern to MANIFEST.SKIP 2009-10-22 14:34:53 +09:00
Tokuhiro Matsuno
c6a2569af8 - generate README automatically
- added LICENSE term
2009-10-22 14:32:39 +09:00
frsyuki
3424dc916c cpp: add missing type::tuple::tuple(object o) 2009-10-09 17:49:30 +09:00
frsyuki
c8ad32a39e cpp: preprocess.sh: more verbose 2009-10-05 23:31:08 +09:00
Kazuki Ohta
d0b76814b0 cpp: add tests for stream unpacker api 2009-09-12 03:12:53 +09:00
frsyuki
bf3cb63d46 cpp: version 0.3.8 2009-09-10 13:53:12 +09:00
frsyuki
8da7b692f6 cpp: define, type::tuple: GENERATION_LIMIT = 31 2009-09-10 13:50:19 +09:00
Kazuki Ohta
320c79db49 c++: add vrefbuffer test 2009-09-04 16:20:29 +09:00
frsyuki
ebf64d9892 cpp: test.cpp: fixes EXPECT_EQ rule 2009-08-26 12:28:08 +09:00
frsyuki
c12d5b8461 c: test.cpp: add msgpack_sbuffer_destroy and msgpack_zone_destroy 2009-08-26 12:27:28 +09:00
Kazuki Ohta
7186edc45e C: more strict tests for float, double
C++: more strict tests for float, double & enum, union member
2009-08-26 11:52:12 +09:00
Kazuki Ohta
c94772104d C: add test for map
C++: add tests for primitive types, stl types, user-defined type
2009-08-26 11:28:54 +09:00
Kazuki Ohta
9374571056 C: add more tests (float, double, nil, true, false, array, raw) 2009-08-26 09:24:07 +09:00
Kazuki Ohta
c232e91f83 c: fix bugs in c/test.cpp and add more tests 2009-08-25 19:26:54 +09:00
Kazuki Ohta
5b8777026a c: add sometests for serialization 2009-08-25 19:04:21 +09:00
Kazuki Ohta
51e435d46c fix build 2009-08-25 18:40:06 +09:00
frsyuki
d3f9ab7dec add c/test.cpp cpp/test.cpp 2009-08-25 18:35:26 +09:00
frsyuki
1ba330c473 fix cpp/preprocess.sh 2009-08-25 18:25:58 +09:00
frsyuki
dba7f480ed cpp: add missing preprocess.sh file 2009-08-19 17:50:15 +09:00
frsyuki
3a39accb0b cpp: preprocess eruby templates on ./bootstrap; released package doesn't require erb 2009-08-19 17:47:22 +09:00
frsyuki
387eca6fbf cpp-0.3.7 2009-08-19 17:36:05 +09:00
frsyuki
b2381d0513 cpp: fix overflow check for minimum number of signed integer type 2009-08-19 15:10:10 +09:00
frsyuki
92952f6566 c++: fix object >> std::string 2009-08-10 22:16:44 +09:00
frsyuki
a62a5d6c69 c++: fix type.hpp 2009-08-10 18:33:35 +09:00
frsyuki
0627324da6 c++: rebuild type/*.hpp 2009-08-10 18:26:01 +09:00
frsyuki
394331cd4e c++: add std::pair and std::set serializer 2009-08-10 17:34:21 +09:00
frsyuki
0491768fb2 c++: fix Makefile.am 2009-08-10 15:58:43 +09:00
frsyuki
a5705183d6 0.3.5 2009-08-07 13:32:32 +09:00
frsyuki
95a6316cc7 cpp: fix msgpack::type::make_define() 2009-08-07 13:32:07 +09:00
frsyuki
be32e3b1fb cpp: add missing msgpack::type::make_tuple() 2009-08-07 13:31:42 +09:00
frsyuki
b4cb5e23c0 fix Makefile.am 2009-08-07 11:28:23 +09:00
frsyuki
1375732c80 add 2009-08-07 11:15:33 +09:00
frsyuki
7fbe845434 cpp: msgpack::define is obsolete 2009-08-06 13:59:48 +09:00
frsyuki
3afa9f265e cpp: add msgpack::type::define 2009-08-06 13:51:49 +09:00
frsyuki
ec8932d6a1 fix missing tuple<>::value_type 2009-08-06 13:28:41 +09:00
frsyuki
f7a9805f7b operator>> (object, std::vector<T>): return reference; don't copy 2009-08-06 13:26:34 +09:00
frsyuki
aaef612a05 Makefile.am: don't package perl and ruby files 2009-08-06 13:20:43 +09:00
Tokuhiro Matsuno
da9b75f553 Checking in changes prior to tagging of version 0.08. Changelog diff is:
diff --git a/perl/Changes b/perl/Changes
index 4e7f1d7..c6e370c 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.08
+
+    - fixed PVNV issue...
+
 0.07

     - do not use switch (SvTYPE(val)).
2009-07-30 16:52:13 +09:00
Tokuhiro Matsuno
d3906bd1ab Perl: use M::I::XSUtil 2009-07-30 16:38:03 +09:00
Tokuhiro Matsuno
4db90d23ac - fixed SVt_PVNV issue. 2009-07-30 16:22:00 +09:00
Tokuhiro Matsuno
bb455c1f71 perl: display module version 2009-07-30 13:29:24 +09:00
Tokuhiro Matsuno
3275eee281 Perl: display original data 2009-07-30 13:24:38 +09:00
Tokuhiro Matsuno
0fe79a7752 Perl: added benchmark script for memroy-usage 2009-07-30 13:19:49 +09:00
Tokuhiro Matsuno
794adf9469 Checking in changes prior to tagging of version 0.07. Changelog diff is:
diff --git a/perl/Changes b/perl/Changes
index 1a51ddf..4e7f1d7 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.07
+
+    - do not use switch (SvTYPE(val)).
+
 0.06

     - use SvNOK.
2009-07-22 16:42:12 +09:00
Tokuhiro Matsuno
718227bc2c Perl: do not use switch (SvTYPE) 2009-07-22 16:40:15 +09:00
Tokuhiro Matsuno
390c5ad8a0 added test case. 2009-07-22 13:41:31 +09:00
Tokuhiro Matsuno
2da4b17d0b Merge branch 'master' of tokuhirom@git.sourceforge.jp:/gitroot/msgpack/msgpack 2009-07-22 13:28:27 +09:00
inada-n
d19c488929 version: python-0.1.1 2009-07-13 15:52:25 +09:00
inada-n
0db5e0439d Fix: Unpacker.unpack() may raise StopIteration before unpacking large object when deserializing from file. 2009-07-13 15:49:38 +09:00
inada-n
6083bad5ff Fix wrong MANIFEST. 2009-07-13 14:46:53 +09:00
inada-n
63a507a123 merge python binding from bzr. 2009-07-13 14:40:02 +09:00
Naoki INADA
294e3fe7ab Add setup script for distribution. 2009-07-13 14:27:57 +09:00
Naoki INADA
e5c49dae13 Release 0.1.0 2009-07-12 20:02:21 +09:00
Naoki INADA
900785e1aa Clean up 2009-07-12 09:29:11 +09:00
Naoki INADA
979efbb950 Support MinGW. 2009-07-09 13:41:04 +09:00
Tokuhiro Matsuno
7da1a9b3cf Checking in changes prior to tagging of version 0.06. Changelog diff is:
diff --git a/perl/Changes b/perl/Changes
index 15603ea..1a51ddf 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.06
+
+    - use SvNOK.
+
 0.05

     - change type detection for old perl
2009-07-03 18:19:29 +09:00
Tokuhiro Matsuno
661f273481 Perl: use SvNOK. 2009-07-03 18:18:40 +09:00
Tokuhiro Matsuno
cb5c878b77 Checking in changes prior to tagging of version 0.05. Changelog diff is:
diff --git a/perl/Changes b/perl/Changes
index 33fb36c..15603ea 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,7 @@
+0.05
+
+    - change type detection for old perl
+
 0.04

     - check SvROK first(reported by yappo++)
2009-07-03 18:15:45 +09:00
Tokuhiro Matsuno
34ed3bc9e3 Perl: check IV by SvIOK 2009-07-03 18:09:38 +09:00
Tokuhiro Matsuno
ad7cf12128 perl: added test case for "the flag is working?" 2009-07-03 17:27:44 +09:00
Tokuhiro Matsuno
6fb6283463 Checking in changes prior to tagging of version 0.04. Changelog diff is:
diff --git a/perl/Changes b/perl/Changes
index 0c170a3..33fb36c 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,11 @@
+0.04
+
+    - check SvROK first(reported by yappo++)
+    - PreferInteger: faster string to integer conversion; support negative value
+      (frsyuki++)
+    - make PreferInteger variable magical and remove get_sv from _msgpack_pack_sv
+      (frsyuki++)
+
 0.03

     - performance tuning for too long string
2009-07-03 15:23:50 +09:00
Tokuhiro Matsuno
b45dc8db61 check SvROK first 2009-07-03 15:14:31 +09:00
Tokuhiro Matsuno
3397d261d8 Merge branch 'master' of tokuhirom@git.sourceforge.jp:/gitroot/msgpack/msgpack
Conflicts:
	perl/lib/Data/MessagePack.pm
2009-07-03 11:39:34 +09:00
frsyuki
eaa8be8ddd perl: PreferInteger: faster string to integer conversion; support negative value 2009-07-03 02:08:22 +09:00
frsyuki
0f9dcb8610 perl: make PreferInteger variable magical and remove get_sv from _msgpack_pack_sv 2009-07-03 01:49:37 +09:00
Tokuhiro Matsuno
3446c475d7 Checking in changes prior to tagging of version 0.03. Changelog diff is:
diff --git a/perl/Changes b/perl/Changes
index fb31a69..0c170a3 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,8 @@
+0.03
+
+    - performance tuning for too long string
+    - fixed memory leaks in stream unpacker
+
 0.02

     - added $Data::MessagePack::PreferInteger
2009-07-02 17:43:58 +09:00
Tokuhiro Matsuno
ffef0a0b6f oops. fixed memory leaks in stream unpacker. 2009-07-02 17:42:28 +09:00
Tokuhiro Matsuno
580fbe77e9 do not check the string longer than 10. 2009-07-02 16:40:41 +09:00
Tokuhiro Matsuno
e92e99c4d1 Perl: I don't need CCFLAGS 2009-07-02 14:43:22 +09:00
Tokuhiro Matsuno
c3f793aa09 Checking in changes prior to tagging of version 0.02. Changelog diff is:
diff --git a/perl/Changes b/perl/Changes
index 18041d4..fb31a69 100644
--- a/perl/Changes
+++ b/perl/Changes
@@ -1,3 +1,8 @@
+0.02
+
+    - added $Data::MessagePack::PreferInteger
+      (requested by yappo++)
+
 0.01

     - initial release to CPAN
2009-07-02 14:37:54 +09:00
Tokuhiro Matsuno
3d9908c8e5 Merge branch 'master' of git://git.sourceforge.jp/gitroot/msgpack/msgpack
Conflicts:
	perl/pack.c
2009-07-02 14:31:52 +09:00
Tokuhiro Matsuno
7b198d5966 s/Preferred/Prefer/g suggested by kazuho++ 2009-07-02 14:29:49 +09:00
Tokuhiro Matsuno
601209c83c support $Data::MessagePack::PreferredInteger for Data::Model 2009-07-02 14:25:48 +09:00
Naoki INADA
78db826a75 Fix memory leak. Remove stream packing feature. Add errorcheck in packing. 2009-07-01 20:55:24 +09:00
Tokuhiro Matsuno
c2a63b2c54 Checking in changes prior to tagging of version 0.01. Changelog diff is: 2009-07-01 18:40:14 +09:00
Tokuhiro Matsuno
7c27624161 added .shipit file 2009-07-01 18:34:27 +09:00
Tokuhiro Matsuno
d86b90e663 added Changes file 2009-07-01 18:34:11 +09:00
Tokuhiro Matsuno
d72bef9f9a added MANIFEST.SKIP files 2009-07-01 18:33:56 +09:00
Tokuhiro Matsuno
37972dfe3e copy files into this dir. 2009-07-01 18:20:14 +09:00
Tokuhiro Matsuno
c6496ddf13 added .gitignore file 2009-07-01 18:08:39 +09:00
Tokuhiro Matsuno
a95e8c790c this module requires perl 5.8 2009-07-01 17:45:18 +09:00
Naoki INADA
03942a1b90 Major speedup on packing. 2009-07-01 00:57:46 +09:00
Naoki INADA
d4317fdc85 Some optimization on packing. 2009-06-30 23:03:33 +09:00
Naoki INADA
b5010c71a9 Fix tests. 2009-06-29 11:21:28 +09:00
Naoki INADA
9015bd4ecf Fix error on packing unsigned long long. 2009-06-29 10:09:04 +09:00
Naoki INADA
fe2421275d Add some test cases. 2009-06-29 09:31:43 +09:00
Naoki INADA
257270c1eb Refactor packing code. 2009-06-29 08:23:49 +09:00
Naoki INADA
0b33a634a6 Update test_format. 2009-06-29 08:23:27 +09:00
Naoki INADA
3e396ef146 Don't use C++. 2009-06-28 21:24:16 +09:00
Naoki INADA
1b07b61c04 Ues more suitable type when packing. 2009-06-28 21:24:02 +09:00
Naoki INADA
fa2efcdb5b Rename test files. 2009-06-27 12:04:11 +09:00
Naoki INADA
a345131aaa Add: README 2009-06-27 12:03:00 +09:00
Naoki INADA
ffc16736ba merge to git master 2009-06-27 10:35:07 +09:00
Naoki INADA
3c3df3133c Implement streaming deserializer. 2009-06-26 14:10:20 +09:00
Naoki INADA
16a208243b merge 2009-06-26 14:09:15 +09:00
frsyuki
8f52ed26c7 version 0.3.3 2009-06-24 16:01:13 +09:00
Naoki INADA
479263989b Stop unnecessary caching. 2009-06-24 14:58:02 +09:00
Tokuhiro Matsuno
8e166de1d1 works correctly under Perl5.8.x. Perl5.8.x makes "a" as PVIV in {"a", 0}. 2009-06-24 14:46:28 +09:00
Tokuhiro Matsuno
3aef3edbad works correctly under Perl5.8.x.
Perl5.8.x makes "a" as PVIV in {"a", 0}.
2009-06-24 14:36:37 +09:00
Tokuhiro Matsuno
9a342ab7f8 update ppport.h 2009-06-24 14:11:06 +09:00
frsyuki
8596d36d02 perl package 2009-06-24 13:53:12 +09:00
Naoki INADA
423e5132a1 merge 2009-06-24 08:49:48 +09:00
Naoki INADA
1581acfd14 Make setup.py executable. 2009-06-24 14:33:36 +09:00
Naoki INADA
5d4189306a Check return value of c-api. 2009-06-24 04:25:05 +09:00
Naoki INADA
f61b282886 Reduce memory footprint. 2009-06-24 01:54:47 +09:00
Naoki INADA
3fd28d0792 Remove duplicated values. 2009-06-24 01:38:48 +09:00
Naoki INADA
dd53b141ef Remove unneccessary value. 2009-06-24 01:13:39 +09:00
Naoki INADA
99d0a41ec6 Fix setup script bug. 2009-06-24 01:13:22 +09:00
Naoki INADA
b8e5b918a3 Update manifest. 2009-06-22 22:50:05 +09:00
Naoki INADA
71af62c1df merge to master. 2009-06-22 20:08:17 +09:00
Naoki INADA
7d5f04917e Update manifest. 2009-06-22 19:55:46 +09:00
Naoki INADA
46d7c65621 Fix compile error. 2009-06-22 19:49:02 +09:00
Naoki INADA
87f5df1503 Use std::stack. 2009-06-22 15:59:02 +09:00
Naoki INADA
9a77ab57f6 merge document fix. 2009-06-22 14:55:46 +09:00
Naoki INADA
20a7ff0be8 Make msgpack package instead of module. and using Cython in setup script. 2009-06-22 14:38:36 +09:00
Naoki INADA
075081a521 Fix manifest. 2009-06-22 14:28:04 +09:00
Naoki INADA
f4387e9746 merge changing include path 2009-06-22 13:26:41 +09:00
Naoki INADA
0d14239c21 Optimize to parsing data that has a number of same short raw field. 2009-06-22 09:51:24 +09:00
Naoki INADA
2475187c7d Fix refcount leak and optimize list initialization. 2009-06-17 13:45:08 +09:00
Naoki INADA
4d6e9ffaa2 Fix can't pack float values. 2009-06-16 01:58:07 +09:00
Naoki INADA
6184e17a42 Increase stack size. 2009-06-16 01:56:04 +09:00
Naoki INADA
e814986b4e Fix document miss. 2009-06-10 13:33:42 +09:00
Naoki INADA
3a9f74e79c Make msgpack package instead of module. 2009-06-10 10:58:09 +09:00
Naoki INADA
a1fb1507d4 Refactor include path. 2009-06-10 10:45:07 +09:00
Naoki INADA
85ca594118 free buffer when packer deleted. 2009-06-09 13:12:29 +09:00
Naoki INADA
9c9393bff9 Fix setup script doesn't work. 2009-06-08 13:21:38 +09:00
Naoki INADA
560bd901f8 Fix double INCREF-ing when unpacking. 2009-06-08 12:46:02 +09:00
Naoki INADA
114ef92d42 Merge branch 'master' of git://git.sourceforge.jp/gitroot/msgpack/msgpack 2009-06-08 04:43:25 +09:00
Naoki INADA
1840ef70ae merge to trunk 2009-06-08 04:38:20 +09:00
Naoki INADA
935db853f0 add test. 2009-06-08 04:33:58 +09:00
Naoki INADA
17d2ca2d63 Fix unpacking True, False and True. 2009-06-08 04:33:47 +09:00
Naoki INADA
c930f5367b add cythoned source and setup script. 2009-06-08 01:43:50 +09:00
Naoki INADA
d8a3bc920c refactoring 2009-06-08 01:30:43 +09:00
Naoki INADA
711e4817a5 support packing long and tuple. add missing files. 2009-06-08 00:23:38 +09:00
frsyuki
7cd359c1fd add msgpack_vrefbuffer, msgpack::vrefbuffer 2009-06-07 14:59:50 +09:00
frsyuki
2598d98922 Merge branch 'master' of frsyuki@git.sourceforge.jp:/gitroot/msgpack/msgpack 2009-06-07 13:33:22 +09:00
frsyuki
8617213149 cpp: fix map<K, V> converter 2009-06-03 22:01:27 +09:00
Naoki INADA
3628ea22d4 add pyx 2009-05-22 14:31:20 +09:00
frsyuki
6a0729ea91 cpp: const 2009-05-13 17:53:27 +09:00
Tokuhiro Matsuno
b0062a7f6f perl: oops. this doens't needed. 2009-04-15 23:14:56 +09:00
Tokuhiro Matsuno
b140b27b9a perl: added argument check 2009-04-15 23:11:26 +09:00
Tokuhiro Matsuno
e0bd2a2911 perl: added benchmark script for deserialization 2009-04-15 23:06:47 +09:00
Tokuhiro Matsuno
ea41db4cc7 perl: renamed benchmark script 2009-04-15 23:02:27 +09:00
Tokuhiro Matsuno
5a201be844 perl: use more efficent strategy for memory allocation.this code taken from JSON::XS. thanks to mlehmann++ 2009-04-15 22:43:59 +09:00
Tokuhiro Matsuno
28e113fd00 oops. remove debugging code. 2009-04-15 22:43:16 +09:00
Tokuhiro Matsuno
5710b87b06 perl: enhancement portability 2009-04-15 13:09:05 +09:00
Tokuhiro Matsuno
8c62d93bca added perl support 2009-04-15 12:55:41 +09:00
frsyuki
b8cc8b72bd version 0.3.1 2009-03-04 01:54:07 +09:00
frsyuki
cc7379d532 more test caces 2009-03-04 01:36:56 +09:00
frsyuki
163fc6f589 fix serialization bug on BigEndian environment 3 2009-03-04 01:15:22 +09:00
frsyuki
c7f193e441 fix serialization bug on BigEndian environment 2009-03-04 01:04:43 +09:00
frsyuki
09978e500a update ruby/msgpack.gemspec 2009-03-01 18:32:50 +09:00
frsyuki
2fad10ca3f zone::base 2009-03-01 16:40:02 +09:00
frsyuki
e707b7a600 zone::push_finalizer reverts memory allocation on exception 2009-03-01 15:49:24 +09:00
frsyuki
e7403013e5 msgpack_zone: sizeof(int) bytes alignment 2009-03-01 14:59:13 +09:00
frsyuki
c3f9696268 fix packaging problem 2009-03-01 13:46:20 +09:00
frsyuki
cb24a0c24f fix msgpack_unpacker_expand_buffer 2009-03-01 03:39:34 +09:00
frsyuki
0efb8160b9 msgpack_zone_clear, msgpack::zone::clear 2009-03-01 02:55:45 +09:00
frsyuki
bf13ba72b5 fix unpacker 2009-03-01 02:27:04 +09:00
frsyuki
6fc38d1669 msgpack::pack is not obsolete 2009-03-01 01:31:12 +09:00
frsyuki
879c70f93a fix msgpack_sbuffer_release 2009-03-01 01:13:31 +09:00
frsyuki
6fda01111e msgpack::sbuffer::data() const 2009-03-01 01:06:16 +09:00
frsyuki
4f4fa39cd5 c: msgpack_sbuffer; cpp: msgpack::sbuffer 2009-03-01 00:59:15 +09:00
frsyuki (none)
c60b6be548 add NOTICE file 2009-02-26 18:37:13 +09:00
frsyuki (none)
9b4b49a6a8 example: limit message size 2009-02-26 01:33:34 +09:00
frsyuki (none)
c0baf9b873 add msgpack_unpacker_message_size 2009-02-26 01:27:00 +09:00
frsyuki (none)
65ef9cab66 remove msgpack_unpacker_buffered_size, add msgpack_unpacker_parsed_size 2009-02-26 01:15:14 +09:00
frsyuki (none)
6ffee9e54a c: msgpack_unpacker_buffered_size; c++: unpacker::buffered_size 2009-02-25 23:31:53 +09:00
frsyuki (none)
43360e3786 fix msgpack::unpack_return 2009-02-25 18:55:56 +09:00
frsyuki (none)
4d708aa4da c: msgpack_pack_object 2009-02-24 16:37:47 +09:00
frsyuki (none)
5d51129e65 add example/simple.c 2009-02-24 16:37:01 +09:00
frsyuki (none)
a0b82e39e1 AC_CONFIG_AUX_DIR(ac) 2009-02-22 15:47:06 +09:00
frsyuki (none)
9642368835 type conversion operator msgpack_object <-> msgpack::object 2009-02-22 15:36:02 +09:00
frsyuki (none)
cbf7afc1cc c and c++: rewritten and integrated 2009-02-22 15:14:21 +09:00
94 changed files with 512 additions and 15838 deletions

19
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,19 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
msgpack-c or msgpack-cxx version.
e.g) msgpack-cxx 5.0.0
**To Reproduce**
Please prepare https://stackoverflow.com/help/minimal-reproducible-example
**Expected behavior**
A clear and concise description of what you expected to happen.

View File

@ -1 +0,0 @@
FURUHASHI Sadayuki <frsyuki _at_ users.sourceforge.jp>

412
CHANGELOG.md Normal file
View File

@ -0,0 +1,412 @@
# 2020-06-05 version 3.3.0
* Add json example for C (#870)
* Add both header and body packing functions for C (#870)
* Set default ref_size and chunk_size to vrefbuffer (#865)
* Add examples (#861)
* Improve build system (#839, #842)
* Improve tests (#829)
* Improve documents (#828)
* Remove some warnings (#827, #851, #871)
* Improve CI environment (#824, #831, #833, #834, #846, #860, 874)
# 2019-12-10 version 3.2.1
* Fix snprintf return value checking (#821)
* Remove some warnings (#819)
* Fix fbuffer result checking (#812)
* Fix temporary object handling (#807)
* Improve cmake support (#804)
* Fix invalid `int main` parameter (#800)
* Improve supporting platform (#797, #817)
* Fix ZLIB error handling (#795)
* Remove unused variable (#793)
* Improve integer overflow checking (#792)
# 2019-05-27 version 3.2.0
* Fix invalid include (#783)
* Add timespec support (#781)
* Fix unchecked fnprintf on C (#780)
* Improve integer overflow checking on C (#776)
* Fix warnings on `-Wconversion` (#770, #777, #784)
* Fix invalid passed by value on aligned_zone_size_visitor (#764)
* Improve windows support (#757, #779)
* Fix msgpack::object size caluclation error (#754)
* Fix memory error on example code (#753)
* Fix redundant memory allocation on C (#747)
* Fix msgpack::type::tuple base class conversion (#743)
# 2018-09-09 version 3.1.1
* Add force endian set functionality (#736)
* Fix vrefbuffer memory management problem (#733)
* Fix msvc specific problem (#731, #732)
* Update boost from 1.61.0 to 1.68.0 (#730)
* Fix msgpack_timestamp type mismatch bug (#726)
# 2018-08-10 version 3.1.0
* Improve documents (#687, #718)
* Add fuzzer support (#689)
* Fix msgpack::object union member access bug (#694)
* Improve cross platform configuration (#704)
* Fix out of range dereference bug of EXT (#705)
* Add timestamp support. std::chrono::system_clock::time_point is mapped to TIMESTAMP (#706)
* Add minimal timestamp support for C. The type `msgpack_timestamp` and the function `msgpack_object_to_timestamp()` are introduced (#707)
* Improve MSGPACK_DEFINE family name confliction probability (#710)
* Add no static-library build option (BUILD_SHARED_LIBS=ON) (#713, #717, #722)
* Add header only cmake target (#721)
* Add `std::byte` adaptor (#719)
* Remove some warnings (#720)
# 2018-05-12 version 3.0.1
* Add fuzz directory to release tar ball (#686)
* Add include file checking for X-Code (#683)
# 2018-05-09 version 3.0.0
## << breaking changes >>
* Change offset parameter updating rule. If parse error happens, offset is updated to the error position. (#639, #666)
## << other updates >>
* Improve cross platform configuration (#655, #677)
* Improve build system (#647)
* Improve user class adaptor (#645, #673)
* Improve msgpack::object visitation logic (#676)
* Remove some warnings (#641, 659)
* Add `->` and `*` operators to object_handle (#635)
* Improve CI environment (#631, #634, #643, #657, #662, #668)
* Improve documents (#630, #661)
* Refactoring (#670)
* Add OSS-Fuzz support (#672, #674, #675, #678)
# 2017-08-04 version 2.1.5
* Improve cross platform configuration (#624)
* Add boost asio examples (including zlib) (#610)
* Remove some warnings (#611)
* Fix unpack visitor to treat float32/64 correctly (#613)
* Improve documents (#616)
* Fix alignment problem on some platform (#617, #518)
* Fix conflict std::tuple, std::pair, and boost::fusion::sequence problem (#619)
# 2017-08-03 version 2.1.4 (Invalid)
* See https://github.com/msgpack/msgpack-c/issues/623
# 2017-06-15 version 2.1.3
* Improve build system (#603)
* Add C++17 adaptors `std::optional` and `std::string_view`. (#607, #608)
* Improve cross platform configuration (#601)
* Remove some warnings (#599, #602, #605)
# 2017-06-07 version 2.1.2
* Improve documents (#565)
* Fix empty map parse bug (#568)
* Improve build system (#569, #570, #572, #579, #591, #592)
* Remove some warnings (#574, #578, #586, #588)
* Improve cross platform configuration (#577, #582)
* Add cmake package config support (#580)
* Fix streaming unpack bug (#585)
# 2017-02-04 version 2.1.1
* Fix unpacker's buffer management bug (#561)
* Add boost string_view adaptor (#558)
* Remove some warnings (#557, #559)
* Improve coding style (#556)
# 2017-01-10 version 2.1.0
## << breaking changes >>
* Fix object internal data type is float if msgpack format is float32 (#531)
## << recommended changes >>
* Add `FLOAT64` type. Please use it instead of `DOUBLE` (#531)
* Add `FLOAT32` type. Please use it instead of `FLOAT` (#531)
## << other updates >>
* Add iterator based parse/unpack function(experimental) (#553)
* Add `[[deprecated]]` attribute for C++14 (#552)
* Fix `msgpack_unpack()` return code (#548)
* Fix integer overflow (#547, #549, #550)
* Add example codes (#542)
* Add MSGPACK_NVP. You can use not only variable name but also any strings (#535)
* Fix and Improve build system (#532, #545)
* Fix `gcc_atomic.hpp` include path (#529, #530)
* Improve CI environment (#526)
* Improve documents (#524)
* Add msgpack_unpacker_next_with_size() function (#515)
* Fix `as()` applying condition (#511)
* Fix fbuffer write (#504)
* Add gcc bug workaround (#499)
* Improve object print (#497, #500, #505, #533)
* Remove some warnings (#495, #506, #508, #513, #528, #538, #545)
# 2016-06-25 version 2.0.0
## << breaking changes >>
* Removed autotools support. Use cmake instead (#476, #479)
* Removed pointer version of msgpack::unpack APIs. Use reference version instead (#453)
* Removed MSGPACK_DISABLE_LEGACY_CONVERT. msgpack::object::convert(T*) is removed by default. Use msgpack::object::convert(T&) instead (#451)
* Removed msgpacl::type::nil. Use nil_t or define MSGPACK_USE_LECACY_NIL (#444)
* Removed std::string to msgpack::object conversion (#434)
## << recommended changes >>
* Replaced msgpack::unpacked with msgpack::object_handle. msgpack::unpacked is kept as a typedef of msgpack::object_handle. (#448)
## << other updates >>
* Add strict size checking adaptor. Relaxed tuple conversion (#489)
* Fix and Improve example codes (#487)
* Add C++/CLI support for nullptr (#481)
* Update the boost libraries that are contained by msgpack-c (#475)
* Fix gcc_atomic.hpp location (#474)
* Add C-Style array support (#466, #488)
* Fix include file dependency (#464)
* Add a visitor version of unpack API (#461)
* Fix JSON string conversion from "nil" to "null" (#458)
* Fix and Improve build system (#455, #471, #473, #486, #491)
* Fix comments (#452)
* Fix unintentional msgpack::zone moving problem (#447)
* Fix operator>> and << for msgpack::object (#443)
* Fix C++03 msgpack::zone::clear() memory access violation bug (#441)
* Fix TARGET_OS_IPHONE checking (#436)
* Fix invalid front() call for empty container (#435)
* Fix compile error on g++6 (C++11 only) (#426, #430)
* Fix zone size expansion logic (#423)
* Fix wrong hader file dependency (#421)
* Fix msvc specific problem (#420)
* Add v2 API support (#415)
# 2016-01-22 version 1.4.0
## << recommended changes >>
* Define [MSGPACK_DISABLE_LEGACY_NIL](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_nil-since-140), then `msgpack::type::nil` is replaced by with `msgpack::type::nil_t` (#408, #411, #412).
Replace `msgpack::type::nil` with `msgpack::type::nil_t` in client codes.
`msgpack::type::nil` will be removed on the version 2.0.0.
* Define [MSGPACK_DISABLE_LEGACY_CONVERT](https://github.com/msgpack/msgpack-c/wiki/v1_1_cpp_configure#msgpack_disable_legacy_convert-since-140), then `msgpack::object::convert(T*)` is removed (#410).
Replace calling `msgpack::bojectconvert(T*)` with `msgpack::bojectconvert(T&)` in client codes as follows:
```C++
int i;
obj.convert(&i); // before
```
```C++
int i;
obj.convert(i); // after
```
`msgpack::object::convert(T*)` will be removed on the version 2.0.0.
Define the macros above as follows when you compile C++ codes that use msgpack-c:
```
g++ -Ipath_to_msgpack/include -DMSGPACK_DISABLE_LEGACY_NIL -DMSGPACK_DISABLE_LEGACY_CONVERT your_code.cpp
```
You can compile existing codes without defining macros above but I recommend defining them and updating your codes to fix the issues #408, #411, #412, #399, and #410. It is also a good preparation for the version 2.0.0.
## << other updates >>
* Improve documents (#387, #407)
* Remove C++ version library (#394, #402)
* Add Doxyfile and ChangeLog to the distribution package (#397)
* Add signed/unsigned char test to travis-ci (#398)
* Remove some warnings (#400, #401, #409)
* Fix endian checking. (#404)
# 2015-11-21 version 1.3.0
* Change the license from the Apache License Version 2.0 to the
Boost Software License, Version 1.0.(#386)
* Remove some warnings (#365)
* Add std::reference_wrapper support(#373, #384)
* Improve tests (#375, #378, #379, #380)
* Fix msvc specific problem (#376, #383)
* Fix typos (#381)
# 2015-09-04 version 1.2.0
## << breaking changes >>
* Change std::vector<unsigned char> and std::array<unsigned char>
mapped to BIN instead of ARRAY (#243)
* Remove redundant copy (#285)
## << other updates >>
* Add array_ref to map to ARRAY (#243)
* Add variant type and adaptor (#349)
* Add object::convert_if_not_nil() (#357)
* Fix invalid offset update (#354)
* Add C++11 support on MSVC2015(#339, #347)
* Fix and Improve build system (#346, #350, #361, #363)
* Import Boost.Preprocessor as a part of msgpack-c (#312)
* Fix OSX with libc++ specific errors (#334, #362)
* Add customized containers support (#330)
* Add std::unique_ptr and std::shared_ptr support (#329)
* Add missing install files (#328)
* Add shared/static library switching option (#316)
* Improve no throw description on C++11 (#313)
* Import Boost.Predef as a part of msgpack-c (#312)
* Add map based serialize support (#306)
* Add Boost.Fusion support (#305)
* Add v4 format RAW support (#304)
* Fix zbuffer with empty string problem (#303)
* Add non default constructible class support (#302, #324, #327, #331, #332, #345)
* Add inline keyword to function (template) (#299)
* Add EXT type supporting classes (#292, #308)
* Fix raw_ref != comparison (#290)
* Add object deep copy (#288)
* Remove some warnings (#284, #322, #323, #335)
* Improve compiler version checking (#283)
* Add return value to object::convert() (#282)
* Improve move semantic support in C++11 (#279, #353)
* Add Boost.StringRef support (#278)
* Improve CI environment (#276, #294, #338)
* Add converting to JSON (#274, #301)
* Fix iOS specific problem (#270)
* Improve doxtgen document generation (#269)
* Add Boost.Optional support (#268)
* Fix msvc specific problem (#267, #295)
* Add base class serialization. (#265, #277)
* Add and improve examples. (#264, #310, #311, #341, #342, #344)
* Fix wiki URL. (#263)
# 2015-04-03 version 1.1.0
## << breaking changes >>
* Remove msgpack_fwd.hpp
* Improve user types adaptation mechanism (#262)
Since version 1.0.0, users need to obey the correct include order.
However, it is very difficult to maintain the correct order in big
projects. version 1.1.0 removed this order. Users don't need to
care about include order. Migration guide from 1.0.x to 1.1.0 has
been written. See https://github.com/msgpack/msgpack-c/wiki
## << other updates >>
* Fix vector<bool> size check (#251)
* Fix inttypes.h inclusion on MSVC (#257)
* Support documents generation by Doxygen (#259)
* Remove C99 style variable declaration (#253)
* Improve documents (https://github.com/msgpack/msgpack-c/wiki)
# 2015-03-22 version 1.0.1:
* Fix compilation error on Mac 10.9 (#244)
* Fix typos in documents (#240)
* Update CHANGELOG.md for version 1.0.0 (#242)
* Fix erb templates for the next code generation (#239)
# 2015-03-10 version 1.0.0:
* Support msgpack v5 format (str, bin, and ext) https://github.com/msgpack/msgpack/blob/master/spec.md (#142)
* Support std::tuple, std::forward_list, std::array, std::unordered_set, std::unordered_map on C++11. tr1 unordered containers are still supported (#53, #130, #137, #154, #169)
* Update msgpack-c as a header-only library on C++ (#142)
* Move include directory (#142)
* Update the name of float format family on msgpack::object from 'dec' to 'f64' (#194)
* Remove existing elements on associative containers when unpacking (#127)
* Add an API versioning functionality https://github.com/msgpack/msgpack-c/wiki/cpp_versioning (#139)
* Add C++11 enum class support (#205)
* Map std::vector<char> and std::array<char> to BIN (#100)
* Map '\0' teminated char* and char const* to STR (#206)
* Add the new parameter on unpacking functions and classes to limit msgpack's bytestream size (https://github.com/msgpack/msgpack-c/wiki/cpp_unpacker#limit-size-of-elements) (#175)
* Add the copy or reference choosing function on unpack() and unpacker (https://github.com/msgpack/msgpack-c/wiki/cpp_unpacker#memory-management)
* Add the new unpack() overloads for C++11 https://github.com/msgpack/msgpack-c/wiki/cpp_unpacker (#128)
* Add a msgpack::object::with_zone (deep) copying function (#133, #163)
* Remove the compile-time defined limit of msgpack nest level on C++ (#218)
* Add the new unpack() overloads that use an existing zone (#201)
* Add the range-based for loop support on msgpack object array and map (#203)
* Add msgpack revision getter function for 'revision' (#237)
* Support EXT for C (#118, #129)
* Fix unpacking buffer allocation problem when malformed data is given (#160, #185)
* Add dll exporting function on MSVC (#162)
* Fix msgpack::zone::allocate_no_align(). Now it allocates the memory that is not aligned as expected (#171)
* Improve documents (https://github.com/msgpack/msgpack-c/wiki)
* Other bug fixes and refactoring: #62, #91, #95, #97, #107, #109, #113, #117, #119, #121, #122, #123, #126, #131, #136, #138, #140, #143, #145, #146, #150, #151, #152, #156, #157, #158, #161, #165, #170, #172, #179, #180, #181, #182, #183, #192, #195, #199, #200, #207, #211, #212, #219, #222, #224, #230, #231, #232, #233, #234, #235
# 2014-07-02 version 0.5.9:
* Support std::tr1 unordered containers by default (#51, #63, #68, #69)
* Remove some warnings (#56)
* Fix segmentation fault after malloc failures (#58, #59)
* Fix alloc/dealloc mismatch (#52, #61)
* Fix sample codes (#60, #64)
* Support implicit conversion from integer to float/double (#54)
* Improve documents (#45, #75, #82, #83)
* Support CMake (#20, #87)
* Remove Ruby dependencies in bootstrap (#86, #87)
* Add FILE* buffer (#40)
* Other bug fixes and refactoring: #39, #73, #77, #79, #80, #81, #84, #90
# 2013-12-23 version 0.5.8:
* Move to the new github repository msgpack/msgpack-c
* Support the new deserialization specification
* fixes the problem of unpack helpers for array and map with 32bit compilers (#37, #38)
* Other bug fixes and refactoring: #46, #41, #36, #35, #33, #32, #30, #29, #28, #27, #26, #25, #8, #3
* Update of documents: #23, #18, #17
# 2011-08-08 version 0.5.7:
* fixes compile error problem with llvm-gcc and Mac OS X Lion
# 2011-04-24 version 0.5.6:
* #42 fixes double-free problem on msgpack_unpacker_release_zone
# 2011-02-24 version 0.5.5:
* eliminates dependency of winsock2.h header
* fixes msgpack_vc.postbuild.bat file
* fixes some implicit cast warnings
# 2010-08-29 version 0.5.4:
* includes msgpack_vc2008.vcproj file in source package
* fixes type::fix_int types
# 2010-08-27 version 0.5.3:
* adds type::fix_{u,}int{8,16,32,64} types
* adds msgpack_pack_fix_{u,}int{8,16,32,64} functions
* adds packer<Stream>::pack_fix_{u,}int{8,16,32,64} functions
* fixes include paths
# 2010-07-14 version 0.5.2:
* type::raw::str(), operator==, operator!=, operator< and operator> are now const
* generates version.h using AC_OUTPUT macro in ./configure
# 2010-07-06 version 0.5.1:
* Add msgpack_vrefbuffer_new and msgpack_vrefbuffer_free
* Add msgpack_sbuffer_new and msgpack_sbuffer_free
* Add msgpack_unpacker_next and msgpack_unpack_next
* msgpack::unpack returns void
* Add MSGPACK_VERSION{,_MAJOR,_MINOR} macros to check header version
* Add msgpack_version{,_major,_minor} functions to check library version
* ./configure supports --disable-cxx option not to build C++ API
# 2010-04-29 version 0.5.0:
* msgpack_object_type is changed. MSGPACK_OBJECT_NIL is now 0x00.
* New safe streaming deserializer API.
* Add object::object(const T&) and object::operator=(const T&)
* Add operator==(object, const T&)
* MSGPACK_DEFINE macro defines msgpack_object(object* obj, zone* z)
* C++ programs doesn't need to link "msgpackc" library.

17
COPYING
View File

@ -1,14 +1,5 @@
Copyright (C) 2008-2009 FURUHASHI Sadayuki
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Copyright (C) 2008-2015 FURUHASHI Sadayuki
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)

View File

202
LICENSE
View File

@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

23
LICENSE_1_0.txt Normal file
View File

@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@ -1,48 +0,0 @@
if ENABLE_CXX
export ERB
SUBDIRS = c cpp
else
SUBDIRS = c
endif
nobase_include_HEADERS = \
msgpack/pack_define.h \
msgpack/pack_template.h \
msgpack/unpack_define.h \
msgpack/unpack_template.h
EXTRA_DIST = \
ruby/bench.rb \
ruby/extconf.rb \
ruby/gem/README \
ruby/gem/Rakefile \
ruby/gem/test/test_helper.rb \
ruby/gengem.sh \
ruby/msgpack.gemspec \
ruby/pack.c \
ruby/pack.h \
ruby/rbinit.c \
ruby/test_case.rb \
ruby/test_format.rb \
ruby/test_pack.rb \
ruby/unpack.c \
ruby/unpack.h \
perl/Makefile.PL \
perl/MessagePack.c \
perl/benchmark/deserialize.pl \
perl/benchmark/serialize.pl \
perl/lib/Data/MessagePack.pm \
perl/lib/Data/MessagePack \
perl/lib/Data/MessagePack/Unpacker.pod \
perl/pack.c \
perl/ppport.h \
perl/t/00_compile.t \
perl/t/01_pack.t \
perl/t/02_unpack.t \
perl/t/03_stream_unpack.t \
perl/t/04_invert.t \
perl/t/Util.pm \
perl/t/data.pl \
perl/unpack.c \
perl/xt/99_pod.t

0
NEWS
View File

16
NOTICE
View File

@ -1,4 +1,14 @@
MessagePack is developed by FURUHASHI Sadayuki, licensed under Apache License,
Version 2.0. The original software and related information is available at
http://msgpack.sourceforge.jp/.
This product bundles Boost Predef and Boost Preprocessor.
They are distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
For details, see the following files:
external/boost/predef
include/msgpack/predef.h
include/msgpack/predef/*
external/boost/preprocessor
include/msgpack/preprocessor.hpp
include/msgpack/preprocessor/*

72
README
View File

@ -1,72 +0,0 @@
MessagePack
-----------
Binary-based efficient data interchange format.
*Requirements
MessagePack is only tested on Linux and Mac OS X, but it may run on other
UNIX-like platforms.
Following programs are required to build:
- gcc >= 4.1 with C++ support
- ruby >= 1.8 (ruby is used as a preprocessor)
*Installation
Simply run ./configure && make && make install to install C and C++ binding.
$ ./configure
$ make
$ sudo make install
To install Ruby binding, run ./gengem.sh script on ruby/ directory and install
generated gem package.
$ cd ruby
$ ./gengem.sh
$ gem install gem/pkg/msgpack-*.gem
*Usage
C++:
include msgpack.hpp header and link libmsgpack library.
see example/simple.cc for example.
g++ simple.cc -lmsgpack
g++ stream.cc -lmsgpack -lpthread
C:
include msgpack.h header and link libmsgpackc library.
see example/simple.c for example.
gcc simple.c -lmsgpackc
Ruby:
require msgpack library.
see example/simple.rb for example.
ruby -rubygems simple.rb
API Document is available at http://msgpack.sourceforge.jp/.
Copyright (C) 2008-2009 FURUHASHI Sadayuki
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

41
README.md Normal file
View File

@ -0,0 +1,41 @@
`msgpack` for C/C++
===================
It's like JSON but smaller and faster.
Overview
--------
[MessagePack](http://msgpack.org/) is an efficient binary serialization
format, which lets you exchange data among multiple languages like JSON,
except that it's faster and smaller. Small integers are encoded into a
single byte and short strings require only one extra byte in
addition to the strings themselves.
### C Library
See [c_master](https://github.com/msgpack/msgpack-c/tree/c_master)
### C++ Library
See [cpp_master](https://github.com/msgpack/msgpack-c/tree/cpp_master)
### Documentation
You can get additional information including the tutorial on the
[wiki](https://github.com/msgpack/msgpack-c/wiki).
Contributing
------------
`msgpack-c` is developed on GitHub at [msgpack/msgpack-c](https://github.com/msgpack/msgpack-c).
To report an issue or send a pull request, use the
[issue tracker](https://github.com/msgpack/msgpack-c/issues).
Here's the list of [great contributors](https://github.com/msgpack/msgpack-c/graphs/contributors).
License
-------
`msgpack-c` is licensed under the Boost Software License, Version 1.0. See
the [`LICENSE_1_0.txt`](./LICENSE_1_0.txt) file for details.

120
bootstrap
View File

@ -1,120 +0,0 @@
#!/bin/sh
# vim:ts=4:sw=4
# Calls autotools to build configure script and Makefile.in.
# Generated automatically using bootstrapper 0.2.1
# http://bootstrapper.sourceforge.net/
#
# Copyright (C) 2002 Anthony Ventimiglia
#
# This bootstrap script is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
#
# Calls proper programs to create configure script and Makefile.in files.
# if run with the --clean option, bootstrap removes files it generates. To
# clean all autogenerated files (eg: for cvs imports) first run
# make distclean, then bootstrap --clean
# see bootstrapper(1) for more infor
if test x"$1" = x"--help"; then
echo "$0: automatic bootstrapping utility for GNU Autotools"
echo " cleans up old autogenerated files and runs autoconf,"
echo " automake and aclocal on local directory"
echo
echo " --clean clean up auto-generated files without"
echo " creating new scripts"
echo
exit 0
fi
#if [ -z "$NO_NEST" ];then
# cd c && ./bootstrap $@; cd ..
# cd cpp && ./bootstrap $@; cd ..
#fi
mkdir -p ac
ACLOCAL="aclocal"
ACLOCAL_FILES="aclocal.m4"
ALWAYS_CLEAN="config.status config.log config.cache libtool"
AUTOCONF="autoconf"
AUTOCONF_FILES="configure"
AUTOHEADER="autoheader"
AUTOHEADER_FILES=""
AUTOMAKE="automake --add-missing --copy"
AUTOMAKE_FILES="config.sub stamp-h.in ltmain.sh missing mkinstalldirs install-sh config.guess"
CONFIG_AUX_DIR="."
CONFIG_FILES="stamp-h ltconfig"
CONFIG_HEADER=""
if [ x`uname` = x"Darwin" ]; then
LIBTOOLIZE="glibtoolize --force --copy"
else
LIBTOOLIZE="libtoolize --force --copy"
fi
LIBTOOLIZE_FILES="config.sub ltmain.sh config.guess"
RM="rm"
SUBDIRS="[]"
# These are files created by configure, so we'll always clean them
for i in $ALWAYS_CLEAN; do
test -f $i && \
$RM $i
done
if test x"$1" = x"--clean"; then
#
#Clean Files left by previous bootstrap run
#
if test -n "$CONFIG_AUX_DIR";
then CONFIG_AUX_DIR="$CONFIG_AUX_DIR/"
fi
# Clean Libtoolize generated files
for cf in $LIBTOOLIZE_FILES; do
cf="$CONFIG_AUX_DIR$cf"
test -f $cf && \
$RM $cf
done
#aclocal.m4 created by aclocal
test -f $ACLOCAL_FILES && $RM $ACLOCAL_FILES
#Clean Autoheader Generated files
for cf in $AUTOHEADER_FILES; do
cf=$CONFIG_AUX_DIR$cf
test -f $cf && \
$RM $cf
done
# remove config header (Usaually config.h)
test -n "$CONFIG_HEADER" && test -f $CONFIG_HEADER && $RM $CONFIG_HEADER
#Clean Automake generated files
for cf in $AUTOMAKE_FILES; do
cf=$CONFIG_AUX_DIR$cf
test -f $cf && \
$RM $cf
done
for i in $SUBDIRS; do
test -f $i/Makefile.in && \
$RM $i/Makefile.in
done
#Autoconf generated files
for cf in $AUTOCONF_FILES; do
test -f $cf && \
$RM $cf
done
for cf in $CONFIG_FILES; do
cf="$CONFIG_AUX_DIR$cf"
test -f $cf && \
$RM $cf
done
else
$LIBTOOLIZE
$ACLOCAL
$AUTOHEADER
$AUTOMAKE
$AUTOCONF
fi

View File

@ -1,20 +0,0 @@
lib_LTLIBRARIES = libmsgpackc.la
libmsgpackc_la_SOURCES = \
unpack.c \
object.c \
vrefbuffer.c \
zone.c
nobase_include_HEADERS = \
msgpack.h \
msgpack/sbuffer.h \
msgpack/vrefbuffer.h \
msgpack/pack.h \
msgpack/unpack.h \
msgpack/object.h \
msgpack/zone.h
# -version-info CURRENT:REVISION:AGE
libmsgpackc_la_LDFLAGS = -version-info 1:0:0

323
c/bench.c
View File

@ -1,323 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
#include <msgpack/pack.h>
#include <msgpack/unpack.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_gen.h>
static struct timeval g_timer;
void reset_timer()
{
gettimeofday(&g_timer, NULL);
}
void show_timer(size_t bufsz)
{
struct timeval endtime;
gettimeofday(&endtime, NULL);
double sec = (endtime.tv_sec - g_timer.tv_sec)
+ (double)(endtime.tv_usec - g_timer.tv_usec) / 1000 / 1000;
printf("%f sec\n", sec);
printf("%f MB\n", ((double)bufsz)/1024/1024);
printf("%f Mbps\n", ((double)bufsz)*8/sec/1000/1000);
}
static int reformat_null(void * ctx) { return 1; }
static int reformat_boolean(void * ctx, int boolean) { return 1; }
static int reformat_number(void * ctx, const char * s, unsigned int l) { return 1; }
static int reformat_string(void * ctx, const unsigned char * stringVal, unsigned int stringLen) { return 1; }
static int reformat_map_key(void * ctx, const unsigned char * stringVal, unsigned int stringLen) { return 1; }
static int reformat_start_map(void * ctx) { return 1; }
static int reformat_end_map(void * ctx) { return 1; }
static int reformat_start_array(void * ctx) { return 1; }
static int reformat_end_array(void * ctx) { return 1; }
static void* unpack_uint8(void* data, uint8_t d) { return NULL; }
static void* unpack_uint16(void* data, uint16_t d) { return NULL; }
static void* unpack_uint32(void* data, uint32_t d) { return NULL; }
static void* unpack_uint64(void* data, uint64_t d) { return NULL; }
static void* unpack_int8(void* data, int8_t d) { return NULL; }
static void* unpack_int16(void* data, int16_t d) { return NULL; }
static void* unpack_int32(void* data, int32_t d) { return NULL; }
static void* unpack_int64(void* data, int64_t d) { return NULL; }
static void* unpack_float(void* data, float d) { return NULL; }
static void* unpack_double(void* data, double d) { return NULL; }
static void* unpack_nil(void* data) { return NULL; }
static void* unpack_true(void* data) { return NULL; }
static void* unpack_false(void* data) { return NULL; }
static void* unpack_array(void* data, unsigned int n) { return NULL; }
static void unpack_array_item(void* data, void* c, void* o) { }
static void* unpack_map(void* data, unsigned int n) { return NULL; }
static void unpack_map_item(void* data, void* c, void* k, void* v) { }
static void* unpack_raw(void* data, const char* b, const char* p, unsigned int l) { /*printf("unpack raw %p %lu\n",p,l);*/ return NULL; }
typedef struct {
size_t allocated;
size_t length;
char* buffer;
} pack_buffer;
static const size_t PACK_INITIAL_BUFFER_SIZE = 32*1024;
static void pack_buffer_init(pack_buffer* data)
{
data->buffer = malloc(PACK_INITIAL_BUFFER_SIZE);
data->length = 0;
data->allocated = PACK_INITIAL_BUFFER_SIZE;
}
static void pack_buffer_reset(pack_buffer* data)
{
data->buffer = realloc(data->buffer, PACK_INITIAL_BUFFER_SIZE);
data->allocated = PACK_INITIAL_BUFFER_SIZE;
data->length = 0;
}
static void pack_buffer_free(pack_buffer* data)
{
free(data->buffer);
}
static void pack_append_buffer(void* user, const char* b, unsigned int l)
{
pack_buffer* data = (pack_buffer*)user;
if(data->allocated - data->length < l) {
data->buffer = realloc(data->buffer, data->allocated*2);
data->allocated *= 2;
}
memcpy(data->buffer + data->length, b, l);
data->length += l;
}
static const unsigned int TASK_INT_NUM = 1<<24;
static const unsigned int TASK_STR_LEN = 1<<15;
//static const unsigned int TASK_INT_NUM = 1<<20;
//static const unsigned int TASK_STR_LEN = 1<<12;
static const char* TASK_STR_PTR;
void bench_json(void)
{
puts("== JSON ==");
yajl_gen_config gcfg = {0, NULL};
yajl_gen g = yajl_gen_alloc(&gcfg);
yajl_parser_config hcfg = { 0, 0 };
yajl_callbacks callbacks = {
reformat_null,
reformat_boolean,
NULL,
NULL,
reformat_number,
reformat_string,
reformat_start_map,
reformat_map_key,
reformat_end_map,
reformat_start_array,
reformat_end_array
};
yajl_handle h = yajl_alloc(&callbacks, &hcfg, NULL);
const unsigned char * buf;
unsigned int len;
puts("generate integer");
reset_timer();
{
unsigned int i;
yajl_gen_array_open(g);
for(i=0; i < TASK_INT_NUM; ++i) {
yajl_gen_integer(g, i);
}
yajl_gen_array_close(g);
}
show_timer(len);
yajl_gen_get_buf(g, &buf, &len);
puts("----");
puts("parse integer");
reset_timer();
{
yajl_status stat = yajl_parse(h, buf, len);
if (stat != yajl_status_ok && stat != yajl_status_insufficient_data) {
unsigned char * str = yajl_get_error(h, 1, buf, len);
fprintf(stderr, (const char *) str);
}
}
show_timer(len);
//yajl_gen_clear(g);
yajl_gen_free(g);
g = yajl_gen_alloc(&gcfg);
yajl_free(h);
h = yajl_alloc(&callbacks, &hcfg, NULL);
puts("----");
puts("generate string");
reset_timer();
{
unsigned int i;
yajl_gen_array_open(g);
for(i=0; i < TASK_STR_LEN; ++i) {
yajl_gen_string(g, (const unsigned char*)TASK_STR_PTR, i);
}
yajl_gen_array_close(g);
}
show_timer(len);
yajl_gen_get_buf(g, &buf, &len);
puts("----");
puts("parse string");
reset_timer();
{
yajl_status stat = yajl_parse(h, buf, len);
if (stat != yajl_status_ok && stat != yajl_status_insufficient_data) {
unsigned char * str = yajl_get_error(h, 1, buf, len);
fprintf(stderr, (const char *) str);
}
}
show_timer(len);
yajl_gen_free(g);
yajl_free(h);
}
void bench_msgpack(void)
{
puts("== MessagePack ==");
pack_buffer mpkbuf;
pack_buffer_init(&mpkbuf);
msgpack_pack_t* mpk = msgpack_pack_new(
&mpkbuf, pack_append_buffer);
msgpack_unpack_callback cb = {
unpack_uint8,
unpack_uint16,
unpack_uint32,
unpack_uint64,
unpack_int8,
unpack_int16,
unpack_int32,
unpack_int64,
unpack_float,
unpack_double,
unpack_nil,
unpack_true,
unpack_false,
unpack_array,
unpack_array_item,
unpack_map,
unpack_map_item,
unpack_raw,
};
msgpack_unpack_t* mupk = msgpack_unpack_new(NULL, &cb);
size_t len;
const char* buf;
puts("pack integer");
reset_timer();
{
unsigned int i;
msgpack_pack_array(mpk, TASK_INT_NUM);
for(i=0; i < TASK_INT_NUM; ++i) {
msgpack_pack_unsigned_int(mpk, i);
}
}
show_timer(mpkbuf.length);
len = mpkbuf.length;
buf = mpkbuf.buffer;
puts("----");
puts("unpack integer");
reset_timer();
{
size_t off = 0;
int ret = msgpack_unpack_execute(mupk, buf, len, &off);
if(ret < 0) {
fprintf(stderr, "Parse error.\n");
} else if(ret == 0) {
fprintf(stderr, "Not finished.\n");
}
}
show_timer(mpkbuf.length);
pack_buffer_reset(&mpkbuf);
msgpack_unpack_reset(mupk);
puts("----");
puts("pack string");
reset_timer();
{
unsigned int i;
msgpack_pack_array(mpk, TASK_STR_LEN);
for(i=0; i < TASK_STR_LEN; ++i) {
msgpack_pack_raw(mpk, i);
msgpack_pack_raw_body(mpk, TASK_STR_PTR, i);
}
}
show_timer(mpkbuf.length);
len = mpkbuf.length;
buf = mpkbuf.buffer;
puts("----");
puts("unpack string");
reset_timer();
{
size_t off = 0;
int ret = msgpack_unpack_execute(mupk, buf, len, &off);
if(ret < 0) {
fprintf(stderr, "Parse error.\n");
} else if(ret == 0) {
fprintf(stderr, "Not finished.\n");
}
}
show_timer(mpkbuf.length);
msgpack_unpack_free(mupk);
msgpack_pack_free(mpk);
pack_buffer_free(&mpkbuf);
}
int main(int argc, char* argv[])
{
char* str = malloc(TASK_STR_LEN);
memset(str, 'a', TASK_STR_LEN);
TASK_STR_PTR = str;
bench_msgpack();
bench_json();
return 0;
}

View File

@ -1,9 +0,0 @@
CFLAGS += -Wall -g -I. -I.. -O4
LDFLAGS += -lyajl
all: bench
bench: bench.o pack.o unpack.o pack.h unpack.h
$(CC) bench.o pack.o unpack.o $(CFLAGS) $(LDFLAGS) -o $@

View File

@ -1 +0,0 @@
.

View File

@ -1,23 +0,0 @@
/*
* MessagePack for C
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "msgpack/object.h"
#include "msgpack/zone.h"
#include "msgpack/pack.h"
#include "msgpack/unpack.h"
#include "msgpack/sbuffer.h"
#include "msgpack/vrefbuffer.h"

View File

@ -1,161 +0,0 @@
/*
* MessagePack for C dynamic typing routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "msgpack/object.h"
#include "msgpack/pack.h"
#include <stdio.h>
#include <inttypes.h>
int msgpack_pack_object(msgpack_packer* pk, msgpack_object d)
{
switch(d.type) {
case MSGPACK_OBJECT_NIL:
return msgpack_pack_nil(pk);
case MSGPACK_OBJECT_BOOLEAN:
if(d.via.boolean) {
return msgpack_pack_true(pk);
} else {
return msgpack_pack_false(pk);
}
case MSGPACK_OBJECT_POSITIVE_INTEGER:
return msgpack_pack_uint64(pk, d.via.u64);
case MSGPACK_OBJECT_NEGATIVE_INTEGER:
return msgpack_pack_int64(pk, d.via.i64);
case MSGPACK_OBJECT_DOUBLE:
return msgpack_pack_double(pk, d.via.dec);
case MSGPACK_OBJECT_RAW:
{
int ret = msgpack_pack_raw(pk, d.via.raw.size);
if(ret < 0) { return ret; }
return msgpack_pack_raw_body(pk, d.via.raw.ptr, d.via.raw.size);
}
case MSGPACK_OBJECT_ARRAY:
{
int ret = msgpack_pack_array(pk, d.via.array.size);
if(ret < 0) { return ret; }
msgpack_object* o = d.via.array.ptr;
msgpack_object* const oend = d.via.array.ptr + d.via.array.size;
for(; o != oend; ++o) {
ret = msgpack_pack_object(pk, *o);
if(ret < 0) { return ret; }
}
return 0;
}
case MSGPACK_OBJECT_MAP:
{
int ret = msgpack_pack_map(pk, d.via.map.size);
if(ret < 0) { return ret; }
msgpack_object_kv* kv = d.via.map.ptr;
msgpack_object_kv* const kvend = d.via.map.ptr + d.via.map.size;
for(; kv != kvend; ++kv) {
ret = msgpack_pack_object(pk, kv->key);
if(ret < 0) { return ret; }
ret = msgpack_pack_object(pk, kv->val);
if(ret < 0) { return ret; }
}
return 0;
}
default:
return -1;
}
}
void msgpack_object_print(FILE* out, msgpack_object o)
{
switch(o.type) {
case MSGPACK_OBJECT_NIL:
fprintf(out, "nil");
break;
case MSGPACK_OBJECT_BOOLEAN:
fprintf(out, (o.via.boolean ? "true" : "false"));
break;
case MSGPACK_OBJECT_POSITIVE_INTEGER:
fprintf(out, "%"PRIu64, o.via.u64);
break;
case MSGPACK_OBJECT_NEGATIVE_INTEGER:
fprintf(out, "%"PRIi64, o.via.i64);
break;
case MSGPACK_OBJECT_DOUBLE:
fprintf(out, "%f", o.via.dec);
break;
case MSGPACK_OBJECT_RAW:
fprintf(out, "\"");
fwrite(o.via.raw.ptr, o.via.raw.size, 1, out);
fprintf(out, "\"");
break;
case MSGPACK_OBJECT_ARRAY:
fprintf(out, "[");
if(o.via.array.size != 0) {
msgpack_object* p = o.via.array.ptr;
msgpack_object_print(out, *p);
++p;
msgpack_object* const pend = o.via.array.ptr + o.via.array.size;
for(; p < pend; ++p) {
fprintf(out, ", ");
msgpack_object_print(out, *p);
}
}
fprintf(out, "]");
break;
// FIXME loop optimiziation
case MSGPACK_OBJECT_MAP:
fprintf(out, "{");
if(o.via.map.size != 0) {
msgpack_object_kv* p = o.via.map.ptr;
msgpack_object_print(out, p->key);
fprintf(out, "=>");
msgpack_object_print(out, p->val);
++p;
msgpack_object_kv* const pend = o.via.map.ptr + o.via.map.size;
for(; p < pend; ++p) {
fprintf(out, ", ");
msgpack_object_print(out, p->key);
fprintf(out, "=>");
msgpack_object_print(out, p->val);
}
}
fprintf(out, "}");
break;
// FIXME loop optimiziation
default:
// FIXME
fprintf(out, "#<UNKNOWN %hu %"PRIu64">", o.type, o.via.u64);
}
}

View File

@ -1,91 +0,0 @@
/*
* MessagePack for C dynamic typing routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MSGPACK_OBJECT_H__
#define MSGPACK_OBJECT_H__
#include "msgpack/zone.h"
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
MSGPACK_OBJECT_NIL = 0x01,
MSGPACK_OBJECT_BOOLEAN = 0x02,
MSGPACK_OBJECT_POSITIVE_INTEGER = 0x03,
MSGPACK_OBJECT_NEGATIVE_INTEGER = 0x04,
MSGPACK_OBJECT_DOUBLE = 0x05,
MSGPACK_OBJECT_RAW = 0x06,
MSGPACK_OBJECT_ARRAY = 0x07,
MSGPACK_OBJECT_MAP = 0x08,
} msgpack_object_type;
struct msgpack_object;
struct msgpack_object_kv;
typedef struct {
uint32_t size;
struct msgpack_object* ptr;
} msgpack_object_array;
typedef struct {
uint32_t size;
struct msgpack_object_kv* ptr;
} msgpack_object_map;
typedef struct {
uint32_t size;
const char* ptr;
} msgpack_object_raw;
typedef union {
bool boolean;
uint64_t u64;
int64_t i64;
double dec;
msgpack_object_array array;
msgpack_object_map map;
msgpack_object_raw raw;
} msgpack_object_union;
typedef struct msgpack_object {
msgpack_object_type type;
msgpack_object_union via;
} msgpack_object;
typedef struct msgpack_object_kv {
msgpack_object key;
msgpack_object val;
} msgpack_object_kv;
void msgpack_object_print(FILE* out, msgpack_object o);
#ifdef __cplusplus
}
#endif
#endif /* msgpack/object.h */

118
c/pack.h
View File

@ -1,118 +0,0 @@
/*
* MessagePack for C packing routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MSGPACK_PACK_H__
#define MSGPACK_PACK_H__
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include "msgpack/pack_define.h"
#include "msgpack/object.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*msgpack_packer_write)(void* data, const char* buf, unsigned int len);
typedef struct msgpack_packer {
void* data;
msgpack_packer_write callback;
} msgpack_packer;
static void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback);
static msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback);
static void msgpack_packer_free(msgpack_packer* pk);
static int msgpack_pack_short(msgpack_packer* pk, short d);
static int msgpack_pack_int(msgpack_packer* pk, int d);
static int msgpack_pack_long(msgpack_packer* pk, long d);
static int msgpack_pack_long_long(msgpack_packer* pk, long long d);
static int msgpack_pack_unsigned_short(msgpack_packer* pk, unsigned short d);
static int msgpack_pack_unsigned_int(msgpack_packer* pk, unsigned int d);
static int msgpack_pack_unsigned_long(msgpack_packer* pk, unsigned long d);
static int msgpack_pack_unsigned_long_long(msgpack_packer* pk, unsigned long long d);
static int msgpack_pack_uint8(msgpack_packer* pk, uint8_t d);
static int msgpack_pack_uint16(msgpack_packer* pk, uint16_t d);
static int msgpack_pack_uint32(msgpack_packer* pk, uint32_t d);
static int msgpack_pack_uint64(msgpack_packer* pk, uint64_t d);
static int msgpack_pack_int8(msgpack_packer* pk, int8_t d);
static int msgpack_pack_int16(msgpack_packer* pk, int16_t d);
static int msgpack_pack_int32(msgpack_packer* pk, int32_t d);
static int msgpack_pack_int64(msgpack_packer* pk, int64_t d);
static int msgpack_pack_float(msgpack_packer* pk, float d);
static int msgpack_pack_double(msgpack_packer* pk, double d);
static int msgpack_pack_nil(msgpack_packer* pk);
static int msgpack_pack_true(msgpack_packer* pk);
static int msgpack_pack_false(msgpack_packer* pk);
static int msgpack_pack_array(msgpack_packer* pk, unsigned int n);
static int msgpack_pack_map(msgpack_packer* pk, unsigned int n);
static int msgpack_pack_raw(msgpack_packer* pk, size_t l);
static int msgpack_pack_raw_body(msgpack_packer* pk, const void* b, size_t l);
int msgpack_pack_object(msgpack_packer* pk, msgpack_object d);
#define msgpack_pack_inline_func(name) \
inline int msgpack_pack ## name
#define msgpack_pack_inline_func_cint(name) \
inline int msgpack_pack ## name
#define msgpack_pack_user msgpack_packer*
#define msgpack_pack_append_buffer(user, buf, len) \
return (*(user)->callback)((user)->data, (const char*)buf, len)
#include "msgpack/pack_template.h"
inline void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback)
{
pk->data = data;
pk->callback = callback;
}
inline msgpack_packer* msgpack_packer_new(void* data, msgpack_packer_write callback)
{
msgpack_packer* pk = (msgpack_packer*)calloc(1, sizeof(msgpack_packer));
if(!pk) { return NULL; }
msgpack_packer_init(pk, data, callback);
return pk;
}
inline void msgpack_packer_free(msgpack_packer* pk)
{
free(pk);
}
#ifdef __cplusplus
}
#endif
#endif /* msgpack/pack.h */

View File

@ -1,85 +0,0 @@
/*
* MessagePack for C simple buffer implementation
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MSGPACK_SBUFFER_H__
#define MSGPACK_SBUFFER_H__
#include <stdlib.h>
#include <string.h>
#ifndef MSGPACK_SBUFFER_INIT_SIZE
#define MSGPACK_SBUFFER_INIT_SIZE 2048
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct msgpack_sbuffer {
size_t size;
char* data;
size_t alloc;
} msgpack_sbuffer;
static inline void msgpack_sbuffer_init(msgpack_sbuffer* sbuf)
{
memset(sbuf, 0, sizeof(msgpack_sbuffer));
}
static inline void msgpack_sbuffer_destroy(msgpack_sbuffer* sbuf)
{
free(sbuf->data);
}
static inline int msgpack_sbuffer_write(void* data, const char* buf, unsigned int len)
{
msgpack_sbuffer* sbuf = (msgpack_sbuffer*)data;
if(sbuf->alloc - sbuf->size < len) {
size_t nsize = (sbuf->alloc) ?
sbuf->alloc * 2 : MSGPACK_SBUFFER_INIT_SIZE;
while(nsize < sbuf->size + len) { nsize *= 2; }
void* tmp = realloc(sbuf->data, nsize);
if(!tmp) { return -1; }
sbuf->data = (char*)tmp;
sbuf->alloc = nsize;
}
memcpy(sbuf->data + sbuf->size, buf, len);
sbuf->size += len;
return 0;
}
static inline char* msgpack_sbuffer_release(msgpack_sbuffer* sbuf)
{
char* tmp = sbuf->data;
sbuf->size = 0;
sbuf->data = NULL;
sbuf->alloc = 0;
return tmp;
}
#ifdef __cplusplus
}
#endif
#endif /* msgpack/sbuffer.h */

View File

@ -1,399 +0,0 @@
/*
* MessagePack for C unpacking routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "msgpack/unpack.h"
#include "msgpack/unpack_define.h"
#include <stdlib.h>
typedef struct {
msgpack_zone* z;
bool referenced;
} unpack_user;
#define msgpack_unpack_struct(name) \
struct template ## name
#define msgpack_unpack_func(ret, name) \
ret template ## name
#define msgpack_unpack_callback(name) \
template_callback ## name
#define msgpack_unpack_object msgpack_object
#define msgpack_unpack_user unpack_user
struct template_context;
typedef struct template_context template_context;
static void template_init(template_context* ctx);
static msgpack_object template_data(template_context* ctx);
static int template_execute(template_context* ctx,
const char* data, size_t len, size_t* off);
static inline msgpack_object template_callback_root(unpack_user* u)
{ msgpack_object o; return o; }
static inline int template_callback_uint8(unpack_user* u, uint8_t d, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
static inline int template_callback_uint16(unpack_user* u, uint16_t d, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
static inline int template_callback_uint32(unpack_user* u, uint32_t d, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
static inline int template_callback_uint64(unpack_user* u, uint64_t d, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
static inline int template_callback_int8(unpack_user* u, int8_t d, msgpack_object* o)
{ if(d >= 0) { o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
else { o->type = MSGPACK_OBJECT_NEGATIVE_INTEGER; o->via.i64 = d; return 0; } }
static inline int template_callback_int16(unpack_user* u, int16_t d, msgpack_object* o)
{ if(d >= 0) { o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
else { o->type = MSGPACK_OBJECT_NEGATIVE_INTEGER; o->via.i64 = d; return 0; } }
static inline int template_callback_int32(unpack_user* u, int32_t d, msgpack_object* o)
{ if(d >= 0) { o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
else { o->type = MSGPACK_OBJECT_NEGATIVE_INTEGER; o->via.i64 = d; return 0; } }
static inline int template_callback_int64(unpack_user* u, int64_t d, msgpack_object* o)
{ if(d >= 0) { o->type = MSGPACK_OBJECT_POSITIVE_INTEGER; o->via.u64 = d; return 0; }
else { o->type = MSGPACK_OBJECT_NEGATIVE_INTEGER; o->via.i64 = d; return 0; } }
static inline int template_callback_float(unpack_user* u, float d, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_DOUBLE; o->via.dec = d; return 0; }
static inline int template_callback_double(unpack_user* u, double d, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_DOUBLE; o->via.dec = d; return 0; }
static inline int template_callback_nil(unpack_user* u, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_NIL; return 0; }
static inline int template_callback_true(unpack_user* u, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_BOOLEAN; o->via.boolean = true; return 0; }
static inline int template_callback_false(unpack_user* u, msgpack_object* o)
{ o->type = MSGPACK_OBJECT_BOOLEAN; o->via.boolean = false; return 0; }
static inline int template_callback_array(unpack_user* u, unsigned int n, msgpack_object* o)
{
o->type = MSGPACK_OBJECT_ARRAY;
o->via.array.size = 0;
o->via.array.ptr = msgpack_zone_malloc(u->z, n*sizeof(msgpack_object));
if(o->via.array.ptr == NULL) { return -1; }
return 0;
}
static inline int template_callback_array_item(unpack_user* u, msgpack_object* c, msgpack_object o)
{ c->via.array.ptr[c->via.array.size++] = o; return 0; }
static inline int template_callback_map(unpack_user* u, unsigned int n, msgpack_object* o)
{
o->type = MSGPACK_OBJECT_MAP;
o->via.map.size = 0;
o->via.map.ptr = (msgpack_object_kv*)msgpack_zone_malloc(u->z, n*sizeof(msgpack_object_kv));
if(o->via.map.ptr == NULL) { return -1; }
return 0;
}
static inline int template_callback_map_item(unpack_user* u, msgpack_object* c, msgpack_object k, msgpack_object v)
{
c->via.map.ptr[c->via.map.size].key = k;
c->via.map.ptr[c->via.map.size].val = v;
++c->via.map.size;
return 0;
}
static inline int template_callback_raw(unpack_user* u, const char* b, const char* p, unsigned int l, msgpack_object* o)
{
o->type = MSGPACK_OBJECT_RAW;
o->via.raw.ptr = p;
o->via.raw.size = l;
u->referenced = true;
return 0;
}
#include "msgpack/unpack_template.h"
#define CTX_CAST(m) ((template_context*)(m))
#define CTX_REFERENCED(mpac) CTX_CAST((mpac)->ctx)->user.referenced
static const size_t COUNTER_SIZE = sizeof(unsigned int);
static inline void init_count(void* buffer)
{
*(volatile unsigned int*)buffer = 1;
}
static inline void decl_count(void* buffer)
{
//if(--*(unsigned int*)buffer == 0) {
if(__sync_sub_and_fetch((unsigned int*)buffer, 1) == 0) {
free(buffer);
}
}
static inline void incr_count(void* buffer)
{
//++*(unsigned int*)buffer;
__sync_add_and_fetch((unsigned int*)buffer, 1);
}
static inline unsigned int get_count(void* buffer)
{
return *(volatile unsigned int*)buffer;
}
bool msgpack_unpacker_init(msgpack_unpacker* mpac, size_t initial_buffer_size)
{
if(initial_buffer_size < COUNTER_SIZE) {
initial_buffer_size = COUNTER_SIZE;
}
char* buffer = (char*)malloc(initial_buffer_size);
if(buffer == NULL) {
return false;
}
void* ctx = malloc(sizeof(template_context));
if(ctx == NULL) {
free(buffer);
return false;
}
msgpack_zone* z = msgpack_zone_new(MSGPACK_ZONE_CHUNK_SIZE);
if(z == NULL) {
free(ctx);
free(buffer);
return false;
}
mpac->buffer = buffer;
mpac->used = COUNTER_SIZE;
mpac->free = initial_buffer_size - mpac->used;
mpac->off = COUNTER_SIZE;
mpac->parsed = 0;
mpac->initial_buffer_size = initial_buffer_size;
mpac->z = z;
mpac->ctx = ctx;
init_count(mpac->buffer);
template_init(CTX_CAST(mpac->ctx));
CTX_CAST(mpac->ctx)->user.z = mpac->z;
CTX_CAST(mpac->ctx)->user.referenced = false;
return true;
}
void msgpack_unpacker_destroy(msgpack_unpacker* mpac)
{
msgpack_zone_free(mpac->z);
free(mpac->ctx);
decl_count(mpac->buffer);
}
msgpack_unpacker* msgpack_unpacker_new(size_t initial_buffer_size)
{
msgpack_unpacker* mpac = (msgpack_unpacker*)malloc(sizeof(msgpack_unpacker));
if(mpac == NULL) {
return NULL;
}
if(!msgpack_unpacker_init(mpac, initial_buffer_size)) {
free(mpac);
return NULL;
}
return mpac;
}
void msgpack_unpacker_free(msgpack_unpacker* mpac)
{
msgpack_unpacker_destroy(mpac);
free(mpac);
}
bool msgpack_unpacker_expand_buffer(msgpack_unpacker* mpac, size_t size)
{
if(mpac->used == mpac->off && get_count(mpac->buffer) == 1
&& !CTX_REFERENCED(mpac)) {
// rewind buffer
mpac->free += mpac->used - COUNTER_SIZE;
mpac->used = COUNTER_SIZE;
mpac->off = COUNTER_SIZE;
if(mpac->free >= size) {
return true;
}
}
if(mpac->off == COUNTER_SIZE) {
size_t next_size = (mpac->used + mpac->free) * 2; // include COUNTER_SIZE
while(next_size < size + mpac->used) {
next_size *= 2;
}
char* tmp = (char*)realloc(mpac->buffer, next_size);
if(tmp == NULL) {
return false;
}
mpac->buffer = tmp;
mpac->free = next_size - mpac->used;
} else {
size_t next_size = mpac->initial_buffer_size; // include COUNTER_SIZE
size_t not_parsed = mpac->used - mpac->off;
while(next_size < size + not_parsed + COUNTER_SIZE) {
next_size *= 2;
}
char* tmp = (char*)malloc(next_size);
if(tmp == NULL) {
return false;
}
init_count(tmp);
memcpy(tmp+COUNTER_SIZE, mpac->buffer+mpac->off, not_parsed);
if(CTX_REFERENCED(mpac)) {
if(!msgpack_zone_push_finalizer(mpac->z, decl_count, mpac->buffer)) {
free(tmp);
return false;
}
CTX_REFERENCED(mpac) = false;
} else {
decl_count(mpac->buffer);
}
mpac->buffer = tmp;
mpac->used = not_parsed + COUNTER_SIZE;
mpac->free = next_size - mpac->used;
mpac->off = COUNTER_SIZE;
}
return true;
}
int msgpack_unpacker_execute(msgpack_unpacker* mpac)
{
size_t off = mpac->off;
int ret = template_execute(CTX_CAST(mpac->ctx),
mpac->buffer, mpac->used, &mpac->off);
if(mpac->off > off) {
mpac->parsed += mpac->off - off;
}
return ret;
}
msgpack_object msgpack_unpacker_data(msgpack_unpacker* mpac)
{
return template_data(CTX_CAST(mpac->ctx));
}
msgpack_zone* msgpack_unpacker_release_zone(msgpack_unpacker* mpac)
{
if(!msgpack_unpacker_flush_zone(mpac)) {
return false;
}
msgpack_zone* r = msgpack_zone_new(MSGPACK_ZONE_CHUNK_SIZE);
if(r == NULL) {
return NULL;
}
msgpack_zone* old = mpac->z;
mpac->z = r;
return old;
}
void msgpack_unpacker_reset_zone(msgpack_unpacker* mpac)
{
msgpack_zone_clear(mpac->z);
}
bool msgpack_unpacker_flush_zone(msgpack_unpacker* mpac)
{
if(CTX_REFERENCED(mpac)) {
if(!msgpack_zone_push_finalizer(mpac->z, decl_count, mpac->buffer)) {
return false;
}
CTX_REFERENCED(mpac) = false;
incr_count(mpac->buffer);
}
return true;
}
void msgpack_unpacker_reset(msgpack_unpacker* mpac)
{
template_init(CTX_CAST(mpac->ctx));
// don't reset referenced flag
mpac->parsed = 0;
}
msgpack_unpack_return
msgpack_unpack(const char* data, size_t len, size_t* off,
msgpack_zone* z, msgpack_object* result)
{
template_context ctx;
template_init(&ctx);
ctx.user.z = z;
ctx.user.referenced = false;
size_t noff = 0;
if(off != NULL) { noff = *off; }
int ret = template_execute(&ctx, data, len, &noff);
if(ret < 0) {
return MSGPACK_UNPACK_PARSE_ERROR;
}
if(off != NULL) { *off = noff; }
if(ret == 0) {
return MSGPACK_UNPACK_CONTINUE;
}
*result = template_data(&ctx);
if(noff < len) {
return MSGPACK_UNPACK_EXTRA_BYTES;
}
return MSGPACK_UNPACK_SUCCESS;
}

View File

@ -1,125 +0,0 @@
/*
* MessagePack for C unpacking routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef msgpack_unpacker_H__
#define msgpack_unpacker_H__
#include "msgpack/zone.h"
#include "msgpack/object.h"
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct msgpack_unpacker {
char* buffer;
size_t used;
size_t free;
size_t off;
size_t parsed;
msgpack_zone* z;
size_t initial_buffer_size;
void* ctx;
} msgpack_unpacker;
bool msgpack_unpacker_init(msgpack_unpacker* mpac, size_t initial_buffer_size);
void msgpack_unpacker_destroy(msgpack_unpacker* mpac);
msgpack_unpacker* msgpack_unpacker_new(size_t initial_buffer_size);
void msgpack_unpacker_free(msgpack_unpacker* mpac);
static inline bool msgpack_unpacker_reserve_buffer(msgpack_unpacker* mpac, size_t size);
static inline char* msgpack_unpacker_buffer(msgpack_unpacker* mpac);
static inline size_t msgpack_unpacker_buffer_capacity(const msgpack_unpacker* mpac);
static inline void msgpack_unpacker_buffer_consumed(msgpack_unpacker* mpac, size_t size);
int msgpack_unpacker_execute(msgpack_unpacker* mpac);
msgpack_object msgpack_unpacker_data(msgpack_unpacker* mpac);
msgpack_zone* msgpack_unpacker_release_zone(msgpack_unpacker* mpac);
void msgpack_unpacker_reset_zone(msgpack_unpacker* mpac);
void msgpack_unpacker_reset(msgpack_unpacker* mpac);
static inline size_t msgpack_unpacker_message_size(const msgpack_unpacker* mpac);
typedef enum {
MSGPACK_UNPACK_SUCCESS = 2,
MSGPACK_UNPACK_EXTRA_BYTES = 1,
MSGPACK_UNPACK_CONTINUE = 0,
MSGPACK_UNPACK_PARSE_ERROR = -1,
} msgpack_unpack_return;
msgpack_unpack_return
msgpack_unpack(const char* data, size_t len, size_t* off,
msgpack_zone* z, msgpack_object* result);
static inline size_t msgpack_unpacker_parsed_size(const msgpack_unpacker* mpac);
bool msgpack_unpacker_flush_zone(msgpack_unpacker* mpac);
bool msgpack_unpacker_expand_buffer(msgpack_unpacker* mpac, size_t size);
bool msgpack_unpacker_reserve_buffer(msgpack_unpacker* mpac, size_t size)
{
if(mpac->free >= size) { return true; }
return msgpack_unpacker_expand_buffer(mpac, size);
}
char* msgpack_unpacker_buffer(msgpack_unpacker* mpac)
{
return mpac->buffer + mpac->used;
}
size_t msgpack_unpacker_buffer_capacity(const msgpack_unpacker* mpac)
{
return mpac->free;
}
void msgpack_unpacker_buffer_consumed(msgpack_unpacker* mpac, size_t size)
{
mpac->used += size;
mpac->free -= size;
}
size_t msgpack_unpacker_message_size(const msgpack_unpacker* mpac)
{
return mpac->parsed - mpac->off + mpac->used;
}
size_t msgpack_unpacker_parsed_size(const msgpack_unpacker* mpac)
{
return mpac->parsed;
}
#ifdef __cplusplus
}
#endif
#endif /* msgpack/unpack.h */

View File

@ -1,135 +0,0 @@
/*
* MessagePack for C zero-copy buffer implementation
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "msgpack/vrefbuffer.h"
#include <stdlib.h>
#include <string.h>
bool msgpack_vrefbuffer_init(msgpack_vrefbuffer* vbuf,
size_t ref_size, size_t chunk_size)
{
if(chunk_size < sizeof(msgpack_vrefbuffer_chunk)+72) {
chunk_size = 72;
} else {
chunk_size -= sizeof(msgpack_vrefbuffer_chunk);
}
vbuf->chunk_size = chunk_size;
vbuf->ref_size = ref_size;
// glibcは72バイト以下のmallocが高速
size_t nfirst = (sizeof(struct iovec) < 72/2) ?
72 / sizeof(struct iovec) : 8;
struct iovec* array = (struct iovec*)malloc(
sizeof(struct iovec) * nfirst);
if(array == NULL) {
return false;
}
vbuf->tail = array;
vbuf->end = array + nfirst;
vbuf->array = array;
vbuf->chunk = (msgpack_vrefbuffer_chunk*)malloc(
chunk_size + sizeof(msgpack_vrefbuffer_chunk));
if(vbuf->chunk == NULL) {
free(array);
return false;
}
vbuf->chunk->next = NULL;
vbuf->chunk->free = chunk_size;
return true;
}
void msgpack_vrefbuffer_destroy(msgpack_vrefbuffer* vbuf)
{
msgpack_vrefbuffer_chunk* c = vbuf->chunk;
while(true) {
msgpack_vrefbuffer_chunk* n = c->next;
free(c);
if(n) {
c = n;
} else {
break;
}
}
free(vbuf->array);
}
int msgpack_vrefbuffer_append_ref(msgpack_vrefbuffer* vbuf,
const char* buf, unsigned int len)
{
if(vbuf->tail == vbuf->end) {
const size_t nused = vbuf->end - vbuf->array;
const size_t nnext = nused * 2;
struct iovec* nvec = (struct iovec*)realloc(
vbuf->array, sizeof(struct iovec)*nnext);
if(nvec == NULL) {
return -1;
}
vbuf->array = nvec;
vbuf->end = nvec + nnext;
vbuf->tail = nvec + nused;
}
vbuf->tail->iov_base = (char*)buf;
vbuf->tail->iov_len = len;
++vbuf->tail;
return 0;
}
int msgpack_vrefbuffer_append_copy(msgpack_vrefbuffer* vbuf,
const char* buf, unsigned int len)
{
msgpack_vrefbuffer_chunk* chunk = vbuf->chunk;
size_t cur_size = vbuf->chunk_size;
if(chunk->free < len) {
cur_size = (cur_size > len) ? cur_size : len;
chunk = (msgpack_vrefbuffer_chunk*)malloc(
cur_size + sizeof(msgpack_vrefbuffer_chunk));
if(chunk == NULL) {
return -1;
}
chunk->free = cur_size;
chunk->next = vbuf->chunk;
vbuf->chunk = chunk;
}
char* m = ((char*)chunk) + sizeof(msgpack_vrefbuffer_chunk)
+ (cur_size - chunk->free);
memcpy(m, buf, len);
chunk->free -= len;
if(vbuf->tail != vbuf->array && m ==
(const char*)((vbuf->tail-1)->iov_base) + (vbuf->tail-1)->iov_len) {
(vbuf->tail-1)->iov_len += len;
return 0;
} else {
return msgpack_vrefbuffer_append_ref(vbuf, m, len);
}
}

View File

@ -1,97 +0,0 @@
/*
* MessagePack for C zero-copy buffer implementation
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MSGPACK_VREFBUFFER_H__
#define MSGPACK_VREFBUFFER_H__
#include "msgpack/zone.h"
#include <sys/uio.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MSGPACK_VREFBUFFER_REF_SIZE
#define MSGPACK_VREFBUFFER_REF_SIZE 32
#endif
#ifndef MSGPACK_VREFBUFFER_CHUNK_SIZE
#define MSGPACK_VREFBUFFER_CHUNK_SIZE 2048
#endif
typedef struct msgpack_vrefbuffer_chunk {
size_t free;
struct msgpack_vrefbuffer_chunk* next;
/* data ... */
} msgpack_vrefbuffer_chunk;
typedef struct msgpack_vrefbuffer {
size_t chunk_size;
size_t ref_size;
struct iovec* tail;
struct iovec* end;
struct iovec* array;
msgpack_vrefbuffer_chunk* chunk;
} msgpack_vrefbuffer;
bool msgpack_vrefbuffer_init(msgpack_vrefbuffer* vbuf,
size_t ref_size, size_t chunk_size);
void msgpack_vrefbuffer_destroy(msgpack_vrefbuffer* vbuf);
static inline int msgpack_vrefbuffer_write(void* data, const char* buf, unsigned int len);
static inline const struct iovec* msgpack_vrefbuffer_vec(const msgpack_vrefbuffer* vref);
static inline size_t msgpack_vrefbuffer_veclen(const msgpack_vrefbuffer* vref);
int msgpack_vrefbuffer_append_copy(msgpack_vrefbuffer* vbuf,
const char* buf, unsigned int len);
int msgpack_vrefbuffer_append_ref(msgpack_vrefbuffer* vbuf,
const char* buf, unsigned int len);
int msgpack_vrefbuffer_write(void* data, const char* buf, unsigned int len)
{
msgpack_vrefbuffer* vbuf = (msgpack_vrefbuffer*)data;
if(len < vbuf->ref_size) {
return msgpack_vrefbuffer_append_copy(vbuf, buf, len);
} else {
return msgpack_vrefbuffer_append_ref(vbuf, buf, len);
}
}
const struct iovec* msgpack_vrefbuffer_vec(const msgpack_vrefbuffer* vref)
{
return vref->array;
}
size_t msgpack_vrefbuffer_veclen(const msgpack_vrefbuffer* vref)
{
return vref->tail - vref->array;
}
#ifdef __cplusplus
}
#endif
#endif /* msgpack/vrefbuffer.h */

241
c/zone.c
View File

@ -1,241 +0,0 @@
/*
* MessagePack for C memory pool implementation
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "msgpack/zone.h"
#include <stdlib.h>
#include <string.h>
static inline bool init_chunk_array(msgpack_zone_chunk_array* ca, size_t chunk_size)
{
// glibcは72バイト以下のmallocが高速
const size_t nfirst = (sizeof(msgpack_zone_chunk) < 72/2) ?
72 / sizeof(msgpack_zone_chunk) : 8;
msgpack_zone_chunk* array = (msgpack_zone_chunk*)malloc(
sizeof(msgpack_zone_chunk) * nfirst);
if(array == NULL) {
return false;
}
const size_t sz = chunk_size;
char* ptr = (char*)malloc(sz);
if(ptr == NULL) {
free(array);
return NULL;
}
ca->tail = array;
ca->end = array + nfirst;
ca->array = array;
array[0].free = sz;
array[0].ptr = ptr;
array[0].alloc = ptr;
return true;
}
static inline void destroy_chunk_array(msgpack_zone_chunk_array* ca)
{
msgpack_zone_chunk* chunk = ca->array;
for(; chunk != ca->tail+1; ++chunk) {
free(chunk->alloc);
}
free(ca->array);
}
static inline void clear_chunk_array(msgpack_zone_chunk_array* ca)
{
msgpack_zone_chunk* chunk = ca->array + 1;
for(; chunk != ca->tail+1; ++chunk) {
free(chunk->alloc);
}
ca->tail = ca->array;
ca->array[0].free += ca->array[0].ptr - (char*)ca->array[0].alloc;
ca->array[0].ptr = (char*)ca->array[0].alloc;
}
void* msgpack_zone_malloc_expand(msgpack_zone* zone, size_t size)
{
msgpack_zone_chunk_array* const ca = &zone->chunk_array;
msgpack_zone_chunk* chunk = ++ca->tail;
if(chunk == ca->end) {
// ca->arrayに空きがない
// ca->arrayを拡張する
const size_t nused = ca->end - ca->array;
const size_t nnext = (ca->end - ca->array) * 2;
chunk = (msgpack_zone_chunk*)realloc(ca->array,
sizeof(msgpack_zone_chunk) * nnext);
if(chunk == NULL) {
return NULL;
}
ca->array = chunk;
ca->end = chunk + nnext;
chunk = ca->tail = chunk + nused;
}
size_t sz = zone->chunk_size;
while(sz < size) {
sz *= 2;
}
char* ptr = (char*)malloc(sz);
if(ptr == NULL) {
return NULL;
}
chunk->free = sz - size;
chunk->ptr = ptr + size;
chunk->alloc = ptr;
return ptr;
}
static inline void init_finalizer_array(msgpack_zone_finalizer_array* fa)
{
fa->tail = NULL;
fa->end = NULL;
fa->array = NULL;
}
static inline void call_finalizer_array(msgpack_zone_finalizer_array* fa)
{
// 逆順に呼び出し
msgpack_zone_finalizer* fin = fa->tail;
for(; fin != fa->array; --fin) {
(*(fin-1)->func)((fin-1)->data);
}
}
static inline void destroy_finalizer_array(msgpack_zone_finalizer_array* fa)
{
call_finalizer_array(fa);
free(fa->array);
}
static inline void clear_finalizer_array(msgpack_zone_finalizer_array* fa)
{
call_finalizer_array(fa);
fa->tail = fa->array;
}
bool msgpack_zone_push_finalizer_expand(msgpack_zone* zone,
void (*func)(void* data), void* data)
{
msgpack_zone_finalizer_array* const fa = &zone->finalizer_array;
const size_t nused = fa->end - fa->array;
size_t nnext;
if(nused == 0) {
// 初回の呼び出しfa->tail == fa->end == fa->array == NULL
// glibcは72バイト以下のmallocが高速
nnext = (sizeof(msgpack_zone_finalizer) < 72/2) ?
72 / sizeof(msgpack_zone_finalizer) : 8;
} else {
nnext = nused * 2;
}
msgpack_zone_finalizer* tmp =
(msgpack_zone_finalizer*)realloc(fa->array,
sizeof(msgpack_zone_finalizer) * nnext);
if(tmp == NULL) {
return false;
}
fa->array = tmp;
fa->end = tmp + nnext;
fa->tail = tmp + nused;
fa->tail->func = func;
fa->tail->data = data;
++fa->tail;
return true;
}
bool msgpack_zone_is_empty(msgpack_zone* zone)
{
msgpack_zone_chunk_array* const ca = &zone->chunk_array;
msgpack_zone_finalizer_array* const fa = &zone->finalizer_array;
return ca->array[0].ptr == ca->array[0].alloc &&
ca->tail == ca->array &&
fa->tail == fa->array;
}
bool msgpack_zone_init(msgpack_zone* zone, size_t chunk_size)
{
zone->chunk_size = chunk_size;
if(!init_chunk_array(&zone->chunk_array, chunk_size)) {
return false;
}
init_finalizer_array(&zone->finalizer_array);
return true;
}
void msgpack_zone_destroy(msgpack_zone* zone)
{
destroy_finalizer_array(&zone->finalizer_array);
destroy_chunk_array(&zone->chunk_array);
}
void msgpack_zone_clear(msgpack_zone* zone)
{
clear_finalizer_array(&zone->finalizer_array);
clear_chunk_array(&zone->chunk_array);
}
msgpack_zone* msgpack_zone_new(size_t chunk_size)
{
msgpack_zone* zone = (msgpack_zone*)malloc(sizeof(msgpack_zone));
if(zone == NULL) {
return NULL;
}
if(!msgpack_zone_init(zone, chunk_size)) {
free(zone);
return NULL;
}
return zone;
}
void msgpack_zone_free(msgpack_zone* zone)
{
msgpack_zone_destroy(zone);
free(zone);
}

135
c/zone.h
View File

@ -1,135 +0,0 @@
/*
* MessagePack for C memory pool implementation
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MSGPACK_ZONE_H__
#define MSGPACK_ZONE_H__
#include <stddef.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct msgpack_zone_chunk {
size_t free;
char* ptr;
void* alloc;
} msgpack_zone_chunk;
typedef struct msgpack_zone_finalizer {
void (*func)(void* data);
void* data;
} msgpack_zone_finalizer;
typedef struct msgpack_zone_chunk_array {
msgpack_zone_chunk* tail;
msgpack_zone_chunk* end;
msgpack_zone_chunk* array;
} msgpack_zone_chunk_array;
typedef struct msgpack_zone_finalizer_array {
msgpack_zone_finalizer* tail;
msgpack_zone_finalizer* end;
msgpack_zone_finalizer* array;
} msgpack_zone_finalizer_array;
typedef struct msgpack_zone {
msgpack_zone_chunk_array chunk_array;
msgpack_zone_finalizer_array finalizer_array;
size_t chunk_size;
} msgpack_zone;
#ifndef MSGPACK_ZONE_CHUNK_SIZE
#define MSGPACK_ZONE_CHUNK_SIZE 2048
#endif
bool msgpack_zone_init(msgpack_zone* zone, size_t chunk_size);
void msgpack_zone_destroy(msgpack_zone* zone);
msgpack_zone* msgpack_zone_new(size_t chunk_size);
void msgpack_zone_free(msgpack_zone* zone);
static inline void* msgpack_zone_malloc(msgpack_zone* zone, size_t size);
static inline void* msgpack_zone_malloc_no_align(msgpack_zone* zone, size_t size);
static inline bool msgpack_zone_push_finalizer(msgpack_zone* zone,
void (*func)(void* data), void* data);
bool msgpack_zone_is_empty(msgpack_zone* zone);
void msgpack_zone_clear(msgpack_zone* zone);
#ifndef MSGPACK_ZONE_ALIGN
#define MSGPACK_ZONE_ALIGN sizeof(int)
#endif
void* msgpack_zone_malloc_expand(msgpack_zone* zone, size_t size);
void* msgpack_zone_malloc_no_align(msgpack_zone* zone, size_t size)
{
msgpack_zone_chunk* chunk = zone->chunk_array.tail;
if(chunk->free < size) {
return msgpack_zone_malloc_expand(zone, size);
}
char* ptr = chunk->ptr;
chunk->ptr += size;
chunk->free -= size;
return ptr;
}
void* msgpack_zone_malloc(msgpack_zone* zone, size_t size)
{
return msgpack_zone_malloc_no_align(zone,
((size)+((MSGPACK_ZONE_ALIGN)-1)) & ~((MSGPACK_ZONE_ALIGN)-1));
}
bool msgpack_zone_push_finalizer_expand(msgpack_zone* zone,
void (*func)(void* data), void* data);
bool msgpack_zone_push_finalizer(msgpack_zone* zone,
void (*func)(void* data), void* data)
{
msgpack_zone_finalizer_array* const fa = &zone->finalizer_array;
msgpack_zone_finalizer* fin = fa->tail;
if(fin == fa->end) {
return msgpack_zone_push_finalizer_expand(zone, func, data);
}
fin->func = func;
fin->data = data;
++fa->tail;
return true;
}
#ifdef __cplusplus
}
#endif
#endif /* msgpack/zone.h */

View File

@ -1,44 +0,0 @@
AC_INIT(msgpack/unpack_template.h)
AC_CONFIG_AUX_DIR(ac)
AM_INIT_AUTOMAKE(msgpack, 0.3.3)
AC_CONFIG_HEADER(config.h)
AC_SUBST(CFLAGS)
if test "" = "$CFLAGS"; then
CFLAGS="-g -O4"
fi
AC_PROG_CC
CFLAGS="-O4 -Wall $CFLAGS -I.."
AC_MSG_CHECKING([if c++ api is enabled])
AC_ARG_ENABLE(cxx,
AS_HELP_STRING([--disable-cxx],
[don't build c++ api.]) )
AC_MSG_RESULT($enable_cxx)
if test "$enable_cxx" != "no"; then
AC_SUBST(CXXFLAGS)
if test "" = "$CXXFLAGS"; then
CXXFLAGS="-g -O4"
fi
AC_CHECK_PROG(ERB, erb, erb)
if test "x$ERB" = x; then
AC_MSG_ERROR([cannot find erb. Ruby is needed to build.])
fi
fi
# FIXME
AC_PROG_CXX
CXXFLAGS="-O4 -Wall $CXXFLAGS -I.. -I../c"
AM_CONDITIONAL(ENABLE_CXX, test "$enable_cxx" != "no")
AC_PROG_LIBTOOL
AC_OUTPUT([Makefile c/Makefile cpp/Makefile])

View File

@ -1,47 +0,0 @@
lib_LTLIBRARIES = libmsgpack.la
libmsgpack_la_SOURCES = \
object.cpp
nobase_include_HEADERS = \
msgpack.hpp \
msgpack/sbuffer.hpp \
msgpack/vrefbuffer.hpp \
msgpack/pack.hpp \
msgpack/unpack.hpp \
msgpack/object.hpp \
msgpack/zone.hpp \
msgpack/type.hpp \
msgpack/type/array.hpp \
msgpack/type/boolean.hpp \
msgpack/type/float.hpp \
msgpack/type/integer.hpp \
msgpack/type/map.hpp \
msgpack/type/nil.hpp \
msgpack/type/raw.hpp \
msgpack/type/tuple.hpp
# FIXME
object.lo: msgpack/type/tuple.hpp msgpack/zone.hpp
msgpack/type/tuple.hpp: msgpack/type/tuple.hpp.erb
$(ERB) $< > $@.tmp
mv $@.tmp $@
msgpack/zone.hpp: msgpack/zone.hpp.erb
$(ERB) $< > $@.tmp
mv $@.tmp $@
MOSTLYCLEANFILES = \
msgpack/type/tuple.hpp \
msgpack/zone.hpp
EXTRA_DIST = \
msgpack/type/tuple.hpp.erb \
msgpack/zone.hpp.erb
libmsgpack_la_LIBADD = -L../c -lmsgpackc
# -version-info CURRENT:REVISION:AGE
libmsgpack_la_LDFLAGS = -version-info 1:0:0

View File

@ -1,188 +0,0 @@
#include <msgpack/unpack.hpp>
#include <msgpack/pack.hpp>
#include <string.h>
#include <sys/time.h>
#include <iostream>
#include <stdexcept>
#include <string>
static const unsigned int TASK_INT_NUM = 1<<24;
static const unsigned int TASK_STR_LEN = 1<<15;
//static const unsigned int TASK_INT_NUM = 1<<22;
//static const unsigned int TASK_STR_LEN = 1<<13;
static const char* TASK_STR_PTR;
class simple_timer {
public:
void reset() { gettimeofday(&m_timeval, NULL); }
void show_stat(size_t bufsz)
{
struct timeval endtime;
gettimeofday(&endtime, NULL);
double sec = (endtime.tv_sec - m_timeval.tv_sec)
+ (double)(endtime.tv_usec - m_timeval.tv_usec) / 1000 / 1000;
std::cout << sec << " sec" << std::endl;
std::cout << (double(bufsz)/1024/1024) << " MB" << std::endl;
std::cout << (bufsz/sec/1000/1000*8) << " Mbps" << std::endl;
}
private:
timeval m_timeval;
};
class simple_buffer {
public:
static const size_t DEFAULT_INITIAL_SIZE = 32*1024;//512*1024*1024*2;
simple_buffer(size_t initial_size = DEFAULT_INITIAL_SIZE) :
m_storage((char*)malloc(initial_size)),
m_allocated(initial_size),
m_used(0)
{
if(!m_storage) { throw std::bad_alloc(); }
}
~simple_buffer()
{
free(m_storage);
}
public:
inline void write(const char* buf, size_t len)
{
if(m_allocated - m_used < len) {
expand_buffer(len);
}
memcpy(m_storage + m_used, buf, len);
m_used += len;
}
void clear()
{
m_used = 0;
}
private:
void expand_buffer(size_t req)
{
size_t nsize = m_allocated * 2;
size_t at_least = m_used + req;
while(nsize < at_least) { nsize *= 2; }
char* tmp = (char*)realloc(m_storage, nsize);
if(!tmp) { throw std::bad_alloc(); }
m_storage = tmp;
m_allocated = nsize;
}
public:
size_t size() const { return m_used; }
const char* data() const { return m_storage; }
private:
char* m_storage;
size_t m_allocated;
size_t m_used;
};
void bench_msgpack_int()
{
simple_buffer buf;
simple_timer timer;
std::cout << "----" << std::endl;
std::cout << "pack integer" << std::endl;
timer.reset();
{
msgpack::packer<simple_buffer> pk(buf);
pk.pack_array(TASK_INT_NUM);
for(unsigned int i=0; i < TASK_INT_NUM; ++i) {
pk.pack_unsigned_int(i);
}
}
timer.show_stat(buf.size());
std::cout << "----" << std::endl;
std::cout << "unpack integer" << std::endl;
msgpack::zone z;
msgpack::object obj;
timer.reset();
{
obj = msgpack::unpack(buf.data(), buf.size(), z);
}
timer.show_stat(buf.size());
/*
std::cout << "----" << std::endl;
std::cout << "dynamic pack integer" << std::endl;
buf.clear();
timer.reset();
msgpack::pack(buf, obj);
timer.show_stat(buf.size());
*/
}
void bench_msgpack_str()
{
simple_buffer buf;
simple_timer timer;
std::cout << "----" << std::endl;
std::cout << "pack string" << std::endl;
timer.reset();
{
msgpack::packer<simple_buffer> pk(buf);
pk.pack_array(TASK_STR_LEN);
for(unsigned int i=0; i < TASK_STR_LEN; ++i) {
pk.pack_raw(i);
pk.pack_raw_body(TASK_STR_PTR, i);
}
}
timer.show_stat(buf.size());
std::cout << "----" << std::endl;
std::cout << "unpack string" << std::endl;
msgpack::zone z;
msgpack::object obj;
timer.reset();
{
obj = msgpack::unpack(buf.data(), buf.size(), z);
}
timer.show_stat(buf.size());
/*
std::cout << "----" << std::endl;
std::cout << "dynamic pack string" << std::endl;
buf.clear();
timer.reset();
msgpack::pack(buf, obj);
timer.show_stat(buf.size());
*/
}
int main(void)
{
char* str = (char*)malloc(TASK_STR_LEN);
memset(str, 'a', TASK_STR_LEN);
TASK_STR_PTR = str;
bench_msgpack_int();
bench_msgpack_str();
return 0;
}

View File

@ -1,9 +0,0 @@
CXXFLAGS += -Wall -g -I. -I.. -O4
LDFLAGS +=
all: bench
bench: bench.o unpack.o zone.o object.o pack.hpp unpack.hpp zone.hpp object.hpp
$(CXX) bench.o unpack.o zone.o object.o $(CXXFLAGS) $(LDFLAGS) -o $@

View File

@ -1 +0,0 @@
.

View File

@ -1,24 +0,0 @@
//
// MessagePack for C++
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "msgpack/object.hpp"
#include "msgpack/zone.hpp"
#include "msgpack/pack.hpp"
#include "msgpack/unpack.hpp"
#include "msgpack/sbuffer.hpp"
#include "msgpack/vrefbuffer.hpp"
#include "msgpack.h"

View File

@ -1,139 +0,0 @@
//
// MessagePack for C++ dynamic typed objects
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "msgpack/object.hpp"
#include <string.h>
namespace msgpack {
std::ostream& operator<< (std::ostream& s, const object o)
{
switch(o.type) {
case type::NIL:
s << "nil";
break;
case type::BOOLEAN:
s << (o.via.boolean ? "true" : "false");
break;
case type::POSITIVE_INTEGER:
s << o.via.u64;
break;
case type::NEGATIVE_INTEGER:
s << o.via.i64;
break;
case type::DOUBLE:
s << o.via.dec;
break;
case type::RAW:
(s << '"').write(o.via.raw.ptr, o.via.raw.size) << '"';
break;
case type::ARRAY:
s << "[";
if(o.via.array.size != 0) {
object* p(o.via.array.ptr);
s << *p;
++p;
for(object* const pend(o.via.array.ptr + o.via.array.size);
p < pend; ++p) {
s << ", " << *p;
}
}
s << "]";
break;
// FIXME loop optimiziation
case type::MAP:
s << "{";
if(o.via.map.size != 0) {
object_kv* p(o.via.map.ptr);
s << p->key << "=>" << p->val;
++p;
for(object_kv* const pend(o.via.map.ptr + o.via.map.size);
p < pend; ++p) {
s << ", " << p->key << "=>" << p->val;
}
}
s << "}";
break;
// FIXME loop optimiziation
default:
// FIXME
s << "#<UNKNOWN " << (uint16_t)o.type << ">";
}
return s;
}
bool operator==(const object x, const object y)
{
if(x.type != y.type) { return false; }
switch(x.type) {
case type::NIL:
return true;
case type::BOOLEAN:
return x.via.boolean == y.via.boolean;
case type::POSITIVE_INTEGER:
return x.via.u64 == y.via.u64;
case type::NEGATIVE_INTEGER:
return x.via.i64 == y.via.i64;
case type::RAW:
return x.via.raw.size == y.via.raw.size &&
memcmp(x.via.raw.ptr, y.via.raw.ptr, x.via.raw.size) == 0;
case type::ARRAY:
if(x.via.array.size != y.via.array.size) { return false; }
for(object* px(x.via.array.ptr),
* const pxend(x.via.array.ptr + x.via.array.size),
* py(y.via.array.ptr);
px < pxend; ++px, ++py) {
if(*px != *py) { return false; }
}
return true;
// FIXME loop optimiziation
case type::MAP:
if(x.via.map.size != y.via.map.size) { return false; }
for(object_kv* px(x.via.map.ptr),
* const pxend(x.via.map.ptr + x.via.map.size),
* py(y.via.map.ptr);
px < pxend; ++px, ++py) {
if(px->key != py->key || px->val != py->val) { return false; }
}
return true;
default:
return false;
}
}
} // namespace msgpack

View File

@ -1,329 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_OBJECT_HPP__
#define MSGPACK_OBJECT_HPP__
#include "msgpack/object.h"
#include "msgpack/pack.hpp"
#include <stdint.h>
#include <string.h>
#include <stdexcept>
#include <typeinfo>
#include <limits>
#include <ostream>
namespace msgpack {
class type_error : public std::bad_cast { };
namespace type {
enum object_type {
NIL = 0x01,
BOOLEAN = 0x02,
POSITIVE_INTEGER = 0x03,
NEGATIVE_INTEGER = 0x04,
DOUBLE = 0x05,
RAW = 0x06,
ARRAY = 0x07,
MAP = 0x08,
};
}
struct object;
struct object_kv;
struct object_array {
uint32_t size;
object* ptr;
};
struct object_map {
uint32_t size;
object_kv* ptr;
};
struct object_raw {
uint32_t size;
const char* ptr;
};
struct object {
union union_type {
bool boolean;
uint64_t u64;
int64_t i64;
double dec;
object_array array;
object_map map;
object_raw raw;
object_raw ref; // obsolete
};
type::object_type type;
union_type via;
bool is_nil() const { return type == type::NIL; }
template <typename T>
T as() const;
template <typename T>
void convert(T* v) const;
object();
object(msgpack_object obj);
operator msgpack_object();
private:
struct implicit_type;
public:
implicit_type convert() const;
};
struct object_kv {
object key;
object val;
};
bool operator==(const object x, const object y);
bool operator!=(const object x, const object y);
std::ostream& operator<< (std::ostream& s, const object o);
template <typename Stream, typename T>
packer<Stream>& operator<< (packer<Stream>& o, const T& v);
template <typename T>
T& operator>> (object o, T& v);
struct object::implicit_type {
implicit_type(object o) : obj(o) { }
~implicit_type() { }
template <typename T>
operator T() { return obj.as<T>(); }
private:
object obj;
};
template <typename Type>
class define : public Type {
public:
typedef Type msgpack_type;
typedef define<Type> define_type;
define() {}
define(const msgpack_type& v) : msgpack_type(v) {}
template <typename Packer>
void msgpack_pack(Packer& o) const
{
o << static_cast<const msgpack_type&>(*this);
}
void msgpack_unpack(object o)
{
o >> static_cast<msgpack_type&>(*this);
}
};
template <typename Stream>
template <typename T>
inline packer<Stream>& packer<Stream>::pack(const T& v)
{
*this << v;
return *this;
}
inline object& operator>> (object o, object& v)
{
v = o;
return v;
}
template <typename T>
inline T& operator>> (object o, T& v)
{
v.msgpack_unpack(o.convert());
return v;
}
template <typename Stream, typename T>
inline packer<Stream>& operator<< (packer<Stream>& o, const T& v)
{
v.msgpack_pack(o);
return o;
}
inline bool operator!=(const object x, const object y)
{ return !(x == y); }
inline object::object() { }
inline object::object(msgpack_object obj)
{
// FIXME beter way?
::memcpy(this, &obj, sizeof(obj));
}
inline object::operator msgpack_object()
{
// FIXME beter way?
msgpack_object obj;
::memcpy(&obj, this, sizeof(obj));
return obj;
}
inline object::implicit_type object::convert() const
{
return implicit_type(*this);
}
template <typename T>
inline void object::convert(T* v) const
{
*this >> *v;
}
template <typename T>
inline T object::as() const
{
T v;
convert(&v);
return v;
}
// obsolete
template <typename T>
inline void convert(T& v, object o)
{
o.convert(&v);
}
// obsolete
template <typename Stream, typename T>
inline void pack(packer<Stream>& o, const T& v)
{
o.pack(v);
}
// obsolete
template <typename Stream, typename T>
inline void pack_copy(packer<Stream>& o, T v)
{
pack(o, v);
}
template <typename Stream>
packer<Stream>& operator<< (packer<Stream>& o, const object& v)
{
switch(v.type) {
case type::NIL:
o.pack_nil();
return o;
case type::BOOLEAN:
if(v.via.boolean) {
o.pack_true();
} else {
o.pack_false();
}
return o;
case type::POSITIVE_INTEGER:
if(v.via.u64 <= (uint64_t)std::numeric_limits<uint16_t>::max()) {
if(v.via.u64 <= (uint16_t)std::numeric_limits<uint8_t>::max()) {
o.pack_uint8(v.via.u64);
} else {
o.pack_uint16(v.via.u64);
}
} else {
if(v.via.u64 <= (uint64_t)std::numeric_limits<uint32_t>::max()) {
o.pack_uint32(v.via.u64);
} else {
o.pack_uint64(v.via.u64);
}
}
return o;
case type::NEGATIVE_INTEGER:
if(v.via.i64 >= (int64_t)std::numeric_limits<int16_t>::min()) {
if(v.via.i64 >= (int64_t)std::numeric_limits<int8_t>::min()) {
o.pack_int8(v.via.i64);
} else {
o.pack_int16(v.via.i64);
}
} else {
if(v.via.i64 >= (int64_t)std::numeric_limits<int32_t>::min()) {
o.pack_int64(v.via.i64);
} else {
o.pack_int64(v.via.i64);
}
}
return o;
case type::RAW:
o.pack_raw(v.via.raw.size);
o.pack_raw_body(v.via.raw.ptr, v.via.raw.size);
return o;
case type::ARRAY:
o.pack_array(v.via.array.size);
for(object* p(v.via.array.ptr),
* const pend(v.via.array.ptr + v.via.array.size);
p < pend; ++p) {
o << *p;
}
return o;
case type::MAP:
o.pack_map(v.via.map.size);
for(object_kv* p(v.via.map.ptr),
* const pend(v.via.map.ptr + v.via.map.size);
p < pend; ++p) {
o << p->key;
o << p->val;
}
return o;
default:
throw type_error();
}
}
} // namespace msgpack
#include "msgpack/type.hpp"
#endif /* msgpack/object.hpp */

View File

@ -1,253 +0,0 @@
//
// MessagePack for C++ serializing routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_PACK_HPP__
#define MSGPACK_PACK_HPP__
#include <arpa/inet.h> // __BYTE_ORDER
#include <stdexcept>
#include <limits.h>
#include "msgpack/pack_define.h"
namespace msgpack {
template <typename Stream>
class packer {
public:
packer(Stream& s);
~packer();
public:
template <typename T>
packer<Stream>& pack(const T& v);
packer<Stream>& pack_uint8(uint8_t d);
packer<Stream>& pack_uint16(uint16_t d);
packer<Stream>& pack_uint32(uint32_t d);
packer<Stream>& pack_uint64(uint64_t d);
packer<Stream>& pack_int8(uint8_t d);
packer<Stream>& pack_int16(uint16_t d);
packer<Stream>& pack_int32(uint32_t d);
packer<Stream>& pack_int64(uint64_t d);
packer<Stream>& pack_short(int d);
packer<Stream>& pack_int(int d);
packer<Stream>& pack_long(long d);
packer<Stream>& pack_long_long(long long d);
packer<Stream>& pack_unsigned_short(unsigned short d);
packer<Stream>& pack_unsigned_int(unsigned int d);
packer<Stream>& pack_unsigned_long(unsigned long d);
packer<Stream>& pack_unsigned_long_long(unsigned long long d);
packer<Stream>& pack_float(float d);
packer<Stream>& pack_double(double d);
packer<Stream>& pack_nil();
packer<Stream>& pack_true();
packer<Stream>& pack_false();
packer<Stream>& pack_array(unsigned int n);
packer<Stream>& pack_map(unsigned int n);
packer<Stream>& pack_raw(size_t l);
packer<Stream>& pack_raw_body(const char* b, size_t l);
private:
static void _pack_uint8(Stream& x, uint8_t d);
static void _pack_uint16(Stream& x, uint16_t d);
static void _pack_uint32(Stream& x, uint32_t d);
static void _pack_uint64(Stream& x, uint64_t d);
static void _pack_int8(Stream& x, int8_t d);
static void _pack_int16(Stream& x, int16_t d);
static void _pack_int32(Stream& x, int32_t d);
static void _pack_int64(Stream& x, int64_t d);
static void _pack_short(Stream& x, short d);
static void _pack_int(Stream& x, int d);
static void _pack_long(Stream& x, long d);
static void _pack_long_long(Stream& x, long long d);
static void _pack_unsigned_short(Stream& x, unsigned short d);
static void _pack_unsigned_int(Stream& x, unsigned int d);
static void _pack_unsigned_long(Stream& x, unsigned long d);
static void _pack_unsigned_long_long(Stream& x, unsigned long long d);
static void _pack_float(Stream& x, float d);
static void _pack_double(Stream& x, double d);
static void _pack_nil(Stream& x);
static void _pack_true(Stream& x);
static void _pack_false(Stream& x);
static void _pack_array(Stream& x, unsigned int n);
static void _pack_map(Stream& x, unsigned int n);
static void _pack_raw(Stream& x, size_t l);
static void _pack_raw_body(Stream& x, const void* b, size_t l);
static void append_buffer(Stream& x, const unsigned char* buf, unsigned int len)
{ x.write((const char*)buf, len); }
private:
Stream& m_stream;
private:
packer();
};
template <typename Stream, typename T>
inline void pack(Stream& s, const T& v)
{
packer<Stream>(s).pack(v);
}
#define msgpack_pack_inline_func(name) \
template <typename Stream> \
inline void packer<Stream>::_pack ## name
#define msgpack_pack_inline_func_cint(name) \
template <typename Stream> \
inline void packer<Stream>::_pack ## name
#define msgpack_pack_user Stream&
#define msgpack_pack_append_buffer append_buffer
#include "msgpack/pack_template.h"
template <typename Stream>
packer<Stream>::packer(Stream& s) : m_stream(s) { }
template <typename Stream>
packer<Stream>::~packer() { }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_uint8(uint8_t d)
{ _pack_uint8(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_uint16(uint16_t d)
{ _pack_uint16(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_uint32(uint32_t d)
{ _pack_uint32(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_uint64(uint64_t d)
{ _pack_uint64(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_int8(uint8_t d)
{ _pack_int8(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_int16(uint16_t d)
{ _pack_int16(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_int32(uint32_t d)
{ _pack_int32(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_int64(uint64_t d)
{ _pack_int64(m_stream, d); return *this;}
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_short(int d)
{ _pack_short(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_int(int d)
{ _pack_int(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_long(long d)
{ _pack_long(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_long_long(long long d)
{ _pack_long_long(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_unsigned_short(unsigned short d)
{ _pack_unsigned_short(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_unsigned_int(unsigned int d)
{ _pack_unsigned_int(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_unsigned_long(unsigned long d)
{ _pack_unsigned_long(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_unsigned_long_long(unsigned long long d)
{ _pack_unsigned_long_long(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_float(float d)
{ _pack_float(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_double(double d)
{ _pack_double(m_stream, d); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_nil()
{ _pack_nil(m_stream); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_true()
{ _pack_true(m_stream); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_false()
{ _pack_false(m_stream); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_array(unsigned int n)
{ _pack_array(m_stream, n); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_map(unsigned int n)
{ _pack_map(m_stream, n); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_raw(size_t l)
{ _pack_raw(m_stream, l); return *this; }
template <typename Stream>
inline packer<Stream>& packer<Stream>::pack_raw_body(const char* b, size_t l)
{ _pack_raw_body(m_stream, b, l); return *this; }
} // namespace msgpack
#endif /* msgpack/pack.hpp */

View File

@ -1,103 +0,0 @@
//
// MessagePack for C++ simple buffer implementation
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_SBUFFER_HPP__
#define MSGPACK_SBUFFER_HPP__
#include "msgpack/sbuffer.h"
#include <stdexcept>
namespace msgpack {
class sbuffer : public msgpack_sbuffer {
public:
sbuffer(size_t initsz = MSGPACK_SBUFFER_INIT_SIZE)
{
base::data = (char*)::malloc(initsz);
if(!base::data) {
throw std::bad_alloc();
}
base::size = 0;
base::alloc = initsz;
}
~sbuffer()
{
::free(base::data);
}
public:
void write(const char* buf, unsigned int len)
{
if(base::alloc - base::size < len) {
expand_buffer(len);
}
memcpy(base::data + base::size, buf, len);
base::size += len;
}
char* data()
{
return base::data;
}
const char* data() const
{
return base::data;
}
size_t size() const
{
return base::size;
}
char* release()
{
return msgpack_sbuffer_release(this);
}
private:
void expand_buffer(size_t len)
{
size_t nsize = (base::alloc) ?
base::alloc * 2 : MSGPACK_SBUFFER_INIT_SIZE;
while(nsize < base::size + len) { nsize *= 2; }
void* tmp = realloc(base::data, nsize);
if(!tmp) {
throw std::bad_alloc();
}
base::data = (char*)tmp;
base::alloc = nsize;
}
private:
typedef msgpack_sbuffer base;
private:
sbuffer(const sbuffer&);
};
} // namespace msgpack
#endif /* msgpack/sbuffer.hpp */

View File

@ -1,201 +0,0 @@
#include <iostream>
#include <string>
#include <msgpack.hpp>
#include <sstream>
#include <memory>
using namespace msgpack;
class checker {
public:
template <typename T>
void check(const char* d, size_t len, T should) {
try {
std::cout << "----" << std::endl;
object o;
try {
o = unpack(d, len, m_zone);
} catch (std::runtime_error& e) {
std::cout << o << std::endl;
std::cout << "**" << e.what() << "**" << std::endl;
return;
}
std::cout << o << std::endl;
try {
std::stringstream s;
pack(s, should);
std::string str(s.str());
object ro = unpack(str.data(), str.size(), m_zone);
std::cout << ro << std::endl;
if(ro != o) { throw std::runtime_error("NOT MATCH"); }
} catch (std::runtime_error& e) {
std::cout << "** REUNPACK FAILED **" << std::endl;
std::cout << e.what() << std::endl;
} catch (...) {
std::cout << "** REUNPACK FAILED **" << std::endl;
std::cout << "unknown error" << std::endl;
}
} catch (...) { m_zone.clear(); throw; }
m_zone.clear();
}
private:
zone m_zone;
};
int main(void)
{
checker c;
#if 0
{ // SimpleValue
const char d[] = {
0x93, 0xc0, 0xc2, 0xc3,
};
c.check(d, sizeof(d),
type::make_tuple(
type::nil(), false, true
)
);
}
{ // Fixnum
const char d[] = {
0x92,
0x93, 0x00, 0x40, 0x7f,
0x93, 0xe0, 0xf0, 0xff,
};
c.check(d, sizeof(d),
type::make_tuple(
type::make_tuple(
0, 64, 127
),
type::make_tuple(
-32, -16, -1
)
)
);
}
{ // FixArray
const char d[] = {
0x92,
0x90,
0x91,
0x91, 0xc0,
};
std::vector<int> empty;
c.check(d, sizeof(d),
type::make_tuple(
empty,
type::make_tuple(
type::make_tuple(
type::nil()
)
)
)
);
}
{ // FixRaw
const char d[] = {
0x94,
0xa0,
0xa1, 'a',
0xa2, 'b', 'c',
0xa3, 'd', 'e', 'f',
};
c.check(d, sizeof(d),
type::make_tuple(
std::string(""),
std::string("a"),
std::string("bc"),
type::raw_ref("def", 3)
)
);
}
#endif
static const unsigned TASK_ARRAY = 1000;
static const unsigned TASK_REPEAT = 10;
std::vector<std::string> task;
// create task
{
static char traw[64];
memset(traw, 'a', sizeof(traw));
task.resize(TASK_ARRAY);
for(unsigned i=0; i < TASK_ARRAY; ++i) {
task[i] = std::string(traw, sizeof(traw));
}
}
std::stringstream stream;
// send message
{
for(unsigned i=0; i < TASK_REPEAT; ++i) {
pack(stream, task);
}
std::cout << "send " << stream.str().size() << " bytes" << std::endl;
}
ssize_t total_bytes = stream.str().size();
stream.seekg(0);
// reserive message
{
unsigned num_msg = 0;
static const size_t RESERVE_SIZE = 32;//*1024;
unpacker pac;
while(stream.good() && total_bytes > 0) {
// 1. reserve buffer
pac.reserve_buffer(RESERVE_SIZE);
// 2. read data to buffer() up to buffer_capacity() bytes
size_t sz = stream.readsome(
pac.buffer(),
pac.buffer_capacity());
total_bytes -= sz;
std::cout << "read " << sz << " bytes to capacity "
<< pac.buffer_capacity() << " bytes"
<< std::endl;
// 3. specify the number of bytes actually copied
pac.buffer_consumed(sz);
// 4. repeat execute() until it returns false
while( pac.execute() ) {
// 5.1. take out the parsed object
object o = pac.data();
// 5.2 release the zone
std::auto_ptr<zone> olife( pac.release_zone() );
// 5.3 re-initialize the unpacker */
pac.reset();
// do some with the o and olife
std::cout << "message parsed: " << o << std::endl;
++num_msg;
}
}
std::cout << "stream finished" << std::endl;
std::cout << num_msg << " messages reached" << std::endl;
}
return 0;
}

View File

@ -1,9 +0,0 @@
CXXFLAGS += -Wall -g -I. -I.. -O4
LDFLAGS +=
all: test
test: test.o unpack.o zone.o object.o pack.hpp unpack.hpp zone.hpp object.hpp
$(CXX) test.o unpack.o zone.o object.o $(CXXFLAGS) $(LDFLAGS) -o $@

View File

@ -1,9 +0,0 @@
#include "msgpack/type/array.hpp"
#include "msgpack/type/boolean.hpp"
#include "msgpack/type/float.hpp"
#include "msgpack/type/integer.hpp"
#include "msgpack/type/map.hpp"
#include "msgpack/type/nil.hpp"
#include "msgpack/type/raw.hpp"
#include "msgpack/type/tuple.hpp"

View File

@ -1,57 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_ARRAY_HPP__
#define MSGPACK_TYPE_ARRAY_HPP__
#include "msgpack/object.hpp"
#include <vector>
namespace msgpack {
template <typename T>
inline std::vector<T> operator>> (object o, std::vector<T>& v)
{
if(o.type != type::ARRAY) { throw type_error(); }
v.resize(o.via.array.size);
object* p = o.via.array.ptr;
object* const pend = o.via.array.ptr + o.via.array.size;
T* it = &v.front();
for(; p < pend; ++p, ++it) {
p->convert(it);
}
return v;
}
template <typename Stream, typename T>
inline packer<Stream>& operator<< (packer<Stream>& o, const std::vector<T>& v)
{
o.pack_array(v.size());
for(typename std::vector<T>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(*it);
}
return o;
}
} // namespace msgpack
#endif /* msgpack/type/array.hpp */

View File

@ -1,47 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_BOOLEAN_HPP__
#define MSGPACK_TYPE_BOOLEAN_HPP__
#include "msgpack/object.hpp"
#include <vector>
namespace msgpack {
inline bool& operator>> (object o, bool& v)
{
if(o.type != type::BOOLEAN) { throw type_error(); }
v = o.via.boolean;
return v;
}
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const bool& v)
{
if(v) { o.pack_true(); }
else { o.pack_false(); }
return o;
}
} // namespace msgpack
#endif /* msgpack/type/bool.hpp */

View File

@ -1,65 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_FLOAT_HPP__
#define MSGPACK_TYPE_FLOAT_HPP__
#include "msgpack/object.hpp"
#include <vector>
namespace msgpack {
// FIXME check overflow, underflow
inline float& operator>> (object o, float& v)
{
if(o.type != type::DOUBLE) { throw type_error(); }
v = o.via.dec;
return v;
}
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const float& v)
{
o.pack_float(v);
return o;
}
inline double& operator>> (object o, double& v)
{
if(o.type != type::DOUBLE) { throw type_error(); }
v = o.via.dec;
return v;
}
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const double& v)
{
o.pack_double(v);
return o;
}
} // namespace msgpack
#endif /* msgpack/type/float.hpp */

View File

@ -1,147 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_INTEGER_HPP__
#define MSGPACK_TYPE_INTEGER_HPP__
#include "msgpack/object.hpp"
#include <limits>
namespace msgpack {
namespace type {
namespace detail {
template <typename T, bool Signed>
struct convert_integer_sign;
template <typename T>
struct convert_integer_sign<T, true> {
static inline T convert(object o) {
if(o.type == type::POSITIVE_INTEGER) {
if(o.via.u64 > (uint64_t)std::numeric_limits<T>::max())
{ throw type_error(); }
return o.via.u64;
} else if(o.type == type::NEGATIVE_INTEGER) {
if(o.via.i64 < (int64_t)-std::numeric_limits<T>::max())
{ throw type_error(); }
return o.via.i64;
}
throw type_error();
}
};
template <typename T>
struct convert_integer_sign<T, false> {
static inline T convert(object o) {
if(o.type == type::POSITIVE_INTEGER) {
if(o.via.u64 > (uint64_t)std::numeric_limits<T>::max())
{ throw type_error(); }
return o.via.u64;
}
throw type_error();
}
};
template <typename T>
static inline T convert_integer(object o)
{
return detail::convert_integer_sign<T, std::numeric_limits<T>::is_signed>::convert(o);
}
} // namespace detail
} // namespace type
inline signed char& operator>> (object o, signed char& v)
{ v = type::detail::convert_integer<signed char>(o); return v; }
inline signed short& operator>> (object o, signed short& v)
{ v = type::detail::convert_integer<signed short>(o); return v; }
inline signed int& operator>> (object o, signed int& v)
{ v = type::detail::convert_integer<signed int>(o); return v; }
inline signed long& operator>> (object o, signed long& v)
{ v = type::detail::convert_integer<signed long>(o); return v; }
inline signed long long& operator>> (object o, signed long long& v)
{ v = type::detail::convert_integer<signed long long>(o); return v; }
inline unsigned char& operator>> (object o, unsigned char& v)
{ v = type::detail::convert_integer<unsigned char>(o); return v; }
inline unsigned short& operator>> (object o, unsigned short& v)
{ v = type::detail::convert_integer<unsigned short>(o); return v; }
inline unsigned int& operator>> (object o, unsigned int& v)
{ v = type::detail::convert_integer<unsigned int>(o); return v; }
inline unsigned long& operator>> (object o, unsigned long& v)
{ v = type::detail::convert_integer<unsigned long>(o); return v; }
inline unsigned long long& operator>> (object o, unsigned long long& v)
{ v = type::detail::convert_integer<unsigned long long>(o); return v; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const signed char& v)
{ o.pack_int8(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const signed short& v)
{ o.pack_short(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const signed int& v)
{ o.pack_int(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const signed long& v)
{ o.pack_long(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const signed long long& v)
{ o.pack_long_long(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const unsigned char& v)
{ o.pack_uint8(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const unsigned short& v)
{ o.pack_unsigned_short(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const unsigned int& v)
{ o.pack_unsigned_int(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const unsigned long& v)
{ o.pack_unsigned_long(v); return o; }
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const unsigned long long& v)
{ o.pack_unsigned_long_long(v); return o; }
} // namespace msgpack
#endif /* msgpack/type/integer.hpp */

View File

@ -1,139 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_MAP_HPP__
#define MSGPACK_TYPE_MAP_HPP__
#include "msgpack/object.hpp"
#include <map>
#include <vector>
#include <algorithm>
namespace msgpack {
namespace type {
template <typename K, typename V>
class assoc_vector : public std::vector< std::pair<K, V> > {};
namespace detail {
template <typename K, typename V>
struct pair_first_less {
bool operator() (const std::pair<K, V>& x, const std::pair<K, V>& y) const
{ return x.first < y.first; }
};
}
} //namespace type
template <typename K, typename V>
inline type::assoc_vector<K,V>& operator>> (object o, type::assoc_vector<K,V>& v)
{
if(o.type != type::MAP) { throw type_error(); }
v.resize(o.via.map.size);
object_kv* p = o.via.map.ptr;
object_kv* const pend = o.via.map.ptr + o.via.map.size;
std::pair<K, V>* it(&v.front());
for(; p < pend; ++p, ++it) {
p->key.convert(&it->first);
p->val.convert(&it->second);
}
std::sort(v.begin(), v.end(), type::detail::pair_first_less<K,V>());
return v;
}
template <typename Stream, typename K, typename V>
inline packer<Stream>& operator<< (packer<Stream>& o, const type::assoc_vector<K,V>& v)
{
o.pack_map(v.size());
for(typename type::assoc_vector<K,V>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(it->first);
o.pack(it->second);
}
return o;
}
template <typename K, typename V>
inline std::map<K, V> operator>> (object o, std::map<K, V>& v)
{
if(o.type != type::MAP) { throw type_error(); }
object_kv* p(o.via.map.ptr);
object_kv* const pend(o.via.map.ptr + o.via.map.size);
for(; p != pend; ++p) {
K key;
p->key.convert(&key);
typename std::map<K,V>::iterator it(v.lower_bound(key));
if(it != v.end() && !(key < it->first)) {
p->val.convert(&it->second);
} else {
V val;
p->val.convert(&val);
v.insert(it, std::pair<K,V>(key, val));
}
}
return v;
}
template <typename Stream, typename K, typename V>
inline packer<Stream>& operator<< (packer<Stream>& o, const std::map<K,V>& v)
{
o.pack_map(v.size());
for(typename std::map<K,V>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(it->first);
o.pack(it->second);
}
return o;
}
template <typename K, typename V>
inline std::multimap<K, V> operator>> (object o, std::multimap<K, V>& v)
{
if(o.type != type::MAP) { throw type_error(); }
object_kv* p(o.via.map.ptr);
object_kv* const pend(o.via.map.ptr + o.via.map.size);
for(; p != pend; ++p) {
std::pair<K, V> value;
p->key.convert(&value.first);
p->val.convert(&value.second);
v.insert(value);
}
return v;
}
template <typename Stream, typename K, typename V>
inline packer<Stream>& operator<< (packer<Stream>& o, const std::multimap<K,V>& v)
{
o.pack_map(v.size());
for(typename std::multimap<K,V>::const_iterator it(v.begin()), it_end(v.end());
it != it_end; ++it) {
o.pack(it->first);
o.pack(it->second);
}
return o;
}
} // namespace msgpack
#endif /* msgpack/type/map.hpp */

View File

@ -1,49 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_NIL_HPP__
#define MSGPACK_TYPE_NIL_HPP__
#include "msgpack/object.hpp"
namespace msgpack {
namespace type {
struct nil { };
} // namespace type
inline type::nil& operator>> (object o, type::nil& v)
{
if(o.type != type::NIL) { throw type_error(); }
return v;
}
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const type::nil& v)
{
o.pack_nil();
return o;
}
} // namespace msgpack
#endif /* msgpack/type/nil.hpp */

View File

@ -1,103 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_RAW_HPP__
#define MSGPACK_TYPE_RAW_HPP__
#include "msgpack/object.hpp"
#include <string.h>
#include <string>
namespace msgpack {
namespace type {
struct raw_ref {
raw_ref() : size(0), ptr(NULL) {}
raw_ref(const char* p, uint32_t s) : size(s), ptr(p) {}
uint32_t size;
const char* ptr;
std::string str() { return std::string(ptr, size); }
bool operator== (const raw_ref& x)
{
return size == x.size && memcmp(ptr, x.ptr, size) == 0;
}
bool operator!= (const raw_ref& x)
{
return !(*this != x);
}
bool operator< (const raw_ref& x)
{
if(size == x.size) { return memcmp(ptr, x.ptr, size) < 0; }
else { return size < x.size; }
}
bool operator> (const raw_ref& x)
{
if(size == x.size) { return memcmp(ptr, x.ptr, size) > 0; }
else { return size > x.size; }
}
};
} // namespace type
inline type::raw_ref& operator>> (object o, type::raw_ref& v)
{
if(o.type != type::RAW) { throw type_error(); }
v.ptr = o.via.raw.ptr;
v.size = o.via.raw.size;
return v;
}
inline std::string& operator>> (object o, std::string& v)
{
type::raw_ref r;
o >> r;
v.assign(r.ptr, r.size);
return v;
}
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const type::raw_ref& v)
{
o.pack_raw(v.size);
o.pack_raw_body(v.ptr, v.size);
return o;
}
template <typename Stream>
inline packer<Stream>& operator<< (packer<Stream>& o, const std::string& v)
{
o.pack_raw(v.size());
o.pack_raw_body(v.data(), v.size());
return o;
}
} // namespace msgpack
#endif /* msgpack/type/raw.hpp */

View File

@ -1,170 +0,0 @@
//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_TYPE_TUPLE_HPP__
#define MSGPACK_TYPE_TUPLE_HPP__
#include "msgpack/object.hpp"
namespace msgpack {
namespace type {
// FIXME operator==
// FIXME operator!=
<% GENERATION_LIMIT = 15 %>
template <typename A0 = void<%1.upto(GENERATION_LIMIT+1) {|i|%>, typename A<%=i%> = void<%}%>>
struct tuple;
template <typename Tuple, int N>
struct tuple_element;
template <typename Tuple, int N>
struct const_tuple_element;
template <typename T>
struct tuple_type {
typedef T type;
typedef T value_type;
typedef T& reference;
typedef const T& const_reference;
typedef const T& transparent_reference;
};
template <typename T>
struct tuple_type<T&> {
typedef T type;
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef T& transparent_reference;
};
template <typename T>
struct tuple_type<const T&> {
typedef T type;
typedef T& value_type;
typedef T& reference;
typedef const T& const_reference;
typedef const T& transparent_reference;
};
<%0.upto(GENERATION_LIMIT) {|i|%>
<%0.upto(i) {|j|%>
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
struct tuple_element<tuple<A0<%1.upto(i) {|k|%>, A<%=k%><%}%>>, <%=j%>> : tuple_type<A<%=j%>> {
tuple_element(tuple<A0<%1.upto(i) {|k|%>, A<%=k%> <%}%>>& x) : _x(x.a<%=j%>) {}
typename tuple_type<A<%=j%>>::reference get() { return _x; }
typename tuple_type<A<%=j%>>::const_reference get() const { return _x; }
private:
typename tuple_type<A<%=j%>>::reference _x;
};
<%}%>
<%}%>
<%0.upto(GENERATION_LIMIT) {|i|%>
<%0.upto(i) {|j|%>
template <typename A0<%1.upto(i) {|k|%>, typename A<%=k%><%}%>>
struct const_tuple_element<tuple<A0<%1.upto(i) {|k|%>, A<%=k%><%}%>>, <%=j%>> : tuple_type<A<%=j%>> {
const_tuple_element(const tuple<A0<%1.upto(i) {|k|%>, A<%=k%><%}%>>& x) : _x(x.a<%=j%>) {}
typename tuple_type<A<%=j%>>::const_reference get() const { return _x; }
private:
typename tuple_type<A<%=j%>>::const_reference _x;
};
<%}%>
<%}%>
<%0.upto(GENERATION_LIMIT) {|i|%>
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<A0>::transparent_reference a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference a<%=j%><%}%>)
{
return tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>(a0<%1.upto(i) {|j|%>, a<%=j%><%}%>);
}
<%}%>
template <>
struct tuple<> {
};
<%0.upto(GENERATION_LIMIT) {|i|%>
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
struct tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
typedef tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> value_type;
tuple() {}
tuple(typename tuple_type<A0>::transparent_reference _a0<%1.upto(i) {|j|%>, typename tuple_type<A<%=j%>>::transparent_reference _a<%=j%><%}%>) :
a0(_a0)<%1.upto(i) {|j|%>, a<%=j%>(_a<%=j%>)<%}%> {}
tuple(object o) { o.convert(this); }
template <int N> typename tuple_element<value_type, N>::reference get()
{ return tuple_element<value_type, N>(*this).get(); }
template <int N> typename const_tuple_element<value_type, N>::const_reference get() const
{ return const_tuple_element<value_type, N>(*this).get(); }
<%0.upto(i) {|j|%>
A<%=j%> a<%=j%>;<%}%>
};
<%}%>
} // namespace type
inline type::tuple<>& operator>> (
object o,
type::tuple<>& v) {
if(o.type != type::ARRAY) { throw type_error(); }
return v;
}
<%0.upto(GENERATION_LIMIT) {|i|%>
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& operator>> (
object o,
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
if(o.type != type::ARRAY) { throw type_error(); }
if(o.via.array.size < <%=i+1%>) { throw type_error(); }
<%0.upto(i) {|j|%>
o.via.array.ptr[<%=j%>].convert<A<%=j%>>(&v.template get<<%=j%>>());<%}%>
return v;
}
<%}%>
template <typename Stream>
const packer<Stream>& operator<< (
packer<Stream>& o,
const type::tuple<>& v) {
o.pack_array(0);
return o;
}
<%0.upto(GENERATION_LIMIT) {|i|%>
template <typename Stream, typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
const packer<Stream>& operator<< (
packer<Stream>& o,
const type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
o.pack_array(<%=i+1%>);
<%0.upto(i) {|j|%>
o.pack(v.template get<<%=j%>>());<%}%>
return o;
}
<%}%>
} // namespace msgpack
#endif /* msgpack/type/tuple.hpp */

View File

@ -1,301 +0,0 @@
//
// MessagePack for C++ deserializing routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_UNPACK_HPP__
#define MSGPACK_UNPACK_HPP__
#include "msgpack/unpack.h"
#include "msgpack/object.hpp"
#include "msgpack/zone.hpp"
#include <memory>
#include <stdexcept>
#ifndef MSGPACK_UNPACKER_DEFAULT_INITIAL_BUFFER_SIZE
#define MSGPACK_UNPACKER_DEFAULT_INITIAL_BUFFER_SIZE (32*1024)
#endif
namespace msgpack {
struct unpack_error : public std::runtime_error {
unpack_error(const std::string& msg) :
std::runtime_error(msg) { }
};
class unpacker : public msgpack_unpacker {
public:
unpacker(size_t init_buffer_size = MSGPACK_UNPACKER_DEFAULT_INITIAL_BUFFER_SIZE);
~unpacker();
public:
/*! 1. reserve buffer. at least `size' bytes of capacity will be ready */
void reserve_buffer(size_t size);
/*! 2. read data to the buffer() up to buffer_capacity() bytes */
char* buffer();
size_t buffer_capacity() const;
/*! 3. specify the number of bytes actually copied */
void buffer_consumed(size_t size);
/*! 4. repeat execute() until it retunrs false */
bool execute();
/*! 5.1. if execute() returns true, take out the parsed object */
object data();
/*! 5.2. the object is valid until the zone is deleted */
// Note that once release_zone() from unpacker, you must delete it
// otherwise the memrory will leak.
zone* release_zone();
/*! 5.2. this method is equivalence to `delete release_zone()` */
void reset_zone();
/*! 5.3. after release_zone(), re-initialize unpacker */
void reset();
/*! 6. check if the size of message doesn't exceed assumption. */
size_t message_size() const;
// Basic usage of the unpacker is as following:
//
// msgpack::unpacker pac;
//
// while( /* readable */ ) {
//
// // 1.
// pac.reserve(1024);
//
// // 2.
// ssize_t bytes =
// read(the_source, pac.buffer(), pac.buffer_capacity());
//
// // error handling ...
//
// // 3.
// pac.buffer_consumed(bytes);
//
// // 4.
// while(pac.execute()) {
// // 5.1
// object o = pac.data();
//
// // 5.2
// std::auto_ptr<msgpack::zone> olife( pac.release_zone() );
//
// // boost::shared_ptr is also usable:
// // boost::shared_ptr<msgpack::zone> olife( pac.release_zone() );
//
// // 5.3
// pac.reset();
//
// // do some with the object with the old zone.
// do_something(o, olife);
// }
// }
//
public:
// These functions are usable when non-MessagePack message follows after
// MessagePack message.
size_t parsed_size() const;
/*! get address of the buffer that is not parsed */
char* nonparsed_buffer();
size_t nonparsed_size() const;
/*! skip specified size of non-parsed buffer, leaving the buffer */
// Note that the `size' argument must be smaller than nonparsed_size()
void skip_nonparsed_buffer(size_t size);
/*! remove unparsed buffer from unpacker */
// Note that reset() leaves non-parsed buffer.
void remove_nonparsed_buffer();
private:
typedef msgpack_unpacker base;
private:
unpacker(const unpacker&);
};
typedef enum {
UNPACK_SUCCESS = 2,
UNPACK_EXTRA_BYTES = 1,
UNPACK_CONTINUE = 0,
UNPACK_PARSE_ERROR = -1,
} unpack_return;
static unpack_return unpack(const char* data, size_t len, size_t* off,
zone* z, object* result);
// obsolete
static object unpack(const char* data, size_t len, zone& z, size_t* off = NULL);
inline unpacker::unpacker(size_t initial_buffer_size)
{
if(!msgpack_unpacker_init(this, initial_buffer_size)) {
throw std::bad_alloc();
}
}
inline unpacker::~unpacker()
{
msgpack_unpacker_destroy(this);
}
inline void unpacker::reserve_buffer(size_t size)
{
if(!msgpack_unpacker_reserve_buffer(this, size)) {
throw std::bad_alloc();
}
}
inline char* unpacker::buffer()
{
return msgpack_unpacker_buffer(this);
}
inline size_t unpacker::buffer_capacity() const
{
return msgpack_unpacker_buffer_capacity(this);
}
inline void unpacker::buffer_consumed(size_t size)
{
return msgpack_unpacker_buffer_consumed(this, size);
}
inline bool unpacker::execute()
{
int ret = msgpack_unpacker_execute(this);
if(ret < 0) {
throw unpack_error("parse error");
} else if(ret == 0) {
return false;
} else {
return true;
}
}
inline object unpacker::data()
{
return msgpack_unpacker_data(this);
}
inline zone* unpacker::release_zone()
{
if(!msgpack_unpacker_flush_zone(this)) {
throw std::bad_alloc();
}
zone* r = new zone();
msgpack_zone old = *base::z;
*base::z = *r;
*static_cast<msgpack_zone*>(r) = old;
return r;
}
inline void unpacker::reset_zone()
{
msgpack_unpacker_reset_zone(this);
}
inline void unpacker::reset()
{
msgpack_unpacker_reset(this);
}
inline size_t unpacker::message_size() const
{
return msgpack_unpacker_message_size(this);
}
inline size_t unpacker::parsed_size() const
{
return msgpack_unpacker_parsed_size(this);
}
inline char* unpacker::nonparsed_buffer()
{
return base::buffer + base::off;
}
inline size_t unpacker::nonparsed_size() const
{
return base::used - base::off;
}
inline void unpacker::skip_nonparsed_buffer(size_t size)
{
base::off += size;
}
inline void unpacker::remove_nonparsed_buffer()
{
base::used = base::off;
}
inline unpack_return unpack(const char* data, size_t len, size_t* off,
zone* z, object* result)
{
return (unpack_return)msgpack_unpack(data, len, off,
z, reinterpret_cast<msgpack_object*>(result));
}
// obsolete
inline object unpack(const char* data, size_t len, zone& z, size_t* off)
{
object result;
switch( msgpack::unpack(data, len, off, &z, &result) ) {
case UNPACK_SUCCESS:
return result;
case UNPACK_EXTRA_BYTES:
if(off) {
return result;
} else {
throw unpack_error("extra bytes");
}
case UNPACK_CONTINUE:
throw unpack_error("insufficient bytes");
case UNPACK_PARSE_ERROR:
default:
throw unpack_error("parse error");
}
}
} // namespace msgpack
#endif /* msgpack/unpack.hpp */

View File

@ -1,85 +0,0 @@
//
// MessagePack for C++ zero-copy buffer implementation
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_VREFBUFFER_HPP__
#define MSGPACK_VREFBUFFER_HPP__
#include "msgpack/vrefbuffer.h"
#include <stdexcept>
namespace msgpack {
class vrefbuffer : public msgpack_vrefbuffer {
public:
vrefbuffer(size_t ref_size = MSGPACK_VREFBUFFER_REF_SIZE,
size_t chunk_size = MSGPACK_VREFBUFFER_CHUNK_SIZE)
{
msgpack_vrefbuffer_init(this, ref_size, chunk_size);
}
~vrefbuffer()
{
msgpack_vrefbuffer_destroy(this);
}
public:
void write(const char* buf, unsigned int len)
{
if(len < base::ref_size) {
append_copy(buf, len);
} else {
append_ref(buf, len);
}
}
void append_ref(const char* buf, size_t len)
{
if(msgpack_vrefbuffer_append_ref(this, buf, len) < 0) {
throw std::bad_alloc();
}
}
void append_copy(const char* buf, size_t len)
{
if(msgpack_vrefbuffer_append_copy(this, buf, len) < 0) {
throw std::bad_alloc();
}
}
const struct iovec* vector() const
{
return msgpack_vrefbuffer_vec(this);
}
size_t vector_size() const
{
return msgpack_vrefbuffer_veclen(this);
}
private:
typedef msgpack_vrefbuffer base;
private:
vrefbuffer(const vrefbuffer&);
};
} // namespace msgpack
#endif /* msgpack/vrefbuffer.hpp */

View File

@ -1,137 +0,0 @@
//
// MessagePack for C++ memory pool
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef MSGPACK_ZONE_HPP__
#define MSGPACK_ZONE_HPP__
#include "msgpack/object.hpp"
#include "msgpack/zone.h"
#include <cstdlib>
#include <vector>
<% GENERATION_LIMIT = 15 %>
namespace msgpack {
class zone : public msgpack_zone {
public:
zone(size_t chunk_size = MSGPACK_ZONE_CHUNK_SIZE);
~zone();
public:
void* malloc(size_t size);
void* malloc_no_align(size_t size);
void push_finalizer(void (*func)(void*), void* data);
void clear();
<%0.upto(GENERATION_LIMIT) {|i|%>
template <typename T<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
T* allocate(<%=(1..i).map{|j|"A#{j} a#{j}"}.join(', ')%>);
<%}%>
private:
void undo_malloc(size_t size);
template <typename T>
static void object_destructor(void* obj);
typedef msgpack_zone base;
private:
zone(const zone&);
};
inline zone::zone(size_t chunk_size)
{
msgpack_zone_init(this, chunk_size);
}
inline zone::~zone()
{
msgpack_zone_destroy(this);
}
inline void* zone::malloc(size_t size)
{
void* ptr = msgpack_zone_malloc(this, size);
if(!ptr) {
throw std::bad_alloc();
}
return ptr;
}
inline void* zone::malloc_no_align(size_t size)
{
void* ptr = msgpack_zone_malloc_no_align(this, size);
if(!ptr) {
throw std::bad_alloc();
}
return ptr;
}
inline void zone::push_finalizer(void (*func)(void*), void* data)
{
if(!msgpack_zone_push_finalizer(this, func, data)) {
throw std::bad_alloc();
}
}
inline void zone::clear()
{
msgpack_zone_clear(this);
}
template <typename T>
void zone::object_destructor(void* obj)
{
reinterpret_cast<T*>(obj)->~T();
}
inline void zone::undo_malloc(size_t size)
{
msgpack_zone_chunk* chunk = base::chunk_array.tail;
chunk->ptr -= size;
chunk->free += size;
}
<%0.upto(GENERATION_LIMIT) {|i|%>
template <typename T<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
T* zone::allocate(<%=(1..i).map{|j|"A#{j} a#{j}"}.join(', ')%>)
{
void* x = malloc(sizeof(T));
if(!msgpack_zone_push_finalizer(this, &zone::object_destructor<T>, x)) {
undo_malloc(sizeof(T));
throw std::bad_alloc();
}
try {
return new (x) T(<%=(1..i).map{|j|"a#{j}"}.join(', ')%>);
} catch (...) {
--base::finalizer_array.tail;
undo_malloc(sizeof(T));
throw;
}
}
<%}%>
} // namespace msgpack
#endif /* msgpack/zone.hpp */

View File

@ -1,86 +0,0 @@
#include <msgpack.hpp>
#include <string>
#include <iostream>
#include <sstream>
namespace myprotocol {
using namespace msgpack::type;
using msgpack::define;
struct Get : define< tuple<uint32_t, std::string> > {
Get() { }
Get(uint32_t f, const std::string& k) :
define_type(msgpack_type(f, k)) { }
uint32_t& flags() { return get<0>(); }
std::string& key() { return get<1>(); }
};
struct Put : define< tuple<uint32_t, std::string, raw_ref> > {
Put() { }
Put(uint32_t f, const std::string& k, const char* valref, size_t vallen) :
define_type(msgpack_type( f, k, raw_ref(valref,vallen) )) { }
uint32_t& flags() { return get<0>(); }
std::string& key() { return get<1>(); }
raw_ref& value() { return get<2>(); }
};
struct MultiGet : define< std::vector<Get> > {
};
}
int main(void)
{
// send Get request
std::stringstream stream;
{
myprotocol::Get req;
req.flags() = 0;
req.key() = "key0";
msgpack::pack(stream, req);
}
stream.seekg(0);
// receive Get request
{
std::string buffer(stream.str());
msgpack::zone mempool;
msgpack::object o =
msgpack::unpack(buffer.data(), buffer.size(), mempool);
myprotocol::Get req;
msgpack::convert(req, o);
std::cout << "received: " << o << std::endl;
}
stream.str("");
// send MultiGet request
{
myprotocol::MultiGet req;
req.push_back( myprotocol::Get(1, "key1") );
req.push_back( myprotocol::Get(2, "key2") );
req.push_back( myprotocol::Get(3, "key3") );
msgpack::pack(stream, req);
}
stream.seekg(0);
// receive MultiGet request
{
std::string buffer(stream.str());
msgpack::zone mempool;
msgpack::object o =
msgpack::unpack(buffer.data(), buffer.size(), mempool);
myprotocol::MultiGet req;
msgpack::convert(req, o);
std::cout << "received: " << o << std::endl;
}
}

View File

@ -1,37 +0,0 @@
#include <msgpack.h>
#include <stdio.h>
int main(void)
{
/* msgpack::sbuffer is a simple buffer implementation. */
msgpack_sbuffer sbuf;
msgpack_sbuffer_init(&sbuf);
/* serialize values into the buffer using msgpack_sbuffer_write callback function. */
msgpack_packer pk;
msgpack_packer_init(&pk, &sbuf, msgpack_sbuffer_write);
msgpack_pack_array(&pk, 3);
msgpack_pack_int(&pk, 1);
msgpack_pack_true(&pk);
msgpack_pack_raw(&pk, 7);
msgpack_pack_raw_body(&pk, "example", 7);
/* deserialize the buffer into msgpack_object instance. */
/* deserialized object is valid during the msgpack_zone instance alive. */
msgpack_zone mempool;
msgpack_zone_init(&mempool, 2048);
msgpack_object deserialized;
msgpack_unpack(sbuf.data, sbuf.size, NULL, &mempool, &deserialized);
/* print the deserialized object. */
msgpack_object_print(stdout, deserialized);
puts("");
msgpack_zone_destroy(&mempool);
msgpack_sbuffer_destroy(&sbuf);
return 0;
}

View File

@ -1,37 +0,0 @@
#include <msgpack.hpp>
#include <string>
#include <iostream>
#include <sstream>
int main(void)
{
msgpack::type::tuple<int, bool, std::string> src(1, true, "example");
// serialize the object into the buffer.
// any classes that implements write(const char*,size_t) can be a buffer.
std::stringstream buffer;
msgpack::pack(buffer, src);
// send the buffer ...
buffer.seekg(0);
// deserialize the buffer into msgpack::object instance.
std::string str(buffer.str());
// deserialized object is valid during the msgpack::zone instance alive.
msgpack::zone mempool;
msgpack::object deserialized;
msgpack::unpack(str.data(), str.size(), NULL, &mempool, &deserialized);
// msgpack::object supports ostream.
std::cout << deserialized << std::endl;
// convert msgpack::object instance into the original type.
// if the type is mismatched, it throws msgpack::type_error exception.
msgpack::type::tuple<int, bool, std::string> dst;
deserialized.convert(&dst);
return 0;
}

View File

@ -1,5 +0,0 @@
require 'msgpack'
serialized = [1, -1, true, false, nil, {"key" => "value"}].to_msgpack
p MessagePack.unpack(serialized)

View File

@ -1,136 +0,0 @@
#include <msgpack.hpp>
#include <iostream>
#include <stdexcept>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
class Server {
public:
Server(int sock) : m_sock(sock) { }
~Server() { }
typedef std::auto_ptr<msgpack::zone> auto_zone;
void socket_readable()
{
m_pac.reserve_buffer(1024);
ssize_t count =
read(m_sock, m_pac.buffer(), m_pac.buffer_capacity());
if(count < 0) {
if(errno == EAGAIN || errno == EINTR) {
return;
} else {
throw std::runtime_error(strerror(errno));
}
} else if(count == 0) {
throw std::runtime_error("connection closed");
}
m_pac.buffer_consumed(count);
while(m_pac.execute()) {
msgpack::object msg = m_pac.data();
auto_zone life( m_pac.release_zone() );
m_pac.reset();
process_message(msg, life);
}
if(m_pac.message_size() > 10*1024*1024) {
throw std::runtime_error("message is too large");
}
}
private:
void process_message(msgpack::object msg, auto_zone& life)
{
std::cout << "message reached: " << msg << std::endl;
}
private:
int m_sock;
msgpack::unpacker m_pac;
};
static void* run_server(void* arg)
try {
Server* srv = reinterpret_cast<Server*>(arg);
while(true) {
srv->socket_readable();
}
return NULL;
} catch (std::exception& e) {
std::cerr << "error while processing client packet: "
<< e.what() << std::endl;
return NULL;
} catch (...) {
std::cerr << "error while processing client packet: "
<< "unknown error" << std::endl;
return NULL;
}
struct fwriter {
fwriter(int fd) : m_fp( fdopen(fd, "w") ) { }
void write(const char* buf, size_t buflen)
{
size_t count = fwrite(buf, buflen, 1, m_fp);
if(count < 1) {
std::cout << buflen << std::endl;
std::cout << count << std::endl;
throw std::runtime_error(strerror(errno));
}
}
void flush() { fflush(m_fp); }
void close() { fclose(m_fp); }
private:
FILE* m_fp;
};
int main(void)
{
int pair[2];
pipe(pair);
// run server thread
Server srv(pair[0]);
pthread_t thread;
pthread_create(&thread, NULL,
run_server, reinterpret_cast<void*>(&srv));
// client thread:
fwriter writer(pair[1]);
msgpack::packer<fwriter> pk(writer);
typedef msgpack::type::tuple<std::string, std::string, std::string> put_t;
typedef msgpack::type::tuple<std::string, std::string> get_t;
put_t req1("put", "apple", "red");
put_t req2("put", "lemon", "yellow");
get_t req3("get", "apple");
pk.pack(req1);
pk.pack(req2);
pk.pack(req3);
writer.flush();
writer.close();
pthread_join(thread, NULL);
}

View File

@ -1,72 +0,0 @@
require 'msgpack'
class Server
def initialize(sock)
@sock = sock
@pk = MessagePack::Unpacker.new
@buffer = ''
@nread = 0
end
def run
while true
begin
data = @sock.sysread(1024)
rescue
puts "connection closed (#{$!})"
return
end
receive_data(data)
end
end
private
def receive_data(data)
@buffer << data
while true
@nread = @pk.execute(@buffer, @nread)
if @pk.finished?
msg = @pk.data
process_message(msg)
@pk.reset
@buffer.slice!(0, @nread)
@nread = 0
next unless @buffer.empty?
end
break
end
if @buffer.length > 10*1024*1024
raise "message is too large"
end
rescue
puts "error while processing client packet: #{$!}"
end
def process_message(msg)
puts "message reached: #{msg.inspect}"
end
end
rpipe, wpipe = IO.pipe
# run server thread
thread = Thread.new(Server.new(rpipe)) {|srv|
srv.run
}
# client thread:
wpipe.write ["put", "apple", "red"].to_msgpack
wpipe.write ["put", "lemon", "yellow"].to_msgpack
wpipe.write ["get", "apple"].to_msgpack
wpipe.close
thread.join

View File

@ -1,26 +0,0 @@
/*
* MessagePack unpacking routine template
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MSGPACK_PACK_DEFINE_H__
#define MSGPACK_PACK_DEFINE_H__
#include <stddef.h>
#include <stdint.h>
#include <limits.h>
#endif /* msgpack/pack_define.h */

View File

@ -1,741 +0,0 @@
/*
* MessagePack packing routine template
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __LITTLE_ENDIAN__
#elif __BYTE_ORDER == __BIG_ENDIAN
#define __BIG_ENDIAN__
#endif
#endif
#ifdef __LITTLE_ENDIAN__
#define STORE8_BE8(d) \
((uint8_t*)&d)[0]
#define STORE16_BE8(d) \
((uint8_t*)&d)[0]
#define STORE16_BE16(d) \
((uint8_t*)&d)[1], ((uint8_t*)&d)[0]
#define STORE32_BE8(d) \
((uint8_t*)&d)[0]
#define STORE32_BE16(d) \
((uint8_t*)&d)[1], ((uint8_t*)&d)[0]
#define STORE32_BE32(d) \
((uint8_t*)&d)[3], ((uint8_t*)&d)[2], ((uint8_t*)&d)[1], ((uint8_t*)&d)[0]
#define STORE64_BE8(d) \
((uint8_t*)&d)[0]
#define STORE64_BE16(d) \
((uint8_t*)&d)[1], ((uint8_t*)&d)[0]
#define STORE64_BE32(d) \
((uint8_t*)&d)[3], ((uint8_t*)&d)[2], ((uint8_t*)&d)[1], ((uint8_t*)&d)[0]
#define STORE64_BE64(d) \
((uint8_t*)&d)[7], ((uint8_t*)&d)[6], ((uint8_t*)&d)[5], ((uint8_t*)&d)[4], \
((uint8_t*)&d)[3], ((uint8_t*)&d)[2], ((uint8_t*)&d)[1], ((uint8_t*)&d)[0]
#elif __BIG_ENDIAN__
#define STORE8_BE8(d) \
((uint8_t*)&d)[0]
#define STORE16_BE8(d) \
((uint8_t*)&d)[1]
#define STORE16_BE16(d) \
((uint8_t*)&d)[0], ((uint8_t*)&d)[1]
#define STORE32_BE8(d) \
((uint8_t*)&d)[3]
#define STORE32_BE16(d) \
((uint8_t*)&d)[2], ((uint8_t*)&d)[3]
#define STORE32_BE32(d) \
((uint8_t*)&d)[0], ((uint8_t*)&d)[1], ((uint8_t*)&d)[2], ((uint8_t*)&d)[3]
#define STORE64_BE8(d) \
((uint8_t*)&d)[7]
#define STORE64_BE16(d) \
((uint8_t*)&d)[6], ((uint8_t*)&d)[7]
#define STORE64_BE32(d) \
((uint8_t*)&d)[4], ((uint8_t*)&d)[5], ((uint8_t*)&d)[6], ((uint8_t*)&d)[7]
#define STORE64_BE64(d) \
((uint8_t*)&d)[0], ((uint8_t*)&d)[1], ((uint8_t*)&d)[2], ((uint8_t*)&d)[3], \
((uint8_t*)&d)[4], ((uint8_t*)&d)[5], ((uint8_t*)&d)[6], ((uint8_t*)&d)[7]
#endif
#ifndef msgpack_pack_inline_func
#error msgpack_pack_inline_func template is not defined
#endif
#ifndef msgpack_pack_user
#error msgpack_pack_user type is not defined
#endif
#ifndef msgpack_pack_append_buffer
#error msgpack_pack_append_buffer callback is not defined
#endif
/*
* Integer
*/
#define msgpack_pack_real_uint8(x, d) \
do { \
if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE8_BE8(d), 1); \
} else { \
/* unsigned 8 */ \
const unsigned char buf[2] = {0xcc, STORE8_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} while(0)
#define msgpack_pack_real_uint16(x, d) \
do { \
if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE16_BE8(d), 1); \
} else if(d < (1<<8)) { \
/* unsigned 8 */ \
const unsigned char buf[2] = {0xcc, STORE16_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else { \
/* unsigned 16 */ \
const unsigned char buf[3] = {0xcd, STORE16_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} \
} while(0)
#define msgpack_pack_real_uint32(x, d) \
do { \
if(d < (1<<8)) { \
if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE32_BE8(d), 1); \
} else { \
/* unsigned 8 */ \
const unsigned char buf[2] = {0xcc, STORE32_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} else { \
if(d < (1<<16)) { \
/* unsigned 16 */ \
const unsigned char buf[3] = {0xcd, STORE32_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} else { \
/* unsigned 32 */ \
const unsigned char buf[5] = {0xce, STORE32_BE32(d)}; \
msgpack_pack_append_buffer(x, buf, 5); \
} \
} \
} while(0)
#define msgpack_pack_real_uint64(x, d) \
do { \
if(d < (1ULL<<8)) { \
if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE64_BE8(d), 1); \
} else { \
/* unsigned 8 */ \
const unsigned char buf[2] = {0xcc, STORE64_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} else { \
if(d < (1ULL<<16)) { \
/* signed 16 */ \
const unsigned char buf[3] = {0xcd, STORE64_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} else if(d < (1ULL<<32)) { \
/* signed 32 */ \
const unsigned char buf[5] = {0xce, STORE64_BE32(d)}; \
msgpack_pack_append_buffer(x, buf, 5); \
} else { \
/* signed 64 */ \
const unsigned char buf[9] = {0xcf, STORE64_BE64(d)}; \
msgpack_pack_append_buffer(x, buf, 9); \
} \
} \
} while(0)
#define msgpack_pack_real_int8(x, d) \
do { \
if(d < -(1<<5)) { \
/* signed 8 */ \
const unsigned char buf[2] = {0xd0, STORE8_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE8_BE8(d), 1); \
} \
} while(0)
#define msgpack_pack_real_int16(x, d) \
do { \
if(d < -(1<<5)) { \
if(d < -(1<<7)) { \
/* signed 16 */ \
const unsigned char buf[3] = {0xd1, STORE16_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} else { \
/* signed 8 */ \
const unsigned char buf[2] = {0xd0, STORE16_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} else if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE16_BE8(d), 1); \
} else { \
if(d < (1<<8)) { \
/* unsigned 8 */ \
const unsigned char buf[2] = {0xcc, STORE16_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else { \
/* unsigned 16 */ \
const unsigned char buf[3] = {0xcd, STORE16_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} \
} \
} while(0)
#define msgpack_pack_real_int32(x, d) \
do { \
if(d < -(1<<5)) { \
if(d < -(1<<15)) { \
/* signed 32 */ \
const unsigned char buf[5] = {0xd2, STORE32_BE32(d)}; \
msgpack_pack_append_buffer(x, buf, 5); \
} else if(d < -(1<<7)) { \
/* signed 16 */ \
const unsigned char buf[3] = {0xd1, STORE32_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} else { \
/* signed 8 */ \
const unsigned char buf[2] = {0xd0, STORE32_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} else if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE32_BE8(d), 1); \
} else { \
if(d < (1<<8)) { \
/* unsigned 8 */ \
const unsigned char buf[2] = {0xcc, STORE32_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else if(d < (1<<16)) { \
/* unsigned 16 */ \
const unsigned char buf[3] = {0xcd, STORE32_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} else { \
/* unsigned 32 */ \
const unsigned char buf[5] = {0xce, STORE32_BE32(d)}; \
msgpack_pack_append_buffer(x, buf, 5); \
} \
} \
} while(0)
#define msgpack_pack_real_int64(x, d) \
do { \
if(d < -(1LL<<5)) { \
if(d < -(1LL<<15)) { \
if(d < -(1LL<<31)) { \
/* signed 64 */ \
const unsigned char buf[9] = {0xd3, STORE64_BE64(d)}; \
msgpack_pack_append_buffer(x, buf, 9); \
} else { \
/* signed 32 */ \
const unsigned char buf[5] = {0xd2, STORE64_BE32(d)}; \
msgpack_pack_append_buffer(x, buf, 5); \
} \
} else { \
if(d < -(1<<7)) { \
/* signed 16 */ \
const unsigned char buf[3] = {0xd1, STORE64_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} else { \
/* signed 8 */ \
const unsigned char buf[2] = {0xd0, STORE64_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} \
} \
} else if(d < (1<<7)) { \
/* fixnum */ \
msgpack_pack_append_buffer(x, &STORE64_BE8(d), 1); \
} else { \
if(d < (1LL<<16)) { \
if(d < (1<<8)) { \
/* unsigned 8 */ \
const unsigned char buf[2] = {0xcc, STORE64_BE8(d)}; \
msgpack_pack_append_buffer(x, buf, 2); \
} else { \
/* unsigned 16 */ \
const unsigned char buf[3] = {0xcd, STORE64_BE16(d)}; \
msgpack_pack_append_buffer(x, buf, 3); \
} \
} else { \
if(d < (1LL<<32)) { \
/* unsigned 32 */ \
const unsigned char buf[5] = {0xce, STORE64_BE32(d)}; \
msgpack_pack_append_buffer(x, buf, 5); \
} else { \
/* unsigned 64 */ \
const unsigned char buf[9] = {0xcf, STORE64_BE64(d)}; \
msgpack_pack_append_buffer(x, buf, 9); \
} \
} \
} \
} while(0)
#ifdef msgpack_pack_inline_func_fastint
msgpack_pack_inline_func_fastint(_uint8)(msgpack_pack_user x, uint8_t d)
{
const unsigned char buf[2] = {0xcc, STORE8_BE8(d)};
msgpack_pack_append_buffer(x, buf, 2);
}
msgpack_pack_inline_func_fastint(_uint16)(msgpack_pack_user x, uint16_t d)
{
const unsigned char buf[3] = {0xcd, STORE16_BE16(d)};
msgpack_pack_append_buffer(x, buf, 3);
}
msgpack_pack_inline_func_fastint(_uint32)(msgpack_pack_user x, uint32_t d)
{
const unsigned char buf[5] = {0xce, STORE32_BE32(d)};
msgpack_pack_append_buffer(x, buf, 5);
}
msgpack_pack_inline_func_fastint(_uint64)(msgpack_pack_user x, uint64_t d)
{
const unsigned char buf[9] = {0xcf, STORE64_BE64(d)};
msgpack_pack_append_buffer(x, buf, 9);
}
msgpack_pack_inline_func_fastint(_int8)(msgpack_pack_user x, int8_t d)
{
const unsigned char buf[2] = {0xd0, STORE8_BE8(d)};
msgpack_pack_append_buffer(x, buf, 2);
}
msgpack_pack_inline_func_fastint(_int16)(msgpack_pack_user x, int16_t d)
{
const unsigned char buf[3] = {0xd1, STORE16_BE16(d)};
msgpack_pack_append_buffer(x, buf, 3);
}
msgpack_pack_inline_func_fastint(_int32)(msgpack_pack_user x, int32_t d)
{
const unsigned char buf[5] = {0xd2, STORE32_BE32(d)};
msgpack_pack_append_buffer(x, buf, 5);
}
msgpack_pack_inline_func_fastint(_int64)(msgpack_pack_user x, int64_t d)
{
const unsigned char buf[9] = {0xd3, STORE64_BE64(d)};
msgpack_pack_append_buffer(x, buf, 9);
}
#undef msgpack_pack_inline_func_fastint
#endif
msgpack_pack_inline_func(_uint8)(msgpack_pack_user x, uint8_t d)
{
msgpack_pack_real_uint8(x, d);
}
msgpack_pack_inline_func(_uint16)(msgpack_pack_user x, uint16_t d)
{
msgpack_pack_real_uint16(x, d);
}
msgpack_pack_inline_func(_uint32)(msgpack_pack_user x, uint32_t d)
{
msgpack_pack_real_uint32(x, d);
}
msgpack_pack_inline_func(_uint64)(msgpack_pack_user x, uint64_t d)
{
msgpack_pack_real_uint64(x, d);
}
msgpack_pack_inline_func(_int8)(msgpack_pack_user x, int8_t d)
{
msgpack_pack_real_int8(x, d);
}
msgpack_pack_inline_func(_int16)(msgpack_pack_user x, int16_t d)
{
msgpack_pack_real_int16(x, d);
}
msgpack_pack_inline_func(_int32)(msgpack_pack_user x, int32_t d)
{
msgpack_pack_real_int32(x, d);
}
msgpack_pack_inline_func(_int64)(msgpack_pack_user x, int64_t d)
{
msgpack_pack_real_int64(x, d);
}
#ifdef msgpack_pack_inline_func_cint
msgpack_pack_inline_func_cint(_short)(msgpack_pack_user x, short d)
{
#if defined(SIZEOF_SHORT) || defined(SHRT_MAX)
#if SIZEOF_SHORT == 2 || SHRT_MAX == 0x7fff
msgpack_pack_real_int16(x, d);
#elif SIZEOF_SHORT == 4 || SHRT_MAX == 0x7fffffff
msgpack_pack_real_int32(x, d);
#else
msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(short) == 2) {
msgpack_pack_real_int16(x, d);
} else if(sizeof(short) == 4) {
msgpack_pack_real_int32(x, d);
} else {
msgpack_pack_real_int64(x, d);
}
#endif
}
msgpack_pack_inline_func_cint(_int)(msgpack_pack_user x, int d)
{
#if defined(SIZEOF_INT) || defined(INT_MAX)
#if SIZEOF_INT == 2 || INT_MAX == 0x7fff
msgpack_pack_real_int16(x, d);
#elif SIZEOF_INT == 4 || INT_MAX == 0x7fffffff
msgpack_pack_real_int32(x, d);
#else
msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(int) == 2) {
msgpack_pack_real_int16(x, d);
} else if(sizeof(int) == 4) {
msgpack_pack_real_int32(x, d);
} else {
msgpack_pack_real_int64(x, d);
}
#endif
}
msgpack_pack_inline_func_cint(_long)(msgpack_pack_user x, long d)
{
#if defined(SIZEOF_LONG) || defined(LONG_MAX)
#if SIZEOF_LONG == 2 || LONG_MAX == 0x7fffL
msgpack_pack_real_int16(x, d);
#elif SIZEOF_LONG == 4 || LONG_MAX == 0x7fffffffL
msgpack_pack_real_int32(x, d);
#else
msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(long) == 2) {
msgpack_pack_real_int16(x, d);
} else if(sizeof(long) == 4) {
msgpack_pack_real_int32(x, d);
} else {
msgpack_pack_real_int64(x, d);
}
#endif
}
msgpack_pack_inline_func_cint(_long_long)(msgpack_pack_user x, long long d)
{
#if defined(SIZEOF_LONG_LONG) || defined(LLONG_MAX)
#if SIZEOF_LONG_LONG == 2 || LLONG_MAX == 0x7fffL
msgpack_pack_real_int16(x, d);
#elif SIZEOF_LONG_LONG == 4 || LLONG_MAX == 0x7fffffffL
msgpack_pack_real_int32(x, d);
#else
msgpack_pack_real_int64(x, d);
#endif
#else
if(sizeof(long long) == 2) {
msgpack_pack_real_int16(x, d);
} else if(sizeof(long long) == 4) {
msgpack_pack_real_int32(x, d);
} else {
msgpack_pack_real_int64(x, d);
}
#endif
}
msgpack_pack_inline_func_cint(_unsigned_short)(msgpack_pack_user x, unsigned short d)
{
#if defined(SIZEOF_SHORT) || defined(USHRT_MAX)
#if SIZEOF_SHORT == 2 || USHRT_MAX == 0xffffU
msgpack_pack_real_uint16(x, d);
#elif SIZEOF_SHORT == 4 || USHRT_MAX == 0xffffffffU
msgpack_pack_real_uint32(x, d);
#else
msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned short) == 2) {
msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned short) == 4) {
msgpack_pack_real_uint32(x, d);
} else {
msgpack_pack_real_uint64(x, d);
}
#endif
}
msgpack_pack_inline_func_cint(_unsigned_int)(msgpack_pack_user x, unsigned int d)
{
#if defined(SIZEOF_INT) || defined(UINT_MAX)
#if SIZEOF_INT == 2 || UINT_MAX == 0xffffU
msgpack_pack_real_uint16(x, d);
#elif SIZEOF_INT == 4 || UINT_MAX == 0xffffffffU
msgpack_pack_real_uint32(x, d);
#else
msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned int) == 2) {
msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned int) == 4) {
msgpack_pack_real_uint32(x, d);
} else {
msgpack_pack_real_uint64(x, d);
}
#endif
}
msgpack_pack_inline_func_cint(_unsigned_long)(msgpack_pack_user x, unsigned long d)
{
#if defined(SIZEOF_LONG) || defined(ULONG_MAX)
#if SIZEOF_LONG == 2 || ULONG_MAX == 0xffffUL
msgpack_pack_real_uint16(x, d);
#elif SIZEOF_LONG == 4 || ULONG_MAX == 0xffffffffUL
msgpack_pack_real_uint32(x, d);
#else
msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned int) == 2) {
msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned int) == 4) {
msgpack_pack_real_uint32(x, d);
} else {
msgpack_pack_real_uint64(x, d);
}
#endif
}
msgpack_pack_inline_func_cint(_unsigned_long_long)(msgpack_pack_user x, unsigned long long d)
{
#if defined(SIZEOF_LONG_LONG) || defined(ULLONG_MAX)
#if SIZEOF_LONG_LONG == 2 || ULLONG_MAX == 0xffffUL
msgpack_pack_real_uint16(x, d);
#elif SIZEOF_LONG_LONG == 4 || ULLONG_MAX == 0xffffffffUL
msgpack_pack_real_uint32(x, d);
#else
msgpack_pack_real_uint64(x, d);
#endif
#else
if(sizeof(unsigned long long) == 2) {
msgpack_pack_real_uint16(x, d);
} else if(sizeof(unsigned long long) == 4) {
msgpack_pack_real_uint32(x, d);
} else {
msgpack_pack_real_uint64(x, d);
}
#endif
}
#undef msgpack_pack_inline_func_cint
#endif
/*
* Float
*/
msgpack_pack_inline_func(_float)(msgpack_pack_user x, float d)
{
union { char buf[4]; uint32_t num; } f;
*((float*)&f.buf) = d; // FIXME
const unsigned char buf[5] = {0xca, STORE32_BE32(f.num)};
msgpack_pack_append_buffer(x, buf, 5);
}
msgpack_pack_inline_func(_double)(msgpack_pack_user x, double d)
{
union { char buf[8]; uint64_t num; } f;
*((double*)&f.buf) = d; // FIXME
const unsigned char buf[9] = {0xcb, STORE64_BE64(f.num)};
msgpack_pack_append_buffer(x, buf, 9);
}
/*
* Nil
*/
msgpack_pack_inline_func(_nil)(msgpack_pack_user x)
{
static const unsigned char d = 0xc0;
msgpack_pack_append_buffer(x, &d, 1);
}
/*
* Boolean
*/
msgpack_pack_inline_func(_true)(msgpack_pack_user x)
{
static const unsigned char d = 0xc3;
msgpack_pack_append_buffer(x, &d, 1);
}
msgpack_pack_inline_func(_false)(msgpack_pack_user x)
{
static const unsigned char d = 0xc2;
msgpack_pack_append_buffer(x, &d, 1);
}
/*
* Array
*/
msgpack_pack_inline_func(_array)(msgpack_pack_user x, unsigned int n)
{
if(n < 16) {
unsigned char d = 0x90 | n;
msgpack_pack_append_buffer(x, &d, 1);
} else if(n < 65536) {
uint16_t d = (uint16_t)n;
unsigned char buf[3] = {0xdc, STORE16_BE16(d)};
msgpack_pack_append_buffer(x, buf, 3);
} else {
uint32_t d = (uint32_t)n;
unsigned char buf[5] = {0xdd, STORE32_BE32(d)};
msgpack_pack_append_buffer(x, buf, 5);
}
}
/*
* Map
*/
msgpack_pack_inline_func(_map)(msgpack_pack_user x, unsigned int n)
{
if(n < 16) {
unsigned char d = 0x80 | n;
msgpack_pack_append_buffer(x, &STORE8_BE8(d), 1);
} else if(n < 65536) {
uint16_t d = (uint16_t)n;
unsigned char buf[3] = {0xde, STORE16_BE16(d)};
msgpack_pack_append_buffer(x, buf, 3);
} else {
uint32_t d = (uint32_t)n;
unsigned char buf[5] = {0xdf, STORE32_BE32(d)};
msgpack_pack_append_buffer(x, buf, 5);
}
}
/*
* Raw
*/
msgpack_pack_inline_func(_raw)(msgpack_pack_user x, size_t l)
{
if(l < 32) {
unsigned char d = 0xa0 | l;
msgpack_pack_append_buffer(x, &STORE8_BE8(d), 1);
} else if(l < 65536) {
uint16_t d = (uint16_t)l;
unsigned char buf[3] = {0xda, STORE16_BE16(d)};
msgpack_pack_append_buffer(x, buf, 3);
} else {
uint32_t d = (uint32_t)l;
unsigned char buf[5] = {0xdb, STORE32_BE32(d)};
msgpack_pack_append_buffer(x, buf, 5);
}
}
msgpack_pack_inline_func(_raw_body)(msgpack_pack_user x, const void* b, size_t l)
{
msgpack_pack_append_buffer(x, (const unsigned char*)b, l);
}
#undef msgpack_pack_inline_func
#undef msgpack_pack_user
#undef msgpack_pack_append_buffer
#undef STORE8_BE8
#undef STORE16_BE8
#undef STORE16_BE16
#undef STORE32_BE8
#undef STORE32_BE16
#undef STORE32_BE32
#undef STORE64_BE8
#undef STORE64_BE16
#undef STORE64_BE32
#undef STORE64_BE64
#undef msgpack_pack_real_uint8
#undef msgpack_pack_real_uint16
#undef msgpack_pack_real_uint32
#undef msgpack_pack_real_uint64
#undef msgpack_pack_real_int8
#undef msgpack_pack_real_int16
#undef msgpack_pack_real_int32
#undef msgpack_pack_real_int64

View File

@ -1,129 +0,0 @@
/*
* MessagePack unpacking routine template
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MSGPACK_UNPACK_DEFINE_H__
#define MSGPACK_UNPACK_DEFINE_H__
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#ifndef __WIN32__
#include <arpa/inet.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef MSGPACK_MAX_STACK_SIZE
#define MSGPACK_MAX_STACK_SIZE 16
#endif
#if !defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define __LITTLE_ENDIAN__
#elif __BYTE_ORDER == __BIG_ENDIAN
#define __BIG_ENDIAN__
#endif
#endif
#define msgpack_betoh16(x) ntohs(x)
#define msgpack_betoh32(x) ntohl(x)
#ifdef __LITTLE_ENDIAN__
#if defined(__bswap_64)
# define msgpack_betoh64(x) __bswap_64(x)
#elif defined(__DARWIN_OSSwapInt64)
# define msgpack_betoh64(x) __DARWIN_OSSwapInt64(x)
#else
static inline uint64_t msgpack_betoh64(uint64_t x) {
return ((x << 56) & 0xff00000000000000ULL ) |
((x << 40) & 0x00ff000000000000ULL ) |
((x << 24) & 0x0000ff0000000000ULL ) |
((x << 8) & 0x000000ff00000000ULL ) |
((x >> 8) & 0x00000000ff000000ULL ) |
((x >> 24) & 0x0000000000ff0000ULL ) |
((x >> 40) & 0x000000000000ff00ULL ) |
((x >> 56) & 0x00000000000000ffULL ) ;
}
#endif
#else
#define msgpack_betoh64(x) (x)
#endif
typedef enum {
CS_HEADER = 0x00, // nil
//CS_ = 0x01,
//CS_ = 0x02, // false
//CS_ = 0x03, // true
//CS_ = 0x04,
//CS_ = 0x05,
//CS_ = 0x06,
//CS_ = 0x07,
//CS_ = 0x08,
//CS_ = 0x09,
CS_FLOAT = 0x0a,
CS_DOUBLE = 0x0b,
CS_UINT_8 = 0x0c,
CS_UINT_16 = 0x0d,
CS_UINT_32 = 0x0e,
CS_UINT_64 = 0x0f,
CS_INT_8 = 0x10,
CS_INT_16 = 0x11,
CS_INT_32 = 0x12,
CS_INT_64 = 0x13,
//CS_ = 0x14,
//CS_ = 0x15,
//CS_BIG_INT_16 = 0x16,
//CS_BIG_INT_32 = 0x17,
//CS_BIG_FLOAT_16 = 0x18,
//CS_BIG_FLOAT_32 = 0x19,
CS_RAW_16 = 0x1a,
CS_RAW_32 = 0x1b,
CS_ARRAY_16 = 0x1c,
CS_ARRAY_32 = 0x1d,
CS_MAP_16 = 0x1e,
CS_MAP_32 = 0x1f,
//ACS_BIG_INT_VALUE,
//ACS_BIG_FLOAT_VALUE,
ACS_RAW_VALUE,
} msgpack_unpack_state;
typedef enum {
CT_ARRAY_ITEM,
CT_MAP_KEY,
CT_MAP_VALUE,
} msgpack_container_type;
#ifdef __cplusplus
}
#endif
#endif /* msgpack/unpack_define.h */

View File

@ -1,361 +0,0 @@
/*
* MessagePack unpacking routine template
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef msgpack_unpack_func
#error msgpack_unpack_func template is not defined
#endif
#ifndef msgpack_unpack_callback
#error msgpack_unpack_callback template is not defined
#endif
#ifndef msgpack_unpack_struct
#error msgpack_unpack_struct template is not defined
#endif
#ifndef msgpack_unpack_struct_decl
#define msgpack_unpack_struct_decl(name) msgpack_unpack_struct(name)
#endif
#ifndef msgpack_unpack_object
#error msgpack_unpack_object type is not defined
#endif
#ifndef msgpack_unpack_user
#error msgpack_unpack_user type is not defined
#endif
msgpack_unpack_struct_decl(_stack) {
msgpack_unpack_object obj;
size_t count;
unsigned int ct;
msgpack_unpack_object map_key;
};
msgpack_unpack_struct_decl(_context) {
msgpack_unpack_user user;
unsigned int cs;
unsigned int trail;
unsigned int top;
msgpack_unpack_struct(_stack) stack[MSGPACK_MAX_STACK_SIZE];
};
msgpack_unpack_func(void, _init)(msgpack_unpack_struct(_context)* ctx)
{
ctx->cs = CS_HEADER;
ctx->trail = 0;
ctx->top = 0;
ctx->stack[0].obj = msgpack_unpack_callback(_root)(&ctx->user);
}
msgpack_unpack_func(msgpack_unpack_object, _data)(msgpack_unpack_struct(_context)* ctx)
{
return (ctx)->stack[0].obj;
}
msgpack_unpack_func(int, _execute)(msgpack_unpack_struct(_context)* ctx, const char* data, size_t len, size_t* off)
{
assert(len >= *off);
const unsigned char* p = (unsigned char*)data + *off;
const unsigned char* const pe = (unsigned char*)data + len;
const void* n = NULL;
unsigned int trail = ctx->trail;
unsigned int cs = ctx->cs;
unsigned int top = ctx->top;
msgpack_unpack_struct(_stack)* stack = ctx->stack;
msgpack_unpack_user* user = &ctx->user;
msgpack_unpack_object obj;
msgpack_unpack_struct(_stack)* c = NULL;
int ret;
#define push_simple_value(func) \
if(msgpack_unpack_callback(func)(user, &obj) < 0) { goto _failed; } \
goto _push
#define push_fixed_value(func, arg) \
if(msgpack_unpack_callback(func)(user, arg, &obj) < 0) { goto _failed; } \
goto _push
#define push_variable_value(func, base, pos, len) \
if(msgpack_unpack_callback(func)(user, \
(const char*)base, (const char*)pos, len, &obj) < 0) { goto _failed; } \
goto _push
#define again_fixed_trail(_cs, trail_len) \
trail = trail_len; \
cs = _cs; \
goto _fixed_trail_again
#define again_fixed_trail_if_zero(_cs, trail_len, ifzero) \
trail = trail_len; \
if(trail == 0) { goto ifzero; } \
cs = _cs; \
goto _fixed_trail_again
#define start_container(func, count_, ct_) \
if(msgpack_unpack_callback(func)(user, count_, &stack[top].obj) < 0) { goto _failed; } \
if((count_) == 0) { obj = stack[top].obj; goto _push; } \
if(top >= MSGPACK_MAX_STACK_SIZE) { goto _failed; } \
stack[top].ct = ct_; \
stack[top].count = count_; \
/*printf("container %d count %d stack %d\n",stack[top].obj,count_,top);*/ \
/*printf("stack push %d\n", top);*/ \
++top; \
goto _header_again
#define NEXT_CS(p) \
((unsigned int)*p & 0x1f)
#define PTR_CAST_8(ptr) (*(uint8_t*)ptr)
#define PTR_CAST_16(ptr) msgpack_betoh16(*(uint16_t*)ptr)
#define PTR_CAST_32(ptr) msgpack_betoh32(*(uint32_t*)ptr)
#define PTR_CAST_64(ptr) msgpack_betoh64(*(uint64_t*)ptr)
if(p == pe) { goto _out; }
do {
switch(cs) {
case CS_HEADER:
switch(*p) {
case 0x00 ... 0x7f: // Positive Fixnum
push_fixed_value(_uint8, *(uint8_t*)p);
case 0xe0 ... 0xff: // Negative Fixnum
push_fixed_value(_int8, *(int8_t*)p);
case 0xc0 ... 0xdf: // Variable
switch(*p) {
case 0xc0: // nil
push_simple_value(_nil);
//case 0xc1: // string
// again_terminal_trail(NEXT_CS(p), p+1);
case 0xc2: // false
push_simple_value(_false);
case 0xc3: // true
push_simple_value(_true);
//case 0xc4:
//case 0xc5:
//case 0xc6:
//case 0xc7:
//case 0xc8:
//case 0xc9:
case 0xca: // float
case 0xcb: // double
case 0xcc: // unsigned int 8
case 0xcd: // unsigned int 16
case 0xce: // unsigned int 32
case 0xcf: // unsigned int 64
case 0xd0: // signed int 8
case 0xd1: // signed int 16
case 0xd2: // signed int 32
case 0xd3: // signed int 64
again_fixed_trail(NEXT_CS(p), 1 << (((unsigned int)*p) & 0x03));
//case 0xd4:
//case 0xd5:
//case 0xd6: // big integer 16
//case 0xd7: // big integer 32
//case 0xd8: // big float 16
//case 0xd9: // big float 32
case 0xda: // raw 16
case 0xdb: // raw 32
case 0xdc: // array 16
case 0xdd: // array 32
case 0xde: // map 16
case 0xdf: // map 32
again_fixed_trail(NEXT_CS(p), 2 << (((unsigned int)*p) & 0x01));
default:
goto _failed;
}
case 0xa0 ... 0xbf: // FixRaw
again_fixed_trail_if_zero(ACS_RAW_VALUE, ((unsigned int)*p & 0x1f), _raw_zero);
case 0x90 ... 0x9f: // FixArray
start_container(_array, ((unsigned int)*p) & 0x0f, CT_ARRAY_ITEM);
case 0x80 ... 0x8f: // FixMap
start_container(_map, ((unsigned int)*p) & 0x0f, CT_MAP_KEY);
default:
goto _failed;
}
// end CS_HEADER
_fixed_trail_again:
++p;
default:
if((size_t)(pe - p) < trail) { goto _out; }
n = p; p += trail - 1;
switch(cs) {
//case CS_
//case CS_
case CS_FLOAT: {
union { uint32_t num; char buf[4]; } f;
f.num = PTR_CAST_32(n); // FIXME
push_fixed_value(_float, *((float*)f.buf)); }
case CS_DOUBLE: {
union { uint64_t num; char buf[8]; } f;
f.num = PTR_CAST_64(n); // FIXME
push_fixed_value(_double, *((double*)f.buf)); }
case CS_UINT_8:
push_fixed_value(_uint8, (uint8_t)PTR_CAST_8(n));
case CS_UINT_16:
push_fixed_value(_uint16, (uint16_t)PTR_CAST_16(n));
case CS_UINT_32:
push_fixed_value(_uint32, (uint32_t)PTR_CAST_32(n));
case CS_UINT_64:
push_fixed_value(_uint64, (uint64_t)PTR_CAST_64(n));
case CS_INT_8:
push_fixed_value(_int8, (int8_t)PTR_CAST_8(n));
case CS_INT_16:
push_fixed_value(_int16, (int16_t)PTR_CAST_16(n));
case CS_INT_32:
push_fixed_value(_int32, (int32_t)PTR_CAST_32(n));
case CS_INT_64:
push_fixed_value(_int64, (int64_t)PTR_CAST_64(n));
//case CS_
//case CS_
//case CS_BIG_INT_16:
// again_fixed_trail_if_zero(ACS_BIG_INT_VALUE, (uint16_t)PTR_CAST_16(n), _big_int_zero);
//case CS_BIG_INT_32:
// again_fixed_trail_if_zero(ACS_BIG_INT_VALUE, (uint32_t)PTR_CAST_32(n), _big_int_zero);
//case ACS_BIG_INT_VALUE:
//_big_int_zero:
// // FIXME
// push_variable_value(_big_int, data, n, trail);
//case CS_BIG_FLOAT_16:
// again_fixed_trail_if_zero(ACS_BIG_FLOAT_VALUE, (uint16_t)PTR_CAST_16(n), _big_float_zero);
//case CS_BIG_FLOAT_32:
// again_fixed_trail_if_zero(ACS_BIG_FLOAT_VALUE, (uint32_t)PTR_CAST_32(n), _big_float_zero);
//case ACS_BIG_FLOAT_VALUE:
//_big_float_zero:
// // FIXME
// push_variable_value(_big_float, data, n, trail);
case CS_RAW_16:
again_fixed_trail_if_zero(ACS_RAW_VALUE, (uint16_t)PTR_CAST_16(n), _raw_zero);
case CS_RAW_32:
again_fixed_trail_if_zero(ACS_RAW_VALUE, (uint32_t)PTR_CAST_32(n), _raw_zero);
case ACS_RAW_VALUE:
_raw_zero:
push_variable_value(_raw, data, n, trail);
case CS_ARRAY_16:
start_container(_array, (uint16_t)PTR_CAST_16(n), CT_ARRAY_ITEM);
case CS_ARRAY_32:
/* FIXME security guard */
start_container(_array, (uint32_t)PTR_CAST_32(n), CT_ARRAY_ITEM);
case CS_MAP_16:
start_container(_map, (uint16_t)PTR_CAST_16(n), CT_MAP_KEY);
case CS_MAP_32:
/* FIXME security guard */
start_container(_map, (uint32_t)PTR_CAST_32(n), CT_MAP_KEY);
default:
goto _failed;
}
}
_push:
if(top == 0) { goto _finish; }
c = &stack[top-1];
switch(c->ct) {
case CT_ARRAY_ITEM:
if(msgpack_unpack_callback(_array_item)(user, &c->obj, obj) < 0) { goto _failed; }
if(--c->count == 0) {
obj = c->obj;
--top;
/*printf("stack pop %d\n", top);*/
goto _push;
}
goto _header_again;
case CT_MAP_KEY:
c->map_key = obj;
c->ct = CT_MAP_VALUE;
goto _header_again;
case CT_MAP_VALUE:
if(msgpack_unpack_callback(_map_item)(user, &c->obj, c->map_key, obj) < 0) { goto _failed; }
if(--c->count == 0) {
obj = c->obj;
--top;
/*printf("stack pop %d\n", top);*/
goto _push;
}
c->ct = CT_MAP_KEY;
goto _header_again;
default:
goto _failed;
}
_header_again:
cs = CS_HEADER;
++p;
} while(p != pe);
goto _out;
_finish:
stack[0].obj = obj;
++p;
ret = 1;
/*printf("-- finish --\n"); */
goto _end;
_failed:
/*printf("** FAILED **\n"); */
ret = -1;
goto _end;
_out:
ret = 0;
goto _end;
_end:
ctx->cs = cs;
ctx->trail = trail;
ctx->top = top;
*off = p - (const unsigned char*)data;
return ret;
}
#undef msgpack_unpack_func
#undef msgpack_unpack_callback
#undef msgpack_unpack_struct
#undef msgpack_unpack_object
#undef msgpack_unpack_user
#undef push_simple_value
#undef push_fixed_value
#undef push_variable_value
#undef again_fixed_trail
#undef again_fixed_trail_if_zero
#undef start_container
#undef NEXT_CS
#undef PTR_CAST_8
#undef PTR_CAST_16
#undef PTR_CAST_32
#undef PTR_CAST_64

View File

@ -1,34 +0,0 @@
use inc::Module::Install;
name 'Data-MessagePack';
all_from 'lib/Data/MessagePack.pm';
perl_version '5.008005';
license 'perl';
can_cc or die "This module requires a C compiler";
my $ccflags = '-I../ ';
makemaker_args(
OBJECT => '$(O_FILES)',
LIBS => [''],
CCFLAGS => $ccflags,
clean => {
FILES => q{
*.stackdump
*.gcov *.gcda *.gcno
*.out
nytprof
cover_db
},
},
);
tests 't/*.t';
author_tests('xt');
auto_set_repository;
build_requires 'Test::More';
use_test_base;
auto_include;
WriteAll;

View File

@ -1,40 +0,0 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#define NEED_newCONSTSUB
#include "ppport.h"
#ifdef __cplusplus
};
#endif
XS(xs_pack);
XS(xs_unpack);
XS(xs_unpacker_new);
XS(xs_unpacker_execute);
XS(xs_unpacker_execute_limit);
XS(xs_unpacker_is_finished);
XS(xs_unpacker_data);
XS(xs_unpacker_reset);
XS(boot_Data__MessagePack) {
dXSARGS;
HV * stash;
newXS("Data::MessagePack::pack", xs_pack, __FILE__);
newXS("Data::MessagePack::unpack", xs_unpack, __FILE__);
stash = gv_stashpvn("Data::MessagePack", strlen("Data::MessagePack"), TRUE);
newCONSTSUB(stash, "true", &PL_sv_yes);
newCONSTSUB(stash, "false", &PL_sv_no);
newXS("Data::MessagePack::Unpacker::new", xs_unpacker_new, __FILE__);
newXS("Data::MessagePack::Unpacker::execute", xs_unpacker_execute, __FILE__);
newXS("Data::MessagePack::Unpacker::execute_limit", xs_unpacker_execute_limit, __FILE__);
newXS("Data::MessagePack::Unpacker::is_finished", xs_unpacker_is_finished, __FILE__);
newXS("Data::MessagePack::Unpacker::data", xs_unpacker_data, __FILE__);
newXS("Data::MessagePack::Unpacker::reset", xs_unpacker_reset, __FILE__);
}

View File

@ -1,20 +0,0 @@
use strict;
use warnings;
use Data::MessagePack;
use JSON::XS;
use Benchmark ':all';
my $a = [0..2**24];
my $j = JSON::XS::encode_json($a);
my $m = Data::MessagePack->pack($a);
print "-- deserialize\n";
print "JSON::XS: $JSON::XS::VERSION\n";
print "Data::MessagePack: $Data::MessagePack::VERSION\n";
cmpthese(
-1 => {
json => sub { JSON::XS::decode_json($j) },
mp => sub { Data::MessagePack->unpack($m) },
}
);

View File

@ -1,18 +0,0 @@
use strict;
use warnings;
use Data::MessagePack;
use JSON::XS;
use Benchmark ':all';
my $a = [0..2**24];
print "-- serialize\n";
print "JSON::XS: $JSON::XS::VERSION\n";
print "Data::MessagePack: $Data::MessagePack::VERSION\n";
cmpthese(
-1 => {
json => sub { JSON::XS::encode_json($a) },
mp => sub { Data::MessagePack->pack($a) },
}
);

View File

@ -1,33 +0,0 @@
package Data::MessagePack;
use strict;
use warnings;
use XSLoader;
our $VERSION = 0.01;
XSLoader::load(__PACKAGE__, $VERSION);
1;
__END__
=head1 NAME
Data::MessagePack - messagepack
=head1 SYNOPSIS
my $packed = Data::MessagePack->pack($dat);
my $unpacked = Data::MessagePack->unpack($dat);
=head1 DESCRIPTION
Data::MessagePack is a binary packer for perl.
=head1 AUTHORS
Tokuhiro Matsuno
=head1 SEE ALSO
L<http://msgpack.sourceforge.jp/>

View File

@ -1,52 +0,0 @@
=head1 NAME
Data::MessagePack::Unpacker - messagepack streaming deserializer
=head1 SYNOPSIS
use Data::Dumper;
my $up = Data::MessagePack::Unpacker->new;
my $ret = $up->execute($v, 0);
if ($ret != length($v)) {
fail "extra bytes";
}
return Dumper($up->data);
=head1 DESCRIPTION
This is an streaming deserializer for messagepack.
=head1 METHODS
=over 4
=item my $up = Data::MessagePack::Unpacker->new()
create new stream deserializer
=item $up->execute()
=item $up->execute_limit()
=item $up->is_finished()
is this deserializer finished?
=item $up->data()
returns deserialized object.
=item $up->reset()
reset the stream deserializer, without memory zone.
=back
=head1 AUTHORS
Tokuhiro Matsuno
=head1 SEE ALSO
L<Data::MessagePack>

View File

@ -1,155 +0,0 @@
/*
* code is written by tokuhirom.
* buffer alocation technique is taken from JSON::XS. thanks to mlehmann.
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#ifdef __cplusplus
};
#endif
#include "msgpack/pack_define.h"
#define msgpack_pack_inline_func(name) \
static inline void msgpack_pack ## name
#define msgpack_pack_inline_func_cint(name) \
static inline void msgpack_pack ## name
typedef struct {
char *cur; /* SvPVX (sv) + current output position */
char *end; /* SvEND (sv) */
SV *sv; /* result scalar */
} enc_t;
void need(enc_t *enc, STRLEN len);
#define msgpack_pack_user enc_t*
#define msgpack_pack_append_buffer(enc, buf, len) \
need(enc, len); \
memcpy(enc->cur, buf, len); \
enc->cur += len;
#include "msgpack/pack_template.h"
#define _PACK_WRAPPER(t) msgpack_pack_##t
#define PACK_WRAPPER(t) _PACK_WRAPPER(t)
#define INIT_SIZE 32 /* initial scalar size to be allocated */
void need(enc_t *enc, STRLEN len)
{
if (enc->cur + len >= enc->end) {
STRLEN cur = enc->cur - (char *)SvPVX (enc->sv);
SvGROW (enc->sv, cur + (len < (cur >> 2) ? cur >> 2 : len) + 1);
enc->cur = SvPVX (enc->sv) + cur;
enc->end = SvPVX (enc->sv) + SvLEN (enc->sv) - 1;
}
}
static void _msgpack_pack_sv(enc_t *enc, SV* val) {
if (val==NULL) {
msgpack_pack_nil(enc);
return;
}
switch (SvTYPE(val)) {
case SVt_NULL:
msgpack_pack_nil(enc);
break;
case SVt_IV:
if (SvIOK_UV(val)) {
msgpack_pack_uint32(enc, SvUV(val));
} else {
PACK_WRAPPER(IVTYPE)(enc, SvIV(val));
}
break;
case SVt_PVNV:
{
STRLEN len = 0;
char *pv = SvPV(val, len);
if (len == 1 && *pv == '1') {
msgpack_pack_true(enc);
} else if (len == 0 && *pv==0) {
msgpack_pack_false(enc);
} else {
msgpack_pack_nil(enc);
}
}
break;
case SVt_NV:
PACK_WRAPPER(NVTYPE)(enc, SvNV(val));
break;
case SVt_PVAV:
{
AV* ary = (AV*)val;
int len = av_len(ary) + 1;
int i;
msgpack_pack_array(enc, len);
for (i=0; i<len; i++) {
SV** svp = av_fetch(ary, i, 0);
if (svp) {
_msgpack_pack_sv(enc, *svp);
} else {
msgpack_pack_nil(enc);
}
}
}
break;
case SVt_PVHV:
{
HV* hval = (HV*)val;
int count = hv_iterinit(hval);
HE* he;
msgpack_pack_map(enc, count);
while (he = hv_iternext(hval)) {
_msgpack_pack_sv(enc, hv_iterkeysv(he));
_msgpack_pack_sv(enc, HeVAL(he));
}
}
break;
case SVt_RV:
_msgpack_pack_sv(enc, SvRV(val));
break;
default:
if (SvPOKp(val)) {
STRLEN len;
char * cval = SvPV(val, len);
msgpack_pack_raw(enc, len);
msgpack_pack_raw_body(enc, cval, len);
return;
} else {
sv_dump(val);
Perl_croak(aTHX_ "msgpack for perl doesn't supported this type: %d\n", SvTYPE(val));
}
}
}
XS(xs_pack) {
dXSARGS;
if (items != 2) {
Perl_croak(aTHX_ "Usage: Data::MessagePack->pack($dat)");
}
SV* val = ST(1);
enc_t enc;
enc.sv = sv_2mortal(NEWSV(0, INIT_SIZE));
enc.cur = SvPVX(enc.sv);
enc.end = SvEND(enc.sv);
SvPOK_only(enc.sv);
_msgpack_pack_sv(&enc, val);
SvCUR_set(enc.sv, enc.cur - SvPVX (enc.sv));
*SvEND (enc.sv) = 0; /* many xs functions expect a trailing 0 for text strings */
ST(0) = enc.sv;
XSRETURN(1);
}

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +0,0 @@
use strict;
use warnings;
use Test::More tests => 1;
use_ok 'Data::MessagePack';

View File

@ -1,60 +0,0 @@
use t::Util;
use Test::More;
use Data::MessagePack;
sub packit {
local $_ = unpack("H*", Data::MessagePack->pack($_[0]));
s/(..)/$1 /g;
s/ $//;
$_;
}
sub pis ($$) {
is packit($_[0]), $_[1], 'dump ' . $_[1];
}
my @dat = (
0, '00',
1, '01',
127, '7f',
128, 'cc 80',
255, 'cc ff',
256, 'cd 01 00',
65535, 'cd ff ff',
65536, 'ce 00 01 00 00',
-1, 'ff',
-32, 'e0',
-33, 'd0 df',
-128, 'd0 80',
-129, 'd1 ff 7f',
-32768, 'd1 80 00',
-32769, 'd2 ff ff 7f ff',
1.0, 'cb 3f f0 00 00 00 00 00 00',
"", 'a0',
"a", 'a1 61',
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'bf 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'da 00 20 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61',
undef, 'c0',
Data::MessagePack::true(), 'c3',
Data::MessagePack::false(), 'c2',
[], '90',
[+[]], '91 90',
[[], undef], '92 90 c0',
{'a', 0}, '81 a1 61 00',
8388608, 'ce 00 80 00 00',
[undef, false, true], '93 c0 c2 c3',
["", "a", "bc", "def"], '94 a0 a1 61 a2 62 63 a3 64 65 66',
[[], [[undef]]], '92 90 91 91 c0',
[undef, false, true], '93 c0 c2 c3',
[[0, 64, 127], [-32, -16, -1]], '92 93 00 40 7f 93 e0 f0 ff',
[0, -128, -1, 0, -32768, -1, 0, -2147483648, -1], '99 00 d0 80 ff 00 d1 80 00 ff 00 d2 80 00 00 00 ff',
2147483648, 'ce 80 00 00 00',
-2147483648, 'd2 80 00 00 00',
);
plan tests => 1*(scalar(@dat)/2);
for (my $i=0; $i<scalar(@dat); ) {
pis $dat[$i++], $dat[$i++];
}

View File

@ -1,24 +0,0 @@
use Test::More;
use Data::MessagePack;
use t::Util;
no warnings 'uninitialized'; # i need this. i need this.
sub unpackit {
my $v = $_[0];
$v =~ s/ //g;
$v = pack 'H*', $v;
return Data::MessagePack->unpack($v);
}
sub pis ($$) {
is_deeply unpackit($_[0]), $_[1], 'dump ' . $_[0];
}
my @dat = do 't/data.pl';
plan tests => 1*(scalar(@dat)/2);
for (my $i=0; $i<scalar(@dat); ) {
pis $dat[$i++], $dat[$i++];
}

View File

@ -1,32 +0,0 @@
use t::Util;
use Test::More;
use Data::MessagePack;
no warnings 'uninitialized'; # i need this. i need this.
my $up = Data::MessagePack::Unpacker->new;
sub unpackit {
my $v = $_[0];
$v =~ s/ //g;
$v = pack 'H*', $v;
$up->reset;
my $ret = $up->execute($v, 0);
if ($ret != length($v)) {
fail "extra bytes";
}
return $up->data;
}
sub pis ($$) {
is_deeply unpackit($_[0]), $_[1], 'dump ' . $_[0];
}
my @dat = do 't/data.pl';
plan tests => 1*(scalar(@dat)/2) + 1;
isa_ok $up, 'Data::MessagePack::Unpacker';
for (my $i=0; $i<scalar(@dat); ) {
pis $dat[$i++], $dat[$i++];
}

View File

@ -1,24 +0,0 @@
use Test::More;
use Data::MessagePack;
use t::Util;
no warnings 'uninitialized'; # i need this. i need this.
sub invert {
return Data::MessagePack->unpack(
Data::MessagePack->pack($_[0]),
);
}
sub pis ($) {
is_deeply invert($_[0]), $_[0], 'dump ' . $_[0];
}
my @dat = do 't/data.pl';
plan tests => 1*(scalar(@dat)/2);
for (my $i=0; $i<scalar(@dat); ) {
$i++;
pis $dat[$i++];
}

View File

@ -1,20 +0,0 @@
package t::Util;
use strict;
use warnings;
sub import {
my $pkg = caller(0);
strict->import;
warnings->import;
no strict 'refs';
*{"$pkg\::true"} = sub () {
Data::MessagePack::true()
};
*{"$pkg\::false"} = sub () {
Data::MessagePack::false()
};
}
1;

View File

@ -1,15 +0,0 @@
no warnings 'uninitialized'; # i need this. i need this.
(
'93 c0 c2 c3' => [undef, false, true],
'94 a0 a1 61 a2 62 63 a3 64 65 66', ["", "a", "bc", "def"],
'92 90 91 91 c0', [[], [[undef]]],
'93 c0 c2 c3', [undef, false, true],
'ce 80 00 00 00', 2147483648,
'99 cc 00 cc 80 cc ff cd 00 00 cd 80 00 cd ff ff ce 00 00 00 00 ce 80 00 00 00 ce ff ff ff ff', [0, 128, 255, 0, 32768, 65535, 0, 2147483648, 4294967295],
'92 93 00 40 7f 93 e0 f0 ff', [[0, 64, 127], [-32, -16, -1]],
'96 dc 00 00 dc 00 01 c0 dc 00 02 c2 c3 dd 00 00 00 00 dd 00 00 00 01 c0 dd 00 00 00 02 c2 c3', [[], [undef], [false, true], [], [undef], [false, true]],
'96 da 00 00 da 00 01 61 da 00 02 61 62 db 00 00 00 00 db 00 00 00 01 61 db 00 00 00 02 61 62', ["", "a", "ab", "", "a", "ab"],
'99 d0 00 d0 80 d0 ff d1 00 00 d1 80 00 d1 ff ff d2 00 00 00 00 d2 80 00 00 00 d2 ff ff ff ff', [0, -128, -1, 0, -32768, -1, 0, -2147483648, -1],
'82 c2 81 c0 c0 c3 81 c0 80', {false,{undef,undef}, true,{undef,{}}},
'96 de 00 00 de 00 01 c0 c2 de 00 02 c0 c2 c3 c2 df 00 00 00 00 df 00 00 00 01 c0 c2 df 00 00 00 02 c0 c2 c3 c2', [{}, {undef,false}, {true,false, undef,false}, {}, {undef,false}, {true,false, undef,false}],
)

View File

@ -1,290 +0,0 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#define NEED_newRV_noinc
#define NEED_sv_2pv_flags
#include "ppport.h"
#ifdef __cplusplus
};
#endif
typedef struct {
int finished;
SV* source;
} unpack_user;
#include "msgpack/unpack_define.h"
#define msgpack_unpack_struct(name) \
struct template ## name
#define msgpack_unpack_func(ret, name) \
ret template ## name
#define msgpack_unpack_callback(name) \
template_callback ## name
#define msgpack_unpack_object SV*
#define msgpack_unpack_user unpack_user
struct template_context;
typedef struct template_context msgpack_unpack_t;
static void template_init(msgpack_unpack_t* u);
static SV* template_data(msgpack_unpack_t* u);
static int template_execute(msgpack_unpack_t* u,
const char* data, size_t len, size_t* off);
static inline SV* template_callback_root(unpack_user* u)
{ return &PL_sv_undef; }
static inline int template_callback_uint8(unpack_user* u, uint8_t d, SV** o)
{ *o = newSVuv(d); return 0; }
static inline int template_callback_uint16(unpack_user* u, uint16_t d, SV** o)
{ *o = newSVuv(d); return 0; }
static inline int template_callback_uint32(unpack_user* u, uint32_t d, SV** o)
{ *o = newSVuv(d); return 0; }
static inline int template_callback_uint64(unpack_user* u, uint64_t d, SV** o)
{ *o = newSVuv(d); return 0; }
static inline int template_callback_int8(unpack_user* u, int8_t d, SV** o)
{ *o = newSViv((long)d); return 0; }
static inline int template_callback_int16(unpack_user* u, int16_t d, SV** o)
{ *o = newSViv((long)d); return 0; }
static inline int template_callback_int32(unpack_user* u, int32_t d, SV** o)
{ *o = newSViv((long)d); return 0; }
static inline int template_callback_int64(unpack_user* u, int64_t d, SV** o)
{ *o = newSViv(d); return 0; }
static inline int template_callback_float(unpack_user* u, float d, SV** o)
{ *o = newSVnv(d); return 0; }
static inline int template_callback_double(unpack_user* u, double d, SV** o)
{ *o = newSVnv(d); return 0; }
static inline int template_callback_nil(unpack_user* u, SV** o)
{ *o = &PL_sv_undef; return 0; }
static inline int template_callback_true(unpack_user* u, SV** o)
{ *o = &PL_sv_yes; return 0; }
static inline int template_callback_false(unpack_user* u, SV** o)
{ *o = &PL_sv_no; return 0;}
static inline int template_callback_array(unpack_user* u, unsigned int n, SV** o)
{ AV* a = newAV(); *o = (SV*)newRV_noinc((SV*)a); av_extend(a, n); return 0; }
static inline int template_callback_array_item(unpack_user* u, SV** c, SV* o)
{ av_push((AV*)SvRV(*c), o); SvREFCNT_inc(o); return 0; } /* FIXME set value directry RARRAY_PTR(obj)[RARRAY_LEN(obj)++] */
static inline int template_callback_map(unpack_user* u, unsigned int n, SV** o)
{ HV * h = newHV(); *o = newRV_noinc((SV*)h); return 0; }
static inline int template_callback_map_item(unpack_user* u, SV** c, SV* k, SV* v)
{ hv_store_ent((HV*)SvRV(*c), k, v, 0); SvREFCNT_inc(v); return 0; }
static inline int template_callback_raw(unpack_user* u, const char* b, const char* p, unsigned int l, SV** o)
{ *o = (l == 0) ? newSVpv("", 0) : newSVpv(p, l); return 0; }
#define UNPACKER(from, name) \
msgpack_unpack_t *name; \
name = INT2PTR(msgpack_unpack_t*, SvROK((from)) ? SvIV(SvRV((from))) : SvIV((from))); \
if(name == NULL) { \
Perl_croak(aTHX_ "NULL found for " # name " when shouldn't be."); \
}
#include "msgpack/unpack_template.h"
SV* _msgpack_unpack(SV* data, int limit) {
msgpack_unpack_t mp;
unpack_user u = {0, &PL_sv_undef};
int ret;
size_t from = 0;
STRLEN dlen;
const char * dptr = SvPV_const(data, dlen);
template_init(&mp);
mp.user = u;
mp.user.source = data;
ret = template_execute(&mp, dptr, (size_t)dlen, &from);
mp.user.source = &PL_sv_undef;
if(ret < 0) {
Perl_croak(aTHX_ "parse error.");
} else if(ret == 0) {
Perl_croak(aTHX_ "insufficient bytes.");
} else {
if(from < dlen) {
Perl_croak(aTHX_ "extra bytes.");
}
return template_data(&mp);
}
}
XS(xs_unpack_limit) {
dXSARGS;
if (items != 3) {
Perl_croak(aTHX_ "Usage: Data::MessagePack->unpack('datadata', $limit)");
}
{
int limit = SvIV(ST(2));
ST(0) = _msgpack_unpack(ST(1), limit);
}
XSRETURN(1);
}
XS(xs_unpack) {
dXSARGS;
msgpack_unpack_t mp;
if (items != 2) {
Perl_croak(aTHX_ "Usage: Data::MessagePack->unpack('datadata')");
}
{
ST(0) = _msgpack_unpack(ST(1), sv_len(ST(1)));
}
XSRETURN(1);
}
/* ------------------------------ stream -- */
static void _reset(SV* self) {
UNPACKER(self, mp);
template_init(mp);
unpack_user u = {0, &PL_sv_undef};
mp->user = u;
}
XS(xs_unpacker_new) {
dXSARGS;
if (items != 1) {
Perl_croak(aTHX_ "Usage: Data::MessagePack::Unpacker->new()");
}
SV* self = sv_newmortal();
msgpack_unpack_t *mp;
Newx(mp, 1, msgpack_unpack_t);
sv_setref_pv(self, "Data::MessagePack::Unpacker", mp);
_reset(self);
ST(0) = self;
XSRETURN(1);
}
static SV* _execute_impl(SV* self, SV* data, UV off, I32 limit) {
UNPACKER(self, mp);
size_t from = off;
const char* dptr = SvPV_nolen_const(data);
long dlen = limit;
int ret;
if(from >= dlen) {
Perl_croak(aTHX_ "offset is bigger than data buffer size.");
}
mp->user.source = data;
ret = template_execute(mp, dptr, (size_t)dlen, &from);
mp->user.source = &PL_sv_undef;
if(ret < 0) {
Perl_croak(aTHX_ "parse error.");
} else if(ret > 0) {
mp->user.finished = 1;
return newSVuv(from);
} else {
mp->user.finished = 0;
return newSVuv(from);
}
}
XS(xs_unpacker_execute) {
dXSARGS;
if (items != 3) {
Perl_croak(aTHX_ "Usage: $unpacker->execute_limit(data, off)");
}
{
SV* self = ST(0);
SV* data = ST(1);
IV off = SvIV(ST(2));
ST(0) = _execute_impl(self, data, off, sv_len(data));
}
XSRETURN(1);
}
XS(xs_unpacker_execute_limit) {
dXSARGS;
if (items != 4) {
Perl_croak(aTHX_ "Usage: $unpacker->execute_limit(data, off, limit)");
}
SV* self = ST(0);
SV* data = ST(1);
IV off = SvIV(ST(2));
IV limit = SvIV(ST(3));
ST(0) = _execute_impl(self, data, off, limit);
XSRETURN(1);
}
XS(xs_unpacker_is_finished) {
dXSARGS;
if (items != 1) {
Perl_croak(aTHX_ "Usage: $unpacker->is_finished()");
}
UNPACKER(ST(0), mp);
ST(0) = (mp->user.finished) ? &PL_sv_yes : &PL_sv_no;
XSRETURN(1);
}
XS(xs_unpacker_data) {
dXSARGS;
if (items != 1) {
Perl_croak(aTHX_ "Usage: $unpacker->data()");
}
UNPACKER(ST(0), mp);
ST(0) = template_data(mp);
XSRETURN(1);
}
XS(xs_unpacker_reset) {
dXSARGS;
if (items != 1) {
Perl_croak(aTHX_ "Usage: $unpacker->reset()");
}
_reset(ST(0));
XSRETURN(0);
}

View File

@ -1,4 +0,0 @@
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
all_pod_files_ok();

View File

@ -1,70 +0,0 @@
require 'rubygems'
require 'json'
require 'msgpack'
def show10(str)
puts "#{str.length/1024} KB"
puts str[0, 10].unpack('C*').map{|x|"%02x"%x}.join(' ') + " ..."
end
ary = []
i = 0
while i < (1<<24)
#ary << (1<<24)
ary << i
i += 1
end
GC.start
puts "----"
puts "MessagePack"
a = Time.now
packed = MessagePack::pack(ary)
b = Time.now
show10(packed)
sec = b - a
puts "#{sec} sec."
puts "#{packed.length.to_f / sec / 1024 / 1024 * 8} Mbps"
GC.start
=begin
puts "----"
puts "JSON"
a = Time.now
json = ary.to_json
b = Time.now
show10(json)
puts "#{b-a} sec."
ary = nil
GC.start
=end
puts "----"
puts "MessagePack"
a = Time.now
ary = MessagePack::unpack(packed)
b = Time.now
sec = b - a
puts "#{sec} sec."
puts "#{packed.length.to_f / sec / 1024 / 1024 * 8} Mbps"
p ary.size
p (1<<24)
ary = nil
GC.start
=begin
puts "----"
puts "JSON"
a = Time.now
ary = JSON::load(json)
b = Time.now
puts "#{b-a} sec."
=end

View File

@ -1,4 +0,0 @@
require 'mkmf'
$CFLAGS << " -I.. -Wall -O4"
create_makefile('msgpack')

View File

@ -1,29 +0,0 @@
= MessagePack
== Description
== Installation
=== Archive Installation
rake install
=== Gem Installation
gem install msgpack
== Features/Problems
== Synopsis
== Copyright
Author:: frsyuki <frsyuki@users.sourceforge.jp>
Copyright:: Copyright (c) 2008-2009 frsyuki
License:: Apache License, Version 2.0

View File

@ -1,133 +0,0 @@
require 'rubygems'
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require 'rake/rdoctask'
require 'rake/contrib/rubyforgepublisher'
require 'rake/contrib/sshpublisher'
require 'fileutils'
include FileUtils
NAME = "msgpack"
AUTHOR = "FURUHASHI Sadayuki"
EMAIL = "frsyuki _at_ users.sourceforge.jp"
DESCRIPTION = "Binary-based efficient data interchange format."
RUBYFORGE_PROJECT = "msgpack"
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
BIN_FILES = %w( )
VERS = "0.3.1"
#REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
REV = nil
CLEAN.include ['**/.*.sw?', '*.gem', '.config']
RDOC_OPTS = [
'--title', "#{NAME} documentation",
"--charset", "utf-8",
"--opname", "index.html",
"--line-numbers",
"--main", "README",
"--inline-source",
]
task :default => [:test]
task :package => [:clean]
Rake::TestTask.new("test") do |t|
t.libs << "test"
t.pattern = "test/**/*_test.rb"
t.verbose = true
end
spec = Gem::Specification.new do |s|
s.name = NAME
s.version = VERS
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = ["README", "ChangeLog", "AUTHORS"]
s.rdoc_options += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
s.summary = DESCRIPTION
s.description = DESCRIPTION
s.author = AUTHOR
s.email = EMAIL
s.homepage = HOMEPATH
s.executables = BIN_FILES
s.rubyforge_project = RUBYFORGE_PROJECT
s.bindir = "bin"
s.require_path = "ext"
s.autorequire = ""
s.test_files = Dir["test/test_*.rb"]
#s.add_dependency('activesupport', '>=1.3.1')
#s.required_ruby_version = '>= 1.8.2'
s.files = %w(README ChangeLog Rakefile) +
Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
Dir.glob("ext/**/*.{h,c,rb}") +
Dir.glob("examples/**/*.rb") +
Dir.glob("tools/*.rb") +
Dir.glob("msgpack/*.h")
s.extensions = FileList["ext/**/extconf.rb"].to_a
end
Rake::GemPackageTask.new(spec) do |p|
p.need_tar = true
p.gem_spec = spec
end
task :install do
name = "#{NAME}-#{VERS}.gem"
sh %{rake package}
sh %{sudo gem install pkg/#{name}}
end
task :uninstall => [:clean] do
sh %{sudo gem uninstall #{NAME}}
end
#Rake::RDocTask.new do |rdoc|
# rdoc.rdoc_dir = 'html'
# rdoc.options += RDOC_OPTS
# rdoc.template = "resh"
# #rdoc.template = "#{ENV['template']}.rb" if ENV['template']
# if ENV['DOC_FILES']
# rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
# else
# rdoc.rdoc_files.include('README', 'ChangeLog')
# rdoc.rdoc_files.include('lib/**/*.rb')
# rdoc.rdoc_files.include('ext/**/*.c')
# end
#end
desc "Publish to RubyForge"
task :rubyforge => [:rdoc, :package] do
require 'rubyforge'
Rake::RubyForgePublisher.new(RUBYFORGE_PROJECT, 'frsyuki').upload
end
desc 'Package and upload the release to rubyforge.'
task :release => [:clean, :package] do |t|
v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
abort "Versions don't match #{v} vs #{VERS}" unless v == VERS
pkg = "pkg/#{NAME}-#{VERS}"
rf = RubyForge.new
puts "Logging in"
rf.login
c = rf.userconfig
# c["release_notes"] = description if description
# c["release_changes"] = changes if changes
c["preformatted"] = true
files = [
"#{pkg}.tgz",
"#{pkg}.gem"
].compact
puts "Releasing #{NAME} v. #{VERS}"
rf.add_release RUBYFORGE_PROJECT, NAME, VERS, *files
end

View File

@ -1,3 +0,0 @@
require 'test/unit'
require File.dirname(__FILE__) + '/../ext/msgpack'

View File

@ -1,20 +0,0 @@
#!/bin/sh
mkdir -p gem/ext
mkdir -p gem/msgpack
cp extconf.rb gem/ext/
cp pack.c gem/ext/
cp pack.h gem/ext/
cp rbinit.c gem/ext/
cp unpack.c gem/ext/
cp unpack.h gem/ext/
cat test_case.rb | sed "s/require ['\"]msgpack['\"]/require File.dirname(__FILE__) + '\/test_helper.rb'/" > gem/test/msgpack_test.rb
cp ../AUTHORS gem/AUTHORS
cp ../ChangeLog gem/ChangeLog
cp ../msgpack/pack_define.h gem/msgpack/
cp ../msgpack/pack_template.h gem/msgpack/
cp ../msgpack/unpack_define.h gem/msgpack/
cp ../msgpack/unpack_template.h gem/msgpack/
cd gem && rake --trace package

View File

@ -1,12 +0,0 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::CURRENT
s.name = "msgpack"
s.version = "0.3.1"
s.summary = "MessagePack"
s.author = "FURUHASHI Sadayuki"
s.email = "frsyuki@users.sourceforge.jp"
s.homepage = "http://msgpack.sourceforge.jp/"
s.rubyforge_project = "msgpack"
s.require_paths = ["lib", "ext"]
s.files = ["lib/**/*", "ext/**/*"].map {|g| Dir.glob(g) }.flatten
end

View File

@ -1,165 +0,0 @@
/*
* MessagePack for Ruby packing routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ruby.h"
#include "msgpack/pack_define.h"
#define msgpack_pack_inline_func(name) \
static inline void msgpack_pack ## name
#define msgpack_pack_inline_func_cint(name) \
static inline void msgpack_pack ## name
#define msgpack_pack_user VALUE
#define msgpack_pack_append_buffer(user, buf, len) \
rb_str_buf_cat(user, (const void*)buf, len)
#include "msgpack/pack_template.h"
#ifndef RUBY_VM
#include "st.h" // ruby hash
#endif
static ID s_to_msgpack;
#define ARG_BUFFER(name, argc, argv) \
VALUE name; \
if(argc == 1) { \
name = argv[0]; \
} else if(argc == 0) { \
name = rb_str_buf_new(0); \
} else { \
rb_raise(rb_eArgError, "wrong number of arguments (%d for 0)", argc); \
}
static VALUE MessagePack_NilClass_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_nil(out);
return out;
}
static VALUE MessagePack_TrueClass_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_true(out);
return out;
}
static VALUE MessagePack_FalseClass_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_false(out);
return out;
}
static VALUE MessagePack_Fixnum_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_long(out, FIX2LONG(self));
return out;
}
#ifndef RBIGNUM_SIGN // Ruby 1.8
#define RBIGNUM_SIGN(b) (RBIGNUM(b)->sign)
#endif
static VALUE MessagePack_Bignum_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
// FIXME bignum
if(RBIGNUM_SIGN(self)) { // positive
msgpack_pack_uint64(out, rb_big2ull(self));
} else { // negative
msgpack_pack_int64(out, rb_big2ll(self));
}
return out;
}
static VALUE MessagePack_Float_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_double(out, rb_num2dbl(self));
return out;
}
static VALUE MessagePack_String_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_raw(out, RSTRING_LEN(self));
msgpack_pack_raw_body(out, RSTRING_PTR(self), RSTRING_LEN(self));
return out;
}
static VALUE MessagePack_Array_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_array(out, RARRAY_LEN(self));
VALUE* p = RARRAY_PTR(self);
VALUE* const pend = p + RARRAY_LEN(self);
for(;p != pend; ++p) {
rb_funcall(*p, s_to_msgpack, 1, out);
}
return out;
}
#ifndef RHASH_SIZE // Ruby 1.8
#define RHASH_SIZE(h) (RHASH(h)->tbl ? RHASH(h)->tbl->num_entries : 0)
#endif
static int MessagePack_Hash_to_msgpack_foreach(VALUE key, VALUE value, VALUE out)
{
if (key == Qundef) { return ST_CONTINUE; }
rb_funcall(key, s_to_msgpack, 1, out);
rb_funcall(value, s_to_msgpack, 1, out);
return ST_CONTINUE;
}
static VALUE MessagePack_Hash_to_msgpack(int argc, VALUE *argv, VALUE self)
{
ARG_BUFFER(out, argc, argv);
msgpack_pack_map(out, RHASH_SIZE(self));
rb_hash_foreach(self, MessagePack_Hash_to_msgpack_foreach, out);
return out;
}
static VALUE MessagePack_pack(VALUE self, VALUE data)
{
return rb_funcall(data, s_to_msgpack, 0);
}
void Init_msgpack_pack(VALUE mMessagePack)
{
s_to_msgpack = rb_intern("to_msgpack");
rb_define_method_id(rb_cNilClass, s_to_msgpack, MessagePack_NilClass_to_msgpack, -1);
rb_define_method_id(rb_cTrueClass, s_to_msgpack, MessagePack_TrueClass_to_msgpack, -1);
rb_define_method_id(rb_cFalseClass, s_to_msgpack, MessagePack_FalseClass_to_msgpack, -1);
rb_define_method_id(rb_cFixnum, s_to_msgpack, MessagePack_Fixnum_to_msgpack, -1);
rb_define_method_id(rb_cBignum, s_to_msgpack, MessagePack_Bignum_to_msgpack, -1);
rb_define_method_id(rb_cFloat, s_to_msgpack, MessagePack_Float_to_msgpack, -1);
rb_define_method_id(rb_cString, s_to_msgpack, MessagePack_String_to_msgpack, -1);
rb_define_method_id(rb_cArray, s_to_msgpack, MessagePack_Array_to_msgpack, -1);
rb_define_method_id(rb_cHash, s_to_msgpack, MessagePack_Hash_to_msgpack, -1);
rb_define_module_function(mMessagePack, "pack", MessagePack_pack, 1);
}

View File

@ -1,26 +0,0 @@
/*
* MessagePack for Ruby packing routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef PACK_H__
#define PACK_H__
#include "ruby.h"
void Init_msgpack_pack(VALUE mMessagePack);
#endif /* pack.h */

View File

@ -1,29 +0,0 @@
/*
* MessagePack for Ruby
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "pack.h"
#include "unpack.h"
static VALUE mMessagePack;
void Init_msgpack(void)
{
mMessagePack = rb_define_module("MessagePack");
Init_msgpack_unpack(mMessagePack);
Init_msgpack_pack(mMessagePack);
}

View File

@ -1,225 +0,0 @@
#!/usr/bin/env ruby
require 'msgpack'
require 'test/unit'
class MessagePackTestFormat < Test::Unit::TestCase
def self.it(name, &block)
define_method("test_#{name}", &block)
end
it "nil" do
check 1, nil
end
it "true" do
check 1, true
end
it "false" do
check 1, false
end
it "zero" do
check 1, 0
end
it "positive fixnum" do
check 1, 1
check 1, (1<<6)
check 1, (1<<7)-1
end
it "positive int 8" do
check 1, -1
check 2, (1<<7)
check 2, (1<<8)-1
end
it "positive int 16" do
check 3, (1<<8)
check 3, (1<<16)-1
end
it "positive int 32" do
check 5, (1<<16)
check 5, (1<<32)-1
end
it "positive int 64" do
check 9, (1<<32)
check 9, (1<<64)-1
end
it "negative fixnum" do
check 1, -1
check 1, -((1<<5)-1)
check 1, -(1<<5)
end
it "negative int 8" do
check 2, -((1<<5)+1)
check 2, -(1<<7)
end
it "negative int 16" do
check 3, -((1<<7)+1)
check 3, -(1<<15)
end
it "negative int 32" do
check 5, -((1<<15)+1)
check 5, -(1<<31)
end
it "negative int 64" do
check 9, -((1<<31)+1)
check 9, -(1<<63)
end
it "double" do
check 9, 1.0
check 9, 0.1
check 9, -0.1
check 9, -1.0
end
it "fixraw" do
check_raw 1, 0
check_raw 1, (1<<5)-1
end
it "raw 16" do
check_raw 3, (1<<5)
check_raw 3, (1<<16)-1
end
it "raw 32" do
check_raw 5, (1<<16)
#check_raw 5, (1<<32)-1 # memory error
end
it "fixarray" do
check_array 1, 0
check_array 1, (1<<4)-1
end
it "array 16" do
check_array 3, (1<<4)
check_array 3, (1<<16)-1
end
it "array 32" do
check_array 5, (1<<16)
#check_array 5, (1<<32)-1 # memory error
end
it "nil" do
match nil, "\xc0"
end
it "false" do
match false, "\xc2"
end
it "true" do
match true, "\xc3"
end
it "0" do
match 0, "\x00"
end
it "127" do
match 127, "\x7f"
end
it "128" do
match 128, "\xcc\x80"
end
it "256" do
match 256, "\xcd\x01\x00"
end
it "-1" do
match -1, "\xff"
end
it "-33" do
match -33, "\xd0\xdf"
end
it "-129" do
match -129, "\xd1\xff\x7f"
end
it "{1=>1}" do
match ({1=>1}), "\x81\x01\x01"
end
it "1.0" do
match 1.0, "\xcb\x3f\xf0\x00\x00\x00\x00\x00\x00"
end
it "[]" do
match [], "\x90"
end
it "[0, 1, ..., 14]" do
match (0..14).to_a, "\x9f\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e"
end
it "[0, 1, ..., 15]" do
match (0..15).to_a, "\xdc\x00\x10\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f"
end
it "{}" do
match ({}), "\x80"
end
it "{0=>0, 1=>1, ..., 14=>14}" do
a = (0..14).to_a;
match Hash[*a.zip(a).flatten], "\x8f\x05\x05\x0b\x0b\x00\x00\x06\x06\x0c\x0c\x01\x01\x07\x07\x0d\x0d\x02\x02\x08\x08\x0e\x0e\x03\x03\x09\x09\x04\x04\x0a\x0a"
end
it "{0=>0, 1=>1, ..., 15=>15}" do
a = (0..15).to_a;
match Hash[*a.zip(a).flatten], "\xde\x00\x10\x05\x05\x0b\x0b\x00\x00\x06\x06\x0c\x0c\x01\x01\x07\x07\x0d\x0d\x02\x02\x08\x08\x0e\x0e\x03\x03\x09\x09\x0f\x0f\x04\x04\x0a\x0a"
end
# it "fixmap" do
# check_map 1, 0
# check_map 1, (1<<4)-1
# end
#
# it "map 16" do
# check_map 3, (1<<4)
# check_map 3, (1<<16)-1
# end
#
# it "map 32" do
# check_map 5, (1<<16)
# #check_map 5, (1<<32)-1 # memory error
# end
private
def check(len, obj)
v = obj.to_msgpack
assert_equal(v.length, len)
assert_equal(MessagePack.unpack(v), obj)
end
def check_raw(overhead, num)
check num+overhead, " "*num
end
def check_array(overhead, num)
check num+overhead, Array.new(num)
end
def match(obj, buf)
assert_equal(obj.to_msgpack, buf)
assert_equal(MessagePack::unpack(buf), obj)
end
end

View File

@ -1,122 +0,0 @@
require 'msgpack'
@up = MessagePack::Unpacker.new
def check(bytes, should)
puts "----"
@up.reset
src = bytes.pack('C*')
ret = @up.execute(src, 0)
if ret != src.length
puts "** EXTRA BYTES **"
end
puts bytes.map{|x|"%x"%x}.join(' ')
data = @up.data
p data
if data != should
puts "** TEST FAILED **"
p should
end
end
# SimpleValue
check([
0x93, 0xc0, 0xc2, 0xc3,
], [nil,false,true])
# Fixnum
check([
0x92,
0x93, 0x00, 0x40, 0x7f,
0x93, 0xe0, 0xf0, 0xff,
], [[0,64,127], [-32,-16,-1]])
# FixArray
check([
0x92,
0x90,
0x91,
0x91, 0xc0,
], [[],[[nil]]])
# FixRaw
check([
0x94,
0xa0,
0xa1, ?a,
0xa2, ?b, ?c,
0xa3, ?d, ?e, ?f,
], ["","a","bc","def"])
# FixMap
check([
0x82,
0xc2, 0x81,
0xc0, 0xc0,
0xc3, 0x81,
0xc0, 0x80,
], {false=>{nil=>nil}, true=>{nil=>{}}})
# unsigned int
check([
0x99,
0xcc, 0,
0xcc, 128,
0xcc, 255,
0xcd, 0x00, 0x00,
0xcd, 0x80, 0x00,
0xcd, 0xff, 0xff,
0xce, 0x00, 0x00, 0x00, 0x00,
0xce, 0x80, 0x00, 0x00, 0x00,
0xce, 0xff, 0xff, 0xff, 0xff,
], [0, 128, 255, 0, 32768, 65535, 0, 2147483648, 4294967295])
# signed int
check([
0x99,
0xd0, 0,
0xd0, 128,
0xd0, 255,
0xd1, 0x00, 0x00,
0xd1, 0x80, 0x00,
0xd1, 0xff, 0xff,
0xd2, 0x00, 0x00, 0x00, 0x00,
0xd2, 0x80, 0x00, 0x00, 0x00,
0xd2, 0xff, 0xff, 0xff, 0xff,
], [0, -128, -1, 0, -32768, -1, 0, -2147483648, -1])
# raw
check([
0x96,
0xda, 0x00, 0x00,
0xda, 0x00, 0x01, ?a,
0xda, 0x00, 0x02, ?a, ?b,
0xdb, 0x00, 0x00, 0x00, 0x00,
0xdb, 0x00, 0x00, 0x00, 0x01, ?a,
0xdb, 0x00, 0x00, 0x00, 0x02, ?a, ?b,
], ["", "a", "ab", "", "a", "ab"])
# array
check([
0x96,
0xdc, 0x00, 0x00,
0xdc, 0x00, 0x01, 0xc0,
0xdc, 0x00, 0x02, 0xc2, 0xc3,
0xdd, 0x00, 0x00, 0x00, 0x00,
0xdd, 0x00, 0x00, 0x00, 0x01, 0xc0,
0xdd, 0x00, 0x00, 0x00, 0x02, 0xc2, 0xc3
], [[], [nil], [false,true], [], [nil], [false,true]])
# map
check([
0x96,
0xde, 0x00, 0x00,
0xde, 0x00, 0x01, 0xc0, 0xc2,
0xde, 0x00, 0x02, 0xc0, 0xc2, 0xc3, 0xc2,
0xdf, 0x00, 0x00, 0x00, 0x00,
0xdf, 0x00, 0x00, 0x00, 0x01, 0xc0, 0xc2,
0xdf, 0x00, 0x00, 0x00, 0x02, 0xc0, 0xc2, 0xc3, 0xc2,
], [{}, {nil=>false}, {true=>false, nil=>false}, {}, {nil=>false}, {true=>false, nil=>false}])

View File

@ -1,58 +0,0 @@
require 'msgpack'
def check(data)
puts "---"
pack = data.to_msgpack
p data
puts pack.unpack('C*').map{|x|"%02x"%x}.join(' ')
re = MessagePack::unpack(pack)
if re != data
p re
puts "** TEST FAILED **"
end
end
check 0
check 1
check 127
check 128
check 255
check 256
check 65535
check 65536
check -1
check -32
check -33
check -128
check -129
check -32768
check -32769
check 1.0
check ""
check "a"
check "a"*31
check "a"*32
check nil
check true
check false
check []
check [[]]
check [[], nil]
check( {nil=>0} )
check (1<<23)
__END__
ary = []
i = 0
while i < (1<<16)
ary << i
i += 1
end
check ary

View File

@ -1,318 +0,0 @@
/*
* MessagePack for Ruby unpacking routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "ruby.h"
#include "msgpack/unpack_define.h"
typedef struct {
int finished;
VALUE source;
} unpack_user;
#define msgpack_unpack_struct(name) \
struct template ## name
#define msgpack_unpack_func(ret, name) \
ret template ## name
#define msgpack_unpack_callback(name) \
template_callback ## name
#define msgpack_unpack_object VALUE
#define msgpack_unpack_user unpack_user
struct template_context;
typedef struct template_context msgpack_unpack_t;
static void template_init(msgpack_unpack_t* u);
static VALUE template_data(msgpack_unpack_t* u);
static int template_execute(msgpack_unpack_t* u,
const char* data, size_t len, size_t* off);
static inline VALUE template_callback_root(unpack_user* u)
{ return Qnil; }
static inline int template_callback_uint8(unpack_user* u, uint8_t d, VALUE* o)
{ *o = INT2FIX(d); return 0; }
static inline int template_callback_uint16(unpack_user* u, uint16_t d, VALUE* o)
{ *o = INT2FIX(d); return 0; }
static inline int template_callback_uint32(unpack_user* u, uint32_t d, VALUE* o)
{ *o = UINT2NUM(d); return 0; }
static inline int template_callback_uint64(unpack_user* u, uint64_t d, VALUE* o)
{ *o = rb_ull2inum(d); return 0; }
static inline int template_callback_int8(unpack_user* u, int8_t d, VALUE* o)
{ *o = INT2FIX((long)d); return 0; }
static inline int template_callback_int16(unpack_user* u, int16_t d, VALUE* o)
{ *o = INT2FIX((long)d); return 0; }
static inline int template_callback_int32(unpack_user* u, int32_t d, VALUE* o)
{ *o = INT2NUM((long)d); return 0; }
static inline int template_callback_int64(unpack_user* u, int64_t d, VALUE* o)
{ *o = rb_ll2inum(d); return 0; }
static inline int template_callback_float(unpack_user* u, float d, VALUE* o)
{ *o = rb_float_new(d); return 0; }
static inline int template_callback_double(unpack_user* u, double d, VALUE* o)
{ *o = rb_float_new(d); return 0; }
static inline int template_callback_nil(unpack_user* u, VALUE* o)
{ *o = Qnil; return 0; }
static inline int template_callback_true(unpack_user* u, VALUE* o)
{ *o = Qtrue; return 0; }
static inline int template_callback_false(unpack_user* u, VALUE* o)
{ *o = Qfalse; return 0;}
static inline int template_callback_array(unpack_user* u, unsigned int n, VALUE* o)
{ *o = rb_ary_new2(n); return 0; }
static inline int template_callback_array_item(unpack_user* u, VALUE* c, VALUE o)
{ rb_ary_push(*c, o); return 0; } // FIXME set value directry RARRAY_PTR(obj)[RARRAY_LEN(obj)++]
static inline int template_callback_map(unpack_user* u, unsigned int n, VALUE* o)
{ *o = rb_hash_new(); return 0; }
static inline int template_callback_map_item(unpack_user* u, VALUE* c, VALUE k, VALUE v)
{ rb_hash_aset(*c, k, v); return 0; }
static inline int template_callback_raw(unpack_user* u, const char* b, const char* p, unsigned int l, VALUE* o)
{ *o = (l == 0) ? rb_str_new(0,0) : rb_str_substr(u->source, p - b, l); return 0; }
#include "msgpack/unpack_template.h"
#define UNPACKER(from, name) \
msgpack_unpack_t *name = NULL; \
Data_Get_Struct(from, msgpack_unpack_t, name); \
if(name == NULL) { \
rb_raise(rb_eArgError, "NULL found for " # name " when shouldn't be."); \
}
#define CHECK_STRING_TYPE(value) \
value = rb_check_string_type(value); \
if( NIL_P(value) ) { \
rb_raise(rb_eTypeError, "instance of String needed"); \
}
static VALUE cUnpacker;
static VALUE eUnpackError;
static void MessagePack_Unpacker_free(void* data)
{
if(data) { free(data); }
}
static void MessagePack_Unpacker_mark(msgpack_unpack_t *mp)
{
unsigned int i;
for(i=0; i < mp->top; ++i) {
rb_gc_mark(mp->stack[i].obj);
rb_gc_mark(mp->stack[i].map_key);
}
}
static VALUE MessagePack_Unpacker_alloc(VALUE klass)
{
VALUE obj;
msgpack_unpack_t* mp = ALLOC_N(msgpack_unpack_t, 1);
obj = Data_Wrap_Struct(klass, MessagePack_Unpacker_mark,
MessagePack_Unpacker_free, mp);
return obj;
}
static VALUE MessagePack_Unpacker_reset(VALUE self)
{
UNPACKER(self, mp);
template_init(mp);
unpack_user u = {0, Qnil};
mp->user = u;
return self;
}
static VALUE MessagePack_Unpacker_initialize(VALUE self)
{
return MessagePack_Unpacker_reset(self);
}
static VALUE MessagePack_Unpacker_execute_impl(VALUE args)
{
VALUE self = ((VALUE*)args)[0];
VALUE data = ((VALUE*)args)[1];
UNPACKER(self, mp);
size_t from = NUM2UINT(((VALUE*)args)[2]);
char* dptr = RSTRING_PTR(data);
long dlen = FIX2LONG(((VALUE*)args)[3]);
int ret;
if(from >= dlen) {
rb_raise(eUnpackError, "offset is bigger than data buffer size.");
}
mp->user.source = data;
ret = template_execute(mp, dptr, (size_t)dlen, &from);
mp->user.source = Qnil;
if(ret < 0) {
rb_raise(eUnpackError, "parse error.");
} else if(ret > 0) {
mp->user.finished = 1;
return ULONG2NUM(from);
} else {
mp->user.finished = 0;
return ULONG2NUM(from);
}
}
static VALUE MessagePack_Unpacker_execute_rescue(VALUE nouse)
{
rb_gc_enable();
#ifdef RUBY_VM
rb_exc_raise(rb_errinfo());
#else
rb_exc_raise(ruby_errinfo);
#endif
}
static VALUE MessagePack_Unpacker_execute_limit(VALUE self, VALUE data,
VALUE off, VALUE limit)
{
// FIXME execute実行中はmp->topが更新されないのでGC markが機能しない
rb_gc_disable();
VALUE args[4] = {self, data, off, limit};
VALUE ret = rb_rescue(MessagePack_Unpacker_execute_impl, (VALUE)args,
MessagePack_Unpacker_execute_rescue, Qnil);
rb_gc_enable();
return ret;
}
static VALUE MessagePack_Unpacker_execute(VALUE self, VALUE data, VALUE off)
{
return MessagePack_Unpacker_execute_limit(self, data, off,
LONG2FIX(RSTRING_LEN(data)));
}
static VALUE MessagePack_Unpacker_finished_p(VALUE self)
{
UNPACKER(self, mp);
if(mp->user.finished) {
return Qtrue;
}
return Qfalse;
}
static VALUE MessagePack_Unpacker_data(VALUE self)
{
UNPACKER(self, mp);
return template_data(mp);
}
static VALUE MessagePack_unpack_impl(VALUE args)
{
msgpack_unpack_t* mp = (msgpack_unpack_t*)((VALUE*)args)[0];
VALUE data = ((VALUE*)args)[1];
size_t from = 0;
char* dptr = RSTRING_PTR(data);
long dlen = FIX2LONG(((VALUE*)args)[2]);
int ret;
mp->user.source = data;
ret = template_execute(mp, dptr, (size_t)dlen, &from);
mp->user.source = Qnil;
if(ret < 0) {
rb_raise(eUnpackError, "parse error.");
} else if(ret == 0) {
rb_raise(eUnpackError, "insufficient bytes.");
} else {
if(from < dlen) {
rb_raise(eUnpackError, "extra bytes.");
}
return template_data(mp);
}
}
static VALUE MessagePack_unpack_rescue(VALUE args)
{
rb_gc_enable();
#ifdef RUBY_VM
rb_exc_raise(rb_errinfo());
#else
rb_exc_raise(ruby_errinfo);
#endif
}
static VALUE MessagePack_unpack_limit(VALUE self, VALUE data, VALUE limit)
{
CHECK_STRING_TYPE(data);
msgpack_unpack_t mp;
template_init(&mp);
unpack_user u = {0, Qnil};
mp.user = u;
rb_gc_disable();
VALUE args[3] = {(VALUE)&mp, data, limit};
VALUE ret = rb_rescue(MessagePack_unpack_impl, (VALUE)args,
MessagePack_unpack_rescue, Qnil);
rb_gc_enable();
return ret;
}
static VALUE MessagePack_unpack(VALUE self, VALUE data)
{
return MessagePack_unpack_limit(self, data,
LONG2FIX(RSTRING_LEN(data)));
}
void Init_msgpack_unpack(VALUE mMessagePack)
{
eUnpackError = rb_define_class_under(mMessagePack, "UnpackError", rb_eStandardError);
cUnpacker = rb_define_class_under(mMessagePack, "Unpacker", rb_cObject);
rb_define_alloc_func(cUnpacker, MessagePack_Unpacker_alloc);
rb_define_method(cUnpacker, "initialize", MessagePack_Unpacker_initialize, 0);
rb_define_method(cUnpacker, "execute", MessagePack_Unpacker_execute, 2);
rb_define_method(cUnpacker, "execute_limit", MessagePack_Unpacker_execute_limit, 3);
rb_define_method(cUnpacker, "finished?", MessagePack_Unpacker_finished_p, 0);
rb_define_method(cUnpacker, "data", MessagePack_Unpacker_data, 0);
rb_define_method(cUnpacker, "reset", MessagePack_Unpacker_reset, 0);
rb_define_module_function(mMessagePack, "unpack", MessagePack_unpack, 1);
rb_define_module_function(mMessagePack, "unpack_limit", MessagePack_unpack_limit, 2);
}

View File

@ -1,26 +0,0 @@
/*
* MessagePack for Ruby unpacking routine
*
* Copyright (C) 2008-2009 FURUHASHI Sadayuki
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef UNPACK_H__
#define UNPACK_H__
#include "ruby.h"
void Init_msgpack_unpack(VALUE mMessagePack);
#endif /* unpack.h */