Compare commits

...

6 Commits

7 changed files with 30 additions and 19 deletions

View File

@ -44,7 +44,7 @@ ifneq (${EPICS_BASETYPE},3.13)
RECORDTYPES += calcout RECORDTYPES += calcout
endif endif
StreamCore.o: streamReferences StreamCore.o StreamCore.d: streamReferences
streamReferences: streamReferences:
perl ../src/makeref.pl Interface $(BUSSES) > $@ perl ../src/makeref.pl Interface $(BUSSES) > $@

View File

@ -562,13 +562,7 @@ connectToAsynPort()
clientName(), connected ? "already" : "not yet"); clientName(), connected ? "already" : "not yet");
if (!connected) if (!connected)
{ {
printf ("%s: AsynDriverInterface::connectToAsynPort: "
"pasynCommon->connect(%p, %p)\n",
clientName(), pvtCommon, pasynUser);
status = pasynCommon->connect(pvtCommon, pasynUser); status = pasynCommon->connect(pvtCommon, pasynUser);
printf ("%s: AsynDriverInterface::connectToAsynPort: "
"pasynCommon->connect(%p, %p) = %s\n",
clientName(), pvtCommon, pasynUser, asynStatusStr[status]);
debug("AsynDriverInterface::connectToAsynPort(%s): " debug("AsynDriverInterface::connectToAsynPort(%s): "
"status=%s\n", "status=%s\n",
clientName(), asynStatusStr[status]); clientName(), asynStatusStr[status]);

View File

@ -223,7 +223,7 @@ static void regsubst(const StreamFormat& fmt, StreamBuffer& buffer, long start)
} }
buffer.replace(start+c+ovector[0], l, s); buffer.replace(start+c+ovector[0], l, s);
length += s.length() - l; length += s.length() - l;
c += s.length(); c += ovector[0] + s.length();
if (n == fmt.prec) // max match reached if (n == fmt.prec) // max match reached
return; return;
} }

View File

@ -196,8 +196,12 @@ extern "C" long streamReload(char* recordname)
dbCommon* record; dbCommon* record;
long status; long status;
int oldStreamError = streamError;
streamError = 1;
if(!pdbbase) { if(!pdbbase) {
error("No database has been loaded\n"); error("No database has been loaded\n");
streamError = oldStreamError;
return ERROR; return ERROR;
} }
debug("streamReload(%s)\n", recordname); debug("streamReload(%s)\n", recordname);
@ -234,6 +238,7 @@ extern "C" long streamReload(char* recordname)
} }
dbFinishEntry(&dbentry); dbFinishEntry(&dbentry);
StreamProtocolParser::free(); StreamProtocolParser::free();
streamError = oldStreamError;
return OK; return OK;
} }
@ -408,6 +413,7 @@ long streamInit(int after)
{ {
if (after) if (after)
{ {
streamError = 0; // Switch off errors after init in order not to spam messages when a device is down.
StreamProtocolParser::free(); StreamProtocolParser::free();
} }
return OK; return OK;

View File

@ -23,7 +23,7 @@
#include <stdio.h> #include <stdio.h>
int streamDebug = 0; int streamDebug = 0;
int streamError = 0; int streamError = 1;
extern "C" { extern "C" {
#ifdef _WIN32 #ifdef _WIN32
__declspec(dllexport) __declspec(dllexport)

View File

@ -512,7 +512,16 @@ Each time newline is read, line is incremented.
buffer(token)); buffer(token));
return false; return false;
} }
if (c == '$' && buffer[-1] == '\\') buffer.append(c);
if (c == quote)
{
quote = false;
break;
}
if (c == '\\')
{
c = getc(file);
if (c == '$')
{ {
// quoted variable reference // quoted variable reference
// terminate string here and do variable in next pass // terminate string here and do variable in next pass
@ -520,11 +529,13 @@ Each time newline is read, line is incremented.
ungetc(c, file); ungetc(c, file);
break; break;
} }
buffer.append(c); if (c == EOF || c == '\n')
if (c == quote && buffer[-2] != '\\')
{ {
quote = false; error(line, filename(), "Backslash at end of line: %s\n",
break; buffer(token));
return false;
}
buffer.append(c);
} }
c = getc(file); c = getc(file);
} }

View File

@ -23,7 +23,7 @@
#define STREAM_MAJOR 2 #define STREAM_MAJOR 2
#define STREAM_MINOR 7 #define STREAM_MINOR 7
#define STREAM_PATCHLEVEL 10 #define STREAM_PATCHLEVEL 12
#if defined(__vxworks) || defined(vxWorks) #if defined(__vxworks) || defined(vxWorks)
#include <vxWorks.h> #include <vxWorks.h>