From 7902cc0033070b229f5665f5bed29b983cfb3679 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Wed, 30 Aug 2017 14:24:58 -0500 Subject: [PATCH] fixup --- src/ioc/PVAServerRegister.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/ioc/PVAServerRegister.cpp b/src/ioc/PVAServerRegister.cpp index bc9c135..a7c386f 100644 --- a/src/ioc/PVAServerRegister.cpp +++ b/src/ioc/PVAServerRegister.cpp @@ -34,15 +34,15 @@ #include -using std::cout; -using std::endl; namespace pvd = epics::pvData; namespace pva = epics::pvAccess; -static pvd::Mutex the_server_lock; -static pva::ServerContext::shared_pointer the_server; +namespace { -static void startitup() { +pvd::Mutex the_server_lock; +pva::ServerContext::shared_pointer the_server; + +void startitup() { the_server = pva::ServerContext::create(pva::ServerContext::Config() .config(pva::ConfigurationBuilder() // default to all providers instead of just "local" @@ -54,7 +54,7 @@ static void startitup() { .build())); } -static void startPVAServer(const char *names) +void startPVAServer(const char *names) { try { if(names && names[0]!='\0') { @@ -74,7 +74,7 @@ static void startPVAServer(const char *names) } } -static void stopPVAServer() +void stopPVAServer() { try { pvd::Lock G(the_server_lock); @@ -88,7 +88,7 @@ static void stopPVAServer() } } -static void statusPVAServer() +void statusPVAServer() { try { pvd::Lock G(the_server_lock); @@ -103,7 +103,7 @@ static void statusPVAServer() } } -static void initStartPVAServer(initHookState state) +void initStartPVAServer(initHookState state) { pvd::Lock G(the_server_lock); if(state==initHookAfterIocRunning && !the_server) { @@ -115,7 +115,7 @@ static void initStartPVAServer(initHookState state) } -static void registerStartPVAServer(void) +void registerStartPVAServer(void) { epics::iocshRegister("startPVAServer", "provider names"); epics::iocshRegister<&statusPVAServer>("statusPVAServer"); @@ -123,6 +123,8 @@ static void registerStartPVAServer(void) initHookRegister(&initStartPVAServer); } +} // namespace + extern "C" { epicsExportRegistrar(registerStartPVAServer); }