diff --git a/MODULE b/MODULE deleted file mode 100644 index 4c35d3f..0000000 --- a/MODULE +++ /dev/null @@ -1,5 +0,0 @@ -# Please change the following email with yours. -Email: dirk.zimoch@psi.ch -Module-Name: misc -Description: Miscellaneous helper funtions for EPICS -Project-Name: diff --git a/Makefile b/Makefile index 1938dc9..8c107d6 100644 --- a/Makefile +++ b/Makefile @@ -1,36 +1,7 @@ include /ioc/tools/driver.makefile -# I need to find the Linux link.h before the EPICS link.h -USR_INCLUDES_Linux=-idirafter ${EPICS_BASE}/include -USR_INCLUDES+=$(USR_INCLUDES_$(OS_CLASS)) - -USR_CFLAGS=-DEPICS_RELEASE=$(EPICS_VERSION) -DT_A=$(T_A) - HEADERS += require.h BUILDCLASSES += Linux SOURCES += require.c DBDS += require.dbd - -SOURCES += listRecords.c -DBDS += listRecords.dbd - -SOURCES += updateMenuConvert.c -DBDS += updateMenuConvert.dbd - -SOURCES += addScan.c -DBDS += addScan.dbd - -SOURCES_3.14 += disctools.c -DBDS_3.14 += disctools.dbd - -SOURCES_3.14 += exec.c -DBDS_3.14 += exec.dbd - -SOURCES_3.14 += mlock.c -DBDS_3.14 += mlock.dbd - -SOURCES_vxWorks += bootNotify.c - -HEADERS_3.13 += epicsEndian.h -HEADERS_3.14.8 += epicsEndian.h diff --git a/README b/README index d4d81ab..c2ea383 100644 --- a/README +++ b/README @@ -1,37 +1,4 @@ -Functions in this library depend on EPICS but are not -real device drivers. It's a bunch of utilities. - -Functions are: - -require "" [,""] +require "" [,""] [,"macro1=value, macro2=value"] shell function load a library and its dbd file - -updateMenuConvert - startup script function - add all loaded breakpoint tables found on this ioc to menu convert - to be called before iocInit - -addScan rate - startup script function - create a new scan rate (seconds) and add it to menuScan - to be called before iocInit - -bootNotify - startup script function - call a script on the boot pc and tell it a lot of boot infos - -dir / ls / ll / mkdir / rmdir / rm / mv / umask / chmod - shell functions - make disc functions available in iocsh - not needed on vxWorks - -exec / ! - execute an externel command from iocsh - shell function - not available on vxWorks - -listRecords filename fields - shell function - wrapper for dbl to get same syntax in 3.13 and 3.14 - + executes its startup script if available, applying macros and environment diff --git a/addScan.c b/addScan.c deleted file mode 100644 index 1ee14b1..0000000 --- a/addScan.c +++ /dev/null @@ -1,103 +0,0 @@ -/* addScan.c -* -* add a new scan rate to the ioc -* -* $Author: zimoch $ -* -* $Source: /cvs/G/DRV/misc/addScan.c,v $ -* -*/ - -#include -#include -#include -#include -#include -#include -#ifdef BASE_VERSION -#define EPICS_3_13 -extern DBBASE *pdbbase; -#else -#define EPICS_3_14 -#include -#include -#endif - - -int addScan (char* ratestr) -{ - dbMenu *menuScan; - int l, i, j, nChoice; - char **papChoiceName; - char **papChoiceValue; - double rate, r; - char dummy; - char *name; - - if (interruptAccept) - { - fprintf(stderr, "addScan: Can add a scan period only before iocInit!\n"); - return -1; - } - if (!ratestr || sscanf (ratestr, "%lf%c", &rate, &dummy) != 1 || rate <= 0) - { - fprintf(stderr, "addScan: Argument '%s' must be a number > 0\n", ratestr); - return -1; - } - menuScan = dbFindMenu(pdbbase,"menuScan"); - nChoice = menuScan->nChoice; - for (i=SCAN_1ST_PERIODIC; i < nChoice; i++) - { - r = strtod(menuScan->papChoiceValue[i], NULL); - if (r == rate) - { - fprintf(stderr, "addScan: rate %s already available\n", menuScan->papChoiceValue[i]); - return 0; - } - if (r < rate) break; - } - papChoiceName=dbCalloc(nChoice+1,sizeof(char*)); - papChoiceValue=dbCalloc(nChoice+1,sizeof(char*)); - for (j=0; j < i; j++) - { - papChoiceName[j] = menuScan->papChoiceName[j]; - papChoiceValue[j] = menuScan->papChoiceValue[j]; - } - name = ratestr; - while (name[0]=='0') name++; - l = strlen(name); - papChoiceValue[i] = dbCalloc(l+16,1); - strcpy(papChoiceValue[i], name); - strcpy(papChoiceValue[i]+l, " second"); - for (j=i; j < nChoice; j++) - { - papChoiceName[j+1] = menuScan->papChoiceName[j]; - papChoiceValue[j+1] = menuScan->papChoiceValue[j]; - } - free(menuScan->papChoiceName); - free(menuScan->papChoiceValue); - menuScan->papChoiceName=papChoiceName; - menuScan->papChoiceValue=papChoiceValue; - menuScan->nChoice = nChoice+1; - return 0; -} - -#ifdef EPICS_3_14 -static const iocshArg addScanArg0 = { "rate", iocshArgString }; -static const iocshArg * const addScanArgs[1] = { &addScanArg0 }; -static const iocshFuncDef addScanDef = { "addScan", 1, addScanArgs }; -static void addScanFunc (const iocshArgBuf *args) -{ - addScan(args[0].sval); -} -static void addScanRegister(void) -{ - static int firstTime = 1; - if (firstTime) { - iocshRegister (&addScanDef, addScanFunc); - firstTime = 0; - } -} -epicsExportRegistrar(addScanRegister); -#endif - diff --git a/addScan.dbd b/addScan.dbd deleted file mode 100644 index 147c8b0..0000000 --- a/addScan.dbd +++ /dev/null @@ -1 +0,0 @@ -registrar(addScanRegister) diff --git a/bootNotify.c b/bootNotify.c deleted file mode 100644 index 19224df..0000000 --- a/bootNotify.c +++ /dev/null @@ -1,67 +0,0 @@ -/* bootNotify.c -* -* call a script on the boot PC and give it a lot of boot infos -* -* $Author: zimoch $ -* -* $Log: bootNotify.c,v $ -* Revision 1.4 2013/08/15 09:50:07 zimoch -* strip off leading strings from vxWorksVersion -* -* Revision 1.3 2006/03/03 13:30:33 zimoch -* made epicsver compatible to 3.14 -* -* Revision 1.2 2004/05/24 15:18:58 zimoch -* use ifName() -* -* Revision 1.1 2004/04/16 08:07:12 zimoch -* put here from utilities -* these are EPICS dependend, utilities not -* -* Revision 1.4 2004/04/02 14:52:15 zimoch -* generic ethernet address support added -* -* Revision 1.3 2003/03/20 14:57:50 zimoch -* upload of ethernet address added -* -* Revision 1.2 2003/03/18 08:03:28 zimoch -* debugged -* -* Revision 1.1 2003/02/18 17:26:59 zimoch -* split bootUntil.c into 3 parts -* -* -*/ -#include -#include -#include -#include -#include - -int bootNotify (char* script, char* script2) -{ - char command[256]; - char epicsver[15]; - char* vxver = vxWorksVersion; - - if (script == NULL) - { - printErr ("usage: bootNotify [\"\",] \"