bucketLib.c - added LOCAL as required
ellLib.c - added missing stdio.h envSubr.c - use getenv/putenv under vxWorks errSymLib.c - call mprintf() and not printf or logMsg() (eliminated errToLogMsg variable) genSubr.c - silenced DEC CC warning tsSubr.c - fixed ts min west out of range test & VMS changes
This commit is contained in:
@@ -12,7 +12,7 @@ SRCS.c = \
|
||||
../genTaskSubr.c ../gpHashLib.c ../helpSubr.c ../memDebugLib.c \
|
||||
../nextFieldSubr.c ../postfix.c ../sydSubr.c ../sydSubrCA.c \
|
||||
../sydSubrCF.c ../sydSubrSSF.c ../tsSubr.c errSymTbl.c ../errInc.c \
|
||||
../realpath.c
|
||||
../realpath.c ../mprintf.c
|
||||
|
||||
LIBOBJS = \
|
||||
tsSubr.o arAccessLib.o arCSCheck.o arChanIO.o bfSubr.o bucketLib.o \
|
||||
@@ -20,7 +20,7 @@ LIBOBJS = \
|
||||
envSubr.o errMtst.o errSymLib.o errSymTbl.o ezsSockSubr.o fdmgr.o \
|
||||
freeListLib.o genSubr.o genTaskSubr.o gpHashLib.o helpSubr.o \
|
||||
memDebugLib.o nextFieldSubr.o postfix.o sydSubr.o sydSubrCA.o \
|
||||
sydSubrCF.o sydSubrSSF.o realpath.o
|
||||
sydSubrCF.o sydSubrSSF.o realpath.o mprintf.o
|
||||
|
||||
LIBNAME = libCom.a
|
||||
|
||||
|
||||
@@ -9,13 +9,14 @@ SRCS.c = \
|
||||
../genTaskSubr.c ../helpSubr.c ../nextFieldSubr.c ../postfix.c \
|
||||
../sydSubr.c ../sydSubrCA.c ../sydSubrCF.c ../sydSubrSSF.c \
|
||||
../bucketLib.c ../memDebugLib.c ../tsSubr.c ../pal.c \
|
||||
../paldef.c errSymTbl.c
|
||||
../paldef.c ../mprintf.c errSymTbl.c
|
||||
|
||||
|
||||
OBJS = \
|
||||
calcPerform.o cvtBpt.o cvtFast.o ellLib.o envSubr.o errSymLib.o \
|
||||
errSymTbl.o genSubr.o genTaskSubr.o nextFieldSubr.o postfix.o \
|
||||
bucketLib.o tsSubr.o gpHashLib.o freeListLib.o pal.o paldef.o
|
||||
bucketLib.o tsSubr.o gpHashLib.o freeListLib.o pal.o paldef.o \
|
||||
mprintf.o
|
||||
|
||||
OBJS1 = \
|
||||
cmdSubr.o cvtNumbers.o cvtFast.o ezsSockSubr.o helpSubr.o
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -196,7 +197,7 @@ LOCAL ITEM **bucketUnsignedCompare (ITEM **ppi, const void *pId)
|
||||
/*
|
||||
* bucketPointerCompare()
|
||||
*/
|
||||
ITEM **bucketPointerCompare (ITEM **ppi, const void *pId)
|
||||
LOCAL ITEM **bucketPointerCompare (ITEM **ppi, const void *pId)
|
||||
{
|
||||
void *ptr;
|
||||
void **pItemId;
|
||||
@@ -219,7 +220,7 @@ ITEM **bucketPointerCompare (ITEM **ppi, const void *pId)
|
||||
/*
|
||||
* bucketStringCompare ()
|
||||
*/
|
||||
ITEM **bucketStringCompare (ITEM **ppi, const void *pId)
|
||||
LOCAL ITEM **bucketStringCompare (ITEM **ppi, const void *pId)
|
||||
{
|
||||
const char *pStr = pId;
|
||||
ITEM *pi;
|
||||
@@ -241,7 +242,7 @@ ITEM **bucketStringCompare (ITEM **ppi, const void *pId)
|
||||
/*
|
||||
* bucketUnsignedHash ()
|
||||
*/
|
||||
BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId)
|
||||
LOCAL BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId)
|
||||
{
|
||||
const unsigned *pUId = pId;
|
||||
unsigned src;
|
||||
@@ -262,11 +263,10 @@ BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId)
|
||||
|
||||
/*
|
||||
* bucketPointerHash ()
|
||||
*
|
||||
*/
|
||||
BUCKETID bucketPointerHash (BUCKET *pb, const void *pId)
|
||||
LOCAL BUCKETID bucketPointerHash (BUCKET *pb, const void *pId)
|
||||
{
|
||||
void * const *ppId = pId;
|
||||
void * const *ppId = (void * const *) pId;
|
||||
unsigned long src;
|
||||
BUCKETID hashid;
|
||||
|
||||
@@ -292,7 +292,7 @@ BUCKETID bucketPointerHash (BUCKET *pb, const void *pId)
|
||||
/*
|
||||
* bucketStringHash ()
|
||||
*/
|
||||
BUCKETID bucketStringHash (BUCKET *pb, const void *pId)
|
||||
LOCAL BUCKETID bucketStringHash (BUCKET *pb, const void *pId)
|
||||
{
|
||||
const char *pStr = pId;
|
||||
BUCKETID hashid;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -196,7 +197,7 @@ LOCAL ITEM **bucketUnsignedCompare (ITEM **ppi, const void *pId)
|
||||
/*
|
||||
* bucketPointerCompare()
|
||||
*/
|
||||
ITEM **bucketPointerCompare (ITEM **ppi, const void *pId)
|
||||
LOCAL ITEM **bucketPointerCompare (ITEM **ppi, const void *pId)
|
||||
{
|
||||
void *ptr;
|
||||
void **pItemId;
|
||||
@@ -219,7 +220,7 @@ ITEM **bucketPointerCompare (ITEM **ppi, const void *pId)
|
||||
/*
|
||||
* bucketStringCompare ()
|
||||
*/
|
||||
ITEM **bucketStringCompare (ITEM **ppi, const void *pId)
|
||||
LOCAL ITEM **bucketStringCompare (ITEM **ppi, const void *pId)
|
||||
{
|
||||
const char *pStr = pId;
|
||||
ITEM *pi;
|
||||
@@ -241,7 +242,7 @@ ITEM **bucketStringCompare (ITEM **ppi, const void *pId)
|
||||
/*
|
||||
* bucketUnsignedHash ()
|
||||
*/
|
||||
BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId)
|
||||
LOCAL BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId)
|
||||
{
|
||||
const unsigned *pUId = pId;
|
||||
unsigned src;
|
||||
@@ -262,11 +263,10 @@ BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId)
|
||||
|
||||
/*
|
||||
* bucketPointerHash ()
|
||||
*
|
||||
*/
|
||||
BUCKETID bucketPointerHash (BUCKET *pb, const void *pId)
|
||||
LOCAL BUCKETID bucketPointerHash (BUCKET *pb, const void *pId)
|
||||
{
|
||||
void * const *ppId = pId;
|
||||
void * const *ppId = (void * const *) pId;
|
||||
unsigned long src;
|
||||
BUCKETID hashid;
|
||||
|
||||
@@ -292,7 +292,7 @@ BUCKETID bucketPointerHash (BUCKET *pb, const void *pId)
|
||||
/*
|
||||
* bucketStringHash ()
|
||||
*/
|
||||
BUCKETID bucketStringHash (BUCKET *pb, const void *pId)
|
||||
LOCAL BUCKETID bucketStringHash (BUCKET *pb, const void *pId)
|
||||
{
|
||||
const char *pStr = pId;
|
||||
BUCKETID hashid;
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
/* #define DEBUG_DRIVER */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <ellLib.h>
|
||||
|
||||
#if !defined(NULL)
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
/* #define DEBUG_DRIVER */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <ellLib.h>
|
||||
|
||||
#if !defined(NULL)
|
||||
|
||||
91
src/libCom/env/envSubr.c
vendored
91
src/libCom/env/envSubr.c
vendored
@@ -28,6 +28,8 @@
|
||||
* .01 07-20-91 rac initial version
|
||||
* .02 08-07-91 joh added config get for long and double C types
|
||||
* .03 08-07-91 joh added config get for struct in_addr type
|
||||
* .04 01-11-95 joh use getenv()/putenv() to fetch/write env
|
||||
* vars under vxWorks
|
||||
*
|
||||
* make options
|
||||
* -DvxWorks makes a version for VxWorks
|
||||
@@ -60,20 +62,21 @@
|
||||
*
|
||||
*-***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifdef vxWorks
|
||||
# include <vxWorks.h>
|
||||
# include <stdioLib.h>
|
||||
# include <in.h>
|
||||
# include <types.h>
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <sys/types.h>
|
||||
# include <netinet/in.h>
|
||||
#include <inetLib.h>
|
||||
#include <envLib.h>
|
||||
#include <errnoLib.h>
|
||||
#endif
|
||||
|
||||
#define ENV_PRIVATE_DATA
|
||||
#include <envDefs.h>
|
||||
#include <errMdef.h>
|
||||
#include <epicsEnvParams.h>
|
||||
|
||||
|
||||
@@ -122,11 +125,8 @@ char *pBuf; /* I pointer to parameter buffer */
|
||||
char *pEnv; /* pointer to environment string */
|
||||
long i;
|
||||
|
||||
#ifndef vxWorks
|
||||
pEnv = getenv(pParam->name);
|
||||
#else
|
||||
pEnv = NULL;
|
||||
#endif
|
||||
|
||||
if (pEnv == NULL)
|
||||
pEnv = pParam->dflt;
|
||||
if (strlen(pEnv) <= 0)
|
||||
@@ -363,26 +363,64 @@ ENV_PARAM *pParam; /* I pointer to config param structure */
|
||||
*
|
||||
*-*/
|
||||
long
|
||||
envSetConfigParam(pParam, value)
|
||||
ENV_PARAM *pParam; /* I pointer to config param structure */
|
||||
char *value; /* I pointer to value string */
|
||||
envSetConfigParam (pParam, value)
|
||||
ENV_PARAM *pParam; /* I pointer to config param structure */
|
||||
char *value; /* I pointer to value string */
|
||||
{
|
||||
#ifndef vxWorks
|
||||
printf("envSetConfigParam can't be used in UNIX\n");
|
||||
printf("envSetConfigParam can only be used under vxWorks\n");
|
||||
return -1L;
|
||||
#else
|
||||
if (strlen(value) < 80)
|
||||
strcpy(pParam->dflt, value);
|
||||
else {
|
||||
strncpy(pParam->dflt, value, 79);
|
||||
pParam->dflt[79] = '\0';
|
||||
}
|
||||
long retCode = 0;
|
||||
int status;
|
||||
char *pEnv;
|
||||
|
||||
/*
|
||||
* space for two strings, an '=' character,
|
||||
* and a null termination
|
||||
*/
|
||||
pEnv = malloc (strlen (pParam->name) + strlen (value) + 2);
|
||||
if (!pEnv) {
|
||||
errPrintf(
|
||||
-1L,
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"Failed to set environment parameter \"%s\" to \"%s\" because \"%s\"\n",
|
||||
pParam->name,
|
||||
value,
|
||||
strerror (errnoGet()));
|
||||
return -1L;
|
||||
}
|
||||
|
||||
strcpy (pEnv, pParam->name);
|
||||
strcat (pEnv, "=");
|
||||
strcat (pEnv, value);
|
||||
status = putenv (pEnv);
|
||||
if (status<0) {
|
||||
errPrintf(
|
||||
-1L,
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"Failed to set environment parameter \"%s\" to \"%s\" because \"%s\"\n",
|
||||
pParam->name,
|
||||
value,
|
||||
strerror (errnoGet()));
|
||||
retCode = -1L;
|
||||
}
|
||||
/*
|
||||
* vxWorks copies into a private buffer
|
||||
* (this does not match UNIX behavior)
|
||||
*/
|
||||
free (pEnv);
|
||||
|
||||
return retCode;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*parameters meant to be modified in epicsEnvParams.h*/
|
||||
|
||||
epicsSetEnvParams()
|
||||
int epicsSetEnvParams()
|
||||
{
|
||||
printf("setting EPICS environment parameters\n");
|
||||
envSetConfigParam(&EPICS_TS_MIN_WEST, EPICS_TS_MIN_VALUE);
|
||||
@@ -393,7 +431,8 @@ epicsSetEnvParams()
|
||||
envSetConfigParam(&EPICS_IOC_LOG_FILE_NAME, EPICS_IOC_LOG_FILE_TXT);
|
||||
return 0;
|
||||
}
|
||||
epicsPrtEnvParams()
|
||||
|
||||
int epicsPrtEnvParams()
|
||||
{
|
||||
envPrtConfigParam(&EPICS_TS_MIN_WEST);
|
||||
envPrtConfigParam(&EPICS_CMD_PROTO_PORT);
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
* .01 07-20-91 rac initial version
|
||||
* .02 08-07-91 joh added config get for long and double C types
|
||||
* .03 08-07-91 joh added config get for struct in_addr type
|
||||
* .04 01-11-95 joh use getenv()/putenv() to fetch/write env
|
||||
* vars under vxWorks
|
||||
*
|
||||
* make options
|
||||
* -DvxWorks makes a version for VxWorks
|
||||
@@ -60,20 +62,21 @@
|
||||
*
|
||||
*-***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifdef vxWorks
|
||||
# include <vxWorks.h>
|
||||
# include <stdioLib.h>
|
||||
# include <in.h>
|
||||
# include <types.h>
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <sys/types.h>
|
||||
# include <netinet/in.h>
|
||||
#include <inetLib.h>
|
||||
#include <envLib.h>
|
||||
#include <errnoLib.h>
|
||||
#endif
|
||||
|
||||
#define ENV_PRIVATE_DATA
|
||||
#include <envDefs.h>
|
||||
#include <errMdef.h>
|
||||
#include <epicsEnvParams.h>
|
||||
|
||||
|
||||
@@ -122,11 +125,8 @@ char *pBuf; /* I pointer to parameter buffer */
|
||||
char *pEnv; /* pointer to environment string */
|
||||
long i;
|
||||
|
||||
#ifndef vxWorks
|
||||
pEnv = getenv(pParam->name);
|
||||
#else
|
||||
pEnv = NULL;
|
||||
#endif
|
||||
|
||||
if (pEnv == NULL)
|
||||
pEnv = pParam->dflt;
|
||||
if (strlen(pEnv) <= 0)
|
||||
@@ -363,26 +363,64 @@ ENV_PARAM *pParam; /* I pointer to config param structure */
|
||||
*
|
||||
*-*/
|
||||
long
|
||||
envSetConfigParam(pParam, value)
|
||||
ENV_PARAM *pParam; /* I pointer to config param structure */
|
||||
char *value; /* I pointer to value string */
|
||||
envSetConfigParam (pParam, value)
|
||||
ENV_PARAM *pParam; /* I pointer to config param structure */
|
||||
char *value; /* I pointer to value string */
|
||||
{
|
||||
#ifndef vxWorks
|
||||
printf("envSetConfigParam can't be used in UNIX\n");
|
||||
printf("envSetConfigParam can only be used under vxWorks\n");
|
||||
return -1L;
|
||||
#else
|
||||
if (strlen(value) < 80)
|
||||
strcpy(pParam->dflt, value);
|
||||
else {
|
||||
strncpy(pParam->dflt, value, 79);
|
||||
pParam->dflt[79] = '\0';
|
||||
}
|
||||
long retCode = 0;
|
||||
int status;
|
||||
char *pEnv;
|
||||
|
||||
/*
|
||||
* space for two strings, an '=' character,
|
||||
* and a null termination
|
||||
*/
|
||||
pEnv = malloc (strlen (pParam->name) + strlen (value) + 2);
|
||||
if (!pEnv) {
|
||||
errPrintf(
|
||||
-1L,
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"Failed to set environment parameter \"%s\" to \"%s\" because \"%s\"\n",
|
||||
pParam->name,
|
||||
value,
|
||||
strerror (errnoGet()));
|
||||
return -1L;
|
||||
}
|
||||
|
||||
strcpy (pEnv, pParam->name);
|
||||
strcat (pEnv, "=");
|
||||
strcat (pEnv, value);
|
||||
status = putenv (pEnv);
|
||||
if (status<0) {
|
||||
errPrintf(
|
||||
-1L,
|
||||
__FILE__,
|
||||
__LINE__,
|
||||
"Failed to set environment parameter \"%s\" to \"%s\" because \"%s\"\n",
|
||||
pParam->name,
|
||||
value,
|
||||
strerror (errnoGet()));
|
||||
retCode = -1L;
|
||||
}
|
||||
/*
|
||||
* vxWorks copies into a private buffer
|
||||
* (this does not match UNIX behavior)
|
||||
*/
|
||||
free (pEnv);
|
||||
|
||||
return retCode;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*parameters meant to be modified in epicsEnvParams.h*/
|
||||
|
||||
epicsSetEnvParams()
|
||||
int epicsSetEnvParams()
|
||||
{
|
||||
printf("setting EPICS environment parameters\n");
|
||||
envSetConfigParam(&EPICS_TS_MIN_WEST, EPICS_TS_MIN_VALUE);
|
||||
@@ -393,7 +431,8 @@ epicsSetEnvParams()
|
||||
envSetConfigParam(&EPICS_IOC_LOG_FILE_NAME, EPICS_IOC_LOG_FILE_TXT);
|
||||
return 0;
|
||||
}
|
||||
epicsPrtEnvParams()
|
||||
|
||||
int epicsPrtEnvParams()
|
||||
{
|
||||
envPrtConfigParam(&EPICS_TS_MIN_WEST);
|
||||
envPrtConfigParam(&EPICS_CMD_PROTO_PORT);
|
||||
|
||||
@@ -61,27 +61,32 @@
|
||||
* .01 09-04-93 rcz Merged errMessage.c, errPrint.c, errSymFind.c
|
||||
* rcz into one file (errSymLib.c) and changed method
|
||||
* rcz of errSymTable lookup.
|
||||
* .02 01-13-95 joh call mprintf() instead of logMsg()
|
||||
* and eliminated errToLogMsg variable
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <ellLib.h>
|
||||
#include <dbDefs.h>
|
||||
#include <errMdef.h>
|
||||
#include "errSymTbl.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef vxWorks
|
||||
#include <vxWorks.h>
|
||||
#include <taskLib.h>
|
||||
#include <logLib.h>
|
||||
#include <types.h>
|
||||
#include <symLib.h>
|
||||
#include <errnoLib.h>
|
||||
|
||||
#include <mprintf.h>
|
||||
|
||||
extern SYMTAB_ID statSymTbl;
|
||||
|
||||
#else
|
||||
#include <string.h>
|
||||
extern int errno;
|
||||
extern int sys_nerr;
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
#endif
|
||||
|
||||
@@ -108,14 +113,14 @@ static int initialized = FALSE;
|
||||
extern ERRSYMTAB_ID errSymTbl;
|
||||
|
||||
|
||||
#ifdef vxWorks
|
||||
int errToLogMsg = TRUE;
|
||||
#endif
|
||||
|
||||
/*Declare storage for errVerbose( defined in errMdef.h)*/
|
||||
int errVerbose=0;
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
int verrPrintStatus(long status, char *pFormatString, va_list pvar);
|
||||
#else
|
||||
int verrPrintStatus();
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************
|
||||
@@ -213,11 +218,6 @@ va_dcl
|
||||
char *pFileName;
|
||||
int lineno;
|
||||
#endif
|
||||
#ifdef vxWorks
|
||||
int id;
|
||||
static int saveid = -1;
|
||||
char *pname;
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
va_start(pvar, pformat);
|
||||
@@ -229,29 +229,8 @@ va_dcl
|
||||
pformat = va_arg(pvar, char *);
|
||||
#endif
|
||||
|
||||
#ifdef vxWorks
|
||||
if(!errToLogMsg) {
|
||||
id = taskIdSelf();
|
||||
if (saveid != id) {
|
||||
saveid = id;
|
||||
pname = taskName(id);
|
||||
printf("taskid=%x taskname=%s ", id, pname);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(pFileName && errVerbose){
|
||||
#ifdef vxWorks
|
||||
if(errToLogMsg) {
|
||||
logMsg("filename=\"%s\" line number=%d\n", pFileName, lineno,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
else{
|
||||
printf("filename=\"%s\" line number=%d\n", pFileName, lineno);
|
||||
}
|
||||
#else
|
||||
printf("filename=\"%s\" line number=%d\n", pFileName, lineno);
|
||||
#endif
|
||||
mprintf("filename=\"%s\" line number=%d\n", pFileName, lineno);
|
||||
}
|
||||
|
||||
if (pformat != NULL) {
|
||||
@@ -273,12 +252,7 @@ va_dcl
|
||||
reformatSize = size;
|
||||
}
|
||||
else{
|
||||
#ifdef vxWorks
|
||||
logMsg("%s: calloc error\n", __FILE__,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
#else
|
||||
printf("%s: calloc error\n", __FILE__);
|
||||
#endif
|
||||
mprintf ("%s: calloc error\n", __FILE__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -369,34 +343,11 @@ va_list pvar;
|
||||
strcat(name, ctxToLarge);
|
||||
}
|
||||
else{
|
||||
fprintf(stderr,ctxToLarge);
|
||||
mprintf(ctxToLarge);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef vxWorks
|
||||
if(errToLogMsg){
|
||||
int i;
|
||||
int logMsgArgs[6];
|
||||
|
||||
for(i=0; i< NELEMENTS(logMsgArgs); i++){
|
||||
logMsgArgs[i] = va_arg(pvar, int);
|
||||
}
|
||||
|
||||
logMsg(
|
||||
name,
|
||||
logMsgArgs[0],
|
||||
logMsgArgs[1],
|
||||
logMsgArgs[2],
|
||||
logMsgArgs[3],
|
||||
logMsgArgs[4],
|
||||
logMsgArgs[5]);
|
||||
}
|
||||
else{
|
||||
vprintf(name, pvar);
|
||||
}
|
||||
#else
|
||||
vprintf(name, pvar);
|
||||
#endif
|
||||
vmprintf(name, pvar);
|
||||
|
||||
return rtnval;
|
||||
}
|
||||
@@ -623,3 +574,5 @@ unsigned short endErrNum;
|
||||
errSymTestPrint(errNum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,27 +61,32 @@
|
||||
* .01 09-04-93 rcz Merged errMessage.c, errPrint.c, errSymFind.c
|
||||
* rcz into one file (errSymLib.c) and changed method
|
||||
* rcz of errSymTable lookup.
|
||||
* .02 01-13-95 joh call mprintf() instead of logMsg()
|
||||
* and eliminated errToLogMsg variable
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <ellLib.h>
|
||||
#include <dbDefs.h>
|
||||
#include <errMdef.h>
|
||||
#include "errSymTbl.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef vxWorks
|
||||
#include <vxWorks.h>
|
||||
#include <taskLib.h>
|
||||
#include <logLib.h>
|
||||
#include <types.h>
|
||||
#include <symLib.h>
|
||||
#include <errnoLib.h>
|
||||
|
||||
#include <mprintf.h>
|
||||
|
||||
extern SYMTAB_ID statSymTbl;
|
||||
|
||||
#else
|
||||
#include <string.h>
|
||||
extern int errno;
|
||||
extern int sys_nerr;
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
#endif
|
||||
|
||||
@@ -108,14 +113,14 @@ static int initialized = FALSE;
|
||||
extern ERRSYMTAB_ID errSymTbl;
|
||||
|
||||
|
||||
#ifdef vxWorks
|
||||
int errToLogMsg = TRUE;
|
||||
#endif
|
||||
|
||||
/*Declare storage for errVerbose( defined in errMdef.h)*/
|
||||
int errVerbose=0;
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
int verrPrintStatus(long status, char *pFormatString, va_list pvar);
|
||||
#else
|
||||
int verrPrintStatus();
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************
|
||||
@@ -213,11 +218,6 @@ va_dcl
|
||||
char *pFileName;
|
||||
int lineno;
|
||||
#endif
|
||||
#ifdef vxWorks
|
||||
int id;
|
||||
static int saveid = -1;
|
||||
char *pname;
|
||||
#endif
|
||||
|
||||
#ifdef __STDC__
|
||||
va_start(pvar, pformat);
|
||||
@@ -229,29 +229,8 @@ va_dcl
|
||||
pformat = va_arg(pvar, char *);
|
||||
#endif
|
||||
|
||||
#ifdef vxWorks
|
||||
if(!errToLogMsg) {
|
||||
id = taskIdSelf();
|
||||
if (saveid != id) {
|
||||
saveid = id;
|
||||
pname = taskName(id);
|
||||
printf("taskid=%x taskname=%s ", id, pname);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(pFileName && errVerbose){
|
||||
#ifdef vxWorks
|
||||
if(errToLogMsg) {
|
||||
logMsg("filename=\"%s\" line number=%d\n", pFileName, lineno,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
else{
|
||||
printf("filename=\"%s\" line number=%d\n", pFileName, lineno);
|
||||
}
|
||||
#else
|
||||
printf("filename=\"%s\" line number=%d\n", pFileName, lineno);
|
||||
#endif
|
||||
mprintf("filename=\"%s\" line number=%d\n", pFileName, lineno);
|
||||
}
|
||||
|
||||
if (pformat != NULL) {
|
||||
@@ -273,12 +252,7 @@ va_dcl
|
||||
reformatSize = size;
|
||||
}
|
||||
else{
|
||||
#ifdef vxWorks
|
||||
logMsg("%s: calloc error\n", __FILE__,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
#else
|
||||
printf("%s: calloc error\n", __FILE__);
|
||||
#endif
|
||||
mprintf ("%s: calloc error\n", __FILE__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -369,34 +343,11 @@ va_list pvar;
|
||||
strcat(name, ctxToLarge);
|
||||
}
|
||||
else{
|
||||
fprintf(stderr,ctxToLarge);
|
||||
mprintf(ctxToLarge);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef vxWorks
|
||||
if(errToLogMsg){
|
||||
int i;
|
||||
int logMsgArgs[6];
|
||||
|
||||
for(i=0; i< NELEMENTS(logMsgArgs); i++){
|
||||
logMsgArgs[i] = va_arg(pvar, int);
|
||||
}
|
||||
|
||||
logMsg(
|
||||
name,
|
||||
logMsgArgs[0],
|
||||
logMsgArgs[1],
|
||||
logMsgArgs[2],
|
||||
logMsgArgs[3],
|
||||
logMsgArgs[4],
|
||||
logMsgArgs[5]);
|
||||
}
|
||||
else{
|
||||
vprintf(name, pvar);
|
||||
}
|
||||
#else
|
||||
vprintf(name, pvar);
|
||||
#endif
|
||||
vmprintf(name, pvar);
|
||||
|
||||
return rtnval;
|
||||
}
|
||||
@@ -623,3 +574,5 @@ unsigned short endErrNum;
|
||||
errSymTestPrint(errNum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -124,6 +124,8 @@ int lineNum;
|
||||
#else
|
||||
abort();
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*+/subr**********************************************************************
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
* .09 02-09-94 jbk tsLocalTime() now calls TScurrentTimeStamp() vxWorks
|
||||
* for the EPOCH year
|
||||
* .10 05-04-94 pg HPUX cpp changes. (elif to else and if)
|
||||
* .11 01-09-95 joh fixed ts min west out of range test
|
||||
*
|
||||
* make options
|
||||
* -DvxWorks makes a version for VxWorks
|
||||
@@ -107,19 +108,23 @@
|
||||
* 4.2 BSD.)
|
||||
*-***************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef vxWorks
|
||||
# include <vxWorks.h>
|
||||
# include <stdioLib.h>
|
||||
# include <strLib.h>
|
||||
# include <ctype.h>
|
||||
#else
|
||||
#if VMS
|
||||
# include <sys/time.h>
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
#if 0
|
||||
# include <strings.h>
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -361,7 +366,7 @@ date()
|
||||
*
|
||||
*-*/
|
||||
static
|
||||
sunday(day, leap, dayYear, dayOfWeek)
|
||||
int sunday(day, leap, dayYear, dayOfWeek)
|
||||
int day; /* I day of year to find closest Sunday */
|
||||
int leap; /* I 0, 1 for not leap year, leap year, respectively */
|
||||
int dayYear; /* I known day of year */
|
||||
@@ -600,10 +605,6 @@ TS_STAMP *pStamp; /* O pointer to time stamp buffer */
|
||||
return TScurrentTimeStamp((struct timespec*)pStamp);
|
||||
# endif
|
||||
#else
|
||||
#if VMS
|
||||
assert(0); /* not available on VMS */
|
||||
assert(pStamp != NULL);
|
||||
#else /* SunOS */
|
||||
struct timeval curtime;
|
||||
|
||||
assert(pStamp != NULL);
|
||||
@@ -613,7 +614,6 @@ TS_STAMP *pStamp; /* O pointer to time stamp buffer */
|
||||
pStamp->nsec = ( curtime.tv_usec/1000 ) * 1000000;
|
||||
pStamp->secPastEpoch = curtime.tv_sec - TS_EPOCH_SEC_PAST_1970;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
pStamp->nsec = pStamp->nsec - (pStamp->nsec % TS_TRUNC);
|
||||
@@ -874,7 +874,7 @@ tsInitMinWest()
|
||||
if (envGetLongConfigParam(&EPICS_TS_MIN_WEST, &tsMinWest) != 0)
|
||||
error = 1;
|
||||
else
|
||||
if (tsMinWest > 1380 && tsMinWest < -1380)
|
||||
if (tsMinWest > 1380 || tsMinWest < -1380)
|
||||
error = 1;
|
||||
if (error) {
|
||||
(void)printf(
|
||||
@@ -1373,10 +1373,8 @@ TS_STAMP *pStamp; /* O time stamp corresponding to text */
|
||||
char **pText; /* IO ptr to ptr to string containing time and date */
|
||||
{
|
||||
long retStat=S_ts_OK;/* status return to caller */
|
||||
long stat; /* status from calls */
|
||||
struct tsDetail t; /* detailed breakdown of text */
|
||||
TS_STAMP stamp; /* temp for building time stamp */
|
||||
char *pField; /* pointer to field */
|
||||
char delim; /* delimiter character */
|
||||
int count; /* count from scan of next field */
|
||||
long nsec; /* temp for nano-seconds */
|
||||
|
||||
Reference in New Issue
Block a user