MCPcopy Create free account
hub / github.com/F-Stack/f-stack / xo_set_depth

Function xo_set_depth

tools/libxo/libxo/libxo.c:6899–6918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6897}
6898
6899void
6900xo_set_depth (xo_handle_t *xop, int depth)
6901{
6902 xop = xo_default(xop);
6903
6904 if (xo_depth_check(xop, depth))
6905 return;
6906
6907 xop->xo_depth += depth;
6908 xop->xo_indent += depth;
6909
6910 /*
6911 * Handling the "top wrapper" for JSON is a bit of a pain. Here
6912 * we need to detect that the depth has been changed to set the
6913 * "XOIF_TOP_EMITTED" flag correctly.
6914 */
6915 if (xop->xo_style == XO_STYLE_JSON
6916 && !XOF_ISSET(xop, XOF_NO_TOP) && xop->xo_depth > 0)
6917 XOIF_SET(xop, XOIF_TOP_EMITTED);
6918}
6919
6920static xo_xsf_flags_t
6921xo_stack_flags (xo_xof_flags_t xflags)

Callers 1

mainFunction · 0.85

Calls 2

xo_defaultFunction · 0.85
xo_depth_checkFunction · 0.85

Tested by

no test coverage detected