diff --git a/src/makeBaseApp/Makefile b/src/makeBaseApp/Makefile index 2662aeb4f..a067a3aef 100644 --- a/src/makeBaseApp/Makefile +++ b/src/makeBaseApp/Makefile @@ -30,7 +30,7 @@ TEMPLATES += top/exampleApp/src/exampleInclude.dbd TEMPLATES += top/exampleApp/src/sncExample.stt TEMPLATES += top/exampleApp/src/xxxRecord.dbd TEMPLATES += top/exampleApp/src/exampleMain.cpp -TEMPLATES += top/exampleApp/src/dbSubExample.cpp +TEMPLATES += top/exampleApp/src/dbSubExample.c TEMPLATES += top/exampleBoot/Makefile TEMPLATES += top/exampleBoot/nfsCommands@vxWorks diff --git a/src/makeBaseApp/top/exampleApp/src/Makefile b/src/makeBaseApp/top/exampleApp/src/Makefile index 33f73637a..513605f15 100644 --- a/src/makeBaseApp/top/exampleApp/src/Makefile +++ b/src/makeBaseApp/top/exampleApp/src/Makefile @@ -35,7 +35,7 @@ PROD_IOC = example example_SRCS += xxxRecord.c example_SRCS += devXxxSoft.c -example_SRCS += dbSubExample.cpp +example_SRCS += dbSubExample.c # _registerRecordDeviceDriver.cpp will be created from .dbd example_SRCS += example_registerRecordDeviceDriver.cpp diff --git a/src/makeBaseApp/top/exampleApp/src/dbSubExample.c b/src/makeBaseApp/top/exampleApp/src/dbSubExample.c new file mode 100644 index 000000000..486d99c72 --- /dev/null +++ b/src/makeBaseApp/top/exampleApp/src/dbSubExample.c @@ -0,0 +1,16 @@ +#include +#include "subRecord.h" + +typedef long (*processMethod)(subRecord *precord); + +long mySubInit(subRecord *precord,processMethod process) +{ + printf("%s mySubInit process %p\n",precord->name, (void*) process); + return(0); +} + +long mySubProcess(subRecord *precord) +{ + printf("%s mySubProcess\n",precord->name); + return(0); +} diff --git a/src/makeBaseApp/top/exampleApp/src/dbSubExample.cpp b/src/makeBaseApp/top/exampleApp/src/dbSubExample.cpp deleted file mode 100644 index 86f52a1b4..000000000 --- a/src/makeBaseApp/top/exampleApp/src/dbSubExample.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include -#include -#include -#include -#include - -#include -#include - -extern "C" { -typedef long (*processMethod)(subRecord *precord); -long mySubInit(subRecord *precord,processMethod process); -long mySubProcess(subRecord *precord); -void mySubRecordFunctionsRegister(void); -} - -long mySubInit(subRecord *precord,processMethod process) -{ - printf("%s mySubInit process %p\n",precord->name,process); - return(0); -} - -long mySubProcess(subRecord *precord) -{ - printf("%s mySubProcess\n",precord->name); - return(0); -} - -void mySubRecordFunctionsRegister(void) -{ - - if(!registryFunctionAdd("mySubInit",(REGISTRYFUNCTION)mySubInit)) - errlogPrintf("mySubRecordFunctionsRegister registryFunctionAdd failed\n"); - if(!registryFunctionAdd("mySubProcess",(REGISTRYFUNCTION)mySubProcess)) - errlogPrintf("mySubRecordFunctionsRegister registryFunctionAdd failed\n"); -} - -/* - * Register commands on application startup - */ -class mySubRegister { - public: - mySubRegister() { mySubRecordFunctionsRegister(); } -}; -static mySubRegister mySubRegisterObj; - diff --git a/src/makeBaseApp/top/exampleApp/src/exampleInclude.dbd b/src/makeBaseApp/top/exampleApp/src/exampleInclude.dbd index 44558d7ac..81134994c 100644 --- a/src/makeBaseApp/top/exampleApp/src/exampleInclude.dbd +++ b/src/makeBaseApp/top/exampleApp/src/exampleInclude.dbd @@ -1,3 +1,5 @@ include "base.dbd" include "xxxRecord.dbd" device(xxx,CONSTANT,devXxxSoft,"SoftChannel") +function("mySubInit") +function("mySubProcess")