Added optional dlload command.
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
# Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE Versions 3.13.7
|
||||
# and higher are distributed subject to a Software License Agreement found
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
@@ -13,6 +12,7 @@ include $(TOP)/configure/CONFIG
|
||||
|
||||
DBD += base.dbd
|
||||
DBD += system.dbd
|
||||
DBD += dlload.dbd
|
||||
|
||||
INC += epicsRelease.h
|
||||
INC += iocInit.h
|
||||
@@ -23,8 +23,10 @@ LIB_SRCS += epicsRelease.c
|
||||
LIB_SRCS += iocInit.c
|
||||
LIB_SRCS += asSubRecordFunctions.c
|
||||
LIB_SRCS += miscIocRegister.c
|
||||
LIB_SRCS += dlload.c
|
||||
LIB_SRCS += iocshRegisterCommon.c
|
||||
|
||||
|
||||
LIBRARY_IOC = miscIoc
|
||||
|
||||
miscIoc_RCS = miscIoc.rc
|
||||
|
||||
25
src/misc/dlload.c
Normal file
25
src/misc/dlload.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
#include "epicsFindSymbol.h"
|
||||
#include "iocsh.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
static const iocshArg dlloadArg0 = { "path/library.so", iocshArgString};
|
||||
static const iocshArg * const dlloadArgs[] = {&dlloadArg0};
|
||||
static const iocshFuncDef dlloadFuncDef = {"dlload", 1, dlloadArgs};
|
||||
static void dlloadCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
if (!epicsLoadLibrary(args[0].sval)) {
|
||||
printf("epicsLoadLibrary failed: %s\n", epicsLoadError());
|
||||
}
|
||||
}
|
||||
|
||||
static void dlloadRegistar(void) {
|
||||
iocshRegister(&dlloadFuncDef, dlloadCallFunc);
|
||||
}
|
||||
epicsExportRegistrar(dlloadRegistar);
|
||||
3
src/misc/dlload.dbd
Normal file
3
src/misc/dlload.dbd
Normal file
@@ -0,0 +1,3 @@
|
||||
# Including this DBD file adds the 'dlload' command to the IOC shell.
|
||||
|
||||
registrar(dlloadRegistar)
|
||||
Reference in New Issue
Block a user