Compare commits
113 Commits
R3.13.0-al
...
R3.13.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f39f39d79 | ||
|
|
d807b2ace5 | ||
|
|
18c52e5839 | ||
|
|
81cd82fcca | ||
|
|
f1d714a57e | ||
|
|
7ce03e13e8 | ||
|
|
3ca0a1f556 | ||
|
|
b8a0083745 | ||
|
|
11925a7168 | ||
|
|
e81b990a31 | ||
|
|
edff93791b | ||
|
|
5ca9baaede | ||
|
|
ea0ff36f65 | ||
|
|
a2b8735fe5 | ||
|
|
cb9583a21a | ||
|
|
3d1180b17f | ||
|
|
507a125c2c | ||
|
|
c5bfbfccc0 | ||
|
|
d3e21e87b2 | ||
|
|
9c05191e9e | ||
|
|
9c2248a5c6 | ||
|
|
546bb97e92 | ||
|
|
c556f69387 | ||
|
|
2ec12266ad | ||
|
|
13c03c4cde | ||
|
|
99deec1134 | ||
|
|
1938a00761 | ||
|
|
e50d5375f8 | ||
|
|
30e64505e3 | ||
|
|
0b3df30c4f | ||
|
|
070673fa89 | ||
|
|
bfb6dcc118 | ||
|
|
46c39c3253 | ||
|
|
ad232dd2d9 | ||
|
|
c40ff7da52 | ||
|
|
2af23a4893 | ||
|
|
7260cf15fb | ||
|
|
ee2cf25c35 | ||
|
|
08ec0e69d8 | ||
|
|
e906138c55 | ||
|
|
0e6b238881 | ||
|
|
82e39acd3a | ||
|
|
85ef2f5a10 | ||
|
|
733ed90bd7 | ||
|
|
4c8c63c9e1 | ||
|
|
aeaad63186 | ||
|
|
70a87d2c95 | ||
|
|
41b53c1a67 | ||
|
|
a4ac96afdc | ||
|
|
a5d46a7a07 | ||
|
|
e37d227975 | ||
|
|
adab5e6a1a | ||
|
|
56a11aa90c | ||
|
|
969152088f | ||
|
|
2a5871e303 | ||
|
|
b5c459b036 | ||
|
|
cffd160cf0 | ||
|
|
c4aa64946f | ||
|
|
069c404d64 | ||
|
|
998e413bed | ||
|
|
8fd7fff71c | ||
|
|
d799330ec0 | ||
|
|
631de381fd | ||
|
|
f15f4ad524 | ||
|
|
13156bee16 | ||
|
|
090e6ce3d3 | ||
|
|
fd2a536131 | ||
|
|
6b6c9ce6a1 | ||
|
|
95f4990b98 | ||
|
|
ad2a272e90 | ||
|
|
7438234eb5 | ||
|
|
67eb929b63 | ||
|
|
5d73bdffb2 | ||
|
|
3c603a7e3f | ||
|
|
ec34df23fc | ||
|
|
67dce79b62 | ||
|
|
70c885000e | ||
|
|
f2cd63c68f | ||
|
|
7d342b5276 | ||
|
|
20880b3950 | ||
|
|
6bd6481cbd | ||
|
|
2433b09c1c | ||
|
|
a057f79d75 | ||
|
|
1947538968 | ||
|
|
dc6972ba06 | ||
|
|
c4171b7ec0 | ||
|
|
7f08759c2a | ||
|
|
43b11de6ad | ||
|
|
66ee6135ba | ||
|
|
3c4ffb5cc4 | ||
|
|
72a8c35f55 | ||
|
|
53f2acfaa1 | ||
|
|
fe4cfd8091 | ||
|
|
8c2cefc5a4 | ||
|
|
dbe9f90ac1 | ||
|
|
4b47e7a979 | ||
|
|
d12ce5f58a | ||
|
|
f1b751a3d3 | ||
|
|
c324b8f598 | ||
|
|
64e851e05c | ||
|
|
e3fb1f6c90 | ||
|
|
0844d7132f | ||
|
|
dd8fa0e290 | ||
|
|
276dd19293 | ||
|
|
a312de99b0 | ||
|
|
ccfcd95561 | ||
|
|
2e42535459 | ||
|
|
d3432d487a | ||
|
|
c6701f8475 | ||
|
|
dba800ebb7 | ||
|
|
cda87cbf31 | ||
|
|
376f37eb1e | ||
|
|
2f2f378238 |
76
Makefile
76
Makefile
@@ -16,32 +16,9 @@
|
||||
TOP=.
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
all: install
|
||||
DIRS = src config
|
||||
|
||||
build:
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} $@.$${ARCH}; \
|
||||
done)
|
||||
|
||||
install:
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} $@.$${ARCH}; \
|
||||
done)
|
||||
|
||||
depends:
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} $@.$${ARCH}; \
|
||||
done)
|
||||
|
||||
clean:
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} $@.$${ARCH}; \
|
||||
done)
|
||||
|
||||
uninstall:
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} $@.$${ARCH}; \
|
||||
done)
|
||||
include $(TOP)/config/RULES_TOP
|
||||
|
||||
release:
|
||||
@echo TOP: Creating Release...
|
||||
@@ -51,54 +28,7 @@ built_release: install
|
||||
@echo TOP: Creating Fully Built Release...
|
||||
@./MakeRelease ${TOP} -b
|
||||
|
||||
# Notes for single architecture build rules:
|
||||
# CheckArch only has to be run for dirs.% . That
|
||||
# way it will only be run ONCE when filtering down
|
||||
# dependencies.
|
||||
#
|
||||
# CheckArch does not have to be run for cleans
|
||||
# because you might want to eliminate binaries for
|
||||
# an old architecture.
|
||||
|
||||
# DIRS RULE syntax: make depends.arch
|
||||
# e.g.: make depends.mv167
|
||||
#
|
||||
# Create dependencies for an architecture. We MUST
|
||||
# do this separately for each architecture because
|
||||
# some things may be included on a per architecture
|
||||
# basis.
|
||||
|
||||
build.%:
|
||||
@echo $*: Building
|
||||
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs build
|
||||
|
||||
install.%:
|
||||
@echo $*: Installing
|
||||
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs install
|
||||
|
||||
depends.%:
|
||||
@echo $*: Performing Make Depends
|
||||
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs depends
|
||||
|
||||
# Illegal Syntax
|
||||
|
||||
release.%:
|
||||
@echo
|
||||
@echo "The release.arch syntax is not supported by this build."
|
||||
@echo " Use 'make release' or 'make built_release' instead."
|
||||
@echo
|
||||
|
||||
uninstall.%:
|
||||
@echo "TOP: Uninstalling $* "
|
||||
@rm -rf $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
|
||||
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
|
||||
@rm -rf rec.bak rec
|
||||
uninstall::
|
||||
@DIR1=`pwd`;cd $(INSTALL_LOCATION);DIR2=`pwd`;cd $$DIR1;\
|
||||
if [ "$$DIR1" != "$$DIR2" ]; then rm -fr $(INSTALL_LOCATION)/config; fi
|
||||
|
||||
clean.%:
|
||||
@echo "TOP: Cleaning $* "
|
||||
@find src -type d -name "O.$*" -prune -exec rm -rf {} \;
|
||||
@find config -type d -name "O.$*" -prune -exec rm -rf {} \;
|
||||
|
||||
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
#
|
||||
# base $Id$
|
||||
#
|
||||
# EPICS Makefile For Subdirectory Recursions
|
||||
# by Matthew Needes and Mike Bordua
|
||||
#
|
||||
|
||||
TOP=.
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
all: build
|
||||
|
||||
build: dirs
|
||||
@(for DIR in ${DIRS}; \
|
||||
do \
|
||||
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
|
||||
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
|
||||
cd $$TMP; \
|
||||
done)
|
||||
|
||||
install: dirs
|
||||
@(for DIR in ${DIRS}; \
|
||||
do \
|
||||
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
|
||||
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
|
||||
cd $$TMP; \
|
||||
done)
|
||||
|
||||
depends: dirs
|
||||
@(for DIR in ${DIRS}; \
|
||||
do \
|
||||
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
|
||||
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
|
||||
cd $$TMP; \
|
||||
done)
|
||||
|
||||
dirs:
|
||||
@echo ${T_A}: Creating Directories
|
||||
@for DIR in ${DIRS}; \
|
||||
do \
|
||||
TMP=`pwd`; \
|
||||
cd $$DIR ; \
|
||||
if [ -f Makefile.${BUILD_TYPE} ] ; then \
|
||||
test -d O.${T_A} || \
|
||||
mkdir O.${T_A}; \
|
||||
test -f O.${T_A}/Makefile || \
|
||||
( echo "T_A=${T_A}" > O.${T_A}/Makefile; \
|
||||
echo "include ../Makefile.${BUILD_TYPE}" \
|
||||
>> O.${T_A}/Makefile;); \
|
||||
test -f O.${T_A}/.DEPENDS || \
|
||||
touch O.${T_A}/.DEPENDS; \
|
||||
fi ; \
|
||||
cd $$TMP; \
|
||||
done
|
||||
|
||||
152
README
152
README
@@ -27,9 +27,9 @@ Notes:
|
||||
|
||||
1.2 To add a target architecture to EPICS:
|
||||
|
||||
cd config
|
||||
cp CONFIG_ARCH.mv167 CONFIG_ARCH.YOUR_ARCH
|
||||
edit CONFIG_ARCH.YOUR_ARCH - For compiler flags / etc.
|
||||
cd base/config
|
||||
cp CONFIG.mv167 CONFIG.YOUR_ARCH
|
||||
edit CONFIG.YOUR_ARCH - For compiler flags / etc.
|
||||
|
||||
cp CONFIG.Vx.68k CONFIG.Vx.YOUR_ARCH_CLASS
|
||||
cp CONFIG_SITE.Vx.68k CONFIG_SITE.Vx.YOUR_ARCH_CLASS
|
||||
@@ -43,20 +43,12 @@ Notes:
|
||||
cd epics/base
|
||||
gnumake - To build and install EPICS.
|
||||
gnumake clean - To clean temporary object files. Top level
|
||||
clean will remove all the O.ARCH dirs, not
|
||||
only those specified in BUILD_ARCHS.
|
||||
clean will remove all the O.ARCH dirs, not
|
||||
only those specified in BUILD_ARCHS.
|
||||
gnumake uninstall - Only available at the top level directory.
|
||||
Cleans directories created by the install.
|
||||
|
||||
1.4 To create an EPICS release:
|
||||
|
||||
edit src/include/epicsVersion.h - ONLY IF you need to change the EPICS
|
||||
version number.
|
||||
|
||||
gnumake release - Will create Tar file
|
||||
|
||||
gnumake built_release - Will create Tar file, after generating
|
||||
dependencies, INCLUDING BINARIES.
|
||||
|
||||
1.5 "Partial" build commands:
|
||||
1.4 "Partial" build commands:
|
||||
|
||||
gnumake clean.sun4 - Cleans sun4 binaries in O.sun4 dirs only.
|
||||
gnumake install.sun4 - Builds sun4 only.
|
||||
@@ -64,12 +56,12 @@ Notes:
|
||||
be complete before this can be issued).
|
||||
|
||||
NOTES:
|
||||
1. base/MakeRelease will create tar files in the directory ABOVE
|
||||
base. These tar files are then meant to be untarred at that level.
|
||||
This release will include the "epics/startup" directory.
|
||||
|
||||
2. EPICS binaries and shellscripts are installed into the bin/ARCH and
|
||||
lib/ARCH directories.
|
||||
1. EPICS binaries and shellscripts are installed into the directory
|
||||
$(INSTALL_LOCATION)/bin/ARCH.
|
||||
|
||||
2. EPICS libraries are installed into the $(INSTALL_LOCATION)/lib/ARCH
|
||||
directory.
|
||||
|
||||
3. During a normal build (a "make" or "make install"), the "depends"
|
||||
dependency will NOT be invoked. Only if "make depends" is run
|
||||
@@ -88,7 +80,7 @@ NOTES:
|
||||
mv167 target.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Part 2 --- Configuration Files in epics/config
|
||||
Part 2 --- Configuration Files in epics/base/config
|
||||
----------------------------------------------------------------------------
|
||||
CONFIG - This file is meant to be included in the low-level EPICS Makefiles.
|
||||
It includes the other EPICS makefiles, and allows individual developers
|
||||
@@ -107,7 +99,7 @@ manager. It specifies:
|
||||
etc.
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
CONFIG_ARCH.ARCH - This file defines a particular architecture. It
|
||||
CONFIG.ARCH - This file defines a particular architecture. It
|
||||
contains the following variables:
|
||||
|
||||
BUILD_TYPE: Unix / Vx
|
||||
@@ -115,23 +107,21 @@ contains the following variables:
|
||||
Architecture dependent build flags. The flag names / contents
|
||||
depend on your architecture class.
|
||||
----------------------------------------------------------------------------
|
||||
CONFIG_SITE.BUILD_TYPE.ARCH_CLASS - Contains definitions of where to
|
||||
find things, like X11 / Motif, etc.
|
||||
----------------------------------------------------------------------------
|
||||
CONFIG.BUILD_TYPE.ARCH_CLASS - Contains definitions pertaining to a
|
||||
particular architecture class. This file's primary usefulness is to
|
||||
define compile and link flags.
|
||||
CONFIG_SITE.ARCH - Contains site specific definitions pertaining to a
|
||||
particular architecture. This file's primary usefulness is to
|
||||
define site specific compile and link flags.
|
||||
----------------------------------------------------------------------------
|
||||
CONFIG_COMMON - Contains definitions describing the layout of base.
|
||||
----------------------------------------------------------------------------
|
||||
CONFIG_BASE
|
||||
CONFIG_EXTENSIONS - Defines what subdirectories get built by default under
|
||||
base and extensions.
|
||||
CONFIG_BASE - Defines what subdirectories get built by default under base.
|
||||
----------------------------------------------------------------------------
|
||||
RULES.Vx - Rules for building with VxWorks makefiles.
|
||||
----------------------------------------------------------------------------
|
||||
RULES.Unix - Rules for building with Unix makefiles.
|
||||
----------------------------------------------------------------------------
|
||||
RULES_TOP - Top level rules for building.
|
||||
----------------------------------------------------------------------------
|
||||
RULES_ARCHS
|
||||
RULES_DIRS - Allows top-level type command syntax in low-level directories.
|
||||
----------------------------------------------------------------------------
|
||||
@@ -143,18 +133,18 @@ Filename SYS_MGR ADD_VX_ARCH ADD_UNIX_ARCH DEVELOPER
|
||||
|
||||
CONFIG m - - m
|
||||
CONFIG_SITE m m m -
|
||||
CONFIG_ARCH.ARCH - c c -
|
||||
CONFIG_SITE.Unix.ARCH_CLASS m - c* -
|
||||
CONFIG_SITE.Vx.ARCH_CLASS m c* - -
|
||||
CONFIG.Unix.ARCH_CLASS - - c* -
|
||||
CONFIG_SITE_ENV m - - -
|
||||
CONFIG.ARCH - c c -
|
||||
CONFIG_SITE.ARCH - c c -
|
||||
CONFIG.Vx.ARCH_CLASS - c* - -
|
||||
RULES.Vx - - - -
|
||||
RULES.Unix - - - -
|
||||
CONFIG_BASE - - - -
|
||||
CONFIG_EXTENSIONS - - - -
|
||||
CONFIG_COMMON - - - -
|
||||
CONFIG_ENV - - - -
|
||||
RULES_ARCHS - - - -
|
||||
RULES_DIRS - - - -
|
||||
RULES_TOP - - - -
|
||||
|
||||
m - Modify an existing file.
|
||||
c - Create a new file.
|
||||
@@ -172,63 +162,57 @@ RULES_DIRS - - - -
|
||||
(files are numbered in the order of their inclusion)
|
||||
|
||||
src/db/Makefile.Vx (An example EPICS makefile)
|
||||
^ ^ ^
|
||||
| | +--- 3. RULES.Vx
|
||||
| | Default rules.
|
||||
| +------- 2. CONFIG
|
||||
| ^ ^ ^ ^ ^
|
||||
| | | | | |
|
||||
| | | | | +- 1. CONFIG_SITE
|
||||
| | | | | HOST_ARCH = sun4
|
||||
| | | | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
|
||||
| | | | | VX_DIR = /vxworks
|
||||
| | | | | More.
|
||||
| | | | +--- 2. CONFIG_COMMON
|
||||
| | | | General info about base.
|
||||
| | | +----- 3. CONFIG_ARCH.hkv2f
|
||||
| | | BUILD_TYPE = Vx
|
||||
| | | ARCH_CLASS = 68k
|
||||
| | | Arch Specific Compiler Flag Setup
|
||||
| | +------- 4. CONFIG_SITE.Vx.68k
|
||||
| | Directory locations
|
||||
| +--------- 5. CONFIG.Vx.68k
|
||||
| Compiler/utility setup for ARCH_CLASS
|
||||
+---------- 1. Target.include
|
||||
T_A definition (target architecture)
|
||||
^ ^
|
||||
| +--- 3. RULES.Vx
|
||||
| Default rules.
|
||||
+------- 2. CONFIG
|
||||
^ ^ ^ ^
|
||||
| | | |
|
||||
| | | +- 1. CONFIG_SITE
|
||||
| | | HOST_ARCH = sun4
|
||||
| | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
|
||||
| | | VX_DIR = /vxworks
|
||||
| | | More.
|
||||
| | +--- 2. CONFIG_COMMON
|
||||
| | General info about base.
|
||||
| +----- 3. CONFIG.hkv2f
|
||||
| ^ BUILD_TYPE = Vx
|
||||
| | ARCH_CLASS = 68k
|
||||
| | Arch Specific Compiler Flag Setup
|
||||
| +--- a. CONFIG.Vx.68k
|
||||
| Compiler/utility setup for ARCH_CLASS
|
||||
+------- 4. CONFIG_SITE.hkv2f
|
||||
Site Specific setup
|
||||
|
||||
---------------------------- sun4 example --------------------------------
|
||||
(files are numbered in the order of their inclusion)
|
||||
|
||||
src/db/Makefile.Unix (An example EPICS makefile)
|
||||
^ ^ ^
|
||||
| | +--- 3. RULES.Unix
|
||||
| | Default rules.
|
||||
| +------- 2. CONFIG
|
||||
| ^ ^ ^ ^ ^
|
||||
| | | | | |
|
||||
| | | | | +- 1. CONFIG_SITE
|
||||
| | | | | HOST_ARCH = sun4
|
||||
| | | | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
|
||||
| | | | | VX_DIR = /vxworks
|
||||
| | | | | More.
|
||||
| | | | +--- 2. CONFIG_COMMON
|
||||
| | | | General info about base.
|
||||
| | | +----- 3. CONFIG_ARCH.sun4
|
||||
| | | BUILD_TYPE = Unix
|
||||
| | | ARCH_CLASS = sun4
|
||||
| | | Arch Specific Compiler Flag Setup
|
||||
| | +------- 4. CONFIG_SITE.Unix.sun4
|
||||
| | Directory locations
|
||||
| +--------- 5. CONFIG.Unix.sun4
|
||||
| Compiler/utility setup for ARCH_CLASS
|
||||
+---------- 1. Target.include
|
||||
T_A definition (target architecture)
|
||||
^ ^
|
||||
| +--- 3. RULES.Unix
|
||||
| Default rules.
|
||||
+------- 2. CONFIG
|
||||
^ ^ ^ ^
|
||||
| | | |
|
||||
| | | +- 1. CONFIG_SITE
|
||||
| | | HOST_ARCH = sun4
|
||||
| | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
|
||||
| | | VX_DIR = /vxworks
|
||||
| | | More.
|
||||
| | +--- 2. CONFIG_COMMON
|
||||
| | General info about base.
|
||||
| +----- 3. CONFIG.sun4
|
||||
| BUILD_TYPE = Unix
|
||||
| ARCH_CLASS = sun4
|
||||
| Arch Specific Compiler Flag Setup
|
||||
+------- 4. CONFIG_SITE.sun4
|
||||
Directory locations
|
||||
|
||||
----------------------------------------------------------------------------
|
||||
Part 4 --- EPICS dependencies
|
||||
Part 4 --- EPICS makefile rules
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
Dependencies supported by lower level Makefiles:
|
||||
Rules supported by lower level Makefiles:
|
||||
|
||||
depends - Generate include dependencies
|
||||
build - Builds objects, using libraries from "build_libs"
|
||||
|
||||
@@ -11,16 +11,21 @@ include $(EPICS_BASE)/config/CONFIG_SITE
|
||||
#
|
||||
include $(EPICS_BASE)/config/CONFIG_COMMON
|
||||
|
||||
ifdef T_A
|
||||
|
||||
# assume T_A is the host arch if not specified
|
||||
ifndef T_A
|
||||
T_A = $(HOST_ARCH)
|
||||
endif
|
||||
|
||||
# Architecture specific definitions
|
||||
#
|
||||
include $(EPICS_BASE)/config/CONFIG.$(T_A)
|
||||
#
|
||||
include $(EPICS_BASE)/config/CONFIG_SITE.$(T_A)
|
||||
|
||||
endif
|
||||
-include $(EPICS_BASE)/config/CONFIG_SITE.$(T_A)
|
||||
|
||||
# User specific definitions
|
||||
#
|
||||
-include $(HOME)/.EPICS_CONFIG
|
||||
|
||||
# All EPICS options other than BUILD_TYPE
|
||||
# may be overridden here.
|
||||
#
|
||||
@@ -38,4 +43,3 @@ endif
|
||||
#VX_WARN=YES
|
||||
#etc.
|
||||
#
|
||||
|
||||
|
||||
@@ -22,8 +22,10 @@ YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
G++ = g++
|
||||
CCC = CC
|
||||
RMDIR = rm -rf
|
||||
MKDIR = mkdir
|
||||
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
|
||||
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
|
||||
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
|
||||
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
|
||||
@@ -43,6 +45,24 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
|
||||
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
|
||||
CC = $(C_$(CMPLR))
|
||||
|
||||
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
|
||||
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_LD_FLAGS =
|
||||
CCC_LD_LIBS =
|
||||
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
|
||||
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
|
||||
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
|
||||
-Wmissing-prototypes -Woverloaded-virtual \
|
||||
-Wwrite-strings -Wconversion -Wstrict-prototypes\
|
||||
-Wpointer-arith -Winline
|
||||
|
||||
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
|
||||
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXX = $(CXX_$(CXXCMPLR))
|
||||
|
||||
# Static Build options
|
||||
ACC_SFLAGS_YES= -Bstatic
|
||||
ACC_SFLAGS_NO=
|
||||
@@ -91,7 +111,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXXFLAGS = $(CCFLAGS)
|
||||
CXX =$($(CPLUSPLUS))
|
||||
|
||||
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
|
||||
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
|
||||
@@ -102,5 +121,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
|
||||
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
|
||||
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.Linux
|
||||
|
||||
@@ -8,11 +8,16 @@ RANLIB = $(VX_GNU_BIN)/ranlib68k
|
||||
YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
CC = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
|
||||
CXX = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
|
||||
CPP = $(VX_GNU_BIN)/cpp68k -nostdinc
|
||||
#CPP = $(CC) -E
|
||||
GCC = $(CC)
|
||||
LD = $(VX_GNU_BIN)/ld68k -r
|
||||
EPICS_LDLIBS =
|
||||
MV=mv
|
||||
RM=rm -f
|
||||
MKDIR=mkdir
|
||||
RMDIR=rm -rf
|
||||
|
||||
# special c library requirements
|
||||
SPECIAL_LANG =
|
||||
@@ -48,14 +53,18 @@ TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
|
||||
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
|
||||
|
||||
CFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
|
||||
CXXFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
|
||||
LDFLAGS = $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(VX_LDFLAGS)
|
||||
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
|
||||
|
||||
# Build compile line here
|
||||
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
|
||||
LINK.c = $(LD) $(LDFLAGS)
|
||||
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
|
||||
LINK.cc = $(LD) $(LDFLAGS)
|
||||
|
||||
CPPSNCFLAGS = $(USR_INCLUDES) $(VX_INCLUDES)
|
||||
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
|
||||
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Vx.68k
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
|
||||
DEPENDS_RULE.cc = -$(COMPILE.cc) -M $(SRCS.cc) > .DEPENDS
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
G++ = g++
|
||||
CCC = CC
|
||||
RMDIR = rm -rf
|
||||
MKDIR = mkdir
|
||||
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
|
||||
ACC_ANSI_INVOKE_W_YES = $(ACC)
|
||||
@@ -37,6 +39,24 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
|
||||
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
|
||||
CC = $(C_$(CMPLR))
|
||||
|
||||
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
|
||||
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_LD_FLAGS =
|
||||
CCC_LD_LIBS =
|
||||
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
|
||||
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
|
||||
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
|
||||
-Wmissing-prototypes -Woverloaded-virtual \
|
||||
-Wwrite-strings -Wconversion -Wstrict-prototypes\
|
||||
-Wpointer-arith -Winline
|
||||
|
||||
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
|
||||
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXX = $(CXX_$(CXXCMPLR))
|
||||
|
||||
# Static Build options
|
||||
ACC_SFLAGS_YES= -non_shared
|
||||
ACC_SFLAGS_NO= -call_shared
|
||||
@@ -83,7 +103,6 @@ CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(U
|
||||
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
|
||||
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
|
||||
CXXFLAGS = $(CCFLAGS)
|
||||
CXX =$($(CPLUSPLUS))
|
||||
|
||||
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
|
||||
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
|
||||
|
||||
@@ -20,6 +20,8 @@ YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
G++ = g++
|
||||
CCC = CC
|
||||
RMDIR = rm -rf
|
||||
MKDIR = mkdir
|
||||
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
|
||||
ACC_ANSI_INVOKE_W_YES = $(ACC)
|
||||
@@ -39,7 +41,25 @@ GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
|
||||
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic
|
||||
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
|
||||
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
|
||||
|
||||
|
||||
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
|
||||
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_LD_FLAGS =
|
||||
CCC_LD_LIBS =
|
||||
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
|
||||
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
|
||||
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
|
||||
-Wmissing-prototypes -Woverloaded-virtual \
|
||||
-Wwrite-strings -Wconversion -Wstrict-prototypes\
|
||||
-Wpointer-arith -Winline
|
||||
|
||||
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
|
||||
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXX = $(CXX_$(CXXCMPLR))
|
||||
|
||||
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
|
||||
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
|
||||
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
|
||||
@@ -91,7 +111,6 @@ CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(U
|
||||
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
|
||||
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
|
||||
CXXFLAGS = $(CCFLAGS)
|
||||
CXX =$($(CPLUSPLUS))
|
||||
|
||||
ARFLAGS = rv
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
G++ = g++
|
||||
CCC = CC
|
||||
RMDIR = rm -rf
|
||||
MKDIR = mkdir
|
||||
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -xansi -w
|
||||
ACC_ANSI_INVOKE_W_YES = $(ACC) -xansi
|
||||
@@ -42,6 +44,25 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
|
||||
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
|
||||
CC = $(C_$(CMPLR))
|
||||
|
||||
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
|
||||
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_LD_FLAGS =
|
||||
CCC_LD_LIBS =
|
||||
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
|
||||
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
|
||||
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
|
||||
-Wmissing-prototypes -Woverloaded-virtual \
|
||||
-Wwrite-strings -Wconversion -Wstrict-prototypes\
|
||||
-Wpointer-arith -Winline
|
||||
|
||||
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
|
||||
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXX = $(CXX_$(CXXCMPLR))
|
||||
|
||||
|
||||
# Static Build options
|
||||
ACC_SFLAGS_YES= -Bstatic
|
||||
ACC_SFLAGS_NO=
|
||||
@@ -89,7 +110,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXXFLAGS = $(CCFLAGS)
|
||||
CXX =$($(CPLUSPLUS))
|
||||
|
||||
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
|
||||
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
|
||||
@@ -101,5 +121,5 @@ LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
LOAD.c = ld -shared $(LDFLAGS)
|
||||
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
|
||||
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sgi
|
||||
|
||||
@@ -20,12 +20,16 @@ YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
G++ = /opt/gnu/bin/g++
|
||||
CCC = /opt/SUNWspro/bin/CC
|
||||
RMDIR = rm -rf
|
||||
MKDIR = mkdir
|
||||
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
|
||||
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
|
||||
ACC_STRICT_INVOKE_W_YES = $(ACC) -Xc -v
|
||||
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
|
||||
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
|
||||
ACC_LD_FLAGS =
|
||||
ACC_LD_LIBS =
|
||||
SUNCC_TRAD_INVOKE_W_NO = $(ACC_TRAD_INVOKE_W_NO)
|
||||
SUNCC_TRAD_INVOKE_W_YES = $(ACC_TRAD_INVOKE_W_YES)
|
||||
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w
|
||||
@@ -33,12 +37,41 @@ GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
|
||||
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic
|
||||
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
|
||||
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
|
||||
|
||||
GCC_LD_LIBS =
|
||||
GCC_LD_FLAGS =
|
||||
|
||||
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
|
||||
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
|
||||
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
|
||||
CC = $(C_$(CMPLR))
|
||||
|
||||
LD_LIBS_OLD = $($(STANDARD)_LD_LIBS)
|
||||
LD_LIBS_ANSI = $($(ANSI)_LD_LIBS)
|
||||
LD_LIBS_STRICT = $($(ANSI)_LD_LIBS)
|
||||
CCOMPILER_LDLIBS = $(LD_LIBS_$(CMPLR))
|
||||
LD_FLAGS_OLD = $($(STANDARD)_LD_FLAGS)
|
||||
LD_FLAGS_ANSI = $($(ANSI)_LD_FLAGS)
|
||||
LD_FLAGS_STRICT = $($(ANSI)_LD_FLAGS)
|
||||
CCOMPILER_LDFLAGS = $(LD_FLAGS_$(CMPLR))
|
||||
|
||||
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
|
||||
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
|
||||
CCC_LD_LIBS =
|
||||
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
|
||||
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
|
||||
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
|
||||
-Wmissing-prototypes -Woverloaded-virtual \
|
||||
-Wwrite-strings -Wconversion -Wstrict-prototypes\
|
||||
-Wpointer-arith -Winline
|
||||
|
||||
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
|
||||
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXX = $(CXX_$(CXXCMPLR))
|
||||
|
||||
# Static Build options
|
||||
#ACC_SFLAGS_YES= -dn
|
||||
ACC_SFLAGS_YES= -Bstatic
|
||||
@@ -71,8 +104,8 @@ UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
|
||||
# Operating system flags
|
||||
OP_SYS_FLAGS = -DUNIX
|
||||
|
||||
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
|
||||
UNIX_LDLIBS = $(UNIX_SLIBS) -lm
|
||||
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
|
||||
UNIX_LDLIBS = $(UNIX_SLIBS) -lm $(CCOMPILER_LDLIBS)
|
||||
|
||||
# Architecture specific build flags
|
||||
ARCH_DEP_CFLAGS = -DSOLARIS
|
||||
@@ -99,7 +132,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXXFLAGS = $(CCFLAGS)
|
||||
CXX = $(CCC)
|
||||
|
||||
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
|
||||
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
|
||||
@@ -110,5 +142,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
|
||||
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -xM $(SRCS.c) >> .DEPENDS
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -xM $(SRCS.c) > .DEPENDS
|
||||
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.solaris
|
||||
|
||||
@@ -21,13 +21,17 @@ YACC = $(EYACC)
|
||||
LEX = $(ELEX)
|
||||
G++ = g++
|
||||
CCC = /usr/lang/CC
|
||||
RMDIR = rm -rf
|
||||
MKDIR = mkdir
|
||||
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
|
||||
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
|
||||
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
|
||||
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
|
||||
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
|
||||
ACC_STRICT_INVOKE_W_NO = $(ACC) -Xc -w
|
||||
ACC_STRICT_INVOKE_W_YES = $(ACC) -Xc -vc
|
||||
ACC_LD_FLAGS = -L$(SPECIAL_LANG)
|
||||
ACC_LD_LIBS =
|
||||
SUNCC_TRAD_INVOKE_W_NO = $(SUNCC) -w
|
||||
SUNCC_TRAD_INVOKE_W_YES = $(SUNCC)
|
||||
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w -D__USE_FIXED_PROTOTYPES__
|
||||
@@ -36,12 +40,42 @@ GCC_STRICT_INVOKE_W_NO = $(GCC) -ansi -pedantic -D__USE_FIXED_PROTOTYPES__
|
||||
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic -D__USE_FIXED_PROTOTYPES__
|
||||
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
|
||||
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
|
||||
GCC_LD_LIBS = -liberty
|
||||
GCC_LD_FLAGS =
|
||||
|
||||
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
|
||||
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
|
||||
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
|
||||
CC = $(C_$(CMPLR))
|
||||
|
||||
LD_LIBS_OLD = $($(STANDARD)_LD_LIBS)
|
||||
LD_LIBS_ANSI = $($(ANSI)_LD_LIBS)
|
||||
LD_LIBS_STRICT = $($(ANSI)_LD_LIBS)
|
||||
CCOMPILER_LDLIBS = $(LD_LIBS_$(CMPLR))
|
||||
LD_FLAGS_OLD = $($(STANDARD)_LD_FLAGS)
|
||||
LD_FLAGS_ANSI = $($(ANSI)_LD_FLAGS)
|
||||
LD_FLAGS_STRICT = $($(ANSI)_LD_FLAGS)
|
||||
CCOMPILER_LDFLAGS = $(LD_FLAGS_$(CMPLR))
|
||||
|
||||
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
|
||||
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
|
||||
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
|
||||
CCC_LD_LIBS =
|
||||
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
|
||||
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
|
||||
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
|
||||
-Wmissing-prototypes -Woverloaded-virtual \
|
||||
-Wwrite-strings -Wconversion -Wstrict-prototypes\
|
||||
-Wpointer-arith -Winline
|
||||
|
||||
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
|
||||
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXX = $(CXX_$(CXXCMPLR))
|
||||
|
||||
|
||||
# Static Build options
|
||||
ACC_SFLAGS_YES= -Bstatic
|
||||
ACC_SFLAGS_NO=
|
||||
@@ -67,21 +101,9 @@ UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
|
||||
OP_SYS_FLAGS = -DUNIX
|
||||
|
||||
|
||||
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
|
||||
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
|
||||
|
||||
#
|
||||
# The three nested if stmnts here document the fact that current
|
||||
# organization here requires that we must use gcc for
|
||||
# all compilation or not at all (no mixed compiler compilation)
|
||||
#
|
||||
UNIX_LDLIBS = -lm
|
||||
#ifeq ($(ANSI), GCC)
|
||||
#ifeq ($(STANDARD), GCC)
|
||||
#ifeq ($(CPLUSPLUS), G++)
|
||||
UNIX_LDLIBS += -liberty
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
UNIX_LDLIBS = -lm $(CCOMPILER_LDLIBS)
|
||||
|
||||
ARCH_DEP_CFLAGS = -DSUNOS4
|
||||
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
|
||||
@@ -103,7 +125,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
|
||||
|
||||
# GNU make likes CXX instead of CCC
|
||||
CXXFLAGS = $(CCFLAGS)
|
||||
CXX =$($(CPLUSPLUS))
|
||||
|
||||
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
|
||||
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
|
||||
@@ -114,5 +135,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
|
||||
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
|
||||
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
|
||||
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sun4
|
||||
|
||||
@@ -2,51 +2,34 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
# the order of following lists are important
|
||||
# the order of following list is important
|
||||
|
||||
DIRS_Vx= \
|
||||
src/libCom\
|
||||
src/libvxWorks\
|
||||
src/bpt\
|
||||
src/util\
|
||||
src/sequencer\
|
||||
src/misc\
|
||||
src/db\
|
||||
src/ca\
|
||||
src/rsrv\
|
||||
src/dbStatic\
|
||||
src/dbtools\
|
||||
src/rec\
|
||||
src/as\
|
||||
src/drv/ansi\
|
||||
src/drv/old\
|
||||
src/dev\
|
||||
src/devOpt\
|
||||
src/iocCore
|
||||
|
||||
DIRS_Unix= \
|
||||
src/tools \
|
||||
src/include \
|
||||
src/cxxTemplates \
|
||||
src/db \
|
||||
src/toolsComm/antelope \
|
||||
src/toolsComm/flex \
|
||||
src/libCom \
|
||||
src/cvtDctsdr \
|
||||
src/dbStatic \
|
||||
src/bpt \
|
||||
src/ca \
|
||||
src/gdd \
|
||||
src/cas/generic \
|
||||
src/cas/build/singleThread \
|
||||
src/cas/example \
|
||||
src/as \
|
||||
src/util \
|
||||
src/sequencer \
|
||||
src/dbtools \
|
||||
config
|
||||
DIRS = \
|
||||
tools \
|
||||
include \
|
||||
cxxTemplates \
|
||||
toolsComm\
|
||||
libCom \
|
||||
libvxWorks\
|
||||
cvtDctsdr \
|
||||
dbStatic \
|
||||
db \
|
||||
bpt \
|
||||
ca \
|
||||
gdd \
|
||||
cas \
|
||||
util \
|
||||
misc \
|
||||
sequencer \
|
||||
dbtools \
|
||||
rsrv\
|
||||
rec\
|
||||
as \
|
||||
drv\
|
||||
dev\
|
||||
devOpt\
|
||||
iocCore
|
||||
|
||||
DIRS = $(DIRS_$(BUILD_TYPE))
|
||||
|
||||
EPICS_BASE = $(TOP)
|
||||
|
||||
@@ -55,3 +38,12 @@ include $(TOP)/config/CONFIG
|
||||
|
||||
EPICS_BASE = $(INSTALL_LOCATION)
|
||||
|
||||
#
|
||||
# this speeds up the build by turning off implicit rules search
|
||||
#
|
||||
.PHONY: $(TOP)/config/CONFIG
|
||||
.PHONY: $(TOP)/config/CONFIG.* $(TOP)/config/CONFIG_*
|
||||
.PHONY: $(TOP)/config/RULES.* $(TOP)/config/RULES_* .DEPENDS
|
||||
.PHONY: $(HOME)/.EPICS_CONFIG
|
||||
.PHONY: ../Makefile.Vx ../Makefile.Unix ../Makefile.Host Makefile
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ EPICS_BASE_DBD = $(EPICS_BASE)/dbd
|
||||
EPICS_EXTENSIONS_INCLUDE = $(EPICS_EXTENSIONS)/include
|
||||
EPICS_EXTENSIONS_TEMPLATES = $(EPICS_EXTENSIONS)/templates
|
||||
|
||||
DIVIDER = .
|
||||
|
||||
# private versions of lex/yacc from EPICS
|
||||
EYACC = $(EPICS_BASE)/bin/$(HOST_ARCH)/antelope
|
||||
|
||||
@@ -34,7 +34,7 @@ endif
|
||||
# mv162lc
|
||||
# mv147
|
||||
# hkv2f
|
||||
# niCpu030
|
||||
# niCpu030
|
||||
#
|
||||
CROSS_COMPILER_TARGET_ARCHS=mv167
|
||||
|
||||
@@ -95,3 +95,15 @@ UNIX_WARN=YES
|
||||
# must be either YES or NO
|
||||
VX_WARN=YES
|
||||
|
||||
# sch2edif compiler and flags
|
||||
SCH2EDIF = sch2edif
|
||||
SCH2EDIF_PATH =
|
||||
SCH2EDIF_SYSFLAGS = -n -ap -p.+..+$(SCH2EDIF_PATH)+$(EPICS_EXTENSIONS)/templates/capfast/sym+
|
||||
SCH2EDIF_FLAGS =
|
||||
|
||||
# e2db and flags
|
||||
# - again there is an assumption where edb.def is installed.
|
||||
E2DB = $(EPICS_EXTENSIONS)/bin/$(HOST_ARCH)/e2db
|
||||
E2DB_SYSFLAGS = -ate -d $(EPICS_EXTENSIONS)/templates/capfast/edb.def
|
||||
E2DB_FLAGS =
|
||||
|
||||
|
||||
@@ -11,3 +11,10 @@
|
||||
# OLD - Standard C - Not appropriate here.
|
||||
CMPLR=ANSI
|
||||
|
||||
# Default SUN C++ compiler, individual Makefiles will override
|
||||
# if they are coded to a higher standard.
|
||||
# STRICT - ANSI C++ force strict warning flags
|
||||
# NORMAL - ANSI C++ optional warning flags
|
||||
CXXCMPLR=NORMAL
|
||||
#CXXCMPLR=STRICT
|
||||
|
||||
|
||||
@@ -12,3 +12,10 @@
|
||||
# OLD - Standard C - Not appropriate here.
|
||||
CMPLR=ANSI
|
||||
|
||||
# Default SUN C++ compiler, individual Makefiles will override
|
||||
# if they are coded to a higher standard.
|
||||
# STRICT - ANSI C++ force strict warning flags
|
||||
# NORMAL - ANSI C++ optional warning flags
|
||||
CXXCMPLR=NORMAL
|
||||
#CXXCMPLR=STRICT
|
||||
|
||||
|
||||
@@ -12,3 +12,10 @@
|
||||
# OLD - Standard C - Not appropriate here.
|
||||
CMPLR=ANSI
|
||||
|
||||
# Default SUN C++ compiler, individual Makefiles will override
|
||||
# if they are coded to a higher standard.
|
||||
# STRICT - ANSI C++ force strict warning flags
|
||||
# NORMAL - ANSI C++ optional warning flags
|
||||
CXXCMPLR=NORMAL
|
||||
#CXXCMPLR=STRICT
|
||||
|
||||
|
||||
@@ -14,8 +14,14 @@
|
||||
# OLD - Standard C - Not appropriate here.
|
||||
CMPLR=ANSI
|
||||
|
||||
# Default SUN C++ compiler, individual Makefiles will override
|
||||
# if they are coded to a higher standard.
|
||||
# STRICT - ANSI C++ force strict warning flags
|
||||
# NORMAL - ANSI C++ optional warning flags
|
||||
CXXCMPLR=NORMAL
|
||||
#CXXCMPLR=STRICT
|
||||
|
||||
# Special C library requirements
|
||||
SPECIAL_LANG = /usr/lang/SC2.0.1patch
|
||||
SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)
|
||||
|
||||
|
||||
|
||||
@@ -11,10 +11,16 @@
|
||||
# OLD - Standard C - Not appropriate here.
|
||||
CMPLR=ANSI
|
||||
|
||||
# Default SUN C++ compiler, individual Makefiles will override
|
||||
# if they are coded to a higher standard.
|
||||
# STRICT - ANSI C++ force strict warning flags
|
||||
# NORMAL - ANSI C++ optional warning flags
|
||||
CXXCMPLR=NORMAL
|
||||
#CXXCMPLR=STRICT
|
||||
|
||||
# Unbundled C compiler stuff
|
||||
SPARCWORKS = /opt/SUNWspro
|
||||
#SPECIAL_LANG = $(SPARCWORKS)/SC3.0/lib
|
||||
#SPECIAL_LANG = .
|
||||
#SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)
|
||||
#SPECIAL_LANG = $(SPARCWORKS)/lib
|
||||
SPECIAL_LANG = .
|
||||
|
||||
|
||||
|
||||
@@ -12,12 +12,20 @@
|
||||
|
||||
CMPLR=ANSI
|
||||
|
||||
# Default SUN C++ compiler, individual Makefiles will override
|
||||
# if they are coded to a higher standard.
|
||||
# STRICT - ANSI C++ force strict warning flags
|
||||
# NORMAL - ANSI C++ optional warning flags
|
||||
CXXCMPLR=NORMAL
|
||||
#CXXCMPLR=STRICT
|
||||
|
||||
#CMPLR=STRICT
|
||||
#ANSI=GCC
|
||||
#STANDARD=GCC
|
||||
#CPLUSPLUS=G++
|
||||
|
||||
# Special C library requirements
|
||||
SPECIAL_LANG = /usr/lang/SC2.0.1patch
|
||||
SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)
|
||||
#SPECIAL_LANG = /usr/lang/SC3.0.1
|
||||
#SPECIAL_LANG = /usr/lang/lib
|
||||
SPECIAL_LANG = .
|
||||
|
||||
|
||||
@@ -10,36 +10,15 @@ CONFIGS += CONFIG_BASE
|
||||
CONFIGS += CONFIG_COMMON
|
||||
CONFIGS += CONFIG_ENV
|
||||
|
||||
CONFIGS += CONFIG.Linux
|
||||
CONFIGS += CONFIG.alpha
|
||||
CONFIGS += CONFIG.hp700
|
||||
CONFIGS += CONFIG.sgi
|
||||
CONFIGS += CONFIG.solaris
|
||||
CONFIGS += CONFIG.sun4
|
||||
CONFIGS += CONFIG.hkv2f
|
||||
CONFIGS += CONFIG.mv147
|
||||
CONFIGS += CONFIG.mv162
|
||||
CONFIGS += CONFIG.mv162lc
|
||||
CONFIGS += CONFIG.mv167
|
||||
CONFIGS += CONFIG.niCpu030
|
||||
|
||||
CONFIGS += CONFIG.Vx.68k
|
||||
|
||||
CONFIGS += CONFIG_SITE
|
||||
CONFIGS += CONFIG_SITE_ENV
|
||||
|
||||
CONFIGS += CONFIG_SITE.Linux
|
||||
CONFIGS += CONFIG_SITE.alpha
|
||||
CONFIGS += CONFIG_SITE.hp700
|
||||
CONFIGS += CONFIG_SITE.sgi
|
||||
CONFIGS += CONFIG_SITE.solaris
|
||||
CONFIGS += CONFIG_SITE.sun4
|
||||
CONFIGS += CONFIG_SITE.hkv2f
|
||||
CONFIGS += CONFIG_SITE.mv147
|
||||
CONFIGS += CONFIG_SITE.mv162lc
|
||||
CONFIGS += CONFIG_SITE.mv162
|
||||
CONFIGS += CONFIG_SITE.mv167
|
||||
CONFIGS += CONFIG_SITE.niCpu030
|
||||
CONFIGS += $(HOST_ARCH:%=CONFIG.%)
|
||||
CONFIGS += $(CROSS_COMPILER_TARGET_ARCHS:%=CONFIG.%)
|
||||
CONFIGS += $(HOST_ARCH:%=CONFIG_SITE.%)
|
||||
CONFIGS += $(CROSS_COMPILER_TARGET_ARCHS:%=CONFIG_SITE.%)
|
||||
|
||||
CONFIGS += RULES.Unix
|
||||
CONFIGS += RULES.Vx
|
||||
@@ -49,5 +28,3 @@ CONFIGS += RULES_TOP
|
||||
|
||||
include $(TOP)/config/RULES.Unix
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# $Id$
|
||||
|
||||
VPATH += .:..
|
||||
|
||||
INSTALL_PROD=$(PROD:%=$(INSTALL_BIN)/%)
|
||||
INSTALL_LIBS=$(LIBNAME:%=$(INSTALL_LIB)/%)
|
||||
INSTALL_INC=$(INC:%=$(INSTALL_INCLUDE)/%)
|
||||
@@ -19,19 +21,19 @@ INSTALL_TCLLIBS=$(TCLLIBNAME:%=$(INSTALL_TCLLIB)/%)
|
||||
INSTALL_TCLINDEX=$(TCLINDEX:%=$(INSTALL_TCLLIB)/%)
|
||||
INSTALL_CONFIGS=$(CONFIGS:%=$(INSTALL_CONFIG)/%)
|
||||
|
||||
all: install
|
||||
all:: install
|
||||
|
||||
pre_build:
|
||||
pre_build::
|
||||
|
||||
build: pre_build $(LIBNAME) $(TARGETS) $(PROD)
|
||||
build:: pre_build $(LIBNAME) $(TARGETS) $(PROD)
|
||||
|
||||
install: build $(INSTALL_INC) $(INSTALL_LIBS) $(TARGETS) $(INSTALL_PROD) \
|
||||
$(INSTALL_MANS) $(INSTALL_DOCS) $(INSTALL_SCRIPTS) $(INSTALL_TEMPLATE) \
|
||||
inc:: $(INSTALL_INC)
|
||||
|
||||
install:: inc build $(INSTALL_LIBS) $(TARGETS) $(INSTALL_SCRIPTS) $(INSTALL_PROD) \
|
||||
$(INSTALL_MANS) $(INSTALL_DOCS) $(INSTALL_TEMPLATE) \
|
||||
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) $(INSTALL_CONFIGS)
|
||||
|
||||
depends: $(SRCS.c) $(SRCS.cc)
|
||||
rm -f .DEPENDS
|
||||
touch .DEPENDS
|
||||
depends:: $(SRCS.c) $(SRCS.cc)
|
||||
ifdef SRCS
|
||||
echo you have a SRCS in your Makefile
|
||||
exit 2
|
||||
@@ -65,19 +67,11 @@ $(TARGETS) $(PROD): $(DEPLIBS)
|
||||
$(RM) $@
|
||||
$(COMPILE.c) $<
|
||||
|
||||
%.o: ../%.c
|
||||
$(RM) $@
|
||||
$(COMPILE.c) $<
|
||||
|
||||
%.o: %.cc
|
||||
$(RM) $@
|
||||
$(COMPILE.cc) $<
|
||||
|
||||
%.o: ../%.cc
|
||||
$(RM) $@
|
||||
$(COMPILE.cc) $<
|
||||
|
||||
%.c: ../%.y
|
||||
%.c: %.y
|
||||
$(RM) y.tab.c y.tab.h
|
||||
$(YACC) $(YACCOPT) $<
|
||||
@if [ -f y.tab.c ]; \
|
||||
@@ -91,14 +85,14 @@ $(TARGETS) $(PROD): $(DEPLIBS)
|
||||
/bin/mv y.tab.h $*.h; \
|
||||
fi
|
||||
|
||||
%.c: ../%.l
|
||||
%.c: %.l
|
||||
$(RM) lex.yy.c
|
||||
$(LEX) $(LEXOPT) $<
|
||||
$(RM) $@
|
||||
/bin/mv lex.yy.c $@
|
||||
|
||||
#state notation language rule
|
||||
%.c: ../%.st
|
||||
#state notation language rules
|
||||
%.c: %.st
|
||||
@echo "preprocessing $*.st"
|
||||
@$(RM) $*.i
|
||||
$(CPP) $(CPPFLAGS) $< $*.i
|
||||
@@ -106,6 +100,28 @@ $(TARGETS) $(PROD): $(DEPLIBS)
|
||||
@$(RM) $@
|
||||
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
|
||||
|
||||
%.c: %.stt
|
||||
@echo "converting $<
|
||||
@$(RM) $@
|
||||
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $<
|
||||
|
||||
# Capfast Rules:
|
||||
%.db: %.edf
|
||||
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
|
||||
|
||||
%.edf: ../%.sch $(DEPSCHS)
|
||||
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
|
||||
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
|
||||
|
||||
# Mangen Rule:
|
||||
%.1:%
|
||||
$(RM) $(<F)
|
||||
$(RM) $(<F).nr
|
||||
ln -s $<
|
||||
$(MANGEN) -s $(<F)
|
||||
mv $(<F).nr $(<F).1
|
||||
|
||||
|
||||
$(LIBNAME): $(LIBOBJS)
|
||||
@echo Building library $@
|
||||
$(RM) $@
|
||||
@@ -121,12 +137,6 @@ $(INSTALL_BIN)/%: %
|
||||
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
|
||||
@$(INSTALL_PRODUCT) -m 555 $< $(INSTALL_BIN)
|
||||
|
||||
$(INSTALL_BIN)/%: ../%
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
|
||||
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
|
||||
@$(INSTALL_PRODUCT) -m 555 $< $(INSTALL_BIN)
|
||||
|
||||
$(INSTALL_LIB)/%.a: %.a
|
||||
@echo "Installing library $@"
|
||||
@test -d $(INSTALL_LOCATION_LIB) || mkdir $(INSTALL_LOCATION_LIB)
|
||||
@@ -136,12 +146,12 @@ $(INSTALL_LIB)/%.a: %.a
|
||||
$(RANLIB) $(RANLIBFLAGS) $@; \
|
||||
fi
|
||||
|
||||
$(INSTALL_CONFIG)/%: ../%
|
||||
$(INSTALL_CONFIG)/%: %
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_CONFIG) || mkdir $(INSTALL_CONFIG)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_CONFIG)
|
||||
|
||||
$(INSTALL_TCLLIB)/%: ../%
|
||||
$(INSTALL_TCLLIB)/%: %
|
||||
@echo "Installing Tcl library $@"
|
||||
@test -d $(INSTALL_LOCATION_LIB) || mkdir $(INSTALL_LOCATION_LIB)
|
||||
@test -d $(INSTALL_LIB) || mkdir $(INSTALL_LIB)
|
||||
@@ -159,7 +169,7 @@ $(INSTALL_MAN)/man5/% \
|
||||
$(INSTALL_MAN)/man4/% \
|
||||
$(INSTALL_MAN)/man3/% \
|
||||
$(INSTALL_MAN)/man2/% \
|
||||
$(INSTALL_MAN)/man1/%: ../%
|
||||
$(INSTALL_MAN)/man1/%: %
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
|
||||
@test -d $(@D) || mkdir $(@D)
|
||||
@@ -170,31 +180,18 @@ $(INSTALL_INCLUDE)/%: %
|
||||
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
|
||||
|
||||
$(INSTALL_INCLUDE)/%: ../%
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
|
||||
|
||||
$(INSTALL_DOC)/%: ../%
|
||||
$(INSTALL_DOC)/%: %
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
|
||||
|
||||
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: ../%
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
|
||||
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
|
||||
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
|
||||
|
||||
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: %
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
|
||||
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
|
||||
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
|
||||
@$(INSTALL) -d -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
|
||||
|
||||
.PRECIOUS: %.o %.c
|
||||
|
||||
include .DEPENDS
|
||||
.PHONY: all inc depends build install pre-build clean
|
||||
|
||||
-include .DEPENDS
|
||||
|
||||
|
||||
109
config/RULES.Vx
109
config/RULES.Vx
@@ -1,9 +1,12 @@
|
||||
# $Id$
|
||||
|
||||
INC +=$(RECTYPES) $(MENUS)
|
||||
VPATH += .:..
|
||||
|
||||
INCREC +=$(RECTYPES) $(MENUS)
|
||||
INSTALL_PROD=$(PROD:%=$(INSTALL_BIN)/%)
|
||||
INSTALL_LIBS=$(LIBNAME:%=$(INSTALL_BIN)/%)
|
||||
INSTALL_INC=$(INC:%=$(INSTALL_INCLUDE)/%)
|
||||
INSTALL_INCREC=$(INCREC:%=$(INSTALL_INCLUDE)/%)
|
||||
INSTALL_MANS+=$(MAN1:%=$(INSTALL_MAN)/man1/%)
|
||||
INSTALL_MANS+=$(MAN2:%=$(INSTALL_MAN)/man2/%)
|
||||
INSTALL_MANS+=$(MAN3:%=$(INSTALL_MAN)/man3/%)
|
||||
@@ -22,24 +25,24 @@ INSTALL_DBS=$(DBDINSTALL:%=$(INSTALL_DBD)/%)\
|
||||
$(RECTYPES:%.h=$(INSTALL_DBD)/%.dbd)\
|
||||
$(MENUS:%.h=$(INSTALL_DBD)/%.dbd)
|
||||
|
||||
INSTALL_DBDEXPAND=$(DBDEXPAND:%=$(INSTALL_DBD)/%)
|
||||
all: install
|
||||
INSTALL_DBDNAME=$(DBDNAME:%=$(INSTALL_DBD)/%)
|
||||
|
||||
pre_build:
|
||||
all:: install
|
||||
|
||||
build: pre_build $(MENUS) $(RECTYPES) $(BPTS)\
|
||||
pre_build::
|
||||
|
||||
build:: pre_build $(MENUS) $(RECTYPES) $(BPTS)\
|
||||
$(LIBNAME) $(TARGETS) $(PROD) $(DBDEXPAND)
|
||||
|
||||
install: build $(INSTALL_INC)\
|
||||
inc:: $(INSTALL_INC)
|
||||
|
||||
install:: inc build $(INSTALL_INCREC)\
|
||||
$(INSTALL_LIBS) $(TARGETS) $(INSTALL_PROD) $(INSTALL_MANS)\
|
||||
$(INSTALL_DOCS) $(INSTALL_SCRIPTS)\
|
||||
$(INSTALL_INSTALLS) $(INSTALL_DBS)\
|
||||
$(INSTALL_MENUS) $(INSTALL_RECTYPES) $(INSTALL_BPTS)\
|
||||
$(INSTALL_DBDEXPAND)
|
||||
$(INSTALL_INSTALLS) $(INSTALL_DBS) $(INSTALL_BPTS)\
|
||||
$(INSTALL_DBDNAME)
|
||||
|
||||
depends: $(SRCS.c) $(SRCS.cc)
|
||||
rm -f .DEPENDS
|
||||
touch .DEPENDS
|
||||
depends:: $(SRCS.c) $(SRCS.cc)
|
||||
ifdef SRCS
|
||||
echo you have a SRCS in your Makefile
|
||||
exit 2
|
||||
@@ -72,19 +75,11 @@ clean::
|
||||
$(RM) $@
|
||||
$(COMPILE.c) $<
|
||||
|
||||
%.o: ../%.c
|
||||
$(RM) $@
|
||||
$(COMPILE.c) $<
|
||||
|
||||
%.o: %.cc
|
||||
$(RM) $@
|
||||
$(COMPILE.cc) $<
|
||||
|
||||
%.o: ../%.cc
|
||||
$(RM) $@
|
||||
$(COMPILE.cc) $<
|
||||
|
||||
%.c: ../%.y
|
||||
%.c: %.y
|
||||
$(RM) y.tab.c y.tab.h
|
||||
$(YACC) $(YACCOPT) $<
|
||||
@if [ -f y.tab.c ]; \
|
||||
@@ -98,14 +93,14 @@ clean::
|
||||
/bin/mv y.tab.h $*.h; \
|
||||
fi
|
||||
|
||||
%.c: ../%.l
|
||||
%.c: %.l
|
||||
$(RM) lex.yy.c
|
||||
$(LEX) $(LEXOPT) $<
|
||||
$(RM) $@
|
||||
/bin/mv lex.yy.c $@
|
||||
|
||||
#state notation language rule
|
||||
%.c: ../%.st
|
||||
#state notation language rules
|
||||
%.c: %.st
|
||||
@echo "preprocessing $*.st"
|
||||
@$(RM) $*.i
|
||||
$(CPP) $(CPPFLAGS) $< $*.i
|
||||
@@ -113,33 +108,58 @@ clean::
|
||||
@$(RM) $@
|
||||
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
|
||||
|
||||
%.c: %.stt
|
||||
@echo "converting $<
|
||||
@$(RM) $@
|
||||
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $<
|
||||
|
||||
# Capfast Rules:
|
||||
%.db: %.edf
|
||||
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
|
||||
|
||||
%.edf: ../%.sch $(DEPSCHS)
|
||||
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
|
||||
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
|
||||
|
||||
# Mangen Rule:
|
||||
%.1:%
|
||||
$(RM) $(<F)
|
||||
$(RM) $(<F).nr
|
||||
ln -s $<
|
||||
$(MANGEN) -s $(<F)
|
||||
mv $(<F).nr $(<F).1
|
||||
|
||||
|
||||
$(INSTALL_DBD)/%: %
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_DBD)
|
||||
|
||||
$(INSTALL_DBD)/%: ../%
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_DBD)
|
||||
|
||||
%Record.h: ../%Record.dbd
|
||||
%Record.h: %Record.dbd
|
||||
$(RM) $@
|
||||
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \
|
||||
$(USER_DBDFLAGS) $<
|
||||
|
||||
menu%.h: ../menu%.dbd
|
||||
menu%.h: menu%.dbd
|
||||
$(RM) $@
|
||||
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToMenuH $<
|
||||
|
||||
bpt%.dbd: ../bpt%.data
|
||||
bpt%.dbd: bpt%.data
|
||||
$(RM) $@
|
||||
$(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt $<
|
||||
|
||||
%.dbd: ../%.dbd
|
||||
$(RM) $@
|
||||
$(DBDNAME): $(DBDEXPAND)
|
||||
@echo expanding dbd
|
||||
@$(RM) $@
|
||||
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand\
|
||||
$(USER_DBDFLAGS) $< > $(<F)
|
||||
$(USER_DBDFLAGS) $< > $@
|
||||
|
||||
%.1:%
|
||||
$(RM) $(<F)
|
||||
$(RM) $(<F).nr
|
||||
ln -s $<
|
||||
$(MANGEN) -s $(<F)
|
||||
mv $(<F).nr $(<F).1
|
||||
|
||||
$(LIBNAME): $(LIBOBJS)
|
||||
@echo Building library $@
|
||||
@@ -152,12 +172,6 @@ $(INSTALL_BIN)/%: %
|
||||
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
|
||||
@$(INSTALL) -m 555 $< $(INSTALL_BIN)
|
||||
|
||||
$(INSTALL_BIN)/%: ../%
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
|
||||
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
|
||||
@$(INSTALL) -m 555 $< $(INSTALL_BIN)
|
||||
|
||||
$(INSTALL_BIN)/%: $(EPICS_BASE_BIN)/%
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_LOCATION_BIN) || mkdir $(INSTALL_LOCATION_BIN)
|
||||
@@ -172,7 +186,7 @@ $(INSTALL_MAN)/man5/% \
|
||||
$(INSTALL_MAN)/man4/% \
|
||||
$(INSTALL_MAN)/man3/% \
|
||||
$(INSTALL_MAN)/man2/% \
|
||||
$(INSTALL_MAN)/man1/%: ../%
|
||||
$(INSTALL_MAN)/man1/%: %
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
|
||||
@test -d $(@D) || mkdir $(@D)
|
||||
@@ -183,17 +197,14 @@ $(INSTALL_INCLUDE)/%: %
|
||||
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
|
||||
|
||||
$(INSTALL_INCLUDE)/%: ../%
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
|
||||
|
||||
$(INSTALL_DOC)/%: ../%
|
||||
$(INSTALL_DOC)/%: %
|
||||
@echo "Installing $@"
|
||||
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
|
||||
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
|
||||
|
||||
.PRECIOUS: %.o %.c
|
||||
|
||||
include .DEPENDS
|
||||
.PHONY: all inc depends build install pre-build clean
|
||||
|
||||
-include .DEPENDS
|
||||
|
||||
|
||||
@@ -2,74 +2,89 @@
|
||||
# $Id$
|
||||
#
|
||||
# EPICS RULES_ARCH
|
||||
# by Matthew Needes and Mike Bordua and Janet Anderson
|
||||
# by Matthew Needes and Mike Bordua and Janet Andersoni and Jeff Hill
|
||||
#
|
||||
|
||||
all:: install
|
||||
|
||||
dirs::
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} dir "T_A=${ARCH}"; \
|
||||
done)
|
||||
ACTIONS += inc
|
||||
ACTIONS += build
|
||||
ACTIONS += install
|
||||
ACTIONS += depends
|
||||
|
||||
depends::
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
|
||||
done)
|
||||
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
|
||||
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
|
||||
|
||||
build::
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
|
||||
done)
|
||||
#
|
||||
# hostActionArchTargets
|
||||
#
|
||||
hostArchs = $(HOST_ARCH) $(filter-out $(HOST_ARCH),$(CROSS_COMPILER_HOST_ARCHS))
|
||||
hostActionArchTargets = $(foreach x, $(ACTIONS),\
|
||||
$(foreach arch,$(hostArchs), $(x)$(DIVIDER)$(arch)))
|
||||
ifeq (Makefile.$(BUILD_TYPE), $(wildcard Makefile.$(BUILD_TYPE)))
|
||||
hostDirs = $(addprefix O.,$(hostArchs))
|
||||
$(hostActionArchTargets) : $(hostDirs)
|
||||
$(MAKE) -C O.$(archPart) -f ../Makefile.$(BUILD_TYPE) T_A=$(archPart) $(actionPart)
|
||||
$(hostArchs) : % : O.%
|
||||
$(MAKE) -C O.$@ -f ../Makefile.$(BUILD_TYPE) T_A=$@
|
||||
else
|
||||
$(hostActionArchTargets) :
|
||||
$(hostArchs) :
|
||||
endif
|
||||
|
||||
install::
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
|
||||
done)
|
||||
#
|
||||
# crossActionArchTargets
|
||||
#
|
||||
crossArchs = $(CROSS_COMPILER_TARGET_ARCHS)
|
||||
crossActionArchTargets = $(foreach x, $(ACTIONS), \
|
||||
$(foreach arch, $(CROSS_COMPILER_TARGET_ARCHS), $(x)$(DIVIDER)$(arch)))
|
||||
ifeq (Makefile.Vx, $(wildcard Makefile.Vx))
|
||||
crossDirs = $(addprefix O.,$(crossArchs))
|
||||
$(crossActionArchTargets) : $(crossDirs)
|
||||
$(MAKE) -C O.$(archPart) -f ../Makefile.Vx T_A=$(archPart) $(actionPart)
|
||||
$(crossArchs) : % : O.%
|
||||
$(MAKE) -C O.$@ -f ../Makefile.Vx T_A=$@
|
||||
else
|
||||
$(crossActionArchTargets) :
|
||||
$(crossArchs) :
|
||||
endif
|
||||
|
||||
clean::
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
|
||||
done)
|
||||
$(hostDirs) :
|
||||
$(MKDIR) $@
|
||||
echo "T_A=$(subst O.,,$@)" > $@/Makefile
|
||||
echo "include ../Makefile.$(BUILD_TYPE)" >> $@/Makefile
|
||||
|
||||
$(crossDirs) :
|
||||
$(MKDIR) $@
|
||||
echo "T_A=$(subst O.,,$@)" > $@/Makefile
|
||||
echo "include ../Makefile.Vx" >> $@/Makefile
|
||||
|
||||
#
|
||||
# host/cross action targets
|
||||
#
|
||||
$(ACTIONS) clean : % : %$(DIVIDER)host %$(DIVIDER)cross
|
||||
HostActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)host)
|
||||
CrossActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)cross)
|
||||
$(HostActionTargets) : %$(DIVIDER)host : $(addprefix %$(DIVIDER), $(hostArchs))
|
||||
$(CrossActionTargets) : %$(DIVIDER)cross : $(addprefix %$(DIVIDER), $(crossArchs))
|
||||
|
||||
|
||||
dirs.%::
|
||||
@${MAKE} dir T_A=$*
|
||||
#
|
||||
# arch targets
|
||||
#
|
||||
host : $(hostArchs)
|
||||
cross : $(crossArchs)
|
||||
|
||||
depends.%::
|
||||
@${MAKE} arch T_A=$* ACTION=depends
|
||||
|
||||
build.%::
|
||||
@${MAKE} arch T_A=$* ACTION=build
|
||||
|
||||
install.%::
|
||||
@${MAKE} arch T_A=$* ACTION=install
|
||||
|
||||
clean.%::
|
||||
@${MAKE} arch T_A=$* ACTION=clean
|
||||
|
||||
${BUILD_ARCHS}::
|
||||
@${MAKE} arch T_A=$@ ACTION=install
|
||||
|
||||
|
||||
arch: dir
|
||||
@if [ -f Makefile.${BUILD_TYPE} ] ; then \
|
||||
echo "${T_A}: ${ACTION}"; \
|
||||
cd O.${T_A}; ${MAKE} ${ACTION} ; \
|
||||
fi
|
||||
|
||||
dir:
|
||||
@if [ -f Makefile.${BUILD_TYPE} ] ; then \
|
||||
test -f ./.cvsignore || \
|
||||
echo "O.*" > ./.cvsignore; \
|
||||
test -d O.${T_A} || \
|
||||
( echo "Creating O.${T_A}"; mkdir O.${T_A};); \
|
||||
test -f O.${T_A}/Makefile || \
|
||||
( echo "T_A=${T_A}" > O.${T_A}/Makefile; \
|
||||
echo "include ../Makefile.${BUILD_TYPE}" \
|
||||
>> O.${T_A}/Makefile;); \
|
||||
test -f O.${T_A}/.DEPENDS || \
|
||||
touch O.${T_A}/.DEPENDS; \
|
||||
fi
|
||||
#
|
||||
# special clean rule
|
||||
#
|
||||
clean$(DIVIDER)% :
|
||||
$(RMDIR) O.$*
|
||||
|
||||
.PHONY : $(HostActionTargets)
|
||||
.PHONY : $(CrossActionTargets)
|
||||
.PHONY : $(crossActionArchTargets)
|
||||
.PHONY : $(hostActionArchTargets)
|
||||
.PHONY : $(hostArchs) $(crossArchs)
|
||||
.PHONY : $(ACTIONS) clean all host cross
|
||||
|
||||
|
||||
@@ -1,70 +1,42 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# Top level rules For Subdirectory Recursions
|
||||
#
|
||||
|
||||
|
||||
all:: install
|
||||
|
||||
dirs::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
depends::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
build::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
install::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
clean::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
ARCHS= $(BUILD_ARCHS) host cross
|
||||
ACTIONS = clean inc install depends
|
||||
|
||||
dirPart = $(word 1, $(subst $(DIVIDER), ,$@))
|
||||
actionArchPart = $(subst $(dirPart)$(DIVIDER), ,$@)
|
||||
|
||||
dirActionArchTargets = $(foreach dir, $(DIRS), \
|
||||
$(foreach action, $(ACTIONS),\
|
||||
$(foreach arch, $(ARCHS), \
|
||||
$(dir)$(DIVIDER)$(action)$(DIVIDER)$(arch))))
|
||||
dirArchTargets += $(foreach dir, $(DIRS), \
|
||||
$(foreach arch, $(ARCHS),\
|
||||
$(dir)$(DIVIDER)$(arch)))
|
||||
dirActionTargets += $(foreach dir, $(DIRS), \
|
||||
$(foreach action, $(ACTIONS),\
|
||||
$(dir)$(DIVIDER)$(action)))
|
||||
actionArchTargets = $(foreach action, $(ACTIONS),\
|
||||
$(foreach arch, $(ARCHS), \
|
||||
$(action)$(DIVIDER)$(arch)))
|
||||
|
||||
|
||||
all:: inc install
|
||||
|
||||
dirs.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
rebuild:: clean uninstall all
|
||||
|
||||
$(DIRS) $(dirActionTargets) $(dirArchTargets)$(dirActionArchTargets) ::
|
||||
$(MAKE) -C $(dirPart) $(actionArchPart)
|
||||
|
||||
depends.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
$(ARCHS) $(ACTIONS) $(actionArchTargets):%: $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
|
||||
|
||||
|
||||
build.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
install.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
clean.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
.PHONY : $(DIRS)
|
||||
.PHONY : $(ARCHS) $(ACTIONS)
|
||||
.PHONY : $(dirActionTargets) $(dirArchTargets)
|
||||
.PHONY : $(dirActionArchTargets)
|
||||
.PHONY : $(actionArchTargets)
|
||||
|
||||
|
||||
122
config/RULES_TOP
122
config/RULES_TOP
@@ -2,95 +2,49 @@
|
||||
# $Id$
|
||||
#
|
||||
|
||||
all:: install
|
||||
include $(TOP)/config/RULES_DIRS
|
||||
|
||||
dirs::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
uninstall$(DIVIDER)%::
|
||||
@$(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
|
||||
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
|
||||
@$(RMDIR) rec.bak rec
|
||||
|
||||
depends::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
build::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
install::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
clean::
|
||||
@echo "TOP: Cleaning
|
||||
@for DIR in ${DIRS}; do \
|
||||
find $$DIR/src -type d -name "O.*" -prune -exec rm -rf {} \; ; \
|
||||
done
|
||||
|
||||
uninstall::
|
||||
@(for ARCH in ${BUILD_ARCHS}; do \
|
||||
${MAKE} $@.$${ARCH}; \
|
||||
done)
|
||||
|
||||
|
||||
|
||||
dirs.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
depends.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
build.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
install.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
clean.%::
|
||||
@for DIR in ${DIRS}; do \
|
||||
echo "$@: $$DIR"; \
|
||||
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
|
||||
done
|
||||
|
||||
uninstall.%::
|
||||
@echo "TOP: Uninstalling $* "
|
||||
@rm -rf ./bin/$* ./lib/$* dbd include man
|
||||
@rm -rf rec.bak rec
|
||||
|
||||
|
||||
DIRNAME=$(notdir $(shell pwd))
|
||||
uninstall:: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))
|
||||
|
||||
tar:
|
||||
@echo "TOP: Creating $(DIRNAME).Tar file..."
|
||||
@ls Makefile* | xargs tar vcf ${DIRNAME}.Tar
|
||||
@if [ -f .current_rel_hist ]; then \
|
||||
ls .current_rel_hist | xargs tar vrf ${DIRNAME}.Tar ; \
|
||||
fi
|
||||
@if [ -f EPICS_BASE ]; then \
|
||||
ls EPICS_BASE | xargs tar vrf ${DIRNAME}.Tar ; \
|
||||
fi
|
||||
@for DIR in ${DIRS}; do \
|
||||
@DIRNAME=$(notdir $(shell pwd)); \
|
||||
echo "TOP: Creating $$DIRNAME.Tar file..."; \
|
||||
ls Makefile* | xargs tar vcf $$DIRNAME.Tar; \
|
||||
if [ -f .current_rel_hist ]; then \
|
||||
ls .current_rel_hist | xargs tar vrf $$DIRNAME.Tar ; \
|
||||
fi ;\
|
||||
if [ -f EPICS_BASE ]; then \
|
||||
ls EPICS_BASE | xargs tar vrf $$DIRNAME.Tar ; \
|
||||
fi ;\
|
||||
for DIR in ${DIRS}; do \
|
||||
find $${DIR} -name CVS -prune -o ! -type d -print \
|
||||
| grep -v "/O\..*$$" | xargs tar vrf ${DIRNAME}.Tar; \
|
||||
| grep -v "/O\..*$$" | xargs tar vrf $$DIRNAME.Tar; \
|
||||
done
|
||||
|
||||
help:
|
||||
@echo "Usage: gnumake [options] [target] ..."
|
||||
@echo "Targets supported by all Makefiles:"
|
||||
@echo " install - Installs executables in bin/<arch> (default rule)"
|
||||
@echo " build - Builds objects, using libraries from "build_libs"
|
||||
@echo " clean - Cleans objects. Clean removes the" O.<arch> dirs
|
||||
@echo " in all except the O.<arch> level Makefile"
|
||||
@echo " depends - Generates include dependencies"
|
||||
@echo "\"Partial\" build targets supported by Makefiles:"
|
||||
@echo " install.<arch> - Builds and installs <arch> only.
|
||||
@echo " clean.<arch> - Cleans <arch> binaries in O.<arch> dirs only."
|
||||
@echo " build.<arch> - Builds <arch> only.
|
||||
@echo " depends.<arch> - Generates <arch> dependencies only.
|
||||
@echo "Targets supported by top level Makefile:"
|
||||
@echo " uninstall - Cleans directories created by the install."
|
||||
@echo " tar - Create tar file "
|
||||
@echo "Indiv. object targets are supported by O.<arch> level Makefile .e.g"
|
||||
@echo " xxxRecord.o
|
||||
|
||||
.PHONY : uninstall tar help
|
||||
.PHONY : $(addprefix uninstall$(DIVIDER), $(BUILDARCHS))
|
||||
|
||||
|
||||
44
src/Makefile
44
src/Makefile
@@ -1,42 +1,14 @@
|
||||
# $Id$
|
||||
# Author: Robert Zieman (ANL)
|
||||
# Date: 6/03/91
|
||||
#
|
||||
# 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:
|
||||
# -----------------
|
||||
# .01 mm-dd-yy iii Comment
|
||||
# .02 08-16-93 rcz moving most of these pre-builds back to the
|
||||
# object area Imakefile and adding DependTarget($(EARLYSRC))
|
||||
#
|
||||
# ...
|
||||
# $Id$
|
||||
#
|
||||
|
||||
all: bld_errSym
|
||||
TOP = ..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
bld_errSym:
|
||||
cd libCom; ../../tools/blderrSymTbl
|
||||
#
|
||||
# Directories to build defined in CONFIG_BASE
|
||||
#
|
||||
|
||||
|
||||
include $(TOP)/config/RULES_DIRS
|
||||
|
||||
clean:
|
||||
/bin/rm -f libCom/errInc.o
|
||||
|
||||
@@ -3,9 +3,13 @@ include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
INC += cvtTable.h
|
||||
|
||||
SRCS.c = ../makeBpt
|
||||
OBJS = makeBpt
|
||||
SRCS.c = ../makeBpt.c
|
||||
OBJS = makeBpt.o
|
||||
PROD = makeBpt
|
||||
|
||||
include $(TOP)/config/RULES.Unix
|
||||
|
||||
$(PROD): $(OBJS) $(DEPLIBS)
|
||||
$(RM) $@
|
||||
$(LINK.c) -o $@ ${OBJS} $(LDLIBS)
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
TOP = ../../..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
CMPLR = STRICT
|
||||
|
||||
USR_LDLIBS = -lca -lCom -lm
|
||||
USR_LDLIBS = -lca -lCom
|
||||
USR_LDFLAGS = -L.
|
||||
|
||||
DEPLIBS_BASE = $(INSTALL_LIB)
|
||||
DEPLIBS = ./libca.a\
|
||||
$(DEPLIBS_BASE)/libCom.a
|
||||
DEPLIBS = ./libca.a $(DEPLIBS_BASE)/libCom.a
|
||||
|
||||
INC += cadef.h
|
||||
INC += caerr.h
|
||||
@@ -32,15 +30,7 @@ LIBNAME = libca.a
|
||||
|
||||
PROD = caRepeater
|
||||
|
||||
TARGETS = acctst catime
|
||||
|
||||
include $(TOP)/config/RULES.Unix
|
||||
|
||||
acctst: acctst.o $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a
|
||||
$(LINK.c) -o $@ $< $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a \
|
||||
$(ARCH_DEP_LDLIBS) -lm
|
||||
|
||||
catime: catime.o $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a
|
||||
$(LINK.c) -o $@ $< $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a \
|
||||
$(ARCH_DEP_LDLIBS) -lm
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,9 @@ static char *sccsId = "@(#) $Id$";
|
||||
|
||||
/*
|
||||
* $Log$
|
||||
* Revision 1.35 1996/07/01 19:49:15 jhill
|
||||
* turned on analog value wrap-around test
|
||||
*
|
||||
* Revision 1.34 1996/06/19 17:59:02 jhill
|
||||
* many 3.13 beta changes
|
||||
*
|
||||
@@ -100,7 +103,7 @@ int acctst(char *pname)
|
||||
NULL);
|
||||
}
|
||||
#else /* not vxWorks */
|
||||
main(int argc, char **argv)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if(argc == 2){
|
||||
doacctst(argv[1]);
|
||||
@@ -513,7 +516,7 @@ int doacctst(char *pname)
|
||||
status = ca_clear_event(mid[i]);
|
||||
if(status != ECA_NORMAL){
|
||||
printf(
|
||||
"Clear of event %d %x failed because \"%s\"\n",
|
||||
"Clear of event %ld %x failed because \"%s\"\n",
|
||||
i,
|
||||
mid[i]->id,
|
||||
ca_message(status));
|
||||
@@ -582,7 +585,7 @@ int doacctst(char *pname)
|
||||
if (pfloat)
|
||||
for (i = 0; i < NUM; i++) {
|
||||
for (j = 0; j < NUM; j++)
|
||||
sprintf(&pstring[j][0], "%d", j + 100);
|
||||
sprintf(&pstring[j][0], "%ld", j + 100l);
|
||||
SEVCHK(ca_array_put(
|
||||
DBR_STRING,
|
||||
NUM,
|
||||
@@ -752,8 +755,6 @@ unsigned iterations)
|
||||
void null_event(struct event_handler_args args)
|
||||
{
|
||||
static int i;
|
||||
dbr_double_t fval = 3.8;
|
||||
int status;
|
||||
unsigned *pInc = (unsigned *) args.usr;
|
||||
|
||||
if (pInc) {
|
||||
|
||||
@@ -78,13 +78,32 @@ int cac_select_io(struct timeval *ptimeout, int flags)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (piiu->sock_chan>=FD_SETSIZE) {
|
||||
#ifdef WIN32
|
||||
/* Under WIN32, FD_SETSIZE is the number of sockets,
|
||||
* not the max. file descriptor value that you may select() !
|
||||
*
|
||||
* Of course it's not allowed to look into fd_count,
|
||||
* but what shall we do? -kuk-
|
||||
*/
|
||||
|
||||
if (pfdi->readMask.fd_count >= FD_SETSIZE)
|
||||
{
|
||||
ca_printf(
|
||||
"%s.%d: file number > FD_SETSIZE=%d ignored\n",
|
||||
__FILE__, __LINE__, FD_SETSIZE);
|
||||
"%s.%d: no room for fd %d in fd_set (FD_SETSIZE=%d)\n",
|
||||
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
|
||||
continue;
|
||||
}
|
||||
|
||||
#else
|
||||
if (piiu->sock_chan>=FD_SETSIZE)
|
||||
{
|
||||
ca_printf(
|
||||
"%s.%d: file number %d > FD_SETSIZE=%d ignored\n",
|
||||
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dont bother receiving if we have insufficient
|
||||
* space for the maximum UDP message
|
||||
|
||||
@@ -124,22 +124,22 @@ HDRVERSIONID(caerrh, "@(#) $Id$")
|
||||
#define ECA_ADDFAIL DEFMSG(CA_K_WARNING, 21)
|
||||
#define ECA_BADCOUNT DEFMSG(CA_K_WARNING, 22)
|
||||
#define ECA_BADSTR DEFMSG(CA_K_ERROR, 23)
|
||||
#define ECA_DISCONN DEFMSG(CA_K_INFO, 24)
|
||||
#define ECA_DBLCHNL DEFMSG(CA_K_INFO, 25)
|
||||
#define ECA_DISCONN DEFMSG(CA_K_WARNING, 24)
|
||||
#define ECA_DBLCHNL DEFMSG(CA_K_WARNING, 25)
|
||||
#define ECA_EVDISALLOW DEFMSG(CA_K_ERROR, 26)
|
||||
#define ECA_BUILDGET DEFMSG(CA_K_WARNING, 27)
|
||||
#define ECA_NEEDSFP DEFMSG(CA_K_INFO, 28)
|
||||
#define ECA_NEEDSFP DEFMSG(CA_K_WARNING, 28)
|
||||
#define ECA_OVEVFAIL DEFMSG(CA_K_WARNING, 29)
|
||||
#define ECA_BADMONID DEFMSG(CA_K_ERROR, 30)
|
||||
#define ECA_NEWADDR DEFMSG(CA_K_INFO, 31)
|
||||
#define ECA_NEWADDR DEFMSG(CA_K_WARNING, 31)
|
||||
#define ECA_NEWCONN DEFMSG(CA_K_INFO, 32)
|
||||
#define ECA_NOCACTX DEFMSG(CA_K_WARNING, 33)
|
||||
#define ECA_DEFUNCT DEFMSG(CA_K_FATAL, 34)
|
||||
#define ECA_EMPTYSTR DEFMSG(CA_K_WARNING, 35)
|
||||
#define ECA_NOREPEATER DEFMSG(CA_K_INFO, 36)
|
||||
#define ECA_NOCHANMSG DEFMSG(CA_K_INFO, 37)
|
||||
#define ECA_DLCKREST DEFMSG(CA_K_INFO, 38)
|
||||
#define ECA_SERVBEHIND DEFMSG(CA_K_INFO, 39)
|
||||
#define ECA_NOREPEATER DEFMSG(CA_K_WARNING, 36)
|
||||
#define ECA_NOCHANMSG DEFMSG(CA_K_WARNNING, 37)
|
||||
#define ECA_DLCKREST DEFMSG(CA_K_WARNING, 38)
|
||||
#define ECA_SERVBEHIND DEFMSG(CA_K_WARNING, 39)
|
||||
#define ECA_NOCAST DEFMSG(CA_K_WARNING, 40)
|
||||
#define ECA_BADMASK DEFMSG(CA_K_ERROR, 41)
|
||||
#define ECA_IODONE DEFMSG(CA_K_INFO, 42)
|
||||
@@ -192,7 +192,7 @@ READONLY char *ca_message_text[]
|
||||
"A monitor by that id cant be found",
|
||||
"Remote channel has new network address",
|
||||
"New or resumed network connection",
|
||||
"Attempt to import from a task without a CA context failed",
|
||||
"Specified task isnt a member of a CA context",
|
||||
"Attempt to use defunct CA feature failed",
|
||||
"The supplied string is empty",
|
||||
"Unable to spawn the CA repeater thread- auto reconnect will fail",
|
||||
|
||||
@@ -47,6 +47,9 @@
|
||||
/* address in use so that test works on UNIX */
|
||||
/* kernels that support multicast */
|
||||
/* $Log$
|
||||
* Revision 1.63 1996/07/09 22:41:28 jhill
|
||||
* silence gcc warning
|
||||
*
|
||||
* Revision 1.62 1996/06/19 17:59:06 jhill
|
||||
* many 3.13 beta changes
|
||||
*
|
||||
@@ -1662,7 +1665,7 @@ void caAddConfiguredAddr(ELLLIST *pList, ENV_PARAM *pEnv,
|
||||
addr.in.sin_family = AF_INET;
|
||||
addr.in.sin_port = htons(port);
|
||||
addr.in.sin_addr.s_addr = inet_addr(pToken);
|
||||
if(addr.in.sin_addr.s_addr == -1){
|
||||
if (addr.in.sin_addr.s_addr == ~0ul) {
|
||||
ca_printf(
|
||||
"%s: Parsing '%s'\n",
|
||||
__FILE__,
|
||||
|
||||
@@ -32,6 +32,12 @@
|
||||
/************************************************************************/
|
||||
|
||||
/* $Log$
|
||||
* Revision 1.55 1996/08/05 19:21:26 jhill
|
||||
* removed unused proto
|
||||
*
|
||||
* Revision 1.54 1996/06/20 21:43:15 jhill
|
||||
* restored io_done_sem (removed by cleanup)
|
||||
*
|
||||
* Revision 1.53 1996/06/20 21:19:35 jhill
|
||||
* fixed posix signal problem with "cc -Xc"
|
||||
*
|
||||
@@ -470,7 +476,6 @@ struct ca_static{
|
||||
int ca_event_tid;
|
||||
int ca_tid;
|
||||
int recv_tid;
|
||||
unsigned ca_local_ticks;
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -595,8 +600,6 @@ unsigned short port,
|
||||
int net_proto
|
||||
);
|
||||
|
||||
int ca_check_for_fp(void);
|
||||
|
||||
void caSetupBCastAddrList (ELLLIST *pList, SOCKET sock, unsigned port);
|
||||
|
||||
int ca_os_independent_init (void);
|
||||
|
||||
@@ -219,11 +219,6 @@ static char *os_depenhSccsId = "$Id$";
|
||||
#define LOCAL static
|
||||
#endif
|
||||
|
||||
/* delay for when a poll is used */
|
||||
/* NOTE: DELAYTICKS must be less than TICKSPERSEC */
|
||||
#define DELAYTICKS 50L /* (adjust units below) */
|
||||
#define TICKSPERSEC 1000L /* mili sec per sec */
|
||||
|
||||
/*
|
||||
* BSD prototypes missing from SUNOS4, MULTINET and
|
||||
* perhaps other environments
|
||||
@@ -231,14 +226,6 @@ static char *os_depenhSccsId = "$Id$";
|
||||
#include <epicsTypes.h>
|
||||
#include <bsdProto.h>
|
||||
|
||||
/*
|
||||
* order of ops is important here
|
||||
*
|
||||
* NOTE: large OS dependent SYFREQ might cause an overflow
|
||||
*/
|
||||
#define LOCALTICKS ((SYSFREQ*DELAYTICKS)/TICKSPERSEC)
|
||||
|
||||
|
||||
#if defined(vxWorks)
|
||||
# define VXTASKIDNONE 0
|
||||
# define LOCK semTake(client_lock, WAIT_FOREVER);
|
||||
@@ -256,8 +243,6 @@ static char *os_depenhSccsId = "$Id$";
|
||||
# define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
|
||||
# define MYERRNO (errnoGet()&0xffff)
|
||||
# define POST_IO_EV semGive(io_done_sem)
|
||||
# define SYSFREQ ((long) sysClkRateGet()) /* usually 60 Hz */
|
||||
# define time(A) (tickGet()/SYSFREQ)
|
||||
typedef int SOCKET;
|
||||
# define INVALID_SOCKET (-1)
|
||||
#endif
|
||||
@@ -272,7 +257,6 @@ static char *os_depenhSccsId = "$Id$";
|
||||
# define socket_ioctl(A,B,C) ioctl(A,B,C)
|
||||
# define MYERRNO errno
|
||||
# define POST_IO_EV
|
||||
# define SYSFREQ 1000000L /* 1 MHz */
|
||||
typedef int SOCKET;
|
||||
# define INVALID_SOCKET (-1)
|
||||
#endif
|
||||
@@ -298,7 +282,6 @@ static char *os_depenhSccsId = "$Id$";
|
||||
# endif
|
||||
# endif
|
||||
# define POST_IO_EV
|
||||
# define SYSFREQ 10000000L /* 10 MHz */
|
||||
# define LOCK
|
||||
# define UNLOCK
|
||||
# define LOCKEVENTS
|
||||
@@ -326,7 +309,6 @@ static char *os_depenhSccsId = "$Id$";
|
||||
# define socket_ioctl(A,B,C) ioctlsocket(A,B,C)
|
||||
# define MYERRNO WSAGetLastError()
|
||||
# define POST_IO_EV
|
||||
# define SYSFREQ 1000000L /* 1 MHz */
|
||||
#endif /*WIN32*/
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* $Log$
|
||||
* Revision 1.23 1996/08/05 19:18:56 jhill
|
||||
* better msg for lack of fp
|
||||
*
|
||||
* Revision 1.22 1996/06/19 17:59:31 jhill
|
||||
* many 3.13 beta changes
|
||||
*
|
||||
* Revision 1.21 1995/10/18 16:44:36 jhill
|
||||
* select time out must be greater than a vxWorks tick
|
||||
*
|
||||
@@ -51,6 +57,17 @@ LOCAL void ca_extra_event_labor(void *pArg);
|
||||
LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid);
|
||||
LOCAL int cac_add_task_variable (struct ca_static *ca_temp);
|
||||
LOCAL void deleteCallBack(CALLBACK *pcb);
|
||||
LOCAL void ca_check_for_fp();
|
||||
|
||||
/*
|
||||
* order of ops is important here
|
||||
*
|
||||
* NOTE: large OS dependent SYFREQ might cause an overflow
|
||||
* NOTE: POLLDELAY must be less than TICKSPERSEC
|
||||
*/
|
||||
#define POLLDELAY 50 /* milli sec */
|
||||
#define TICKSPERSEC 1000 /* milli sec per sec */
|
||||
#define LOCALTICKS ((sysClkRateGet()*POLLDELAY)/TICKSPERSEC)
|
||||
|
||||
|
||||
|
||||
@@ -103,8 +120,8 @@ void cac_gettimeval(struct timeval *pt)
|
||||
void cac_block_for_io_completion(struct timeval *pTV)
|
||||
{
|
||||
struct timeval itimeout;
|
||||
unsigned long ticks;
|
||||
unsigned long rate = sysClkRateGet();
|
||||
int ticks;
|
||||
int rate = sysClkRateGet();
|
||||
|
||||
#ifdef NOASYNCRECV
|
||||
cac_mux_io(pTV);
|
||||
@@ -117,7 +134,7 @@ void cac_block_for_io_completion(struct timeval *pTV)
|
||||
itimeout.tv_sec = 0;
|
||||
cac_mux_io(&itimeout);
|
||||
|
||||
ticks = pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC;
|
||||
ticks = (int) (pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC);
|
||||
ticks = min(LOCALTICKS, ticks);
|
||||
|
||||
semTake(io_done_sem, ticks);
|
||||
@@ -171,8 +188,8 @@ void os_specific_sg_io_complete(CASG *pcasg)
|
||||
void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
|
||||
{
|
||||
struct timeval itimeout;
|
||||
unsigned long ticks;
|
||||
unsigned long rate = sysClkRateGet();
|
||||
int ticks;
|
||||
int rate = sysClkRateGet();
|
||||
|
||||
#ifdef NOASYNCRECV
|
||||
cac_mux_io(pTV);
|
||||
@@ -185,7 +202,7 @@ void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
|
||||
itimeout.tv_sec = 0;
|
||||
cac_mux_io(&itimeout);
|
||||
|
||||
ticks = pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC;
|
||||
ticks = (int) (pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC);
|
||||
ticks = min(LOCALTICKS, ticks);
|
||||
|
||||
semTake (pcasg->sem, ticks);
|
||||
@@ -209,10 +226,7 @@ LOCAL int cac_add_task_variable (struct ca_static *ca_temp)
|
||||
TVIU *ptviu;
|
||||
int status;
|
||||
|
||||
status = ca_check_for_fp();
|
||||
if(status != ECA_NORMAL){
|
||||
return status;
|
||||
}
|
||||
ca_check_for_fp();
|
||||
|
||||
# ifdef DEBUG
|
||||
ca_printf("CAC: adding task variable\n");
|
||||
@@ -342,7 +356,6 @@ int cac_os_depen_init(struct ca_static *pcas)
|
||||
ellInit(&pcas->ca_putNotifyQue);
|
||||
|
||||
pcas->ca_tid = taskIdSelf();
|
||||
pcas->ca_local_ticks = LOCALTICKS;
|
||||
pcas->ca_client_lock = semMCreate(SEM_DELETE_SAFE);
|
||||
assert(pcas->ca_client_lock);
|
||||
pcas->ca_event_lock = semMCreate(SEM_DELETE_SAFE);
|
||||
@@ -620,10 +633,7 @@ int ca_import(int tid)
|
||||
struct ca_static *pcas;
|
||||
TVIU *ptviu;
|
||||
|
||||
status = ca_check_for_fp();
|
||||
if(status != ECA_NORMAL){
|
||||
return status;
|
||||
}
|
||||
ca_check_for_fp();
|
||||
|
||||
/*
|
||||
* just return success if they have already done
|
||||
@@ -671,8 +681,26 @@ int ca_import(int tid)
|
||||
*/
|
||||
int ca_import_cancel(int tid)
|
||||
{
|
||||
int status;
|
||||
TVIU *ptviu;
|
||||
int status;
|
||||
TVIU *ptviu;
|
||||
struct ca_static *pcas;
|
||||
|
||||
if (tid == taskIdSelf()) {
|
||||
pcas = NULL;
|
||||
}
|
||||
else {
|
||||
pcas = ca_static;
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to attach to the specified context
|
||||
*/
|
||||
ca_static = (struct ca_static *)
|
||||
taskVarGet(tid, (int *)&ca_static);
|
||||
if (ca_static == (struct ca_static *) ERROR){
|
||||
ca_static = pcas;
|
||||
return ECA_NOCACTX;
|
||||
}
|
||||
|
||||
LOCK;
|
||||
ptviu = (TVIU *) ellFirst(&ca_static->ca_taskVarList);
|
||||
@@ -684,16 +712,20 @@ int ca_import_cancel(int tid)
|
||||
}
|
||||
|
||||
if(!ptviu){
|
||||
ca_static = pcas;
|
||||
UNLOCK;
|
||||
return ECA_NOCACTX;
|
||||
}
|
||||
|
||||
ellDelete(&ca_static->ca_taskVarList, &ptviu->node);
|
||||
free(ptviu);
|
||||
UNLOCK;
|
||||
|
||||
status = taskVarDelete(tid, (void *)&ca_static);
|
||||
assert (status == OK);
|
||||
|
||||
ca_static = pcas;
|
||||
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
|
||||
@@ -701,15 +733,14 @@ int ca_import_cancel(int tid)
|
||||
/*
|
||||
* ca_check_for_fp()
|
||||
*/
|
||||
int ca_check_for_fp()
|
||||
LOCAL void ca_check_for_fp()
|
||||
{
|
||||
int options;
|
||||
|
||||
assert(taskOptionsGet(taskIdSelf(), &options) == OK);
|
||||
if (!(options & VX_FP_TASK)) {
|
||||
return ECA_NEEDSFP;
|
||||
ca_signal(ECA_NEEDSFP, taskName(taskIdSelf()));
|
||||
}
|
||||
return ECA_NORMAL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,8 +32,14 @@
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* $Log$
|
||||
* Revision 1.20 1995/12/19 19:36:20 jhill
|
||||
* function prototype changes
|
||||
*
|
||||
* Revision 1.19 1995/11/29 19:15:42 jhill
|
||||
* added $Log$ to the header
|
||||
* added $Log$
|
||||
* Revision 1.20 1995/12/19 19:36:20 jhill
|
||||
* function prototype changes
|
||||
* to the header
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -466,7 +472,7 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
|
||||
SetConsoleTitle("Channel Access Status");
|
||||
freopen( "CONOUT$", "a", stderr );
|
||||
}
|
||||
fprintf(stderr, "Process attached to ca.dll R3.12.1\n");
|
||||
fprintf(stderr, "Process attached to ca.dll\n");
|
||||
#endif /* init. winsock */
|
||||
if ((status = WSAStartup(MAKEWORD(1,1), &WsaData)) != 0) {
|
||||
fprintf(stderr,"Cant init winsock \n");
|
||||
@@ -497,13 +503,13 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
|
||||
|
||||
case DLL_THREAD_ATTACH:
|
||||
#if _DEBUG
|
||||
fprintf(stderr, "Thread attached to ca.dll R3.12.1\n");
|
||||
fprintf(stderr, "Thread attached to ca.dll\n");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case DLL_THREAD_DETACH:
|
||||
#if _DEBUG
|
||||
fprintf(stderr, "Thread detached from ca.dll R3.12.1\n");
|
||||
fprintf(stderr, "Thread detached from ca.dll\n");
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ VPATH = $(SRC) $(IOSRC) $(OSSRC)
|
||||
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
CXXCMPLR = STRICT
|
||||
|
||||
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA)
|
||||
|
||||
DEPLIBS_BASE = $(EPICS_BASE_LIB)
|
||||
|
||||
@@ -4,6 +4,8 @@ TOP = $(CAS)/../..
|
||||
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
CXXCMPLR = STRICT
|
||||
|
||||
USR_INCLUDES =
|
||||
USR_LDLIBS = -lcas -lca -lCom -lgdd
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ void exPV::scanPV()
|
||||
//
|
||||
this->currentTime = osiTime::getCurrent();
|
||||
|
||||
pDD = new gddScaler (gddAppType_value, aitEnumFloat32);
|
||||
pDD = new gddScalar (gddAppType_value, aitEnumFloat32);
|
||||
if (!pDD) {
|
||||
return;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ caStatus exPV::update(gdd &valueIn)
|
||||
this->info.getName().string, valueIn);
|
||||
# endif
|
||||
|
||||
if (valueIn.isScaler()) {
|
||||
if (valueIn.isScalar()) {
|
||||
pNewValue = &valueIn;
|
||||
pNewValue->reference();
|
||||
}
|
||||
@@ -149,7 +149,7 @@ caStatus exPV::update(gdd &valueIn)
|
||||
// this does not modify the current value
|
||||
// (because it may be referenced in the event queue)
|
||||
//
|
||||
pNewValue = new gddScaler (gddAppType_value, aitEnumFloat32);
|
||||
pNewValue = new gddScalar (gddAppType_value, aitEnumFloat32);
|
||||
if (!pNewValue) {
|
||||
return S_casApp_noMemory;
|
||||
}
|
||||
@@ -255,10 +255,10 @@ void exPV::show(unsigned level)
|
||||
caStatus exPV::getStatus(gdd &value)
|
||||
{
|
||||
if (this->pValue) {
|
||||
value.putConvert(this->pValue->getStat());
|
||||
value.put(this->pValue->getStat());
|
||||
}
|
||||
else {
|
||||
value.putConvert(epicsAlarmUDF);
|
||||
value.put((aitUint16)epicsAlarmUDF);
|
||||
}
|
||||
return S_cas_success;
|
||||
}
|
||||
@@ -269,10 +269,10 @@ caStatus exPV::getStatus(gdd &value)
|
||||
caStatus exPV::getSeverity(gdd &value)
|
||||
{
|
||||
if (this->pValue) {
|
||||
value.putConvert(this->pValue->getSevr());
|
||||
value.put(this->pValue->getSevr());
|
||||
}
|
||||
else {
|
||||
value.putConvert(epicsSevInvalid);
|
||||
value.put((aitUint16)epicsSevInvalid);
|
||||
}
|
||||
return S_cas_success;
|
||||
}
|
||||
@@ -299,7 +299,7 @@ inline aitTimeStamp exPV::getTS()
|
||||
caStatus exPV::getSeconds(gdd &value)
|
||||
{
|
||||
aitUint32 sec (this->getTS().tv_sec);
|
||||
value.putConvert (sec);
|
||||
value.put(sec);
|
||||
return S_cas_success;
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ caStatus exPV::getSeconds(gdd &value)
|
||||
caStatus exPV::getNanoseconds(gdd &value)
|
||||
{
|
||||
aitUint32 nsec (this->getTS().tv_nsec);
|
||||
value.putConvert (nsec);
|
||||
value.put(nsec);
|
||||
return S_cas_success;
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ caStatus exPV::getNanoseconds(gdd &value)
|
||||
//
|
||||
caStatus exPV::getPrecision(gdd &prec)
|
||||
{
|
||||
prec.putConvert(4u);
|
||||
prec.put(4u);
|
||||
return S_cas_success;
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ caStatus exPV::getPrecision(gdd &prec)
|
||||
//
|
||||
caStatus exPV::getHighLimit(gdd &value)
|
||||
{
|
||||
value.putConvert(info.getHopr());
|
||||
value.put(info.getHopr());
|
||||
return S_cas_success;
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ caStatus exPV::getHighLimit(gdd &value)
|
||||
//
|
||||
caStatus exPV::getLowLimit(gdd &value)
|
||||
{
|
||||
value.putConvert(info.getLopr());
|
||||
value.put(info.getLopr());
|
||||
return S_cas_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
|
||||
#include <exServer.h>
|
||||
#include <fdMgr.h>
|
||||
#include <fdManager.h>
|
||||
|
||||
const pvInfo exServer::pvList[] = {
|
||||
pvInfo (1.0e-1, "jane", 10.0f, 0.0f, excasIoSync),
|
||||
|
||||
@@ -77,29 +77,6 @@ private:
|
||||
|
||||
class exPV;
|
||||
|
||||
//
|
||||
// exServer
|
||||
//
|
||||
class exServer : public caServer {
|
||||
public:
|
||||
exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate=0x3ff,
|
||||
unsigned maxSimultaneousIO=1u);
|
||||
void show (unsigned level);
|
||||
caStatus pvExistTest (const casCtx &ctxIn, const char *pPVName,
|
||||
gdd &canonicalPVName);
|
||||
casPV *createPV (const casCtx &ctxIn, const char *pPVName);
|
||||
|
||||
static const pvInfo *findPV(const char *pName);
|
||||
|
||||
static gddAppFuncTableStatus read(exPV &pv, gdd &value)
|
||||
{
|
||||
return exServer::ft.read(pv, value);
|
||||
}
|
||||
private:
|
||||
static const pvInfo pvList[];
|
||||
static gddAppFuncTable<exPV> ft;
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// exScanTimer
|
||||
@@ -191,6 +168,29 @@ private:
|
||||
static osiTime currentTime;
|
||||
};
|
||||
|
||||
//
|
||||
// exServer
|
||||
//
|
||||
class exServer : public caServer {
|
||||
public:
|
||||
exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate=0x3ff,
|
||||
unsigned maxSimultaneousIO=1u);
|
||||
void show (unsigned level);
|
||||
caStatus pvExistTest (const casCtx &ctxIn, const char *pPVName,
|
||||
gdd &canonicalPVName);
|
||||
casPV *createPV (const casCtx &ctxIn, const char *pPVName);
|
||||
|
||||
static const pvInfo *findPV(const char *pName);
|
||||
|
||||
static gddAppFuncTableStatus read(exPV &pv, gdd &value)
|
||||
{
|
||||
return exServer::ft.read(pv, value);
|
||||
}
|
||||
private:
|
||||
static const pvInfo pvList[];
|
||||
static gddAppFuncTable<exPV> ft;
|
||||
};
|
||||
|
||||
//
|
||||
// exSyncPV
|
||||
//
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
|
||||
* ca server installation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -48,14 +51,6 @@
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef OK
|
||||
#define OK 0
|
||||
#endif
|
||||
|
||||
#ifndef ERROR
|
||||
#define ERROR (-1)
|
||||
#endif
|
||||
|
||||
#ifndef NELEMENTS
|
||||
#define NELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
|
||||
#endif
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.2 1996/08/05 19:25:17 jhill
|
||||
* removed unused code
|
||||
*
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
|
||||
* ca server installation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -135,6 +141,10 @@ caStatus caServerI::init()
|
||||
int status;
|
||||
int resLibStatus;
|
||||
|
||||
if (this->osiMutex::init()) {
|
||||
return S_cas_noMemory;
|
||||
}
|
||||
|
||||
status = caServerIO::init();
|
||||
if (status) {
|
||||
return status;
|
||||
@@ -253,75 +263,6 @@ void caServerI::connectCB()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
//
|
||||
// caServerI::elapsedTimeCompare()
|
||||
//
|
||||
int caServerI::elapsedTimeCompare(
|
||||
const caTime &stamp1, const caTime &stamp2)
|
||||
{
|
||||
if (stamp1.sec == stamp2.sec) {
|
||||
if (stamp1.nsec == stamp2.nsec) {
|
||||
return 0;
|
||||
}
|
||||
else if (stamp1.nsec > stamp2.nsec) {
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else if (stamp1.sec > stamp2.sec) {
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
//
|
||||
// caServerI::getElapsedTime()
|
||||
//
|
||||
caTime caServerI::getElapsedTime (const caTime &stamp)
|
||||
{
|
||||
caTime elapsed;
|
||||
caTime current;
|
||||
caTime local = stamp;
|
||||
|
||||
//
|
||||
// OS dependent function - see casOSDInLine.h
|
||||
//
|
||||
current = caServerI::getTime();
|
||||
|
||||
//
|
||||
// this indicates wrap around
|
||||
//
|
||||
if (local.sec>current.sec) {
|
||||
unsigned long tmp;
|
||||
|
||||
tmp = ULONG_MAX - local.sec;
|
||||
assert (tmp < ULONG_MAX - current.sec);
|
||||
current.sec += tmp;
|
||||
local.sec = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// borrow
|
||||
//
|
||||
if (local.nsec > current.nsec) {
|
||||
assert (current.sec>0);
|
||||
assert (current.sec>=local.sec);
|
||||
current.sec--;
|
||||
assert (2*CAServerNSecInSec < ULONG_MAX);
|
||||
current.nsec += CAServerNSecInSec;
|
||||
}
|
||||
elapsed.sec = current.sec - local.sec;
|
||||
elapsed.nsec = current.nsec - local.nsec;
|
||||
|
||||
return elapsed;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// caServerI::advanceBeaconPeriod()
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.2 1996/07/01 19:56:09 jhill
|
||||
* one last update prior to first release
|
||||
*
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
|
||||
* ca server installation
|
||||
*
|
||||
@@ -57,7 +60,7 @@ casChannel::~casChannel()
|
||||
|
||||
casPV *casChannel::getPV()
|
||||
{
|
||||
casPVI &pvi(this->casChannelI::getPVI());
|
||||
casPVI pvi = this->casChannelI::getPVI();
|
||||
|
||||
if (&pvi!=NULL) {
|
||||
return pvi.intefaceObjectPointer();
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.2 1996/07/09 22:54:31 jhill
|
||||
* store msg copy in the ctx
|
||||
*
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
|
||||
* ca server installation
|
||||
*
|
||||
@@ -87,6 +90,10 @@ caStatus casClient::init()
|
||||
if (status) {
|
||||
return status;
|
||||
}
|
||||
status = this->casCoreClient::init();
|
||||
if (status) {
|
||||
return status;
|
||||
}
|
||||
|
||||
serverDebugLevel = this->ctx.getServer()->getDebugLevel();
|
||||
if (serverDebugLevel>0u) {
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
|
||||
* ca server installation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -219,7 +222,7 @@ caStatus casCoreClient::asyncIOCompletion(casChannelI *pChan,
|
||||
pAsyncIoCallBack pCB;
|
||||
|
||||
pCB = casCoreClient::asyncIOJumpTable[msg.m_cmmd];
|
||||
if (!pCB) {
|
||||
if (pCB==NULL) {
|
||||
return S_casApp_noSupport;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.3 1996/08/05 19:26:15 jhill
|
||||
* made os specific code smaller
|
||||
*
|
||||
* Revision 1.2 1996/06/26 21:18:52 jhill
|
||||
* now matches gdd api revisions
|
||||
*
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
|
||||
* ca server installation
|
||||
*
|
||||
@@ -204,7 +210,7 @@ caStatus casDGClient::searchResponse(casChannelI *nullPtr, const caHdr &msg,
|
||||
*search_reply = msg;
|
||||
search_reply->m_postsize = sizeof(*pMinorVersion);
|
||||
search_reply->m_cid = ~0U;
|
||||
search_reply->m_type = this->ctx.getServer()->serverPortNumber();
|
||||
search_reply->m_type = htons(this->ctx.getServer()->serverPortNumber());
|
||||
search_reply->m_count = 0ul;
|
||||
|
||||
/*
|
||||
@@ -290,3 +296,56 @@ void casDGClient::ioBlockedSignal()
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
// casDGClient::process()
|
||||
//
|
||||
void casDGClient::process()
|
||||
{
|
||||
caStatus status;
|
||||
casFlushCondition flushCond;
|
||||
casFillCondition fillCond;
|
||||
|
||||
//
|
||||
// force all replies to be sent to the client
|
||||
// that made the request
|
||||
//
|
||||
this->clear();
|
||||
|
||||
//
|
||||
// read in new input
|
||||
//
|
||||
fillCond = this->fill();
|
||||
if (fillCond == casFillDisconnect) {
|
||||
casVerify(0);
|
||||
return;
|
||||
}
|
||||
//
|
||||
// verify that we have a message to process
|
||||
//
|
||||
if (this->inBuf::bytesPresent()>0u) {
|
||||
//
|
||||
// process the message
|
||||
//
|
||||
status = this->processMsg();
|
||||
if (status) {
|
||||
errMessage (status,
|
||||
"unexpected error processing stateless protocol");
|
||||
//
|
||||
// clear the input buffer so this will
|
||||
// not effect future input
|
||||
//
|
||||
this->clear();
|
||||
}
|
||||
else {
|
||||
//
|
||||
// force all replies to go to the sender
|
||||
//
|
||||
flushCond = this->flush();
|
||||
if (flushCond!=casFlushCompleted) {
|
||||
this->clear();
|
||||
casVerify(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
|
||||
* ca server installation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -140,7 +143,7 @@ casProcCond casEventSys::process()
|
||||
* not accepted so return to the head of the list
|
||||
* (we will try again later)
|
||||
*/
|
||||
this->insertEventQueue(*pEvent);
|
||||
this->pushOnToEventQueue(*pEvent);
|
||||
cond = casProcOk;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.3 1996/07/01 19:56:11 jhill
|
||||
* one last update prior to first release
|
||||
*
|
||||
* Revision 1.2 1996/06/26 21:18:56 jhill
|
||||
* now matches gdd api revisions
|
||||
*
|
||||
@@ -177,7 +180,7 @@ void casMonitor::push(gdd &newValue)
|
||||
pLog->assign(*this, pValue);
|
||||
gddStatus = pValue->unreference();
|
||||
assert(!gddStatus);
|
||||
client.insertEventQueue(*pLog, &this->overFlowEvent);
|
||||
client.insertEventQueue(*pLog, this->overFlowEvent);
|
||||
}
|
||||
else {
|
||||
//
|
||||
|
||||
@@ -29,6 +29,12 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.7 1996/08/05 19:26:51 jhill
|
||||
* doc
|
||||
*
|
||||
* Revision 1.5 1996/07/09 22:53:33 jhill
|
||||
* init stat and sev in gdd
|
||||
*
|
||||
* Revision 1.4 1996/07/01 19:56:14 jhill
|
||||
* one last update prior to first release
|
||||
*
|
||||
@@ -1346,7 +1352,7 @@ caStatus casStrmClient::write()
|
||||
status = this->writeArrayData();
|
||||
}
|
||||
else {
|
||||
status = this->writeScalerData();
|
||||
status = this->writeScalarData();
|
||||
}
|
||||
|
||||
(*pPV)->endTransaction();
|
||||
@@ -1356,9 +1362,9 @@ caStatus casStrmClient::write()
|
||||
|
||||
|
||||
//
|
||||
// casStrmClient::writeScalerData()
|
||||
// casStrmClient::writeScalarData()
|
||||
//
|
||||
caStatus casStrmClient::writeScalerData()
|
||||
caStatus casStrmClient::writeScalarData()
|
||||
{
|
||||
gdd *pDD;
|
||||
const caHdr *pHdr = this->ctx.getMsg();
|
||||
@@ -1371,7 +1377,7 @@ caStatus casStrmClient::writeScalerData()
|
||||
return S_cas_badType;
|
||||
}
|
||||
|
||||
pDD = new gddScaler (gddAppType_value, type);
|
||||
pDD = new gddScalar (gddAppType_value, type);
|
||||
if (!pDD) {
|
||||
return S_cas_noMemory;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* $Log$
|
||||
* Revision 1.4 1996/07/01 19:56:15 jhill
|
||||
* one last update prior to first release
|
||||
*
|
||||
* Revision 1.3 1996/06/26 23:08:55 jhill
|
||||
* took path out of casInternal.h include
|
||||
*
|
||||
@@ -477,6 +480,10 @@ public:
|
||||
casChannel(const casCtx &ctx);
|
||||
virtual ~casChannel();
|
||||
|
||||
//
|
||||
// Called when the user name and the host name are changed
|
||||
// for a live connection.
|
||||
//
|
||||
virtual void setOwner(const char * const pUserName,
|
||||
const char * const pHostName);
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
|
||||
* ca server installation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -133,16 +136,12 @@ caHdr **ppMsg
|
||||
void outBuf::commitMsg ()
|
||||
{
|
||||
caHdr *mp;
|
||||
bufSizeT size;
|
||||
bufSizeT extSize;
|
||||
bufSizeT diff;
|
||||
|
||||
assert (this->bufSize);
|
||||
|
||||
mp = (caHdr *) &this->pBuf[this->stack];
|
||||
|
||||
extSize = CA_MESSAGE_ALIGN(mp->m_postsize);
|
||||
assert((extSize&0x7)==0);
|
||||
|
||||
//
|
||||
// Guarantee that all portions of outgoing messages
|
||||
@@ -177,8 +176,7 @@ assert((extSize&0x7)==0);
|
||||
mp->m_cid = htonl (mp->m_cid);
|
||||
mp->m_available = htonl (mp->m_available);
|
||||
|
||||
size = sizeof(caHdr) + mp->m_postsize;
|
||||
this->stack += size;
|
||||
this->stack += sizeof(caHdr) + extSize;
|
||||
assert (this->stack <= this->bufSize);
|
||||
|
||||
this->mutex.unlock();
|
||||
|
||||
@@ -29,6 +29,18 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.8 1996/08/05 23:22:58 jhill
|
||||
* gddScaler => gddScalar
|
||||
*
|
||||
* Revision 1.7 1996/08/05 19:27:28 jhill
|
||||
* added process()
|
||||
*
|
||||
* Revision 1.5 1996/07/24 22:00:50 jhill
|
||||
* added pushOnToEventQueue()
|
||||
*
|
||||
* Revision 1.4 1996/07/09 22:51:14 jhill
|
||||
* store copy of msg in ctx
|
||||
*
|
||||
* Revision 1.3 1996/06/26 21:19:04 jhill
|
||||
* now matches gdd api revisions
|
||||
*
|
||||
@@ -162,8 +174,8 @@ private:
|
||||
virtual void osdShow (unsigned level) const = 0;
|
||||
};
|
||||
|
||||
#include <casIOD.h> // IO dependent
|
||||
#include <casOSD.h> // OS dependent
|
||||
#include <casIOD.h> // IO dependent
|
||||
|
||||
enum casProcCond {casProcOk, casProcDisconnect};
|
||||
|
||||
@@ -200,6 +212,13 @@ public:
|
||||
eventsOff(aitFalse)
|
||||
{
|
||||
}
|
||||
init()
|
||||
{
|
||||
if (mutex.init()) {
|
||||
return S_cas_noMemory;
|
||||
}
|
||||
return S_cas_success;
|
||||
}
|
||||
~casEventSys();
|
||||
|
||||
void show(unsigned level);
|
||||
@@ -212,7 +231,9 @@ public:
|
||||
|
||||
void removeFromEventQueue(casEvent &);
|
||||
inline void addToEventQueue(casEvent &);
|
||||
void insertEventQueue(casEvent &insert, casEvent *pPrev=NULL);
|
||||
|
||||
void insertEventQueue(casEvent &insert, casEvent &prevEvent);
|
||||
void pushOnToEventQueue(casEvent &event);
|
||||
|
||||
aitBool full();
|
||||
|
||||
@@ -249,10 +270,20 @@ private:
|
||||
//
|
||||
// casEventSys::insertEventQueue()
|
||||
//
|
||||
inline void casEventSys::insertEventQueue(casEvent &insert, casEvent *pPrevEvent)
|
||||
inline void casEventSys::insertEventQueue(casEvent &insert, casEvent &prevEvent)
|
||||
{
|
||||
this->mutex.lock();
|
||||
this->eventLogQue.insert(insert, pPrevEvent);
|
||||
this->eventLogQue.insertAfter(insert, prevEvent);
|
||||
this->mutex.unlock();
|
||||
}
|
||||
|
||||
//
|
||||
// casEventSys::pushOnToEventQueue()
|
||||
//
|
||||
inline void casEventSys::pushOnToEventQueue(casEvent &event)
|
||||
{
|
||||
this->mutex.lock();
|
||||
this->eventLogQue.push(event);
|
||||
this->mutex.unlock();
|
||||
}
|
||||
|
||||
@@ -303,11 +334,6 @@ public:
|
||||
private:
|
||||
};
|
||||
|
||||
//
|
||||
// ndim == 0 => scaler
|
||||
// otherwise pIndexArray points to an array of ndim items
|
||||
//
|
||||
#define nDimScaler 0U
|
||||
class casCtx {
|
||||
public:
|
||||
casCtx() :
|
||||
@@ -519,6 +545,13 @@ class casCoreClient : public osiMutex, public ioBlocked,
|
||||
public casEventSys {
|
||||
public:
|
||||
casCoreClient(caServerI &serverInternal);
|
||||
caStatus init()
|
||||
{
|
||||
if (this->osiMutex::init()) {
|
||||
return S_cas_noMemory;
|
||||
}
|
||||
return this->casEventSys::init();
|
||||
}
|
||||
virtual ~casCoreClient();
|
||||
virtual void destroy();
|
||||
virtual caStatus disconnectChan(caResId id);
|
||||
@@ -793,7 +826,7 @@ private:
|
||||
caStatus channelCreateFailed (const caHdr *mp, caStatus createStatus);
|
||||
|
||||
caStatus writeArrayData();
|
||||
caStatus writeScalerData();
|
||||
caStatus writeScalarData();
|
||||
caStatus writeString();
|
||||
};
|
||||
|
||||
@@ -835,6 +868,10 @@ public:
|
||||
}
|
||||
|
||||
void destroy();
|
||||
|
||||
protected:
|
||||
void process();
|
||||
|
||||
private:
|
||||
void ioBlockedSignal(); // dummy
|
||||
|
||||
@@ -895,11 +932,6 @@ public:
|
||||
|
||||
void removeClient(casStrmClient *pClient);
|
||||
|
||||
casStrmClient *firstClient() const
|
||||
{
|
||||
return clientList.first();
|
||||
}
|
||||
|
||||
unsigned getMaxSimultaneousIO() const {return this->maxSimultaneousIO;}
|
||||
|
||||
//
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
// Some BSD calls have crept in here
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 1996/07/24 22:03:36 jhill
|
||||
// fixed net proto for gnu compiler
|
||||
//
|
||||
// Revision 1.1.1.1 1996/06/20 00:28:18 jhill
|
||||
// ca server installation
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef includeCASIODH
|
||||
@@ -21,9 +27,8 @@ extern "C" {
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#if 0 // func proto do not have args for C++
|
||||
#ifndef SUNOS4 // func proto do not have args for C++ (under sunos4)
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -42,13 +47,15 @@ typedef int SOCKET;
|
||||
|
||||
void hostNameFromIPAddr (const caAddr *pAddr,
|
||||
char *pBuf, unsigned bufSize);
|
||||
#if 0
|
||||
//
|
||||
// assuming al posix machines are IEEE fload will be wrong
|
||||
// assuming al posix machines are IEEE float will be wrong
|
||||
//
|
||||
#define ntohf(A) (A)
|
||||
#define ntohd(A) (A)
|
||||
#define htonf(A) (A)
|
||||
#define htond(A) (A)
|
||||
#endif
|
||||
|
||||
class caServerIO {
|
||||
public:
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
//
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.3 1996/07/09 22:55:22 jhill
|
||||
// added cast
|
||||
//
|
||||
// Revision 1.2 1996/06/21 02:18:11 jhill
|
||||
// SOLARIS port
|
||||
//
|
||||
@@ -20,7 +23,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#ifndef SUNOS4 // the SUNOS4 prototypes are trad C - see bsdProto.h
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
*
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
|
||||
* ca server installation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -108,6 +111,6 @@ casServerReg::~casServerReg()
|
||||
//
|
||||
int caServerOS::getFD()
|
||||
{
|
||||
return cas.caServerIO::getFD();
|
||||
return cas.caServerIO::getFD();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
*
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
|
||||
* ca server installation
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -166,54 +169,9 @@ casProcCond casDGOS::processInput ()
|
||||
//
|
||||
void casDGReadReg::callBack()
|
||||
{
|
||||
caStatus status;
|
||||
casFlushCondition flushCond;
|
||||
casFillCondition fillCond;
|
||||
|
||||
assert (os.pRdReg);
|
||||
|
||||
//
|
||||
// force all replies to be sent to the client
|
||||
// that made the request
|
||||
//
|
||||
os.clear();
|
||||
|
||||
//
|
||||
// read in new input
|
||||
//
|
||||
fillCond = os.fill();
|
||||
if (fillCond == casFillDisconnect) {
|
||||
casVerify(0);
|
||||
return;
|
||||
}
|
||||
//
|
||||
// verify that we have a message to process
|
||||
//
|
||||
if (os.inBuf::bytesPresent()>0u) {
|
||||
//
|
||||
// process the message
|
||||
//
|
||||
status = os.processMsg();
|
||||
if (status) {
|
||||
errMessage (status,
|
||||
"unexpected error processing stateless protocol");
|
||||
//
|
||||
// clear the input buffer so this will
|
||||
// not effect future input
|
||||
//
|
||||
os.clear();
|
||||
}
|
||||
else {
|
||||
//
|
||||
// force all replies to go to the sender
|
||||
//
|
||||
flushCond = os.flush();
|
||||
if (flushCond!=casFlushCompleted) {
|
||||
os.clear();
|
||||
casVerify(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
os.process();
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
// Some BSD calls have crept in here
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
|
||||
// ca server installation
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef includeCASOSDH
|
||||
@@ -21,12 +24,12 @@ extern "C" {
|
||||
// for htons() etc
|
||||
//
|
||||
# include <netinet/in.h>
|
||||
|
||||
# include <netdb.h>
|
||||
} // extern "C"
|
||||
|
||||
#include <osiMutex.h>
|
||||
#include <osiTimer.h>
|
||||
#include <fdMgr.h>
|
||||
#include <fdManager.h>
|
||||
|
||||
class caServerI;
|
||||
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
* Some of this isnt posix - its BSD
|
||||
*
|
||||
* $Log$
|
||||
*/
|
||||
|
||||
#ifndef includeCasSpecificOSH
|
||||
#define includeCasSpecificOSH
|
||||
|
||||
#include <singleThread.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <bsdProto.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
typedef int SOCKET;
|
||||
#define SOCKERRNO errno
|
||||
#define socket_close(S) close(S)
|
||||
#define socket_ioctl(A,B,C) ioctl(A,B,C)
|
||||
|
||||
#define ntohf(A) (A)
|
||||
#define ntohd(A) (A)
|
||||
#define htonf(A) (A)
|
||||
#define htond(A) (A)
|
||||
|
||||
#endif /* ifndef includeCasSpecificOSH (no new code below this line) */
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
|
||||
|
||||
//
|
||||
// osiMutex - OS independent mutex
|
||||
// (NOOP on single threaded OS)
|
||||
//
|
||||
class osiMutex {
|
||||
public:
|
||||
//
|
||||
// constructor that returns status
|
||||
// (since g++ does not have exceptions)
|
||||
//
|
||||
int init() {return 0;}
|
||||
void lock() {};
|
||||
void unlock() {};
|
||||
private:
|
||||
|
||||
@@ -29,6 +29,15 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.3 1996/07/25 17:58:16 jhill
|
||||
* fixed missing ref in list decl
|
||||
*
|
||||
* Revision 1.2 1996/07/24 22:12:02 jhill
|
||||
* added remove() to iter class + made node's prev/next private
|
||||
*
|
||||
* Revision 1.1.1.1 1996/06/20 22:15:55 jhill
|
||||
* installed ca server templates
|
||||
*
|
||||
*
|
||||
* NOTES:
|
||||
* .01 Storage for identifier must persist until an item is deleted
|
||||
@@ -38,9 +47,12 @@
|
||||
#ifndef INCresourceLibh
|
||||
#define INCresourceLibh
|
||||
|
||||
#include <tsSLList.h>
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <tsSLList.h>
|
||||
|
||||
typedef int resLibStatus;
|
||||
typedef unsigned resTableIndex;
|
||||
|
||||
@@ -94,14 +106,11 @@ public:
|
||||
while (pList<&this->pTable[this->hashIdMask+1]) {
|
||||
tsSLIter<T> iter(*pList);
|
||||
T *pItem;
|
||||
T *pNextItem;
|
||||
|
||||
pItem = iter();
|
||||
while (pItem) {
|
||||
pNextItem = iter();
|
||||
while ( (pItem = iter()) ) {
|
||||
iter.remove();
|
||||
delete pItem;
|
||||
this->nInUse--;
|
||||
pItem = pNextItem;
|
||||
}
|
||||
pList++;
|
||||
}
|
||||
@@ -159,10 +168,10 @@ public:
|
||||
// T must derive from ID
|
||||
//
|
||||
tsSLList<T> &list = this->pTable[this->hash(res)];
|
||||
tsSLNode<T> *pPrev;
|
||||
tsSLIter<T> iter(list);
|
||||
|
||||
pPrev = this->find(list, res);
|
||||
if (pPrev) {
|
||||
this->find(iter, res);
|
||||
if (iter.current()) {
|
||||
return -1;
|
||||
}
|
||||
list.add(res);
|
||||
@@ -172,31 +181,25 @@ public:
|
||||
|
||||
T *remove (const ID &idIn)
|
||||
{
|
||||
tsSLList<T> &list = this->pTable[this->hash(idIn)];
|
||||
tsSLNode<T> *pPrev;
|
||||
T *pItem;
|
||||
tsSLIter<T> iter(this->pTable[this->hash(idIn)]);
|
||||
T *pCur;
|
||||
|
||||
pPrev = this->find(list, idIn);
|
||||
if (!pPrev) {
|
||||
return 0;
|
||||
this->find(iter, idIn);
|
||||
pCur = iter.current();
|
||||
if (pCur) {
|
||||
this->nInUse--;
|
||||
iter.remove();
|
||||
}
|
||||
this->nInUse--;
|
||||
pItem = pPrev->next();
|
||||
list.remove(*pItem, *pPrev);
|
||||
return pItem;
|
||||
return pCur;
|
||||
}
|
||||
|
||||
|
||||
T *lookup (const ID &idIn)
|
||||
{
|
||||
tsSLList<T> &list = this->pTable[this->hash(idIn)];
|
||||
tsSLNode<T> *pPrev;
|
||||
tsSLIter<T> iter(this->pTable[this->hash(idIn)]);
|
||||
|
||||
pPrev = this->find(list, idIn);
|
||||
if (pPrev) {
|
||||
return pPrev->next();
|
||||
}
|
||||
return NULL;
|
||||
this->find(iter, idIn);
|
||||
return iter.current();
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -213,22 +216,25 @@ private:
|
||||
}
|
||||
|
||||
//
|
||||
// beware - this returns a pointer to the node just prior to the
|
||||
// the item found on the list
|
||||
// find
|
||||
// searches from where the iterator points to the
|
||||
// end of the list for idIn
|
||||
//
|
||||
tsSLNode<T> *find(tsSLList<T> &list, const ID &idIn)
|
||||
// iterator points to the item found upon return
|
||||
// (or NULL if nothing matching was found)
|
||||
//
|
||||
void find (tsSLIter<T> &iter, const ID &idIn)
|
||||
{
|
||||
tsSLIter<T> iter(list);
|
||||
T *pItem;
|
||||
ID *pId;
|
||||
|
||||
while ( (pItem = iter()) ) {
|
||||
pId = pItem;
|
||||
if (*pId == idIn) {
|
||||
return iter.prev();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
7
src/cxxTemplates/test/Makefile
Normal file
7
src/cxxTemplates/test/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
TOP=../../..
|
||||
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
include $(TOP)/config/RULES_ARCHS
|
||||
|
||||
35
src/cxxTemplates/test/Makefile.Unix
Normal file
35
src/cxxTemplates/test/Makefile.Unix
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
TOP = ../../../..
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
SRCS.cc += ../resourceLibTest.cc
|
||||
SRCS.cc += ../tsDLListBench.cc
|
||||
SRCS.cc += ../tsDLListTest.cc
|
||||
SRCS.cc += ../tsSLListBench.cc
|
||||
SRCS.cc += ../tsSLListTest.cc
|
||||
|
||||
TARGETS += buildHere
|
||||
#TARGETS += resourceLibTest
|
||||
#TARGETS += tsDLListBench
|
||||
#TARGETS += tsDLListTest
|
||||
#TARGETS += tsSLListTest
|
||||
|
||||
include $(TOP)/config/RULES.Unix
|
||||
|
||||
buildHere: resourceLibTest tsDLListBench tsDLListTest tsSLListBench tsSLListTest
|
||||
|
||||
resourceLibTest: resourceLibTest.o
|
||||
$(LINK.cc) -o $@ $<
|
||||
|
||||
tsDLListBench: tsDLListBench.o
|
||||
$(LINK.cc) -o $@ $<
|
||||
|
||||
tsDLListTest: tsDLListTest.o
|
||||
$(LINK.cc) -o $@ $<
|
||||
|
||||
tsSLListBench: tsSLListBench.o
|
||||
$(LINK.cc) -o $@ $<
|
||||
|
||||
tsSLListTest: tsSLListTest.o
|
||||
$(LINK.cc) -o $@ $<
|
||||
|
||||
@@ -5,57 +5,37 @@
|
||||
#include <stdio.h>
|
||||
#include <resourceLib.h>
|
||||
|
||||
class uintId {
|
||||
public:
|
||||
uintId (unsigned idIn) : id(idIn) {}
|
||||
|
||||
resourceTableID resourceHash(unsigned nBitsId) const
|
||||
{
|
||||
unsigned src = this->id;
|
||||
resourceTableID hashid;
|
||||
|
||||
hashid = src;
|
||||
src = src >> nBitsId;
|
||||
while (src) {
|
||||
hashid = hashid ^ src;
|
||||
src = src >> nBitsId;
|
||||
}
|
||||
//
|
||||
// the result here is always masked to the
|
||||
// proper size after it is returned to the resource class
|
||||
//
|
||||
return hashid;
|
||||
}
|
||||
|
||||
int operator == (const uintId &idIn)
|
||||
{
|
||||
return this->id == idIn.id;
|
||||
}
|
||||
private:
|
||||
unsigned const id;
|
||||
};
|
||||
#ifdef SUNOS4
|
||||
#ifndef CLOCKS_PER_SEC
|
||||
#define CLOCKS_PER_SEC 1000000
|
||||
#endif
|
||||
#endif
|
||||
|
||||
class fred : public uintId, tsSLNode<fred> {
|
||||
public:
|
||||
fred (const char *pNameIn, unsigned idIn) :
|
||||
pName(pNameIn), uintId(idIn) {}
|
||||
void show (unsigned)
|
||||
{
|
||||
printf("fred %s\n", pName);
|
||||
}
|
||||
private:
|
||||
const char * const pName;
|
||||
};
|
||||
|
||||
main()
|
||||
{
|
||||
unsigned i;
|
||||
clock_t start, finish;
|
||||
double duration;
|
||||
const int LOOPS = 500000;
|
||||
resourceTable<fred,uintId> tbl;
|
||||
fred fred1("fred1",0x1000a432);
|
||||
fred fred2("fred2",0x0000a432);
|
||||
fred *pFred;
|
||||
uintId id1(0x1000a432);
|
||||
uintId id2(0x0000a432);
|
||||
int status;
|
||||
unsigned i;
|
||||
clock_t start, finish;
|
||||
double duration;
|
||||
const int LOOPS = 500000;
|
||||
resTable<fred,uintId> tbl;
|
||||
fred fred1("fred1",0x1000a432);
|
||||
fred fred2("fred2",0x0000a432);
|
||||
fred *pFred;
|
||||
uintId id1(0x1000a432);
|
||||
uintId id2(0x0000a432);
|
||||
int status;
|
||||
|
||||
status = tbl.init(8);
|
||||
if (status) {
|
||||
|
||||
@@ -35,9 +35,9 @@ main ()
|
||||
|
||||
list.add(*pFred);
|
||||
list.add(*pFredII);
|
||||
pFredBack = list.first();
|
||||
pFredBack = iter();
|
||||
assert(pFredBack == pFred);
|
||||
pFredBack = list.last();
|
||||
pFredBack = iter();
|
||||
assert(pFredBack == pFredII);
|
||||
list.remove(*pFred);
|
||||
list.add(*pFred);
|
||||
@@ -51,6 +51,7 @@ main ()
|
||||
list.add(* new fred("C"));
|
||||
list.add(* new fred("D"));
|
||||
|
||||
iter.reset();
|
||||
while (pFredBack = iter()) {
|
||||
pFredBack->show();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <tsSLList.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
class fred : public tsSLNode<fred> {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <tsSLList.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class fred : public tsSLNode<fred> {
|
||||
public:
|
||||
@@ -34,14 +35,22 @@ main ()
|
||||
|
||||
list.add(*pFred);
|
||||
list.add(*pFredII);
|
||||
pFredBack = list.first();
|
||||
pFredBack = iter();
|
||||
assert(pFredBack == pFredII);
|
||||
list.remove(*pFred, *pFredII);
|
||||
list.remove(*pFredII); // removes *pFred !!
|
||||
list.add(*pFred);
|
||||
pFredBack = list.get();
|
||||
assert (pFredBack == pFred);
|
||||
pFredBack = list.get();
|
||||
assert (pFredBack == pFredII);
|
||||
list.add(*pFredII);
|
||||
list.add(*pFred);
|
||||
iter.reset();
|
||||
pFredBack = iter();
|
||||
iter.remove();
|
||||
iter.remove();
|
||||
pFredBack = list.get();
|
||||
assert (pFredBack == 0);
|
||||
list.add(*pFred);
|
||||
list.add(*pFredII);
|
||||
list.add(* new fred("C"));
|
||||
|
||||
@@ -31,6 +31,15 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.3 1996/07/25 18:01:41 jhill
|
||||
* use pointer (not ref) for list in iter class
|
||||
*
|
||||
* Revision 1.2 1996/07/24 22:12:03 jhill
|
||||
* added remove() to iter class + made node's prev/next private
|
||||
*
|
||||
* Revision 1.1.1.1 1996/06/20 22:15:55 jhill
|
||||
* installed ca server templates
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -42,6 +51,7 @@
|
||||
//
|
||||
template <class T>
|
||||
class tsDLList {
|
||||
friend class tsDLIter<T>;
|
||||
private:
|
||||
//
|
||||
// clear()
|
||||
@@ -59,7 +69,8 @@ public:
|
||||
}
|
||||
|
||||
//
|
||||
// adds addList to this (and removes all items from addList)
|
||||
// installs items in addList on the list
|
||||
// (and removes all items from addList)
|
||||
//
|
||||
tsDLList (tsDLList<T> &addList)
|
||||
{
|
||||
@@ -67,24 +78,9 @@ public:
|
||||
addList.clear();
|
||||
}
|
||||
|
||||
//
|
||||
// first()
|
||||
//
|
||||
T *first() const
|
||||
{
|
||||
return (T *) this->pFirst;
|
||||
}
|
||||
|
||||
//
|
||||
// last()
|
||||
//
|
||||
T *last() const
|
||||
{
|
||||
return (T *) this->pLast;
|
||||
}
|
||||
|
||||
//
|
||||
// count()
|
||||
// (returns the number of items on the list)
|
||||
//
|
||||
unsigned count() const
|
||||
{
|
||||
@@ -93,7 +89,8 @@ public:
|
||||
|
||||
//
|
||||
// add() -
|
||||
// adds addList to this (and removes all items from addList)
|
||||
// adds addList to the end of the list
|
||||
// (and removes all items from addList)
|
||||
//
|
||||
void add (tsDLList<T> &addList)
|
||||
{
|
||||
@@ -129,7 +126,8 @@ public:
|
||||
|
||||
|
||||
//
|
||||
// add() - an item
|
||||
// add()
|
||||
// (add an item to the end of the list)
|
||||
//
|
||||
void add (T &item)
|
||||
{
|
||||
@@ -149,24 +147,28 @@ public:
|
||||
}
|
||||
|
||||
//
|
||||
// insert()
|
||||
// pItemBefore==0 => make item be the first item on the list
|
||||
// pItemBefore!=0 => place item in the list immediately after
|
||||
// pItemBefore
|
||||
// get ()
|
||||
//
|
||||
void insert (T &item, T *pItemBefore=0)
|
||||
T * get()
|
||||
{
|
||||
if (pItemBefore) {
|
||||
item.tsDLNode<T>::pPrev = pItemBefore;
|
||||
item.tsDLNode<T>::pNext =
|
||||
pItemBefore->tsDLNode<T>::pNext;
|
||||
pItemBefore->tsDLNode<T>::pNext = &item;
|
||||
}
|
||||
else {
|
||||
item.tsDLNode<T>::pPrev = 0;
|
||||
item.tsDLNode<T>::pNext = this->pFirst;
|
||||
this->pFirst = &item;
|
||||
T *pItem = this->pFirst;
|
||||
|
||||
if (pItem) {
|
||||
this->remove (*pItem);
|
||||
}
|
||||
|
||||
return pItem;
|
||||
}
|
||||
|
||||
//
|
||||
// insertAfter()
|
||||
// (place item in the list immediately after itemBefore)
|
||||
//
|
||||
void insertAfter (T &item, T &itemBefore)
|
||||
{
|
||||
item.tsDLNode<T>::pPrev = &itemBefore;
|
||||
item.tsDLNode<T>::pNext = itemBefore.tsDLNode<T>::pNext;
|
||||
itemBefore.tsDLNode<T>::pNext = &item;
|
||||
|
||||
if (item.tsDLNode<T>::pNext) {
|
||||
item.tsDLNode<T>::pNext->tsDLNode<T>::pPrev = &item;
|
||||
@@ -178,6 +180,26 @@ public:
|
||||
this->itemCount++;
|
||||
}
|
||||
|
||||
//
|
||||
// insertBefore ()
|
||||
// (place item in the list immediately before itemAfter)
|
||||
//
|
||||
void insertBefore (T &item, T &itemAfter)
|
||||
{
|
||||
item.tsDLNode<T>::pNext = &itemAfter;
|
||||
item.tsDLNode<T>::pPrev = itemAfter.tsDLNode<T>::pPrev;
|
||||
itemAfter.tsDLNode<T>::pPrev = &item;
|
||||
|
||||
if (item.tsDLNode<T>::pPrev) {
|
||||
item.tsDLNode<T>::pPrev->tsDLNode<T>::pNext = &item;
|
||||
}
|
||||
else {
|
||||
this->pFirst = &item;
|
||||
}
|
||||
|
||||
this->itemCount++;
|
||||
}
|
||||
|
||||
//
|
||||
// remove ()
|
||||
//
|
||||
@@ -202,20 +224,49 @@ public:
|
||||
this->itemCount--;
|
||||
}
|
||||
|
||||
//
|
||||
// get ()
|
||||
//
|
||||
T * get()
|
||||
{
|
||||
T *pItem = this->pFirst;
|
||||
|
||||
if (pItem) {
|
||||
this->remove (*pItem);
|
||||
}
|
||||
|
||||
return pItem;
|
||||
//
|
||||
// pop ()
|
||||
// (returns the first item on the list)
|
||||
T * pop()
|
||||
{
|
||||
return this->get();
|
||||
}
|
||||
|
||||
//
|
||||
// push ()
|
||||
// (add an item at the beginning of the list)
|
||||
//
|
||||
void push (T &item)
|
||||
{
|
||||
item.tsDLNode<T>::pPrev = 0;
|
||||
item.tsDLNode<T>::pNext = this->pFirst;
|
||||
|
||||
if (this->itemCount) {
|
||||
this->pFirst->tsDLNode<T>::pPrev = &item;
|
||||
}
|
||||
else {
|
||||
this->pLast = &item;
|
||||
}
|
||||
|
||||
this->pFirst = &item;
|
||||
|
||||
this->itemCount++;
|
||||
}
|
||||
|
||||
//
|
||||
// find
|
||||
// returns -1 if the item isnt on the list
|
||||
// and the node number (beginning with zero if
|
||||
// it is)
|
||||
//
|
||||
int find(T &item);
|
||||
|
||||
T *first(void) const { return pFirst; }
|
||||
|
||||
protected:
|
||||
T *getFirst(void) const { return pFirst; }
|
||||
T *getLast(void) const { return pLast; }
|
||||
private:
|
||||
T *pFirst;
|
||||
T *pLast;
|
||||
@@ -232,13 +283,14 @@ friend class tsDLIter<T>;
|
||||
public:
|
||||
tsDLNode() : pNext(0), pPrev(0) {}
|
||||
//
|
||||
// when someone copies int a class deriving from this
|
||||
// when someone copies in a class deriving from this
|
||||
// do _not_ change the node pointers
|
||||
//
|
||||
void operator = (tsDLNode<T> &) {}
|
||||
|
||||
T *getPrev() {return this->pPrev;}
|
||||
T *getNext() {return this->pNext;}
|
||||
|
||||
protected:
|
||||
T *getNext(void) { return pNext; }
|
||||
T *getPrev(void) { return pPrev; }
|
||||
private:
|
||||
T *pNext;
|
||||
T *pPrev;
|
||||
@@ -251,7 +303,7 @@ template <class T>
|
||||
class tsDLIter {
|
||||
public:
|
||||
tsDLIter(tsDLList<T> &listIn) :
|
||||
list(listIn), pCurrent(0) {}
|
||||
pList(&listIn), pCurrent(0) {}
|
||||
|
||||
void reset ()
|
||||
{
|
||||
@@ -261,7 +313,7 @@ public:
|
||||
void reset (tsDLList<T> &listIn)
|
||||
{
|
||||
this->reset();
|
||||
this->list = listIn;
|
||||
this->pList = &listIn;
|
||||
}
|
||||
|
||||
void operator = (tsDLList<T> &listIn)
|
||||
@@ -269,11 +321,29 @@ public:
|
||||
this->reset(listIn);
|
||||
}
|
||||
|
||||
T * operator () ()
|
||||
T * current ()
|
||||
{
|
||||
return this->pCurrent;
|
||||
}
|
||||
|
||||
T * prev ()
|
||||
{
|
||||
T *pCur = this->pCurrent;
|
||||
if (pCur==0) {
|
||||
pCur = this->list.first();
|
||||
pCur = this->pList->pLast;
|
||||
}
|
||||
else {
|
||||
pCur = pCur->tsDLNode<T>::pPrev;
|
||||
}
|
||||
this->pCurrent = pCur;
|
||||
return pCur;
|
||||
}
|
||||
|
||||
T * next ()
|
||||
{
|
||||
T *pCur = this->pCurrent;
|
||||
if (pCur==0) {
|
||||
pCur = this->pList->pFirst;
|
||||
}
|
||||
else {
|
||||
pCur = pCur->tsDLNode<T>::pNext;
|
||||
@@ -281,10 +351,72 @@ public:
|
||||
this->pCurrent = pCur;
|
||||
return pCur;
|
||||
}
|
||||
|
||||
T * first()
|
||||
{
|
||||
this->pCurrent = this->pList->pFirst;
|
||||
return this->pCurrent;
|
||||
}
|
||||
|
||||
T * last()
|
||||
{
|
||||
this->pCurrent = this->pList->pLast;
|
||||
return this->pCurrent;
|
||||
}
|
||||
|
||||
T * operator () ()
|
||||
{
|
||||
return this->next();
|
||||
}
|
||||
|
||||
//
|
||||
// remove ()
|
||||
// remove current item
|
||||
// (and move current to be the next item
|
||||
// in the list)
|
||||
//
|
||||
void remove ()
|
||||
{
|
||||
T *pCur = this->pCurrent;
|
||||
if (pCur) {
|
||||
//
|
||||
// move current to the next item
|
||||
//
|
||||
this->next();
|
||||
//
|
||||
// delete current item
|
||||
//
|
||||
this->pList->remove(*pCur);
|
||||
}
|
||||
}
|
||||
protected:
|
||||
tsDLList<T> *getList() { return pList; }
|
||||
private:
|
||||
tsDLList<T> &list;
|
||||
tsDLList<T> *pList;
|
||||
T *pCurrent;
|
||||
};
|
||||
|
||||
//
|
||||
// find
|
||||
// returns -1 if the item isnt on the list
|
||||
// and the node number (beginning with zero if
|
||||
// it is)
|
||||
//
|
||||
template <class T>
|
||||
inline int tsDLList<T>::find(T &item)
|
||||
{
|
||||
tsDLIter<T> iter(*this);
|
||||
tsDLNode<T> *pItem;
|
||||
int itemNo=0;
|
||||
|
||||
while ( (pItem = iter()) ) {
|
||||
if (pItem == &item) {
|
||||
return itemNo;
|
||||
}
|
||||
itemNo++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif // tsDLListH_include
|
||||
|
||||
|
||||
@@ -31,6 +31,12 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.2 1996/07/24 22:12:04 jhill
|
||||
* added remove() to iter class + made node's prev/next private
|
||||
*
|
||||
* Revision 1.1.1.1 1996/06/20 22:15:55 jhill
|
||||
* installed ca server templates
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -40,15 +46,6 @@
|
||||
template <class T>
|
||||
class tsSLList : public tsSLNode<T> {
|
||||
public:
|
||||
tsSLList () {}
|
||||
|
||||
//
|
||||
// first()
|
||||
//
|
||||
T *first() const
|
||||
{
|
||||
return this->tsSLNode<T>::pNext;
|
||||
}
|
||||
|
||||
//
|
||||
// insert()
|
||||
@@ -71,12 +68,16 @@ public:
|
||||
|
||||
//
|
||||
// remove ()
|
||||
// **** removes item after "itemBefore" ****
|
||||
// (itemBefore might be the list header object and therefore
|
||||
// will not always be of type T)
|
||||
//
|
||||
void remove (T &item, tsSLNode<T> &itemBefore)
|
||||
void remove (tsSLNode<T> &itemBefore)
|
||||
{
|
||||
itemBefore.tsSLNode<T>::pNext = item.tsSLNode<T>::pNext;
|
||||
T *pItem = itemBefore.tsSLNode<T>::pNext;
|
||||
if (pItem) {
|
||||
itemBefore.tsSLNode<T>::pNext = pItem->tsSLNode<T>::pNext;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -85,11 +86,19 @@ public:
|
||||
T * get()
|
||||
{
|
||||
T *pItem = this->tsSLNode<T>::pNext;
|
||||
if (pItem) {
|
||||
this->remove(*pItem, *this);
|
||||
}
|
||||
this->remove(*this);
|
||||
return pItem;
|
||||
}
|
||||
|
||||
T * pop()
|
||||
{
|
||||
return get();
|
||||
}
|
||||
|
||||
void push(T &item)
|
||||
{
|
||||
this->add(item);
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
@@ -103,12 +112,11 @@ public:
|
||||
tsSLNode() : pNext(0) {}
|
||||
|
||||
//
|
||||
// when someone copies int a class deriving from this
|
||||
// when someone copies into a class deriving from this
|
||||
// do _not_ change the node pointers
|
||||
//
|
||||
void operator = (tsSLNode<T> &) {}
|
||||
|
||||
T *next() {return this->pNext;}
|
||||
private:
|
||||
T *pNext;
|
||||
};
|
||||
@@ -116,36 +124,68 @@ private:
|
||||
template <class T>
|
||||
class tsSLIter {
|
||||
public:
|
||||
tsSLIter(tsSLList<T> &listIn) :
|
||||
pCurrent(0), pPrevious(0), list(listIn) {}
|
||||
tsSLIter(tsSLList<T> &listIn) :
|
||||
pList(&listIn), pCurrent(0), pPrevious(0) {}
|
||||
|
||||
void reset()
|
||||
{
|
||||
this->pCurrent = 0;
|
||||
this->pPrevious = 0;
|
||||
}
|
||||
|
||||
void reset (tsSLList<T> &listIn)
|
||||
{
|
||||
this->pList = &listIn;
|
||||
this->reset();
|
||||
}
|
||||
|
||||
void operator = (tsSLList<T> &listIn)
|
||||
{
|
||||
list = listIn;
|
||||
pCurrent = 0;
|
||||
pPrevious = 0;
|
||||
this->reset(listIn);
|
||||
}
|
||||
|
||||
T * current ()
|
||||
{
|
||||
return this->pCurrent;
|
||||
}
|
||||
|
||||
T * next ()
|
||||
{
|
||||
if (this->pCurrent) {
|
||||
this->pPrevious = this->pCurrent;
|
||||
}
|
||||
else {
|
||||
this->pPrevious = this->pList;
|
||||
}
|
||||
this->pCurrent = this->pPrevious->pNext;
|
||||
return this->pCurrent;
|
||||
}
|
||||
|
||||
// this should move current?
|
||||
//tsSLNode<T> * prev () const
|
||||
//{
|
||||
// return this->pPrevious;
|
||||
//}
|
||||
|
||||
T * operator () ()
|
||||
{
|
||||
tsSLNode<T> *pPrev = this->pCurrent;
|
||||
T *pCur;
|
||||
if (pPrev==0) {
|
||||
pPrev = &this->list;
|
||||
}
|
||||
this->pPrevious = pPrev;
|
||||
pCur = pPrev->pNext;
|
||||
this->pCurrent = pCur;
|
||||
return pCur;
|
||||
return this->next();
|
||||
}
|
||||
|
||||
tsSLNode<T> * prev () const
|
||||
//
|
||||
// remove current node
|
||||
//
|
||||
void remove ()
|
||||
{
|
||||
return this->pPrevious;
|
||||
if (this->pCurrent) {
|
||||
this->pCurrent =
|
||||
this->pCurrent->tsSLNode<T>::pNext;
|
||||
this->pPrevious->pNext = this->pCurrent;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
T *pCurrent;
|
||||
tsSLNode<T> *pPrevious;
|
||||
tsSLList<T> &list;
|
||||
tsSLList<T> *pList;
|
||||
};
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ MENUS += menuScan.h
|
||||
MENUS += menuYesNo.h
|
||||
|
||||
RECTYPES += dbCommon.h
|
||||
USER_DBDFLAGS += -I .. -I $(EPICS_BASE)/dbd
|
||||
USER_DBDFLAGS += -I ..
|
||||
|
||||
DBDINSTALL += dbCommonRecord.dbd
|
||||
DBDINSTALL += menuGlobal.dbd
|
||||
|
||||
@@ -173,7 +173,7 @@ device(mbboDirect,CONSTANT,devMbboDirectSoft,"Soft Channel")
|
||||
#device(pulseTrain,VME_IO,devPtMz8310,"Mizar-8310")
|
||||
#device(steppermotor,VME_IO,devSmCompumotor1830,"Compumotor 1830")
|
||||
#device(steppermotor,VME_IO,devSmOms6Axis,"OMS 6-Axis")
|
||||
#device(steppermotor,AB_IO,devSmAB1746Hstp1,"Allen Bradley 1746-HTSP1")
|
||||
#device(steppermotor,AB_IO,devSmAB1746Hstp1,"AB-1746HSTP1")
|
||||
device(stringin,CONSTANT,devSiSoft,"Soft Channel")
|
||||
#device(stringin,CONSTANT,devSiTestAsyn,"Test Asyn")
|
||||
#device(stringin,CONSTANT,devSiSymb,"vxWorks Variable")
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* $Log$
|
||||
* Revision 1.7 1996/04/22 14:30:38 mrk
|
||||
* Changes for dynamic link modification
|
||||
*
|
||||
* Revision 1.6 1995/11/29 14:23:28 mrk
|
||||
* Changes for replacing default.dctsdr by all ascii files
|
||||
*
|
||||
@@ -507,7 +510,7 @@ long dbc(char *record_name)
|
||||
return(status);
|
||||
}
|
||||
|
||||
if (record_name == NULL && last_lset != pnode->l_num);
|
||||
if (record_name == NULL && last_lset != pnode->l_num)
|
||||
printf(" BKPT> Continuing: %s\n", pnode->precord->name);
|
||||
|
||||
last_lset = pnode->l_num;
|
||||
|
||||
@@ -88,6 +88,10 @@
|
||||
#ifndef INCLdb_accessh
|
||||
#define INCLdb_accessh
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <epicsTypes.h>
|
||||
@@ -1175,7 +1179,7 @@ union db_access_val{
|
||||
"DBR_PUT_ACKS",
|
||||
"DBR_STSACK_STRING",
|
||||
};
|
||||
READONLY char * READONLY dbr_text_invalid = "DBR_invalid";
|
||||
READONLY char * dbr_text_invalid = "DBR_invalid";
|
||||
READONLY short dbr_text_dim = (sizeof dbr_text)/(sizeof (char *));
|
||||
#endif
|
||||
|
||||
@@ -1183,4 +1187,8 @@ short db_name_to_addr();
|
||||
short db_put_field();
|
||||
short db_get_field();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* INCLdb_accessh */
|
||||
|
||||
@@ -45,6 +45,13 @@ int main(int argc,char **argv)
|
||||
static char *subSep = ",";
|
||||
|
||||
/*Look for options*/
|
||||
if(argc<2) {
|
||||
fprintf(stderr,
|
||||
"usage: dbExpand -Idir -Idir "
|
||||
"-S substitutions -S substitutions"
|
||||
" file1.dbd file2.dbd ...\n");
|
||||
exit(0);
|
||||
}
|
||||
while((strncmp(argv[1],"-I",2)==0)||(strncmp(argv[1],"-S",2)==0)) {
|
||||
if(strncmp(argv[1],"-I",2)==0) {
|
||||
pstr = &path;
|
||||
|
||||
@@ -155,7 +155,7 @@ PVDENTRY *dbPvdAdd(dbBase *pdbbase,dbRecordType *precordType,dbRecordNode *precn
|
||||
ppvdlist=ppvd[hashInd];
|
||||
ppvdNode = (PVDENTRY *) ellFirst(ppvdlist);
|
||||
while(ppvdNode) {
|
||||
if(strcmp(name,(char *)ppvdNode->precnode->precord) == 0) return(NULL);
|
||||
if(strcmp(name,(char *)ppvdNode->precnode->recordname)==0) return(NULL);
|
||||
ppvdNode = (PVDENTRY *) ellNext((ELLNODE*)ppvdNode);
|
||||
}
|
||||
ppvdNode = dbCalloc(1, sizeof(PVDENTRY));
|
||||
@@ -180,8 +180,8 @@ void dbPvdDelete(dbBase *pdbbase,dbRecordNode *precnode)
|
||||
ppvdlist=ppvd[hashInd];
|
||||
ppvdNode = (PVDENTRY *) ellFirst(ppvdlist);
|
||||
while(ppvdNode) {
|
||||
if(ppvdNode->precnode && ppvdNode->precnode->precord
|
||||
&& strcmp(name,(char *)ppvdNode->precnode->precord) == 0) {
|
||||
if(ppvdNode->precnode && ppvdNode->precnode->recordname
|
||||
&& strcmp(name,(char *)ppvdNode->precnode->recordname) == 0) {
|
||||
ellDelete(ppvdlist, (ELLNODE*)ppvdNode);
|
||||
free((void *)ppvdNode);
|
||||
return;
|
||||
@@ -213,6 +213,7 @@ void dbPvdFreeMem(dbBase *pdbbase)
|
||||
free((void *)ppvd[hashInd]);
|
||||
}
|
||||
free((void *)ppvd);
|
||||
pdbbase->ppvd = NULL;
|
||||
}
|
||||
|
||||
void dbPvdDump(dbBase *pdbbase,int verbose)
|
||||
|
||||
@@ -44,6 +44,10 @@ int main(int argc,char **argv)
|
||||
static char *subSep = ",";
|
||||
|
||||
/*Look for options*/
|
||||
if(argc<2) {
|
||||
printf("usage: dbReadTest -Idir -Idir file.dbd file.dbd \n");
|
||||
exit(0);
|
||||
}
|
||||
while((strncmp(argv[1],"-I",2)==0)||(strncmp(argv[1],"-S",2)==0)) {
|
||||
if(strncmp(argv[1],"-I",2)==0) {
|
||||
pstr = &path;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,7 +60,6 @@
|
||||
#define DCT_LINK_CONSTANT 0
|
||||
#define DCT_LINK_FORM 1
|
||||
#define DCT_LINK_PV 2
|
||||
#define DCT_LINK_DEVICE 3
|
||||
|
||||
typedef dbBase DBBASE;
|
||||
|
||||
@@ -138,6 +137,7 @@ int dbGetPromptGroup(DBENTRY *pdbentry);
|
||||
|
||||
long dbCreateRecord(DBENTRY *pdbentry,char *precordName);
|
||||
long dbDeleteRecord(DBENTRY *pdbentry);
|
||||
long dbFreeRecords(DBBASE *pdbbase);
|
||||
long dbFindRecord(DBENTRY *pdbentry,char *precordName);
|
||||
long dbFirstRecord(DBENTRY *pdbentry); /*first of record type*/
|
||||
long dbNextRecord(DBENTRY *pdbentry);
|
||||
@@ -168,6 +168,7 @@ char **dbGetFormPrompt(DBENTRY *pdbentry);
|
||||
char **dbGetFormValue(DBENTRY *pdbentry);
|
||||
long dbPutForm(DBENTRY *pdbentry,char **value);
|
||||
char **dbVerifyForm(DBENTRY *pdbentry,char **value);
|
||||
char *dbGetRelatedField(DBENTRY *pdbentry);
|
||||
|
||||
int dbGetNLinks(DBENTRY *pdbentry);
|
||||
long dbGetLinkField(DBENTRY *pdbentry,int index);
|
||||
@@ -206,4 +207,6 @@ extern int dbStaticDebug;
|
||||
#define S_dbLib_nameLength (M_dbLib|17) /*Record Name is too long*/
|
||||
#define S_dbLib_noRecSup (M_dbLib|19) /*Record support not found*/
|
||||
#define S_dbLib_strLen (M_dbLib|21) /*String is too long*/
|
||||
#define S_dbLib_noSizeOffset (M_dbLib|23) /*Missing SizeOffset Routine*/
|
||||
#define S_dbLib_noForm (M_dbLib|25) /*dbAllocForm was not called*/
|
||||
#endif /*INCdbStaticLibh*/
|
||||
|
||||
@@ -123,22 +123,8 @@ long dbFreeRecord(DBENTRY *pdbentry)
|
||||
field_type = pflddes->field_type;
|
||||
if(field_type==DBF_INLINK
|
||||
|| field_type==DBF_OUTLINK
|
||||
|| field_type==DBF_FWDLINK) {
|
||||
struct link *plink = (struct link *)pap[i];
|
||||
|
||||
switch(plink->type) {
|
||||
case CONSTANT: free((void *)plink->value.constantStr); break;
|
||||
case PV_LINK: free((void *)plink->value.pv_link.pvname); break;
|
||||
case VME_IO: dbFreeParmString(&plink->value.vmeio.parm); break;
|
||||
case CAMAC_IO: dbFreeParmString(&plink->value.camacio.parm); break;
|
||||
case AB_IO: dbFreeParmString(&plink->value.abio.parm); break;
|
||||
case GPIB_IO: dbFreeParmString(&plink->value.gpibio.parm); break;
|
||||
case BITBUS_IO: dbFreeParmString(&plink->value.bitbusio.parm);break;
|
||||
case INST_IO: dbFreeParmString(&plink->value.instio.string); break;
|
||||
case BBGPIB_IO: dbFreeParmString(&plink->value.bbgpibio.parm);break;
|
||||
case VXI_IO: dbFreeParmString(&plink->value.vxiio.parm); break;
|
||||
}
|
||||
}
|
||||
|| field_type==DBF_FWDLINK)
|
||||
dbFreeLinkContents((struct link *)pap[i]);
|
||||
free(pap[i]);
|
||||
}
|
||||
free((void *)pap);
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
#define INCdbStaticPvth 1
|
||||
|
||||
/*Following are not intended for client code */
|
||||
void dbInitDeviceMenu(DBENTRY *pdbentry);
|
||||
void dbFreeParmString(char **pparm);
|
||||
dbDeviceMenu *dbGetDeviceMenu(DBENTRY *pdbentry);
|
||||
void dbFreeLinkContents(struct link *plink);
|
||||
void dbFreePath(DBBASE *pdbbase);
|
||||
void dbCatString(char **string,int *stringLength,char *new,char *separator);
|
||||
|
||||
|
||||
@@ -35,9 +35,6 @@ of this distribution.
|
||||
#include <cvtFast.h>
|
||||
#include <dbStaticLib.h>
|
||||
#include <dbStaticPvt.h>
|
||||
#include <devSup.h>
|
||||
#include <drvSup.h>
|
||||
#include <recSup.h>
|
||||
#include <special.h>
|
||||
|
||||
static char hex_digit_to_ascii[16]={'0','1','2','3','4','5','6','7','8','9',
|
||||
@@ -218,7 +215,7 @@ long dbAllocRecord(DBENTRY *pdbentry,char *precordName)
|
||||
}
|
||||
break;
|
||||
case DBF_DEVICE:
|
||||
if(!pflddes->ftPvt) dbInitDeviceMenu(pdbentry);
|
||||
if(!pflddes->ftPvt) dbGetDeviceMenu(pdbentry);
|
||||
break;
|
||||
case DBF_INLINK:
|
||||
case DBF_OUTLINK:
|
||||
@@ -603,7 +600,7 @@ void dbGetRecordtypeSizeOffset(dbRecordType *pdbRecordType)
|
||||
vxstatus = symFindByName(sysSymTbl, name,
|
||||
(void *)&sizeOffset, &type);
|
||||
if (vxstatus != OK) {
|
||||
status = S_rec_noSizeOffset;
|
||||
status = S_dbLib_noSizeOffset;
|
||||
errPrintf(status,__FILE__,__LINE__,"%s",name);
|
||||
taskSuspend(0);
|
||||
}
|
||||
|
||||
@@ -49,6 +49,10 @@ int main(int argc,char **argv)
|
||||
static char *subSep = ",";
|
||||
|
||||
/*Look for options*/
|
||||
if(argc<2) {
|
||||
fprintf(stderr,"usage: dbToMenu -Idir -Idir file.dbd\n");
|
||||
exit(0);
|
||||
}
|
||||
while((strncmp(argv[1],"-I",2)==0)||(strncmp(argv[1],"-S",2)==0)) {
|
||||
if(strncmp(argv[1],"-I",2)==0) {
|
||||
pstr = &path;
|
||||
@@ -102,7 +106,9 @@ int main(int argc,char **argv)
|
||||
fprintf(outFile,"#define INC%sH\n",pdbMenu->name);
|
||||
fprintf(outFile,"typedef enum {\n");
|
||||
for(i=0; i<pdbMenu->nChoice; i++) {
|
||||
fprintf(outFile,"\t%s,\n",pdbMenu->papChoiceName[i]);
|
||||
fprintf(outFile,"\t%s",pdbMenu->papChoiceName[i]);
|
||||
if(i < (pdbMenu->nChoice - 1)) fprintf(outFile,",");
|
||||
fprintf(outFile,"\n");
|
||||
}
|
||||
fprintf(outFile,"}%s;\n",pdbMenu->name);
|
||||
fprintf(outFile,"#endif /*INC%sH*/\n",pdbMenu->name);
|
||||
|
||||
@@ -52,6 +52,10 @@ int main(int argc,char **argv)
|
||||
static char *subSep = ",";
|
||||
|
||||
/*Look for options*/
|
||||
if(argc<2) {
|
||||
fprintf(stderr,"usage: dbToRecordtypeH -Idir -Idir file.dbd\n");
|
||||
exit(0);
|
||||
}
|
||||
while((strncmp(argv[1],"-I",2)==0)||(strncmp(argv[1],"-S",2)==0)) {
|
||||
if(strncmp(argv[1],"-I",2)==0) {
|
||||
pstr = &path;
|
||||
|
||||
@@ -10,10 +10,9 @@ INC += dbVarSub.h
|
||||
|
||||
SRCS.c = ../dbVarSub.c dbLoadTemplate_lex.c dbLoadTemplate.c \
|
||||
dbLoadRecords_lex.c dbLoadRecords.c \
|
||||
../BSlib.c ../PVSserver.c ../rdbapplist.c ../rdbls.o
|
||||
../BSlib.c ../PVSserver.c ../rdbapplist.c ../rdbls.c
|
||||
|
||||
VAR_OBJS = dbVarSub.o dbLoadTemplate.o dbLoadRecords.o
|
||||
OBJS = $(VAR_OBJS) PVSserver.o rdbapplist.o rdbls.o
|
||||
|
||||
LIBOBJS = BSlib.o
|
||||
LIBNAME = BSlib.a
|
||||
|
||||
@@ -9,8 +9,21 @@ USR_CFLAGS = -ansi
|
||||
|
||||
VX_WARN_YES = -Wall -pedantic
|
||||
|
||||
INC += epvxi.h
|
||||
INC += canBus.h
|
||||
INC += drvAb.h
|
||||
INC += drvAt5Vxi.h
|
||||
INC += drvEpvxi.h
|
||||
INC += drvHp1404a.h
|
||||
INC += drvHpe1368a.h
|
||||
INC += drvIpac.h
|
||||
INC += drvKscV215.h
|
||||
INC += drvMz8310.h
|
||||
INC += drvStc.h
|
||||
INC += drvTip810.h
|
||||
INC += epvxi.h
|
||||
INC += ipModules.h
|
||||
INC += ipic.h
|
||||
INC += pca82c200.h
|
||||
|
||||
SRCS.c += ../drvAb.c
|
||||
SRCS.c += ../drvAt5Vxi.c
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
# $Id$
|
||||
#
|
||||
# $Log$
|
||||
# Revision 1.10 1996/07/23 17:13:29 jbk
|
||||
# various fixes - dbmapper incorrectly worked with enum types
|
||||
#
|
||||
# Revision 1.9 1996/07/10 23:48:03 jhill
|
||||
# added install for gddAppFuncTable.h
|
||||
#
|
||||
# Revision 1.8 1996/07/09 22:58:55 jhill
|
||||
# added installation of the include files
|
||||
#
|
||||
@@ -46,6 +52,8 @@ TOP= ../../..
|
||||
|
||||
include $(TOP)/config/CONFIG_BASE
|
||||
|
||||
#OPTIM_YES=-g
|
||||
|
||||
INC += gdd.h
|
||||
INC += gddNewDel.h
|
||||
INC += gddUtils.h
|
||||
@@ -67,8 +75,10 @@ SRCS.cc = ../aitGen.c ../aitTypes.c ../aitHelpers.cc \
|
||||
../gdd.cc ../gddAppDefs.cc ../gddAppTable.cc ../gddNewDel.cc \
|
||||
../gddTest.cc ../genApps.cc ../dbMapper.cc
|
||||
|
||||
LIBOBJS = gdd.o gddTest.o gddAppTable.o gddNewDel.o gddAppDefs.o \
|
||||
aitTypes.o aitConvert.o aitHelpers.o dbMapper.o
|
||||
MY_OBJS = gdd.o gddTest.o gddAppTable.o gddNewDel.o gddAppDefs.o \
|
||||
aitTypes.o aitConvert.o aitHelpers.o
|
||||
|
||||
LIBOBJS = $(MY_OBJS) dbMapper.o
|
||||
|
||||
LIBNAME = libgdd.a
|
||||
|
||||
@@ -95,7 +105,7 @@ dbMapper.o: ../dbMapper.cc gdd.h gddAppTable.h dbMapper.h gddApps.h aitTypes.h
|
||||
gddApps.h: genApps
|
||||
./genApps $@
|
||||
|
||||
genApps: genApps.o $(LIBOBJS)
|
||||
genApps: genApps.o $(MY_OBJS)
|
||||
$(LINK.cc) -o $@ $^ $(LDLIBS)
|
||||
|
||||
clean::
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.1 1996/06/25 19:11:28 jbk
|
||||
// new in EPICS base
|
||||
//
|
||||
//
|
||||
// *Revision 0.4 1996/06/25 18:58:58 jbk
|
||||
// *more fixes for the aitString management functions and mapping menus
|
||||
@@ -69,7 +72,7 @@ static void aitConvertStringFixedString(void* d,const void* s,aitIndex c)
|
||||
aitString* out = (aitString*)d;
|
||||
aitFixedString* in = (aitFixedString*)s;
|
||||
|
||||
for(i=0;i<c;i++) out[i].installString(in[i].fixed_string);
|
||||
for(i=0;i<c;i++) out[i].copy(in[i].fixed_string);
|
||||
}
|
||||
|
||||
static void aitConvertFixedStringString(void* d,const void* s,aitIndex c)
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.1 1996/06/25 19:11:29 jbk
|
||||
* new in EPICS base
|
||||
*
|
||||
*
|
||||
* *Revision 1.1 1996/05/31 13:15:18 jbk
|
||||
* *add new stuff
|
||||
@@ -15,7 +18,13 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock.h>
|
||||
#else
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#include "aitTypes.h"
|
||||
|
||||
#if defined(__i386) || defined(i386)
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.2 1996/06/27 14:33:13 jbk
|
||||
* changes data type to string conversions to use installString(), not copy()
|
||||
*
|
||||
* Revision 1.1 1996/06/25 19:11:30 jbk
|
||||
* new in EPICS base
|
||||
*
|
||||
@@ -159,14 +162,25 @@ void MakeStringFuncFrom(int i,int j,int k)
|
||||
pr(dfd,"{\n");
|
||||
pr(dfd,"\taitIndex i;\n");
|
||||
pr(dfd,"\tchar temp[AIT_FIXED_STRING_SIZE];\n");
|
||||
pr(dfd,"\taitString* out=(aitString*)d;\n");
|
||||
pr(dfd,"\t%s* in=(%s*)s;\n",aitName[j],aitName[j]);
|
||||
|
||||
#if 0
|
||||
if(j==aitEnumInt8)
|
||||
{
|
||||
pr(dfd,"\n\t// assume source s is string if count c is 1\n");
|
||||
pr(dfd,"\n\tif(c==1) {\n");
|
||||
pr(dfd,"\t\tout->copy((char*)in);\n");
|
||||
pr(dfd,"\t\treturn;\n");
|
||||
pr(dfd,"\t}\n\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if(j==aitEnumInt8)
|
||||
pr(dfd,"\taitInt32 itmp;\n");
|
||||
else if(j==aitEnumUint8)
|
||||
pr(dfd,"\taitUint32 itmp;\n");
|
||||
|
||||
pr(dfd,"\taitString* out=(aitString*)d;\n");
|
||||
pr(dfd,"\t%s* in=(%s*)s;\n",aitName[j],aitName[j]);
|
||||
pr(dfd,"\tfor(i=0;i<c;i++) {\n");
|
||||
|
||||
if(j==aitEnumInt8)
|
||||
@@ -196,15 +210,25 @@ void MakeStringFuncTo(int i,int j,int k)
|
||||
pr(dfd,"{\n");
|
||||
pr(dfd,"\taitIndex i;\n");
|
||||
pr(dfd,"\taitString* in=(aitString*)s;\n");
|
||||
pr(dfd,"\t%s* out=(%s*)d;\n",aitName[i],aitName[i]);
|
||||
|
||||
/* I special cased the Int8 and Uint8 - yuck */
|
||||
#if 0
|
||||
if(i==aitEnumInt8)
|
||||
{
|
||||
pr(dfd,"\n\t// assume dest d is string if count c is 1\n");
|
||||
pr(dfd,"\n\tif(c==1) {\n");
|
||||
pr(dfd,"\t\tin->extractString((char*)out);\n");
|
||||
pr(dfd,"\t\treturn;\n");
|
||||
pr(dfd,"\t}\n\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if(i==aitEnumInt8)
|
||||
pr(dfd,"\taitInt32 itmp;\n");
|
||||
else if(i==aitEnumUint8)
|
||||
pr(dfd,"\taitUint32 itmp;\n");
|
||||
|
||||
pr(dfd,"\t%s* out=(%s*)d;\n",aitName[i],aitName[i]);
|
||||
pr(dfd,"\tfor(i=0;i<c;i++) {\n");
|
||||
pr(dfd,"\t\tif(in[i].string()) {\n");
|
||||
|
||||
@@ -235,14 +259,25 @@ void MakeFStringFuncFrom(int i,int j,int k)
|
||||
table_type[k],&(aitName[i])[3],&(aitName[j])[3]);
|
||||
pr(dfd,"{\n");
|
||||
pr(dfd,"\taitIndex i;\n");
|
||||
pr(dfd,"\taitFixedString* out=(aitFixedString*)d;\n");
|
||||
pr(dfd,"\t%s* in=(%s*)s;\n",aitName[j],aitName[j]);
|
||||
|
||||
#if 0
|
||||
if(j==aitEnumInt8)
|
||||
{
|
||||
pr(dfd,"\n\t// assume source s is string if count c is 1\n");
|
||||
pr(dfd,"\n\tif(c==1) {\n");
|
||||
pr(dfd,"\t\tstrcpy(out->fixed_string,(char*)in);\n");
|
||||
pr(dfd,"\t\treturn;\n");
|
||||
pr(dfd,"\t}\n\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if(j==aitEnumInt8)
|
||||
pr(dfd,"\taitInt32 itmp;\n");
|
||||
else if(j==aitEnumUint8)
|
||||
pr(dfd,"\taitUint32 itmp;\n");
|
||||
|
||||
pr(dfd,"\taitFixedString* out=(aitFixedString*)d;\n");
|
||||
pr(dfd,"\t%s* in=(%s*)s;\n",aitName[j],aitName[j]);
|
||||
pr(dfd,"\tfor(i=0;i<c;i++) {\n");
|
||||
|
||||
if(j==aitEnumInt8)
|
||||
@@ -270,15 +305,25 @@ void MakeFStringFuncTo(int i,int j,int k)
|
||||
pr(dfd,"{\n");
|
||||
pr(dfd,"\taitIndex i;\n");
|
||||
pr(dfd,"\taitFixedString* in=(aitFixedString*)s;\n");
|
||||
pr(dfd,"\t%s* out=(%s*)d;\n",aitName[i],aitName[i]);
|
||||
|
||||
/* I special cased the Int8 and Uint8 - yuck */
|
||||
#if 0
|
||||
if(i==aitEnumInt8)
|
||||
{
|
||||
pr(dfd,"\n\t// assume dest d is string if count c is 1\n");
|
||||
pr(dfd,"\n\tif(c==1) {\n");
|
||||
pr(dfd,"\t\tstrcpy((char*)out,in->fixed_string);\n");
|
||||
pr(dfd,"\t\treturn;\n");
|
||||
pr(dfd,"\t}\n\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
if(i==aitEnumInt8)
|
||||
pr(dfd,"\taitInt32 itmp;\n");
|
||||
else if(i==aitEnumUint8)
|
||||
pr(dfd,"\taitUint32 itmp;\n");
|
||||
|
||||
pr(dfd,"\t%s* out=(%s*)d;\n",aitName[i],aitName[i]);
|
||||
pr(dfd,"\tfor(i=0;i<c;i++) {\n");
|
||||
|
||||
if(i==aitEnumInt8)
|
||||
|
||||
@@ -5,15 +5,46 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 1996/08/06 19:14:06 jbk
|
||||
// Fixes to the string class.
|
||||
// Changes units field to a aitString instead of aitInt8.
|
||||
//
|
||||
// Revision 1.1 1996/06/25 19:11:30 jbk
|
||||
// new in EPICS base
|
||||
//
|
||||
//
|
||||
|
||||
#include "aitTypes.h"
|
||||
#include "aitHelpers.h"
|
||||
|
||||
void aitString::mallocFailure(void)
|
||||
{
|
||||
str="";
|
||||
len=0u;
|
||||
type=aitStrConst;
|
||||
fprintf(stderr,"aitString: no pool => continuing with nill str\n");
|
||||
}
|
||||
|
||||
void aitString::dump(const char* p) const
|
||||
{
|
||||
fprintf(stderr,"<%s>:",p);
|
||||
dump();
|
||||
}
|
||||
|
||||
void aitString::dump(void) const
|
||||
{
|
||||
fprintf(stderr,"this=%8.8x ",(int)this);
|
||||
if(str) fprintf(stderr,"string=%8.8x<%s>, ",(int)str,str);
|
||||
else fprintf(stderr,"no string present, ");
|
||||
fprintf(stderr,"length=%d, ",(int)len);
|
||||
if(type==aitStrConst) fprintf(stderr,"type=Constant\n");
|
||||
else fprintf(stderr,"type=Allocated\n");
|
||||
}
|
||||
|
||||
aitIndex aitString::compact(aitString* array, aitIndex arraySize,
|
||||
void* buf, aitIndex bufSize)
|
||||
{
|
||||
aitIndex i,j;
|
||||
aitIndex i;
|
||||
aitUint32 pos;
|
||||
char* ptr=(char*)buf;
|
||||
aitString* str=(aitString*)buf;
|
||||
|
||||
@@ -8,6 +8,20 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 1996/08/12 15:37:46 jbk
|
||||
* Re-added the installString() function I took out.
|
||||
*
|
||||
* Revision 1.4 1996/08/09 02:28:09 jbk
|
||||
* rewrite of aitString class - more intuitive now, I think
|
||||
*
|
||||
* Revision 1.3 1996/08/06 19:14:09 jbk
|
||||
* Fixes to the string class.
|
||||
* Changes units field to a aitString instead of aitInt8.
|
||||
*
|
||||
* Revision 1.2 1996/06/26 21:00:05 jbk
|
||||
* Fixed up code in aitHelpers, removed unused variables in others
|
||||
* Fixed potential problem in gddAppTable.cc with the map functions
|
||||
*
|
||||
* Revision 1.1 1996/06/25 19:11:31 jbk
|
||||
* new in EPICS base
|
||||
*
|
||||
@@ -129,80 +143,61 @@ inline int operator>= (const aitTimeStamp &lhs, const aitTimeStamp &rhs)
|
||||
//
|
||||
class aitString
|
||||
{
|
||||
private:
|
||||
enum aitStrType {aitStrMalloc, aitStrConst};
|
||||
|
||||
int set(const char* p)
|
||||
{
|
||||
int rc=0;
|
||||
if(p)
|
||||
{
|
||||
len=strlen(p);
|
||||
str=(const char*)new char[len+1];
|
||||
if(str)
|
||||
{
|
||||
strcpy((char*)str, p);
|
||||
type=aitStrMalloc;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If malloc fails set it to
|
||||
// an empty constant str
|
||||
str = "";
|
||||
len = 0u;
|
||||
type = aitStrConst;
|
||||
printf("aitString: no pool => continuing with nill str\n");
|
||||
rc=-1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
str=NULL;
|
||||
len=0u;
|
||||
type=aitStrConst;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
void cset(const char* p)
|
||||
{
|
||||
str=p;
|
||||
type=aitStrConst;
|
||||
if(str)
|
||||
len=strlen(str);
|
||||
else
|
||||
len = 0u;
|
||||
}
|
||||
|
||||
public:
|
||||
aitString(char* p); // copy the user's string
|
||||
aitString(aitString* p); // copy the user's string
|
||||
aitString(aitString& p); // copy the user's string
|
||||
|
||||
aitString(void) { cset((char*)NULL); }
|
||||
aitString(const char* x) { cset(x); }
|
||||
aitString(char* x) { cset(x); }
|
||||
aitString(const char* p); // reference a user's constant string
|
||||
aitString(const aitString* p); // reference a user's constant string
|
||||
aitString(const aitString& p); // reference a user's constant string
|
||||
|
||||
operator aitUint16(void) { return len; }
|
||||
operator const char*(void) { return str; }
|
||||
aitUint32 length(void) { return len; }
|
||||
aitString(void);
|
||||
~aitString(void); // free up string is required
|
||||
|
||||
void clear(void); // clear everything, free string if required
|
||||
void dump(void) const;
|
||||
void dump(const char* id) const;
|
||||
|
||||
// casts from aitString to other things - pulls info out of aitString
|
||||
operator aitUint16(void) const { return (aitUint16)len; }
|
||||
operator aitUint32(void) const { return (aitUint32)len; }
|
||||
operator aitInt32(void) const { return (aitInt32)len; }
|
||||
operator const char*(void) const { return str; }
|
||||
operator char*(void) const { return str; }
|
||||
int isConstant(void) const;
|
||||
|
||||
aitUint32 length(void) const { return (aitUint32)len; }
|
||||
const char* string(void) const { return str; }
|
||||
|
||||
// completely reset the aitString to a new value
|
||||
aitString& operator=(aitString& p);
|
||||
aitString& operator=(aitString* p);
|
||||
aitString& operator=(char* p);
|
||||
aitString& operator=(const aitString& p);
|
||||
aitString& operator=(const aitString* p);
|
||||
aitString& operator=(const char* p);
|
||||
|
||||
// change strings into the aitString (actually makes new strings)
|
||||
int copy(aitString* p);
|
||||
int copy(aitString& p);
|
||||
int copy(char* p);
|
||||
int copy(const aitString* p);
|
||||
int copy(const aitString& p);
|
||||
int copy(const char* p);
|
||||
void installString(char* p) { copy(p); }
|
||||
|
||||
// set data in the aitString and retrieve data from the aitString
|
||||
void replaceData(const char* p);
|
||||
void replaceData(const aitString* p);
|
||||
void replaceData(aitString& p);
|
||||
void extractString(char* to_here);
|
||||
|
||||
// special function to change the string - internal use with gdd library
|
||||
void force(char* x) { str=x; }
|
||||
void force(unsigned char* x) { str=(char*)x; }
|
||||
void force(unsigned long x) { str=(char*)x; }
|
||||
|
||||
void clear(void)
|
||||
{
|
||||
if (str && type==aitStrMalloc)
|
||||
{
|
||||
char *pStr=(char*)str;
|
||||
delete [] pStr;
|
||||
}
|
||||
}
|
||||
|
||||
int installString(const char* p) { clear(); return set(p); }
|
||||
int installString(char* p) { clear(); return set(p); }
|
||||
void copy(const char* p) { clear(); cset(p); }
|
||||
void copy(char* p) { clear(); cset(p); }
|
||||
aitString& operator=(const char* p) { this->copy(p); return *this; }
|
||||
aitString& operator=(char* p) { this->copy(p); return *this; }
|
||||
void init(void);
|
||||
|
||||
// take the aitString array, and put it and all the string into buf,
|
||||
// return the total length the data copied
|
||||
@@ -212,9 +207,109 @@ public:
|
||||
void* buf, aitIndex bufSize);
|
||||
|
||||
private:
|
||||
const char * str;
|
||||
enum aitStrType {aitStrMalloc, aitStrConst};
|
||||
|
||||
char* str;
|
||||
aitUint16 len;
|
||||
aitUint16 type; // aitStrType goes here
|
||||
|
||||
void mallocFailure(void);
|
||||
int set(const char* p, aitUint32 len);
|
||||
int cset(const char* p, aitUint32 len);
|
||||
aitStrType getType(void) const { return (aitStrType)type; }
|
||||
};
|
||||
|
||||
inline int aitString::isConstant(void) const
|
||||
{
|
||||
return (getType()==aitStrConst && str)?1:0;
|
||||
}
|
||||
|
||||
inline void aitString::clear(void)
|
||||
{
|
||||
if(str && type==aitStrMalloc) delete [] str;
|
||||
type=aitStrConst;
|
||||
str=NULL;
|
||||
len=0;
|
||||
}
|
||||
|
||||
inline int aitString::set(const char* p,aitUint32 l)
|
||||
{
|
||||
int rc=0;
|
||||
clear();
|
||||
len=l;
|
||||
str=new char[len+1];
|
||||
if(str)
|
||||
{
|
||||
strcpy(str, p);
|
||||
type=aitStrMalloc;
|
||||
}
|
||||
else
|
||||
{
|
||||
mallocFailure();
|
||||
rc=-1;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
inline int aitString::cset(const char* p,aitUint32 l)
|
||||
{
|
||||
clear();
|
||||
str=(char*)p;
|
||||
type=aitStrConst;
|
||||
len=l;
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline int aitString::copy(const char* p)
|
||||
{ return p?cset(p,strlen(p)):-1; }
|
||||
inline int aitString::copy(char* p)
|
||||
{ return p?set(p,strlen(p)):-1; }
|
||||
inline int aitString::copy(aitString* p)
|
||||
{ return p?set((char*)*p,p->length()):-1; }
|
||||
inline int aitString::copy(aitString& p)
|
||||
{ return set((char*)p,p.length()); }
|
||||
inline int aitString::copy(const aitString* p)
|
||||
{ return p?cset((const char*)*p,p->length()):-1; }
|
||||
inline int aitString::copy(const aitString& p)
|
||||
{ return cset((const char*)p,p.length()); }
|
||||
|
||||
inline void aitString::replaceData(const char* p)
|
||||
{ if(p && str) strncpy(str,p,len); }
|
||||
inline void aitString::replaceData(const aitString* p)
|
||||
{ if(p && str) strncpy(str,p->string(),len); }
|
||||
inline void aitString::replaceData(aitString& p)
|
||||
{ if(str) strncpy(str,p.string(),len); }
|
||||
inline void aitString::extractString(char* p)
|
||||
{ if(p && str) strcpy(p,str); }
|
||||
|
||||
inline aitString& aitString::operator=(const aitString& p)
|
||||
{ this->copy(p); return *this; }
|
||||
inline aitString& aitString::operator=(const aitString* p)
|
||||
{ this->copy(p); return *this; }
|
||||
inline aitString& aitString::operator=(aitString& p)
|
||||
{ this->copy(p); return *this; }
|
||||
inline aitString& aitString::operator=(aitString* p)
|
||||
{ this->copy(p); return *this; }
|
||||
inline aitString& aitString::operator=(const char* p)
|
||||
{ this->copy(p); return *this; }
|
||||
inline aitString& aitString::operator=(char* p)
|
||||
{ this->copy(p); return *this; }
|
||||
|
||||
inline void aitString::init(void) { str=NULL; len=0u; type=aitStrConst; }
|
||||
|
||||
inline aitString::~aitString(void)
|
||||
{
|
||||
// dump("~aitString");
|
||||
clear();
|
||||
}
|
||||
inline aitString::aitString(void) { init(); }
|
||||
|
||||
inline aitString::aitString(char* p) { init(); copy(p); }
|
||||
inline aitString::aitString(aitString* p) { init(); copy(p); }
|
||||
inline aitString::aitString(aitString& p) { init(); copy(p); }
|
||||
|
||||
inline aitString::aitString(const char* p) { init(); copy(p); }
|
||||
inline aitString::aitString(const aitString* p) { init(); copy(p); }
|
||||
inline aitString::aitString(const aitString& p) { init(); copy(p); }
|
||||
|
||||
#endif // aitHelpersInclude
|
||||
|
||||
@@ -4,6 +4,25 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.10 1996/08/13 15:07:45 jbk
|
||||
// changes for better string manipulation and fixes for the units field
|
||||
//
|
||||
// Revision 1.9 1996/08/06 19:14:10 jbk
|
||||
// Fixes to the string class.
|
||||
// Changes units field to a aitString instead of aitInt8.
|
||||
//
|
||||
// Revision 1.8 1996/07/26 02:23:15 jbk
|
||||
// Fixed the spelling error with Scalar.
|
||||
//
|
||||
// Revision 1.7 1996/07/24 22:48:06 jhill
|
||||
// fixed gnu warning int=>size_t
|
||||
//
|
||||
// Revision 1.6 1996/07/23 17:13:30 jbk
|
||||
// various fixes - dbmapper incorrectly worked with enum types
|
||||
//
|
||||
// Revision 1.5 1996/07/01 19:59:12 jhill
|
||||
// fixed case where gdd was mapped to a string without cvrt
|
||||
//
|
||||
// Revision 1.4 1996/06/26 21:00:06 jbk
|
||||
// Fixed up code in aitHelpers, removed unused variables in others
|
||||
// Fixed potential problem in gddAppTable.cc with the map functions
|
||||
@@ -66,7 +85,7 @@ gddDbrToAitTable gddDbrToAit[] = {
|
||||
{ aitEnumFixedString, 0, "value" },
|
||||
{ aitEnumInt16, 0, "value" },
|
||||
{ aitEnumFloat32, 0, "value" },
|
||||
{ aitEnumEnum16, 0, "enums" },
|
||||
{ aitEnumEnum16, 0, "value" },
|
||||
{ aitEnumInt8, 0, "value" },
|
||||
{ aitEnumInt32, 0, "value" },
|
||||
{ aitEnumFloat64, 0, "value" },
|
||||
@@ -74,7 +93,7 @@ gddDbrToAitTable gddDbrToAit[] = {
|
||||
{ aitEnumFixedString, 0, "value" },
|
||||
{ aitEnumInt16, 0, "value" },
|
||||
{ aitEnumFloat32, 0, "value" },
|
||||
{ aitEnumEnum16, 0, "enums" },
|
||||
{ aitEnumEnum16, 0, "value" },
|
||||
{ aitEnumInt8, 0, "value" },
|
||||
{ aitEnumInt32, 0, "value" },
|
||||
{ aitEnumFloat64, 0, "value" },
|
||||
@@ -82,7 +101,7 @@ gddDbrToAitTable gddDbrToAit[] = {
|
||||
{ aitEnumFixedString, 0, "value" },
|
||||
{ aitEnumInt16, 0, "value" },
|
||||
{ aitEnumFloat32, 0, "value" },
|
||||
{ aitEnumEnum16, 0, "enums" },
|
||||
{ aitEnumEnum16, 0, "value" },
|
||||
{ aitEnumInt8, 0, "value" },
|
||||
{ aitEnumInt32, 0, "value" },
|
||||
{ aitEnumFloat64, 0, "value" },
|
||||
@@ -122,7 +141,7 @@ static gdd* mapStringToGdd(void* v,aitIndex count) {
|
||||
|
||||
if(count<=1)
|
||||
{
|
||||
dd=new gddScaler(to_app,to_type);
|
||||
dd=new gddScalar(to_app,to_type);
|
||||
dd->put(*db);
|
||||
}
|
||||
else
|
||||
@@ -135,7 +154,13 @@ static gdd* mapStringToGdd(void* v,aitIndex count) {
|
||||
|
||||
static int mapGddToString(void* v, gdd* dd) {
|
||||
aitFixedString* db = (aitFixedString*)v;
|
||||
aitFixedString* dbx = (aitFixedString*)dd->dataPointer();
|
||||
aitFixedString* dbx;
|
||||
|
||||
if(dd->isScalar())
|
||||
dbx=(aitFixedString*)dd->dataAddress();
|
||||
else
|
||||
dbx=(aitFixedString*)dd->dataPointer();
|
||||
|
||||
int len = dd->getDataSizeElements();
|
||||
if(dbx!=db) dd->getConvert(*db);
|
||||
return len;
|
||||
@@ -150,7 +175,7 @@ static gdd* mapShortToGdd(void* v,aitIndex count) {
|
||||
gddDbrToAit[DBR_SHORT].type,1,count);
|
||||
dd->putRef(sv);
|
||||
} else {
|
||||
dd=new gddScaler(gddDbrToAit[DBR_SHORT].app);
|
||||
dd=new gddScalar(gddDbrToAit[DBR_SHORT].app);
|
||||
*dd=*sv;
|
||||
}
|
||||
return dd;
|
||||
@@ -178,7 +203,7 @@ static gdd* mapFloatToGdd(void* v,aitIndex count) {
|
||||
gddDbrToAit[DBR_FLOAT].type,1,count);
|
||||
dd->putRef(sv);
|
||||
} else {
|
||||
dd=new gddScaler(gddDbrToAit[DBR_FLOAT].app);
|
||||
dd=new gddScalar(gddDbrToAit[DBR_FLOAT].app);
|
||||
*dd=*sv;
|
||||
}
|
||||
return dd;
|
||||
@@ -206,7 +231,7 @@ static gdd* mapEnumToGdd(void* v,aitIndex count) {
|
||||
gddDbrToAit[DBR_ENUM].type,1,count);
|
||||
dd->putRef(sv);
|
||||
} else {
|
||||
dd=new gddScaler(gddDbrToAit[DBR_ENUM].app);
|
||||
dd=new gddScalar(gddDbrToAit[DBR_ENUM].app);
|
||||
*dd=*sv;
|
||||
}
|
||||
return dd;
|
||||
@@ -234,7 +259,7 @@ static gdd* mapCharToGdd(void* v,aitIndex count) {
|
||||
gddDbrToAit[DBR_CHAR].type,1,count);
|
||||
dd->putRef(sv);
|
||||
} else {
|
||||
dd=new gddScaler(gddDbrToAit[DBR_CHAR].app);
|
||||
dd=new gddScalar(gddDbrToAit[DBR_CHAR].app);
|
||||
*dd=*sv;
|
||||
}
|
||||
return dd;
|
||||
@@ -262,7 +287,7 @@ static gdd* mapLongToGdd(void* v,aitIndex count) {
|
||||
gddDbrToAit[DBR_LONG].type,1,count);
|
||||
dd->putRef(sv);
|
||||
} else {
|
||||
dd=new gddScaler(gddDbrToAit[DBR_LONG].app);
|
||||
dd=new gddScalar(gddDbrToAit[DBR_LONG].app);
|
||||
*dd=*sv;
|
||||
}
|
||||
return dd;
|
||||
@@ -290,7 +315,7 @@ static gdd* mapDoubleToGdd(void* v,aitIndex count) {
|
||||
gddDbrToAit[DBR_DOUBLE].type,1,count);
|
||||
dd->putRef(sv);
|
||||
} else {
|
||||
dd=new gddScaler(gddDbrToAit[DBR_DOUBLE].app);
|
||||
dd=new gddScalar(gddDbrToAit[DBR_DOUBLE].app);
|
||||
*dd=*sv;
|
||||
}
|
||||
return dd;
|
||||
@@ -323,7 +348,7 @@ static gdd* mapStsStringToGdd(void* v,aitIndex count)
|
||||
|
||||
if(count<=1)
|
||||
{
|
||||
dd=new gddScaler(to_app,to_type);
|
||||
dd=new gddScalar(to_app,to_type);
|
||||
dd->put(*dbv);
|
||||
}
|
||||
else
|
||||
@@ -340,10 +365,15 @@ static int mapStsGddToString(void* v, gdd* dd)
|
||||
{
|
||||
dbr_sts_string* db = (dbr_sts_string*)v;
|
||||
aitFixedString* dbv = (aitFixedString*)db->value;
|
||||
aitFixedString* dbx = (aitFixedString*)dd->dataPointer();
|
||||
aitFixedString* dbx;
|
||||
|
||||
if(dd->isScalar())
|
||||
dbx=(aitFixedString*)dd->dataAddress();
|
||||
else
|
||||
dbx=(aitFixedString*)dd->dataPointer();
|
||||
|
||||
// copy string into user buffer for now if not the same as one in gdd
|
||||
if(dbx!=dbv) dd->get(dbv);
|
||||
if(dbx!=dbv) dd->getConvert(*dbv);
|
||||
dd->getStatSevr(db->status,db->severity);
|
||||
return dd->getDataSizeElements();
|
||||
}
|
||||
@@ -458,7 +488,7 @@ static gdd* mapTimeStringToGdd(void* v,aitIndex count)
|
||||
|
||||
if(count<=1)
|
||||
{
|
||||
dd=new gddScaler(to_app,to_type);
|
||||
dd=new gddScalar(to_app,to_type);
|
||||
dd->put(*dbv);
|
||||
}
|
||||
else
|
||||
@@ -476,9 +506,15 @@ static int mapTimeGddToString(void* v, gdd* dd)
|
||||
{
|
||||
dbr_time_string* db = (dbr_time_string*)v;
|
||||
aitFixedString* dbv = (aitFixedString*)db->value;
|
||||
aitFixedString* dbx;
|
||||
|
||||
// copy string into user buffer for now if not the same as one in gdd
|
||||
if(v!=dd->dataPointer()) dd->get(dbv);
|
||||
if(dd->isScalar())
|
||||
dbx=(aitFixedString*)dd->dataAddress();
|
||||
else
|
||||
dbx=(aitFixedString*)dd->dataPointer();
|
||||
|
||||
if(dbv!=dbx) dd->getConvert(*dbv);
|
||||
|
||||
dd->getStatSevr(db->status,db->severity);
|
||||
dd->getTimeStamp((aitTimeStamp*)&db->stamp);
|
||||
@@ -605,8 +641,10 @@ static gdd* mapGraphicShortToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_SHORT].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_short_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_units].put(str);
|
||||
aitString* str=NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_short_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_graphicHigh]=db->upper_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_alarmLow]=db->lower_alarm_limit;
|
||||
@@ -635,8 +673,10 @@ static gdd* mapControlShortToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_SHORT].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_short_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh]=db->upper_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_controlLow]=db->lower_ctrl_limit;
|
||||
@@ -666,9 +706,10 @@ static int mapGraphicGddToShort(void* v, gdd* dd)
|
||||
int sz=1;
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_short_value];
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_gr_short_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_short_graphicHigh];
|
||||
db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_short_alarmLow];
|
||||
@@ -693,9 +734,10 @@ static int mapControlGddToShort(void* v, gdd* dd)
|
||||
int sz=1;
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_short_value];
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_short_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_short_graphicHigh];
|
||||
db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_short_controlLow];
|
||||
@@ -724,8 +766,10 @@ static gdd* mapGraphicFloatToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_FLOAT].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_float_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_float_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -755,8 +799,10 @@ static gdd* mapControlFloatToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_FLOAT].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_float_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -787,9 +833,10 @@ static int mapGraphicGddToFloat(void* v, gdd* dd)
|
||||
int sz=1;
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_float_value];
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_gr_float_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->precision=dd[gddAppTypeIndex_dbr_gr_float_precision];
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_float_graphicHigh];
|
||||
@@ -815,9 +862,10 @@ static int mapControlGddToFloat(void* v, gdd* dd)
|
||||
int sz=1;
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_float_value];
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_float_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->precision=dd[gddAppTypeIndex_dbr_ctrl_float_precision];
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_float_graphicHigh];
|
||||
@@ -846,10 +894,14 @@ static gdd* mapGraphicEnumToGdd(void* v, aitIndex /*count*/)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_ENUM].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_enum_value];
|
||||
gdd& menu = dd[gddAppTypeIndex_dbr_gr_enum_enums];
|
||||
aitString* str = menu;
|
||||
int i;
|
||||
aitFixedString* str = menu;
|
||||
aitFixedString* f = (aitFixedString*)db->strs;
|
||||
|
||||
for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));
|
||||
// int i;
|
||||
// old way using aitString menu
|
||||
// for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));
|
||||
|
||||
menu.putRef(f);
|
||||
menu.setBound(0,0,db->no_str);
|
||||
vdd.setStatSevr(db->status,db->severity);
|
||||
|
||||
@@ -865,10 +917,14 @@ static gdd* mapControlEnumToGdd(void* v, aitIndex /*count*/)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_ENUM].app);
|
||||
gdd& menu = dd[gddAppTypeIndex_dbr_ctrl_enum_enums];
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_enum_value];
|
||||
aitString* str = menu;
|
||||
int i;
|
||||
aitFixedString* str = menu;
|
||||
aitFixedString* f = (aitFixedString*)db->strs;
|
||||
|
||||
for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));
|
||||
// int i;
|
||||
// old way using aitString menu
|
||||
// for(i=0;i<db->no_str;i++) str[i]=((const char*)&(db->strs[i][0]));
|
||||
|
||||
menu.putRef(f);
|
||||
menu.setBound(0,0,db->no_str);
|
||||
vdd.setStatSevr(db->status,db->severity);
|
||||
|
||||
@@ -883,15 +939,19 @@ static int mapGraphicGddToEnum(void* v, gdd* dd)
|
||||
dbr_gr_enum* db = (dbr_gr_enum*)v;
|
||||
gdd& menu = dd[gddAppTypeIndex_dbr_gr_enum_enums];
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_enum_value];
|
||||
aitString* str = menu;
|
||||
aitFixedString* str = menu;
|
||||
aitFixedString* f = (aitFixedString*)db->strs;
|
||||
int i;
|
||||
|
||||
vdd.getStatSevr(db->status,db->severity);
|
||||
db->value=vdd; // always scaler
|
||||
db->no_str=menu.getDataSizeElements();
|
||||
|
||||
for(i=0;i<db->no_str;i++) strcpy(&(db->strs[i][0]),str[i]);
|
||||
|
||||
db->value=vdd; // always scaler
|
||||
if(str && str!=f)
|
||||
{
|
||||
for(i=0;i<db->no_str;i++)
|
||||
strcpy(&(db->strs[i][0]),str[i].fixed_string);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -900,15 +960,19 @@ static int mapControlGddToEnum(void* v, gdd* dd)
|
||||
dbr_ctrl_enum* db = (dbr_ctrl_enum*)v;
|
||||
gdd& menu = dd[gddAppTypeIndex_dbr_ctrl_enum_enums];
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_enum_value];
|
||||
aitString* str = menu;
|
||||
aitFixedString* str = menu;
|
||||
aitFixedString* f = (aitFixedString*)db->strs;
|
||||
int i;
|
||||
|
||||
vdd.getStatSevr(db->status,db->severity);
|
||||
db->value=vdd; // always scaler
|
||||
db->no_str=menu.getDataSizeElements();
|
||||
|
||||
for(i=0;i<db->no_str;i++) strcpy(&(db->strs[i][0]),str[i]);
|
||||
|
||||
db->value=vdd; // always scaler
|
||||
if(str && str!=f)
|
||||
{
|
||||
for(i=0;i<db->no_str;i++)
|
||||
strcpy(&(db->strs[i][0]),str[i].fixed_string);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -920,8 +984,10 @@ static gdd* mapGraphicCharToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_CHAR].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_char_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_char_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_graphicHigh]=db->upper_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_alarmLow]=db->lower_alarm_limit;
|
||||
@@ -950,8 +1016,10 @@ static gdd* mapControlCharToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_CHAR].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_char_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh]=db->upper_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_controlLow]=db->lower_ctrl_limit;
|
||||
@@ -981,9 +1049,10 @@ static int mapGraphicGddToChar(void* v, gdd* dd)
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_char_value];
|
||||
int sz=1;
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_gr_char_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_char_graphicHigh];
|
||||
db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_char_alarmLow];
|
||||
@@ -1008,9 +1077,10 @@ static int mapControlGddToChar(void* v, gdd* dd)
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_char_value];
|
||||
int sz=1;
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_char_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_char_graphicHigh];
|
||||
db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_char_controlLow];
|
||||
@@ -1039,8 +1109,10 @@ static gdd* mapGraphicLongToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_LONG].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_long_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_long_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_graphicHigh]=db->upper_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_alarmLow]=db->lower_alarm_limit;
|
||||
@@ -1069,8 +1141,10 @@ static gdd* mapControlLongToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_LONG].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_long_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh]=db->upper_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_controlLow]=db->lower_ctrl_limit;
|
||||
@@ -1100,9 +1174,10 @@ static int mapGraphicGddToLong(void* v, gdd* dd)
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_long_value];
|
||||
int sz=1;
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_gr_long_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_long_graphicHigh];
|
||||
db->lower_alarm_limit=dd[gddAppTypeIndex_dbr_gr_long_alarmLow];
|
||||
@@ -1127,9 +1202,10 @@ static int mapControlGddToLong(void* v, gdd* dd)
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_long_value];
|
||||
int sz=1;
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_long_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_long_graphicHigh];
|
||||
db->lower_ctrl_limit=dd[gddAppTypeIndex_dbr_ctrl_long_controlLow];
|
||||
@@ -1158,8 +1234,10 @@ static gdd* mapGraphicDoubleToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_GR_DOUBLE].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_double_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_gr_double_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -1189,8 +1267,10 @@ static gdd* mapControlDoubleToGdd(void* v, aitIndex count)
|
||||
gdd* dd = type_table->getDD(gddDbrToAit[DBR_CTRL_DOUBLE].app);
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_double_value];
|
||||
|
||||
aitString str = db->units;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_units].put(str);
|
||||
aitString* str = NULL;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str);
|
||||
str->copy(db->units);
|
||||
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_precision]=db->precision;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_graphicLow]=db->lower_disp_limit;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_graphicHigh]=db->upper_disp_limit;
|
||||
@@ -1221,9 +1301,10 @@ static int mapGraphicGddToDouble(void* v, gdd* dd)
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_gr_double_value];
|
||||
int sz=1;
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_gr_double_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->precision=dd[gddAppTypeIndex_dbr_gr_double_precision];
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_gr_double_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_gr_double_graphicHigh];
|
||||
@@ -1249,9 +1330,10 @@ static int mapControlGddToDouble(void* v, gdd* dd)
|
||||
gdd& vdd = dd[gddAppTypeIndex_dbr_ctrl_double_value];
|
||||
int sz=1;
|
||||
|
||||
aitString str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_units].get(str);
|
||||
strcpy(db->units,str.string());
|
||||
aitString* str;
|
||||
dd[gddAppTypeIndex_dbr_ctrl_double_units].getRef(str);
|
||||
if(str->string()) strcpy(db->units,str->string());
|
||||
|
||||
db->precision=dd[gddAppTypeIndex_dbr_ctrl_double_precision];
|
||||
db->lower_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_double_graphicLow];
|
||||
db->upper_disp_limit=dd[gddAppTypeIndex_dbr_ctrl_double_graphicHigh];
|
||||
@@ -1279,7 +1361,7 @@ void gddMakeMapDBR(gddApplicationTypeTable& tt) { gddMakeMapDBR(&tt); }
|
||||
void gddMakeMapDBR(gddApplicationTypeTable* tt)
|
||||
{
|
||||
type_table=tt;
|
||||
int i;
|
||||
size_t i;
|
||||
|
||||
// Storing the DBRxxx type code in the app table will not work
|
||||
// for most of the types. This is because many share the same
|
||||
|
||||
196
src/gdd/gdd.cc
196
src/gdd/gdd.cc
@@ -4,6 +4,23 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.7 1996/08/13 15:07:46 jbk
|
||||
// changes for better string manipulation and fixes for the units field
|
||||
//
|
||||
// Revision 1.6 1996/08/06 19:14:11 jbk
|
||||
// Fixes to the string class.
|
||||
// Changes units field to a aitString instead of aitInt8.
|
||||
//
|
||||
// Revision 1.5 1996/07/26 02:23:16 jbk
|
||||
// Fixed the spelling error with Scalar.
|
||||
//
|
||||
// Revision 1.4 1996/07/23 17:13:31 jbk
|
||||
// various fixes - dbmapper incorrectly worked with enum types
|
||||
//
|
||||
// Revision 1.3 1996/06/26 21:00:07 jbk
|
||||
// Fixed up code in aitHelpers, removed unused variables in others
|
||||
// Fixed potential problem in gddAppTable.cc with the map functions
|
||||
//
|
||||
// Revision 1.2 1996/06/26 02:42:06 jbk
|
||||
// more correction to the aitString processing - testing menus
|
||||
//
|
||||
@@ -100,11 +117,11 @@ void gdd::init(int app, aitEnum prim, int dimen)
|
||||
setApplType(app);
|
||||
setPrimType(prim);
|
||||
dim=(aitUint8)dimen;
|
||||
setData(NULL);
|
||||
destruct=NULL;
|
||||
ref_cnt=1;
|
||||
flags=0;
|
||||
bounds=NULL;
|
||||
setData(NULL);
|
||||
|
||||
if(dim)
|
||||
{
|
||||
@@ -116,6 +133,11 @@ void gdd::init(int app, aitEnum prim, int dimen)
|
||||
default: bounds=(gddBounds*)new gddBounds[dim]; break;
|
||||
}
|
||||
}
|
||||
else if(primitiveType()==aitEnumString)
|
||||
{
|
||||
aitString* str=(aitString*)dataAddress();
|
||||
str->init();
|
||||
}
|
||||
}
|
||||
|
||||
gdd::gdd(gdd* dd)
|
||||
@@ -133,7 +155,7 @@ gdd::~gdd(void)
|
||||
|
||||
// this function need to be corrected for use of aitEnumString!
|
||||
|
||||
if(isScaler())
|
||||
if(isScalar())
|
||||
{
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
{
|
||||
@@ -218,7 +240,7 @@ gddStatus gdd::genCopy(aitEnum t, const void* d)
|
||||
aitInt8* buf;
|
||||
gddStatus rc=0;
|
||||
|
||||
if(isScaler())
|
||||
if(isScalar())
|
||||
aitConvert(primitiveType(),&data,t,d,1);
|
||||
else if(isAtomic())
|
||||
{
|
||||
@@ -251,7 +273,7 @@ gddStatus gdd::changeType(int app,aitEnum prim)
|
||||
// this should only be allowed for setting the type if it is
|
||||
// undefined or if the data is a scaler
|
||||
|
||||
if(isScaler() || primitiveType()==aitEnumInvalid)
|
||||
if(isScalar() || primitiveType()==aitEnumInvalid)
|
||||
{
|
||||
setApplType(app);
|
||||
setPrimType(prim);
|
||||
@@ -316,7 +338,7 @@ gddStatus gdd::copyStuff(gdd* dd,int ctype)
|
||||
{
|
||||
init(dd->applicationType(),dd->primitiveType(),dd->dimension());
|
||||
|
||||
if(dd->isScaler())
|
||||
if(dd->isScalar())
|
||||
data=dd->data;
|
||||
else // atomic
|
||||
{
|
||||
@@ -404,7 +426,7 @@ size_t gdd::getTotalSizeBytes(void) const
|
||||
sz=sizeof(gdd)+(sizeof(gddBounds)*dimension());
|
||||
|
||||
// special case the aitString/aitFixedString here - sucks bad
|
||||
if(isScaler())
|
||||
if(isScalar())
|
||||
{
|
||||
if(primitiveType()==aitEnumString)
|
||||
{
|
||||
@@ -515,7 +537,7 @@ size_t gdd::flattenWithAddress(void* buf, size_t size, aitIndex* total_dd)
|
||||
// aitString or aitFixedString (even if scaler gdd)
|
||||
// must special case the strings - that really sucks
|
||||
|
||||
if(isScaler())
|
||||
if(isScalar())
|
||||
{
|
||||
// here is special case for the string types
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
@@ -531,8 +553,10 @@ size_t gdd::flattenWithAddress(void* buf, size_t size, aitIndex* total_dd)
|
||||
if(str->string())
|
||||
{
|
||||
memcpy((char*)&pdd[pos],str->string(),str->length()+1);
|
||||
*str=(char*)&pdd[pos];
|
||||
str->force((char*)&pdd[pos]);
|
||||
}
|
||||
else
|
||||
str->init();
|
||||
}
|
||||
}
|
||||
else if(isContainer())
|
||||
@@ -593,7 +617,6 @@ gddStatus gdd::flattenData(gdd* dd, int tot_dds, void* buf,size_t size)
|
||||
size_t sz;
|
||||
gddBounds* bnds;
|
||||
aitUint8* ptr = (aitUint8*)buf;
|
||||
unsigned long tmp;
|
||||
|
||||
// This functions needs to be divided into two sections
|
||||
// 1) copy ALL the bounds out
|
||||
@@ -654,7 +677,7 @@ gddStatus gdd::flattenData(gdd* dd, int tot_dds, void* buf,size_t size)
|
||||
dd[i].bounds=NULL;
|
||||
}
|
||||
}
|
||||
else if(dd[i].isScaler())
|
||||
else if(dd[i].isScalar())
|
||||
{
|
||||
// here is special case for String types
|
||||
if(dd[i].primitiveType()==aitEnumString)
|
||||
@@ -663,9 +686,11 @@ gddStatus gdd::flattenData(gdd* dd, int tot_dds, void* buf,size_t size)
|
||||
if(str->string())
|
||||
{
|
||||
memcpy(ptr,str->string(),str->length()+1);
|
||||
*str=(char*)ptr;
|
||||
str->force((char*)ptr);
|
||||
ptr+=str->length()+1;
|
||||
}
|
||||
else
|
||||
str->init();
|
||||
}
|
||||
else if(dd[i].primitiveType()==aitEnumFixedString)
|
||||
{
|
||||
@@ -764,10 +789,12 @@ gddStatus gdd::convertOffsetsToAddress(void)
|
||||
cstr=str[i].string();
|
||||
str[i].force(pdd+(unsigned long)cstr);
|
||||
}
|
||||
else
|
||||
str[i].init();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(isScaler())
|
||||
else if(isScalar())
|
||||
{
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
if(data.FString) setData(pdd+dp);
|
||||
@@ -779,6 +806,8 @@ gddStatus gdd::convertOffsetsToAddress(void)
|
||||
cstr=str->string();
|
||||
str->force(pdd+(unsigned long)cstr);
|
||||
}
|
||||
else
|
||||
str->init();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -830,13 +859,14 @@ gddStatus gdd::convertAddressToOffsets(void)
|
||||
{
|
||||
cstr=str[i].string();
|
||||
if(cstr) str[i].force(cstr-(const char*)pdd);
|
||||
else str[i].init();
|
||||
}
|
||||
}
|
||||
// bounds and data of atomic to offsets
|
||||
setData((gdd*)(dp-pdd));
|
||||
bounds=(gddBounds*)(bnds-pdd);
|
||||
}
|
||||
else if(isScaler())
|
||||
else if(isScalar())
|
||||
{
|
||||
// handle the special string scaler cases
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
@@ -846,6 +876,7 @@ gddStatus gdd::convertAddressToOffsets(void)
|
||||
str=(aitString*)dataAddress();
|
||||
cstr=str->string();
|
||||
if(cstr) str->force(cstr-(const char*)pdd);
|
||||
else str->init();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -916,6 +947,108 @@ gddStatus gdd::reset(aitEnum prim, int dimen, aitIndex* cnt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void gdd::get(aitString& d)
|
||||
{
|
||||
if(primitiveType()==aitEnumString)
|
||||
{
|
||||
aitString* s=(aitString*)dataAddress();
|
||||
d=*s;
|
||||
}
|
||||
else if(dim==1 && primitiveType()==aitEnumInt8)
|
||||
{
|
||||
if(isConstant())
|
||||
{
|
||||
const char* ci=(const char*)dataPointer();
|
||||
d.copy(ci);
|
||||
}
|
||||
else
|
||||
{
|
||||
char* i=(char*)dataPointer();
|
||||
d.copy(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
get(aitEnumString,&d);
|
||||
}
|
||||
void gdd::get(aitFixedString& d)
|
||||
{
|
||||
if(primitiveType()==aitEnumFixedString)
|
||||
strcpy(d.fixed_string,data.FString->fixed_string);
|
||||
else if(primitiveType()==aitEnumInt8 && dim==1)
|
||||
strcpy(d.fixed_string,(char*)dataPointer());
|
||||
else
|
||||
get(aitEnumFixedString,&d);
|
||||
}
|
||||
|
||||
void gdd::getConvert(aitString& d)
|
||||
{
|
||||
if(primitiveType()==aitEnumInt8 && dim==1)
|
||||
{
|
||||
if(isConstant())
|
||||
{
|
||||
const char* ci=(const char*)dataPointer();
|
||||
d.copy(ci);
|
||||
}
|
||||
else
|
||||
{
|
||||
char* i=(char*)dataPointer();
|
||||
d.copy(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
get(aitEnumString,&d);
|
||||
}
|
||||
|
||||
void gdd::getConvert(aitFixedString& d)
|
||||
{
|
||||
if(primitiveType()==aitEnumInt8 && dim==1)
|
||||
strcpy(d.fixed_string,(char*)dataPointer());
|
||||
else
|
||||
get(aitEnumFixedString,d.fixed_string);
|
||||
}
|
||||
|
||||
void gdd::put(aitString d)
|
||||
{
|
||||
aitString* s=(aitString*)dataAddress();
|
||||
*s=d;
|
||||
setPrimType(aitEnumString);
|
||||
}
|
||||
|
||||
// this is dangerous, should the fixed string be copied here?
|
||||
void gdd::put(aitFixedString& d)
|
||||
{
|
||||
data.FString=&d;
|
||||
setPrimType(aitEnumFixedString);
|
||||
}
|
||||
|
||||
void gdd::putConvert(aitString d)
|
||||
{
|
||||
if(primitiveType()==aitEnumInt8 && dim==1)
|
||||
{
|
||||
aitUint32 len = getDataSizeElements();
|
||||
char* cp = (char*)dataPointer();
|
||||
if(d.length()<len) len=d.length();
|
||||
strncpy(cp,d.string(),len);
|
||||
cp[len]='\0';
|
||||
}
|
||||
else
|
||||
set(aitEnumString,&d);
|
||||
}
|
||||
|
||||
void gdd::putConvert(aitFixedString& d)
|
||||
{
|
||||
if(primitiveType()==aitEnumInt8 && dim==1)
|
||||
{
|
||||
aitUint32 len = getDataSizeElements();
|
||||
char* cp = (char*)dataPointer();
|
||||
if(sizeof(d.fixed_string)<len) len=sizeof(d.fixed_string);
|
||||
strncpy(cp,d.fixed_string,len);
|
||||
cp[len]='\0';
|
||||
}
|
||||
else
|
||||
set(aitEnumFixedString,d.fixed_string);
|
||||
}
|
||||
|
||||
// copy each of the strings into this DDs storage area
|
||||
gddStatus gdd::put(const aitString* const d)
|
||||
{
|
||||
@@ -953,12 +1086,13 @@ gddStatus gdd::put(const gdd* dd)
|
||||
|
||||
if(isContainer() || dd->isContainer())
|
||||
rc=gddErrorNotSupported;
|
||||
if(isScaler() && dd->isScaler())
|
||||
else if(isScalar() && dd->isScalar())
|
||||
{
|
||||
// this is the simple case - just make this scaler look like the other
|
||||
// not protected against screwing up the string type
|
||||
setPrimType(dd->primitiveType());
|
||||
put(((aitType*)dd->dataAddress()));
|
||||
// set(dd->primitiveType(),dd->dataAddress());
|
||||
}
|
||||
else if(isAtomic() && dd->isAtomic())
|
||||
{
|
||||
@@ -1024,7 +1158,32 @@ gddStatus gdd::put(const gdd* dd)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if(isScaler())
|
||||
else if((primitiveType()==aitEnumString ||
|
||||
primitiveType()==aitEnumFixedString) &&
|
||||
dd->primitiveType()==aitEnumInt8 &&
|
||||
isScalar() && dd->isAtomic())
|
||||
{
|
||||
// special case for aitInt8--->aitString (hate this)
|
||||
aitInt8* i1=(aitInt8*)dd->dataPointer();
|
||||
put(i1);
|
||||
}
|
||||
else if(primitiveType()==aitEnumInt8 &&
|
||||
dd->primitiveType()==aitEnumString &&
|
||||
dd->isScalar() && isAtomic())
|
||||
{
|
||||
// special case for aitString--->aitInt8
|
||||
aitString* s1=(aitString*)dd->dataAddress();
|
||||
put(*s1);
|
||||
}
|
||||
else if(primitiveType()==aitEnumInt8 &&
|
||||
dd->primitiveType()==aitEnumFixedString &&
|
||||
dd->isScalar() && isAtomic())
|
||||
{
|
||||
// special case for aitFixedString--->aitInt8
|
||||
aitFixedString* s2=data.FString;
|
||||
if(s2) put(*s2);
|
||||
}
|
||||
else if(isScalar())
|
||||
{
|
||||
// just put first element of dd into this scaler - sucks
|
||||
if(dd->getDataSizeElements()>0)
|
||||
@@ -1039,6 +1198,11 @@ gddStatus gdd::put(const gdd* dd)
|
||||
dd->primitiveType(),dd->dataAddress(),1);
|
||||
}
|
||||
|
||||
aitTimeStamp ts;
|
||||
setStatSevr(dd->getStat(),dd->getSevr());
|
||||
dd->getTimeStamp(&ts);
|
||||
setTimeStamp(&ts);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1112,7 +1276,7 @@ gddStatus gddAtomic::setBoundingBoxOrigin(const aitUint32* const b)
|
||||
return rc;
|
||||
}
|
||||
|
||||
// --------------------The gddScaler functions---------------------
|
||||
// --------------------The gddScalar functions---------------------
|
||||
|
||||
// --------------------The gddContainer functions---------------------
|
||||
|
||||
|
||||
223
src/gdd/gdd.h
223
src/gdd/gdd.h
@@ -8,6 +8,32 @@
|
||||
* $Id$
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.9 1996/08/14 12:30:15 jbk
|
||||
* fixes for converting aitString to aitInt8* and back
|
||||
* fixes for managing the units field for the dbr types
|
||||
*
|
||||
* Revision 1.8 1996/08/13 15:07:48 jbk
|
||||
* changes for better string manipulation and fixes for the units field
|
||||
*
|
||||
* Revision 1.7 1996/08/09 02:29:16 jbk
|
||||
* fix getRef(aitString*&) to return the correct value if gdd is scalar
|
||||
*
|
||||
* Revision 1.6 1996/08/06 19:14:12 jbk
|
||||
* Fixes to the string class.
|
||||
* Changes units field to a aitString instead of aitInt8.
|
||||
*
|
||||
* Revision 1.5 1996/07/26 02:23:17 jbk
|
||||
* Fixed the spelling error with Scalar.
|
||||
*
|
||||
* Revision 1.4 1996/07/24 22:17:17 jhill
|
||||
* removed gdd:: from func proto
|
||||
*
|
||||
* Revision 1.3 1996/07/23 17:13:33 jbk
|
||||
* various fixes - dbmapper incorrectly worked with enum types
|
||||
*
|
||||
* Revision 1.2 1996/06/26 00:19:40 jhill
|
||||
* added CHAR_BIT to max bound calc for the "ref_cnt" member of class gdd
|
||||
*
|
||||
* Revision 1.1 1996/06/25 19:11:38 jbk
|
||||
* new in EPICS base
|
||||
*
|
||||
@@ -82,7 +108,7 @@ typedef struct timespec timespec;
|
||||
|
||||
class gddContainer;
|
||||
class gddAtomic;
|
||||
class gddScaler;
|
||||
class gddScalar;
|
||||
|
||||
// Not Complete in this prototype:
|
||||
// - Read only DD.
|
||||
@@ -248,7 +274,7 @@ public:
|
||||
// ---------------------------------------------------------------------
|
||||
// class structure for DDs:
|
||||
//
|
||||
// gddScaler
|
||||
// gddScalar
|
||||
// \
|
||||
// gddAtomic gddContainer
|
||||
// \ /
|
||||
@@ -297,10 +323,10 @@ public:
|
||||
void* dataPointer(void) const;
|
||||
void* dataPointer(aitIndex element_offset) const;
|
||||
|
||||
void getTimeStamp(struct timespec* ts);
|
||||
void getTimeStamp(aitTimeStamp* ts);
|
||||
void setTimeStamp(struct timespec* ts);
|
||||
void setTimeStamp(aitTimeStamp* ts);
|
||||
void getTimeStamp(struct timespec* const ts) const;
|
||||
void getTimeStamp(aitTimeStamp* const ts) const;
|
||||
void setTimeStamp(const struct timespec* const ts);
|
||||
void setTimeStamp(const aitTimeStamp* const ts);
|
||||
void setStatus(aitUint32);
|
||||
void setStatus(aitUint16 high, aitUint16 low);
|
||||
void getStatus(aitUint32&);
|
||||
@@ -308,8 +334,8 @@ public:
|
||||
|
||||
void setStat(aitUint16);
|
||||
void setSevr(aitUint16);
|
||||
aitUint16 getStat(void);
|
||||
aitUint16 getSevr(void);
|
||||
aitUint16 getStat(void) const;
|
||||
aitUint16 getSevr(void) const;
|
||||
void setStatSevr(aitInt16 stat, aitInt16 sevr);
|
||||
void getStatSevr(aitInt16& stat, aitInt16& sevr);
|
||||
|
||||
@@ -322,7 +348,7 @@ public:
|
||||
// scaler or atomic type to container
|
||||
|
||||
// copyInfo() will copy DD info only, this means appl, primitive type
|
||||
// and bounds. Scaler data will be copied, but no arrays.
|
||||
// and bounds. Scalar data will be copied, but no arrays.
|
||||
// copy() will copy DD info, bounds, allocate array data buffer and
|
||||
// copy data into it.
|
||||
// Dup() will copy DD info. bounds, data references copied only.
|
||||
@@ -338,7 +364,7 @@ public:
|
||||
gddStatus convertOffsetsToAddress(void);
|
||||
gddStatus convertAddressToOffsets(void);
|
||||
|
||||
int isScaler(void) const;
|
||||
int isScalar(void) const;
|
||||
int isContainer(void) const;
|
||||
int isAtomic(void) const;
|
||||
|
||||
@@ -501,27 +527,27 @@ public:
|
||||
// gdd& operator=(aitFixedString d); // not present
|
||||
|
||||
// Same as getRef() methods
|
||||
gdd::operator aitFloat64*(void) const;
|
||||
gdd::operator aitFloat32*(void) const;
|
||||
gdd::operator aitUint32*(void) const;
|
||||
gdd::operator aitInt32*(void) const;
|
||||
gdd::operator aitUint16*(void) const;
|
||||
gdd::operator aitInt16*(void) const;
|
||||
gdd::operator aitUint8*(void) const;
|
||||
gdd::operator aitInt8*(void) const;
|
||||
gdd::operator aitString*(void) const;
|
||||
gdd::operator aitFixedString*(void) const;
|
||||
operator aitFloat64*(void) const;
|
||||
operator aitFloat32*(void) const;
|
||||
operator aitUint32*(void) const;
|
||||
operator aitInt32*(void) const;
|
||||
operator aitUint16*(void) const;
|
||||
operator aitInt16*(void) const;
|
||||
operator aitUint8*(void) const;
|
||||
operator aitInt8*(void) const;
|
||||
operator aitString*(void) const;
|
||||
operator aitFixedString*(void) const;
|
||||
|
||||
// Same as get() methods
|
||||
gdd::operator aitFloat64(void);
|
||||
gdd::operator aitFloat32(void);
|
||||
gdd::operator aitUint32(void);
|
||||
gdd::operator aitInt32(void);
|
||||
gdd::operator aitUint16(void);
|
||||
gdd::operator aitInt16(void);
|
||||
gdd::operator aitUint8(void);
|
||||
gdd::operator aitInt8(void);
|
||||
gdd::operator aitString(void);
|
||||
operator aitFloat64(void);
|
||||
operator aitFloat32(void);
|
||||
operator aitUint32(void);
|
||||
operator aitInt32(void);
|
||||
operator aitUint16(void);
|
||||
operator aitInt16(void);
|
||||
operator aitUint8(void);
|
||||
operator aitInt8(void);
|
||||
operator aitString(void);
|
||||
// gdd::operator aitFixedString(void); // not present
|
||||
|
||||
gddStatus genCopy(aitEnum t, const void* d);
|
||||
@@ -608,13 +634,14 @@ inline void gdd::markFlat(void) { flags|=GDD_FLAT_MASK; }
|
||||
inline void gdd::markManaged(void) { flags|=GDD_MANAGED_MASK; }
|
||||
inline void gdd::markUnmanaged(void) { flags&=~GDD_MANAGED_MASK; }
|
||||
|
||||
inline void gdd::getTimeStamp(struct timespec* ts)
|
||||
inline void gdd::getTimeStamp(struct timespec* const ts) const
|
||||
{ ts->tv_sec=time_stamp.tv_sec; ts->tv_nsec=time_stamp.tv_nsec; }
|
||||
inline void gdd::setTimeStamp(struct timespec* ts) {
|
||||
inline void gdd::setTimeStamp(const struct timespec* const ts) {
|
||||
time_stamp.tv_sec=(aitUint32)ts->tv_sec;
|
||||
time_stamp.tv_nsec=(aitUint32)ts->tv_nsec; }
|
||||
inline void gdd::getTimeStamp(aitTimeStamp* ts) { *ts=time_stamp; }
|
||||
inline void gdd::setTimeStamp(aitTimeStamp* ts) { time_stamp=*ts; }
|
||||
inline void gdd::getTimeStamp(aitTimeStamp* const ts) const { *ts=time_stamp; }
|
||||
inline void gdd::setTimeStamp(const aitTimeStamp* const ts) { time_stamp=*ts; }
|
||||
|
||||
inline void gdd::setStatus(aitUint32 s) { status=s; }
|
||||
inline void gdd::getStatus(aitUint32& s) { s=status; }
|
||||
inline void gdd::setStatus(aitUint16 high, aitUint16 low)
|
||||
@@ -626,9 +653,9 @@ inline void gdd::setStat(aitUint16 s)
|
||||
{ aitUint16* x = (aitUint16*)&status; x[0]=s; }
|
||||
inline void gdd::setSevr(aitUint16 s)
|
||||
{ aitUint16* x = (aitUint16*)&status; x[1]=s; }
|
||||
inline aitUint16 gdd::getStat(void)
|
||||
inline aitUint16 gdd::getStat(void) const
|
||||
{ aitUint16* x = (aitUint16*)&status; return x[0]; }
|
||||
inline aitUint16 gdd::getSevr(void)
|
||||
inline aitUint16 gdd::getSevr(void) const
|
||||
{ aitUint16* x = (aitUint16*)&status; return x[1]; }
|
||||
inline void gdd::getStatSevr(aitInt16& st, aitInt16& se)
|
||||
{ st=getStat(); se=getSevr(); }
|
||||
@@ -638,7 +665,7 @@ inline void gdd::setStatSevr(aitInt16 st, aitInt16 se)
|
||||
inline gdd& gdd::operator=(const gdd& v)
|
||||
{ memcpy(this,&v,sizeof(gdd)); return *this; }
|
||||
|
||||
inline int gdd::isScaler(void) const { return dimension()==0?1:0; }
|
||||
inline int gdd::isScalar(void) const { return dimension()==0?1:0; }
|
||||
inline int gdd::isContainer(void) const
|
||||
{ return (primitiveType()==aitEnumContainer)?1:0; }
|
||||
inline int gdd::isAtomic(void) const
|
||||
@@ -672,10 +699,9 @@ inline gddStatus gdd::unreference(void)
|
||||
if(ref_cnt==0u)
|
||||
{
|
||||
fprintf(stderr,"gdd reference count underflow!!\n");
|
||||
return gddErrorUnderflow;
|
||||
rc=gddErrorUnderflow;
|
||||
}
|
||||
|
||||
if(--ref_cnt<=0u)
|
||||
else if(--ref_cnt<=0u)
|
||||
{
|
||||
if(isManaged())
|
||||
{
|
||||
@@ -699,6 +725,14 @@ inline void gdd::destroyData(void)
|
||||
else
|
||||
destruct->run(voidData());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(primitiveType()==aitEnumString && isScalar())
|
||||
{
|
||||
aitString* str = (aitString*)dataAddress();
|
||||
str->clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void gdd::adjust(gddDestructor* d, void* v, aitEnum type)
|
||||
@@ -723,10 +757,12 @@ inline void gdd::getRef(aitUint16*& d) { d=(aitUint16*)voidData(); }
|
||||
inline void gdd::getRef(aitInt16*& d) { d=(aitInt16*)voidData(); }
|
||||
inline void gdd::getRef(aitUint8*& d) { d=(aitUint8*)voidData(); }
|
||||
inline void gdd::getRef(aitInt8*& d) { d=(aitInt8*)voidData(); }
|
||||
inline void gdd::getRef(aitString*& d) { d=(aitString*)voidData(); }
|
||||
inline void gdd::getRef(void*& d) { d=voidData(); }
|
||||
inline void gdd::getRef(aitFixedString*& d) { d=(aitFixedString*)voidData(); }
|
||||
|
||||
inline void gdd::getRef(aitString*& d)
|
||||
{ if(isScalar()) d=(aitString*)dataAddress(); else d=(aitString*)voidData(); }
|
||||
|
||||
inline void gdd::putRef(void* v,aitEnum code, gddDestructor* d)
|
||||
{ adjust(d, v, code); }
|
||||
inline void gdd::putRef(aitFloat64* v, gddDestructor* d)
|
||||
@@ -779,8 +815,6 @@ inline void gdd::getConvert(aitUint16& d) { get(aitEnumUint16,&d); }
|
||||
inline void gdd::getConvert(aitInt16& d) { get(aitEnumInt16,&d); }
|
||||
inline void gdd::getConvert(aitUint8& d) { get(aitEnumUint8,&d); }
|
||||
inline void gdd::getConvert(aitInt8& d) { get(aitEnumInt8,&d); }
|
||||
inline void gdd::getConvert(aitString& d) { get(aitEnumString,&d); }
|
||||
inline void gdd::getConvert(aitFixedString& d){get(aitEnumFixedString,d.fixed_string);}
|
||||
|
||||
inline void gdd::putConvert(aitFloat64 d){ set(aitEnumFloat64,&d); }
|
||||
inline void gdd::putConvert(aitFloat32 d){ set(aitEnumFloat32,&d); }
|
||||
@@ -790,8 +824,6 @@ inline void gdd::putConvert(aitUint16 d) { set(aitEnumUint16,&d); }
|
||||
inline void gdd::putConvert(aitInt16 d) { set(aitEnumInt16,&d); }
|
||||
inline void gdd::putConvert(aitUint8 d) { set(aitEnumUint8,&d); }
|
||||
inline void gdd::putConvert(aitInt8 d) { set(aitEnumInt8,&d); }
|
||||
inline void gdd::putConvert(aitString d) { set(aitEnumString,&d); }
|
||||
inline void gdd::putConvert(aitFixedString& d) { set(aitEnumFixedString,d.fixed_string); }
|
||||
|
||||
inline gddStatus gdd::put(const aitFloat64* const d)
|
||||
{ return genCopy(aitEnumFloat64,d); }
|
||||
@@ -807,8 +839,27 @@ inline gddStatus gdd::put(const aitInt16* const d)
|
||||
{ return genCopy(aitEnumInt16,d); }
|
||||
inline gddStatus gdd::put(const aitUint8* const d)
|
||||
{ return genCopy(aitEnumUint8,d); }
|
||||
|
||||
// special case for aitInt8 array to aitString scalar
|
||||
inline gddStatus gdd::put(const aitInt8* const d)
|
||||
{ return genCopy(aitEnumInt8,d); }
|
||||
{
|
||||
gddStatus rc=0;
|
||||
|
||||
if(primitiveType()==aitEnumString && dim==0)
|
||||
{
|
||||
aitString* p = (aitString*)dataAddress();
|
||||
if(isConstant())
|
||||
p->replaceData((char*)d);
|
||||
else
|
||||
p->copy((char*)d);
|
||||
}
|
||||
else if(primitiveType()==aitEnumFixedString && dim==0)
|
||||
strcpy(data.FString->fixed_string,(char*)d);
|
||||
else
|
||||
rc=genCopy(aitEnumInt8,d);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
// currently unprotected from destroying an atomic gdd
|
||||
inline void gdd::put(aitFloat64 d){ data.Float64=d;setPrimType(aitEnumFloat64);}
|
||||
@@ -820,10 +871,6 @@ inline void gdd::put(aitInt16 d) { data.Int16=d; setPrimType(aitEnumInt16); }
|
||||
inline void gdd::put(aitUint8 d) { data.Uint8=d; setPrimType(aitEnumUint8); }
|
||||
inline void gdd::put(aitInt8 d) { data.Int8=d; setPrimType(aitEnumInt8); }
|
||||
inline void gdd::put(aitType* d) { data=*d; }
|
||||
inline void gdd::put(aitString d)
|
||||
{ aitString* s=(aitString*)&data; *s=d; setPrimType(aitEnumString); }
|
||||
inline void gdd::put(aitFixedString& d)
|
||||
{ data.FString=&d; setPrimType(aitEnumFixedString); }
|
||||
|
||||
inline void gdd::get(void* d)
|
||||
{ aitConvert(primitiveType(),d,primitiveType(),voidData(),getDataSizeElements());}
|
||||
@@ -843,13 +890,25 @@ inline void gdd::get(aitInt16* d)
|
||||
{ aitConvert(aitEnumInt16,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitUint8* d)
|
||||
{ aitConvert(aitEnumUint8,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitInt8* d)
|
||||
{ aitConvert(aitEnumInt8,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitString* d)
|
||||
{ aitConvert(aitEnumString,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
inline void gdd::get(aitFixedString* d)
|
||||
{ aitConvert(aitEnumFixedString,d,primitiveType(),voidData(),getDataSizeElements()); }
|
||||
|
||||
// special case for string scalar to aitInt8 array!
|
||||
inline void gdd::get(aitInt8* d)
|
||||
{
|
||||
if(primitiveType()==aitEnumString && dim==0)
|
||||
{
|
||||
aitString* str = (aitString*)dataAddress();
|
||||
strcpy((char*)d,str->string());
|
||||
}
|
||||
else if(primitiveType()==aitEnumFixedString && dim==0)
|
||||
strcpy((char*)d,data.FString->fixed_string);
|
||||
else
|
||||
aitConvert(aitEnumInt8,d,primitiveType(),voidData(),getDataSizeElements());
|
||||
}
|
||||
|
||||
inline void gdd::get(aitFloat64& d) {
|
||||
if(primitiveType()==aitEnumFloat64) d=getData().Float64;
|
||||
else get(aitEnumFloat64,&d);
|
||||
@@ -882,14 +941,6 @@ inline void gdd::get(aitInt8& d) {
|
||||
if(primitiveType()==aitEnumInt8) d=getData().Int8;
|
||||
else get(aitEnumInt8,&d);
|
||||
}
|
||||
inline void gdd::get(aitString& d) {
|
||||
if(primitiveType()==aitEnumString) {aitString* s=(aitString*)&data; d=*s; }
|
||||
else get(aitEnumString,&d);
|
||||
}
|
||||
inline void gdd::get(aitFixedString& d) {
|
||||
if(primitiveType()==aitEnumFixedString) { d=*(getData().FString); }
|
||||
else get(aitEnumFixedString,&d);
|
||||
}
|
||||
inline void gdd::get(aitType& d) { d=data; }
|
||||
|
||||
inline gdd& gdd::operator=(aitFloat64* v) { putRef(v); return *this;}
|
||||
@@ -976,30 +1027,30 @@ private:
|
||||
// Add handling of the special case where the data is a scaler - the
|
||||
// dimension is zero
|
||||
|
||||
class gddScaler : public gddAtomic
|
||||
class gddScalar : public gddAtomic
|
||||
{
|
||||
public:
|
||||
gddScaler(void) { }
|
||||
gddScaler(gddScaler* ad) : gddAtomic(ad) { }
|
||||
gddScaler(int app) : gddAtomic(app) { }
|
||||
gddScaler(int app,aitEnum prim) : gddAtomic(app,prim) { }
|
||||
gddScalar(void) { }
|
||||
gddScalar(gddScalar* ad) : gddAtomic(ad) { }
|
||||
gddScalar(int app) : gddAtomic(app) { }
|
||||
gddScalar(int app,aitEnum prim) : gddAtomic(app,prim) { }
|
||||
|
||||
void dump(void);
|
||||
void test(void);
|
||||
|
||||
gddScaler& operator=(aitFloat64 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScaler& operator=(aitFloat32 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScaler& operator=(aitUint32 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScaler& operator=(aitInt32 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScaler& operator=(aitUint16 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScaler& operator=(aitInt16 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScaler& operator=(aitUint8 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScaler& operator=(aitInt8 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitFloat64 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitFloat32 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitUint32 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitInt32 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitUint16 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitInt16 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitUint8 d) { *((gdd*)this)=d; return *this; }
|
||||
gddScalar& operator=(aitInt8 d) { *((gdd*)this)=d; return *this; }
|
||||
|
||||
protected:
|
||||
gddScaler(int app, aitEnum prim, int dimen, aitUint32* size_array):
|
||||
gddScalar(int app, aitEnum prim, int dimen, aitUint32* size_array):
|
||||
gddAtomic(app,prim,dimen,size_array) { }
|
||||
~gddScaler(void) { }
|
||||
~gddScalar(void) { }
|
||||
|
||||
// disallow
|
||||
const gddBounds* getBounds(void) { return NULL; }
|
||||
@@ -1048,7 +1099,7 @@ public:
|
||||
|
||||
// The following are slow and inefficient
|
||||
gdd* getDD(aitIndex index);
|
||||
gdd* getDD(aitIndex index,gddScaler*&);
|
||||
gdd* getDD(aitIndex index,gddScalar*&);
|
||||
gdd* getDD(aitIndex index,gddAtomic*&);
|
||||
gdd* getDD(aitIndex index,gddContainer*&);
|
||||
gdd* operator[](aitIndex index);
|
||||
@@ -1077,8 +1128,8 @@ inline int gddContainer::total(void)
|
||||
{ return bounds->size(); }
|
||||
inline gdd* gddContainer::operator[](aitIndex index)
|
||||
{ return getDD(index); }
|
||||
inline gdd* gddContainer::getDD(aitIndex index,gddScaler*& dd)
|
||||
{ return (gdd*)(dd=(gddScaler*)getDD(index)); }
|
||||
inline gdd* gddContainer::getDD(aitIndex index,gddScalar*& dd)
|
||||
{ return (gdd*)(dd=(gddScalar*)getDD(index)); }
|
||||
inline gdd* gddContainer::getDD(aitIndex index,gddAtomic*& dd)
|
||||
{ return (gdd*)(dd=(gddAtomic*)getDD(index)); }
|
||||
inline gdd* gddContainer::getDD(aitIndex index,gddContainer*& dd)
|
||||
@@ -1093,17 +1144,17 @@ public:
|
||||
gddCursor(const gddContainer* ec);
|
||||
|
||||
gdd* first(void);
|
||||
gdd* first(gddScaler*&);
|
||||
gdd* first(gddScalar*&);
|
||||
gdd* first(gddAtomic*&);
|
||||
gdd* first(gddContainer*&);
|
||||
|
||||
gdd* next(void);
|
||||
gdd* next(gddScaler*&);
|
||||
gdd* next(gddScalar*&);
|
||||
gdd* next(gddAtomic*&);
|
||||
gdd* next(gddContainer*&);
|
||||
|
||||
gdd* current(void);
|
||||
gdd* current(gddScaler*&);
|
||||
gdd* current(gddScalar*&);
|
||||
gdd* current(gddAtomic*&);
|
||||
gdd* current(gddContainer*&);
|
||||
|
||||
@@ -1121,8 +1172,8 @@ inline gddCursor::gddCursor(const gddContainer* ec):list(ec)
|
||||
|
||||
inline gdd* gddCursor::first(void)
|
||||
{ curr=list->cData(); curr_index=0; return curr; }
|
||||
inline gdd* gddCursor::first(gddScaler*& dd)
|
||||
{ return (gdd*)(dd=(gddScaler*)first()); }
|
||||
inline gdd* gddCursor::first(gddScalar*& dd)
|
||||
{ return (gdd*)(dd=(gddScalar*)first()); }
|
||||
inline gdd* gddCursor::first(gddAtomic*& dd)
|
||||
{ return (gdd*)(dd=(gddAtomic*)first()); }
|
||||
inline gdd* gddCursor::first(gddContainer*& dd)
|
||||
@@ -1130,8 +1181,8 @@ inline gdd* gddCursor::first(gddContainer*& dd)
|
||||
|
||||
inline gdd* gddCursor::next(void)
|
||||
{ if(curr) { curr_index++;curr=curr->next(); } return curr; }
|
||||
inline gdd* gddCursor::next(gddScaler*& dd)
|
||||
{ return (gdd*)(dd=(gddScaler*)next()); }
|
||||
inline gdd* gddCursor::next(gddScalar*& dd)
|
||||
{ return (gdd*)(dd=(gddScalar*)next()); }
|
||||
inline gdd* gddCursor::next(gddAtomic*& dd)
|
||||
{ return (gdd*)(dd=(gddAtomic*)next()); }
|
||||
inline gdd* gddCursor::next(gddContainer*& dd)
|
||||
@@ -1139,8 +1190,8 @@ inline gdd* gddCursor::next(gddContainer*& dd)
|
||||
|
||||
inline gdd* gddCursor::current(void)
|
||||
{ return curr; }
|
||||
inline gdd* gddCursor::current(gddScaler*& dd)
|
||||
{ return (gdd*)(dd=(gddScaler*)current()); }
|
||||
inline gdd* gddCursor::current(gddScalar*& dd)
|
||||
{ return (gdd*)(dd=(gddScalar*)current()); }
|
||||
inline gdd* gddCursor::current(gddAtomic*& dd)
|
||||
{ return (gdd*)(dd=(gddAtomic*)current()); }
|
||||
inline gdd* gddCursor::current(gddContainer*& dd)
|
||||
|
||||
@@ -4,6 +4,15 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.3 1996/07/26 02:23:18 jbk
|
||||
// Fixed the spelling error with Scalar.
|
||||
//
|
||||
// Revision 1.2 1996/07/23 17:13:34 jbk
|
||||
// various fixes - dbmapper incorrectly worked with enum types
|
||||
//
|
||||
// Revision 1.1 1996/06/25 19:11:41 jbk
|
||||
// new in EPICS base
|
||||
//
|
||||
//
|
||||
|
||||
// *Revision 1.3 1996/06/24 03:15:34 jbk
|
||||
@@ -28,14 +37,17 @@ gddApplicationTypeTable* gddGenerateApplicationTypeTable(long x/*=(1<<13)*/)
|
||||
|
||||
void gddApplicationTypeTable::GenerateTypes(void)
|
||||
{
|
||||
gddScaler* add_units = new gddScaler(0);
|
||||
gddAtomic* add_enum = new gddAtomic(0,aitEnumString,1,16);
|
||||
gddScalar* add_units = new gddScalar(0,aitEnumString);
|
||||
|
||||
aitString add_enum_buf[16];
|
||||
aitString add_units_buf = thing;
|
||||
// One attempt at building a menu using aitString, which is not so
|
||||
// good.
|
||||
// gddAtomic* add_enum = new gddAtomic(0,aitEnumString,1,16);
|
||||
// aitString add_enum_buf[16];
|
||||
// add_enum->putRef(add_enum_buf);
|
||||
|
||||
add_units->put(add_units_buf);
|
||||
add_enum->putRef(add_enum_buf);
|
||||
// Just describe the menu - allow the block of choiced to be
|
||||
// referenced in.
|
||||
gddAtomic* add_enum = new gddAtomic(0,aitEnumFixedString,1);
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// register simple types
|
||||
@@ -106,147 +118,147 @@ void gddApplicationTypeTable::GenerateTypes(void)
|
||||
|
||||
// DBR_GR_SHORT
|
||||
gddContainer* cdd_gr_short=new gddContainer(0);
|
||||
cdd_gr_short->insert(new gddScaler(type_value,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScaler(type_ghigh,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScaler(type_glow,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScaler(type_ahigh,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScaler(type_alow,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScaler(type_awhigh,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScaler(type_awlow,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScalar(type_value,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScalar(type_ghigh,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScalar(type_glow,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScalar(type_ahigh,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScalar(type_alow,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScalar(type_awhigh,aitEnumInt16));
|
||||
cdd_gr_short->insert(new gddScalar(type_awlow,aitEnumInt16));
|
||||
cdd_gr_short->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_gr_short",cdd_gr_short);
|
||||
|
||||
// DBR_GR_FLOAT
|
||||
gddContainer* cdd_gr_float=new gddContainer(0);
|
||||
cdd_gr_float->insert(new gddScaler(type_value,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScaler(type_prec,aitEnumInt16));
|
||||
cdd_gr_float->insert(new gddScaler(type_ghigh,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScaler(type_glow,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScaler(type_ahigh,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScaler(type_alow,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScaler(type_awhigh,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScaler(type_awlow,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScalar(type_value,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScalar(type_prec,aitEnumInt16));
|
||||
cdd_gr_float->insert(new gddScalar(type_ghigh,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScalar(type_glow,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScalar(type_ahigh,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScalar(type_alow,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScalar(type_awhigh,aitEnumFloat32));
|
||||
cdd_gr_float->insert(new gddScalar(type_awlow,aitEnumFloat32));
|
||||
cdd_gr_float->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_gr_float",cdd_gr_float);
|
||||
|
||||
// DBR_GR_ENUM
|
||||
gddContainer* cdd_gr_enum=new gddContainer(0);
|
||||
cdd_gr_enum->insert(getDD(type_menu));
|
||||
cdd_gr_enum->insert(new gddScaler(type_value,aitEnumEnum16));
|
||||
cdd_gr_enum->insert(new gddScalar(type_value,aitEnumEnum16));
|
||||
registerApplicationTypeWithProto("dbr_gr_enum",cdd_gr_enum);
|
||||
|
||||
// DBR_GR_CHAR
|
||||
gddContainer* cdd_gr_char=new gddContainer(0);
|
||||
cdd_gr_char->insert(new gddScaler(type_value,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScaler(type_ghigh,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScaler(type_glow,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScaler(type_ahigh,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScaler(type_alow,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScaler(type_awhigh,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScaler(type_awlow,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScalar(type_value,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScalar(type_ghigh,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScalar(type_glow,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScalar(type_ahigh,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScalar(type_alow,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScalar(type_awhigh,aitEnumInt8));
|
||||
cdd_gr_char->insert(new gddScalar(type_awlow,aitEnumInt8));
|
||||
cdd_gr_char->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_gr_char",cdd_gr_char);
|
||||
|
||||
// DBR_GR_LONG
|
||||
gddContainer* cdd_gr_long=new gddContainer(0);
|
||||
cdd_gr_long->insert(new gddScaler(type_value,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScaler(type_ghigh,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScaler(type_glow,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScaler(type_ahigh,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScaler(type_alow,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScaler(type_awhigh,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScaler(type_awlow,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScalar(type_value,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScalar(type_ghigh,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScalar(type_glow,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScalar(type_ahigh,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScalar(type_alow,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScalar(type_awhigh,aitEnumInt32));
|
||||
cdd_gr_long->insert(new gddScalar(type_awlow,aitEnumInt32));
|
||||
cdd_gr_long->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_gr_long",cdd_gr_long);
|
||||
|
||||
// DBR_GR_DOUBLE
|
||||
gddContainer* cdd_gr_double=new gddContainer(0);
|
||||
cdd_gr_double->insert(new gddScaler(type_value,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScaler(type_prec,aitEnumInt16));
|
||||
cdd_gr_double->insert(new gddScaler(type_ghigh,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScaler(type_glow,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScaler(type_ahigh,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScaler(type_alow,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScaler(type_awhigh,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScaler(type_awlow,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScalar(type_value,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScalar(type_prec,aitEnumInt16));
|
||||
cdd_gr_double->insert(new gddScalar(type_ghigh,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScalar(type_glow,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScalar(type_ahigh,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScalar(type_alow,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScalar(type_awhigh,aitEnumFloat64));
|
||||
cdd_gr_double->insert(new gddScalar(type_awlow,aitEnumFloat64));
|
||||
cdd_gr_double->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_gr_double",cdd_gr_double);
|
||||
|
||||
// DBR_CTRL_SHORT
|
||||
gddContainer* cdd_ctrl_short=new gddContainer(0);
|
||||
cdd_ctrl_short->insert(new gddScaler(type_value,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_ghigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_glow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_chigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_clow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_ahigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_alow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_awhigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScaler(type_awlow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_value,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_ghigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_glow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_chigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_clow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_ahigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_alow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_awhigh,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(new gddScalar(type_awlow,aitEnumInt16));
|
||||
cdd_ctrl_short->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_ctrl_short",cdd_ctrl_short);
|
||||
|
||||
// DBR_CTRL_FLOAT
|
||||
gddContainer* cdd_ctrl_float=new gddContainer(0);
|
||||
cdd_ctrl_float->insert(new gddScaler(type_value,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_prec,aitEnumInt16));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_ghigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_glow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_chigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_clow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_ahigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_alow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_awhigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScaler(type_awlow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_value,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_prec,aitEnumInt16));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_ghigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_glow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_chigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_clow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_ahigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_alow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_awhigh,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(new gddScalar(type_awlow,aitEnumFloat32));
|
||||
cdd_ctrl_float->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_ctrl_float",cdd_ctrl_float);
|
||||
|
||||
// DBR_CTRL_ENUM
|
||||
gddContainer* cdd_ctrl_enum=new gddContainer(0);
|
||||
cdd_ctrl_enum->insert(getDD(type_menu));
|
||||
cdd_ctrl_enum->insert(new gddScaler(type_value,aitEnumEnum16));
|
||||
cdd_ctrl_enum->insert(new gddScalar(type_value,aitEnumEnum16));
|
||||
registerApplicationTypeWithProto("dbr_ctrl_enum",cdd_ctrl_enum);
|
||||
|
||||
// DBR_CTRL_CHAR
|
||||
gddContainer* cdd_ctrl_char=new gddContainer(0);
|
||||
cdd_ctrl_char->insert(new gddScaler(type_value,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_ghigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_glow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_chigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_clow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_ahigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_alow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_awhigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScaler(type_awlow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_value,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_ghigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_glow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_chigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_clow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_ahigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_alow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_awhigh,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(new gddScalar(type_awlow,aitEnumInt8));
|
||||
cdd_ctrl_char->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_ctrl_char",cdd_ctrl_char);
|
||||
|
||||
// DBR_CTRL_LONG
|
||||
gddContainer* cdd_ctrl_long=new gddContainer(0);
|
||||
cdd_ctrl_long->insert(new gddScaler(type_value,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_ghigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_glow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_chigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_clow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_ahigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_alow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_awhigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScaler(type_awlow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_value,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_ghigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_glow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_chigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_clow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_ahigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_alow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_awhigh,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(new gddScalar(type_awlow,aitEnumInt32));
|
||||
cdd_ctrl_long->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_ctrl_long",cdd_ctrl_long);
|
||||
|
||||
// DBR_CTRL_DOUBLE
|
||||
gddContainer* cdd_ctrl_double=new gddContainer(0);
|
||||
cdd_ctrl_double->insert(new gddScaler(type_value,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_prec,aitEnumInt16));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_ghigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_glow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_chigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_clow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_ahigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_alow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_awhigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScaler(type_awlow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_value,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_prec,aitEnumInt16));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_ghigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_glow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_chigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_clow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_ahigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_alow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_awhigh,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(new gddScalar(type_awlow,aitEnumFloat64));
|
||||
cdd_ctrl_double->insert(getDD(type_units));
|
||||
registerApplicationTypeWithProto("dbr_ctrl_double",cdd_ctrl_double);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
*
|
||||
* History
|
||||
* $Log$
|
||||
* Revision 1.1 1996/07/10 23:44:12 jhill
|
||||
* moved here from src/cas/generic
|
||||
*
|
||||
* Revision 1.2 1996/06/26 21:19:01 jhill
|
||||
* now matches gdd api revisions
|
||||
*
|
||||
@@ -223,7 +226,7 @@ inline gddAppFuncTableStatus gddAppFuncTable<PV>::read(PV &pv, gdd &value)
|
||||
return S_gddAppFuncTable_badType;
|
||||
}
|
||||
pFunc = this->pMFuncRead[type];
|
||||
if (!pFunc) {
|
||||
if (pFunc==NULL) {
|
||||
errPrintf (S_gddAppFuncTable_badType, __FILE__,
|
||||
__LINE__, "- ukn appl type code = %u\n",
|
||||
type);
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
// $Id$
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.1 1996/06/25 19:11:48 jbk
|
||||
// new in EPICS base
|
||||
//
|
||||
//
|
||||
|
||||
// *Revision 1.3 1996/06/24 03:15:38 jbk
|
||||
@@ -23,13 +26,13 @@ void gdd::dump(void) { }
|
||||
#else
|
||||
void gdd::dump(void)
|
||||
{
|
||||
gddScaler* sdd;
|
||||
gddScalar* sdd;
|
||||
gddAtomic* add;
|
||||
gddContainer* cdd;
|
||||
|
||||
if(isScaler())
|
||||
if(isScalar())
|
||||
{
|
||||
sdd=(gddScaler*)this;
|
||||
sdd=(gddScalar*)this;
|
||||
sdd->dump();
|
||||
return;
|
||||
}
|
||||
@@ -73,11 +76,11 @@ void gdd::dumpInfo(void)
|
||||
fprintf(stderr," (%d) %8.8x first=%d count=%d\n",i,&bounds[i],f,c);
|
||||
}
|
||||
|
||||
if(isScaler()) fprintf(stderr," Is a Scaler\n");
|
||||
if(isScalar()) fprintf(stderr," Is a Scalar\n");
|
||||
if(isAtomic()) fprintf(stderr," Is a Atomic\n");
|
||||
if(isContainer()) fprintf(stderr," Is a Container\n");
|
||||
|
||||
if(!isContainer() && !isScaler() && !isAtomic())
|
||||
if(!isContainer() && !isScalar() && !isAtomic())
|
||||
fprintf(stderr,"--------------------------------------\n");
|
||||
}
|
||||
#endif
|
||||
@@ -157,9 +160,9 @@ void gddAtomic::dump(void)
|
||||
#endif
|
||||
|
||||
#ifdef NO_DUMP_TEST
|
||||
void gddScaler::dump(void) { }
|
||||
void gddScalar::dump(void) { }
|
||||
#else
|
||||
void gddScaler::dump(void)
|
||||
void gddScalar::dump(void)
|
||||
{
|
||||
aitFloat64 f64; aitFloat32 f32; aitUint32 ui32; aitInt32 i32;
|
||||
aitUint16 ui16; aitInt16 i16; aitUint8 ui8; aitInt8 i8;
|
||||
@@ -319,9 +322,9 @@ void gddAtomic::test(void)
|
||||
#endif
|
||||
|
||||
#ifdef NO_DUMP_TEST
|
||||
void gddScaler::test(void) { }
|
||||
void gddScalar::test(void) { }
|
||||
#else
|
||||
void gddScaler::test(void)
|
||||
void gddScalar::test(void)
|
||||
{
|
||||
int i;
|
||||
aitFloat32 fa32,f32 = 32.0;
|
||||
@@ -400,7 +403,7 @@ void gddContainer::dump(void)
|
||||
int i;
|
||||
gdd* dd;
|
||||
gddAtomic* add;
|
||||
gddScaler* sdd;
|
||||
gddScalar* sdd;
|
||||
gddContainer* cdd;
|
||||
|
||||
fprintf(stderr,"----------dumping container:\n");
|
||||
@@ -412,7 +415,7 @@ void gddContainer::dump(void)
|
||||
for(i=0;dd=getDD(i);i++)
|
||||
{
|
||||
if(dd->isAtomic()) { add=(gddAtomic*)dd; add->dump(); }
|
||||
if(dd->isScaler()) { sdd=(gddScaler*)dd; sdd->dump(); }
|
||||
if(dd->isScalar()) { sdd=(gddScalar*)dd; sdd->dump(); }
|
||||
if(dd->isContainer()) { cdd=(gddContainer*)dd; cdd->dump(); }
|
||||
}
|
||||
}
|
||||
@@ -423,8 +426,8 @@ void gddContainer::test(void) { }
|
||||
#else
|
||||
void gddContainer::test(void)
|
||||
{
|
||||
gddScaler* sdd1 = new gddScaler(1,aitEnumInt32);
|
||||
gddScaler* sdd2 = new gddScaler(2,aitEnumInt16);
|
||||
gddScalar* sdd1 = new gddScalar(1,aitEnumInt32);
|
||||
gddScalar* sdd2 = new gddScalar(2,aitEnumInt16);
|
||||
gddAtomic* add1 = new gddAtomic(3,aitEnumFloat32,1,3);
|
||||
gddContainer* cdd1;
|
||||
|
||||
|
||||
@@ -124,22 +124,22 @@ HDRVERSIONID(caerrh, "@(#) $Id$")
|
||||
#define ECA_ADDFAIL DEFMSG(CA_K_WARNING, 21)
|
||||
#define ECA_BADCOUNT DEFMSG(CA_K_WARNING, 22)
|
||||
#define ECA_BADSTR DEFMSG(CA_K_ERROR, 23)
|
||||
#define ECA_DISCONN DEFMSG(CA_K_INFO, 24)
|
||||
#define ECA_DBLCHNL DEFMSG(CA_K_INFO, 25)
|
||||
#define ECA_DISCONN DEFMSG(CA_K_WARNING, 24)
|
||||
#define ECA_DBLCHNL DEFMSG(CA_K_WARNING, 25)
|
||||
#define ECA_EVDISALLOW DEFMSG(CA_K_ERROR, 26)
|
||||
#define ECA_BUILDGET DEFMSG(CA_K_WARNING, 27)
|
||||
#define ECA_NEEDSFP DEFMSG(CA_K_INFO, 28)
|
||||
#define ECA_NEEDSFP DEFMSG(CA_K_WARNING, 28)
|
||||
#define ECA_OVEVFAIL DEFMSG(CA_K_WARNING, 29)
|
||||
#define ECA_BADMONID DEFMSG(CA_K_ERROR, 30)
|
||||
#define ECA_NEWADDR DEFMSG(CA_K_INFO, 31)
|
||||
#define ECA_NEWADDR DEFMSG(CA_K_WARNING, 31)
|
||||
#define ECA_NEWCONN DEFMSG(CA_K_INFO, 32)
|
||||
#define ECA_NOCACTX DEFMSG(CA_K_WARNING, 33)
|
||||
#define ECA_DEFUNCT DEFMSG(CA_K_FATAL, 34)
|
||||
#define ECA_EMPTYSTR DEFMSG(CA_K_WARNING, 35)
|
||||
#define ECA_NOREPEATER DEFMSG(CA_K_INFO, 36)
|
||||
#define ECA_NOCHANMSG DEFMSG(CA_K_INFO, 37)
|
||||
#define ECA_DLCKREST DEFMSG(CA_K_INFO, 38)
|
||||
#define ECA_SERVBEHIND DEFMSG(CA_K_INFO, 39)
|
||||
#define ECA_NOREPEATER DEFMSG(CA_K_WARNING, 36)
|
||||
#define ECA_NOCHANMSG DEFMSG(CA_K_WARNNING, 37)
|
||||
#define ECA_DLCKREST DEFMSG(CA_K_WARNING, 38)
|
||||
#define ECA_SERVBEHIND DEFMSG(CA_K_WARNING, 39)
|
||||
#define ECA_NOCAST DEFMSG(CA_K_WARNING, 40)
|
||||
#define ECA_BADMASK DEFMSG(CA_K_ERROR, 41)
|
||||
#define ECA_IODONE DEFMSG(CA_K_INFO, 42)
|
||||
@@ -192,7 +192,7 @@ READONLY char *ca_message_text[]
|
||||
"A monitor by that id cant be found",
|
||||
"Remote channel has new network address",
|
||||
"New or resumed network connection",
|
||||
"Attempt to import from a task without a CA context failed",
|
||||
"Specified task isnt a member of a CA context",
|
||||
"Attempt to use defunct CA feature failed",
|
||||
"The supplied string is empty",
|
||||
"Unable to spawn the CA repeater thread- auto reconnect will fail",
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
#define EPICS_MODIFICATION 0
|
||||
#define EPICS_UPDATE_LEVEL 5
|
||||
|
||||
#define epicsReleaseVersion "@(#)Version R3.13.0.alpha5 $Date$"
|
||||
#define epicsReleaseVersion "@(#)Version R3.13.0.beta1 $Date$"
|
||||
|
||||
#define EPICS_VERSION_STRING "EPICS Version 3.13.0.alpha5"
|
||||
#define EPICS_VERSION_STRING "EPICS Version 3.13.0.beta1"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user