diff --git a/.appveyor.yml b/.appveyor.yml
index bba0292e8..f98fb81bb 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,11 +1,18 @@
-# AppVeyor configuration for EPICS Base
-
-# Ralph Lange
-# Copyright (c) 2016-2017 ITER Organization
+# .appveyor.yml for use with EPICS Base ci-scripts
+# (see: https://github.com/epics-base/ci-scripts)
# Version format
version: base-{branch}-{build}
+#---------------------------------#
+# build cache #
+#---------------------------------#
+# The AppVeyor cache allowance is way too small (1GB per account across all projects, branches and jobs)
+# to be used for the dependency builds.
+
+cache:
+ - C:\Users\appveyor\.tools
+
#---------------------------------#
# repository cloning #
#---------------------------------#
@@ -16,15 +23,15 @@ init:
- git config --global core.autocrlf true
# Set clone depth (do not fetch complete history)
-clone_depth: 50
+clone_depth: 5
# Skipping commits affecting only specific files
skip_commits:
files:
- 'documentation/*'
- - 'templates/*'
- '**/*.html'
- '**/*.md'
+ - '.travis.yml'
#---------------------------------#
# build matrix configuration #
@@ -37,45 +44,44 @@ configuration:
- dynamic-debug
- static-debug
-# Environment variables: compiler toolchain
+# Environment variables: compiler toolchain, base version, setup file, ...
environment:
- matrix:
- - TOOLCHAIN: mingw
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLCHAIN: 2019
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLCHAIN: 2017
- - TOOLCHAIN: 14.0
- - TOOLCHAIN: 12.0
- - TOOLCHAIN: 11.0
- - TOOLCHAIN: 10.0
+ # common / default variables for all jobs
+ SETUP_PATH: .ci-local:.ci
+ BASE: SELF
-# Platform: architecture
+ matrix:
+ - CMP: vs2019
+ APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
+ - CMP: vs2017
+ APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+ - CMP: vs2015
+ - CMP: vs2013
+ - CMP: vs2012
+ - CMP: vs2010
+ - CMP: mingw
+
+# Platform: processor architecture
platform:
- x86
- x64
-# Matrix configuration: allow specific failing jobs
+# Matrix configuration: exclude sets of jobs
matrix:
exclude:
- # VS Express installs don't have the 64 bit compiler
+ # VS2012 and older installs don't have the 64 bit compiler
- platform: x64
- TOOLCHAIN: 10.0
- # Exclude to reduce total job runtime
- # skip 64-bit for older and 32-bit for newer
+ CMP: vs2012
- platform: x64
- TOOLCHAIN: 11.0
+ CMP: vs2010
+ - platform: x64
+ CMP: vs2008
+ # Exclude more jobs to reduce build time
+ # Skip 32-bit for "middle-aged" compilers
- platform: x86
- TOOLCHAIN: mingw
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+ CMP: vs2017
- platform: x86
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- TOOLCHAIN: 2019
- - platform: x86
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- TOOLCHAIN: 2017
-
+ CMP: vs2015
#---------------------------------#
# building & testing #
@@ -83,18 +89,17 @@ matrix:
install:
- cmd: git submodule update --init --recursive
- - cmd: .ci/appveyor-prepare.bat
+ - cmd: python .ci/appveyor/do.py prepare
build_script:
- - cmd: .ci/appveyor-make.bat
+ - cmd: python .ci/appveyor/do.py build
test_script:
- - cmd: .ci/appveyor-make.bat tapfiles
- - cmd: .ci/appveyor-make.bat test-results
+ - cmd: python .ci/appveyor/do.py test
on_finish:
- ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
-
+ - cmd: python .ci/appveyor/do.py build test-results -s
#---------------------------------#
# debugging #
@@ -104,10 +109,13 @@ on_finish:
## note that you will need to connect within the usual build timeout limit (60 minutes)
## so you may want to adjust the build matrix above to just build the one of interest
-#on_failure:
+# print the connection info
+#init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
-# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+# block a failed build (until the watchdog barks)
+#on_failure:
+# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
#---------------------------------#
# notifications #
diff --git a/.ci/appveyor-make.bat b/.ci/appveyor-make.bat
deleted file mode 100644
index eb127c5ce..000000000
--- a/.ci/appveyor-make.bat
+++ /dev/null
@@ -1,132 +0,0 @@
-:: Universal build script for AppVeyor (https://ci.appveyor.com/)
-:: Environment:
-:: TOOLCHAIN - toolchain version [10.0/11.0/12.0/14.0/2017/2019/mingw]
-:: CONFIGURATION - determines EPICS build [dynamic/static]
-:: PLATFORM - architecture [x86/x64]
-::
-:: All command line args are passed to make
-
-Setlocal EnableDelayedExpansion
-
-:: we do not currently have a combined static and debug EPICS_HOST_ARCH target
-:: So a combined debug and static target will appear to be just static
-:: but debug will have been specified in CONFIG_SITE by appveyor-prepare.bat
-set "ST="
-echo.%CONFIGURATION% | findstr /C:"debug">nul && (
- set "ST=-debug"
-)
-echo.%CONFIGURATION% | findstr /C:"static">nul && (
- set "ST=-static"
-)
-
-set MY_OS=64BIT
-if "%PLATFORM%"=="x86" set MY_OS=32BIT
-
-echo [INFO] Platform: %MY_OS%
-
-:: Use parallel make, except for 3.14
-set "MAKEARGS=-j2 -Otarget"
-if "%APPVEYOR_REPO_BRANCH%"=="3.14" set MAKEARGS=
-
-if "%TOOLCHAIN%"=="mingw" (
- set "MAKE=mingw32-make"
- if "%MY_OS%"=="64BIT" (
- set "EPICS_HOST_ARCH=windows-x64-mingw"
- set "INCLUDE=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\include;%INCLUDE%"
- set "PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%"
- echo [INFO] MinGW Toolchain 64bit
- ) else (
- set "EPICS_HOST_ARCH=win32-x86-mingw"
- set "INCLUDE=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\include;%INCLUDE%"
- set "PATH=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;%PATH%"
- echo [INFO] MinGW Toolchain 32bit
- )
- echo [INFO] Compiler Version
- gcc -v
- goto Finish
-)
-
-if "%TOOLCHAIN%"=="2019" (
- echo [INFO] Setting strawberry perl path
- set "PATH=c:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%"
-)
-
-set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN%"
-if not exist "%VSINSTALL%\" set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio\%TOOLCHAIN%\Community"
-if not exist "%VSINSTALL%\" goto MSMissing
-
-set "MAKE=C:\tools\make"
-
-echo [INFO] APPVEYOR_BUILD_WORKER_IMAGE=%APPVEYOR_BUILD_WORKER_IMAGE%
-
-if "%MY_OS%"=="64BIT" (
- set EPICS_HOST_ARCH=windows-x64%ST%
- :: VS 2017/2019
- if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" (
- call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat"
- where cl
- if !ERRORLEVEL! NEQ 0 goto MSMissing
- goto MSFound
- )
- if exist "%VSINSTALL%\VC\vcvarsall.bat" (
- call "%VSINSTALL%\VC\vcvarsall.bat" amd64
- where cl
- if !ERRORLEVEL! NEQ 0 (
- call "%VSINSTALL%\VC\vcvarsall.bat" x86_amd64
- where cl
- if !ERRORLEVEL! NEQ 0 goto MSMissing
- )
- goto MSFound
- )
- if exist "%VSINSTALL%\VC\bin\amd64\vcvars64.bat" (
- call "%VSINSTALL%\VC\bin\amd64\vcvars64.bat"
- where cl
- if !ERRORLEVEL! NEQ 0 goto MSMissing
- goto MSFound
- )
-) else (
- set EPICS_HOST_ARCH=win32-x86%ST%
- :: VS 2017/2019
- if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat" (
- call "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat"
- where cl
- if !ERRORLEVEL! NEQ 0 goto MSMissing
- goto MSFound
- )
- if exist "%VSINSTALL%\VC\vcvarsall.bat" (
- call "%VSINSTALL%\VC\vcvarsall.bat" x86
- where cl
- if !ERRORLEVEL! NEQ 0 goto MSMissing
- goto MSFound
- )
- if exist "%VSINSTALL%\VC\bin\vcvars32.bat" (
- call "%VSINSTALL%\VC\bin\vcvars32.bat"
- where cl
- if !ERRORLEVEL! NEQ 0 goto MSMissing
- goto MSFound
- )
- if exist "%VSINSTALL%\Common7\Tools\vsvars32.bat" (
- call "%VSINSTALL%\Common7\Tools\vsvars32.bat"
- where cl
- if !ERRORLEVEL! NEQ 0 goto MSMissing
- goto MSFound
- )
-)
-
-:MSMissing
-echo [INFO] Installation for MSVC Toolchain %TOOLCHAIN% / %MY_OS% seems to be missing
-exit 1
-
-:MSFound
-echo [INFO] Microsoft Visual Studio Toolchain %TOOLCHAIN%
-echo [INFO] Compiler Version
-cl
-
-:Finish
-echo [INFO] EPICS_HOST_ARCH: %EPICS_HOST_ARCH%
-echo [INFO] Make version
-%MAKE% --version
-echo [INFO] Perl version
-perl --version
-
-%MAKE% %MAKEARGS% %*
diff --git a/.ci/appveyor-prepare.bat b/.ci/appveyor-prepare.bat
deleted file mode 100644
index 312223d16..000000000
--- a/.ci/appveyor-prepare.bat
+++ /dev/null
@@ -1,52 +0,0 @@
-:: Build script for AppVeyor (https://ci.appveyor.com/)
-:: Environment:
-:: TOOLCHAIN - Toolchain Version [9.0/10.0/11.0/12.0/14.0/mingw]
-:: CONFIGURATION - determines EPICS build [dynamic/static, -debug]
-:: PLATFORM - "x86" -> use 32bit architecture
-::
-:: Prepares an Appveyor build by excuting the following steps
-:: - Set up configure\CONFIG_SITE for static vs. dynamic build
-:: - Install Mingw (TOOLCHAIN setting) in the in the appropriate flavor
-:: - Download and install Make-4.1 from EPICS download page
-
-Setlocal EnableDelayedExpansion
-
-set MY_OS=64BIT
-if "%PLATFORM%"=="x86" set MY_OS=32BIT
-
-echo [INFO] Platform: %MY_OS%
-
-:: with MSVC either static or debug can be handled as part
-:: of EPICS_HOST_ARCH but not both. So we set the appropriate
-:: options in CONFIG_SITE. For mingw and cygwin they are missing
-:: some static and debug targets so set things here too
-echo.%CONFIGURATION% | findstr /C:"static">nul && (
- echo SHARED_LIBRARIES=NO>> configure\CONFIG_SITE
- echo STATIC_BUILD=YES>> configure\CONFIG_SITE
- echo [INFO] EPICS set up for static build
-) || (
- echo [INFO] EPICS set up for dynamic build
-)
-
-echo.%CONFIGURATION% | findstr /C:"debug">nul && (
- echo HOST_OPT=NO>> configure\CONFIG_SITE
- echo [INFO] EPICS set up for debug build
-) || (
- echo [INFO] EPICS set up for optimized build
-)
-
-echo [INFO] Installing Make 4.2.1 from ANL web site
-curl -fsS --retry 3 -o C:\tools\make-4.2.1.zip https://epics.anl.gov/download/tools/make-4.2.1-win64.zip
-cd \tools
-"C:\Program Files\7-Zip\7z" e make-4.2.1.zip
-
-set "PERLVER=5.30.0.1"
-if "%TOOLCHAIN%"=="2019" (
- echo [INFO] Installing Strawberry Perl %PERLVER%
- curl -fsS --retry 3 -o C:\tools\perl-%PERLVER%.zip http://strawberryperl.com/download/%PERLVER%/strawberry-perl-%PERLVER%-64bit.zip
- cd \tools
- "C:\Program Files\7-Zip\7z" x perl-%PERLVER%.zip -oC:\strawberry
- cd \strawberry
- :: we set PATH in appveyor-build.bat
- call relocation.pl.bat
-)
diff --git a/.ci/checkout-modules.sh b/.ci/checkout-modules.sh
deleted file mode 100755
index 69070adb7..000000000
--- a/.ci/checkout-modules.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# Checkout submodules on their appropriate branches
-#
-
-git submodule foreach '\
- git checkout `git config -f $toplevel/.gitmodules submodule.$name.branch` && \
- git pull '
diff --git a/.ci/travis-build.sh b/.ci/travis-build.sh
deleted file mode 100755
index c71bdd90e..000000000
--- a/.ci/travis-build.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-set -e -x
-
-die() {
- echo "$1" >&2
- exit 1
-}
-
-CACHEKEY=1
-
-export EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl`
-
-[ -e configure/os/CONFIG_SITE.Common.linux-x86 ] || die "Wrong location: $PWD"
-
-case "$CMPLR" in
-clang)
- echo "Host compiler is clang"
- cat << EOF >> configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH
-GNU = NO
-CMPLR_CLASS = clang
-CC = clang
-CCC = clang++
-EOF
- ;;
-*) echo "Host compiler is default";;
-esac
-
-if [ "$STATIC" = "YES" ]
-then
- echo "Build static libraries/executables"
- cat << EOF >> configure/CONFIG_SITE
-SHARED_LIBRARIES=NO
-STATIC_BUILD=YES
-EOF
-fi
-
-# requires wine and g++-mingw-w64-i686
-if [ "$WINE" = "32" ]
-then
- echo "Cross mingw32"
- sed -i -e '/CMPLR_PREFIX/d' configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
- cat << EOF >> configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
-CMPLR_PREFIX=i686-w64-mingw32-
-EOF
- cat << EOF >> configure/CONFIG_SITE
-CROSS_COMPILER_TARGET_ARCHS+=win32-x86-mingw
-EOF
-fi
-
-# set RTEMS to eg. "4.9" or "4.10"
-if [ -n "$RTEMS" ]
-then
- echo "Cross RTEMS${RTEMS} for pc386"
- curl -L "https://github.com/mdavidsaver/rsb/releases/download/20171203-${RTEMS}/i386-rtems${RTEMS}-trusty-20171203-${RTEMS}.tar.bz2" \
- | tar -C / -xmj
-
- sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' configure/os/CONFIG_SITE.Common.RTEMS
- cat << EOF >> configure/os/CONFIG_SITE.Common.RTEMS
-RTEMS_VERSION=$RTEMS
-RTEMS_BASE=$HOME/.rtems
-EOF
- cat << EOF >> configure/CONFIG_SITE
-CROSS_COMPILER_TARGET_ARCHS += RTEMS-pc386-qemu
-EOF
-
- # find local qemu-system-i386
- echo -n "Using QEMU: "
- type qemu-system-i386 || echo "Missing qemu"
-fi
-
-make -j2 RTEMS_QEMU_FIXUPS=YES CMD_CFLAGS="${CMD_CFLAGS}" CMD_CXXFLAGS="${CMD_CXXFLAGS}" CMD_LDFLAGS="${CMD_LDFLAGS}"
-
-if [ "$TEST" != "NO" ]
-then
- make -j2 tapfiles
- make -s test-results
-fi
diff --git a/.ci/travis-prepare.sh b/.ci/travis-prepare.sh
deleted file mode 100755
index 393bd80b6..000000000
--- a/.ci/travis-prepare.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-set -e -x
-
-die() {
- echo "$1" >&2
- exit 1
-}
-
-if [ -f /etc/hosts ]
-then
- # The travis-ci "bionic" image throws us a curveball in /etc/hosts
- # by including two entries for localhost. The first for 127.0.1.1
- # which causes epicsSockResolveTest to fail.
- # cat /etc/hosts
- # ...
- # 127.0.1.1 localhost localhost ip4-loopback
- # 127.0.0.1 localhost nettuno travis vagrant travis-job-....
-
- sudo sed -i -e '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts
-
- echo "==== /etc/hosts"
- cat /etc/hosts
- echo "===="
-fi
diff --git a/.gitmodules b/.gitmodules
index 18490da91..aa607a0e7 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -22,6 +22,10 @@
path = modules/pva2pva
url = https://github.com/epics-base/pva2pva
branch = master
+[submodule ".ci"]
+ path = .ci
+ url = https://github.com/epics-base/ci-scripts
+ branch = master
[submodule "modules/pcas"]
- path = modules/pcas
- url = https://github.com/epics-modules/pcas
+ path = modules/pcas
+ url = https://github.com/epics-modules/pcas
diff --git a/.tools/make-tar.sh b/.tools/make-tar.sh
index e6bf59315..4bb0c8a3a 100755
--- a/.tools/make-tar.sh
+++ b/.tools/make-tar.sh
@@ -89,7 +89,8 @@ git archive --prefix=$PREFIX $TOPREV | tar -C "$TDIR"/tar -x
#
# sub-modules appear in tree as eg.:
# 160000 commit c3a6cfcf0dad4a4eeecf59b474710d06ff3eb68a modules/ca
-git ls-tree -r $TOPREV | awk '/^[0-9]+ commit / {print $3, $4}' | \
+git ls-tree -r $TOPREV | \
+ awk '/^[0-9]+ commit / && $4 != ".ci" {print $3, $4}' | \
while read HASH MODDIR
do
echo "Visiting $HASH $MODDIR"
@@ -105,13 +106,17 @@ sed -i -e 's|^\./||' "$TDIR"/list.1
# Exclude files
sed \
- -e '/\/\.\?ci\//d' \
+ -e '/\/\.ci\//d' \
+ -e '/\/\.ci-local\//d' \
-e '/\/\.tools\//d' \
-e '/\/jenkins\//d' \
-e '/\/\.git/d' \
+ -e '/\/\.hgtags$/d' \
+ -e '/\/\.cproject$/d' \
-e '/\/\.project$/d' \
-e '/\/\.travis\.yml$/d' \
-e '/\/\.appveyor\.yml$/d' \
+ -e '/\/\.readthedocs\.yml$/d' \
"$TDIR"/list.1 > "$TDIR"/list.2
if ! diff -U 0 "$TDIR"/list.1 "$TDIR"/list.2
diff --git a/.travis.yml b/.travis.yml
index 1e7d45212..2983b481a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,63 +1,89 @@
-language: c
+# .travis.yml for use with EPICS Base ci-scripts
+# (see: https://github.com/epics-base/ci-scripts)
-matrix:
- include:
- - sudo: false
- dist: bionic
- compiler: gcc
- env: CMPLR=gcc
- - sudo: false
- dist: xenial
- compiler: gcc
- env: CMPLR=gcc
- - sudo: false
- dist: bionic
- compiler: gcc
- env: CMPLR=gcc CMD_CXXFLAGS=-std=c++11
- - sudo: false
- dist: trusty
- compiler: gcc
- env: CMPLR=gcc STATIC=YES CMD_CXXFLAGS=-std=c++11
- - sudo: false
- dist: bionic
- compiler: gcc
- env: CMPLR=clang
- - sudo: false
- dist: xenial
- compiler: gcc
- env: CMPLR=clang
- - sudo: false
- dist: trusty
- compiler: gcc
- env: CMPLR=clang STATIC=YES
- - sudo: false
- dist: trusty
- compiler: gcc
- env: WINE=32 TEST=NO STATIC=YES
- - sudo: false
- dist: trusty
- compiler: gcc
- env: WINE=32 TEST=NO STATIC=NO
- - sudo: false
- dist: trusty
- compiler: gcc
- env: RTEMS=4.10
- - sudo: false
- dist: trusty
- compiler: gcc
- env: RTEMS=4.9
- - os: osx
- env: CMD_CFLAGS="-mmacosx-version-min=10.7" CMD_CXXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" CMD_LDXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++"
+language: cpp
+compiler: gcc
+dist: xenial
+
+cache:
+ directories:
+ - $HOME/.cache
+
+env:
+ global:
+ - SETUP_PATH=.ci-local:.ci
+ - BASE=SELF
addons:
apt:
packages:
+ # for all EPICS builds
- libreadline6-dev
- libncurses5-dev
- perl
+ # for clang compiler
- clang
+ # for mingw builds (32bit and 64bit)
- g++-mingw-w64-i686
+ - g++-mingw-w64-x86-64
+ # for RTEMS cross builds
- qemu-system-x86
+ homebrew:
+ packages:
+ # for all EPICS builds
+ - bash
+ update: true
+
+install:
+ - ./.ci/travis/prepare.sh
+
script:
- - .ci/travis-prepare.sh
- - .ci/travis-build.sh
+ - ./.ci/travis/build.sh
+
+# Define build jobs
+
+jobs:
+ include:
+
+# Different configurations of default gcc and clang
+ - dist: bionic
+
+ - dist: xenial
+
+ - dist: bionic
+ env: EXTRA="CMD_CXXFLAGS=-std=c++11"
+
+ - dist: trusty
+ env: STATIC=YES EXTRA="CMD_CXXFLAGS=-std=c++11"
+
+ - dist: bionic
+ compiler: clang
+
+ - compiler: clang
+
+ - dist: trusty
+ compiler: clang
+ env: STATIC=YES
+
+# Cross-compilations to Windows using MinGW and WINE
+
+ - env: WINE=32 TEST=NO STATIC=YES
+ compiler: mingw
+
+ - env: WINE=32 TEST=NO STATIC=NO
+ compiler: mingw
+
+# Cross-compilation to RTEMS
+
+ - env: RTEMS=4.10
+
+ - env: RTEMS=4.9
+
+# MacOS build
+
+ - os: osx
+ env:
+ - EXTRA="CMD_CFLAGS=-mmacosx-version-min=10.7"
+ - EXTRA1="CMD_CXXFLAGS=-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++"
+ - EXTRA2="CMD_LDXFLAGS=-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++"
+ compiler: clang
diff --git a/configure/CONFIG_BASE b/configure/CONFIG_BASE
index 8f9fadcdf..0b17dc60a 100644
--- a/configure/CONFIG_BASE
+++ b/configure/CONFIG_BASE
@@ -42,8 +42,6 @@ FIND_TOOL = $(firstword $(wildcard $(TOOLS)/$(1) $(EPICS_BASE)/src/tools/$(1)))
PODTOHTML = $(PERL) $(TOOLS)/podToHtml.pl
CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl)
FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl
-TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl
-PROVE = $(PERL) $(TOOLS)/epicsProve.pl
GENVERSIONHEADER = $(PERL) $(TOOLS)/genVersionHeader.pl $(QUIET_FLAG) $(QUESTION_FLAG)
MAKERPATH = $(PYTHON) $(TOOLS)/makeRPath.py
@@ -63,3 +61,13 @@ REPLACEVAR = $(PERL) $(TOOLS)/replaceVAR.pl
# tools for cleaning out unwanted files
CVSCLEAN = $(call FIND_TOOL,cvsclean.pl)
DEPCLEAN = $(call FIND_TOOL,depclean.pl)
+
+#---------------------------------------------------------------
+# Tools for testing
+TAPTOJUNIT = $(PERL) $(TOOLS)/tap-to-junit-xml.pl
+PROVE = $(PERL) $(TOOLS)/epicsProve.pl
+PROVE.tap = $(PROVE) --ext .tap --exec "$(CAT)"
+
+TEST_FAILURE_FILENAME = .tests-failed.log
+TEST_FAILURE_FILE = $(TOP)/$(TEST_FAILURE_FILENAME)
+PROVE_FAILURE = echo $(abspath .)>> $(TEST_FAILURE_FILE)
diff --git a/configure/CONFIG_BASE_VERSION b/configure/CONFIG_BASE_VERSION
index fbe1545a2..66767f545 100644
--- a/configure/CONFIG_BASE_VERSION
+++ b/configure/CONFIG_BASE_VERSION
@@ -48,11 +48,11 @@ EPICS_VERSION = 7
EPICS_REVISION = 0
# EPICS_MODIFICATION must be a number >=0 and <256
-EPICS_MODIFICATION = 3
+EPICS_MODIFICATION = 4
# EPICS_PATCH_LEVEL must be a number (win32 resource file requirement)
# Not included in the official EPICS version number if zero
-EPICS_PATCH_LEVEL = 2
+EPICS_PATCH_LEVEL = 1
# Immediately after an official release the EPICS_PATCH_LEVEL is incremented
# and the -DEV suffix is added (similar to the Maven -SNAPSHOT versions)
@@ -60,12 +60,8 @@ EPICS_PATCH_LEVEL = 2
EPICS_DEV_SNAPSHOT=-DEV
#EPICS_DEV_SNAPSHOT=-pre1
#EPICS_DEV_SNAPSHOT=-pre1-DEV
-#EPICS_DEV_SNAPSHOT=-pre2
-#EPICS_DEV_SNAPSHOT=-pre2-DEV
#EPICS_DEV_SNAPSHOT=-rc1
#EPICS_DEV_SNAPSHOT=-rc1-DEV
-#EPICS_DEV_SNAPSHOT=-rc2
-#EPICS_DEV_SNAPSHOT=-rc2-DEV
# No changes should be needed below here
diff --git a/configure/CONFIG_CA_VERSION b/configure/CONFIG_CA_VERSION
index c75b4e421..28de9e09e 100644
--- a/configure/CONFIG_CA_VERSION
+++ b/configure/CONFIG_CA_VERSION
@@ -2,7 +2,7 @@
EPICS_CA_MAJOR_VERSION = 4
EPICS_CA_MINOR_VERSION = 13
-EPICS_CA_MAINTENANCE_VERSION = 6
+EPICS_CA_MAINTENANCE_VERSION = 7
# Development flag, set to zero for release versions
diff --git a/configure/CONFIG_COMMON b/configure/CONFIG_COMMON
index b79e15cf5..6c0e11e0d 100644
--- a/configure/CONFIG_COMMON
+++ b/configure/CONFIG_COMMON
@@ -306,7 +306,7 @@ LDLIBS = $(POSIX_LDLIBS) $(ARCH_DEP_LDLIBS) $(DEBUG_LDLIBS) $(OP_SYS_LDLIBS)\
CPPFLAGS = $($(BUILD_CLASS)_CPPFLAGS) $(POSIX_CPPFLAGS) $(OPT_CPPFLAGS)\
$(DEBUG_CPPFLAGS) $(WARN_CPPFLAGS) $(BASE_CPPFLAGS) $(TARGET_CPPFLAGS)\
$(USR_CPPFLAGS) $(CMD_CPPFLAGS) $(ARCH_DEP_CPPFLAGS) $(OP_SYS_CPPFLAGS)\
- $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS)
+ $(OP_SYS_INCLUDE_CPPFLAGS) $(CODE_CPPFLAGS) $(API_CPPFLAGS)
#--------------------------------------------------
# ar definition default
diff --git a/configure/CONFIG_DATABASE_VERSION b/configure/CONFIG_DATABASE_VERSION
index 21ac836b0..9c4684ffc 100644
--- a/configure/CONFIG_DATABASE_VERSION
+++ b/configure/CONFIG_DATABASE_VERSION
@@ -1,8 +1,8 @@
# Version number for the database APIs and shared library
EPICS_DATABASE_MAJOR_VERSION = 3
-EPICS_DATABASE_MINOR_VERSION = 17
-EPICS_DATABASE_MAINTENANCE_VERSION = 6
+EPICS_DATABASE_MINOR_VERSION = 18
+EPICS_DATABASE_MAINTENANCE_VERSION = 1
# Development flag, set to zero for release versions
diff --git a/configure/CONFIG_LIBCOM_VERSION b/configure/CONFIG_LIBCOM_VERSION
index 3def716cb..6251b1e1f 100644
--- a/configure/CONFIG_LIBCOM_VERSION
+++ b/configure/CONFIG_LIBCOM_VERSION
@@ -1,8 +1,8 @@
# Version number for the libcom APIs and shared library
EPICS_LIBCOM_MAJOR_VERSION = 3
-EPICS_LIBCOM_MINOR_VERSION = 17
-EPICS_LIBCOM_MAINTENANCE_VERSION = 7
+EPICS_LIBCOM_MINOR_VERSION = 18
+EPICS_LIBCOM_MAINTENANCE_VERSION = 1
# Development flag, set to zero for release versions
diff --git a/configure/RULES.Db b/configure/RULES.Db
index fae5014ab..42a57430c 100644
--- a/configure/RULES.Db
+++ b/configure/RULES.Db
@@ -436,7 +436,7 @@ $(COMMON_DIR)/%.html: %.dbd.pod
$(COMMON_DIR)/%.html: %.pod
@$(RM) $(notdir $@)
- $(PODTOHTML) -o $(notdir $@) $<
+ $(PODTOHTML) -s -s -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
$(COMMON_DIR)/%.html: %.pm
diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD
index 843f59d8f..77d2d32a6 100644
--- a/configure/RULES_BUILD
+++ b/configure/RULES_BUILD
@@ -125,17 +125,17 @@ PRODTARGETS += $(PRODNAME) $(MUNCHNAME) $(CTDT_SRCS) $(CTDT_OBJS) $(NMS)
TESTPRODTARGETS += $(TESTPRODNAME) $(TESTMUNCHNAME)
#---------------------------------------------------------------
-# Test specifications and test result files
+# Test result files
#
-ifneq (,$(strip $(TESTS)))
-TARGETS += testspec
-endif
-# Enable testing if this host can run tests on the current target
-ifneq (,$(findstring $(T_A),$(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS)))
+# Enable testing if this host can run tests for the current target
+ifneq (,$(filter $(T_A), $(EPICS_HOST_ARCH) $(CROSS_COMPILER_RUNTEST_ARCHS)))
RUNTESTS_ENABLED = YES
-TAPFILES += $(TESTSCRIPTS:.t=.tap)
-JUNITFILES += $(TAPFILES:.tap=.xml)
+TESTSCRIPTS.t = $(filter %.t, $(TESTSCRIPTS))
+TAPFILES.t += $(TESTSCRIPTS.t:.t=.tap)
+JUNITFILES.t += $(TESTSCRIPTS.t:.t=.xml)
+TAPFILES += $(TAPFILES.t)
+JUNITFILES += $(JUNITFILES.t)
endif
#---------------------------------------------------------------
@@ -367,23 +367,22 @@ $(MODNAME): %$(MODEXT): %$(EXE)
#---------------------------------------------------------------
# Automated testing
-runtests: $(TESTSCRIPTS)
+runtests: run-tap-tests
+run-tap-tests: $(TESTSCRIPTS.t)
+ifneq ($(TESTSCRIPTS.t),)
ifdef RUNTESTS_ENABLED
- $(PERL) -MTest::Harness -e 'runtests @ARGV if @ARGV;' $^
+ $(PROVE) --failures --color $^ || $(PROVE_FAILURE)
+endif
endif
-testspec: $(TESTSCRIPTS)
- @$(RM) $@
- @echo OS-class: $(OS_CLASS) > $@
- @echo Target-arch: $(T_A) >> $@
- $(if $^, @echo Tests: $^ >> $@)
- $(if $(TESTFILES), @echo Files: $(TESTFILES) >> $@)
- $(if $(TESTSPEC_$(OS_CLASS)), @echo "Harness: $(TESTSPEC_$(OS_CLASS))" >> $@)
+tapfiles: $(TAPFILES)
+junitfiles: $(JUNITFILES)
-test-results: tapfiles
-ifneq ($(TAPFILES),)
+test-results: tap-results
+tap-results: $(TAPFILES)
+ifneq ($(strip $(TAPFILES)),)
ifdef RUNTESTS_ENABLED
- $(PROVE) --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES)
+ $(PROVE.tap) --failures --color $^ || $(PROVE_FAILURE)
endif
CURRENT_TAPFILES := $(wildcard $(TAPFILES))
@@ -398,16 +397,13 @@ ifneq ($(CURRENT_JUNITFILES),)
$(RM) $(CURRENT_JUNITFILES)
endif
-tapfiles: $(TESTSCRIPTS) $(TAPFILES)
-junitfiles: $(JUNITFILES)
-
# A .tap file is the output from running the associated test script
-%.tap: %.t
+$(TAPFILES.t): %.tap: %.t
ifdef RUNTESTS_ENABLED
$(PERL) $< -tap > $@
endif
-%.xml: %.tap
+$(JUNITFILES.t): %.xml: %.tap
$(TAPTOJUNIT) --puretap --output $@ --input $< $*
# If there's a perl test script (.plt) available, use it
@@ -422,6 +418,23 @@ endif
$(PERL) $(TOOLS)/makeTestfile.pl $(T_A) $(EPICS_HOST_ARCH) $@ $<
#---------------------------------------------------------------
+# Generate $(API_HEADER) files on request (%API.h)
+
+ifdef API_HEADER
+# Install them
+INC += $(API_HEADER)
+
+# Ensure we generate them early enough
+INSTALL_API_HEADERS = $(addprefix $(INSTALL_INCLUDE)/,$(API_HEADER))
+$(filter-out $(INSTALL_API_HEADERS), $(INSTALL_INC)) $(HDEPENDS_FILES): \
+ | $(INSTALL_API_HEADERS)
+
+# How to make one
+$(COMMON_DIR)/%API.h: $(TOOLS)/makeAPIheader.pl
+ @$(RM) $@
+ $(PERL) $(TOOLS)/makeAPIheader.pl -o $@ $(@:$(COMMON_DIR)/%API.h=%)
+endif
+
# Generate header with version number from VCS
ifneq ($(GENVERSION),)
@@ -564,8 +577,8 @@ include $(CONFIG)/RULES_EXPAND
.PRECIOUS: $(COMMON_INC)
.PHONY: all host inc build install clean rebuild buildInstall build_clean
-.PHONY: runtests tapfiles clean-tests test-results junitfiles
-.PHONY: checkRelease warnRelease noCheckRelease FORCE
+.PHONY: runtests run-tap-tests tapfiles junitfiles test-results tap-results
+.PHONY: clean-tests checkRelease warnRelease noCheckRelease FORCE
include $(CONFIG)/RULES_COMMON
diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS
index db68a84a5..f47df4a53 100644
--- a/configure/RULES_DIRS
+++ b/configure/RULES_DIRS
@@ -4,7 +4,7 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
-# in the file LICENSE that is included with this distribution.
+# in the file LICENSE that is included with this distribution.
#*************************************************************************
ARCHS += $(BUILD_ARCHS)
@@ -54,7 +54,7 @@ $(foreach dir, $(DIRS), \
define DEP_template2
$(1)$$(DIVIDER)$(2) : $$(foreach ddir, $$($(1)_DEPEND_DIRS), \
- $$(addsuffix $$(DIVIDER)$(2),$$(ddir)))
+ $$(addsuffix $$(DIVIDER)$(2),$$(ddir))) | before-$(2)
endef
$(foreach action, $(ACTIONS), \
$(foreach dir, $(DIRS), \
@@ -79,18 +79,24 @@ $(foreach arch, $(ARCHS), \
dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@))))
actionArchPart = $(join $(word 2, $(subst $(DIVIDER), ,$(notdir $@))), \
- $(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@)))))
-$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets) :
+ $(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@)))))
+
+$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets):
$(MAKE) -C $(dirPart) $(actionArchPart)
+# before-action rules are run once prior to recursing through the
+# list of subdirectories and running the action rule in each one.
+# See DEP_template2 above for how that rule ordering is achieved.
+beforeActions = $(addprefix before-,$(ACTIONS))
+$(beforeActions):
+
$(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \
$(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
-
-.PHONY: $(DIRS) all host rebuild
-.PHONY: $(ARCHS) $(ACTIONS)
-.PHONY: $(dirActionTargets) $(dirArchTargets)
-.PHONY: $(dirActionArchTargets)
-.PHONY: $(actionArchTargets)
+.PHONY : $(DIRS) all host rebuild
+.PHONY : $(ARCHS) $(ACTIONS) $(beforeActions)
+.PHONY : $(dirActionTargets) $(dirArchTargets)
+.PHONY : $(dirActionArchTargets)
+.PHONY : $(actionArchTargets)
include $(CONFIG)/RULES_COMMON
diff --git a/configure/RULES_EXPAND b/configure/RULES_EXPAND
index f315a7e9e..2fce30de1 100644
--- a/configure/RULES_EXPAND
+++ b/configure/RULES_EXPAND
@@ -12,28 +12,72 @@
vpath %@ $(USR_VPATH) $(ALL_SRC_DIRS)
#---------------------------------------------------------------
-# Variable expansion
+# Template variable expansion
+
+# This feature allows you to instantiate simple template files at
+# build-time, replacing macros spelled @NAME@ with values provided
+# by the Makefile. The template filename must end with an @ sign,
+# which is removed to create the expanded filename.
+
+# Makefiles can use this variable expansion as follows:
+#
+# 1. Add the template filename (with the trailing @ sign) to either
+# the EXPAND or EXPAND_COMMON variable, for example:
+# EXPAND_COMMON += myVersion.h@
+# Use EXPAND_COMMON for templates that don't depend on the
+# target architecture (these will be generated in O.Common).
+# 2. There are 2 ways of defining template macros. The simplest
+# is to add a NAME=VALUE string to the EXPAND_VARS variable for
+# the desired macros, e.g.:
+# EXPAND_VARS += MY_MAJOR_VERSION=$(MY_MAJOR_VERSION)
+# EXPAND_VARS += MY_MINOR_VERSION=$(MY_MINOR_VERSION)
+# These values may not contain spaces, even if inside quotes.
+# 3. A better way in the above case is to add the names of any
+# Makefile variables that should be provided as macros to the
+# variable EXPAND_ME, like this:
+# EXPAND_ME += MY_MAJOR_VERSION
+# EXPAND_ME += MY_MINOR_VERSION
+# The values of these variables may contain spaces.
+# 4. The macros TOP and ARCH will be set by the build system.
+# TOP is the value of $(INSTALL_LOCATION) for this module.
+# ARCH is the target architecture $(T_A), but is only set
+# while expanding files in EXPAND
+# 5. Add the expanded filename to some other variable that will
+# cause it to be created and used, such as INC here:
+# INC += myVersion.h
# Default settings
EXPAND_TOOL ?= $(PERL) $(TOOLS)/expandVars.pl
-EXPANDFLAGS += -t $(INSTALL_LOCATION) -a $(T_A)
-EXPANDFLAGS += $(addprefix -D ,$(EXPAND_VARS))
+EXPANDARCH = -a $(T_A)
+EXPANDFLAGS += -t $(INSTALL_LOCATION)
+EXPANDFLAGS += $(addprefix -D ,$(EXPAND_VARS) $($@_EXPAND_VARS))
+EXPANDFLAGS += $(foreach var, $(EXPAND_ME) $($@_EXPAND_ME), \
+ -D$(var)="$(strip $($(var)))")
# The names of files to be expanded must end with '@'
EXPANDED = $(EXPAND:%@=%)
+EXPANDED_COM = $(EXPAND_COMMON:%@=%)
+EXPANDED_COMMON = $(EXPANDED_COM:%=$(COMMON_DIR)/%)
$(EXPANDED): %: %@
$(ECHO) "Expanding $< to $@"
@$(RM) $@
- @$(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@
+ $(EXPAND_TOOL) $(EXPANDARCH) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@
+
+$(EXPANDED_COM): %: %@
+ $(ECHO) "Expanding $< to $(COMMON_DIR)/$@"
+ @$(RM) $@
+ $(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@
+$(EXPANDED_COMMON): $(COMMON_DIR)/%: %
+ @$(MV) $< $@
clean: expand_clean
expand_clean:
- @$(RM) $(EXPANDED)
+ @$(RM) $(EXPANDED) $(EXPANDED_COMMON)
-.PRECIOUS: $(EXPANDED)
+.PRECIOUS: $(EXPANDED) $(EXPANDED_COMMON)
.PHONY: expand_clean
#---------------------------------------------------------------
@@ -70,4 +114,3 @@ $1$(DEP):
endef
$(foreach asy, $(sort $(COMMON_ASSEMBLIES) $(ASSEMBLIES)), \
$(eval $(call ASSEMBLY_DEP_template,$(strip $(asy)))))
-
diff --git a/configure/RULES_MODULES b/configure/RULES_MODULES
index 08ebb3e10..a163ce18d 100644
--- a/configure/RULES_MODULES
+++ b/configure/RULES_MODULES
@@ -23,7 +23,8 @@
# -include $(TOP)/../CONFIG_SITE.local
# Add checked-out submodules to DIRS
-DIRS += $(subst /Makefile,,$(wildcard $(addsuffix /Makefile, $(SUBMODULES))))
+LIVE_SUBMODULES = $(subst /Makefile,,$(wildcard $(addsuffix /Makefile, $(SUBMODULES))))
+DIRS += $(LIVE_SUBMODULES)
include $(CONFIG)/RULES_DIRS
@@ -45,3 +46,13 @@ realclean:
$(RM) $(wildcard RELEASE.*.local)
.PHONY: RELEASE.host realclean
+
+# Append all our live submodule failure files
+FAILURE_FILES = $(addsuffix /$(TEST_FAILURE_FILENAME), $(LIVE_SUBMODULES))
+
+runtests: | $(addsuffix $(DIVIDER)runtests, $(LIVE_SUBMODULES))
+ @$(TOUCH) $(FAILURE_FILES)
+ @$(CAT) $(FAILURE_FILES) >> $(TEST_FAILURE_FILE)
+test-results: | $(addsuffix $(DIVIDER)test-results, $(LIVE_SUBMODULES))
+ @$(TOUCH) $(FAILURE_FILES)
+ @$(CAT) $(FAILURE_FILES) >> $(TEST_FAILURE_FILE)
diff --git a/configure/RULES_TARGET b/configure/RULES_TARGET
index e96232876..5d77b105e 100644
--- a/configure/RULES_TARGET
+++ b/configure/RULES_TARGET
@@ -95,12 +95,20 @@ $(1)_DLL_DEPLIBS=$$(foreach lib, $$($(1)_DLL_LIBS), \
$$(LIB_PREFIX)$(1)$$(LIB_SUFFIX):$$($(1)_OBJSNAME) $$($(1)_RESS)
$$(LIB_PREFIX)$(1)$$(LIB_SUFFIX):$$($(1)_DEPLIBS)
+ifneq ($$($(1)_API),)
+$$(LIB_PREFIX)$(1)$$(LIB_SUFFIX): API_CPPFLAGS += -DBUILDING_$$($(1)_API)_API
+endif
+
ifeq ($$(SHARED_LIBRARIES),YES)
ifdef SHRLIB_SUFFIX
$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX):$$($(1)_OBJSNAME) $$($(1)_RESS)
$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX):$$($(1)_DEPLIBS)
$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX):$$($(1)_DLL_DEPLIBS)
+
+ifneq ($$($(1)_API),)
+$$(SHRLIB_PREFIX)$(1)$$(SHRLIB_SUFFIX): API_CPPFLAGS += -DBUILDING_$$($(1)_API)_API
+endif
endif
endif
@@ -141,6 +149,11 @@ $(1)_DLL_DEPLIBS=$$(foreach lib, $$($(1)_DLL_LIBS),\
$$(LOADABLE_SHRLIB_PREFIX)$(1)$$(LOADABLE_SHRLIB_SUFFIX):$$($(1)_OBJSNAME) $$($(1)_RESS)
$$(LOADABLE_SHRLIB_PREFIX)$(1)$$(LOADABLE_SHRLIB_SUFFIX):$$($(1)_DEPLIBS)
$$(LOADABLE_SHRLIB_PREFIX)$(1)$$(LOADABLE_SHRLIB_SUFFIX):$$($(1)_DLL_DEPLIBS)
+
+ifneq ($$($(1)_API),)
+$$(LOADABLE_SHRLIB_PREFIX)$(1)$$(LOADABLE_SHRLIB_SUFFIX): \
+ API_CPPFLAGS += -DBUILDING_$$($(1)_API)_API
+endif
endef
$(foreach target, $(LOADABLE_LIBRARY), \
diff --git a/configure/RULES_TOP b/configure/RULES_TOP
index 615586d17..b956839ec 100644
--- a/configure/RULES_TOP
+++ b/configure/RULES_TOP
@@ -50,6 +50,9 @@ uninstall$(DIVIDER)%:
$(RMDIR) $(addsuffix /$(subst uninstall$(DIVIDER),,$@), \
$(INSTALL_LOCATION_BIN) $(INSTALL_LOCATION_LIB))
+runtests test-results:
+ @$(PERL) $(TOOLS)/testFailures.pl $(TEST_FAILURE_FILE)
+
else
#
# Using a disabled rule aborts
@@ -60,6 +63,10 @@ else
endif # DISABLE_TOP_RULES
+before-runtests before-test-results: rm-failure-file
+rm-failure-file:
+ @$(RM) $(TEST_FAILURE_FILE)
+ @$(TOUCH) $(TEST_FAILURE_FILE)
help:
@echo "Usage: gnumake [options] [target] ..."
@@ -99,7 +106,7 @@ endif
@echo "Object targets are supported by the O. level Makefile .e.g"
@echo " xxxRecord.o"
-.PHONY: distclean uninstall help
+.PHONY: distclean uninstall rm-failure-file help
.PHONY: realuninstall archuninstall uninstallDirs
ifndef DISABLE_TOP_RULES
diff --git a/configure/os/CONFIG.Common.win32-x86-mingw b/configure/os/CONFIG.Common.win32-x86-mingw
index cb3f53978..7c03781b0 100644
--- a/configure/os/CONFIG.Common.win32-x86-mingw
+++ b/configure/os/CONFIG.Common.win32-x86-mingw
@@ -30,7 +30,7 @@ ARCH_DEP_LDFLAGS += -m32
# Compiler does not define __unix __unix__ unix
# Override for -DUNIX from CONFIG.Common.UnixCommon
-OP_SYS_CPPFLAGS = -D_MINGW -Wno-format
+OP_SYS_CPPFLAGS = -D_MINGW -D__USE_MINGW_ANSI_STDIO
EXE = .exe
RES = .coff
diff --git a/configure/os/CONFIG.UnixCommon.Common b/configure/os/CONFIG.UnixCommon.Common
index 026a5234d..72c1ee929 100644
--- a/configure/os/CONFIG.UnixCommon.Common
+++ b/configure/os/CONFIG.UnixCommon.Common
@@ -11,6 +11,7 @@ RM = rm -f
MKDIR = mkdir -p
RMDIR = rm -rf
CAT = cat
+TOUCH = touch
# Allow site overrides
-include $(CONFIG)/os/CONFIG_SITE.UnixCommon.Common
diff --git a/configure/os/CONFIG.linux-x86.win32-x86-mingw b/configure/os/CONFIG.linux-x86.win32-x86-mingw
index bd75f5ebd..655b33f23 100644
--- a/configure/os/CONFIG.linux-x86.win32-x86-mingw
+++ b/configure/os/CONFIG.linux-x86.win32-x86-mingw
@@ -21,4 +21,4 @@ LOADABLE_SHRLIB_LDFLAGS = -shared \
GNU_LDLIBS_YES =
# Link with system libraries
-OP_SYS_LDLIBS = -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
+OP_SYS_LDLIBS = -lpsapi -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
diff --git a/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw b/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw
index a08f19902..8430011c4 100644
--- a/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw
+++ b/configure/os/CONFIG.win32-x86-mingw.win32-x86-mingw
@@ -32,4 +32,4 @@ LOADABLE_SHRLIB_LDFLAGS = -shared \
GNU_LDLIBS_YES =
# Link with system libraries
-OP_SYS_LDLIBS = -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
+OP_SYS_LDLIBS = -lpsapi -lws2_32 -ladvapi32 -luser32 -lkernel32 -lwinmm -ldbghelp
diff --git a/configure/os/CONFIG.win32-x86.Common b/configure/os/CONFIG.win32-x86.Common
index 43cfc342f..c76af8ea3 100644
--- a/configure/os/CONFIG.win32-x86.Common
+++ b/configure/os/CONFIG.win32-x86.Common
@@ -11,6 +11,7 @@ MKDIR = $(PERL) -MExtUtils::Command -e mkpath
RMDIR = $(PERL) -MExtUtils::Command -e rm_rf
NOP = $(PERL) -e ''
CAT = $(PERL) -MExtUtils::Command -e cat
+TOUCH = $(PERL) -MExtUtils::Command -e touch
WIND_HOST_TYPE = x86-win32
OSITHREAD_USE_DEFAULT_STACK = NO
diff --git a/documentation/RELEASE_NOTES.md b/documentation/RELEASE_NOTES.md
index 2adeacf24..6fd80615a 100644
--- a/documentation/RELEASE_NOTES.md
+++ b/documentation/RELEASE_NOTES.md
@@ -8,9 +8,199 @@ which they were originally committed.** Thus it is important to read more than
just the first section to understand everything that has changed in each
release.
-The external PVA submodules each have their own separate set of release notes
-which should also be read to understand what has changed since an earlier
-release.
+The PVA submodules each have their own individual sets of release notes which
+should also be read to understand what has changed since earlier releases.
+
+**This version of EPICS has not been released yet.**
+
+## Changes made on the 7.0 branch since 7.0.4
+
+
+
+
+## EPICS Release 7.0.4
+
+### Bug fixes
+
+The following launchpad bugs have fixes included in this release:
+
+- [lp: 1812084](https://bugs.launchpad.net/bugs/1812084), Build failure on
+ RTEMS 4.10.2
+- [lp: 1829919](https://bugs.launchpad.net/bugs/1829919), IOC segfaults when
+ calling dbLoadRecords after iocInit
+- [lp: 1838792](https://bugs.launchpad.net/bugs/1838792), epicsCalc bit-wise
+ operators on aarch64
+- [lp: 1853148](https://bugs.launchpad.net/bugs/1853148), mingw compiler
+ problem with printf/scanf formats
+- [lp: 1852653](https://bugs.launchpad.net/bugs/1852653), USE_TYPED_DSET
+ incompatible with C++
+- [lp: 1862328](https://bugs.launchpad.net/bugs/1862328), Race condition on
+ IOC start leaves rsrv unresponsive
+- [lp: 1866651](https://bugs.launchpad.net/bugs/1866651), thread joinable race
+- [lp: 1868486](https://bugs.launchpad.net/bugs/1868486), epicsMessageQueue
+ lost messages
+- [lp: 1868680](https://bugs.launchpad.net/bugs/1868680), Access Security file
+ reload (asInit) fails
+
+### \*_API macros in EPICS headers
+
+Internally, the Com and ca libraries now express dllimport/export (Windows)
+and symbol visibility (GCC) using library-specific macros (eg. `LIBCOM_API`)
+instead of the macros `epicsShareFunc`, `epicsShareClass`, `epicsShareDef` etc.
+that are defined in the `shareLib.h` header.
+This change may affect some user code which uses the `epicsShare*` macros
+without having explicitly included the `shareLib.h` header themselves.
+Such code should be changed to include `shareLib.h` directly.
+
+A new helper script `makeAPIheader.pl` and build rules to generate a
+library-specific `*API.h` header file has been added. Run `makeAPIheader.pl -h`
+for information on how to use this in your own applications, but note that the
+resulting sources will not be able to be compiled using earlier versions of
+EPICS Base.
+
+### IOCsh usage messages
+
+At the iocShell prompt `help ` now prints a descriptive usage message
+for many internal IOCsh commands in addition to the command parameters.
+Try `help *` to see all commands, or a glob pattern such as `help db*` to see
+a subset.
+
+External code may provide usage messages when registering commands using a
+new `const char *usage` member of the `iocshFuncDef` structure.
+The `iocsh.h` header also now defines a macro `IOCSHFUNCDEF_HAS_USAGE` which
+can be used to detect Base versions that support this feature at compile-time.
+
+### Variable names in RELEASE files
+
+`configure/RELEASE` files are parsed by both GNUmake and the `convertRelease.pl`
+script. While GNUmake is quite relaxed about what characters may be used in a
+RELEASE variable name, the `convertRelease.pl` script parser has only recognized
+variable names that match the Perl regular expression `\w+`, i.e. upper and
+lower-case letters, digits and underscore characters.
+
+The script has been modified so now RELEASE variable names must start with a
+letter or underscore, and be followed by any number of letters, digits,
+underscore or hyphen characters, matching the regular expression
+`[A-Za-z_][A-Za-z_0-9-]*`. The hyphen character `-` was not previously allowed
+and if used would have prevented a build from finding include files and
+libraries in any module using that in its RELEASE variable name.
+
+This change does disallow names that start with a digit which used to be
+allowed, but hopefully nobody has been relying on that ability. The regular
+expression used for names can be found in the file `src/tools/EPICS/Release.pm`
+and can be adjusted locally if necessary.
+
+### caRepeater /dev/null
+
+On \*NIX targets caRepeater will now partially daemonize by redirecting
+stdin/out/err to /dev/null. This prevents caRepeater from inheriting
+the stdin/out of a process, like caget, which has spawned it in the
+background. This has been known to cause problems in some cases when
+caget is itself being run from a shell script.
+
+caRepeater will now understand the `-v` argument to retain stdin/out/err
+which may be necessary to see any error messages it may emit.
+
+### `state` record deprecated
+
+IOCs now emit a warning when a database file containing the `state` record is
+loaded. This record has been deprecated for a while and will be removed
+beginning with EPICS 7.1. Consider using the `stringin` record instead.
+
+### Record types publish dset's
+
+The record types in Base now define their device support entry table (DSET)
+structures in the record header file. While still optional, developers of
+external support modules are encouraged to start converting their code to use
+the record's new definitions instead of the traditional approach of copying the
+structure definitions into each source file that needs them. By following the
+instructions below it is still possible for the converted code to build and
+work with older Base releases.
+
+This would also be a good time to modify the device support to use the type-safe
+device support entry tables that were introduced in Base-3.16.2 -- see
+[#type-safe-device-and-driver-support-tables](this entry below) for the
+description of that change, which is also optional for now.
+
+Look at the aiRecord for example. Near the top of the generated `aiRecord.h`
+header file is a new section that declares the `aidset`:
+
+```C
+/* Declare Device Support Entry Table */
+struct aiRecord;
+typedef struct aidset {
+ dset common;
+ long (*read_ai)(struct aiRecord *prec);
+ long (*special_linconv)(struct aiRecord *prec, int after);
+} aidset;
+#define HAS_aidset
+```
+
+Notice that the common members (`number`, `report()`, `init()`, `init_record()`
+and `get_ioint_info()` don't appear directly but are included by embedding the
+`dset common` member instead. This avoids the need to have separate definitions
+of those members in each record dset, but does require those members to be
+wrapped inside another set of braces `{}` when initializing the data structure
+for the individual device supports. It also requires changes to code that
+references those common members, but that code usually only appears inside the
+record type implementation and very rarely in device supports.
+
+An aiRecord device support that will only be built against this or later
+versions of EPICS can now declare its dset like this:
+
+```C
+aidset devAiSoft = {
+ { 6, NULL, NULL, init_record, NULL },
+ read_ai, NULL
+};
+epicsExportAddress(dset, devAiSoft);
+```
+
+However most device support that is not built into EPICS itself will need to
+remain compatible with older EPICS versions, which is why the ai record's header
+file also declares the preprocessor macro `HAS_aidset`. This makes it easy to
+define the `aidset` in the device support code when it's needed, and not when
+it's provided in the header:
+
+```C
+#ifndef HAS_aidset
+typedef struct aidset {
+ dset common;
+ long (*read_ai)(aiRecord *prec);
+ long (*special_linconv)(aiRecord *prec, int after);
+} aidset;
+#endif
+aidset devAiSoft = {
+ { 6, NULL, NULL, init_record, NULL },
+ read_ai, NULL
+};
+epicsExportAddress(dset, devAiSoft);
+```
+
+The above `typedef struct` declaration was copied directly from the new
+aiRecord.h file and wrapped in the `#ifndef HAS_aidset` conditional.
+
+This same pattern should be followed for all record types except for the lsi,
+lso and printf record types, which have published their device support entry
+table structures since they were first added to Base but didn't previously embed
+the `dset common` member. Device support for these record types therefore can't
+use the dset name since the new definitions are different from the originals and
+will cause a compile error, so this pattern should be used instead:
+
+```C
+#ifndef HAS_lsidset
+struct {
+ dset common;
+ long (*read_string)(lsiRecord *prec);
+}
+#else
+lsidset
+#endif
+devLsiEtherIP = {
+ {5, NULL, lsi_init, lsi_init_record, get_ioint_info},
+ lsi_read
+};
+```
## EPICS Release 7.0.3.1
@@ -162,7 +352,7 @@ set to their default values.
void startitup(void) {
epicsThreadOpts opts = EPICS_THREAD_OPTS_INIT;
epicsThreadId tid;
-
+
opts.priority = epicsThreadPriorityMedium;
tid = epicsThreadCreateOpt("my thread", &threadMain, NULL, &opts);
}
@@ -629,14 +819,14 @@ number instead, like this:
```
#include
-
+
#ifndef VERSION_INT
# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
#endif
#ifndef EPICS_VERSION_INT
# define EPICS_VERSION_INT VERSION_INT(EPICS_VERSION, EPICS_REVISION, EPICS_MODIFICATION, EPICS_PATCH_LEVEL)
#endif
-
+
#if EPICS_VERSION_INT >= VERSION_INT(3,16,1,0)
/* Code where Base has INT64 support */
#else
@@ -962,7 +1152,7 @@ excerpts from a database file:
record(ai, math:pi) {
field(INP, {const: 3.14159265358979}) # Correct
field(SIOL, "{const: 3.142857}") # Wrong
-
+
info(autosave, { # White-space and comments are allowed
fields:[DESC, SIMM],
pass0:[VAL]
@@ -1110,7 +1300,7 @@ this:
```
#include "epicsTime.h"
-
+
#ifndef M_time
/* S_time_... status values were not provided before Base 3.16 */
#define S_time_unsynchronized epicsTimeERROR
@@ -1135,9 +1325,115 @@ Added a new macro `callbackGetPriority(prio, callback)` to the callback.h
header and removed the need for dbScan.c to reach into the internals of its
`CALLBACK` objects.
-## Changes from the 3.15 branch since 3.15.7
-> None.
+# Changes incorporated from the 3.15 branch
+
+
+## Changes made between 3.15.7 and 3.15.8
+
+### Bug fixes
+
+The following launchpad bugs have fixes included in this release:
+
+- [lp: 1812084](https://bugs.launchpad.net/epics-base/+bug/1812084), Build
+ failure on RTEMS 4.10.2
+- [lp: 1829770](https://bugs.launchpad.net/epics-base/+bug/1829770), event
+ record device support broken with constant INP
+- [lp: 1829919](https://bugs.launchpad.net/epics-base/+bug/1829919), IOC
+ segfaults when calling dbLoadRecords after iocInit
+- [lp: 1838792](https://bugs.launchpad.net/epics-base/+bug/1838792), epicsCalc
+ bit-wise operators on aarch64
+- [lp: 1841608](https://bugs.launchpad.net/epics-base/+bug/1841608), logClient
+ falsely sends error logs on all connections
+- [lp: 1853168](https://bugs.launchpad.net/epics-base/+bug/1853168), undefined
+ reference to `clock_gettime()`
+- [lp: 1862328](https://bugs.launchpad.net/epics-base/+bug/1862328), Race
+ condition on IOC start leaves rsrv unresponsive
+- [lp: 1868486](https://bugs.launchpad.net/epics-base/+bug/1868486),
+ epicsMessageQueue lost messages
+
+
+### Improvements to the self-test build targets
+
+This release contains changes that make it possible to integrate another test
+running and reporting system (such as Google's gtest) into the EPICS build
+system. The built-in test-runner and reporting system will continue to be used
+by the test programs inside Base however.
+
+These GNUmake `tapfiles` and `test-results` build targets now collect a list of
+the directories that experienced test failures and display those at the end of
+running and/or reporting all of the tests. The GNUmake process will also only
+exit with an error status after running and/or reporting all of the test
+results; previously the `-k` flag to make was needed and even that didn't always
+work.
+
+Continuous Integration systems are recommended to run `make tapfiles` (or if
+they can read junittest output instead of TAP `make junitests`) followed by
+`make -s test-results` to display the results of the tests. If multiple CPUs are
+available the `-j` flag can be used to run tests in parallel, giving the maximum
+jobs that should be allowed so `make -j4 tapfiles` for a system with 4 CPUs say.
+Running many more jobs than you have CPUs is likely to be slower and is not
+recommended.
+
+### Calc Engine Fixes and Enhancements
+
+The code that implements bit operations for Calc expressions has been reworked
+to better handle some CPU architectures and compilers. As part of this work a
+new operator has been added: `>>>` performs a logical right-shift, inserting
+zero bits into the most significant bits (the operator `>>` is an arithmetic
+right-shift which copies the sign bit as it shifts the value rightwards).
+
+### IOC logClient Changes
+
+The IOC's error logging system has been updated significantly to fix a number
+of issues including:
+
+ - Only send errlog messages to iocLogClient listeners
+ - Try to minimize lost messages while the log server is down:
+ + Detect disconnects sooner
+ + Don't discard the buffer on disconnect
+ + Flush the buffer immediately after a server reconnects
+
+### epicsThread: Main thread defaults to allow blocking I/O
+
+VxWorks IOCs (and potentially RTEMS IOCs running GeSys) have had problems with
+garbled error messages from dbStaticLib routines for some time — messages
+printed before `iocInit` were being queued through the errlog thread instead of
+being output immediately. This has been fixed by initializing the main thread
+with its `OkToBlock` flag set instead of cleared. IOCs running on other
+operating systems that use iocsh to execute the startup script previously had
+that set anyway in iocsh so were not affected, but this change might cause other
+programs that don't use iocsh to change their behavior slightly if they use
+`errlogPrintf()`, `epicsPrintf()` or `errPrintf()`.
+
+### catools: Handle data type changes in camonitor
+
+The camonitor program didn't properly cope if subscribed to a channel whose data
+type changed when its IOC was rebooted without restarting the camonitor program.
+This has now been fixed.
+
+### More Record Reference Documentation
+
+The remaining record types have had their reference pages moved from the Wiki,
+and some new reference pages have been written to cover the analog array and
+long string input and output record types plus the printf record type, none of
+which were previously documented. The wiki reference pages covering the fields
+common to all, input, and output record types have also been added, thanks to
+Rolf Keitel. The POD conversion scripts have also been improved and they now
+properly support linking to subsections in a different document, although the
+POD changes to add the cross-links that appeared in the original wiki pages
+still needs to be done in most cases.
+
+### Fix build issues with newer MinGW versions
+
+The `clock_gettime()` routine is no longer used under MinGW since newer versions
+don't provide it any more.
+
+### Fix race for port in RSRV when multiple IOCs start simultaneously
+
+If multiple IOCs were started at the same time, by systemd say, they could race
+to obtain the Channel Access TCP port number 5064. This issue has been fixed.
+
## Changes made between 3.15.6 and 3.15.7
@@ -1854,4 +2150,3 @@ Simpler versions of the `epicsTime_gmtime()` and `epicsTime_localtime()`
routines have been included in the Windows implementations, and a new test
program added. The original versions do not report DST status properly. Fixes
[Launchpad bug 1528284](https://bugs.launchpad.net/bugs/1528284).
-
diff --git a/documentation/RecordReference.md b/documentation/RecordReference.md
index 587ec6148..a999d10f7 100644
--- a/documentation/RecordReference.md
+++ b/documentation/RecordReference.md
@@ -1,9 +1,17 @@
# Record Reference Documentation
-The following documentation for the record types and menus include with Base was converted from the old EPICS Wiki pages and updated. This list does not include all of the available record types as some have not been documented yet.
+The following documentation for the record types and menus include with Base was
+converted from the old EPICS Wiki pages and updated. This list only includes the
+record types supplied with Base.
+
+* [Fields Common to All Record Types](dbCommonRecord.html)
+* [Fields Common to Input Record Types](dbCommonInput.html)
+* [Fields Common to Output Record Types](dbCommonOutput.html)
## Record Types
+* [Analog Array Input Record (aai)](aaiRecord.html)
+* [Analog Array Output Record (aao)](aaoRecord.html)
* [Analog Input Record (ai)](aiRecord.html)
* [Analog Output Record (ao)](aoRecord.html)
* [Array Subroutine Record (aSub)](aSubRecord.html)
@@ -15,15 +23,19 @@ The following documentation for the record types and menus include with Base was
* [Data Fanout Record (dfanout)](dfanoutRecord.html)
* [Event Record (event)](eventRecord.html)
* [Fanout Record (fanout)](fanoutRecord.html)
+* [Histogram Record (histogram)](histogramRecord.html)
* [64bit Integer Input Record (int64in)](int64inRecord.html)
* [64bit Integer Output Record (int64out)](int64outRecord.html)
* [Long Input Record (longin)](longinRecord.html)
* [Long Output Record (longout)](longoutRecord.html)
+* [Long String Input Record (lsi)](lsiRecord.html)
+* [Long String Output Record (lso)](lsoRecord.html)
* [Multi-Bit Binary Input Direct Record (mbbiDirect)](mbbiDirectRecord.html)
* [Multi-Bit Binary Input Record (mbbi)](mbbiRecord.html)
* [Multi-Bit Binary Output Direct Record (mbboDirect)](mbboDirectRecord.html)
* [Multi-Bit Binary Output Record (mbbo)](mbboRecord.html)
* [Permissive Record (permissive)](permissiveRecord.html)
+* [Printf Record (prinf)](printfRecord.html)
* [Select Record (sel)](selRecord.html)
* [Sequence Record (seq)](seqRecord.html)
* [State Record (state)](stateRecord.html)
@@ -47,4 +59,10 @@ The following documentation for the record types and menus include with Base was
## Corrections and Updates
-Corrections to these documents can be submitted as patch files to the EPICS core developers, or as merge requests or pull requests to the 7.0 branch of epics-base. The document sources can be found in the `modules/database/src/std/rec` and `modules/database/src/ioc/db` directories in files with extension `.dbd.pod`. The documentation format is an extended version of Perl POD, run `perldoc pod` for details.
+Corrections to these documents can be submitted as patch files to the EPICS core
+developers, or as merge requests or pull requests to the 7.0 branch of Base.
+The document sources can be found in the `modules/database/src/std/rec` and
+`modules/database/src/ioc/db` directories in files with extension `.dbd.pod`.
+The documentation source format is a combination of the EPICS DBD file format
+with an extended version of Perl's POD (plain old documentation); run `perldoc
+pod` for details of POD.
diff --git a/documentation/ReleaseChecklist.html b/documentation/ReleaseChecklist.html
index 0a80c7cba..117748b06 100644
--- a/documentation/ReleaseChecklist.html
+++ b/documentation/ReleaseChecklist.html
@@ -147,17 +147,17 @@ starting at Release Approval .
Tag the module in Git, using these tag conventions:
- R7.0.3.2-pren
+ R7.0.4.1-pren
— pre-release tag
- R7.0.3.2-rcn
+ R7.0.4.1-rcn
— release candidate tag
cd base-7.0
- git tag -m 'ANJ: Tagged for 7.0.3.2-rc1' R7.0.3.2-rc1
+ git tag -m 'ANJ: Tagged for 7.0.4.1-rc1' R7.0.4.1-rc1
Note that submodules must not be tagged with the version used
for the top-level, they each have their own separate version numbers
@@ -171,11 +171,11 @@ starting at Release Approval .
files and directories that are only used for continuous integration:
cd base-7.0
- ./.tools/make-tar.sh R7.0.3.2-rc1 base-7.0.3.2-rc1.tar.gz base-7.0.3.2-rc1/
+ ./.tools/make-tar.sh R7.0.4.1-rc1 base-7.0.4.1-rc1.tar.gz base-7.0.4.1-rc1/
Create a GPG signature file of the tarfile as follows:
- gpg --armor --sign --detach-sig base-7.0.3.2-rc1.tar.gz
+ gpg --armor --sign --detach-sig base-7.0.4.1-rc1.tar.gz
@@ -298,7 +298,7 @@ starting at Release Approval .
Tag the module:
- git tag -m 'ANJ: Tag for EPICS 7.0.3.2' <module-version>
+ git tag -m 'ANJ: Tag for EPICS 7.0.4.1' <module-version>
@@ -355,7 +355,7 @@ starting at Release Approval .
Tag the epics-base module in Git:
cd base-7.0
- git tag -m 'ANJ: Tagged for 7.0.3.2' R7.0.3.2
+ git tag -m 'ANJ: Tagged for release' R7.0.4.1
Don't push these commits or the new tag to the Launchpad repository
yet.
@@ -387,12 +387,12 @@ starting at Release Approval .
files and directories that are only used for continuous integration:
cd base-7.0
- ./.tools/make-tar.sh R7.0.3.2 ../base-7.0.3.2.tar.gz base-7.0.3.2/
+ ./.tools/make-tar.sh R7.0.4.1 ../base-7.0.4.1.tar.gz base-7.0.4.1/
Create a GPG signature file of the tarfile as follows:
cd ..
- gpg --armor --sign --detach-sig base-7.0.3.2.tar.gz
+ gpg --armor --sign --detach-sig base-7.0.4.1.tar.gz
@@ -457,7 +457,7 @@ starting at Release Approval .
Upload the tar file and its .asc signature file to the
epics-controls web-server.
- scp base-7.0.3.2.tar.gz base-7.0.3.2.tar.gz.asc epics-controls:download/base
+ scp base-7.0.4.1.tar.gz base-7.0.4.1.tar.gz.asc epics-controls:download/base
diff --git a/modules/ca/Makefile b/modules/ca/Makefile
index eeb147b07..8fde37827 100644
--- a/modules/ca/Makefile
+++ b/modules/ca/Makefile
@@ -12,4 +12,4 @@ include $(TOP)/configure/CONFIG
DIRS += src
-include $(TOP)/configure/RULES_TOP
+include $(TOP)/configure/RULES_DIRS
diff --git a/modules/ca/src/client/CASG.cpp b/modules/ca/src/client/CASG.cpp
index 4ffb414c7..0fc76e238 100644
--- a/modules/ca/src/client/CASG.cpp
+++ b/modules/ca/src/client/CASG.cpp
@@ -18,7 +18,6 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "syncGroup.h"
#include "oldAccess.h"
@@ -83,7 +82,7 @@ int CASG::block (
return ECA_TIMEOUT;
}
- cur_time = epicsTime::getMonotonic ();
+ cur_time = epicsTime::getCurrent ();
this->client.flush ( guard );
@@ -121,7 +120,7 @@ int CASG::block (
/*
* force a time update
*/
- cur_time = epicsTime::getMonotonic ();
+ cur_time = epicsTime::getCurrent ();
delay = cur_time - beg_time;
}
@@ -209,23 +208,23 @@ bool CASG::ioComplete (
return this->ioPendingList.count () == 0u;
}
-void CASG::put ( epicsGuard < epicsMutex > & guard, chid pChan,
+void CASG::put ( epicsGuard < epicsMutex > & guard, chid pChan,
unsigned type, arrayElementCount count, const void * pValue )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
sgAutoPtr < syncGroupWriteNotify > pNotify ( guard, *this );
- pNotify = syncGroupWriteNotify::factory (
+ pNotify = syncGroupWriteNotify::factory (
this->freeListWriteOP, *this, & CASG :: recycleWriteNotifyIO, pChan );
pNotify->begin ( guard, type, count, pValue );
pNotify.release ();
}
-void CASG::get ( epicsGuard < epicsMutex > & guard, chid pChan,
+void CASG::get ( epicsGuard < epicsMutex > & guard, chid pChan,
unsigned type, arrayElementCount count, void *pValue )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
sgAutoPtr < syncGroupReadNotify > pNotify ( guard, *this );
- pNotify = syncGroupReadNotify::factory (
+ pNotify = syncGroupReadNotify::factory (
this->freeListReadOP, *this, & CASG :: recycleReadNotifyIO, pChan, pValue );
pNotify->begin ( guard, type, count );
pNotify.release ();
@@ -242,14 +241,14 @@ void CASG::completionNotify (
}
}
-void CASG :: recycleReadNotifyIO ( epicsGuard < epicsMutex > & guard,
+void CASG :: recycleReadNotifyIO ( epicsGuard < epicsMutex > & guard,
syncGroupReadNotify & io )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
this->freeListReadOP.release ( & io );
}
-void CASG :: recycleWriteNotifyIO ( epicsGuard < epicsMutex > & guard,
+void CASG :: recycleWriteNotifyIO ( epicsGuard < epicsMutex > & guard,
syncGroupWriteNotify & io )
{
guard.assertIdenticalMutex ( this->client.mutexRef() );
diff --git a/modules/ca/src/client/Makefile b/modules/ca/src/client/Makefile
index b59eee465..13fe6a412 100644
--- a/modules/ca/src/client/Makefile
+++ b/modules/ca/src/client/Makefile
@@ -26,7 +26,13 @@ INC += cacIO.h
INC += caDiagnostics.h
INC += net_convert.h
INC += caVersion.h
-INC += caVersionNum.h
+
+EXPAND_COMMON += caVersion.h@
+
+EXPAND_ME += EPICS_CA_MAJOR_VERSION
+EXPAND_ME += EPICS_CA_MINOR_VERSION
+EXPAND_ME += EPICS_CA_MAINTENANCE_VERSION
+EXPAND_ME += EPICS_CA_DEVELOPMENT_FLAG
LIBSRCS += cac.cpp
LIBSRCS += cacChannel.cpp
@@ -74,6 +80,9 @@ LIBSRCS += hostNameCache.cpp
LIBSRCS += msgForMultiplyDefinedPV.cpp
LIBSRCS_vxWorks += templateInstances.cpp
+API_HEADER = libCaAPI.h
+ca_API = libCa
+
LIBRARY=ca
ca_RCS = ca.rc
@@ -118,20 +127,7 @@ ca_test_SYS_LIBS_WIN32 = ws2_32 advapi32 user32
OBJS_vxWorks += ca_test
-EXPANDVARS += EPICS_CA_MAJOR_VERSION
-EXPANDVARS += EPICS_CA_MINOR_VERSION
-EXPANDVARS += EPICS_CA_MAINTENANCE_VERSION
-EXPANDVARS += EPICS_CA_DEVELOPMENT_FLAG
-
-EXPANDFLAGS += $(foreach var,$(EXPANDVARS),-D$(var)="$(strip $($(var)))")
-
# shared library ABI version.
SHRLIB_VERSION = $(EPICS_CA_MAJOR_VERSION).$(EPICS_CA_MINOR_VERSION).$(EPICS_CA_MAINTENANCE_VERSION)
include $(TOP)/configure/RULES
-
-
-# Can't use EXPAND as generated headers must appear
-# in O.Common, but EXPAND emits rules for O.$(T_A)
-../O.Common/caVersionNum.h: ../caVersionNum.h@
- $(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@
diff --git a/modules/ca/src/client/SearchDest.h b/modules/ca/src/client/SearchDest.h
index c22be7c87..ce6381122 100644
--- a/modules/ca/src/client/SearchDest.h
+++ b/modules/ca/src/client/SearchDest.h
@@ -5,11 +5,11 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
- * in file LICENSE that is included with this distribution.
+ * in file LICENSE that is included with this distribution.
\*************************************************************************/
-#ifndef SearchDest_h
-#define SearchDest_h
+#ifndef INC_SearchDest_H
+#define INC_SearchDest_H
#include
#include
@@ -28,7 +28,7 @@ struct SearchDest :
virtual void notify (
const caHdr & msg, const void * pPayload,
const osiSockAddr & addr, const epicsTime & ) = 0;
- virtual void show (
+ virtual void show (
epicsGuard < epicsMutex > &, unsigned level ) const = 0;
};
virtual void searchRequest ( epicsGuard < epicsMutex > &,
@@ -36,4 +36,4 @@ struct SearchDest :
virtual void show ( epicsGuard < epicsMutex > &, unsigned level ) const = 0;
};
-#endif // SearchDest_h
+#endif // ifndef INC_SearchDest_H
diff --git a/modules/ca/src/client/access.cpp b/modules/ca/src/client/access.cpp
index a36899c02..169a08bef 100644
--- a/modules/ca/src/client/access.cpp
+++ b/modules/ca/src/client/access.cpp
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -40,7 +39,6 @@
*/
#define CAC_VERSION_GLOBAL
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
#include "cac.h"
@@ -165,13 +163,13 @@ int fetchClientContext ( ca_client_context **ppcac )
* ca_task_initialize ()
*/
// extern "C"
-int epicsShareAPI ca_task_initialize ( void )
+int epicsStdCall ca_task_initialize ( void )
{
return ca_context_create ( ca_disable_preemptive_callback );
}
// extern "C"
-int epicsShareAPI ca_context_create (
+int epicsStdCall ca_context_create (
ca_preemptive_callback_select premptiveCallbackSelect )
{
ca_client_context *pcac;
@@ -183,19 +181,19 @@ int epicsShareAPI ca_context_create (
}
pcac = ( ca_client_context * ) epicsThreadPrivateGet ( caClientContextId );
- if ( pcac ) {
+ if ( pcac ) {
if ( premptiveCallbackSelect == ca_enable_preemptive_callback &&
! pcac->preemptiveCallbakIsEnabled() ) {
return ECA_NOTTHREADED;
}
- return ECA_NORMAL;
- }
+ return ECA_NORMAL;
+ }
pcac = new ca_client_context (
premptiveCallbackSelect == ca_enable_preemptive_callback );
- if ( ! pcac ) {
- return ECA_ALLOCMEM;
- }
+ if ( ! pcac ) {
+ return ECA_ALLOCMEM;
+ }
epicsThreadPrivateSet ( caClientContextId, (void *) pcac );
}
@@ -211,7 +209,7 @@ int epicsShareAPI ca_context_create (
// defunct
//
// extern "C"
-int epicsShareAPI ca_modify_host_name ( const char * )
+int epicsStdCall ca_modify_host_name ( const char * )
{
return ECA_NORMAL;
}
@@ -222,7 +220,7 @@ int epicsShareAPI ca_modify_host_name ( const char * )
// defunct
//
// extern "C"
-int epicsShareAPI ca_modify_user_name ( const char * )
+int epicsStdCall ca_modify_user_name ( const char * )
{
return ECA_NORMAL;
}
@@ -231,7 +229,7 @@ int epicsShareAPI ca_modify_user_name ( const char * )
// ca_context_destroy ()
//
// extern "C"
-void epicsShareAPI ca_context_destroy ()
+void epicsStdCall ca_context_destroy ()
{
ca_client_context *pcac;
@@ -250,7 +248,7 @@ void epicsShareAPI ca_context_destroy ()
* releases all resources alloc to a channel access client
*/
// extern "C"
-int epicsShareAPI ca_task_exit ()
+int epicsStdCall ca_task_exit ()
{
ca_context_destroy ();
return ECA_NORMAL;
@@ -263,7 +261,7 @@ int epicsShareAPI ca_task_exit ()
* backwards compatible entry point to ca_search_and_connect()
*/
// extern "C"
-int epicsShareAPI ca_build_and_connect ( const char *name_str, chtype get_type,
+int epicsStdCall ca_build_and_connect ( const char *name_str, chtype get_type,
arrayElementCount get_count, chid * chan, void *pvalue,
caCh *conn_func, void *puser )
{
@@ -278,7 +276,7 @@ int epicsShareAPI ca_build_and_connect ( const char *name_str, chtype get_type,
* ca_search_and_connect()
*/
// extern "C"
-int epicsShareAPI ca_search_and_connect (
+int epicsStdCall ca_search_and_connect (
const char * name_str, chid * chanptr,
caCh * conn_func, void * puser )
{
@@ -287,7 +285,7 @@ int epicsShareAPI ca_search_and_connect (
}
// extern "C"
-int epicsShareAPI ca_create_channel (
+int epicsStdCall ca_create_channel (
const char * name_str, caCh * conn_func, void * puser,
capri priority, chid * chanptr )
{
@@ -362,7 +360,7 @@ int epicsShareAPI ca_create_channel (
* its context
*/
// extern "C"
-int epicsShareAPI ca_clear_channel ( chid pChan )
+int epicsStdCall ca_clear_channel ( chid pChan )
{
ca_client_context & cac = pChan->getClientCtx ();
{
@@ -401,7 +399,7 @@ int epicsShareAPI ca_clear_channel ( chid pChan )
* Specify an event subroutine to be run for asynch exceptions
*/
// extern "C"
-int epicsShareAPI ca_add_exception_event ( caExceptionHandler *pfunc, void *arg )
+int epicsStdCall ca_add_exception_event ( caExceptionHandler *pfunc, void *arg )
{
ca_client_context *pcac;
int caStatus = fetchClientContext ( &pcac );
@@ -417,7 +415,7 @@ int epicsShareAPI ca_add_exception_event ( caExceptionHandler *pfunc, void *arg
/*
* ca_add_masked_array_event
*/
-int epicsShareAPI ca_add_masked_array_event (
+int epicsStdCall ca_add_masked_array_event (
chtype type, arrayElementCount count, chid pChan,
caEventCallBackFunc *pCallBack, void *pCallBackArg,
ca_real, ca_real, ca_real,
@@ -430,19 +428,19 @@ int epicsShareAPI ca_add_masked_array_event (
/*
* ca_clear_event ()
*/
-int epicsShareAPI ca_clear_event ( evid pMon )
+int epicsStdCall ca_clear_event ( evid pMon )
{
return ca_clear_subscription ( pMon );
}
// extern "C"
-chid epicsShareAPI ca_evid_to_chid ( evid pMon )
+chid epicsStdCall ca_evid_to_chid ( evid pMon )
{
return & pMon->channel ();
}
// extern "C"
-int epicsShareAPI ca_pend ( ca_real timeout, int early )
+int epicsStdCall ca_pend ( ca_real timeout, int early )
{
if ( early ) {
return ca_pend_io ( timeout );
@@ -456,7 +454,7 @@ int epicsShareAPI ca_pend ( ca_real timeout, int early )
* ca_pend_event ()
*/
// extern "C"
-int epicsShareAPI ca_pend_event ( ca_real timeout )
+int epicsStdCall ca_pend_event ( ca_real timeout )
{
ca_client_context *pcac;
int status = fetchClientContext ( &pcac );
@@ -467,7 +465,7 @@ int epicsShareAPI ca_pend_event ( ca_real timeout )
try {
// preserve past odd ball behavior of waiting forever when
// the delay is zero
- if ( timeout == 0.0 ) {
+ if ( timeout == 0.0 ) {
while ( true ) {
pcac->pendEvent ( 60.0 );
}
@@ -483,7 +481,7 @@ int epicsShareAPI ca_pend_event ( ca_real timeout )
* ca_pend_io ()
*/
// extern "C"
-int epicsShareAPI ca_pend_io ( ca_real timeout )
+int epicsStdCall ca_pend_io ( ca_real timeout )
{
ca_client_context *pcac;
int status = fetchClientContext ( &pcac );
@@ -508,7 +506,7 @@ int epicsShareAPI ca_pend_io ( ca_real timeout )
/*
* ca_flush_io ()
*/
-int epicsShareAPI ca_flush_io ()
+int epicsStdCall ca_flush_io ()
{
ca_client_context * pcac;
int caStatus = fetchClientContext (&pcac);
@@ -525,7 +523,7 @@ int epicsShareAPI ca_flush_io ()
/*
* CA_TEST_IO ()
*/
-int epicsShareAPI ca_test_io ()
+int epicsStdCall ca_test_io ()
{
ca_client_context *pcac;
int caStatus = fetchClientContext ( &pcac );
@@ -545,7 +543,7 @@ int epicsShareAPI ca_test_io ()
* CA_SIGNAL()
*/
// extern "C"
-void epicsShareAPI ca_signal ( long ca_status, const char *message )
+void epicsStdCall ca_signal ( long ca_status, const char *message )
{
ca_signal_with_file_and_lineno ( ca_status, message, NULL, 0 );
}
@@ -560,7 +558,7 @@ void epicsShareAPI ca_signal ( long ca_status, const char *message )
* (if they call this routine again).
*/
// extern "C"
-const char * epicsShareAPI ca_message ( long ca_status )
+const char * epicsStdCall ca_message ( long ca_status )
{
unsigned msgNo = CA_EXTRACT_MSG_NO ( ca_status );
@@ -576,7 +574,7 @@ const char * epicsShareAPI ca_message ( long ca_status )
* ca_signal_with_file_and_lineno()
*/
// extern "C"
-void epicsShareAPI ca_signal_with_file_and_lineno ( long ca_status,
+void epicsStdCall ca_signal_with_file_and_lineno ( long ca_status,
const char *message, const char *pfilenm, int lineno )
{
ca_signal_formated ( ca_status, pfilenm, lineno, message );
@@ -586,7 +584,7 @@ void epicsShareAPI ca_signal_with_file_and_lineno ( long ca_status,
* ca_signal_formated()
*/
// extern "C"
-void epicsShareAPI ca_signal_formated ( long ca_status, const char *pfilenm,
+void epicsStdCall ca_signal_formated ( long ca_status, const char *pfilenm,
int lineno, const char *pFormat, ... )
{
ca_client_context *pcac;
@@ -622,7 +620,7 @@ void epicsShareAPI ca_signal_formated ( long ca_status, const char *pfilenm,
*
*/
// extern "C"
-int epicsShareAPI ca_add_fd_registration ( CAFDHANDLER * func, void * arg )
+int epicsStdCall ca_add_fd_registration ( CAFDHANDLER * func, void * arg )
{
ca_client_context *pcac;
int caStatus = fetchClientContext ( &pcac );
@@ -640,7 +638,7 @@ int epicsShareAPI ca_add_fd_registration ( CAFDHANDLER * func, void * arg )
* function that returns the CA version string
*/
// extern "C"
-const char * epicsShareAPI ca_version ()
+const char * epicsStdCall ca_version ()
{
return CA_VERSION_STRING ( CA_MINOR_PROTOCOL_REVISION );
}
@@ -649,7 +647,7 @@ const char * epicsShareAPI ca_version ()
* ca_replace_printf_handler ()
*/
// extern "C"
-int epicsShareAPI ca_replace_printf_handler ( caPrintfFunc *ca_printf_func )
+int epicsStdCall ca_replace_printf_handler ( caPrintfFunc *ca_printf_func )
{
ca_client_context *pcac;
int caStatus = fetchClientContext (&pcac);
@@ -669,7 +667,7 @@ int epicsShareAPI ca_replace_printf_handler ( caPrintfFunc *ca_printf_func )
* (for testing purposes only)
*/
// extern "C"
-unsigned epicsShareAPI ca_get_ioc_connection_count ()
+unsigned epicsStdCall ca_get_ioc_connection_count ()
{
ca_client_context * pcac;
int caStatus = fetchClientContext ( & pcac );
@@ -680,7 +678,7 @@ unsigned epicsShareAPI ca_get_ioc_connection_count ()
return pcac->circuitCount ();
}
-unsigned epicsShareAPI ca_beacon_anomaly_count ()
+unsigned epicsStdCall ca_beacon_anomaly_count ()
{
ca_client_context * pcac;
int caStatus = fetchClientContext ( & pcac );
@@ -692,15 +690,15 @@ unsigned epicsShareAPI ca_beacon_anomaly_count ()
}
// extern "C"
-int epicsShareAPI ca_channel_status ( epicsThreadId /* tid */ )
+int epicsStdCall ca_channel_status ( epicsThreadId /* tid */ )
{
::printf ("The R3.14 EPICS OS abstraction API does not allow peeking at thread private storage of another thread.\n");
::printf ("Please call \"ca_client_status ( unsigned level )\" from the subsystem specific diagnostic code.\n");
- return ECA_ANACHRONISM;
+ return ECA_ANACHRONISM;
}
// extern "C"
-int epicsShareAPI ca_client_status ( unsigned level )
+int epicsStdCall ca_client_status ( unsigned level )
{
ca_client_context *pcac;
int caStatus = fetchClientContext ( &pcac );
@@ -712,7 +710,7 @@ int epicsShareAPI ca_client_status ( unsigned level )
return ECA_NORMAL;
}
-int epicsShareAPI ca_context_status ( ca_client_context * pcac, unsigned level )
+int epicsStdCall ca_context_status ( ca_client_context * pcac, unsigned level )
{
pcac->show ( level );
return ECA_NORMAL;
@@ -725,7 +723,7 @@ int epicsShareAPI ca_context_status ( ca_client_context * pcac, unsigned level )
* by another thread
*/
// extern "C"
-struct ca_client_context * epicsShareAPI ca_current_context ()
+struct ca_client_context * epicsStdCall ca_current_context ()
{
struct ca_client_context *pCtx;
if ( caClientContextId ) {
@@ -745,7 +743,7 @@ struct ca_client_context * epicsShareAPI ca_current_context ()
* by another thread
*/
// extern "C"
-int epicsShareAPI ca_attach_context ( struct ca_client_context * pCtx )
+int epicsStdCall ca_attach_context ( struct ca_client_context * pCtx )
{
ca_client_context *pcac = (ca_client_context *) epicsThreadPrivateGet ( caClientContextId );
if ( pcac && pCtx != 0 ) {
@@ -758,14 +756,14 @@ int epicsShareAPI ca_attach_context ( struct ca_client_context * pCtx )
return ECA_NORMAL;
}
-void epicsShareAPI ca_detach_context ()
+void epicsStdCall ca_detach_context ()
{
if ( caClientContextId ) {
epicsThreadPrivateSet ( caClientContextId, 0 );
}
}
-int epicsShareAPI ca_preemtive_callback_is_enabled ()
+int epicsStdCall ca_preemtive_callback_is_enabled ()
{
ca_client_context *pcac = (ca_client_context *) epicsThreadPrivateGet ( caClientContextId );
if ( ! pcac ) {
@@ -776,7 +774,7 @@ int epicsShareAPI ca_preemtive_callback_is_enabled ()
// extern "C"
-void epicsShareAPI ca_self_test ()
+void epicsStdCall ca_self_test ()
{
ca_client_context *pcac = (ca_client_context *) epicsThreadPrivateGet ( caClientContextId );
if ( ! pcac ) {
@@ -785,8 +783,7 @@ void epicsShareAPI ca_self_test ()
pcac->selfTest ();
}
-// extern "C"
-epicsShareDef const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
+const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
DBR_SHORT, /* forces conversion fronm uint8 to int16 */
DBR_CHAR,
DBR_SHORT,
@@ -800,265 +797,257 @@ epicsShareDef const int epicsTypeToDBR_XXXX [lastEpicsType+1] = {
DBR_STRING
};
-// extern "C"
-epicsShareDef const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] = {
- epicsOldStringT,
- epicsInt16T,
- epicsFloat32T,
- epicsEnum16T,
- epicsUInt8T,
- epicsInt32T,
- epicsFloat64T,
+const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1] = {
+ epicsOldStringT,
+ epicsInt16T,
+ epicsFloat32T,
+ epicsEnum16T,
+ epicsUInt8T,
+ epicsInt32T,
+ epicsFloat64T,
- epicsOldStringT,
- epicsInt16T,
- epicsFloat32T,
- epicsEnum16T,
- epicsUInt8T,
- epicsInt32T,
- epicsFloat64T,
+ epicsOldStringT,
+ epicsInt16T,
+ epicsFloat32T,
+ epicsEnum16T,
+ epicsUInt8T,
+ epicsInt32T,
+ epicsFloat64T,
- epicsOldStringT,
- epicsInt16T,
- epicsFloat32T,
- epicsEnum16T,
- epicsUInt8T,
- epicsInt32T,
- epicsFloat64T,
+ epicsOldStringT,
+ epicsInt16T,
+ epicsFloat32T,
+ epicsEnum16T,
+ epicsUInt8T,
+ epicsInt32T,
+ epicsFloat64T,
- epicsOldStringT,
- epicsInt16T,
- epicsFloat32T,
- epicsEnum16T,
- epicsUInt8T,
- epicsInt32T,
- epicsFloat64T,
+ epicsOldStringT,
+ epicsInt16T,
+ epicsFloat32T,
+ epicsEnum16T,
+ epicsUInt8T,
+ epicsInt32T,
+ epicsFloat64T,
- epicsOldStringT,
- epicsInt16T,
- epicsFloat32T,
- epicsEnum16T,
- epicsUInt8T,
- epicsInt32T,
- epicsFloat64T,
+ epicsOldStringT,
+ epicsInt16T,
+ epicsFloat32T,
+ epicsEnum16T,
+ epicsUInt8T,
+ epicsInt32T,
+ epicsFloat64T,
- epicsUInt16T,
- epicsUInt16T,
- epicsOldStringT,
- epicsOldStringT
+ epicsUInt16T,
+ epicsUInt16T,
+ epicsOldStringT,
+ epicsOldStringT
};
-// extern "C"
-epicsShareDef const unsigned short dbr_size[LAST_BUFFER_TYPE+1] = {
- sizeof(dbr_string_t), /* string max size */
- sizeof(dbr_short_t), /* short */
- sizeof(dbr_float_t), /* IEEE Float */
- sizeof(dbr_enum_t), /* item number */
- sizeof(dbr_char_t), /* character */
+const unsigned short dbr_size[LAST_BUFFER_TYPE+1] = {
+ sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_short_t), /* short */
+ sizeof(dbr_float_t), /* IEEE Float */
+ sizeof(dbr_enum_t), /* item number */
+ sizeof(dbr_char_t), /* character */
- sizeof(dbr_long_t), /* long */
- sizeof(dbr_double_t), /* double */
- sizeof(struct dbr_sts_string), /* string field with status */
- sizeof(struct dbr_sts_short), /* short field with status */
- sizeof(struct dbr_sts_float), /* float field with status */
+ sizeof(dbr_long_t), /* long */
+ sizeof(dbr_double_t), /* double */
+ sizeof(struct dbr_sts_string), /* string field with status */
+ sizeof(struct dbr_sts_short), /* short field with status */
+ sizeof(struct dbr_sts_float), /* float field with status */
- sizeof(struct dbr_sts_enum), /* item number with status */
- sizeof(struct dbr_sts_char), /* char field with status */
- sizeof(struct dbr_sts_long), /* long field with status */
- sizeof(struct dbr_sts_double), /* double field with time */
- sizeof(struct dbr_time_string), /* string field with time */
+ sizeof(struct dbr_sts_enum), /* item number with status */
+ sizeof(struct dbr_sts_char), /* char field with status */
+ sizeof(struct dbr_sts_long), /* long field with status */
+ sizeof(struct dbr_sts_double), /* double field with time */
+ sizeof(struct dbr_time_string), /* string field with time */
- sizeof(struct dbr_time_short), /* short field with time */
- sizeof(struct dbr_time_float), /* float field with time */
- sizeof(struct dbr_time_enum), /* item number with time */
- sizeof(struct dbr_time_char), /* char field with time */
- sizeof(struct dbr_time_long), /* long field with time */
+ sizeof(struct dbr_time_short), /* short field with time */
+ sizeof(struct dbr_time_float), /* float field with time */
+ sizeof(struct dbr_time_enum), /* item number with time */
+ sizeof(struct dbr_time_char), /* char field with time */
+ sizeof(struct dbr_time_long), /* long field with time */
- sizeof(struct dbr_time_double), /* double field with time */
- sizeof(struct dbr_sts_string), /* graphic string info */
- sizeof(struct dbr_gr_short), /* graphic short info */
- sizeof(struct dbr_gr_float), /* graphic float info */
- sizeof(struct dbr_gr_enum), /* graphic item info */
+ sizeof(struct dbr_time_double), /* double field with time */
+ sizeof(struct dbr_sts_string), /* graphic string info */
+ sizeof(struct dbr_gr_short), /* graphic short info */
+ sizeof(struct dbr_gr_float), /* graphic float info */
+ sizeof(struct dbr_gr_enum), /* graphic item info */
- sizeof(struct dbr_gr_char), /* graphic char info */
- sizeof(struct dbr_gr_long), /* graphic long info */
- sizeof(struct dbr_gr_double), /* graphic double info */
- sizeof(struct dbr_sts_string), /* control string info */
- sizeof(struct dbr_ctrl_short), /* control short info */
+ sizeof(struct dbr_gr_char), /* graphic char info */
+ sizeof(struct dbr_gr_long), /* graphic long info */
+ sizeof(struct dbr_gr_double), /* graphic double info */
+ sizeof(struct dbr_sts_string), /* control string info */
+ sizeof(struct dbr_ctrl_short), /* control short info */
- sizeof(struct dbr_ctrl_float), /* control float info */
- sizeof(struct dbr_ctrl_enum), /* control item info */
- sizeof(struct dbr_ctrl_char), /* control char info */
- sizeof(struct dbr_ctrl_long), /* control long info */
- sizeof(struct dbr_ctrl_double), /* control double info */
+ sizeof(struct dbr_ctrl_float), /* control float info */
+ sizeof(struct dbr_ctrl_enum), /* control item info */
+ sizeof(struct dbr_ctrl_char), /* control char info */
+ sizeof(struct dbr_ctrl_long), /* control long info */
+ sizeof(struct dbr_ctrl_double), /* control double info */
- sizeof(dbr_put_ackt_t), /* put ackt */
- sizeof(dbr_put_acks_t), /* put acks */
- sizeof(struct dbr_stsack_string),/* string field with status/ack*/
- sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_put_ackt_t), /* put ackt */
+ sizeof(dbr_put_acks_t), /* put acks */
+ sizeof(struct dbr_stsack_string),/* string field with status/ack*/
+ sizeof(dbr_string_t), /* string max size */
};
-// extern "C"
-epicsShareDef const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = {
- sizeof(dbr_string_t), /* string max size */
- sizeof(dbr_short_t), /* short */
- sizeof(dbr_float_t), /* IEEE Float */
- sizeof(dbr_enum_t), /* item number */
- sizeof(dbr_char_t), /* character */
+const unsigned short dbr_value_size[LAST_BUFFER_TYPE+1] = {
+ sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_short_t), /* short */
+ sizeof(dbr_float_t), /* IEEE Float */
+ sizeof(dbr_enum_t), /* item number */
+ sizeof(dbr_char_t), /* character */
- sizeof(dbr_long_t), /* long */
- sizeof(dbr_double_t), /* double */
- sizeof(dbr_string_t), /* string max size */
- sizeof(dbr_short_t), /* short */
- sizeof(dbr_float_t), /* IEEE Float */
+ sizeof(dbr_long_t), /* long */
+ sizeof(dbr_double_t), /* double */
+ sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_short_t), /* short */
+ sizeof(dbr_float_t), /* IEEE Float */
- sizeof(dbr_enum_t), /* item number */
- sizeof(dbr_char_t), /* character */
- sizeof(dbr_long_t), /* long */
- sizeof(dbr_double_t), /* double */
- sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_enum_t), /* item number */
+ sizeof(dbr_char_t), /* character */
+ sizeof(dbr_long_t), /* long */
+ sizeof(dbr_double_t), /* double */
+ sizeof(dbr_string_t), /* string max size */
- sizeof(dbr_short_t), /* short */
- sizeof(dbr_float_t), /* IEEE Float */
- sizeof(dbr_enum_t), /* item number */
- sizeof(dbr_char_t), /* character */
- sizeof(dbr_long_t), /* long */
+ sizeof(dbr_short_t), /* short */
+ sizeof(dbr_float_t), /* IEEE Float */
+ sizeof(dbr_enum_t), /* item number */
+ sizeof(dbr_char_t), /* character */
+ sizeof(dbr_long_t), /* long */
- sizeof(dbr_double_t), /* double */
- sizeof(dbr_string_t), /* string max size */
- sizeof(dbr_short_t), /* short */
- sizeof(dbr_float_t), /* IEEE Float */
- sizeof(dbr_enum_t), /* item number */
+ sizeof(dbr_double_t), /* double */
+ sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_short_t), /* short */
+ sizeof(dbr_float_t), /* IEEE Float */
+ sizeof(dbr_enum_t), /* item number */
- sizeof(dbr_char_t), /* character */
- sizeof(dbr_long_t), /* long */
- sizeof(dbr_double_t), /* double */
- sizeof(dbr_string_t), /* string max size */
- sizeof(dbr_short_t), /* short */
+ sizeof(dbr_char_t), /* character */
+ sizeof(dbr_long_t), /* long */
+ sizeof(dbr_double_t), /* double */
+ sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_short_t), /* short */
- sizeof(dbr_float_t), /* IEEE Float */
- sizeof(dbr_enum_t), /* item number */
- sizeof(dbr_char_t), /* character */
- sizeof(dbr_long_t), /* long */
- sizeof(dbr_double_t), /* double */
+ sizeof(dbr_float_t), /* IEEE Float */
+ sizeof(dbr_enum_t), /* item number */
+ sizeof(dbr_char_t), /* character */
+ sizeof(dbr_long_t), /* long */
+ sizeof(dbr_double_t), /* double */
- sizeof(dbr_ushort_t), /* put_ackt */
- sizeof(dbr_ushort_t), /* put_acks */
- sizeof(dbr_string_t), /* string max size */
- sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_ushort_t), /* put_ackt */
+ sizeof(dbr_ushort_t), /* put_acks */
+ sizeof(dbr_string_t), /* string max size */
+ sizeof(dbr_string_t), /* string max size */
};
//extern "C"
-epicsShareDef const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1] = {
- dbr_class_string, /* string max size */
- dbr_class_int, /* short */
- dbr_class_float, /* IEEE Float */
- dbr_class_int, /* item number */
- dbr_class_int, /* character */
- dbr_class_int, /* long */
- dbr_class_float, /* double */
+const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1] = {
+ dbr_class_string, /* string max size */
+ dbr_class_int, /* short */
+ dbr_class_float, /* IEEE Float */
+ dbr_class_int, /* item number */
+ dbr_class_int, /* character */
+ dbr_class_int, /* long */
+ dbr_class_float, /* double */
- dbr_class_string, /* string max size */
- dbr_class_int, /* short */
- dbr_class_float, /* IEEE Float */
- dbr_class_int, /* item number */
- dbr_class_int, /* character */
- dbr_class_int, /* long */
- dbr_class_float, /* double */
+ dbr_class_string, /* string max size */
+ dbr_class_int, /* short */
+ dbr_class_float, /* IEEE Float */
+ dbr_class_int, /* item number */
+ dbr_class_int, /* character */
+ dbr_class_int, /* long */
+ dbr_class_float, /* double */
- dbr_class_string, /* string max size */
- dbr_class_int, /* short */
- dbr_class_float, /* IEEE Float */
- dbr_class_int, /* item number */
- dbr_class_int, /* character */
- dbr_class_int, /* long */
- dbr_class_float, /* double */
+ dbr_class_string, /* string max size */
+ dbr_class_int, /* short */
+ dbr_class_float, /* IEEE Float */
+ dbr_class_int, /* item number */
+ dbr_class_int, /* character */
+ dbr_class_int, /* long */
+ dbr_class_float, /* double */
- dbr_class_string, /* string max size */
- dbr_class_int, /* short */
- dbr_class_float, /* IEEE Float */
- dbr_class_int, /* item number */
- dbr_class_int, /* character */
- dbr_class_int, /* long */
- dbr_class_float, /* double */
+ dbr_class_string, /* string max size */
+ dbr_class_int, /* short */
+ dbr_class_float, /* IEEE Float */
+ dbr_class_int, /* item number */
+ dbr_class_int, /* character */
+ dbr_class_int, /* long */
+ dbr_class_float, /* double */
- dbr_class_string, /* string max size */
- dbr_class_int, /* short */
- dbr_class_float, /* IEEE Float */
- dbr_class_int, /* item number */
- dbr_class_int, /* character */
- dbr_class_int, /* long */
- dbr_class_float, /* double */
- dbr_class_int,
- dbr_class_int,
- dbr_class_string,
- dbr_class_string, /* string max size */
+ dbr_class_string, /* string max size */
+ dbr_class_int, /* short */
+ dbr_class_float, /* IEEE Float */
+ dbr_class_int, /* item number */
+ dbr_class_int, /* character */
+ dbr_class_int, /* long */
+ dbr_class_float, /* double */
+ dbr_class_int,
+ dbr_class_int,
+ dbr_class_string,
+ dbr_class_string, /* string max size */
};
-// extern "C"
-epicsShareDef const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1] = {
- 0, /* string */
- 0, /* short */
- 0, /* IEEE Float */
- 0, /* item number */
- 0, /* character */
- 0, /* long */
- 0, /* IEEE double */
- (unsigned short) offsetof(dbr_sts_string,value[0]),/* string field with status */
- (unsigned short) offsetof(dbr_sts_short,value), /* short field with status */
- (unsigned short) offsetof(dbr_sts_float,value), /* float field with status */
- (unsigned short) offsetof(dbr_sts_enum,value), /* item number with status */
- (unsigned short) offsetof(dbr_sts_char,value), /* char field with status */
- (unsigned short) offsetof(dbr_sts_long,value), /* long field with status */
- (unsigned short) offsetof(dbr_sts_double,value), /* double field with time */
- (unsigned short) offsetof(dbr_time_string,value[0] ),/* string field with time */
- (unsigned short) offsetof(dbr_time_short,value), /* short field with time */
- (unsigned short) offsetof(dbr_time_float,value), /* float field with time */
- (unsigned short) offsetof(dbr_time_enum,value), /* item number with time */
- (unsigned short) offsetof(dbr_time_char,value), /* char field with time */
- (unsigned short) offsetof(dbr_time_long,value), /* long field with time */
- (unsigned short) offsetof(dbr_time_double,value), /* double field with time */
- (unsigned short) offsetof(dbr_sts_string,value[0]),/* graphic string info */
- (unsigned short) offsetof(dbr_gr_short,value), /* graphic short info */
- (unsigned short) offsetof(dbr_gr_float,value), /* graphic float info */
- (unsigned short) offsetof(dbr_gr_enum,value), /* graphic item info */
- (unsigned short) offsetof(dbr_gr_char,value), /* graphic char info */
- (unsigned short) offsetof(dbr_gr_long,value), /* graphic long info */
- (unsigned short) offsetof(dbr_gr_double,value), /* graphic double info */
- (unsigned short) offsetof(dbr_sts_string,value[0]),/* control string info */
- (unsigned short) offsetof(dbr_ctrl_short,value), /* control short info */
- (unsigned short) offsetof(dbr_ctrl_float,value), /* control float info */
- (unsigned short) offsetof(dbr_ctrl_enum,value), /* control item info */
- (unsigned short) offsetof(dbr_ctrl_char,value), /* control char info */
- (unsigned short) offsetof(dbr_ctrl_long,value), /* control long info */
- (unsigned short) offsetof(dbr_ctrl_double,value), /* control double info */
- 0, /* put ackt */
- 0, /* put acks */
- (unsigned short) offsetof(dbr_stsack_string,value[0]),/* string field with status */
- 0, /* string */
+const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1] = {
+ 0, /* string */
+ 0, /* short */
+ 0, /* IEEE Float */
+ 0, /* item number */
+ 0, /* character */
+ 0, /* long */
+ 0, /* IEEE double */
+ (unsigned short) offsetof(dbr_sts_string,value[0]), /* string field with status */
+ (unsigned short) offsetof(dbr_sts_short,value), /* short field with status */
+ (unsigned short) offsetof(dbr_sts_float,value), /* float field with status */
+ (unsigned short) offsetof(dbr_sts_enum,value), /* item number with status */
+ (unsigned short) offsetof(dbr_sts_char,value), /* char field with status */
+ (unsigned short) offsetof(dbr_sts_long,value), /* long field with status */
+ (unsigned short) offsetof(dbr_sts_double,value), /* double field with time */
+ (unsigned short) offsetof(dbr_time_string,value[0] ), /* string field with time */
+ (unsigned short) offsetof(dbr_time_short,value), /* short field with time */
+ (unsigned short) offsetof(dbr_time_float,value), /* float field with time */
+ (unsigned short) offsetof(dbr_time_enum,value), /* item number with time */
+ (unsigned short) offsetof(dbr_time_char,value), /* char field with time */
+ (unsigned short) offsetof(dbr_time_long,value), /* long field with time */
+ (unsigned short) offsetof(dbr_time_double,value), /* double field with time */
+ (unsigned short) offsetof(dbr_sts_string,value[0]), /* graphic string info */
+ (unsigned short) offsetof(dbr_gr_short,value), /* graphic short info */
+ (unsigned short) offsetof(dbr_gr_float,value), /* graphic float info */
+ (unsigned short) offsetof(dbr_gr_enum,value), /* graphic item info */
+ (unsigned short) offsetof(dbr_gr_char,value), /* graphic char info */
+ (unsigned short) offsetof(dbr_gr_long,value), /* graphic long info */
+ (unsigned short) offsetof(dbr_gr_double,value), /* graphic double info */
+ (unsigned short) offsetof(dbr_sts_string,value[0]), /* control string info */
+ (unsigned short) offsetof(dbr_ctrl_short,value), /* control short info */
+ (unsigned short) offsetof(dbr_ctrl_float,value), /* control float info */
+ (unsigned short) offsetof(dbr_ctrl_enum,value), /* control item info */
+ (unsigned short) offsetof(dbr_ctrl_char,value), /* control char info */
+ (unsigned short) offsetof(dbr_ctrl_long,value), /* control long info */
+ (unsigned short) offsetof(dbr_ctrl_double,value), /* control double info */
+ 0, /* put ackt */
+ 0, /* put acks */
+ (unsigned short) offsetof(dbr_stsack_string,value[0]), /* string field with status */
+ 0, /* string */
};
-// extern "C"
-epicsShareDef const char *dbf_text[LAST_TYPE+3] = {
- "TYPENOTCONN",
- "DBF_STRING",
- "DBF_SHORT",
- "DBF_FLOAT",
- "DBF_ENUM",
- "DBF_CHAR",
- "DBF_LONG",
- "DBF_DOUBLE",
- "DBF_NO_ACCESS"
+const char *dbf_text[LAST_TYPE+3] = {
+ "TYPENOTCONN",
+ "DBF_STRING",
+ "DBF_SHORT",
+ "DBF_FLOAT",
+ "DBF_ENUM",
+ "DBF_CHAR",
+ "DBF_LONG",
+ "DBF_DOUBLE",
+ "DBF_NO_ACCESS"
};
-// extern "C"
-epicsShareDef const char *dbf_text_invalid = "DBF_invalid";
+const char *dbf_text_invalid = "DBF_invalid";
-// extern "C"
-epicsShareDef const short dbf_text_dim = (sizeof dbf_text)/(sizeof (char *));
+const short dbf_text_dim = (sizeof dbf_text)/(sizeof (char *));
-// extern "C"
-epicsShareDef const char *dbr_text[LAST_BUFFER_TYPE+1] = {
+const char *dbr_text[LAST_BUFFER_TYPE+1] = {
"DBR_STRING",
"DBR_SHORT",
"DBR_FLOAT",
@@ -1100,8 +1089,6 @@ epicsShareDef const char *dbr_text[LAST_BUFFER_TYPE+1] = {
"DBR_CLASS_NAME"
};
-// extern "C"
-epicsShareDef const char *dbr_text_invalid = "DBR_invalid";
+const char *dbr_text_invalid = "DBR_invalid";
-// extern "C"
-epicsShareDef const short dbr_text_dim = (sizeof dbr_text) / (sizeof (char *)) + 1;
+const short dbr_text_dim = (sizeof dbr_text) / (sizeof (char *)) + 1;
diff --git a/modules/ca/src/client/acctst.c b/modules/ca/src/client/acctst.c
index fd18ae4b1..9f3e90714 100644
--- a/modules/ca/src/client/acctst.c
+++ b/modules/ca/src/client/acctst.c
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -14,7 +14,7 @@
* Jeff Hill
* Murali Shankar - initial versions of verifyMultithreadSubscr
* Michael Abbott - initial versions of multiSubscrDestroyNoLateCallbackTest
- *
+ *
*/
/*
@@ -110,7 +110,7 @@ void nUpdatesTester ( struct event_handler_args args )
( *pCtr ) ++;
}
else {
- printf ( "subscription update failed for \"%s\" because \"%s\"",
+ printf ( "subscription update failed for \"%s\" because \"%s\"",
ca_name ( args.chid ), ca_message ( args.status ) );
}
}
@@ -131,7 +131,7 @@ void monitorSubscriptionFirstUpdateTest ( const char *pName, chid chan, unsigned
* verify that the first event arrives (with evid)
* and channel connected
*/
- status = ca_add_event ( DBR_FLOAT,
+ status = ca_add_event ( DBR_FLOAT,
chan, nUpdatesTester, &eventCount, &id );
SEVCHK ( status, 0 );
ca_flush_io ();
@@ -190,7 +190,7 @@ void monitorSubscriptionFirstUpdateTest ( const char *pName, chid chan, unsigned
waitCount = 0u;
status = ca_search ( pName, &chan2 );
SEVCHK ( status, 0 );
- status = ca_add_event ( DBR_FLOAT, chan2,
+ status = ca_add_event ( DBR_FLOAT, chan2,
nUpdatesTester, &eventCount, 0 );
SEVCHK ( status, 0 );
status = ca_pend_io ( timeoutToPendIO );
@@ -250,7 +250,7 @@ void ioTesterGet ( struct event_handler_args args )
( *pCtr ) ++;
}
else {
- printf("get call back failed for \"%s\" because \"%s\"",
+ printf("get call back failed for \"%s\" because \"%s\"",
ca_name ( args.chid ), ca_message ( args.status ) );
}
}
@@ -263,7 +263,7 @@ void ioTesterEvent ( struct event_handler_args args )
SEVCHK ( status, 0 );
}
else {
- printf ( "subscription update failed for \"%s\" because \"%s\"",
+ printf ( "subscription update failed for \"%s\" because \"%s\"",
ca_name ( args.chid ), ca_message ( args.status ) );
}
}
@@ -280,7 +280,7 @@ void verifyMonitorSubscriptionFlushIO ( chid chan, unsigned interestLevel )
/*
* verify that the first event arrives
*/
- status = ca_add_event ( DBR_FLOAT,
+ status = ca_add_event ( DBR_FLOAT,
chan, nUpdatesTester, &eventCount, &id );
SEVCHK (status, 0);
ca_flush_io ();
@@ -317,8 +317,8 @@ void getCallbackStateChange ( struct event_handler_args args )
verify ( pChan->channel == args.chid );
verify ( pChan->connected );
if ( args.status != ECA_NORMAL ) {
- printf ( "getCallbackStateChange abnormal status was \"%s\"\n",
- ca_message ( args.status ) );
+ printf ( "getCallbackStateChange abnormal status was \"%s\"\n",
+ ca_message ( args.status ) );
verify ( args.status == ECA_NORMAL );
}
@@ -373,7 +373,7 @@ void subscriptionStateChange ( struct event_handler_args args )
void noopSubscriptionStateChange ( struct event_handler_args args )
{
if ( args.status != ECA_NORMAL ) {
- printf ( "noopSubscriptionStateChange: subscription update failed for \"%s\" because \"%s\"",
+ printf ( "noopSubscriptionStateChange: subscription update failed for \"%s\" because \"%s\"",
ca_name ( args.chid ), ca_message ( args.status ) );
}
}
@@ -396,7 +396,7 @@ void noopSubscriptionStateChange ( struct event_handler_args args )
*
* 7) verify that a nill access rights handler can be installed
*/
-void verifyConnectionHandlerConnect ( appChan *pChans, unsigned chanCount,
+void verifyConnectionHandlerConnect ( appChan *pChans, unsigned chanCount,
unsigned repetitionCount, unsigned interestLevel )
{
int status;
@@ -439,7 +439,7 @@ void verifyConnectionHandlerConnect ( appChan *pChans, unsigned chanCount,
showProgress ( interestLevel );
- while ( connectionUpdateCount < chanCount ||
+ while ( connectionUpdateCount < chanCount ||
getCallbackCount < chanCount ) {
epicsThreadSleep ( 0.1 );
ca_poll (); /* emulate typical GUI */
@@ -471,7 +471,7 @@ void verifyConnectionHandlerConnect ( appChan *pChans, unsigned chanCount,
ca_self_test ();
showProgress ( interestLevel );
-
+
for ( j = 0u; j < chanCount; j++ ) {
status = ca_replace_access_rights_event (
pChans[j].channel, 0 );
@@ -494,7 +494,7 @@ void verifyConnectionHandlerConnect ( appChan *pChans, unsigned chanCount,
/*
* verifyBlockingConnect ()
*
- * 1) verify that we dont print a disconnect message when
+ * 1) verify that we dont print a disconnect message when
* we delete the last channel
*
* 2) verify that we delete the connection to the IOC
@@ -502,7 +502,7 @@ void verifyConnectionHandlerConnect ( appChan *pChans, unsigned chanCount,
*
* 3) verify channel connection state variables
*
- * 4) verify ca_test_io () and ca_pend_io () work with
+ * 4) verify ca_test_io () and ca_pend_io () work with
* channels w/o connection handlers
*
* 5) verify that the pending IO count is properly
@@ -512,7 +512,7 @@ void verifyConnectionHandlerConnect ( appChan *pChans, unsigned chanCount,
* 6) verify that the pending IO count goes to zero
* if the channel is deleted before it connects.
*/
-void verifyBlockingConnect ( appChan *pChans, unsigned chanCount,
+void verifyBlockingConnect ( appChan *pChans, unsigned chanCount,
unsigned repetitionCount, unsigned interestLevel )
{
int status;
@@ -551,7 +551,7 @@ void verifyBlockingConnect ( appChan *pChans, unsigned chanCount,
verify ( INVALID_DB_REQ ( ca_field_type ( pChans[j].channel ) ) );
verify ( ca_test_io () == ECA_IOINPROGRESS );
}
-
+
status = ca_replace_access_rights_event (
pChans[j].channel, accessRightsStateChange );
SEVCHK ( status, NULL );
@@ -605,7 +605,7 @@ void verifyBlockingConnect ( appChan *pChans, unsigned chanCount,
showProgress ( interestLevel );
/*
- * verify that connections to IOC's that are
+ * verify that connections to IOC's that are
* not in use are dropped
*/
if ( ca_get_ioc_connection_count () != backgroundConnCount ) {
@@ -698,13 +698,13 @@ void verifyClear ( appChan *pChans, unsigned interestLevel )
/*
* verify subscription clear before connect
- * and verify that NULL evid does not cause failure
+ * and verify that NULL evid does not cause failure
*/
status = ca_search ( pChans[0].name, &pChans[0].channel );
SEVCHK ( status, NULL );
SEVCHK ( status, NULL );
- status = ca_add_event ( DBR_GR_DOUBLE,
+ status = ca_add_event ( DBR_GR_DOUBLE,
pChans[0].channel, noopSubscriptionStateChange, NULL, NULL );
SEVCHK ( status, NULL );
@@ -791,7 +791,7 @@ void ctrlDoubleTest ( chid chan, unsigned interestLevel )
SEVCHK (status, "ctrlDoubleTest, ca_array_put");
size = dbr_size_n(DBR_CTRL_DOUBLE, ca_element_count(chan));
- pCtrlDbl = (struct dbr_ctrl_double *) malloc (size);
+ pCtrlDbl = (struct dbr_ctrl_double *) malloc (size);
verify (pCtrlDbl!=NULL);
/*
@@ -846,7 +846,7 @@ void verifyBlockInPendIO ( chid chan, unsigned interestLevel )
else if ( resp != -100 ) {
printf ( "CA didnt block for get to return?\n" );
}
-
+
req = 1;
resp = -100;
SEVCHK ( ca_put (DBR_LONG, chan, &req), NULL );
@@ -898,7 +898,7 @@ void floatTest ( chid chan, dbr_float_t beginValue, dbr_float_t increment,
/*
* doubleTest ()
*/
-void doubleTest ( chid chan, dbr_double_t beginValue,
+void doubleTest ( chid chan, dbr_double_t beginValue,
dbr_double_t increment, dbr_double_t epsilon,
unsigned iterations)
{
@@ -929,7 +929,7 @@ void doubleTest ( chid chan, dbr_double_t beginValue,
* Verify that we can write and then read back
* the same analog value
*/
-void verifyAnalogIO ( chid chan, int dataType, double min, double max,
+void verifyAnalogIO ( chid chan, int dataType, double min, double max,
int minExp, int maxExp, double epsilon, unsigned interestLevel )
{
int i;
@@ -962,11 +962,11 @@ void verifyAnalogIO ( chid chan, int dataType, double min, double max,
iter = 10u;
}
if ( dataType == DBR_FLOAT ) {
- floatTest ( chan, (dbr_float_t) base, (dbr_float_t) incr,
+ floatTest ( chan, (dbr_float_t) base, (dbr_float_t) incr,
(dbr_float_t) epsil, iter );
}
else if (dataType == DBR_DOUBLE ) {
- doubleTest ( chan, (dbr_double_t) base, (dbr_double_t) incr,
+ doubleTest ( chan, (dbr_double_t) base, (dbr_double_t) incr,
(dbr_double_t) epsil, iter );
}
else {
@@ -983,11 +983,11 @@ void verifyAnalogIO ( chid chan, int dataType, double min, double max,
iter = 10u;
}
if ( dataType == DBR_FLOAT ) {
- floatTest ( chan, (dbr_float_t) base, (dbr_float_t) incr,
+ floatTest ( chan, (dbr_float_t) base, (dbr_float_t) incr,
(dbr_float_t) epsil, iter );
}
else if (dataType == DBR_DOUBLE ) {
- doubleTest ( chan, (dbr_double_t) base, (dbr_double_t) incr,
+ doubleTest ( chan, (dbr_double_t) base, (dbr_double_t) incr,
(dbr_double_t) epsil, iter );
}
else {
@@ -1004,11 +1004,11 @@ void verifyAnalogIO ( chid chan, int dataType, double min, double max,
iter = 10l;
}
if ( dataType == DBR_FLOAT ) {
- floatTest ( chan, (dbr_float_t) base, (dbr_float_t) incr,
+ floatTest ( chan, (dbr_float_t) base, (dbr_float_t) incr,
(dbr_float_t) epsil, iter );
}
else if (dataType == DBR_DOUBLE ) {
- doubleTest ( chan, (dbr_double_t) base, (dbr_double_t) incr,
+ doubleTest ( chan, (dbr_double_t) base, (dbr_double_t) incr,
(dbr_double_t) epsil, iter );
}
else {
@@ -1045,7 +1045,7 @@ void verifyLongIO ( chid chan, unsigned interestLevel )
if ( incr == 0 ) {
incr = 1;
}
- for ( iter = cl.lower_ctrl_limit;
+ for ( iter = cl.lower_ctrl_limit;
iter <= cl.upper_ctrl_limit; iter+=incr ) {
ca_put ( DBR_LONG, chan, &iter );
@@ -1089,8 +1089,8 @@ void verifyShortIO ( chid chan, unsigned interestLevel )
if ( incr == 0 ) {
incr = 1;
}
- for ( iter = (dbr_short_t) cl.lower_ctrl_limit;
- iter <= (dbr_short_t) cl.upper_ctrl_limit;
+ for ( iter = (dbr_short_t) cl.lower_ctrl_limit;
+ iter <= (dbr_short_t) cl.upper_ctrl_limit;
iter = (dbr_short_t) (iter + incr) ) {
ca_put ( DBR_SHORT, chan, &iter );
@@ -1131,7 +1131,7 @@ void verifyHighThroughputRead ( chid chan, unsigned interestLevel )
}
}
-void verifyHighThroughputWrite ( chid chan, unsigned interestLevel )
+void verifyHighThroughputWrite ( chid chan, unsigned interestLevel )
{
int status;
unsigned i;
@@ -1155,12 +1155,12 @@ void verifyHighThroughputWrite ( chid chan, unsigned interestLevel )
* verify we dont jam up on many uninterrupted
* get callback requests
*/
-void verifyHighThroughputReadCallback ( chid chan, unsigned interestLevel )
+void verifyHighThroughputReadCallback ( chid chan, unsigned interestLevel )
{
unsigned i;
int status;
- if ( ca_read_access ( chan ) ) {
+ if ( ca_read_access ( chan ) ) {
unsigned count = 0u;
showProgressBegin ( "verifyHighThroughputReadCallback", interestLevel );
for ( i=0; i<10000; i++ ) {
@@ -1203,10 +1203,10 @@ void verifyHighThroughputWriteCallback ( chid chan, unsigned interestLevel )
SEVCHK ( ca_flush_io (), NULL );
dval = 0.0;
status = ca_get ( DBR_DOUBLE, chan, &dval );
- SEVCHK ( status,
+ SEVCHK ( status,
"verifyHighThroughputWriteCallback, verification get" );
status = ca_pend_io ( timeoutToPendIO );
- SEVCHK ( status,
+ SEVCHK ( status,
"verifyHighThroughputWriteCallback, verification get pend" );
verify ( dval == i );
showProgressEnd ( interestLevel );
@@ -1360,9 +1360,9 @@ static void noLateCallbackDetect ( struct event_handler_args args )
verify ( callbackIsOk );
}
-static void multiSubscrDestroyNoLateCallbackThread ( void * pParm )
+static void multiSubscrDestroyNoLateCallbackThread ( void * pParm )
{
- struct MultiSubscrDestroyNoLateCallbackTestData * const pTestData =
+ struct MultiSubscrDestroyNoLateCallbackTestData * const pTestData =
( struct MultiSubscrDestroyNoLateCallbackTestData * ) pParm;
unsigned i, j;
int status;
@@ -1391,10 +1391,10 @@ static void multiSubscrDestroyNoLateCallbackThread ( void * pParm )
SEVCHK ( ca_add_event ( DBR_GR_FLOAT, pTestData->m_chan, noLateCallbackDetect,
&pTestData->m_eventData[j], &pTestData->m_eventData[j].m_id ) , NULL );
}
- SEVCHK ( ca_flush_io(), NULL );
+ SEVCHK ( ca_flush_io(), NULL );
/*
- * raise the priority of the current thread hoping to improve our
+ * raise the priority of the current thread hoping to improve our
* likelyhood of detecting a bug
*/
priorityOfTestThread = epicsThreadGetPrioritySelf ();
@@ -1445,7 +1445,7 @@ static void multiSubscrDestroyNoLateCallbackThread ( void * pParm )
}
/*
- * verify that, in a preemtive callback mode client, a subscription callback never
+ * verify that, in a preemtive callback mode client, a subscription callback never
* comes after the subscription is destroyed
*/
static void multiSubscrDestroyNoLateCallbackTest ( const char *pName, unsigned interestLevel )
@@ -1456,13 +1456,13 @@ static void multiSubscrDestroyNoLateCallbackTest ( const char *pName, unsigned i
pTestData = calloc ( 1u, sizeof ( struct MultiSubscrDestroyNoLateCallbackTestData ) );
verify ( pTestData );
- pTestData->m_mutex = epicsMutexMustCreate ();
+ pTestData->m_mutex = epicsMutexMustCreate ();
pTestData->m_testDoneEvent = epicsEventMustCreate ( epicsEventEmpty );
pTestData->m_pChanName = pName;
pTestData->m_interestLevel = interestLevel;
epicsThreadMustCreate (
"multiSubscrDestroyNoLateCallbackTest",
- epicsThreadPriorityLow,
+ epicsThreadPriorityLow,
epicsThreadGetStackSize ( epicsThreadStackMedium ),
multiSubscrDestroyNoLateCallbackThread,
pTestData );
@@ -1488,7 +1488,7 @@ static void multiSubscrDestroyNoLateCallbackTest ( const char *pName, unsigned i
* 1) verify we can add many monitors at once
* 2) verify that under heavy load the last monitor
* returned is the last modification sent
- * 3) attempt to delete monitors while many monitors
+ * 3) attempt to delete monitors while many monitors
* are running
*/
void multiSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
@@ -1497,7 +1497,7 @@ void multiSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
evid mid[1000];
dbr_float_t temp, getResp;
unsigned i;
-
+
showProgressBegin ( "multiSubscriptionDeleteTest", interestLevel );
for ( i=0; i < NELEMENTS (mid); i++ ) {
@@ -1510,7 +1510,7 @@ void multiSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
* complete
*
* NOTE: this hopefully demonstrates that when the
- * server is very busy with monitors the client
+ * server is very busy with monitors the client
* is still able to punch through with a request.
*/
SEVCHK ( ca_get ( DBR_FLOAT,chan,&getResp ), NULL );
@@ -1521,7 +1521,7 @@ void multiSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
/*
* attempt to generate heavy event traffic before initiating
* the monitor delete
- */
+ */
if ( ca_write_access (chan) ) {
for ( i=0; i < NELEMENTS (mid); i++ ) {
temp = (float) i;
@@ -1532,12 +1532,12 @@ void multiSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
showProgress ( interestLevel );
/*
- * without pausing begin deleting the event subscriptions
+ * without pausing begin deleting the event subscriptions
* while the queue is full
*
- * continue attempting to generate heavy event traffic
- * while deleting subscriptions with the hope that we will
- * deleting an event at the instant that its callback is
+ * continue attempting to generate heavy event traffic
+ * while deleting subscriptions with the hope that we will
+ * deleting an event at the instant that its callback is
* occurring
*/
for ( i=0; i < NELEMENTS (mid); i++ ) {
@@ -1557,14 +1557,14 @@ void multiSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
SEVCHK ( ca_pend_io (timeoutToPendIO), NULL );
showProgressEnd ( interestLevel );
-}
+}
/*
* singleSubscriptionDeleteTest
*
- * verify that we dont fail when we repeatedly create
- * and delete only one subscription with a high level of
+ * verify that we dont fail when we repeatedly create
+ * and delete only one subscription with a high level of
* traffic on it
*/
void singleSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
@@ -1573,7 +1573,7 @@ void singleSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
evid sid;
dbr_float_t temp, getResp;
unsigned i;
-
+
showProgressBegin ( "singleSubscriptionDeleteTest", interestLevel );
for ( i=0; i < 1000; i++ ){
@@ -1595,14 +1595,14 @@ void singleSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
* attempt to generate heavy event traffic before initiating
* the monitor delete
*
- * try to interrupt the recv thread while it is processing
+ * try to interrupt the recv thread while it is processing
* incoming subscription updates
- */
+ */
if ( ca_write_access (chan) ) {
unsigned j = 0;
while ( j < i ) {
temp = (float) j++;
- SEVCHK ( ca_put (DBR_FLOAT, chan, &temp),
+ SEVCHK ( ca_put (DBR_FLOAT, chan, &temp),
"singleSubscriptionDeleteTest - one of multiple puts" );
}
ca_flush_io ();
@@ -1612,7 +1612,7 @@ void singleSubscriptionDeleteTest ( chid chan, unsigned interestLevel )
}
showProgressEnd ( interestLevel );
-}
+}
/*
* channelClearWithEventTrafficTest
@@ -1626,13 +1626,13 @@ void channelClearWithEventTrafficTest ( const char *pName, unsigned interestLeve
evid sid;
dbr_float_t temp, getResp;
unsigned i;
-
+
showProgressBegin ( "channelClearWithEventTrafficTest", interestLevel );
for ( i=0; i < 1000; i++ ) {
chid chan;
- int status = ca_create_channel ( pName, 0, 0,
+ int status = ca_create_channel ( pName, 0, 0,
CA_PRIORITY_DEFAULT, &chan );
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "channelClearWithEventTrafficTest: channel connect failed" );
@@ -1652,9 +1652,9 @@ void channelClearWithEventTrafficTest ( const char *pName, unsigned interestLeve
* attempt to generate heavy event traffic before initiating
* the channel delete
*
- * try to interrupt the recv thread while it is processing
+ * try to interrupt the recv thread while it is processing
* incoming subscription updates
- */
+ */
if ( ca_write_access (chan) ) {
unsigned j = 0;
while ( j < i ) {
@@ -1669,7 +1669,7 @@ void channelClearWithEventTrafficTest ( const char *pName, unsigned interestLeve
}
showProgressEnd ( interestLevel );
-}
+}
@@ -1679,7 +1679,7 @@ void selfDeleteEvent ( struct event_handler_args args )
{
int status;
status = ca_clear_event ( globalEventID );
- verify ( status == ECA_NORMAL );
+ verify ( status == ECA_NORMAL );
}
void eventClearTest ( chid chan )
@@ -1687,29 +1687,29 @@ void eventClearTest ( chid chan )
int status;
evid monix1, monix2, monix3;
- status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
+ status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
NULL, &monix1 );
SEVCHK ( status, NULL );
status = ca_clear_event ( monix1 );
SEVCHK ( status, NULL );
- status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
+ status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
NULL, &monix1 );
SEVCHK ( status, NULL );
- status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
+ status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
NULL, &monix2);
SEVCHK (status, NULL);
status = ca_clear_event ( monix2 );
SEVCHK ( status, NULL);
- status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
+ status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
NULL, &monix2);
SEVCHK ( status, NULL );
- status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
+ status = ca_add_event ( DBR_FLOAT, chan, noopSubscriptionStateChange,
NULL, &monix3);
SEVCHK ( status, NULL );
@@ -1722,7 +1722,7 @@ void eventClearTest ( chid chan )
status = ca_clear_event ( monix3 );
SEVCHK ( status, NULL);
- status = ca_add_event ( DBR_FLOAT, chan, selfDeleteEvent,
+ status = ca_add_event ( DBR_FLOAT, chan, selfDeleteEvent,
0, &globalEventID );
SEVCHK ( status, NULL );
}
@@ -1739,7 +1739,7 @@ void arrayEventExceptionNotify ( struct event_handler_args args )
if ( args.status == ECA_NORMAL ) {
printf (
"arrayEventExceptionNotify: expected "
- "exception but didnt receive one against \"%s\" \n",
+ "exception but didnt receive one against \"%s\" \n",
ca_name ( args.chid ) );
}
else {
@@ -1765,8 +1765,8 @@ void exceptionTest ( chid chan, unsigned interestLevel )
pRS = malloc ( ca_element_count (chan) * sizeof (*pRS) );
verify ( pRS );
- status = ca_array_get ( DBR_PUT_ACKT,
- ca_element_count (chan), chan, pRS );
+ status = ca_array_get ( DBR_PUT_ACKT,
+ ca_element_count (chan), chan, pRS );
SEVCHK ( status, "array read request failed" );
ca_pend_io ( 1e-5 );
epicsThreadSleep ( 0.1 );
@@ -1787,8 +1787,8 @@ void exceptionTest ( chid chan, unsigned interestLevel )
*/
{
arrayEventExceptionNotifyComplete = 0u;
- status = ca_array_get_callback ( DBR_PUT_ACKT,
- ca_element_count (chan), chan, arrayEventExceptionNotify, 0 );
+ status = ca_array_get_callback ( DBR_PUT_ACKT,
+ ca_element_count (chan), chan, arrayEventExceptionNotify, 0 );
if ( status != ECA_NORMAL ) {
verify ( status == ECA_BADTYPE || status == ECA_GETFAIL );
arrayEventExceptionNotifyComplete = 1;
@@ -1811,8 +1811,8 @@ void exceptionTest ( chid chan, unsigned interestLevel )
evid id;
arrayEventExceptionNotifyComplete = 0u;
- status = ca_add_array_event ( DBR_PUT_ACKT, ca_element_count ( chan ),
- chan, arrayEventExceptionNotify, 0, 0.0, 0.0, 0.0, &id );
+ status = ca_add_array_event ( DBR_PUT_ACKT, ca_element_count ( chan ),
+ chan, arrayEventExceptionNotify, 0, 0.0, 0.0, 0.0, &id );
if ( status != ECA_NORMAL ) {
verify ( status == ECA_BADTYPE || status == ECA_GETFAIL );
arrayEventExceptionNotifyComplete = 1;
@@ -1846,8 +1846,8 @@ void exceptionTest ( chid chan, unsigned interestLevel )
for ( i = 0; i < ca_element_count (chan); i++ ) {
strcpy ( pWS[i], "@#$%" );
}
- status = ca_array_put ( DBR_STRING,
- ca_element_count (chan), chan, pWS );
+ status = ca_array_put ( DBR_STRING,
+ ca_element_count (chan), chan, pWS );
if ( status != ECA_NORMAL ) {
verify ( status == ECA_BADTYPE || status == ECA_PUTFAIL );
acctstExceptionCount++; /* local PV case */
@@ -1879,9 +1879,9 @@ void exceptionTest ( chid chan, unsigned interestLevel )
strcpy ( pWS[i], "@#$%" );
}
arrayEventExceptionNotifyComplete = 0u;
- status = ca_array_put_callback ( DBR_STRING,
+ status = ca_array_put_callback ( DBR_STRING,
ca_element_count (chan), chan, pWS,
- arrayEventExceptionNotify, 0);
+ arrayEventExceptionNotify, 0);
if ( status != ECA_NORMAL ) {
arrayEventExceptionNotifyComplete = 1;
}
@@ -1924,7 +1924,7 @@ void arrayWriteNotify ( struct event_handler_args args )
arrayWriteNotifyComplete = 1;
}
else {
- printf ( "arrayWriteNotify: update failed for \"%s\" because \"%s\"",
+ printf ( "arrayWriteNotify: update failed for \"%s\" because \"%s\"",
ca_name ( args.chid ), ca_message ( args.status ) );
}
}
@@ -1956,15 +1956,15 @@ void arrayTest ( chid chan, unsigned maxArrayBytes, unsigned interestLevel )
pWF[i] = rand ();
pRF[i] = - pWF[i];
}
- status = ca_array_put ( DBR_DOUBLE, ca_element_count ( chan ),
- chan, pWF );
+ status = ca_array_put ( DBR_DOUBLE, ca_element_count ( chan ),
+ chan, pWF );
SEVCHK ( status, "array write request failed" );
/*
* read back the array
*/
- status = ca_array_get ( DBR_DOUBLE, ca_element_count (chan),
- chan, pRF );
+ status = ca_array_get ( DBR_DOUBLE, ca_element_count (chan),
+ chan, pRF );
SEVCHK ( status, "array read request failed" );
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "array read failed" );
@@ -1991,8 +1991,8 @@ void arrayTest ( chid chan, unsigned maxArrayBytes, unsigned interestLevel )
pRS = malloc ( ca_element_count (chan) * MAX_STRING_SIZE );
verify ( pRS );
- status = ca_array_get ( DBR_STRING,
- ca_element_count (chan), chan, pRS );
+ status = ca_array_get ( DBR_STRING,
+ ca_element_count (chan), chan, pRS );
SEVCHK ( status, "array read request failed" );
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "array read failed" );
@@ -2010,11 +2010,11 @@ void arrayTest ( chid chan, unsigned maxArrayBytes, unsigned interestLevel )
pWF[i] = rand ();
pRF[i] = - pWF[i];
}
- status = ca_array_put_callback ( DBR_DOUBLE, ca_element_count (chan),
- chan, pWF, arrayWriteNotify, 0 );
+ status = ca_array_put_callback ( DBR_DOUBLE, ca_element_count (chan),
+ chan, pWF, arrayWriteNotify, 0 );
SEVCHK ( status, "array write notify request failed" );
- status = ca_array_get_callback ( DBR_DOUBLE, ca_element_count (chan),
- chan, arrayReadNotify, pWF );
+ status = ca_array_get_callback ( DBR_DOUBLE, ca_element_count (chan),
+ chan, arrayReadNotify, pWF );
SEVCHK ( status, "array read notify request failed" );
ca_flush_io ();
while ( ! arrayWriteNotifyComplete || ! arrayReadNotifyComplete ) {
@@ -2030,11 +2030,11 @@ void arrayTest ( chid chan, unsigned maxArrayBytes, unsigned interestLevel )
pRF[i] = - pWF[i];
}
arrayReadNotifyComplete = 0;
- status = ca_array_put ( DBR_DOUBLE, ca_element_count ( chan ),
- chan, pWF );
+ status = ca_array_put ( DBR_DOUBLE, ca_element_count ( chan ),
+ chan, pWF );
SEVCHK ( status, "array write notify request failed" );
- status = ca_add_array_event ( DBR_DOUBLE, ca_element_count ( chan ),
- chan, arrayReadNotify, pWF, 0.0, 0.0, 0.0, &id );
+ status = ca_add_array_event ( DBR_DOUBLE, ca_element_count ( chan ),
+ chan, arrayReadNotify, pWF, 0.0, 0.0, 0.0, &id );
SEVCHK ( status, "array subscription request failed" );
ca_flush_io ();
while ( ! arrayReadNotifyComplete ) {
@@ -2052,8 +2052,8 @@ void arrayTest ( chid chan, unsigned maxArrayBytes, unsigned interestLevel )
acctstExceptionCount = 0u;
status = ca_add_exception_event ( acctstExceptionNotify, 0 );
SEVCHK ( status, "exception notify install failed" );
- status = ca_array_get ( DBR_DOUBLE,
- ca_element_count (chan)+1, chan, pRF );
+ status = ca_array_get ( DBR_DOUBLE,
+ ca_element_count (chan)+1, chan, pRF );
if ( status == ECA_NORMAL ) {
ca_poll ();
while ( acctstExceptionCount < 1u ) {
@@ -2076,7 +2076,7 @@ void arrayTest ( chid chan, unsigned maxArrayBytes, unsigned interestLevel )
showProgressEnd ( interestLevel );
}
-/*
+/*
* verify that unequal send/recv buffer sizes work
* (a bug related to this test was detected in early R3.14)
*
@@ -2115,8 +2115,8 @@ void unequalServerBufferSizeTest ( const char * pName, unsigned interestLevel )
pWF = (dbr_double_t *) calloc ( ca_element_count (newChan), sizeof (*pWF) );
verify ( pWF != NULL );
- status = ca_array_get ( DBR_DOUBLE, ca_element_count ( newChan ),
- newChan, pRF );
+ status = ca_array_get ( DBR_DOUBLE, ca_element_count ( newChan ),
+ newChan, pRF );
status = ca_pend_io ( timeoutToPendIO );
verify ( status == ECA_NORMAL );
status = ca_clear_channel ( newChan );
@@ -2131,11 +2131,11 @@ void unequalServerBufferSizeTest ( const char * pName, unsigned interestLevel )
showProgress ( interestLevel );
- status = ca_array_put ( DBR_DOUBLE, ca_element_count ( newChan ),
- newChan, pWF );
+ status = ca_array_put ( DBR_DOUBLE, ca_element_count ( newChan ),
+ newChan, pWF );
verify ( status == ECA_NORMAL );
- status = ca_array_get ( DBR_DOUBLE, 1,
- newChan, pRF );
+ status = ca_array_get ( DBR_DOUBLE, 1,
+ newChan, pRF );
verify ( status == ECA_NORMAL );
status = ca_pend_io ( timeoutToPendIO );
verify ( status == ECA_NORMAL );
@@ -2205,9 +2205,9 @@ void verifyDataTypeMacros (void)
verify ( dbf_type_is_valid ( DBF_SHORT ) );
{
int dataType = -1;
- dbf_text_to_type ( "DBF_SHORT", dataType );
+ dbf_text_to_type ( "DBF_SHORT", dataType );
verify ( dataType == DBF_SHORT );
- dbr_text_to_type ( "DBR_CLASS_NAME", dataType );
+ dbr_text_to_type ( "DBR_CLASS_NAME", dataType );
verify ( dataType == DBR_CLASS_NAME );
}
}
@@ -2225,7 +2225,7 @@ void updateTestEvent ( struct event_handler_args args )
{
eventTest *pET = (eventTest *) args.usr;
struct dbr_gr_float *pGF = (struct dbr_gr_float *) args.dbr;
- pET->lastValue = pGF->value;
+ pET->lastValue = pGF->value;
pET->count++;
}
@@ -2246,7 +2246,7 @@ void clearChannelInGetCallbackTest ( const char *pName, unsigned level )
unsigned i;
chid chan;
int status;
-
+
showProgressBegin ( "clearChannelInGetCallbackTest", level );
for ( i = 0; ca_get_ioc_connection_count () > 0 ; i++ ) {
@@ -2259,15 +2259,15 @@ void clearChannelInGetCallbackTest ( const char *pName, unsigned level )
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "clearChannelInGetCallbackTest connect channel" );
-
+
status = ca_get_callback ( DBR_DOUBLE, chan, callbackClearsChannel, 0 );
SEVCHK ( status, "clearChannelInGetCallbackTest get callback" );
-
+
for ( i = 0; ca_get_ioc_connection_count () > 0 ; i++ ) {
ca_pend_event ( 0.1 );
verify ( i < 100 );
}
-
+
showProgressEnd ( level );
}
@@ -2277,7 +2277,7 @@ void clearChannelInPutCallbackTest ( const char *pName, unsigned level )
const dbr_double_t value = 1.1;
chid chan;
int status;
-
+
showProgressBegin ( "clearChannelInPutCallbackTest", level );
for ( i = 0; ca_get_ioc_connection_count () > 0 ; i++ ) {
@@ -2291,15 +2291,15 @@ void clearChannelInPutCallbackTest ( const char *pName, unsigned level )
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "clearChannelInPutCallbackTest connect channel" );
- status = ca_put_callback ( DBR_DOUBLE, chan, & value,
+ status = ca_put_callback ( DBR_DOUBLE, chan, & value,
callbackClearsChannel, 0 );
SEVCHK ( status, "clearChannelInPutCallbackTest get callback" );
-
+
for ( i = 0; ca_get_ioc_connection_count () > 0 ; i++ ) {
ca_pend_event ( 0.1 );
verify ( i < 100 );
}
-
+
showProgressEnd ( level );
}
@@ -2308,7 +2308,7 @@ void clearChannelInSubscrCallbackTest ( const char *pName, unsigned level )
unsigned i;
chid chan;
int status;
-
+
showProgressBegin ( "clearChannelInSubscrCallbackTest", level );
for ( i = 0; ca_get_ioc_connection_count () > 0 ; i++ ) {
@@ -2321,8 +2321,8 @@ void clearChannelInSubscrCallbackTest ( const char *pName, unsigned level )
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "clearChannelInSubscrCallbackTest connect channel" );
-
- status = ca_create_subscription ( DBR_DOUBLE, 1, chan,
+
+ status = ca_create_subscription ( DBR_DOUBLE, 1, chan,
DBE_VALUE, callbackClearsChannel, 0, 0 );
SEVCHK ( status, "clearChannelInSubscrCallbackTest subscribe" );
@@ -2330,18 +2330,18 @@ void clearChannelInSubscrCallbackTest ( const char *pName, unsigned level )
ca_pend_event ( 0.1 );
verify ( i < 100 );
}
-
+
showProgressEnd ( level );
}
-void monitorAddConnectionCallback ( struct connection_handler_args args )
+void monitorAddConnectionCallback ( struct connection_handler_args args )
{
if ( args.op == CA_OP_CONN_UP ) {
unsigned * pEventCount = ( unsigned * ) ca_puser ( args.chid );
int status;
verify ( *pEventCount == 0u );
(*pEventCount)++;
- status = ca_create_subscription ( DBR_DOUBLE, 1,
+ status = ca_create_subscription ( DBR_DOUBLE, 1,
args.chid, DBE_VALUE, nUpdatesTester, ca_puser ( args.chid ), 0 );
SEVCHK ( status, "monitorAddConnectionCallback create subscription" );
}
@@ -2363,7 +2363,7 @@ void monitorAddConnectionCallbackTest ( const char *pName, unsigned interestLeve
int status;
unsigned eventCount = 0u;
unsigned getCallbackCount = 0u;
-
+
showProgressBegin ( "monitorAddConnectionCallbackTest", interestLevel );
for ( i = 0; ca_get_ioc_connection_count () > 0 ; i++ ) {
@@ -2371,7 +2371,7 @@ void monitorAddConnectionCallbackTest ( const char *pName, unsigned interestLeve
verify ( i < 100 );
}
- status = ca_create_channel ( pName,
+ status = ca_create_channel ( pName,
monitorAddConnectionCallback, &eventCount, 0, & chan );
SEVCHK ( status, "monitorAddConnectionCallbackTest create channel" );
@@ -2379,7 +2379,7 @@ void monitorAddConnectionCallbackTest ( const char *pName, unsigned interestLeve
ca_pend_event ( 0.1 );
}
verify ( eventCount >= 2u );
-
+
status = ca_get_callback ( DBR_DOUBLE, chan, nUpdatesTester, &getCallbackCount );
SEVCHK ( status, "monitorAddConnectionCallback get callback" );
while ( getCallbackCount == 0 ) {
@@ -2390,7 +2390,7 @@ void monitorAddConnectionCallbackTest ( const char *pName, unsigned interestLeve
status = ca_clear_channel ( chan );
SEVCHK ( status, "monitorAddConnectionCallbackTest clear channel" );
-
+
status = ca_flush_io ();
SEVCHK ( status, "monitorAddConnectionCallbackTest flush" );
@@ -2423,7 +2423,7 @@ void monitorUpdateTest ( chid chan, unsigned interestLevel )
printf ("skipped monitorUpdateTest test - not an analog type\n");
return;
}
-
+
showProgressBegin ( "monitorUpdateTest", interestLevel );
/*
@@ -2444,12 +2444,12 @@ void monitorUpdateTest ( chid chan, unsigned interestLevel )
* complete
*
* NOTE: this hopefully demonstrates that when the
- * server is very busy with monitors the client
+ * server is very busy with monitors the client
* is still able to punch through with a request.
*/
SEVCHK ( ca_get ( DBR_FLOAT, chan, &getResp) ,NULL );
SEVCHK ( ca_pend_io ( timeoutToPendIO ) ,NULL );
-
+
showProgress ( interestLevel );
/*
@@ -2483,7 +2483,7 @@ void monitorUpdateTest ( chid chan, unsigned interestLevel )
/*
* attempt to uncover problems where the last event isnt sent
* and hopefully get into a flow control situation
- */
+ */
prevPassCount = 0u;
for ( i = 0; i < 10; i++ ) {
for ( j = 0; j < NELEMENTS(test); j++ ) {
@@ -2492,7 +2492,7 @@ void monitorUpdateTest ( chid chan, unsigned interestLevel )
test[j].lastValue = -1.0f;
SEVCHK ( ca_add_event ( DBR_GR_FLOAT, chan, updateTestEvent,
&test[j], &test[j].id ) , NULL );
- }
+ }
for ( j = 0; j <= i; j++ ) {
temp = monitorUpdateTestPattern ( j );
@@ -2522,7 +2522,7 @@ void monitorUpdateTest ( chid chan, unsigned interestLevel )
ca_poll (); /* emulate typical GUI */
for ( j = 0; j < NELEMENTS ( test ); j++ ) {
/*
- * we shouldnt see old monitors because
+ * we shouldnt see old monitors because
* we resubscribed
*/
verify ( test[j].count <= i + 2 );
@@ -2562,12 +2562,12 @@ void monitorUpdateTest ( chid chan, unsigned interestLevel )
showProgress ( interestLevel );
/*
- * delete the event subscriptions
+ * delete the event subscriptions
*/
for ( i = 0; i < NELEMENTS ( test ); i++ ) {
SEVCHK ( ca_clear_event ( test[i].id ), NULL );
}
-
+
/*
* force all of the clear event requests to
* complete
@@ -2578,7 +2578,7 @@ void monitorUpdateTest ( chid chan, unsigned interestLevel )
/* printf ( "flow control bypassed %u events\n", flowCtrlCount ); */
showProgressEnd ( interestLevel );
-}
+}
void verifyReasonableBeaconPeriod ( chid chan, unsigned interestLevel )
{
@@ -2594,7 +2594,7 @@ void verifyReasonableBeaconPeriod ( chid chan, unsigned interestLevel )
ca_beacon_anomaly_count () );
beaconPeriod = ca_beacon_period ( chan );
- printf ( "Estimated beacon period for channel %s = %g sec.\n",
+ printf ( "Estimated beacon period for channel %s = %g sec.\n",
ca_name ( chan ), beaconPeriod );
watchDogDelay = ca_receive_watchdog_delay ( chan );
@@ -2603,8 +2603,8 @@ void verifyReasonableBeaconPeriod ( chid chan, unsigned interestLevel )
printf ( "busy: receive watchdog for \"%s\" expires in %g sec.\n",
ca_name ( chan ), watchDogDelay );
- /*
- * let one default connection timeout go by w/o receive activity
+ /*
+ * let one default connection timeout go by w/o receive activity
* so we can see if beacons reset the watchdog
*/
for ( i = 0u; i < 15u; i++ ) {
@@ -2667,18 +2667,18 @@ void verifyTimeStamps ( chid chan, unsigned interestLevel )
status = ca_pend_io ( timeoutToPendIO );
verify ( status == ECA_NORMAL );
- length = epicsTimeToStrftime ( buf, sizeof ( buf ),
+ length = epicsTimeToStrftime ( buf, sizeof ( buf ),
"%a %b %d %Y %H:%M:%S.%f", & first.stamp );
verify ( length );
- printf ("Processing time of channel \"%s\" was \"%s\"\n",
+ printf ("Processing time of channel \"%s\" was \"%s\"\n",
ca_name ( chan ), buf );
diff = epicsTimeDiffInSeconds ( & last.stamp, & first.stamp );
- printf ("Time difference between two successive reads was %g sec\n",
+ printf ("Time difference between two successive reads was %g sec\n",
diff );
diff = epicsTimeDiffInSeconds ( & first.stamp, & localTime );
- printf ("Time difference between client and server %g sec\n",
+ printf ("Time difference between client and server %g sec\n",
diff );
showProgressEnd ( interestLevel );
@@ -2700,7 +2700,7 @@ void verifyChannelPriorities ( const char *pName, unsigned interestLevel )
double value;
chid chan0, chan1;
unsigned priority0, priority1;
-
+
priority0 = ( i * ( CA_PRIORITY_MAX - CA_PRIORITY_MIN ) ) / nPrio;
priority0 += CA_PRIORITY_MIN;
if ( priority0 > CA_PRIORITY_MAX ) {
@@ -2713,11 +2713,11 @@ void verifyChannelPriorities ( const char *pName, unsigned interestLevel )
priority1 = CA_PRIORITY_MAX;
}
- status = ca_create_channel ( pName, 0, 0,
+ status = ca_create_channel ( pName, 0, 0,
priority0, &chan0 );
SEVCHK ( status, "prioritized channel create failed" );
- status = ca_create_channel ( pName, 0, 0,
+ status = ca_create_channel ( pName, 0, 0,
priority1, &chan1 );
SEVCHK ( status, "prioritized channel create failed" );
@@ -2751,8 +2751,8 @@ void verifyChannelPriorities ( const char *pName, unsigned interestLevel )
showProgressEnd ( interestLevel );
}
-void verifyTearDownWhenChannelConnected ( const char * pName,
- enum ca_preemptive_callback_select select,
+void verifyTearDownWhenChannelConnected ( const char * pName,
+ enum ca_preemptive_callback_select select,
unsigned interestLevel )
{
static const unsigned chanCount = 20;
@@ -2761,15 +2761,15 @@ void verifyTearDownWhenChannelConnected ( const char * pName,
chid * const pChans = (chid * const) calloc ( chanCount, sizeof ( *pChans ) );
double * const pValues = (double * const) calloc ( chanCount, sizeof ( *pValues ) );
unsigned i, j;
-
+
verify ( pChans && pValues );
-
+
showProgressBegin ( "verifyTearDownWhenChannelConnected", interestLevel );
for ( i = 0u; i < loopCount; i++ ) {
int status;
ca_context_create ( select );
-
+
for ( j = 0; j < chanCount; j++ ) {
status = ca_create_channel ( pName, 0, 0, 0, & pChans[j] );
SEVCHK ( status, "immediate tear down channel create failed" );
@@ -2782,11 +2782,11 @@ void verifyTearDownWhenChannelConnected ( const char * pName,
status = ca_get ( DBR_DOUBLE, pChans[j], &pValues[j] );
SEVCHK ( status, "immediate tear down channel get failed" );
}
-
+
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "immediate tear down get pend io failed" );
- ca_context_destroy ();
+ ca_context_destroy ();
}
ca_context_create ( select );
@@ -2798,8 +2798,8 @@ void verifyTearDownWhenChannelConnected ( const char * pName,
}
-void verifyImmediateTearDown ( const char * pName,
- enum ca_preemptive_callback_select select,
+void verifyImmediateTearDown ( const char * pName,
+ enum ca_preemptive_callback_select select,
unsigned interestLevel )
{
int i;
@@ -2817,8 +2817,8 @@ void verifyImmediateTearDown ( const char * pName,
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "immediate tear down channel connect failed" );
verify ( status == ECA_NORMAL );
- /*
- * verify that puts pending when we call ca_task_exit()
+ /*
+ * verify that puts pending when we call ca_task_exit()
* get flushed out
*/
if ( i > 0 ) {
@@ -2868,12 +2868,12 @@ void fdRegCB ( void * parg, int fd, int opened )
fdctx * mgrCtx = ( fdctx * ) parg;
if ( opened ) {
- status = fdmgr_add_callback (
+ status = fdmgr_add_callback (
mgrCtx, fd, fdi_read, fdcb, 0 );
verify ( status >= 0 );
}
else {
- status = fdmgr_clear_callback (
+ status = fdmgr_clear_callback (
mgrCtx, fd, fdi_read );
verify ( status >= 0 );
}
@@ -2893,21 +2893,21 @@ typedef struct {
unsigned m_interestLevel;
} MultiThreadSubscrTest;
-static void testMultithreadSubscrSubscrCallback
+static void testMultithreadSubscrSubscrCallback
( struct event_handler_args eha )
{
const epicsEventId firstUpdateEvent = ( epicsEventId ) eha.usr;
epicsEventSignal ( firstUpdateEvent );
}
-static void testMultithreadSubscrCreateSubscr ( void * pParm )
+static void testMultithreadSubscrCreateSubscr ( void * pParm )
{
static unsigned nElem = 0;
int testComplete = FALSE;
evid id;
epicsEventId firstUpdateEvent;
- epicsEventWaitStatus eventWaitStatus;
- MultiThreadSubscrTest * const pMultiThreadSubscrTest =
+ epicsEventWaitStatus eventWaitStatus;
+ MultiThreadSubscrTest * const pMultiThreadSubscrTest =
( MultiThreadSubscrTest * ) pParm;
/* this is required for the ca_flush below to work correctly */
@@ -2915,19 +2915,19 @@ static void testMultithreadSubscrCreateSubscr ( void * pParm )
verify ( status == ECA_NORMAL );
firstUpdateEvent = epicsEventMustCreate ( epicsEventEmpty );
verify ( firstUpdateEvent );
- status = ca_create_subscription (
- DBR_TIME_LONG,
- nElem,
- pMultiThreadSubscrTest->m_chan,
- DBE_VALUE,
- testMultithreadSubscrSubscrCallback,
- firstUpdateEvent,
+ status = ca_create_subscription (
+ DBR_TIME_LONG,
+ nElem,
+ pMultiThreadSubscrTest->m_chan,
+ DBE_VALUE,
+ testMultithreadSubscrSubscrCallback,
+ firstUpdateEvent,
& id );
verify ( status == ECA_NORMAL );
status = ca_flush_io ();
verify ( status == ECA_NORMAL );
/* wait for first update */
- eventWaitStatus = epicsEventWaitWithTimeout (
+ eventWaitStatus = epicsEventWaitWithTimeout (
firstUpdateEvent, 60.0 * 10 );
verify ( eventWaitStatus == epicsEventWaitOK );
epicsEventDestroy ( firstUpdateEvent );
@@ -2935,7 +2935,7 @@ static void testMultithreadSubscrCreateSubscr ( void * pParm )
verify ( status == ECA_NORMAL );
epicsMutexMustLock ( pMultiThreadSubscrTest->m_mutex );
pMultiThreadSubscrTest->m_nUpdatesReceived++;
- testComplete = ( pMultiThreadSubscrTest->m_nUpdatesReceived ==
+ testComplete = ( pMultiThreadSubscrTest->m_nUpdatesReceived ==
pMultiThreadSubscrTest->m_nUpdatesRequired );
pMultiThreadSubscrTest->m_testComplete = testComplete;
epicsMutexUnlock ( pMultiThreadSubscrTest->m_mutex );
@@ -2946,10 +2946,10 @@ static void testMultithreadSubscrCreateSubscr ( void * pParm )
void testMultithreadSubscrConnHandler ( struct connection_handler_args args )
{
- MultiThreadSubscrTest * const pMultiThreadSubscrTest =
+ MultiThreadSubscrTest * const pMultiThreadSubscrTest =
( MultiThreadSubscrTest * ) ca_puser ( args.chid );
epicsMutexMustLock ( pMultiThreadSubscrTest->m_mutex );
- if ( !pMultiThreadSubscrTest->m_testInitiated &&
+ if ( !pMultiThreadSubscrTest->m_testInitiated &&
args.op == CA_OP_CONN_UP ) {
int i;
pMultiThreadSubscrTest->m_testInitiated = TRUE;
@@ -2957,10 +2957,10 @@ void testMultithreadSubscrConnHandler ( struct connection_handler_args args )
char threadname[64];
epicsThreadId threadId;
sprintf(threadname, "testSubscr%06u", i);
- threadId = epicsThreadCreate ( threadname,
- epicsThreadPriorityMedium,
- epicsThreadGetStackSize(epicsThreadStackSmall),
- testMultithreadSubscrCreateSubscr,
+ threadId = epicsThreadCreate ( threadname,
+ epicsThreadPriorityMedium,
+ epicsThreadGetStackSize(epicsThreadStackSmall),
+ testMultithreadSubscrCreateSubscr,
pMultiThreadSubscrTest );
verify ( threadId );
}
@@ -2970,7 +2970,7 @@ void testMultithreadSubscrConnHandler ( struct connection_handler_args args )
void testMultithreadSubscr ( void * pParm )
{
- MultiThreadSubscrTest * const pMultiThreadSubscrTest =
+ MultiThreadSubscrTest * const pMultiThreadSubscrTest =
( MultiThreadSubscrTest * ) pParm;
int status;
unsigned i;
@@ -2983,11 +2983,11 @@ void testMultithreadSubscr ( void * pParm )
pMultiThreadSubscrTest->m_chanName,
testMultithreadSubscrConnHandler,
pMultiThreadSubscrTest,
- CA_PRIORITY_MIN,
+ CA_PRIORITY_MIN,
& pMultiThreadSubscrTest->m_chan );
verify ( status == ECA_NORMAL );
- showProgressBegin ( "verifyMultithreadSubscr",
+ showProgressBegin ( "verifyMultithreadSubscr",
pMultiThreadSubscrTest->m_interestLevel );
i = 0;
while ( TRUE ) {
@@ -2999,11 +2999,11 @@ void testMultithreadSubscr ( void * pParm )
if ( success ) {
break;
}
- eventWaitStatus = epicsEventWaitWithTimeout (
+ eventWaitStatus = epicsEventWaitWithTimeout (
pMultiThreadSubscrTest->m_testCompleteEvent, 0.1 );
- verify ( eventWaitStatus == epicsEventWaitOK ||
+ verify ( eventWaitStatus == epicsEventWaitOK ||
eventWaitStatus == epicsEventWaitTimeout );
- if ( i++ % 100 == 0u )
+ if ( i++ % 100 == 0u )
showProgress ( pMultiThreadSubscrTest->m_interestLevel );
verify ( i < 1000 );
}
@@ -3023,33 +3023,33 @@ void verifyMultithreadSubscr ( const char * pName, unsigned interestLevel )
{
static unsigned nSubscr = 3000;
epicsThreadId threadId;
- MultiThreadSubscrTest * const pMultiThreadSubscrTest =
- (MultiThreadSubscrTest*) calloc ( 1,
+ MultiThreadSubscrTest * const pMultiThreadSubscrTest =
+ (MultiThreadSubscrTest*) calloc ( 1,
sizeof ( MultiThreadSubscrTest ) );
verify ( pMultiThreadSubscrTest);
pMultiThreadSubscrTest->m_mutex = epicsMutexMustCreate ();
verify ( pMultiThreadSubscrTest->m_mutex );
- pMultiThreadSubscrTest->m_testCompleteEvent =
+ pMultiThreadSubscrTest->m_testCompleteEvent =
epicsEventMustCreate ( epicsEventEmpty );
verify ( pMultiThreadSubscrTest->m_testCompleteEvent );
- pMultiThreadSubscrTest->m_threadExitEvent =
+ pMultiThreadSubscrTest->m_threadExitEvent =
epicsEventMustCreate ( epicsEventEmpty );
verify ( pMultiThreadSubscrTest->m_threadExitEvent );
- strncpy ( pMultiThreadSubscrTest->m_chanName, pName,
+ strncpy ( pMultiThreadSubscrTest->m_chanName, pName,
sizeof ( pMultiThreadSubscrTest->m_chanName ) );
pMultiThreadSubscrTest->m_chanName
[ sizeof ( pMultiThreadSubscrTest->m_chanName ) - 1u ] = '\0';
pMultiThreadSubscrTest->m_nUpdatesRequired = nSubscr;
pMultiThreadSubscrTest->m_interestLevel = interestLevel;
- threadId = epicsThreadCreate (
- "testMultithreadSubscr",
- epicsThreadPriorityMedium,
- epicsThreadGetStackSize(epicsThreadStackSmall),
+ threadId = epicsThreadCreate (
+ "testMultithreadSubscr",
+ epicsThreadPriorityMedium,
+ epicsThreadGetStackSize(epicsThreadStackSmall),
testMultithreadSubscr, pMultiThreadSubscrTest );
verify ( threadId );
{
epicsEventWaitStatus eventWaitStatus;
- eventWaitStatus = epicsEventWaitWithTimeout (
+ eventWaitStatus = epicsEventWaitWithTimeout (
pMultiThreadSubscrTest->m_threadExitEvent, 1000.0 );
verify ( eventWaitStatus == epicsEventWaitOK );
}
@@ -3068,7 +3068,7 @@ void fdManagerVerify ( const char * pName, unsigned interestLevel )
evid subscription;
unsigned eventCount = 0u;
epicsTimeStamp begin, end;
-
+
mgrCtx = fdmgr_init ();
verify ( mgrCtx );
@@ -3089,7 +3089,7 @@ void fdManagerVerify ( const char * pName, unsigned interestLevel )
showProgress ( interestLevel );
- status = ca_add_event ( DBR_FLOAT, newChan,
+ status = ca_add_event ( DBR_FLOAT, newChan,
nUpdatesTester, & eventCount, & subscription );
verify ( status == ECA_NORMAL );
@@ -3142,7 +3142,7 @@ void fdManagerVerify ( const char * pName, unsigned interestLevel )
showProgressEnd ( interestLevel );
}
-void verifyConnectWithDisconnectedChannels (
+void verifyConnectWithDisconnectedChannels (
const char *pName, unsigned interestLevel )
{
int status;
@@ -3171,11 +3171,11 @@ void verifyConnectWithDisconnectedChannels (
status = ca_create_channel ( pName, 0, 0, 0, & validChan );
verify ( status == ECA_NORMAL );
- /*
- * we should be able to connect to a valid
+ /*
+ * we should be able to connect to a valid
* channel within a reasonable delay even
- * though there is one permanently
- * diasconnected channel
+ * though there is one permanently
+ * diasconnected channel
*/
status = ca_pend_io ( timeoutToPendIO );
verify ( status == ECA_NORMAL );
@@ -3205,7 +3205,7 @@ void noopExceptionCallback ( struct exception_handler_args args )
{
}
-void verifyDisconnect (
+void verifyDisconnect (
const char * pName, unsigned interestLevel )
{
int disconnectFlag = 0;
@@ -3214,8 +3214,8 @@ void verifyDisconnect (
chid chan1;
int status;
- status = ca_create_channel (
- pName, verifyClearChannelOnDisconnectCallback,
+ status = ca_create_channel (
+ pName, verifyClearChannelOnDisconnectCallback,
& disconnectFlag, 0, & chan0 );
SEVCHK ( status, NULL );
@@ -3256,7 +3256,7 @@ void verifyDisconnect (
fprintf ( stdout, "confirmed.\n" );
/* channel cleared by disconnect handler */
- status = ca_create_channel (
+ status = ca_create_channel (
pName, 0, 0, 0, & chan1 );
SEVCHK ( status, NULL );
@@ -3275,11 +3275,11 @@ void verifyDisconnect (
SEVCHK ( status, NULL );
}
-void verifyName (
+void verifyName (
const char * pName, unsigned interestLevel )
{
chid chan;
- int status = ca_create_channel (
+ int status = ca_create_channel (
pName, 0, 0, 0, & chan );
SEVCHK ( status, NULL );
if ( strcmp ( pName, ca_name ( chan ) ) != 0 ) {
@@ -3297,13 +3297,13 @@ void verifyContextRundownFlush ( const char * pName, unsigned interestLevel )
for ( i=0u; i < 1000; i++ ) {
const dbr_double_t stim = i;
-
- {
+
+ {
chid chan;
int status;
status = ca_context_create ( ca_disable_preemptive_callback );
SEVCHK ( status, "context create failed" );
-
+
status = ca_create_channel ( pName, 0, 0, 0, & chan );
/*
* currently in-memory channels cant be used with this test
@@ -3311,26 +3311,26 @@ void verifyContextRundownFlush ( const char * pName, unsigned interestLevel )
*/
if ( status != ECA_UNAVAILINSERV ) {
SEVCHK ( status, NULL );
-
+
status = ca_pend_io( timeoutToPendIO );
SEVCHK ( status, "channel connect failed" );
-
+
status = ca_put ( DBR_DOUBLE, chan, & stim );
SEVCHK ( status, "channel put failed" );
-
+
status = ca_clear_channel ( chan );
SEVCHK ( status, NULL );
}
ca_context_destroy ();
}
-
+
{
chid chan;
int status;
dbr_double_t resp;
status = ca_context_create ( ca_disable_preemptive_callback );
SEVCHK ( status, "context create failed" );
-
+
status = ca_create_channel ( pName, 0, 0, 0, & chan );
SEVCHK ( status, NULL );
/*
@@ -3340,15 +3340,15 @@ void verifyContextRundownFlush ( const char * pName, unsigned interestLevel )
if ( status != ECA_UNAVAILINSERV ) {
status = ca_pend_io( timeoutToPendIO );
SEVCHK ( status, "channel connect failed" );
-
+
status = ca_get ( DBR_DOUBLE, chan, & resp );
SEVCHK ( status, "channel get failed" );
-
+
status = ca_pend_io ( timeoutToPendIO );
SEVCHK ( status, "get, pend io failed" );
-
+
verify ( stim == resp );
-
+
status = ca_clear_channel ( chan );
SEVCHK ( status, NULL );
}
@@ -3359,11 +3359,11 @@ void verifyContextRundownFlush ( const char * pName, unsigned interestLevel )
showProgress ( interestLevel );
}
}
-
+
showProgressEnd ( interestLevel );
}
-void verifyContextRundownChanStillExist (
+void verifyContextRundownChanStillExist (
const char * pName, unsigned interestLevel )
{
chid chan[10000];
@@ -3374,7 +3374,7 @@ void verifyContextRundownChanStillExist (
status = ca_context_create ( ca_disable_preemptive_callback );
SEVCHK ( status, "context create failed" );
-
+
for ( i = 0; i < NELEMENTS ( chan ); i++ ) {
status = ca_create_channel ( pName, 0, 0, 0, & chan[i] );
/*
@@ -3386,17 +3386,17 @@ void verifyContextRundownChanStillExist (
}
SEVCHK ( status, NULL );
}
-
+
status = ca_pend_io( timeoutToPendIO );
SEVCHK ( status, "channel connect failed" );
ca_context_destroy ();
-
+
showProgressEnd ( interestLevel );
}
-int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
- unsigned repetitionCount, enum ca_preemptive_callback_select select )
+int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
+ unsigned repetitionCount, enum ca_preemptive_callback_select select )
{
chid chan;
int status;
@@ -3405,7 +3405,7 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
unsigned connections;
unsigned maxArrayBytes = 10000000;
- printf ( "CA Client V%s, channel name \"%s\", timeout %g\n",
+ printf ( "CA Client V%s, channel name \"%s\", timeout %g\n",
ca_version (), pName, timeoutToPendIO );
if ( select == ca_enable_preemptive_callback ) {
printf ( "Preemptive call back is enabled.\n" );
@@ -3414,7 +3414,7 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
{
char tmpString[32];
sprintf ( tmpString, "%u", maxArrayBytes );
- epicsEnvSet ( "EPICS_CA_MAX_ARRAY_BYTES", tmpString );
+ epicsEnvSet ( "EPICS_CA_MAX_ARRAY_BYTES", tmpString );
}
/*
@@ -3447,7 +3447,7 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
showProgressEnd ( interestLevel );
printf ( "native type was %s, native count was %lu\n",
- dbf_type_to_text ( ca_field_type ( chan ) ),
+ dbf_type_to_text ( ca_field_type ( chan ) ),
ca_element_count ( chan ) );
connections = ca_get_ioc_connection_count ();
@@ -3464,14 +3464,14 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
verifyTimeStamps ( chan, interestLevel );
verifyOldPend ( interestLevel );
exceptionTest ( chan, interestLevel );
- arrayTest ( chan, maxArrayBytes, interestLevel );
+ arrayTest ( chan, maxArrayBytes, interestLevel );
verifyMonitorSubscriptionFlushIO ( chan, interestLevel );
monitorSubscriptionFirstUpdateTest ( pName, chan, interestLevel );
ctrlDoubleTest ( chan, interestLevel );
verifyBlockInPendIO ( chan, interestLevel );
- verifyAnalogIO ( chan, DBR_FLOAT, FLT_MIN, FLT_MAX,
+ verifyAnalogIO ( chan, DBR_FLOAT, FLT_MIN, FLT_MAX,
FLT_MIN_EXP, FLT_MAX_EXP, FLT_EPSILON, interestLevel );
- verifyAnalogIO ( chan, DBR_DOUBLE, DBL_MIN, DBL_MAX,
+ verifyAnalogIO ( chan, DBR_DOUBLE, DBL_MIN, DBL_MAX,
DBL_MIN_EXP, DBL_MAX_EXP, DBL_EPSILON, interestLevel );
verifyLongIO ( chan, interestLevel );
verifyShortIO ( chan, interestLevel );
@@ -3486,7 +3486,7 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
verifyBadString ( chan, interestLevel );
verifyMultithreadSubscr ( pName, interestLevel );
if ( select != ca_enable_preemptive_callback ) {
- fdManagerVerify ( pName, interestLevel );
+ fdManagerVerify ( pName, interestLevel );
}
/*
@@ -3497,7 +3497,7 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
printf ( "\n" );
pend_event_delay_test ( 1.0 );
pend_event_delay_test ( 0.1 );
- pend_event_delay_test ( 0.25 );
+ pend_event_delay_test ( 0.25 );
/* ca_channel_status ( 0 ); */
ca_client_status ( 0 );
@@ -3539,10 +3539,10 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
/* SEVCHK ( status, NULL ); */
caTaskExitTest ( interestLevel );
-
+
verifyContextRundownFlush ( pName, interestLevel );
verifyContextRundownChanStillExist ( pName, interestLevel );
-
+
free ( pChans );
printf ( "\nTest Complete\n" );
diff --git a/modules/ca/src/client/acctstMain.c b/modules/ca/src/client/acctstMain.c
index 4c700a30b..5386019e0 100644
--- a/modules/ca/src/client/acctstMain.c
+++ b/modules/ca/src/client/acctstMain.c
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include
@@ -19,15 +19,15 @@ int main ( int argc, char **argv )
unsigned progressLoggingLevel;
unsigned channelCount;
unsigned repetitionCount;
- enum ca_preemptive_callback_select preempt;
- int aBoolean;
+ enum ca_preemptive_callback_select preempt;
+ int aBoolean;
if ( argc < 2 || argc > 6 ) {
printf ("usage: %s [progress logging level] [channel count] "
- "[repetition count] [enable preemptive callback]\n",
+ "[repetition count] [enable preemptive callback]\n",
argv[0] );
- return 1;
+ return 1;
}
if ( argc >= 3 ) {
@@ -57,12 +57,12 @@ int main ( int argc, char **argv )
else {
aBoolean = 0;
}
- if ( aBoolean ) {
- preempt = ca_enable_preemptive_callback;
- }
- else {
- preempt = ca_disable_preemptive_callback;
- }
+ if ( aBoolean ) {
+ preempt = ca_enable_preemptive_callback;
+ }
+ else {
+ preempt = ca_disable_preemptive_callback;
+ }
acctst ( argv[1], progressLoggingLevel, channelCount, repetitionCount, preempt );
diff --git a/modules/ca/src/client/acctstRegister.cpp b/modules/ca/src/client/acctstRegister.cpp
index e75ed7fe3..5ddc5af16 100644
--- a/modules/ca/src/client/acctstRegister.cpp
+++ b/modules/ca/src/client/acctstRegister.cpp
@@ -60,7 +60,7 @@ struct AutoInit {
AutoInit ();
};
-AutoInit :: AutoInit ()
+AutoInit :: AutoInit ()
{
iocshRegister ( &acctstFuncDef, acctstCallFunc );
}
diff --git a/modules/ca/src/client/addrList.h b/modules/ca/src/client/addrList.h
index c06c8b2bc..9f1bd9d78 100644
--- a/modules/ca/src/client/addrList.h
+++ b/modules/ca/src/client/addrList.h
@@ -3,38 +3,38 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-#ifndef addrListh
-#define addrListh
+#ifndef INC_addrList_H
+#define INC_addrList_H
-#include "shareLib.h"
-#include "envDefs.h"
+#include "envDefs.h"
#include "osiSock.h"
+#include "libCaAPI.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-epicsShareFunc void epicsShareAPI configureChannelAccessAddressList
+LIBCA_API void epicsStdCall configureChannelAccessAddressList
( struct ELLLIST *pList, SOCKET sock, unsigned short port );
-epicsShareFunc int epicsShareAPI addAddrToChannelAccessAddressList
- ( struct ELLLIST *pList, const ENV_PARAM *pEnv,
+LIBCA_API int epicsStdCall addAddrToChannelAccessAddressList
+ ( struct ELLLIST *pList, const ENV_PARAM *pEnv,
unsigned short port, int ignoreNonDefaultPort );
-epicsShareFunc void epicsShareAPI printChannelAccessAddressList
+LIBCA_API void epicsStdCall printChannelAccessAddressList
( const struct ELLLIST *pList );
-epicsShareFunc void epicsShareAPI removeDuplicateAddresses
+LIBCA_API void epicsStdCall removeDuplicateAddresses
( struct ELLLIST *pDestList, ELLLIST *pSrcList, int silent);
#ifdef __cplusplus
}
#endif
-#endif /* ifndef addrListh */
+#endif /* ifndef INC_addrList_H */
diff --git a/modules/ca/src/client/autoPtrFreeList.h b/modules/ca/src/client/autoPtrFreeList.h
index 7dc73609a..e1d31d215 100644
--- a/modules/ca/src/client/autoPtrFreeList.h
+++ b/modules/ca/src/client/autoPtrFreeList.h
@@ -3,41 +3,31 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef autoPtrFreeListh
-#define autoPtrFreeListh
-
-#ifdef epicsExportSharedSymbols
-# define autoPtrFreeListh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_autoPtrFreeList_H
+#define INC_autoPtrFreeList_H
#include "tsFreeList.h"
#include "compilerDependencies.h"
-#ifdef autoPtrFreeListh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-#endif
-
template < class T, unsigned N = 0x400, class MUTEX = epicsMutex >
class autoPtrFreeList {
public:
@@ -56,7 +46,7 @@ private:
};
template < class T, unsigned N, class MUTEX >
-inline autoPtrFreeList < T, N, MUTEX >::autoPtrFreeList (
+inline autoPtrFreeList < T, N, MUTEX >::autoPtrFreeList (
tsFreeList < T, N, MUTEX > & freeListIn, T * pIn ) :
p ( pIn ), freeList ( freeListIn ) {}
@@ -101,4 +91,4 @@ inline T * autoPtrFreeList < T, N, MUTEX >::release ()
return pTmp;
}
-#endif // #ifdef autoPtrFreeListh
+#endif // #ifndef INC_autoPtrFreeList_H
diff --git a/modules/ca/src/client/autoPtrRecycle.h b/modules/ca/src/client/autoPtrRecycle.h
index 173e148b8..600bb5a8c 100644
--- a/modules/ca/src/client/autoPtrRecycle.h
+++ b/modules/ca/src/client/autoPtrRecycle.h
@@ -5,22 +5,22 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#ifndef autoPtrRecycleh
@@ -29,7 +29,7 @@
template < class T >
class autoPtrRecycle {
public:
- autoPtrRecycle (
+ autoPtrRecycle (
epicsGuard < epicsMutex > &, chronIntIdResTable < baseNMIU > &,
cacRecycle &, T * );
~autoPtrRecycle ();
@@ -43,12 +43,12 @@ private:
chronIntIdResTable < baseNMIU > & ioTable;
epicsGuard < epicsMutex > & guard;
// not implemented
- autoPtrRecycle ( const autoPtrRecycle & );
- autoPtrRecycle & operator = ( const autoPtrRecycle & );
+ autoPtrRecycle ( const autoPtrRecycle & );
+ autoPtrRecycle & operator = ( const autoPtrRecycle & );
};
template < class T >
-inline autoPtrRecycle::autoPtrRecycle (
+inline autoPtrRecycle::autoPtrRecycle (
epicsGuard < epicsMutex > & guardIn, chronIntIdResTable < baseNMIU > & tbl,
cacRecycle & rIn, T * pIn ) :
p ( pIn ), r ( rIn ), ioTable ( tbl ), guard ( guardIn ) {}
diff --git a/modules/ca/src/client/baseNMIU.cpp b/modules/ca/src/client/baseNMIU.cpp
index 20f153b0a..9a86886dc 100644
--- a/modules/ca/src/client/baseNMIU.cpp
+++ b/modules/ca/src/client/baseNMIU.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
diff --git a/modules/ca/src/client/bhe.cpp b/modules/ca/src/client/bhe.cpp
index d6f1796be..19b8f9045 100644
--- a/modules/ca/src/client/bhe.cpp
+++ b/modules/ca/src/client/bhe.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-
-/*
+
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -28,7 +27,6 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "virtualCircuit.h"
#include "bhe.h"
@@ -42,12 +40,12 @@
* start up
*
* if creating this in response to a search reply
- * and not in response to a beacon then
+ * and not in response to a beacon then
* we set the beacon time stamp to
* zero (so we can correctly compute the period
* between the 1st and 2nd beacons)
*/
-bhe::bhe ( epicsMutex & mutexIn, const epicsTime & initialTimeStamp,
+bhe::bhe ( epicsMutex & mutexIn, const epicsTime & initialTimeStamp,
unsigned initialBeaconNumber, const inetAddrID & addr ) :
inetAddrID ( addr ), timeStamp ( initialTimeStamp ), averagePeriod ( - DBL_MAX ),
mutex ( mutexIn ), pIIU ( 0 ), lastBeaconNumber ( initialBeaconNumber )
@@ -74,7 +72,7 @@ void bhe::beaconAnomalyNotify ( epicsGuard < epicsMutex > & guard )
}
#ifdef DEBUG
-void bhe::logBeacon ( const char * pDiagnostic,
+void bhe::logBeacon ( const char * pDiagnostic,
const double & currentPeriod,
const epicsTime & currentTime )
{
@@ -82,10 +80,10 @@ void bhe::logBeacon ( const char * pDiagnostic,
char name[64];
this->name ( name, sizeof ( name ) );
char date[64];
- currentTime.strftime ( date, sizeof ( date ),
+ currentTime.strftime ( date, sizeof ( date ),
"%a %b %d %Y %H:%M:%S.%f");
::printf ( "%s cp=%g ap=%g %s %s\n",
- pDiagnostic, currentPeriod,
+ pDiagnostic, currentPeriod,
this->averagePeriod, name, date );
}
}
@@ -105,7 +103,7 @@ void bhe::logBeaconDiscard ( unsigned beaconAdvance,
char name[64];
this->name ( name, sizeof ( name ) );
char date[64];
- currentTime.strftime ( date, sizeof ( date ),
+ currentTime.strftime ( date, sizeof ( date ),
"%a %b %d %Y %H:%M:%S.%f");
::printf ( "bb %u %s %s\n",
beaconAdvance, name, date );
@@ -123,16 +121,16 @@ void bhe::logBeaconDiscard ( unsigned /* beaconAdvance */,
*
* updates beacon period, and looks for beacon anomalies
*/
-bool bhe::updatePeriod (
- epicsGuard < epicsMutex > & guard, const epicsTime & programBeginTime,
- const epicsTime & currentTime, ca_uint32_t beaconNumber,
+bool bhe::updatePeriod (
+ epicsGuard < epicsMutex > & guard, const epicsTime & programBeginTime,
+ const epicsTime & currentTime, ca_uint32_t beaconNumber,
unsigned protocolRevision )
{
guard.assertIdenticalMutex ( this->mutex );
//
// this block is enetered if the beacon was created as a side effect of
- // creating a connection and so we dont yet know the first beacon time
+ // creating a connection and so we dont yet know the first beacon time
// and sequence number
//
if ( this->timeStamp == epicsTime () ) {
@@ -142,7 +140,7 @@ bool bhe::updatePeriod (
this->beaconAnomalyNotify ( guard );
- /*
+ /*
* this is the 1st beacon seen - the beacon time stamp
* was not initialized during BHE create because
* a TCP/IP connection created the beacon.
@@ -167,15 +165,15 @@ bool bhe::updatePeriod (
}
this->lastBeaconNumber = beaconNumber;
- // throw out sequence numbers just prior to, or the same as, the last one received
+ // throw out sequence numbers just prior to, or the same as, the last one received
// (this situation is probably caused by a temporary duplicate route )
if ( beaconSeqAdvance == 0 || beaconSeqAdvance > ca_uint32_max - 256 ) {
logBeaconDiscard ( beaconSeqAdvance, currentTime );
return false;
}
- // throw out sequence numbers that jump forward by only a few numbers
- // (this situation is probably caused by a duplicate route
+ // throw out sequence numbers that jump forward by only a few numbers
+ // (this situation is probably caused by a duplicate route
// or a beacon due to input queue overun)
if ( beaconSeqAdvance > 1 && beaconSeqAdvance < 4 ) {
logBeaconDiscard ( beaconSeqAdvance, currentTime );
@@ -205,7 +203,7 @@ bool bhe::updatePeriod (
/*
* ignore beacons seen for the first time shortly after
* init, but do not ignore beacons arriving with a short
- * period because the IOC was rebooted soon after the
+ * period because the IOC was rebooted soon after the
* client starts up.
*/
totalRunningTime = this->timeStamp - programBeginTime;
@@ -217,24 +215,24 @@ bool bhe::updatePeriod (
/*
* Is this an IOC seen because of a restored
- * network segment?
+ * network segment?
*
- * It may be possible to get false triggers here
+ * It may be possible to get false triggers here
* if the client is busy, but this does not cause
- * problems because the echo response will tell us
+ * problems because the echo response will tell us
* that the server is available
*/
if ( currentPeriod >= this->averagePeriod * 1.25 ) {
- /*
- * trigger on any missing beacon
+ /*
+ * trigger on any missing beacon
* if connected to this server
- */
+ */
this->beaconAnomalyNotify ( guard );
if ( currentPeriod >= this->averagePeriod * 3.25 ) {
- /*
- * trigger on any 3 contiguous missing beacons
+ /*
+ * trigger on any 3 contiguous missing beacons
* if not connected to this server
*/
netChange = true;
@@ -248,9 +246,9 @@ bool bhe::updatePeriod (
* IOC reboots). Lower tolarance here because we
* dont have to worry about lost beacons.
*
- * It may be possible to get false triggers here
+ * It may be possible to get false triggers here
* if the client is busy, but this does not cause
- * problems because the echo response will tell us
+ * problems because the echo response will tell us
* that the server is available
*/
else if ( currentPeriod <= this->averagePeriod * 0.80 ) {
@@ -259,14 +257,14 @@ bool bhe::updatePeriod (
logBeacon ( "bal", currentPeriod, currentTime );
}
else if ( this->pIIU ) {
- // update state of health for active virtual circuits
+ // update state of health for active virtual circuits
// if the beacon looks ok
this->pIIU->beaconArrivalNotify ( guard );
logBeacon ( "vb", currentPeriod, currentTime );
}
// update a running average period
- this->averagePeriod = currentPeriod * 0.125 +
+ this->averagePeriod = currentPeriod * 0.125 +
this->averagePeriod * 0.875;
}
@@ -286,22 +284,22 @@ void bhe::show ( epicsGuard < epicsMutex > &, unsigned level ) const
char host [64];
this->name ( host, sizeof ( host ) );
if ( this->averagePeriod == -DBL_MAX ) {
- ::printf ( "CA beacon hash entry for %s \n",
+ ::printf ( "CA beacon hash entry for %s \n",
host );
}
else {
- ::printf ( "CA beacon hash entry for %s with period estimate %f\n",
+ ::printf ( "CA beacon hash entry for %s with period estimate %f\n",
host, this->averagePeriod );
}
if ( level > 0u ) {
char date[64];
this->timeStamp.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S");
- ::printf ( "\tbeacon number %u, on %s\n",
+ ::printf ( "\tbeacon number %u, on %s\n",
this->lastBeaconNumber, date );
}
}
-double bhe::period ( epicsGuard < epicsMutex > & guard ) const
+double bhe::period ( epicsGuard < epicsMutex > & guard ) const
{
guard.assertIdenticalMutex ( this->mutex );
return this->averagePeriod;
@@ -313,14 +311,14 @@ epicsTime bhe::updateTime ( epicsGuard < epicsMutex > & guard ) const
return this->timeStamp;
}
-void bhe::registerIIU (
+void bhe::registerIIU (
epicsGuard < epicsMutex > & guard, tcpiiu & iiu )
{
guard.assertIdenticalMutex ( this->mutex );
this->pIIU = & iiu;
}
-void bhe::unregisterIIU (
+void bhe::unregisterIIU (
epicsGuard < epicsMutex > & guard, tcpiiu & iiu )
{
guard.assertIdenticalMutex ( this->mutex );
diff --git a/modules/ca/src/client/bhe.h b/modules/ca/src/client/bhe.h
index 4da95202a..7bd3f93b9 100644
--- a/modules/ca/src/client/bhe.h
+++ b/modules/ca/src/client/bhe.h
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -19,24 +18,15 @@
* Author: Jeff Hill
*/
-#ifndef bheh
-#define bheh
-
-#ifdef epicsExportSharedSymbols
-# define bhehEpicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_bhe_H
+#define INC_bhe_H
#include "tsDLList.h"
#include "tsFreeList.h"
#include "epicsTime.h"
#include "compilerDependencies.h"
-#ifdef bhehEpicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
+#include "libCaAPI.h"
#include "inetAddrID.h"
#include "caProto.h"
@@ -45,7 +35,7 @@ class bheMemoryManager;
// using a pure abstract wrapper class around the free list avoids
// Tornado 2.0.1 GNU compiler bugs
-class epicsShareClass bheMemoryManager {
+class LIBCA_API bheMemoryManager {
public:
virtual ~bheMemoryManager ();
virtual void * allocate ( size_t ) = 0;
@@ -54,24 +44,24 @@ public:
class bhe : public tsSLNode < bhe >, public inetAddrID {
public:
- epicsShareFunc bhe (
- epicsMutex &, const epicsTime & initialTimeStamp,
+ LIBCA_API bhe (
+ epicsMutex &, const epicsTime & initialTimeStamp,
unsigned initialBeaconNumber, const inetAddrID & addr );
- epicsShareFunc ~bhe ();
- epicsShareFunc bool updatePeriod (
+ LIBCA_API ~bhe ();
+ LIBCA_API bool updatePeriod (
epicsGuard < epicsMutex > &,
- const epicsTime & programBeginTime,
- const epicsTime & currentTime, ca_uint32_t beaconNumber,
+ const epicsTime & programBeginTime,
+ const epicsTime & currentTime, ca_uint32_t beaconNumber,
unsigned protocolRevision );
- epicsShareFunc double period ( epicsGuard < epicsMutex > & ) const;
- epicsShareFunc epicsTime updateTime ( epicsGuard < epicsMutex > & ) const;
- epicsShareFunc void show ( unsigned level ) const;
- epicsShareFunc void show ( epicsGuard < epicsMutex > &, unsigned /* level */ ) const;
- epicsShareFunc void registerIIU ( epicsGuard < epicsMutex > &, tcpiiu & );
- epicsShareFunc void unregisterIIU ( epicsGuard < epicsMutex > &, tcpiiu & );
- epicsShareFunc void * operator new ( size_t size, bheMemoryManager & );
+ LIBCA_API double period ( epicsGuard < epicsMutex > & ) const;
+ LIBCA_API epicsTime updateTime ( epicsGuard < epicsMutex > & ) const;
+ LIBCA_API void show ( unsigned level ) const;
+ LIBCA_API void show ( epicsGuard < epicsMutex > &, unsigned /* level */ ) const;
+ LIBCA_API void registerIIU ( epicsGuard < epicsMutex > &, tcpiiu & );
+ LIBCA_API void unregisterIIU ( epicsGuard < epicsMutex > &, tcpiiu & );
+ LIBCA_API void * operator new ( size_t size, bheMemoryManager & );
#ifdef CXX_PLACEMENT_DELETE
- epicsShareFunc void operator delete ( void *, bheMemoryManager & );
+ LIBCA_API void operator delete ( void *, bheMemoryManager & );
#endif
private:
epicsTime timeStamp;
@@ -80,14 +70,14 @@ private:
tcpiiu * pIIU;
ca_uint32_t lastBeaconNumber;
void beaconAnomalyNotify ( epicsGuard < epicsMutex > & );
- void logBeacon ( const char * pDiagnostic,
+ void logBeacon ( const char * pDiagnostic,
const double & currentPeriod,
const epicsTime & currentTime );
void logBeaconDiscard ( unsigned beaconAdvance,
const epicsTime & currentTime );
- bhe ( const bhe & );
- bhe & operator = ( const bhe & );
- epicsShareFunc void operator delete ( void * );
+ bhe ( const bhe & );
+ bhe & operator = ( const bhe & );
+ LIBCA_API void operator delete ( void * );
};
// using a wrapper class around the free list avoids
@@ -99,24 +89,24 @@ public:
void release ( void * );
private:
tsFreeList < bhe, 0x100 > freeList;
- bheFreeStore ( const bheFreeStore & );
- bheFreeStore & operator = ( const bheFreeStore & );
+ bheFreeStore ( const bheFreeStore & );
+ bheFreeStore & operator = ( const bheFreeStore & );
};
-inline void * bhe::operator new ( size_t size,
+inline void * bhe::operator new ( size_t size,
bheMemoryManager & mgr )
-{
+{
return mgr.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
-inline void bhe::operator delete ( void * pCadaver,
+inline void bhe::operator delete ( void * pCadaver,
bheMemoryManager & mgr )
-{
+{
mgr.release ( pCadaver );
}
#endif
-#endif // ifdef bheh
+#endif // ifndef INC_bhe_H
diff --git a/modules/ca/src/client/caConnTest.cpp b/modules/ca/src/client/caConnTest.cpp
index 21077398a..4a74f6cfb 100644
--- a/modules/ca/src/client/caConnTest.cpp
+++ b/modules/ca/src/client/caConnTest.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include
@@ -60,50 +59,50 @@ void caConnTest ( const char *pNameIn, unsigned channelCountIn, double delayIn )
{
unsigned iteration = 0u;
int status;
- unsigned i;
- chid *pChans;
+ unsigned i;
+ chid *pChans;
channelCount = channelCountIn;
pChans = new chid [channelCount];
-
- while ( 1 ) {
+
+ while ( 1 ) {
connCount = 0u;
subsequentConnect = false;
begin = epicsTime::getCurrent ();
printf ( "initializing CA client library\n" );
- status = ca_task_initialize();
- SEVCHK ( status, "CA init failed" );
+ status = ca_task_initialize();
+ SEVCHK ( status, "CA init failed" );
printf ( "creating channels\n" );
- for ( i = 0u; i < channelCount; i++ ) {
- status = ca_search_and_connect ( pNameIn,
+ for ( i = 0u; i < channelCount; i++ ) {
+ status = ca_search_and_connect ( pNameIn,
&pChans[i], caConnTestConnHandler, 0 );
- SEVCHK ( status, "CA search problems" );
- }
+ SEVCHK ( status, "CA search problems" );
+ }
printf ( "all channels were created\n" );
- ca_pend_event ( delayIn );
+ ca_pend_event ( delayIn );
if ( iteration & 1 ) {
- for ( i = 0u; i < channelCount; i++ ) {
- status = ca_clear_channel ( pChans[i] );
- SEVCHK ( status, "ca_clear_channel() problems" );
- }
+ for ( i = 0u; i < channelCount; i++ ) {
+ status = ca_clear_channel ( pChans[i] );
+ SEVCHK ( status, "ca_clear_channel() problems" );
+ }
printf ( "all channels were destroyed\n" );
}
printf ( "shutting down CA client library\n" );
- status = ca_task_exit ();
- SEVCHK ( status, "task exit problems" );
+ status = ca_task_exit ();
+ SEVCHK ( status, "task exit problems" );
iteration++;
- }
+ }
//delete [] pChans;
}
diff --git a/modules/ca/src/client/caConnTestMain.cpp b/modules/ca/src/client/caConnTestMain.cpp
index f3985801a..aaab0f1d2 100644
--- a/modules/ca/src/client/caConnTestMain.cpp
+++ b/modules/ca/src/client/caConnTestMain.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include
diff --git a/modules/ca/src/client/caDiagnostics.h b/modules/ca/src/client/caDiagnostics.h
index 90221e1ed..d495ebbdd 100644
--- a/modules/ca/src/client/caDiagnostics.h
+++ b/modules/ca/src/client/caDiagnostics.h
@@ -3,13 +3,12 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-#ifndef caDiagnosticsh
-#define caDiagnosticsh
+#ifndef INC_caDiagnostics_H
+#define INC_caDiagnostics_H
#include "cadef.h"
@@ -20,8 +19,8 @@ extern "C" {
enum appendNumberFlag {appendNumber, dontAppendNumber};
int catime ( const char *channelName, unsigned channelCount, enum appendNumberFlag appNF );
-int acctst ( const char *pname, unsigned logggingInterestLevel,
- unsigned channelCount, unsigned repetitionCount,
+int acctst ( const char *pname, unsigned logggingInterestLevel,
+ unsigned channelCount, unsigned repetitionCount,
enum ca_preemptive_callback_select select );
#define CATIME_OK 0
@@ -33,6 +32,6 @@ int acctst ( const char *pname, unsigned logggingInterestLevel,
void caConnTest ( const char *pNameIn, unsigned channelCountIn, double delayIn );
-#endif /* caDiagnosticsh */
+#endif /* ifndef INC_caDiagnostics_H */
diff --git a/modules/ca/src/client/caEventRate.cpp b/modules/ca/src/client/caEventRate.cpp
index 8beb16333..be6c4f2d9 100644
--- a/modules/ca/src/client/caEventRate.cpp
+++ b/modules/ca/src/client/caEventRate.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include
@@ -38,50 +37,50 @@ void caEventRate ( const char *pName, unsigned count )
chid * pChidTable = new chid [ count ];
{
- printf ( "Connecting to CA Channel \"%s\" %u times.",
+ printf ( "Connecting to CA Channel \"%s\" %u times.",
pName, count );
fflush ( stdout );
-
+
epicsTime begin = epicsTime::getCurrent ();
for ( unsigned i = 0u; i < count; i++ ) {
int status = ca_search ( pName, & pChidTable[i] );
SEVCHK ( status, NULL );
}
-
+
int status = ca_pend_io ( 10000.0 );
if ( status != ECA_NORMAL ) {
fprintf ( stderr, " not found.\n" );
return;
}
epicsTime end = epicsTime::getCurrent ();
-
+
printf ( " done(%f sec).\n", end - begin );
}
{
printf ( "Subscribing %u times.", count );
fflush ( stdout );
-
+
epicsTime begin = epicsTime::getCurrent ();
for ( unsigned i = 0u; i < count; i++ ) {
- int addEventStatus = ca_add_event ( DBR_FLOAT,
+ int addEventStatus = ca_add_event ( DBR_FLOAT,
pChidTable[i], eventCallBack, &eventCount, NULL);
SEVCHK ( addEventStatus, __FILE__ );
}
-
+
int status = ca_flush_io ();
SEVCHK ( status, __FILE__ );
-
+
epicsTime end = epicsTime::getCurrent ();
-
+
printf ( " done(%f sec).\n", end - begin );
}
-
+
{
printf ( "Waiting for initial value events." );
fflush ( stdout );
-
- // let the first one go by
+
+ // let the first one go by
epicsTime begin = epicsTime::getCurrent ();
while ( eventCount < count ) {
int status = ca_pend_event ( 0.01 );
@@ -90,7 +89,7 @@ void caEventRate ( const char *pName, unsigned count )
}
}
epicsTime end = epicsTime::getCurrent ();
-
+
printf ( " done(%f sec).\n", end - begin );
}
@@ -128,7 +127,7 @@ void caEventRate ( const char *pName, unsigned count )
double mean = X / N;
double stdDev = sqrt ( XX / N - mean * mean );
- printf ( "CA Event Rate (Hz): current %g mean %g std dev %g\n",
+ printf ( "CA Event Rate (Hz): current %g mean %g std dev %g\n",
Hz, mean, stdDev );
if ( samplePeriod < maxSamplePeriod ) {
diff --git a/modules/ca/src/client/caEventRateMain.cpp b/modules/ca/src/client/caEventRateMain.cpp
index 725e66102..f773c5de4 100644
--- a/modules/ca/src/client/caEventRateMain.cpp
+++ b/modules/ca/src/client/caEventRateMain.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include
diff --git a/modules/ca/src/client/caProto.h b/modules/ca/src/client/caProto.h
index 781c89b34..43e4c225c 100644
--- a/modules/ca/src/client/caProto.h
+++ b/modules/ca/src/client/caProto.h
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -14,15 +13,15 @@
* 505 665 1831
*/
-#ifndef __CAPROTO__
-#define __CAPROTO__
+#ifndef INC_caProto_H
+#define INC_caProto_H
#define capStrOf(A) #A
#define capStrOfX(A) capStrOf ( A )
-/*
+/*
* CA protocol revision
- * TCP/UDP port number (bumped each major protocol change)
+ * TCP/UDP port number (bumped each major protocol change)
*/
#define CA_MAJOR_PROTOCOL_REVISION 4
#define CA_VERSION_STRING( MINOR_REVISION ) \
@@ -30,7 +29,7 @@
#define CA_UKN_MINOR_VERSION 0u /* unknown minor version */
#define CA_MINIMUM_SUPPORTED_VERSION 4u
# define CA_VSUPPORTED(MINOR) ((MINOR)>=CA_MINIMUM_SUPPORTED_VERSION)
-# define CA_V41(MINOR) ((MINOR)>=1u)
+# define CA_V41(MINOR) ((MINOR)>=1u)
# define CA_V42(MINOR) ((MINOR)>=2u)
# define CA_V43(MINOR) ((MINOR)>=3u)
# define CA_V44(MINOR) ((MINOR)>=4u)
@@ -45,8 +44,8 @@
# define CA_V413(MINOR) ((MINOR)>=13u) /* Allow zero length in requests. */
/*
- * These port numbers are only used if the CA repeater and
- * CA server port numbers cant be obtained from the EPICS
+ * These port numbers are only used if the CA repeater and
+ * CA server port numbers cant be obtained from the EPICS
* environment variables "EPICS_CA_REPEATER_PORT" and
* "EPICS_CA_SERVER_PORT"
*/
@@ -54,8 +53,8 @@
#define CA_SERVER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u)
#define CA_REPEATER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u+1u)
-/*
- * 1500 (max of ethernet and 802.{2,3} MTU) - 20(IP) - 8(UDP)
+/*
+ * 1500 (max of ethernet and 802.{2,3} MTU) - 20(IP) - 8(UDP)
* (the MTU of Ethernet is currently independent of its speed varient)
*/
#define ETHERNET_MAX_UDP ( 1500u - 20u - 8u )
@@ -89,10 +88,10 @@ typedef ca_uint32_t caResId;
#define CA_PROTO_SNAPSHOT 5u /* snapshot of the system */
#define CA_PROTO_SEARCH 6u /* IOC channel search */
#define CA_PROTO_BUILD 7u /* build - obsolete */
-#define CA_PROTO_EVENTS_OFF 8u /* flow control */
-#define CA_PROTO_EVENTS_ON 9u /* flow control */
-#define CA_PROTO_READ_SYNC 10u /* purge old reads */
-#define CA_PROTO_ERROR 11u /* an operation failed */
+#define CA_PROTO_EVENTS_OFF 8u /* flow control */
+#define CA_PROTO_EVENTS_ON 9u /* flow control */
+#define CA_PROTO_READ_SYNC 10u /* purge old reads */
+#define CA_PROTO_ERROR 11u /* an operation failed */
#define CA_PROTO_CLEAR_CHANNEL 12u /* free chan resources */
#define CA_PROTO_RSRV_IS_UP 13u /* CA server has joined the net */
#define CA_PROTO_NOT_FOUND 14u /* channel not found */
@@ -172,7 +171,7 @@ typedef struct ca_hdr {
*/
struct mon_info {
ca_float32_t m_lval; /* low delta */
- ca_float32_t m_hval; /* high delta */
+ ca_float32_t m_hval; /* high delta */
ca_float32_t m_toval; /* period btween samples */
ca_uint16_t m_mask; /* event select mask */
ca_uint16_t m_pad; /* extend to 32 bits */
@@ -183,5 +182,5 @@ struct mon_info {
*/
#define unreasonablePVNameSize 500u
-#endif /* __CAPROTO__ */
+#endif /* ifndef INC_caProto_H */
diff --git a/modules/ca/src/client/caRepeater.cpp b/modules/ca/src/client/caRepeater.cpp
index 03cb8957d..a9cefbdf7 100644
--- a/modules/ca/src/client/caRepeater.cpp
+++ b/modules/ca/src/client/caRepeater.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -31,12 +30,65 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
+#include
+
+#if !defined(_WIN32) && !defined(__rtems__) && !defined(vxWorks)
+# include
+# include
+# include
+#define CAN_DETACH_STDINOUT
+#endif
+
#include "epicsAssert.h"
#include "osiUnistd.h"
+#include "epicsGetopt.h"
#include "udpiiu.h"
-int main()
+static void usage(char* argv[])
{
+ fprintf(stderr, "Usage: %s -hv\n"
+ "\n"
+ " -h - Print this message\n"
+ " -v - Do not replace stdin/out/err with /dev/null\n",
+ argv[0]);
+}
+
+int main(int argc, char* argv[])
+{
+ bool detachinout = true;
+
+ int opt;
+ while ((opt = getopt(argc, argv, "hv")) != -1) {
+ switch (opt) {
+ default:
+ usage(argv);
+ fprintf(stderr, "\nUnknown argument '%c'\n", opt);
+ return 1;
+ case 'h':
+ usage(argv);
+ return 0;
+ case 'v':
+ detachinout = false;
+ break;
+ }
+ }
+
+#ifdef CAN_DETACH_STDINOUT
+ if(detachinout) {
+ int readfd = open("/dev/null", O_RDONLY);
+ int writefd = open("/dev/null", O_WRONLY);
+
+ dup2(readfd, 0);
+ dup2(writefd, 1);
+ dup2(writefd, 2);
+
+ close(readfd);
+ close(writefd);
+ }
+#else
+ (void)detachinout;
+#endif
+
chdir ( "/" );
ca_repeater ();
return ( 0 );
diff --git a/modules/ca/src/client/caServerID.h b/modules/ca/src/client/caServerID.h
index 08bfdd5df..de4441a42 100644
--- a/modules/ca/src/client/caServerID.h
+++ b/modules/ca/src/client/caServerID.h
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -18,8 +17,8 @@
* Author: Jeff Hill
*/
-#ifndef caServerIDh
-#define caServerIDh
+#ifndef INC_caServerID_H
+#define INC_caServerID_H
#include "osiSock.h"
#include "resourceLib.h"
@@ -37,7 +36,7 @@ private:
ca_uint8_t pri;
};
-inline caServerID::caServerID (
+inline caServerID::caServerID (
const struct sockaddr_in & addrIn, unsigned priorityIn ) :
addr ( addrIn ), pri ( static_cast ( priorityIn ) )
{
@@ -46,7 +45,7 @@ inline caServerID::caServerID (
inline bool caServerID::operator == ( const caServerID & rhs ) const
{
- if ( this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr &&
+ if ( this->addr.sin_addr.s_addr == rhs.addr.sin_addr.s_addr &&
this->addr.sin_port == rhs.addr.sin_port &&
this->pri == rhs.pri ) {
return true;
@@ -67,7 +66,7 @@ inline resTableIndex caServerID::hash () const
index ^= this->addr.sin_port;
index ^= this->addr.sin_port >> 8u;
index ^= this->pri;
- return integerHash ( caServerMinIndexBitWidth,
+ return integerHash ( caServerMinIndexBitWidth,
caServerMaxIndexBitWidth, index );
}
@@ -83,6 +82,4 @@ inline unsigned caServerID::priority () const
return this->pri;
}
-#endif // ifdef caServerID
-
-
+#endif // ifdef INC_caServerID_H
diff --git a/modules/ca/src/client/caVersion.h b/modules/ca/src/client/caVersion.h
deleted file mode 100644
index cdae17dce..000000000
--- a/modules/ca/src/client/caVersion.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*************************************************************************\
-* Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne
-* National Laboratory.
-* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
-\*************************************************************************/
-
-#ifndef CAVERSION_H
-#define CAVERSION_H
-
-#include
-#include
-
-#ifndef VERSION_INT
-# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
-#endif
-
-/* include generated headers with:
- * EPICS_CA_MAJOR_VERSION
- * EPICS_CA_MINOR_VERSION
- * EPICS_CA_MAINTENANCE_VERSION
- * EPICS_CA_DEVELOPMENT_FLAG
- */
-#include "caVersionNum.h"
-
-#define CA_VERSION_INT VERSION_INT(EPICS_CA_MAJOR_VERSION, EPICS_CA_MINOR_VERSION, EPICS_CA_MAINTENANCE_VERSION, 0)
-
-#endif // CAVERSION_H
diff --git a/modules/ca/src/client/caVersion.h@ b/modules/ca/src/client/caVersion.h@
new file mode 100644
index 000000000..f9225c53a
--- /dev/null
+++ b/modules/ca/src/client/caVersion.h@
@@ -0,0 +1,21 @@
+/*************************************************************************\
+* Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne
+* National Laboratory.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
+\*************************************************************************/
+
+#ifndef INC_caVersion_H
+#define INC_caVersion_H
+
+#define EPICS_CA_MAJOR_VERSION @EPICS_CA_MAJOR_VERSION@
+#define EPICS_CA_MINOR_VERSION @EPICS_CA_MINOR_VERSION@
+#define EPICS_CA_MAINTENANCE_VERSION @EPICS_CA_MAINTENANCE_VERSION@
+#define EPICS_CA_DEVELOPMENT_FLAG @EPICS_CA_DEVELOPMENT_FLAG@
+
+#include
+
+#define CA_VERSION_INT VERSION_INT(EPICS_CA_MAJOR_VERSION, \
+ EPICS_CA_MINOR_VERSION, EPICS_CA_MAINTENANCE_VERSION, 0)
+
+#endif /* INC_caVersion_H */
diff --git a/modules/ca/src/client/caVersionNum.h@ b/modules/ca/src/client/caVersionNum.h@
deleted file mode 100644
index 26ce6e1af..000000000
--- a/modules/ca/src/client/caVersionNum.h@
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef CAVERSION_H
-# error include caVersion.h, not this header
-#endif
-#define EPICS_CA_MAJOR_VERSION @EPICS_CA_MAJOR_VERSION@
-#define EPICS_CA_MINOR_VERSION @EPICS_CA_MINOR_VERSION@
-#define EPICS_CA_MAINTENANCE_VERSION @EPICS_CA_MAINTENANCE_VERSION@
-#define EPICS_CA_DEVELOPMENT_FLAG @EPICS_CA_DEVELOPMENT_FLAG@
diff --git a/modules/ca/src/client/ca_client_context.cpp b/modules/ca/src/client/ca_client_context.cpp
index 3fd0512d6..4430ea0ad 100644
--- a/modules/ca/src/client/ca_client_context.cpp
+++ b/modules/ca/src/client/ca_client_context.cpp
@@ -17,9 +17,9 @@
* Copyright, 1986, The Regents of the University of California.
*
*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#ifdef _MSC_VER
@@ -34,12 +34,11 @@
#include "errlog.h"
#include "locationException.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
#include "cac.h"
-epicsShareDef epicsThreadPrivateId caClientCallbackThreadId;
+epicsThreadPrivateId caClientCallbackThreadId;
static epicsThreadOnceId cacOnce = EPICS_THREAD_ONCE_INIT;
@@ -475,7 +474,7 @@ int ca_client_context::pendIO ( const double & timeout )
}
int status = ECA_NORMAL;
- epicsTime beg_time = epicsTime::getMonotonic ();
+ epicsTime beg_time = epicsTime::getCurrent ();
double remaining = timeout;
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -493,7 +492,7 @@ int ca_client_context::pendIO ( const double & timeout )
this->blockForEventAndEnableCallbacks ( this->ioDone, remaining );
}
- double delay = epicsTime::getMonotonic () - beg_time;
+ double delay = epicsTime::getCurrent () - beg_time;
if ( delay < timeout ) {
remaining = timeout - delay;
}
@@ -522,7 +521,7 @@ int ca_client_context::pendEvent ( const double & timeout )
return ECA_EVDISALLOW;
}
- epicsTime current = epicsTime::getMonotonic ();
+ epicsTime current = epicsTime::getCurrent ();
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -563,7 +562,7 @@ int ca_client_context::pendEvent ( const double & timeout )
this->noWakeupSincePend = true;
}
- double elapsed = epicsTime::getMonotonic() - current;
+ double elapsed = epicsTime::getCurrent() - current;
double delay;
if ( timeout > elapsed ) {
@@ -736,12 +735,12 @@ void ca_client_context::installDefaultService ( cacService & service )
ca_client_context::pDefaultService = & service;
}
-void epicsShareAPI caInstallDefaultService ( cacService & service )
+void epicsStdCall caInstallDefaultService ( cacService & service )
{
ca_client_context::installDefaultService ( service );
}
-epicsShareFunc int epicsShareAPI ca_clear_subscription ( evid pMon )
+LIBCA_API int epicsStdCall ca_clear_subscription ( evid pMon )
{
oldChannelNotify & chan = pMon->channel ();
ca_client_context & cac = chan.getClientCtx ();
diff --git a/modules/ca/src/client/cac.cpp b/modules/ca/src/client/cac.cpp
index 476d1c380..070feb2e1 100644
--- a/modules/ca/src/client/cac.cpp
+++ b/modules/ca/src/client/cac.cpp
@@ -34,7 +34,6 @@
#include "errlog.h"
#include "epicsExport.h"
-#define epicsExportSharedSymbols
#include "addrList.h"
#include "iocinf.h"
#include "cac.h"
@@ -130,7 +129,7 @@ cac::cac (
epicsMutex & callbackControlIn,
cacContextNotify & notifyIn ) :
_refLocalHostName ( localHostNameCache.getReference () ),
- programBeginTime ( epicsTime::getMonotonic() ),
+ programBeginTime ( epicsTime::getCurrent() ),
connTMO ( CA_CONN_VERIFY_PERIOD ),
mutex ( mutualExclusionIn ),
cbMutex ( callbackControlIn ),
@@ -155,7 +154,7 @@ cac::cac (
}
try {
- long status;
+ long status;
/*
* Certain os, such as HPUX, do not unblock a socket system call
diff --git a/modules/ca/src/client/cac.h b/modules/ca/src/client/cac.h
index 7db5c6ddc..018ce30f4 100644
--- a/modules/ca/src/client/cac.h
+++ b/modules/ca/src/client/cac.h
@@ -19,13 +19,8 @@
*
*/
-#ifndef cach
-#define cach
-
-#ifdef epicsExportSharedSymbols
-# define cach_restore_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_cac_H
+#define INC_cac_H
#include "compilerDependencies.h"
#include "ipAddrToAsciiAsynchronous.h"
@@ -35,11 +30,7 @@
#include "freeList.h"
#include "localHostName.h"
-#ifdef cach_restore_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
+#include "libCaAPI.h"
#include "nciu.h"
#include "comBuf.h"
#include "bhe.h"
@@ -81,8 +72,8 @@ public:
void release ( void * );
private:
tsFreeList < comBuf, 0x20 > freeList;
- cacComBufMemoryManager ( const cacComBufMemoryManager & );
- cacComBufMemoryManager & operator = ( const cacComBufMemoryManager & );
+ cacComBufMemoryManager ( const cacComBufMemoryManager & );
+ cacComBufMemoryManager & operator = ( const cacComBufMemoryManager & );
};
class notifyGuard {
@@ -348,8 +339,8 @@ private:
const char *pCtx, unsigned status );
static const pExcepProtoStubTCP tcpExcepJumpTableCAC [];
- cac ( const cac & );
- cac & operator = ( const cac & );
+ cac ( const cac & );
+ cac & operator = ( const cac & );
friend class tcpiiu;
};
@@ -432,4 +423,4 @@ inline double cac ::
return this->connTMO;
}
-#endif // ifdef cach
+#endif // ifndef INC_cac_H
diff --git a/modules/ca/src/client/cacChannel.cpp b/modules/ca/src/client/cacChannel.cpp
index c1a52a002..0720ced51 100644
--- a/modules/ca/src/client/cacChannel.cpp
+++ b/modules/ca/src/client/cacChannel.cpp
@@ -3,13 +3,12 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -27,7 +26,6 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "localHostName.h"
#include "cacIO.h"
@@ -41,7 +39,7 @@ private:
epicsSingleton < localHostName > :: reference
_refLocalHostName;
};
-
+
static epicsThreadOnceId cacChannelIdOnce = EPICS_THREAD_ONCE_INIT;
const cacChannel::priLev cacChannel::priorityMax = 99u;
@@ -55,63 +53,63 @@ cacChannel::~cacChannel ()
{
}
-caAccessRights cacChannel::accessRights (
- epicsGuard < epicsMutex > & ) const
+caAccessRights cacChannel::accessRights (
+ epicsGuard < epicsMutex > & ) const
{
static caAccessRights ar ( true, true );
return ar;
}
-unsigned cacChannel::searchAttempts (
- epicsGuard < epicsMutex > & ) const
+unsigned cacChannel::searchAttempts (
+ epicsGuard < epicsMutex > & ) const
{
return 0u;
}
-double cacChannel::beaconPeriod (
- epicsGuard < epicsMutex > & ) const
+double cacChannel::beaconPeriod (
+ epicsGuard < epicsMutex > & ) const
{
return - DBL_MAX;
}
-double cacChannel::receiveWatchdogDelay (
+double cacChannel::receiveWatchdogDelay (
epicsGuard < epicsMutex > & ) const
{
return - DBL_MAX;
}
bool cacChannel::ca_v42_ok (
- epicsGuard < epicsMutex > & ) const
+ epicsGuard < epicsMutex > & ) const
{
return true;
}
bool cacChannel::connected (
- epicsGuard < epicsMutex > & ) const
+ epicsGuard < epicsMutex > & ) const
{
return true;
}
-CACChannelPrivate ::
+CACChannelPrivate ::
CACChannelPrivate() :
_refLocalHostName ( localHostNameCache.getReference () )
{
}
-inline unsigned CACChannelPrivate ::
+inline unsigned CACChannelPrivate ::
getHostName ( char * pBuf, unsigned bufLength )
{
return _refLocalHostName->getName ( pBuf, bufLength );
}
-
-inline const char * CACChannelPrivate ::
+
+inline const char * CACChannelPrivate ::
pHostName ()
{
return _refLocalHostName->pointer ();
}
static CACChannelPrivate * pCACChannelPrivate = 0;
-
+
// runs once only for each process
extern "C" void cacChannelSetup ( void * )
{
@@ -119,7 +117,7 @@ extern "C" void cacChannelSetup ( void * )
}
// the default is to assume that it is a locally hosted channel
-unsigned cacChannel::getHostName (
+unsigned cacChannel::getHostName (
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLength ) const throw ()
{
diff --git a/modules/ca/src/client/cacChannelNotify.cpp b/modules/ca/src/client/cacChannelNotify.cpp
index 08d2cab94..cb231d848 100644
--- a/modules/ca/src/client/cacChannelNotify.cpp
+++ b/modules/ca/src/client/cacChannelNotify.cpp
@@ -3,32 +3,29 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include "iocinf.h"
-#define epicsExportSharedSymbols
#include "cacIO.h"
-#undef epicsExportSharedSymbols
-cacChannelNotify::~cacChannelNotify ()
+cacChannelNotify::~cacChannelNotify ()
{
}
diff --git a/modules/ca/src/client/cacContextNotify.cpp b/modules/ca/src/client/cacContextNotify.cpp
index a4498ac04..2c36ba06d 100644
--- a/modules/ca/src/client/cacContextNotify.cpp
+++ b/modules/ca/src/client/cacContextNotify.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -23,19 +22,17 @@
#include "iocinf.h"
-#define epicsExportSharedSymbols
#include "cacIO.h"
-#undef epicsExportSharedSymbols
cacContextNotify::~cacContextNotify ()
{
}
-void cacContextNotify::callbackProcessingInitiateNotify ()
+void cacContextNotify::callbackProcessingInitiateNotify ()
{
}
-void cacContextNotify::callbackProcessingCompleteNotify ()
+void cacContextNotify::callbackProcessingCompleteNotify ()
{
}
diff --git a/modules/ca/src/client/cacIO.h b/modules/ca/src/client/cacIO.h
index 4e8af4a05..627a6b1dd 100644
--- a/modules/ca/src/client/cacIO.h
+++ b/modules/ca/src/client/cacIO.h
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -17,13 +16,13 @@
* Copyright, 1986, The Regents of the University of California.
*
*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef cacIOh
-#define cacIOh
+#ifndef INC_cacIO_H
+#define INC_cacIO_H
//
// Open Issues
@@ -47,20 +46,12 @@
#include
#include
-#ifdef epicsExportSharedSymbols
-# define cacIOh_restore_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
-
#include "tsDLList.h"
#include "epicsMutex.h"
#include "epicsGuard.h"
#include "epicsThread.h"
-#ifdef cacIOh_restore_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
class cacChannel;
@@ -69,7 +60,7 @@ typedef unsigned long arrayElementCount;
// 1) this should not be passing caerr.h status to the exception callback
// 2) needless-to-say the data should be passed here using the new data access API
-class epicsShareClass cacWriteNotify {
+class LIBCA_API cacWriteNotify {
public:
virtual ~cacWriteNotify () = 0;
virtual void completion ( epicsGuard < epicsMutex > & ) = 0;
@@ -82,7 +73,7 @@ public:
// 1) this should not be passing caerr.h status to the exception callback
// 2) needless-to-say the data should be passed here using the new data access API
-class epicsShareClass cacReadNotify {
+class LIBCA_API cacReadNotify {
public:
virtual ~cacReadNotify () = 0;
virtual void completion (
@@ -97,7 +88,7 @@ public:
// 1) this should not be passing caerr.h status to the exception callback
// 2) needless-to-say the data should be passed here using the new data access API
-class epicsShareClass cacStateNotify {
+class LIBCA_API cacStateNotify {
public:
virtual ~cacStateNotify () = 0;
virtual void current (
@@ -131,7 +122,7 @@ private:
bool f_operatorConfirmationRequest:1;
};
-class epicsShareClass cacChannelNotify {
+class LIBCA_API cacChannelNotify {
public:
virtual ~cacChannelNotify () = 0;
virtual void connectNotify ( epicsGuard < epicsMutex > & ) = 0;
@@ -169,7 +160,7 @@ private:
// but perhaps is a bad practice that should be eliminated? If so,
// then the IO should not store or use a pointer to the channel.
//
-class epicsShareClass cacChannel {
+class LIBCA_API cacChannel {
public:
typedef unsigned priLev;
static const priLev priorityMax;
@@ -273,11 +264,11 @@ protected:
private:
cacChannelNotify & callback;
- cacChannel ( const cacChannel & );
- cacChannel & operator = ( const cacChannel & );
+ cacChannel ( const cacChannel & );
+ cacChannel & operator = ( const cacChannel & );
};
-class epicsShareClass cacContext {
+class LIBCA_API cacContext {
public:
virtual ~cacContext ();
virtual cacChannel & createChannel (
@@ -296,7 +287,7 @@ public:
epicsGuard < epicsMutex > &, unsigned level ) const = 0;
};
-class epicsShareClass cacContextNotify {
+class LIBCA_API cacContextNotify {
public:
virtual ~cacContextNotify () = 0;
virtual cacContext & createNetworkContext (
@@ -316,7 +307,7 @@ public:
// **** Lock Hierarchy ****
// callbackControl must be taken before mutualExclusion if both are held at
// the same time
-class epicsShareClass cacService {
+class LIBCA_API cacService {
public:
virtual ~cacService () = 0;
virtual cacContext & contextCreate (
@@ -325,9 +316,9 @@ public:
cacContextNotify & ) = 0;
};
-epicsShareFunc void epicsShareAPI caInstallDefaultService ( cacService & service );
+LIBCA_API void epicsStdCall caInstallDefaultService ( cacService & service );
-epicsShareExtern epicsThreadPrivateId caClientCallbackThreadId;
+LIBCA_API extern epicsThreadPrivateId caClientCallbackThreadId;
inline cacChannel::cacChannel ( cacChannelNotify & notify ) :
callback ( notify )
@@ -389,4 +380,4 @@ inline bool caAccessRights::operatorConfirmationRequest () const
return this->f_operatorConfirmationRequest;
}
-#endif // ifndef cacIOh
+#endif // ifndef INC_cacIO_H
diff --git a/modules/ca/src/client/cacReadNotify.cpp b/modules/ca/src/client/cacReadNotify.cpp
index 23284c8df..2361f73fb 100644
--- a/modules/ca/src/client/cacReadNotify.cpp
+++ b/modules/ca/src/client/cacReadNotify.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -21,9 +20,7 @@
#include "iocinf.h"
-#define epicsExportSharedSymbols
#include "cacIO.h"
-#undef epicsExportSharedSymbols
cacReadNotify::~cacReadNotify ()
{
diff --git a/modules/ca/src/client/cacStateNotify.cpp b/modules/ca/src/client/cacStateNotify.cpp
index 08852489a..b9da1240c 100644
--- a/modules/ca/src/client/cacStateNotify.cpp
+++ b/modules/ca/src/client/cacStateNotify.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -21,9 +20,7 @@
#include "iocinf.h"
-#define epicsExportSharedSymbols
#include "cacIO.h"
-#undef epicsExportSharedSymbols
cacStateNotify::~cacStateNotify ()
{
diff --git a/modules/ca/src/client/cacWriteNotify.cpp b/modules/ca/src/client/cacWriteNotify.cpp
index 13d47cd45..4ed642d93 100644
--- a/modules/ca/src/client/cacWriteNotify.cpp
+++ b/modules/ca/src/client/cacWriteNotify.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -21,9 +20,7 @@
#include "iocinf.h"
-#define epicsExportSharedSymbols
#include "cacIO.h"
-#undef epicsExportSharedSymbols
cacWriteNotify::~cacWriteNotify ()
{
diff --git a/modules/ca/src/client/cadef.h b/modules/ca/src/client/cadef.h
index e62dd7249..5ed215584 100644
--- a/modules/ca/src/client/cadef.h
+++ b/modules/ca/src/client/cadef.h
@@ -3,11 +3,10 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -21,8 +20,8 @@
*
*/
-#ifndef INCLcadefh
-#define INCLcadefh
+#ifndef INC_cadef_H
+#define INC_cadef_H
/*
* done in two ifdef steps so that we will remain compatible with
@@ -32,19 +31,9 @@
# include
#endif
-#ifdef epicsExportSharedSymbols
-# define INCLcadefh_accessh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
-
#include "epicsThread.h"
-#ifdef INCLcadefh_accessh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
-
+#include "libCaAPI.h"
#include "caerr.h"
#include "db_access.h"
#include "caeventmask.h"
@@ -83,8 +72,8 @@ typedef void caArh (struct access_rights_handler_args args);
/* The conversion routine to call for each type */
#define VALID_TYPE(TYPE) (((unsigned short)TYPE)<=LAST_BUFFER_TYPE)
-/*
- * Arguments passed to event handlers and get/put call back handlers.
+/*
+ * Arguments passed to event handlers and get/put call back handlers.
*
* The status field below is the CA ECA_XXX status of the requested
* operation which is saved from when the operation was attempted in the
@@ -95,14 +84,14 @@ typedef void caArh (struct access_rights_handler_args args);
typedef struct event_handler_args {
void *usr; /* user argument supplied with request */
chanId chid; /* channel id */
- long type; /* the type of the item returned */
+ long type; /* the type of the item returned */
long count; /* the element count of the item returned */
const void *dbr; /* a pointer to the item returned */
int status; /* ECA_XXX status of the requested op from the server */
} evargs;
typedef void caEventCallBackFunc (struct event_handler_args);
-epicsShareFunc void epicsShareAPI ca_test_event
+LIBCA_API void epicsStdCall ca_test_event
(
struct event_handler_args
);
@@ -133,8 +122,8 @@ typedef unsigned CA_SYNC_GID;
#define CA_OP_CLEAR_EVENT 4
#define CA_OP_OTHER 5
-/*
- * used with connection_handler_args
+/*
+ * used with connection_handler_args
*/
#define CA_OP_CONN_UP 6
#define CA_OP_CONN_DOWN 7
@@ -158,46 +147,46 @@ typedef unsigned CA_SYNC_GID;
#define TYPENOTCONN (-1) /* the channel's native type when disconnected */
-epicsShareFunc short epicsShareAPI ca_field_type (chid chan);
-epicsShareFunc unsigned long epicsShareAPI ca_element_count (chid chan);
-epicsShareFunc const char * epicsShareAPI ca_name (chid chan);
-epicsShareFunc void epicsShareAPI ca_set_puser (chid chan, void *puser);
-epicsShareFunc void * epicsShareAPI ca_puser (chid chan);
-epicsShareFunc unsigned epicsShareAPI ca_read_access (chid chan);
-epicsShareFunc unsigned epicsShareAPI ca_write_access (chid chan);
+LIBCA_API short epicsStdCall ca_field_type (chid chan);
+LIBCA_API unsigned long epicsStdCall ca_element_count (chid chan);
+LIBCA_API const char * epicsStdCall ca_name (chid chan);
+LIBCA_API void epicsStdCall ca_set_puser (chid chan, void *puser);
+LIBCA_API void * epicsStdCall ca_puser (chid chan);
+LIBCA_API unsigned epicsStdCall ca_read_access (chid chan);
+LIBCA_API unsigned epicsStdCall ca_write_access (chid chan);
/*
- * cs_ - `channel state'
- *
+ * cs_ - `channel state'
+ *
* cs_never_conn valid chid, IOC not found
* cs_prev_conn valid chid, IOC was found, but unavailable
* cs_conn valid chid, IOC was found, still available
* cs_closed channel deleted by user
*/
enum channel_state {cs_never_conn, cs_prev_conn, cs_conn, cs_closed};
-epicsShareFunc enum channel_state epicsShareAPI ca_state (chid chan);
+LIBCA_API enum channel_state epicsStdCall ca_state (chid chan);
/************************************************************************/
/* Perform Library Initialization */
/* */
/* Must be called once before calling any of the other routines */
/************************************************************************/
-epicsShareFunc int epicsShareAPI ca_task_initialize (void);
-enum ca_preemptive_callback_select
+LIBCA_API int epicsStdCall ca_task_initialize (void);
+enum ca_preemptive_callback_select
{ ca_disable_preemptive_callback, ca_enable_preemptive_callback };
-epicsShareFunc int epicsShareAPI
+LIBCA_API int epicsStdCall
ca_context_create (enum ca_preemptive_callback_select select);
-epicsShareFunc void epicsShareAPI ca_detach_context ();
+LIBCA_API void epicsStdCall ca_detach_context ();
/************************************************************************/
/* Remove CA facility from your task */
/* */
/* Normally called automatically at task exit */
/************************************************************************/
-epicsShareFunc int epicsShareAPI ca_task_exit (void);
-epicsShareFunc void epicsShareAPI ca_context_destroy (void);
+LIBCA_API int epicsStdCall ca_task_exit (void);
+LIBCA_API void epicsStdCall ca_context_destroy (void);
-typedef unsigned capri;
+typedef unsigned capri;
#define CA_PRIORITY_MAX 99
#define CA_PRIORITY_MIN 0
#define CA_PRIORITY_DEFAULT CA_PRIORITY_MIN
@@ -210,7 +199,7 @@ typedef unsigned capri;
* ca_create_channel ()
*
* pChanName R channel name string
- * pConnStateCallback R address of connection state change
+ * pConnStateCallback R address of connection state change
* callback function
* pUserPrivate R placed in the channel's user private field
* o can be fetched later by ca_puser(CHID)
@@ -218,10 +207,10 @@ typedef unsigned capri;
* priority R priority level in the server 0 - 100
* pChanID RW channel id written here
*/
-epicsShareFunc int epicsShareAPI ca_create_channel
+LIBCA_API int epicsStdCall ca_create_channel
(
- const char *pChanName,
- caCh *pConnStateCallback,
+ const char *pChanName,
+ caCh *pConnStateCallback,
void *pUserPrivate,
capri priority,
chid *pChanID
@@ -230,10 +219,10 @@ epicsShareFunc int epicsShareAPI ca_create_channel
/*
* ca_change_connection_event()
*
- * chan R channel identifier
+ * chan R channel identifier
* pfunc R address of connection call-back function
*/
-epicsShareFunc int epicsShareAPI ca_change_connection_event
+LIBCA_API int epicsStdCall ca_change_connection_event
(
chid chan,
caCh * pfunc
@@ -242,10 +231,10 @@ epicsShareFunc int epicsShareAPI ca_change_connection_event
/*
* ca_replace_access_rights_event ()
*
- * chan R channel identifier
+ * chan R channel identifier
* pfunc R address of access rights call-back function
*/
-epicsShareFunc int epicsShareAPI ca_replace_access_rights_event (
+LIBCA_API int epicsStdCall ca_replace_access_rights_event (
chid chan,
caArh *pfunc
);
@@ -256,11 +245,11 @@ epicsShareFunc int epicsShareAPI ca_replace_access_rights_event (
* replace the default exception handler
*
* pfunc R address of exception call-back function
- * pArg R copy of this pointer passed to exception
+ * pArg R copy of this pointer passed to exception
* call-back function
*/
typedef void caExceptionHandler (struct exception_handler_args);
-epicsShareFunc int epicsShareAPI ca_add_exception_event
+LIBCA_API int epicsStdCall ca_add_exception_event
(
caExceptionHandler *pfunc,
void *pArg
@@ -272,7 +261,7 @@ epicsShareFunc int epicsShareAPI ca_add_exception_event
*
* chanId R channel ID
*/
-epicsShareFunc int epicsShareAPI ca_clear_channel
+LIBCA_API int epicsStdCall ca_clear_channel
(
chid chanId
);
@@ -283,10 +272,10 @@ epicsShareFunc int epicsShareAPI ca_clear_channel
/*
* ca_bput()
*
- * WARNING: this copies the new value from a string (dbr_string_t)
+ * WARNING: this copies the new value from a string (dbr_string_t)
* (and not as an integer)
*
- * chan R channel identifier
+ * chan R channel identifier
* pValue R new channel value string copied from this location
*/
#define ca_bput(chan, pValue) \
@@ -295,9 +284,9 @@ ca_array_put(DBR_STRING, 1u, chan, (const dbr_string_t *) (pValue))
/*
* ca_rput()
*
- * WARNING: this copies the new value from a dbr_float_t
+ * WARNING: this copies the new value from a dbr_float_t
*
- * chan R channel identifier
+ * chan R channel identifier
* pValue R new channel value copied from this location
*/
#define ca_rput(chan,pValue) \
@@ -307,7 +296,7 @@ ca_array_put(DBR_FLOAT, 1u, chan, (const dbr_float_t *) pValue)
* ca_put()
*
* type R data type from db_access.h
- * chan R channel identifier
+ * chan R channel identifier
* pValue R new channel value copied from this location
*/
#define ca_put(type, chan, pValue) ca_array_put (type, 1u, chan, pValue)
@@ -317,13 +306,13 @@ ca_array_put(DBR_FLOAT, 1u, chan, (const dbr_float_t *) pValue)
*
* type R data type from db_access.h
* count R array element count
- * chan R channel identifier
+ * chan R channel identifier
* pValue R new channel value copied from this location
*/
-epicsShareFunc int epicsShareAPI ca_array_put
+LIBCA_API int epicsStdCall ca_array_put
(
- chtype type,
- unsigned long count,
+ chtype type,
+ unsigned long count,
chid chanId,
const void * pValue
);
@@ -331,8 +320,8 @@ epicsShareFunc int epicsShareAPI ca_array_put
/*
* ca_array_put_callback()
*
- * This routine functions identically to the original ca put request
- * with the addition of a callback to the user supplied function
+ * This routine functions identically to the original ca put request
+ * with the addition of a callback to the user supplied function
* after recod processing completes in the IOC. The arguments
* to the user supplied callback function are declared in
* the structure event_handler_args and include the pointer
@@ -340,15 +329,15 @@ epicsShareFunc int epicsShareAPI ca_array_put
*
* type R data type from db_access.h
* count R array element count
- * chan R channel identifier
+ * chan R channel identifier
* pValue R new channel value copied from this location
* pFunc R pointer to call-back function
* pArg R copy of this pointer passed to pFunc
*/
-epicsShareFunc int epicsShareAPI ca_array_put_callback
+LIBCA_API int epicsStdCall ca_array_put_callback
(
- chtype type,
- unsigned long count,
+ chtype type,
+ unsigned long count,
chid chanId,
const void * pValue,
caEventCallBackFunc * pFunc,
@@ -365,10 +354,10 @@ epicsShareFunc int epicsShareAPI ca_array_put_callback
/*
* ca_bget()
*
- * WARNING: this copies the new value into a string (dbr_string_t)
+ * WARNING: this copies the new value into a string (dbr_string_t)
* (and not into an integer)
*
- * chan R channel identifier
+ * chan R channel identifier
* pValue W channel value copied to this location
*/
#define ca_bget(chan, pValue) \
@@ -377,9 +366,9 @@ ca_array_get(DBR_STRING, 1u, chan, (dbr_string_t *)(pValue))
/*
* ca_rget()
*
- * WARNING: this copies the new value into a 32 bit float (dbr_float_t)
+ * WARNING: this copies the new value into a 32 bit float (dbr_float_t)
*
- * chan R channel identifier
+ * chan R channel identifier
* pValue W channel value copied to this location
*/
#define ca_rget(chan, pValue) \
@@ -389,7 +378,7 @@ ca_array_get(DBR_FLOAT, 1u, chan, (dbr_float_t *)(pValue))
* ca_rget()
*
* type R data type from db_access.h
- * chan R channel identifier
+ * chan R channel identifier
* pValue W channel value copied to this location
*/
#define ca_get(type, chan, pValue) ca_array_get(type, 1u, chan, pValue)
@@ -399,13 +388,13 @@ ca_array_get(DBR_FLOAT, 1u, chan, (dbr_float_t *)(pValue))
*
* type R data type from db_access.h
* count R array element count
- * chan R channel identifier
+ * chan R channel identifier
* pValue W channel value copied to this location
*/
-epicsShareFunc int epicsShareAPI ca_array_get
+LIBCA_API int epicsStdCall ca_array_get
(
- chtype type,
- unsigned long count,
+ chtype type,
+ unsigned long count,
chid chanId,
void * pValue
);
@@ -419,10 +408,10 @@ epicsShareFunc int epicsShareAPI ca_array_get
/*
* ca_bget_callback()
*
- * WARNING: this returns the new value as a string (dbr_string_t)
+ * WARNING: this returns the new value as a string (dbr_string_t)
* (and not as an integer)
*
- * chan R channel identifier
+ * chan R channel identifier
* pFunc R pointer to call-back function
* pArg R copy of this pointer passed to pFunc
*/
@@ -432,9 +421,9 @@ ca_array_get_callback (DBR_STRING, 1u, chan, pFunc, pArg)
/*
* ca_rget_callback()
*
- * WARNING: this returns the new value as a float (dbr_float_t)
+ * WARNING: this returns the new value as a float (dbr_float_t)
*
- * chan R channel identifier
+ * chan R channel identifier
* pFunc R pointer to call-back function
* pArg R copy of this pointer passed to pFunc
*/
@@ -445,7 +434,7 @@ ca_array_get_callback (DBR_FLOAT, 1u, chan, pFunc, pArg)
* ca_get_callback()
*
* type R data type from db_access.h
- * chan R channel identifier
+ * chan R channel identifier
* pFunc R pointer to call-back function
* pArg R copy of this pointer passed to pFunc
*/
@@ -457,14 +446,14 @@ ca_array_get_callback (type, 1u, chan, pFunc, pArg)
*
* type R data type from db_access.h
* count R array element count
- * chan R channel identifier
+ * chan R channel identifier
* pFunc R pointer to call-back function
* pArg R copy of this pointer passed to pFunc
*/
-epicsShareFunc int epicsShareAPI ca_array_get_callback
+LIBCA_API int epicsStdCall ca_array_get_callback
(
- chtype type,
- unsigned long count,
+ chtype type,
+ unsigned long count,
chid chanId,
caEventCallBackFunc * pFunc,
void * pArg
@@ -476,7 +465,7 @@ epicsShareFunc int epicsShareAPI ca_array_get_callback
/* NOTES: */
/* 1) Evid may be omited by passing a NULL pointer */
/* */
-/* 2) An array count of zero specifies the native db count */
+/* 2) An array count of zero specifies the native db count */
/* */
/************************************************************************/
@@ -485,16 +474,16 @@ epicsShareFunc int epicsShareAPI ca_array_get_callback
*
* type R data type from db_access.h
* count R array element count
- * chan R channel identifier
+ * chan R channel identifier
* mask R event mask - one of {DBE_VALUE, DBE_ALARM, DBE_LOG}
* pFunc R pointer to call-back function
* pArg R copy of this pointer passed to pFunc
* pEventID W event id written at specified address
*/
-epicsShareFunc int epicsShareAPI ca_create_subscription
+LIBCA_API int epicsStdCall ca_create_subscription
(
- chtype type,
- unsigned long count,
+ chtype type,
+ unsigned long count,
chid chanId,
long mask,
caEventCallBackFunc * pFunc,
@@ -512,12 +501,12 @@ epicsShareFunc int epicsShareAPI ca_create_subscription
*
* eventID R event id
*/
-epicsShareFunc int epicsShareAPI ca_clear_subscription
+LIBCA_API int epicsStdCall ca_clear_subscription
(
evid eventID
);
-epicsShareFunc chid epicsShareAPI ca_evid_to_chid ( evid id );
+LIBCA_API chid epicsStdCall ca_evid_to_chid ( evid id );
/************************************************************************/
@@ -535,24 +524,24 @@ epicsShareFunc chid epicsShareAPI ca_evid_to_chid ( evid id );
/* FLOW OF TYPICAL APPLICATION */
/* */
/* search() ! Obtain Channel ids */
-/* . ! " */
+/* . ! " */
/* . ! " */
/* pend_io ! wait for channels to connect */
/* */
/* get() ! several requests for remote info */
-/* get() ! " */
-/* add_event() ! " */
-/* get() ! " */
+/* get() ! " */
+/* add_event() ! " */
+/* get() ! " */
/* . */
/* . */
/* . */
/* flush_io() ! send get requests */
/* ! optional parallel processing */
-/* . ! " */
-/* . ! " */
+/* . ! " */
+/* . ! " */
/* pend_io() ! wait for replies from get requests */
/* . ! access to requested data */
-/* . ! " */
+/* . ! " */
/* pend_event() ! wait for requested events */
/* */
/************************************************************************/
@@ -562,7 +551,7 @@ epicsShareFunc chid epicsShareAPI ca_evid_to_chid ( evid id );
/* functions specified with add_event when events occur. If the */
/* timeout is specified as 0 an infinite timeout is assumed. */
/* ca_flush_io() is called by this routine. If ca_pend_io () */
-/* is called when no IO is outstanding then it will return immediately */
+/* is called when no IO is outstanding then it will return immediately */
/* without processing. */
/************************************************************************/
@@ -571,28 +560,28 @@ epicsShareFunc chid epicsShareAPI ca_evid_to_chid ( evid id );
*
* timeOut R wait for this delay in seconds
*/
-epicsShareFunc int epicsShareAPI ca_pend_event (ca_real timeOut);
+LIBCA_API int epicsStdCall ca_pend_event (ca_real timeOut);
#define ca_poll() ca_pend_event(1e-12)
/*
* ca_pend_io()
*
- * timeOut R wait for this delay in seconds but return early
- * if all get requests (or search requests with null
+ * timeOut R wait for this delay in seconds but return early
+ * if all get requests (or search requests with null
* connection handler pointer have completed)
*/
-epicsShareFunc int epicsShareAPI ca_pend_io (ca_real timeOut);
+LIBCA_API int epicsStdCall ca_pend_io (ca_real timeOut);
/* calls ca_pend_io() if early is true otherwise ca_pend_event() is called */
-epicsShareFunc int epicsShareAPI ca_pend (ca_real timeout, int early);
+LIBCA_API int epicsStdCall ca_pend (ca_real timeout, int early);
/*
* ca_test_io()
*
- * returns TRUE when get requests (or search requests with null
+ * returns TRUE when get requests (or search requests with null
* connection handler pointer) are outstanding
*/
-epicsShareFunc int epicsShareAPI ca_test_io (void);
+LIBCA_API int epicsStdCall ca_test_io (void);
/************************************************************************/
/* Send out all outstanding messages in the send queue */
@@ -600,7 +589,7 @@ epicsShareFunc int epicsShareAPI ca_test_io (void);
/*
* ca_flush_io()
*/
-epicsShareFunc int epicsShareAPI ca_flush_io (void);
+LIBCA_API int epicsStdCall ca_flush_io (void);
/*
@@ -609,10 +598,10 @@ epicsShareFunc int epicsShareAPI ca_flush_io (void);
* errorCode R status returned from channel access function
* pCtxStr R context string included with error print out
*/
-epicsShareFunc void epicsShareAPI ca_signal
+LIBCA_API void epicsStdCall ca_signal
(
- long errorCode,
- const char *pCtxStr
+ long errorCode,
+ const char *pCtxStr
);
/*
@@ -623,12 +612,12 @@ epicsShareFunc void epicsShareAPI ca_signal
* lineNo R line number included with error print out
*
*/
-epicsShareFunc void epicsShareAPI ca_signal_with_file_and_lineno
+LIBCA_API void epicsStdCall ca_signal_with_file_and_lineno
(
- long errorCode,
- const char *pCtxStr,
- const char *pFileStr,
- int lineNo
+ long errorCode,
+ const char *pCtxStr,
+ const char *pFileStr,
+ int lineNo
);
/*
@@ -639,7 +628,7 @@ epicsShareFunc void epicsShareAPI ca_signal_with_file_and_lineno
* pFormat R printf dtyle format string (and optional arguments)
*
*/
-epicsShareFunc void epicsShareAPI ca_signal_formated (long ca_status, const char *pfilenm,
+LIBCA_API void epicsStdCall ca_signal_formated (long ca_status, const char *pfilenm,
int lineno, const char *pFormat, ...);
/*
@@ -649,15 +638,15 @@ epicsShareFunc void epicsShareAPI ca_signal_formated (long ca_status, const char
*
* !!!! this function is _not_ thread safe !!!!
*/
-epicsShareFunc const char * epicsShareAPI ca_host_name (chid channel);
+LIBCA_API const char * epicsStdCall ca_host_name (chid channel);
/* thread safe version */
-epicsShareFunc unsigned epicsShareAPI ca_get_host_name ( chid pChan,
+LIBCA_API unsigned epicsStdCall ca_get_host_name ( chid pChan,
char *pBuf, unsigned bufLength );
/*
* CA_ADD_FD_REGISTRATION
*
- * call their function with their argument whenever
+ * call their function with their argument whenever
* a new fd is added or removed
* (for use with a manager of the select system call under UNIX)
*
@@ -665,7 +654,7 @@ epicsShareFunc unsigned epicsShareAPI ca_get_host_name ( chid pChan,
* if (!opened) then fd was deleted
*
*/
-typedef void CAFDHANDLER (void *parg, int fd, int opened);
+typedef void CAFDHANDLER (void *parg, int fd, int opened);
/*
* ca_add_fd_registration()
@@ -674,7 +663,7 @@ typedef void CAFDHANDLER (void *parg, int fd, int opened);
* when an fd is created or deleted
* pArg R argument passed to above function
*/
-epicsShareFunc int epicsShareAPI ca_add_fd_registration
+LIBCA_API int epicsStdCall ca_add_fd_registration
(
CAFDHANDLER *pHandler,
void *pArg
@@ -696,29 +685,29 @@ epicsShareFunc int epicsShareAPI ca_add_fd_registration
*
* create a sync group
*
- * pgid W pointer to sync group id that will be written
+ * pgid W pointer to sync group id that will be written
*/
-epicsShareFunc int epicsShareAPI ca_sg_create (CA_SYNC_GID * pgid);
+LIBCA_API int epicsStdCall ca_sg_create (CA_SYNC_GID * pgid);
/*
* ca_sg_delete()
*
* delete a sync group
*
- * gid R sync group id
+ * gid R sync group id
*/
-epicsShareFunc int epicsShareAPI ca_sg_delete (const CA_SYNC_GID gid);
+LIBCA_API int epicsStdCall ca_sg_delete (const CA_SYNC_GID gid);
/*
* ca_sg_block()
*
- * block for IO performed within a sync group to complete
+ * block for IO performed within a sync group to complete
*
- * gid R sync group id
+ * gid R sync group id
* timeout R wait for this duration prior to timing out
* and returning ECA_TIMEOUT
*/
-epicsShareFunc int epicsShareAPI ca_sg_block (const CA_SYNC_GID gid, ca_real timeout);
+LIBCA_API int epicsStdCall ca_sg_block (const CA_SYNC_GID gid, ca_real timeout);
/*
* ca_sg_test()
@@ -726,17 +715,17 @@ epicsShareFunc int epicsShareAPI ca_sg_block (const CA_SYNC_GID gid, ca_real tim
* test for sync group IO operations in progress
*
* gid R sync group id
- *
+ *
* returns one of ECA_BADSYNCGRP, ECA_IOINPROGRESS, ECA_IODONE
*/
-epicsShareFunc int epicsShareAPI ca_sg_test (const CA_SYNC_GID gid);
+LIBCA_API int epicsStdCall ca_sg_test (const CA_SYNC_GID gid);
/*
* ca_sg_reset
*
* gid R sync group id
*/
-epicsShareFunc int epicsShareAPI ca_sg_reset(const CA_SYNC_GID gid);
+LIBCA_API int epicsStdCall ca_sg_reset(const CA_SYNC_GID gid);
/*
* ca_sg_array_get()
@@ -747,16 +736,16 @@ epicsShareFunc int epicsShareAPI ca_sg_reset(const CA_SYNC_GID gid);
* gid R sync group id
* type R data type from db_access.h
* count R array element count
- * chan R channel identifier
+ * chan R channel identifier
* pValue W channel value copied to this location
*/
-epicsShareFunc int epicsShareAPI ca_sg_array_get
+LIBCA_API int epicsStdCall ca_sg_array_get
(
const CA_SYNC_GID gid,
- chtype type,
+ chtype type,
unsigned long count,
chid chan,
- void *pValue
+ void *pValue
);
#define ca_sg_get(gid, type, chan, pValue) \
@@ -771,16 +760,16 @@ ca_sg_array_get (gid, type, 1u, chan, pValue)
* gid R sync group id
* type R data type from db_access.h
* count R array element count
- * chan R channel identifier
+ * chan R channel identifier
* pValue R new channel value copied from this location
*/
-epicsShareFunc int epicsShareAPI ca_sg_array_put
+LIBCA_API int epicsStdCall ca_sg_array_put
(
const CA_SYNC_GID gid,
- chtype type,
+ chtype type,
unsigned long count,
chid chan,
- const void *pValue
+ const void *pValue
);
#define ca_sg_put(gid, type, chan, pValue) \
@@ -793,29 +782,29 @@ ca_sg_array_put (gid, type, 1u, chan, pValue)
*
* gid R sync group id
*/
-epicsShareFunc int epicsShareAPI ca_sg_stat (CA_SYNC_GID gid);
+LIBCA_API int epicsStdCall ca_sg_stat (CA_SYNC_GID gid);
-epicsShareFunc void epicsShareAPI ca_dump_dbr (chtype type, unsigned count, const void * pbuffer);
+LIBCA_API void epicsStdCall ca_dump_dbr (chtype type, unsigned count, const void * pbuffer);
/*
* ca_v42_ok()
*
- * Put call back is available if the CA server is on version is 4.2
+ * Put call back is available if the CA server is on version is 4.2
* or higher.
*
* chan R channel identifier
- *
+ *
* (returns true or false)
*/
-epicsShareFunc int epicsShareAPI ca_v42_ok (chid chan);
+LIBCA_API int epicsStdCall ca_v42_ok (chid chan);
/*
* ca_version()
*
* returns the CA version string
*/
-epicsShareFunc const char * epicsShareAPI ca_version (void);
+LIBCA_API const char * epicsStdCall ca_version (void);
/*
* ca_replace_printf_handler ()
@@ -830,7 +819,7 @@ epicsShareFunc const char * epicsShareAPI ca_version (void);
*/
#ifndef CA_DONT_INCLUDE_STDARGH
typedef int caPrintfFunc (const char *pformat, va_list args);
-epicsShareFunc int epicsShareAPI ca_replace_printf_handler (
+LIBCA_API int epicsStdCall ca_replace_printf_handler (
caPrintfFunc *ca_printf_func
);
#endif /*CA_DONT_INCLUDE_STDARGH*/
@@ -838,24 +827,24 @@ epicsShareFunc int epicsShareAPI ca_replace_printf_handler (
/*
* (for testing purposes only)
*/
-epicsShareFunc unsigned epicsShareAPI ca_get_ioc_connection_count (void);
-epicsShareFunc int epicsShareAPI ca_preemtive_callback_is_enabled (void);
-epicsShareFunc void epicsShareAPI ca_self_test (void);
-epicsShareFunc unsigned epicsShareAPI ca_beacon_anomaly_count (void);
-epicsShareFunc unsigned epicsShareAPI ca_search_attempts (chid chan);
-epicsShareFunc double epicsShareAPI ca_beacon_period (chid chan);
-epicsShareFunc double epicsShareAPI ca_receive_watchdog_delay (chid chan);
+LIBCA_API unsigned epicsStdCall ca_get_ioc_connection_count (void);
+LIBCA_API int epicsStdCall ca_preemtive_callback_is_enabled (void);
+LIBCA_API void epicsStdCall ca_self_test (void);
+LIBCA_API unsigned epicsStdCall ca_beacon_anomaly_count (void);
+LIBCA_API unsigned epicsStdCall ca_search_attempts (chid chan);
+LIBCA_API double epicsStdCall ca_beacon_period (chid chan);
+LIBCA_API double epicsStdCall ca_receive_watchdog_delay (chid chan);
/*
* used when an auxillary thread needs to join a CA client context started
* by another thread
*/
-epicsShareFunc struct ca_client_context * epicsShareAPI ca_current_context ();
-epicsShareFunc int epicsShareAPI ca_attach_context ( struct ca_client_context * context );
+LIBCA_API struct ca_client_context * epicsStdCall ca_current_context ();
+LIBCA_API int epicsStdCall ca_attach_context ( struct ca_client_context * context );
-epicsShareFunc int epicsShareAPI ca_client_status ( unsigned level );
-epicsShareFunc int epicsShareAPI ca_context_status ( struct ca_client_context *, unsigned level );
+LIBCA_API int epicsStdCall ca_client_status ( unsigned level );
+LIBCA_API int epicsStdCall ca_context_status ( struct ca_client_context *, unsigned level );
/*
* deprecated
@@ -864,16 +853,16 @@ epicsShareFunc int epicsShareAPI ca_context_status ( struct ca_client_context *,
ca_build_and_connect(NAME, XXXXX, 1, CHIDPTR, YYYYY, 0, 0)
#define ca_array_build(NAME,XXXXX, ZZZZZZ, CHIDPTR,YYYYY)\
ca_build_and_connect(NAME, XXXXX, ZZZZZZ, CHIDPTR, YYYYY, 0, 0)
-epicsShareFunc int epicsShareAPI ca_build_and_connect
- ( const char *pChanName, chtype, unsigned long,
+LIBCA_API int epicsStdCall ca_build_and_connect
+ ( const char *pChanName, chtype, unsigned long,
chid * pChanID, void *, caCh * pFunc, void * pArg );
#define ca_search(pChanName, pChanID)\
ca_search_and_connect (pChanName, pChanID, 0, 0)
-epicsShareFunc int epicsShareAPI ca_search_and_connect
- ( const char * pChanName, chid * pChanID,
+LIBCA_API int epicsStdCall ca_search_and_connect
+ ( const char * pChanName, chid * pChanID,
caCh *pFunc, void * pArg );
-epicsShareFunc int epicsShareAPI ca_channel_status (epicsThreadId tid);
-epicsShareFunc int epicsShareAPI ca_clear_event ( evid eventID );
+LIBCA_API int epicsStdCall ca_channel_status (epicsThreadId tid);
+LIBCA_API int epicsStdCall ca_clear_event ( evid eventID );
#define ca_add_event(type,chan,pFunc,pArg,pEventID)\
ca_add_array_event(type,1u,chan,pFunc,pArg,0.0,0.0,0.0,pEventID)
#define ca_add_delta_event(TYPE,CHID,ENTRY,ARG,DELTA,EVID)\
@@ -882,7 +871,7 @@ ca_add_array_event(type,1u,chan,pFunc,pArg,0.0,0.0,0.0,pEventID)
ca_add_array_event(TYPE,1,CHID,ENTRY,ARG,P_DELTA,N_DELTA,TO,EVID)
#define ca_add_array_event(TYPE,COUNT,CHID,ENTRY,ARG,P_DELTA,N_DELTA,TO,EVID)\
ca_add_masked_array_event(TYPE,COUNT,CHID,ENTRY,ARG,P_DELTA,N_DELTA,TO,EVID, DBE_VALUE | DBE_ALARM)
-epicsShareFunc int epicsShareAPI ca_add_masked_array_event
+LIBCA_API int epicsStdCall ca_add_masked_array_event
( chtype type, unsigned long count, chid chanId, caEventCallBackFunc * pFunc,
void * pArg, ca_real p_delta, ca_real n_delta, ca_real timeout,
evid * pEventID, long mask );
@@ -890,8 +879,8 @@ epicsShareFunc int epicsShareAPI ca_add_masked_array_event
/*
* defunct
*/
-epicsShareFunc int epicsShareAPI ca_modify_user_name ( const char *pUserName );
-epicsShareFunc int epicsShareAPI ca_modify_host_name ( const char *pHostName );
+LIBCA_API int epicsStdCall ca_modify_user_name ( const char *pUserName );
+LIBCA_API int epicsStdCall ca_modify_host_name ( const char *pHostName );
#ifdef __cplusplus
}
@@ -900,5 +889,5 @@ epicsShareFunc int epicsShareAPI ca_modify_host_name ( const char *pHostName );
/*
* no additions below this endif
*/
-#endif /* ifndef INCLcadefh */
+#endif /* ifndef INC_cadef_H */
diff --git a/modules/ca/src/client/caerr.h b/modules/ca/src/client/caerr.h
index 53930962d..03967475d 100644
--- a/modules/ca/src/client/caerr.h
+++ b/modules/ca/src/client/caerr.h
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -17,23 +16,15 @@
*
* Author: Jeffrey O. Hill
*
- */
+ */
-#ifndef INCLcaerrh
-#define INCLcaerrh
+#ifndef INC_caerr_H
+#define INC_caerr_H
-#ifdef epicsExportSharedSymbols
-# define INCLcaerrh_accessh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#include "epicsTypes.h"
-# include "epicsTypes.h"
-
-#ifdef INCLcaerrh_accessh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
/* CA Status Code Definitions */
@@ -78,9 +69,9 @@
(CA_INSERT_MSG_NO(NUMBER) | CA_INSERT_SEVERITY(SEVERITY))
/*
- * In the lines below "defunct" indicates that current release
+ * In the lines below "defunct" indicates that current release
* servers and client library will not return this error code, but
- * servers on earlier releases that communicate with current clients
+ * servers on earlier releases that communicate with current clients
* might still generate exceptions with these error constants
*/
#define ECA_NORMAL DEFMSG(CA_K_SUCCESS, 0) /* success */
@@ -89,10 +80,10 @@
#define ECA_UKNSERV DEFMSG(CA_K_ERROR, 3) /* defunct */
#define ECA_SOCK DEFMSG(CA_K_ERROR, 4) /* defunct */
#define ECA_CONN DEFMSG(CA_K_WARNING, 5) /* defunct */
-#define ECA_ALLOCMEM DEFMSG(CA_K_WARNING, 6)
+#define ECA_ALLOCMEM DEFMSG(CA_K_WARNING, 6)
#define ECA_UKNCHAN DEFMSG(CA_K_WARNING, 7) /* defunct */
#define ECA_UKNFIELD DEFMSG(CA_K_WARNING, 8) /* defunct */
-#define ECA_TOLARGE DEFMSG(CA_K_WARNING, 9)
+#define ECA_TOLARGE DEFMSG(CA_K_WARNING, 9)
#define ECA_TIMEOUT DEFMSG(CA_K_WARNING, 10)
#define ECA_NOSUPPORT DEFMSG(CA_K_WARNING, 11) /* defunct */
#define ECA_STRTOBIG DEFMSG(CA_K_WARNING, 12) /* defunct */
@@ -149,9 +140,9 @@
extern "C" {
#endif
-epicsShareFunc const char * epicsShareAPI ca_message(long ca_status);
+LIBCA_API const char * epicsStdCall ca_message(long ca_status);
-epicsShareExtern const char * ca_message_text [];
+LIBCA_API extern const char * ca_message_text [];
#ifdef __cplusplus
}
diff --git a/modules/ca/src/client/caeventmask.h b/modules/ca/src/client/caeventmask.h
index 5f0914509..4f0f2ec79 100644
--- a/modules/ca/src/client/caeventmask.h
+++ b/modules/ca/src/client/caeventmask.h
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INCLcaeventmaskh
@@ -13,12 +13,12 @@
/*
event selections
- (If any more than 8 of these are needed then update the
- select field in the event_block struct in db_event.c from
+ (If any more than 8 of these are needed then update the
+ select field in the event_block struct in db_event.c from
unsigned char to unsigned short)
- DBE_VALUE
+ DBE_VALUE
Trigger an event when a significant change in the channel's value
occurs. Relies on the monitor deadband field under DCT.
diff --git a/modules/ca/src/client/casw.cpp b/modules/ca/src/client/casw.cpp
index bdb08e04d..ee16c70aa 100644
--- a/modules/ca/src/client/casw.cpp
+++ b/modules/ca/src/client/casw.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -23,7 +22,7 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
-#include "envDefs.h"
+#include "envDefs.h"
#include "errlog.h"
#include "osiWireFormat.h"
@@ -40,8 +39,8 @@ public:
void release ( void * );
private:
tsFreeList < class bhe, 0x100 > freeList;
- bheFreeStoreMgr ( const bheFreeStoreMgr & );
- bheFreeStoreMgr & operator = ( const bheFreeStoreMgr & );
+ bheFreeStoreMgr ( const bheFreeStoreMgr & );
+ bheFreeStoreMgr & operator = ( const bheFreeStoreMgr & );
};
void * bheFreeStoreMgr::allocate ( size_t size )
@@ -59,7 +58,7 @@ int main ( int argc, char ** argv )
epicsMutex mutex;
epicsGuard < epicsMutex > guard ( mutex );
bheFreeStoreMgr bheFreeList;
- epicsTime programBeginTime = epicsTime::getMonotonic ();
+ epicsTime programBeginTime = epicsTime::getCurrent();
bool validCommandLine = false;
unsigned interest = 0u;
SOCKET sock;
@@ -108,7 +107,7 @@ int main ( int argc, char ** argv )
sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
if ( sock == INVALID_SOCKET ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ("casw: unable to create datagram socket because = \"%s\"\n",
sockErrBuf );
@@ -122,7 +121,7 @@ int main ( int argc, char ** argv )
status = bind ( sock, &addr.sa, sizeof (addr) );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy ( sock );
errlogPrintf ( "casw: unable to bind to an unconstrained address because = \"%s\"\n",
@@ -134,7 +133,7 @@ int main ( int argc, char ** argv )
status = socket_ioctl ( sock, FIONBIO, &yes );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy ( sock );
errlogPrintf ( "casw: unable to set socket to nonblocking state because \"%s\"\n",
@@ -169,7 +168,7 @@ int main ( int argc, char ** argv )
status = socket_ioctl ( sock, FIONBIO, &no );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy ( sock );
errlogPrintf ( "casw: unable to set socket to blocking state because \"%s\"\n",
@@ -185,7 +184,7 @@ int main ( int argc, char ** argv )
&addr.sa, &addrSize );
if ( status <= 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy ( sock );
errlogPrintf ("casw: error from recv was = \"%s\"\n",
@@ -196,7 +195,7 @@ int main ( int argc, char ** argv )
if ( addr.sa.sa_family != AF_INET ) {
continue;
}
-
+
unsigned byteCount = static_cast ( status );
pCurMsg = reinterpret_cast < const caHdr * > ( ( pCurBuf = buf ) );
while ( byteCount ) {
@@ -213,9 +212,9 @@ int main ( int argc, char ** argv )
epicsTime previousTime;
struct sockaddr_in ina;
- /*
+ /*
* this allows a fan-out server to potentially
- * insert the true address of the CA server
+ * insert the true address of the CA server
*
* old servers:
* 1) set this field to one of the ip addresses of the host _or_
@@ -244,7 +243,7 @@ int main ( int argc, char ** argv )
ca_uint32_t beaconNumber = ntohl ( pCurMsg->m_cid );
unsigned protocolRevision = ntohs ( pCurMsg->m_dataType );
- epicsTime currentTime = epicsTime::getMonotonic();
+ epicsTime currentTime = epicsTime::getCurrent();
/*
* look for it in the hash table
@@ -252,8 +251,8 @@ int main ( int argc, char ** argv )
bhe *pBHE = beaconTable.lookup ( ina );
if ( pBHE ) {
previousTime = pBHE->updateTime ( guard );
- anomaly = pBHE->updatePeriod (
- guard, programBeginTime,
+ anomaly = pBHE->updatePeriod (
+ guard, programBeginTime,
currentTime, beaconNumber, protocolRevision );
}
else {
@@ -264,7 +263,7 @@ int main ( int argc, char ** argv )
* time that we have seen a server's beacon
* shortly after the program started up)
*/
- pBHE = new ( bheFreeList )
+ pBHE = new ( bheFreeList )
bhe ( mutex, currentTime, beaconNumber, ina );
if ( pBHE ) {
if ( beaconTable.add ( *pBHE ) < 0 ) {
@@ -275,7 +274,7 @@ int main ( int argc, char ** argv )
}
if ( anomaly || interest > 1 ) {
char date[64];
- currentTime.strftime ( date, sizeof ( date ),
+ currentTime.strftime ( date, sizeof ( date ),
"%Y-%m-%d %H:%M:%S.%09f");
char host[64];
ipAddrToA ( &ina, host, sizeof ( host ) );
@@ -288,11 +287,11 @@ int main ( int argc, char ** argv )
pPrefix = " ";
}
}
- printf ( "%s%-40s %s\n",
+ printf ( "%s%-40s %s\n",
pPrefix, host, date );
if ( anomaly && interest > 0 ) {
- printf ( "\testimate=%f current=%f\n",
- pBHE->period ( guard ),
+ printf ( "\testimate=%f current=%f\n",
+ pBHE->period ( guard ),
currentTime - previousTime );
}
fflush(stdout);
diff --git a/modules/ca/src/client/catime.c b/modules/ca/src/client/catime.c
index cccd940bc..ab758d3fd 100644
--- a/modules/ca/src/client/catime.c
+++ b/modules/ca/src/client/catime.c
@@ -5,17 +5,17 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
- * CA performance test
+ * CA performance test
*
- * History
+ * History
* joh 09-12-89 Initial release
* joh 12-20-94 portability
*
- *
+ *
*/
#include
@@ -45,7 +45,7 @@ typedef struct testItem {
char name[128];
int type;
int count;
- void * pValue;
+ void * pValue;
} ti;
typedef void tf ( ti *pItems, unsigned iterations, unsigned *pInlineIter );
@@ -144,7 +144,7 @@ unsigned *pInlineIter
{
int status;
unsigned i;
-
+
for (i=0u; itype,
@@ -257,7 +257,7 @@ unsigned *pInlineIter
{
ti *pi;
int status;
-
+
for (pi=pItems; pi<&pItems[iterations]; pi++) {
status = ca_array_get(
pi->type,
@@ -337,7 +337,7 @@ unsigned *pInlineIter
{
ti *pi;
int status;
-
+
for (pi=pItems; pi<&pItems[iterations]; pi++) {
status = ca_array_get(
pi->type,
@@ -361,9 +361,9 @@ static void measure_get_latency (ti *pItems, unsigned iterations)
epicsTimeStamp start_time;
double delay;
double X = 0u;
- double XX = 0u;
- double max = DBL_MIN;
- double min = DBL_MAX;
+ double XX = 0u;
+ double max = DBL_MIN;
+ double min = DBL_MAX;
double mean;
double stdDev;
ti *pi;
@@ -371,7 +371,7 @@ static void measure_get_latency (ti *pItems, unsigned iterations)
for ( pi = pItems; pi < &pItems[iterations]; pi++ ) {
epicsTimeGetCurrent ( &start_time );
- status = ca_array_get ( pi->type, pi->count,
+ status = ca_array_get ( pi->type, pi->count,
pi->chix, pi->pValue );
SEVCHK ( status, NULL );
status = ca_pend_io ( 100.0 );
@@ -395,13 +395,13 @@ static void measure_get_latency (ti *pItems, unsigned iterations)
mean = X/iterations;
stdDev = sqrt ( XX/iterations - mean*mean );
- printf (
+ printf (
"Get Latency - "
"mean = %3.1f uS, "
"std dev = %3.1f uS, "
"min = %3.1f uS "
"max = %3.1f uS\n",
- mean * 1e6, stdDev * 1e6,
+ mean * 1e6, stdDev * 1e6,
min * 1e6, max * 1e6 );
}
@@ -412,9 +412,9 @@ static void printSearchStat ( const ti * pi, unsigned iterations )
{
unsigned i;
double X = 0u;
- double XX = 0u;
- double max = DBL_MIN;
- double min = DBL_MAX;
+ double XX = 0u;
+ double max = DBL_MIN;
+ double min = DBL_MAX;
double mean;
double stdDev;
@@ -432,7 +432,7 @@ static void printSearchStat ( const ti * pi, unsigned iterations )
mean = X / iterations;
stdDev = sqrt( XX / iterations - mean * mean );
- printf (
+ printf (
"Search tries per chan - "
"mean = %3.1f "
"std dev = %3.1f "
@@ -458,10 +458,10 @@ void timeIt ( tf *pfunc, ti *pItems, unsigned iterations,
delay = epicsTimeDiffInSeconds ( &end_time, &start_time );
if ( delay > 0.0 ) {
double freq = ( iterations * inlineIter ) / delay;
- printf ( "Per Op, %8.4f uS ( %8.4f MHz )",
+ printf ( "Per Op, %8.4f uS ( %8.4f MHz )",
1e6 / freq, freq / 1e6 );
if ( pItems != NULL ) {
- printf(", %8.4f snd Mbps, %8.4f rcv Mbps\n",
+ printf(", %8.4f snd Mbps, %8.4f rcv Mbps\n",
(inlineIter*nBytesSent*CHAR_BIT)/(delay*1e6),
(inlineIter*nBytesRecv*CHAR_BIT)/(delay*1e6) );
}
@@ -479,13 +479,13 @@ static void test ( ti *pItems, unsigned iterations )
unsigned payloadSize, dblPayloadSize;
unsigned nBytesSent, nBytesRecv;
- payloadSize =
+ payloadSize =
dbr_size_n ( pItems[0].type, pItems[0].count );
payloadSize = CA_MESSAGE_ALIGN ( payloadSize );
dblPayloadSize = dbr_size [ DBR_DOUBLE ];
dblPayloadSize = CA_MESSAGE_ALIGN ( dblPayloadSize );
-
+
if ( payloadSize > dblPayloadSize ) {
unsigned factor = payloadSize / dblPayloadSize;
while ( factor ) {
@@ -500,15 +500,15 @@ static void test ( ti *pItems, unsigned iterations )
printf ( "\t### async put test ###\n");
nBytesSent = sizeof ( caHdr ) + CA_MESSAGE_ALIGN( payloadSize );
nBytesRecv = 0u;
- timeIt ( test_put, pItems, iterations,
- nBytesSent * iterations,
+ timeIt ( test_put, pItems, iterations,
+ nBytesSent * iterations,
nBytesRecv * iterations );
printf ( "\t### async get test ###\n");
nBytesSent = sizeof ( caHdr );
nBytesRecv = sizeof ( caHdr ) + CA_MESSAGE_ALIGN ( payloadSize );
- timeIt ( test_get, pItems, iterations,
- nBytesSent * ( iterations ),
+ timeIt ( test_get, pItems, iterations,
+ nBytesSent * ( iterations ),
nBytesRecv * ( iterations ) );
printf ("\t### synch get test ###\n");
@@ -520,7 +520,7 @@ static void test ( ti *pItems, unsigned iterations )
else if ( iterations > 10 ) {
iterations /= 10;
}
- timeIt ( test_wait, pItems, iterations,
+ timeIt ( test_wait, pItems, iterations,
nBytesSent * iterations,
nBytesRecv * iterations );
}
@@ -528,7 +528,7 @@ static void test ( ti *pItems, unsigned iterations )
/*
* catime ()
*/
-int catime ( const char * channelName,
+int catime ( const char * channelName,
unsigned channelCount, enum appendNumberFlag appNF )
{
unsigned i;
@@ -536,7 +536,7 @@ int catime ( const char * channelName,
unsigned strsize;
unsigned nBytesSent, nBytesRecv;
ti *pItemList;
-
+
if ( channelCount == 0 ) {
printf ( "channel count was zero\n" );
return 0;
@@ -547,15 +547,15 @@ int catime ( const char * channelName,
return -1;
}
- SEVCHK ( ca_context_create ( ca_disable_preemptive_callback ),
+ SEVCHK ( ca_context_create ( ca_disable_preemptive_callback ),
"Unable to initialize" );
if ( appNF == appendNumber ) {
- printf ( "Testing with %u channels named %snnn\n",
+ printf ( "Testing with %u channels named %snnn\n",
channelCount, channelName );
}
else {
- printf ( "Testing with %u channels named %s\n",
+ printf ( "Testing with %u channels named %s\n",
channelCount, channelName );
}
@@ -573,7 +573,7 @@ int catime ( const char * channelName,
pItemList[i].name[strsize]= '\0';
pItemList[i].count = 0;
pItemList[i].pValue = 0;
- nBytesSent += 2 * ( CA_MESSAGE_ALIGN ( strlen ( pItemList[i].name ) )
+ nBytesSent += 2 * ( CA_MESSAGE_ALIGN ( strlen ( pItemList[i].name ) )
+ sizeof (caHdr) );
nBytesRecv += 2 * sizeof (caHdr);
}
@@ -582,7 +582,7 @@ int catime ( const char * channelName,
printf ( "--------------------\n" );
timeIt ( test_search, pItemList, channelCount, nBytesSent, nBytesRecv );
printSearchStat ( pItemList, channelCount );
-
+
for ( i = 0; i < channelCount; i++ ) {
size_t count = ca_element_count ( pItemList[i].chix );
size_t size = sizeof ( dbr_string_t ) * count;
@@ -608,7 +608,7 @@ int catime ( const char * channelName,
for ( j = 0; j < pItemList[i].count; j++ ) {
pFltVal[j] = (dbr_float_t) val;
}
- pItemList[i].type = DBR_FLOAT;
+ pItemList[i].type = DBR_FLOAT;
}
printf ( "DBR_FLOAT Test\n" );
printf ( "--------------\n" );
@@ -621,13 +621,13 @@ int catime ( const char * channelName,
for ( j = 0; j < pItemList[i].count; j++ ) {
pDblVal[j] = (dbr_double_t) val;
}
- pItemList[i].type = DBR_DOUBLE;
+ pItemList[i].type = DBR_DOUBLE;
}
printf ( "DBR_DOUBLE Test\n" );
printf ( "---------------\n" );
test ( pItemList, channelCount );
-
+
for ( i = 0; i < channelCount; i++ ) {
dbr_string_t * pStrVal = ( dbr_string_t * ) pItemList[i].pValue;
double val = i;
@@ -635,7 +635,7 @@ int catime ( const char * channelName,
for ( j = 0; j < pItemList[i].count; j++ ) {
sprintf ( pStrVal[j], "%f", val );
}
- pItemList[i].type = DBR_STRING;
+ pItemList[i].type = DBR_STRING;
}
printf ( "DBR_STRING Test\n" );
printf ( "---------------\n" );
@@ -648,7 +648,7 @@ int catime ( const char * channelName,
for ( j = 0; j < pItemList[i].count; j++ ) {
pIntVal[j] = (dbr_int_t) val;
}
- pItemList[i].type = DBR_INT;
+ pItemList[i].type = DBR_INT;
}
printf ( "DBR_INT Test\n" );
printf ( "------------\n" );
@@ -661,8 +661,8 @@ int catime ( const char * channelName,
for ( j = 0; j < pItemList[i].count; j++ ) {
pDblVal[j] = 0;
}
- pItemList[i].type = DBR_DOUBLE;
- }
+ pItemList[i].type = DBR_DOUBLE;
+ }
measure_get_latency ( pItemList, channelCount );
printf ( "Free Channel Test\n" );
@@ -670,10 +670,10 @@ int catime ( const char * channelName,
timeIt ( test_free, pItemList, channelCount, 0, 0 );
SEVCHK ( ca_task_exit (), "Unable to free resources at exit" );
-
+
for ( i = 0; i < channelCount; i++ ) {
free ( pItemList[i].pValue );
- }
+ }
free ( pItemList );
diff --git a/modules/ca/src/client/catimeMain.c b/modules/ca/src/client/catimeMain.c
index 598ec453b..cc9ec8365 100644
--- a/modules/ca/src/client/catimeMain.c
+++ b/modules/ca/src/client/catimeMain.c
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include
diff --git a/modules/ca/src/client/comBuf.cpp b/modules/ca/src/client/comBuf.cpp
index 94245d387..481ba3996 100644
--- a/modules/ca/src/client/comBuf.cpp
+++ b/modules/ca/src/client/comBuf.cpp
@@ -3,22 +3,21 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
*/
#include
@@ -33,7 +32,7 @@ bool comBuf::flushToWire ( wireSendAdapter & wire, const epicsTime & currentTime
unsigned index = this->nextReadIndex;
unsigned finalIndex = this->commitIndex;
while ( index < finalIndex ) {
- unsigned nBytes = wire.sendBytes (
+ unsigned nBytes = wire.sendBytes (
&this->buf[index], finalIndex - index, currentTime );
if ( nBytes == 0u ) {
this->nextReadIndex = index;
@@ -45,9 +44,9 @@ bool comBuf::flushToWire ( wireSendAdapter & wire, const epicsTime & currentTime
return true;
}
-// throwing the exception from a function that isnt inline
+// throwing the exception from a function that isnt inline
// shrinks the GNU compiled object code
-void comBuf::throwInsufficentBytesException ()
+void comBuf::throwInsufficentBytesException ()
{
throw comBuf::insufficentBytesAvailable ();
}
diff --git a/modules/ca/src/client/comBuf.h b/modules/ca/src/client/comBuf.h
index 59e38780b..93ba732f2 100644
--- a/modules/ca/src/client/comBuf.h
+++ b/modules/ca/src/client/comBuf.h
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -17,12 +16,12 @@
* Copyright, 1986, The Regents of the University of California.
*
*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
*/
-#ifndef comBufh
-#define comBufh
+#ifndef INC_comBuf_H
+#define INC_comBuf_H
#include
#include
@@ -40,23 +39,23 @@ static const unsigned comBufSize = 0x4000;
class comBufMemoryManager {
public:
virtual ~comBufMemoryManager ();
- virtual void * allocate ( size_t ) = 0;
- virtual void release ( void * ) = 0;
+ virtual void * allocate ( size_t ) = 0;
+ virtual void release ( void * ) = 0;
};
class wireSendAdapter {
public:
- virtual unsigned sendBytes ( const void * pBuf,
- unsigned nBytesInBuf,
+ virtual unsigned sendBytes ( const void * pBuf,
+ unsigned nBytesInBuf,
const class epicsTime & currentTime ) = 0;
protected:
virtual ~wireSendAdapter() {}
};
-enum swioCircuitState {
- swioConnected,
- swioPeerHangup,
- swioPeerAbort,
+enum swioCircuitState {
+ swioConnected,
+ swioPeerHangup,
+ swioPeerAbort,
swioLinkFailure,
swioLocalAbort
};
@@ -67,7 +66,7 @@ struct statusWireIO {
class wireRecvAdapter {
public:
- virtual void recvBytes ( void * pBuf,
+ virtual void recvBytes ( void * pBuf,
unsigned nBytesInBuf, statusWireIO & ) = 0;
protected:
virtual ~wireRecvAdapter() {}
@@ -106,7 +105,7 @@ public:
template < class T >
popStatus pop ( T & );
static void throwInsufficentBytesException ();
- void * operator new ( size_t size,
+ void * operator new ( size_t size,
comBufMemoryManager & );
epicsPlacementDeleteOperator (( void *, comBufMemoryManager & ))
private:
@@ -119,14 +118,14 @@ private:
bool push ( const T * ); // disabled
};
-inline void * comBuf::operator new ( size_t size,
+inline void * comBuf::operator new ( size_t size,
comBufMemoryManager & mgr )
{
return mgr.allocate ( size );
}
-
+
#ifdef CXX_PLACEMENT_DELETE
-inline void comBuf::operator delete ( void * pCadaver,
+inline void comBuf::operator delete ( void * pCadaver,
comBufMemoryManager & mgr )
{
mgr.release ( pCadaver );
@@ -162,8 +161,8 @@ inline unsigned comBuf :: uncommittedBytes () const
inline unsigned comBuf :: push ( comBuf & bufIn )
{
- unsigned nBytes = this->copyInBytes (
- & bufIn.buf[ bufIn.nextReadIndex ],
+ unsigned nBytes = this->copyInBytes (
+ & bufIn.buf[ bufIn.nextReadIndex ],
bufIn.commitIndex - bufIn.nextReadIndex );
bufIn.nextReadIndex += nBytes;
return nBytes;
@@ -174,11 +173,11 @@ inline unsigned comBuf :: capacityBytes ()
return comBufSize;
}
-inline void comBuf :: fillFromWire (
+inline void comBuf :: fillFromWire (
wireRecvAdapter & wire, statusWireIO & stat )
{
- wire.recvBytes (
- & this->buf[this->nextWriteIndex],
+ wire.recvBytes (
+ & this->buf[this->nextWriteIndex],
sizeof ( this->buf ) - this->nextWriteIndex, stat );
if ( stat.circuitState == swioConnected ) {
this->nextWriteIndex += stat.bytesCopied;
@@ -332,4 +331,4 @@ comBuf :: popStatus comBuf :: pop ( T & returnVal )
return status;
}
-#endif // ifndef comBufh
+#endif // ifndef INC_comBuf_H
diff --git a/modules/ca/src/client/comQueRecv.cpp b/modules/ca/src/client/comQueRecv.cpp
index 88263544d..45cd4301f 100644
--- a/modules/ca/src/client/comQueRecv.cpp
+++ b/modules/ca/src/client/comQueRecv.cpp
@@ -3,11 +3,10 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
*
* L O S A L A M O S
@@ -26,8 +25,8 @@
#include "iocinf.h"
#include "virtualCircuit.h"
-comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ):
- comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
+comQueRecv::comQueRecv ( comBufMemoryManager & comBufMemoryManagerIn ):
+ comBufMemMgr ( comBufMemoryManagerIn ), nBytesPending ( 0u )
{
}
@@ -101,7 +100,7 @@ void comQueRecv::popString ( epicsOldString *pStr )
}
void comQueRecv::pushLastComBufReceived ( comBuf & bufIn )
-
+
{
bufIn.commitIncomming ();
comBuf * pComBuf = this->bufs.last ();
@@ -172,7 +171,7 @@ void comQueRecv::removeAndDestroyBuf ( comBuf & buf )
this->comBufMemMgr.release ( & buf );
}
-epicsUInt8 comQueRecv::popUInt8 ()
+epicsUInt8 comQueRecv::popUInt8 ()
{
comBuf * pComBuf = this->bufs.first ();
if ( ! pComBuf ) {
diff --git a/modules/ca/src/client/comQueRecv.h b/modules/ca/src/client/comQueRecv.h
index 7f3153d8d..2807f54e3 100644
--- a/modules/ca/src/client/comQueRecv.h
+++ b/modules/ca/src/client/comQueRecv.h
@@ -3,28 +3,27 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef comQueRecvh
-#define comQueRecvh
+#ifndef INC_comQueRecv_H
+#define INC_comQueRecv_H
#include "comBuf.h"
@@ -54,8 +53,8 @@ private:
epicsUInt16 multiBufferPopUInt16 ();
epicsUInt32 multiBufferPopUInt32 ();
void removeAndDestroyBuf ( comBuf & );
- comQueRecv ( const comQueRecv & );
- comQueRecv & operator = ( const comQueRecv & );
+ comQueRecv ( const comQueRecv & );
+ comQueRecv & operator = ( const comQueRecv & );
};
inline unsigned comQueRecv::occupiedBytes () const
@@ -108,4 +107,4 @@ inline epicsFloat64 comQueRecv::popFloat64 ()
return AlignedWireRef < epicsFloat64 > ( tmp._fp );
}
-#endif // ifndef comQueRecvh
+#endif // ifndef INC_comQueRecv_H
diff --git a/modules/ca/src/client/comQueSend.cpp b/modules/ca/src/client/comQueSend.cpp
index 6ed516bb3..82489c033 100644
--- a/modules/ca/src/client/comQueSend.cpp
+++ b/modules/ca/src/client/comQueSend.cpp
@@ -3,23 +3,22 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
*/
//
@@ -35,7 +34,7 @@
// a connection dropped.
// 4) Do not allocate too much memory in exception situatons (such as
// after a circuit disconnect).
-// 5) Avoid allocating more memory than is absolutely necessary to meet
+// 5) Avoid allocating more memory than is absolutely necessary to meet
// the above requirements.
// 6) Message fragments must never be sent to the IOC when there isnt
// enough memory to queue part of a message (we also must not force
@@ -44,7 +43,7 @@
// protocol stream.
//
// Implementation:
-// 1) When queuing a complete message, first test to see if a flush is
+// 1) When queuing a complete message, first test to see if a flush is
// required. If it is a receive thread scheduals the flush with the
// send thread, and otherwise directly execute the system call. The
// send thread must run at a higher priority than the receive thread
@@ -52,14 +51,14 @@
// 2) Preallocate space for the entire message prior to copying in the
// message so that message fragments are not flushed out just prior
// to detecting that memory is unavailable.
-// 3) Return a special error constant when the following situations
+// 3) Return a special error constant when the following situations
// are detected when the user is attempting to queue a request
// from within a user callback executed by a receive thread:
-// a) A user is queuing more requests that demand a response from a
+// a) A user is queuing more requests that demand a response from a
// callback than are removed by the response that initiated the
// callback, and this situation persists for many callbacks until
// all buffering in the system is exausted.
-// b) A user is queuing many requests that demand a response from one
+// b) A user is queuing many requests that demand a response from one
// callback until all buffering in the system is exausted.
// c) Some combination of both (a) nad (b).
//
@@ -67,21 +66,20 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "virtualCircuit.h"
#include "db_access.h" // for dbr_short_t etc
// nill message alignment pad bytes
-const char cacNillBytes [] =
-{
+const char cacNillBytes [] =
+{
0, 0, 0, 0,
0, 0, 0, 0
};
-comQueSend::comQueSend ( wireSendAdapter & wireIn,
+comQueSend::comQueSend ( wireSendAdapter & wireIn,
comBufMemoryManager & comBufMemMgrIn ):
- comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ),
+ comBufMemMgr ( comBufMemMgrIn ), wire ( wireIn ),
nBytesPending ( 0u )
{
}
@@ -91,7 +89,7 @@ comQueSend::~comQueSend ()
this->clear ();
}
-void comQueSend::clear ()
+void comQueSend::clear ()
{
comBuf *pBuf;
@@ -181,32 +179,32 @@ const comQueSend::copyScalarFunc_t comQueSend::dbrCopyScalar [39] = {
&comQueSend::copy_dbr_invalid // DBR_CLASS_NAME
};
-void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem )
+void comQueSend::copy_dbr_string ( const void *pValue, unsigned nElem )
{
this->push ( static_cast < const char * > ( pValue ), nElem * MAX_STRING_SIZE );
}
-void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem )
+void comQueSend::copy_dbr_short ( const void *pValue, unsigned nElem )
{
this->push ( static_cast ( pValue ), nElem );
}
-void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem )
+void comQueSend::copy_dbr_float ( const void *pValue, unsigned nElem )
{
this->push ( static_cast ( pValue ), nElem );
}
-void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem )
+void comQueSend::copy_dbr_char ( const void *pValue, unsigned nElem )
{
this->push ( static_cast ( pValue ), nElem );
}
-void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem )
+void comQueSend::copy_dbr_long ( const void *pValue, unsigned nElem )
{
this->push ( static_cast ( pValue ), nElem );
}
-void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem )
+void comQueSend::copy_dbr_double ( const void *pValue, unsigned nElem )
{
this->push ( static_cast ( pValue ), nElem );
}
@@ -258,7 +256,7 @@ const comQueSend::copyVectorFunc_t comQueSend::dbrCopyVector [39] = {
&comQueSend::copy_dbr_invalid // DBR_CLASS_NAME
};
-comBuf * comQueSend::popNextComBufToSend ()
+comBuf * comQueSend::popNextComBufToSend ()
{
comBuf *pBuf = this->bufs.get ();
if ( pBuf ) {
@@ -279,9 +277,9 @@ comBuf * comQueSend::popNextComBufToSend ()
}
void comQueSend::insertRequestHeader (
- ca_uint16_t request, ca_uint32_t payloadSize,
- ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
- ca_uint32_t requestDependent, bool v49Ok )
+ ca_uint16_t request, ca_uint32_t payloadSize,
+ ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
+ ca_uint32_t requestDependent, bool v49Ok )
{
if ( payloadSize < 0xffff && nElem < 0xffff ) {
comBuf * pComBuf = this->bufs.last ();
@@ -289,12 +287,12 @@ void comQueSend::insertRequestHeader (
pComBuf = newComBuf ();
this->pushComBuf ( *pComBuf );
}
- pComBuf->push ( request );
- pComBuf->push ( static_cast < ca_uint16_t > ( payloadSize ) );
- pComBuf->push ( dataType );
- pComBuf->push ( static_cast < ca_uint16_t > ( nElem ) );
- pComBuf->push ( cid );
- pComBuf->push ( requestDependent );
+ pComBuf->push ( request );
+ pComBuf->push ( static_cast < ca_uint16_t > ( payloadSize ) );
+ pComBuf->push ( dataType );
+ pComBuf->push ( static_cast < ca_uint16_t > ( nElem ) );
+ pComBuf->push ( cid );
+ pComBuf->push ( requestDependent );
}
else if ( v49Ok ) {
comBuf * pComBuf = this->bufs.last ();
@@ -302,14 +300,14 @@ void comQueSend::insertRequestHeader (
pComBuf = newComBuf ();
this->pushComBuf ( *pComBuf );
}
- pComBuf->push ( request );
- pComBuf->push ( static_cast < ca_uint16_t > ( 0xffff ) );
- pComBuf->push ( dataType );
- pComBuf->push ( static_cast < ca_uint16_t > ( 0u ) );
- pComBuf->push ( cid );
- pComBuf->push ( requestDependent );
- pComBuf->push ( payloadSize );
- pComBuf->push ( nElem );
+ pComBuf->push ( request );
+ pComBuf->push ( static_cast < ca_uint16_t > ( 0xffff ) );
+ pComBuf->push ( dataType );
+ pComBuf->push ( static_cast < ca_uint16_t > ( 0u ) );
+ pComBuf->push ( cid );
+ pComBuf->push ( requestDependent );
+ pComBuf->push ( payloadSize );
+ pComBuf->push ( nElem );
}
else {
throw cacChannel::outOfBounds ();
@@ -317,9 +315,9 @@ void comQueSend::insertRequestHeader (
}
void comQueSend::insertRequestWithPayLoad (
- ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
- ca_uint32_t cid, ca_uint32_t requestDependent,
- const void * pPayload, bool v49Ok )
+ ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
+ ca_uint32_t cid, ca_uint32_t requestDependent,
+ const void * pPayload, bool v49Ok )
{
if ( INVALID_DB_REQ ( dataType ) ) {
throw cacChannel::badType ();
@@ -337,16 +335,16 @@ void comQueSend::insertRequestWithPayLoad (
throw cacChannel::outOfBounds();
}
payloadSize = CA_MESSAGE_ALIGN ( size );
- this->insertRequestHeader ( request, payloadSize,
- static_cast ( dataType ),
+ this->insertRequestHeader ( request, payloadSize,
+ static_cast ( dataType ),
nElem, cid, requestDependent, v49Ok );
- this->pushString ( pStr, size );
+ this->pushString ( pStr, size );
}
else {
size = dbr_size[dataType];
payloadSize = CA_MESSAGE_ALIGN ( size );
- this->insertRequestHeader ( request, payloadSize,
- static_cast ( dataType ),
+ this->insertRequestHeader ( request, payloadSize,
+ static_cast ( dataType ),
nElem, cid, requestDependent, v49Ok );
( this->*dbrCopyScalar [dataType] ) ( pPayload );
}
@@ -357,22 +355,22 @@ void comQueSend::insertRequestWithPayLoad (
maxBytes = 0xffffffff;
}
else {
- maxBytes = MAX_TCP - sizeof ( caHdr );
+ maxBytes = MAX_TCP - sizeof ( caHdr );
}
- arrayElementCount maxElem =
- ( maxBytes - sizeof (dbr_double_t) - dbr_size[dataType] ) /
+ arrayElementCount maxElem =
+ ( maxBytes - sizeof (dbr_double_t) - dbr_size[dataType] ) /
dbr_value_size[dataType];
if ( nElem >= maxElem ) {
throw cacChannel::outOfBounds();
}
// the above checks verify that the total size
// is lest that 0xffffffff
- size = static_cast < ca_uint32_t >
+ size = static_cast < ca_uint32_t >
( dbr_size_n ( dataType, nElem ) );
payloadSize = CA_MESSAGE_ALIGN ( size );
- this->insertRequestHeader ( request, payloadSize,
- static_cast ( dataType ),
- static_cast < ca_uint32_t > ( nElem ),
+ this->insertRequestHeader ( request, payloadSize,
+ static_cast ( dataType ),
+ static_cast < ca_uint32_t > ( nElem ),
cid, requestDependent, v49Ok );
( this->*dbrCopyVector [dataType] ) ( pPayload, nElem );
}
@@ -383,7 +381,7 @@ void comQueSend::insertRequestWithPayLoad (
}
}
-void comQueSend::commitMsg ()
+void comQueSend::commitMsg ()
{
while ( this->pFirstUncommited.valid() ) {
this->nBytesPending += this->pFirstUncommited->uncommittedBytes ();
diff --git a/modules/ca/src/client/comQueSend.h b/modules/ca/src/client/comQueSend.h
index 808285e7a..f7b25c3f4 100644
--- a/modules/ca/src/client/comQueSend.h
+++ b/modules/ca/src/client/comQueSend.h
@@ -3,31 +3,30 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef comQueSendh
-#define comQueSendh
+#ifndef INC_comQueSend_H
+#define INC_comQueSend_H
-#include
+#include
#include "tsDLList.h"
#include "comBuf.h"
@@ -39,7 +38,7 @@ template < class T > class epicsGuard;
class comQueSendMsgMinder {
public:
- comQueSendMsgMinder (
+ comQueSendMsgMinder (
class comQueSend &, epicsGuard < epicsMutex > & );
~comQueSendMsgMinder ();
void commit ();
@@ -56,20 +55,20 @@ public:
comQueSend ( wireSendAdapter &, comBufMemoryManager & );
~comQueSend ();
void clear ();
- unsigned occupiedBytes () const;
+ unsigned occupiedBytes () const;
bool flushEarlyThreshold ( unsigned nBytesThisMsg ) const;
- bool flushBlockThreshold () const;
+ bool flushBlockThreshold () const;
void pushUInt16 ( const ca_uint16_t value );
void pushUInt32 ( const ca_uint32_t value );
void pushFloat32 ( const ca_float32_t value );
void pushString ( const char *pVal, unsigned nChar );
- void insertRequestHeader (
- ca_uint16_t request, ca_uint32_t payloadSize,
- ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
+ void insertRequestHeader (
+ ca_uint16_t request, ca_uint32_t payloadSize,
+ ca_uint16_t dataType, ca_uint32_t nElem, ca_uint32_t cid,
ca_uint32_t requestDependent, bool v49Ok );
void insertRequestWithPayLoad (
- ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
- ca_uint32_t cid, ca_uint32_t requestDependent,
+ ca_uint16_t request, unsigned dataType, arrayElementCount nElem,
+ ca_uint32_t cid, ca_uint32_t requestDependent,
const void * pPayload, bool v49Ok );
comBuf * popNextComBufToSend ();
private:
@@ -79,43 +78,43 @@ private:
wireSendAdapter & wire;
unsigned nBytesPending;
- typedef void ( comQueSend::*copyScalarFunc_t ) (
+ typedef void ( comQueSend::*copyScalarFunc_t ) (
const void * pValue );
static const copyScalarFunc_t dbrCopyScalar [comQueSendCopyDispatchSize];
void copy_dbr_string ( const void * pValue );
- void copy_dbr_short ( const void * pValue );
- void copy_dbr_float ( const void * pValue );
- void copy_dbr_char ( const void * pValue );
- void copy_dbr_long ( const void * pValue );
- void copy_dbr_double ( const void * pValue );
+ void copy_dbr_short ( const void * pValue );
+ void copy_dbr_float ( const void * pValue );
+ void copy_dbr_char ( const void * pValue );
+ void copy_dbr_long ( const void * pValue );
+ void copy_dbr_double ( const void * pValue );
void copy_dbr_invalid ( const void * pValue );
- typedef void ( comQueSend::*copyVectorFunc_t ) (
+ typedef void ( comQueSend::*copyVectorFunc_t ) (
const void * pValue, unsigned nElem );
static const copyVectorFunc_t dbrCopyVector [comQueSendCopyDispatchSize];
void copy_dbr_string ( const void *pValue, unsigned nElem );
- void copy_dbr_short ( const void *pValue, unsigned nElem );
- void copy_dbr_float ( const void *pValue, unsigned nElem );
- void copy_dbr_char ( const void *pValue, unsigned nElem );
- void copy_dbr_long ( const void *pValue, unsigned nElem );
- void copy_dbr_double ( const void *pValue, unsigned nElem );
+ void copy_dbr_short ( const void *pValue, unsigned nElem );
+ void copy_dbr_float ( const void *pValue, unsigned nElem );
+ void copy_dbr_char ( const void *pValue, unsigned nElem );
+ void copy_dbr_long ( const void *pValue, unsigned nElem );
+ void copy_dbr_double ( const void *pValue, unsigned nElem );
void copy_dbr_invalid ( const void * pValue, unsigned nElem );
- void pushComBuf ( comBuf & );
- comBuf * newComBuf ();
+ void pushComBuf ( comBuf & );
+ comBuf * newComBuf ();
- void beginMsg ();
- void commitMsg ();
+ void beginMsg ();
+ void commitMsg ();
void clearUncommitedMsg ();
friend class comQueSendMsgMinder;
//
- // visual C++ versions 6 & 7 do not allow out of
+ // visual C++ versions 6 & 7 do not allow out of
// class member template function definition
//
template < class T >
- inline void push ( const T *pVal, const unsigned nElem )
+ inline void push ( const T *pVal, const unsigned nElem )
{
comBuf * pLastBuf = this->bufs.last ();
unsigned nCopied;
@@ -127,18 +126,18 @@ private:
}
while ( nElem > nCopied ) {
comBuf * pComBuf = newComBuf ();
- nCopied += pComBuf->push
+ nCopied += pComBuf->push
( &pVal[nCopied], nElem - nCopied );
this->pushComBuf ( *pComBuf );
}
}
//
- // visual C++ versions 6 and 7 do not allow out of
+ // visual C++ versions 6 and 7 do not allow out of
// class member template function definition
//
template < class T >
- inline void push ( const T & val )
+ inline void push ( const T & val )
{
comBuf * pComBuf = this->bufs.last ();
if ( pComBuf && pComBuf->push ( val ) ) {
@@ -159,8 +158,8 @@ private:
extern const char cacNillBytes[];
-inline comQueSendMsgMinder::comQueSendMsgMinder (
- class comQueSend & sendQueIn, epicsGuard < epicsMutex > & ) :
+inline comQueSendMsgMinder::comQueSendMsgMinder (
+ class comQueSend & sendQueIn, epicsGuard < epicsMutex > & ) :
pSendQue ( & sendQueIn )
{
sendQueIn.beginMsg ();
@@ -181,32 +180,32 @@ inline void comQueSendMsgMinder::commit ()
}
}
-inline void comQueSend::beginMsg ()
+inline void comQueSend::beginMsg ()
{
this->pFirstUncommited = this->bufs.lastIter ();
}
-inline void comQueSend::pushUInt16 ( const ca_uint16_t value )
+inline void comQueSend::pushUInt16 ( const ca_uint16_t value )
{
this->push ( value );
}
-inline void comQueSend::pushUInt32 ( const ca_uint32_t value )
+inline void comQueSend::pushUInt32 ( const ca_uint32_t value )
{
this->push ( value );
}
-inline void comQueSend::pushFloat32 ( const ca_float32_t value )
+inline void comQueSend::pushFloat32 ( const ca_float32_t value )
{
this->push ( value );
}
-inline void comQueSend::pushString ( const char *pVal, unsigned nChar )
+inline void comQueSend::pushString ( const char *pVal, unsigned nChar )
{
this->push ( pVal, nChar );
}
-inline void comQueSend::pushComBuf ( comBuf & cb )
+inline void comQueSend::pushComBuf ( comBuf & cb )
{
this->bufs.add ( cb );
if ( ! this->pFirstUncommited.valid() ) {
@@ -214,7 +213,7 @@ inline void comQueSend::pushComBuf ( comBuf & cb )
}
}
-inline unsigned comQueSend::occupiedBytes () const
+inline unsigned comQueSend::occupiedBytes () const
{
return this->nBytesPending;
}
@@ -235,4 +234,4 @@ inline comBuf * comQueSend::newComBuf ()
return new ( this->comBufMemMgr ) comBuf;
}
-#endif // ifndef comQueSendh
+#endif // ifndef INC_comQueSend_H
diff --git a/modules/ca/src/client/convert.cpp b/modules/ca/src/client/convert.cpp
index 851711774..3d423142a 100644
--- a/modules/ca/src/client/convert.cpp
+++ b/modules/ca/src/client/convert.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* C O N V E R T . C
@@ -13,11 +12,11 @@
* Author: D. Kersteins
*
*
- * NOTES:
+ * NOTES:
*
* 1) All routines in this file have an encode argument which
* determines if we are converting from the standard format to
- * the local format or vise versa. To date only float and double data
+ * the local format or vise versa. To date only float and double data
* types must be converted differently depending on the encode
* argument - joh
*
@@ -29,7 +28,6 @@
#include "osiSock.h"
#include "osiWireFormat.h"
-#define epicsExportSharedSymbols
#include "net_convert.h"
#include "iocinf.h"
#include "caProto.h"
@@ -46,38 +44,38 @@
*
* net format: big endian and IEEE float
*/
-typedef void ( * CACVRTFUNCPTR ) (
+typedef void ( * CACVRTFUNCPTR ) (
const void *pSrc, void *pDest, int hton, arrayElementCount count );
-inline void dbr_htond (
+inline void dbr_htond (
const dbr_double_t * pHost, dbr_double_t * pNet )
{
AlignedWireRef < epicsFloat64 > tmp ( *pNet );
tmp = *pHost;
}
-inline void dbr_ntohd (
+inline void dbr_ntohd (
const dbr_double_t * pNet, dbr_double_t * pHost )
{
*pHost = AlignedWireRef < const epicsFloat64 > ( *pNet );
}
-inline void dbr_htonf (
+inline void dbr_htonf (
const dbr_float_t * pHost, dbr_float_t * pNet )
{
AlignedWireRef < epicsFloat32 > tmp ( *pNet );
tmp = *pHost;
}
-inline void dbr_ntohf (
+inline void dbr_ntohf (
const dbr_float_t * pNet, dbr_float_t * pHost )
{
*pHost = AlignedWireRef < const epicsFloat32 > ( *pNet );
}
-inline epicsUInt16 dbr_ntohs( const epicsUInt16 & net )
+inline epicsUInt16 dbr_ntohs( const epicsUInt16 & net )
{
return AlignedWireRef < const epicsUInt16 > ( net );
}
-inline epicsUInt16 dbr_htons ( const epicsUInt16 & host )
+inline epicsUInt16 dbr_htons ( const epicsUInt16 & host )
{
epicsUInt16 tmp;
AlignedWireRef < epicsUInt16 > awr ( tmp );
@@ -103,7 +101,7 @@ inline epicsUInt32 dbr_htonl ( const epicsUInt32 & host )
* otherwise vise-versa
*
* net format: big endian and IEEE float
- *
+ *
*/
/*
@@ -122,7 +120,7 @@ arrayElementCount num /* number of values */
/* convert "in place" -> nothing to do */
if (s == d)
return;
- memcpy ( pDest, pSrc, num*MAX_STRING_SIZE );
+ memcpy ( pDest, pSrc, num*MAX_STRING_SIZE );
}
/*
@@ -234,7 +232,7 @@ arrayElementCount num /* number of values */
*
*
* NOTES:
- * placing encode outside the loop results in more
+ * placing encode outside the loop results in more
* code but better performance.
*
*/
@@ -291,10 +289,10 @@ arrayElementCount num /* number of values */
** struct dbr_sts_string *d pointer to destination struct
** int encode; boolean, if true vax to ieee
** else ieee to vax
-**
+**
** converts fields of struct in HOST format to NET format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -307,7 +305,7 @@ arrayElementCount num /* number of values */
{
struct dbr_sts_string *pSrc = (struct dbr_sts_string *) s;
struct dbr_sts_string *pDest = (struct dbr_sts_string *) d;
-
+
/* convert ieee to vax format or vax to ieee */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
@@ -328,8 +326,8 @@ arrayElementCount num /* number of values */
** else ieee to vax
**
** converts fields ofstruct in HOST format to ieee format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format
****************************************************************************/
@@ -361,10 +359,10 @@ arrayElementCount num /* number of values */
** int encode; boolean, if true vax to ieee
** else ieee to vax
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -387,10 +385,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_sts_double(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -418,9 +416,9 @@ arrayElementCount num /* number of values */
** else ieee to vax
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_sts_enum(
@@ -446,9 +444,9 @@ arrayElementCount num /* number of values */
** cvrt_gr_short()
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_gr_short(
@@ -485,9 +483,9 @@ arrayElementCount num /* number of values */
** cvrt_gr_char()
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_gr_char(
@@ -526,9 +524,9 @@ arrayElementCount num /* number of values */
** cvrt_gr_long()
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_gr_long(
@@ -564,10 +562,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_gr_enum(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -599,10 +597,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_gr_double(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -663,10 +661,10 @@ arrayElementCount num /* number of values */
** int encode; boolean, if true vax to ieee
** else ieee to vax
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -730,9 +728,9 @@ arrayElementCount num /* number of values */
** else ieee to vax
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_ctrl_short(
@@ -772,9 +770,9 @@ arrayElementCount num /* number of values */
** cvrt_ctrl_long(s,d)
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_ctrl_long(
@@ -814,9 +812,9 @@ arrayElementCount num /* number of values */
** cvrt_ctrl_short(s,d)
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_ctrl_char(
@@ -833,7 +831,7 @@ arrayElementCount num /* number of values */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
- if ( s == d )
+ if ( s == d )
return;
pDest->upper_disp_limit = pSrc->upper_disp_limit;
@@ -853,10 +851,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_ctrl_double(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -919,10 +917,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_ctrl_float(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -984,10 +982,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_ctrl_enum(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -1003,7 +1001,7 @@ arrayElementCount num /* number of values */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
- pDest->no_str = dbr_ntohs(pSrc->no_str);
+ pDest->no_str = dbr_ntohs(pSrc->no_str);
if ( s != d ) {
memcpy((void *)pDest->strs,(void *)pSrc->strs,sizeof(pSrc->strs));
}
@@ -1024,8 +1022,8 @@ arrayElementCount num /* number of values */
** else ieee to vax
**
** converts fields ofstruct in HOST format to ieee format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format
****************************************************************************/
@@ -1043,7 +1041,7 @@ arrayElementCount num /* number of values */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
- if ( s == d )
+ if ( s == d )
return;
if (num == 1) /* single value */
@@ -1058,8 +1056,8 @@ arrayElementCount num /* number of values */
** cvrt_sts_long(s,d)
**
** converts fields ofstruct in HOST format to ieee format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format
****************************************************************************/
@@ -1088,10 +1086,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_time_string(s,d)
-**
+**
** converts fields of struct in HOST format to NET format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -1104,7 +1102,7 @@ arrayElementCount num /* number of values */
{
struct dbr_time_string *pSrc = (struct dbr_time_string *) s;
struct dbr_time_string *pDest = (struct dbr_time_string *) d;
-
+
/* convert ieee to vax format or vax to ieee */
pDest->status = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
@@ -1120,8 +1118,8 @@ arrayElementCount num /* number of values */
** cvrt_time_short(s,d)
**
** converts fields ofstruct in HOST format to ieee format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format
****************************************************************************/
@@ -1152,10 +1150,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_time_float(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -1180,10 +1178,10 @@ arrayElementCount num /* number of values */
/****************************************************************************
** cvrt_time_double(s,d)
**
-** if encode
+** if encode
** converts struct in HOST format to ieee format
-** else
-** converts fields of struct in NET format to fields with HOST
+** else
+** converts fields of struct in NET format to fields with HOST
** format;
****************************************************************************/
@@ -1211,9 +1209,9 @@ arrayElementCount num /* number of values */
** cvrt_time_enum(s,d)
**
** converts fields of struct in NET format to fields with HOST format
-** or
+** or
** converts fields of struct in HOST format to fields with NET format
-**
+**
****************************************************************************/
static void cvrt_time_enum(
@@ -1241,8 +1239,8 @@ arrayElementCount num /* number of values */
** cvrt_sts_char(s,d)
**
** converts fields ofstruct in HOST format to ieee format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format
****************************************************************************/
@@ -1262,7 +1260,7 @@ arrayElementCount num /* number of values */
pDest->stamp.secPastEpoch = dbr_ntohl(pSrc->stamp.secPastEpoch);
pDest->stamp.nsec = dbr_ntohl(pSrc->stamp.nsec);
- if ( s == d )
+ if ( s == d )
return;
if (num == 1) /* single value */
@@ -1276,8 +1274,8 @@ arrayElementCount num /* number of values */
** cvrt_time_long(s,d)
**
** converts fields ofstruct in HOST format to ieee format
-** or
-** converts fields of struct in NET format to fields with HOST
+** or
+** converts fields of struct in NET format to fields with HOST
** format
****************************************************************************/
@@ -1326,7 +1324,7 @@ arrayElementCount num /* number of values */
for(i=0; istatus = dbr_ntohs(pSrc->status);
pDest->severity = dbr_ntohs(pSrc->severity);
@@ -1411,7 +1409,7 @@ static CACVRTFUNCPTR cac_dbr_cvrt[] = {
cvrt_ctrl_long,
cvrt_ctrl_double,
- cvrt_put_ackt,
+ cvrt_put_ackt,
cvrt_put_ackt, /* DBR_PUT_ACKS identical to DBR_PUT_ACKT */
cvrt_stsack_string,
cvrt_string
@@ -1419,18 +1417,18 @@ static CACVRTFUNCPTR cac_dbr_cvrt[] = {
#endif /* EPICS_CONVERSION_REQUIRED */
-int caNetConvert ( unsigned type, const void *pSrc, void *pDest,
+int caNetConvert ( unsigned type, const void *pSrc, void *pDest,
int hton, arrayElementCount count )
{
# ifdef EPICS_CONVERSION_REQUIRED
if ( type >= NELEMENTS ( cac_dbr_cvrt ) ) {
return ECA_BADTYPE;
- }
+ }
( * cac_dbr_cvrt [ type ] ) ( pSrc, pDest, hton, count );
# else
if ( INVALID_DB_REQ ( type ) ) {
return ECA_BADTYPE;
- }
+ }
if ( pSrc != pDest ) {
memcpy ( pDest, pSrc, dbr_size_n ( type, count ) );
}
diff --git a/modules/ca/src/client/db_access.h b/modules/ca/src/client/db_access.h
index 92aa5d011..810f82ff7 100644
--- a/modules/ca/src/client/db_access.h
+++ b/modules/ca/src/client/db_access.h
@@ -3,41 +3,32 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* base/include/db_access.h */
/* Author: Bob Dalesio
* Date: 4-4-88
*/
-#ifndef INCLdb_accessh
-#define INCLdb_accessh
+#ifndef INC_db_access_H
+#define INC_db_access_H
#include
-#ifdef epicsExportSharedSymbols
-# define INCLdb_accessh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
-
#include "epicsTypes.h"
#include "epicsTime.h"
-#ifdef INCLdb_accessh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
#ifdef __cplusplus
extern "C" {
#endif
-#define MAX_UNITS_SIZE 8
-#define MAX_ENUM_STRING_SIZE 26
-#define MAX_ENUM_STATES 16
+#define MAX_UNITS_SIZE 8
+#define MAX_ENUM_STRING_SIZE 26
+#define MAX_ENUM_STATES 16
/*
* architecture independent types
@@ -47,135 +38,135 @@ extern "C" {
typedef epicsOldString dbr_string_t;
typedef epicsUInt8 dbr_char_t;
typedef epicsInt16 dbr_short_t;
-typedef epicsUInt16 dbr_ushort_t;
+typedef epicsUInt16 dbr_ushort_t;
typedef epicsInt16 dbr_int_t;
typedef epicsUInt16 dbr_enum_t;
typedef epicsInt32 dbr_long_t;
typedef epicsUInt32 dbr_ulong_t;
typedef epicsFloat32 dbr_float_t;
typedef epicsFloat64 dbr_double_t;
-typedef epicsUInt16 dbr_put_ackt_t;
-typedef epicsUInt16 dbr_put_acks_t;
+typedef epicsUInt16 dbr_put_ackt_t;
+typedef epicsUInt16 dbr_put_acks_t;
typedef epicsOldString dbr_stsack_string_t;
typedef epicsOldString dbr_class_name_t;
#ifndef db_accessHFORdb_accessC
/* database field types */
-#define DBF_STRING 0
-#define DBF_INT 1
-#define DBF_SHORT 1
-#define DBF_FLOAT 2
-#define DBF_ENUM 3
-#define DBF_CHAR 4
-#define DBF_LONG 5
-#define DBF_DOUBLE 6
-#define DBF_NO_ACCESS 7
-#define LAST_TYPE DBF_DOUBLE
-#define VALID_DB_FIELD(x) ((x >= 0) && (x <= LAST_TYPE))
-#define INVALID_DB_FIELD(x) ((x < 0) || (x > LAST_TYPE))
+#define DBF_STRING 0
+#define DBF_INT 1
+#define DBF_SHORT 1
+#define DBF_FLOAT 2
+#define DBF_ENUM 3
+#define DBF_CHAR 4
+#define DBF_LONG 5
+#define DBF_DOUBLE 6
+#define DBF_NO_ACCESS 7
+#define LAST_TYPE DBF_DOUBLE
+#define VALID_DB_FIELD(x) ((x >= 0) && (x <= LAST_TYPE))
+#define INVALID_DB_FIELD(x) ((x < 0) || (x > LAST_TYPE))
/* data request buffer types */
-#define DBR_STRING DBF_STRING
-#define DBR_INT DBF_INT
-#define DBR_SHORT DBF_INT
-#define DBR_FLOAT DBF_FLOAT
-#define DBR_ENUM DBF_ENUM
-#define DBR_CHAR DBF_CHAR
-#define DBR_LONG DBF_LONG
-#define DBR_DOUBLE DBF_DOUBLE
-#define DBR_STS_STRING 7
-#define DBR_STS_SHORT 8
-#define DBR_STS_INT DBR_STS_SHORT
-#define DBR_STS_FLOAT 9
-#define DBR_STS_ENUM 10
-#define DBR_STS_CHAR 11
-#define DBR_STS_LONG 12
-#define DBR_STS_DOUBLE 13
-#define DBR_TIME_STRING 14
-#define DBR_TIME_INT 15
-#define DBR_TIME_SHORT 15
-#define DBR_TIME_FLOAT 16
-#define DBR_TIME_ENUM 17
-#define DBR_TIME_CHAR 18
-#define DBR_TIME_LONG 19
-#define DBR_TIME_DOUBLE 20
-#define DBR_GR_STRING 21
-#define DBR_GR_SHORT 22
-#define DBR_GR_INT DBR_GR_SHORT
-#define DBR_GR_FLOAT 23
-#define DBR_GR_ENUM 24
-#define DBR_GR_CHAR 25
-#define DBR_GR_LONG 26
-#define DBR_GR_DOUBLE 27
-#define DBR_CTRL_STRING 28
-#define DBR_CTRL_SHORT 29
-#define DBR_CTRL_INT DBR_CTRL_SHORT
-#define DBR_CTRL_FLOAT 30
-#define DBR_CTRL_ENUM 31
-#define DBR_CTRL_CHAR 32
-#define DBR_CTRL_LONG 33
-#define DBR_CTRL_DOUBLE 34
-#define DBR_PUT_ACKT DBR_CTRL_DOUBLE + 1
+#define DBR_STRING DBF_STRING
+#define DBR_INT DBF_INT
+#define DBR_SHORT DBF_INT
+#define DBR_FLOAT DBF_FLOAT
+#define DBR_ENUM DBF_ENUM
+#define DBR_CHAR DBF_CHAR
+#define DBR_LONG DBF_LONG
+#define DBR_DOUBLE DBF_DOUBLE
+#define DBR_STS_STRING 7
+#define DBR_STS_SHORT 8
+#define DBR_STS_INT DBR_STS_SHORT
+#define DBR_STS_FLOAT 9
+#define DBR_STS_ENUM 10
+#define DBR_STS_CHAR 11
+#define DBR_STS_LONG 12
+#define DBR_STS_DOUBLE 13
+#define DBR_TIME_STRING 14
+#define DBR_TIME_INT 15
+#define DBR_TIME_SHORT 15
+#define DBR_TIME_FLOAT 16
+#define DBR_TIME_ENUM 17
+#define DBR_TIME_CHAR 18
+#define DBR_TIME_LONG 19
+#define DBR_TIME_DOUBLE 20
+#define DBR_GR_STRING 21
+#define DBR_GR_SHORT 22
+#define DBR_GR_INT DBR_GR_SHORT
+#define DBR_GR_FLOAT 23
+#define DBR_GR_ENUM 24
+#define DBR_GR_CHAR 25
+#define DBR_GR_LONG 26
+#define DBR_GR_DOUBLE 27
+#define DBR_CTRL_STRING 28
+#define DBR_CTRL_SHORT 29
+#define DBR_CTRL_INT DBR_CTRL_SHORT
+#define DBR_CTRL_FLOAT 30
+#define DBR_CTRL_ENUM 31
+#define DBR_CTRL_CHAR 32
+#define DBR_CTRL_LONG 33
+#define DBR_CTRL_DOUBLE 34
+#define DBR_PUT_ACKT DBR_CTRL_DOUBLE + 1
#define DBR_PUT_ACKS DBR_PUT_ACKT + 1
#define DBR_STSACK_STRING DBR_PUT_ACKS + 1
#define DBR_CLASS_NAME DBR_STSACK_STRING + 1
-#define LAST_BUFFER_TYPE DBR_CLASS_NAME
-#define VALID_DB_REQ(x) ((x >= 0) && (x <= LAST_BUFFER_TYPE))
-#define INVALID_DB_REQ(x) ((x < 0) || (x > LAST_BUFFER_TYPE))
+#define LAST_BUFFER_TYPE DBR_CLASS_NAME
+#define VALID_DB_REQ(x) ((x >= 0) && (x <= LAST_BUFFER_TYPE))
+#define INVALID_DB_REQ(x) ((x < 0) || (x > LAST_BUFFER_TYPE))
/*
* The enumeration "epicsType" is an index to this array
* of type DBR types. In some cases we select the a
* larger type to avoid loss of information
*/
-epicsShareExtern const int epicsTypeToDBR_XXXX [lastEpicsType+1];
+LIBCA_API extern const int epicsTypeToDBR_XXXX [lastEpicsType+1];
/*
* The DBR_XXXX types are indicies into this array
*/
-epicsShareExtern const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1];
+LIBCA_API extern const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1];
/* values returned for each field type
- * DBR_STRING returns a NULL terminated string
- * DBR_SHORT returns an unsigned short
- * DBR_INT returns an unsigned short
- * DBR_FLOAT returns an IEEE floating point value
- * DBR_ENUM returns an unsigned short which is the enum item
- * DBR_CHAR returns an unsigned char
- * DBR_LONG returns an unsigned long
- * DBR_DOUBLE returns a double precision floating point number
- * DBR_STS_STRING returns a string status structure (dbr_sts_string)
- * DBR_STS_SHORT returns a short status structure (dbr_sts_short)
- * DBR_STS_INT returns a short status structure (dbr_sts_int)
- * DBR_STS_FLOAT returns a float status structure (dbr_sts_float)
- * DBR_STS_ENUM returns an enum status structure (dbr_sts_enum)
- * DBR_STS_CHAR returns a char status structure (dbr_sts_char)
- * DBR_STS_LONG returns a long status structure (dbr_sts_long)
- * DBR_STS_DOUBLE returns a double status structure (dbr_sts_double)
- * DBR_TIME_STRING returns a string time structure (dbr_time_string)
- * DBR_TIME_SHORT returns a short time structure (dbr_time_short)
- * DBR_TIME_INT returns a short time structure (dbr_time_short)
- * DBR_TIME_FLOAT returns a float time structure (dbr_time_float)
- * DBR_TIME_ENUM returns an enum time structure (dbr_time_enum)
- * DBR_TIME_CHAR returns a char time structure (dbr_time_char)
- * DBR_TIME_LONG returns a long time structure (dbr_time_long)
- * DBR_TIME_DOUBLE returns a double time structure (dbr_time_double)
- * DBR_GR_STRING returns a graphic string structure (dbr_gr_string)
- * DBR_GR_SHORT returns a graphic short structure (dbr_gr_short)
- * DBR_GR_INT returns a graphic short structure (dbr_gr_int)
- * DBR_GR_FLOAT returns a graphic float structure (dbr_gr_float)
- * DBR_GR_ENUM returns a graphic enum structure (dbr_gr_enum)
- * DBR_GR_CHAR returns a graphic char structure (dbr_gr_char)
- * DBR_GR_LONG returns a graphic long structure (dbr_gr_long)
- * DBR_GR_DOUBLE returns a graphic double structure (dbr_gr_double)
- * DBR_CTRL_STRING returns a control string structure (dbr_ctrl_int)
- * DBR_CTRL_SHORT returns a control short structure (dbr_ctrl_short)
- * DBR_CTRL_INT returns a control short structure (dbr_ctrl_int)
- * DBR_CTRL_FLOAT returns a control float structure (dbr_ctrl_float)
- * DBR_CTRL_ENUM returns a control enum structure (dbr_ctrl_enum)
- * DBR_CTRL_CHAR returns a control char structure (dbr_ctrl_char)
- * DBR_CTRL_LONG returns a control long structure (dbr_ctrl_long)
- * DBR_CTRL_DOUBLE returns a control double structure (dbr_ctrl_double)
+ * DBR_STRING returns a NULL terminated string
+ * DBR_SHORT returns an unsigned short
+ * DBR_INT returns an unsigned short
+ * DBR_FLOAT returns an IEEE floating point value
+ * DBR_ENUM returns an unsigned short which is the enum item
+ * DBR_CHAR returns an unsigned char
+ * DBR_LONG returns an unsigned long
+ * DBR_DOUBLE returns a double precision floating point number
+ * DBR_STS_STRING returns a string status structure (dbr_sts_string)
+ * DBR_STS_SHORT returns a short status structure (dbr_sts_short)
+ * DBR_STS_INT returns a short status structure (dbr_sts_int)
+ * DBR_STS_FLOAT returns a float status structure (dbr_sts_float)
+ * DBR_STS_ENUM returns an enum status structure (dbr_sts_enum)
+ * DBR_STS_CHAR returns a char status structure (dbr_sts_char)
+ * DBR_STS_LONG returns a long status structure (dbr_sts_long)
+ * DBR_STS_DOUBLE returns a double status structure (dbr_sts_double)
+ * DBR_TIME_STRING returns a string time structure (dbr_time_string)
+ * DBR_TIME_SHORT returns a short time structure (dbr_time_short)
+ * DBR_TIME_INT returns a short time structure (dbr_time_short)
+ * DBR_TIME_FLOAT returns a float time structure (dbr_time_float)
+ * DBR_TIME_ENUM returns an enum time structure (dbr_time_enum)
+ * DBR_TIME_CHAR returns a char time structure (dbr_time_char)
+ * DBR_TIME_LONG returns a long time structure (dbr_time_long)
+ * DBR_TIME_DOUBLE returns a double time structure (dbr_time_double)
+ * DBR_GR_STRING returns a graphic string structure (dbr_gr_string)
+ * DBR_GR_SHORT returns a graphic short structure (dbr_gr_short)
+ * DBR_GR_INT returns a graphic short structure (dbr_gr_int)
+ * DBR_GR_FLOAT returns a graphic float structure (dbr_gr_float)
+ * DBR_GR_ENUM returns a graphic enum structure (dbr_gr_enum)
+ * DBR_GR_CHAR returns a graphic char structure (dbr_gr_char)
+ * DBR_GR_LONG returns a graphic long structure (dbr_gr_long)
+ * DBR_GR_DOUBLE returns a graphic double structure (dbr_gr_double)
+ * DBR_CTRL_STRING returns a control string structure (dbr_ctrl_int)
+ * DBR_CTRL_SHORT returns a control short structure (dbr_ctrl_short)
+ * DBR_CTRL_INT returns a control short structure (dbr_ctrl_int)
+ * DBR_CTRL_FLOAT returns a control float structure (dbr_ctrl_float)
+ * DBR_CTRL_ENUM returns a control enum structure (dbr_ctrl_enum)
+ * DBR_CTRL_CHAR returns a control char structure (dbr_ctrl_char)
+ * DBR_CTRL_LONG returns a control long structure (dbr_ctrl_long)
+ * DBR_CTRL_DOUBLE returns a control double structure (dbr_ctrl_double)
*/
#endif /*db_accessHFORdb_accessC*/
@@ -183,505 +174,505 @@ epicsShareExtern const epicsType DBR_XXXXToEpicsType [LAST_BUFFER_TYPE+1];
/* structure for a string status field */
struct dbr_sts_string {
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_string_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_string_t value; /* current value */
};
/* structure for a string status and ack field */
struct dbr_stsack_string{
- dbr_ushort_t status; /* status of value */
- dbr_ushort_t severity; /* severity of alarm */
- dbr_ushort_t ackt; /* ack transient? */
- dbr_ushort_t acks; /* ack severity */
- dbr_string_t value; /* current value */
+ dbr_ushort_t status; /* status of value */
+ dbr_ushort_t severity; /* severity of alarm */
+ dbr_ushort_t ackt; /* ack transient? */
+ dbr_ushort_t acks; /* ack severity */
+ dbr_string_t value; /* current value */
};
/* structure for an short status field */
struct dbr_sts_int{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t value; /* current value */
};
struct dbr_sts_short{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t value; /* current value */
};
/* structure for a float status field */
struct dbr_sts_float{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_float_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_float_t value; /* current value */
};
/* structure for a enum status field */
struct dbr_sts_enum{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_enum_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_enum_t value; /* current value */
};
/* structure for a char status field */
struct dbr_sts_char{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_char_t RISC_pad; /* RISC alignment */
- dbr_char_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_char_t RISC_pad; /* RISC alignment */
+ dbr_char_t value; /* current value */
};
/* structure for a long status field */
struct dbr_sts_long{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_long_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_long_t value; /* current value */
};
/* structure for a double status field */
struct dbr_sts_double{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_long_t RISC_pad; /* RISC alignment */
- dbr_double_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_long_t RISC_pad; /* RISC alignment */
+ dbr_double_t value; /* current value */
};
/* VALUES WITH STATUS AND TIME STRUCTURES */
/* structure for a string time field */
struct dbr_time_string{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- epicsTimeStamp stamp; /* time stamp */
- dbr_string_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ epicsTimeStamp stamp; /* time stamp */
+ dbr_string_t value; /* current value */
};
/* structure for an short time field */
struct dbr_time_short{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- epicsTimeStamp stamp; /* time stamp */
- dbr_short_t RISC_pad; /* RISC alignment */
- dbr_short_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ epicsTimeStamp stamp; /* time stamp */
+ dbr_short_t RISC_pad; /* RISC alignment */
+ dbr_short_t value; /* current value */
};
/* structure for a float time field */
struct dbr_time_float{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- epicsTimeStamp stamp; /* time stamp */
- dbr_float_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ epicsTimeStamp stamp; /* time stamp */
+ dbr_float_t value; /* current value */
};
/* structure for a enum time field */
struct dbr_time_enum{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- epicsTimeStamp stamp; /* time stamp */
- dbr_short_t RISC_pad; /* RISC alignment */
- dbr_enum_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ epicsTimeStamp stamp; /* time stamp */
+ dbr_short_t RISC_pad; /* RISC alignment */
+ dbr_enum_t value; /* current value */
};
/* structure for a char time field */
struct dbr_time_char{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- epicsTimeStamp stamp; /* time stamp */
- dbr_short_t RISC_pad0; /* RISC alignment */
- dbr_char_t RISC_pad1; /* RISC alignment */
- dbr_char_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ epicsTimeStamp stamp; /* time stamp */
+ dbr_short_t RISC_pad0; /* RISC alignment */
+ dbr_char_t RISC_pad1; /* RISC alignment */
+ dbr_char_t value; /* current value */
};
/* structure for a long time field */
struct dbr_time_long{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- epicsTimeStamp stamp; /* time stamp */
- dbr_long_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ epicsTimeStamp stamp; /* time stamp */
+ dbr_long_t value; /* current value */
};
/* structure for a double time field */
struct dbr_time_double{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- epicsTimeStamp stamp; /* time stamp */
- dbr_long_t RISC_pad; /* RISC alignment */
- dbr_double_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ epicsTimeStamp stamp; /* time stamp */
+ dbr_long_t RISC_pad; /* RISC alignment */
+ dbr_double_t value; /* current value */
};
/* VALUES WITH STATUS AND GRAPHIC STRUCTURES */
/* structure for a graphic string */
- /* not implemented; use struct_dbr_sts_string */
+ /* not implemented; use struct_dbr_sts_string */
/* structure for a graphic short field */
struct dbr_gr_int{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_short_t upper_disp_limit; /* upper limit of graph */
- dbr_short_t lower_disp_limit; /* lower limit of graph */
- dbr_short_t upper_alarm_limit;
- dbr_short_t upper_warning_limit;
- dbr_short_t lower_warning_limit;
- dbr_short_t lower_alarm_limit;
- dbr_short_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_short_t upper_disp_limit; /* upper limit of graph */
+ dbr_short_t lower_disp_limit; /* lower limit of graph */
+ dbr_short_t upper_alarm_limit;
+ dbr_short_t upper_warning_limit;
+ dbr_short_t lower_warning_limit;
+ dbr_short_t lower_alarm_limit;
+ dbr_short_t value; /* current value */
};
struct dbr_gr_short{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_short_t upper_disp_limit; /* upper limit of graph */
- dbr_short_t lower_disp_limit; /* lower limit of graph */
- dbr_short_t upper_alarm_limit;
- dbr_short_t upper_warning_limit;
- dbr_short_t lower_warning_limit;
- dbr_short_t lower_alarm_limit;
- dbr_short_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_short_t upper_disp_limit; /* upper limit of graph */
+ dbr_short_t lower_disp_limit; /* lower limit of graph */
+ dbr_short_t upper_alarm_limit;
+ dbr_short_t upper_warning_limit;
+ dbr_short_t lower_warning_limit;
+ dbr_short_t lower_alarm_limit;
+ dbr_short_t value; /* current value */
};
/* structure for a graphic floating point field */
struct dbr_gr_float{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t precision; /* number of decimal places */
- dbr_short_t RISC_pad0; /* RISC alignment */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_float_t upper_disp_limit; /* upper limit of graph */
- dbr_float_t lower_disp_limit; /* lower limit of graph */
- dbr_float_t upper_alarm_limit;
- dbr_float_t upper_warning_limit;
- dbr_float_t lower_warning_limit;
- dbr_float_t lower_alarm_limit;
- dbr_float_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t precision; /* number of decimal places */
+ dbr_short_t RISC_pad0; /* RISC alignment */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_float_t upper_disp_limit; /* upper limit of graph */
+ dbr_float_t lower_disp_limit; /* lower limit of graph */
+ dbr_float_t upper_alarm_limit;
+ dbr_float_t upper_warning_limit;
+ dbr_float_t lower_warning_limit;
+ dbr_float_t lower_alarm_limit;
+ dbr_float_t value; /* current value */
};
/* structure for a graphic enumeration field */
struct dbr_gr_enum{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t no_str; /* number of strings */
- char strs[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE];
- /* state strings */
- dbr_enum_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t no_str; /* number of strings */
+ char strs[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE];
+ /* state strings */
+ dbr_enum_t value; /* current value */
};
/* structure for a graphic char field */
struct dbr_gr_char{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_char_t upper_disp_limit; /* upper limit of graph */
- dbr_char_t lower_disp_limit; /* lower limit of graph */
- dbr_char_t upper_alarm_limit;
- dbr_char_t upper_warning_limit;
- dbr_char_t lower_warning_limit;
- dbr_char_t lower_alarm_limit;
- dbr_char_t RISC_pad; /* RISC alignment */
- dbr_char_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_char_t upper_disp_limit; /* upper limit of graph */
+ dbr_char_t lower_disp_limit; /* lower limit of graph */
+ dbr_char_t upper_alarm_limit;
+ dbr_char_t upper_warning_limit;
+ dbr_char_t lower_warning_limit;
+ dbr_char_t lower_alarm_limit;
+ dbr_char_t RISC_pad; /* RISC alignment */
+ dbr_char_t value; /* current value */
};
/* structure for a graphic long field */
struct dbr_gr_long{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_long_t upper_disp_limit; /* upper limit of graph */
- dbr_long_t lower_disp_limit; /* lower limit of graph */
- dbr_long_t upper_alarm_limit;
- dbr_long_t upper_warning_limit;
- dbr_long_t lower_warning_limit;
- dbr_long_t lower_alarm_limit;
- dbr_long_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_long_t upper_disp_limit; /* upper limit of graph */
+ dbr_long_t lower_disp_limit; /* lower limit of graph */
+ dbr_long_t upper_alarm_limit;
+ dbr_long_t upper_warning_limit;
+ dbr_long_t lower_warning_limit;
+ dbr_long_t lower_alarm_limit;
+ dbr_long_t value; /* current value */
};
/* structure for a graphic double field */
struct dbr_gr_double{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t precision; /* number of decimal places */
- dbr_short_t RISC_pad0; /* RISC alignment */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_double_t upper_disp_limit; /* upper limit of graph */
- dbr_double_t lower_disp_limit; /* lower limit of graph */
- dbr_double_t upper_alarm_limit;
- dbr_double_t upper_warning_limit;
- dbr_double_t lower_warning_limit;
- dbr_double_t lower_alarm_limit;
- dbr_double_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t precision; /* number of decimal places */
+ dbr_short_t RISC_pad0; /* RISC alignment */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_double_t upper_disp_limit; /* upper limit of graph */
+ dbr_double_t lower_disp_limit; /* lower limit of graph */
+ dbr_double_t upper_alarm_limit;
+ dbr_double_t upper_warning_limit;
+ dbr_double_t lower_warning_limit;
+ dbr_double_t lower_alarm_limit;
+ dbr_double_t value; /* current value */
};
/* VALUES WITH STATUS, GRAPHIC and CONTROL STRUCTURES */
/* structure for a control string */
- /* not implemented; use struct_dbr_sts_string */
+ /* not implemented; use struct_dbr_sts_string */
/* structure for a control integer */
struct dbr_ctrl_int{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_short_t upper_disp_limit; /* upper limit of graph */
- dbr_short_t lower_disp_limit; /* lower limit of graph */
- dbr_short_t upper_alarm_limit;
- dbr_short_t upper_warning_limit;
- dbr_short_t lower_warning_limit;
- dbr_short_t lower_alarm_limit;
- dbr_short_t upper_ctrl_limit; /* upper control limit */
- dbr_short_t lower_ctrl_limit; /* lower control limit */
- dbr_short_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_short_t upper_disp_limit; /* upper limit of graph */
+ dbr_short_t lower_disp_limit; /* lower limit of graph */
+ dbr_short_t upper_alarm_limit;
+ dbr_short_t upper_warning_limit;
+ dbr_short_t lower_warning_limit;
+ dbr_short_t lower_alarm_limit;
+ dbr_short_t upper_ctrl_limit; /* upper control limit */
+ dbr_short_t lower_ctrl_limit; /* lower control limit */
+ dbr_short_t value; /* current value */
};
struct dbr_ctrl_short{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_short_t upper_disp_limit; /* upper limit of graph */
- dbr_short_t lower_disp_limit; /* lower limit of graph */
- dbr_short_t upper_alarm_limit;
- dbr_short_t upper_warning_limit;
- dbr_short_t lower_warning_limit;
- dbr_short_t lower_alarm_limit;
- dbr_short_t upper_ctrl_limit; /* upper control limit */
- dbr_short_t lower_ctrl_limit; /* lower control limit */
- dbr_short_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_short_t upper_disp_limit; /* upper limit of graph */
+ dbr_short_t lower_disp_limit; /* lower limit of graph */
+ dbr_short_t upper_alarm_limit;
+ dbr_short_t upper_warning_limit;
+ dbr_short_t lower_warning_limit;
+ dbr_short_t lower_alarm_limit;
+ dbr_short_t upper_ctrl_limit; /* upper control limit */
+ dbr_short_t lower_ctrl_limit; /* lower control limit */
+ dbr_short_t value; /* current value */
};
/* structure for a control floating point field */
struct dbr_ctrl_float{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t precision; /* number of decimal places */
- dbr_short_t RISC_pad; /* RISC alignment */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_float_t upper_disp_limit; /* upper limit of graph */
- dbr_float_t lower_disp_limit; /* lower limit of graph */
- dbr_float_t upper_alarm_limit;
- dbr_float_t upper_warning_limit;
- dbr_float_t lower_warning_limit;
- dbr_float_t lower_alarm_limit;
- dbr_float_t upper_ctrl_limit; /* upper control limit */
- dbr_float_t lower_ctrl_limit; /* lower control limit */
- dbr_float_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t precision; /* number of decimal places */
+ dbr_short_t RISC_pad; /* RISC alignment */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_float_t upper_disp_limit; /* upper limit of graph */
+ dbr_float_t lower_disp_limit; /* lower limit of graph */
+ dbr_float_t upper_alarm_limit;
+ dbr_float_t upper_warning_limit;
+ dbr_float_t lower_warning_limit;
+ dbr_float_t lower_alarm_limit;
+ dbr_float_t upper_ctrl_limit; /* upper control limit */
+ dbr_float_t lower_ctrl_limit; /* lower control limit */
+ dbr_float_t value; /* current value */
};
/* structure for a control enumeration field */
struct dbr_ctrl_enum{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t no_str; /* number of strings */
- char strs[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE];
- /* state strings */
- dbr_enum_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t no_str; /* number of strings */
+ char strs[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE];
+ /* state strings */
+ dbr_enum_t value; /* current value */
};
/* structure for a control char field */
struct dbr_ctrl_char{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_char_t upper_disp_limit; /* upper limit of graph */
- dbr_char_t lower_disp_limit; /* lower limit of graph */
- dbr_char_t upper_alarm_limit;
- dbr_char_t upper_warning_limit;
- dbr_char_t lower_warning_limit;
- dbr_char_t lower_alarm_limit;
- dbr_char_t upper_ctrl_limit; /* upper control limit */
- dbr_char_t lower_ctrl_limit; /* lower control limit */
- dbr_char_t RISC_pad; /* RISC alignment */
- dbr_char_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_char_t upper_disp_limit; /* upper limit of graph */
+ dbr_char_t lower_disp_limit; /* lower limit of graph */
+ dbr_char_t upper_alarm_limit;
+ dbr_char_t upper_warning_limit;
+ dbr_char_t lower_warning_limit;
+ dbr_char_t lower_alarm_limit;
+ dbr_char_t upper_ctrl_limit; /* upper control limit */
+ dbr_char_t lower_ctrl_limit; /* lower control limit */
+ dbr_char_t RISC_pad; /* RISC alignment */
+ dbr_char_t value; /* current value */
};
/* structure for a control long field */
struct dbr_ctrl_long{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_long_t upper_disp_limit; /* upper limit of graph */
- dbr_long_t lower_disp_limit; /* lower limit of graph */
- dbr_long_t upper_alarm_limit;
- dbr_long_t upper_warning_limit;
- dbr_long_t lower_warning_limit;
- dbr_long_t lower_alarm_limit;
- dbr_long_t upper_ctrl_limit; /* upper control limit */
- dbr_long_t lower_ctrl_limit; /* lower control limit */
- dbr_long_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_long_t upper_disp_limit; /* upper limit of graph */
+ dbr_long_t lower_disp_limit; /* lower limit of graph */
+ dbr_long_t upper_alarm_limit;
+ dbr_long_t upper_warning_limit;
+ dbr_long_t lower_warning_limit;
+ dbr_long_t lower_alarm_limit;
+ dbr_long_t upper_ctrl_limit; /* upper control limit */
+ dbr_long_t lower_ctrl_limit; /* lower control limit */
+ dbr_long_t value; /* current value */
};
/* structure for a control double field */
struct dbr_ctrl_double{
- dbr_short_t status; /* status of value */
- dbr_short_t severity; /* severity of alarm */
- dbr_short_t precision; /* number of decimal places */
- dbr_short_t RISC_pad0; /* RISC alignment */
- char units[MAX_UNITS_SIZE]; /* units of value */
- dbr_double_t upper_disp_limit; /* upper limit of graph */
- dbr_double_t lower_disp_limit; /* lower limit of graph */
- dbr_double_t upper_alarm_limit;
- dbr_double_t upper_warning_limit;
- dbr_double_t lower_warning_limit;
- dbr_double_t lower_alarm_limit;
- dbr_double_t upper_ctrl_limit; /* upper control limit */
- dbr_double_t lower_ctrl_limit; /* lower control limit */
- dbr_double_t value; /* current value */
+ dbr_short_t status; /* status of value */
+ dbr_short_t severity; /* severity of alarm */
+ dbr_short_t precision; /* number of decimal places */
+ dbr_short_t RISC_pad0; /* RISC alignment */
+ char units[MAX_UNITS_SIZE]; /* units of value */
+ dbr_double_t upper_disp_limit; /* upper limit of graph */
+ dbr_double_t lower_disp_limit; /* lower limit of graph */
+ dbr_double_t upper_alarm_limit;
+ dbr_double_t upper_warning_limit;
+ dbr_double_t lower_warning_limit;
+ dbr_double_t lower_alarm_limit;
+ dbr_double_t upper_ctrl_limit; /* upper control limit */
+ dbr_double_t lower_ctrl_limit; /* lower control limit */
+ dbr_double_t value; /* current value */
};
#define dbr_size_n(TYPE,COUNT)\
((unsigned)((COUNT)<=0?dbr_size[TYPE]:dbr_size[TYPE]+((COUNT)-1)*dbr_value_size[TYPE]))
/* size for each type - array indexed by the DBR_ type code */
-epicsShareExtern const unsigned short dbr_size[];
+LIBCA_API extern const unsigned short dbr_size[];
/* size for each type's value - array indexed by the DBR_ type code */
-epicsShareExtern const unsigned short dbr_value_size[];
+LIBCA_API extern const unsigned short dbr_value_size[];
#ifndef db_accessHFORdb_accessC
/* class for each type's value */
-enum dbr_value_class {
- dbr_class_int,
- dbr_class_float,
- dbr_class_string,
- dbr_class_max};
+enum dbr_value_class {
+ dbr_class_int,
+ dbr_class_float,
+ dbr_class_string,
+ dbr_class_max};
-epicsShareExtern const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1];
+LIBCA_API extern const enum dbr_value_class dbr_value_class[LAST_BUFFER_TYPE+1];
-/*
+/*
* ptr to value given a pointer to the structure and the DBR type
*/
#define dbr_value_ptr(PDBR, DBR_TYPE) \
((void *)(((char *)PDBR)+dbr_value_offset[DBR_TYPE]))
-/*
+/*
* ptr to value given a pointer to the structure and the structure declaration
*/
#define dbr_value_ptr_from_structure(PDBR, STRUCTURE)\
((void *)(((char *)PDBR)+BYTE_OS(STRUCTURE, value)))
-epicsShareExtern const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1];
+LIBCA_API extern const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1];
/* union for each fetch buffers */
union db_access_val{
- dbr_string_t strval; /* string max size */
- dbr_short_t shrtval; /* short */
- dbr_short_t intval; /* short */
- dbr_float_t fltval; /* IEEE Float */
- dbr_enum_t enmval; /* item number */
- dbr_char_t charval; /* character */
- dbr_long_t longval; /* long */
- dbr_double_t doubleval; /* double */
- struct dbr_sts_string sstrval; /* string field with status */
- struct dbr_sts_short sshrtval; /* short field with status */
- struct dbr_sts_float sfltval; /* float field with status */
- struct dbr_sts_enum senmval; /* item number with status */
- struct dbr_sts_char schrval; /* char field with status */
- struct dbr_sts_long slngval; /* long field with status */
- struct dbr_sts_double sdblval; /* double field with time */
- struct dbr_time_string tstrval; /* string field with time */
- struct dbr_time_short tshrtval; /* short field with time */
- struct dbr_time_float tfltval; /* float field with time */
- struct dbr_time_enum tenmval; /* item number with time */
- struct dbr_time_char tchrval; /* char field with time */
- struct dbr_time_long tlngval; /* long field with time */
- struct dbr_time_double tdblval; /* double field with time */
- struct dbr_sts_string gstrval; /* graphic string info */
- struct dbr_gr_short gshrtval; /* graphic short info */
- struct dbr_gr_float gfltval; /* graphic float info */
- struct dbr_gr_enum genmval; /* graphic item info */
- struct dbr_gr_char gchrval; /* graphic char info */
- struct dbr_gr_long glngval; /* graphic long info */
- struct dbr_gr_double gdblval; /* graphic double info */
- struct dbr_sts_string cstrval; /* control string info */
- struct dbr_ctrl_short cshrtval; /* control short info */
- struct dbr_ctrl_float cfltval; /* control float info */
- struct dbr_ctrl_enum cenmval; /* control item info */
- struct dbr_ctrl_char cchrval; /* control char info */
- struct dbr_ctrl_long clngval; /* control long info */
- struct dbr_ctrl_double cdblval; /* control double info */
- dbr_put_ackt_t putackt; /* item number */
- dbr_put_acks_t putacks; /* item number */
- struct dbr_sts_string sastrval; /* string field with status */
- dbr_string_t classname; /* string max size */
+ dbr_string_t strval; /* string max size */
+ dbr_short_t shrtval; /* short */
+ dbr_short_t intval; /* short */
+ dbr_float_t fltval; /* IEEE Float */
+ dbr_enum_t enmval; /* item number */
+ dbr_char_t charval; /* character */
+ dbr_long_t longval; /* long */
+ dbr_double_t doubleval; /* double */
+ struct dbr_sts_string sstrval; /* string field with status */
+ struct dbr_sts_short sshrtval; /* short field with status */
+ struct dbr_sts_float sfltval; /* float field with status */
+ struct dbr_sts_enum senmval; /* item number with status */
+ struct dbr_sts_char schrval; /* char field with status */
+ struct dbr_sts_long slngval; /* long field with status */
+ struct dbr_sts_double sdblval; /* double field with time */
+ struct dbr_time_string tstrval; /* string field with time */
+ struct dbr_time_short tshrtval; /* short field with time */
+ struct dbr_time_float tfltval; /* float field with time */
+ struct dbr_time_enum tenmval; /* item number with time */
+ struct dbr_time_char tchrval; /* char field with time */
+ struct dbr_time_long tlngval; /* long field with time */
+ struct dbr_time_double tdblval; /* double field with time */
+ struct dbr_sts_string gstrval; /* graphic string info */
+ struct dbr_gr_short gshrtval; /* graphic short info */
+ struct dbr_gr_float gfltval; /* graphic float info */
+ struct dbr_gr_enum genmval; /* graphic item info */
+ struct dbr_gr_char gchrval; /* graphic char info */
+ struct dbr_gr_long glngval; /* graphic long info */
+ struct dbr_gr_double gdblval; /* graphic double info */
+ struct dbr_sts_string cstrval; /* control string info */
+ struct dbr_ctrl_short cshrtval; /* control short info */
+ struct dbr_ctrl_float cfltval; /* control float info */
+ struct dbr_ctrl_enum cenmval; /* control item info */
+ struct dbr_ctrl_char cchrval; /* control char info */
+ struct dbr_ctrl_long clngval; /* control long info */
+ struct dbr_ctrl_double cdblval; /* control double info */
+ dbr_put_ackt_t putackt; /* item number */
+ dbr_put_acks_t putacks; /* item number */
+ struct dbr_sts_string sastrval; /* string field with status */
+ dbr_string_t classname; /* string max size */
};
/*----------------------------------------------------------------------------
* repository for some useful PV database constants and utilities
*
* item dimensions
-* db_strval_dim dimension for string values
-* db_units_dim dimension for record units text
-* db_desc_dim dimension for record description text
-* db_name_dim dimension for channel names (record.field\0)
-* db_state_dim number of states possible in a state table
-* db_state_text_dim dimension for a state text string
-* usage: char state_table[db_state_dim][db_state_text_dim]
+* db_strval_dim dimension for string values
+* db_units_dim dimension for record units text
+* db_desc_dim dimension for record description text
+* db_name_dim dimension for channel names (record.field\0)
+* db_state_dim number of states possible in a state table
+* db_state_text_dim dimension for a state text string
+* usage: char state_table[db_state_dim][db_state_text_dim]
*
* type checking macros -- return non-zero if condition is true, zero otherwise
*
-* int dbf_type_is_valid(type) type is a valid DBF_xxx
-* int dbr_type_is_valid(type) type is a valid DBR_xxx
-* int dbr_type_is_plain(type) type is a valid plain DBR_xxx
-* int dbr_type_is_STS(type) type is a valid DBR_STS_xxx
-* int dbr_type_is_TIME(type) type is a valid DBR_TIME_xxx
-* int dbr_type_is_GR(type) type is a valid DBR_GR_xxx
-* int dbr_type_is_CTRL(type) type is a valid DBR_CTRL_xxx
-* int dbr_type_is_STRING(type) type is a valid DBR_STRING_xxx
-* int dbr_type_is_SHORT(type) type is a valid DBR_SHORT_xxx
-* int dbr_type_is_FLOAT(type) type is a valid DBR_FLOAT_xxx
-* int dbr_type_is_ENUM(type) type is a valid DBR_ENUM_xxx
-* int dbr_type_is_CHAR(type) type is a valid DBR_CHAR_xxx
-* int dbr_type_is_LONG(type) type is a valid DBR_LONG_xxx
-* int dbr_type_is_DOUBLE(type) type is a valid DBR_DOUBLE_xxx
+* int dbf_type_is_valid(type) type is a valid DBF_xxx
+* int dbr_type_is_valid(type) type is a valid DBR_xxx
+* int dbr_type_is_plain(type) type is a valid plain DBR_xxx
+* int dbr_type_is_STS(type) type is a valid DBR_STS_xxx
+* int dbr_type_is_TIME(type) type is a valid DBR_TIME_xxx
+* int dbr_type_is_GR(type) type is a valid DBR_GR_xxx
+* int dbr_type_is_CTRL(type) type is a valid DBR_CTRL_xxx
+* int dbr_type_is_STRING(type) type is a valid DBR_STRING_xxx
+* int dbr_type_is_SHORT(type) type is a valid DBR_SHORT_xxx
+* int dbr_type_is_FLOAT(type) type is a valid DBR_FLOAT_xxx
+* int dbr_type_is_ENUM(type) type is a valid DBR_ENUM_xxx
+* int dbr_type_is_CHAR(type) type is a valid DBR_CHAR_xxx
+* int dbr_type_is_LONG(type) type is a valid DBR_LONG_xxx
+* int dbr_type_is_DOUBLE(type) type is a valid DBR_DOUBLE_xxx
*
* type conversion macros
*
-* char *dbf_type_to_text(type) returns text matching DBF_xxx
+* char *dbf_type_to_text(type) returns text matching DBF_xxx
* void dbf_text_to_type(text, type) finds DBF_xxx matching text
-* int dbf_type_to_DBR(type) returns DBR_xxx matching DBF_xxx
-* int dbf_type_to_DBR_TIME(type) returns DBR_TIME_xxx matching DBF_xxx
-* int dbf_type_to_DBR_GR(type) returns DBR_GR_xxx matching DBF_xxx
-* int dbf_type_to_DBR_CTRL(type) returns DBR_CTRL_xxx matching DBF_xxx
-* char *dbr_type_to_text(type) returns text matching DBR_xxx
+* int dbf_type_to_DBR(type) returns DBR_xxx matching DBF_xxx
+* int dbf_type_to_DBR_TIME(type) returns DBR_TIME_xxx matching DBF_xxx
+* int dbf_type_to_DBR_GR(type) returns DBR_GR_xxx matching DBF_xxx
+* int dbf_type_to_DBR_CTRL(type) returns DBR_CTRL_xxx matching DBF_xxx
+* char *dbr_type_to_text(type) returns text matching DBR_xxx
* void dbr_text_to_type(text, type) finds DBR_xxx matching text
*---------------------------------------------------------------------------*/
-#define db_strval_dim MAX_STRING_SIZE
-#define db_units_dim MAX_UNITS_SIZE
-#define db_desc_dim 24
-#define db_name_dim 36
-#define db_state_dim MAX_ENUM_STATES
-#define db_state_text_dim MAX_ENUM_STRING_SIZE
+#define db_strval_dim MAX_STRING_SIZE
+#define db_units_dim MAX_UNITS_SIZE
+#define db_desc_dim 24
+#define db_name_dim 36
+#define db_state_dim MAX_ENUM_STATES
+#define db_state_text_dim MAX_ENUM_STRING_SIZE
#define dbf_type_is_valid(type) ((type) >= 0 && (type) <= LAST_TYPE)
#define dbr_type_is_valid(type) ((type) >= 0 && (type) <= LAST_BUFFER_TYPE)
#define dbr_type_is_plain(type) \
- ((type) >= DBR_STRING && (type) <= DBR_DOUBLE)
+ ((type) >= DBR_STRING && (type) <= DBR_DOUBLE)
#define dbr_type_is_STS(type) \
- ((type) >= DBR_STS_STRING && (type) <= DBR_STS_DOUBLE)
+ ((type) >= DBR_STS_STRING && (type) <= DBR_STS_DOUBLE)
#define dbr_type_is_TIME(type) \
- ((type) >= DBR_TIME_STRING && (type) <= DBR_TIME_DOUBLE)
+ ((type) >= DBR_TIME_STRING && (type) <= DBR_TIME_DOUBLE)
#define dbr_type_is_GR(type) \
- ((type) >= DBR_GR_STRING && (type) <= DBR_GR_DOUBLE)
+ ((type) >= DBR_GR_STRING && (type) <= DBR_GR_DOUBLE)
#define dbr_type_is_CTRL(type) \
- ((type) >= DBR_CTRL_STRING && (type) <= DBR_CTRL_DOUBLE)
+ ((type) >= DBR_CTRL_STRING && (type) <= DBR_CTRL_DOUBLE)
#define dbr_type_is_STRING(type) \
- ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
- (type)%(LAST_TYPE+1) == DBR_STRING)
+ ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
+ (type)%(LAST_TYPE+1) == DBR_STRING)
#define dbr_type_is_SHORT(type) \
- ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
- (type)%(LAST_TYPE+1) == DBR_SHORT)
+ ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
+ (type)%(LAST_TYPE+1) == DBR_SHORT)
#define dbr_type_is_FLOAT(type) \
- ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
- (type)%(LAST_TYPE+1) == DBR_FLOAT)
+ ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
+ (type)%(LAST_TYPE+1) == DBR_FLOAT)
#define dbr_type_is_ENUM(type) \
- ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
- (type)%(LAST_TYPE+1) == DBR_ENUM)
+ ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
+ (type)%(LAST_TYPE+1) == DBR_ENUM)
#define dbr_type_is_CHAR(type) \
- ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
- (type)%(LAST_TYPE+1) == DBR_CHAR)
+ ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
+ (type)%(LAST_TYPE+1) == DBR_CHAR)
#define dbr_type_is_LONG(type) \
- ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
- (type)%(LAST_TYPE+1) == DBR_LONG)
+ ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
+ (type)%(LAST_TYPE+1) == DBR_LONG)
#define dbr_type_is_DOUBLE(type) \
- ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
- (type)%(LAST_TYPE+1) == DBR_DOUBLE)
+ ((type) >= 0 && (type) <= LAST_BUFFER_TYPE && \
+ (type)%(LAST_TYPE+1) == DBR_DOUBLE)
#define dbf_type_to_text(type) \
( ((type) >= -1 && (type) < dbf_text_dim-2) ? \
@@ -724,17 +715,17 @@ union db_access_val{
(type) + 4*(dbf_text_dim-2) : -1 )
-epicsShareExtern const char *dbf_text[LAST_TYPE+3];
-epicsShareExtern const short dbf_text_dim;
-epicsShareExtern const char *dbf_text_invalid;
+LIBCA_API extern const char *dbf_text[LAST_TYPE+3];
+LIBCA_API extern const short dbf_text_dim;
+LIBCA_API extern const char *dbf_text_invalid;
-epicsShareExtern const char *dbr_text[LAST_BUFFER_TYPE+1];
-epicsShareExtern const short dbr_text_dim;
-epicsShareExtern const char *dbr_text_invalid;
+LIBCA_API extern const char *dbr_text[LAST_BUFFER_TYPE+1];
+LIBCA_API extern const short dbr_text_dim;
+LIBCA_API extern const char *dbr_text_invalid;
#endif /*db_accessHFORdb_accessC*/
#ifdef __cplusplus
}
#endif
-#endif /* INCLdb_accessh */
+#endif /* ifndef INC_db_access_H */
diff --git a/modules/ca/src/client/disconnectGovernorTimer.cpp b/modules/ca/src/client/disconnectGovernorTimer.cpp
index f1d517f07..2a7c7fd6a 100644
--- a/modules/ca/src/client/disconnectGovernorTimer.cpp
+++ b/modules/ca/src/client/disconnectGovernorTimer.cpp
@@ -3,11 +3,10 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-//
+//
//
// L O S A L A M O S
// Los Alamos National Laboratory
@@ -20,16 +19,15 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
-#define epicsExportSharedSymbols
#include "disconnectGovernorTimer.h"
#include "udpiiu.h"
#include "nciu.h"
static const double disconnectGovernorPeriod = 10.0; // sec
-disconnectGovernorTimer::disconnectGovernorTimer (
- disconnectGovernorNotify & iiuIn,
- epicsTimerQueue & queueIn,
+disconnectGovernorTimer::disconnectGovernorTimer (
+ disconnectGovernorNotify & iiuIn,
+ epicsTimerQueue & queueIn,
epicsMutex & mutexIn ) :
mutex ( mutexIn ), timer ( queueIn.createTimer () ),
iiu ( iiuIn )
@@ -58,18 +56,18 @@ void disconnectGovernorTimer::shutdown (
}
}
while ( nciu * pChan = this->chanList.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->serviceShutdownNotify ( cbGuard, guard );
}
}
-epicsTimerNotify::expireStatus disconnectGovernorTimer::expire (
+epicsTimerNotify::expireStatus disconnectGovernorTimer::expire (
const epicsTime & /* currentTime */ )
{
epicsGuard < epicsMutex > guard ( this->mutex );
while ( nciu * pChan = chanList.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
this->iiu.govExpireNotify ( guard, *pChan );
}
@@ -83,14 +81,14 @@ void disconnectGovernorTimer::show ( unsigned level ) const
this->chanList.count () );
if ( level > 0u ) {
tsDLIterConst < nciu > pChan = this->chanList.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 1u );
pChan++;
}
}
}
-void disconnectGovernorTimer::installChan (
+void disconnectGovernorTimer::installChan (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
guard.assertIdenticalMutex ( this->mutex );
diff --git a/modules/ca/src/client/disconnectGovernorTimer.h b/modules/ca/src/client/disconnectGovernorTimer.h
index f636d6260..23c1c5427 100644
--- a/modules/ca/src/client/disconnectGovernorTimer.h
+++ b/modules/ca/src/client/disconnectGovernorTimer.h
@@ -3,65 +3,55 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-//
//
-//
+//
+//
// L O S A L A M O S
// Los Alamos National Laboratory
// Los Alamos, New Mexico 87545
-//
+//
// Copyright, 1986, The Regents of the University of California.
-//
-//
-// Author Jeffrey O. Hill
-// johill@lanl.gov
-// 505 665 1831
+//
+//
+// Author Jeffrey O. Hill
+// johill@lanl.gov
+// 505 665 1831
//
-#ifndef disconnectGovernorTimerh
-#define disconnectGovernorTimerh
-
-#ifdef epicsExportSharedSymbols
-# define searchTimerh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_disconnectGovernorTimer_H
+#define INC_disconnectGovernorTimer_H
#include "epicsMutex.h"
#include "epicsGuard.h"
#include "epicsTimer.h"
-#ifdef searchTimerh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
+#include "libCaAPI.h"
#include "caProto.h"
#include "netiiu.h"
class disconnectGovernorNotify {
public:
virtual ~disconnectGovernorNotify () = 0;
- virtual void govExpireNotify (
+ virtual void govExpireNotify (
epicsGuard < epicsMutex > &, nciu & ) = 0;
};
class disconnectGovernorTimer : private epicsTimerNotify {
public:
- disconnectGovernorTimer (
+ disconnectGovernorTimer (
class disconnectGovernorNotify &, epicsTimerQueue &, epicsMutex & );
virtual ~disconnectGovernorTimer ();
void start ();
void shutdown (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
- void installChan (
+ void installChan (
epicsGuard < epicsMutex > &, nciu & );
- void uninstallChan (
+ void uninstallChan (
epicsGuard < epicsMutex > &, nciu & );
void show ( unsigned level ) const;
private:
@@ -70,8 +60,8 @@ private:
epicsTimer & timer;
class disconnectGovernorNotify & iiu;
epicsTimerNotify::expireStatus expire ( const epicsTime & currentTime );
- disconnectGovernorTimer ( const disconnectGovernorTimer & );
- disconnectGovernorTimer & operator = ( const disconnectGovernorTimer & );
+ disconnectGovernorTimer ( const disconnectGovernorTimer & );
+ disconnectGovernorTimer & operator = ( const disconnectGovernorTimer & );
};
-#endif // ifdef disconnectGovernorTimerh
+#endif // ifdef INC_disconnectGovernorTimer_H
diff --git a/modules/ca/src/client/evtime.c b/modules/ca/src/client/evtime.c
index d5cf58382..9c6fe0fdf 100644
--- a/modules/ca/src/client/evtime.c
+++ b/modules/ca/src/client/evtime.c
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include
@@ -17,8 +17,8 @@
void event_handler (struct event_handler_args args);
int evtime (char *pname);
-static unsigned iteration_count;
-static epicsUInt32 last_time;
+static unsigned iteration_count;
+static epicsUInt32 last_time;
#ifndef iocCore
int main(int argc, char **argv)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
else{
printf("usage: %s ", argv[0]);
}
- return(0);
+ return(0);
}
#endif
@@ -41,28 +41,28 @@ int main(int argc, char **argv)
*/
int evtime(char *pname)
{
- chid chan;
- int status;
+ chid chan;
+ int status;
- status = ca_search(pname, &chan);
- SEVCHK(status, NULL);
+ status = ca_search(pname, &chan);
+ SEVCHK(status, NULL);
- status = ca_pend_io(10.0);
- if(status != ECA_NORMAL){
- printf("%s not found\n", pname);
- return 0;
- }
+ status = ca_pend_io(10.0);
+ if(status != ECA_NORMAL){
+ printf("%s not found\n", pname);
+ return 0;
+ }
- status = ca_add_event(
- DBR_FLOAT,
- chan,
- event_handler,
- NULL,
- NULL);
- SEVCHK(status, __FILE__);
+ status = ca_add_event(
+ DBR_FLOAT,
+ chan,
+ event_handler,
+ NULL,
+ NULL);
+ SEVCHK(status, __FILE__);
- status = ca_pend_event(0.0);
- SEVCHK(status, NULL);
+ status = ca_pend_event(0.0);
+ SEVCHK(status, NULL);
}
@@ -72,24 +72,24 @@ int evtime(char *pname)
*/
void event_handler(struct event_handler_args args)
{
- epicsUInt32 current_time;
-# define COUNT 0x8000
- double interval;
- double delay;
- epicsTimeStamp ts;
+ epicsUInt32 current_time;
+# define COUNT 0x8000
+ double interval;
+ double delay;
+ epicsTimeStamp ts;
- if(iteration_count%COUNT == 0){
- epicsTimeGetCurrent(&ts);
- current_time = ts.secPastEpoch;
- if(last_time != 0){
- interval = current_time - last_time;
- delay = interval/COUNT;
- printf("Delay = %f sec per event\n",
- delay);
- }
- last_time = current_time;
- }
+ if(iteration_count%COUNT == 0){
+ epicsTimeGetCurrent(&ts);
+ current_time = ts.secPastEpoch;
+ if(last_time != 0){
+ interval = current_time - last_time;
+ delay = interval/COUNT;
+ printf("Delay = %f sec per event\n",
+ delay);
+ }
+ last_time = current_time;
+ }
- iteration_count++;
+ iteration_count++;
}
diff --git a/modules/ca/src/client/getCallback.cpp b/modules/ca/src/client/getCallback.cpp
index 0fc050043..b7fb46ef2 100644
--- a/modules/ca/src/client/getCallback.cpp
+++ b/modules/ca/src/client/getCallback.cpp
@@ -3,24 +3,23 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include
@@ -28,11 +27,10 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
-getCallback::getCallback ( oldChannelNotify & chanIn,
+getCallback::getCallback ( oldChannelNotify & chanIn,
caEventCallBackFunc *pFuncIn, void *pPrivateIn ) :
chan ( chanIn ), pFunc ( pFuncIn ), pPrivate ( pPrivateIn )
{
@@ -65,7 +63,7 @@ void getCallback::completion (
void getCallback::exception (
epicsGuard < epicsMutex > & guard,
- int status, const char * /* pContext */,
+ int status, const char * /* pContext */,
unsigned type, arrayElementCount count )
{
if ( status != ECA_CHANDESTROY ) {
diff --git a/modules/ca/src/client/getCopy.cpp b/modules/ca/src/client/getCopy.cpp
index 23a508d9a..625620bc9 100644
--- a/modules/ca/src/client/getCopy.cpp
+++ b/modules/ca/src/client/getCopy.cpp
@@ -3,24 +3,23 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include
@@ -30,23 +29,22 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
#include "cac.h"
-getCopy::getCopy (
- epicsGuard < epicsMutex > & guard, ca_client_context & cacCtxIn,
- oldChannelNotify & chanIn, unsigned typeIn,
+getCopy::getCopy (
+ epicsGuard < epicsMutex > & guard, ca_client_context & cacCtxIn,
+ oldChannelNotify & chanIn, unsigned typeIn,
arrayElementCount countIn, void * pValueIn ) :
- count ( countIn ), cacCtx ( cacCtxIn ), chan ( chanIn ), pValue ( pValueIn ),
+ count ( countIn ), cacCtx ( cacCtxIn ), chan ( chanIn ), pValue ( pValueIn ),
ioSeqNo ( 0 ), type ( typeIn )
{
this->ioSeqNo = cacCtxIn.sequenceNumberOfOutstandingIO ( guard );
cacCtxIn.incrementOutstandingIO ( guard, this->ioSeqNo );
}
-getCopy::~getCopy ()
+getCopy::~getCopy ()
{
}
@@ -56,8 +54,8 @@ void getCopy::cancel ()
this->cacCtx.decrementOutstandingIO ( guard, this->ioSeqNo );
}
-void getCopy::completion (
- epicsGuard < epicsMutex > & guard, unsigned typeIn,
+void getCopy::completion (
+ epicsGuard < epicsMutex > & guard, unsigned typeIn,
arrayElementCount countIn, const void *pDataIn )
{
if ( this->type == typeIn ) {
@@ -68,7 +66,7 @@ void getCopy::completion (
// this object destroyed by preceding function call
}
else {
- this->exception ( guard, ECA_INTERNAL,
+ this->exception ( guard, ECA_INTERNAL,
"bad data type match in get copy back response",
typeIn, countIn);
// this object destroyed by preceding function call
@@ -77,7 +75,7 @@ void getCopy::completion (
void getCopy::exception (
epicsGuard < epicsMutex > & guard,
- int status, const char *pContext,
+ int status, const char *pContext,
unsigned /* typeIn */, arrayElementCount /* countIn */ )
{
oldChannelNotify & chanTmp ( this->chan );
@@ -88,8 +86,8 @@ void getCopy::exception (
// the lock and calling cb in case they destroy channel there
this->cacCtx.destroyGetCopy ( guard, *this );
if ( status != ECA_CHANDESTROY ) {
- caClientCtx.exception ( guard, status, pContext,
- __FILE__, __LINE__, chanTmp, typeTmp,
+ caClientCtx.exception ( guard, status, pContext,
+ __FILE__, __LINE__, chanTmp, typeTmp,
countTmp, CA_OP_GET );
}
}
@@ -97,7 +95,7 @@ void getCopy::exception (
void getCopy::show ( unsigned level ) const
{
int tmpType = static_cast ( this->type );
- ::printf ( "read copy IO at %p, type %s, element count %lu\n",
+ ::printf ( "read copy IO at %p, type %s, element count %lu\n",
static_cast ( this ), dbf_type_to_text ( tmpType ), this->count );
if ( level > 0u ) {
::printf ( "\tIO sequence number %u, user's storage %p\n",
diff --git a/modules/ca/src/client/hostNameCache.cpp b/modules/ca/src/client/hostNameCache.cpp
index c3d105c06..310346765 100644
--- a/modules/ca/src/client/hostNameCache.cpp
+++ b/modules/ca/src/client/hostNameCache.cpp
@@ -3,23 +3,22 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
*/
#include
@@ -29,7 +28,7 @@
#include "hostNameCache.h"
#include "epicsGuard.h"
-hostNameCache::hostNameCache (
+hostNameCache::hostNameCache (
const osiSockAddr & addr, ipAddrToAsciiEngine & engine ) :
dnsTransaction ( engine.createTransaction() ), nameLength ( 0 )
{
@@ -65,7 +64,7 @@ void hostNameCache::transactionComplete ( const char * pHostNameIn )
this->nameLength = newNameLen;
}
-unsigned hostNameCache::getName (
+unsigned hostNameCache::getName (
char * pBuf, unsigned bufSize ) const
{
if ( bufSize == 0u ) {
diff --git a/modules/ca/src/client/hostNameCache.h b/modules/ca/src/client/hostNameCache.h
index a4eacfbb3..3209e8eb4 100644
--- a/modules/ca/src/client/hostNameCache.h
+++ b/modules/ca/src/client/hostNameCache.h
@@ -3,41 +3,31 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef hostNameCacheh
-#define hostNameCacheh
-
-#ifdef epicsExportSharedSymbols
-# define hostNameCache_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_hostNameCache_H
+#define INC_hostNameCache_H
#include "ipAddrToAsciiAsynchronous.h"
#include "epicsMutex.h"
-#ifdef hostNameCache_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-#endif
-
class hostNameCache : public ipAddrToAsciiCallBack {
public:
hostNameCache ( const osiSockAddr & addr, ipAddrToAsciiEngine & engine );
@@ -58,4 +48,4 @@ inline const char * hostNameCache::pointer () const
return this->hostNameBuf;
}
-#endif // #ifndef hostNameCacheh
+#endif // #ifndef INC_hostNameCache_H
diff --git a/modules/ca/src/client/inetAddrID.h b/modules/ca/src/client/inetAddrID.h
index 978787599..f8ba11424 100644
--- a/modules/ca/src/client/inetAddrID.h
+++ b/modules/ca/src/client/inetAddrID.h
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -19,8 +18,8 @@
* Author: Jeff Hill
*/
-#ifndef inetAddrIDh
-#define inetAddrIDh
+#ifndef INC_inetAddrID_H
+#define INC_inetAddrID_H
#include "osiSock.h"
#include "resourceLib.h"
@@ -58,7 +57,7 @@ inline resTableIndex inetAddrID::hash () const
index = this->addr.sin_addr.s_addr;
index ^= this->addr.sin_port;
index ^= this->addr.sin_port >> 8u;
- return integerHash ( inetAddrMinIndexBitWidth,
+ return integerHash ( inetAddrMinIndexBitWidth,
inetAddrMaxIndexBitWidth, index );
}
@@ -67,6 +66,6 @@ inline void inetAddrID::name ( char *pBuf, unsigned bufSize ) const
ipAddrToDottedIP ( &this->addr, pBuf, bufSize );
}
-#endif // ifdef inetAddrID
+#endif // ifdef INC_inetAddrID_H
diff --git a/modules/ca/src/client/iocinf.cpp b/modules/ca/src/client/iocinf.cpp
index 09eea292b..0cc069472 100644
--- a/modules/ca/src/client/iocinf.cpp
+++ b/modules/ca/src/client/iocinf.cpp
@@ -4,10 +4,10 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -31,10 +31,7 @@
#include "errlog.h"
#include "osiWireFormat.h"
-#define epicsExportSharedSymbols
#include "addrList.h"
-#undef epicsExportSharedSymbols
-
#include "iocinf.h"
/*
@@ -65,16 +62,16 @@ static char *getToken ( const char **ppString, char *pBuf, unsigned bufSIze )
if ( tokenFound ) {
pBuf[bufSIze-1] = '\0';
- return pBuf;
- }
+ return pBuf;
+ }
return NULL;
}
/*
* addAddrToChannelAccessAddressList ()
*/
-extern "C" int epicsShareAPI addAddrToChannelAccessAddressList
- ( ELLLIST *pList, const ENV_PARAM *pEnv,
+extern "C" int epicsStdCall addAddrToChannelAccessAddressList
+ ( ELLLIST *pList, const ENV_PARAM *pEnv,
unsigned short port, int ignoreNonDefaultPort )
{
osiSockAddrNode *pNewNode;
@@ -109,9 +106,9 @@ extern "C" int epicsShareAPI addAddrToChannelAccessAddressList
pNewNode->addr.ia = addr;
- /*
- * LOCK applied externally
- */
+ /*
+ * LOCK applied externally
+ */
ellAdd (pList, &pNewNode->node);
ret = 0; /* success if anything is added to the list */
}
@@ -122,14 +119,14 @@ extern "C" int epicsShareAPI addAddrToChannelAccessAddressList
/*
* removeDuplicateAddresses ()
*/
-extern "C" void epicsShareAPI removeDuplicateAddresses
+extern "C" void epicsStdCall removeDuplicateAddresses
( ELLLIST *pDestList, ELLLIST *pSrcList, int silent )
{
ELLNODE *pRawNode;
while ( (pRawNode = ellGet ( pSrcList ) ) ) {
- STATIC_ASSERT ( offsetof (osiSockAddrNode, node) == 0 );
- osiSockAddrNode *pNode = reinterpret_cast ( pRawNode );
+ STATIC_ASSERT ( offsetof (osiSockAddrNode, node) == 0 );
+ osiSockAddrNode *pNode = reinterpret_cast ( pRawNode );
osiSockAddrNode *pTmpNode;
if ( pNode->addr.sa.sa_family == AF_INET ) {
@@ -137,14 +134,14 @@ extern "C" void epicsShareAPI removeDuplicateAddresses
pTmpNode = (osiSockAddrNode *) ellFirst (pDestList);
while ( pTmpNode ) {
if (pTmpNode->addr.sa.sa_family == AF_INET) {
- if ( pNode->addr.ia.sin_addr.s_addr == pTmpNode->addr.ia.sin_addr.s_addr &&
+ if ( pNode->addr.ia.sin_addr.s_addr == pTmpNode->addr.ia.sin_addr.s_addr &&
pNode->addr.ia.sin_port == pTmpNode->addr.ia.sin_port ) {
- if ( ! silent ) {
+ if ( ! silent ) {
char buf[64];
ipAddrToDottedIP ( &pNode->addr.ia, buf, sizeof (buf) );
- fprintf ( stderr,
- "Warning: Duplicate EPICS CA Address list entry \"%s\" discarded\n", buf );
- }
+ fprintf ( stderr,
+ "Warning: Duplicate EPICS CA Address list entry \"%s\" discarded\n", buf );
+ }
free (pNode);
pNode = NULL;
break;
@@ -182,7 +179,7 @@ static void forcePort ( ELLLIST *pList, unsigned short port )
/*
* configureChannelAccessAddressList ()
*/
-extern "C" void epicsShareAPI configureChannelAccessAddressList
+extern "C" void epicsStdCall configureChannelAccessAddressList
( ELLLIST *pList, SOCKET sock, unsigned short port )
{
ELLLIST tmpList;
@@ -203,7 +200,7 @@ extern "C" void epicsShareAPI configureChannelAccessAddressList
* from the interfaces found.
*/
yes = true;
- pstr = envGetConfigParam ( &EPICS_CA_AUTO_ADDR_LIST,
+ pstr = envGetConfigParam ( &EPICS_CA_AUTO_ADDR_LIST,
sizeof (yesno), yesno );
if ( pstr ) {
if ( strstr ( pstr, "no" ) || strstr ( pstr, "NO" ) ) {
@@ -216,19 +213,19 @@ extern "C" void epicsShareAPI configureChannelAccessAddressList
* (lock outside because this is used by the server also)
*/
if (yes) {
- ELLLIST bcastList;
+ ELLLIST bcastList;
osiSockAddr addr;
- ellInit ( &bcastList );
+ ellInit ( &bcastList );
addr.ia.sin_family = AF_UNSPEC;
osiSockDiscoverBroadcastAddresses ( &bcastList, sock, &addr );
forcePort ( &bcastList, port );
- removeDuplicateAddresses ( &tmpList, &bcastList, 1 );
+ removeDuplicateAddresses ( &tmpList, &bcastList, 1 );
if ( ellCount ( &tmpList ) == 0 ) {
osiSockAddrNode *pNewNode;
pNewNode = (osiSockAddrNode *) calloc ( 1, sizeof (*pNewNode) );
if ( pNewNode ) {
- /*
- * if no interfaces found then look for local channels
+ /*
+ * if no interfaces found then look for local channels
* with the loop back interface
*/
pNewNode->addr.ia.sin_family = AF_INET;
@@ -250,7 +247,7 @@ extern "C" void epicsShareAPI configureChannelAccessAddressList
/*
* printChannelAccessAddressList ()
*/
-extern "C" void epicsShareAPI printChannelAccessAddressList ( const ELLLIST *pList )
+extern "C" void epicsStdCall printChannelAccessAddressList ( const ELLLIST *pList )
{
osiSockAddrNode *pNode;
diff --git a/modules/ca/src/client/iocinf.h b/modules/ca/src/client/iocinf.h
index 0d3b57db1..5100ac0e7 100644
--- a/modules/ca/src/client/iocinf.h
+++ b/modules/ca/src/client/iocinf.h
@@ -3,27 +3,26 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef INCiocinfh
-#define INCiocinfh
+#ifndef INC_iocinf_H
+#define INC_iocinf_H
#ifdef DEBUG
# define debugPrintf(argsInParen) ::printf argsInParen
@@ -47,17 +46,17 @@
* CA_CONN_VERIFY_PERIOD is normally obtained from an
* EPICS environment variable.
*/
-static const double CA_ECHO_TIMEOUT = 5.0; /* (sec) disconn no echo reply tmo */
+static const double CA_ECHO_TIMEOUT = 5.0; /* (sec) disconn no echo reply tmo */
static const double CA_CONN_VERIFY_PERIOD = 30.0; /* (sec) how often to request echo */
/*
* this determines the number of messages received
- * without a delay in between before we go into
+ * without a delay in between before we go into
* monitor flow control
*
* turning this down effects maximum throughput
- * because we dont get an optimal number of bytes
- * per network frame
+ * because we dont get an optimal number of bytes
+ * per network frame
*/
static const unsigned contiguousMsgCountWhichTriggersFlowControl = 10u;
@@ -67,4 +66,4 @@ static const unsigned contiguousMsgCountWhichTriggersFlowControl = 10u;
#define genLocalExcep( CBGUARD, GUARD, CAC, STAT, PCTX ) \
(CAC).exception ( CBGUARD, GUARD, STAT, PCTX, __FILE__, __LINE__ )
-#endif // ifdef INCiocinfh
+#endif // ifdef INC_iocinf_H
diff --git a/modules/ca/src/client/localHostName.cpp b/modules/ca/src/client/localHostName.cpp
index b0b96bb47..7bc034f90 100644
--- a/modules/ca/src/client/localHostName.cpp
+++ b/modules/ca/src/client/localHostName.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -31,7 +30,7 @@ localHostName::localHostName () :
const char * pErrStr = "";
int status = -1;
if ( this->attachedToSockLib ) {
- status = gethostname (
+ status = gethostname (
this->cache, sizeof ( this->cache ) );
}
if ( status ) {
@@ -48,7 +47,7 @@ localHostName::~localHostName ()
}
}
-unsigned localHostName::getName (
+unsigned localHostName::getName (
char * pBuf, unsigned bufLength ) const
{
if ( bufLength ) {
diff --git a/modules/ca/src/client/localHostName.h b/modules/ca/src/client/localHostName.h
index f116b8140..e26a520b4 100644
--- a/modules/ca/src/client/localHostName.h
+++ b/modules/ca/src/client/localHostName.h
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -19,22 +18,13 @@
* Author: Jeff Hill
*/
-#ifndef localHostNameh
-#define localHostNameh
+#ifndef INC_localHostName_H
+#define INC_localHostName_H
#include
-#ifdef epicsExportSharedSymbols
-# define localHostNameh_restore_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
-
#include "epicsSingleton.h"
-#ifdef localHostNameh_restore_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-#endif
-
class localHostName {
public:
localHostName ();
@@ -60,6 +50,6 @@ inline const char * localHostName::pointer () const
return this->cache;
}
-#endif // ifndef localHostNameh
+#endif // ifndef INC_localHostName_H
diff --git a/modules/ca/src/client/msgForMultiplyDefinedPV.cpp b/modules/ca/src/client/msgForMultiplyDefinedPV.cpp
index 7002dd4b9..72fe2b04e 100644
--- a/modules/ca/src/client/msgForMultiplyDefinedPV.cpp
+++ b/modules/ca/src/client/msgForMultiplyDefinedPV.cpp
@@ -3,24 +3,23 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include
@@ -30,15 +29,14 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "msgForMultiplyDefinedPV.h"
#include "cac.h"
#include "caerr.h" // for ECA_DBLCHNL
-msgForMultiplyDefinedPV::msgForMultiplyDefinedPV (
+msgForMultiplyDefinedPV::msgForMultiplyDefinedPV (
ipAddrToAsciiEngine & engine,
- callbackForMultiplyDefinedPV & cbIn,
+ callbackForMultiplyDefinedPV & cbIn,
const char * pChannelName, const char * pAcc ) :
dnsTransaction ( engine.createTransaction () ), cb ( cbIn )
{
@@ -61,15 +59,15 @@ void msgForMultiplyDefinedPV::transactionComplete ( const char * pHostNameRej )
// !! dont touch 'this' pointer after this point because object has been deleted !!
}
-void * msgForMultiplyDefinedPV::operator new ( size_t size,
+void * msgForMultiplyDefinedPV::operator new ( size_t size,
tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList )
{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
-void msgForMultiplyDefinedPV::operator delete ( void *pCadaver,
- tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList )
+void msgForMultiplyDefinedPV::operator delete ( void *pCadaver,
+ tsFreeList < class msgForMultiplyDefinedPV, 16 > & freeList )
{
freeList.release ( pCadaver, sizeof ( msgForMultiplyDefinedPV ) );
}
diff --git a/modules/ca/src/client/msgForMultiplyDefinedPV.h b/modules/ca/src/client/msgForMultiplyDefinedPV.h
index 3f1e771c0..187fa0d56 100644
--- a/modules/ca/src/client/msgForMultiplyDefinedPV.h
+++ b/modules/ca/src/client/msgForMultiplyDefinedPV.h
@@ -3,48 +3,38 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef msgForMultiplyDefinedPVh
-#define msgForMultiplyDefinedPVh
-
-#ifdef epicsExportSharedSymbols
-# define msgForMultiplyDefinedPVh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_msgForMultiplyDefinedPV_H
+#define INC_msgForMultiplyDefinedPV_H
#include "ipAddrToAsciiAsynchronous.h"
#include "tsFreeList.h"
#include "tsDLList.h"
#include "compilerDependencies.h"
-#ifdef msgForMultiplyDefinedPVh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-#endif
-
class callbackForMultiplyDefinedPV {
public:
virtual ~callbackForMultiplyDefinedPV () = 0;
- virtual void pvMultiplyDefinedNotify (
- class msgForMultiplyDefinedPV &, const char * pChannelName,
+ virtual void pvMultiplyDefinedNotify (
+ class msgForMultiplyDefinedPV &, const char * pChannelName,
const char * pAcc, const char * pRej ) = 0;
};
@@ -53,7 +43,7 @@ class msgForMultiplyDefinedPV :
public tsDLNode < msgForMultiplyDefinedPV > {
public:
msgForMultiplyDefinedPV ( ipAddrToAsciiEngine & engine,
- callbackForMultiplyDefinedPV &, const char * pChannelName,
+ callbackForMultiplyDefinedPV &, const char * pChannelName,
const char * pAcc );
virtual ~msgForMultiplyDefinedPV ();
void ioInitiate ( const osiSockAddr & rej );
@@ -75,5 +65,5 @@ inline void msgForMultiplyDefinedPV::ioInitiate ( const osiSockAddr & rej )
this->dnsTransaction.ipAddrToAscii ( rej, *this );
}
-#endif // ifdef msgForMultiplyDefinedPVh
+#endif // ifdef INC_msgForMultiplyDefinedPV_H
diff --git a/modules/ca/src/client/nciu.cpp b/modules/ca/src/client/nciu.cpp
index 8eb89c5c3..0a7e70899 100644
--- a/modules/ca/src/client/nciu.cpp
+++ b/modules/ca/src/client/nciu.cpp
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -29,7 +28,6 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "cac.h"
#include "osiWireFormat.h"
@@ -51,7 +49,7 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
typeCode ( USHRT_MAX ),
priority ( static_cast ( pri ) )
{
- size_t nameLengthTmp = strlen ( pNameIn ) + 1;
+ size_t nameLengthTmp = strlen ( pNameIn ) + 1;
// second constraint is imposed by size field in protocol header
if ( nameLengthTmp > MAX_UDP_SEND - sizeof ( caHdr ) || nameLengthTmp > USHRT_MAX ) {
@@ -62,7 +60,7 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn,
throw cacChannel::badPriority ();
}
- this->nameLength = static_cast ( nameLengthTmp );
+ this->nameLength = static_cast ( nameLengthTmp );
this->pNameStr = new char [ this->nameLength ];
strcpy ( this->pNameStr, pNameIn );
@@ -114,7 +112,7 @@ void nciu::initiateConnect (
}
void nciu::connect ( unsigned nativeType,
- unsigned nativeCount, unsigned sidIn,
+ unsigned nativeCount, unsigned sidIn,
epicsGuard < epicsMutex > & /* cbGuard */,
epicsGuard < epicsMutex > & guard )
{
diff --git a/modules/ca/src/client/nciu.h b/modules/ca/src/client/nciu.h
index 7cba6e82b..adfeda2c8 100644
--- a/modules/ca/src/client/nciu.h
+++ b/modules/ca/src/client/nciu.h
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -17,18 +16,13 @@
* Copyright, 1986, The Regents of the University of California.
*
*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef nciuh
-#define nciuh
-
-#ifdef epicsExportSharedSymbols
-# define nciuh_restore_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_nciu_H
+#define INC_nciu_H
#include "resourceLib.h"
#include "tsDLList.h"
@@ -36,10 +30,7 @@
#include "epicsMutex.h"
#include "compilerDependencies.h"
-#ifdef nciuh_restore_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
#define CA_MINOR_PROTOCOL_REVISION 13
#include "caProto.h"
@@ -278,8 +269,8 @@ private:
epicsGuard < epicsMutex > &, class baseNMIU & );
const char * pHostName (
epicsGuard < epicsMutex > & guard ) const throw ();
- nciu ( const nciu & );
- nciu & operator = ( const nciu & );
+ nciu ( const nciu & );
+ nciu & operator = ( const nciu & );
void operator delete ( void * );
};
@@ -382,4 +373,4 @@ inline bool channelNode::isInstalledInServer ( epicsGuard < epicsMutex > & ) con
this->listMember == cs_subscripUpdateReqPend;
}
-#endif // ifdef nciuh
+#endif // ifdef INC_nciu_H
diff --git a/modules/ca/src/client/netIO.h b/modules/ca/src/client/netIO.h
index e728d2a1a..e5a257164 100644
--- a/modules/ca/src/client/netIO.h
+++ b/modules/ca/src/client/netIO.h
@@ -3,35 +3,34 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef netIOh
-#define netIOh
+#ifndef INC_netIO_H
+#define INC_netIO_H
#include "nciu.h"
#include "compilerDependencies.h"
// SUN PRO generates multiply defined symbols if the baseNMIU
-// destructor is virtual (therefore it is protected).
+// destructor is virtual (therefore it is protected).
// I assume that SUNPRO will fix this in future versions.
-// With other compilers we get warnings (and
+// With other compilers we get warnings (and
// potential problems) if we dont make the baseNMIU
// destructor virtual.
#if defined ( __SUNPRO_CC ) && ( __SUNPRO_CC <= 0x540 )
@@ -45,42 +44,42 @@ class privateInterfaceForIO;
class baseNMIU : public tsDLNode < baseNMIU >,
public chronIntIdRes < baseNMIU > {
public:
- virtual void destroy (
+ virtual void destroy (
epicsGuard < epicsMutex > &, class cacRecycle & ) = 0; // only called by cac
- virtual void completion (
+ virtual void completion (
epicsGuard < epicsMutex > &, cacRecycle & ) = 0;
- virtual void exception (
- epicsGuard < epicsMutex > &, cacRecycle &,
+ virtual void exception (
+ epicsGuard < epicsMutex > &, cacRecycle &,
int status, const char * pContext ) = 0;
- virtual void exception (
+ virtual void exception (
epicsGuard < epicsMutex > &, cacRecycle &,
- int status, const char * pContext, unsigned type,
+ int status, const char * pContext, unsigned type,
arrayElementCount count ) = 0;
- virtual void completion (
+ virtual void completion (
epicsGuard < epicsMutex > &, cacRecycle &,
- unsigned type, arrayElementCount count,
+ unsigned type, arrayElementCount count,
const void * pData ) = 0;
virtual void forceSubscriptionUpdate (
epicsGuard < epicsMutex > & guard, nciu & chan ) = 0;
virtual class netSubscription * isSubscription () = 0;
- virtual void show (
+ virtual void show (
unsigned level ) const = 0;
- virtual void show (
- epicsGuard < epicsMutex > &,
+ virtual void show (
+ epicsGuard < epicsMutex > &,
unsigned level ) const = 0;
protected:
- NETIO_VIRTUAL_DESTRUCTOR ~baseNMIU ();
+ NETIO_VIRTUAL_DESTRUCTOR ~baseNMIU ();
};
class netSubscription : public baseNMIU {
public:
- static netSubscription * factory (
- tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &,
- class privateInterfaceForIO &, unsigned type, arrayElementCount count,
+ static netSubscription * factory (
+ tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &,
+ class privateInterfaceForIO &, unsigned type, arrayElementCount count,
unsigned mask, cacStateNotify & );
- void show (
+ void show (
unsigned level ) const;
- void show (
+ void show (
epicsGuard < epicsMutex > &, unsigned level ) const;
arrayElementCount getCount (
epicsGuard < epicsMutex > &, bool allow_zero ) const;
@@ -90,12 +89,12 @@ public:
epicsGuard < epicsMutex > & ) const;
void subscribeIfRequired (
epicsGuard < epicsMutex > & guard, nciu & chan );
- void unsubscribeIfRequired (
+ void unsubscribeIfRequired (
epicsGuard < epicsMutex > & guard, nciu & chan );
protected:
- netSubscription (
- class privateInterfaceForIO &, unsigned type,
- arrayElementCount count,
+ netSubscription (
+ class privateInterfaceForIO &, unsigned type,
+ arrayElementCount count,
unsigned mask, cacStateNotify & );
~netSubscription ();
private:
@@ -107,23 +106,23 @@ private:
bool subscribed;
class netSubscription * isSubscription ();
void operator delete ( void * );
- void * operator new ( size_t,
+ void * operator new ( size_t,
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & );
- epicsPlacementDeleteOperator (( void *,
+ epicsPlacementDeleteOperator (( void *,
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & ))
- void destroy (
+ void destroy (
epicsGuard < epicsMutex > &, class cacRecycle & );
void completion (
epicsGuard < epicsMutex > &, cacRecycle & );
- void exception (
+ void exception (
epicsGuard < epicsMutex > &, cacRecycle &,
int status, const char * pContext );
- void completion (
+ void completion (
epicsGuard < epicsMutex > &, cacRecycle &,
unsigned type, arrayElementCount count, const void * pData );
- void exception (
+ void exception (
epicsGuard < epicsMutex > &, cacRecycle &,
- int status, const char * pContext, unsigned type,
+ int status, const char * pContext, unsigned type,
arrayElementCount count );
void forceSubscriptionUpdate (
epicsGuard < epicsMutex > & guard, nciu & chan );
@@ -133,12 +132,12 @@ private:
class netReadNotifyIO : public baseNMIU {
public:
- static netReadNotifyIO * factory (
- tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > &,
+ static netReadNotifyIO * factory (
+ tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > &,
privateInterfaceForIO &, cacReadNotify & );
- void show (
+ void show (
unsigned level ) const;
- void show (
+ void show (
epicsGuard < epicsMutex > &, unsigned level ) const;
protected:
netReadNotifyIO ( privateInterfaceForIO &, cacReadNotify & );
@@ -147,24 +146,24 @@ private:
cacReadNotify & notify;
class privateInterfaceForIO & privateChanForIO;
void operator delete ( void * );
- void * operator new ( size_t,
+ void * operator new ( size_t,
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & );
- epicsPlacementDeleteOperator (( void *,
+ epicsPlacementDeleteOperator (( void *,
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & ))
- void destroy (
+ void destroy (
epicsGuard < epicsMutex > &, class cacRecycle & );
void completion (
epicsGuard < epicsMutex > &, cacRecycle & );
- void exception (
+ void exception (
epicsGuard < epicsMutex > &, cacRecycle &,
int status, const char * pContext );
- void completion (
+ void completion (
epicsGuard < epicsMutex > &, cacRecycle &,
unsigned type, arrayElementCount count,
const void * pData );
- void exception (
+ void exception (
epicsGuard < epicsMutex > &, cacRecycle &,
- int status, const char * pContext,
+ int status, const char * pContext,
unsigned type, arrayElementCount count );
class netSubscription * isSubscription ();
void forceSubscriptionUpdate (
@@ -175,12 +174,12 @@ private:
class netWriteNotifyIO : public baseNMIU {
public:
- static netWriteNotifyIO * factory (
- tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > &,
+ static netWriteNotifyIO * factory (
+ tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > &,
privateInterfaceForIO &, cacWriteNotify & );
- void show (
+ void show (
unsigned level ) const;
- void show (
+ void show (
epicsGuard < epicsMutex > &, unsigned level ) const;
protected:
netWriteNotifyIO ( privateInterfaceForIO &, cacWriteNotify & );
@@ -189,25 +188,25 @@ private:
cacWriteNotify & notify;
privateInterfaceForIO & privateChanForIO;
void operator delete ( void * );
- void * operator new ( size_t,
+ void * operator new ( size_t,
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void *,
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & ))
class netSubscription * isSubscription ();
- void destroy (
+ void destroy (
epicsGuard < epicsMutex > &, class cacRecycle & );
void completion (
epicsGuard < epicsMutex > &, cacRecycle & );
- void exception (
+ void exception (
epicsGuard < epicsMutex > &, cacRecycle &,
int status, const char * pContext );
- void completion (
+ void completion (
epicsGuard < epicsMutex > &, cacRecycle &,
unsigned type, arrayElementCount count,
const void * pData );
- void exception (
+ void exception (
epicsGuard < epicsMutex > &, cacRecycle &,
- int status, const char * pContext, unsigned type,
+ int status, const char * pContext, unsigned type,
arrayElementCount count );
void forceSubscriptionUpdate (
epicsGuard < epicsMutex > & guard, nciu & chan );
@@ -215,23 +214,23 @@ private:
netWriteNotifyIO & operator = ( const netWriteNotifyIO & );
};
-inline void * netSubscription::operator new ( size_t size,
+inline void * netSubscription::operator new ( size_t size,
tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList )
{
return freeList.allocate ( size );
}
#if defined ( CXX_PLACEMENT_DELETE )
- inline void netSubscription::operator delete ( void *pCadaver,
- tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList )
+ inline void netSubscription::operator delete ( void *pCadaver,
+ tsFreeList < class netSubscription, 1024, epicsMutexNOOP > &freeList )
{
freeList.release ( pCadaver );
}
#endif
-inline netSubscription * netSubscription::factory (
- tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & freeList,
- class privateInterfaceForIO & chan, unsigned type, arrayElementCount count,
+inline netSubscription * netSubscription::factory (
+ tsFreeList < class netSubscription, 1024, epicsMutexNOOP > & freeList,
+ class privateInterfaceForIO & chan, unsigned type, arrayElementCount count,
unsigned mask, cacStateNotify ¬ify )
{
return new ( freeList ) netSubscription ( chan, type,
@@ -261,46 +260,46 @@ inline unsigned netSubscription::getMask ( epicsGuard < epicsMutex > & ) const
return this->mask;
}
-inline netReadNotifyIO * netReadNotifyIO::factory (
- tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList,
+inline netReadNotifyIO * netReadNotifyIO::factory (
+ tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList,
privateInterfaceForIO & ioComplNotifIntf, cacReadNotify & notify )
{
return new ( freeList ) netReadNotifyIO ( ioComplNotifIntf, notify );
}
-inline void * netReadNotifyIO::operator new ( size_t size,
+inline void * netReadNotifyIO::operator new ( size_t size,
tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList )
{
return freeList.allocate ( size );
}
#if defined ( CXX_PLACEMENT_DELETE )
- inline void netReadNotifyIO::operator delete ( void *pCadaver,
- tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList )
+ inline void netReadNotifyIO::operator delete ( void *pCadaver,
+ tsFreeList < class netReadNotifyIO, 1024, epicsMutexNOOP > & freeList )
{
freeList.release ( pCadaver );
}
#endif
-inline netWriteNotifyIO * netWriteNotifyIO::factory (
- tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList,
+inline netWriteNotifyIO * netWriteNotifyIO::factory (
+ tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList,
privateInterfaceForIO & ioComplNotifyIntf, cacWriteNotify & notify )
{
return new ( freeList ) netWriteNotifyIO ( ioComplNotifyIntf, notify );
}
-inline void * netWriteNotifyIO::operator new ( size_t size,
+inline void * netWriteNotifyIO::operator new ( size_t size,
tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList )
-{
+{
return freeList.allocate ( size );
}
#if defined ( CXX_PLACEMENT_DELETE )
- inline void netWriteNotifyIO::operator delete ( void *pCadaver,
- tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList )
+ inline void netWriteNotifyIO::operator delete ( void *pCadaver,
+ tsFreeList < class netWriteNotifyIO, 1024, epicsMutexNOOP > & freeList )
{
freeList.release ( pCadaver );
}
#endif
-#endif // ifdef netIOh
+#endif // ifdef INC_netIO_H
diff --git a/modules/ca/src/client/netReadNotifyIO.cpp b/modules/ca/src/client/netReadNotifyIO.cpp
index 2e4b8ead6..7a61acbcf 100644
--- a/modules/ca/src/client/netReadNotifyIO.cpp
+++ b/modules/ca/src/client/netReadNotifyIO.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -29,8 +28,8 @@
#include "nciu.h"
#include "cac.h"
-netReadNotifyIO::netReadNotifyIO (
- privateInterfaceForIO & ioComplIntfIn,
+netReadNotifyIO::netReadNotifyIO (
+ privateInterfaceForIO & ioComplIntfIn,
cacReadNotify & notify ) :
notify ( notify ), privateChanForIO ( ioComplIntfIn )
{
@@ -42,26 +41,26 @@ netReadNotifyIO::~netReadNotifyIO ()
void netReadNotifyIO::show ( unsigned /* level */ ) const
{
- ::printf ( "netReadNotifyIO at %p\n",
+ ::printf ( "netReadNotifyIO at %p\n",
static_cast < const void * > ( this ) );
}
-void netReadNotifyIO::show (
+void netReadNotifyIO::show (
epicsGuard < epicsMutex > &, unsigned level ) const
{
this->show ( level );
}
-void netReadNotifyIO::destroy (
+void netReadNotifyIO::destroy (
epicsGuard < epicsMutex > & guard, cacRecycle & recycle )
{
this->~netReadNotifyIO ();
recycle.recycleReadNotifyIO ( guard, *this );
}
-void netReadNotifyIO::completion (
- epicsGuard < epicsMutex > & guard,
- cacRecycle & recycle, unsigned type,
+void netReadNotifyIO::completion (
+ epicsGuard < epicsMutex > & guard,
+ cacRecycle & recycle, unsigned type,
arrayElementCount count, const void * pData )
{
//guard.assertIdenticalMutex ( this->mutex );
@@ -82,28 +81,28 @@ void netReadNotifyIO::completion (
recycle.recycleReadNotifyIO ( guard, *this );
}
-void netReadNotifyIO::exception (
- epicsGuard < epicsMutex > & guard,
+void netReadNotifyIO::exception (
+ epicsGuard < epicsMutex > & guard,
cacRecycle & recycle,
int status, const char *pContext )
{
//guard.assertIdenticalMutex ( this->mutex );
this->privateChanForIO.ioCompletionNotify ( guard, *this );
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, UINT_MAX, 0u );
this->~netReadNotifyIO ();
recycle.recycleReadNotifyIO ( guard, *this );
}
-void netReadNotifyIO::exception (
- epicsGuard < epicsMutex > & guard,
+void netReadNotifyIO::exception (
+ epicsGuard < epicsMutex > & guard,
cacRecycle & recycle,
- int status, const char *pContext,
+ int status, const char *pContext,
unsigned type, arrayElementCount count )
{
//guard.assertIdenticalMutex ( this->mutex )
this->privateChanForIO.ioCompletionNotify ( guard, *this );
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, type, count );
this->~netReadNotifyIO ();
recycle.recycleReadNotifyIO ( guard, *this );
diff --git a/modules/ca/src/client/netSubscription.cpp b/modules/ca/src/client/netSubscription.cpp
index fe2426a89..78a0b1b6c 100644
--- a/modules/ca/src/client/netSubscription.cpp
+++ b/modules/ca/src/client/netSubscription.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -25,16 +24,15 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "nciu.h"
#include "cac.h"
#include "db_access.h" // for dbf_type_to_text
#include "caerr.h"
-netSubscription::netSubscription (
- privateInterfaceForIO & chanIn,
- unsigned typeIn, arrayElementCount countIn,
+netSubscription::netSubscription (
+ privateInterfaceForIO & chanIn,
+ unsigned typeIn, arrayElementCount countIn,
unsigned maskIn, cacStateNotify & notifyIn ) :
count ( countIn ), privateChanForIO ( chanIn ),
notify ( notifyIn ), type ( typeIn ), mask ( maskIn ),
@@ -48,11 +46,11 @@ netSubscription::netSubscription (
}
}
-netSubscription::~netSubscription ()
+netSubscription::~netSubscription ()
{
}
-void netSubscription::destroy (
+void netSubscription::destroy (
epicsGuard < epicsMutex > & guard, cacRecycle & recycle )
{
this->~netSubscription ();
@@ -66,26 +64,26 @@ class netSubscription * netSubscription::isSubscription ()
void netSubscription::show ( unsigned /* level */ ) const
{
- ::printf ( "event subscription IO at %p, type %s, element count %lu, mask %u\n",
- static_cast < const void * > ( this ),
- dbf_type_to_text ( static_cast < int > ( this->type ) ),
+ ::printf ( "event subscription IO at %p, type %s, element count %lu, mask %u\n",
+ static_cast < const void * > ( this ),
+ dbf_type_to_text ( static_cast < int > ( this->type ) ),
this->count, this->mask );
}
-void netSubscription::show (
+void netSubscription::show (
epicsGuard < epicsMutex > &, unsigned level ) const
{
this->show ( level );
}
-void netSubscription::completion (
+void netSubscription::completion (
epicsGuard < epicsMutex > &, cacRecycle & )
{
errlogPrintf ( "subscription update w/o data ?\n" );
}
-void netSubscription::exception (
- epicsGuard < epicsMutex > & guard, cacRecycle & recycle,
+void netSubscription::exception (
+ epicsGuard < epicsMutex > & guard, cacRecycle & recycle,
int status, const char * pContext )
{
if ( status == ECA_DISCONN ) {
@@ -93,7 +91,7 @@ void netSubscription::exception (
}
if ( status == ECA_CHANDESTROY ) {
this->privateChanForIO.ioCompletionNotify ( guard, *this );
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, UINT_MAX, 0 );
this->~netSubscription ();
recycle.recycleSubscription ( guard, *this );
@@ -101,15 +99,15 @@ void netSubscription::exception (
else {
// guard.assertIdenticalMutex ( this->mutex );
if ( this->privateChanForIO.connected ( guard ) ) {
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, UINT_MAX, 0 );
}
}
}
-void netSubscription::exception (
- epicsGuard < epicsMutex > & guard,
- cacRecycle & recycle, int status, const char * pContext,
+void netSubscription::exception (
+ epicsGuard < epicsMutex > & guard,
+ cacRecycle & recycle, int status, const char * pContext,
unsigned typeIn, arrayElementCount countIn )
{
if ( status == ECA_DISCONN ) {
@@ -117,7 +115,7 @@ void netSubscription::exception (
}
if ( status == ECA_CHANDESTROY ) {
this->privateChanForIO.ioCompletionNotify ( guard, *this );
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, UINT_MAX, 0 );
this->~netSubscription ();
recycle.recycleSubscription ( guard, *this );
@@ -125,20 +123,20 @@ void netSubscription::exception (
else {
//guard.assertIdenticalMutex ( this->mutex );
if ( this->privateChanForIO.connected ( guard ) ) {
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, typeIn, countIn );
}
}
}
-void netSubscription::completion (
+void netSubscription::completion (
epicsGuard < epicsMutex > & guard, cacRecycle &,
- unsigned typeIn, arrayElementCount countIn,
+ unsigned typeIn, arrayElementCount countIn,
const void * pDataIn )
{
// guard.assertIdenticalMutex ( this->mutex );
if ( this->privateChanForIO.connected ( guard ) ) {
- this->notify.current (
+ this->notify.current (
guard, typeIn, countIn, pDataIn );
}
}
@@ -147,17 +145,17 @@ void netSubscription::subscribeIfRequired (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
if ( ! this->subscribed ) {
- chan.getPIIU(guard)->subscriptionRequest (
+ chan.getPIIU(guard)->subscriptionRequest (
guard, chan, *this );
this->subscribed = true;
}
}
-void netSubscription::unsubscribeIfRequired (
+void netSubscription::unsubscribeIfRequired (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
if ( this->subscribed ) {
- chan.getPIIU(guard)->subscriptionCancelRequest (
+ chan.getPIIU(guard)->subscriptionCancelRequest (
guard, chan, *this );
this->subscribed = false;
}
@@ -166,7 +164,7 @@ void netSubscription::unsubscribeIfRequired (
void netSubscription::forceSubscriptionUpdate (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
- chan.getPIIU(guard)->subscriptionUpdateRequest (
+ chan.getPIIU(guard)->subscriptionUpdateRequest (
guard, chan, *this );
}
diff --git a/modules/ca/src/client/netWriteNotifyIO.cpp b/modules/ca/src/client/netWriteNotifyIO.cpp
index afa9996d5..1e11a6e62 100644
--- a/modules/ca/src/client/netWriteNotifyIO.cpp
+++ b/modules/ca/src/client/netWriteNotifyIO.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -29,7 +28,7 @@
#include "nciu.h"
#include "cac.h"
-netWriteNotifyIO::netWriteNotifyIO (
+netWriteNotifyIO::netWriteNotifyIO (
privateInterfaceForIO & ioComplIntf, cacWriteNotify & notifyIn ) :
notify ( notifyIn ), privateChanForIO ( ioComplIntf )
{
@@ -41,19 +40,19 @@ netWriteNotifyIO::~netWriteNotifyIO ()
void netWriteNotifyIO::show ( unsigned /* level */ ) const
{
- ::printf ( "read write notify IO at %p\n",
+ ::printf ( "read write notify IO at %p\n",
static_cast < const void * > ( this ) );
}
-void netWriteNotifyIO::show (
- epicsGuard < epicsMutex > &,
+void netWriteNotifyIO::show (
+ epicsGuard < epicsMutex > &,
unsigned level ) const
{
this->show ( level );
}
-void netWriteNotifyIO::destroy (
- epicsGuard < epicsMutex > & guard,
+void netWriteNotifyIO::destroy (
+ epicsGuard < epicsMutex > & guard,
cacRecycle & recycle )
{
this->~netWriteNotifyIO ();
@@ -70,10 +69,10 @@ void netWriteNotifyIO::completion (
recycle.recycleWriteNotifyIO ( guard, *this );
}
-void netWriteNotifyIO::completion (
- epicsGuard < epicsMutex > & guard,
+void netWriteNotifyIO::completion (
+ epicsGuard < epicsMutex > & guard,
cacRecycle & recycle,
- unsigned /* type */, arrayElementCount /* count */,
+ unsigned /* type */, arrayElementCount /* count */,
const void * /* pData */ )
{
//this->chan.getClient().printf ( "Write response with data ?\n" );
@@ -82,26 +81,26 @@ void netWriteNotifyIO::completion (
recycle.recycleWriteNotifyIO ( guard, *this );
}
-void netWriteNotifyIO::exception (
+void netWriteNotifyIO::exception (
epicsGuard < epicsMutex > & guard,
cacRecycle & recycle,
int status, const char * pContext )
{
this->privateChanForIO.ioCompletionNotify ( guard, *this );
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, UINT_MAX, 0u );
this->~netWriteNotifyIO ();
recycle.recycleWriteNotifyIO ( guard, *this );
}
-void netWriteNotifyIO::exception (
- epicsGuard < epicsMutex > & guard,
+void netWriteNotifyIO::exception (
+ epicsGuard < epicsMutex > & guard,
cacRecycle & recycle,
- int status, const char *pContext,
+ int status, const char *pContext,
unsigned type, arrayElementCount count )
{
this->privateChanForIO.ioCompletionNotify ( guard, *this );
- this->notify.exception (
+ this->notify.exception (
guard, status, pContext, type, count );
this->~netWriteNotifyIO ();
recycle.recycleWriteNotifyIO ( guard, *this );
diff --git a/modules/ca/src/client/net_convert.h b/modules/ca/src/client/net_convert.h
index bee51c0c4..24640dbc4 100644
--- a/modules/ca/src/client/net_convert.h
+++ b/modules/ca/src/client/net_convert.h
@@ -3,21 +3,20 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
- * Author: J. Hill
+ * Author: J. Hill
*
*/
-#ifndef _NET_CONVERT_H
-#define _NET_CONVERT_H
+#ifndef INC_net_convert_H
+#define INC_net_convert_H
#include "db_access.h"
-#include "shareLib.h"
+#include "libCaAPI.h"
#ifdef __cplusplus
extern "C" {
@@ -25,12 +24,12 @@ extern "C" {
typedef unsigned long arrayElementCount;
-epicsShareFunc int caNetConvert (
- unsigned type, const void *pSrc, void *pDest,
+LIBCA_API int caNetConvert (
+ unsigned type, const void *pSrc, void *pDest,
int hton, arrayElementCount count );
#ifdef __cplusplus
}
#endif
-#endif /* define _NET_CONVERT_H */
+#endif /* ifndef INC_net_convert_H */
diff --git a/modules/ca/src/client/netiiu.cpp b/modules/ca/src/client/netiiu.cpp
index a81b15533..4f4204da8 100644
--- a/modules/ca/src/client/netiiu.cpp
+++ b/modules/ca/src/client/netiiu.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -20,7 +19,7 @@
*/
#include
-#include // vxWorks 6.0 requires this include
+#include // vxWorks 6.0 requires this include
#include
#include
@@ -47,51 +46,51 @@ bool netiiu::ca_v41_ok (
return false;
}
-void netiiu::writeRequest (
- epicsGuard < epicsMutex > &, nciu &,
+void netiiu::writeRequest (
+ epicsGuard < epicsMutex > &, nciu &,
unsigned, arrayElementCount, const void * )
{
throw cacChannel::notConnected();
}
-void netiiu::writeNotifyRequest (
- epicsGuard < epicsMutex > &,
- nciu &, netWriteNotifyIO &, unsigned,
+void netiiu::writeNotifyRequest (
+ epicsGuard < epicsMutex > &,
+ nciu &, netWriteNotifyIO &, unsigned,
arrayElementCount, const void * )
{
throw cacChannel::notConnected();
}
-void netiiu::readNotifyRequest (
- epicsGuard < epicsMutex > &,
+void netiiu::readNotifyRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netReadNotifyIO &, unsigned, arrayElementCount )
{
throw cacChannel::notConnected();
}
-void netiiu::clearChannelRequest (
+void netiiu::clearChannelRequest (
epicsGuard < epicsMutex > &, ca_uint32_t, ca_uint32_t )
{
}
-void netiiu::subscriptionRequest (
+void netiiu::subscriptionRequest (
epicsGuard < epicsMutex > &, nciu &, netSubscription & )
{
}
-void netiiu::subscriptionCancelRequest (
+void netiiu::subscriptionCancelRequest (
epicsGuard < epicsMutex > &, nciu &, netSubscription & )
{
}
-void netiiu::subscriptionUpdateRequest (
+void netiiu::subscriptionUpdateRequest (
epicsGuard < epicsMutex > &, nciu &, netSubscription & )
{
}
static const char * const pHostNameNetIIU = "";
-unsigned netiiu::getHostName (
+unsigned netiiu::getHostName (
epicsGuard < epicsMutex > &,
char * pBuf, unsigned bufLen ) const throw ()
{
@@ -124,18 +123,18 @@ osiSockAddr netiiu::getNetworkAddress (
return addr;
}
-void netiiu::flushRequest (
+void netiiu::flushRequest (
epicsGuard < epicsMutex > & )
{
}
-unsigned netiiu::requestMessageBytesPending (
+unsigned netiiu::requestMessageBytesPending (
epicsGuard < epicsMutex > & )
{
return 0u;
}
-void netiiu::flush (
+void netiiu::flush (
epicsGuard < epicsMutex > & )
{
}
@@ -145,7 +144,7 @@ void netiiu::requestRecvProcessPostponedFlush (
{
}
-void netiiu::uninstallChan (
+void netiiu::uninstallChan (
epicsGuard < epicsMutex > &, nciu & )
{
throw cacChannel::notConnected();
@@ -157,15 +156,15 @@ double netiiu::receiveWatchdogDelay (
return - DBL_MAX;
}
-void netiiu::uninstallChanDueToSuccessfulSearchResponse (
+void netiiu::uninstallChanDueToSuccessfulSearchResponse (
epicsGuard < epicsMutex > &, nciu &, const epicsTime & )
{
- throw std::runtime_error (
+ throw std::runtime_error (
"search response occured when not attached to udpiiu?" );
}
bool netiiu::searchMsg (
- epicsGuard < epicsMutex > &, ca_uint32_t /* id */,
+ epicsGuard < epicsMutex > &, ca_uint32_t /* id */,
const char * /* pName */, unsigned /* nameLength */ )
{
return false;
diff --git a/modules/ca/src/client/netiiu.h b/modules/ca/src/client/netiiu.h
index 2caa3d0fa..e017153df 100644
--- a/modules/ca/src/client/netiiu.h
+++ b/modules/ca/src/client/netiiu.h
@@ -3,27 +3,26 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef netiiuh
-#define netiiuh
+#ifndef INC_netiiu_H
+#define INC_netiiu_H
#include "cacIO.h"
#include "caProto.h"
@@ -38,8 +37,8 @@ class nciu;
class netiiu {
public:
virtual ~netiiu () = 0;
- virtual unsigned getHostName (
- epicsGuard < epicsMutex > &, char * pBuf,
+ virtual unsigned getHostName (
+ epicsGuard < epicsMutex > &, char * pBuf,
unsigned bufLength ) const throw () = 0;
virtual const char * pHostName (
epicsGuard < epicsMutex > & ) const throw () = 0;
@@ -47,51 +46,51 @@ public:
epicsGuard < epicsMutex > & ) const = 0;
virtual bool ca_v42_ok (
epicsGuard < epicsMutex > & ) const = 0;
- virtual unsigned requestMessageBytesPending (
+ virtual unsigned requestMessageBytesPending (
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
- virtual void flush (
+ virtual void flush (
epicsGuard < epicsMutex > & mutualExclusionGuard ) = 0;
- virtual void writeRequest (
- epicsGuard < epicsMutex > &, nciu &,
- unsigned type, arrayElementCount nElem,
+ virtual void writeRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ unsigned type, arrayElementCount nElem,
const void *pValue ) = 0;
- virtual void writeNotifyRequest (
- epicsGuard < epicsMutex > &,
- nciu &, netWriteNotifyIO &,
- unsigned type, arrayElementCount nElem,
+ virtual void writeNotifyRequest (
+ epicsGuard < epicsMutex > &,
+ nciu &, netWriteNotifyIO &,
+ unsigned type, arrayElementCount nElem,
const void *pValue ) = 0;
- virtual void readNotifyRequest (
- epicsGuard < epicsMutex > &, nciu &,
- netReadNotifyIO &, unsigned type,
+ virtual void readNotifyRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ netReadNotifyIO &, unsigned type,
arrayElementCount nElem ) = 0;
- virtual void clearChannelRequest (
- epicsGuard < epicsMutex > &,
+ virtual void clearChannelRequest (
+ epicsGuard < epicsMutex > &,
ca_uint32_t sid, ca_uint32_t cid ) = 0;
- virtual void subscriptionRequest (
- epicsGuard < epicsMutex > &,
+ virtual void subscriptionRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netSubscription & ) = 0;
- virtual void subscriptionUpdateRequest (
- epicsGuard < epicsMutex > &,
+ virtual void subscriptionUpdateRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netSubscription & ) = 0;
- virtual void subscriptionCancelRequest (
- epicsGuard < epicsMutex > &,
+ virtual void subscriptionCancelRequest (
+ epicsGuard < epicsMutex > &,
nciu & chan, netSubscription & subscr ) = 0;
- virtual void flushRequest (
+ virtual void flushRequest (
epicsGuard < epicsMutex > & ) = 0;
virtual void requestRecvProcessPostponedFlush (
epicsGuard < epicsMutex > & ) = 0;
virtual osiSockAddr getNetworkAddress (
epicsGuard < epicsMutex > & ) const = 0;
- virtual void uninstallChan (
+ virtual void uninstallChan (
epicsGuard < epicsMutex > &, nciu & ) = 0;
- virtual void uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > &, nciu &,
+ virtual void uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > &, nciu &,
const class epicsTime & currentTime ) = 0;
virtual double receiveWatchdogDelay (
epicsGuard < epicsMutex > & ) const = 0;
virtual bool searchMsg (
- epicsGuard < epicsMutex > &, ca_uint32_t id,
+ epicsGuard < epicsMutex > &, ca_uint32_t id,
const char * pName, unsigned nameLength ) = 0;
};
-#endif // netiiuh
+#endif // ifndef INC_netiiu_H
diff --git a/modules/ca/src/client/noopiiu.cpp b/modules/ca/src/client/noopiiu.cpp
index a3d20b59b..14c878761 100644
--- a/modules/ca/src/client/noopiiu.cpp
+++ b/modules/ca/src/client/noopiiu.cpp
@@ -3,37 +3,35 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include "osiSock.h"
-#define epicsExportSharedSymbols
#include "noopiiu.h"
noopiiu noopIIU;
-noopiiu::~noopiiu ()
+noopiiu::~noopiiu ()
{
}
-unsigned noopiiu::getHostName (
+unsigned noopiiu::getHostName (
epicsGuard < epicsMutex > & cacGuard,
char * pBuf, unsigned bufLength ) const throw ()
{
@@ -58,71 +56,71 @@ bool noopiiu::ca_v41_ok (
return netiiu::ca_v41_ok ( cacGuard );
}
-void noopiiu::writeRequest (
- epicsGuard < epicsMutex > & guard,
- nciu & chan, unsigned type,
+void noopiiu::writeRequest (
+ epicsGuard < epicsMutex > & guard,
+ nciu & chan, unsigned type,
arrayElementCount nElem, const void * pValue )
{
netiiu::writeRequest ( guard, chan, type, nElem, pValue );
}
-void noopiiu::writeNotifyRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
- netWriteNotifyIO & io, unsigned type,
+void noopiiu::writeNotifyRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
+ netWriteNotifyIO & io, unsigned type,
arrayElementCount nElem, const void *pValue )
{
netiiu::writeNotifyRequest ( guard, chan, io, type, nElem, pValue );
}
-void noopiiu::readNotifyRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void noopiiu::readNotifyRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
netReadNotifyIO & io, unsigned type, arrayElementCount nElem )
{
netiiu::readNotifyRequest ( guard, chan, io, type, nElem );
}
-void noopiiu::clearChannelRequest (
- epicsGuard < epicsMutex > & guard,
+void noopiiu::clearChannelRequest (
+ epicsGuard < epicsMutex > & guard,
ca_uint32_t sid, ca_uint32_t cid )
{
netiiu::clearChannelRequest ( guard, sid, cid );
}
-void noopiiu::subscriptionRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void noopiiu::subscriptionRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
netSubscription & subscr )
{
netiiu::subscriptionRequest ( guard, chan, subscr );
}
-void noopiiu::subscriptionUpdateRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void noopiiu::subscriptionUpdateRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
netSubscription & subscr )
{
netiiu::subscriptionUpdateRequest (
guard, chan, subscr );
}
-void noopiiu::subscriptionCancelRequest (
- epicsGuard < epicsMutex > & guard,
+void noopiiu::subscriptionCancelRequest (
+ epicsGuard < epicsMutex > & guard,
nciu & chan, netSubscription & subscr )
{
netiiu::subscriptionCancelRequest ( guard, chan, subscr );
}
-void noopiiu::flushRequest (
+void noopiiu::flushRequest (
epicsGuard < epicsMutex > & guard )
{
netiiu::flushRequest ( guard );
}
-unsigned noopiiu::requestMessageBytesPending (
+unsigned noopiiu::requestMessageBytesPending (
epicsGuard < epicsMutex > & guard )
{
return netiiu::requestMessageBytesPending ( guard );
}
-void noopiiu::flush (
+void noopiiu::flush (
epicsGuard < epicsMutex > & guard )
{
netiiu::flush ( guard );
@@ -146,14 +144,14 @@ double noopiiu::receiveWatchdogDelay (
return netiiu::receiveWatchdogDelay ( guard );
}
-void noopiiu::uninstallChan (
+void noopiiu::uninstallChan (
epicsGuard < epicsMutex > &, nciu & )
{
// intentionally does not call default in netiiu
}
-void noopiiu::uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void noopiiu::uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
const class epicsTime & currentTime )
{
netiiu::uninstallChanDueToSuccessfulSearchResponse (
@@ -161,7 +159,7 @@ void noopiiu::uninstallChanDueToSuccessfulSearchResponse (
}
bool noopiiu::searchMsg (
- epicsGuard < epicsMutex > & guard, ca_uint32_t id,
+ epicsGuard < epicsMutex > & guard, ca_uint32_t id,
const char * pName, unsigned nameLength )
{
return netiiu::searchMsg (
diff --git a/modules/ca/src/client/noopiiu.h b/modules/ca/src/client/noopiiu.h
index f373edec8..9c761f83f 100644
--- a/modules/ca/src/client/noopiiu.h
+++ b/modules/ca/src/client/noopiiu.h
@@ -3,90 +3,89 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef noopiiuh
-#define noopiiuh
+#ifndef INC_noopiiu_H
+#define INC_noopiiu_H
#include "netiiu.h"
class noopiiu : public netiiu {
public:
~noopiiu ();
- unsigned getHostName (
- epicsGuard < epicsMutex > &, char * pBuf,
+ unsigned getHostName (
+ epicsGuard < epicsMutex > &, char * pBuf,
unsigned bufLength ) const throw ();
const char * pHostName (
- epicsGuard < epicsMutex > & ) const throw ();
+ epicsGuard < epicsMutex > & ) const throw ();
bool ca_v41_ok (
epicsGuard < epicsMutex > & ) const;
bool ca_v42_ok (
epicsGuard < epicsMutex > & ) const;
- unsigned requestMessageBytesPending (
+ unsigned requestMessageBytesPending (
epicsGuard < epicsMutex > & mutualExclusionGuard );
- void flush (
+ void flush (
epicsGuard < epicsMutex > & mutualExclusionGuard );
- void writeRequest (
- epicsGuard < epicsMutex > &, nciu &,
- unsigned type, arrayElementCount nElem,
+ void writeRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ unsigned type, arrayElementCount nElem,
const void *pValue );
- void writeNotifyRequest (
- epicsGuard < epicsMutex > &,
- nciu &, netWriteNotifyIO &,
- unsigned type, arrayElementCount nElem,
+ void writeNotifyRequest (
+ epicsGuard < epicsMutex > &,
+ nciu &, netWriteNotifyIO &,
+ unsigned type, arrayElementCount nElem,
const void *pValue );
- void readNotifyRequest (
- epicsGuard < epicsMutex > &, nciu &,
- netReadNotifyIO &, unsigned type,
+ void readNotifyRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ netReadNotifyIO &, unsigned type,
arrayElementCount nElem );
- void clearChannelRequest (
- epicsGuard < epicsMutex > &,
+ void clearChannelRequest (
+ epicsGuard < epicsMutex > &,
ca_uint32_t sid, ca_uint32_t cid );
- void subscriptionRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netSubscription & );
- void subscriptionUpdateRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionUpdateRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netSubscription & );
- void subscriptionCancelRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionCancelRequest (
+ epicsGuard < epicsMutex > &,
nciu & chan, netSubscription & subscr );
- void flushRequest (
+ void flushRequest (
epicsGuard < epicsMutex > & );
void requestRecvProcessPostponedFlush (
epicsGuard < epicsMutex > & );
osiSockAddr getNetworkAddress (
epicsGuard < epicsMutex > & ) const;
- void uninstallChan (
- epicsGuard < epicsMutex > & mutex,
+ void uninstallChan (
+ epicsGuard < epicsMutex > & mutex,
nciu & );
- void uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > &, nciu &,
+ void uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > &, nciu &,
const class epicsTime & currentTime );
double receiveWatchdogDelay (
epicsGuard < epicsMutex > & ) const;
bool searchMsg (
- epicsGuard < epicsMutex > &, ca_uint32_t id,
+ epicsGuard < epicsMutex > &, ca_uint32_t id,
const char * pName, unsigned nameLength );
};
extern noopiiu noopIIU;
-#endif // ifndef noopiiuh
+#endif // ifndef INC_noopiiu_H
diff --git a/modules/ca/src/client/oldAccess.h b/modules/ca/src/client/oldAccess.h
index 1337cb31a..cefa5f577 100644
--- a/modules/ca/src/client/oldAccess.h
+++ b/modules/ca/src/client/oldAccess.h
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -18,30 +17,21 @@
* Copyright, The Regents of the University of California.
*
*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef oldAccessh
-#define oldAccessh
+#ifndef INC_oldAccess_H
+#define INC_oldAccess_H
#include
-#ifdef epicsExportSharedSymbols
-# define oldAccessh_restore_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
-
#include "tsFreeList.h"
#include "compilerDependencies.h"
#include "osiSock.h"
-#ifdef oldAccessh_restore_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
+#include "libCaAPI.h"
#include "caProto.h"
#include "cacIO.h"
#include "cadef.h"
@@ -58,53 +48,53 @@ public:
epicsGuard < epicsMutex > & mutexGuard );
// legacy C API
- friend unsigned epicsShareAPI ca_get_host_name (
+ friend unsigned epicsStdCall ca_get_host_name (
chid pChan, char * pBuf, unsigned bufLength );
- friend const char * epicsShareAPI ca_host_name (
+ friend const char * epicsStdCall ca_host_name (
chid pChan );
- friend const char * epicsShareAPI ca_name (
+ friend const char * epicsStdCall ca_name (
chid pChan );
- friend void epicsShareAPI ca_set_puser (
+ friend void epicsStdCall ca_set_puser (
chid pChan, void * puser );
- friend void * epicsShareAPI ca_puser (
+ friend void * epicsStdCall ca_puser (
chid pChan );
- friend int epicsShareAPI ca_change_connection_event (
+ friend int epicsStdCall ca_change_connection_event (
chid pChan, caCh * pfunc );
- friend int epicsShareAPI ca_replace_access_rights_event (
+ friend int epicsStdCall ca_replace_access_rights_event (
chid pChan, caArh *pfunc );
- friend int epicsShareAPI ca_array_get ( chtype type,
+ friend int epicsStdCall ca_array_get ( chtype type,
arrayElementCount count, chid pChan, void * pValue );
- friend int epicsShareAPI ca_array_get_callback ( chtype type,
+ friend int epicsStdCall ca_array_get_callback ( chtype type,
arrayElementCount count, chid pChan,
caEventCallBackFunc *pfunc, void *arg );
- friend int epicsShareAPI ca_array_put (
+ friend int epicsStdCall ca_array_put (
chtype type, arrayElementCount count,
chid pChan, const void * pValue );
- friend int epicsShareAPI ca_array_put_callback (
+ friend int epicsStdCall ca_array_put_callback (
chtype type, arrayElementCount count,
chid pChan, const void *pValue,
caEventCallBackFunc *pfunc, void *usrarg );
- friend double epicsShareAPI ca_beacon_period (
+ friend double epicsStdCall ca_beacon_period (
chid pChan );
- friend unsigned epicsShareAPI ca_search_attempts (
+ friend unsigned epicsStdCall ca_search_attempts (
chid pChan );
- friend unsigned epicsShareAPI ca_write_access (
+ friend unsigned epicsStdCall ca_write_access (
chid pChan );
- friend unsigned epicsShareAPI ca_read_access (
+ friend unsigned epicsStdCall ca_read_access (
chid pChan );
- friend short epicsShareAPI ca_field_type (
+ friend short epicsStdCall ca_field_type (
chid pChan );
- friend arrayElementCount epicsShareAPI ca_element_count (
+ friend arrayElementCount epicsStdCall ca_element_count (
chid pChan );
- friend int epicsShareAPI ca_v42_ok (
+ friend int epicsStdCall ca_v42_ok (
chid pChan );
- friend int epicsShareAPI ca_create_subscription (
+ friend int epicsStdCall ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack,
void * pCallBackArg, evid * monixptr );
- friend enum channel_state epicsShareAPI ca_state (
+ friend enum channel_state epicsStdCall ca_state (
chid pChan );
- friend double epicsShareAPI ca_receive_watchdog_delay (
+ friend double epicsStdCall ca_receive_watchdog_delay (
chid pChan );
unsigned getName (
@@ -195,8 +185,8 @@ private:
void exception (
epicsGuard < epicsMutex > &, int status,
const char *pContext, unsigned type, arrayElementCount count );
- getCopy ( const getCopy & );
- getCopy & operator = ( const getCopy & );
+ getCopy ( const getCopy & );
+ getCopy & operator = ( const getCopy & );
void operator delete ( void * );
};
@@ -220,8 +210,8 @@ private:
void exception (
epicsGuard < epicsMutex > &, int status,
const char * pContext, unsigned type, arrayElementCount count );
- getCallback ( const getCallback & );
- getCallback & operator = ( const getCallback & );
+ getCallback ( const getCallback & );
+ getCallback & operator = ( const getCallback & );
void operator delete ( void * );
};
@@ -243,8 +233,8 @@ private:
void exception (
epicsGuard < epicsMutex > &, int status, const char *pContext,
unsigned type, arrayElementCount count );
- putCallback ( const putCallback & );
- putCallback & operator = ( const putCallback & );
+ putCallback ( const putCallback & );
+ putCallback & operator = ( const putCallback & );
void operator delete ( void * );
};
@@ -283,8 +273,8 @@ private:
void exception (
epicsGuard < epicsMutex > &, int status,
const char *pContext, unsigned type, arrayElementCount count );
- oldSubscription ( const oldSubscription & );
- oldSubscription & operator = ( const oldSubscription & );
+ oldSubscription ( const oldSubscription & );
+ oldSubscription & operator = ( const oldSubscription & );
void operator delete ( void * );
};
@@ -350,41 +340,41 @@ public:
void whenThereIsAnExceptionDestroySyncGroupIO ( epicsGuard < epicsMutex > &, T & );
// legacy C API
- friend int epicsShareAPI ca_create_channel (
+ friend int epicsStdCall ca_create_channel (
const char * name_str, caCh * conn_func, void * puser,
capri priority, chid * chanptr );
- friend int epicsShareAPI ca_clear_channel ( chid pChan );
- friend int epicsShareAPI ca_array_get ( chtype type,
+ friend int epicsStdCall ca_clear_channel ( chid pChan );
+ friend int epicsStdCall ca_array_get ( chtype type,
arrayElementCount count, chid pChan, void * pValue );
- friend int epicsShareAPI ca_array_get_callback ( chtype type,
+ friend int epicsStdCall ca_array_get_callback ( chtype type,
arrayElementCount count, chid pChan,
caEventCallBackFunc *pfunc, void *arg );
- friend int epicsShareAPI ca_array_put ( chtype type,
+ friend int epicsStdCall ca_array_put ( chtype type,
arrayElementCount count, chid pChan, const void * pValue );
- friend int epicsShareAPI ca_array_put_callback ( chtype type,
+ friend int epicsStdCall ca_array_put_callback ( chtype type,
arrayElementCount count, chid pChan, const void * pValue,
caEventCallBackFunc *pfunc, void *usrarg );
- friend int epicsShareAPI ca_create_subscription (
+ friend int epicsStdCall ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack, void * pCallBackArg,
evid *monixptr );
- friend int epicsShareAPI ca_flush_io ();
- friend int epicsShareAPI ca_clear_subscription ( evid pMon );
- friend int epicsShareAPI ca_sg_create ( CA_SYNC_GID * pgid );
- friend int epicsShareAPI ca_sg_delete ( const CA_SYNC_GID gid );
- friend int epicsShareAPI ca_sg_block ( const CA_SYNC_GID gid, ca_real timeout );
- friend int epicsShareAPI ca_sg_reset ( const CA_SYNC_GID gid );
- friend int epicsShareAPI ca_sg_test ( const CA_SYNC_GID gid );
- friend int epicsShareAPI ca_sg_array_get ( const CA_SYNC_GID gid,
+ friend int epicsStdCall ca_flush_io ();
+ friend int epicsStdCall ca_clear_subscription ( evid pMon );
+ friend int epicsStdCall ca_sg_create ( CA_SYNC_GID * pgid );
+ friend int epicsStdCall ca_sg_delete ( const CA_SYNC_GID gid );
+ friend int epicsStdCall ca_sg_block ( const CA_SYNC_GID gid, ca_real timeout );
+ friend int epicsStdCall ca_sg_reset ( const CA_SYNC_GID gid );
+ friend int epicsStdCall ca_sg_test ( const CA_SYNC_GID gid );
+ friend int epicsStdCall ca_sg_array_get ( const CA_SYNC_GID gid,
chtype type, arrayElementCount count,
chid pChan, void *pValue );
- friend int epicsShareAPI ca_sg_array_put ( const CA_SYNC_GID gid,
+ friend int epicsStdCall ca_sg_array_put ( const CA_SYNC_GID gid,
chtype type, arrayElementCount count,
chid pChan, const void *pValue );
friend int ca_sync_group_destroy ( CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard,
ca_client_context & cac, const CA_SYNC_GID gid );
- friend void sync_group_reset ( ca_client_context & client,
+ friend void sync_group_reset ( ca_client_context & client,
CASG & sg );
// exceptions
@@ -581,7 +571,7 @@ inline unsigned ca_client_context::sequenceNumberOfOutstandingIO (
}
template < class T >
-void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO (
+void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO (
epicsGuard < epicsMutex > & guard, T & io )
{
if ( this->pCallbackGuard.get() &&
@@ -607,4 +597,4 @@ void ca_client_context :: whenThereIsAnExceptionDestroySyncGroupIO (
}
}
-#endif // ifndef oldAccessh
+#endif // ifndef INC_oldAccess_H
diff --git a/modules/ca/src/client/oldChannelNotify.cpp b/modules/ca/src/client/oldChannelNotify.cpp
index 701f51fc1..92f7b576b 100644
--- a/modules/ca/src/client/oldChannelNotify.cpp
+++ b/modules/ca/src/client/oldChannelNotify.cpp
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -17,9 +16,9 @@
* Copyright, 1986, The Regents of the University of California.
*
*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include
@@ -33,7 +32,6 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
#include "cac.h"
@@ -174,7 +172,7 @@ void oldChannelNotify::operator delete ( void * )
/*
* ca_get_host_name ()
*/
-unsigned epicsShareAPI ca_get_host_name (
+unsigned epicsStdCall ca_get_host_name (
chid pChan, char * pBuf, unsigned bufLength )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef() );
@@ -187,7 +185,7 @@ unsigned epicsShareAPI ca_get_host_name (
* !!!! not thread safe !!!!
*
*/
-const char * epicsShareAPI ca_host_name (
+const char * epicsStdCall ca_host_name (
chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -197,7 +195,7 @@ const char * epicsShareAPI ca_host_name (
/*
* ca_set_puser ()
*/
-void epicsShareAPI ca_set_puser (
+void epicsStdCall ca_set_puser (
chid pChan, void * puser )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -207,7 +205,7 @@ void epicsShareAPI ca_set_puser (
/*
* ca_get_puser ()
*/
-void * epicsShareAPI ca_puser (
+void * epicsStdCall ca_puser (
chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -217,7 +215,7 @@ void * epicsShareAPI ca_puser (
/*
* Specify an event subroutine to be run for connection events
*/
-int epicsShareAPI ca_change_connection_event ( chid pChan, caCh * pfunc )
+int epicsStdCall ca_change_connection_event ( chid pChan, caCh * pfunc )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
if ( ! pChan->currentlyConnected ) {
@@ -239,7 +237,7 @@ int epicsShareAPI ca_change_connection_event ( chid pChan, caCh * pfunc )
/*
* ca_replace_access_rights_event
*/
-int epicsShareAPI ca_replace_access_rights_event (
+int epicsStdCall ca_replace_access_rights_event (
chid pChan, caArh *pfunc )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
@@ -266,7 +264,7 @@ int epicsShareAPI ca_replace_access_rights_event (
/*
* ca_array_get ()
*/
-int epicsShareAPI ca_array_get ( chtype type,
+int epicsStdCall ca_array_get ( chtype type,
arrayElementCount count, chid pChan, void *pValue )
{
int caStatus;
@@ -334,7 +332,7 @@ int epicsShareAPI ca_array_get ( chtype type,
/*
* ca_array_get_callback ()
*/
-int epicsShareAPI ca_array_get_callback ( chtype type,
+int epicsStdCall ca_array_get_callback ( chtype type,
arrayElementCount count, chid pChan,
caEventCallBackFunc *pfunc, void *arg )
{
@@ -411,7 +409,7 @@ void oldChannelNotify::read (
/*
* ca_array_put_callback ()
*/
-int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count,
+int epicsStdCall ca_array_put_callback ( chtype type, arrayElementCount count,
chid pChan, const void *pValue, caEventCallBackFunc *pfunc, void *usrarg )
{
int caStatus;
@@ -475,7 +473,7 @@ int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count,
/*
* ca_array_put ()
*/
-int epicsShareAPI ca_array_put ( chtype type, arrayElementCount count,
+int epicsStdCall ca_array_put ( chtype type, arrayElementCount count,
chid pChan, const void * pValue )
{
if ( type < 0 ) {
@@ -529,7 +527,7 @@ int epicsShareAPI ca_array_put ( chtype type, arrayElementCount count,
return caStatus;
}
-int epicsShareAPI ca_create_subscription (
+int epicsStdCall ca_create_subscription (
chtype type, arrayElementCount count, chid pChan,
long mask, caEventCallBackFunc * pCallBack, void * pCallBackArg,
evid * monixptr )
@@ -620,7 +618,7 @@ void oldChannelNotify::write (
/*
* ca_field_type()
*/
-short epicsShareAPI ca_field_type ( chid pChan )
+short epicsStdCall ca_field_type ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.nativeType ( guard );
@@ -629,7 +627,7 @@ short epicsShareAPI ca_field_type ( chid pChan )
/*
* ca_element_count ()
*/
-arrayElementCount epicsShareAPI ca_element_count ( chid pChan )
+arrayElementCount epicsStdCall ca_element_count ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.nativeElementCount ( guard );
@@ -638,7 +636,7 @@ arrayElementCount epicsShareAPI ca_element_count ( chid pChan )
/*
* ca_state ()
*/
-enum channel_state epicsShareAPI ca_state ( chid pChan )
+enum channel_state epicsStdCall ca_state ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
if ( pChan->io.connected ( guard ) ) {
@@ -655,7 +653,7 @@ enum channel_state epicsShareAPI ca_state ( chid pChan )
/*
* ca_read_access ()
*/
-unsigned epicsShareAPI ca_read_access ( chid pChan )
+unsigned epicsStdCall ca_read_access ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.accessRights(guard).readPermit();
@@ -664,7 +662,7 @@ unsigned epicsShareAPI ca_read_access ( chid pChan )
/*
* ca_write_access ()
*/
-unsigned epicsShareAPI ca_write_access ( chid pChan )
+unsigned epicsStdCall ca_write_access ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.accessRights(guard).writePermit();
@@ -673,25 +671,25 @@ unsigned epicsShareAPI ca_write_access ( chid pChan )
/*
* ca_name ()
*/
-const char * epicsShareAPI ca_name ( chid pChan )
+const char * epicsStdCall ca_name ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.pName ( guard );
}
-unsigned epicsShareAPI ca_search_attempts ( chid pChan )
+unsigned epicsStdCall ca_search_attempts ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.searchAttempts ( guard );
}
-double epicsShareAPI ca_beacon_period ( chid pChan )
+double epicsStdCall ca_beacon_period ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.beaconPeriod ( guard );
}
-double epicsShareAPI ca_receive_watchdog_delay ( chid pChan )
+double epicsStdCall ca_receive_watchdog_delay ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.receiveWatchdogDelay ( guard );
@@ -700,7 +698,7 @@ double epicsShareAPI ca_receive_watchdog_delay ( chid pChan )
/*
* ca_v42_ok(chid chan)
*/
-int epicsShareAPI ca_v42_ok ( chid pChan )
+int epicsStdCall ca_v42_ok ( chid pChan )
{
epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () );
return pChan->io.ca_v42_ok ( guard );
diff --git a/modules/ca/src/client/oldSubscription.cpp b/modules/ca/src/client/oldSubscription.cpp
index 34b58a48d..13889d31d 100644
--- a/modules/ca/src/client/oldSubscription.cpp
+++ b/modules/ca/src/client/oldSubscription.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -23,17 +22,16 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
oldSubscription::oldSubscription (
- epicsGuard < epicsMutex > & guard,
- oldChannelNotify & chanIn, cacChannel & io,
+ epicsGuard < epicsMutex > & guard,
+ oldChannelNotify & chanIn, cacChannel & io,
unsigned type, arrayElementCount nElem, unsigned mask,
caEventCallBackFunc * pFuncIn, void * pPrivateIn,
evid * pEventId ) :
- chan ( chanIn ), id ( UINT_MAX ), pFunc ( pFuncIn ),
+ chan ( chanIn ), id ( UINT_MAX ), pFunc ( pFuncIn ),
pPrivate ( pPrivateIn )
{
// The users event id *must* be set prior to potentially
@@ -51,7 +49,7 @@ oldSubscription::~oldSubscription ()
{
}
-void oldSubscription::current (
+void oldSubscription::current (
epicsGuard < epicsMutex > & guard,
unsigned type, arrayElementCount count, const void * pData )
{
@@ -68,10 +66,10 @@ void oldSubscription::current (
( *pFuncTmp ) ( args );
}
}
-
+
void oldSubscription::exception (
epicsGuard < epicsMutex > & guard,
- int status, const char * /* pContext */,
+ int status, const char * /* pContext */,
unsigned type, arrayElementCount count )
{
if ( status == ECA_CHANDESTROY ) {
diff --git a/modules/ca/src/client/putCallback.cpp b/modules/ca/src/client/putCallback.cpp
index 85fcaeb7f..1815afef1 100644
--- a/modules/ca/src/client/putCallback.cpp
+++ b/modules/ca/src/client/putCallback.cpp
@@ -3,24 +3,23 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include
@@ -28,12 +27,11 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
-putCallback::putCallback (
- oldChannelNotify & chanIn, caEventCallBackFunc * pFuncIn,
+putCallback::putCallback (
+ oldChannelNotify & chanIn, caEventCallBackFunc * pFuncIn,
void * pPrivateIn ) :
chan ( chanIn ), pFunc ( pFuncIn ), pPrivate ( pPrivateIn )
{
@@ -63,9 +61,9 @@ void putCallback::completion ( epicsGuard < epicsMutex > & guard )
}
}
-void putCallback::exception (
+void putCallback::exception (
epicsGuard < epicsMutex > & guard,
- int status, const char * /* pContext */,
+ int status, const char * /* pContext */,
unsigned type, arrayElementCount count )
{
if ( status != ECA_CHANDESTROY ) {
diff --git a/modules/ca/src/client/repeater.cpp b/modules/ca/src/client/repeater.cpp
index 61ba33fc5..449d5febc 100644
--- a/modules/ca/src/client/repeater.cpp
+++ b/modules/ca/src/client/repeater.cpp
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -33,7 +33,7 @@
* received it goes to all sockets on the same port, but if a unicast is
* received it goes to only one of the sockets on the same port (we can only
* guess at which one it will be).
- *
+ *
* I have observed this behavior under winsock II:
* o only one of the sockets on the same port receives the message if we
* send to the loopback address
@@ -69,14 +69,14 @@
#include "taskwd.h"
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "caProto.h"
#include "udpiiu.h"
#include "repeaterClient.h"
+#include "addrList.h"
-/*
+/*
* these can be external since there is only one instance
* per machine so we dont care about reentrancy
*/
@@ -89,10 +89,10 @@ static const unsigned short PORT_ANY = 0u;
*/
static int makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
{
- SOCKET sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, 0 );
+ SOCKET sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, 0 );
if ( sock == INVALID_SOCKET ) {
- *pSock = sock;
+ *pSock = sock;
return SOCKERRNO;
}
@@ -108,8 +108,8 @@ static int makeSocket ( unsigned short port, bool reuseAddr, SOCKET * pSock )
memset ( (char *) &bd, 0, sizeof (bd) );
bd.ia.sin_family = AF_INET;
- bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
- bd.ia.sin_port = htons ( port );
+ bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
+ bd.ia.sin_port = htons ( port );
status = bind ( sock, &bd.sa, (int) sizeof(bd) );
if ( status < 0 ) {
status = SOCKERRNO;
@@ -139,7 +139,7 @@ bool repeaterClient::connect ()
if ( int sockerrno = makeSocket ( PORT_ANY, false, & this->sock ) ) {
char sockErrBuf[64];
- epicsSocketConvertErrorToString (
+ epicsSocketConvertErrorToString (
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
fprintf ( stderr, "%s: no client sock because \"%s\"\n",
__FILE__, sockErrBuf );
@@ -149,7 +149,7 @@ bool repeaterClient::connect ()
status = ::connect ( this->sock, &this->from.sa, sizeof ( this->from.sa ) );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf ( stderr, "%s: unable to connect client sock because \"%s\"\n",
__FILE__, sockErrBuf );
@@ -178,7 +178,7 @@ bool repeaterClient::sendConfirm ()
}
else {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
debugPrintf ( ( "CA Repeater: confirm req err was \"%s\"\n", sockErrBuf) );
return false;
@@ -227,7 +227,7 @@ repeaterClient::~repeaterClient ()
}
void repeaterClient::operator delete ( void * )
-{
+{
// Visual C++ .net appears to require operator delete if
// placement operator delete is defined? I smell a ms rat
// because if I declare placement new and delete, but
@@ -237,16 +237,16 @@ void repeaterClient::operator delete ( void * )
__FILE__, __LINE__ );
}
-void * repeaterClient::operator new ( size_t size,
+void * repeaterClient::operator new ( size_t size,
tsFreeList < repeaterClient, 0x20 > & freeList )
-{
+{
return freeList.allocate ( size );
}
#ifdef CXX_PLACEMENT_DELETE
-void repeaterClient::operator delete ( void *pCadaver,
- tsFreeList < repeaterClient, 0x20 > & freeList )
-{
+void repeaterClient::operator delete ( void *pCadaver,
+ tsFreeList < repeaterClient, 0x20 > & freeList )
+{
freeList.release ( pCadaver );
}
#endif
@@ -326,7 +326,7 @@ static void verifyClients ( tsFreeList < repeaterClient, 0x20 > & freeList )
/*
* fanOut()
*/
-static void fanOut ( const osiSockAddr & from, const void * pMsg,
+static void fanOut ( const osiSockAddr & from, const void * pMsg,
unsigned msgSize, tsFreeList < repeaterClient, 0x20 > & freeList )
{
static tsDLList < repeaterClient > theClients;
@@ -354,7 +354,7 @@ static void fanOut ( const osiSockAddr & from, const void * pMsg,
/*
* register_new_client()
*/
-static void register_new_client ( osiSockAddr & from,
+static void register_new_client ( osiSockAddr & from,
tsFreeList < repeaterClient, 0x20 > & freeList )
{
bool newClient = false;
@@ -375,7 +375,7 @@ static void register_new_client ( osiSockAddr & from,
SOCKET sock;
if ( int sockerrno = makeSocket ( PORT_ANY, true, & sock ) ) {
char sockErrBuf[64];
- epicsSocketConvertErrorToString (
+ epicsSocketConvertErrorToString (
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
fprintf ( stderr, "%s: Unable to create repeater bind test socket because \"%s\"\n",
__FILE__, sockErrBuf );
@@ -391,7 +391,7 @@ static void register_new_client ( osiSockAddr & from,
* repeater would not always allow the loopback address
* as a local client address so current clients alternate
* between the address of the first non-loopback interface
- * found and the loopback addresss when subscribing with
+ * found and the loopback addresss when subscribing with
* the CA repeater until all CA repeaters have been updated
* to current code.
*/
@@ -418,8 +418,8 @@ static void register_new_client ( osiSockAddr & from,
break;
}
pclient++;
- }
-
+ }
+
repeaterClient *pNewClient;
if ( pclient.valid () ) {
pNewClient = pclient.pointer ();
@@ -435,7 +435,7 @@ static void register_new_client ( osiSockAddr & from,
freeList.release ( pNewClient );
return;
}
- client_list.add ( *pNewClient );
+ client_list.add ( *pNewClient );
newClient = true;
}
@@ -451,7 +451,7 @@ static void register_new_client ( osiSockAddr & from,
}
/*
- * send a noop message to all other clients so that we dont
+ * send a noop message to all other clients so that we dont
* accumulate sockets when there are no beacons
*/
caHdr noop;
@@ -479,14 +479,14 @@ static void register_new_client ( osiSockAddr & from,
/*
* ca_repeater ()
*/
-void ca_repeater ()
+void ca_repeater ()
{
tsFreeList < repeaterClient, 0x20 > freeList;
int size;
SOCKET sock;
osiSockAddr from;
unsigned short port;
- char * pBuf;
+ char * pBuf;
pBuf = new char [MAX_UDP_RECV];
@@ -508,7 +508,7 @@ void ca_repeater ()
return;
}
char sockErrBuf[64];
- epicsSocketConvertErrorToString (
+ epicsSocketConvertErrorToString (
sockErrBuf, sizeof ( sockErrBuf ), sockerrno );
fprintf ( stderr, "%s: Unable to create repeater socket because \"%s\" - fatal\n",
__FILE__, sockErrBuf );
@@ -517,6 +517,56 @@ void ca_repeater ()
return;
}
+#ifdef IP_ADD_MEMBERSHIP
+ /*
+ * join UDP socket to any multicast groups
+ */
+ {
+ ELLLIST casBeaconAddrList = ELLLIST_INIT;
+ ELLLIST casMergeAddrList = ELLLIST_INIT;
+
+ /*
+ * collect user specified beacon address list;
+ * check BEACON_ADDR_LIST list first; if no result, take CA_ADDR_LIST
+ */
+ if(!addAddrToChannelAccessAddressList(&casMergeAddrList,&EPICS_CAS_BEACON_ADDR_LIST,port,0)) {
+ addAddrToChannelAccessAddressList(&casMergeAddrList,&EPICS_CA_ADDR_LIST,port,0);
+ }
+
+ /* First clean up */
+ removeDuplicateAddresses(&casBeaconAddrList, &casMergeAddrList , 0);
+
+ osiSockAddrNode *pNode;
+ for(pNode = (osiSockAddrNode*)ellFirst(&casBeaconAddrList);
+ pNode;
+ pNode = (osiSockAddrNode*)ellNext(&pNode->node))
+ {
+
+ if(pNode->addr.ia.sin_family==AF_INET) {
+ epicsUInt32 top = ntohl(pNode->addr.ia.sin_addr.s_addr)>>24;
+ if(top>=224 && top<=239) {
+
+ /* This is a multi-cast address */
+ struct ip_mreq mreq;
+
+ memset(&mreq, 0, sizeof(mreq));
+ mreq.imr_multiaddr = pNode->addr.ia.sin_addr;
+ mreq.imr_interface.s_addr = INADDR_ANY;
+
+ if (setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+ (char *) &mreq, sizeof(mreq)) != 0) {
+ char name[40];
+ char sockErrBuf[64];
+ epicsSocketConvertErrnoToString (sockErrBuf, sizeof ( sockErrBuf ) );
+ ipAddrToDottedIP (&pNode->addr.ia, name, sizeof(name));
+ errlogPrintf("caR: Socket mcast join to %s failed: %s\n", name, sockErrBuf );
+ }
+ }
+ }
+ }
+ }
+#endif
+
debugPrintf ( ( "CA Repeater: Attached and initialized\n" ) );
while ( true ) {
@@ -534,7 +584,7 @@ void ca_repeater ()
continue;
}
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
fprintf ( stderr, "CA Repeater: unexpected UDP recv err: %s\n",
sockErrBuf );
@@ -571,7 +621,7 @@ void ca_repeater ()
continue;
}
- fanOut ( from, pMsg, size, freeList );
+ fanOut ( from, pMsg, size, freeList );
}
}
diff --git a/modules/ca/src/client/repeaterClient.h b/modules/ca/src/client/repeaterClient.h
index faaf0809f..eb86d6cf1 100644
--- a/modules/ca/src/client/repeaterClient.h
+++ b/modules/ca/src/client/repeaterClient.h
@@ -3,42 +3,33 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef repeaterClienth
-#define repeaterClienth
-
-#ifdef epicsExportSharedSymbols
-# define repeaterClienth_restore_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_repeaterClient_H
+#define INC_repeaterClient_H
#include "tsDLList.h"
#include "tsFreeList.h"
#include "compilerDependencies.h"
-#ifdef repeaterClienth_restore_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
union osiSockAddr;
@@ -56,9 +47,9 @@ public:
bool verify ();
bool identicalAddress ( const osiSockAddr &from );
bool identicalPort ( const osiSockAddr &from );
- void * operator new ( size_t size,
+ void * operator new ( size_t size,
tsFreeList < repeaterClient, 0x20 > & );
- epicsPlacementDeleteOperator (( void *,
+ epicsPlacementDeleteOperator (( void *,
tsFreeList < repeaterClient, 0x20 > & ))
private:
osiSockAddr from;
@@ -67,6 +58,4 @@ private:
void operator delete ( void * );
};
-#endif // repeaterClienth
-
-
+#endif // ifndef INC_repeaterClient_H
diff --git a/modules/ca/src/client/repeaterSubscribeTimer.cpp b/modules/ca/src/client/repeaterSubscribeTimer.cpp
index 71ba5ad06..29dcac9bd 100644
--- a/modules/ca/src/client/repeaterSubscribeTimer.cpp
+++ b/modules/ca/src/client/repeaterSubscribeTimer.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -25,17 +24,15 @@
#include "iocinf.h"
#include "repeaterSubscribeTimer.h"
-#define epicsExportSharedSymbols
#include "udpiiu.h"
-#undef epicsExportSharedSymbols
static const double repeaterSubscribeTimerInitialPeriod = 10.0; // sec
static const double repeaterSubscribeTimerPeriod = 1.0; // sec
-repeaterSubscribeTimer::repeaterSubscribeTimer (
+repeaterSubscribeTimer::repeaterSubscribeTimer (
repeaterTimerNotify & iiuIn, epicsTimerQueue & queueIn,
epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn ) :
- timer ( queueIn.createTimer () ), iiu ( iiuIn ),
+ timer ( queueIn.createTimer () ), iiu ( iiuIn ),
cbMutex ( cbMutexIn ),ctxNotify ( ctxNotifyIn ),
stateMutex(__FILE__, __LINE__),
attempts ( 0 ), registered ( false ), once ( false )
@@ -49,7 +46,7 @@ repeaterSubscribeTimer::~repeaterSubscribeTimer ()
void repeaterSubscribeTimer::start ()
{
- this->timer.start (
+ this->timer.start (
*this, repeaterSubscribeTimerInitialPeriod );
}
@@ -68,12 +65,12 @@ epicsTimerNotify::expireStatus repeaterSubscribeTimer::
expire ( const epicsTime & /* currentTime */ )
{
epicsGuard < epicsMutex > guard ( this->stateMutex );
-
+
static const unsigned nTriesToMsg = 50;
if ( this->attempts > nTriesToMsg && ! this->once ) {
callbackManager mgr ( this->ctxNotify, this->cbMutex );
this->iiu.printFormated ( mgr.cbGuard,
- "CA client library is unable to contact CA repeater after %u tries.\n",
+ "CA client library is unable to contact CA repeater after %u tries.\n",
nTriesToMsg );
this->iiu.printFormated ( mgr.cbGuard,
"Silence this message by starting a CA repeater daemon\n") ;
@@ -96,7 +93,7 @@ epicsTimerNotify::expireStatus repeaterSubscribeTimer::
void repeaterSubscribeTimer::show ( unsigned /* level */ ) const
{
epicsGuard < epicsMutex > guard ( this->stateMutex );
-
+
::printf ( "repeater subscribe timer: attempts=%u registered=%u once=%u\n",
this->attempts, this->registered, this->once );
}
diff --git a/modules/ca/src/client/repeaterSubscribeTimer.h b/modules/ca/src/client/repeaterSubscribeTimer.h
index fa4768499..4c3e1e9ba 100644
--- a/modules/ca/src/client/repeaterSubscribeTimer.h
+++ b/modules/ca/src/client/repeaterSubscribeTimer.h
@@ -3,42 +3,31 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef repeaterSubscribeTimerh
-#define repeaterSubscribeTimerh
+#ifndef INC_repeaterSubscribeTimer_H
+#define INC_repeaterSubscribeTimer_H
#include "epicsTimer.h"
-#ifdef epicsExportSharedSymbols
-# define repeaterSubscribeTimerh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
-
-#include "epicsTimer.h"
-
-#ifdef repeaterSubscribeTimerh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
class epicsMutex;
class cacContextNotify;
@@ -46,17 +35,17 @@ class cacContextNotify;
class repeaterTimerNotify {
public:
virtual ~repeaterTimerNotify () = 0;
- virtual void repeaterRegistrationMessage (
+ virtual void repeaterRegistrationMessage (
unsigned attemptNumber ) = 0;
- virtual int printFormated (
- epicsGuard < epicsMutex > & callbackControl,
+ virtual int printFormated (
+ epicsGuard < epicsMutex > & callbackControl,
const char * pformat, ... ) = 0;
};
class repeaterSubscribeTimer : private epicsTimerNotify {
public:
- repeaterSubscribeTimer (
- repeaterTimerNotify &, epicsTimerQueue &,
+ repeaterSubscribeTimer (
+ repeaterTimerNotify &, epicsTimerQueue &,
epicsMutex & cbMutex, cacContextNotify & ctxNotify );
virtual ~repeaterSubscribeTimer ();
void start ();
@@ -64,7 +53,7 @@ public:
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void confirmNotify ();
- void show ( unsigned level ) const;
+ void show ( unsigned level ) const;
private:
epicsTimer & timer;
repeaterTimerNotify & iiu;
@@ -74,9 +63,9 @@ private:
unsigned attempts;
bool registered;
bool once;
- expireStatus expire ( const epicsTime & currentTime );
- repeaterSubscribeTimer ( const repeaterSubscribeTimer & );
- repeaterSubscribeTimer & operator = ( const repeaterSubscribeTimer & );
+ expireStatus expire ( const epicsTime & currentTime );
+ repeaterSubscribeTimer ( const repeaterSubscribeTimer & );
+ repeaterSubscribeTimer & operator = ( const repeaterSubscribeTimer & );
};
-#endif // ifdef repeaterSubscribeTimerh
+#endif // ifdef INC_repeaterSubscribeTimer_H
diff --git a/modules/ca/src/client/searchTimer.cpp b/modules/ca/src/client/searchTimer.cpp
index bb9b9a91c..9538bb0ee 100644
--- a/modules/ca/src/client/searchTimer.cpp
+++ b/modules/ca/src/client/searchTimer.cpp
@@ -3,11 +3,10 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-//
+//
//
// L O S A L A M O S
// Los Alamos National Laboratory
@@ -19,31 +18,30 @@
//
#include
-#include // vxWorks 6.0 requires this include
+#include // vxWorks 6.0 requires this include
#include
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
#include "envDefs.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "udpiiu.h"
#include "nciu.h"
static const unsigned initialTriesPerFrame = 1u; // initial UDP frames per search try
-static const unsigned maxTriesPerFrame = 64u; // max UDP frames per search try
+static const unsigned maxTriesPerFrame = 64u; // max UDP frames per search try
//
// searchTimer::searchTimer ()
//
-searchTimer::searchTimer (
- searchTimerNotify & iiuIn,
- epicsTimerQueue & queueIn,
- const unsigned indexIn,
+searchTimer::searchTimer (
+ searchTimerNotify & iiuIn,
+ epicsTimerQueue & queueIn,
+ const unsigned indexIn,
epicsMutex & mutexIn,
bool boostPossibleIn ) :
- timeAtLastSend ( epicsTime::getMonotonic () ),
+ timeAtLastSend ( epicsTime::getCurrent () ),
timer ( queueIn.createTimer () ),
iiu ( iiuIn ),
mutex ( mutexIn ),
@@ -73,7 +71,7 @@ searchTimer::~searchTimer ()
this->timer.destroy ();
}
-void searchTimer::shutdown (
+void searchTimer::shutdown (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
@@ -87,25 +85,25 @@ void searchTimer::shutdown (
}
while ( nciu * pChan = this->chanListReqPending.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->serviceShutdownNotify ( cbGuard, guard );
}
while ( nciu * pChan = this->chanListRespPending.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->serviceShutdownNotify ( cbGuard, guard );
}
}
-void searchTimer::installChannel (
+void searchTimer::installChannel (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
this->chanListReqPending.add ( chan );
chan.channelNode::setReqPendingState ( guard, this->index );
}
-void searchTimer::moveChannels (
+void searchTimer::moveChannels (
epicsGuard < epicsMutex > & guard, searchTimer & dest )
{
while ( nciu * pChan = this->chanListRespPending.get () ) {
@@ -122,25 +120,25 @@ void searchTimer::moveChannels (
//
// searchTimer::expire ()
//
-epicsTimerNotify::expireStatus searchTimer::expire (
+epicsTimerNotify::expireStatus searchTimer::expire (
const epicsTime & currentTime )
{
epicsGuard < epicsMutex > guard ( this->mutex );
while ( nciu * pChan = this->chanListRespPending.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
- this->iiu.noSearchRespNotify (
+ this->iiu.noSearchRespNotify (
guard, *pChan, this->index );
}
-
+
this->timeAtLastSend = currentTime;
// boost search period for channels not recently
// searched for if there was some success
if ( this->searchResponses && this->boostPossible ) {
while ( nciu * pChan = this->chanListReqPending.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
this->iiu.boostChannel ( guard, *pChan );
}
@@ -149,8 +147,8 @@ epicsTimerNotify::expireStatus searchTimer::expire (
if ( this->searchAttempts ) {
#if 0
//
- // dynamically adjust the number of UDP frames per
- // try depending how many search requests are not
+ // dynamically adjust the number of UDP frames per
+ // try depending how many search requests are not
// replied to
//
// The variable this->framesPerTry
@@ -160,13 +158,13 @@ epicsTimerNotify::expireStatus searchTimer::expire (
// network bandwidth. If it is too low we will
// use very little of the incoming UDP message
// buffer associated with the server's port and
- // will therefore take longer to connect. We
- // initialize this->framesPerTry to a prime number
+ // will therefore take longer to connect. We
+ // initialize this->framesPerTry to a prime number
// so that it is less likely that the
// same channel is in the last UDP frame
// sent every time that this is called (and
// potentially discarded by a CA server with
- // a small UDP input queue).
+ // a small UDP input queue).
//
// increase frames per try only if we see better than
// a 93.75% success rate for one pass through the list
@@ -182,19 +180,19 @@ epicsTimerNotify::expireStatus searchTimer::expire (
else {
this->framesPerTry += (this->framesPerTry/8) + 1;
}
- debugPrintf ( ("Increasing frame count to %u t=%u r=%u\n",
+ debugPrintf ( ("Increasing frame count to %u t=%u r=%u\n",
this->framesPerTry, this->searchAttempts, this->searchResponses) );
}
}
- // if we detect congestion because we have less than a 87.5% success
+ // if we detect congestion because we have less than a 87.5% success
// rate then gradually reduce the frames per try
- else if ( this->searchResponses <
+ else if ( this->searchResponses <
( this->searchAttempts - (this->searchAttempts/8u) ) ) {
if ( this->framesPerTry > 1 ) {
this->framesPerTry--;
}
this->framesPerTryCongestThresh = this->framesPerTry/2 + 1;
- debugPrintf ( ("Congestion detected - set frames per try to %f t=%u r=%u\n",
+ debugPrintf ( ("Congestion detected - set frames per try to %f t=%u r=%u\n",
this->framesPerTry, this->searchAttempts, this->searchResponses) );
}
#else
@@ -214,20 +212,20 @@ epicsTimerNotify::expireStatus searchTimer::expire (
else {
this->framesPerTry += 1.0 / this->framesPerTry;
}
- debugPrintf ( ("Increasing frame count to %g t=%u r=%u\n",
+ debugPrintf ( ("Increasing frame count to %g t=%u r=%u\n",
this->framesPerTry, this->searchAttempts, this->searchResponses) );
}
}
else {
this->framesPerTryCongestThresh = this->framesPerTry / 2.0;
this->framesPerTry = 1u;
- debugPrintf ( ("Congestion detected - set frames per try to %g t=%u r=%u\n",
+ debugPrintf ( ("Congestion detected - set frames per try to %g t=%u r=%u\n",
this->framesPerTry, this->searchAttempts, this->searchResponses) );
}
#endif
}
- this->dgSeqNoAtTimerExpireBegin =
+ this->dgSeqNoAtTimerExpireBegin =
this->iiu.datagramSeqNumber ( guard );
this->searchAttempts = 0;
@@ -240,9 +238,9 @@ epicsTimerNotify::expireStatus searchTimer::expire (
break;
}
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
-
+
bool success = pChan->searchMsg ( guard );
if ( ! success ) {
if ( this->iiu.datagramFlush ( guard, currentTime ) ) {
@@ -253,14 +251,14 @@ epicsTimerNotify::expireStatus searchTimer::expire (
}
if ( ! success ) {
this->chanListReqPending.push ( *pChan );
- pChan->channelNode::setReqPendingState (
+ pChan->channelNode::setReqPendingState (
guard, this->index );
break;
}
}
this->chanListRespPending.add ( *pChan );
- pChan->channelNode::setRespPendingState (
+ pChan->channelNode::setRespPendingState (
guard, this->index );
if ( this->searchAttempts < UINT_MAX ) {
@@ -273,14 +271,14 @@ epicsTimerNotify::expireStatus searchTimer::expire (
nFrameSent++;
}
- this->dgSeqNoAtTimerExpireEnd =
+ this->dgSeqNoAtTimerExpireEnd =
this->iiu.datagramSeqNumber ( guard ) - 1u;
# ifdef DEBUG
if ( this->searchAttempts ) {
char buf[64];
currentTime.strftime ( buf, sizeof(buf), "%M:%S.%09f");
- debugPrintf ( ("sent %u delay sec=%f Rts=%s\n",
+ debugPrintf ( ("sent %u delay sec=%f Rts=%s\n",
nFrameSent, this->period(), buf ) );
}
# endif
@@ -293,22 +291,22 @@ void searchTimer :: show ( unsigned level ) const
epicsGuard < epicsMutex > guard ( this->mutex );
::printf ( "searchTimer with period %f\n", this->period ( guard ) );
if ( level > 0 ) {
- ::printf ( "channels with search request pending = %u\n",
+ ::printf ( "channels with search request pending = %u\n",
this->chanListReqPending.count () );
if ( level > 1u ) {
- tsDLIterConst < nciu > pChan =
+ tsDLIterConst < nciu > pChan =
this->chanListReqPending.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
}
- ::printf ( "channels with search response pending = %u\n",
+ ::printf ( "channels with search response pending = %u\n",
this->chanListRespPending.count () );
if ( level > 1u ) {
- tsDLIterConst < nciu > pChan =
+ tsDLIterConst < nciu > pChan =
this->chanListRespPending.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
@@ -321,9 +319,9 @@ void searchTimer :: show ( unsigned level ) const
// at least one response. However, dont reset this delay if we
// get a delayed response to an old search request.
//
-void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > & guard, nciu & chan,
- ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
+void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
+ ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
const epicsTime & currentTime )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -335,8 +333,8 @@ void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
bool validResponse = true;
if ( seqNumberIsValid ) {
- validResponse =
- this->dgSeqNoAtTimerExpireBegin <= respDatagramSeqNo &&
+ validResponse =
+ this->dgSeqNoAtTimerExpireBegin <= respDatagramSeqNo &&
this->dgSeqNoAtTimerExpireEnd >= respDatagramSeqNo;
}
@@ -351,7 +349,7 @@ void searchTimer::uninstallChanDueToSuccessfulSearchResponse (
if ( this->searchResponses == this->searchAttempts ) {
if ( this->chanListReqPending.count () ) {
//
- // when we get 100% success immediately
+ // when we get 100% success immediately
// send another search request
//
debugPrintf ( ( "All requests succesful, set timer delay to zero\n" ) );
@@ -366,25 +364,25 @@ void searchTimer::uninstallChan (
epicsGuard < epicsMutex > & cacGuard, nciu & chan )
{
cacGuard.assertIdenticalMutex ( this->mutex );
- unsigned ulistmem =
- static_cast ( chan.channelNode::listMember );
- unsigned uReqBase =
- static_cast ( channelNode::cs_searchReqPending0 );
+ unsigned ulistmem =
+ static_cast ( chan.channelNode::listMember );
+ unsigned uReqBase =
+ static_cast ( channelNode::cs_searchReqPending0 );
if ( ulistmem == this->index + uReqBase ) {
this->chanListReqPending.remove ( chan );
}
- else {
- unsigned uRespBase =
- static_cast (
- channelNode::cs_searchRespPending0 );
- if ( ulistmem == this->index + uRespBase ) {
- this->chanListRespPending.remove ( chan );
- }
- else {
- throw std::runtime_error (
- "uninstalling channel search timer, but channel "
- "state is wrong" );
- }
+ else {
+ unsigned uRespBase =
+ static_cast (
+ channelNode::cs_searchRespPending0 );
+ if ( ulistmem == this->index + uRespBase ) {
+ this->chanListRespPending.remove ( chan );
+ }
+ else {
+ throw std::runtime_error (
+ "uninstalling channel search timer, but channel "
+ "state is wrong" );
+ }
}
chan.channelNode::listMember = channelNode::cs_none;
}
diff --git a/modules/ca/src/client/searchTimer.h b/modules/ca/src/client/searchTimer.h
index 7b9fe1717..dd291fd59 100644
--- a/modules/ca/src/client/searchTimer.h
+++ b/modules/ca/src/client/searchTimer.h
@@ -3,57 +3,47 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-//
//
-//
+//
+//
// L O S A L A M O S
// Los Alamos National Laboratory
// Los Alamos, New Mexico 87545
-//
+//
// Copyright, 1986, The Regents of the University of California.
-//
-//
-// Author Jeffrey O. Hill
-// johill@lanl.gov
-// 505 665 1831
+//
+//
+// Author Jeffrey O. Hill
+// johill@lanl.gov
+// 505 665 1831
//
-#ifndef searchTimerh
-#define searchTimerh
-
-#ifdef epicsExportSharedSymbols
-# define searchTimerh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_searchTimer_H
+#define INC_searchTimer_H
#include "epicsMutex.h"
#include "epicsGuard.h"
#include "epicsTimer.h"
-#ifdef searchTimerh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
+#include "libCaAPI.h"
#include "caProto.h"
#include "netiiu.h"
class searchTimerNotify {
public:
virtual ~searchTimerNotify () = 0;
- virtual void boostChannel (
+ virtual void boostChannel (
epicsGuard < epicsMutex > &, nciu & ) = 0;
- virtual void noSearchRespNotify (
+ virtual void noSearchRespNotify (
epicsGuard < epicsMutex > &, nciu &, unsigned ) = 0;
virtual double getRTTE ( epicsGuard < epicsMutex > & ) const = 0;
virtual void updateRTTE ( epicsGuard < epicsMutex > &, double rtte ) = 0;
- virtual bool datagramFlush (
- epicsGuard < epicsMutex > &,
+ virtual bool datagramFlush (
+ epicsGuard < epicsMutex > &,
const epicsTime & currentTime ) = 0;
virtual ca_uint32_t datagramSeqNumber (
epicsGuard < epicsMutex > & ) const = 0;
@@ -61,24 +51,24 @@ public:
class searchTimer : private epicsTimerNotify {
public:
- searchTimer (
- class searchTimerNotify &, epicsTimerQueue &,
+ searchTimer (
+ class searchTimerNotify &, epicsTimerQueue &,
const unsigned index, epicsMutex &,
bool boostPossible );
virtual ~searchTimer ();
void start ( epicsGuard < epicsMutex > & );
- void shutdown (
+ void shutdown (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
- void moveChannels (
+ void moveChannels (
epicsGuard < epicsMutex > &, searchTimer & dest );
- void installChannel (
+ void installChannel (
epicsGuard < epicsMutex > &, nciu & );
- void uninstallChan (
+ void uninstallChan (
epicsGuard < epicsMutex > &, nciu & );
- void uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > &, nciu &,
- ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
+ void uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > &, nciu &,
+ ca_uint32_t respDatagramSeqNo, bool seqNumberIsValid,
const epicsTime & currentTime );
void show ( unsigned level ) const;
private:
@@ -94,15 +84,15 @@ private:
unsigned searchAttempts; /* num search tries after last timer experation */
unsigned searchResponses; /* num search resp after last timer experation */
const unsigned index;
- ca_uint32_t dgSeqNoAtTimerExpireBegin;
+ ca_uint32_t dgSeqNoAtTimerExpireBegin;
ca_uint32_t dgSeqNoAtTimerExpireEnd;
const bool boostPossible;
bool stopped;
expireStatus expire ( const epicsTime & currentTime );
double period ( epicsGuard < epicsMutex > & ) const;
- searchTimer ( const searchTimer & ); // not implemented
- searchTimer & operator = ( const searchTimer & ); // not implemented
+ searchTimer ( const searchTimer & ); // not implemented
+ searchTimer & operator = ( const searchTimer & ); // not implemented
};
-#endif // ifdef searchTimerh
+#endif // ifdef INC_searchTimer_H
diff --git a/modules/ca/src/client/sgAutoPtr.h b/modules/ca/src/client/sgAutoPtr.h
index e2899468c..6a8ad9a76 100644
--- a/modules/ca/src/client/sgAutoPtr.h
+++ b/modules/ca/src/client/sgAutoPtr.h
@@ -3,28 +3,27 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef sgAutoPtrh
-#define sgAutoPtrh
+#ifndef INC_sgAutoPtr_H
+#define INC_sgAutoPtr_H
template < class T >
class sgAutoPtr {
@@ -40,18 +39,18 @@ private:
T * pNotify;
struct CASG & sg;
epicsGuard < epicsMutex > & guard;
- sgAutoPtr & operator = ( const sgAutoPtr & );
+ sgAutoPtr & operator = ( const sgAutoPtr & );
};
template < class T >
-inline sgAutoPtr < T > :: sgAutoPtr (
- epicsGuard < epicsMutex > & guardIn, struct CASG & sgIn ) :
+inline sgAutoPtr < T > :: sgAutoPtr (
+ epicsGuard < epicsMutex > & guardIn, struct CASG & sgIn ) :
pNotify ( 0 ), sg ( sgIn ), guard ( guardIn )
{
}
template < class T >
-inline sgAutoPtr < T > :: ~sgAutoPtr ()
+inline sgAutoPtr < T > :: ~sgAutoPtr ()
{
if ( this->pNotify ) {
this->sg.ioPendingList.remove ( *this->pNotify );
@@ -100,4 +99,4 @@ inline T * sgAutoPtr < T > :: get ()
return this->pNotify;
}
-#endif // sgAutoPtrh
+#endif // ifndef INC_sgAutoPtr_H
diff --git a/modules/ca/src/client/syncGroup.h b/modules/ca/src/client/syncGroup.h
index 3b9c3cd4f..6015bef45 100644
--- a/modules/ca/src/client/syncGroup.h
+++ b/modules/ca/src/client/syncGroup.h
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -17,18 +16,13 @@
* Copyright, 1986, The Regents of the University of California.
*
*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef syncGrouph
-#define syncGrouph
-
-#ifdef epicsExportSharedSymbols
-# define syncGrouph_restore_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_syncGroup_H
+#define INC_syncGroup_H
#include "tsDLList.h"
#include "tsFreeList.h"
@@ -36,11 +30,7 @@
#include "epicsEvent.h"
#include "compilerDependencies.h"
-#ifdef syncGrouph_restore_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
+#include "libCaAPI.h"
#include "cadef.h"
#include "cacIO.h"
@@ -70,7 +60,7 @@ struct CASG;
class syncGroupReadNotify : public syncGroupNotify, public cacReadNotify {
public:
- typedef void ( CASG :: * PRecycleFunc )
+ typedef void ( CASG :: * PRecycleFunc )
( epicsGuard < epicsMutex > &, syncGroupReadNotify & );
static syncGroupReadNotify * factory (
tsFreeList < class syncGroupReadNotify, 128, epicsMutexNOOP > &,
@@ -115,7 +105,7 @@ private:
class syncGroupWriteNotify : public syncGroupNotify, public cacWriteNotify {
public:
- typedef void ( CASG :: * PRecycleFunc )
+ typedef void ( CASG :: * PRecycleFunc )
( epicsGuard < epicsMutex > &, syncGroupWriteNotify & );
static syncGroupWriteNotify * factory (
tsFreeList < class syncGroupWriteNotify, 128, epicsMutexNOOP > &,
@@ -150,7 +140,7 @@ private:
void completion ( epicsGuard < epicsMutex > & );
void exception (
epicsGuard < epicsMutex > &, int status, const char *pContext,
- unsigned type, arrayElementCount count );
+ unsigned type, arrayElementCount count );
syncGroupWriteNotify ( const syncGroupWriteNotify & );
syncGroupWriteNotify & operator = ( const syncGroupWriteNotify & );
};
@@ -174,9 +164,9 @@ public:
void reset ( CallbackGuard &, epicsGuard < epicsMutex > & );
void show ( epicsGuard < epicsMutex > &, unsigned level ) const;
void show ( unsigned level ) const;
- void get ( epicsGuard < epicsMutex > &, chid pChan,
+ void get ( epicsGuard < epicsMutex > &, chid pChan,
unsigned type, arrayElementCount count, void * pValue );
- void put ( epicsGuard < epicsMutex > &, chid pChan,
+ void put ( epicsGuard < epicsMutex > &, chid pChan,
unsigned type, arrayElementCount count, const void * pValue );
void completionNotify (
epicsGuard < epicsMutex > &, syncGroupNotify & );
@@ -208,9 +198,9 @@ private:
void destroyCompletedIO (
CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard );
- void recycleReadNotifyIO ( epicsGuard < epicsMutex > &,
+ void recycleReadNotifyIO ( epicsGuard < epicsMutex > &,
syncGroupReadNotify & );
- void recycleWriteNotifyIO ( epicsGuard < epicsMutex > &,
+ void recycleWriteNotifyIO ( epicsGuard < epicsMutex > &,
syncGroupWriteNotify & );
CASG ( const CASG & );
@@ -277,4 +267,4 @@ inline bool syncGroupReadNotify::ioPending (
return ! this->ioComplete;
}
-#endif // ifdef syncGrouph
+#endif // ifdef INC_syncGroup_H
diff --git a/modules/ca/src/client/syncGroupNotify.cpp b/modules/ca/src/client/syncGroupNotify.cpp
index 2780fbe89..cca2ad412 100644
--- a/modules/ca/src/client/syncGroupNotify.cpp
+++ b/modules/ca/src/client/syncGroupNotify.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -16,12 +15,11 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "syncGroup.h"
#include "oldAccess.h"
-syncGroupNotify::syncGroupNotify ()
+syncGroupNotify::syncGroupNotify ()
{
}
diff --git a/modules/ca/src/client/syncGroupReadNotify.cpp b/modules/ca/src/client/syncGroupReadNotify.cpp
index 711a2fae4..36e3ea47c 100644
--- a/modules/ca/src/client/syncGroupReadNotify.cpp
+++ b/modules/ca/src/client/syncGroupReadNotify.cpp
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -21,7 +20,6 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "syncGroup.h"
#include "oldAccess.h"
@@ -29,7 +27,7 @@
syncGroupReadNotify::syncGroupReadNotify (
CASG & sgIn, PRecycleFunc pRecycleFuncIn,
chid pChan, void * pValueIn ) :
- chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
+ chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
sg ( sgIn ), pValue ( pValueIn ),
magic ( CASG_MAGIC ), id ( 0u ),
idIsValid ( false ), ioComplete ( false )
diff --git a/modules/ca/src/client/syncGroupWriteNotify.cpp b/modules/ca/src/client/syncGroupWriteNotify.cpp
index f0bf42753..0543e3307 100644
--- a/modules/ca/src/client/syncGroupWriteNotify.cpp
+++ b/modules/ca/src/client/syncGroupWriteNotify.cpp
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -21,12 +20,11 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "syncGroup.h"
#include "oldAccess.h"
-syncGroupWriteNotify::syncGroupWriteNotify ( CASG & sgIn,
+syncGroupWriteNotify::syncGroupWriteNotify ( CASG & sgIn,
PRecycleFunc pRecycleFuncIn, chid pChan ) :
chan ( pChan ), pRecycleFunc ( pRecycleFuncIn ),
sg ( sgIn ), magic ( CASG_MAGIC ),
diff --git a/modules/ca/src/client/syncgrp.cpp b/modules/ca/src/client/syncgrp.cpp
index 9727ae8df..2a0565f08 100644
--- a/modules/ca/src/client/syncgrp.cpp
+++ b/modules/ca/src/client/syncgrp.cpp
@@ -3,8 +3,7 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
+* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -15,7 +14,6 @@
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
-#define epicsExportSharedSymbols
#include "iocinf.h"
#include "oldAccess.h"
#include "syncGroup.h"
@@ -23,7 +21,7 @@
/*
* ca_sg_create()
*/
-extern "C" int epicsShareAPI ca_sg_create ( CA_SYNC_GID * pgid )
+extern "C" int epicsStdCall ca_sg_create ( CA_SYNC_GID * pgid )
{
ca_client_context * pcac;
int caStatus;
@@ -67,7 +65,7 @@ int ca_sync_group_destroy ( CallbackGuard & cbGuard, epicsGuard < epicsMutex > &
/*
* ca_sg_delete()
*/
-extern "C" int epicsShareAPI ca_sg_delete ( const CA_SYNC_GID gid )
+extern "C" int epicsStdCall ca_sg_delete ( const CA_SYNC_GID gid )
{
ca_client_context * pcac;
int caStatus = fetchClientContext ( & pcac );
@@ -102,7 +100,7 @@ void sync_group_reset ( ca_client_context & client, CASG & sg )
epicsGuard < epicsMutex > guard ( client.mutex );
sg.reset ( *client.pCallbackGuard.get(), guard );
}
- else {
+ else {
//
// we will definately stall out here if all of the
// following are true
@@ -126,7 +124,7 @@ void sync_group_reset ( ca_client_context & client, CASG & sg )
// !!!! is disabled. This prevents the preemptive callback lock from being released
// !!!! by other threads than the one that locked it.
//
-extern "C" int epicsShareAPI ca_sg_block (
+extern "C" int epicsStdCall ca_sg_block (
const CA_SYNC_GID gid, ca_real timeout )
{
ca_client_context *pcac;
@@ -154,7 +152,7 @@ extern "C" int epicsShareAPI ca_sg_block (
/*
* ca_sg_reset
*/
-extern "C" int epicsShareAPI ca_sg_reset ( const CA_SYNC_GID gid )
+extern "C" int epicsStdCall ca_sg_reset ( const CA_SYNC_GID gid )
{
ca_client_context *pcac;
int caStatus = fetchClientContext (&pcac);
@@ -178,7 +176,7 @@ extern "C" int epicsShareAPI ca_sg_reset ( const CA_SYNC_GID gid )
/*
* ca_sg_stat
*/
-extern "C" int epicsShareAPI ca_sg_stat ( const CA_SYNC_GID gid )
+extern "C" int epicsStdCall ca_sg_stat ( const CA_SYNC_GID gid )
{
ca_client_context * pcac;
int caStatus = fetchClientContext ( &pcac );
@@ -201,7 +199,7 @@ extern "C" int epicsShareAPI ca_sg_stat ( const CA_SYNC_GID gid )
/*
* ca_sg_test
*/
-extern "C" int epicsShareAPI ca_sg_test ( const CA_SYNC_GID gid )
+extern "C" int epicsStdCall ca_sg_test ( const CA_SYNC_GID gid )
{
ca_client_context * pcac;
int caStatus = fetchClientContext ( &pcac );
@@ -245,7 +243,7 @@ extern "C" int epicsShareAPI ca_sg_test ( const CA_SYNC_GID gid )
/*
* ca_sg_array_put()
*/
-extern "C" int epicsShareAPI ca_sg_array_put ( const CA_SYNC_GID gid, chtype type,
+extern "C" int epicsStdCall ca_sg_array_put ( const CA_SYNC_GID gid, chtype type,
arrayElementCount count, chid pChan, const void *pValue )
{
ca_client_context *pcac;
@@ -262,7 +260,7 @@ extern "C" int epicsShareAPI ca_sg_array_put ( const CA_SYNC_GID gid, chtype typ
}
try {
- pcasg->put ( guard, pChan, type,
+ pcasg->put ( guard, pChan, type,
static_cast < unsigned > ( count ), pValue );
return ECA_NORMAL;
}
@@ -307,7 +305,7 @@ extern "C" int epicsShareAPI ca_sg_array_put ( const CA_SYNC_GID gid, chtype typ
/*
* ca_sg_array_get()
*/
-extern "C" int epicsShareAPI ca_sg_array_get ( const CA_SYNC_GID gid, chtype type,
+extern "C" int epicsStdCall ca_sg_array_get ( const CA_SYNC_GID gid, chtype type,
arrayElementCount count, chid pChan, void *pValue )
{
ca_client_context *pcac;
@@ -324,7 +322,7 @@ extern "C" int epicsShareAPI ca_sg_array_get ( const CA_SYNC_GID gid, chtype typ
}
try {
- pcasg->get ( guard, pChan, type,
+ pcasg->get ( guard, pChan, type,
static_cast < unsigned > ( count ), pValue );
return ECA_NORMAL;
}
diff --git a/modules/ca/src/client/tcpRecvThread.cpp b/modules/ca/src/client/tcpRecvThread.cpp
deleted file mode 100644
index 34bf8ca83..000000000
--- a/modules/ca/src/client/tcpRecvThread.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-/*************************************************************************\
-* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
-* National Laboratory.
-* Copyright (c) 2002 The Regents of the University of California, as
-* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
-\*************************************************************************/
-
-
diff --git a/modules/ca/src/client/tcpRecvWatchdog.cpp b/modules/ca/src/client/tcpRecvWatchdog.cpp
index 72c92968b..d2834ad7d 100644
--- a/modules/ca/src/client/tcpRecvWatchdog.cpp
+++ b/modules/ca/src/client/tcpRecvWatchdog.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -27,14 +26,14 @@
//
// the recv watchdog timer is active when this object is created
//
-tcpRecvWatchdog::tcpRecvWatchdog
+tcpRecvWatchdog::tcpRecvWatchdog
( epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn,
- epicsMutex & mutexIn, tcpiiu & iiuIn,
+ epicsMutex & mutexIn, tcpiiu & iiuIn,
double periodIn, epicsTimerQueue & queueIn ) :
period ( periodIn ), timer ( queueIn.createTimer () ),
- cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
- mutex ( mutexIn ), iiu ( iiuIn ),
- probeResponsePending ( false ), beaconAnomaly ( true ),
+ cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
+ mutex ( mutexIn ), iiu ( iiuIn ),
+ probeResponsePending ( false ), beaconAnomaly ( true ),
probeTimeoutDetected ( false ), shuttingDown ( false )
{
}
@@ -61,15 +60,15 @@ tcpRecvWatchdog::expire ( const epicsTime & /* currentTime */ )
char hostName[128];
this->iiu.getHostName ( guard, hostName, sizeof (hostName) );
debugPrintf ( ( "CA server \"%s\" unresponsive after %g inactive sec"
- "- disconnecting.\n",
+ "- disconnecting.\n",
hostName, this->period ) );
# endif
- // to get the callback lock safely we must reorder
+ // to get the callback lock safely we must reorder
// the lock hierarchy
epicsGuardRelease < epicsMutex > unguard ( guard );
{
// callback lock is required because channel disconnect
- // state change is initiated from this thread, and
+ // state change is initiated from this thread, and
// this can cause their disconnect notify callback
// to be invoked.
callbackManager mgr ( this->ctxNotify, this->cbMutex );
@@ -91,7 +90,7 @@ tcpRecvWatchdog::expire ( const epicsTime & /* currentTime */ )
}
}
-void tcpRecvWatchdog::beaconArrivalNotify (
+void tcpRecvWatchdog::beaconArrivalNotify (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -103,12 +102,12 @@ void tcpRecvWatchdog::beaconArrivalNotify (
//
// be careful about using beacons to reset the connection
-// time out watchdog until we have received a ping response
+// time out watchdog until we have received a ping response
// from the IOC (this makes the software detect reconnects
-// faster when the server is rebooted twice in rapid
+// faster when the server is rebooted twice in rapid
// succession before a 1st or 2nd beacon has been received)
//
-void tcpRecvWatchdog::beaconAnomalyNotify (
+void tcpRecvWatchdog::beaconAnomalyNotify (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -116,7 +115,7 @@ void tcpRecvWatchdog::beaconAnomalyNotify (
debugPrintf ( ("Saw an abnormal beacon\n") );
}
-void tcpRecvWatchdog::messageArrivalNotify (
+void tcpRecvWatchdog::messageArrivalNotify (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -128,7 +127,7 @@ void tcpRecvWatchdog::messageArrivalNotify (
}
}
-void tcpRecvWatchdog::probeResponseNotify (
+void tcpRecvWatchdog::probeResponseNotify (
epicsGuard < epicsMutex > & cbGuard )
{
bool restartNeeded = false;
@@ -158,27 +157,27 @@ void tcpRecvWatchdog::probeResponseNotify (
}
//
-// The thread for outgoing requests in the client runs
+// The thread for outgoing requests in the client runs
// at a higher priority than the thread in the client
-// that receives responses. Therefore, there could
-// be considerable large array write send backlog that
-// is delaying departure of an echo request and also
-// interrupting delivery of an echo response.
-// We must be careful not to timeout the echo response as
-// long as we see indication of regular departures of
-// message buffers from the client in a situation where
-// we know that the TCP send queueing has been exceeded.
-// The send watchdog will be responsible for detecting
+// that receives responses. Therefore, there could
+// be considerable large array write send backlog that
+// is delaying departure of an echo request and also
+// interrupting delivery of an echo response.
+// We must be careful not to timeout the echo response as
+// long as we see indication of regular departures of
+// message buffers from the client in a situation where
+// we know that the TCP send queueing has been exceeded.
+// The send watchdog will be responsible for detecting
// dead connections in this case.
//
-void tcpRecvWatchdog::sendBacklogProgressNotify (
+void tcpRecvWatchdog::sendBacklogProgressNotify (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
// We dont set "beaconAnomaly" to be false here because, after we see a
- // beacon anomaly (which could be transiently detecting a reboot) we will
- // not trust the beacon as an indicator of a healthy server until we
+ // beacon anomaly (which could be transiently detecting a reboot) we will
+ // not trust the beacon as an indicator of a healthy server until we
// receive at least one message from the server.
if ( this->probeResponsePending && ! this->shuttingDown ) {
this->timer.start ( *this, CA_ECHO_TIMEOUT );
@@ -197,7 +196,7 @@ void tcpRecvWatchdog::connectNotify (
debugPrintf ( ("connected to the server - initiating circuit recv watchdog\n") );
}
-void tcpRecvWatchdog::sendTimeoutNotify (
+void tcpRecvWatchdog::sendTimeoutNotify (
epicsGuard < epicsMutex > & /* cbGuard */,
epicsGuard < epicsMutex > & guard )
{
@@ -243,7 +242,7 @@ void tcpRecvWatchdog::show ( unsigned level ) const
static_cast ( this ), this->period );
if ( level > 0u ) {
::printf ( "\t%s %s %s\n",
- this->probeResponsePending ? "probe-response-pending" : "",
+ this->probeResponsePending ? "probe-response-pending" : "",
this->beaconAnomaly ? "beacon-anomaly-detected" : "",
this->probeTimeoutDetected ? "probe-response-timeout" : "" );
}
diff --git a/modules/ca/src/client/tcpRecvWatchdog.h b/modules/ca/src/client/tcpRecvWatchdog.h
index 0b15e22d8..45e6f0852 100644
--- a/modules/ca/src/client/tcpRecvWatchdog.h
+++ b/modules/ca/src/client/tcpRecvWatchdog.h
@@ -3,57 +3,48 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef tcpRecvWatchdogh
-#define tcpRecvWatchdogh
-
-#ifdef epicsExportSharedSymbols
-# define tcpRecvWatchdogh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_tcpRecvWatchdog_H
+#define INC_tcpRecvWatchdog_H
#include "epicsTimer.h"
-#ifdef tcpRecvWatchdogh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
class tcpiiu;
class tcpRecvWatchdog : private epicsTimerNotify {
public:
- tcpRecvWatchdog ( epicsMutex & cbMutex,
+ tcpRecvWatchdog ( epicsMutex & cbMutex,
cacContextNotify & ctxNotify,
- epicsMutex & mutex, tcpiiu &,
+ epicsMutex & mutex, tcpiiu &,
double periodIn, epicsTimerQueue & );
virtual ~tcpRecvWatchdog ();
void sendBacklogProgressNotify (
epicsGuard < epicsMutex > & );
void messageArrivalNotify (
epicsGuard < epicsMutex > & guard );
- void probeResponseNotify (
+ void probeResponseNotify (
epicsGuard < epicsMutex > & );
- void beaconArrivalNotify (
+ void beaconArrivalNotify (
epicsGuard < epicsMutex > & );
void beaconAnomalyNotify ( epicsGuard < epicsMutex > & );
void connectNotify (
@@ -77,9 +68,9 @@ private:
bool probeTimeoutDetected;
bool shuttingDown;
expireStatus expire ( const epicsTime & currentTime );
- tcpRecvWatchdog ( const tcpRecvWatchdog & );
- tcpRecvWatchdog & operator = ( const tcpRecvWatchdog & );
+ tcpRecvWatchdog ( const tcpRecvWatchdog & );
+ tcpRecvWatchdog & operator = ( const tcpRecvWatchdog & );
};
-#endif // #ifndef tcpRecvWatchdogh
+#endif // #ifndef INC_tcpRecvWatchdog_H
diff --git a/modules/ca/src/client/tcpSendWatchdog.cpp b/modules/ca/src/client/tcpSendWatchdog.cpp
index 6834b39e7..85344164a 100644
--- a/modules/ca/src/client/tcpSendWatchdog.cpp
+++ b/modules/ca/src/client/tcpSendWatchdog.cpp
@@ -3,12 +3,11 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
*
* L O S A L A M O S
* Los Alamos National Laboratory
@@ -25,8 +24,8 @@
#include "cac.h"
#include "virtualCircuit.h"
-tcpSendWatchdog::tcpSendWatchdog (
- epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn,
+tcpSendWatchdog::tcpSendWatchdog (
+ epicsMutex & cbMutexIn, cacContextNotify & ctxNotifyIn,
epicsMutex & mutexIn, tcpiiu & iiuIn,
double periodIn, epicsTimerQueue & queueIn ) :
period ( periodIn ), timer ( queueIn.createTimer () ),
@@ -40,7 +39,7 @@ tcpSendWatchdog::~tcpSendWatchdog ()
this->timer.destroy ();
}
-epicsTimerNotify::expireStatus tcpSendWatchdog::expire (
+epicsTimerNotify::expireStatus tcpSendWatchdog::expire (
const epicsTime & /* currentTime */ )
{
{
@@ -55,7 +54,7 @@ epicsTimerNotify::expireStatus tcpSendWatchdog::expire (
# ifdef DEBUG
char hostName[128];
this->iiu.getHostName ( guard, hostName, sizeof ( hostName ) );
- debugPrintf ( ( "Request not accepted by CA server %s for %g sec. Disconnecting.\n",
+ debugPrintf ( ( "Request not accepted by CA server %s for %g sec. Disconnecting.\n",
hostName, this->period ) );
# endif
this->iiu.sendTimeoutNotify ( mgr, guard );
diff --git a/modules/ca/src/client/tcpSendWatchdog.h b/modules/ca/src/client/tcpSendWatchdog.h
index 05a2dfe75..3fd25d4e1 100644
--- a/modules/ca/src/client/tcpSendWatchdog.h
+++ b/modules/ca/src/client/tcpSendWatchdog.h
@@ -3,41 +3,31 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef tcpSendWatchdogh
-#define tcpSendWatchdogh
-
-
-#ifdef epicsExportSharedSymbols
-# define tcpSendWatchdogh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
+#ifndef INC_tcpSendWatchdog_H
+#define INC_tcpSendWatchdog_H
#include "epicsTimer.h"
-#ifdef tcpSendWatchdogh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
+#include "libCaAPI.h"
class tcpSendWatchdog : private epicsTimerNotify {
public:
@@ -56,8 +46,8 @@ private:
epicsMutex & mutex;
tcpiiu & iiu;
expireStatus expire ( const epicsTime & currentTime );
- tcpSendWatchdog ( const tcpSendWatchdog & );
- tcpSendWatchdog & operator = ( const tcpSendWatchdog & );
+ tcpSendWatchdog ( const tcpSendWatchdog & );
+ tcpSendWatchdog & operator = ( const tcpSendWatchdog & );
};
-#endif // #ifndef tcpSendWatchdog
+#endif // #ifndef INC_tcpSendWatchdog_H
diff --git a/modules/ca/src/client/tcpiiu.cpp b/modules/ca/src/client/tcpiiu.cpp
index 9d174ab84..0751eb4d9 100644
--- a/modules/ca/src/client/tcpiiu.cpp
+++ b/modules/ca/src/client/tcpiiu.cpp
@@ -4,10 +4,10 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
@@ -31,7 +31,6 @@
#include "errlog.h"
-#define epicsExportSharedSymbols
#include "localHostName.h"
#include "iocinf.h"
#include "virtualCircuit.h"
@@ -48,7 +47,7 @@
using namespace std;
tcpSendThread::tcpSendThread (
- class tcpiiu & iiuIn, const char * pName,
+ class tcpiiu & iiuIn, const char * pName,
unsigned stackSize, unsigned priority ) :
thread ( *this, pName, stackSize, priority ), iiu ( iiuIn )
{
@@ -92,7 +91,7 @@ void tcpSendThread::run ()
}
laborPending = false;
- bool flowControlLaborNeeded =
+ bool flowControlLaborNeeded =
this->iiu.busyStateDetected != this->iiu.flowControlActive;
bool echoLaborNeeded = this->iiu.echoRequestPending;
this->iiu.echoRequestPending = false;
@@ -119,7 +118,7 @@ void tcpSendThread::run ()
if ( CA_V42 ( this->iiu.minorProtocolVersion ) ) {
this->iiu.createRespPend.add ( *pChan );
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_createRespPend;
}
else {
@@ -129,12 +128,12 @@ void tcpSendThread::run ()
// that the UDP thread take the callback lock. There are
// almost no V42 servers left at this point.
this->iiu.v42ConnCallbackPend.add ( *pChan );
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_v42ConnCallbackPend;
this->iiu.echoRequestPending = true;
laborPending = true;
}
-
+
if ( this->iiu.sendQue.flushBlockThreshold () ) {
laborPending = true;
break;
@@ -145,7 +144,7 @@ void tcpSendThread::run ()
// this installs any subscriptions as needed
pChan->resubscribe ( guard );
this->iiu.connectedList.add ( *pChan );
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_connected;
if ( this->iiu.sendQue.flushBlockThreshold () ) {
laborPending = true;
@@ -157,7 +156,7 @@ void tcpSendThread::run ()
// this updates any subscriptions as needed
pChan->sendSubscriptionUpdateRequests ( guard );
this->iiu.connectedList.add ( *pChan );
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_connected;
if ( this->iiu.sendQue.flushBlockThreshold () ) {
laborPending = true;
@@ -171,14 +170,14 @@ void tcpSendThread::run ()
}
if ( this->iiu.state == tcpiiu::iiucs_clean_shutdown ) {
this->iiu.sendThreadFlush ( guard );
- // this should cause the server to disconnect from
+ // this should cause the server to disconnect from
// the client
int status = ::shutdown ( this->iiu.sock, SHUT_WR );
if ( status ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ("CAC TCP clean socket shutdown error was %s\n",
+ errlogPrintf ("CAC TCP clean socket shutdown error was %s\n",
sockErrBuf );
}
}
@@ -187,14 +186,14 @@ void tcpSendThread::run ()
errlogPrintf (
"cac: tcp send thread received an unexpected exception "
"- disconnecting\n");
- // this should cause the server to disconnect from
+ // this should cause the server to disconnect from
// the client
int status = ::shutdown ( this->iiu.sock, SHUT_WR );
if ( status ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ("CAC TCP clean socket shutdown error was %s\n",
+ errlogPrintf ("CAC TCP clean socket shutdown error was %s\n",
sockErrBuf );
}
}
@@ -203,11 +202,11 @@ void tcpSendThread::run ()
this->iiu.recvDog.shutdown ();
while ( ! this->iiu.recvThread.exitWait ( 30.0 ) ) {
- // it is possible to get stuck here if the user calls
+ // it is possible to get stuck here if the user calls
// ca_context_destroy() when a circuit isnt known to
// be unresponsive, but is. That situation is probably
// rare, and the IP kernel might have a timeout for
- // such situations, nevertheless we will attempt to deal
+ // such situations, nevertheless we will attempt to deal
// with it here after waiting a reasonable amount of time
// for a clean shutdown to finish.
epicsGuard < epicsMutex > guard ( this->iiu.mutex );
@@ -215,7 +214,7 @@ void tcpSendThread::run ()
}
// user threads blocking for send backlog to be reduced
- // will abort their attempt to get space if
+ // will abort their attempt to get space if
// the state of the tcpiiu changes from connected to a
// disconnecting state. Nevertheless, we need to wait
// for them to finish prior to destroying the IIU.
@@ -229,7 +228,7 @@ void tcpSendThread::run ()
this->iiu.cacRef.destroyIIU ( this->iiu );
}
-unsigned tcpiiu::sendBytes ( const void *pBuf,
+unsigned tcpiiu::sendBytes ( const void *pBuf,
unsigned nBytesInBuf, const epicsTime & currentTime )
{
unsigned nBytes = 0u;
@@ -238,7 +237,7 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
this->sendDog.start ( currentTime );
while ( true ) {
- int status = ::send ( this->sock,
+ int status = ::send ( this->sock,
static_cast < const char * > (pBuf), (int) nBytesInBuf, 0 );
if ( status > 0 ) {
nBytes = static_cast ( status );
@@ -264,7 +263,7 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
}
if ( localError == SOCK_ENOBUFS ) {
- errlogPrintf (
+ errlogPrintf (
"CAC: system low on network buffers "
"- send retry in 15 seconds\n" );
{
@@ -274,16 +273,16 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
continue;
}
- if (
- localError != SOCK_EPIPE &&
+ if (
+ localError != SOCK_EPIPE &&
localError != SOCK_ECONNRESET &&
- localError != SOCK_ETIMEDOUT &&
+ localError != SOCK_ETIMEDOUT &&
localError != SOCK_ECONNABORTED &&
localError != SOCK_SHUTDOWN ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ( "CAC: unexpected TCP send error: %s\n",
+ errlogPrintf ( "CAC: unexpected TCP send error: %s\n",
sockErrBuf );
}
@@ -297,13 +296,13 @@ unsigned tcpiiu::sendBytes ( const void *pBuf,
return nBytes;
}
-void tcpiiu::recvBytes (
+void tcpiiu::recvBytes (
void * pBuf, unsigned nBytesInBuf, statusWireIO & stat )
{
assert ( nBytesInBuf <= INT_MAX );
while ( true ) {
- int status = ::recv ( this->sock, static_cast ( pBuf ),
+ int status = ::recv ( this->sock, static_cast ( pBuf ),
static_cast ( nBytesInBuf ), 0 );
if ( status > 0 ) {
@@ -322,14 +321,14 @@ void tcpiiu::recvBytes (
return;
}
- // if the circuit was locally aborted then supress
+ // if the circuit was locally aborted then supress
// warning messages about bad file descriptor etc
- if ( this->state != iiucs_connected &&
+ if ( this->state != iiucs_connected &&
this->state != iiucs_clean_shutdown ) {
stat.bytesCopied = 0u;
stat.circuitState = swioLocalAbort;
return;
- }
+ }
int localErrno = SOCKERRNO;
@@ -344,7 +343,7 @@ void tcpiiu::recvBytes (
}
if ( localErrno == SOCK_ENOBUFS ) {
- errlogPrintf (
+ errlogPrintf (
"CAC: system low on network buffers "
"- receive retry in 15 seconds\n" );
{
@@ -355,20 +354,20 @@ void tcpiiu::recvBytes (
}
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
// the replacable printf handler isnt called here
// because it reqires a callback lock which probably
// isnt appropriate here
char name[64];
- this->hostNameCacheInstance.getName (
+ this->hostNameCacheInstance.getName (
name, sizeof ( name ) );
errlogPrintf (
"Unexpected problem with CA circuit to"
- " server \"%s\" was \"%s\" - disconnecting\n",
+ " server \"%s\" was \"%s\" - disconnecting\n",
name, sockErrBuf );
-
+
stat.bytesCopied = 0u;
stat.circuitState = swioPeerAbort;
return;
@@ -376,12 +375,12 @@ void tcpiiu::recvBytes (
}
}
-tcpRecvThread::tcpRecvThread (
+tcpRecvThread::tcpRecvThread (
class tcpiiu & iiuIn, class epicsMutex & cbMutexIn,
- cacContextNotify & ctxNotifyIn, const char * pName,
+ cacContextNotify & ctxNotifyIn, const char * pName,
unsigned int stackSize, unsigned int priority ) :
thread ( *this, pName, stackSize, priority ),
- iiu ( iiuIn ), cbMutex ( cbMutexIn ),
+ iiu ( iiuIn ), cbMutex ( cbMutexIn ),
ctxNotify ( ctxNotifyIn ) {}
tcpRecvThread::~tcpRecvThread ()
@@ -407,7 +406,7 @@ void tcpRecvThread::exitWait ()
this->thread.exitWait ();
}
-bool tcpRecvThread::validFillStatus (
+bool tcpRecvThread::validFillStatus (
epicsGuard < epicsMutex > & guard, const statusWireIO & stat )
{
if ( this->iiu.state != tcpiiu::iiucs_connected &&
@@ -464,9 +463,9 @@ void tcpRecvThread::run ()
//
// We leave the bytes pending and fetch them after
- // callbacks are enabled when running in the old preemptive
+ // callbacks are enabled when running in the old preemptive
// call back disabled mode so that asynchronous wakeup via
- // file manager call backs works correctly. This does not
+ // file manager call backs works correctly. This does not
// appear to impact performance.
//
if ( ! pComBuf ) {
@@ -476,11 +475,11 @@ void tcpRecvThread::run ()
statusWireIO stat;
pComBuf->fillFromWire ( this->iiu, stat );
- epicsTime currentTime = epicsTime::getMonotonic ();
+ epicsTime currentTime = epicsTime::getCurrent ();
{
epicsGuard < epicsMutex > guard ( this->iiu.mutex );
-
+
if ( ! this->validFillStatus ( guard, stat ) ) {
break;
}
@@ -502,7 +501,7 @@ void tcpRecvThread::run ()
callbackManager mgr ( this->ctxNotify, this->cbMutex );
epicsGuard < epicsMutex > guard ( this->iiu.mutex );
-
+
// route legacy V42 channel connect through the recv thread -
// the only thread that should be taking the callback lock
while ( nciu * pChan = this->iiu.v42ConnCallbackPend.first () ) {
@@ -525,7 +524,7 @@ void tcpRecvThread::run ()
}
this->iiu._receiveThreadIsBusy = false;
// reschedule connection activity watchdog
- this->iiu.recvDog.messageArrivalNotify ( guard );
+ this->iiu.recvDog.messageArrivalNotify ( guard );
//
// if this thread has connected channels with subscriptions
// that need to be sent then wakeup the send thread
@@ -533,13 +532,13 @@ void tcpRecvThread::run ()
sendWakeupNeeded = true;
}
}
-
+
//
// we dont feel comfortable calling this with a lock applied
// (it might block for longer than we like)
//
- // we would prefer to improve efficency by trying, first, a
- // recv with the new MSG_DONTWAIT flag set, but there isnt
+ // we would prefer to improve efficency by trying, first, a
+ // recv with the new MSG_DONTWAIT flag set, but there isnt
// universal support
//
bool bytesArePending = this->iiu.bytesArePendingInOS ();
@@ -548,7 +547,7 @@ void tcpRecvThread::run ()
if ( bytesArePending ) {
if ( ! this->iiu.busyStateDetected ) {
this->iiu.contigRecvMsgCount++;
- if ( this->iiu.contigRecvMsgCount >=
+ if ( this->iiu.contigRecvMsgCount >=
this->iiu.cacRef.maxContiguousFrames ( guard ) ) {
this->iiu.busyStateDetected = true;
sendWakeupNeeded = true;
@@ -578,7 +577,7 @@ void tcpRecvThread::run ()
}
}
catch ( std::bad_alloc & ) {
- errlogPrintf (
+ errlogPrintf (
"CA client library tcp receive thread "
"terminating due to no space in pool "
"C++ exception\n" );
@@ -586,15 +585,15 @@ void tcpRecvThread::run ()
this->iiu.initiateCleanShutdown ( guard );
}
catch ( std::exception & except ) {
- errlogPrintf (
+ errlogPrintf (
"CA client library tcp receive thread "
- "terminating due to C++ exception \"%s\"\n",
+ "terminating due to C++ exception \"%s\"\n",
except.what () );
epicsGuard < epicsMutex > guard ( this->iiu.mutex );
this->iiu.initiateCleanShutdown ( guard );
}
catch ( ... ) {
- errlogPrintf (
+ errlogPrintf (
"CA client library tcp receive thread "
"terminating due to a non-standard C++ exception\n" );
epicsGuard < epicsMutex > guard ( this->iiu.mutex );
@@ -614,7 +613,7 @@ void tcpRecvThread::connect (
{
epicsGuardRelease < epicsMutex > unguard ( guard );
osiSockAddr tmp = this->iiu.address ();
- status = ::connect ( this->iiu.sock,
+ status = ::connect ( this->iiu.sock,
& tmp.sa, sizeof ( tmp.sa ) );
}
@@ -624,7 +623,7 @@ void tcpRecvThread::connect (
if ( status >= 0 ) {
// put the iiu into the connected state
this->iiu.state = tcpiiu::iiucs_connected;
- this->iiu.recvDog.connectNotify ( guard );
+ this->iiu.recvDog.connectNotify ( guard );
break;
}
else {
@@ -640,7 +639,7 @@ void tcpRecvThread::connect (
}
else {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ( "CAC: Unable to connect because \"%s\"\n",
sockErrBuf );
@@ -663,24 +662,24 @@ void tcpRecvThread::connect (
//
// tcpiiu::tcpiiu ()
//
-tcpiiu::tcpiiu (
- cac & cac, epicsMutex & mutexIn, epicsMutex & cbMutexIn,
- cacContextNotify & ctxNotifyIn, double connectionTimeout,
- epicsTimerQueue & timerQueue, const osiSockAddr & addrIn,
+tcpiiu::tcpiiu (
+ cac & cac, epicsMutex & mutexIn, epicsMutex & cbMutexIn,
+ cacContextNotify & ctxNotifyIn, double connectionTimeout,
+ epicsTimerQueue & timerQueue, const osiSockAddr & addrIn,
comBufMemoryManager & comBufMemMgrIn,
- unsigned minorVersion, ipAddrToAsciiEngine & engineIn,
+ unsigned minorVersion, ipAddrToAsciiEngine & engineIn,
const cacChannel::priLev & priorityIn,
SearchDestTCP * pSearchDestIn ) :
caServerID ( addrIn.ia, priorityIn ),
hostNameCacheInstance ( addrIn, engineIn ),
- recvThread ( *this, cbMutexIn, ctxNotifyIn, "CAC-TCP-recv",
+ recvThread ( *this, cbMutexIn, ctxNotifyIn, "CAC-TCP-recv",
epicsThreadGetStackSize ( epicsThreadStackBig ),
cac::highestPriorityLevelBelow ( cac.getInitializingThreadsPriority() ) ),
sendThread ( *this, "CAC-TCP-send",
epicsThreadGetStackSize ( epicsThreadStackMedium ),
cac::lowestPriorityLevelAbove (
cac.getInitializingThreadsPriority() ) ),
- recvDog ( cbMutexIn, ctxNotifyIn, mutexIn,
+ recvDog ( cbMutexIn, ctxNotifyIn, mutexIn,
*this, connectionTimeout, timerQueue ),
sendDog ( cbMutexIn, ctxNotifyIn, mutexIn,
*this, connectionTimeout, timerQueue ),
@@ -721,9 +720,9 @@ tcpiiu::tcpiiu (
if ( this->sock == INVALID_SOCKET ) {
freeListFree(this->cacRef.tcpSmallRecvBufFreeList, this->pCurData);
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- std :: string reason =
+ std :: string reason =
"CAC: TCP circuit creation failure because \"";
reason += sockErrBuf;
reason += "\"";
@@ -735,7 +734,7 @@ tcpiiu::tcpiiu (
(char *) &flag, sizeof ( flag ) );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ( "CAC: problems setting socket option TCP_NODELAY = \"%s\"\n",
sockErrBuf );
@@ -746,13 +745,13 @@ tcpiiu::tcpiiu (
( char * ) &flag, sizeof ( flag ) );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ( "CAC: problems setting socket option SO_KEEPALIVE = \"%s\"\n",
sockErrBuf );
}
- // load message queue with messages informing server
+ // load message queue with messages informing server
// of version, user, and host name of client
{
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -768,7 +767,7 @@ tcpiiu::tcpiiu (
/*
* some concern that vxWorks will run out of mBuf's
* if this change is made joh 11-10-98
- */
+ */
i = MAX_MSG_SIZE;
status = setsockopt ( this->sock, SOL_SOCKET, SO_SNDBUF,
( char * ) &i, sizeof ( i ) );
@@ -795,10 +794,10 @@ tcpiiu::tcpiiu (
osiSocklen_t sizeOfParameter = static_cast < int > ( sizeof ( nBytes ) );
status = getsockopt ( this->sock, SOL_SOCKET, SO_SNDBUF,
( char * ) &nBytes, &sizeOfParameter );
- if ( status < 0 || nBytes < 0 ||
+ if ( status < 0 || nBytes < 0 ||
sizeOfParameter != static_cast < int > ( sizeof ( nBytes ) ) ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ("CAC: problems getting socket option SO_SNDBUF = \"%s\"\n",
sockErrBuf );
@@ -815,16 +814,16 @@ tcpiiu::tcpiiu (
memset ( (void *) &this->curMsg, '\0', sizeof ( this->curMsg ) );
}
-// this must always be called by the udp thread when it holds
+// this must always be called by the udp thread when it holds
// the callback lock.
-void tcpiiu::start (
+void tcpiiu::start (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
this->recvThread.start ();
}
-void tcpiiu::initiateCleanShutdown (
+void tcpiiu::initiateCleanShutdown (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -849,7 +848,7 @@ void tcpiiu::initiateCleanShutdown (
}
}
-void tcpiiu::disconnectNotify (
+void tcpiiu::disconnectNotify (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -858,7 +857,7 @@ void tcpiiu::disconnectNotify (
this->flushBlockEvent.signal ();
}
-void tcpiiu::responsiveCircuitNotify (
+void tcpiiu::responsiveCircuitNotify (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
@@ -868,7 +867,7 @@ void tcpiiu::responsiveCircuitNotify (
this->unresponsiveCircuit = false;
while ( nciu * pChan = this->unrespCircuit.get() ) {
this->subscripUpdateReqPend.add ( *pChan );
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_subscripUpdateReqPend;
pChan->connect ( cbGuard, guard );
}
@@ -876,7 +875,7 @@ void tcpiiu::responsiveCircuitNotify (
}
}
-void tcpiiu::sendTimeoutNotify (
+void tcpiiu::sendTimeoutNotify (
callbackManager & mgr,
epicsGuard < epicsMutex > & guard )
{
@@ -887,7 +886,7 @@ void tcpiiu::sendTimeoutNotify (
this->recvDog.sendTimeoutNotify ( mgr.cbGuard, guard );
}
-void tcpiiu::receiveTimeoutNotify (
+void tcpiiu::receiveTimeoutNotify (
callbackManager & mgr,
epicsGuard < epicsMutex > & guard )
{
@@ -896,8 +895,8 @@ void tcpiiu::receiveTimeoutNotify (
this->unresponsiveCircuitNotify ( mgr.cbGuard, guard );
}
-void tcpiiu::unresponsiveCircuitNotify (
- epicsGuard < epicsMutex > & cbGuard,
+void tcpiiu::unresponsiveCircuitNotify (
+ epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
cbGuard.assertIdenticalMutex ( this->cbMutex );
@@ -922,7 +921,7 @@ void tcpiiu::unresponsiveCircuitNotify (
if ( this->connectedList.count() ) {
char hostNameTmp[128];
this->getHostName ( guard, hostNameTmp, sizeof ( hostNameTmp ) );
- genLocalExcep ( cbGuard, guard, this->cacRef,
+ genLocalExcep ( cbGuard, guard, this->cacRef,
ECA_UNRESPTMO, hostNameTmp );
while ( nciu * pChan = this->connectedList.get () ) {
// The cac lock is released herein so there is concern that
@@ -932,7 +931,7 @@ void tcpiiu::unresponsiveCircuitNotify (
// channel. The callback lock must be taken in all of
// these situations so this code is protected.
this->unrespCircuit.add ( *pChan );
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_unrespCircuit;
pChan->unresponsiveCircuitNotify ( cbGuard, guard );
}
@@ -940,24 +939,24 @@ void tcpiiu::unresponsiveCircuitNotify (
}
}
-void tcpiiu::initiateAbortShutdown (
+void tcpiiu::initiateAbortShutdown (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
if ( ! this->discardingPendingData ) {
- // force abortive shutdown sequence
+ // force abortive shutdown sequence
// (discard outstanding sends and receives)
struct linger tmpLinger;
tmpLinger.l_onoff = true;
tmpLinger.l_linger = 0u;
- int status = setsockopt ( this->sock, SOL_SOCKET, SO_LINGER,
+ int status = setsockopt ( this->sock, SOL_SOCKET, SO_LINGER,
reinterpret_cast ( &tmpLinger ), sizeof (tmpLinger) );
if ( status != 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ( "CAC TCP socket linger set error was %s\n",
+ errlogPrintf ( "CAC TCP socket linger set error was %s\n",
sockErrBuf );
}
this->discardingPendingData = true;
@@ -986,9 +985,9 @@ void tcpiiu::initiateAbortShutdown (
int status = ::shutdown ( this->sock, SHUT_RDWR );
if ( status ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ("CAC TCP socket shutdown error was %s\n",
+ errlogPrintf ("CAC TCP socket shutdown error was %s\n",
sockErrBuf );
}
}
@@ -1001,7 +1000,7 @@ void tcpiiu::initiateAbortShutdown (
break;
};
- //
+ //
// wake up the send thread if it isnt blocking in send()
//
this->sendThreadFlushEvent.signal ();
@@ -1046,15 +1045,15 @@ void tcpiiu::show ( unsigned level ) const
epicsGuard < epicsMutex > locker ( this->mutex );
char buf[256];
this->hostNameCacheInstance.getName ( buf, sizeof ( buf ) );
- ::printf ( "Virtual circuit to \"%s\" at version V%u.%u state %u\n",
+ ::printf ( "Virtual circuit to \"%s\" at version V%u.%u state %u\n",
buf, CA_MAJOR_PROTOCOL_REVISION,
this->minorProtocolVersion, this->state );
if ( level > 1u ) {
::printf ( "\tcurrent data cache pointer = %p current data cache size = %lu\n",
static_cast < void * > ( this->pCurData ), this->curDataMax );
- ::printf ( "\tcontiguous receive message count=%u, busy detect bool=%u, flow control bool=%u\n",
+ ::printf ( "\tcontiguous receive message count=%u, busy detect bool=%u, flow control bool=%u\n",
this->contigRecvMsgCount, this->busyStateDetected, this->flowControlActive );
- ::printf ( "\receive thread is busy=%u\n",
+ ::printf ( "\receive thread is busy=%u\n",
this->_receiveThreadIsBusy );
}
if ( level > 2u ) {
@@ -1071,7 +1070,7 @@ void tcpiiu::show ( unsigned level ) const
if ( this->createReqPend.count () ) {
::printf ( "Create request pending channels\n" );
tsDLIterConst < nciu > pChan = this->createReqPend.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
@@ -1079,7 +1078,7 @@ void tcpiiu::show ( unsigned level ) const
if ( this->createRespPend.count () ) {
::printf ( "Create response pending channels\n" );
tsDLIterConst < nciu > pChan = this->createRespPend.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
@@ -1087,7 +1086,7 @@ void tcpiiu::show ( unsigned level ) const
if ( this->v42ConnCallbackPend.count () ) {
::printf ( "V42 Conn Callback pending channels\n" );
tsDLIterConst < nciu > pChan = this->v42ConnCallbackPend.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
@@ -1095,7 +1094,7 @@ void tcpiiu::show ( unsigned level ) const
if ( this->subscripReqPend.count () ) {
::printf ( "Subscription request pending channels\n" );
tsDLIterConst < nciu > pChan = this->subscripReqPend.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
@@ -1103,7 +1102,7 @@ void tcpiiu::show ( unsigned level ) const
if ( this->connectedList.count () ) {
::printf ( "Connected channels\n" );
tsDLIterConst < nciu > pChan = this->connectedList.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
@@ -1111,7 +1110,7 @@ void tcpiiu::show ( unsigned level ) const
if ( this->unrespCircuit.count () ) {
::printf ( "Unresponsive circuit channels\n" );
tsDLIterConst < nciu > pChan = this->unrespCircuit.firstIter ();
- while ( pChan.valid () ) {
+ while ( pChan.valid () ) {
pChan->show ( level - 2u );
pChan++;
}
@@ -1144,8 +1143,8 @@ void tcpiiu::flushIfRecvProcessRequested (
}
}
-bool tcpiiu::processIncoming (
- const epicsTime & currentTime,
+bool tcpiiu::processIncoming (
+ const epicsTime & currentTime,
callbackManager & mgr )
{
mgr.cbGuard.assertIdenticalMutex ( this->cbMutex );
@@ -1157,7 +1156,7 @@ bool tcpiiu::processIncoming (
//
if ( ! this->msgHeaderAvailable ) {
if ( ! this->oldMsgHeaderAvailable ) {
- this->oldMsgHeaderAvailable =
+ this->oldMsgHeaderAvailable =
this->recvQue.popOldMsgHeader ( this->curMsg );
if ( ! this->oldMsgHeaderAvailable ) {
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -1166,8 +1165,8 @@ bool tcpiiu::processIncoming (
}
}
if ( this->curMsg.m_postsize == 0xffff ) {
- static const unsigned annexSize =
- sizeof ( this->curMsg.m_postsize ) +
+ static const unsigned annexSize =
+ sizeof ( this->curMsg.m_postsize ) +
sizeof ( this->curMsg.m_count );
if ( this->recvQue.occupiedBytes () < annexSize ) {
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -1197,7 +1196,7 @@ bool tcpiiu::processIncoming (
// check for 8 byte aligned protocol
if ( this->curMsg.m_postsize & 0x7 ) {
this->printFormated ( mgr.cbGuard,
- "CAC: server sent missaligned payload 0x%x\n",
+ "CAC: server sent missaligned payload 0x%x\n",
this->curMsg.m_postsize );
return false;
}
@@ -1251,8 +1250,8 @@ bool tcpiiu::processIncoming (
if ( this->curMsg.m_postsize <= this->curDataMax ) {
if ( this->curMsg.m_postsize > 0u ) {
- this->curDataBytes += this->recvQue.copyOutBytes (
- &this->pCurData[this->curDataBytes],
+ this->curDataBytes += this->recvQue.copyOutBytes (
+ &this->pCurData[this->curDataBytes],
this->curMsg.m_postsize - this->curDataBytes );
if ( this->curDataBytes < this->curMsg.m_postsize ) {
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -1260,7 +1259,7 @@ bool tcpiiu::processIncoming (
return true;
}
}
- bool msgOK = this->cacRef.executeResponse ( mgr, *this,
+ bool msgOK = this->cacRef.executeResponse ( mgr, *this,
currentTime, this->curMsg, this->pCurData );
if ( ! msgOK ) {
return false;
@@ -1274,7 +1273,7 @@ bool tcpiiu::processIncoming (
this->curMsg.m_postsize );
once = true;
}
- this->curDataBytes += this->recvQue.removeBytes (
+ this->curDataBytes += this->recvQue.removeBytes (
this->curMsg.m_postsize - this->curDataBytes );
if ( this->curDataBytes < this->curMsg.m_postsize ) {
epicsGuard < epicsMutex > guard ( this->mutex );
@@ -1282,7 +1281,7 @@ bool tcpiiu::processIncoming (
return true;
}
}
-
+
this->oldMsgHeaderAvailable = false;
this->msgHeaderAvailable = false;
this->curDataBytes = 0u;
@@ -1296,7 +1295,7 @@ void tcpiiu::hostNameSetRequest ( epicsGuard < epicsMutex > & guard )
if ( ! CA_V41 ( this->minorProtocolVersion ) ) {
return;
}
-
+
const char * pName = this->cacRef.pLocalHostName ();
unsigned size = strlen ( pName ) + 1u;
unsigned postSize = CA_MESSAGE_ALIGN ( size );
@@ -1307,9 +1306,9 @@ void tcpiiu::hostNameSetRequest ( epicsGuard < epicsMutex > & guard )
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_HOST_NAME, postSize,
- 0u, 0u, 0u, 0u,
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_HOST_NAME, postSize,
+ 0u, 0u, 0u, 0u,
CA_V49 ( this->minorProtocolVersion ) );
this->sendQue.pushString ( pName, size );
this->sendQue.pushString ( cacNillBytes, postSize - size );
@@ -1337,16 +1336,16 @@ void tcpiiu::userNameSetRequest ( epicsGuard < epicsMutex > & guard )
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_CLIENT_NAME, postSize,
- 0u, 0u, 0u, 0u,
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_CLIENT_NAME, postSize,
+ 0u, 0u, 0u, 0u,
CA_V49 ( this->minorProtocolVersion ) );
this->sendQue.pushString ( pName, size );
this->sendQue.pushString ( cacNillBytes, postSize - size );
minder.commit ();
}
-void tcpiiu::disableFlowControlRequest (
+void tcpiiu::disableFlowControlRequest (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1355,14 +1354,14 @@ void tcpiiu::disableFlowControlRequest (
this->flushRequest ( guard );
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_EVENTS_ON, 0u,
- 0u, 0u, 0u, 0u,
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_EVENTS_ON, 0u,
+ 0u, 0u, 0u, 0u,
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
-void tcpiiu::enableFlowControlRequest (
+void tcpiiu::enableFlowControlRequest (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1371,9 +1370,9 @@ void tcpiiu::enableFlowControlRequest (
this->flushRequest ( guard );
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_EVENTS_OFF, 0u,
- 0u, 0u, 0u, 0u,
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_EVENTS_OFF, 0u,
+ 0u, 0u, 0u, 0u,
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
@@ -1390,10 +1389,10 @@ void tcpiiu::versionMessage ( epicsGuard < epicsMutex > & guard,
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_VERSION, 0u,
- static_cast < ca_uint16_t > ( priority ),
- CA_MINOR_PROTOCOL_REVISION, 0u, 0u,
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_VERSION, 0u,
+ static_cast < ca_uint16_t > ( priority ),
+ CA_MINOR_PROTOCOL_REVISION, 0u, 0u,
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
@@ -1401,7 +1400,7 @@ void tcpiiu::versionMessage ( epicsGuard < epicsMutex > & guard,
void tcpiiu::echoRequest ( epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
-
+
epicsUInt16 command = CA_PROTO_ECHO;
if ( ! CA_V43 ( this->minorProtocolVersion ) ) {
// we fake an echo to early server using a read sync
@@ -1412,9 +1411,9 @@ void tcpiiu::echoRequest ( epicsGuard < epicsMutex > & guard )
this->flushRequest ( guard );
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- command, 0u,
- 0u, 0u, 0u, 0u,
+ this->sendQue.insertRequestHeader (
+ command, 0u,
+ 0u, 0u, 0u, 0u,
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
@@ -1427,7 +1426,7 @@ void tcpiiu::writeRequest ( epicsGuard < epicsMutex > & guard,
throw cacChannel::badType ();
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestWithPayLoad ( CA_PROTO_WRITE,
+ this->sendQue.insertRequestWithPayLoad ( CA_PROTO_WRITE,
type, nElem, chan.getSID(guard), chan.getCID(guard), pValue,
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
@@ -1435,7 +1434,7 @@ void tcpiiu::writeRequest ( epicsGuard < epicsMutex > & guard,
void tcpiiu::writeNotifyRequest ( epicsGuard < epicsMutex > & guard,
- nciu &chan, netWriteNotifyIO &io, unsigned type,
+ nciu &chan, netWriteNotifyIO &io, unsigned type,
arrayElementCount nElem, const void *pValue )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1447,14 +1446,14 @@ void tcpiiu::writeNotifyRequest ( epicsGuard < epicsMutex > & guard,
throw cacChannel::badType ();
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestWithPayLoad ( CA_PROTO_WRITE_NOTIFY,
+ this->sendQue.insertRequestWithPayLoad ( CA_PROTO_WRITE_NOTIFY,
type, nElem, chan.getSID(guard), io.getId(), pValue,
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
void tcpiiu::readNotifyRequest ( epicsGuard < epicsMutex > & guard,
- nciu & chan, netReadNotifyIO & io,
+ nciu & chan, netReadNotifyIO & io,
unsigned dataType, arrayElementCount nElem )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1468,7 +1467,7 @@ void tcpiiu::readNotifyRequest ( epicsGuard < epicsMutex > & guard,
else {
maxBytes = MAX_TCP;
}
- arrayElementCount maxElem =
+ arrayElementCount maxElem =
( maxBytes - dbr_size[dataType] ) / dbr_value_size[dataType];
if ( nElem > maxElem ) {
throw cacChannel::msgBodyCacheTooSmall ();
@@ -1476,21 +1475,21 @@ void tcpiiu::readNotifyRequest ( epicsGuard < epicsMutex > & guard,
if (nElem == 0 && !CA_V413(this->minorProtocolVersion))
nElem = chan.getcount();
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_READ_NOTIFY, 0u,
- static_cast < ca_uint16_t > ( dataType ),
- static_cast < ca_uint32_t > ( nElem ),
- chan.getSID(guard), io.getId(),
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_READ_NOTIFY, 0u,
+ static_cast < ca_uint16_t > ( dataType ),
+ static_cast < ca_uint32_t > ( nElem ),
+ chan.getSID(guard), io.getId(),
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
-void tcpiiu::createChannelRequest (
+void tcpiiu::createChannelRequest (
nciu & chan, epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
- if ( this->state != iiucs_connected &&
+ if ( this->state != iiucs_connected &&
this->state != iiucs_connecting ) {
return;
}
@@ -1521,9 +1520,9 @@ void tcpiiu::createChannelRequest (
// here to communicate the minor version number
// starting with CA 4.1.
//
- this->sendQue.insertRequestHeader (
- CA_PROTO_CREATE_CHAN, postCnt,
- 0u, 0u, identity, CA_MINOR_PROTOCOL_REVISION,
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_CREATE_CHAN, postCnt,
+ 0u, 0u, identity, CA_MINOR_PROTOCOL_REVISION,
CA_V49 ( this->minorProtocolVersion ) );
if ( nameLength ) {
this->sendQue.pushString ( pName, nameLength );
@@ -1544,9 +1543,9 @@ void tcpiiu::clearChannelRequest ( epicsGuard < epicsMutex > & guard,
return;
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_CLEAR_CHANNEL, 0u,
- 0u, 0u, sid, cid,
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_CLEAR_CHANNEL, 0u,
+ 0u, 0u, sid, cid,
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
@@ -1555,14 +1554,14 @@ void tcpiiu::clearChannelRequest ( epicsGuard < epicsMutex > & guard,
// this routine return void because if this internally fails the best response
// is to try again the next time that we reconnect
//
-void tcpiiu::subscriptionRequest (
+void tcpiiu::subscriptionRequest (
epicsGuard < epicsMutex > & guard,
nciu & chan, netSubscription & subscr )
{
guard.assertIdenticalMutex ( this->mutex );
// there are situations where the circuit is disconnected, but
// the channel does not know this yet
- if ( this->state != iiucs_connected &&
+ if ( this->state != iiucs_connected &&
this->state != iiucs_connecting ) {
return;
}
@@ -1587,11 +1586,11 @@ void tcpiiu::subscriptionRequest (
}
comQueSendMsgMinder minder ( this->sendQue, guard );
// nElement bounds checked above
- this->sendQue.insertRequestHeader (
- CA_PROTO_EVENT_ADD, 16u,
- static_cast < ca_uint16_t > ( dataType ),
- static_cast < ca_uint32_t > ( nElem ),
- chan.getSID(guard), subscr.getId(),
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_EVENT_ADD, 16u,
+ static_cast < ca_uint16_t > ( dataType ),
+ static_cast < ca_uint32_t > ( nElem ),
+ chan.getSID(guard), subscr.getId(),
CA_V49 ( this->minorProtocolVersion ) );
// extension
@@ -1607,7 +1606,7 @@ void tcpiiu::subscriptionRequest (
// this routine return void because if this internally fails the best response
// is to try again the next time that we reconnect
//
-void tcpiiu::subscriptionUpdateRequest (
+void tcpiiu::subscriptionUpdateRequest (
epicsGuard < epicsMutex > & guard,
nciu & chan, netSubscription & subscr )
{
@@ -1634,11 +1633,11 @@ void tcpiiu::subscriptionUpdateRequest (
}
comQueSendMsgMinder minder ( this->sendQue, guard );
// nElem boounds checked above
- this->sendQue.insertRequestHeader (
- CA_PROTO_READ_NOTIFY, 0u,
- static_cast < ca_uint16_t > ( dataType ),
- static_cast < ca_uint32_t > ( nElem ),
- chan.getSID (guard), subscr.getId (),
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_READ_NOTIFY, 0u,
+ static_cast < ca_uint16_t > ( dataType ),
+ static_cast < ca_uint32_t > ( nElem ),
+ chan.getSID (guard), subscr.getId (),
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
@@ -1653,12 +1652,12 @@ void tcpiiu::subscriptionCancelRequest ( epicsGuard < epicsMutex > & guard,
return;
}
comQueSendMsgMinder minder ( this->sendQue, guard );
- this->sendQue.insertRequestHeader (
- CA_PROTO_EVENT_CANCEL, 0u,
- static_cast < ca_uint16_t > ( subscr.getType ( guard ) ),
+ this->sendQue.insertRequestHeader (
+ CA_PROTO_EVENT_CANCEL, 0u,
+ static_cast < ca_uint16_t > ( subscr.getType ( guard ) ),
static_cast < ca_uint16_t > ( subscr.getCount (
guard, CA_V413(this->minorProtocolVersion) ) ),
- chan.getSID(guard), subscr.getId(),
+ chan.getSID(guard), subscr.getId(),
CA_V49 ( this->minorProtocolVersion ) );
minder.commit ();
}
@@ -1669,7 +1668,7 @@ bool tcpiiu::sendThreadFlush ( epicsGuard < epicsMutex > & guard )
if ( this->sendQue.occupiedBytes() > 0 ) {
while ( comBuf * pBuf = this->sendQue.popNextComBufToSend () ) {
- epicsTime current = epicsTime::getMonotonic ();
+ epicsTime current = epicsTime::getCurrent ();
unsigned bytesToBeSent = pBuf->occupiedBytes ();
bool success = false;
@@ -1689,10 +1688,10 @@ bool tcpiiu::sendThreadFlush ( epicsGuard < epicsMutex > & guard )
return false;
}
- // set it here with this odd order because we must have
+ // set it here with this odd order because we must have
// the lock and we must have already sent the bytes
this->unacknowledgedSendBytes += bytesToBeSent;
- if ( this->unacknowledgedSendBytes >
+ if ( this->unacknowledgedSendBytes >
this->socketLibrarySendBufferSize ) {
this->recvDog.sendBacklogProgressNotify ( guard );
}
@@ -1712,25 +1711,25 @@ void tcpiiu :: flush ( epicsGuard < epicsMutex > & guard )
this->flushRequest ( guard );
// the process thread is not permitted to flush as this
// can result in a push / pull deadlock on the TCP pipe.
- // Instead, the process thread scheduals the flush with the
- // send thread which runs at a higher priority than the
+ // Instead, the process thread scheduals the flush with the
+ // send thread which runs at a higher priority than the
// receive thread. The same applies to the UDP thread for
// locking hierarchy reasons.
if ( ! epicsThreadPrivateGet ( caClientCallbackThreadId ) ) {
// enable / disable of call back preemption must occur here
// because the tcpiiu might disconnect while waiting and its
- // pointer to this cac might become invalid
+ // pointer to this cac might become invalid
assert ( this->blockingForFlush < UINT_MAX );
this->blockingForFlush++;
while ( this->sendQue.flushBlockThreshold() ) {
bool userRequestsCanBeAccepted =
this->state == iiucs_connected ||
- ( ! this->ca_v42_ok ( guard ) &&
+ ( ! this->ca_v42_ok ( guard ) &&
this->state == iiucs_connecting );
// fail the users request if we have a disconnected
// or unresponsive circuit
- if ( ! userRequestsCanBeAccepted ||
+ if ( ! userRequestsCanBeAccepted ||
this->unresponsiveCircuit ) {
this->decrementBlockingForFlushCount ( guard );
throw cacChannel::notConnected ();
@@ -1743,7 +1742,7 @@ void tcpiiu :: flush ( epicsGuard < epicsMutex > & guard )
}
}
-unsigned tcpiiu::requestMessageBytesPending (
+unsigned tcpiiu::requestMessageBytesPending (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1756,7 +1755,7 @@ unsigned tcpiiu::requestMessageBytesPending (
return sendQue.occupiedBytes ();
}
-void tcpiiu::decrementBlockingForFlushCount (
+void tcpiiu::decrementBlockingForFlushCount (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1789,10 +1788,10 @@ void tcpiiu::requestRecvProcessPostponedFlush (
this->recvProcessPostponedFlush = true;
}
-unsigned tcpiiu::getHostName (
+unsigned tcpiiu::getHostName (
epicsGuard < epicsMutex > & guard,
char * pBuf, unsigned bufLength ) const throw ()
-{
+{
guard.assertIdenticalMutex ( this->mutex );
return this->hostNameCacheInstance.getName ( pBuf, bufLength );
}
@@ -1804,8 +1803,8 @@ const char * tcpiiu::pHostName (
return this->hostNameCacheInstance.pointer ();
}
-void tcpiiu::disconnectAllChannels (
- epicsGuard < epicsMutex > & cbGuard,
+void tcpiiu::disconnectAllChannels (
+ epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard,
class udpiiu & discIIU )
{
@@ -1818,21 +1817,21 @@ void tcpiiu::disconnectAllChannels (
while ( nciu * pChan = this->createRespPend.get () ) {
// we dont yet know the server's id so we cant
- // send a channel delete request and will instead
+ // send a channel delete request and will instead
// trust that the server can do the proper cleanup
// when the circuit disconnects
discIIU.installDisconnectedChannel ( guard, *pChan );
}
-
+
while ( nciu * pChan = this->v42ConnCallbackPend.get () ) {
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
discIIU.installDisconnectedChannel ( guard, *pChan );
}
while ( nciu * pChan = this->subscripReqPend.get () ) {
pChan->disconnectAllIO ( cbGuard, guard );
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
discIIU.installDisconnectedChannel ( guard, *pChan );
pChan->unresponsiveCircuitNotify ( cbGuard, guard );
@@ -1840,7 +1839,7 @@ void tcpiiu::disconnectAllChannels (
while ( nciu * pChan = this->connectedList.get () ) {
pChan->disconnectAllIO ( cbGuard, guard );
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
discIIU.installDisconnectedChannel ( guard, *pChan );
pChan->unresponsiveCircuitNotify ( cbGuard, guard );
@@ -1848,16 +1847,16 @@ void tcpiiu::disconnectAllChannels (
while ( nciu * pChan = this->unrespCircuit.get () ) {
// if we know that the circuit is unresponsive
- // then we dont send a channel delete request and
- // will instead trust that the server can do the
+ // then we dont send a channel delete request and
+ // will instead trust that the server can do the
// proper cleanup when the circuit disconnects
pChan->disconnectAllIO ( cbGuard, guard );
discIIU.installDisconnectedChannel ( guard, *pChan );
}
-
+
while ( nciu * pChan = this->subscripUpdateReqPend.get () ) {
pChan->disconnectAllIO ( cbGuard, guard );
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
discIIU.installDisconnectedChannel ( guard, *pChan );
pChan->unresponsiveCircuitNotify ( cbGuard, guard );
@@ -1867,71 +1866,71 @@ void tcpiiu::disconnectAllChannels (
this->initiateCleanShutdown ( guard );
}
-void tcpiiu::unlinkAllChannels (
- epicsGuard < epicsMutex > & cbGuard,
+void tcpiiu::unlinkAllChannels (
+ epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
cbGuard.assertIdenticalMutex ( this->cbMutex );
guard.assertIdenticalMutex ( this->mutex );
while ( nciu * pChan = this->createReqPend.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->serviceShutdownNotify ( cbGuard, guard );
}
while ( nciu * pChan = this->createRespPend.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
// we dont yet know the server's id so we cant
- // send a channel delete request and will instead
+ // send a channel delete request and will instead
// trust that the server can do the proper cleanup
// when the circuit disconnects
pChan->serviceShutdownNotify ( cbGuard, guard );
}
-
+
while ( nciu * pChan = this->v42ConnCallbackPend.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
pChan->serviceShutdownNotify ( cbGuard, guard );
}
while ( nciu * pChan = this->subscripReqPend.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->disconnectAllIO ( cbGuard, guard );
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
pChan->serviceShutdownNotify ( cbGuard, guard );
}
while ( nciu * pChan = this->connectedList.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->disconnectAllIO ( cbGuard, guard );
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
pChan->serviceShutdownNotify ( cbGuard, guard );
}
while ( nciu * pChan = this->unrespCircuit.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->disconnectAllIO ( cbGuard, guard );
// if we know that the circuit is unresponsive
- // then we dont send a channel delete request and
- // will instead trust that the server can do the
+ // then we dont send a channel delete request and
+ // will instead trust that the server can do the
// proper cleanup when the circuit disconnects
pChan->serviceShutdownNotify ( cbGuard, guard );
}
-
+
while ( nciu * pChan = this->subscripUpdateReqPend.get () ) {
- pChan->channelNode::listMember =
+ pChan->channelNode::listMember =
channelNode::cs_none;
pChan->disconnectAllIO ( cbGuard, guard );
- this->clearChannelRequest ( guard,
+ this->clearChannelRequest ( guard,
pChan->getSID(guard), pChan->getCID(guard) );
pChan->serviceShutdownNotify ( cbGuard, guard );
}
@@ -1940,9 +1939,9 @@ void tcpiiu::unlinkAllChannels (
this->initiateCleanShutdown ( guard );
}
-void tcpiiu::installChannel (
- epicsGuard < epicsMutex > & guard,
- nciu & chan, unsigned sidIn,
+void tcpiiu::installChannel (
+ epicsGuard < epicsMutex > & guard,
+ nciu & chan, unsigned sidIn,
ca_uint16_t typeIn, arrayElementCount countIn )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1951,12 +1950,12 @@ void tcpiiu::installChannel (
this->channelCountTot++;
chan.channelNode::listMember = channelNode::cs_createReqPend;
chan.searchReplySetUp ( *this, sidIn, typeIn, countIn, guard );
- // The tcp send thread runs at apriority below the udp thread
+ // The tcp send thread runs at apriority below the udp thread
// so that this will not send small packets
this->sendThreadFlushEvent.signal ();
}
-bool tcpiiu :: connectNotify (
+bool tcpiiu :: connectNotify (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -1980,7 +1979,7 @@ bool tcpiiu :: connectNotify (
return wasExpected;
}
-void tcpiiu::uninstallChan (
+void tcpiiu::uninstallChan (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
guard.assertIdenticalMutex ( this->mutex );
@@ -2008,7 +2007,7 @@ void tcpiiu::uninstallChan (
this->subscripUpdateReqPend.remove ( chan );
break;
default:
- errlogPrintf (
+ errlogPrintf (
"cac: attempt to uninstall channel from tcp iiu, but it inst installed there?" );
}
chan.channelNode::listMember = channelNode::cs_none;
@@ -2018,8 +2017,8 @@ void tcpiiu::uninstallChan (
}
}
-int tcpiiu :: printFormated (
- epicsGuard < epicsMutex > & cbGuard,
+int tcpiiu :: printFormated (
+ epicsGuard < epicsMutex > & cbGuard,
const char *pformat, ... )
{
cbGuard.assertIdenticalMutex ( this->cbMutex );
@@ -2028,11 +2027,11 @@ int tcpiiu :: printFormated (
int status;
va_start ( theArgs, pformat );
-
+
status = this->cacRef.varArgsPrintFormated ( cbGuard, pformat, theArgs );
-
+
va_end ( theArgs );
-
+
return status;
}
@@ -2054,7 +2053,7 @@ bool tcpiiu::bytesArePendingInOS () const
tmo.tv_usec = 0;
int status = select ( this->sock + 1, & readBits, NULL, NULL, & tmo );
if ( status > 0 ) {
- if ( FD_ISSET ( this->sock, & readBits ) ) {
+ if ( FD_ISSET ( this->sock, & readBits ) ) {
return true;
}
}
@@ -2079,8 +2078,8 @@ double tcpiiu::receiveWatchdogDelay (
}
/*
- * Certain OS, such as HPUX, do not unblock a socket system call
- * when another thread asynchronously calls both shutdown() and
+ * Certain OS, such as HPUX, do not unblock a socket system call
+ * when another thread asynchronously calls both shutdown() and
* close(). To solve this problem we need to employ OS specific
* mechanisms.
*/
@@ -2117,8 +2116,8 @@ unsigned tcpiiu::channelCount ( epicsGuard < epicsMutex > & guard )
return this->channelCountTot;
}
-void tcpiiu::uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void tcpiiu::uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
const class epicsTime & currentTime )
{
netiiu::uninstallChanDueToSuccessfulSearchResponse (
@@ -2126,7 +2125,7 @@ void tcpiiu::uninstallChanDueToSuccessfulSearchResponse (
}
bool tcpiiu::searchMsg (
- epicsGuard < epicsMutex > & guard, ca_uint32_t id,
+ epicsGuard < epicsMutex > & guard, ca_uint32_t id,
const char * pName, unsigned nameLength )
{
return netiiu::searchMsg (
@@ -2193,7 +2192,7 @@ void tcpiiu :: versionRespNotify ( const caHdrLargeArray & msg )
void tcpiiu :: searchRespNotify (
const epicsTime & currentTime, const caHdrLargeArray & msg )
-{
+{
/*
* the type field is abused to carry the port number
* so that we can have multiple servers on one host
@@ -2207,7 +2206,7 @@ void tcpiiu :: searchRespNotify (
else {
serverAddr = this->address ();
}
- cacRef.transferChanToVirtCircuit
- ( msg.m_available, msg.m_cid, 0xffff,
+ cacRef.transferChanToVirtCircuit
+ ( msg.m_available, msg.m_cid, 0xffff,
0, minorProtocolVersion, serverAddr, currentTime );
}
diff --git a/modules/ca/src/client/test/ca_test.c b/modules/ca/src/client/test/ca_test.c
index 998536843..0ecfee8c8 100644
--- a/modules/ca/src/client/test/ca_test.c
+++ b/modules/ca/src/client/test/ca_test.c
@@ -5,11 +5,11 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
- * Author: Jeff Hill
- * Date: 07-01-91
+ * Author: Jeff Hill
+ * Date: 07-01-91
*/
/*
@@ -32,24 +32,24 @@ static unsigned long outstanding;
/*
- * ca_test
+ * ca_test
*
- * find channel, write a value if supplied, and
- * read back the current value
+ * find channel, write a value if supplied, and
+ * read back the current value
*
*/
int ca_test(
-char *pname,
-char *pvalue
+char *pname,
+char *pvalue
)
{
int status;
- if(pvalue){
- status = capft(pname,pvalue);
- }
- else{
- status = cagft(pname);
- }
+ if(pvalue){
+ status = capft(pname,pvalue);
+ }
+ else{
+ status = cagft(pname);
+ }
ca_task_exit();
return status;
}
@@ -57,244 +57,244 @@ char *pvalue
/*
- * cagft()
+ * cagft()
*
- * ca get field test
+ * ca get field test
*
- * test ca get over the range of CA data types
+ * test ca get over the range of CA data types
*/
static int cagft(char *pname)
-{
- const unsigned maxTries = 1000ul;
- unsigned ntries = 0u;
- chid chan_id;
- int status;
- int i;
+{
+ const unsigned maxTries = 1000ul;
+ unsigned ntries = 0u;
+ chid chan_id;
+ int status;
+ int i;
- /*
- * convert name to chan id
- */
- status = ca_search(pname, &chan_id);
- SEVCHK(status,NULL);
- status = ca_pend_io(5.0);
- if(status != ECA_NORMAL){
+ /*
+ * convert name to chan id
+ */
+ status = ca_search(pname, &chan_id);
+ SEVCHK(status,NULL);
+ status = ca_pend_io(5.0);
+ if(status != ECA_NORMAL){
SEVCHK(ca_clear_channel(chan_id),NULL);
- printf("Not Found %s\n", pname);
- return -1;
- }
+ printf("Not Found %s\n", pname);
+ return -1;
+ }
- printf("name:\t%s\n",
+ printf("name:\t%s\n",
ca_name(chan_id));
- printf("native type:\t%s\n",
+ printf("native type:\t%s\n",
dbr_type_to_text(ca_field_type(chan_id)));
- printf("native count:\t%lu\n",
+ printf("native count:\t%lu\n",
ca_element_count(chan_id));
- /*
- * fetch as each type
- */
- for(i=0; i<=LAST_BUFFER_TYPE; i++){
- if(ca_field_type(chan_id)==DBR_STRING) {
- if( (i!=DBR_STRING)
- && (i!=DBR_STS_STRING)
- && (i!=DBR_TIME_STRING)
- && (i!=DBR_GR_STRING)
+ /*
+ * fetch as each type
+ */
+ for(i=0; i<=LAST_BUFFER_TYPE; i++){
+ if(ca_field_type(chan_id)==DBR_STRING) {
+ if( (i!=DBR_STRING)
+ && (i!=DBR_STS_STRING)
+ && (i!=DBR_TIME_STRING)
+ && (i!=DBR_GR_STRING)
&& (i!=DBR_CTRL_STRING)) {
continue;
}
}
/* ignore write only types */
- if (
- i == DBR_PUT_ACKT ||
+ if (
+ i == DBR_PUT_ACKT ||
i == DBR_PUT_ACKS ) {
continue;
}
- status = ca_array_get_callback(
- i,
- ca_element_count(chan_id),
- chan_id,
- printit,
- NULL);
- SEVCHK(status, NULL);
+ status = ca_array_get_callback(
+ i,
+ ca_element_count(chan_id),
+ chan_id,
+ printit,
+ NULL);
+ SEVCHK(status, NULL);
- outstanding++;
- }
+ outstanding++;
+ }
- /*
- * wait for the operation to complete
- * before returning
- */
- while ( ntries < maxTries ) {
- unsigned long oldOut;
+ /*
+ * wait for the operation to complete
+ * before returning
+ */
+ while ( ntries < maxTries ) {
+ unsigned long oldOut;
- oldOut = outstanding;
- ca_pend_event ( 0.05 );
+ oldOut = outstanding;
+ ca_pend_event ( 0.05 );
- if ( ! outstanding ) {
+ if ( ! outstanding ) {
SEVCHK ( ca_clear_channel ( chan_id ), NULL );
- printf ( "\n\n" );
- return 0;
- }
+ printf ( "\n\n" );
+ return 0;
+ }
- if ( outstanding == oldOut ) {
- ntries++;
- }
- }
+ if ( outstanding == oldOut ) {
+ ntries++;
+ }
+ }
SEVCHK ( ca_clear_channel ( chan_id ), NULL );
- return -1;
+ return -1;
}
/*
- * PRINTIT()
+ * PRINTIT()
*/
static void printit ( struct event_handler_args args )
{
- if ( args.status == ECA_NORMAL ) {
- ca_dump_dbr ( args.type, args.count, args.dbr );
- }
- else {
+ if ( args.status == ECA_NORMAL ) {
+ ca_dump_dbr ( args.type, args.count, args.dbr );
+ }
+ else {
printf ( "%s\t%s\n", dbr_text[args.type], ca_message(args.status) );
- }
+ }
- outstanding--;
+ outstanding--;
}
/*
- * capft
+ * capft
+ *
+ * test ca_put() over a range of data types
*
- * test ca_put() over a range of data types
- *
*/
static int capft(
-char *pname,
-char *pvalue
+char *pname,
+char *pvalue
)
{
- dbr_short_t shortvalue;
- dbr_long_t longvalue;
- dbr_float_t floatvalue;
- dbr_char_t charvalue;
- dbr_double_t doublevalue;
- unsigned long ntries = 10ul;
- int status;
- chid chan_id;
+ dbr_short_t shortvalue;
+ dbr_long_t longvalue;
+ dbr_float_t floatvalue;
+ dbr_char_t charvalue;
+ dbr_double_t doublevalue;
+ unsigned long ntries = 10ul;
+ int status;
+ chid chan_id;
- if (((*pname < ' ') || (*pname > 'z'))
- || ((*pvalue < ' ') || (*pvalue > 'z'))){
- printf("\nusage \"pv name\",\"value\"\n");
- return -1;
- }
+ if (((*pname < ' ') || (*pname > 'z'))
+ || ((*pvalue < ' ') || (*pvalue > 'z'))){
+ printf("\nusage \"pv name\",\"value\"\n");
+ return -1;
+ }
- /*
- * convert name to chan id
- */
- status = ca_search(pname, &chan_id);
- SEVCHK(status,NULL);
- status = ca_pend_io(5.0);
- if(status != ECA_NORMAL){
+ /*
+ * convert name to chan id
+ */
+ status = ca_search(pname, &chan_id);
+ SEVCHK(status,NULL);
+ status = ca_pend_io(5.0);
+ if(status != ECA_NORMAL){
SEVCHK(ca_clear_channel(chan_id),NULL);
- printf("Not Found %s\n", pname);
- return -1;
- }
+ printf("Not Found %s\n", pname);
+ return -1;
+ }
- printf("name:\t%s\n", ca_name(chan_id));
- printf("native type:\t%d\n", ca_field_type(chan_id));
- printf("native count:\t%lu\n", ca_element_count(chan_id));
+ printf("name:\t%s\n", ca_name(chan_id));
+ printf("native type:\t%d\n", ca_field_type(chan_id));
+ printf("native count:\t%lu\n", ca_element_count(chan_id));
- /*
- * string value ca_put
- */
- status = ca_put(
- DBR_STRING,
- chan_id,
- pvalue);
- SEVCHK(status, NULL);
- verify_value(chan_id, DBR_STRING);
+ /*
+ * string value ca_put
+ */
+ status = ca_put(
+ DBR_STRING,
+ chan_id,
+ pvalue);
+ SEVCHK(status, NULL);
+ verify_value(chan_id, DBR_STRING);
- if(ca_field_type(chan_id)==0)goto skip_rest;
+ if(ca_field_type(chan_id)==0)goto skip_rest;
- if(sscanf(pvalue,"%hd",&shortvalue)==1) {
- /*
- * short integer ca_put
- */
- status = ca_put(
- DBR_SHORT,
- chan_id,
- &shortvalue);
- SEVCHK(status, NULL);
- verify_value(chan_id, DBR_SHORT);
- status = ca_put(
- DBR_ENUM,
- chan_id,
- &shortvalue);
- SEVCHK(status, NULL);
- verify_value(chan_id, DBR_ENUM);
- charvalue=(dbr_char_t)shortvalue;
- status = ca_put(
- DBR_CHAR,
- chan_id,
- &charvalue);
- SEVCHK(status, NULL);
- verify_value(chan_id, DBR_CHAR);
- }
- if(sscanf(pvalue,"%d",&longvalue)==1) {
- /*
- * long integer ca_put
- */
- status = ca_put(
- DBR_LONG,
- chan_id,
- &longvalue);
- SEVCHK(status, NULL);
- verify_value(chan_id, DBR_LONG);
- }
- if(epicsScanFloat(pvalue, &floatvalue)==1) {
- /*
- * single precision float ca_put
- */
- status = ca_put(
- DBR_FLOAT,
- chan_id,
- &floatvalue);
- SEVCHK(status, NULL);
- verify_value(chan_id, DBR_FLOAT);
- }
- if(epicsScanDouble(pvalue, &doublevalue)==1) {
- /*
- * double precision float ca_put
- */
- status = ca_put(
- DBR_DOUBLE,
- chan_id,
- &doublevalue);
- SEVCHK(status, NULL);
- verify_value(chan_id, DBR_DOUBLE);
- }
+ if(sscanf(pvalue,"%hd",&shortvalue)==1) {
+ /*
+ * short integer ca_put
+ */
+ status = ca_put(
+ DBR_SHORT,
+ chan_id,
+ &shortvalue);
+ SEVCHK(status, NULL);
+ verify_value(chan_id, DBR_SHORT);
+ status = ca_put(
+ DBR_ENUM,
+ chan_id,
+ &shortvalue);
+ SEVCHK(status, NULL);
+ verify_value(chan_id, DBR_ENUM);
+ charvalue=(dbr_char_t)shortvalue;
+ status = ca_put(
+ DBR_CHAR,
+ chan_id,
+ &charvalue);
+ SEVCHK(status, NULL);
+ verify_value(chan_id, DBR_CHAR);
+ }
+ if(sscanf(pvalue,"%d",&longvalue)==1) {
+ /*
+ * long integer ca_put
+ */
+ status = ca_put(
+ DBR_LONG,
+ chan_id,
+ &longvalue);
+ SEVCHK(status, NULL);
+ verify_value(chan_id, DBR_LONG);
+ }
+ if(epicsScanFloat(pvalue, &floatvalue)==1) {
+ /*
+ * single precision float ca_put
+ */
+ status = ca_put(
+ DBR_FLOAT,
+ chan_id,
+ &floatvalue);
+ SEVCHK(status, NULL);
+ verify_value(chan_id, DBR_FLOAT);
+ }
+ if(epicsScanDouble(pvalue, &doublevalue)==1) {
+ /*
+ * double precision float ca_put
+ */
+ status = ca_put(
+ DBR_DOUBLE,
+ chan_id,
+ &doublevalue);
+ SEVCHK(status, NULL);
+ verify_value(chan_id, DBR_DOUBLE);
+ }
skip_rest:
- /*
- * wait for the operation to complete
- * (outstabnding decrements to zero)
- */
- while(ntries){
- ca_pend_event(1.0);
+ /*
+ * wait for the operation to complete
+ * (outstabnding decrements to zero)
+ */
+ while(ntries){
+ ca_pend_event(1.0);
- if(!outstanding){
+ if(!outstanding){
SEVCHK(ca_clear_channel(chan_id),NULL);
- printf("\n\n");
- return 0;
- }
+ printf("\n\n");
+ return 0;
+ }
- ntries--;
- }
+ ntries--;
+ }
SEVCHK(ca_clear_channel(chan_id),NULL);
- return -1;
+ return -1;
}
@@ -305,19 +305,19 @@ skip_rest:
*/
static void verify_value(chid chan_id, chtype type)
{
- int status;
+ int status;
- /*
- * issue a get which calls back `printit'
- * upon completion
- */
- status = ca_array_get_callback(
- type,
- ca_element_count(chan_id),
- chan_id,
- printit,
- NULL);
- SEVCHK(status, NULL);
+ /*
+ * issue a get which calls back `printit'
+ * upon completion
+ */
+ status = ca_array_get_callback(
+ type,
+ ca_element_count(chan_id),
+ chan_id,
+ printit,
+ NULL);
+ SEVCHK(status, NULL);
- outstanding++;
+ outstanding++;
}
diff --git a/modules/ca/src/client/test/ca_test.h b/modules/ca/src/client/test/ca_test.h
index 076f8936a..2b7e3f178 100644
--- a/modules/ca/src/client/test/ca_test.h
+++ b/modules/ca/src/client/test/ca_test.h
@@ -5,11 +5,11 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
- * Author: Jeff Hill
- * Date: 21JAN2000
+ * Author: Jeff Hill
+ * Date: 21JAN2000
*/
#ifdef __cplusplus
diff --git a/modules/ca/src/client/test/ca_test_main.c b/modules/ca/src/client/test/ca_test_main.c
index 85fd7ea19..7d70f67ca 100644
--- a/modules/ca/src/client/test/ca_test_main.c
+++ b/modules/ca/src/client/test/ca_test_main.c
@@ -5,11 +5,11 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
- * Author: Jeff Hill
- * Date: 21JAN2000
+ * Author: Jeff Hill
+ * Date: 21JAN2000
*/
#include
#include
@@ -20,36 +20,36 @@
int main(int argc, char **argv)
{
- /*
- * print error and return if arguments are invalid
- */
- if(argc < 2 || argc > 3){
- printf("usage: %s [optional value to be written]\n", argv[0]);
- printf("the following arguments were received\n");
- while(argc>0) {
- printf("%s\n",argv[0]);
- argv++; argc--;
- }
- return -1;
- }
+ /*
+ * print error and return if arguments are invalid
+ */
+ if(argc < 2 || argc > 3){
+ printf("usage: %s [optional value to be written]\n", argv[0]);
+ printf("the following arguments were received\n");
+ while(argc>0) {
+ printf("%s\n",argv[0]);
+ argv++; argc--;
+ }
+ return -1;
+ }
- /*
- * check for supplied value
- */
- if(argc == 2){
- return ca_test(argv[1], NULL);
- }
- else if(argc == 3){
- char *pt;
+ /*
+ * check for supplied value
+ */
+ if(argc == 2){
+ return ca_test(argv[1], NULL);
+ }
+ else if(argc == 3){
+ char *pt;
- /* strip leading and trailing quotes*/
- if(argv[2][1]=='"') argv[2]++;
- if( (pt=strchr(argv[2],'"')) ) *pt = 0;
- return ca_test(argv[1], argv[2]);
- }
- else{
- return -1;
- }
+ /* strip leading and trailing quotes*/
+ if(argv[2][1]=='"') argv[2]++;
+ if( (pt=strchr(argv[2],'"')) ) *pt = 0;
+ return ca_test(argv[1], argv[2]);
+ }
+ else{
+ return -1;
+ }
}
diff --git a/modules/ca/src/client/test_event.cpp b/modules/ca/src/client/test_event.cpp
index 8b5a8bb54..bcd24c528 100644
--- a/modules/ca/src/client/test_event.cpp
+++ b/modules/ca/src/client/test_event.cpp
@@ -3,9 +3,8 @@
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* EPICS BASE is distributed subject to a Software License Agreement found
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
*
@@ -16,10 +15,9 @@
#include "epicsStdioRedirect.h"
-#define epicsExportSharedSymbols
#include "cadef.h"
-extern "C" void epicsShareAPI ca_test_event ( struct event_handler_args args )
+extern "C" void epicsStdCall ca_test_event ( struct event_handler_args args )
{
chtype nativeType = ca_field_type ( args.chid );
const char * pNativeTypeName = "";
@@ -32,7 +30,7 @@ extern "C" void epicsShareAPI ca_test_event ( struct event_handler_args args )
}
}
- printf ( "ca_test_event() for channel \"%s\" with native type %s\n",
+ printf ( "ca_test_event() for channel \"%s\" with native type %s\n",
ca_name(args.chid), pNativeTypeName );
if ( ! ( CA_M_SUCCESS & args.status ) ) {
@@ -49,7 +47,7 @@ extern "C" void epicsShareAPI ca_test_event ( struct event_handler_args args )
* ca_dump_dbr()
* dump the specified dbr type to stdout
*/
-extern "C" void epicsShareAPI ca_dump_dbr (
+extern "C" void epicsStdCall ca_dump_dbr (
chtype type, unsigned count, const void * pbuffer )
{
unsigned i;
@@ -132,7 +130,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
case DBR_GR_STRING:
case DBR_CTRL_STRING:
{
- struct dbr_sts_string *pvalue
+ struct dbr_sts_string *pvalue
= (struct dbr_sts_string *) pbuffer;
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("\tValue: %s",pvalue->value);
@@ -219,7 +217,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
}
case DBR_TIME_STRING:
{
- struct dbr_time_string *pvalue
+ struct dbr_time_string *pvalue
= (struct dbr_time_string *) pbuffer;
epicsTimeToStrftime(tsString,sizeof(tsString),
@@ -564,12 +562,12 @@ extern "C" void epicsShareAPI ca_dump_dbr (
}
case DBR_STSACK_STRING:
{
- struct dbr_stsack_string *pvalue
- = (struct dbr_stsack_string *)pbuffer;
- printf("%2d %2d",pvalue->status,pvalue->severity);
- printf(" %2d %2d",pvalue->ackt,pvalue->acks);
- printf(" %s",pvalue->value);
- break;
+ struct dbr_stsack_string *pvalue
+ = (struct dbr_stsack_string *)pbuffer;
+ printf("%2d %2d",pvalue->status,pvalue->severity);
+ printf(" %2d %2d",pvalue->ackt,pvalue->acks);
+ printf(" %s",pvalue->value);
+ break;
}
case DBR_CLASS_NAME:
{
@@ -579,7 +577,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
break;
}
default:
- printf (
+ printf (
"unsupported by ca_dbrDump()" );
break;
}
diff --git a/modules/ca/src/client/ucx.h b/modules/ca/src/client/ucx.h
deleted file mode 100644
index c164161a5..000000000
--- a/modules/ca/src/client/ucx.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************\
-* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
-* National Laboratory.
-* Copyright (c) 2002 The Regents of the University of California, as
-* Operator of Los Alamos National Laboratory.
-* EPICS BASE Versions 3.13.7
-* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
-\*************************************************************************/
-/*
- *
- * U C X . H
- * UNIX ioctl structures and defines used for VAX/UCX
- *
- */
-#ifndef _UCX_H_
-# define _UCX_H_
-#ifdef UCX
-
-#define IFF_UP 0x1 /* interface is up */
-#define IFF_BROADCAST 0x2 /* broadcast address valid */
-#define IFF_LOOPBACK 0x8 /* is a loopback net */
-#define IFF_POINTOPOINT 0x10 /* interface is point to point */
-/*
- * Interface request structure used for socket
- * ioctl's. All interface ioctl's must have parameter
- * definitions which begin with ifr_name. The
- * remainder may be interface specific.
- */
-struct ifreq {
-#define IFNAMSIZ 16
- char ifr_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- short ifru_flags;
- int ifru_metric;
- caddr_t ifru_data;
- } ifr_ifru;
-#define ifr_addr ifr_ifru.ifru_addr /* address */
-#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
-#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
-#define ifr_flags ifr_ifru.ifru_flags /* flags */
-#define ifr_metric ifr_ifru.ifru_metric /* metric */
-#define ifr_data ifr_ifru.ifru_data /* for use by interface */
-};
-
-/* Structure used in SIOCGIFCONF request.
- * Used to retrieve interface configuration
- * for machine (useful for programs which
- * must know all networks accessible).
- */
-struct ifconf {
- int ifc_len; /* size of associated buffer */
- union {
- caddr_t ifcu_buf;
- struct ifreq *ifcu_req;
- } ifc_ifcu;
-#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
-#define ifc_req ifc_ifcu.ifcu_req /* array of structures returned */
-};
-
-#ifndef NBBY
-# define NBBY 8
-#endif
-
-
-#ifndef FD_SETSIZE
-# define FD_SETSIZE 256
-#endif
-
-typedef long fd_mask ;
-#define NFDBITS (sizeof (fd_mask) * NBBY ) /* bits per mask */
-#ifndef howmany
-# define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-
-/*
- * Both DEC C and VAX C only allow 32 fd's at once
- */
-typedef int fd_set ;
-
-#define FD_SET(n, p) (*(p) |= (1 << ((n) % NFDBITS)))
-#define FD_CLR(n, p) (*(p) &= ~(1 << ((n) % NFDBITS)))
-#define FD_ISSET(n, p) (*(p) & (1 << ((n) % NFDBITS)))
-#define FD_ZERO(p) memset((char *)(p), 0, sizeof (*(p)))
-
-#include
-#define IO$_RECEIVE (IO$_WRITEVBLK)
-
-struct timezone {
- int tz_minuteswest ; /* minutes west of Greenwich */
- int tz_dsttime ; /* type of dst correction */
-};
-
-#define TWOPOWER32 4294967296.0
-#define TWOPOWER31 2147483648.0
-#define UNIX_EPOCH_AS_MJD 40587.0
-#endif
-#endif
-
diff --git a/modules/ca/src/client/udpiiu.cpp b/modules/ca/src/client/udpiiu.cpp
index fe15f1b69..9d424f1fc 100644
--- a/modules/ca/src/client/udpiiu.cpp
+++ b/modules/ca/src/client/udpiiu.cpp
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -32,7 +32,6 @@
#include "errlog.h"
#include "locationException.h"
-#define epicsExportSharedSymbols
#include "addrList.h"
#include "caerr.h" // for ECA_NOSEARCHADDR
#include "udpiiu.h"
@@ -42,7 +41,7 @@
#include "disconnectGovernorTimer.h"
// UDP protocol dispatch table
-const udpiiu::pProtoStubUDP udpiiu::udpJumpTableCAC [] =
+const udpiiu::pProtoStubUDP udpiiu::udpJumpTableCAC [] =
{
&udpiiu::versionAction,
&udpiiu::badUDPRespAction,
@@ -113,16 +112,16 @@ unsigned getNTimers(double maxPeriod)
//
// udpiiu::udpiiu ()
//
-udpiiu::udpiiu (
+udpiiu::udpiiu (
epicsGuard < epicsMutex > & cacGuard,
- epicsTimerQueueActive & timerQueue,
- epicsMutex & cbMutexIn,
+ epicsTimerQueueActive & timerQueue,
+ epicsMutex & cbMutexIn,
epicsMutex & cacMutexIn,
cacContextNotify & ctxNotifyIn,
cac & cac,
unsigned port,
tsDLList < SearchDest > & searchDestListIn ) :
- recvThread ( *this, ctxNotifyIn, cbMutexIn, "CAC-UDP",
+ recvThread ( *this, ctxNotifyIn, cbMutexIn, "CAC-UDP",
epicsThreadGetStackSize ( epicsThreadStackMedium ),
cac::lowestPriorityLevelAbove (
cac::lowestPriorityLevelAbove (
@@ -159,19 +158,19 @@ udpiiu::udpiiu (
}
for ( unsigned i = 0; i < this->nTimers; i++ ) {
- this->ppSearchTmr[i].reset (
- new searchTimer ( *this, timerQueue, i, cacMutexIn,
- i > this->beaconAnomalyTimerIndex ) );
+ this->ppSearchTmr[i].reset (
+ new searchTimer ( *this, timerQueue, i, cacMutexIn,
+ i > this->beaconAnomalyTimerIndex ) );
}
- this->repeaterPort =
+ this->repeaterPort =
envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT,
static_cast (CA_REPEATER_PORT) );
this->sock = epicsSocketCreate ( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
if ( this->sock == INVALID_SOCKET ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ("CAC: unable to create datagram socket because = \"%s\"\n",
sockErrBuf );
@@ -208,11 +207,11 @@ udpiiu::udpiiu (
#endif
int boolValue = true;
- int status = setsockopt ( this->sock, SOL_SOCKET, SO_BROADCAST,
+ int status = setsockopt ( this->sock, SOL_SOCKET, SO_BROADCAST,
(char *) &boolValue, sizeof ( boolValue ) );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
errlogPrintf ("CAC: IP broadcasting enable failed because = \"%s\"\n",
sockErrBuf );
@@ -244,26 +243,26 @@ udpiiu::udpiiu (
osiSockAddr addr;
memset ( (char *)&addr, 0 , sizeof (addr) );
addr.ia.sin_family = AF_INET;
- addr.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
+ addr.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
addr.ia.sin_port = htons ( PORT_ANY );
status = bind (this->sock, &addr.sa, sizeof (addr) );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy (this->sock);
errlogPrintf ( "CAC: unable to bind to an unconstrained address because = \"%s\"\n",
sockErrBuf );
throwWithLocation ( noSocket () );
}
-
+
{
osiSockAddr tmpAddr;
osiSocklen_t saddr_length = sizeof ( tmpAddr );
status = getsockname ( this->sock, &tmpAddr.sa, &saddr_length );
if ( status < 0 ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
epicsSocketDestroy ( this->sock );
errlogPrintf ( "CAC: getsockname () error was \"%s\"\n", sockErrBuf );
@@ -284,9 +283,9 @@ udpiiu::udpiiu (
ELLLIST dest;
ellInit ( & dest );
configureChannelAccessAddressList ( & dest, this->sock, this->serverPort );
- while ( osiSockAddrNode *
+ while ( osiSockAddrNode *
pNode = reinterpret_cast < osiSockAddrNode * > ( ellGet ( & dest ) ) ) {
- SearchDestUDP & searchDest = *
+ SearchDestUDP & searchDest = *
new SearchDestUDP ( pNode->addr, *this );
_searchDestList.add ( searchDest );
free ( pNode );
@@ -294,14 +293,14 @@ udpiiu::udpiiu (
/* add list of tcp name service addresses */
_searchDestList.add ( searchDestListIn );
-
+
caStartRepeaterIfNotInstalled ( this->repeaterPort );
this->pushVersionMsg ();
// start timers and receive thread
for ( unsigned j =0; j < this->nTimers; j++ ) {
- this->ppSearchTmr[j]->start ( cacGuard );
+ this->ppSearchTmr[j]->start ( cacGuard );
}
this->govTmr.start ();
this->repeaterSubscribeTmr.start ();
@@ -326,19 +325,19 @@ udpiiu::~udpiiu ()
iter++;
delete & curr;
}
-
+
epicsSocketDestroy ( this->sock );
}
-void udpiiu::shutdown (
- epicsGuard < epicsMutex > & cbGuard,
+void udpiiu::shutdown (
+ epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard )
{
// stop all of the timers
this->repeaterSubscribeTmr.shutdown ( cbGuard, guard );
this->govTmr.shutdown ( cbGuard, guard );
for ( unsigned i =0; i < this->nTimers; i++ ) {
- this->ppSearchTmr[i]->shutdown ( cbGuard, guard );
+ this->ppSearchTmr[i]->shutdown ( cbGuard, guard );
}
{
@@ -368,13 +367,13 @@ void udpiiu::shutdown (
}
}
-udpRecvThread::udpRecvThread (
+udpRecvThread::udpRecvThread (
udpiiu & iiuIn, cacContextNotify & ctxNotifyIn, epicsMutex & cbMutexIn,
const char * pName, unsigned stackSize, unsigned priority ) :
- iiu ( iiuIn ), cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
+ iiu ( iiuIn ), cbMutex ( cbMutexIn ), ctxNotify ( ctxNotifyIn ),
thread ( *this, pName, stackSize, priority ) {}
-udpRecvThread::~udpRecvThread ()
+udpRecvThread::~udpRecvThread ()
{
}
@@ -395,18 +394,18 @@ void udpRecvThread::show ( unsigned /* level */ ) const
void udpRecvThread::run ()
{
epicsThreadPrivateSet ( caClientCallbackThreadId, &this->iiu );
-
- if ( this->iiu._searchDestList.count () == 0 ) {
+
+ if ( this->iiu._searchDestList.count () == 0 ) {
callbackManager mgr ( this->ctxNotify, this->cbMutex );
epicsGuard < epicsMutex > guard ( this->iiu.cacMutex );
- genLocalExcep ( mgr.cbGuard, guard,
+ genLocalExcep ( mgr.cbGuard, guard,
this->iiu.cacRef, ECA_NOSEARCHADDR, NULL );
}
do {
osiSockAddr src;
osiSocklen_t src_size = sizeof ( src );
- int status = recvfrom ( this->iiu.sock,
+ int status = recvfrom ( this->iiu.sock,
this->iiu.recvBuf, sizeof ( this->iiu.recvBuf ), 0,
& src.sa, & src_size );
@@ -414,7 +413,7 @@ void udpRecvThread::run ()
if ( status < 0 ) {
int errnoCpy = SOCKERRNO;
- if (
+ if (
errnoCpy != SOCK_EINTR &&
errnoCpy != SOCK_SHUTDOWN &&
errnoCpy != SOCK_ENOTSOCK &&
@@ -426,30 +425,30 @@ void udpRecvThread::run ()
errnoCpy != SOCK_ECONNRESET ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- errlogPrintf ( "CAC: UDP recv error was \"%s\"\n",
+ errlogPrintf ( "CAC: UDP recv error was \"%s\"\n",
sockErrBuf );
}
}
}
else if ( status > 0 ) {
- this->iiu.postMsg ( src, this->iiu.recvBuf,
- (arrayElementCount) status, epicsTime::getMonotonic() );
+ this->iiu.postMsg ( src, this->iiu.recvBuf,
+ (arrayElementCount) status, epicsTime::getCurrent() );
}
} while ( ! this->iiu.shutdownCmd );
}
/* for sunpro compiler */
-udpiiu::M_repeaterTimerNotify::~M_repeaterTimerNotify ()
+udpiiu::M_repeaterTimerNotify::~M_repeaterTimerNotify ()
{
}
/*
* udpiiu::M_repeaterTimerNotify::repeaterRegistrationMessage ()
*
- * register with the repeater
+ * register with the repeater
*/
void udpiiu :: M_repeaterTimerNotify :: repeaterRegistrationMessage ( unsigned attemptNumber )
{
@@ -460,9 +459,9 @@ void udpiiu :: M_repeaterTimerNotify :: repeaterRegistrationMessage ( unsigned a
/*
* caRepeaterRegistrationMessage ()
*
- * register with the repeater
+ * register with the repeater
*/
-void epicsShareAPI caRepeaterRegistrationMessage (
+void epicsStdCall caRepeaterRegistrationMessage (
SOCKET sock, unsigned repeaterPort, unsigned attemptNumber )
{
osiSockAddr saddr;
@@ -470,19 +469,19 @@ void epicsShareAPI caRepeaterRegistrationMessage (
int status;
int len;
- assert ( repeaterPort <= USHRT_MAX );
- unsigned short port = static_cast ( repeaterPort );
+ assert ( repeaterPort <= USHRT_MAX );
+ unsigned short port = static_cast ( repeaterPort );
/*
- * In 3.13 beta 11 and before the CA repeater calls local_addr()
- * to determine a local address and does not allow registration
- * messages originating from other addresses. In these
+ * In 3.13 beta 11 and before the CA repeater calls local_addr()
+ * to determine a local address and does not allow registration
+ * messages originating from other addresses. In these
* releases local_addr() returned the address of the first enabled
* interface found, and this address may or may not have been the loop
* back address. Starting with 3.13 beta 12 local_addr() was
- * changed to always return the address of the first enabled
+ * changed to always return the address of the first enabled
* non-loopback interface because a valid non-loopback local
- * address is required in the beacon messages. Therefore, to
+ * address is required in the beacon messages. Therefore, to
* guarantee compatibility with past versions of the repeater
* we alternate between the address returned by local_addr()
* and the loopback address here.
@@ -527,9 +526,9 @@ void epicsShareAPI caRepeaterRegistrationMessage (
*/
# if defined ( DOES_NOT_ACCEPT_ZERO_LENGTH_UDP )
len = sizeof (msg);
-# else
+# else
len = 0;
-# endif
+# endif
status = sendto ( sock, (char *) &msg, len, 0,
&saddr.sa, sizeof ( saddr ) );
@@ -543,13 +542,13 @@ void epicsShareAPI caRepeaterRegistrationMessage (
* Linux returns SOCK_ECONNREFUSED
* Windows 2000 returns SOCK_ECONNRESET
*/
- if ( errnoCpy != SOCK_EINTR &&
- errnoCpy != SOCK_ECONNREFUSED &&
+ if ( errnoCpy != SOCK_EINTR &&
+ errnoCpy != SOCK_ECONNREFUSED &&
errnoCpy != SOCK_ECONNRESET ) {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
- fprintf ( stderr, "error sending registration message to CA repeater daemon was \"%s\"\n",
+ fprintf ( stderr, "error sending registration message to CA repeater daemon was \"%s\"\n",
sockErrBuf );
}
}
@@ -565,7 +564,7 @@ void epicsShareAPI caRepeaterRegistrationMessage (
* however the repeater detects this, prints a message,
* and lets the other task start the repeater.
*
- * QUESTION: is there a better way to test for a port in use?
+ * QUESTION: is there a better way to test for a port in use?
* ANSWER: none that I can find.
*
* Problems with checking for the repeater installed
@@ -579,13 +578,13 @@ void epicsShareAPI caRepeaterRegistrationMessage (
*
* 072392 - problem solved by using SO_REUSEADDR
*/
-void epicsShareAPI caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
+void epicsStdCall caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
{
bool installed = false;
int status;
SOCKET tmpSock;
union {
- struct sockaddr_in ia;
+ struct sockaddr_in ia;
struct sockaddr sa;
} bd;
@@ -599,8 +598,8 @@ void epicsShareAPI caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
ca_uint16_t port = static_cast < ca_uint16_t > ( repeaterPort );
memset ( (char *) &bd, 0, sizeof ( bd ) );
bd.ia.sin_family = AF_INET;
- bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
- bd.ia.sin_port = htons ( port );
+ bd.ia.sin_addr.s_addr = htonl ( INADDR_ANY );
+ bd.ia.sin_port = htons ( port );
status = bind ( tmpSock, &bd.sa, sizeof ( bd ) );
if ( status < 0 ) {
if ( SOCKERRNO == SOCK_EADDRINUSE ) {
@@ -621,14 +620,14 @@ void epicsShareAPI caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
epicsSocketDestroy ( tmpSock );
if ( ! installed ) {
-
- /*
- * This is not called if the repeater is known to be
- * already running. (in the event of a race condition
- * the 2nd repeater exits when unable to attach to the
- * repeater's port)
- */
- osiSpawnDetachedProcessReturn osptr =
+
+ /*
+ * This is not called if the repeater is known to be
+ * already running. (in the event of a race condition
+ * the 2nd repeater exits when unable to attach to the
+ * repeater's port)
+ */
+ osiSpawnDetachedProcessReturn osptr =
osiSpawnDetachedProcess ( "CA Repeater", "caRepeater" );
if ( osptr == osiSpawnDetachedProcessNoSupport ) {
epicsThreadId tid;
@@ -645,19 +644,19 @@ void epicsShareAPI caStartRepeaterIfNotInstalled ( unsigned repeaterPort )
}
}
-bool udpiiu::badUDPRespAction (
+bool udpiiu::badUDPRespAction (
const caHdr &msg, const osiSockAddr &netAddr, const epicsTime ¤tTime )
{
char buf[64];
sockAddrToDottedIP ( &netAddr.sa, buf, sizeof ( buf ) );
char date[64];
currentTime.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S");
- errlogPrintf ( "CAC: Undecipherable ( bad msg code %u ) UDP message from %s at %s\n",
+ errlogPrintf ( "CAC: Undecipherable ( bad msg code %u ) UDP message from %s at %s\n",
msg.m_cmmd, buf, date );
return false;
}
-bool udpiiu::versionAction (
+bool udpiiu::versionAction (
const caHdr & hdr, const osiSockAddr &, const epicsTime & /* currentTime */ )
{
epicsGuard < epicsMutex > guard ( this->cacMutex );
@@ -671,12 +670,12 @@ bool udpiiu::versionAction (
return true;
}
-bool udpiiu :: searchRespAction (
- const caHdr & msg, const osiSockAddr & addr,
+bool udpiiu :: searchRespAction (
+ const caHdr & msg, const osiSockAddr & addr,
const epicsTime & currentTime )
{
/*
- * we dont currently know what to do with channel's
+ * we dont currently know what to do with channel's
* found to be at non-IP type addresses
*/
if ( addr.sa.sa_family != AF_INET ) {
@@ -694,7 +693,7 @@ bool udpiiu :: searchRespAction (
* care is taken here not to break gcc 3.2 aggressive alias
* analysis rules
*/
- const ca_uint8_t * pPayLoad =
+ const ca_uint8_t * pPayLoad =
reinterpret_cast < const ca_uint8_t *> ( & msg + 1 );
unsigned byte0 = pPayLoad[0];
unsigned byte1 = pPayLoad[1];
@@ -729,21 +728,21 @@ bool udpiiu :: searchRespAction (
}
if ( CA_V42 ( minorVersion ) ) {
- cacRef.transferChanToVirtCircuit
- ( msg.m_available, msg.m_cid, 0xffff,
+ cacRef.transferChanToVirtCircuit
+ ( msg.m_available, msg.m_cid, 0xffff,
0, minorVersion, serverAddr, currentTime );
}
else {
- cacRef.transferChanToVirtCircuit
- ( msg.m_available, msg.m_cid, msg.m_dataType,
+ cacRef.transferChanToVirtCircuit
+ ( msg.m_available, msg.m_cid, msg.m_dataType,
msg.m_count, minorVersion, serverAddr, currentTime );
}
return true;
}
-bool udpiiu::beaconAction (
- const caHdr & msg,
+bool udpiiu::beaconAction (
+ const caHdr & msg,
const osiSockAddr & net_addr, const epicsTime & currentTime )
{
struct sockaddr_in ina;
@@ -754,9 +753,9 @@ bool udpiiu::beaconAction (
return false;
}
- /*
+ /*
* this allows a fan-out server to potentially
- * insert the true address of the CA server
+ * insert the true address of the CA server
*
* old servers:
* 1) set this field to one of the ip addresses of the host _or_
@@ -783,29 +782,29 @@ bool udpiiu::beaconAction (
unsigned protocolRevision = msg.m_dataType;
ca_uint32_t beaconNumber = msg.m_cid;
- this->cacRef.beaconNotify ( ina, currentTime,
+ this->cacRef.beaconNotify ( ina, currentTime,
beaconNumber, protocolRevision );
return true;
}
-bool udpiiu::repeaterAckAction (
- const caHdr &,
+bool udpiiu::repeaterAckAction (
+ const caHdr &,
const osiSockAddr &, const epicsTime &)
{
this->repeaterSubscribeTmr.confirmNotify ();
return true;
}
-bool udpiiu::notHereRespAction (
- const caHdr &,
+bool udpiiu::notHereRespAction (
+ const caHdr &,
const osiSockAddr &, const epicsTime & )
{
return true;
}
-bool udpiiu::exceptionRespAction (
- const caHdr &msg,
+bool udpiiu::exceptionRespAction (
+ const caHdr &msg,
const osiSockAddr & net_addr, const epicsTime & currentTime )
{
const caHdr &reqMsg = * ( &msg + 1 );
@@ -815,22 +814,22 @@ bool udpiiu::exceptionRespAction (
currentTime.strftime ( date, sizeof ( date ), "%a %b %d %Y %H:%M:%S");
if ( msg.m_postsize > sizeof ( caHdr ) ){
- errlogPrintf (
- "error condition \"%s\" detected by %s with context \"%s\" at %s\n",
- ca_message ( msg.m_available ),
+ errlogPrintf (
+ "error condition \"%s\" detected by %s with context \"%s\" at %s\n",
+ ca_message ( msg.m_available ),
name, reinterpret_cast ( &reqMsg + 1 ), date );
}
else{
- errlogPrintf (
- "error condition \"%s\" detected by %s at %s\n",
+ errlogPrintf (
+ "error condition \"%s\" detected by %s at %s\n",
ca_message ( msg.m_available ), name, date );
}
return true;
}
-void udpiiu::postMsg (
- const osiSockAddr & net_addr,
+void udpiiu::postMsg (
+ const osiSockAddr & net_addr,
char * pInBuf, arrayElementCount blockSize,
const epicsTime & currentTime )
{
@@ -845,16 +844,16 @@ void udpiiu::postMsg (
if ( blockSize < sizeof ( *pCurMsg ) ) {
char buf[64];
sockAddrToDottedIP ( &net_addr.sa, buf, sizeof ( buf ) );
- errlogPrintf (
- "%s: Undecipherable (too small) UDP msg from %s ignored\n",
+ errlogPrintf (
+ "%s: Undecipherable (too small) UDP msg from %s ignored\n",
__FILE__, buf );
return;
}
pCurMsg = reinterpret_cast < caHdr * > ( pInBuf );
- /*
- * fix endian of bytes
+ /*
+ * fix endian of bytes
*/
pCurMsg->m_postsize = AlignedWireRef < epicsUInt16 > ( pCurMsg->m_postsize );
pCurMsg->m_cmmd = AlignedWireRef < epicsUInt16 > ( pCurMsg->m_cmmd );
@@ -882,8 +881,8 @@ void udpiiu::postMsg (
if ( size > blockSize ) {
char buf[64];
sockAddrToDottedIP ( &net_addr.sa, buf, sizeof ( buf ) );
- errlogPrintf (
- "%s: Undecipherable (payload too small) UDP msg from %s ignored\n",
+ errlogPrintf (
+ "%s: Undecipherable (payload too small) UDP msg from %s ignored\n",
__FILE__, buf );
return;
}
@@ -920,14 +919,14 @@ bool udpiiu::pushVersionMsg ()
caHdr msg;
AlignedWireRef < epicsUInt16 > ( msg.m_cmmd ) = CA_PROTO_VERSION;
AlignedWireRef < epicsUInt32 > ( msg.m_available ) = 0;
- AlignedWireRef < epicsUInt16 > ( msg.m_dataType ) = sequenceNoIsValid;
+ AlignedWireRef < epicsUInt16 > ( msg.m_dataType ) = sequenceNoIsValid;
AlignedWireRef < epicsUInt16 > ( msg.m_count ) = CA_MINOR_PROTOCOL_REVISION;
AlignedWireRef < epicsUInt32 > ( msg.m_cid ) = this->sequenceNumber; // sequence number
return this->pushDatagramMsg ( guard, msg, 0, 0 );
}
-bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
+bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
const caHdr & msg, const void * pExt, ca_uint16_t extsize )
{
guard.assertIdenticalMutex ( this->cacMutex );
@@ -946,7 +945,7 @@ bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
caHdr * pbufmsg = ( caHdr * ) &this->xmitBuf[this->nBytesInXmitBuf];
*pbufmsg = msg;
- if ( extsize ) {
+ if ( extsize && pExt ) {
memcpy ( pbufmsg + 1, pExt, extsize );
if ( extsize != alignedExtSize ) {
char *pDest = (char *) ( pbufmsg + 1 );
@@ -959,13 +958,13 @@ bool udpiiu::pushDatagramMsg ( epicsGuard < epicsMutex > & guard,
return true;
}
-udpiiu :: SearchDestUDP :: SearchDestUDP (
+udpiiu :: SearchDestUDP :: SearchDestUDP (
const osiSockAddr & destAddr, udpiiu & udpiiuIn ) :
_lastError (0u), _destAddr ( destAddr ), _udpiiu ( udpiiuIn )
{
}
-void udpiiu :: SearchDestUDP :: searchRequest (
+void udpiiu :: SearchDestUDP :: searchRequest (
epicsGuard < epicsMutex > & guard, const char * pBuf, size_t bufSize )
{
guard.assertIdenticalMutex ( _udpiiu.cacMutex );
@@ -973,7 +972,7 @@ void udpiiu :: SearchDestUDP :: searchRequest (
int bufSizeAsInt = static_cast < int > ( bufSize );
while ( true ) {
// This const_cast is needed for vxWorks:
- int status = sendto ( _udpiiu.sock, const_cast(pBuf), bufSizeAsInt, 0,
+ int status = sendto ( _udpiiu.sock, const_cast(pBuf), bufSizeAsInt, 0,
& _destAddr.sa, sizeof ( _destAddr.sa ) );
if ( status == bufSizeAsInt ) {
if ( _lastError ) {
@@ -1013,7 +1012,7 @@ void udpiiu :: SearchDestUDP :: searchRequest (
break;
} else {
char sockErrBuf[64];
- epicsSocketConvertErrnoToString (
+ epicsSocketConvertErrnoToString (
sockErrBuf, sizeof ( sockErrBuf ) );
char buf[64];
sockAddrToDottedIP ( &_destAddr.sa, buf, sizeof ( buf ) );
@@ -1027,8 +1026,8 @@ void udpiiu :: SearchDestUDP :: searchRequest (
}
}
}
-
-void udpiiu :: SearchDestUDP :: show (
+
+void udpiiu :: SearchDestUDP :: show (
epicsGuard < epicsMutex > & guard, unsigned level ) const
{
guard.assertIdenticalMutex ( _udpiiu.cacMutex );
@@ -1037,17 +1036,17 @@ void udpiiu :: SearchDestUDP :: show (
:: printf ( "UDP Search destination \"%s\"\n", buf );
}
-udpiiu :: SearchRespCallback :: SearchRespCallback ( udpiiu & udpiiuIn ) :
+udpiiu :: SearchRespCallback :: SearchRespCallback ( udpiiu & udpiiuIn ) :
_udpiiu ( udpiiuIn )
{
}
-
+
void udpiiu :: SearchRespCallback :: notify (
const caHdr & msg, const void * pPayloadUntyped,
const osiSockAddr & addr, const epicsTime & currentTime )
-{
+{
/*
- * we dont currently know what to do with channel's
+ * we dont currently know what to do with channel's
* found to be at non-IP type addresses
*/
if ( addr.sa.sa_family != AF_INET ) {
@@ -1099,25 +1098,25 @@ void udpiiu :: SearchRespCallback :: notify (
}
if ( CA_V42 ( minorVersion ) ) {
- _udpiiu.cacRef.transferChanToVirtCircuit
- ( msg.m_available, msg.m_cid, 0xffff,
+ _udpiiu.cacRef.transferChanToVirtCircuit
+ ( msg.m_available, msg.m_cid, 0xffff,
0, minorVersion, serverAddr, currentTime );
}
else {
- _udpiiu.cacRef.transferChanToVirtCircuit
- ( msg.m_available, msg.m_cid, msg.m_dataType,
+ _udpiiu.cacRef.transferChanToVirtCircuit
+ ( msg.m_available, msg.m_cid, msg.m_dataType,
msg.m_count, minorVersion, serverAddr, currentTime );
}
}
-void udpiiu :: SearchRespCallback :: show (
+void udpiiu :: SearchRespCallback :: show (
epicsGuard < epicsMutex > & guard, unsigned level ) const
{
guard.assertIdenticalMutex ( _udpiiu.cacMutex );
::printf ( "udpiiu :: SearchRespCallback\n" );
}
-bool udpiiu :: datagramFlush (
+bool udpiiu :: datagramFlush (
epicsGuard < epicsMutex > & guard, const epicsTime & currentTime )
{
guard.assertIdenticalMutex ( cacMutex );
@@ -1149,10 +1148,10 @@ void udpiiu :: show ( unsigned level ) const
if ( level > 1u ) {
::printf ("\trepeater port %u\n", this->repeaterPort );
::printf ("\tdefault server port %u\n", this->serverPort );
- ::printf ( "Search Destination List with %u items\n",
+ ::printf ( "Search Destination List with %u items\n",
_searchDestList.count () );
if ( level > 2u ) {
- tsDLIterConst < SearchDest > iter (
+ tsDLIterConst < SearchDest > iter (
_searchDestList.firstIter () );
while ( iter.valid () )
{
@@ -1193,54 +1192,54 @@ bool udpiiu::wakeupMsg ()
addr.ia.sin_port = htons ( this->localPort );
// send a wakeup msg so the UDP recv thread will exit
- int status = sendto ( this->sock, reinterpret_cast < char * > ( &msg ),
+ int status = sendto ( this->sock, reinterpret_cast < char * > ( &msg ),
sizeof (msg), 0, &addr.sa, sizeof ( addr.sa ) );
return status == sizeof (msg);
}
-void udpiiu::beaconAnomalyNotify (
- epicsGuard < epicsMutex > & cacGuard )
+void udpiiu::beaconAnomalyNotify (
+ epicsGuard < epicsMutex > & cacGuard )
{
- for ( unsigned i = this->beaconAnomalyTimerIndex+1u;
+ for ( unsigned i = this->beaconAnomalyTimerIndex+1u;
i < this->nTimers; i++ ) {
- this->ppSearchTmr[i]->moveChannels ( cacGuard,
+ this->ppSearchTmr[i]->moveChannels ( cacGuard,
*this->ppSearchTmr[this->beaconAnomalyTimerIndex] );
}
}
-void udpiiu::uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void udpiiu::uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
const epicsTime & currentTime )
{
- channelNode::channelState chanState =
+ channelNode::channelState chanState =
chan.channelNode::listMember;
if ( chanState == channelNode::cs_disconnGov ) {
this->govTmr.uninstallChan ( guard, chan );
}
else {
- this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
- uninstallChanDueToSuccessfulSearchResponse (
- guard, chan, this->lastReceivedSeqNo,
+ this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
+ uninstallChanDueToSuccessfulSearchResponse (
+ guard, chan, this->lastReceivedSeqNo,
this->lastReceivedSeqNoIsValid, currentTime );
}
}
-void udpiiu::uninstallChan (
+void udpiiu::uninstallChan (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
- channelNode::channelState chanState =
+ channelNode::channelState chanState =
chan.channelNode::listMember;
if ( chanState == channelNode::cs_disconnGov ) {
this->govTmr.uninstallChan ( guard, chan );
}
else {
- this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
+ this->ppSearchTmr[ chan.getSearchTimerIndex ( guard ) ]->
uninstallChan ( guard, chan );
}
}
bool udpiiu::searchMsg (
- epicsGuard < epicsMutex > & guard, ca_uint32_t id,
+ epicsGuard < epicsMutex > & guard, ca_uint32_t id,
const char * pName, unsigned nameLength )
{
caHdr msg;
@@ -1249,25 +1248,25 @@ bool udpiiu::searchMsg (
AlignedWireRef < epicsUInt16 > ( msg.m_dataType ) = DONTREPLY;
AlignedWireRef < epicsUInt16 > ( msg.m_count ) = CA_MINOR_PROTOCOL_REVISION;
AlignedWireRef < epicsUInt32 > ( msg.m_cid ) = id;
- return this->pushDatagramMsg (
+ return this->pushDatagramMsg (
guard, msg, pName, (ca_uint16_t) nameLength );
}
-void udpiiu::installNewChannel (
+void udpiiu::installNewChannel (
epicsGuard < epicsMutex > & guard, nciu & chan, netiiu * & piiu )
{
piiu = this;
this->ppSearchTmr[0]->installChannel ( guard, chan );
}
-void udpiiu::installDisconnectedChannel (
+void udpiiu::installDisconnectedChannel (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
chan.setServerAddressUnknown ( *this, guard );
this->govTmr.installChan ( guard, chan );
}
-void udpiiu::noSearchRespNotify (
+void udpiiu::noSearchRespNotify (
epicsGuard < epicsMutex > & guard, nciu & chan, unsigned index )
{
const unsigned nTimersMinusOne = this->nTimers - 1;
@@ -1280,32 +1279,32 @@ void udpiiu::noSearchRespNotify (
this->ppSearchTmr[index]->installChannel ( guard, chan );
}
-void udpiiu::boostChannel (
+void udpiiu::boostChannel (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
this->ppSearchTmr[this->beaconAnomalyTimerIndex]->
installChannel ( guard, chan );
}
-void udpiiu::govExpireNotify (
+void udpiiu::govExpireNotify (
epicsGuard < epicsMutex > & guard, nciu & chan )
{
this->ppSearchTmr[0]->installChannel ( guard, chan );
}
-int udpiiu :: M_repeaterTimerNotify :: printFormated (
- epicsGuard < epicsMutex > & cbGuard,
+int udpiiu :: M_repeaterTimerNotify :: printFormated (
+ epicsGuard < epicsMutex > & cbGuard,
const char * pformat, ... )
{
va_list theArgs;
int status;
va_start ( theArgs, pformat );
-
+
status = m_udpiiu.cacRef.varArgsPrintFormated ( cbGuard, pformat, theArgs );
-
+
va_end ( theArgs );
-
+
return status;
}
@@ -1332,7 +1331,7 @@ double udpiiu::getRTTE ( epicsGuard < epicsMutex > & guard ) const
return this->rtteMean + 4 * this->rtteMeanDev;
}
-unsigned udpiiu::getHostName (
+unsigned udpiiu::getHostName (
epicsGuard < epicsMutex > & cacGuard,
char *pBuf, unsigned bufLength ) const throw ()
{
@@ -1357,71 +1356,71 @@ bool udpiiu::ca_v41_ok (
return netiiu::ca_v41_ok ( cacGuard );
}
-void udpiiu::writeRequest (
- epicsGuard < epicsMutex > & guard,
- nciu & chan, unsigned type,
+void udpiiu::writeRequest (
+ epicsGuard < epicsMutex > & guard,
+ nciu & chan, unsigned type,
arrayElementCount nElem, const void * pValue )
{
netiiu::writeRequest ( guard, chan, type, nElem, pValue );
}
-void udpiiu::writeNotifyRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
- netWriteNotifyIO & io, unsigned type,
+void udpiiu::writeNotifyRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
+ netWriteNotifyIO & io, unsigned type,
arrayElementCount nElem, const void *pValue )
{
netiiu::writeNotifyRequest ( guard, chan, io, type, nElem, pValue );
}
-void udpiiu::readNotifyRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void udpiiu::readNotifyRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
netReadNotifyIO & io, unsigned type, arrayElementCount nElem )
{
netiiu::readNotifyRequest ( guard, chan, io, type, nElem );
}
-void udpiiu::clearChannelRequest (
- epicsGuard < epicsMutex > & guard,
+void udpiiu::clearChannelRequest (
+ epicsGuard < epicsMutex > & guard,
ca_uint32_t sid, ca_uint32_t cid )
{
netiiu::clearChannelRequest ( guard, sid, cid );
}
-void udpiiu::subscriptionRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void udpiiu::subscriptionRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
netSubscription & subscr )
{
netiiu::subscriptionRequest ( guard, chan, subscr );
}
-void udpiiu::subscriptionUpdateRequest (
- epicsGuard < epicsMutex > & guard, nciu & chan,
+void udpiiu::subscriptionUpdateRequest (
+ epicsGuard < epicsMutex > & guard, nciu & chan,
netSubscription & subscr )
{
netiiu::subscriptionUpdateRequest (
guard, chan, subscr );
}
-void udpiiu::subscriptionCancelRequest (
- epicsGuard < epicsMutex > & guard,
+void udpiiu::subscriptionCancelRequest (
+ epicsGuard < epicsMutex > & guard,
nciu & chan, netSubscription & subscr )
{
netiiu::subscriptionCancelRequest ( guard, chan, subscr );
}
-void udpiiu::flushRequest (
+void udpiiu::flushRequest (
epicsGuard < epicsMutex > & guard )
{
netiiu::flushRequest ( guard );
}
-unsigned udpiiu::requestMessageBytesPending (
+unsigned udpiiu::requestMessageBytesPending (
epicsGuard < epicsMutex > & guard )
{
return netiiu::requestMessageBytesPending ( guard );
}
-void udpiiu::flush (
+void udpiiu::flush (
epicsGuard < epicsMutex > & guard )
{
netiiu::flush ( guard );
diff --git a/modules/ca/src/client/udpiiu.h b/modules/ca/src/client/udpiiu.h
index fdf348296..2ab79dc95 100644
--- a/modules/ca/src/client/udpiiu.h
+++ b/modules/ca/src/client/udpiiu.h
@@ -4,44 +4,35 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef udpiiuh
-#define udpiiuh
+#ifndef INC_udpiiu_H
+#define INC_udpiiu_H
#include
-#ifdef epicsExportSharedSymbols
-# define udpiiuh_accessh_epicsExportSharedSymbols
-# undef epicsExportSharedSymbols
-#endif
-
#include "osiSock.h"
#include "epicsThread.h"
#include "epicsTime.h"
#include "tsDLList.h"
-#ifdef udpiiuh_accessh_epicsExportSharedSymbols
-# define epicsExportSharedSymbols
-# include "shareLib.h"
-#endif
-
+#include "libCaAPI.h"
#include "netiiu.h"
#include "searchTimer.h"
#include "disconnectGovernorTimer.h"
@@ -50,21 +41,21 @@
extern "C" void cacRecvThreadUDP ( void *pParam );
-epicsShareFunc void epicsShareAPI caStartRepeaterIfNotInstalled (
+LIBCA_API void epicsStdCall caStartRepeaterIfNotInstalled (
unsigned repeaterPort );
-epicsShareFunc void epicsShareAPI caRepeaterRegistrationMessage (
+LIBCA_API void epicsStdCall caRepeaterRegistrationMessage (
SOCKET sock, unsigned repeaterPort, unsigned attemptNumber );
-extern "C" epicsShareFunc void caRepeaterThread (
+extern "C" LIBCA_API void caRepeaterThread (
void * pDummy );
-epicsShareFunc void ca_repeater ( void );
+LIBCA_API void ca_repeater ( void );
class cac;
class cacContextNotify;
-class udpRecvThread :
+class udpRecvThread :
private epicsThreadRunable {
public:
- udpRecvThread (
+ udpRecvThread (
class udpiiu & iiuIn, cacContextNotify &, epicsMutex &,
const char * pName, unsigned stackSize, unsigned priority );
virtual ~udpRecvThread ();
@@ -85,31 +76,31 @@ static const double maxSearchPeriodDefault = 5.0 * 60.0; // seconds
static const double maxSearchPeriodLowerLimit = 60.0; // seconds
static const double beaconAnomalySearchPeriod = 5.0; // seconds
-class udpiiu :
- private netiiu,
- private searchTimerNotify,
+class udpiiu :
+ private netiiu,
+ private searchTimerNotify,
private disconnectGovernorNotify {
public:
- udpiiu (
+ udpiiu (
epicsGuard < epicsMutex > & cacGuard,
- class epicsTimerQueueActive &,
- epicsMutex & callbackControl,
- epicsMutex & mutualExclusion,
+ class epicsTimerQueueActive &,
+ epicsMutex & callbackControl,
+ epicsMutex & mutualExclusion,
cacContextNotify &,
class cac &,
unsigned port,
tsDLList < SearchDest > & );
virtual ~udpiiu ();
- void installNewChannel (
+ void installNewChannel (
epicsGuard < epicsMutex > &, nciu &, netiiu * & );
- void installDisconnectedChannel (
+ void installDisconnectedChannel (
epicsGuard < epicsMutex > &, nciu & );
- void beaconAnomalyNotify (
+ void beaconAnomalyNotify (
epicsGuard < epicsMutex > & guard );
- void shutdown ( epicsGuard < epicsMutex > & cbGuard,
+ void shutdown ( epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
void show ( unsigned level ) const;
-
+
// exceptions
class noSocket {};
@@ -118,43 +109,43 @@ private:
public SearchDest {
public:
SearchDestUDP ( const osiSockAddr &, udpiiu & );
- void searchRequest (
+ void searchRequest (
epicsGuard < epicsMutex > &, const char * pBuf, size_t bufLen );
- void show (
+ void show (
epicsGuard < epicsMutex > &, unsigned level ) const;
private:
int _lastError;
osiSockAddr _destAddr;
udpiiu & _udpiiu;
};
- class SearchRespCallback :
+ class SearchRespCallback :
public SearchDest :: Callback {
public:
SearchRespCallback ( udpiiu & );
void notify (
const caHdr &, const void * pPayload,
const osiSockAddr &, const epicsTime & );
- void show (
+ void show (
epicsGuard < epicsMutex > &, unsigned level ) const;
private:
udpiiu & _udpiiu;
};
- class M_repeaterTimerNotify :
+ class M_repeaterTimerNotify :
public repeaterTimerNotify {
public:
- M_repeaterTimerNotify ( udpiiu & iiu ) :
+ M_repeaterTimerNotify ( udpiiu & iiu ) :
m_udpiiu ( iiu ) {}
~M_repeaterTimerNotify (); /* for sunpro compiler */
// repeaterTimerNotify
- void repeaterRegistrationMessage (
+ void repeaterRegistrationMessage (
unsigned attemptNumber );
- int printFormated (
- epicsGuard < epicsMutex > & callbackControl,
+ int printFormated (
+ epicsGuard < epicsMutex > & callbackControl,
const char * pformat, ... );
private:
udpiiu & m_udpiiu;
};
- char xmitBuf [MAX_UDP_SEND];
+ char xmitBuf [MAX_UDP_SEND];
char recvBuf [MAX_UDP_RECV];
udpRecvThread recvThread;
M_repeaterTimerNotify m_repeaterTimerNotify;
@@ -191,120 +182,120 @@ private:
bool wakeupMsg ();
- void postMsg (
- const osiSockAddr & net_addr,
+ void postMsg (
+ const osiSockAddr & net_addr,
char *pInBuf, arrayElementCount blockSize,
const epicsTime ¤Time );
- bool pushDatagramMsg ( epicsGuard < epicsMutex > &,
- const caHdr & hdr, const void * pExt,
+ bool pushDatagramMsg ( epicsGuard < epicsMutex > &,
+ const caHdr & hdr, const void * pExt,
ca_uint16_t extsize);
- typedef bool ( udpiiu::*pProtoStubUDP ) (
- const caHdr &,
+ typedef bool ( udpiiu::*pProtoStubUDP ) (
+ const caHdr &,
const osiSockAddr &, const epicsTime & );
// UDP protocol dispatch table
static const pProtoStubUDP udpJumpTableCAC[];
// UDP protocol stubs
- bool versionAction (
- const caHdr &,
+ bool versionAction (
+ const caHdr &,
const osiSockAddr &, const epicsTime & );
- bool badUDPRespAction (
- const caHdr &msg,
+ bool badUDPRespAction (
+ const caHdr &msg,
const osiSockAddr &netAddr, const epicsTime & );
- bool searchRespAction (
- const caHdr &msg,
+ bool searchRespAction (
+ const caHdr &msg,
const osiSockAddr &net_addr, const epicsTime & );
- bool exceptionRespAction (
- const caHdr &msg,
+ bool exceptionRespAction (
+ const caHdr &msg,
const osiSockAddr &net_addr, const epicsTime & );
- bool beaconAction (
- const caHdr &msg,
+ bool beaconAction (
+ const caHdr &msg,
const osiSockAddr &net_addr, const epicsTime & );
- bool notHereRespAction (
- const caHdr &msg,
+ bool notHereRespAction (
+ const caHdr &msg,
const osiSockAddr &net_addr, const epicsTime & );
- bool repeaterAckAction (
- const caHdr &msg,
+ bool repeaterAckAction (
+ const caHdr &msg,
const osiSockAddr &net_addr, const epicsTime & );
// netiiu stubs
- unsigned getHostName (
- epicsGuard < epicsMutex > &, char * pBuf,
+ unsigned getHostName (
+ epicsGuard < epicsMutex > &, char * pBuf,
unsigned bufLength ) const throw ();
const char * pHostName (
- epicsGuard < epicsMutex > & ) const throw ();
+ epicsGuard < epicsMutex > & ) const throw ();
bool ca_v41_ok (
epicsGuard < epicsMutex > & ) const;
bool ca_v42_ok (
epicsGuard < epicsMutex > & ) const;
- unsigned requestMessageBytesPending (
+ unsigned requestMessageBytesPending (
epicsGuard < epicsMutex > & mutualExclusionGuard );
- void flush (
+ void flush (
epicsGuard < epicsMutex > & mutualExclusionGuard );
- void writeRequest (
- epicsGuard < epicsMutex > &, nciu &,
- unsigned type, arrayElementCount nElem,
+ void writeRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ unsigned type, arrayElementCount nElem,
const void *pValue );
- void writeNotifyRequest (
- epicsGuard < epicsMutex > &,
- nciu &, netWriteNotifyIO &,
- unsigned type, arrayElementCount nElem,
+ void writeNotifyRequest (
+ epicsGuard < epicsMutex > &,
+ nciu &, netWriteNotifyIO &,
+ unsigned type, arrayElementCount nElem,
const void *pValue );
- void readNotifyRequest (
- epicsGuard < epicsMutex > &, nciu &,
- netReadNotifyIO &, unsigned type,
+ void readNotifyRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ netReadNotifyIO &, unsigned type,
arrayElementCount nElem );
- void clearChannelRequest (
- epicsGuard < epicsMutex > &,
+ void clearChannelRequest (
+ epicsGuard < epicsMutex > &,
ca_uint32_t sid, ca_uint32_t cid );
- void subscriptionRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netSubscription & );
- void subscriptionUpdateRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionUpdateRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netSubscription & );
- void subscriptionCancelRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionCancelRequest (
+ epicsGuard < epicsMutex > &,
nciu & chan, netSubscription & subscr );
- void flushRequest (
+ void flushRequest (
epicsGuard < epicsMutex > & );
void requestRecvProcessPostponedFlush (
epicsGuard < epicsMutex > & );
osiSockAddr getNetworkAddress (
epicsGuard < epicsMutex > & ) const;
- void uninstallChan (
+ void uninstallChan (
epicsGuard < epicsMutex > &, nciu & );
- void uninstallChanDueToSuccessfulSearchResponse (
- epicsGuard < epicsMutex > &, nciu &,
+ void uninstallChanDueToSuccessfulSearchResponse (
+ epicsGuard < epicsMutex > &, nciu &,
const class epicsTime & currentTime );
double receiveWatchdogDelay (
epicsGuard < epicsMutex > & ) const;
bool searchMsg (
- epicsGuard < epicsMutex > &, ca_uint32_t id,
+ epicsGuard < epicsMutex > &, ca_uint32_t id,
const char * pName, unsigned nameLength );
// searchTimerNotify stubs
double getRTTE ( epicsGuard < epicsMutex > & ) const;
void updateRTTE ( epicsGuard < epicsMutex > &, double rtte );
bool pushVersionMsg ();
- void boostChannel (
+ void boostChannel (
epicsGuard < epicsMutex > & guard, nciu & chan );
- void noSearchRespNotify (
+ void noSearchRespNotify (
epicsGuard < epicsMutex > &, nciu & chan, unsigned index );
- bool datagramFlush (
+ bool datagramFlush (
epicsGuard < epicsMutex > &, const epicsTime & currentTime );
- ca_uint32_t datagramSeqNumber (
+ ca_uint32_t datagramSeqNumber (
epicsGuard < epicsMutex > & ) const;
// disconnectGovernorNotify
- void govExpireNotify (
+ void govExpireNotify (
epicsGuard < epicsMutex > &, nciu & );
- udpiiu ( const udpiiu & );
- udpiiu & operator = ( const udpiiu & );
+ udpiiu ( const udpiiu & );
+ udpiiu & operator = ( const udpiiu & );
friend class udpRecvThread;
@@ -314,5 +305,4 @@ private:
friend class udpiiu::M_repeaterTimerNotify;
};
-#endif // udpiiuh
-
+#endif // ifndef INC_udpiiu_H
diff --git a/modules/ca/src/client/virtualCircuit.h b/modules/ca/src/client/virtualCircuit.h
index d06d87c60..7fb1f915e 100644
--- a/modules/ca/src/client/virtualCircuit.h
+++ b/modules/ca/src/client/virtualCircuit.h
@@ -4,26 +4,26 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
+/*
+ *
*
- *
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
- *
+ *
* Copyright, 1986, The Regents of the University of California.
- *
- *
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ *
+ *
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
-#ifndef virtualCircuith
-#define virtualCircuith
+#ifndef INC_virtualCircuit_H
+#define INC_virtualCircuit_H
#include "tsDLList.h"
@@ -42,19 +42,19 @@ class callbackManager;
// a modified ca header with capacity for large arrays
struct caHdrLargeArray {
- ca_uint32_t m_postsize; // size of message extension
- ca_uint32_t m_count; // operation data count
- ca_uint32_t m_cid; // channel identifier
+ ca_uint32_t m_postsize; // size of message extension
+ ca_uint32_t m_count; // operation data count
+ ca_uint32_t m_cid; // channel identifier
ca_uint32_t m_available; // protocol stub dependent
- ca_uint16_t m_dataType; // operation data type
- ca_uint16_t m_cmmd; // operation to be performed
+ ca_uint16_t m_dataType; // operation data type
+ ca_uint16_t m_cmmd; // operation to be performed
};
class ipAddrToAsciiEngine;
class tcpRecvThread : private epicsThreadRunable {
public:
- tcpRecvThread (
+ tcpRecvThread (
class tcpiiu & iiuIn, epicsMutex & cbMutexIn, cacContextNotify &,
const char * pName, unsigned int stackSize, unsigned int priority );
virtual ~tcpRecvThread ();
@@ -71,15 +71,15 @@ private:
void run ();
void connect (
epicsGuard < epicsMutex > & guard );
- bool validFillStatus (
- epicsGuard < epicsMutex > & guard,
+ bool validFillStatus (
+ epicsGuard < epicsMutex > & guard,
const statusWireIO & stat );
};
class tcpSendThread : private epicsThreadRunable {
public:
- tcpSendThread (
- class tcpiiu & iiuIn, const char * pName,
+ tcpSendThread (
+ class tcpiiu & iiuIn, const char * pName,
unsigned int stackSize, unsigned int priority );
virtual ~tcpSendThread ();
void start ();
@@ -110,49 +110,49 @@ private:
class tcpiiu :
public netiiu, public tsDLNode < tcpiiu >,
- public tsSLNode < tcpiiu >, public caServerID,
+ public tsSLNode < tcpiiu >, public caServerID,
private wireSendAdapter, private wireRecvAdapter {
friend void SearchDestTCP::searchRequest ( epicsGuard < epicsMutex > & guard,
const char * pbuf, size_t len );
public:
- tcpiiu ( cac & cac, epicsMutex & mutualExclusion, epicsMutex & callbackControl,
- cacContextNotify &, double connectionTimeout, epicsTimerQueue & timerQueue,
- const osiSockAddr & addrIn, comBufMemoryManager &, unsigned minorVersion,
+ tcpiiu ( cac & cac, epicsMutex & mutualExclusion, epicsMutex & callbackControl,
+ cacContextNotify &, double connectionTimeout, epicsTimerQueue & timerQueue,
+ const osiSockAddr & addrIn, comBufMemoryManager &, unsigned minorVersion,
ipAddrToAsciiEngine & engineIn, const cacChannel::priLev & priorityIn,
SearchDestTCP * pSearchDestIn = NULL);
~tcpiiu ();
void start (
epicsGuard < epicsMutex > & );
- void responsiveCircuitNotify (
+ void responsiveCircuitNotify (
epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
- void sendTimeoutNotify (
+ void sendTimeoutNotify (
callbackManager & cbMgr,
epicsGuard < epicsMutex > & guard );
- void receiveTimeoutNotify(
+ void receiveTimeoutNotify(
callbackManager &,
epicsGuard < epicsMutex > & );
- void beaconAnomalyNotify (
+ void beaconAnomalyNotify (
epicsGuard < epicsMutex > & );
- void beaconArrivalNotify (
+ void beaconArrivalNotify (
epicsGuard < epicsMutex > & );
- void probeResponseNotify (
+ void probeResponseNotify (
epicsGuard < epicsMutex > & );
- void flushRequest (
+ void flushRequest (
epicsGuard < epicsMutex > & );
- unsigned requestMessageBytesPending (
+ unsigned requestMessageBytesPending (
epicsGuard < epicsMutex > & mutualExclusionGuard );
- void flush (
+ void flush (
epicsGuard < epicsMutex > & mutualExclusionGuard );
void show ( unsigned level ) const;
- bool setEchoRequestPending (
+ bool setEchoRequestPending (
epicsGuard < epicsMutex > & );
void requestRecvProcessPostponedFlush (
epicsGuard < epicsMutex > & );
- void clearChannelRequest (
- epicsGuard < epicsMutex > &,
+ void clearChannelRequest (
+ epicsGuard < epicsMutex > &,
ca_uint32_t sid, ca_uint32_t cid );
bool ca_v41_ok (
@@ -164,41 +164,41 @@ public:
bool ca_v49_ok (
epicsGuard < epicsMutex > & ) const;
- unsigned getHostName (
+ unsigned getHostName (
epicsGuard < epicsMutex > &,
char *pBuf, unsigned bufLength ) const throw ();
bool alive (
epicsGuard < epicsMutex > & ) const;
bool connecting (
epicsGuard < epicsMutex > & ) const;
- bool receiveThreadIsBusy (
+ bool receiveThreadIsBusy (
epicsGuard < epicsMutex > & );
osiSockAddr getNetworkAddress (
epicsGuard < epicsMutex > & ) const;
- int printFormated (
- epicsGuard < epicsMutex > & cbGuard,
+ int printFormated (
+ epicsGuard < epicsMutex > & cbGuard,
const char *pformat, ... );
- unsigned channelCount (
+ unsigned channelCount (
epicsGuard < epicsMutex > & );
void disconnectAllChannels (
- epicsGuard < epicsMutex > & cbGuard,
+ epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard, class udpiiu & );
void unlinkAllChannels (
- epicsGuard < epicsMutex > & cbGuard,
+ epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
- void installChannel (
- epicsGuard < epicsMutex > &, nciu & chan,
+ void installChannel (
+ epicsGuard < epicsMutex > &, nciu & chan,
unsigned sidIn, ca_uint16_t typeIn, arrayElementCount countIn );
- void uninstallChan (
+ void uninstallChan (
epicsGuard < epicsMutex > & guard, nciu & chan );
- bool connectNotify (
+ bool connectNotify (
epicsGuard < epicsMutex > &, nciu & chan );
-
- void searchRespNotify (
+
+ void searchRespNotify (
const epicsTime &, const caHdrLargeArray & );
void versionRespNotify ( const caHdrLargeArray & );
- void * operator new ( size_t size,
+ void * operator new ( size_t size,
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & );
epicsPlacementDeleteOperator (( void *,
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & ))
@@ -230,7 +230,7 @@ private:
epicsMutex & mutex;
epicsMutex & cbMutex;
unsigned minorProtocolVersion;
- enum iiu_conn_state {
+ enum iiu_conn_state {
iiucs_connecting, // pending circuit connect
iiucs_connected, // live circuit
iiucs_clean_shutdown, // live circuit will shutdown when flush completes
@@ -248,7 +248,7 @@ private:
bool _receiveThreadIsBusy;
bool busyStateDetected; // only modified by the recv thread
bool flowControlActive; // only modified by the send process thread
- bool echoRequestPending;
+ bool echoRequestPending;
bool oldMsgHeaderAvailable;
bool msgHeaderAvailable;
bool earlyFlush;
@@ -257,93 +257,93 @@ private:
bool socketHasBeenClosed;
bool unresponsiveCircuit;
- bool processIncoming (
+ bool processIncoming (
const epicsTime & currentTime, callbackManager & );
- unsigned sendBytes ( const void *pBuf,
+ unsigned sendBytes ( const void *pBuf,
unsigned nBytesInBuf, const epicsTime & currentTime );
- void recvBytes (
+ void recvBytes (
void * pBuf, unsigned nBytesInBuf, statusWireIO & );
const char * pHostName (
epicsGuard < epicsMutex > & ) const throw ();
double receiveWatchdogDelay (
epicsGuard < epicsMutex > & ) const;
- void unresponsiveCircuitNotify (
- epicsGuard < epicsMutex > & cbGuard,
+ void unresponsiveCircuitNotify (
+ epicsGuard < epicsMutex > & cbGuard,
epicsGuard < epicsMutex > & guard );
- void initiateCleanShutdown (
+ void initiateCleanShutdown (
+ epicsGuard < epicsMutex > & );
+ void initiateAbortShutdown (
epicsGuard < epicsMutex > & );
- void initiateAbortShutdown (
- epicsGuard < epicsMutex > & );
void disconnectNotify (
epicsGuard < epicsMutex > & );
bool bytesArePendingInOS () const;
- void decrementBlockingForFlushCount (
+ void decrementBlockingForFlushCount (
epicsGuard < epicsMutex > & guard );
bool isNameService () const;
// send protocol stubs
- void echoRequest (
+ void echoRequest (
epicsGuard < epicsMutex > & );
- void versionMessage (
+ void versionMessage (
epicsGuard < epicsMutex > &, const cacChannel::priLev & priority );
void disableFlowControlRequest (
epicsGuard < epicsMutex > & );
void enableFlowControlRequest (
epicsGuard < epicsMutex > & );
- void hostNameSetRequest (
+ void hostNameSetRequest (
epicsGuard < epicsMutex > & );
- void userNameSetRequest (
+ void userNameSetRequest (
epicsGuard < epicsMutex > & );
- void createChannelRequest (
+ void createChannelRequest (
nciu &, epicsGuard < epicsMutex > & );
- void writeRequest (
- epicsGuard < epicsMutex > &, nciu &,
+ void writeRequest (
+ epicsGuard < epicsMutex > &, nciu &,
unsigned type, arrayElementCount nElem, const void *pValue );
- void writeNotifyRequest (
- epicsGuard < epicsMutex > &, nciu &,
- netWriteNotifyIO &, unsigned type,
+ void writeNotifyRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ netWriteNotifyIO &, unsigned type,
arrayElementCount nElem, const void *pValue );
- void readNotifyRequest (
- epicsGuard < epicsMutex > &, nciu &,
- netReadNotifyIO &, unsigned type,
+ void readNotifyRequest (
+ epicsGuard < epicsMutex > &, nciu &,
+ netReadNotifyIO &, unsigned type,
arrayElementCount nElem );
- void subscriptionRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionRequest (
+ epicsGuard < epicsMutex > &,
nciu &, netSubscription & subscr );
- void subscriptionUpdateRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionUpdateRequest (
+ epicsGuard < epicsMutex > &,
nciu & chan, netSubscription & subscr );
- void subscriptionCancelRequest (
- epicsGuard < epicsMutex > &,
+ void subscriptionCancelRequest (
+ epicsGuard < epicsMutex > &,
nciu & chan, netSubscription & subscr );
void flushIfRecvProcessRequested (
epicsGuard < epicsMutex > & );
- bool sendThreadFlush (
+ bool sendThreadFlush (
epicsGuard < epicsMutex > & );
// netiiu stubs
- void uninstallChanDueToSuccessfulSearchResponse (
+ void uninstallChanDueToSuccessfulSearchResponse (
epicsGuard < epicsMutex > &, nciu &, const class epicsTime & );
bool searchMsg (
- epicsGuard < epicsMutex > &, ca_uint32_t id,
+ epicsGuard < epicsMutex > &, ca_uint32_t id,
const char * pName, unsigned nameLength );
friend class tcpRecvThread;
friend class tcpSendThread;
- tcpiiu ( const tcpiiu & );
- tcpiiu & operator = ( const tcpiiu & );
+ tcpiiu ( const tcpiiu & );
+ tcpiiu & operator = ( const tcpiiu & );
void operator delete ( void * );
};
-inline void * tcpiiu::operator new ( size_t size,
+inline void * tcpiiu::operator new ( size_t size,
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & mgr )
{
return mgr.allocate ( size );
}
-
+
#ifdef CXX_PLACEMENT_DELETE
-inline void tcpiiu::operator delete ( void * pCadaver,
+inline void tcpiiu::operator delete ( void * pCadaver,
tsFreeList < class tcpiiu, 32, epicsMutexNOOP > & mgr )
{
mgr.release ( pCadaver );
@@ -371,7 +371,7 @@ inline bool tcpiiu::ca_v49_ok (
inline bool tcpiiu::alive (
epicsGuard < epicsMutex > & ) const
{
- return ( this->state == iiucs_connecting ||
+ return ( this->state == iiucs_connecting ||
this->state == iiucs_connected );
}
@@ -381,14 +381,14 @@ inline bool tcpiiu::connecting (
return ( this->state == iiucs_connecting );
}
-inline bool tcpiiu::receiveThreadIsBusy (
+inline bool tcpiiu::receiveThreadIsBusy (
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
return this->_receiveThreadIsBusy;
}
-inline void tcpiiu::beaconAnomalyNotify (
+inline void tcpiiu::beaconAnomalyNotify (
epicsGuard < epicsMutex > & guard )
{
//guard.assertIdenticalMutex ( this->cacRef.mutexRef () );
@@ -418,4 +418,4 @@ inline void SearchDestTCP::setCircuit ( tcpiiu * piiu )
_ptcpiiu = piiu;
}
-#endif // ifdef virtualCircuith
+#endif // ifdef INC_virtualCircuit_H
diff --git a/modules/ca/src/perl/CA.pm b/modules/ca/src/perl/CA.pm
index d79cdd33e..2c5232222 100644
--- a/modules/ca/src/perl/CA.pm
+++ b/modules/ca/src/perl/CA.pm
@@ -134,7 +134,7 @@ garbage-collected by Perl.
=head2 Object Methods
-The following methods are provided for channel objects returned by
+The following methods are provided for channel objects returned by
C<< CA->new() >>.
=over 4
@@ -232,7 +232,7 @@ below.
Callback subroutines should only call Perl's C, C or similar
functions if they are expecting the program to exit at that time; attempts to
C with an exception object in the callback and catch that using C in
-the main thread are not likely to succeed and will probably result in a crash.
+the main thread are not likely to succeed and will probably result in a crash.
Callbacks should not perform any operations that would block for more than a
fraction of a second as this will hold up network communications with the
relevant server and could cause the Perl program and/or the Channel Access
diff --git a/modules/ca/src/template/top/caClientApp/caExample.c b/modules/ca/src/template/top/caClientApp/caExample.c
index cc342e237..5ab230827 100644
--- a/modules/ca/src/template/top/caClientApp/caExample.c
+++ b/modules/ca/src/template/top/caClientApp/caExample.c
@@ -8,12 +8,12 @@
int main(int argc,char **argv)
{
- double data;
- chid mychid;
+ double data;
+ chid mychid;
if(argc != 2) {
- fprintf(stderr,"usage: caExample pvname\n");
- exit(1);
+ fprintf(stderr,"usage: caExample pvname\n");
+ exit(1);
}
SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create");
SEVCHK(ca_create_channel(argv[1],NULL,NULL,10,&mychid),"ca_create_channel failure");
diff --git a/modules/ca/src/template/top/caClientApp/caMonitor.c b/modules/ca/src/template/top/caClientApp/caMonitor.c
index 9554cc744..5adc90e7f 100644
--- a/modules/ca/src/template/top/caClientApp/caMonitor.c
+++ b/modules/ca/src/template/top/caClientApp/caMonitor.c
@@ -18,9 +18,9 @@
#define MAX_PV_NAME_LEN 40
typedef struct{
- char value[20];
- chid mychid;
- evid myevid;
+ char value[20];
+ chid mychid;
+ evid myevid;
} MYNODE;
@@ -28,16 +28,16 @@ static void printChidInfo(chid chid, char *message)
{
printf("\n%s\n",message);
printf("pv: %s type(%d) nelements(%ld) host(%s)",
- ca_name(chid),ca_field_type(chid),ca_element_count(chid),
- ca_host_name(chid));
+ ca_name(chid),ca_field_type(chid),ca_element_count(chid),
+ ca_host_name(chid));
printf(" read(%d) write(%d) state(%d)\n",
- ca_read_access(chid),ca_write_access(chid),ca_state(chid));
+ ca_read_access(chid),ca_write_access(chid),ca_state(chid));
}
static void exceptionCallback(struct exception_handler_args args)
{
- chid chid = args.chid;
- long stat = args.stat; /* Channel access status code*/
+ chid chid = args.chid;
+ long stat = args.stat; /* Channel access status code*/
const char *channel;
static char *noname = "unknown";
@@ -51,39 +51,39 @@ static void exceptionCallback(struct exception_handler_args args)
static void connectionCallback(struct connection_handler_args args)
{
- chid chid = args.chid;
+ chid chid = args.chid;
printChidInfo(chid,"connectionCallback");
}
static void accessRightsCallback(struct access_rights_handler_args args)
{
- chid chid = args.chid;
+ chid chid = args.chid;
printChidInfo(chid,"accessRightsCallback");
}
static void eventCallback(struct event_handler_args eha)
{
- chid chid = eha.chid;
+ chid chid = eha.chid;
if(eha.status!=ECA_NORMAL) {
- printChidInfo(chid,"eventCallback");
+ printChidInfo(chid,"eventCallback");
} else {
- char *pdata = (char *)eha.dbr;
- printf("Event Callback: %s = %s\n",ca_name(eha.chid),pdata);
+ char *pdata = (char *)eha.dbr;
+ printf("Event Callback: %s = %s\n",ca_name(eha.chid),pdata);
}
}
int main(int argc,char **argv)
{
char *filename;
- int npv = 0;
- MYNODE *pmynode[MAX_PV];
- char *pname[MAX_PV];
- int i;
- char tempStr[MAX_PV_NAME_LEN];
- char *pstr;
- FILE *fp;
+ int npv = 0;
+ MYNODE *pmynode[MAX_PV];
+ char *pname[MAX_PV];
+ int i;
+ char tempStr[MAX_PV_NAME_LEN];
+ char *pstr;
+ FILE *fp;
if (argc != 2) {
fprintf(stderr,"usage: caMonitor filename\n");
@@ -112,17 +112,17 @@ int main(int argc,char **argv)
fclose(fp);
SEVCHK(ca_context_create(ca_disable_preemptive_callback),"ca_context_create");
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
- "ca_add_exception_event");
+ "ca_add_exception_event");
for (i=0; imychid),
- "ca_create_channel");
- SEVCHK(ca_replace_access_rights_event(pmynode[i]->mychid,
- accessRightsCallback),
- "ca_replace_access_rights_event");
- SEVCHK(ca_create_subscription(DBR_STRING,1,pmynode[i]->mychid,
- DBE_VALUE,eventCallback,pmynode[i],&pmynode[i]->myevid),
- "ca_create_subscription");
+ SEVCHK(ca_create_channel(pname[i],connectionCallback,
+ pmynode[i],20,&pmynode[i]->mychid),
+ "ca_create_channel");
+ SEVCHK(ca_replace_access_rights_event(pmynode[i]->mychid,
+ accessRightsCallback),
+ "ca_replace_access_rights_event");
+ SEVCHK(ca_create_subscription(DBR_STRING,1,pmynode[i]->mychid,
+ DBE_VALUE,eventCallback,pmynode[i],&pmynode[i]->myevid),
+ "ca_create_subscription");
}
/*Should never return from following call*/
SEVCHK(ca_pend_event(0.0),"ca_pend_event");
diff --git a/modules/ca/src/template/top/caPerlApp/camonitor.pl b/modules/ca/src/template/top/caPerlApp/camonitor.pl
index 564688d68..3a61f2d6c 100644
--- a/modules/ca/src/template/top/caPerlApp/camonitor.pl
+++ b/modules/ca/src/template/top/caPerlApp/camonitor.pl
@@ -55,7 +55,7 @@ sub conn_callback {
if ($opt_n && $type eq 'DBR_ENUM')
|| (!$opt_S && $type eq 'DBR_CHAR');
$type =~ s/^DBR_/DBR_TIME_/;
-
+
$monitors{$chan} =
$chan->create_subscription($opt_m, \&mon_callback, $type, 0+$opt_c);
}
@@ -93,7 +93,7 @@ sub display {
my ($chan, $data) = @_;
die "Internal error"
unless ref $data eq 'HASH';
-
+
my $type = $data->{TYPE};
my $value = $data->{value};
if (ref $value eq 'ARRAY') {
diff --git a/modules/ca/src/tools/caget.c b/modules/ca/src/tools/caget.c
index 75225d07f..8f8e46f8e 100644
--- a/modules/ca/src/tools/caget.c
+++ b/modules/ca/src/tools/caget.c
@@ -8,7 +8,7 @@
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -109,12 +109,12 @@ static void usage (void)
/*+**************************************************************************
*
- * Function: event_handler
+ * Function: event_handler
*
- * Description: CA event_handler for request type callback
- * Allocates the dbr structure and copies the data
+ * Description: CA event_handler for request type callback
+ * Allocates the dbr structure and copies the data
*
- * Arg(s) In: args - event handler args (see CA manual)
+ * Arg(s) In: args - event handler args (see CA manual)
*
**************************************************************************-*/
@@ -137,22 +137,22 @@ static void event_handler (evargs args)
/*+**************************************************************************
*
- * Function: caget
+ * Function: caget
*
- * Description: Issue read requests, wait for incoming data
- * and print the data according to the selected format
+ * Description: Issue read requests, wait for incoming data
+ * and print the data according to the selected format
*
- * Arg(s) In: pvs - Pointer to an array of pv structures
+ * Arg(s) In: pvs - Pointer to an array of pv structures
* nPvs - Number of elements in the pvs array
* request - Request type
* format - Output format
* dbrType - Requested dbr type
* reqElems - Requested number of (array) elements
*
- * Return(s): Error code: 0 = OK, 1 = Error
+ * Return(s): Error code: 0 = OK, 1 = Error
*
**************************************************************************-*/
-
+
static int caget (pv *pvs, int nPvs, RequestT request, OutputT format,
chtype dbrType, unsigned long reqElems)
{
@@ -350,23 +350,23 @@ static int caget (pv *pvs, int nPvs, RequestT request, OutputT format,
/*+**************************************************************************
*
- * Function: main
+ * Function: main
*
- * Description: caget main()
- * Evaluate command line options, set up CA, connect the
- * channels, collect and print the data as requested
+ * Description: caget main()
+ * Evaluate command line options, set up CA, connect the
+ * channels, collect and print the data as requested
*
- * Arg(s) In: [options] ...
+ * Arg(s) In: [options] ...
*
- * Arg(s) Out: none
+ * Arg(s) Out: none
*
- * Return(s): Standard return code (0=success, 1=error)
+ * Return(s): Standard return code (0=success, 1=error)
*
**************************************************************************-*/
static void complainIfNotPlainAndSet (OutputT *current, const OutputT requested)
{
- if (*current != plain)
+ if (*current != plain)
fprintf(stderr,
"Options t,d,a are mutually exclusive. "
"('caget -h' for help.)\n");
@@ -467,7 +467,7 @@ int main (int argc, char *argv[])
case 'f':
case 'g':
if (sscanf(optarg, "%d", &digits) != 1)
- fprintf(stderr,
+ fprintf(stderr,
"Invalid precision argument '%s' "
"for option '-%c' - ignored.\n", optarg, opt);
else
diff --git a/modules/ca/src/tools/cainfo.c b/modules/ca/src/tools/cainfo.c
index fc18ccd3f..13696de34 100644
--- a/modules/ca/src/tools/cainfo.c
+++ b/modules/ca/src/tools/cainfo.c
@@ -7,7 +7,7 @@
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -51,17 +51,17 @@ void usage (void)
/*+**************************************************************************
*
- * Function: cainfo
+ * Function: cainfo
*
- * Description: Print CA info data or call ca_client_status
+ * Description: Print CA info data or call ca_client_status
*
- * Arg(s) In: pvs - Pointer to an array of pv structures
+ * Arg(s) In: pvs - Pointer to an array of pv structures
* nPvs - Number of elements in the pvs array
*
- * Return(s): Error code: 0 = OK, 1 = Error
+ * Return(s): Error code: 0 = OK, 1 = Error
*
**************************************************************************-*/
-
+
int cainfo (pv *pvs, int nPvs)
{
int n;
@@ -114,17 +114,17 @@ int cainfo (pv *pvs, int nPvs)
/*+**************************************************************************
*
- * Function: main
+ * Function: main
*
- * Description: cainfo main()
- * Evaluate command line options, set up CA, connect the
- * channels, print the data as requested
+ * Description: cainfo main()
+ * Evaluate command line options, set up CA, connect the
+ * channels, print the data as requested
*
- * Arg(s) In: [options] ...
+ * Arg(s) In: [options] ...
*
- * Arg(s) Out: none
+ * Arg(s) Out: none
*
- * Return(s): Standard return code (0=success, 1=error)
+ * Return(s): Standard return code (0=success, 1=error)
*
**************************************************************************-*/
diff --git a/modules/ca/src/tools/camonitor.c b/modules/ca/src/tools/camonitor.c
index a3fdecd55..e83883702 100644
--- a/modules/ca/src/tools/camonitor.c
+++ b/modules/ca/src/tools/camonitor.c
@@ -7,7 +7,7 @@
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -95,12 +95,12 @@ void usage (void)
/*+**************************************************************************
*
- * Function: event_handler
+ * Function: event_handler
*
- * Description: CA event_handler for request type callback
- * Prints the event data
+ * Description: CA event_handler for request type callback
+ * Prints the event data
*
- * Arg(s) In: args - event handler args (see CA manual)
+ * Arg(s) In: args - event handler args (see CA manual)
*
**************************************************************************-*/
@@ -125,11 +125,11 @@ static void event_handler (evargs args)
/*+**************************************************************************
*
- * Function: connection_handler
+ * Function: connection_handler
*
- * Description: CA connection_handler
+ * Description: CA connection_handler
*
- * Arg(s) In: args - connection_handler_args (see CA manual)
+ * Arg(s) In: args - connection_handler_args (see CA manual)
*
**************************************************************************-*/
@@ -138,7 +138,14 @@ static void connection_handler ( struct connection_handler_args args )
pv *ppv = ( pv * ) ca_puser ( args.chid );
if ( args.op == CA_OP_CONN_UP ) {
nConn++;
- if (!ppv->onceConnected) {
+
+ if (ppv->onceConnected && ppv->dbfType != ca_field_type(ppv->chid)) {
+ /* Data type has changed. Rebuild connection with new type. */
+ ca_clear_subscription(ppv->evid);
+ ppv->evid = NULL;
+ }
+
+ if (!ppv->evid) {
ppv->onceConnected = 1;
/* Set up pv structure */
/* ------------------- */
@@ -169,7 +176,7 @@ static void connection_handler ( struct connection_handler_args args )
eventMask,
event_handler,
(void*)ppv,
- NULL);
+ &ppv->evid);
}
}
else if ( args.op == CA_OP_CONN_DOWN ) {
@@ -182,17 +189,17 @@ static void connection_handler ( struct connection_handler_args args )
/*+**************************************************************************
*
- * Function: main
+ * Function: main
*
- * Description: camonitor main()
- * Evaluate command line options, set up CA, connect the
- * channels, collect and print the data as requested
+ * Description: camonitor main()
+ * Evaluate command line options, set up CA, connect the
+ * channels, collect and print the data as requested
*
- * Arg(s) In: [options] ...
+ * Arg(s) In: [options] ...
*
- * Arg(s) Out: none
+ * Arg(s) Out: none
*
- * Return(s): Standard return code (0=success, 1=error)
+ * Return(s): Standard return code (0=success, 1=error)
*
**************************************************************************-*/
@@ -296,7 +303,7 @@ int main (int argc, char *argv[])
case 'f':
case 'g':
if (sscanf(optarg, "%d", &digits) != 1)
- fprintf(stderr,
+ fprintf(stderr,
"Invalid precision argument '%s' "
"for option '-%c' - ignored.\n", optarg, opt);
else
diff --git a/modules/ca/src/tools/caput.c b/modules/ca/src/tools/caput.c
index 79ffef8c3..0cd923e72 100644
--- a/modules/ca/src/tools/caput.c
+++ b/modules/ca/src/tools/caput.c
@@ -110,18 +110,18 @@ void put_event_handler ( struct event_handler_args args )
/*+**************************************************************************
*
- * Function: caget
+ * Function: caget
*
- * Description: Issue read request, wait for incoming data
- * and print the data
+ * Description: Issue read request, wait for incoming data
+ * and print the data
*
- * Arg(s) In: pvs - Pointer to an array of pv structures
+ * Arg(s) In: pvs - Pointer to an array of pv structures
* nPvs - Number of elements in the pvs array
* format - Output format
* dbrType - Requested dbr type
* reqElems - Requested number of (array) elements
*
- * Return(s): Error code: 0 = OK, 1 = Error
+ * Return(s): Error code: 0 = OK, 1 = Error
*
**************************************************************************-*/
@@ -241,17 +241,17 @@ int caget (pv *pvs, int nPvs, OutputT format,
/*+**************************************************************************
*
- * Function: main
+ * Function: main
*
- * Description: caput main()
- * Evaluate command line options, set up CA, connect the
- * channel, put and print the data
+ * Description: caput main()
+ * Evaluate command line options, set up CA, connect the
+ * channel, put and print the data
*
- * Arg(s) In: [options] ...
+ * Arg(s) In: [options] ...
*
- * Arg(s) Out: none
+ * Arg(s) Out: none
*
- * Return(s): Standard return code (0=success, 1=error)
+ * Return(s): Standard return code (0=success, 1=error)
*
**************************************************************************-*/
diff --git a/modules/ca/src/tools/tool_lib.c b/modules/ca/src/tools/tool_lib.c
index 29b252e37..e5dbd1afb 100644
--- a/modules/ca/src/tools/tool_lib.c
+++ b/modules/ca/src/tools/tool_lib.c
@@ -7,7 +7,7 @@
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -94,15 +94,15 @@ static void sprint_long (char *ret, dbr_long_t val, IntFormatT outType)
/*+**************************************************************************
*
- * Function: val2str
+ * Function: val2str
*
- * Description: Print (convert) value to a string
+ * Description: Print (convert) value to a string
*
- * Arg(s) In: v - Pointer to dbr_... structure
+ * Arg(s) In: v - Pointer to dbr_... structure
* type - Numeric dbr type
- * index - Index of element to print (for arrays)
+ * index - Index of element to print (for arrays)
*
- * Return(s): Pointer to static output string
+ * Return(s): Pointer to static output string
*
**************************************************************************-*/
@@ -192,14 +192,14 @@ char *val2str (const void *v, unsigned type, int index)
/*+**************************************************************************
*
- * Function: dbr2str
+ * Function: dbr2str
*
- * Description: Print (convert) additional information contained in dbr_...
+ * Description: Print (convert) additional information contained in dbr_...
*
- * Arg(s) In: value - Pointer to dbr_... structure
+ * Arg(s) In: value - Pointer to dbr_... structure
* type - Numeric dbr type
*
- * Return(s): Pointer to static output string
+ * Return(s): Pointer to static output string
*
**************************************************************************-*/
@@ -398,16 +398,16 @@ char *dbr2str (const void *value, unsigned type)
/*+**************************************************************************
*
- * Function: print_time_val_sts
+ * Function: print_time_val_sts
*
- * Description: Print (to stdout) one wide output line
+ * Description: Print (to stdout) one wide output line
* (name, timestamp, value, status, severity)
*
- * Arg(s) In: pv - Pointer to pv structure
+ * Arg(s) In: pv - Pointer to pv structure
* nElems - Number of elements (array)
*
**************************************************************************-*/
-
+
#define PRN_TIME_VAL_STS(TYPE,TYPE_ENUM) \
printAbs = !pv->firstStampPrinted; \
\
@@ -555,22 +555,22 @@ void print_time_val_sts (pv* pv, unsigned long reqElems)
/*+**************************************************************************
*
- * Function: create_pvs
+ * Function: create_pvs
*
- * Description: Creates an arbitrary number of PVs
+ * Description: Creates an arbitrary number of PVs
*
- * Arg(s) In: pvs - Pointer to an array of pv structures
+ * Arg(s) In: pvs - Pointer to an array of pv structures
* nPvs - Number of elements in the pvs array
* pCB - Connection state change callback
*
- * Arg(s) Out: none
+ * Arg(s) Out: none
*
- * Return(s): Error code:
+ * Return(s): Error code:
* 0 - All PVs created
* 1 - Some PV(s) not created
*
**************************************************************************-*/
-
+
int create_pvs (pv* pvs, int nPvs, caCh *pCB)
{
int n;
@@ -603,21 +603,21 @@ int create_pvs (pv* pvs, int nPvs, caCh *pCB)
/*+**************************************************************************
*
- * Function: connect_pvs
+ * Function: connect_pvs
*
- * Description: Connects an arbitrary number of PVs
+ * Description: Connects an arbitrary number of PVs
*
- * Arg(s) In: pvs - Pointer to an array of pv structures
+ * Arg(s) In: pvs - Pointer to an array of pv structures
* nPvs - Number of elements in the pvs array
*
- * Arg(s) Out: none
+ * Arg(s) Out: none
*
- * Return(s): Error code:
+ * Return(s): Error code:
* 0 - All PVs connected
* 1 - Some PV(s) not connected
*
**************************************************************************-*/
-
+
int connect_pvs (pv* pvs, int nPvs)
{
int returncode = create_pvs ( pvs, nPvs, 0);
@@ -630,7 +630,7 @@ int connect_pvs (pv* pvs, int nPvs)
{
fprintf(stderr, "Channel connect timed out: some PV(s) not found.\n");
} else {
- fprintf(stderr, "Channel connect timed out: '%s' not found.\n",
+ fprintf(stderr, "Channel connect timed out: '%s' not found.\n",
pvs[0].name);
}
returncode = 1;
diff --git a/modules/ca/src/tools/tool_lib.h b/modules/ca/src/tools/tool_lib.h
index fb5c4af3c..b53609eac 100644
--- a/modules/ca/src/tools/tool_lib.h
+++ b/modules/ca/src/tools/tool_lib.h
@@ -6,7 +6,7 @@
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -64,7 +64,7 @@ typedef enum { absolute, relative, incremental, incrementalByChan } TimeT;
typedef enum { dec, bin, oct, hex } IntFormatT;
/* Structure representing one PV (= channel) */
-typedef struct
+typedef struct
{
char* name;
chid chid;
@@ -78,6 +78,7 @@ typedef struct
epicsTimeStamp tsPreviousS;
char firstStampPrinted;
char onceConnected;
+ evid evid;
} pv;
diff --git a/modules/database/Makefile b/modules/database/Makefile
index 9bb746e82..729a0326e 100644
--- a/modules/database/Makefile
+++ b/modules/database/Makefile
@@ -15,4 +15,4 @@ DIRS += src
DIRS += test
test_DEPEND_DIRS = src
-include $(TOP)/configure/RULES_TOP
+include $(TOP)/configure/RULES_DIRS
diff --git a/modules/database/src/ioc/Makefile b/modules/database/src/ioc/Makefile
index 70b1b5558..cf3345355 100644
--- a/modules/database/src/ioc/Makefile
+++ b/modules/database/src/ioc/Makefile
@@ -11,19 +11,28 @@ TOP = ../../../..
include $(TOP)/configure/CONFIG
-USR_CPPFLAGS += -DUSE_TYPED_RSET
+USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
-SHRLIB_VERSION = 3.17.0
+# Shared library ABI version.
+SHRLIB_VERSION = $(EPICS_DATABASE_MAJOR_VERSION).$(EPICS_DATABASE_MINOR_VERSION).$(EPICS_DATABASE_MAINTENANCE_VERSION)
+
+API_HEADER = dbCoreAPI.h
+dbCore_API = dbCore
LIBRARY_IOC += dbCore
dbCore_LIBS += ca Com
dbCore_SYS_LIBS_WIN32 += ws2_32
dbCore_RCS += dbCore.rc
-dbStaticHost_RCS = dbStaticHost.rc
+
+EXPAND_COMMON += databaseVersion.h@
+
+EXPAND_ME += EPICS_DATABASE_MAJOR_VERSION
+EXPAND_ME += EPICS_DATABASE_MINOR_VERSION
+EXPAND_ME += EPICS_DATABASE_MAINTENANCE_VERSION
+EXPAND_ME += EPICS_DATABASE_DEVELOPMENT_FLAG
INC += databaseVersion.h
-INC += databaseVersionNum.h
PROD_LIBS = Com
@@ -39,13 +48,6 @@ include $(IOCDIR)/rsrv/Makefile
GENVERSION = epicsVCS.h
GENVERSIONMACRO = EPICS_VCS_VERSION
-EXPANDVARS += EPICS_DATABASE_MAJOR_VERSION
-EXPANDVARS += EPICS_DATABASE_MINOR_VERSION
-EXPANDVARS += EPICS_DATABASE_MAINTENANCE_VERSION
-EXPANDVARS += EPICS_DATABASE_DEVELOPMENT_FLAG
-
-EXPANDFLAGS += $(foreach var,$(EXPANDVARS),-D$(var)="$(strip $($(var)))")
-
include $(TOP)/configure/RULES
include $(IOCDIR)/dbStatic/RULES
@@ -53,10 +55,4 @@ include $(IOCDIR)/bpt/RULES
include $(IOCDIR)/db/RULES
include $(IOCDIR)/dbtemplate/RULES
-# Can't use EXPAND as generated headers must appear
-# in O.Common, but EXPAND emits rules for O.$(T_A)
-../O.Common/databaseVersionNum.h: ../databaseVersionNum.h@
- $(MKDIR) $(COMMON_DIR)
- $(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@
-
epicsRelease$(DEP): $(COMMON_DIR)/$(GENVERSION)
diff --git a/modules/database/src/ioc/as/asCa.c b/modules/database/src/ioc/as/asCa.c
index 21bb47f5f..ffd8c0ab5 100644
--- a/modules/database/src/ioc/as/asCa.c
+++ b/modules/database/src/ioc/as/asCa.c
@@ -5,7 +5,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Marty Kraimer Date: 10-15-93 */
@@ -43,16 +43,16 @@ epicsExportAddress(int,asCaDebug);
static int firstTime = TRUE;
static epicsThreadId threadid=0;
static int caInitializing=FALSE;
-static epicsMutexId asCaTaskLock; /*lock access to task */
-static epicsEventId asCaTaskWait; /*Wait for task to respond*/
-static epicsEventId asCaTaskAddChannels; /*Tell asCaTask to add channels*/
-static epicsEventId asCaTaskClearChannels;/*Tell asCaTask to clear channels*/
+static epicsMutexId asCaTaskLock; /*lock access to task */
+static epicsEventId asCaTaskWait; /*Wait for task to respond*/
+static epicsEventId asCaTaskAddChannels; /*Tell asCaTask to add channels*/
+static epicsEventId asCaTaskClearChannels; /*Tell asCaTask to clear channels*/
typedef struct {
struct dbr_sts_double rtndata;
- chid chid;
+ chid chid;
} CAPVT;
-
+
static void exceptionCallback(struct exception_handler_args args)
{
chid chid = args.chid;
@@ -77,164 +77,158 @@ static void exceptionCallback(struct exception_handler_args args)
writeAccess = (chid ? ca_write_access(chid) : 0);
errlogPrintf("dbCa:exceptionCallback stat \"%s\" channel \"%s\""
- " context \"%s\"\n"
- " nativeType %s requestType %s"
- " nativeCount %ld requestCount %ld %s %s\n",
- ca_message(stat),channel,context,
- nativeType,requestType,
- nativeCount,requestCount,
- (readAccess ? "readAccess" : "noReadAccess"),
- (writeAccess ? "writeAccess" : "noWriteAccess"));
+ " context \"%s\"\n"
+ " nativeType %s requestType %s"
+ " nativeCount %ld requestCount %ld %s %s\n",
+ ca_message(stat),channel,context,
+ nativeType,requestType,
+ nativeCount,requestCount,
+ (readAccess ? "readAccess" : "noReadAccess"),
+ (writeAccess ? "writeAccess" : "noWriteAccess"));
}
/*connectCallback only handles disconnects*/
static void connectCallback(struct connection_handler_args arg)
{
- chid chid = arg.chid;
- ASGINP *pasginp = (ASGINP *)ca_puser(chid);
- ASG *pasg = pasginp->pasg;
+ chid chid = arg.chid;
+ ASGINP *pasginp = (ASGINP *)ca_puser(chid);
+ ASG *pasg = pasginp->pasg;
if(ca_state(chid)!=cs_conn) {
- if(!(pasg->inpBad & (1<inpIndex))) {
- /*was good so lets make it bad*/
- pasg->inpBad |= (1<inpIndex);
- if(!caInitializing) asComputeAsg(pasg);
- if(asCaDebug) printf("as connectCallback disconnect %s\n",
- ca_name(chid));
- }
+ if(!(pasg->inpBad & (1<inpIndex))) {
+ /*was good so lets make it bad*/
+ pasg->inpBad |= (1<inpIndex);
+ if(!caInitializing) asComputeAsg(pasg);
+ if(asCaDebug) printf("as connectCallback disconnect %s\n",
+ ca_name(chid));
+ }
}
}
static void eventCallback(struct event_handler_args arg)
{
- int caStatus = arg.status;
- chid chid = arg.chid;
- ASGINP *pasginp = (ASGINP *)arg.usr;
- ASG *pasg;
- CAPVT *pcapvt;
+ int caStatus = arg.status;
+ chid chid = arg.chid;
+ ASGINP *pasginp = (ASGINP *)arg.usr;
+ ASG *pasg;
+ CAPVT *pcapvt;
const struct dbr_sts_double *pdata;
if(caStatus!=ECA_NORMAL) {
- if(chid) {
- epicsPrintf("asCa: eventCallback error %s channel %s\n",
- ca_message(caStatus),ca_name(chid));
- } else {
- epicsPrintf("asCa: eventCallback error %s chid is null\n",
- ca_message(caStatus));
- }
- return;
+ if(chid) {
+ epicsPrintf("asCa: eventCallback error %s channel %s\n",
+ ca_message(caStatus),ca_name(chid));
+ } else {
+ epicsPrintf("asCa: eventCallback error %s chid is null\n",
+ ca_message(caStatus));
+ }
+ return;
}
pasg = pasginp->pasg;
pcapvt = (CAPVT *)pasginp->capvt;
if(chid!=pcapvt->chid) {
- epicsPrintf("asCa: eventCallback error pcapvt->chid != arg.chid\n");
- return;
+ epicsPrintf("asCa: eventCallback error pcapvt->chid != arg.chid\n");
+ return;
}
if(ca_state(chid)!=cs_conn || !ca_read_access(chid)) {
- if(!(pasg->inpBad & (1<inpIndex))) {
- /*was good so lets make it bad*/
- pasg->inpBad |= (1<inpIndex);
- if(!caInitializing) asComputeAsg(pasg);
- if(asCaDebug) {
- printf("as eventCallback %s inpBad ca_state %d"
- " ca_read_access %d\n",
- ca_name(chid),ca_state(chid),ca_read_access(chid));
- }
- }
- return;
+ if(!(pasg->inpBad & (1<inpIndex))) {
+ /*was good so lets make it bad*/
+ pasg->inpBad |= (1<inpIndex);
+ if(!caInitializing) asComputeAsg(pasg);
+ if(asCaDebug) {
+ printf("as eventCallback %s inpBad ca_state %d"
+ " ca_read_access %d\n",
+ ca_name(chid),ca_state(chid),ca_read_access(chid));
+ }
+ }
+ return;
}
pdata = arg.dbr;
pcapvt->rtndata = *pdata; /*structure copy*/
if(pdata->severity==INVALID_ALARM) {
pasg->inpBad |= (1<inpIndex);
- if(asCaDebug)
- printf("as eventCallback %s inpBad because INVALID_ALARM\n",
- ca_name(chid));
+ if(asCaDebug)
+ printf("as eventCallback %s inpBad because INVALID_ALARM\n",
+ ca_name(chid));
} else {
pasg->inpBad &= ~((1<inpIndex));
pasg->pavalue[pasginp->inpIndex] = pdata->value;
- if(asCaDebug)
- printf("as eventCallback %s inpGood data %f\n",
- ca_name(chid),pdata->value);
+ if(asCaDebug)
+ printf("as eventCallback %s inpGood data %f\n",
+ ca_name(chid),pdata->value);
}
pasg->inpChanged |= (1<inpIndex);
if(!caInitializing) asComputeAsg(pasg);
}
-
+
static void asCaTask(void)
{
- ASG *pasg;
- ASGINP *pasginp;
- CAPVT *pcapvt;
- int status;
+ ASG *pasg;
+ ASGINP *pasginp;
+ CAPVT *pcapvt;
+ int status;
taskwdInsert(epicsThreadGetIdSelf(),NULL,NULL);
SEVCHK(ca_context_create(ca_enable_preemptive_callback),
- "asCaTask calling ca_context_create");
+ "asCaTask calling ca_context_create");
SEVCHK(ca_add_exception_event(exceptionCallback,NULL),
- "ca_add_exception_event");
- while(TRUE) {
+ "ca_add_exception_event");
+ while(TRUE) {
epicsEventMustWait(asCaTaskAddChannels);
- caInitializing = TRUE;
- pasg = (ASG *)ellFirst(&pasbase->asgList);
- while(pasg) {
- pasginp = (ASGINP *)ellFirst(&pasg->inpList);
- while(pasginp) {
- pasg->inpBad |= (1<inpIndex);
- pcapvt = pasginp->capvt = asCalloc(1,sizeof(CAPVT));
- /*Note calls connectCallback immediately for local Pvs*/
- status = ca_search_and_connect(pasginp->inp,&pcapvt->chid,
- connectCallback,pasginp);
- if(status!=ECA_NORMAL) {
- epicsPrintf("asCa ca_search_and_connect error %s\n",
- ca_message(status));
- }
- /*Note calls eventCallback immediately for local Pvs*/
- status = ca_add_event(DBR_STS_DOUBLE,pcapvt->chid,
- eventCallback,pasginp,0);
- if(status!=ECA_NORMAL) {
- epicsPrintf("asCa ca_add_event error %s\n",
- ca_message(status));
- }
- pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
- }
- pasg = (ASG *)ellNext((ELLNODE *)pasg);
- }
+ caInitializing = TRUE;
+ pasg = (ASG *)ellFirst(&pasbase->asgList);
+ while(pasg) {
+ pasginp = (ASGINP *)ellFirst(&pasg->inpList);
+ while(pasginp) {
+ pasg->inpBad |= (1<inpIndex);
+ pcapvt = pasginp->capvt = asCalloc(1,sizeof(CAPVT));
+ /*Note calls connectCallback immediately for local Pvs*/
+ status = ca_search_and_connect(pasginp->inp,&pcapvt->chid,
+ connectCallback,pasginp);
+ if(status!=ECA_NORMAL) {
+ epicsPrintf("asCa ca_search_and_connect error %s\n",
+ ca_message(status));
+ }
+ /*Note calls eventCallback immediately for local Pvs*/
+ status = ca_add_event(DBR_STS_DOUBLE,pcapvt->chid,
+ eventCallback,pasginp,0);
+ if(status!=ECA_NORMAL) {
+ epicsPrintf("asCa ca_add_event error %s\n",
+ ca_message(status));
+ }
+ pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
+ }
+ pasg = (ASG *)ellNext((ELLNODE *)pasg);
+ }
SEVCHK(ca_flush_io(),"asCaTask");
- caInitializing = FALSE;
- asComputeAllAsg();
- if(asCaDebug) printf("asCaTask initialized\n");
- epicsEventSignal(asCaTaskWait);
+ caInitializing = FALSE;
+ asComputeAllAsg();
+ if(asCaDebug) printf("asCaTask initialized\n");
+ epicsEventSignal(asCaTaskWait);
epicsEventMustWait(asCaTaskClearChannels);
- pasg = (ASG *)ellFirst(&pasbase->asgList);
- while(pasg) {
- pasginp = (ASGINP *)ellFirst(&pasg->inpList);
- while(pasginp) {
- pcapvt = (CAPVT *)pasginp->capvt;
- status = ca_clear_channel(pcapvt->chid);
- if(status!=ECA_NORMAL) {
- epicsPrintf("asCa ca_clear_channel error %s\n",
- ca_message(status));
- }
- free(pasginp->capvt);
- pasginp->capvt = 0;
- pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
- }
- pasg = (ASG *)ellNext((ELLNODE *)pasg);
- }
- if(asCaDebug) printf("asCaTask has cleared all channels\n");
- epicsEventSignal(asCaTaskWait);
+ pasg = (ASG *)ellFirst(&pasbase->asgList);
+ while(pasg) {
+ pasginp = (ASGINP *)ellFirst(&pasg->inpList);
+ while(pasginp) {
+ pcapvt = (CAPVT *)pasginp->capvt;
+ status = ca_clear_channel(pcapvt->chid);
+ if(status!=ECA_NORMAL) {
+ epicsPrintf("asCa ca_clear_channel error %s\n",
+ ca_message(status));
+ }
+ free(pasginp->capvt);
+ pasginp->capvt = 0;
+ pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
+ }
+ pasg = (ASG *)ellNext((ELLNODE *)pasg);
+ }
+ if(asCaDebug) printf("asCaTask has cleared all channels\n");
+ epicsEventSignal(asCaTaskWait);
}
}
-
+
void asCaStart(void)
{
- epicsThreadOpts opts = EPICS_THREAD_OPTS_INIT;
-
- opts.stackSize = epicsThreadGetStackSize(epicsThreadStackBig);
- opts.priority = epicsThreadPriorityScanLow - 3;
- opts.joinable = 1;
-
if(asCaDebug) printf("asCaStart called\n");
if(firstTime) {
firstTime = FALSE;
@@ -242,7 +236,10 @@ void asCaStart(void)
asCaTaskWait=epicsEventMustCreate(epicsEventEmpty);
asCaTaskAddChannels=epicsEventMustCreate(epicsEventEmpty);
asCaTaskClearChannels=epicsEventMustCreate(epicsEventEmpty);
- threadid = epicsThreadCreateOpt("asCaTask", (EPICSTHREADFUNC)asCaTask, 0, &opts);
+ threadid = epicsThreadCreate("asCaTask",
+ (epicsThreadPriorityScanLow - 3),
+ epicsThreadGetStackSize(epicsThreadStackBig),
+ (EPICSTHREADFUNC)asCaTask,0);
if(threadid==0) {
errMessage(0,"asCaStart: taskSpawn Failure\n");
}
@@ -263,8 +260,6 @@ void asCaStop(void)
epicsEventMustWait(asCaTaskWait);
if(asCaDebug) printf("asCaStop done\n");
epicsMutexUnlock(asCaTaskLock);
- epicsThreadMustJoin(threadid);
- threadid = 0;
}
int ascar(int level) { return ascarFP(stdout,level);}
@@ -298,8 +293,8 @@ int ascarFP(FILE *fp,int level)
else if(state==cs_closed) fprintf(fp,"closed");
else fprintf(fp,"unknown");
fprintf(fp," read:%s write:%s",
- (ca_read_access(chid) ? "yes" : "no "),
- (ca_write_access(chid) ? "yes" : "no "));
+ (ca_read_access(chid) ? "yes" : "no "),
+ (ca_write_access(chid) ? "yes" : "no "));
fprintf(fp," %s %s\n", ca_name(chid),ca_host_name(chid));
}
pasginp = (ASGINP *)ellNext((ELLNODE *)pasginp);
diff --git a/modules/database/src/ioc/as/asCa.h b/modules/database/src/ioc/as/asCa.h
index a99cb544a..5a2f05b29 100644
--- a/modules/database/src/ioc/as/asCa.h
+++ b/modules/database/src/ioc/as/asCa.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* asCa.h */
diff --git a/modules/database/src/ioc/as/asDbLib.c b/modules/database/src/ioc/as/asDbLib.c
index 49be480bc..6420a40d5 100644
--- a/modules/database/src/ioc/as/asDbLib.c
+++ b/modules/database/src/ioc/as/asDbLib.c
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* Author: Marty Kraimer Date: 02-11-94*/
@@ -36,32 +36,32 @@
#include "dbStaticLib.h"
#include "recSup.h"
-static char *pacf=NULL;
-static char *psubstitutions=NULL;
-static epicsThreadId asInitTheadId=0;
-static int firstTime = TRUE;
+static char *pacf=NULL;
+static char *psubstitutions=NULL;
+static epicsThreadId asInitTheadId=0;
+static int firstTime = TRUE;
static long asDbAddRecords(void)
{
- DBENTRY dbentry;
- DBENTRY *pdbentry=&dbentry;
- long status;
- dbCommon *precord;
+ DBENTRY dbentry;
+ DBENTRY *pdbentry=&dbentry;
+ long status;
+ dbCommon *precord;
dbInitEntry(pdbbase,pdbentry);
status = dbFirstRecordType(pdbentry);
while(!status) {
- status = dbFirstRecord(pdbentry);
- while(!status) {
- precord = pdbentry->precnode->precord;
- if(!precord->asp) {
- status = asAddMember(&precord->asp, precord->asg);
- if(status) errMessage(status,"asDbAddRecords:asAddMember");
- asPutMemberPvt(precord->asp,precord);
- }
- status = dbNextRecord(pdbentry);
- }
- status = dbNextRecordType(pdbentry);
+ status = dbFirstRecord(pdbentry);
+ while(!status) {
+ precord = pdbentry->precnode->precord;
+ if(!precord->asp) {
+ status = asAddMember(&precord->asp, precord->asg);
+ if(status) errMessage(status,"asDbAddRecords:asAddMember");
+ asPutMemberPvt(precord->asp,precord);
+ }
+ status = dbNextRecord(pdbentry);
+ }
+ status = dbNextRecordType(pdbentry);
}
dbFinishEntry(pdbentry);
return(0);
@@ -92,14 +92,14 @@ int asSetSubstitutions(const char *substitutions)
{
if(psubstitutions) free ((void *)psubstitutions);
if(substitutions) {
- psubstitutions = calloc(1,strlen(substitutions)+1);
- if(!psubstitutions) {
- errMessage(0,"asSetSubstitutions calloc failure");
- } else {
- strcpy(psubstitutions,substitutions);
- }
+ psubstitutions = calloc(1,strlen(substitutions)+1);
+ if(!psubstitutions) {
+ errMessage(0,"asSetSubstitutions calloc failure");
+ } else {
+ strcpy(psubstitutions,substitutions);
+ }
} else {
- psubstitutions = NULL;
+ psubstitutions = NULL;
}
return(0);
}
@@ -117,9 +117,9 @@ static void asInitCommonOnce(void *arg)
static long asInitCommon(void)
{
- long status;
- int asWasActive = asActive;
- int wasFirstTime = firstTime;
+ long status;
+ int asWasActive = asActive;
+ int wasFirstTime = firstTime;
static epicsThreadOnceId asInitCommonOnceFlag = EPICS_THREAD_ONCE_INIT;
@@ -140,11 +140,11 @@ static long asInitCommon(void)
}
status = asInitFile(pacf,psubstitutions);
if(asActive) {
- if(!asWasActive) {
+ if(!asWasActive) {
dbSpcAsRegisterCallback(asSpcAsCallback);
asDbAddRecords();
}
- asCaStart();
+ asCaStart();
}
return(status);
}
@@ -179,8 +179,8 @@ static void asInitTask(ASDBCALLBACK *pcallback)
taskwdRemove(epicsThreadGetIdSelf());
asInitTheadId = 0;
if(pcallback) {
- pcallback->status = status;
- callbackRequest(&pcallback->callback);
+ pcallback->status = status;
+ callbackRequest(&pcallback->callback);
}
}
@@ -188,24 +188,24 @@ int asInitAsyn(ASDBCALLBACK *pcallback)
{
if(!pacf) return(0);
if(asInitTheadId) {
- errMessage(-1,"asInit: asInitTask already active");
- if(pcallback) {
- pcallback->status = S_asLib_InitFailed;
- callbackRequest(&pcallback->callback);
- }
- return(-1);
+ errMessage(-1,"asInit: asInitTask already active");
+ if(pcallback) {
+ pcallback->status = S_asLib_InitFailed;
+ callbackRequest(&pcallback->callback);
+ }
+ return(-1);
}
asInitTheadId = epicsThreadCreate("asInitTask",
(epicsThreadPriorityCAServerHigh + 1),
epicsThreadGetStackSize(epicsThreadStackBig),
(EPICSTHREADFUNC)asInitTask,(void *)pcallback);
if(asInitTheadId==0) {
- errMessage(0,"asInit: epicsThreadCreate Error");
- if(pcallback) {
- pcallback->status = S_asLib_InitFailed;
- callbackRequest(&pcallback->callback);
- }
- asInitTheadId = 0;
+ errMessage(0,"asInit: epicsThreadCreate Error");
+ if(pcallback) {
+ pcallback->status = S_asLib_InitFailed;
+ callbackRequest(&pcallback->callback);
+ }
+ asInitTheadId = 0;
}
return(0);
}
@@ -227,18 +227,18 @@ static void astacCallback(ASCLIENTPVT clientPvt,asClientStatus status)
recordname = (char *)asGetClientPvt(clientPvt);
printf("astac callback %s: status=%d",recordname,status);
printf(" get %s put %s\n",(asCheckGet(clientPvt) ? "Yes" : "No"),
- (asCheckPut(clientPvt) ? "Yes" : "No"));
+ (asCheckPut(clientPvt) ? "Yes" : "No"));
}
int astac(const char *pname,const char *user,const char *location)
{
- DBADDR *paddr;
- long status;
- ASCLIENTPVT *pasclientpvt=NULL;
- dbCommon *precord;
- dbFldDes *pflddes;
- char *puser;
- char *plocation;
+ DBADDR *paddr;
+ long status;
+ ASCLIENTPVT *pasclientpvt=NULL;
+ dbCommon *precord;
+ dbFldDes *pflddes;
+ char *puser;
+ char *plocation;
if (!pname || !user || !location){
printf("Usage: astac \"record name\", \"user\", \"host\"\n");
@@ -248,8 +248,8 @@ int astac(const char *pname,const char *user,const char *location)
pasclientpvt = (ASCLIENTPVT *)(paddr + 1);
status=dbNameToAddr(pname,paddr);
if(status) {
- errMessage(status,"dbNameToAddr error");
- return(1);
+ errMessage(status,"dbNameToAddr error");
+ return(1);
}
precord = paddr->precord;
pflddes = paddr->pfldDes;
@@ -259,20 +259,20 @@ int astac(const char *pname,const char *user,const char *location)
strcpy(plocation,location);
status = asAddClient(pasclientpvt,precord->asp,
- (int)pflddes->as_level,puser,plocation);
+ (int)pflddes->as_level,puser,plocation);
if(status) {
- errMessage(status,"asAddClient error");
- return(1);
+ errMessage(status,"asAddClient error");
+ return(1);
} else {
- asPutClientPvt(*pasclientpvt,(void *)precord->name);
- asRegisterClientCallback(*pasclientpvt,astacCallback);
+ asPutClientPvt(*pasclientpvt,(void *)precord->name);
+ asRegisterClientCallback(*pasclientpvt,astacCallback);
}
return(0);
}
static void myMemberCallback(ASMEMBERPVT memPvt,FILE *fp)
{
- dbCommon *precord;
+ dbCommon *precord;
precord = asGetMemberPvt(memPvt);
if(precord) fprintf(fp," Record:%s",precord->name);
diff --git a/modules/database/src/ioc/as/asDbLib.h b/modules/database/src/ioc/as/asDbLib.h
index 235bbbd4b..289210dd0 100644
--- a/modules/database/src/ioc/as/asDbLib.h
+++ b/modules/database/src/ioc/as/asDbLib.h
@@ -18,8 +18,8 @@
#include "shareLib.h"
typedef struct {
- epicsCallback callback;
- long status;
+ epicsCallback callback;
+ long status;
} ASDBCALLBACK;
struct dbChannel;
diff --git a/modules/database/src/ioc/as/asIocRegister.c b/modules/database/src/ioc/as/asIocRegister.c
index d5926a551..6556cfea4 100644
--- a/modules/database/src/ioc/as/asIocRegister.c
+++ b/modules/database/src/ioc/as/asIocRegister.c
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#include "asLib.h"
@@ -19,7 +19,9 @@
static const iocshArg asSetFilenameArg0 = { "ascf",iocshArgString};
static const iocshArg * const asSetFilenameArgs[] = {&asSetFilenameArg0};
static const iocshFuncDef asSetFilenameFuncDef =
- {"asSetFilename",1,asSetFilenameArgs};
+ {"asSetFilename",1,asSetFilenameArgs,
+ "Set path+file name of ACF file.\n"
+ "No immediate effect. Run as asInit() to (re)load.\n"};
static void asSetFilenameCallFunc(const iocshArgBuf *args)
{
asSetFilename(args[0].sval);
@@ -29,21 +31,25 @@ static void asSetFilenameCallFunc(const iocshArgBuf *args)
static const iocshArg asSetSubstitutionsArg0 = { "substitutions",iocshArgString};
static const iocshArg * const asSetSubstitutionsArgs[] = {&asSetSubstitutionsArg0};
static const iocshFuncDef asSetSubstitutionsFuncDef =
- {"asSetSubstitutions",1,asSetSubstitutionsArgs};
+ {"asSetSubstitutions",1,asSetSubstitutionsArgs,
+ "Set subtitutions used when reading ACF file.\n"
+ "No immediate effect. Run as asInit() to (re)load.\n"};
static void asSetSubstitutionsCallFunc(const iocshArgBuf *args)
{
asSetSubstitutions(args[0].sval);
}
/* asInit */
-static const iocshFuncDef asInitFuncDef = {"asInit",0};
+static const iocshFuncDef asInitFuncDef = {"asInit",0,0,
+ "(Re)load ACF file.\n"};
static void asInitCallFunc(const iocshArgBuf *args)
{
iocshSetError(asInit());
}
/* asdbdump */
-static const iocshFuncDef asdbdumpFuncDef = {"asdbdump",0};
+static const iocshFuncDef asdbdumpFuncDef = {"asdbdump",0,0,
+ "Dump processed ACF file (as read).\n"};
static void asdbdumpCallFunc(const iocshArgBuf *args)
{
asdbdump();
@@ -52,7 +58,8 @@ static void asdbdumpCallFunc(const iocshArgBuf *args)
/* aspuag */
static const iocshArg aspuagArg0 = { "uagname",iocshArgString};
static const iocshArg * const aspuagArgs[] = {&aspuagArg0};
-static const iocshFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs};
+static const iocshFuncDef aspuagFuncDef = {"aspuag",1,aspuagArgs,
+ "Show members of User Access Group.\n"};
static void aspuagCallFunc(const iocshArgBuf *args)
{
aspuag(args[0].sval);
@@ -61,7 +68,8 @@ static void aspuagCallFunc(const iocshArgBuf *args)
/* asphag */
static const iocshArg asphagArg0 = { "hagname",iocshArgString};
static const iocshArg * const asphagArgs[] = {&asphagArg0};
-static const iocshFuncDef asphagFuncDef = {"asphag",1,asphagArgs};
+static const iocshFuncDef asphagFuncDef = {"asphag",1,asphagArgs,
+ "Show members of Host Access Group.\n"};
static void asphagCallFunc(const iocshArgBuf *args)
{
asphag(args[0].sval);
@@ -70,7 +78,8 @@ static void asphagCallFunc(const iocshArgBuf *args)
/* asprules */
static const iocshArg asprulesArg0 = { "asgname",iocshArgString};
static const iocshArg * const asprulesArgs[] = {&asprulesArg0};
-static const iocshFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs};
+static const iocshFuncDef asprulesFuncDef = {"asprules",1,asprulesArgs,
+ "List rules of an Access Security Group.\n"};
static void asprulesCallFunc(const iocshArgBuf *args)
{
asprules(args[0].sval);
@@ -80,7 +89,8 @@ static void asprulesCallFunc(const iocshArgBuf *args)
static const iocshArg aspmemArg0 = { "asgname",iocshArgString};
static const iocshArg aspmemArg1 = { "clients",iocshArgInt};
static const iocshArg * const aspmemArgs[] = {&aspmemArg0,&aspmemArg1};
-static const iocshFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs};
+static const iocshFuncDef aspmemFuncDef = {"aspmem",2,aspmemArgs,
+ "List members of Access Security Group.\n"};
static void aspmemCallFunc(const iocshArgBuf *args)
{
aspmem(args[0].sval,args[1].ival);
@@ -89,9 +99,10 @@ static void aspmemCallFunc(const iocshArgBuf *args)
/* astac */
static const iocshArg astacArg0 = { "recordname",iocshArgString};
static const iocshArg astacArg1 = { "user",iocshArgString};
-static const iocshArg astacArg2 = { "location",iocshArgString};
+static const iocshArg astacArg2 = { "host",iocshArgString};
static const iocshArg * const astacArgs[] = {&astacArg0,&astacArg1,&astacArg2};
-static const iocshFuncDef astacFuncDef = {"astac",3,astacArgs};
+static const iocshFuncDef astacFuncDef = {"astac",3,astacArgs,
+ "Test Access Security privlages granted to user+host.\n"};
static void astacCallFunc(const iocshArgBuf *args)
{
astac(args[0].sval,args[1].sval,args[2].sval);
@@ -100,7 +111,8 @@ static void astacCallFunc(const iocshArgBuf *args)
/* ascar */
static const iocshArg ascarArg0 = { "level",iocshArgInt};
static const iocshArg * const ascarArgs[] = {&ascarArg0};
-static const iocshFuncDef ascarFuncDef = {"ascar",1,ascarArgs};
+static const iocshFuncDef ascarFuncDef = {"ascar",1,ascarArgs,
+ "Report status of PVs used in INP*() Access Security rules.\n"};
static void ascarCallFunc(const iocshArgBuf *args)
{
ascar(args[0].ival);
diff --git a/modules/database/src/ioc/as/asIocRegister.h b/modules/database/src/ioc/as/asIocRegister.h
index a7421cdac..d5b88b4c6 100644
--- a/modules/database/src/ioc/as/asIocRegister.h
+++ b/modules/database/src/ioc/as/asIocRegister.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_asIocRegister_H
diff --git a/modules/database/src/ioc/as/ascheck.c b/modules/database/src/ioc/as/ascheck.c
index 7272ef4ae..a0db819e5 100644
--- a/modules/database/src/ioc/as/ascheck.c
+++ b/modules/database/src/ioc/as/ascheck.c
@@ -7,7 +7,7 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/* Author: Marty Kraimer Date: 03-24-94 */
+/* Author: Marty Kraimer Date: 03-24-94 */
#include
#include
@@ -21,35 +21,35 @@
int main(int argc,char **argv)
{
int argn = 1;
- char *sub = NULL;
- int subLength = 0;
- char **pstr;
- char *psep;
- int *len;
- long status = 0;
+ char *sub = NULL;
+ int subLength = 0;
+ char **pstr;
+ char *psep;
+ int *len;
+ long status = 0;
static char *subSep = ",";
/* Look for -Smacro=value options */
while (argc>argn && (strncmp(argv[argn], "-S", 2)==0)) {
- pstr = ⊂
- psep = subSep;
- len = &subLength;
- if (strlen(argv[argn])==2) {
- dbCatString(pstr, len, argv[++argn], psep);
- } else {
- dbCatString(pstr, len, argv[argn]+2, psep);
- }
- argn++;
+ pstr = ⊂
+ psep = subSep;
+ len = &subLength;
+ if (strlen(argv[argn])==2) {
+ dbCatString(pstr, len, argv[++argn], psep);
+ } else {
+ dbCatString(pstr, len, argv[argn]+2, psep);
+ }
+ argn++;
}
if (argc == argn) {
- status = asInitFP(stdin, sub);
- if(status) errlogPrintf("ascheck: Access Security File failed.\n");
+ status = asInitFP(stdin, sub);
+ if(status) errlogPrintf("ascheck: Access Security File failed.\n");
} else if (argc == argn+1) {
- status = asInitFile(argv[argn], sub);
- if(status) errlogPrintf("ascheck: Access Security File failed.\n");
+ status = asInitFile(argv[argn], sub);
+ if(status) errlogPrintf("ascheck: Access Security File failed.\n");
} else {
- printf("usage: ascheck [-Smac=sub ...] [<] file\n");
- status = -1;
+ printf("usage: ascheck [-Smac=sub ...] [<] file\n");
+ status = -1;
}
errlogFlush();
return status;
diff --git a/modules/database/src/ioc/bpt/cvtTable.h b/modules/database/src/ioc/bpt/cvtTable.h
index 374666450..e7d2cf019 100644
--- a/modules/database/src/ioc/bpt/cvtTable.h
+++ b/modules/database/src/ioc/bpt/cvtTable.h
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* Breakpoint Tables
@@ -15,7 +15,7 @@
*/
#ifndef INCcvtTableh
-#define INCcvtTableh 1
+#define INCcvtTableh 1
#include "shareLib.h"
diff --git a/modules/database/src/ioc/bpt/makeBpt.c b/modules/database/src/ioc/bpt/makeBpt.c
index 93095f1c2..a3f37c152 100644
--- a/modules/database/src/ioc/bpt/makeBpt.c
+++ b/modules/database/src/ioc/bpt/makeBpt.c
@@ -5,12 +5,12 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
- * Author: Marty Kraimer
- * Date: 9/28/95
- * Replacement for old bldCvtTable
+ * Author: Marty Kraimer
+ * Date: 9/28/95
+ * Replacement for old bldCvtTable
*/
#include
@@ -27,40 +27,40 @@
#define MAX_LINE_SIZE 160
#define MAX_BREAKS 100
struct brkCreateInfo {
- double engLow; /* Lowest value desired: engineering units */
- double engHigh; /* Highest value desired: engineering units */
- double rawLow; /* Raw value for EngLow */
- double rawHigh; /* Raw value for EngHigh */
- double accuracy; /* accuracy desired in engineering units */
- double tblEngFirst;/* First table value: engineering units */
- double tblEngLast; /* Last table value: engineering units */
- double tblEngDelta;/* Change per table entry: eng units */
- long nTable; /* number of table entries */
- /* (last-first)/delta + 1 */
- double *pTable; /* addr of data table */
+ double engLow; /* Lowest value desired: engineering units */
+ double engHigh; /* Highest value desired: engineering units */
+ double rawLow; /* Raw value for EngLow */
+ double rawHigh; /* Raw value for EngHigh */
+ double accuracy; /* accuracy desired in engineering units */
+ double tblEngFirst; /* First table value: engineering units */
+ double tblEngLast; /* Last table value: engineering units */
+ double tblEngDelta; /* Change per table entry: eng units */
+ long nTable; /* number of table entries */
+ /* (last-first)/delta + 1 */
+ double *pTable; /* addr of data table */
} brkCreateInfo;
-typedef struct brkInt { /* breakpoint interval */
- double raw; /* raw value for beginning of interval */
- double slope; /* slope for interval */
- double eng; /* converted value for beginning of interval */
+typedef struct brkInt { /* breakpoint interval */
+ double raw; /* raw value for beginning of interval */
+ double slope; /* slope for interval */
+ double eng; /* converted value for beginning of interval */
} brkInt;
brkInt brkint[MAX_BREAKS];
static int create_break(struct brkCreateInfo *pbci, brkInt *pabrkInt,
- int max_breaks, int *n_breaks);
+ int max_breaks, int *n_breaks);
static char inbuf[MAX_LINE_SIZE];
static int linenum=0;
typedef struct dataList{
- struct dataList *next;
- double value;
+ struct dataList *next;
+ double value;
}dataList;
static int getNumber(char **pbeg, double *value)
{
- int nchars=0;
+ int nchars=0;
while(isspace((int)**pbeg) && **pbeg!= '\0') (*pbeg)++;
if(**pbeg == '!' || **pbeg == '\0') return(-1);
@@ -68,7 +68,7 @@ static int getNumber(char **pbeg, double *value)
*pbeg += nchars;
return(0);
}
-
+
static void errExit(char *pmessage)
{
fprintf(stderr, "%s\n", pmessage);
@@ -78,98 +78,98 @@ static void errExit(char *pmessage)
int main(int argc, char **argv)
{
- char *pbeg;
- char *pend;
- double value;
- char *pname = NULL;
- dataList *phead;
- dataList *pdataList;
- dataList *pnext;
- double *pdata;
- long ndata;
- int nBreak,n;
- size_t len;
- char *outFilename;
- char *pext;
- FILE *outFile;
- FILE *inFile;
- char *plastSlash;
-
+ char *pbeg;
+ char *pend;
+ double value;
+ char *pname = NULL;
+ dataList *phead;
+ dataList *pdataList;
+ dataList *pnext;
+ double *pdata;
+ long ndata;
+ int nBreak,n;
+ size_t len;
+ char *outFilename;
+ char *pext;
+ FILE *outFile;
+ FILE *inFile;
+ char *plastSlash;
+
if(argc<2) {
- fprintf(stderr,"usage: makeBpt file.data [outfile]\n");
- exit(-1);
+ fprintf(stderr,"usage: makeBpt file.data [outfile]\n");
+ exit(-1);
}
if (argc==2) {
- plastSlash = strrchr(argv[1],'/');
- plastSlash = (plastSlash ? plastSlash+1 : argv[1]);
- outFilename = calloc(1,strlen(plastSlash)+2);
- if(!outFilename) {
- fprintf(stderr,"calloc failed\n");
- exit(-1);
- }
- strcpy(outFilename,plastSlash);
- pext = strstr(outFilename,".data");
- if(!pext) {
- fprintf(stderr,"Input file MUST have .data extension\n");
- exit(-1);
- }
- strcpy(pext,".dbd");
+ plastSlash = strrchr(argv[1],'/');
+ plastSlash = (plastSlash ? plastSlash+1 : argv[1]);
+ outFilename = calloc(1,strlen(plastSlash)+2);
+ if(!outFilename) {
+ fprintf(stderr,"calloc failed\n");
+ exit(-1);
+ }
+ strcpy(outFilename,plastSlash);
+ pext = strstr(outFilename,".data");
+ if(!pext) {
+ fprintf(stderr,"Input file MUST have .data extension\n");
+ exit(-1);
+ }
+ strcpy(pext,".dbd");
} else {
- outFilename = calloc(1,strlen(argv[2])+1);
- if(!outFilename) {
- fprintf(stderr,"calloc failed\n");
- exit(-1);
- }
- strcpy(outFilename,argv[2]);
+ outFilename = calloc(1,strlen(argv[2])+1);
+ if(!outFilename) {
+ fprintf(stderr,"calloc failed\n");
+ exit(-1);
+ }
+ strcpy(outFilename,argv[2]);
}
inFile = fopen(argv[1],"r");
if(!inFile) {
- fprintf(stderr,"Error opening %s\n",argv[1]);
- exit(-1);
+ fprintf(stderr,"Error opening %s\n",argv[1]);
+ exit(-1);
}
outFile = fopen(outFilename,"w");
if(!outFile) {
- fprintf(stderr,"Error opening %s\n",outFilename);
- exit(-1);
+ fprintf(stderr,"Error opening %s\n",outFilename);
+ exit(-1);
}
while(fgets(inbuf,MAX_LINE_SIZE,inFile)) {
- linenum++;
- pbeg = inbuf;
- while(isspace((int)*pbeg) && *pbeg!= '\0') pbeg++;
- if(*pbeg == '!' || *pbeg == '\0') continue;
- while(*pbeg!='"' && *pbeg!= '\0') pbeg++;
- if(*pbeg!='"' ) errExit("Illegal Header");
- pbeg++; pend = pbeg;
- while(*pend!='"' && *pend!= '\0') pend++;
- if(*pend!='"') errExit("Illegal Header");
- len = pend - pbeg;
- if(len<=1) errExit("Illegal Header");
- pname = calloc(len+1,sizeof(char));
- if(!pname) {
- fprintf(stderr,"calloc failed while processing line %d\n",linenum);
- exit(-1);
- }
- strncpy(pname,pbeg,len);
- pname[len]='\0';
- pbeg = pend + 1;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.engLow = value;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.rawLow = value;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.engHigh = value;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.rawHigh = value;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.accuracy = value;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.tblEngFirst = value;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.tblEngLast = value;
- if(getNumber(&pbeg,&value)) errExit("Illegal Header");
- brkCreateInfo.tblEngDelta = value;
- goto got_header;
+ linenum++;
+ pbeg = inbuf;
+ while(isspace((int)*pbeg) && *pbeg!= '\0') pbeg++;
+ if(*pbeg == '!' || *pbeg == '\0') continue;
+ while(*pbeg!='"' && *pbeg!= '\0') pbeg++;
+ if(*pbeg!='"' ) errExit("Illegal Header");
+ pbeg++; pend = pbeg;
+ while(*pend!='"' && *pend!= '\0') pend++;
+ if(*pend!='"') errExit("Illegal Header");
+ len = pend - pbeg;
+ if(len<=1) errExit("Illegal Header");
+ pname = calloc(len+1,sizeof(char));
+ if(!pname) {
+ fprintf(stderr,"calloc failed while processing line %d\n",linenum);
+ exit(-1);
+ }
+ strncpy(pname,pbeg,len);
+ pname[len]='\0';
+ pbeg = pend + 1;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.engLow = value;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.rawLow = value;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.engHigh = value;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.rawHigh = value;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.accuracy = value;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.tblEngFirst = value;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.tblEngLast = value;
+ if(getNumber(&pbeg,&value)) errExit("Illegal Header");
+ brkCreateInfo.tblEngDelta = value;
+ goto got_header;
}
errExit("Illegal Header");
got_header:
@@ -177,48 +177,48 @@ got_header:
ndata = 0;
errno = 0;
while(fgets(inbuf,MAX_LINE_SIZE,inFile)) {
- double value;
+ double value;
- linenum++;
- pbeg = inbuf;
- while(!getNumber(&pbeg,&value)) {
- ndata++;
- pdataList = (dataList *)calloc(1,sizeof(dataList));
- if(!pdataList) {
- fprintf(stderr,"calloc failed (after header)"
- " while processing line %d\n",linenum);
- exit(-1);
- }
- if(!phead)
- phead = pdataList;
- else
- pnext->next = pdataList;
- pdataList->value = value;
- pnext = pdataList;
- }
+ linenum++;
+ pbeg = inbuf;
+ while(!getNumber(&pbeg,&value)) {
+ ndata++;
+ pdataList = (dataList *)calloc(1,sizeof(dataList));
+ if(!pdataList) {
+ fprintf(stderr,"calloc failed (after header)"
+ " while processing line %d\n",linenum);
+ exit(-1);
+ }
+ if(!phead)
+ phead = pdataList;
+ else
+ pnext->next = pdataList;
+ pdataList->value = value;
+ pnext = pdataList;
+ }
}
if(!pname) {
- errExit("create_break failed: no name specified\n");
+ errExit("create_break failed: no name specified\n");
}
brkCreateInfo.nTable = ndata;
pdata = (double *)calloc(brkCreateInfo.nTable,sizeof(double));
if(!pdata) {
- fprintf(stderr,"calloc failed for table length %ld\n",brkCreateInfo.nTable);
- exit(-1);
+ fprintf(stderr,"calloc failed for table length %ld\n",brkCreateInfo.nTable);
+ exit(-1);
}
pnext = phead;
for(n=0; nvalue;
- pdataList = pnext;
- pnext = pnext->next;
- free((void *)pdataList);
+ pdata[n] = pnext->value;
+ pdataList = pnext;
+ pnext = pnext->next;
+ free((void *)pdataList);
}
brkCreateInfo.pTable = pdata;
- if(create_break(&brkCreateInfo,&brkint[0],MAX_BREAKS,&nBreak))
- errExit("create_break failed\n");
+ if(create_break(&brkCreateInfo,&brkint[0],MAX_BREAKS,&nBreak))
+ errExit("create_break failed\n");
fprintf(outFile,"breaktable(%s) {\n",pname);
for(n=0; nengLow >= pbci->engHigh) {
- errExit("create_break: engLow >= engHigh");
- return (-1);
+ errExit("create_break: engLow >= engHigh");
+ return (-1);
}
if ((pbci->engLow < pbci->tblEngFirst)
- || (pbci->engHigh > pbci->tblEngLast)) {
- errExit("create_break: engLow > engHigh");
- return (-1);
+ || (pbci->engHigh > pbci->tblEngLast)) {
+ errExit("create_break: engLow > engHigh");
+ return (-1);
}
if (pbci->tblEngDelta <= 0.0) {
- errExit("create_break: tblEngDelta <= 0.0");
- return (-1);
+ errExit("create_break: tblEngDelta <= 0.0");
+ return (-1);
}
if (ntable < 3) {
- errExit("raw data must have at least 3 elements");
- return (-1);
+ errExit("raw data must have at least 3 elements");
+ return (-1);
}
/***************************************************************************
- Convert Table to raw values
+ Convert Table to raw values
*
* raw and table values are assumed to be related by an equation of the form:
*
@@ -296,23 +296,23 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
ilow = (pbci->engLow - pbci->tblEngFirst) / (pbci->tblEngDelta);
i = (int) ilow;
if (i >= ntable - 1)
- i = ntable - 2;
+ i = ntable - 2;
tbllow = table[i] + (table[i + 1] - table[i]) * (ilow - (double) i);
/* Find engHigh in Table and then compute tblHigh */
ihigh = (pbci->engHigh - pbci->tblEngFirst) / (pbci->tblEngDelta);
i = (int) ihigh;
if (i >= ntable - 1)
- i = ntable - 2;
+ i = ntable - 2;
tblhigh = table[i] + (table[i + 1] - table[i]) * (ihigh - (double) i);
/* compute slope and offset */
slope = (pbci->rawHigh - pbci->rawLow) / (tblhigh - tbllow);
offset = pbci->rawHigh - slope * tblhigh;
/* convert table to raw units */
for (i = 0; i < ntable; i++)
- table[i] = table[i] * slope + offset;
+ table[i] = table[i] * slope + offset;
/*****************************************************************************
- * Now create break point table
+ * Now create break point table
*
* The algorithm does the following:
*
@@ -320,11 +320,11 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
*
* 1) Use a relatively large portion of the remaining table as an interval
* 2) It attempts to use the entire interval as a breakpoint interval
- * Success is determined by the following algorithm:
- * a) compute the slope using the entire interval
+ * Success is determined by the following algorithm:
+ * a) compute the slope using the entire interval
* b) for each table entry in the interval determine the eng value
- * using the slope just determined.
- * c) compare the computed value with eng value associated with table
+ * using the slope just determined.
+ * c) compare the computed value with eng value associated with table
* d) if all table entries are within the accuracy desired then success.
* 3) If successful then attempt to expand the interval and try again.
* Note that it is expanded by up to 1/10 of the table size.
@@ -337,7 +337,7 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
/* Must start with table entry corresponding to engLow; */
i = (int) ilow;
if (i >= ntable - 1)
- i = ntable - 2;
+ i = ntable - 2;
rawBeg = table[i] + (table[i + 1] - table[i]) * (ilow - (double) i);
engBeg = pbci->engLow;
ibeg = (int) (ilow); /* Make sure that ibeg > ilow */
@@ -349,77 +349,77 @@ static int create_break( struct brkCreateInfo *pbci, brkInt *pabrkInt,
pbrkInt->eng = engBeg;
/* determine next breakpoint interval */
while ((engBeg <= pbci->engHigh) && (ibeg < ntable - 1)) {
- /* determine next interval to try. Up to 1/10 full range */
- rawEnd = rawBeg;
- engEnd = engBeg;
- iend = ibeg;
- inc = (int) ((ihigh - ilow) / 10.0);
- if (inc < 1)
- inc = 1;
- valid = TRUE;
- /* keep trying intervals until cant do better */
- expanding = TRUE; /* originally we are trying larger and larger
- * intervals */
- while (valid) {
- imax = iend + inc;
- if (imax >= ntable) {
- /* don't go past end of table */
- imax = ntable - 1;
- inc = ntable - iend - 1;
- expanding = FALSE;
- }
- if (imax > (int) (ihigh + 1.0)) { /* Don't go to far past
- * engHigh */
- imax = (int) (ihigh + 1.0);
- inc = (int) (ihigh + 1.0) - iend;
- expanding = FALSE;
- }
- if (imax <= ibeg)
- break; /* failure */
- rawEnd = table[imax];
- engEnd = pbci->tblEngFirst + (double) imax *(pbci->tblEngDelta);
- slope = (engEnd - engBeg) / (rawEnd - rawBeg);
- all_ok = TRUE;
- for (i = ibeg + 1; i <= imax; i++) {
- engCalc = engBeg + slope * (table[i] - rawBeg);
- engActual = pbci->tblEngFirst + ((double) i) * (pbci->tblEngDelta);
- error = engCalc - engActual;
- if (error < 0.0)
- error = -error;
- if (error >= pbci->accuracy) {
- /* we will be trying smaller intervals */
- expanding = FALSE;
- /* just decrease inc and let while(valid) try again */
- inc--;
- all_ok = FALSE;
- break;
- }
- } /* end for */
- if (all_ok) {
- iend = imax;
- /* if not expanding we found interval */
- if (!expanding)
- break;
- /* will automatically try larger interval */
- }
- } /* end while(valid) */
- /* either we failed or optimal interval has been found */
- if ((iend <= ibeg) && (iend < (int) ihigh)) {
- errExit("Could not meet accuracy criteria");
- return (-1);
- }
- pbrkInt->slope = slope;
- /* get ready for next breakpoint interval */
- if (n++ >= max_breaks) {
- errExit("Break point table too large");
- return (-1);
- }
- ibeg = iend;
- pbrkInt++;
- rawBeg = rawEnd;
- engBeg = engEnd;
- pbrkInt->raw = rawBeg;
- pbrkInt->eng = engBeg + (pbrkInt->raw - rawBeg) * slope;
+ /* determine next interval to try. Up to 1/10 full range */
+ rawEnd = rawBeg;
+ engEnd = engBeg;
+ iend = ibeg;
+ inc = (int) ((ihigh - ilow) / 10.0);
+ if (inc < 1)
+ inc = 1;
+ valid = TRUE;
+ /* keep trying intervals until cant do better */
+ expanding = TRUE; /* originally we are trying larger and larger
+ * intervals */
+ while (valid) {
+ imax = iend + inc;
+ if (imax >= ntable) {
+ /* don't go past end of table */
+ imax = ntable - 1;
+ inc = ntable - iend - 1;
+ expanding = FALSE;
+ }
+ if (imax > (int) (ihigh + 1.0)) { /* Don't go to far past
+ * engHigh */
+ imax = (int) (ihigh + 1.0);
+ inc = (int) (ihigh + 1.0) - iend;
+ expanding = FALSE;
+ }
+ if (imax <= ibeg)
+ break; /* failure */
+ rawEnd = table[imax];
+ engEnd = pbci->tblEngFirst + (double) imax *(pbci->tblEngDelta);
+ slope = (engEnd - engBeg) / (rawEnd - rawBeg);
+ all_ok = TRUE;
+ for (i = ibeg + 1; i <= imax; i++) {
+ engCalc = engBeg + slope * (table[i] - rawBeg);
+ engActual = pbci->tblEngFirst + ((double) i) * (pbci->tblEngDelta);
+ error = engCalc - engActual;
+ if (error < 0.0)
+ error = -error;
+ if (error >= pbci->accuracy) {
+ /* we will be trying smaller intervals */
+ expanding = FALSE;
+ /* just decrease inc and let while(valid) try again */
+ inc--;
+ all_ok = FALSE;
+ break;
+ }
+ } /* end for */
+ if (all_ok) {
+ iend = imax;
+ /* if not expanding we found interval */
+ if (!expanding)
+ break;
+ /* will automatically try larger interval */
+ }
+ } /* end while(valid) */
+ /* either we failed or optimal interval has been found */
+ if ((iend <= ibeg) && (iend < (int) ihigh)) {
+ errExit("Could not meet accuracy criteria");
+ return (-1);
+ }
+ pbrkInt->slope = slope;
+ /* get ready for next breakpoint interval */
+ if (n++ >= max_breaks) {
+ errExit("Break point table too large");
+ return (-1);
+ }
+ ibeg = iend;
+ pbrkInt++;
+ rawBeg = rawEnd;
+ engBeg = engEnd;
+ pbrkInt->raw = rawBeg;
+ pbrkInt->eng = engBeg + (pbrkInt->raw - rawBeg) * slope;
}
pbrkInt->slope = 0.0;
*n_breaks = n;
diff --git a/modules/database/src/ioc/databaseVersion.h b/modules/database/src/ioc/databaseVersion.h@
similarity index 50%
rename from modules/database/src/ioc/databaseVersion.h
rename to modules/database/src/ioc/databaseVersion.h@
index eb5e4d732..efd837b26 100644
--- a/modules/database/src/ioc/databaseVersion.h
+++ b/modules/database/src/ioc/databaseVersion.h@
@@ -5,23 +5,17 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
-#ifndef DATABASEVERSION_H
-#define DATABASEVERSION_H
+#ifndef INC_databaseVersion_H
+#define INC_databaseVersion_H
+
+#define EPICS_DATABASE_MAJOR_VERSION @EPICS_DATABASE_MAJOR_VERSION@
+#define EPICS_DATABASE_MINOR_VERSION @EPICS_DATABASE_MINOR_VERSION@
+#define EPICS_DATABASE_MAINTENANCE_VERSION @EPICS_DATABASE_MAINTENANCE_VERSION@
+#define EPICS_DATABASE_DEVELOPMENT_FLAG @EPICS_DATABASE_DEVELOPMENT_FLAG@
#include
-#ifndef VERSION_INT
-# define VERSION_INT(V,R,M,P) ( ((V)<<24) | ((R)<<16) | ((M)<<8) | (P))
-#endif
+#define DATABASE_VERSION_INT VERSION_INT(EPICS_DATABASE_MAJOR_VERSION, \
+ EPICS_DATABASE_MINOR_VERSION, EPICS_DATABASE_MAINTENANCE_VERSION, 0)
-/* include generated headers with:
- * EPICS_DATABASE_MAJOR_VERSION
- * EPICS_DATABASE_MINOR_VERSION
- * EPICS_DATABASE_MAINTENANCE_VERSION
- * EPICS_DATABASE_DEVELOPMENT_FLAG
- */
-#include "databaseVersionNum.h"
-
-#define DATABASE_VERSION_INT VERSION_INT(EPICS_DATABASE_MAJOR_VERSION, EPICS_DATABASE_MINOR_VERSION, EPICS_DATABASE_MAINTENANCE_VERSION, 0)
-
-#endif // DATABASEVERSION_H
+#endif /* INC_databaseVersion_H */
diff --git a/modules/database/src/ioc/databaseVersionNum.h@ b/modules/database/src/ioc/databaseVersionNum.h@
deleted file mode 100644
index 02184a81b..000000000
--- a/modules/database/src/ioc/databaseVersionNum.h@
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef DATABASEVERSION_H
-# error include databaseVersion.h, not this header
-#endif
-#define EPICS_DATABASE_MAJOR_VERSION @EPICS_DATABASE_MAJOR_VERSION@
-#define EPICS_DATABASE_MINOR_VERSION @EPICS_DATABASE_MINOR_VERSION@
-#define EPICS_DATABASE_MAINTENANCE_VERSION @EPICS_DATABASE_MAINTENANCE_VERSION@
-#define EPICS_DATABASE_DEVELOPMENT_FLAG @EPICS_DATABASE_DEVELOPMENT_FLAG@
diff --git a/modules/database/src/ioc/db/Makefile b/modules/database/src/ioc/db/Makefile
index 7e9d56704..2dbf89192 100644
--- a/modules/database/src/ioc/db/Makefile
+++ b/modules/database/src/ioc/db/Makefile
@@ -4,7 +4,7 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
-# in file LICENSE that is included with this distribution.
+# in file LICENSE that is included with this distribution.
#*************************************************************************
# This is a Makefile fragment, see src/ioc/Makefile.
@@ -63,6 +63,9 @@ DBDINC += dbCommon
dbMenusPod = $(notdir $(wildcard ../db/menu*.dbd.pod))
HTMLS += $(patsubst %.dbd.pod,%.html,$(dbMenusPod))
+HTMLS += dbCommonRecord.html
+HTMLS += dbCommonInput.html
+HTMLS += dbCommonOutput.html
dbCore_SRCS += dbLock.c
dbCore_SRCS += dbAccess.c
@@ -98,4 +101,3 @@ dbCore_SRCS += dbState.c
dbCore_SRCS += dbUnitTest.c
dbCore_SRCS += dbServer.c
dbCore_SRCS_vxWorks += templateInstances.cpp
-
diff --git a/modules/database/src/ioc/db/RULES b/modules/database/src/ioc/db/RULES
index 5f11a4cc6..c7dbfe8ef 100644
--- a/modules/database/src/ioc/db/RULES
+++ b/modules/database/src/ioc/db/RULES
@@ -6,21 +6,25 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
-# in file LICENSE that is included with this distribution.
+# in file LICENSE that is included with this distribution.
#*************************************************************************
# This is a Makefile fragment, see src/ioc/Makefile.
-dbCommon.h$(DEP): $(IOCDIR)/db/dbCommonRecord.dbd $(IOCDIR)/db/RULES
- @$(RM) $@
- @$(DBTORECORDTYPEH) -D -I ../db -o $(COMMONDEP_TARGET) $< > $@
+THESE_RULES := $(IOCDIR)/db/RULES
-$(COMMON_DIR)/dbCommon.h: $(IOCDIR)/db/dbCommonRecord.dbd $(IOCDIR)/db/RULES
+dbCommon.h$(DEP): $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES)
+ @$(RM) $@
+ @$(DBTORECORDTYPEH) -D -I ../db -I $(COMMON_DIR) -o $(COMMONDEP_TARGET) $< > $@
+
+$(COMMON_DIR)/dbCommonRecord.html: ../db/dbCommon.dbd.pod
+
+$(COMMON_DIR)/dbCommon.h: $(COMMON_DIR)/dbCommonRecord.dbd $(THESE_RULES)
@$(RM) $(notdir $@)
- $(DBTORECORDTYPEH) -I ../db -o $(notdir $@) $<
+ $(DBTORECORDTYPEH) -I ../db -I $(COMMON_DIR) -o $(notdir $@) $<
@$(MV) $(notdir $@) $@
-$(COMMON_DIR)/menuGlobal.dbd: $(IOCDIR)/db/Makefile $(IOCDIR)/db/RULES
+$(COMMON_DIR)/menuGlobal.dbd: $(IOCDIR)/db/Makefile $(THESE_RULES)
# This is a target-specific variable
$(COMMON_DIR)/menuGlobal.dbd: DBDCAT_COMMAND = \
diff --git a/modules/database/src/ioc/db/callback.c b/modules/database/src/ioc/db/callback.c
index bbd798ed4..30ceb118c 100644
--- a/modules/database/src/ioc/db/callback.c
+++ b/modules/database/src/ioc/db/callback.c
@@ -9,10 +9,10 @@
\*************************************************************************/
/* callback.c */
-/* general purpose callback tasks */
+/* general purpose callback tasks */
/*
* Original Author: Marty Kraimer
- * Date: 07-18-91
+ * Date: 07-18-91
*/
#include
@@ -65,7 +65,7 @@ static cbQueueSet callbackQueue[NUM_CALLBACK_PRIORITIES];
int callbackThreadsDefault = 1;
/* Don't know what a reasonable default is (yet).
* For the time being: parallel means 2 if not explicitly specified */
-epicsShareDef int callbackParallelThreadsDefault = 2;
+int callbackParallelThreadsDefault = 2;
epicsExportAddress(int,callbackParallelThreadsDefault);
/* Timer for Delayed Requests */
diff --git a/modules/database/src/ioc/db/callback.h b/modules/database/src/ioc/db/callback.h
index a77a888f9..c86a9a840 100644
--- a/modules/database/src/ioc/db/callback.h
+++ b/modules/database/src/ioc/db/callback.h
@@ -5,13 +5,13 @@
* Operator of Los Alamos National Laboratory.
* Copyright (c) 2013 ITER Organization.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/* includes for general purpose callback tasks */
+/* includes for general purpose callback tasks */
/*
* Original Author: Marty Kraimer
- * Date: 07-18-91
+ * Date: 07-18-91
*/
#ifndef INCcallbackh
@@ -27,9 +27,9 @@ extern "C" {
* WINDOWS also has a "CALLBACK" type def
*/
#if defined(_WIN32) && !defined(EPICS_NO_CALLBACK)
-# ifdef CALLBACK
-# undef CALLBACK
-# endif /*CALLBACK*/
+# ifdef CALLBACK
+# undef CALLBACK
+# endif /*CALLBACK*/
#endif /*_WIN32*/
#define NUM_CALLBACK_PRIORITIES 3
@@ -38,9 +38,9 @@ extern "C" {
#define priorityHigh 2
typedef struct callbackPvt {
- void (*callback)(struct callbackPvt*);
- int priority;
- void *user; /*for use by callback user*/
+ void (*callback)(struct callbackPvt*);
+ int priority;
+ void *user; /*for use by callback user*/
void *timer; /*for use by callback itself*/
}epicsCallback;
diff --git a/modules/database/src/ioc/db/cvtBpt.c b/modules/database/src/ioc/db/cvtBpt.c
index 2689483ee..54c9b71ae 100644
--- a/modules/database/src/ioc/db/cvtBpt.c
+++ b/modules/database/src/ioc/db/cvtBpt.c
@@ -5,14 +5,14 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-
+
/* cvtBpt.c - Convert using breakpoint table
*
* Author: Marty Kraimer
* Date: 04OCT95
- * This is adaptation of old bldCvtTable
+ * This is adaptation of old bldCvtTable
*/
#include "epicsPrint.h"
@@ -24,179 +24,179 @@
#include "dbStaticLib.h"
static brkTable *findBrkTable(short linr)
-{
- dbMenu *pdbMenu;
+{
+ dbMenu *pdbMenu;
pdbMenu = dbFindMenu(pdbbase,"menuConvert");
if (!pdbMenu) {
- epicsPrintf("findBrkTable: menuConvert not loaded!\n");
- return NULL;
+ epicsPrintf("findBrkTable: menuConvert not loaded!\n");
+ return NULL;
}
if (linr < 0 || linr >= pdbMenu->nChoice) {
- epicsPrintf("findBrkTable: linr=%d but menuConvert only has %d choices\n",
- linr,pdbMenu->nChoice);
- return NULL;
+ epicsPrintf("findBrkTable: linr=%d but menuConvert only has %d choices\n",
+ linr,pdbMenu->nChoice);
+ return NULL;
}
return dbFindBrkTable(pdbbase,pdbMenu->papChoiceValue[linr]);
}
/* Used by both ao and ai record types */
long cvtRawToEngBpt(double *pval, short linr, short init,
- void **ppbrk, short *plbrk)
+ void **ppbrk, short *plbrk)
{
- double val = *pval;
- long status = 0;
- brkTable *pbrkTable;
- brkInt *pInt, *nInt;
- short lbrk;
- int number;
+ double val = *pval;
+ long status = 0;
+ brkTable *pbrkTable;
+ brkInt *pInt, *nInt;
+ short lbrk;
+ int number;
if (linr < 2)
- return -1;
+ return -1;
if (init || *ppbrk == NULL) {
- pbrkTable = findBrkTable(linr);
- if (!pbrkTable)
- return S_dbLib_badField;
-
- *ppbrk = (void *)pbrkTable;
- *plbrk = 0;
+ pbrkTable = findBrkTable(linr);
+ if (!pbrkTable)
+ return S_dbLib_badField;
+
+ *ppbrk = (void *)pbrkTable;
+ *plbrk = 0;
} else
- pbrkTable = (brkTable *)*ppbrk;
-
+ pbrkTable = (brkTable *)*ppbrk;
+
number = pbrkTable->number;
lbrk = *plbrk;
-
+
/* Limit index to the size of the table */
if (lbrk < 0)
- lbrk = 0;
+ lbrk = 0;
else if (lbrk > number-2)
- lbrk = number-2;
-
+ lbrk = number-2;
+
pInt = & pbrkTable->paBrkInt[lbrk];
nInt = pInt + 1;
-
+
if (nInt->raw > pInt->raw) {
- /* raw values increase down the table */
- while (val > nInt->raw) {
- lbrk++;
- pInt = nInt++;
- if (lbrk > number-2) {
- status = 1;
- break;
- }
- }
- while (val < pInt->raw) {
- if (lbrk <= 0) {
- status = 1;
- break;
- }
- lbrk--;
- nInt = pInt--;
- }
+ /* raw values increase down the table */
+ while (val > nInt->raw) {
+ lbrk++;
+ pInt = nInt++;
+ if (lbrk > number-2) {
+ status = 1;
+ break;
+ }
+ }
+ while (val < pInt->raw) {
+ if (lbrk <= 0) {
+ status = 1;
+ break;
+ }
+ lbrk--;
+ nInt = pInt--;
+ }
} else {
- /* raw values decrease down the table */
- while (val <= nInt->raw) {
- lbrk++;
- pInt = nInt++;
- if (lbrk > number-2) {
- status = 1;
- break;
- }
- }
- while(val > pInt->raw) {
- if (lbrk <= 0) {
- status = 1;
- break;
- }
- lbrk--;
- nInt = pInt--;
- }
+ /* raw values decrease down the table */
+ while (val <= nInt->raw) {
+ lbrk++;
+ pInt = nInt++;
+ if (lbrk > number-2) {
+ status = 1;
+ break;
+ }
+ }
+ while(val > pInt->raw) {
+ if (lbrk <= 0) {
+ status = 1;
+ break;
+ }
+ lbrk--;
+ nInt = pInt--;
+ }
}
-
+
*plbrk = lbrk;
*pval = pInt->eng + (val - pInt->raw) * pInt->slope;
-
+
return status;
}
/* Used by the ao record type */
long cvtEngToRawBpt(double *pval, short linr, short init,
- void **ppbrk, short *plbrk)
+ void **ppbrk, short *plbrk)
{
- double val = *pval;
- long status = 0;
- brkTable *pbrkTable;
- brkInt *pInt, *nInt;
- short lbrk;
- int number;
+ double val = *pval;
+ long status = 0;
+ brkTable *pbrkTable;
+ brkInt *pInt, *nInt;
+ short lbrk;
+ int number;
if (linr < 2)
- return -1;
-
+ return -1;
+
if (init || *ppbrk == NULL) { /*must find breakpoint table*/
- pbrkTable = findBrkTable(linr);
- if (!pbrkTable)
- return S_dbLib_badField;
-
- *ppbrk = (void *)pbrkTable;
- /* start at the beginning */
- *plbrk = 0;
+ pbrkTable = findBrkTable(linr);
+ if (!pbrkTable)
+ return S_dbLib_badField;
+
+ *ppbrk = (void *)pbrkTable;
+ /* start at the beginning */
+ *plbrk = 0;
} else
- pbrkTable = (brkTable *)*ppbrk;
-
+ pbrkTable = (brkTable *)*ppbrk;
+
number = pbrkTable->number;
lbrk = *plbrk;
-
+
/* Limit index to the size of the table */
if (lbrk < 0)
- lbrk = 0;
+ lbrk = 0;
else if (lbrk > number-2)
- lbrk = number-2;
-
+ lbrk = number-2;
+
pInt = & pbrkTable->paBrkInt[lbrk];
nInt = pInt + 1;
-
+
if (nInt->eng > pInt->eng) {
- /* eng values increase down the table */
- while (val > nInt->eng) {
- lbrk++;
- pInt = nInt++;
- if (lbrk > number-2) {
- status = 1;
- break;
- }
- }
- while (val < pInt->eng) {
- if (lbrk <= 0) {
- status = 1;
- break;
- }
- lbrk--;
- nInt = pInt--;
- }
+ /* eng values increase down the table */
+ while (val > nInt->eng) {
+ lbrk++;
+ pInt = nInt++;
+ if (lbrk > number-2) {
+ status = 1;
+ break;
+ }
+ }
+ while (val < pInt->eng) {
+ if (lbrk <= 0) {
+ status = 1;
+ break;
+ }
+ lbrk--;
+ nInt = pInt--;
+ }
} else {
- /* eng values decrease down the table */
- while (val <= nInt->eng) {
- lbrk++;
- pInt = nInt++;
- if (lbrk > number-2) {
- status = 1;
- break;
- }
- }
- while (val > pInt->eng) {
- if (lbrk <= 0) {
- status = 1;
- break;
- }
- lbrk--;
- nInt = pInt--;
- }
+ /* eng values decrease down the table */
+ while (val <= nInt->eng) {
+ lbrk++;
+ pInt = nInt++;
+ if (lbrk > number-2) {
+ status = 1;
+ break;
+ }
+ }
+ while (val > pInt->eng) {
+ if (lbrk <= 0) {
+ status = 1;
+ break;
+ }
+ lbrk--;
+ nInt = pInt--;
+ }
}
-
+
*plbrk = lbrk;
*pval = pInt->raw + (val - pInt->eng) / pInt->slope;
-
+
return status;
}
diff --git a/modules/database/src/ioc/db/dbAccess.c b/modules/database/src/ioc/db/dbAccess.c
index 19f60381d..40d522b94 100644
--- a/modules/database/src/ioc/db/dbAccess.c
+++ b/modules/database/src/ioc/db/dbAccess.c
@@ -62,15 +62,15 @@
#include "recSup.h"
#include "special.h"
-epicsShareDef struct dbBase *pdbbase = 0;
-epicsShareDef volatile int interruptAccept=FALSE;
+struct dbBase *pdbbase = 0;
+volatile int interruptAccept=FALSE;
-epicsShareDef int dbAccessDebugPUTF = 0;
+int dbAccessDebugPUTF = 0;
epicsExportAddress(int, dbAccessDebugPUTF);
/* Hook Routines */
-epicsShareDef DB_LOAD_RECORDS_HOOK_ROUTINE dbLoadRecordsHook = NULL;
+DB_LOAD_RECORDS_HOOK_ROUTINE dbLoadRecordsHook = NULL;
static short mapDBFToDBR[DBF_NTYPES] = {
/* DBF_STRING => */ DBR_STRING,
@@ -111,176 +111,176 @@ void dbSpcAsRegisterCallback(SPC_ASCALLBACK func)
long dbPutSpecial(DBADDR *paddr,int pass)
{
- long int (*pspecial)()=NULL;
+ long int (*pspecial)()=NULL;
rset *prset;
- dbCommon *precord = paddr->precord;
- long status=0;
- long special=paddr->special;
+ dbCommon *precord = paddr->precord;
+ long status=0;
+ long special=paddr->special;
prset = dbGetRset(paddr);
if(special<100) { /*global processing*/
- if((special==SPC_NOMOD) && (pass==0)) {
- status = S_db_noMod;
- recGblDbaddrError(status,paddr,"dbPut");
- return(status);
- }else if(special==SPC_SCAN){
- if(pass==0)
- scanDelete(precord);
- else
- scanAdd(precord);
- }else if((special==SPC_AS) && (pass==1)) {
+ if((special==SPC_NOMOD) && (pass==0)) {
+ status = S_db_noMod;
+ recGblDbaddrError(status,paddr,"dbPut");
+ return(status);
+ }else if(special==SPC_SCAN){
+ if(pass==0)
+ scanDelete(precord);
+ else
+ scanAdd(precord);
+ }else if((special==SPC_AS) && (pass==1)) {
if(spcAsCallback) (*spcAsCallback)(precord);
- }
+ }
}else {
- if( prset && (pspecial = (prset->special))) {
- status=(*pspecial)(paddr,pass);
- if(status) return(status);
- } else if(pass==0){
- recGblRecSupError(S_db_noSupport,paddr,"dbPut", "special");
- return(S_db_noSupport);
- }
+ if( prset && (pspecial = (prset->special))) {
+ status=(*pspecial)(paddr,pass);
+ if(status) return(status);
+ } else if(pass==0){
+ recGblRecSupError(S_db_noSupport,paddr,"dbPut", "special");
+ return(S_db_noSupport);
+ }
}
return(0);
}
static void get_enum_strs(DBADDR *paddr, char **ppbuffer,
- rset *prset,long *options)
+ rset *prset,long *options)
{
- short field_type=paddr->field_type;
- dbFldDes *pdbFldDes = paddr->pfldDes;
- dbMenu *pdbMenu;
- dbDeviceMenu *pdbDeviceMenu;
- char **papChoice;
- unsigned long no_str;
- char *ptemp;
- struct dbr_enumStrs *pdbr_enumStrs=(struct dbr_enumStrs*)(*ppbuffer);
+ short field_type=paddr->field_type;
+ dbFldDes *pdbFldDes = paddr->pfldDes;
+ dbMenu *pdbMenu;
+ dbDeviceMenu *pdbDeviceMenu;
+ char **papChoice;
+ unsigned long no_str;
+ char *ptemp;
+ struct dbr_enumStrs *pdbr_enumStrs=(struct dbr_enumStrs*)(*ppbuffer);
unsigned int i;
- memset(pdbr_enumStrs,'\0',dbr_enumStrs_size);
- switch(field_type) {
- case DBF_ENUM:
- if( prset && prset->get_enum_strs ) {
- (*prset->get_enum_strs)(paddr,pdbr_enumStrs);
- } else {
- *options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
- }
- break;
- case DBF_MENU:
- pdbMenu = (dbMenu *)pdbFldDes->ftPvt;
- no_str = pdbMenu->nChoice;
- papChoice= pdbMenu->papChoiceValue;
- goto choice_common;
- case DBF_DEVICE:
- pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt;
+ memset(pdbr_enumStrs,'\0',dbr_enumStrs_size);
+ switch(field_type) {
+ case DBF_ENUM:
+ if( prset && prset->get_enum_strs ) {
+ (*prset->get_enum_strs)(paddr,pdbr_enumStrs);
+ } else {
+ *options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
+ }
+ break;
+ case DBF_MENU:
+ pdbMenu = (dbMenu *)pdbFldDes->ftPvt;
+ no_str = pdbMenu->nChoice;
+ papChoice= pdbMenu->papChoiceValue;
+ goto choice_common;
+ case DBF_DEVICE:
+ pdbDeviceMenu = (dbDeviceMenu *)pdbFldDes->ftPvt;
if(!pdbDeviceMenu) {
*options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
break;
}
- no_str = pdbDeviceMenu->nChoice;
- papChoice = pdbDeviceMenu->papChoice;
- goto choice_common;
+ no_str = pdbDeviceMenu->nChoice;
+ papChoice = pdbDeviceMenu->papChoice;
+ goto choice_common;
choice_common:
- i = sizeof(pdbr_enumStrs->strs)/
- sizeof(pdbr_enumStrs->strs[0]);
- if(ino_str = no_str;
- ptemp = &(pdbr_enumStrs->strs[0][0]);
- for (i=0; istrs[0]));
- *(ptemp+sizeof(pdbr_enumStrs->strs[0])-1) = 0;
- }
- ptemp += sizeof(pdbr_enumStrs->strs[0]);
- }
- break;
- default:
- *options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
- break;
- }
- *ppbuffer = ((char *)*ppbuffer) + dbr_enumStrs_size;
- return;
+ i = sizeof(pdbr_enumStrs->strs)/
+ sizeof(pdbr_enumStrs->strs[0]);
+ if(ino_str = no_str;
+ ptemp = &(pdbr_enumStrs->strs[0][0]);
+ for (i=0; istrs[0]));
+ *(ptemp+sizeof(pdbr_enumStrs->strs[0])-1) = 0;
+ }
+ ptemp += sizeof(pdbr_enumStrs->strs[0]);
+ }
+ break;
+ default:
+ *options = (*options)^DBR_ENUM_STRS;/*Turn off option*/
+ break;
+ }
+ *ppbuffer = ((char *)*ppbuffer) + dbr_enumStrs_size;
+ return;
}
static void get_graphics(DBADDR *paddr, char **ppbuffer,
- rset *prset,long *options)
+ rset *prset,long *options)
{
- struct dbr_grDouble grd;
- int got_data=FALSE;
+ struct dbr_grDouble grd;
+ int got_data=FALSE;
grd.upper_disp_limit = grd.lower_disp_limit = 0.0;
- if( prset && prset->get_graphic_double ) {
- (*prset->get_graphic_double)(paddr,&grd);
- got_data=TRUE;
- }
- if( (*options) & (DBR_GR_LONG) ) {
- char *pbuffer=*ppbuffer;
+ if( prset && prset->get_graphic_double ) {
+ (*prset->get_graphic_double)(paddr,&grd);
+ got_data=TRUE;
+ }
+ if( (*options) & (DBR_GR_LONG) ) {
+ char *pbuffer=*ppbuffer;
- if(got_data) {
- struct dbr_grLong *pgr=(struct dbr_grLong*)pbuffer;
- pgr->upper_disp_limit = (epicsInt32)grd.upper_disp_limit;
- pgr->lower_disp_limit = (epicsInt32)grd.lower_disp_limit;
- } else {
- memset(pbuffer,'\0',dbr_grLong_size);
- *options = (*options) ^ DBR_GR_LONG; /*Turn off option*/
- }
- *ppbuffer = ((char *)*ppbuffer) + dbr_grLong_size;
- }
- if( (*options) & (DBR_GR_DOUBLE) ) {
- char *pbuffer=*ppbuffer;
+ if(got_data) {
+ struct dbr_grLong *pgr=(struct dbr_grLong*)pbuffer;
+ pgr->upper_disp_limit = (epicsInt32)grd.upper_disp_limit;
+ pgr->lower_disp_limit = (epicsInt32)grd.lower_disp_limit;
+ } else {
+ memset(pbuffer,'\0',dbr_grLong_size);
+ *options = (*options) ^ DBR_GR_LONG; /*Turn off option*/
+ }
+ *ppbuffer = ((char *)*ppbuffer) + dbr_grLong_size;
+ }
+ if( (*options) & (DBR_GR_DOUBLE) ) {
+ char *pbuffer=*ppbuffer;
- if(got_data) {
- struct dbr_grDouble *pgr=(struct dbr_grDouble*)pbuffer;
- pgr->upper_disp_limit = grd.upper_disp_limit;
- pgr->lower_disp_limit = grd.lower_disp_limit;
- } else {
- memset(pbuffer,'\0',dbr_grDouble_size);
- *options = (*options) ^ DBR_GR_DOUBLE; /*Turn off option*/
- }
- *ppbuffer = ((char *)*ppbuffer) + dbr_grDouble_size;
- }
- return;
+ if(got_data) {
+ struct dbr_grDouble *pgr=(struct dbr_grDouble*)pbuffer;
+ pgr->upper_disp_limit = grd.upper_disp_limit;
+ pgr->lower_disp_limit = grd.lower_disp_limit;
+ } else {
+ memset(pbuffer,'\0',dbr_grDouble_size);
+ *options = (*options) ^ DBR_GR_DOUBLE; /*Turn off option*/
+ }
+ *ppbuffer = ((char *)*ppbuffer) + dbr_grDouble_size;
+ }
+ return;
}
static void get_control(DBADDR *paddr, char **ppbuffer,
- rset *prset,long *options)
+ rset *prset,long *options)
{
- struct dbr_ctrlDouble ctrld;
- int got_data=FALSE;
+ struct dbr_ctrlDouble ctrld;
+ int got_data=FALSE;
ctrld.upper_ctrl_limit = ctrld.lower_ctrl_limit = 0.0;
- if( prset && prset->get_control_double ) {
- (*prset->get_control_double)(paddr,&ctrld);
- got_data=TRUE;
- }
- if( (*options) & (DBR_CTRL_LONG) ) {
- char *pbuffer=*ppbuffer;
+ if( prset && prset->get_control_double ) {
+ (*prset->get_control_double)(paddr,&ctrld);
+ got_data=TRUE;
+ }
+ if( (*options) & (DBR_CTRL_LONG) ) {
+ char *pbuffer=*ppbuffer;
- if(got_data) {
- struct dbr_ctrlLong *pctrl=(struct dbr_ctrlLong*)pbuffer;
- pctrl->upper_ctrl_limit = (epicsInt32)ctrld.upper_ctrl_limit;
- pctrl->lower_ctrl_limit = (epicsInt32)ctrld.lower_ctrl_limit;
- } else {
- memset(pbuffer,'\0',dbr_ctrlLong_size);
- *options = (*options) ^ DBR_CTRL_LONG; /*Turn off option*/
- }
- *ppbuffer = ((char *)*ppbuffer) + dbr_ctrlLong_size;
- }
- if( (*options) & (DBR_CTRL_DOUBLE) ) {
- char *pbuffer=*ppbuffer;
+ if(got_data) {
+ struct dbr_ctrlLong *pctrl=(struct dbr_ctrlLong*)pbuffer;
+ pctrl->upper_ctrl_limit = (epicsInt32)ctrld.upper_ctrl_limit;
+ pctrl->lower_ctrl_limit = (epicsInt32)ctrld.lower_ctrl_limit;
+ } else {
+ memset(pbuffer,'\0',dbr_ctrlLong_size);
+ *options = (*options) ^ DBR_CTRL_LONG; /*Turn off option*/
+ }
+ *ppbuffer = ((char *)*ppbuffer) + dbr_ctrlLong_size;
+ }
+ if( (*options) & (DBR_CTRL_DOUBLE) ) {
+ char *pbuffer=*ppbuffer;
- if(got_data) {
- struct dbr_ctrlDouble *pctrl=(struct dbr_ctrlDouble*)pbuffer;
- pctrl->upper_ctrl_limit = ctrld.upper_ctrl_limit;
- pctrl->lower_ctrl_limit = ctrld.lower_ctrl_limit;
- } else {
- memset(pbuffer,'\0',dbr_ctrlDouble_size);
- *options = (*options) ^ DBR_CTRL_DOUBLE; /*Turn off option*/
- }
- *ppbuffer = ((char *)*ppbuffer) + dbr_ctrlDouble_size;
- }
- return;
+ if(got_data) {
+ struct dbr_ctrlDouble *pctrl=(struct dbr_ctrlDouble*)pbuffer;
+ pctrl->upper_ctrl_limit = ctrld.upper_ctrl_limit;
+ pctrl->lower_ctrl_limit = ctrld.lower_ctrl_limit;
+ } else {
+ memset(pbuffer,'\0',dbr_ctrlDouble_size);
+ *options = (*options) ^ DBR_CTRL_DOUBLE; /*Turn off option*/
+ }
+ *ppbuffer = ((char *)*ppbuffer) + dbr_ctrlDouble_size;
+ }
+ return;
}
static void get_alarm(DBADDR *paddr, char **ppbuffer,
@@ -332,21 +332,21 @@ static void get_alarm(DBADDR *paddr, char **ppbuffer,
static void getOptions(DBADDR *paddr, char **poriginal, long *options,
void *pflin)
{
- db_field_log *pfl= (db_field_log *)pflin;
- rset *prset;
- short field_type;
- dbCommon *pcommon;
- char *pbuffer = *poriginal;
+ db_field_log *pfl= (db_field_log *)pflin;
+ rset *prset;
+ short field_type;
+ dbCommon *pcommon;
+ char *pbuffer = *poriginal;
if (!pfl || pfl->type == dbfl_type_rec)
field_type = paddr->field_type;
else
field_type = pfl->field_type;
- prset=dbGetRset(paddr);
- /* Process options */
- pcommon = paddr->precord;
- if( (*options) & DBR_STATUS ) {
- unsigned short *pushort = (unsigned short *)pbuffer;
+ prset=dbGetRset(paddr);
+ /* Process options */
+ pcommon = paddr->precord;
+ if( (*options) & DBR_STATUS ) {
+ unsigned short *pushort = (unsigned short *)pbuffer;
if (!pfl || pfl->type == dbfl_type_rec) {
*pushort++ = pcommon->stat;
@@ -355,32 +355,32 @@ static void getOptions(DBADDR *paddr, char **poriginal, long *options,
*pushort++ = pfl->stat;
*pushort++ = pfl->sevr;
}
- *pushort++ = pcommon->acks;
- *pushort++ = pcommon->ackt;
- pbuffer = (char *)pushort;
- }
- if( (*options) & DBR_UNITS ) {
- memset(pbuffer,'\0',dbr_units_size);
- if( prset && prset->get_units ){
- (*prset->get_units)(paddr, pbuffer);
- pbuffer[DB_UNITS_SIZE-1] = '\0';
- } else {
- *options ^= DBR_UNITS; /*Turn off DBR_UNITS*/
- }
- pbuffer += dbr_units_size;
- }
- if( (*options) & DBR_PRECISION ) {
- memset(pbuffer, '\0', dbr_precision_size);
- if((field_type==DBF_FLOAT || field_type==DBF_DOUBLE)
- && prset && prset->get_precision ){
+ *pushort++ = pcommon->acks;
+ *pushort++ = pcommon->ackt;
+ pbuffer = (char *)pushort;
+ }
+ if( (*options) & DBR_UNITS ) {
+ memset(pbuffer,'\0',dbr_units_size);
+ if( prset && prset->get_units ){
+ (*prset->get_units)(paddr, pbuffer);
+ pbuffer[DB_UNITS_SIZE-1] = '\0';
+ } else {
+ *options ^= DBR_UNITS; /*Turn off DBR_UNITS*/
+ }
+ pbuffer += dbr_units_size;
+ }
+ if( (*options) & DBR_PRECISION ) {
+ memset(pbuffer, '\0', dbr_precision_size);
+ if((field_type==DBF_FLOAT || field_type==DBF_DOUBLE)
+ && prset && prset->get_precision ){
(*prset->get_precision)(paddr,(long *)pbuffer);
- } else {
- *options ^= DBR_PRECISION; /*Turn off DBR_PRECISION*/
- }
- pbuffer += dbr_precision_size;
- }
- if( (*options) & DBR_TIME ) {
- epicsUInt32 *ptime = (epicsUInt32 *)pbuffer;
+ } else {
+ *options ^= DBR_PRECISION; /*Turn off DBR_PRECISION*/
+ }
+ pbuffer += dbr_precision_size;
+ }
+ if( (*options) & DBR_TIME ) {
+ epicsUInt32 *ptime = (epicsUInt32 *)pbuffer;
if (!pfl || pfl->type == dbfl_type_rec) {
*ptime++ = pcommon->time.secPastEpoch;
@@ -388,26 +388,26 @@ static void getOptions(DBADDR *paddr, char **poriginal, long *options,
} else {
*ptime++ = pfl->time.secPastEpoch;
*ptime++ = pfl->time.nsec;
- }
- pbuffer = (char *)ptime;
- }
- if( (*options) & DBR_ENUM_STRS )
- get_enum_strs(paddr, &pbuffer, prset, options);
- if( (*options) & (DBR_GR_LONG|DBR_GR_DOUBLE ))
- get_graphics(paddr, &pbuffer, prset, options);
- if((*options) & (DBR_CTRL_LONG | DBR_CTRL_DOUBLE ))
- get_control(paddr, &pbuffer, prset, options);
- if((*options) & (DBR_AL_LONG | DBR_AL_DOUBLE ))
- get_alarm(paddr, &pbuffer, prset, options);
- *poriginal = pbuffer;
+ }
+ pbuffer = (char *)ptime;
+ }
+ if( (*options) & DBR_ENUM_STRS )
+ get_enum_strs(paddr, &pbuffer, prset, options);
+ if( (*options) & (DBR_GR_LONG|DBR_GR_DOUBLE ))
+ get_graphics(paddr, &pbuffer, prset, options);
+ if((*options) & (DBR_CTRL_LONG | DBR_CTRL_DOUBLE ))
+ get_control(paddr, &pbuffer, prset, options);
+ if((*options) & (DBR_AL_LONG | DBR_AL_DOUBLE ))
+ get_alarm(paddr, &pbuffer, prset, options);
+ *poriginal = pbuffer;
}
rset * dbGetRset(const struct dbAddr *paddr)
{
- struct dbFldDes *pfldDes = paddr->pfldDes;
+ struct dbFldDes *pfldDes = paddr->pfldDes;
- if(!pfldDes) return(0);
- return(pfldDes->pdbRecordType->prset);
+ if(!pfldDes) return(0);
+ return(pfldDes->pdbRecordType->prset);
}
long dbPutAttribute(
@@ -466,7 +466,7 @@ long dbProcess(dbCommon *precord)
char context[40] = "";
long status = 0;
int *ptrace;
- int set_trace = FALSE;
+ int set_trace = FALSE;
dbFldDes *pdbFldDes;
int callNotifyCompletion = FALSE;
@@ -776,8 +776,19 @@ int dbLoadRecords(const char* file, const char* subs)
return -1;
}
status = dbReadDatabase(&pdbbase, file, 0, subs);
- if (!status && dbLoadRecordsHook)
- dbLoadRecordsHook(file, subs);
+ switch(status)
+ {
+ case 0:
+ if(dbLoadRecordsHook)
+ dbLoadRecordsHook(file, subs);
+ break;
+ case -2:
+ errlogPrintf("dbLoadRecords: failed to load '%s'\n"
+ " Records cannot be loaded after iocInit!\n", file);
+ break;
+ default:
+ errlogPrintf("dbLoadRecords: failed to load '%s'\n", file);
+ }
return status;
}
@@ -943,6 +954,11 @@ long dbGet(DBADDR *paddr, short dbrType,
} else {
DBADDR localAddr = *paddr; /* Structure copy */
+ if (pfl->no_elements < 1) {
+ status = S_db_badField;
+ goto done;
+ }
+
localAddr.field_type = pfl->field_type;
localAddr.field_size = pfl->field_size;
localAddr.no_elements = pfl->no_elements;
@@ -1204,11 +1220,11 @@ cleanup:
long dbPutField(DBADDR *paddr, short dbrType,
const void *pbuffer, long nRequest)
{
- long status = 0;
- long special = paddr->special;
- dbFldDes *pfldDes = paddr->pfldDes;
- dbCommon *precord = paddr->precord;
- short dbfType = paddr->field_type;
+ long status = 0;
+ long special = paddr->special;
+ dbFldDes *pfldDes = paddr->pfldDes;
+ dbCommon *precord = paddr->precord;
+ short dbfType = paddr->field_type;
if (special == SPC_ATTRIBUTE)
return S_db_noMod;
diff --git a/modules/database/src/ioc/db/dbAccess.h b/modules/database/src/ioc/db/dbAccess.h
index 96246b302..fa7c4a7fa 100644
--- a/modules/database/src/ioc/db/dbAccess.h
+++ b/modules/database/src/ioc/db/dbAccess.h
@@ -4,9 +4,9 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/* dbAccess.h */
+/* dbAccess.h */
#ifndef INCdbAccessh
#define INCdbAccessh
diff --git a/modules/database/src/ioc/db/dbAccessDefs.h b/modules/database/src/ioc/db/dbAccessDefs.h
index 805dfd41f..5ccfa6314 100644
--- a/modules/database/src/ioc/db/dbAccessDefs.h
+++ b/modules/database/src/ioc/db/dbAccessDefs.h
@@ -6,7 +6,7 @@
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/* dbAccessDefs.h */
+/* dbAccessDefs.h */
#ifndef INCdbAccessDefsh
#define INCdbAccessDefsh
@@ -38,7 +38,7 @@ epicsShareExtern volatile int interruptAccept;
epicsShareExtern int dbAccessDebugPUTF;
/* The database field and request types are defined in dbFldTypes.h*/
-/* Data Base Request Options */
+/* Data Base Request Options */
#define DBR_STATUS 0x00000001
#define DBR_UNITS 0x00000002
#define DBR_PRECISION 0x00000004
@@ -57,9 +57,9 @@ epicsShareExtern int dbAccessDebugPUTF;
* of 10 float values + DBR_STATUS and DBR_TIME options
*
* struct {
- * DBRstatus
- * DBRtime
- * epicsFloat32 value[10]
+ * DBRstatus
+ * DBRtime
+ * epicsFloat32 value[10]
* } buffer;
*
* IMPORTANT!! The DBRoptions must be given in the order that they
@@ -74,9 +74,9 @@ epicsShareExtern int dbAccessDebugPUTF;
* rtnval=dbGetField(paddr,DBR_FLOAT,&buffer,&options,&number_elements);
*
* When dbGetField returns:
- * rtnval is error status (0 means success)
- * options has a bit set for each option that was accepted
- * number_elements is actual number of elements obtained
+ * rtnval is error status (0 means success)
+ * options has a bit set for each option that was accepted
+ * number_elements is actual number of elements obtained
*
* The individual items can be refered to by the expressions::
*
@@ -90,9 +90,9 @@ epicsShareExtern int dbAccessDebugPUTF;
* The following is also a valid declaration:
*
* typedef struct {
- * DBRstatus
- * DBRtime
- * epicsFloat32 value[10]
+ * DBRstatus
+ * DBRtime
+ * epicsFloat32 value[10]
* } MYBUFFER;
*
* With this definition you can give definitions such as the following:
@@ -103,13 +103,13 @@ epicsShareExtern int dbAccessDebugPUTF;
/* Macros for defining each option */
#define DBRstatus \
- epicsUInt16 status; /* alarm status */\
- epicsUInt16 severity; /* alarm severity*/\
- epicsUInt16 acks; /* alarm ack severity*/\
- epicsUInt16 ackt; /* Acknowledge transient alarms?*/
+ epicsUInt16 status; /* alarm status */\
+ epicsUInt16 severity; /* alarm severity*/\
+ epicsUInt16 acks; /* alarm ack severity*/\
+ epicsUInt16 ackt; /* Acknowledge transient alarms?*/
#define DB_UNITS_SIZE 16
#define DBRunits \
- char units[DB_UNITS_SIZE]; /* units */
+ char units[DB_UNITS_SIZE]; /* units */
#define DBRprecision union { \
long dp; /* number of decimal places*/\
double unused; /* for alignment */\
@@ -119,11 +119,11 @@ epicsShareExtern int dbAccessDebugPUTF;
* too late to change now. DBRprecision must be padded to
* maintain 8-byte alignment. */
#define DBRtime \
- epicsTimeStamp time; /* time stamp*/
+ epicsTimeStamp time; /* time stamp*/
#define DBRenumStrs \
- epicsUInt32 no_str; /* number of strings*/\
- epicsInt32 padenumStrs; /*padding to force 8 byte align*/\
- char strs[DB_MAX_CHOICES][MAX_STRING_SIZE]; /* string values */
+ epicsUInt32 no_str; /* number of strings*/\
+ epicsInt32 padenumStrs; /*padding to force 8 byte align*/\
+ char strs[DB_MAX_CHOICES][MAX_STRING_SIZE]; /* string values */
#define DBRgrLong \
epicsInt32 upper_disp_limit; /*upper limit of graph*/\
epicsInt32 lower_disp_limit; /*lower limit of graph*/
@@ -175,23 +175,23 @@ struct dbr_alDouble {DBRalDouble};
#ifndef INCerrMdefh
#include "errMdef.h"
#endif
-#define S_db_notFound (M_dbAccess| 1) /*Process Variable Not Found*/
-#define S_db_badDbrtype (M_dbAccess| 3) /*Illegal Database Request Type*/
-#define S_db_noMod (M_dbAccess| 5) /*Attempt to modify noMod field*/
-#define S_db_badLset (M_dbAccess| 7) /*Illegal Lock Set*/
-#define S_db_precision (M_dbAccess| 9) /*get precision failed */
-#define S_db_onlyOne (M_dbAccess|11) /*Only one element allowed*/
-#define S_db_badChoice (M_dbAccess|13) /*Illegal choice*/
-#define S_db_badField (M_dbAccess|15) /*Illegal field value*/
-#define S_db_lsetLogic (M_dbAccess|17) /*Logic error generating lock sets*/
+#define S_db_notFound (M_dbAccess| 1) /*Process Variable Not Found*/
+#define S_db_badDbrtype (M_dbAccess| 3) /*Illegal Database Request Type*/
+#define S_db_noMod (M_dbAccess| 5) /*Attempt to modify noMod field*/
+#define S_db_badLset (M_dbAccess| 7) /*Illegal Lock Set*/
+#define S_db_precision (M_dbAccess| 9) /*get precision failed */
+#define S_db_onlyOne (M_dbAccess|11) /*Only one element allowed*/
+#define S_db_badChoice (M_dbAccess|13) /*Illegal choice*/
+#define S_db_badField (M_dbAccess|15) /*Illegal field value*/
+#define S_db_lsetLogic (M_dbAccess|17) /*Logic error generating lock sets*/
#define S_db_noLSET (M_dbAccess|21) /*No link support table or entry*/
-#define S_db_noRSET (M_dbAccess|31) /*missing record support entry table*/
-#define S_db_noSupport (M_dbAccess|33) /*RSET or DSXT routine not defined*/
-#define S_db_BadSub (M_dbAccess|35) /*Subroutine not found*/
+#define S_db_noRSET (M_dbAccess|31) /*missing record support entry table*/
+#define S_db_noSupport (M_dbAccess|33) /*RSET or DSXT routine not defined*/
+#define S_db_BadSub (M_dbAccess|35) /*Subroutine not found*/
/*!!!! Do not change next line without changing src/rsrv/server.h!!!!!!!!*/
-#define S_db_Pending (M_dbAccess|37) /*Request is pending*/
+#define S_db_Pending (M_dbAccess|37) /*Request is pending*/
-#define S_db_Blocked (M_dbAccess|39) /*Request is Blocked*/
+#define S_db_Blocked (M_dbAccess|39) /*Request is Blocked*/
#define S_db_putDisabled (M_dbAccess|41) /*putFields are disabled*/
#define S_db_badHWaddr (M_dbAccess|43) /*Hardware link type not on INP/OUT*/
#define S_db_bkptSet (M_dbAccess|53) /*Breakpoint already set*/
diff --git a/modules/database/src/ioc/db/dbBkpt.c b/modules/database/src/ioc/db/dbBkpt.c
index b3fdd2da4..e36f62abc 100644
--- a/modules/database/src/ioc/db/dbBkpt.c
+++ b/modules/database/src/ioc/db/dbBkpt.c
@@ -5,7 +5,7 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbBkpt.c */
/*
@@ -89,7 +89,7 @@ static long FIND_CONT_NODE(
* dbb() and dbd() add a breakpoint to a record or delete one
* from a record. dbstat() prints out comprehensive breakpoint
* status information.
- *
+ *
* Breakpoints may be set on a per lockset basis. When a
* breakpoint is set in a lockset, a new task is created. A
* separate task gets created for _every_ lockset containing
@@ -201,7 +201,7 @@ static long FIND_CONT_NODE(
struct LS_LIST **ppnode,
struct dbCommon **pprecord)
{
- struct dbAddr addr;
+ struct dbAddr addr;
struct LS_LIST *pnode;
struct dbCommon *precord = NULL;
long status = 0;
@@ -211,7 +211,7 @@ static long FIND_CONT_NODE(
* Search through stack, taking the first entry that
* is currently stopped at a breakpoint.
*/
- pnode = (struct LS_LIST *) ellFirst(&lset_stack);
+ pnode = (struct LS_LIST *) ellFirst(&lset_stack);
while (pnode != NULL) {
if (pnode->precord != NULL) {
precord = pnode->precord;
@@ -219,7 +219,7 @@ static long FIND_CONT_NODE(
}
pnode = (struct LS_LIST *) ellNext((ELLNODE *)pnode);
}
-
+
if (pnode == NULL) {
printf(" BKPT> No records are currently stopped\n");
return(S_db_notStopped);
@@ -295,7 +295,7 @@ long dbb(const char *record_name)
precord = addr.precord;
if (precord->bkpt & BKPT_ON_MASK) {
- printf(" BKPT> Breakpoint already set in this record\n");
+ printf(" BKPT> Breakpoint already set in this record\n");
return(S_db_bkptSet);
}
@@ -354,13 +354,13 @@ long dbb(const char *record_name)
epicsMutexUnlock(bkpt_stack_sem);
return(1);
}
- pbl->precord = precord;
+ pbl->precord = precord;
ellAdd(&pnode->bp_list, (ELLNODE *)pbl);
/*
* Turn on breakpoint field in record
*/
- precord->bkpt |= BKPT_ON_MASK;
+ precord->bkpt |= BKPT_ON_MASK;
if (! pnode->taskid) {
@@ -455,7 +455,7 @@ long dbd(const char *record_name)
}
if (pbl == NULL) {
- printf(" BKPT> Logic Error in dbd()\n");
+ printf(" BKPT> Logic Error in dbd()\n");
precord->bkpt &= BKPT_OFF_MASK;
epicsMutexUnlock(bkpt_stack_sem);
dbScanUnlock(precord);
@@ -663,9 +663,9 @@ int dbBkpt(dbCommon *precord)
/*
* Take and give a semaphore to check for breakpoints
- * every time a record is processed. Slow. Thank
- * goodness breakpoint checking is turned off during
- * normal operation.
+ * every time a record is processed. Slow. Thank
+ * goodness breakpoint checking is turned off during
+ * normal operation.
*/
epicsMutexMustLock(bkpt_stack_sem);
FIND_LOCKSET(precord, pnode);
@@ -696,7 +696,7 @@ int dbBkpt(dbCommon *precord)
* is used to determine if the source of processing is the
* continuation task or an external source. If it is an external
* source, queue its execution, but dump out of dbProcess without
- * calling record support.
+ * calling record support.
*/
if (pnode->taskid && (epicsThreadGetIdSelf() != pnode->taskid)) {
/* CONTINUE TASK CANNOT ENTER HERE */
@@ -706,7 +706,7 @@ int dbBkpt(dbCommon *precord)
* not already exist.
*/
FIND_QUEUE_ENTRY(&pnode->ep_queue, pqe, precord);
-
+
if (pqe == NULL) {
pqe = (struct EP_LIST *) malloc(sizeof(struct EP_LIST));
@@ -746,7 +746,7 @@ int dbBkpt(dbCommon *precord)
/*
* Release the semaphore, letting the continuation
* task begin execution of the new entrypoint.
- */
+ */
epicsEventSignal(pnode->ex_sem);
}
return(1);
@@ -903,7 +903,7 @@ long dbstat(void)
pnode->l_num, pnode->precord->name, ellCount(&pnode->bp_list), pnode->taskid);
/* for each entrypoint detected, print out entrypoint statistics */
- pqe = (struct EP_LIST *) ellFirst(&pnode->ep_queue);
+ pqe = (struct EP_LIST *) ellFirst(&pnode->ep_queue);
while (pqe != NULL) {
double diff = epicsTimeDiffInSeconds(&time,&pqe->time);
if (diff) {
diff --git a/modules/database/src/ioc/db/dbBkpt.h b/modules/database/src/ioc/db/dbBkpt.h
index 7240b701c..ed2bc76be 100644
--- a/modules/database/src/ioc/db/dbBkpt.h
+++ b/modules/database/src/ioc/db/dbBkpt.h
@@ -5,9 +5,9 @@
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/* dbBkpt.h */
+/* dbBkpt.h */
/*
* Author: Matthew Needes
* Date: 8-30-93
@@ -32,7 +32,7 @@ extern "C" {
struct BP_LIST {
ELLNODE *next_list;
- ELLNODE *prev_list;
+ ELLNODE *prev_list;
struct dbCommon *precord;
};
@@ -41,7 +41,7 @@ struct BP_LIST {
* detected for a lockset.
*/
struct EP_LIST {
- ELLNODE *next_list;
+ ELLNODE *next_list;
ELLNODE *prev_list;
struct dbCommon *entrypoint; /* pointer to entry point in lockset */
unsigned long count; /* number of times record processed */
diff --git a/modules/database/src/ioc/db/dbCAC.h b/modules/database/src/ioc/db/dbCAC.h
index 2d97fac35..0dab81bef 100644
--- a/modules/database/src/ioc/db/dbCAC.h
+++ b/modules/database/src/ioc/db/dbCAC.h
@@ -8,9 +8,9 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*
* NOTES:
* 1) This interface is preliminary and will change in the future
diff --git a/modules/database/src/ioc/db/dbCa.c b/modules/database/src/ioc/db/dbCa.c
index 45e178cae..3403f2c8d 100644
--- a/modules/database/src/ioc/db/dbCa.c
+++ b/modules/database/src/ioc/db/dbCa.c
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
@@ -641,7 +641,7 @@ static long getControlLimits(const struct link *plink,
*low = pca->controlLimits[0];
*high = pca->controlLimits[1];
}
- epicsMutexUnlock(pca->lock);
+ epicsMutexUnlock(pca->lock);
return gotAttributes ? 0 : -1;
}
@@ -657,7 +657,7 @@ static long getGraphicLimits(const struct link *plink,
*low = pca->displayLimits[0];
*high = pca->displayLimits[1];
}
- epicsMutexUnlock(pca->lock);
+ epicsMutexUnlock(pca->lock);
return gotAttributes ? 0 : -1;
}
@@ -687,7 +687,7 @@ static long getPrecision(const struct link *plink, short *precision)
pcaGetCheck
gotAttributes = pca->gotAttributes;
if (gotAttributes) *precision = pca->precision;
- epicsMutexUnlock(pca->lock);
+ epicsMutexUnlock(pca->lock);
return gotAttributes ? 0 : -1;
}
@@ -890,8 +890,8 @@ static void eventCallback(struct event_handler_args arg)
/* Disable the record scan if we also have a string monitor */
doScan = !(plink->value.pv_link.pvlMask & pvlOptInpString);
/* fall through */
- case DBR_TIME_STRING:
- case DBR_TIME_SHORT:
+ case DBR_TIME_STRING:
+ case DBR_TIME_SHORT:
case DBR_TIME_FLOAT:
case DBR_TIME_CHAR:
case DBR_TIME_LONG:
@@ -970,7 +970,7 @@ done:
static void accessRightsCallback(struct access_rights_handler_args arg)
{
caLink *pca = (caLink *)ca_puser(arg.chid);
- struct link *plink;
+ struct link *plink;
struct pv_link *ppv_link;
dbCommon *precord;
diff --git a/modules/database/src/ioc/db/dbCaPvt.h b/modules/database/src/ioc/db/dbCaPvt.h
index c6bdf359b..f8ea758cc 100644
--- a/modules/database/src/ioc/db/dbCaPvt.h
+++ b/modules/database/src/ioc/db/dbCaPvt.h
@@ -22,41 +22,41 @@
#include "link.h"
/* link_action mask */
-#define CA_CLEAR_CHANNEL 0x1
-#define CA_CONNECT 0x2
-#define CA_WRITE_NATIVE 0x4
-#define CA_WRITE_STRING 0x8
-#define CA_MONITOR_NATIVE 0x10
-#define CA_MONITOR_STRING 0x20
-#define CA_GET_ATTRIBUTES 0x40
-#define CA_SYNC 0x1000
+#define CA_CLEAR_CHANNEL 0x1
+#define CA_CONNECT 0x2
+#define CA_WRITE_NATIVE 0x4
+#define CA_WRITE_STRING 0x8
+#define CA_MONITOR_NATIVE 0x10
+#define CA_MONITOR_STRING 0x20
+#define CA_GET_ATTRIBUTES 0x40
+#define CA_SYNC 0x1000
/* write type */
#define CA_PUT 0x1
#define CA_PUT_CALLBACK 0x2
typedef struct caLink
{
- ELLNODE node;
- int refcount;
- epicsMutexId lock;
- struct link *plink;
- char *pvname;
- chid chid;
- short link_action;
+ ELLNODE node;
+ int refcount;
+ epicsMutexId lock;
+ struct link *plink;
+ char *pvname;
+ chid chid;
+ short link_action;
/* The following have new values after each data event*/
- epicsEnum16 sevr;
- epicsEnum16 stat;
- epicsTimeStamp timeStamp;
+ epicsEnum16 sevr;
+ epicsEnum16 stat;
+ epicsTimeStamp timeStamp;
/* The following have values after connection*/
- short dbrType;
+ short dbrType;
size_t elementSize; /* size of one element in pgetNative */
unsigned long nelements; /* PVs max array size */
unsigned long usedelements; /* currently used in pgetNative */
unsigned long putnelements; /* currently used in pputNative */
- char hasReadAccess;
- char hasWriteAccess;
+ char hasReadAccess;
+ char hasWriteAccess;
char isConnected;
- char gotFirstConnection;
+ char gotFirstConnection;
/* The following are for dbCaAddLinkCallback */
dbCaCallback connect;
dbCaCallback monitor;
@@ -67,7 +67,7 @@ typedef struct caLink
void *putUserPvt;
/* The following are for access to additional attributes*/
char gotAttributes;
- dbCaCallback getAttributes;
+ dbCaCallback getAttributes;
void *getAttributesPvt;
/* The following have values after getAttribEventCallback*/
double controlLimits[2];
@@ -76,22 +76,22 @@ typedef struct caLink
short precision;
char units[MAX_UNITS_SIZE]; /* units of value */
/* The following are for handling data*/
- void *pgetNative;
- char *pgetString;
- void *pputNative;
- char *pputString;
- evid evidNative;
- evid evidString;
- char gotInNative;
- char gotInString;
- char gotOutNative;
- char gotOutString;
- char newOutNative;
- char newOutString;
+ void *pgetNative;
+ char *pgetString;
+ void *pputNative;
+ char *pputString;
+ evid evidNative;
+ evid evidString;
+ char gotInNative;
+ char gotInString;
+ char gotOutNative;
+ char gotOutString;
+ char newOutNative;
+ char newOutString;
unsigned char scanningOnce;
/* The following are for dbcar*/
- unsigned long nDisconnect;
- unsigned long nNoWrite; /*only modified by dbCaPutLink*/
+ unsigned long nDisconnect;
+ unsigned long nNoWrite; /*only modified by dbCaPutLink*/
unsigned long nUpdate;
}caLink;
diff --git a/modules/database/src/ioc/db/dbCaTest.c b/modules/database/src/ioc/db/dbCaTest.c
index 18ef393ca..3f6ab1a78 100644
--- a/modules/database/src/ioc/db/dbCaTest.c
+++ b/modules/database/src/ioc/db/dbCaTest.c
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* dbCaTest.c */
@@ -155,7 +155,7 @@ done:
printf(" (%lu disconnects, %lu writes prohibited)\n\n",
nDisconnect, nNoWrite);
dbFinishEntry(pdbentry);
-
+
if ( level > 2 && dbCaClientContext != 0 ) {
ca_context_status ( dbCaClientContext, level - 2 );
}
diff --git a/modules/database/src/ioc/db/dbCaTest.h b/modules/database/src/ioc/db/dbCaTest.h
index ed501df2d..9be2c9053 100644
--- a/modules/database/src/ioc/db/dbCaTest.h
+++ b/modules/database/src/ioc/db/dbCaTest.h
@@ -4,7 +4,7 @@
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE is distributed subject to a Software License Agreement found
-* in file LICENSE that is included with this distribution.
+* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_dbCaTest_H
diff --git a/modules/database/src/ioc/db/dbChannel.c b/modules/database/src/ioc/db/dbChannel.c
index 6db2982d8..bc3c8e421 100644
--- a/modules/database/src/ioc/db/dbChannel.c
+++ b/modules/database/src/ioc/db/dbChannel.c
@@ -37,6 +37,7 @@
#include "link.h"
#include "recSup.h"
#include "special.h"
+#include "alarm.h"
typedef struct parseContext {
dbChannel *chan;
@@ -601,6 +602,7 @@ long dbChannelOpen(dbChannel *chan)
probe.field_type = dbChannelExportType(chan);
probe.no_elements = dbChannelElements(chan);
probe.field_size = dbChannelFieldSize(chan);
+ probe.sevr = NO_ALARM;
p = probe;
/*
diff --git a/modules/database/src/ioc/db/dbChannel.h b/modules/database/src/ioc/db/dbChannel.h
index fab9c6627..e30270a1c 100644
--- a/modules/database/src/ioc/db/dbChannel.h
+++ b/modules/database/src/ioc/db/dbChannel.h
@@ -21,9 +21,9 @@
#include "ellLib.h"
#include "epicsTypes.h"
#include "errMdef.h"
-#include "shareLib.h"
#include "db_field_log.h"
#include "dbEvent.h"
+#include "dbCoreAPI.h"
#ifdef __cplusplus
extern "C" {
@@ -148,14 +148,14 @@ struct chFilter {
struct dbCommon;
struct dbFldDes;
-epicsShareFunc void dbChannelInit (void);
-epicsShareFunc void dbChannelExit(void);
-epicsShareFunc long dbChannelTest(const char *name);
-epicsShareFunc dbChannel * dbChannelCreate(const char *name);
-epicsShareFunc long dbChannelOpen(dbChannel *chan);
+DBCORE_API void dbChannelInit (void);
+DBCORE_API void dbChannelExit(void);
+DBCORE_API long dbChannelTest(const char *name);
+DBCORE_API dbChannel * dbChannelCreate(const char *name);
+DBCORE_API long dbChannelOpen(dbChannel *chan);
/*Following is also defined in db_convert.h*/
-epicsShareExtern unsigned short dbDBRnewToDBRold[];
+DBCORE_API extern unsigned short dbDBRnewToDBRold[];
/* In the following macros pChan is dbChannel* */
@@ -206,25 +206,25 @@ epicsShareExtern unsigned short dbDBRnewToDBRold[];
#define dbChannelField(pChan) ((pChan)->addr.pfield)
-epicsShareFunc long dbChannelGet(dbChannel *chan, short type,
+DBCORE_API long dbChannelGet(dbChannel *chan, short type,
void *pbuffer, long *options, long *nRequest, void *pfl);
-epicsShareFunc long dbChannelGetField(dbChannel *chan, short type,
+DBCORE_API long dbChannelGetField(dbChannel *chan, short type,
void *pbuffer, long *options, long *nRequest, void *pfl);
-epicsShareFunc long dbChannelPut(dbChannel *chan, short type,
+DBCORE_API long dbChannelPut(dbChannel *chan, short type,
const void *pbuffer, long nRequest);
-epicsShareFunc long dbChannelPutField(dbChannel *chan, short type,
+DBCORE_API long dbChannelPutField(dbChannel *chan, short type,
const void *pbuffer, long nRequest);
-epicsShareFunc void dbChannelShow(dbChannel *chan, int level,
+DBCORE_API void dbChannelShow(dbChannel *chan, int level,
const unsigned short indent);
-epicsShareFunc void dbChannelFilterShow(dbChannel *chan, int level,
+DBCORE_API void dbChannelFilterShow(dbChannel *chan, int level,
const unsigned short indent);
-epicsShareFunc void dbChannelDelete(dbChannel *chan);
+DBCORE_API void dbChannelDelete(dbChannel *chan);
-epicsShareFunc void dbRegisterFilter(const char *key, const chFilterIf *fif, void *puser);
-epicsShareFunc db_field_log* dbChannelRunPreChain(dbChannel *chan, db_field_log *pLogIn);
-epicsShareFunc db_field_log* dbChannelRunPostChain(dbChannel *chan, db_field_log *pLogIn);
-epicsShareFunc const chFilterPlugin * dbFindFilter(const char *key, size_t len);
-epicsShareFunc void dbChannelMakeArrayCopy(void *pvt, db_field_log *pfl, dbChannel *chan);
+DBCORE_API void dbRegisterFilter(const char *key, const chFilterIf *fif, void *puser);
+DBCORE_API db_field_log* dbChannelRunPreChain(dbChannel *chan, db_field_log *pLogIn);
+DBCORE_API db_field_log* dbChannelRunPostChain(dbChannel *chan, db_field_log *pLogIn);
+DBCORE_API const chFilterPlugin * dbFindFilter(const char *key, size_t len);
+DBCORE_API void dbChannelMakeArrayCopy(void *pvt, db_field_log *pfl, dbChannel *chan);
#ifdef __cplusplus
}
diff --git a/modules/database/src/ioc/db/dbChannelIO.cpp b/modules/database/src/ioc/db/dbChannelIO.cpp
index a086d3e56..72fbbcca4 100644
--- a/modules/database/src/ioc/db/dbChannelIO.cpp
+++ b/modules/database/src/ioc/db/dbChannelIO.cpp
@@ -7,10 +7,10 @@
* in file LICENSE that is included with this distribution.
\*************************************************************************/
-/*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+/*
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*/
#include
@@ -48,7 +48,7 @@ dbChannelIO::~dbChannelIO ()
{
}
-void dbChannelIO::destructor ( CallbackGuard & cbGuard,
+void dbChannelIO::destructor ( CallbackGuard & cbGuard,
epicsGuard < epicsMutex > & guard )
{
guard.assertIdenticalMutex ( this->mutex );
diff --git a/modules/database/src/ioc/db/dbChannelIO.h b/modules/database/src/ioc/db/dbChannelIO.h
index 5eb7c4eb2..a31bdcd55 100644
--- a/modules/database/src/ioc/db/dbChannelIO.h
+++ b/modules/database/src/ioc/db/dbChannelIO.h
@@ -9,9 +9,9 @@
\*************************************************************************/
/*
- * Author Jeffrey O. Hill
- * johill@lanl.gov
- * 505 665 1831
+ * Author Jeffrey O. Hill
+ * johill@lanl.gov
+ * 505 665 1831
*
* NOTES:
* 1) This interface is preliminary and will change in the future
diff --git a/modules/database/src/ioc/db/dbCommon.dbd b/modules/database/src/ioc/db/dbCommon.dbd
deleted file mode 100644
index aa6a63345..000000000
--- a/modules/database/src/ioc/db/dbCommon.dbd
+++ /dev/null
@@ -1,268 +0,0 @@
-#*************************************************************************
-# Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne
-# National Laboratory.
-# Copyright (c) 2002 The Regents of the University of California, as
-# Operator of Los Alamos National Laboratory.
-# EPICS BASE is distributed subject to a Software License Agreement found
-# in file LICENSE that is included with this distribution.
-#*************************************************************************
- %#include "epicsTypes.h"
- %#include "link.h"
- field(NAME,DBF_STRING) {
- prompt("Record Name")
- special(SPC_NOMOD)
- size(61)
- }
- field(DESC,DBF_STRING) {
- prompt("Descriptor")
- promptgroup("10 - Common")
- size(41)
- }
- field(ASG,DBF_STRING) {
- prompt("Access Security Group")
- promptgroup("10 - Common")
- special(SPC_AS)
- size(29)
- }
- field(SCAN,DBF_MENU) {
- prompt("Scan Mechanism")
- promptgroup("20 - Scan")
- special(SPC_SCAN)
- interest(1)
- menu(menuScan)
- }
- field(PINI,DBF_MENU) {
- prompt("Process at iocInit")
- promptgroup("20 - Scan")
- interest(1)
- menu(menuPini)
- }
- field(PHAS,DBF_SHORT) {
- prompt("Scan Phase")
- promptgroup("20 - Scan")
- special(SPC_SCAN)
- interest(1)
- }
- field(EVNT,DBF_STRING) {
- prompt("Event Name")
- promptgroup("20 - Scan")
- special(SPC_SCAN)
- size(40)
- interest(1)
- }
- field(TSE,DBF_SHORT) {
- prompt("Time Stamp Event")
- promptgroup("20 - Scan")
- interest(1)
- }
- field(TSEL,DBF_INLINK) {
- prompt("Time Stamp Link")
- promptgroup("20 - Scan")
- interest(1)
- }
- field(DTYP,DBF_DEVICE) {
- prompt("Device Type")
- promptgroup("10 - Common")
- interest(1)
- }
- field(DISV,DBF_SHORT) {
- prompt("Disable Value")
- promptgroup("20 - Scan")
- initial("1")
- }
- field(DISA,DBF_SHORT) {
- prompt("Disable")
- }
- field(SDIS,DBF_INLINK) {
- prompt("Scanning Disable")
- promptgroup("20 - Scan")
- interest(1)
- }
- %#include "epicsMutex.h"
- field(MLOK,DBF_NOACCESS) {
- prompt("Monitor lock")
- special(SPC_NOMOD)
- interest(4)
- extra("epicsMutexId mlok")
- }
- %#include "ellLib.h"
- field(MLIS,DBF_NOACCESS) {
- prompt("Monitor List")
- special(SPC_NOMOD)
- interest(4)
- extra("ELLLIST mlis")
- }
- field(BKLNK,DBF_NOACCESS) {
- prompt("Backwards link tracking")
- special(SPC_NOMOD)
- interest(4)
- extra("ELLLIST bklnk")
- }
- field(DISP,DBF_UCHAR) {
- prompt("Disable putField")
- }
- field(PROC,DBF_UCHAR) {
- prompt("Force Processing")
- pp(TRUE)
- interest(3)
- }
- field(STAT,DBF_MENU) {
- prompt("Alarm Status")
- special(SPC_NOMOD)
- menu(menuAlarmStat)
- initial("UDF")
- }
- field(SEVR,DBF_MENU) {
- prompt("Alarm Severity")
- special(SPC_NOMOD)
- menu(menuAlarmSevr)
- }
- field(NSTA,DBF_MENU) {
- prompt("New Alarm Status")
- special(SPC_NOMOD)
- interest(2)
- menu(menuAlarmStat)
- }
- field(NSEV,DBF_MENU) {
- prompt("New Alarm Severity")
- special(SPC_NOMOD)
- interest(2)
- menu(menuAlarmSevr)
- }
- field(ACKS,DBF_MENU) {
- prompt("Alarm Ack Severity")
- special(SPC_NOMOD)
- interest(2)
- menu(menuAlarmSevr)
- }
- field(ACKT,DBF_MENU) {
- prompt("Alarm Ack Transient")
- promptgroup("70 - Alarm")
- special(SPC_NOMOD)
- interest(2)
- menu(menuYesNo)
- initial("YES")
- }
- field(DISS,DBF_MENU) {
- prompt("Disable Alarm Sevrty")
- promptgroup("70 - Alarm")
- interest(1)
- menu(menuAlarmSevr)
- }
- field(LCNT,DBF_UCHAR) {
- prompt("Lock Count")
- special(SPC_NOMOD)
- interest(2)
- }
- field(PACT,DBF_UCHAR) {
- prompt("Record active")
- special(SPC_NOMOD)
- interest(1)
- }
- field(PUTF,DBF_UCHAR) {
- prompt("dbPutField process")
- special(SPC_NOMOD)
- interest(1)
- }
- field(RPRO,DBF_UCHAR) {
- prompt("Reprocess ")
- special(SPC_NOMOD)
- interest(1)
- }
- field(ASP,DBF_NOACCESS) {
- prompt("Access Security Pvt")
- special(SPC_NOMOD)
- interest(4)
- extra("struct asgMember *asp")
- }
- field(PPN,DBF_NOACCESS) {
- prompt("pprocessNotify")
- special(SPC_NOMOD)
- interest(4)
- extra("struct processNotify *ppn")
- }
- field(PPNR,DBF_NOACCESS) {
- prompt("pprocessNotifyRecord")
- special(SPC_NOMOD)
- interest(4)
- extra("struct processNotifyRecord *ppnr")
- }
- field(SPVT,DBF_NOACCESS) {
- prompt("Scan Private")
- special(SPC_NOMOD)
- interest(4)
- extra("struct scan_element *spvt")
- }
- field(RSET,DBF_NOACCESS) {
- prompt("Address of RSET")
- special(SPC_NOMOD)
- interest(4)
- extra("struct typed_rset *rset")
- }
- %#include "devSup.h"
- field(DSET,DBF_NOACCESS) {
- prompt("DSET address")
- special(SPC_NOMOD)
- interest(4)
- extra("unambiguous_dset *dset")
- }
- field(DPVT,DBF_NOACCESS) {
- prompt("Device Private")
- special(SPC_NOMOD)
- interest(4)
- extra("void *dpvt")
- }
- field(RDES,DBF_NOACCESS) {
- prompt("Address of dbRecordType")
- special(SPC_NOMOD)
- interest(4)
- extra("struct dbRecordType *rdes")
- }
- field(LSET,DBF_NOACCESS) {
- prompt("Lock Set")
- special(SPC_NOMOD)
- interest(4)
- extra("struct lockRecord *lset")
- }
- field(PRIO,DBF_MENU) {
- prompt("Scheduling Priority")
- promptgroup("20 - Scan")
- special(SPC_SCAN)
- interest(1)
- menu(menuPriority)
- }
- field(TPRO,DBF_UCHAR) {
- prompt("Trace Processing")
- }
- field(BKPT,DBF_NOACCESS) {
- prompt("Break Point")
- special(SPC_NOMOD)
- interest(1)
- extra("char bkpt")
- }
- field(UDF,DBF_UCHAR) {
- prompt("Undefined")
- promptgroup("10 - Common")
- pp(TRUE)
- interest(1)
- initial("1")
- }
- field(UDFS,DBF_MENU) {
- prompt("Undefined Alarm Sevrty")
- promptgroup("70 - Alarm")
- interest(1)
- menu(menuAlarmSevr)
- initial("INVALID")
- }
- %#include "epicsTime.h"
- field(TIME,DBF_NOACCESS) {
- prompt("Time")
- special(SPC_NOMOD)
- interest(2)
- extra("epicsTimeStamp time")
- }
- field(FLNK,DBF_FWDLINK) {
- prompt("Forward Process Link")
- promptgroup("20 - Scan")
- interest(1)
- }
diff --git a/modules/database/src/ioc/db/dbCommon.dbd.pod b/modules/database/src/ioc/db/dbCommon.dbd.pod
new file mode 100644
index 000000000..0fa00155a
--- /dev/null
+++ b/modules/database/src/ioc/db/dbCommon.dbd.pod
@@ -0,0 +1,521 @@
+#*************************************************************************
+# Copyright (c) 2007 UChicago Argonne LLC, as Operator of Argonne
+# National Laboratory.
+# Copyright (c) 2002 The Regents of the University of California, as
+# Operator of Los Alamos National Laboratory.
+# EPICS BASE is distributed subject to a Software License Agreement found
+# in file LICENSE that is included with this distribution.
+#*************************************************************************
+
+=head3 Operator Display Parameters
+
+The B field contains the record name which must be unique within an
+EPICS Channel Access name space. The name is supplied by the application
+developer and is the means of identifying a specific record. The name has a
+maximum length of 60 characters and should use only this limited set of
+characters:
+
+ a-z A-Z 0-9 _ - : [ ] < > ;
+
+The B field may be set to provide a meaningful description of the
+record's purpose. Maximum length is 40 characters.
+
+=fields NAME, DESC
+
+=cut
+
+ %#include "epicsTypes.h"
+ %#include "link.h"
+ field(NAME,DBF_STRING) {
+ prompt("Record Name")
+ special(SPC_NOMOD)
+ size(61)
+ }
+ field(DESC,DBF_STRING) {
+ prompt("Descriptor")
+ promptgroup("10 - Common")
+ size(41)
+ }
+ field(ASG,DBF_STRING) {
+ prompt("Access Security Group")
+ promptgroup("10 - Common")
+ special(SPC_AS)
+ size(29)
+ }
+
+=head3 Scan Fields
+
+These fields contain information related to how and when a record processes. A
+few records have unique fields that also affect how they process. These
+fields, if any, will be listed and explained in the section for each record.
+
+The B field specifies the scanning period for periodic record scans or the
+scan type for non-periodic record scans. The default set of values for SCAN can
+be found in L.
+
+The choices provided by this menu are:
+
+=over
+
+=item *
+
+C for the record scan to be triggered by other records or Channel
+Access
+
+=item *
+
+C for event-driven scan
+
+=item *
+
+C for interrupt-driven scan
+
+=item *
+
+A set of periodic scan intervals
+
+=back
+
+Additional periodic scan rates may be defined for individual IOCs by making a
+local copy of menuScan.dbd and adding more choices as required. Scan rates
+should normally be defined in order, with the fastest rates appearing first.
+Scan periods may now be specified in seconds, minutes, hours or Hertz/Hz, and
+plural time units will also be accepted (seconds are used if no unit is
+mentioned in the choice string). For example the rates given below are all
+valid:
+
+ 1 hour
+ 0.5 hours
+ 15 minutes
+ 3 seconds
+ 1 second
+ 2 Hertz
+
+The B field specifies record processing at initialization. If it is set
+to YES during database configuration, the record is processed once at IOC
+initialization (before the normal scan tasks are started).
+
+The B field orders the records within a specific SCAN group. This is not
+meaningful for passive records. All records of a specified phase are processed
+before those with higher phase number. Whenever possible it is better to use
+linked passive records to enforce the order of processing rather than a phase
+number.
+
+The B field specifies an event number. This event number is used if the
+SCAN field is set to C. All records with scan type C and the
+same EVNT value will be processed when a call to post_event for EVNT is made.
+The call to post_event is: post_event(short event_number).
+
+The B field specifies the scheduling priority for processing records
+with SCAN=C and asynchronous record completion tasks.
+
+The B field specifies a "disable value". Record processing is
+immediately terminated if the value of this field is equal to the value of the
+DISA field, i.e. the record is disabled. Note that field values of a record
+can be changed by database put or Channel Access, even if a record is
+disabled.
+
+The B field contains the value that is compared with DISV to determine
+if the record is disabled. The value of the DISA field is obtained via SDIS if
+SDIS is a database or channel access link. If SDIS is not a database or
+channel access link, then DISA can be set via dbPutField or dbPutLink.
+
+If the B field of a record is written to, the record is processed.
+
+The B field defines the record's "disable severity". If this field is
+not NO_ALARM and the record is disabled, the record will be put into alarm
+with this severity and a status of DISABLE_ALARM.
+
+The B field contains the lock set to which this record belongs. All
+records linked in any way via input, output, or forward database links belong
+to the same lock set. Lock sets are determined at IOC initialization time, and
+are updated whenever a database link is added, removed or altered.
+
+The B field counts the number of times dbProcess finds the record active
+during successive scans, i.e. PACT is TRUE. If dbProcess finds the record
+active MAX_LOCK times (currently set to 10) it raises a SCAN_ALARM.
+
+The B field is TRUE while the record is being processed. For
+asynchronous records PACT can be TRUE from the time record processing is
+started until the asynchronous completion occurs. As long as PACT is TRUE,
+dbProcess will not call the record processing routine. See Application
+Developers Guide for details on usage of PACT.
+
+The B field is a database link to another record (the "target" record).
+Processing a record with a specified FLNK field will force processing of the
+target record, provided the target record's SCAN field is set to C.
+
+The B field is for internal use by the scanning system.
+
+=fields SCAN, PINI, PHAS, EVNT, PRIO, DISV, DISA, SDIS, PROC, DISS, LCNT, PACT, FLNK, SPVT
+
+=cut
+
+ field(SCAN,DBF_MENU) {
+ prompt("Scan Mechanism")
+ promptgroup("20 - Scan")
+ special(SPC_SCAN)
+ interest(1)
+ menu(menuScan)
+ }
+ field(PINI,DBF_MENU) {
+ prompt("Process at iocInit")
+ promptgroup("20 - Scan")
+ interest(1)
+ menu(menuPini)
+ }
+ field(PHAS,DBF_SHORT) {
+ prompt("Scan Phase")
+ promptgroup("20 - Scan")
+ special(SPC_SCAN)
+ interest(1)
+ }
+ field(EVNT,DBF_STRING) {
+ prompt("Event Name")
+ promptgroup("20 - Scan")
+ special(SPC_SCAN)
+ size(40)
+ interest(1)
+ }
+ field(TSE,DBF_SHORT) {
+ prompt("Time Stamp Event")
+ promptgroup("20 - Scan")
+ interest(1)
+ }
+ field(TSEL,DBF_INLINK) {
+ prompt("Time Stamp Link")
+ promptgroup("20 - Scan")
+ interest(1)
+ }
+ field(DTYP,DBF_DEVICE) {
+ prompt("Device Type")
+ promptgroup("10 - Common")
+ interest(1)
+ }
+ field(DISV,DBF_SHORT) {
+ prompt("Disable Value")
+ promptgroup("20 - Scan")
+ initial("1")
+ }
+ field(DISA,DBF_SHORT) {
+ prompt("Disable")
+ }
+ field(SDIS,DBF_INLINK) {
+ prompt("Scanning Disable")
+ promptgroup("20 - Scan")
+ interest(1)
+ }
+ %#include "epicsMutex.h"
+ field(MLOK,DBF_NOACCESS) {
+ prompt("Monitor lock")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("epicsMutexId mlok")
+ }
+ %#include "ellLib.h"
+ field(MLIS,DBF_NOACCESS) {
+ prompt("Monitor List")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("ELLLIST mlis")
+ }
+ field(BKLNK,DBF_NOACCESS) {
+ prompt("Backwards link tracking")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("ELLLIST bklnk")
+ }
+ field(DISP,DBF_UCHAR) {
+ prompt("Disable putField")
+ }
+ field(PROC,DBF_UCHAR) {
+ prompt("Force Processing")
+ pp(TRUE)
+ interest(3)
+ }
+
+=head3 Alarm Fields
+
+These fields indicate the status and severity of alarms, or else determine the
+how and when alarms are triggered. Of course, many records have alarm-related
+fields not common to all records. These fields are listed and explained in the
+appropriate section on each record.
+
+The B field contains the current alarm status.
+
+The B field contains the current alarm severity.
+
+These two fields are seen outside database access. The B and B
+fields are used by the database access, record support, and device support
+routines to set new alarm status and severity values. Whenever any software
+component discovers an alarm condition, it uses the following macro function:
+recGblSetSevr(precord,new_status,new_severity) This ensures that the current
+alarm severity is set equal to the highest outstanding alarm. The file alarm.h
+defines all allowed alarm status and severity values.
+
+The B field contains the highest unacknowledged alarm severity.
+
+The B field specifies if it is necessary to acknowledge transient
+alarms.
+
+The B indicates if the record's value is BnBeBined. Typically
+this is caused by a failure in device support, the fact that the record has
+never been processed, or that the VAL field currently contains a NaN (not a
+number). UDF is initialized to TRUE at IOC initialization. Record and device
+support routines which write to the VAL field are responsible for setting UDF.
+
+=fields STAT, SEVR, NSTA, NSEV, ACKS, ACKT, UDF
+
+=cut
+
+ field(STAT,DBF_MENU) {
+ prompt("Alarm Status")
+ special(SPC_NOMOD)
+ menu(menuAlarmStat)
+ initial("UDF")
+ }
+ field(SEVR,DBF_MENU) {
+ prompt("Alarm Severity")
+ special(SPC_NOMOD)
+ menu(menuAlarmSevr)
+ }
+ field(NSTA,DBF_MENU) {
+ prompt("New Alarm Status")
+ special(SPC_NOMOD)
+ interest(2)
+ menu(menuAlarmStat)
+ }
+ field(NSEV,DBF_MENU) {
+ prompt("New Alarm Severity")
+ special(SPC_NOMOD)
+ interest(2)
+ menu(menuAlarmSevr)
+ }
+ field(ACKS,DBF_MENU) {
+ prompt("Alarm Ack Severity")
+ special(SPC_NOMOD)
+ interest(2)
+ menu(menuAlarmSevr)
+ }
+ field(ACKT,DBF_MENU) {
+ prompt("Alarm Ack Transient")
+ promptgroup("70 - Alarm")
+ special(SPC_NOMOD)
+ interest(2)
+ menu(menuYesNo)
+ initial("YES")
+ }
+ field(DISS,DBF_MENU) {
+ prompt("Disable Alarm Sevrty")
+ promptgroup("70 - Alarm")
+ interest(1)
+ menu(menuAlarmSevr)
+ }
+ field(LCNT,DBF_UCHAR) {
+ prompt("Lock Count")
+ special(SPC_NOMOD)
+ interest(2)
+ }
+ field(PACT,DBF_UCHAR) {
+ prompt("Record active")
+ special(SPC_NOMOD)
+ interest(1)
+ }
+ field(PUTF,DBF_UCHAR) {
+ prompt("dbPutField process")
+ special(SPC_NOMOD)
+ interest(1)
+ }
+ field(RPRO,DBF_UCHAR) {
+ prompt("Reprocess ")
+ special(SPC_NOMOD)
+ interest(1)
+ }
+ field(ASP,DBF_NOACCESS) {
+ prompt("Access Security Pvt")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("struct asgMember *asp")
+ }
+ field(PPN,DBF_NOACCESS) {
+ prompt("pprocessNotify")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("struct processNotify *ppn")
+ }
+ field(PPNR,DBF_NOACCESS) {
+ prompt("pprocessNotifyRecord")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("struct processNotifyRecord *ppnr")
+ }
+ field(SPVT,DBF_NOACCESS) {
+ prompt("Scan Private")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("struct scan_element *spvt")
+ }
+
+=head3 Device Fields
+
+The B field contains the address of the Record Support Entry Table. See
+the Application Developers Guide for details on usage.
+
+The B field contains the address of Device Support Entry Table. The
+value of this field is determined at IOC initialization time. Record support
+routines use this field to locate their device support routines.
+
+The B field is is for private use of the device support modules.
+
+=fields RSET, DSET, DPVT
+
+=cut
+
+ field(RSET,DBF_NOACCESS) {
+ prompt("Address of RSET")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("struct typed_rset *rset")
+ }
+ %#include "devSup.h"
+ field(DSET,DBF_NOACCESS) {
+ prompt("DSET address")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("unambiguous_dset *dset")
+ }
+ field(DPVT,DBF_NOACCESS) {
+ prompt("Device Private")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("void *dpvt")
+ }
+ field(RDES,DBF_NOACCESS) {
+ prompt("Address of dbRecordType")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("struct dbRecordType *rdes")
+ }
+ field(LSET,DBF_NOACCESS) {
+ prompt("Lock Set")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("struct lockRecord *lset")
+ }
+ field(PRIO,DBF_MENU) {
+ prompt("Scheduling Priority")
+ promptgroup("20 - Scan")
+ special(SPC_SCAN)
+ interest(1)
+ menu(menuPriority)
+ }
+
+=head3 Debugging Fields
+
+The B field is used for trace processing. If this field is non-zero a
+message is printed whenever this record is processed, and when any other
+record in the same lock-set is processed by a database link from this record.
+
+The B field indicates if there is a breakpoint set at this record. This
+supports setting a debug breakpoint in the record processing. STEP through
+database processing can be supported using this.
+
+=fields TPRO, BKPT
+
+
+=head3 Miscellaneous Fields
+
+The B field contains a character string value defining the access
+security group for this record. If left empty, the record is placed in group
+DEFAULT.
+
+The B field is a field for private use of the access security system.
+
+The B field controls dbPutFields to this record which are normally
+issued by channel access. If the field is set to TRUE all dbPutFields
+directed to this record are ignored except to the field DISP itself.
+
+The B field specifies the device type for the record. Each record type
+has its own set of device support routines which are specified in
+devSup.ASCII. If a record type does not have any associated device support,
+DTYP and DSET are meaningless.
+
+The B field contains the monitor lock. The lock used by the monitor
+routines when the monitor list is being used. The list is locked whenever
+monitors are being scheduled, invoked, or when monitors are being added to or
+removed from the list. This field is accessed only by the dbEvent routines.
+
+The B field is the head of the list of monitors connected to this
+record. Each record support module is responsible for triggering monitors for
+any fields that change as a result of record processing. Monitors are present
+if mlis count is greater than zero. The call to trigger monitors is:
+db_post_event(precord,&data,mask), where "mask" is some combination of
+DBE_ALARM, DBE_VALUE, and DBE_LOG.
+
+The B field contains the address of a putNotify callback.
+
+The B field contains the next record for PutNotify.
+
+The B field is set to TRUE if dbPutField caused the current record
+processing.
+
+The B field contains the address of dbRecordType
+
+The B field specifies a reprocessing of the record when current
+processing completes.
+
+The B field contains the time when this record was last processed in
+standard format.
+
+The B field indicates the mechanism to use to get the time stamp. '0' -
+call get time as before '-1' - call the time stamp driver and use the best
+source available. '-2' - the device support provides the time stamp from the
+hardware. Values between 1-255 request the time of the last occurance of a
+generalTime event.
+
+The B field contains an input link for obtaining the time stamp. If this
+link references the .TIME field of a record then the time stamp of the
+referenced record becomes the time stamp for this record as well. In this
+case, an internal flag is set and ".TIME" is then overwritten by ".VAL". If
+any other field is referenced, the field value is read and stored in the .TSE
+field which is then used to acquire a timestamp.
+
+=fields ASG, ASP, DISP, DTYP, MLOK, MLIS, PPN, PPNR, PUTF, RDES, RPRO, TIME, TSE, TSEL
+
+=cut
+
+ field(TPRO,DBF_UCHAR) {
+ prompt("Trace Processing")
+ }
+ field(BKPT,DBF_NOACCESS) {
+ prompt("Break Point")
+ special(SPC_NOMOD)
+ interest(1)
+ extra("char bkpt")
+ }
+ field(UDF,DBF_UCHAR) {
+ prompt("Undefined")
+ promptgroup("10 - Common")
+ pp(TRUE)
+ interest(1)
+ initial("1")
+ }
+ field(UDFS,DBF_MENU) {
+ prompt("Undefined Alarm Sevrty")
+ promptgroup("70 - Alarm")
+ interest(1)
+ menu(menuAlarmSevr)
+ initial("INVALID")
+ }
+ %#include "epicsTime.h"
+ field(TIME,DBF_NOACCESS) {
+ prompt("Time")
+ special(SPC_NOMOD)
+ interest(2)
+ extra("epicsTimeStamp time")
+ }
+ field(FLNK,DBF_FWDLINK) {
+ prompt("Forward Process Link")
+ promptgroup("20 - Scan")
+ interest(1)
+ }
diff --git a/modules/database/src/ioc/db/dbCommonInput.pod b/modules/database/src/ioc/db/dbCommonInput.pod
new file mode 100644
index 000000000..079277002
--- /dev/null
+++ b/modules/database/src/ioc/db/dbCommonInput.pod
@@ -0,0 +1,208 @@
+#*************************************************************************
+# EPICS BASE is distributed subject to a Software License Agreement found
+# in file LICENSE that is included with this distribution.
+#*************************************************************************
+
+=head1 Fields Common to Input Record Types
+
+This section describes fields that are found in many input record types.
+These fields usually have the same meaning whenever they are used.
+
+See also L and L.
+
+=head3 Input and Value Fields
+
+The B field specifies an input link. It is used by the device support
+routines to obtain input. For soft analog records it can be a constant, a
+database link, or a channel access link.
+
+The B field specifies the name of the device support module that will
+input values. Each record type has its own set of device support routines. If
+a record type does not have any associated device support, DTYP is
+meaningless.
+
+The B field contains - whenever possible - the raw data value exactly as
+it is obtained from the hardware or from the associated device driver and
+before it undergoes any conversions. The Soft Channel device support module
+reads values directly into VAL, bypassing this field.
+
+The B field contains the record's final value, after any needed
+conversions have been performed.
+
+=head3 Device Input
+
+A device input routine normally returns one of the following values to its
+associated record support routine:
+
+=over
+
+=item *
+
+0: Success and convert. The input value is in RVAL. The record support module
+will compute VAL from RVAL.
+
+=item *
+
+2: Success, but don't convert. The device support module can specify this
+value if it does not want any conversions. It might do this for two reasons:
+
+=over
+
+=item *
+
+A hardware error is detected (in this case, it should also raise an alarm
+condition).
+
+=item *
+
+The device support routine reads values directly into the VAL field and then
+sets UDF to FALSE. For some record types the device support routine may have to
+do other record-specific processing as well such as applying a smoothing filter
+to the engineering units value.
+
+=back
+
+=back
+
+=head3 Device Support for Soft Records
+
+In most cases, two soft output device support modules are provided: Soft Channel
+and Raw Soft Channel. Both allow INP to be a constant, a database link, or a
+channel access link. The Soft Channel device support module reads input directly
+into the VAL field and specifies that no value conversion should be performed.
+This allows the record to store values in the data type of its VAL field. Note
+that for Soft Channel input, the RVAL field is not used. The Raw Soft Channel
+support module reads input into RVAL and indicates that any specified unit
+conversions be performed.
+
+The device support read routine normally calls C which
+fetches a value from the link.
+
+If a value was returned by the link the UDF field is set to FALSE. The device
+support read routine normally returns the status from C.
+
+
+=head3 Input Simulation Fields
+
+The B field controls simulation mode.
+By setting this field to YES or RAW, the record can be switched into
+simulation mode of operation.
+While in simulation mode, input will be obtained from SIOL instead of INP.
+
+The B field specifies the simulation mode location. This field can be a
+constant, a database link, or a channel access link. If SIML is a database or
+channel access link, then SIMM is read from SIML. If SIML is a constant link
+then SIMM is initialized with the constant value, but can be changed via
+database or channel access puts.
+
+The B field contains the simulation value. This is the record's input
+value, in engineering units, when the record is switched into simulation mode,
+i.e., SIMM is set to YES or RAW. If the record type supports conversion,
+setting SIMM to RAW causes SVAL to be written to RVAL and the conversion to
+be done.
+
+The B field is a link that can be used to fetch the simulation value. The
+link can be a constant, a database link, or a channel access link. If SIOL is a
+database or channel access link, then SVAL is read from SIOL. If SIOL is a
+constant link then SVAL is initialized with the constant value but can be
+changed via database or channel access puts.
+
+The B field specifies the simulation mode alarm severity. When this
+field is set to a value other than NO_ALARM and the record is in simulation
+mode, it will be put into alarm with this severity and a status of SIMM_ALARM.
+
+The B field specifies a delay (in seconds) to implement asynchronous
+processing in simulation mode. A positive SDLY value will be used as delay
+between the first and second phase of processing in simulation mode.
+A negative value (default) specifies synchronous processing.
+
+The B field specifies the SCAN mechanism to be used in simulation mode.
+This is specifically useful for 'I/O Intr' scanned records, which would
+otherwise never be scanned in simulation mode.
+
+=head3 Simulation Mode for Input Records
+
+An input record can be switched into simulation mode of operation by setting
+the value of SIMM to YES or RAW.
+During simulation, the record will be put into alarm with a severity of SIMS
+and a status of SIMM_ALARM.
+
+ -- (SIMM = NO?)
+ / (if supported and directed by device support,
+ / INP -> RVAL -- convert -> VAL),
+ (else INP -> VAL)
+ SIML -> SIMM
+
+ \
+ -- (SIMM = YES?) SIOL -> SVAL -> VAL
+ \
+ -- (SIMM = RAW?) SIOL -> SVAL -> RVAL -- convert -> VAL
+
+If SIMM is set to YES, the input value, in engineering units, will be obtained
+from SIOL instead of INP and directly written to the VAL field.
+If SIMM is set to RAW, the value read through SIOL will be truncated and
+written to the RVAL field, followed by the regular raw value conversion.
+While the record is in simulation mode, there will be no calls to device
+support when the record is processed.
+
+If SIOL contains a link, a TSE setting of "time from device" (-2) is honored
+in simulation mode by taking the time stamp from the record that SIOL points
+to.
+
+Normally input records contain a private C routine which performs
+the following steps:
+
+=over
+
+=item *
+
+If PACT is TRUE, the device support read routine is called, status is set to
+its return code, and readValue returns.
+
+=item *
+
+Call C to get a new value for SIMM from SIML.
+
+=item *
+
+Check value of SIMM.
+
+=item *
+
+If SIMM is NO, then call the device support read routine, set status to its
+return code, and return.
+
+=item *
+
+If SIMM is YES or RAW, then
+
+=over
+
+=item *
+
+Set alarm status to SIMM_ALARM and severity to SIMS,
+if SIMS is greater than zero.
+
+=item *
+
+If the record simulation processing is synchronous (SDLY < 0) or the record is
+in the second phase of an asynchronous processing, call C
+to read the input value from SIOL into SVAL.
+Set status to the return code from C.
+If the call succeeded and SIMM is YES, write the value to VAL and set the
+status to 2 (don't convert),
+if SIMM is RAW and the record type supports conversion, cast the value to RVAL
+and leave the status as 0 (convert).
+
+Otherwise (record is in first phase of an asynchronous processing), set up a
+callback processing with the delay specified in SDLY.
+
+=back
+
+=item *
+
+If SIMM is not YES, NO or RAW, a SOFT alarm with a severity of INVALID is
+raised, and return status is set to -1.
+
+=back
diff --git a/modules/database/src/ioc/db/dbCommonOutput.pod b/modules/database/src/ioc/db/dbCommonOutput.pod
new file mode 100644
index 000000000..b60468269
--- /dev/null
+++ b/modules/database/src/ioc/db/dbCommonOutput.pod
@@ -0,0 +1,239 @@
+#*************************************************************************
+# EPICS BASE is distributed subject to a Software License Agreement found
+# in file LICENSE that is included with this distribution.
+#*************************************************************************
+
+=head1 Fields Common to Output Record Types
+
+This section describes fields that are found in many output record types.
+These fields usually have the same meaning whenever they are used.
+
+See also L and L.
+
+=head3 Output and Value Fields
+
+The B field specifies an output link. It is used by the device support
+routines to decide where to send output. For soft records, it can be a
+constant, a database link, or a channel access link. If the link is a
+constant, the result is no output.
+
+The B field specifies the name of the device support module that will
+input values. Each record type has its own set of device support routines. If
+a record type does not have any associated device support, DTYP is
+meaningless.
+
+The B field contains the desired value before any conversions to raw
+output have been performed.
+
+The B field is used to decide when to invoke monitors. Archive and value
+change monitors are invoked if OVAL is not equal to VAL. If a record type
+needs to make adjustments, OVAL is used to enforce the maximum rate of change
+limit before converting the desired value to a raw value.
+
+The B field contains - whenever possible - the actual value sent to the
+hardware itself or to the associated device driver.
+
+The B field contains - whenever possible - the actual read back value
+obtained from the hardware itself or from the associated device driver.
+
+
+=head3 Device Support for Soft Records
+
+Normally two soft output device support modules are provided, Soft Channel and
+and Raw Soft Channel. Both write a value through the output link OUT.
+The Soft Channel module writes output from the value associated with OVAL or
+VAL (if OVAL does not exist). The Raw Soft Channel support module writes the
+value associated with the RVAL field after conversion has been performed.
+
+The device support write routine normally calls C which writes a
+value through the OUT link, and returns the status from that call.
+
+
+=head3 Input and Mode Select Fields
+
+The B field is a link from which the desired output value can be fetched.
+DOL can be a constant, a database link, or a channel access link. If DOL is a
+database or channel access link and OMSL is closed_loop, then VAL is obtained
+from DOL.
+
+The B field selects the output mode. This field has either the value
+C or C. DOL is used to fetch VAL only if OMSL has the
+value C. By setting this field a record can be switched between
+supervisory and closed loop mode of operation. While in closed loop mode, the
+VAL field cannot be set via dbPuts.
+
+=head3 Output Mode Selection
+
+The fields DOL and OMSL are used to allow the output record to be part of a
+closed loop control algorithm. OMSL is meaningful only if DOL refers to a
+database or channel access link. It can have the values C or
+C. If the mode is C, then nothing is done to VAL. If
+the mode is C and the record type does not contain an OIF field,
+then each time the record is processed, VAL is set equal to the value obtained
+from the location referenced by DOL. If the mode is C in record
+types with an OIF field and OIF is Full, VAL is set equal to the value obtained
+from the location referenced by DOL; if OIF is Incremental VAL is incremented by
+the value obtained from DOL.
+
+=head3 Invalid Output Action Fields
+
+The B field specifies the output action for the case that the record is
+put into an INVALID alarm severity. IVOA can be one of the following actions:
+
+=over
+
+=item *
+
+C
+
+=item *
+
+C
+
+=item *
+
+C
+
+=back
+
+The B field contains the value for the IVOA action C
+in engineering units. If a new severity has been set to INVALID and IVOA is
+C, then VAL is set to IVOV and converted to RVAL before
+device support is called.
+
+=head3 Invalid Alarm Output Action
+
+Whenever an output record is put into INVALID alarm severity, IVOA specifies
+an action to take. The record support process routine for each output record
+contains code which performs the following steps.
+
+=over
+
+=item *
+
+If new severity is less than INVALID, then call C:
+
+=item *
+
+Else do the following:
+
+=over
+
+=item *
+
+If IVOA is C then call C.
+
+=item *
+
+If IVOA is C then do not write output.
+
+=item *
+
+If IVOA is C then set VAL to IVOV, call C if
+necessary, and then call C.
+
+=item *
+
+If IVOA not one of the above, an error message is generated.
+
+=back
+
+=back
+
+
+=head3 Output Simulation Fields
+
+The B field controls simulation mode. It has either the value YES or NO.
+By setting this field to YES, the record can be switched into simulation mode
+of operation. While in simulation mode, output will be forwarded through SIOL
+instead of OUT.
+
+The B field specifies the simulation mode location. This field can be a
+constant, a database link, or a channel access link. If SIML is a database or
+channel access link, then SIMM is read from SIML. If SIML is a constant link
+then SIMM is initialized with the constant value, but can be changed via
+database or channel access puts.
+
+The B field is a link that the output value is written to when the record
+is in simulation mode.
+
+The B field specifies the simulation mode alarm severity. When this
+field is set to a value other than NO_ALARM and the record is in simulation
+mode, it will be put into alarm with this severity and a status of SIMM_ALARM.
+
+The B field specifies a delay (in seconds) to implement asynchronous
+processing in simulation mode. A positive SDLY value will be used as delay
+between the first and second phase of processing in simulation mode.
+A negative value (default) specifies synchronous processing.
+
+The B field specifies the SCAN mechanism to be used in simulation mode.
+This is specifically useful for 'I/O Intr' scanned records, which would
+otherwise never be scanned in simulation mode.
+
+=head3 Simulation Mode for Output Records
+
+An output record can be switched into simulation mode of operation by setting
+the value of SIMM to YES. During simulation, the record will be put into alarm
+with a severity of SIMS and a status of SIMM_ALARM. While in simulation mode,
+output values, in engineering units, will be written to SIOL instead of OUT.
+However, the output values are never converted. Also, while the record is in
+simulation mode, there will be no calls to device support during record
+processing.
+
+Normally output records contain a private C routine which performs
+the following steps:
+
+=over
+
+=item *
+
+If PACT is TRUE, the device support write routine is called, status is set to
+its return code, and readValue returns.
+
+=item *
+
+Call C to get a new value for SIMM if SIML is a DB_LINK or a
+CA_LINK.
+
+=item *
+
+Check value of SIMM.
+
+=item *
+
+If SIMM is NO, then call the device support write routine, set status to its
+return code, and return.
+
+=item *
+
+If SIMM is YES, then
+
+=over
+
+=item *
+
+Set alarm status to SIMM_ALARM and severity to SIMS,
+if SIMS is greater than zero.
+
+=item *
+
+If the record simulation processing is synchronous (SDLY < 0) or the record is
+in the second phase of an asynchronous processing, call C
+to write the output value from VAL or OVAL to SIOL.
+
+Otherwise (record is in first phase of an asynchronous processing), set up a
+callback processing with the delay specified in SDLY.
+
+=item *
+
+Set status to the return code from C and return.
+
+=back
+
+=item *
+
+If SIMM is not YES or NO, a SOFT alarm with a severity of INVALID is
+raised, and return status is set to -1.
+
+=back
diff --git a/modules/database/src/ioc/db/dbCommonRecord.dbd b/modules/database/src/ioc/db/dbCommonRecord.dbd
deleted file mode 100644
index a988619ae..000000000
--- a/modules/database/src/ioc/db/dbCommonRecord.dbd
+++ /dev/null
@@ -1,12 +0,0 @@
-#*************************************************************************
-# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
-# National Laboratory.
-# Copyright (c) 2002 The Regents of the University of California, as
-# Operator of Los Alamos National Laboratory.
-# EPICS BASE Versions 3.13.7
-# and higher are distributed subject to a Software License Agreement found
-# in file LICENSE that is included with this distribution.
-#*************************************************************************
-recordtype(dbCommon) {
- include "dbCommon.dbd"
-}
diff --git a/modules/database/src/ioc/db/dbCommonRecord.dbd.pod b/modules/database/src/ioc/db/dbCommonRecord.dbd.pod
new file mode 100644
index 000000000..e331b8e00
--- /dev/null
+++ b/modules/database/src/ioc/db/dbCommonRecord.dbd.pod
@@ -0,0 +1,20 @@
+#*************************************************************************
+# EPICS BASE is distributed subject to a Software License Agreement found
+# in file LICENSE that is included with this distribution.
+#*************************************************************************
+
+=head1 Fields Common to All Record Types
+
+This section contains a description of the fields that are common to all record
+types. These fields are defined in dbCommon.dbd.
+
+See also L