split epicsStdio into common and osdStdio portions

This commit is contained in:
Marty Kraimer
2004-07-07 16:03:51 +00:00
parent ce1be263d5
commit f212fae267
7 changed files with 32 additions and 27 deletions
+1
View File
@@ -190,6 +190,7 @@ SRCS += osdEnv.c
SRCS += epicsReadline.c
SRCS += epicsTempFile.cpp
SRCS += epicsStdio.c
SRCS += osdStdio.c
osdEnv_CFLAGS_WIN32= -U__STDC__
+22
View File
@@ -0,0 +1,22 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*epicsStdio.c*/
/*Author: Marty Kraimer*/
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#define epicsExportSharedSymbols
#include "epicsStdio.h"
/* Currently this file has nothing*/
+2 -1
View File
@@ -26,9 +26,10 @@ epicsShareFunc int epicsShareAPI epicsSnprintf(
epicsShareFunc int epicsShareAPI epicsVsnprintf(
char *str, size_t size, const char *format, va_list ap);
epicsShareFunc void epicsShareAPI epicsTempName (
char * pNameBuf, size_t nameBufLength );
char * pNameBuf, size_t nameBufLength );
epicsShareFunc FILE * epicsShareAPI epicsTempFile ();
/*
* truncate to specified size (we dont use truncate()
* because it is not portable)
@@ -1,4 +1,4 @@
/* epicsStdio.c */
/* osdStdio.c */
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
@@ -15,10 +15,6 @@
#define epicsExportSharedSymbols
#include "epicsStdio.h"
#ifdef __cplusplus
extern "C" {
#endif
int epicsShareAPI epicsVsnprintf (
char * str, size_t size, const char *format, va_list ap )
{
@@ -49,7 +45,3 @@ int epicsShareAPI epicsSnprintf (
va_end ( pvar );
return ( rtn );
}
#ifdef __cplusplus
}
#endif
@@ -1,4 +1,4 @@
/* epicsStdio.c */
/* osdStdio.c */
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
@@ -12,10 +12,7 @@
#include <stdio.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
#define epicsExportSharedSymbols
#include "epicsStdio.h"
int epicsVsnprintf (
@@ -48,7 +45,3 @@ int epicsSnprintf (
va_end ( pvar );
return ( rtn );
}
#ifdef __cplusplus
}
#endif
@@ -8,11 +8,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include <epicsStdio.h>
#include <osiUnistd.h>
#define epicsExportSharedSymbols
#include <epicsStdio.h>
extern "C" {
epicsShareFunc int epicsShareAPI epicsSnprintf(
char *str, size_t size, const char *format, ...)
{
@@ -30,7 +29,3 @@ epicsShareFunc int epicsShareAPI epicsVsnprintf(
{
return vsnprintf ( str, size, format, ap );
}
}
@@ -1,4 +1,4 @@
/* epicsStdio.c */
/* osdStdio.c */
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
@@ -23,6 +23,7 @@ static STATUS outRoutine(char *buffer, int nchars, int outarg) {
struct outStr_s *poutStr = (struct outStr_s *) outarg;
int len = min(poutStr->free, nchars);
if(len<=0) return ERROR;
strncat(poutStr->str, buffer, len);
poutStr->free -= nchars;