ws

Websocket frame builder and decoder (no transport)
git clone https://noulin.net/git/ws.git
Log | Files | Refs | LICENSE

commit 3762ea315268fffd13d748bb84b17eddb2e16f71
parent 999ac89fc735bd3f51c5853680828e18ca315b1b
Author: Remy Noulin <loader2x@gmail.com>
Date:   Tue, 30 Apr 2019 19:42:03 +0200

add isCompiledWithCurrentLisheepyVersion

Diffstat:
Mpackage.yml | 27++++++---------------------
Mws.c | 5+++++
Mws.h | 3+++
3 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/package.yml b/package.yml @@ -1,32 +1,17 @@ --- name: ws - version: 0.0.1 - description: "Websocket frame builder and decoder (no transport)" + version: 0.0.2 + description: Websocket frame builder and decoder (no transport) bin: ./ws.c - #cflags: -DA -ggdb -std=gnu11 -fPIC -pipe - #lflags: -lpcre repository: type: git - url: git+https://github.com/RemyNoun/ws.git + url: "git+https://github.com/RemyNoun/ws.git" keywords: - library - websocket author: Remy license: MIT bugs: - url: https://github.com/RemyNoulin/ws/issues - homepage: https://github.com/RemyNoulin/ws#readme - #compileHelp: # text displayed when there is a compilation error - #dependencies: - # md4c: - # Test configuration: - #testBin: ./testWs.c - #testCflags: -ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra - #testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic - # Memcheck configuration: - #memcheckBin: ./memcheckWs.c - #memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all - #memcheckCflags: -ggdb -std=gnu11 -fPIC -pipe - #memcheckLflags: -rdynamic - #documentationCmd: # command for generating the documentation with spm doc - private: false # true for private package + url: "https://github.com/RemyNoulin/ws/issues" + homepage: "https://github.com/RemyNoulin/ws#readme" + private: false diff --git a/ws.c b/ws.c @@ -483,3 +483,8 @@ bool wsIsMasked(char *frame) { wsOpt wsDecodeOp(char *frame) { return (wsOpt) frame[0] & WS_OP_MASK; } + +bool checkLibsheepyVersionWs(const char *currentLibsheepyVersion) { + return eqG(currentLibsheepyVersion, LIBSHEEPY_VERSION); +} + diff --git a/ws.h b/ws.h @@ -35,3 +35,6 @@ char *wsDecodeInPlace (char *frame, size_t size); bool wsIsFinal (char *frame); bool wsIsMasked (char *frame); wsOpt wsDecodeOp (char *frame); + +#define isWsCompiledWithCurrentLisheepyVersion checkLibsheepyVersionWs(LIBSHEEPY_VERSION) +bool checkLibsheepyVersionWs(const char *currentLibsheepyVersion);