printf always becomes epicsStdoutPrintf

This commit is contained in:
Marty Kraimer
2004-07-09 13:35:12 +00:00
parent 94e70da4ef
commit 23d4d7f790

View File

@@ -29,6 +29,21 @@ epicsShareFunc void epicsShareAPI epicsTempName (
char * pNameBuf, size_t nameBufLength );
epicsShareFunc FILE * epicsShareAPI epicsTempFile ();
/*
* truncate to specified size (we dont use truncate()
* because it is not portable)
*
* pFileName - name (and optionally path) of file
* size - the new file size (if file is curretly larger)
*
* returns TF_OK if the file is less than size bytes
* or if it was successfully truncated. Returns
* TF_ERROR if the file could not be truncated.
*/
enum TF_RETURN {TF_OK=0, TF_ERROR=1};
epicsShareFunc enum TF_RETURN epicsShareAPI truncateFile ( const char *pFileName, unsigned size );
/*The followig are for redirecting stdin,stdout,stderr */
epicsShareFunc FILE * epicsShareAPI epicsGetStdin(void);
epicsShareFunc FILE * epicsShareAPI epicsGetStdout(void);
epicsShareFunc FILE * epicsShareAPI epicsGetStderr(void);
@@ -47,34 +62,20 @@ epicsShareFunc int epicsShareAPI epicsStdoutPrintf(
#undef stderr
#define stderr epicsGetStderr()
/*The following are for making printf be fprintf(stdout */
#ifdef printf
#undef printf
#endif
#endif /*printf*/
#if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L
#define printf(...) fprintf(stdout,__VAR_ARGS__)
#define printf(...) epicsStdoutPrintf(...)
#elif defined(__GNUC__)
#define printf(format...) fprintf(stdout,format)
#define printf(format...) epicsStdoutPrintf(format)
#else
#define printf epicsStdoutPrintf
#endif
#endif /* defined(__STDC_VERSION__) && __STDC_VERSION__>=199901_*/
#endif /* epicsStdioPVT */
/*
* truncate to specified size (we dont use truncate()
* because it is not portable)
*
* pFileName - name (and optionally path) of file
* size - the new file size (if file is curretly larger)
*
* returns TF_OK if the file is less than size bytes
* or if it was successfully truncated. Returns
* TF_ERROR if the file could not be truncated.
*/
enum TF_RETURN {TF_OK=0, TF_ERROR=1};
epicsShareFunc enum TF_RETURN epicsShareAPI truncateFile ( const char *pFileName, unsigned size );
#ifdef __cplusplus
}
#endif