X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fsc_test.c;h=289e50ca510d98c2098c2793b123f187698a6a36;hp=025baabc73f5b4d42ae9ae57666646d85589ea5a;hb=88d3bedf772316f87e1996f655ccf8d1e2589755;hpb=540056f9cf1a3304b253db09eba899cc6763466d diff --git a/src/sc_test.c b/src/sc_test.c index 025baab..289e50c 100644 --- a/src/sc_test.c +++ b/src/sc_test.c @@ -1,8 +1,13 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. */ +/** + * \file sc_test.c + * \brief Small test for the Windows Service Control utility + */ + #ifdef WIN32 #include #include @@ -15,12 +20,20 @@ #include #include +/** \brief handle that is used to stop that service should be stopped */ HANDLE default_stop_event = NULL; + +/** \brief stop handler which just signals "stop" */ static void default_sc_stop(yaz_sc_t s) { SetEvent(default_stop_event); } +/** \brief service control main + This does not read argc and argv. + Real applications would typically do that. It is very important that + yaz_sc_running is called before the application starts to operate . +*/ static int default_sc_main(yaz_sc_t s, int argc, char **argv) { default_stop_event = CreateEvent( @@ -38,7 +51,7 @@ static int default_sc_main(yaz_sc_t s, int argc, char **argv) return 0; } - +/** \brief the system main function */ int main(int argc, char **argv) { yaz_sc_t s = yaz_sc_create("yaz_sc_test", "YAZ Service Control Test"); @@ -51,6 +64,7 @@ int main(int argc, char **argv) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab