libui/redo/shouldquit.c

23 lines
372 B
C
Raw Normal View History

// 9 may 2015
2015-05-16 00:45:20 -05:00
#include "out/ui.h"
#include "uipriv.h"
static int defaultOnShouldQuit(void *data)
{
return 0;
}
static int (*onShouldQuit)(void *) = defaultOnShouldQuit;
static void *onShouldQuitData;
void uiOnShouldQuit(int (*f)(void *), void *data)
{
onShouldQuit = f;
onShouldQuitData = data;
}
int shouldQuit(void)
{
return (*onShouldQuit)(onShouldQuitData);
}