Move alarm string arrays into libCom
Using idea from Peter Heesterman: * Instanciate the alarm strings once in libCom * Remove the epicsAlarmGlobal macro * Make sure the decorations are right
This commit is contained in:
@@ -25,9 +25,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define epicsAlarmGLOBAL
|
||||
#include <alarm.h>
|
||||
#undef epicsAlarmGLOBAL
|
||||
#include <alarmString.h>
|
||||
#include <epicsTime.h>
|
||||
#include <epicsString.h>
|
||||
#include <cadef.h>
|
||||
|
||||
@@ -31,6 +31,7 @@ INC += testMain.h
|
||||
# epicsVersion.h is created by this Makefile
|
||||
INC += epicsVersion.h
|
||||
|
||||
Com_SRCS += alarmString.c
|
||||
Com_SRCS += aToIPAddr.c
|
||||
Com_SRCS += adjustment.c
|
||||
Com_SRCS += cantProceed.c
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#define INC_alarm_H
|
||||
|
||||
#include "shareLib.h"
|
||||
#include "epicsTypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -43,8 +42,6 @@ typedef enum {
|
||||
#define INVALID_ALARM epicsSevInvalid
|
||||
#define lastEpicsAlarmSev epicsSevInvalid
|
||||
|
||||
epicsShareExtern const char *epicsAlarmSeverityStrings [ALARM_NSEV];
|
||||
|
||||
|
||||
/* ALARM STATUS - must match menuAlarmStat.dbd */
|
||||
|
||||
@@ -98,15 +95,9 @@ typedef enum {
|
||||
#define WRITE_ACCESS_ALARM epicsAlarmWriteAccess
|
||||
#define lastEpicsAlarmCond epicsAlarmWriteAccess
|
||||
|
||||
epicsShareExtern const char *epicsAlarmConditionStrings [ALARM_NSTATUS];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef epicsAlarmGLOBAL
|
||||
# include "alarmString.h"
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* INC_alarm_H */
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2009 UChicago Argonne LLC, 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 is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* $Revision-Id$ */
|
||||
|
||||
/* String names for alarm status and severity values */
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "alarm.h"
|
||||
#include "alarmString.h"
|
||||
|
||||
/* ALARM SEVERITIES - must match menuAlarmSevr.dbd and alarm.h */
|
||||
|
||||
epicsShareDef const char * epicsAlarmSeverityStrings[ALARM_NSEV] = {
|
||||
"NO_ALARM",
|
||||
"MINOR",
|
||||
"MAJOR",
|
||||
"INVALID"
|
||||
};
|
||||
|
||||
|
||||
/* ALARM STATUS - must match menuAlarmStat.dbd and alarm.h */
|
||||
|
||||
epicsShareDef const char * epicsAlarmConditionStrings[ALARM_NSTATUS] = {
|
||||
"NO_ALARM",
|
||||
"READ",
|
||||
"WRITE",
|
||||
"HIHI",
|
||||
"HIGH",
|
||||
"LOLO",
|
||||
"LOW",
|
||||
"STATE",
|
||||
"COS",
|
||||
"COMM",
|
||||
"TIMEOUT",
|
||||
"HWLIMIT",
|
||||
"CALC",
|
||||
"SCAN",
|
||||
"LINK",
|
||||
"SOFT",
|
||||
"BAD_SUB",
|
||||
"UDF",
|
||||
"DISABLE",
|
||||
"SIMM",
|
||||
"READ_ACCESS",
|
||||
"WRITE_ACCESS"
|
||||
};
|
||||
@@ -8,59 +8,28 @@
|
||||
\*************************************************************************/
|
||||
/* $Revision-Id$ */
|
||||
|
||||
/* String names for alarms */
|
||||
/* String names for alarm status and severity values */
|
||||
|
||||
#ifndef INC_alarmString_H
|
||||
#define INC_alarmString_H
|
||||
|
||||
#include "shareLib.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Compatibility with original alarmString.h names */
|
||||
/* An older version of alarmString.h used these names: */
|
||||
|
||||
#define alarmSeverityString epicsAlarmSeverityStrings
|
||||
#define alarmStatusString epicsAlarmConditionStrings
|
||||
|
||||
|
||||
/* Name strings */
|
||||
/* Name string arrays */
|
||||
|
||||
/* ALARM SEVERITIES - must match menuAlarmSevr.dbd and alarm.h */
|
||||
epicsShareExtern const char *epicsAlarmSeverityStrings [ALARM_NSEV];
|
||||
epicsShareExtern const char *epicsAlarmConditionStrings [ALARM_NSTATUS];
|
||||
|
||||
const char * epicsAlarmSeverityStrings[] = {
|
||||
"NO_ALARM",
|
||||
"MINOR",
|
||||
"MAJOR",
|
||||
"INVALID"
|
||||
};
|
||||
|
||||
|
||||
/* ALARM STATUS - must match menuAlarmStat.dbd and alarm.h */
|
||||
|
||||
const char * epicsAlarmConditionStrings[] = {
|
||||
"NO_ALARM",
|
||||
"READ",
|
||||
"WRITE",
|
||||
"HIHI",
|
||||
"HIGH",
|
||||
"LOLO",
|
||||
"LOW",
|
||||
"STATE",
|
||||
"COS",
|
||||
"COMM",
|
||||
"TIMEOUT",
|
||||
"HWLIMIT",
|
||||
"CALC",
|
||||
"SCAN",
|
||||
"LINK",
|
||||
"SOFT",
|
||||
"BAD_SUB",
|
||||
"UDF",
|
||||
"DISABLE",
|
||||
"SIMM",
|
||||
"READ_ACCESS",
|
||||
"WRITE_ACCESS"
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user