本文整理汇总了C++中epicsExit函数的典型用法代码示例。如果您正苦于以下问题:C++ epicsExit函数的具体用法?C++ epicsExit怎么用?C++ epicsExit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了epicsExit函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exitFunc
static void exitFunc(void* arg)
{
long stat = (long)arg;
epicsThreadSleep(0.1); /* give asub record time to finish */
if (stat == 0)
{
epicsExit(EXIT_SUCCESS);
}
else
{
epicsExit(EXIT_FAILURE);
}
}
示例2: exitSubroutine
static void exitSubroutine(subRecord *precord) {
#ifdef USE_EXIT_LATER
epicsExitLater((precord->a == 0.0) ? EXIT_SUCCESS : EXIT_FAILURE);
#else
epicsExit((precord->a == 0.0) ? EXIT_SUCCESS : EXIT_FAILURE);
#endif
}
示例3: usage
static void usage(int status) {
printf("Usage: %s [-D softIoc.dbd] [-h] [-S] [-a ascf]\n", arg0);
puts("\t[-m macro=value,macro2=value2] [-d file.db]");
puts("\t[-x prefix] [st.cmd]");
puts("Compiled-in path to softIocPVA.dbd is:");
printf("\t%s\n", base_dbd);
epicsExit(status);
}
示例4: main
int main(int argc,char *argv[])
{
if(argc>=2) {
iocsh(argv[1]);
epicsThreadSleep(.2);
}
iocsh(NULL);
epicsExit(0);
return(0);
}
示例5: main
int main(int argc, char*argv[]) {
if (argc >= 2) {
iocsh(argv[1]);
epicsThreadSleep(.2);
}
iocsh(NULL);
gROOT->CloseFiles();
epicsExit(0);
return 0;
}
示例6: main
int main(int argc,char *argv[])
{
iocshRegister(&asinittestFuncDef,asinittestCallFunc);
if(argc>=2) {
if (iocsh(argv[1]) < 0)
return(1);
epicsThreadSleep(.2);
}
iocsh(NULL);
epicsExit(0);
return(0);
}
示例7: main
int main(int argc,char *argv[])
{
if(argc!=2) {
printf("must provide command file\n");
return(1);
}
iocsh(argv[1]);
epicsThreadSleep(.2);
iocsh(NULL);
epicsExit(0);
return(0);
}
示例8: main
int main(int argc,char *argv[])
{
int i, j;
short daemon;
char stcmd[256];
/* Need to catch hang up signal to make sure semaphores are
cleaned up properly */
SetSigShutdownHandler();
daemon = 0;
if(argc>=2) {
snprintf( stcmd, 255, "%s", argv[1]);
j = 0;
for( i = 2; i < argc; i++) {
if( strcmp( argv[i], "-D") == 0) {
i++;
DEBUG = atoi( argv[i]);
} else if( strcmp( argv[i], "-d") == 0) {
daemon = 1;
}
}
}
else
{
printf( "Syntax: hvcontrol <st.cmd> [-d] [-D <debuglevel>]\n");
printf( " -d = run in daemon mode\n");
printf( " <debuglevel> = 0 no messages\n");
printf( " <debuglevel> = 10 all available messages\n");
}
if (strlen(stcmd)>0) iocsh(stcmd);
if (daemon) {
for(;;)
epicsThreadSleep(1.0);
} else {
iocsh(NULL);
}
Shutdown();
epicsExit(0);
return(0);
}
示例9: pvDataAllTests
void pvDataAllTests(void)
{
testHarness();
/* pv */
runTest(testBitSetUtil);
runTest(testConvert);
runTest(testFieldBuilder);
runTest(testIntrospect);
runTest(testOperators);
runTest(testPVData);
runTest(testPVScalarArray);
runTest(testPVStructureArray);
runTest(testPVType);
runTest(testPVUnion);
runTest(testStandardField);
runTest(testStandardPVField);
/* misc */
runTest(testBaseException);
runTest(testBitSet);
runTest(testByteBuffer);
runTest(testOverrunBitSet);
runTest(testSerialization);
runTest(testSharedVector);
runTest(testThread);
runTest(testEvent);
runTest(testTimeStamp);
runTest(testTimer);
runTest(testTypeCast);
/* copy */
runTest(testCreateRequest);
runTest(testPVCopy);
/* property */
runTest(testCreateRequest);
epicsExit(0); /* Trigger test harness */
}
示例10: Init
//.........这里部分代码省略.........
RTEMS_SELF,
epicsThreadGetOssPriorityValue(epicsThreadPriorityIocsh),
&newpri);
/*
* Create a reasonable environment
*/
initConsole ();
putenv ("TERM=xterm");
putenv ("IOCSH_HISTSIZE=20");
/*
* Display some OS information
*/
printf("\n***** RTEMS Version: %s *****\n",
rtems_get_version_string());
/*
* Start network
*/
if ((cp = getenv("EPICS_TS_NTP_INET")) != NULL)
rtems_bsdnet_config.ntp_server[0] = cp;
if (rtems_bsdnet_config.network_task_priority == 0)
{
unsigned int p;
if (epicsThreadHighestPriorityLevelBelow(epicsThreadPriorityScanLow, &p)
== epicsThreadBooleanStatusSuccess)
{
rtems_bsdnet_config.network_task_priority = epicsThreadGetOssPriorityValue(p);
}
}
printf("\n***** Initializing network *****\n");
rtems_bsdnet_initialize_network();
initialize_remote_filesystem(argv, initialize_local_filesystem(argv));
/*
* More environment: iocsh prompt and hostname
*/
{
char hostname[1024];
gethostname(hostname, 1023);
char *cp = mustMalloc(strlen(hostname)+3, "iocsh prompt");
sprintf(cp, "%s> ", hostname);
epicsEnvSet ("IOCSH_PS1", cp);
epicsEnvSet("IOC_NAME", hostname);
}
/*
* Use BSP-supplied time of day if available otherwise supply default time.
* It is very likely that other time synchronization facilities in EPICS
* will soon override this value.
*/
if (rtems_clock_get(RTEMS_CLOCK_GET_TOD,&now) != RTEMS_SUCCESSFUL) {
now.year = 2001;
now.month = 1;
now.day = 1;
now.hour = 0;
now.minute = 0;
now.second = 0;
now.ticks = 0;
if ((sc = rtems_clock_set (&now)) != RTEMS_SUCCESSFUL)
printf ("***** Can't set time: %s\n", rtems_status_text (sc));
}
if (getenv("TZ") == NULL) {
const char *tzp = envGetConfigParamPtr(&EPICS_TIMEZONE);
if (tzp == NULL) {
printf("Warning -- no timezone information available -- times will be displayed as GMT.\n");
}
else {
char tz[10];
int minWest, toDst = 0, fromDst = 0;
if(sscanf(tzp, "%9[^:]::%d:%d:%d", tz, &minWest, &toDst, &fromDst) < 2) {
printf("Warning: EPICS_TIMEZONE (%s) unrecognizable -- times will be displayed as GMT.\n", tzp);
}
else {
char posixTzBuf[40];
char *p = posixTzBuf;
p += sprintf(p, "%cST%d:%.2d", tz[0], minWest/60, minWest%60);
if (toDst != fromDst)
p += sprintf(p, "%cDT", tz[0]);
epicsEnvSet("TZ", posixTzBuf);
}
}
}
tzset();
osdTimeRegister();
/*
* Run the EPICS startup script
*/
printf ("***** Starting EPICS application *****\n");
iocshRegisterRTEMS ();
set_directory (argv[1]);
epicsEnvSet ("IOC_STARTUP_SCRIPT", argv[1]);
atexit(exitHandler);
i = main ((sizeof argv / sizeof argv[0]) - 1, argv);
printf ("***** IOC application terminating *****\n");
epicsThreadSleep(1.0);
epicsExit(0);
}
示例11: simRegDevAsyncConfigureFunc
static void simRegDevAsyncConfigureFunc (const iocshArgBuf *args)
{
int status = simRegDevAsyncConfigure(
args[0].sval, args[1].ival, args[2].ival);
if (status != 0) epicsExit(1);
}
示例12: exitSubroutine
static void exitSubroutine(subRecord *precord) {
epicsExit((precord->a == 0.0) ? EXIT_SUCCESS : EXIT_FAILURE);
}
示例13: main
int main(int argc, char *argv[])
{
char *dbd_file = const_cast<char*>(base_dbd);
char *macros = NULL;
char xmacro[PVNAME_STRINGSZ + 4];
int startIocsh = 1; /* default = start shell */
int loadedDb = 0;
arg0 = strrchr(*argv, '/');
if (!arg0) {
arg0 = *argv;
} else {
++arg0; /* skip the '/' */
}
--argc, ++argv;
/* Do this here in case the dbd file not available */
if (argc>0 && **argv=='-' && (*argv)[1]=='h') {
usage(EXIT_SUCCESS);
}
if (argc>1 && **argv=='-' && (*argv)[1]=='D') {
dbd_file = *++argv;
argc -= 2;
++argv;
}
if (dbLoadDatabase(dbd_file, NULL, NULL)) {
epicsExit(EXIT_FAILURE);
}
softIocPVA_registerRecordDeviceDriver(pdbbase);
registryFunctionAdd("exit", (REGISTRYFUNCTION) exitSubroutine);
while (argc>1 && **argv == '-') {
switch ((*argv)[1]) {
case 'a':
if (macros) asSetSubstitutions(macros);
asSetFilename(*++argv);
--argc;
break;
case 'd':
if (dbLoadRecords(*++argv, macros)) {
epicsExit(EXIT_FAILURE);
}
loadedDb = 1;
--argc;
break;
case 'h':
usage(EXIT_SUCCESS);
case 'm':
macros = *++argv;
--argc;
break;
case 'S':
startIocsh = 0;
break;
case 's':
break;
case 'x':
epicsSnprintf(xmacro, sizeof xmacro, "IOC=%s", *++argv);
if (dbLoadRecords(exit_db, xmacro)) {
epicsExit(EXIT_FAILURE);
}
loadedDb = 1;
--argc;
break;
default:
printf("%s: option '%s' not recognized\n", arg0, *argv);
usage(EXIT_FAILURE);
}
--argc;
++argv;
}
if (argc>0 && **argv=='-') {
switch((*argv)[1]) {
case 'a':
case 'd':
case 'm':
case 'x':
printf("%s: missing argument to option '%s'\n", arg0, *argv);
usage(EXIT_FAILURE);
case 'h':
usage(EXIT_SUCCESS);
case 'S':
startIocsh = 0;
break;
case 's':
//.........这里部分代码省略.........
示例14: exitNow
static void exitNow(void *junk)
{
epicsExit(exitLaterStatus);
}