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

Function xo_buf_escape

tools/libxo/libxo/libxo.c:880–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878}
879
880static void
881xo_buf_escape (xo_handle_t *xop, xo_buffer_t *xbp,
882 const char *str, ssize_t len, xo_xff_flags_t flags)
883{
884 if (!xo_buf_has_room(xbp, len))
885 return;
886
887 memcpy(xbp->xb_curp, str, len);
888
889 switch (xo_style(xop)) {
890 case XO_STYLE_XML:
891 case XO_STYLE_HTML:
892 len = xo_escape_xml(xbp, len, flags);
893 break;
894
895 case XO_STYLE_JSON:
896 len = xo_escape_json(xbp, len, flags);
897 break;
898
899 case XO_STYLE_SDPARAMS:
900 len = xo_escape_sdparams(xbp, len, flags);
901 break;
902 }
903
904 xbp->xb_curp += len;
905}
906
907/*
908 * Write the current contents of the data buffer using the handle's

Callers 3

xo_data_escapeFunction · 0.85
xo_format_stringFunction · 0.85
xo_buf_append_divFunction · 0.85

Calls 6

xo_buf_has_roomFunction · 0.85
xo_styleFunction · 0.85
xo_escape_xmlFunction · 0.85
xo_escape_jsonFunction · 0.85
xo_escape_sdparamsFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected