* 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 */
| 1892 | * @see xo_destroy |
| 1893 | */ |
| 1894 | xo_handle_t * |
| 1895 | xo_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. |
nothing calls this directly
no test coverage detected