1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
8 * \brief Small test for the Windows Service Control utility
19 #include <yaz/xmalloc.h>
23 HANDLE default_stop_event = NULL;
24 static void default_sc_stop(yaz_sc_t s)
26 SetEvent(default_stop_event);
29 static int default_sc_main(yaz_sc_t s, int argc, char **argv)
31 default_stop_event = CreateEvent(
32 NULL, // default security attributes
33 TRUE, // manual reset event
34 FALSE, // not signaled
37 if (default_stop_event == NULL)
42 WaitForSingleObject(default_stop_event, INFINITE);
47 int main(int argc, char **argv)
49 yaz_sc_t s = yaz_sc_create("yaz_sc_test", "YAZ Service Control Test");
51 yaz_sc_program(s, argc, argv, default_sc_main, default_sc_stop);
59 * indent-tabs-mode: nil
61 * vim: shiftwidth=4 tabstop=8 expandtab