Removed complex C++ registration of subroutines,
replaced by function() statments in .dbd file.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -35,7 +35,7 @@ PROD_IOC = example
|
||||
|
||||
example_SRCS += xxxRecord.c
|
||||
example_SRCS += devXxxSoft.c
|
||||
example_SRCS += dbSubExample.cpp
|
||||
example_SRCS += dbSubExample.c
|
||||
|
||||
# <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd
|
||||
example_SRCS += example_registerRecordDeviceDriver.cpp
|
||||
|
||||
16
src/makeBaseApp/top/exampleApp/src/dbSubExample.c
Normal file
16
src/makeBaseApp/top/exampleApp/src/dbSubExample.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#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);
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <registryFunction.h>
|
||||
#include <subRecord.h>
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
include "base.dbd"
|
||||
include "xxxRecord.dbd"
|
||||
device(xxx,CONSTANT,devXxxSoft,"SoftChannel")
|
||||
function("mySubInit")
|
||||
function("mySubProcess")
|
||||
|
||||
Reference in New Issue
Block a user