/* Example showing how to register a new command with iocsh */ #include #include #include /* This is the command, which the vxWorks shell will call directly */ void start(const char *name) { if (name) { printf("Start %s bld\n", name); } else { puts("Start bld"); } } /* Information needed by iocsh */ static const iocshArg startArg0 = {"name", iocshArgString}; static const iocshArg *startArgs[] = {&startArg0}; static const iocshFuncDef startFuncDef = {"start", 1, startArgs}; /* Wrapper called by iocsh, selects the argument types that start needs */ static void startCallFunc(const iocshArgBuf *args) { start(args[0].sval); } /* Registration routine, runs at startup */ static void startRegister(void) { iocshRegister(&startFuncDef, startCallFunc); } epicsExportRegistrar(startRegister);