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

Function xo_simple_field

tools/libxo/libxo/libxo.c:3808–3820  ·  view source on GitHub ↗

* Convenience function that either append a fixed value (if one is * given) or formats a field using a format string. If it's * encode_only, then we can't skip formatting the field, since it may * be pulling arguments off the stack. */

Source from the content-addressed store, hash-verified

3806 * be pulling arguments off the stack.
3807 */
3808static inline void
3809xo_simple_field (xo_handle_t *xop, unsigned encode_only,
3810 const char *value, ssize_t vlen,
3811 const char *fmt, ssize_t flen, xo_xff_flags_t flags)
3812{
3813 if (encode_only)
3814 flags |= XFF_NO_OUTPUT;
3815
3816 if (vlen == 0)
3817 xo_do_format_field(xop, NULL, fmt, flen, flags);
3818 else if (!encode_only)
3819 xo_data_append_content(xop, value, vlen, flags);
3820}
3821
3822/*
3823 * Html mode: append a <div> to the output buffer contain a field

Callers 4

xo_buf_append_divFunction · 0.85
xo_format_titleFunction · 0.85
xo_format_valueFunction · 0.85
xo_format_contentFunction · 0.85

Calls 2

xo_do_format_fieldFunction · 0.85
xo_data_append_contentFunction · 0.85

Tested by

no test coverage detected