* Write the current contents of the data buffer using the handle's * xo_write function. */
| 909 | * xo_write function. |
| 910 | */ |
| 911 | static ssize_t |
| 912 | xo_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, |
no test coverage detected