Skip to content
Snippets Groups Projects
Commit 5caaf707 authored by benjamin.franksen's avatar benjamin.franksen
Browse files

no actual change, just minor formatting

parent 3996f330
No related branches found
No related tags found
No related merge requests found
...@@ -33,11 +33,11 @@ static struct sequencerProgram *seqHead; ...@@ -33,11 +33,11 @@ static struct sequencerProgram *seqHead;
* This routine is called before multitasking has started, so there's * This routine is called before multitasking has started, so there's
* no race condition in creating the linked list. * no race condition in creating the linked list.
*/ */
epicsShareFunc void epicsShareAPI seqRegisterSequencerProgram (struct seqProgram *p) epicsShareFunc void epicsShareAPI seqRegisterSequencerProgram(struct seqProgram *p)
{ {
struct sequencerProgram *sp; struct sequencerProgram *sp;
sp = (struct sequencerProgram *)mallocMustSucceed (sizeof *sp, "seqRegisterSequencerProgram"); sp = (struct sequencerProgram *)mallocMustSucceed(sizeof *sp, "seqRegisterSequencerProgram");
sp->prog = p; sp->prog = p;
sp->next = seqHead; sp->next = seqHead;
seqHead = sp; seqHead = sp;
...@@ -46,19 +46,18 @@ epicsShareFunc void epicsShareAPI seqRegisterSequencerProgram (struct seqProgram ...@@ -46,19 +46,18 @@ epicsShareFunc void epicsShareAPI seqRegisterSequencerProgram (struct seqProgram
/* /*
* Find a thread by name or ID number * Find a thread by name or ID number
*/ */
static epicsThreadId static epicsThreadId findThread(const char *name)
findThread (const char *name)
{ {
epicsThreadId id; epicsThreadId id;
char *term; char *term;
id = (epicsThreadId)strtoul (name, &term, 16); id = (epicsThreadId)strtoul(name, &term, 16);
if ((term != name) && (*term == '\0')) if ((term != name) && (*term == '\0'))
return id; return id;
id = epicsThreadGetId (name); id = epicsThreadGetId(name);
if (id) if (id)
return id; return id;
printf ("No such thread.\n"); printf("No such thread.\n");
return NULL; return NULL;
} }
...@@ -76,18 +75,18 @@ static void seqCallFunc(const iocshArgBuf *args) ...@@ -76,18 +75,18 @@ static void seqCallFunc(const iocshArgBuf *args)
struct sequencerProgram *sp; struct sequencerProgram *sp;
if (!table) { if (!table) {
printf ("No sequencer specified.\n"); printf("No sequencer specified.\n");
return; return;
} }
if (*table == '&') if (*table == '&')
table++; table++;
for (sp = seqHead ; sp != NULL ; sp = sp->next) { for (sp = seqHead ; sp != NULL ; sp = sp->next) {
if (!strcmp (table, sp->prog->pProgName)) { if (!strcmp(table, sp->prog->pProgName)) {
seq (sp->prog, macroDef, stackSize); seq(sp->prog, macroDef, stackSize);
return; return;
} }
} }
printf ("Can't find sequencer `%s'.\n", table); printf("Can't find sequencer `%s'.\n", table);
} }
/* seqShow */ /* seqShow */
...@@ -100,9 +99,9 @@ static void seqShowCallFunc(const iocshArgBuf *args) ...@@ -100,9 +99,9 @@ static void seqShowCallFunc(const iocshArgBuf *args)
char *name = args[0].sval; char *name = args[0].sval;
if (name == NULL) if (name == NULL)
seqShow (NULL); seqShow(NULL);
else if ((id = findThread (name)) != NULL) else if ((id = findThread(name)) != NULL)
seqShow (id); seqShow(id);
} }
/* seqQueueShow */ /* seqQueueShow */
...@@ -114,8 +113,8 @@ static void seqQueueShowCallFunc(const iocshArgBuf *args) ...@@ -114,8 +113,8 @@ static void seqQueueShowCallFunc(const iocshArgBuf *args)
epicsThreadId id; epicsThreadId id;
char *name = args[0].sval; char *name = args[0].sval;
if ((name != NULL) && ((id = findThread (name)) != NULL)) if ((name != NULL) && ((id = findThread(name)) != NULL))
seqQueueShow (id); seqQueueShow(id);
} }
/* seqStop */ /* seqStop */
...@@ -127,8 +126,8 @@ static void seqStopCallFunc(const iocshArgBuf *args) ...@@ -127,8 +126,8 @@ static void seqStopCallFunc(const iocshArgBuf *args)
epicsThreadId id; epicsThreadId id;
char *name = args[0].sval; char *name = args[0].sval;
if ((name != NULL) && ((id = findThread (name)) != NULL)) if ((name != NULL) && ((id = findThread(name)) != NULL))
seqStop (id); seqStop(id);
} }
/* seqChanShow */ /* seqChanShow */
...@@ -142,8 +141,8 @@ static void seqChanShowCallFunc(const iocshArgBuf *args) ...@@ -142,8 +141,8 @@ static void seqChanShowCallFunc(const iocshArgBuf *args)
char *name = args[0].sval; char *name = args[0].sval;
char *chan = args[1].sval; char *chan = args[1].sval;
if ((name != NULL) && ((id = findThread (name)) != NULL)) if ((name != NULL) && ((id = findThread(name)) != NULL))
seqChanShow (id, chan); seqChanShow(id, chan);
} }
/* seqcar */ /* seqcar */
...@@ -152,14 +151,14 @@ static const iocshArg * const seqcarArgs[1] = {&seqcarArg0}; ...@@ -152,14 +151,14 @@ static const iocshArg * const seqcarArgs[1] = {&seqcarArg0};
static const iocshFuncDef seqcarFuncDef = {"seqcar",1,seqcarArgs}; static const iocshFuncDef seqcarFuncDef = {"seqcar",1,seqcarArgs};
static void seqcarCallFunc(const iocshArgBuf *args) static void seqcarCallFunc(const iocshArgBuf *args)
{ {
seqcar (args[0].ival); seqcar(args[0].ival);
} }
/* /*
* This routine is called before multitasking has started, so there's * This routine is called before multitasking has started, so there's
* no race condition in the test/set of firstTime. * no race condition in the test/set of firstTime.
*/ */
epicsShareFunc void epicsShareAPI seqRegisterSequencerCommands (void) epicsShareFunc void epicsShareAPI seqRegisterSequencerCommands(void)
{ {
static int firstTime = 1; static int firstTime = 1;
if (firstTime) { if (firstTime) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment