netSerial

serializer producing compact bitstreams
git clone https://noulin.net/git/netSerial.git
Log | Files | Refs | README | LICENSE

commit 705937a99c75a4aa831366bb0fc58b6a70885b02
parent 4dec63793b0a6c6bea1fc18efa45111ab2552d6b
Author: Remy Noulin <loader2x@gmail.com>
Date:   Wed,  7 Aug 2019 16:09:10 +0200

rename PACKED to PACK to avoid name collision with latest libsheepy

netSerial.c         | 16 ++++++++--------
netSerial.h         |  3 ++-
netSerialInternal.h |  2 +-
package.yml         |  6 +++---
4 files changed, 14 insertions(+), 13 deletions(-)

Diffstat:
MnetSerial.c | 16++++++++--------
MnetSerial.h | 3++-
MnetSerialInternal.h | 2+-
Mpackage.yml | 6+++---
4 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/netSerial.c b/netSerial.c @@ -1830,7 +1830,7 @@ internal void dictNetSerial(sBytest **r, sDictt *dict, contextt *ctx, packingT p // encode type and element count // in pack dictionary - if (packing == PACKED) { + if (packing == PACK) { // uniform dict can't be packed // because there is only one type of packed arrays goto normalDict; @@ -1945,7 +1945,7 @@ internal void dictNetSerial(sBytest **r, sDictt *dict, contextt *ctx, packingT p normalDict: // encode type and element count - if (packing == PACKED or packing == UNIFORM) { + if (packing == PACK or packing == UNIFORM) { // when the packing is packed or uniform, there is no need to encode DICT type since all elements have this type uintToVarint(r, dict->count); } @@ -2092,7 +2092,7 @@ internal void dictNetSerial(sBytest **r, sDictt *dict, contextt *ctx, packingT p type = 0; } // if type - dictNetSerial(r, (sDictt *)(e->data), ctx, /*packing=*/PACKED); + dictNetSerial(r, (sDictt *)(e->data), ctx, /*packing=*/PACK); // stop packing when packCount == 0 packCount--; if (!packCount) pack = false; @@ -2225,7 +2225,7 @@ internal void dictNetSerial(sBytest **r, sDictt *dict, contextt *ctx, packingT p type = 0; } // if type - arrayNetSerial(r, (sArrayt *)(e->data), ctx, /*packing=*/PACKED); + arrayNetSerial(r, (sArrayt *)(e->data), ctx, /*packing=*/PACK); // stop packing when packCount == 0 packCount--; if (!packCount) pack = false; @@ -2355,7 +2355,7 @@ internal void arrayNetSerial(sBytest **r, sArrayt *array, contextt *ctx, packing // encode type and element count // in pack array - if (packing == PACKED) { + if (packing == PACK) { // uniform array can't be packed // because there is only one type of packed arrays goto normalArray; @@ -2440,7 +2440,7 @@ internal void arrayNetSerial(sBytest **r, sArrayt *array, contextt *ctx, packing normalArray: // encode type and element count - if (packing == PACKED or packing == UNIFORM) { + if (packing == PACK or packing == UNIFORM) { // when the packing is packed or uniform, there is no need to encode ARRAY type since all elements have this type uintToVarint(r, array->count); } @@ -2575,7 +2575,7 @@ internal void arrayNetSerial(sBytest **r, sArrayt *array, contextt *ctx, packing type = 0; } // if type - dictNetSerial(r, (sDictt *)e, ctx, /*packing=*/PACKED); + dictNetSerial(r, (sDictt *)e, ctx, /*packing=*/PACK); // stop packing when packCount == 0 packCount--; if (!packCount) pack = false; @@ -2708,7 +2708,7 @@ internal void arrayNetSerial(sBytest **r, sArrayt *array, contextt *ctx, packing type = 0; } // if type - arrayNetSerial(r, (sArrayt *)e, ctx, /*packing=*/PACKED); + arrayNetSerial(r, (sArrayt *)e, ctx, /*packing=*/PACK); // stop packing when packCount == 0 packCount--; if (!packCount) pack = false; diff --git a/netSerial.h b/netSerial.h @@ -103,7 +103,8 @@ smallJsont* allocNetSerialLevel2(void); smallJsont* allocNetSerial(void); /* end class netSerial*/ -// vim: set expandtab ts=2 sw=2: #define isNetSerialCompiledWithCurrentLisheepyVersion checkLibsheepyVersionNetSerial(LIBSHEEPY_VERSION) bool checkLibsheepyVersionNetSerial(const char *currentLibsheepyVersion); + +// vim: set expandtab ts=2 sw=2: diff --git a/netSerialInternal.h b/netSerialInternal.h @@ -5,7 +5,7 @@ static smallJsonFunctionst *netSerialF = NULL; /** 4 bits - 16 types in the serialized bitstream */ enum {S_UNDEFINED, S_BOOL, S_DICT, S_DOUBLE, S_INT, S_STRING, S_ARRAY, S_BYTES, PK_DICT, PK_DOUBLE, PK_INT, PK_STRING, PK_ARRAY, PK_BYTES, UNIFORM_DICT, UNIFORM_ARRAY}; -typ enum {NOPACKING, PACKED, UNIFORM} packingT; +typ enum {NOPACKING, PACK, UNIFORM} packingT; /** * libsheepy object types to netSerial types diff --git a/package.yml b/package.yml @@ -1,6 +1,6 @@ --- name: netSerial - version: 0.0.9 + version: 0.0.10 description: network serializer with binary format more compact than the default serializer in smallJson bin: ./netSerial.c repository: @@ -14,10 +14,10 @@ url: "https://noulin.net/netSerial/log.html" homepage: "https://noulin.net/netSerial/file/README.md.html" testBin: ./testNetSerial.c - testCflags: "-ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra" + testCflags: "-g3 -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra" testLflags: "-lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic" memcheckBin: ./memcheckNetSerial.c memcheckCmd: "valgrind --leak-check=full --show-leak-kinds=all" - memcheckCflags: "-ggdb -std=gnu11 -fPIC -pipe" + memcheckCflags: "-g3 -std=gnu11 -fPIC -pipe" memcheckLflags: "-rdynamic" private: false