* Release any resources held by the handle. * * @param xop XO handle to alter (or NULL for default handle) */
| 1949 | * @param xop XO handle to alter (or NULL for default handle) |
| 1950 | */ |
| 1951 | void |
| 1952 | xo_destroy (xo_handle_t *xop_arg) |
| 1953 | { |
| 1954 | xo_handle_t *xop = xo_default(xop_arg); |
| 1955 | |
| 1956 | xo_flush_h(xop); |
| 1957 | |
| 1958 | if (xop->xo_close && XOF_ISSET(xop, XOF_CLOSE_FP)) |
| 1959 | xop->xo_close(xop->xo_opaque); |
| 1960 | |
| 1961 | xo_free(xop->xo_stack); |
| 1962 | xo_buf_cleanup(&xop->xo_data); |
| 1963 | xo_buf_cleanup(&xop->xo_fmt); |
| 1964 | xo_buf_cleanup(&xop->xo_predicate); |
| 1965 | xo_buf_cleanup(&xop->xo_attrs); |
| 1966 | xo_buf_cleanup(&xop->xo_color_buf); |
| 1967 | |
| 1968 | if (xop->xo_version) |
| 1969 | xo_free(xop->xo_version); |
| 1970 | |
| 1971 | if (xop_arg == NULL) { |
| 1972 | bzero(&xo_default_handle, sizeof(xo_default_handle)); |
| 1973 | xo_default_inited = 0; |
| 1974 | } else |
| 1975 | xo_free(xop); |
| 1976 | } |
| 1977 | |
| 1978 | /** |
| 1979 | * Record a new output style to use for the given handle (or default if |
no test coverage detected