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

Function xo_create_to_file

tools/libxo/libxo/libxo.c:1894–1907  ·  view source on GitHub ↗

* Create a handle that will write to the given file. Use * the XOF_CLOSE_FP flag to have the file closed on xo_destroy(). * * @param fp FILE pointer to use * @param style Style of output desired (XO_STYLE_* value) * @param flags Set of XOF_* flags to use with this handle * @return Newly allocated handle * @see xo_destroy */

Source from the content-addressed store, hash-verified

1892 * @see xo_destroy
1893 */
1894xo_handle_t *
1895xo_create_to_file (FILE *fp, xo_style_t style, xo_xof_flags_t flags)
1896{
1897 xo_handle_t *xop = xo_create(style, flags);
1898
1899 if (xop) {
1900 xop->xo_opaque = fp;
1901 xop->xo_write = xo_write_to_file;
1902 xop->xo_close = xo_close_file;
1903 xop->xo_flush = xo_flush_file;
1904 }
1905
1906 return xop;
1907}
1908
1909/**
1910 * Set the default handler to output to a file.

Callers

nothing calls this directly

Calls 1

xo_createFunction · 0.85

Tested by

no test coverage detected