This is Unofficial EPICS BASE Doxygen Site
dlload.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2009 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * EPICS BASE is distributed subject to a Software License Agreement found
5 * in file LICENSE that is included with this distribution.
6 \*************************************************************************/
7 
8 #include "epicsFindSymbol.h"
9 #include "iocsh.h"
10 #include "epicsExport.h"
11 
12 IOCSH_STATIC_FUNC void dlload(const char* name)
13 {
14  if (!epicsLoadLibrary(name)) {
15  printf("epicsLoadLibrary failed: %s\n", epicsLoadError());
16  }
17 }
18 
19 static const iocshArg dlloadArg0 = { "path/library.so", iocshArgString};
20 static const iocshArg * const dlloadArgs[] = {&dlloadArg0};
21 static const iocshFuncDef dlloadFuncDef = {"dlload", 1, dlloadArgs};
22 static void dlloadCallFunc(const iocshArgBuf *args)
23 {
24  dlload(args[0].sval);
25 }
26 
27 static void dlloadRegistar(void) {
28  iocshRegister(&dlloadFuncDef, dlloadCallFunc);
29 }
30 epicsExportRegistrar(dlloadRegistar);
#define printf
Definition: epicsStdio.h:41
void epicsStdCall iocshRegister(const iocshFuncDef *piocshFuncDef, iocshCallFunc func)
Definition: iocsh.cpp:111
#define IOCSH_STATIC_FUNC
Definition: iocsh.h:23
LIBCOM_API const char * epicsLoadError(void)
Definition: osdFindSymbol.c:18
LIBCOM_API void * epicsLoadLibrary(const char *name)
Definition: osdFindSymbol.c:13
epicsExportRegistrar(dlloadRegistar)
IOCSH_STATIC_FUNC void dlload(const char *name)
Definition: dlload.c:12
Definition: iocsh.h:56
Exporting IOC objects.