From 8764c9971cf527f1533a14338c4ac81441ab4404 Mon Sep 17 00:00:00 2001 From: zimoch Date: Tue, 9 Jan 2007 09:33:40 +0000 Subject: [PATCH] function (and file) renamed, usage message added --- dumpRecords.c => listRecords.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) rename dumpRecords.c => listRecords.c (69%) diff --git a/dumpRecords.c b/listRecords.c similarity index 69% rename from dumpRecords.c rename to listRecords.c index a043c23..44b4550 100644 --- a/dumpRecords.c +++ b/listRecords.c @@ -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 #include #include +#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 +}