From 9a055e83f3f87e25a9a6d1102723981f3502a9f3 Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Thu, 24 Oct 2019 01:21:56 +0300 Subject: [PATCH] Added a structure for the cstr wrapper; --- include/sexpr/sexp.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/include/sexpr/sexp.h b/include/sexpr/sexp.h index 891a0cd..2359af6 100644 --- a/include/sexpr/sexp.h +++ b/include/sexpr/sexp.h @@ -2,8 +2,13 @@ @cond IGNORE ====================================================== + Original copyrights (before the fork): SFSEXP: Small, Fast S-Expression Library version 1.2 Written by Matthew Sottile (mjsottile@gmail.com) + Forked: + libsexpr: fork of sfsexp (small and fast s-expression lib) + (c) Matthew Sottile (original author) + (c) Alexander Vdolainen (some extra API additions) ====================================================== Copyright (2003-2006). The Regents of the University of California. This @@ -44,6 +49,8 @@ LA-CC-04-094 #include "sexp_memory.h" #include "sexp_errors.h" +#define CSTRBUFSIZ 512 + /* doxygen documentation groups defined here */ /** @@ -552,7 +559,7 @@ typedef struct sexp_iowrap { * Buffer to read data into before parsing. */ char buf[BUFSIZ]; - + /** * Byte count for last read. If it is -1, there was an error. Otherwise, * it will be a value from 0 to BUFSIZ. @@ -560,6 +567,15 @@ typedef struct sexp_iowrap { size_t cnt; } sexp_iowrap_t; +/* TODO: doxygen? more doxygen */ +typedef struct sexp_cstrwrap { + pcont_t *cc; + const char *seval; + size_t rl, cnt; + size_t sln; + char buf[CSTRBUFSIZ]; +} sexp_cstrwrap_t; + /*========*/ /* GLOBAL */ /*========*/