#include <iostream>
#include <string>
#include <list>
#include <stdexcept>
#include <epicsGetopt.h>
#include "registryFunction.h"
#include "epicsThread.h"
#include "epicsExit.h"
#include "epicsStdio.h"
#include "epicsString.h"
#include "dbStaticLib.h"
#include "subRecord.h"
#include "dbAccess.h"
#include "asDbLib.h"
#include "iocInit.h"
#include "iocsh.h"
#include "osiFileName.h"
#include "epicsInstallDir.h"
Go to the source code of this file.
#define DBD_BASE "dbd" OSI_PATH_SEPARATOR "softIoc.dbd" |
#define EXIT_BASE "db" OSI_PATH_SEPARATOR "softIocExit.db" |
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 116 of file softMain.cpp.
124 bool loadedDb =
false;
146 while ((opt =
getopt(argc, argv,
"ha:D:d:m:Ssx:")) != -1) {
149 usage(argv[0], dbd_file);
153 usage(argv[0], dbd_file);
154 std::cerr<<
"Unknown argument: -"<<char(opt)<<
"\n";
159 if (!macros.empty()) {
161 throw std::bad_alloc();
162 std::cout<<
"asSetSubstitutions(\""<<macros<<
"\")\n";
165 throw std::bad_alloc();
166 std::cout<<
"asSetFilename(\""<<
optarg<<
"\")\n";
169 if(lazy_dbd_loaded) {
170 throw std::runtime_error(
"-D specified too late. softIoc.dbd already loaded.\n");
176 errIf(dbLoadRecords(optarg, macros.c_str()),
177 std::string(
"Failed to load: ")+
optarg);
178 std::cout<<
"dbLoadRecords(\""<<optarg<<
"\"";
180 std::cout<<
", \""<<macros<<
"\"";
196 errIf(dbLoadRecords(exit_file.c_str(), xmacro.c_str()),
197 std::string(
"Failed to load: ")+exit_file);
209 std::cout<<
"# Begin "<<argv[
optind]<<
"\n";
211 std::string(
"Error in ")+argv[optind]);
212 std::cout<<
"# End "<<argv[
optind]<<
"\n";
219 std::cout<<
"iocInit()\n";
237 usage(argv[0], dbd_file);
238 std::cerr<<
"Nothing to do!\n";
247 }
catch(std::exception& e){
248 std::cerr<<
"Error: "<<e.what()<<
"\n";
int getopt(int nargc, char *const *nargv, const char *ostr)
LIBCOM_API char * epicsGetExecDir(void)
int asSetSubstitutions(const char *substitutions)
int epicsStdCall iocsh(const char *pathname)
LIBCOM_API void epicsExit(int status)
Calls epicsExitCallAtExits(), then the OS exit() routine.
LIBCOM_API void epicsStdCall epicsThreadExitMain(void)
LIBCOM_API void epicsStdCall epicsThreadSleep(double seconds)
Block the calling thread for at least the specified time.
int asSetFilename(const char *acf)
int softIoc_registerRecordDeviceDriver |
( |
struct dbBase * |
pdbbase | ) |
|