* Set the default handler to output to a file. * * @param xop libxo handle * @param fp FILE pointer to use * @return 0 on success, non-zero on failure */
| 1914 | * @return 0 on success, non-zero on failure |
| 1915 | */ |
| 1916 | int |
| 1917 | xo_set_file_h (xo_handle_t *xop, FILE *fp) |
| 1918 | { |
| 1919 | xop = xo_default(xop); |
| 1920 | |
| 1921 | if (fp == NULL) { |
| 1922 | xo_failure(xop, "xo_set_file: NULL fp"); |
| 1923 | return -1; |
| 1924 | } |
| 1925 | |
| 1926 | xop->xo_opaque = fp; |
| 1927 | xop->xo_write = xo_write_to_file; |
| 1928 | xop->xo_close = xo_close_file; |
| 1929 | xop->xo_flush = xo_flush_file; |
| 1930 | |
| 1931 | return 0; |
| 1932 | } |
| 1933 | |
| 1934 | /** |
| 1935 | * Set the default handler to output to a file. |
no test coverage detected