--- libelwix/inc/elwix/ajson.h 2025/08/25 12:44:59 1.9.2.2 +++ libelwix/inc/elwix/ajson.h 2026/03/31 15:29:12 1.11 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: ajson.h,v 1.9.2.2 2025/08/25 12:44:59 misho Exp $ +* $Id: ajson.h,v 1.11 2026/03/31 15:29:12 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2025 +Copyright 2004 - 2026 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -132,6 +132,14 @@ unsigned int json_parse(json_t * __restrict json, cons */ ait_val_t *json_token2val(const char *jstr, jtok_t * __restrict tok); /* + * json_token2rstr() - Return token to raw string + * + * @jstr = JSON string + * @tok = Token for convert + * @return =NULL error or !=NULL allocated str, after use should be json_freestr()|e_free() + */ +char *json_token2rstr(const char *jstr, jtok_t * __restrict tok); +/* * json_token2str() - Return token to string * * @jstr = JSON string @@ -183,11 +191,13 @@ array_t *json_token2vars(const char *jstr, jtok_t * __ * after use should be json_freearray() */ array_t *json_token2array(const char *jstr, jtok_t * __restrict tok); -#define json_freearray(x) do { \ - assert((x)); \ - array_Free(*(x)); \ - array_Destroy((x)); \ - } while(0) +/* + * json_freearray() - Free & destroy allocated array from json_token2array function + * + * @parr = Array + * return -1 error or 0 ok + */ +int json_freearray(array_t **parr); /*