Skip to content

Commit d18faac

Browse files
committed
Merge branch 'develop'
2 parents af55d10 + bdb178b commit d18faac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3543
-1544
lines changed

.gitignore

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11

22
# build files
3+
/build
34
*.o
45
*.swp
56
*.gcov
67
/.sconsign.dblite
78
/.sconf_temp/
89
/config.log
910
mpack-test-file
11+
mpack-test-blank-file
1012
/mpack-test-dir/
1113
/analysis/
12-
13-
# folders
14-
/tags
15-
/build
16-
/docs
14+
/docs/html/
1715

1816
# visual studio project
1917
*.suo
2018
*.opensdf
2119
*.sdf
20+
*.vcxproj.user
2221
/projects/vs/Debug/
2322
/projects/vs/Release/
2423

@@ -29,4 +28,5 @@ xcuserdata/
2928

3029
# other junk
3130
.directory
31+
/tags
3232

README.md

+36-5
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@ The core of MPack contains a buffered reader and writer with a custom callback t
1212

1313
The MPack code is small enough to be embedded directly into your codebase. The easiest way to use it is to download the [amalgamation package](https://github.com/ludocode/mpack/releases) and insert the source files directly into your project. Copy `mpack.h` and `mpack.c` into to your codebase, and copy `mpack-config.h.sample` as `mpack-config.h`. You can use the defaults or edit it if you'd like to customize the MPack featureset.
1414

15-
MPack is written in the portable intersection of C99 and C++. In other words, it's written in C99, but if you are stuck using a certain popular compiler from a certain unpopular vendor that refuses to support C99, you can compile it as C++ instead.
16-
1715
## Build Status
1816

1917
MPack is beta software under development.
2018

21-
| [Travis-CI](https://travis-ci.org/) | [Coveralls.io](https://coveralls.io/) |
22-
| :-------: | :----------: |
23-
| [![Build Status](https://travis-ci.org/ludocode/mpack.svg?branch=master)](https://travis-ci.org/ludocode/mpack/branches) | [![Coverage Status](https://coveralls.io/repos/ludocode/mpack/badge.svg?branch=master&service=github)](https://coveralls.io/github/ludocode/mpack?branch=master) |
19+
[travis-home]: https://travis-ci.org/
20+
[travis-badge]: https://travis-ci.org/ludocode/mpack.svg?branch=master
21+
[travis-mpack]: https://travis-ci.org/ludocode/mpack/branches
22+
[appveyor-home]: https://ci.appveyor.com/
23+
[appveyor-badge]: https://ci.appveyor.com/api/projects/status/tux06aefpqq83k30/branch/master?svg=true
24+
[appveyor-mpack]: https://ci.appveyor.com/project/ludocode/mpack/branch/master
25+
[coveralls-home]: https://coveralls.io/
26+
[coveralls-badge]: https://coveralls.io/repos/ludocode/mpack/badge.svg?branch=master&service=github
27+
[coveralls-mpack]: https://coveralls.io/github/ludocode/mpack?branch=master
28+
29+
| [Travis-CI][travis-home] | [AppVeyor][appveyor-home] | [Coveralls.io][coveralls-home] |
30+
| :-------: | :----------: | :----------: |
31+
| [![Build Status][travis-badge]][travis-mpack] | [![Build status][appveyor-badge]][appveyor-mpack] | [![Coverage Status][coveralls-badge]][coveralls-mpack] |
2432

2533
## The Node Reader API
2634

@@ -81,6 +89,29 @@ If any error occurs, the writer is placed in an error state. The writer will fla
8189

8290
Note in particular that in debug mode, the `mpack_finish_map()` call above ensures that two key/value pairs were actually written as claimed, something that other MessagePack C/C++ libraries may not do.
8391

92+
## Comparison With Other Parsers
93+
94+
MPack is rich in features while maintaining very high performance and a small code footprint. Here's a short feature table comparing it to other C parsers:
95+
96+
[mpack]: https://github.com/ludocode/mpack
97+
[msgpack-c]: https://github.com/msgpack/msgpack-c
98+
[cmp]: https://github.com/camgunz/cmp
99+
100+
| | [MPack][mpack]<br>(v0.8) | [msgpack-c][msgpack-c]<br>(v1.3.0) | [CMP][cmp]<br>(v14) |
101+
|:------------------------------------|:---:|:---:|:---:|
102+
| No libc requirement || ||
103+
| Growable memory writer ||| |
104+
| File I/O helpers ||| |
105+
| Tree parser ||| |
106+
| Propagating errors || ||
107+
| Compound size tracking || | |
108+
| Incremental parser || ||
109+
| Incremental range/match helpers || | |
110+
| Tree stream parser | || |
111+
| UTF-8 verification || | |
112+
113+
A larger feature comparison table is available [here](docs/features.md) which includes descriptions of the various entries in the table.
114+
84115
## Why Not Just Use JSON?
85116

86117
Conceptually, MessagePack stores data similarly to JSON: they are both composed of simple values such as numbers and strings, stored hierarchically in maps and arrays. So why not just use JSON instead? The main reason is that JSON is designed to be human-readable, so it is not as efficient as a binary serialization format:

SConstruct

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,9 @@ AddBuild("debug", allfeatures + allconfigs + debugflags + cflags + gcovflags, gc
104104
# to reveal configuration errors.
105105
if ARGUMENTS.get('more') or ARGUMENTS.get('all'):
106106
AddBuild("release", allfeatures + allconfigs + releaseflags + cflags)
107-
AddBuilds("embed", allfeatures + cflags)
107+
AddBuilds("embed", allfeatures + cflags + ["-DMPACK_NO_BUILTINS=1"])
108108
AddBuilds("noio", allfeatures + noioconfigs + cflags)
109109
AddBuild("debug-size", ["-DMPACK_OPTIMIZE_FOR_SIZE=1"] + debugflags + allfeatures + allconfigs + cflags)
110-
AddBuild("release-size", ["-Os"] + allfeatures + allconfigs + cflags)
111110

112111

113112
# Run "scons all=1" to run all builds. This is what the CI runs.
@@ -118,6 +117,7 @@ if ARGUMENTS.get('all'):
118117
AddBuild("release-fastmath", allfeatures + allconfigs + releaseflags + cflags + ["-ffast-math"])
119118
if conf.CheckFlags(ltoflags, ltoflags, "-flto"):
120119
AddBuild("release-lto", allfeatures + allconfigs + ltoflags + cflags, ltoflags)
120+
AddBuild("release-size", ["-Os"] + allfeatures + allconfigs + cflags)
121121

122122
# feature subsets with default configuration
123123
AddBuilds("empty", allconfigs + cflags)
@@ -132,7 +132,7 @@ if ARGUMENTS.get('all'):
132132
AddBuilds("noio-expect", ["-DMPACK_READER=1", "-DMPACK_EXPECT=1"] + noioconfigs + cflags)
133133
AddBuilds("noio-node", ["-DMPACK_NODE=1"] + noioconfigs + cflags)
134134

135-
# embedded builds without libc
135+
# embedded builds without libc (using builtins)
136136
AddBuilds("embed-writer", ["-DMPACK_WRITER=1"] + cflags)
137137
AddBuilds("embed-reader", ["-DMPACK_READER=1"] + cflags)
138138
AddBuilds("embed-expect", ["-DMPACK_READER=1", "-DMPACK_EXPECT=1"] + cflags)

appveyor.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 0.0.{build}
2+
3+
configuration:
4+
- Debug
5+
- Release
6+
7+
platform:
8+
- Win32
9+
- x64
10+
11+
build:
12+
project: projects\vs\mpack.sln
13+
parallel: true
14+
15+
test_script:
16+
- cd projects\vs && %PLATFORM%\%CONFIGURATION%\mpack.exe

Doxyfile renamed to docs/doxyfile

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ PROJECT_NUMBER = develop
77

88
INPUT = \
99
README.md \
10+
docs/expect.md \
11+
docs/features.md \
1012
src/mpack/mpack-common.h \
1113
src/mpack/mpack-reader.h \
1214
src/mpack/mpack-writer.h \
1315
src/mpack/mpack-expect.h \
1416
src/mpack/mpack-node.h \
1517
src/mpack/mpack.h
1618

19+
LAYOUT_FILE = docs/doxygen-layout.xml
1720
USE_MDFILE_AS_MAINPAGE = README.md
18-
HTML_OUTPUT = docs
21+
HTML_OUTPUT = docs/html
1922
GENERATE_LATEX = no
2023
STRIP_FROM_PATH = . ./src
24+
HTML_EXTRA_STYLESHEET = docs/doxygen-mpack-css.css
2125

2226
PREDEFINED = \
2327
inline= \
24-
MPACK_ALWAYS_INLINE= \
2528
MPACK_INLINE= \
26-
MPACK_INLINE_SPEED= \
2729
\
2830
MPACK_READER=1 \
2931
MPACK_WRITER=1 \
@@ -53,6 +55,10 @@ OPTIMIZE_OUTPUT_FOR_C = YES
5355
INLINE_SIMPLE_STRUCTS = YES
5456
TYPEDEF_HIDES_STRUCT = YES
5557

58+
SHOW_FILES = NO
59+
VERBATIM_HEADERS = NO
60+
ALPHABETICAL_INDEX = NO
61+
5662
# warn about anything undocumented
5763
HIDE_UNDOC_MEMBERS = NO
5864
WARNINGS = YES

docs/doxygen-layout.xml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<doxygenlayout version="1.0">
2+
<!-- Generated by doxygen 1.8.10 -->
3+
4+
<!-- Navigation index tabs for HTML output -->
5+
<navindex>
6+
<tab type="mainpage" visible="yes" title=""/>
7+
<tab type="pages" visible="yes" title="Pages" intro=""/>
8+
<tab type="modules" visible="yes" title="" intro=""/>
9+
<tab type="examples" visible="yes" title="" intro=""/>
10+
</navindex>
11+
12+
<!-- Layout definition for a group page -->
13+
<group>
14+
<briefdescription visible="yes"/>
15+
<groupgraph visible="$GROUP_GRAPHS"/>
16+
<memberdecl>
17+
<nestedgroups visible="yes" title=""/>
18+
<dirs visible="yes" title=""/>
19+
<files visible="yes" title=""/>
20+
<namespaces visible="yes" title=""/>
21+
<classes visible="yes" title=""/>
22+
<defines title=""/>
23+
<typedefs title=""/>
24+
<enums title=""/>
25+
<enumvalues title=""/>
26+
<functions title=""/>
27+
<variables title=""/>
28+
<signals title=""/>
29+
<publicslots title=""/>
30+
<protectedslots title=""/>
31+
<privateslots title=""/>
32+
<events title=""/>
33+
<properties title=""/>
34+
<friends title=""/>
35+
<membergroups visible="yes"/>
36+
</memberdecl>
37+
<detaileddescription title=""/>
38+
<memberdef>
39+
<pagedocs/>
40+
<inlineclasses title=""/>
41+
<defines title=""/>
42+
<typedefs title=""/>
43+
<enums title=""/>
44+
<enumvalues title=""/>
45+
<functions title=""/>
46+
<variables title=""/>
47+
<signals title=""/>
48+
<publicslots title=""/>
49+
<protectedslots title=""/>
50+
<privateslots title=""/>
51+
<events title=""/>
52+
<properties title=""/>
53+
<friends title=""/>
54+
</memberdef>
55+
<authorsection visible="yes"/>
56+
</group>
57+
</doxygenlayout>

docs/doxygen-mpack-css.css

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
table.doxtable th {
2+
background-color: #e0e7ff;
3+
color: #000;
4+
}

0 commit comments

Comments
 (0)