/*============================================================================= Name: mgntRegister.c mgntRegistrar - registers all "mgnt*" commands with the iocsh Abs: shell commands must be registered before they can be recognized by IOC shell. Registration is achieved by calling a registration function with the appropiate parameters for each command. Auth: 10-Feb-2010, Debbie Rogind (drogind): created -----------------------------------------------------------------------------*/ #include "copyright_SLAC.h" /* SLAC copyright comments */ /*----------------------------------------------------------------------------- Mod: (newest to oldest) =============================================================================*/ #include "debugPrint.h" #ifdef DEBUG_PRINT int mgntRegFlag = DP_DEBUG; #endif /* c library includes */ #include /* epics includes */ #include /* NELEMENTS */ #include /* ioc shell stuff */ #include #include /* for registering mgntfcomInit */ #include "mgntRegister.h" #include "mgntPauUsr.h" /* re-define mgntfcom.h */ /* mgntfcomInit */ static const iocshArg mgntfcomInitArg0 = { "IP Addr", iocshArgString}; static const iocshArg * const mgntfcomInitArgs[1] = {&mgntfcomInitArg0}; LOCAL iocshFuncDef mgntfcomInitFuncDef = {"mgntfcomInit", 1, &mgntfcomInitArg0 }; LOCAL void mgntfcomInitCallFunc(const iocshArgBuf *args) { mgntfcomInit(args[0].sval); } /* mgntfcomPVName */ static const iocshArg mgntfcomPVNameArg0 = { "PV Name", iocshArgString}; static const iocshArg * const mgntfcomPVNameArgs[1] = {&mgntfcomPVNameArg0}; LOCAL iocshFuncDef mgntfcomPVNameFuncDef = {"mgntfcomPVName", 1, mgntfcomPVNameArgs }; LOCAL void mgntfcomPVNameCallFunc(const iocshArgBuf *args) { mgntfcomPVName(args[0].sval); } /* mgntfcomStatus */ LOCAL iocshFuncDef mgntfcomStatusFuncDef = {"mgntfcomStatus", 0, NULL }; LOCAL void mgntfcomStatusCallFunc(const iocshArgBuf *args) { mgntfcomStatus(); } LOCAL registryFunctionRef mgntRef[] = { {"mgntfcomInit", (REGISTRYFUNCTION)mgntfcomInit}, {"mgntfcomStatus",(REGISTRYFUNCTION)mgntfcomStatus}, {"mgntfcomPVName", (REGISTRYFUNCTION)mgntfcomPVName} }; /*============================================================================= Name: mgntRegistrar Abs: add mgntfcomInit and mgntfcomPVName to the function registry Args: none Rem: epics requires global functions to be registered for proper linking Side: Ret: none ==============================================================================*/ void mgntRegistrar(void) { registryFunctionRefAdd(mgntRef,NELEMENTS(mgntRef)); iocshRegister(&mgntfcomInitFuncDef, mgntfcomInitCallFunc); iocshRegister(&mgntfcomStatusFuncDef, mgntfcomStatusCallFunc); iocshRegister(&mgntfcomPVNameFuncDef, mgntfcomPVNameCallFunc); } epicsExportRegistrar(mgntRegistrar);