NAME
sqlbox_free
—
frees sqlbox context
LIBRARY
library “sqlbox”
SYNOPSIS
#include
<stdint.h>
#include <sqlbox.h>
void
sqlbox_free
(struct sqlbox
*box);
DESCRIPTION
Shuts down box by closing the box communication channel and releasing memory. When the box channel closes, it will finalise databases' open statements, roll back databases' transactions, close open databases, and release memory. This does not free any of the sqlbox_cfg memory passed to sqlbox_alloc(3).
If box is NULL
, does
nothing. The box should not be used subsequent this
function.
EXAMPLES
This trivial example allocates then frees a context.
struct sqlbox *p; struct sqlbox_cfg cfg; memset(&cfg, 0, sizeof(struct sqlbox_cfg)); if ((p = sqlbox_alloc(&cfg)) == NULL) errx(EXIT_FAILURE, "sqlbox_alloc"); sqlbox_free(p);