use iocshelper

This commit is contained in:
Michael Davidsaver
2017-08-30 13:10:23 -05:00
parent 6d9b8bac1b
commit 1e9a044aff

View File

@@ -30,6 +30,7 @@
#include <pv/pvAccess.h>
#include <pv/serverContext.h>
#include <pv/iocshelper.h>
#include <epicsExport.h>
@@ -53,17 +54,9 @@ static void startitup() {
.build()));
}
static const iocshArg startPVAServerArg0 = { "providerNames", iocshArgString };
static const iocshArg *startPVAServerArgs[] = {
&startPVAServerArg0};
static const iocshFuncDef startPVAServerFuncDef = {
"startPVAServer", 1, startPVAServerArgs
};
static void startPVAServer(const iocshArgBuf *args)
static void startPVAServer(const char *names)
{
try {
char *names = args[0].sval;
if(names && names[0]!='\0') {
printf("Warning: startPVAServer() no longer accepts provider list as argument.\n"
" Instead place the following before calling startPVAServer() and iocInit()\n"
@@ -81,11 +74,7 @@ static void startPVAServer(const iocshArgBuf *args)
}
}
static const iocshArg *stopPVAServerArgs[1] = {};
static const iocshFuncDef stopPVAServerFuncDef = {
"stopPVAServer", 0, stopPVAServerArgs
};
static void stopPVAServer(const iocshArgBuf *args)
static void stopPVAServer()
{
try {
pvd::Lock G(the_server_lock);
@@ -99,11 +88,7 @@ static void stopPVAServer(const iocshArgBuf *args)
}
}
static const iocshArg *statusPVAServerArgs[1] = {};
static const iocshFuncDef statusPVAServerFuncDef = {
"statusPVAServer", 0, statusPVAServerArgs
};
static void statusPVAServer(const iocshArgBuf *args)
static void statusPVAServer()
{
try {
pvd::Lock G(the_server_lock);
@@ -132,9 +117,9 @@ static void initStartPVAServer(initHookState state)
static void registerStartPVAServer(void)
{
iocshRegister(&startPVAServerFuncDef, startPVAServer);
iocshRegister(&stopPVAServerFuncDef, stopPVAServer);
iocshRegister(&statusPVAServerFuncDef, statusPVAServer);
epics::iocshRegister<const char*, &startPVAServer>("startPVAServer", "provider names");
epics::iocshRegister<&statusPVAServer>("statusPVAServer");
epics::iocshRegister<&stopPVAServer>("stopPVAServer");
initHookRegister(&initStartPVAServer);
}