diff --git a/src/libCom/errPrintfUNIX.c b/src/libCom/errPrintfUNIX.c deleted file mode 100644 index 406a7931a..000000000 --- a/src/libCom/errPrintfUNIX.c +++ /dev/null @@ -1,86 +0,0 @@ -/* $Id$ - * errPrintfUNIX.c - * Author: Marty Kraimer - * Date: 02-16-95 - * - * Experimental Physics and Industrial Control System (EPICS) - * - * Copyright 1991, the Regents of the University of California, - * and the University of Chicago Board of Governors. - * - * This software was produced under U.S. Government contracts: - * (W-7405-ENG-36) at the Los Alamos National Laboratory, - * and (W-31-109-ENG-38) at Argonne National Laboratory. - * - * Initial development by: - * The Controls and Automation Group (AT-8) - * Ground Test Accelerator - * Accelerator Technology Division - * Los Alamos National Laboratory - * - * Co-developed with - * The Controls and Computing Group - * Accelerator Systems Division - * Advanced Photon Source - * Argonne National Laboratory - * - * Modification Log: errPrintfUNIX.c - * ----------------- - * .01 02-16-95 mrk Extracted from errSymLib.c - *************************************************************************** - * This must ultimately be replaced by a facility that allows remote - * nodes access to the error messages. A message handling communication - * task should be written that allows multiple remote nodes to request - * notification of all error messages. - * For now lets just print messages and last errno via logMsg or printf - *************************************************************************** - */ - -#include -#include -#include -#include - -#define epicsExportSharedSymbols -#include "epicsAssert.h" -#include "dbDefs.h" -#include "errMdef.h" -#include "epicsPrint.h" -#include "errSymTbl.h" - - -/**************************************************************** - * ERRMESSAGE - now a macro to call errPrintf - * ERRPRINTF - print an error symbol message - ***************************************************************/ -void epicsShareAPI errPrintf(long status, const char *pFileName, - int lineno, const char *pformat, ...) -{ - va_list pvar; - - va_start(pvar, pformat); - if(pFileName && errVerbose){ - fprintf(stderr,"filename=\"%s\" line number=%d\n", pFileName, lineno); - } - if(status==0) status = errno; - if(status>0) { - int rtnval; - unsigned short modnum,errnum; - char name[256]; - - rtnval = errSymFind(status,name); - modnum = (unsigned short) (status >> 16); - errnum = (unsigned short) (status & 0xffff); - if(rtnval) { - fprintf(stderr, "Error status (module %hu, number %hu) not in symbol table", - modnum, errnum); - } else { - fprintf(stderr,"%s ",name); - } - } - if (pformat) { - vfprintf(stderr,pformat,pvar); - } - fprintf(stderr,"\n"); -} - diff --git a/src/libCom/errPrintfVX.c b/src/libCom/errPrintfVX.c deleted file mode 100644 index 4f6486fce..000000000 --- a/src/libCom/errPrintfVX.c +++ /dev/null @@ -1,282 +0,0 @@ -/* $Id$ - * errPrintfVX.c - * Author: Marty Kraimer and Jeff Hill - * Date: 6-1-90 - * - * Experimental Physics and Industrial Control System (EPICS) - * - * Copyright 1991, the Regents of the University of California, - * and the University of Chicago Board of Governors. - * - * This software was produced under U.S. Government contracts: - * (W-7405-ENG-36) at the Los Alamos National Laboratory, - * and (W-31-109-ENG-38) at Argonne National Laboratory. - * - * Initial development by: - * The Controls and Automation Group (AT-8) - * Ground Test Accelerator - * Accelerator Technology Division - * Los Alamos National Laboratory - * - * Co-developed with - * The Controls and Computing Group - * Accelerator Systems Division - * Advanced Photon Source - * Argonne National Laboratory - * - * Modification Log: errPrintfVX.c - * ----------------- - * .01 02-16-95 mrk Extracted from errSymLib.c - * $Log$ - * Revision 1.9 1997/04/10 19:45:23 jhill - * API changes and include with not <> - * - * Revision 1.8 1996/09/04 21:46:20 jhill - * fixed gcc warning - * - * Revision 1.7 1995/11/08 23:44:41 jhill - * changes associated with fixing the log client - * - *************************************************************************** - */ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define epicsExportSharedSymbols -#include "epicsAssert.h" -#include "ellLib.h" -#include "dbDefs.h" -#include "task_params.h" -#include "errMdef.h" -#include "epicsPrint.h" -#ifndef LOCAL -#define LOCAL static -#endif /* LOCAL */ - -static int mprintf (const char *pFormat, ...); -static int vmprintf (const char *pFormat, va_list pvar); - -LOCAL SEM_ID clientWaitForTask; -LOCAL SEM_ID clientWaitForCompletion; -LOCAL SEM_ID serverWaitForWork; - -LOCAL void epicsPrintTask(void); -LOCAL void errPrintfPVT(void); - -typedef enum{cmdErrPrintf,cmdEpicsPrint} cmdType; - -LOCAL struct { - cmdType cmd; - int taskid; - long status; - const char *pFileName; - int lineno; - const char *pformat; - va_list pvar; - int oldtaskid; - int printfStatus; -}pvtData; - -LOCAL int errInitFlag=0; - -void errInit(void) -{ - if(!vxTas(&errInitFlag)) return; - pvtData.oldtaskid = 0; - if((clientWaitForTask=semBCreate(SEM_Q_FIFO,SEM_EMPTY))==NULL) - logMsg("semBcreate failed in errInit",0,0,0,0,0,0); - if((clientWaitForCompletion=semBCreate(SEM_Q_FIFO,SEM_EMPTY))==NULL) - logMsg("semBcreate failed in errInit",0,0,0,0,0,0); - if((serverWaitForWork=semBCreate(SEM_Q_FIFO,SEM_EMPTY))==NULL) - logMsg("semBcreate failed in errInit",0,0,0,0,0,0); - taskSpawn(EPICSPRINT_NAME,EPICSPRINT_PRI,EPICSPRINT_OPT, - EPICSPRINT_STACK,(FUNCPTR)epicsPrintTask, - 0,0,0,0,0,0,0,0,0,0); - if ((errSymBld()) != 0) { - logMsg("errSymBld failed to initialize\n",0,0,0,0,0,0); - } -} - -LOCAL void epicsPrintTask(void) -{ - semGive(clientWaitForTask); - while(TRUE) { - if(semTake(serverWaitForWork,WAIT_FOREVER)!=OK) - logMsg("epicsPrint: semTake returned error\n",0,0,0,0,0,0); - switch(pvtData.cmd) { - case (cmdErrPrintf) : - errPrintfPVT(); - break; - case (cmdEpicsPrint) : - pvtData.printfStatus = vmprintf(pvtData.pformat,pvtData.pvar); - break; - } - semGive(clientWaitForCompletion); - } -} - - -void errPrintf(long status, const char *pFileName, - int lineno, const char *pformat, ...) -{ - va_list pvar; - - if(INT_CONTEXT()) { - int logMsgArgs[6]; - unsigned i; - - va_start (pvar, pformat); - for (i=0; i0) { - int rtnval; - unsigned short modnum,errnum; - char name[256]; - - rtnval = errSymFind(status,name); - modnum = status >> 16; - errnum = status & 0xffff; - if(rtnval) { - mprintf("Error status (module %hu, number %hu) not in symbol table\n", - modnum, errnum); - } else { - mprintf("%s ",name); - } - } - vmprintf(pformat,pvar); - mprintf("\n"); - return; -} - -int epicsPrintf(const char *pformat, ...) -{ - va_list pvar; - - va_start(pvar, pformat); - return epicsVprintf(pformat,pvar); -} - -int epicsVprintf(const char *pformat, va_list pvar) -{ - int status; - - if(INT_CONTEXT()) { - int logMsgArgs[6]; - unsigned i; - - for (i=0; i