libsheepy

C lib for handling text files, strings and json like data structure with an object oriented system
git clone https://spartatek.se/git/libsheepy.git
Log | Files | Refs | README | LICENSE

commit 636c4f0b3064e523fba796c8b9530a3e1c004a87
parent 4b7a8c575700fc93c384b165c354fd229fb586a8
Author: Remy Noulin <loader2x@gmail.com>
Date:   Sun,  3 Nov 2019 08:22:33 +0100

fix bug in json path when the object is a dict and the path has an array index, add TODO macro

completion.txt                         | 1 +
documentation.md                       | 5 +++++
release/libsheepy.c                    | 2 +-
release/libsheepy.h                    | 7 ++++++-
src/json/libsheepyCSmallJsonInternal.h | 3 +++
src/libsheepy.c                        | 2 +-
src/libsheepy.h                        | 7 ++++++-
7 files changed, 23 insertions(+), 4 deletions(-)

Diffstat:
Mcompletion.txt | 1+
Mdocumentation.md | 5+++++
Mrelease/libsheepy.c | 2+-
Mrelease/libsheepy.h | 7++++++-
Msrc/json/libsheepyCSmallJsonInternal.h | 3+++
Msrc/libsheepy.c | 2+-
Msrc/libsheepy.h | 7++++++-
7 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/completion.txt b/completion.txt @@ -113,6 +113,7 @@ loopBreaker(breakCount) FILE_LINE PFILE_LINE AT +TODO(message) TOKENPASTE2(a, b) TOKENPASTE(a, b) UNIQVAR(name) diff --git a/documentation.md b/documentation.md @@ -144,6 +144,7 @@ loopBreaker(breakCount) FILE_LINE PFILE_LINE AT +TODO(message) TOKENPASTE2(a, b) TOKENPASTE(a, b) UNIQVAR(name) @@ -1804,6 +1805,10 @@ extern jmp_buf tryJumpBuffers[maxTryThrowCount]; * libsheepy.c, main:9149 */ #define AT pLog(LOG_INFO, __FILE__", %s:"stringifyExpr(__LINE__)"\n",__func__); +/* + * print a todo message in log + */ +#define TODO(message) logI(BLD MGT BGBLK"TODO"RST BLD MGT": "message RST) // macros for token paste for automatically creating unique variable names // used in forEachCharP #define TOKENPASTE2(a, b) a ## b diff --git a/release/libsheepy.c b/release/libsheepy.c @@ -1363,7 +1363,7 @@ void initLibsheepyF(const char *progPath, initLibsheepyObjectP initF) { staticArrayInit(fibers.L); staticArrayInit(fibers.startL); - // free insternal buffers + // free internal buffers atexit(finalizeLibsheepyCharAtExit); diff --git a/release/libsheepy.h b/release/libsheepy.h @@ -96,7 +96,7 @@ // version accoring to the version package: Release.Major.minor.patch // https://noulin.net/version/file/README.md.html -#define LIBSHEEPY_VERSION "1.0.9" +#define LIBSHEEPY_VERSION "1.0.9.1" #ifndef SH_PREFIX #define SH_PREFIX(NAME) NAME @@ -649,6 +649,11 @@ extern jmp_buf tryJumpBuffers[maxTryThrowCount]; */ #define AT pLog(LOG_INFO, __FILE__", %s:"stringifyExpr(__LINE__)"\n",__func__); +/** + * print a todo message in log + */ +#define TODO(message) logI(BLD MGT BGBLK"TODO"RST BLD MGT": "message RST) + // macros for token paste for automatically creating unique variable names // used in forEachCharP #define TOKENPASTE2(a, b) a ## b diff --git a/src/json/libsheepyCSmallJsonInternal.h b/src/json/libsheepyCSmallJsonInternal.h @@ -68,6 +68,9 @@ declareRecycle(smallJsont); if ((*a)->type != ARRAY) {free(keyInPath);return keyErrorReturn;}\ }\ \ + /* check that array a exists */\ + if (!*a) {free(keyInPath);return keyErrorReturn;}\ +\ int64_t idx = parseInt(keyInPath);\ /* convert python index (negative index) */\ int64_t len = (*a)->count;\ diff --git a/src/libsheepy.c b/src/libsheepy.c @@ -1419,7 +1419,7 @@ void initLibsheepyF(const char *progPath, initLibsheepyObjectP initF) { staticArrayInit(fibers.L); staticArrayInit(fibers.startL); - // free insternal buffers + // free internal buffers atexit(finalizeLibsheepyCharAtExit); diff --git a/src/libsheepy.h b/src/libsheepy.h @@ -96,7 +96,7 @@ // version accoring to the version package: Release.Major.minor.patch // https://noulin.net/version/file/README.md.html -#define LIBSHEEPY_VERSION "1.0.9" +#define LIBSHEEPY_VERSION "1.0.9.1" #ifndef SH_PREFIX #define SH_PREFIX(NAME) NAME @@ -649,6 +649,11 @@ extern jmp_buf tryJumpBuffers[maxTryThrowCount]; */ #define AT pLog(LOG_INFO, __FILE__", %s:"stringifyExpr(__LINE__)"\n",__func__); +/** + * print a todo message in log + */ +#define TODO(message) logI(BLD MGT BGBLK"TODO"RST BLD MGT": "message RST) + // macros for token paste for automatically creating unique variable names // used in forEachCharP #define TOKENPASTE2(a, b) a ## b