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

Function xo_destroy

tools/libxo/libxo/libxo.c:1951–1976  ·  view source on GitHub ↗

* Release any resources held by the handle. * * @param xop XO handle to alter (or NULL for default handle) */

Source from the content-addressed store, hash-verified

1949 * @param xop XO handle to alter (or NULL for default handle)
1950 */
1951void
1952xo_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

Callers 2

xo_vsyslogFunction · 0.85
xo_encoder_createFunction · 0.85

Calls 4

xo_defaultFunction · 0.85
xo_flush_hFunction · 0.85
xo_buf_cleanupFunction · 0.85
bzeroFunction · 0.85

Tested by

no test coverage detected