skip to content
==> include/mesh/debug_str.h <==
1/* @ajax/mesh-debug-str: a string quoted the way Rust's `{:?}` prints a `&str`, so the port's error
2 * messages read exactly as the Rust's: "items \"x\": ...". */
3#ifndef MESH_DEBUG_STR_H
4#define MESH_DEBUG_STR_H
5
6#include "mesh/strbuf.h"
7
8#include <stddef.h>
9
10/* Appends s (n bytes, UTF-8) in double quotes, escaping as Rust does: \" \\ \t \r \n \0, other
11 * control characters as \u{..}; other characters (printable ASCII and UTF-8) as they are. */
12void mdebug_str(msb *b, const char *s, size_t n);
13/* The same into a new string. */
14char *mdebug(const char *s);
15
16#endif