Skip to content
Snippets Groups Projects
Commit 5a4e7dd5 authored by zimoch's avatar zimoch
Browse files

wrapper for dbl to file

parent 383848f0
No related branches found
No related tags found
1 merge request!7Submodule merge
/* dumpRecords is a wrapper function for dbl
it is required because of the changed syntax of dbl in R3.14.
*/
#include <epicsVersion.h>
#include <stddef.h>
#ifdef BASE_VERSION
/* This is R3.13 */
long dbl(char *precordTypename, char *filename, char *fields);
int dumpRecords(char* file, char* fields)
{
return dbl(0L, file, fields);
}
#else
/* This is R3.14 */
#include <string.h>
#include <dbTest.h>
#include <epicsStdio.h>
int dumpRecords(char* file, char* fields)
{
FILE* oldStdout;
FILE* newStdout;
newStdout = fopen(file, "w");
if (!newStdout)
{
fprintf (stderr, "Can't open %s for writing: %s\n",
file, strerror(errno));
return errno;
}
oldStdout = epicsGetThreadStdout();
epicsSetThreadStdout(newStdout);
dbl(0L, fields);
fclose(newStdout);
epicsSetThreadStdout(oldStdout);
return OK;
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment