function (and file) renamed, usage message added

This commit is contained in:
zimoch
2007-01-09 09:33:40 +00:00
parent 122f7680ec
commit 8764c9971c
+18 -11
View File
@@ -1,4 +1,4 @@
/* dumpRecords is a wrapper function for dbl
/* listRecords is a wrapper function for dbl
it is required because of the changed syntax of dbl in R3.14.
*/
@@ -8,23 +8,32 @@
#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>
#endif
int dumpRecords(char* file, char* fields)
int listRecords(char* file, char* fields)
{
#ifndef BASE_VERSION
/* This is R3.14 */
FILE* oldStdout;
FILE* newStdout;
#endif
if (!file)
{
printf ("usage: listRecords \"filename\", \"field, field, ...\"\n");
return -1;
}
#ifdef BASE_VERSION
/* This is R3.13 */
return dbl(0L, file, fields);
#else
/* This is R3.14 */
newStdout = fopen(file, "w");
if (!newStdout)
{
@@ -38,6 +47,4 @@ int dumpRecords(char* file, char* fields)
fclose(newStdout);
epicsSetThreadStdout(oldStdout);
return OK;
}
#endif
}