17 lines
560 B
C
17 lines
560 B
C
/*
|
|
* caching_relay - strip JSONC comments so cJSON can parse it.
|
|
*
|
|
* cJSON does not natively understand JSONC. This produces a heap buffer the
|
|
* caller must free() containing the comment-stripped JSON. String literals are
|
|
* respected so a double-slash inside a string is preserved.
|
|
*/
|
|
#ifndef CACHING_RELAY_JSONC_STRIP_H
|
|
#define CACHING_RELAY_JSONC_STRIP_H
|
|
|
|
#include <stddef.h>
|
|
|
|
/* Returns malloc'd buffer (null-terminated) or NULL on alloc failure. */
|
|
char *jsonc_strip_comments(const char *input, size_t len);
|
|
|
|
#endif /* CACHING_RELAY_JSONC_STRIP_H */
|