Commit 20a2007b authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Add a VSM_IsOpen API function

parent 05f5cd86
......@@ -126,6 +126,15 @@ int VSM_Open(struct VSM_data *vd);
* <0 on failure, VSM_Error() returns diagnostic string
*/
int VSM_IsOpen(const struct VSM_data *vd);
/*
* Check if the VSM is open.
*
* Returns:
* 1: Is open
* 0: Is closed
*/
int VSM_Abandoned(struct VSM_data *vd);
/*
* Find out if the VSM file has been abandoned or closed and should
......
......@@ -129,4 +129,5 @@ LIBVARNISHAPI_1.4 {
global:
VNUM;
VSLQ_SetCursor;
VSM_IsOpen;
} LIBVARNISHAPI_1.0;
......@@ -287,6 +287,16 @@ VSM_Open(struct VSM_data *vd)
/*--------------------------------------------------------------------*/
int
VSM_IsOpen(const struct VSM_data *vd)
{
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
return (vd->head != NULL);
}
/*--------------------------------------------------------------------*/
void
VSM_Close(struct VSM_data *vd)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment