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

Function xo_format_content

tools/libxo/libxo/libxo.c:4663–4702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4661}
4662
4663static void
4664xo_format_content (xo_handle_t *xop, const char *class_name,
4665 const char *tag_name,
4666 const char *value, ssize_t vlen,
4667 const char *fmt, ssize_t flen,
4668 xo_xff_flags_t flags)
4669{
4670 switch (xo_style(xop)) {
4671 case XO_STYLE_TEXT:
4672 xo_simple_field(xop, FALSE, value, vlen, fmt, flen, flags);
4673 break;
4674
4675 case XO_STYLE_HTML:
4676 xo_buf_append_div(xop, class_name, flags, NULL, 0,
4677 value, vlen, fmt, flen, NULL, 0);
4678 break;
4679
4680 case XO_STYLE_XML:
4681 case XO_STYLE_JSON:
4682 case XO_STYLE_SDPARAMS:
4683 if (tag_name) {
4684 xo_open_container_h(xop, tag_name);
4685 xo_format_value(xop, "message", 7, value, vlen,
4686 fmt, flen, NULL, 0, flags);
4687 xo_close_container_h(xop, tag_name);
4688
4689 } else {
4690 /*
4691 * Even though we don't care about labels, we need to do
4692 * enough parsing work to skip over the right bits of xo_vap.
4693 */
4694 xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags);
4695 }
4696 break;
4697
4698 case XO_STYLE_ENCODER:
4699 xo_simple_field(xop, TRUE, value, vlen, fmt, flen, flags);
4700 break;
4701 }
4702}
4703
4704static const char *xo_color_names[] = {
4705 "default", /* XO_COL_DEFAULT */

Callers 3

xo_format_unitsFunction · 0.85
xo_anchor_stopFunction · 0.85
xo_do_emit_fieldsFunction · 0.85

Calls 6

xo_styleFunction · 0.85
xo_simple_fieldFunction · 0.85
xo_buf_append_divFunction · 0.85
xo_open_container_hFunction · 0.85
xo_format_valueFunction · 0.85
xo_close_container_hFunction · 0.85

Tested by

no test coverage detected