skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

commit 4fa9aa58a926275c2db31a4cc98122e7883c714a
parent 753ceac3272a8c4f150ace8b4695991a85345c3c
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Tue, 10 Oct 2023 07:59:47 +0000

 Add string_quotes macro

Signed-off-by: Laurent Bercot <ska@appnovation.com>

Diffstat:
Msrc/include/skalibs/skamisc.h | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/include/skalibs/skamisc.h b/src/include/skalibs/skamisc.h @@ -3,7 +3,7 @@ #ifndef SKALIBS_SKAMISC_H #define SKALIBS_SKAMISC_H -#include <sys/types.h> +#include <string.h> #include <skalibs/buffer.h> #include <skalibs/stralloc.h> @@ -22,6 +22,7 @@ extern int getlnmaxsep (buffer *, char *, size_t, size_t *, char const *, size_t extern int sauniquename (stralloc *) ; extern int string_quote (stralloc *, char const *, size_t) ; +#define string_quotes(sa, s) string_quote(sa, (s), strlen(s)) extern int string_quote_nodelim (stralloc *, char const *, size_t) ; extern int string_quote_nodelim_mustquote (stralloc *, char const *, size_t, char const *, size_t) ; extern int string_unquote (char *, size_t *, char const *, size_t, size_t *) ;