| 6897 | } |
| 6898 | |
| 6899 | void |
| 6900 | xo_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 | |
| 6920 | static xo_xsf_flags_t |
| 6921 | xo_stack_flags (xo_xof_flags_t xflags) |
no test coverage detected