Merge Dirk's FixShellCommands branch into 7.0

This commit is contained in:
Andrew Johnson
2018-10-30 09:51:02 -05:00
12 changed files with 96 additions and 15 deletions
+10 -1
View File
@@ -755,13 +755,22 @@ long dbBufferSize(short dbr_type, long options, long no_elements)
}
int dbLoadDatabase(const char *file, const char *path, const char *subs)
{
if (!file) {
printf("Usage: dbLoadDatabase \"file\", \"path\", \"subs\"\n");
return -1;
}
return dbReadDatabase(&pdbbase, file, path, subs);
}
int dbLoadRecords(const char* file, const char* subs)
{
int status = dbReadDatabase(&pdbbase, file, 0, subs);
int status;
if (!file) {
printf("Usage: dbLoadRecords \"file\", \"subs\"\n");
return -1;
}
status = dbReadDatabase(&pdbbase, file, 0, subs);
if (!status && dbLoadRecordsHook)
dbLoadRecordsHook(file, subs);
return status;
+12
View File
@@ -283,6 +283,10 @@ long dbb(const char *record_name)
/*
* Convert name to address
*/
if (!record_name) {
printf("Usage: dbb \"record_name\"\n");
return -1;
}
status = dbNameToAddr(record_name, &addr);
if (status == S_db_notFound)
printf(" BKPT> Record %s not found\n", record_name);
@@ -403,6 +407,10 @@ long dbd(const char *record_name)
/*
* Convert name to address
*/
if (!record_name) {
printf("Usage: dbd \"record_name\"\n");
return -1;
}
status = dbNameToAddr(record_name, &addr);
if (status == S_db_notFound)
printf(" BKPT> Record %s not found\n", record_name);
@@ -846,6 +854,10 @@ long dbap(const char *record_name)
/*
* Convert name to address
*/
if (!record_name) {
printf("Usage: dbap \"record_name\"\n");
return -1;
}
status = dbNameToAddr(record_name, &addr);
if (status == S_db_notFound)
printf(" BKPT> Record %s not found\n", record_name);
+5 -1
View File
@@ -596,9 +596,13 @@ long dbtpn(char *pname, char *pvalue)
tpnInfo *ptpnInfo;
processNotify *ppn=NULL;
if (!pname) {
printf("Usage: dbtpn \"name\", \"value\"\n");
return -1;
}
chan = dbChannelCreate(pname);
if (!chan) {
printf("dbtpn: No such channel");
printf("dbtpn: No such channel\n");
return -1;
}
+6
View File
@@ -37,6 +37,9 @@ dbStateId dbStateFind(const char *name)
ELLNODE *node;
dbStateId id;
if (!name)
return NULL;
for (node = ellFirst(&states); node; node = ellNext(node)) {
id = CONTAINER(node, dbState, node);
if (strcmp(id->name, name) == 0)
@@ -49,6 +52,9 @@ dbStateId dbStateCreate(const char *name)
{
dbStateId id;
if (!name)
return NULL;
if ((id = dbStateFind(name)))
return id;
+12
View File
@@ -40,6 +40,10 @@ int gft(const char *pname)
short type;
int i;
if (!pname) {
printf("Usage: gft \"pv_name\"\n");
return -1;
}
chan = dbChannel_create(pname);
if (!chan) {
printf("Channel couldn't be created\n");
@@ -94,6 +98,10 @@ int pft(const char *pname, const char *pvalue)
unsigned char charvalue;
double doublevalue;
if (!pname || !pvalue) {
printf("Usage: pft \"pv_name\", \"value\"\n");
return -1;
}
chan = dbChannel_create(pname);
if (!chan) {
printf("Channel couldn't be created\n");
@@ -223,6 +231,10 @@ int tpn(const char *pname, const char *pvalue)
tpnInfo *ptpnInfo;
processNotify *ppn = NULL;
if (!pname || !pvalue) {
printf("Usage: tpn \"pv_name\", \"value\"\n");
return -1;
}
chan = dbChannel_create(pname);
if (!chan) {
printf("Channel couldn't be created\n");
+8 -3
View File
@@ -9,14 +9,19 @@
#include "iocsh.h"
#include "epicsExport.h"
IOCSH_STATIC_FUNC void dlload(const char* name)
{
if (!epicsLoadLibrary(name)) {
printf("epicsLoadLibrary failed: %s\n", epicsLoadError());
}
}
static const iocshArg dlloadArg0 = { "path/library.so", iocshArgString};
static const iocshArg * const dlloadArgs[] = {&dlloadArg0};
static const iocshFuncDef dlloadFuncDef = {"dlload", 1, dlloadArgs};
static void dlloadCallFunc(const iocshArgBuf *args)
{
if (!epicsLoadLibrary(args[0].sval)) {
printf("epicsLoadLibrary failed: %s\n", epicsLoadError());
}
dlload(args[0].sval);
}
static void dlloadRegistar(void) {