+= epicsStdio for HPUX
This commit is contained in:
@@ -225,6 +225,9 @@ INC_vxWorks += iocClock.h
|
||||
SRCS_vxWorks += iocClock.c
|
||||
SRCS_vxWorks += epicsStdio.c
|
||||
|
||||
# For hpux only the Stdio stuff
|
||||
SRCS_hpux += epicsStdio.c
|
||||
|
||||
# Library to build:
|
||||
# lib$(LIBRARY).a or ..dll/..exp/..lib
|
||||
#
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/* epicsStdio.c */
|
||||
/*************************************************************************\
|
||||
* 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.
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "epicsStdio.h"
|
||||
|
||||
int epicsVsnprintf (
|
||||
char * str, size_t size, const char *format, va_list ap )
|
||||
{
|
||||
int rtn;
|
||||
|
||||
rtn = vsnprintf ( str, size, format, ap );
|
||||
if ( rtn >= 0 ) {
|
||||
size_t sizeReturned = (size_t) rtn;
|
||||
if ( sizeReturned < size ) {
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
if ( rtn == -1 ) {
|
||||
str[size-1] = 0;
|
||||
return (int) size;
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
int epicsSnprintf (
|
||||
char *str, size_t size, const char *pFormat, ... )
|
||||
{
|
||||
int rtn;
|
||||
va_list pvar;
|
||||
|
||||
va_start ( pvar, pFormat );
|
||||
rtn = epicsVsnprintf ( str, size, pFormat, pvar );
|
||||
va_end ( pvar );
|
||||
return ( rtn );
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,28 @@
|
||||
/* epicsStdio.h */
|
||||
/*************************************************************************\
|
||||
* 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.
|
||||
\*************************************************************************/
|
||||
#ifndef epicsStdioh
|
||||
#define epicsStdioh
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int epicsSnprintf ( char *str, size_t size, const char *format, ...);
|
||||
int epicsVsnprintf ( char *str, size_t size, const char *format, va_list ap);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* epicsStdioh */
|
||||
Reference in New Issue
Block a user