Merge Dirk's FixShellCommands branch into 7.0
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user