Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ludocode committed Jan 5, 2016
2 parents af55d10 + bdb178b commit d18faac
Show file tree
Hide file tree
Showing 42 changed files with 3,543 additions and 1,544 deletions.
10 changes: 5 additions & 5 deletions .gitignore
@@ -1,24 +1,23 @@

# build files
/build
*.o
*.swp
*.gcov
/.sconsign.dblite
/.sconf_temp/
/config.log
mpack-test-file
mpack-test-blank-file
/mpack-test-dir/
/analysis/

# folders
/tags
/build
/docs
/docs/html/

# visual studio project
*.suo
*.opensdf
*.sdf
*.vcxproj.user
/projects/vs/Debug/
/projects/vs/Release/

Expand All @@ -29,4 +28,5 @@ xcuserdata/

# other junk
.directory
/tags

41 changes: 36 additions & 5 deletions README.md
Expand Up @@ -12,15 +12,23 @@ The core of MPack contains a buffered reader and writer with a custom callback t

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.

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.

## Build Status

MPack is beta software under development.

| [Travis-CI](https://travis-ci.org/) | [Coveralls.io](https://coveralls.io/) |
| :-------: | :----------: |
| [![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) |
[travis-home]: https://travis-ci.org/
[travis-badge]: https://travis-ci.org/ludocode/mpack.svg?branch=master
[travis-mpack]: https://travis-ci.org/ludocode/mpack/branches
[appveyor-home]: https://ci.appveyor.com/
[appveyor-badge]: https://ci.appveyor.com/api/projects/status/tux06aefpqq83k30/branch/master?svg=true
[appveyor-mpack]: https://ci.appveyor.com/project/ludocode/mpack/branch/master
[coveralls-home]: https://coveralls.io/
[coveralls-badge]: https://coveralls.io/repos/ludocode/mpack/badge.svg?branch=master&service=github
[coveralls-mpack]: https://coveralls.io/github/ludocode/mpack?branch=master

| [Travis-CI][travis-home] | [AppVeyor][appveyor-home] | [Coveralls.io][coveralls-home] |
| :-------: | :----------: | :----------: |
| [![Build Status][travis-badge]][travis-mpack] | [![Build status][appveyor-badge]][appveyor-mpack] | [![Coverage Status][coveralls-badge]][coveralls-mpack] |

## The Node Reader API

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

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.

## Comparison With Other Parsers

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:

[mpack]: https://github.com/ludocode/mpack
[msgpack-c]: https://github.com/msgpack/msgpack-c
[cmp]: https://github.com/camgunz/cmp

| | [MPack][mpack]<br>(v0.8) | [msgpack-c][msgpack-c]<br>(v1.3.0) | [CMP][cmp]<br>(v14) |
|:------------------------------------|:---:|:---:|:---:|
| No libc requirement || ||
| Growable memory writer ||| |
| File I/O helpers ||| |
| Tree parser ||| |
| Propagating errors || ||
| Compound size tracking || | |
| Incremental parser || ||
| Incremental range/match helpers || | |
| Tree stream parser | || |
| UTF-8 verification || | |

A larger feature comparison table is available [here](docs/features.md) which includes descriptions of the various entries in the table.

## Why Not Just Use JSON?

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:
Expand Down
6 changes: 3 additions & 3 deletions SConstruct
Expand Up @@ -104,10 +104,9 @@ AddBuild("debug", allfeatures + allconfigs + debugflags + cflags + gcovflags, gc
# to reveal configuration errors.
if ARGUMENTS.get('more') or ARGUMENTS.get('all'):
AddBuild("release", allfeatures + allconfigs + releaseflags + cflags)
AddBuilds("embed", allfeatures + cflags)
AddBuilds("embed", allfeatures + cflags + ["-DMPACK_NO_BUILTINS=1"])
AddBuilds("noio", allfeatures + noioconfigs + cflags)
AddBuild("debug-size", ["-DMPACK_OPTIMIZE_FOR_SIZE=1"] + debugflags + allfeatures + allconfigs + cflags)
AddBuild("release-size", ["-Os"] + allfeatures + allconfigs + cflags)


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

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

# embedded builds without libc
# embedded builds without libc (using builtins)
AddBuilds("embed-writer", ["-DMPACK_WRITER=1"] + cflags)
AddBuilds("embed-reader", ["-DMPACK_READER=1"] + cflags)
AddBuilds("embed-expect", ["-DMPACK_READER=1", "-DMPACK_EXPECT=1"] + cflags)
Expand Down
16 changes: 16 additions & 0 deletions appveyor.yml
@@ -0,0 +1,16 @@
version: 0.0.{build}

configuration:
- Debug
- Release

platform:
- Win32
- x64

build:
project: projects\vs\mpack.sln
parallel: true

test_script:
- cd projects\vs && %PLATFORM%\%CONFIGURATION%\mpack.exe
12 changes: 9 additions & 3 deletions Doxyfile → docs/doxyfile
Expand Up @@ -7,23 +7,25 @@ PROJECT_NUMBER = develop

INPUT = \
README.md \
docs/expect.md \
docs/features.md \
src/mpack/mpack-common.h \
src/mpack/mpack-reader.h \
src/mpack/mpack-writer.h \
src/mpack/mpack-expect.h \
src/mpack/mpack-node.h \
src/mpack/mpack.h

LAYOUT_FILE = docs/doxygen-layout.xml
USE_MDFILE_AS_MAINPAGE = README.md
HTML_OUTPUT = docs
HTML_OUTPUT = docs/html
GENERATE_LATEX = no
STRIP_FROM_PATH = . ./src
HTML_EXTRA_STYLESHEET = docs/doxygen-mpack-css.css

PREDEFINED = \
inline= \
MPACK_ALWAYS_INLINE= \
MPACK_INLINE= \
MPACK_INLINE_SPEED= \
\
MPACK_READER=1 \
MPACK_WRITER=1 \
Expand Down Expand Up @@ -53,6 +55,10 @@ OPTIMIZE_OUTPUT_FOR_C = YES
INLINE_SIMPLE_STRUCTS = YES
TYPEDEF_HIDES_STRUCT = YES

SHOW_FILES = NO
VERBATIM_HEADERS = NO
ALPHABETICAL_INDEX = NO

# warn about anything undocumented
HIDE_UNDOC_MEMBERS = NO
WARNINGS = YES
Expand Down
57 changes: 57 additions & 0 deletions docs/doxygen-layout.xml
@@ -0,0 +1,57 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.10 -->

<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="Pages" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>

<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
</doxygenlayout>
4 changes: 4 additions & 0 deletions docs/doxygen-mpack-css.css
@@ -0,0 +1,4 @@
table.doxtable th {
background-color: #e0e7ff;
color: #000;
}

0 comments on commit d18faac

Please sign in to comment.