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

Function xo_write

tools/libxo/libxo/libxo.c:911–929  ·  view source on GitHub ↗

* Write the current contents of the data buffer using the handle's * xo_write function. */

Source from the content-addressed store, hash-verified

909 * xo_write function.
910 */
911static ssize_t
912xo_write (xo_handle_t *xop)
913{
914 ssize_t rc = 0;
915 xo_buffer_t *xbp = &xop->xo_data;
916
917 if (xbp->xb_curp != xbp->xb_bufp) {
918 xo_buf_append(xbp, "", 1); /* Append ending NUL */
919 xo_anchor_clear(xop);
920 if (xop->xo_write)
921 rc = xop->xo_write(xop->xo_opaque, xbp->xb_bufp);
922 xbp->xb_curp = xbp->xb_bufp;
923 }
924
925 /* Turn off the flags that don't survive across writes */
926 XOIF_CLEAR(xop, XOIF_UNITS_PENDING);
927
928 return rc;
929}
930
931/*
932 * Format arguments into our buffer. If a custom formatter has been set,

Callers 4

xo_warn_hcvFunction · 0.85
xo_message_hcvFunction · 0.85
xo_flush_hFunction · 0.85
xo_errorn_hvFunction · 0.85

Calls 2

xo_buf_appendFunction · 0.85
xo_anchor_clearFunction · 0.85

Tested by

no test coverage detected