Compare commits
100 Commits
PSI-7.0.8.
...
7.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4ebc01401 | ||
|
|
6ea6ae633b | ||
|
|
9fac52fa58 | ||
|
|
fc5d3c9a5c | ||
| c75ad2673e | |||
| b97a35fec8 | |||
|
|
350570134e | ||
|
|
72f3e75c8d | ||
|
|
90f97a7037 | ||
|
|
fd86f0ff04 | ||
|
|
bcc6cb96ae | ||
|
|
a4bc0db6e6 | ||
|
|
48ebe2c64e | ||
|
|
9f788996dc | ||
|
|
13d6ca598c | ||
| ee1a49045a | |||
|
|
78f263f359 | ||
| 43e75e3901 | |||
|
|
131578124b | ||
|
|
7bd3e7aa2e | ||
|
|
86154953f5 | ||
|
|
07572ab025 | ||
|
|
0733beae50 | ||
|
|
a3d8531008 | ||
|
|
7a6e11cae0 | ||
|
|
7384351181 | ||
|
|
890cbc2c0d | ||
|
|
2612b47c3f | ||
|
|
f4c474eb77 | ||
|
|
1735a821db | ||
|
|
1d19ba4cc2 | ||
|
|
144f9756ea | ||
|
|
48eed22f3b | ||
|
|
8ac2c87156 | ||
|
|
0d2ffcd97f | ||
|
|
c8eccfcb8f | ||
|
|
6fb40b02fe | ||
|
|
dad0ee9c89 | ||
|
|
065fe7cab6 | ||
|
|
e4ad4becde | ||
|
|
1cd141c540 | ||
| 72026a27a0 | |||
|
|
9fb820b46e | ||
|
|
721e9cc3a7 | ||
|
|
0186836449 | ||
|
|
b90ab7de13 | ||
|
|
333be085c0 | ||
|
|
169948967f | ||
|
|
5a11954c51 | ||
|
|
9f8a8b9c1f | ||
|
|
d0cf47cd6f | ||
|
|
f4aee8e6b7 | ||
| dac620a708 | |||
| 4ee766b6b1 | |||
| 5143258011 | |||
|
|
ead8b7e82b | ||
|
|
8483ff9560 | ||
| b7cc33c3c9 | |||
| 9e7cd241e0 | |||
| faac1df1c6 | |||
|
|
1f8851a5dc | ||
|
|
ac3e8af9fd | ||
|
|
98a30e8029 | ||
|
|
594e5ee9db | ||
|
|
135193c4bd | ||
|
|
9d65da5c61 | ||
|
|
f9d1fbeedb | ||
|
|
2b8a944a7d | ||
|
|
83cbf8a4c7 | ||
|
|
47880fbcf7 | ||
|
|
b0bff556c9 | ||
|
|
932e506df1 | ||
|
|
b7991b6eca | ||
|
|
f6cd43b7cc | ||
|
|
e6a2047bbf | ||
|
|
7923076b1c | ||
|
|
46ad962cd8 | ||
|
|
f47e1d94a3 | ||
|
|
022b8d468b | ||
|
|
152d306ad8 | ||
|
|
012139638d | ||
|
|
78b575f487 | ||
|
|
74713632a6 | ||
|
|
dd5df7363c | ||
|
|
3888e9dec7 | ||
|
|
af206ba7fc | ||
|
|
be4d1604ba | ||
|
|
8e2217dbf7 | ||
|
|
34b3306faa | ||
|
|
8c88d052bb | ||
|
|
ad7575f5a4 | ||
|
|
601ac051db | ||
|
|
c0aeb4c69b | ||
|
|
7cdaaf716a | ||
|
|
615ba73044 | ||
|
|
c285f2a78f | ||
|
|
fcb227ed97 | ||
|
|
4f6aa7ec29 | ||
| 60f6ba7b49 | |||
|
|
8045770751 |
@@ -52,8 +52,6 @@ environment:
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- CMP: vs2015
|
||||
- CMP: vs2013
|
||||
- CMP: vs2012
|
||||
- CMP: vs2010
|
||||
- CMP: gcc
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
# TODO: static linking w/ readline isn't working. Bypass auto-detect
|
||||
@@ -67,11 +65,6 @@ platform:
|
||||
# Matrix configuration: exclude sets of jobs
|
||||
matrix:
|
||||
exclude:
|
||||
# VS2012 and older installs don't have the 64 bit compiler
|
||||
- platform: x64
|
||||
CMP: vs2012
|
||||
- platform: x64
|
||||
CMP: vs2010
|
||||
# Exclude more jobs to reduce build time
|
||||
# Skip 32-bit for "middle-aged" compilers
|
||||
- platform: x86
|
||||
|
||||
@@ -59,8 +59,6 @@ environment:
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
- CMP: vs2015
|
||||
- CMP: vs2013
|
||||
- CMP: vs2012
|
||||
- CMP: vs2010
|
||||
- CMP: gcc
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
# TODO: static linking w/ readline isn't working. Bypass auto-detect
|
||||
@@ -74,11 +72,6 @@ platform:
|
||||
# Matrix configuration: exclude sets of jobs
|
||||
matrix:
|
||||
exclude:
|
||||
# VS2012 and older installs don't have the 64 bit compiler
|
||||
- platform: x64
|
||||
CMP: vs2012
|
||||
- platform: x64
|
||||
CMP: vs2010
|
||||
# Exclude more jobs to reduce build time
|
||||
# Skip 32-bit for "middle-aged" compilers
|
||||
- platform: x86
|
||||
|
||||
22
.github/codeql/config.yml
vendored
Normal file
22
.github/codeql/config.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: "CodeQL Config"
|
||||
|
||||
# Queries and the suites they belong to are documented at
|
||||
# https://codeql.github.com/codeql-query-help/cpp/
|
||||
|
||||
queries:
|
||||
- uses: security-and-quality
|
||||
# Choose the above from 3 query suites:
|
||||
# default
|
||||
# The default set of queries
|
||||
# security-extended
|
||||
# `default` suite plus lower severity and precision queries
|
||||
# security-and-quality
|
||||
# `security-extended`, plus maintainability and reliability queries
|
||||
|
||||
query-filters:
|
||||
-
|
||||
exclude:
|
||||
id: cpp/use-of-goto
|
||||
-
|
||||
exclude:
|
||||
problem.severity: recommendation
|
||||
174
.github/workflows/ci-scripts-build.yml
vendored
174
.github/workflows/ci-scripts-build.yml
vendored
@@ -15,7 +15,6 @@ on:
|
||||
- 'startup/*'
|
||||
- '.appveyor/*'
|
||||
- '.tools/*'
|
||||
- '.lgtm.yml'
|
||||
- '.gitattributes'
|
||||
- '**/*.html'
|
||||
- '**/*.md'
|
||||
@@ -25,7 +24,6 @@ on:
|
||||
- 'startup/*'
|
||||
- '.appveyor/*'
|
||||
- '.tools/*'
|
||||
- '.lgtm.yml'
|
||||
- '.gitattributes'
|
||||
- '**/*.html'
|
||||
- '**/*.md'
|
||||
@@ -52,9 +50,9 @@ jobs:
|
||||
matrix:
|
||||
# Job names also name artifacts, character limitations apply
|
||||
include:
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc-12
|
||||
name: "Ub-22 gcc-12 c++20 Werror"
|
||||
- os: ubuntu-24.04
|
||||
cmp: gcc
|
||||
name: "Ub-24 gcc-13 c++20 Werror"
|
||||
# Turn all warnings into errors,
|
||||
# except for those we could not fix (yet).
|
||||
# Remove respective -Wno-error=... flag once it is fixed.
|
||||
@@ -75,85 +73,85 @@ jobs:
|
||||
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3'
|
||||
CMD_LDFLAGS=-Wl,-z,relro"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
cross: "windows-x64-mingw"
|
||||
name: "Ub-20 gcc-9 + MinGW"
|
||||
name: "Ub-22 gcc + MinGW"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: static
|
||||
cross: "windows-x64-mingw"
|
||||
name: "Ub-20 gcc-9 + MinGW, static"
|
||||
name: "Ub-22 gcc + MinGW, static"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: static
|
||||
extra: "CMD_CXXFLAGS=-std=c++11"
|
||||
name: "Ub-20 gcc-9 C++11, static"
|
||||
name: "Ub-22 gcc C++11, static"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: static
|
||||
extra: "CMD_CFLAGS=-funsigned-char CMD_CXXFLAGS=-funsigned-char"
|
||||
name: "Ub-20 gcc-9 unsigned char"
|
||||
name: "Ub-22 gcc unsigned char"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: clang
|
||||
configuration: default
|
||||
name: "Ub-20 clang-10"
|
||||
name: "Ub-22 clang"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: clang
|
||||
configuration: default
|
||||
extra: "CMD_CXXFLAGS=-std=c++11"
|
||||
name: "Ub-20 clang-10 C++11"
|
||||
name: "Ub-22 clang C++11"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
cross: "RTEMS-pc686-qemu@5"
|
||||
name: "Ub-20 gcc-9 + RT-5.1 pc686"
|
||||
name: "Ub-22 gcc + RT-5.1 pc686"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
cross: "RTEMS-beatnik@5"
|
||||
test: NO
|
||||
name: "Ub-20 gcc-9 + RT-5.1 beatnik"
|
||||
name: "Ub-22 gcc + RT-5.1 beatnik"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
cross: "RTEMS-xilinx_zynq_a9_qemu@5"
|
||||
test: NO
|
||||
name: "Ub-20 gcc-9 + RT-5.1 xilinx_zynq_a9_qemu"
|
||||
name: "Ub-22 gcc + RT-5.1 xilinx_zynq_a9_qemu"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
cross: "RTEMS-uC5282@5"
|
||||
test: NO
|
||||
name: "Ub-20 gcc-9 + RT-5.1 uC5282"
|
||||
name: "Ub-22 gcc + RT-5.1 uC5282"
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
name: "Ub-20 gcc-9 + RT-4.10"
|
||||
name: "Ub-22 gcc + RT-4.10"
|
||||
cross: "RTEMS-pc386-qemu@4.10"
|
||||
test: NO
|
||||
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
name: "Ub-20 gcc-9 + RT-4.9"
|
||||
name: "Ub-22 gcc + RT-4.9"
|
||||
cross: "RTEMS-pc386-qemu@4.9"
|
||||
|
||||
- os: macos-latest
|
||||
cmp: clang
|
||||
configuration: default
|
||||
name: "MacOS clang-12"
|
||||
name: "MacOS clang"
|
||||
|
||||
- os: windows-2019
|
||||
cmp: vs2019
|
||||
@@ -198,7 +196,7 @@ jobs:
|
||||
cross: linux-arm@arm-linux-gnueabihf
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Automatic core dumper analysis
|
||||
@@ -216,7 +214,7 @@ jobs:
|
||||
run: python .ci/cue.py -T 60M test
|
||||
- name: Upload tapfiles Artifact
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tapfiles ${{ matrix.name }}
|
||||
path: '**/O.*/*.tap'
|
||||
@@ -241,10 +239,15 @@ jobs:
|
||||
matrix:
|
||||
# Job names also name artifacts, character limitations apply
|
||||
include:
|
||||
#- name: "CentOS-7"
|
||||
# image: centos:7
|
||||
# cmp: gcc
|
||||
# configuration: default
|
||||
- name: "CentOS-8"
|
||||
image: centos:8
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
|
||||
- name: "Rocky-9"
|
||||
image: rockylinux:9
|
||||
cmp: gcc
|
||||
configuration: default
|
||||
|
||||
- name: "Fedora-33"
|
||||
image: fedora:33
|
||||
@@ -257,54 +260,87 @@ jobs:
|
||||
configuration: default
|
||||
|
||||
steps:
|
||||
- name: "Build newer Git"
|
||||
# actions/checkout@v2 wants git >=2.18
|
||||
# centos:7 has 1.8
|
||||
if: matrix.image=='centos:7'
|
||||
- name: "Fix repo URLs on CentOS-8"
|
||||
# centos:8 is frozen, repos are in the vault
|
||||
if: matrix.image=='centos:8'
|
||||
run: |
|
||||
yum -y install curl make gcc curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker
|
||||
curl https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.0.tar.gz | tar -xz
|
||||
cd git-*
|
||||
make -j2 prefix=/usr/local all
|
||||
make prefix=/usr/local install
|
||||
cd ..
|
||||
rm -rf git-*
|
||||
type -a git
|
||||
git --version
|
||||
sed -i -e "s|mirrorlist=|#mirrorlist=|" \
|
||||
-e "s|#baseurl=http://mirror|baseurl=http://vault|" \
|
||||
/etc/yum.repos.d/CentOS-Linux-{BaseOS,AppStream,Extras,Plus}.repo
|
||||
- name: "Redhat setup"
|
||||
run: |
|
||||
dnfyum() {
|
||||
dnf -y "$@" || yum -y "$@"
|
||||
return $?
|
||||
}
|
||||
dnfyum install python3 gdb make perl gcc-c++ glibc-devel readline-devel ncurses-devel perl-devel perl-Test-Simple
|
||||
git --version || dnfyum install git
|
||||
# rather than just bite the bullet and link python3 -> python,
|
||||
# people would rather just break all existing scripts...
|
||||
[ -e /usr/bin/python ] || ln -sf python3 /usr/bin/python
|
||||
python --version
|
||||
- uses: actions/checkout@v3
|
||||
dnf -y install python3 gdb make perl gcc-c++ glibc-devel readline-devel ncurses-devel perl-devel perl-Test-Simple
|
||||
git --version || dnf -y install git
|
||||
python3 --version
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
- name: Automatic core dumper analysis
|
||||
uses: mdavidsaver/ci-core-dumper@master
|
||||
if: matrix.image!='centos:7'
|
||||
- name: Automatic core dumper analysis
|
||||
uses: mdavidsaver/ci-core-dumper@node16
|
||||
if: matrix.image=='centos:7'
|
||||
- name: Prepare and compile dependencies
|
||||
run: python .ci/cue.py prepare
|
||||
run: python3 .ci/cue.py prepare
|
||||
- name: Build main module
|
||||
run: python .ci/cue.py build
|
||||
run: python3 .ci/cue.py build
|
||||
- name: Run main module tests
|
||||
run: python .ci/cue.py -T 20M test
|
||||
run: python3 .ci/cue.py -T 20M test
|
||||
- name: Upload tapfiles Artifact
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: tapfiles ${{ matrix.name }}
|
||||
path: '**/O.*/*.tap'
|
||||
if-no-files-found: ignore
|
||||
- name: Collect and show test results
|
||||
if: ${{ always() }}
|
||||
run: python .ci/cue.py -T 5M test-results
|
||||
run: python3 .ci/cue.py -T 5M test-results
|
||||
|
||||
build-docker:
|
||||
name: Docker CentOS-7
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CMP: gcc
|
||||
BCFG: default
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Run...
|
||||
run: |
|
||||
env > env.list
|
||||
cat <<EOF > runit.sh
|
||||
#!/bin/sh
|
||||
set -e -x
|
||||
cd /io
|
||||
id
|
||||
|
||||
sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo
|
||||
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
|
||||
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
|
||||
yum -y install epel-release
|
||||
yum -y install \
|
||||
curl make gcc curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker \
|
||||
python3 gdb make perl gcc-c++ glibc-devel readline-devel ncurses-devel perl-devel perl-Test-Simple \
|
||||
libevent-devel sudo re2c
|
||||
[ -e /usr/bin/python ] || ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
||||
# fake out cue.py
|
||||
ln -s /bin/true /usr/bin/apt-get
|
||||
|
||||
# quiet warnings spam from perl
|
||||
export LANG=C
|
||||
|
||||
python --version
|
||||
python .ci/cue.py prepare
|
||||
python .ci/cue.py build
|
||||
python .ci/cue.py -T 15M test
|
||||
python .ci/cue.py test-results
|
||||
EOF
|
||||
chmod +x runit.sh
|
||||
docker run --rm --quiet \
|
||||
--pull=always \
|
||||
--env-file env.list \
|
||||
-v `pwd`:/io \
|
||||
centos:7 \
|
||||
/io/runit.sh
|
||||
|
||||
64
.github/workflows/codeql.yml
vendored
Normal file
64
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: 7.0
|
||||
tags: 'R7.0.*'
|
||||
pull_request:
|
||||
branches: 7.0
|
||||
paths-ignore:
|
||||
- '.appveyor/*'
|
||||
- '.tools/*'
|
||||
- 'documentation/*'
|
||||
- 'startup/*'
|
||||
- '**/*.md'
|
||||
- '**/*.html'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on:
|
||||
- ubuntu-latest
|
||||
# - windows-latest
|
||||
# Supported by CodeQL which would check the Windows
|
||||
# port, but needs more work here to set it up
|
||||
|
||||
permissions:
|
||||
# Required for all workflows:
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ cpp ]
|
||||
|
||||
steps:
|
||||
- name: Checkout Repositories
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
- name: Install Packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install --yes libreadline-dev
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config-file: ./.github/codeql/config.yml
|
||||
|
||||
- name: Build C/C++
|
||||
run: |
|
||||
echo '*** Building with these versions >>>'
|
||||
g++ --version
|
||||
make --version
|
||||
perl --version
|
||||
echo '<<<'
|
||||
make -sj2 || echo '*** Ignoring build failure for CodeQL ***'
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{ matrix.language }}"
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@
|
||||
/lib/
|
||||
/db/
|
||||
/dbd/
|
||||
/doc/
|
||||
/html/
|
||||
/include/
|
||||
/templates/
|
||||
|
||||
50
.lgtm.yml
50
.lgtm.yml
@@ -1,50 +0,0 @@
|
||||
# Configuration for lgtm.com
|
||||
#
|
||||
|
||||
path_classifiers:
|
||||
test:
|
||||
- exclude: /
|
||||
- test
|
||||
- "modules/*/test*"
|
||||
library:
|
||||
- modules/libcom/src/yacc
|
||||
- modules/libcom/src/flex
|
||||
template:
|
||||
- src/template
|
||||
- modules/ca/src/template
|
||||
- modules/database/src/template
|
||||
|
||||
extraction:
|
||||
cpp:
|
||||
prepare:
|
||||
packages:
|
||||
- "libreadline-dev"
|
||||
index:
|
||||
build_command:
|
||||
- "g++ --version"
|
||||
- "make --version"
|
||||
- "perl --version"
|
||||
- "make -sj2 || echo '*** Build failed, ignored for lgtm ***'"
|
||||
|
||||
python:
|
||||
index:
|
||||
include:
|
||||
- src/tools
|
||||
|
||||
# Interpreted languages to be excluded
|
||||
javascript:
|
||||
index:
|
||||
exclude:
|
||||
- "*"
|
||||
|
||||
# Compiled languages to be excluded
|
||||
java:
|
||||
index:
|
||||
build_command: "echo No Java code in this project"
|
||||
csharp:
|
||||
index:
|
||||
build_command: "echo No C# code in this project"
|
||||
go:
|
||||
index:
|
||||
build_command: "echo No Go code in this project"
|
||||
|
||||
36
.readthedocs.yaml
Normal file
36
.readthedocs.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
# .readthedocs.yml
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.9"
|
||||
apt_packages:
|
||||
- graphviz
|
||||
- rsync
|
||||
jobs:
|
||||
pre_build:
|
||||
- make inc
|
||||
- make -C documentation rtd
|
||||
|
||||
# Build documentation in the documentation/O.Common directory with Sphinx
|
||||
sphinx:
|
||||
configuration: documentation/O.Common/rtd-src/conf.py
|
||||
|
||||
# Build documentation with MkDocs
|
||||
#mkdocs:
|
||||
# configuration: mkdocs.yml
|
||||
|
||||
# Optionally build your docs in additional formats such as PDF and ePub
|
||||
#formats: []
|
||||
|
||||
submodules:
|
||||
exclude: all
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: documentation/requirements.txt
|
||||
@@ -45,10 +45,13 @@ FIND_PM = $(wildcard $(EPICS_BASE)/lib/perl/$(1))
|
||||
#---------------------------------------------------------------
|
||||
# EPICS Base build tools and tool flags
|
||||
|
||||
PODTOMD_pl = $(TOOLS)/podToMD.pl
|
||||
PODTOMD = $(PERL) $(PODTOMD_pl)
|
||||
PODTOHTML_pl = $(TOOLS)/podToHtml.pl
|
||||
PODTOHTML_dep = $(PODTOHTML_pl) $(call FIND_PM,EPICS/PodHtml.pm)
|
||||
PODTOHTML = $(PERL) $(PODTOHTML_pl)
|
||||
CONVERTRELEASE = $(PERL) $(call FIND_TOOL,convertRelease.pl)
|
||||
FILTERMAKEFLAGS = $(PERL) $(call FIND_TOOL,filterMakeflags.pl)
|
||||
FULLPATHNAME = $(PERL) $(TOOLS)/fullPathName.pl
|
||||
GENVERSIONHEADER = $(PERL) $(TOOLS)/genVersionHeader.pl $(QUIET_FLAG) $(QUESTION_FLAG)
|
||||
|
||||
@@ -65,6 +68,24 @@ INSTALL_LIBRARY = $(INSTALL)
|
||||
MKMF = $(PERL) $(TOOLS)/mkmf.pl
|
||||
REPLACEVAR = $(PERL) $(TOOLS)/replaceVAR.pl
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# How to portably check the flags to make
|
||||
# GNUmake versions before 4.0 gave different values
|
||||
makeflags := $(shell $(FILTERMAKEFLAGS) $(MAKEFLAGS))
|
||||
define checkflags
|
||||
make-$1 := $(findstring $1,$(makeflags))
|
||||
endef
|
||||
# This is extensible to most single letter flags:
|
||||
$(foreach flag,s q, $(eval $(call checkflags,$(flag))))
|
||||
|
||||
# Silent builds - suppress messages during 'make -s'
|
||||
NOP = :
|
||||
ECHO = @$(if $(make-s),$(NOP),echo)
|
||||
QUIET_FLAG := $(if $(make-s),-q,)
|
||||
|
||||
# Convert 'make -q' flag into '-i' for genVersionHeader.pl
|
||||
QUESTION_FLAG := $(if $(make-q),-i,)
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# tools for cleaning out unwanted files
|
||||
CVSCLEAN = $(call FIND_TOOL,cvsclean.pl)
|
||||
|
||||
@@ -48,11 +48,11 @@ EPICS_VERSION = 7
|
||||
EPICS_REVISION = 0
|
||||
|
||||
# EPICS_MODIFICATION must be a number >=0 and <256
|
||||
EPICS_MODIFICATION = 8
|
||||
EPICS_MODIFICATION = 9
|
||||
|
||||
# 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)
|
||||
@@ -71,6 +71,3 @@ endif
|
||||
EPICS_SHORT_VERSION=$(EPICS_VERSION).$(EPICS_REVISION).$(EPICS_MODIFICATION)$(EPICS_PATCH_VSTRING)
|
||||
EPICS_VERSION_NUMBER=$(EPICS_SHORT_VERSION)$(EPICS_DEV_SNAPSHOT)$(EPICS_SITE_VSTRING)
|
||||
EPICS_VERSION_STRING="EPICS Version $(EPICS_VERSION_NUMBER)"
|
||||
|
||||
# Provide this in case anyone is still using the old name
|
||||
COMMIT_DATE="-no-date-"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
EPICS_CA_MAJOR_VERSION = 4
|
||||
EPICS_CA_MINOR_VERSION = 14
|
||||
EPICS_CA_MAINTENANCE_VERSION = 5
|
||||
EPICS_CA_MAINTENANCE_VERSION = 6
|
||||
|
||||
# Development flag, set to zero for release versions
|
||||
|
||||
|
||||
@@ -81,23 +81,6 @@ FINAL_LOCATION = $(INSTALL_ABSOLUTE)
|
||||
# IOC's view of install path
|
||||
IOCS_APPL_TOP = $(INSTALL_ABSOLUTE)
|
||||
|
||||
#-------------------------------------------------------
|
||||
# How to portably check the flags to make
|
||||
makeflags := $(firstword $(filter-out -,$(filter-out --%,$(MAKEFLAGS))))
|
||||
define checkflags
|
||||
make-$1 := $(findstring $1,$(makeflags))
|
||||
endef
|
||||
# This is extensible to most single letter flags:
|
||||
$(foreach flag,s q, $(eval $(call checkflags,$(flag))))
|
||||
|
||||
# Silent builds - suppress messages during 'make -s'
|
||||
NOP = :
|
||||
ECHO = @$(if $(make-s),$(NOP),echo)
|
||||
QUIET_FLAG := $(if $(make-s),-q,)
|
||||
|
||||
# Convert 'make -q' flag into '-i' for genVersionHeader.pl
|
||||
QUESTION_FLAG := $(if $(make-q),-i,)
|
||||
|
||||
#-------------------------------------------------------
|
||||
ifdef T_A
|
||||
|
||||
@@ -486,4 +469,9 @@ COMMON_INC += $(filter $(COMMON_DIR)/%, \
|
||||
$(foreach dir, $(ALL_SRC_DIRS), \
|
||||
$(addsuffix /$(file), $(dir)))) $(COMMON_DIR)/$(file))))
|
||||
|
||||
COMMON_DOCS += $(filter $(COMMON_DIR)/%, \
|
||||
$(foreach file, $(DOCS), \
|
||||
$(firstword $(wildcard $(file) \
|
||||
$(foreach dir, $(ALL_SRC_DIRS), \
|
||||
$(addsuffix /$(file), $(dir)))) $(COMMON_DIR)/$(file))))
|
||||
endif
|
||||
|
||||
@@ -12,6 +12,7 @@ DBDTORECTYPEH_pl = $(EPICS_BASE_HOST_BIN)/dbdToRecordtypeH.pl
|
||||
DBDTORECTYPEH_dep = $(DBDTORECTYPEH_pl) $(call FIND_PM,DBD/Rec*.pm)
|
||||
DBDTOMENUH_pl = $(EPICS_BASE_HOST_BIN)/dbdToMenuH.pl
|
||||
DBDTOMENUH_dep = $(DBDTOMENUH_pl) $(call FIND_PM,DBD/Menu.pm)
|
||||
DBDTOMD_pl = $(EPICS_BASE_HOST_BIN)/dbdToMD.pl
|
||||
DBDTOHTML_pl = $(EPICS_BASE_HOST_BIN)/dbdToHtml.pl
|
||||
DBDTOHTML_dep = $(DBDTOHTML_pl) $(call FIND_PM,EPICS/Pod*Html.pm)
|
||||
REGRECDEVDRV_pl = $(EPICS_BASE_HOST_BIN)/registerRecordDeviceDriver.pl
|
||||
@@ -21,6 +22,7 @@ REGRECDEVDRV_dep = $(REGRECDEVDRV_pl)
|
||||
DBEXPAND = $(PERL) $(DBDEXPAND_pl)
|
||||
DBTORECORDTYPEH = $(PERL) $(DBDTORECTYPEH_pl)
|
||||
DBTOMENUH = $(PERL) $(DBDTOMENUH_pl)
|
||||
DBDTOMD = $(PERL) $(DBDTOMD_pl)
|
||||
DBDTOHTML = $(PERL) $(DBDTOHTML_pl)
|
||||
REGISTERRECORDDEVICEDRIVER = $(PERL) $(REGRECDEVDRV_pl)
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Version number for the database APIs and shared library
|
||||
|
||||
EPICS_DATABASE_MAJOR_VERSION = 3
|
||||
EPICS_DATABASE_MINOR_VERSION = 23
|
||||
EPICS_DATABASE_MAINTENANCE_VERSION = 2
|
||||
EPICS_DATABASE_MINOR_VERSION = 24
|
||||
EPICS_DATABASE_MAINTENANCE_VERSION = 1
|
||||
|
||||
# Development flag, set to zero for release versions
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Version number for the libcom APIs and shared library
|
||||
|
||||
EPICS_LIBCOM_MAJOR_VERSION = 3
|
||||
EPICS_LIBCOM_MINOR_VERSION = 23
|
||||
EPICS_LIBCOM_MAINTENANCE_VERSION = 2
|
||||
EPICS_LIBCOM_MINOR_VERSION = 24
|
||||
EPICS_LIBCOM_MAINTENANCE_VERSION = 1
|
||||
|
||||
# Development flag, set to zero for release versions
|
||||
|
||||
|
||||
@@ -92,3 +92,6 @@ EPICS_IOC_LOG_FILE_NAME=
|
||||
EPICS_IOC_LOG_FILE_COMMAND=
|
||||
EPICS_IOC_LOG_FILE_LIMIT=1000000
|
||||
|
||||
# Set to 'YES' to call abort() rather than suspend the current thread
|
||||
# when an assert() fails
|
||||
EPICS_ABORT_ON_ASSERT=NO
|
||||
|
||||
@@ -197,7 +197,7 @@ endif
|
||||
# build dependancies, clean rule
|
||||
|
||||
inc: $(COMMON_INC) $(INSTALL_INC) $(COMMON_DBDS) $(COMMON_DBDCATS) \
|
||||
$(INSTALL_DBDS) $(INSTALL_DBD_INSTALLS)
|
||||
$(INSTALL_DBDS) $(INSTALL_DBD_INSTALLS) $(COMMON_DOCS)
|
||||
|
||||
build: $(COMMON_DBS) $(INSTALL_DBS) \
|
||||
$(DBDDEPENDS_FILES) $(TARGETS) \
|
||||
@@ -427,6 +427,26 @@ $(foreach file, $(DBD_INSTALLS), $(eval $(call DBD_INSTALLS_template, $(file))))
|
||||
|
||||
.PRECIOUS: $(COMMON_DBDS) $(COMMON_DIR)/%.dbd
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# Markdown files
|
||||
|
||||
$(COMMON_DIR)/%.md: %.dbd.pod $(DBDTOMD_pl)
|
||||
@$(RM) $(notdir $@)
|
||||
$(DBDTOMD) $(DBDFLAGS) -o $(notdir $@) $<
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
$(COMMON_DIR)/%.md: %.pod $(PODTOMD_pl)
|
||||
@$(RM) $(notdir $@)
|
||||
$(PODTOMD) -o $(notdir $@) $<
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
$(COMMON_DIR)/%.md: ../%.pl $(PODTOMD_pl)
|
||||
@$(RM) $(notdir $@)
|
||||
$(PODTOMD) -o $(notdir $@) $<
|
||||
@$(MV) $(notdir $@) $@
|
||||
|
||||
.PRECIOUS: $(COMMON_DIR)/%.md
|
||||
|
||||
#---------------------------------------------------------------
|
||||
# HTML files
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ vpath %.cpp $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
vpath %.rc $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
vpath %.h $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
vpath %.hpp $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
vpath %.html $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
vpath %.html $(USR_VPATH) $(ALL_SRC_DIRS) $(COMMON_DIR)
|
||||
vpath %.md $(USR_VPATH) $(ALL_SRC_DIRS) $(COMMON_DIR)
|
||||
vpath %.skel.static $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
vpath %.y $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
vpath %.l $(USR_VPATH) $(ALL_SRC_DIRS)
|
||||
@@ -111,7 +112,7 @@ endif
|
||||
#---------------------------------------------------------------
|
||||
# Read dependency files
|
||||
|
||||
ifneq (inc,$(strip $(MAKECMDGOALS)))
|
||||
ifneq ($(filter-out inc,$(strip $(MAKECMDGOALS))),)
|
||||
ifneq (,$(strip $(HDEPENDS_FILES)))
|
||||
$(filter-out $(wildcard *$(DEP)), $(HDEPENDS_FILES)): | $(COMMON_INC)
|
||||
-include $(HDEPENDS_FILES)
|
||||
@@ -165,12 +166,12 @@ build: $(OBJSNAME) $(LIBTARGETS) $(PRODTARGETS) $(TESTPRODTARGETS) \
|
||||
$(TARGETS) $(TESTSCRIPTS) $(INSTALL_LIB_INSTALLS)
|
||||
|
||||
inc: $(COMMON_INC) $(INSTALL_INC) $(INSTALL_CONFIGS) $(INSTALLS_CFG) \
|
||||
$(INSTALL_HTMLS) $(INSTALLS_PERL_MODULES) $(INSTALL_SCRIPTS)
|
||||
$(INSTALL_HTMLS) $(INSTALLS_PERL_MODULES) $(INSTALL_SCRIPTS) \
|
||||
$(INSTALL_DOCS)
|
||||
|
||||
buildInstall: \
|
||||
$(INSTALL_PROD) $(INSTALL_MUNCHS) \
|
||||
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) \
|
||||
$(INSTALL_DOCS) \
|
||||
$(INSTALL_OBJS) \
|
||||
$(INSTALL_TEMPLATE) \
|
||||
$(INSTALL_BIN_INSTALLS)
|
||||
@@ -555,6 +556,10 @@ $(INSTALL_INCLUDE)/compiler/$(CMPLR_CLASS)/%: %
|
||||
$(ECHO) "Installing compiler dependent include file $@"
|
||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||
|
||||
$(INSTALL_DOC)/%: $(COMMON_DIR)/%
|
||||
$(ECHO) "Installing generated doc $@"
|
||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(@D)
|
||||
|
||||
$(INSTALL_DOC)/%: %
|
||||
$(ECHO) "Installing doc $@"
|
||||
@$(INSTALL) -d -m $(INSTALL_PERMISSIONS) $< $(INSTALL_DOC)
|
||||
|
||||
@@ -65,7 +65,7 @@ CXXFLAGS = $($(BUILD_CLASS)_CXXFLAGS) $(POSIX_CXXFLAGS) $(OPT_CXXFLAGS)\
|
||||
$(USR_CXXFLAGS) $(CMD_CXXFLAGS) $(ARCH_DEP_CXXFLAGS) $(CODE_CXXFLAGS)\
|
||||
$(STATIC_CXXFLAGS) $(OP_SYS_CXXFLAGS) $(LIBRARY_SRC_CFLAGS)
|
||||
|
||||
LDFLAGS = $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(CMD_LDFLAGS)\
|
||||
LDFLAGS += $(OPT_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(CMD_LDFLAGS)\
|
||||
$(POSIX_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(DEBUG_LDFLAGS) $(OP_SYS_LDFLAGS)\
|
||||
$($(BUILD_CLASS)_LDFLAGS) $(RUNTIME_LDFLAGS) $(CODE_LDFLAGS)
|
||||
|
||||
@@ -102,15 +102,47 @@ OS_CLASS = RTEMS
|
||||
# Operating system compile & link flags
|
||||
OP_SYS_CFLAGS += -D__LINUX_ERRNO_EXTENSIONS__
|
||||
|
||||
OP_SYS_CFLAGS_NET_yes = -DRTEMS_LEGACY_STACK
|
||||
OP_SYS_CFLAGS += $(OP_SYS_CFLAGS_NET_$(RTEMS_HAS_NETWORKING))
|
||||
|
||||
ifeq ($(RTEMS_HAS_POSIX_API),yes)
|
||||
POSIX_CPPFLAGS = -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
||||
# Has RTEMS been built with the internal legacy stack?
|
||||
ifeq ($(RTEMS_LEGACY_NETWORKING_INTERNAL),yes)
|
||||
RTEMS_HAS_NETWORKING = yes
|
||||
RTEMS_NETWORKING = legacy_internal
|
||||
endif
|
||||
|
||||
OP_SYS_LDLIBS_posix_NET_yes = -ltftpfs -lnfs -lz -ltelnetd
|
||||
OP_SYS_LDLIBS_posix_NET_no = -ltftpfs -lbsd -lz
|
||||
# Has RTEMS been built with the legacy stack as a separate package?
|
||||
ifeq ($(RTEMS_LEGACY_NETWORKING),yes)
|
||||
RTEMS_HAS_NETWORKING = yes
|
||||
RTEMS_NETWORKING = legacy
|
||||
endif
|
||||
|
||||
# Has RTEMS been built with the libbsd stack as a separate package?
|
||||
ifeq ($(RTEMS_BSD_NETWORKING),yes)
|
||||
RTEMS_HAS_NETWORKING = yes
|
||||
RTEMS_NETWORKING = bsd
|
||||
endif
|
||||
|
||||
RTEMS_LEGACY_NET_LIB_no=
|
||||
|
||||
# Legacy network with RTEMS 5 and earlier
|
||||
RTEMS_NET_LIB_legacy_internal=-lnfs
|
||||
OP_SYS_CFLAGS_NET_legacy_internal = -DRTEMS_LEGACY_STACK
|
||||
|
||||
# Legacy network with RTEMS 6 is a separate package and library
|
||||
RTEMS_NET_LIB_legacy=-lnfs -lnetworking -lnfs
|
||||
OP_SYS_CFLAGS_NET_legacy = -DRTEMS_LEGACY_STACK
|
||||
|
||||
# LibBSD network with RTEMS 5 and 6 is a separate package and library
|
||||
RTEMS_NET_LIB_bsd=-lbsd
|
||||
OP_SYS_CFLAGS_NET_bsd = -DRTEMS_LIBBSD_STACK
|
||||
|
||||
# Set the networking flags
|
||||
OP_SYS_CFLAGS += $(OP_SYS_CFLAGS_NET_$(RTEMS_NETWORKING))
|
||||
|
||||
POSIX_CPPFLAGS_posix = -D_GNU_SOURCE -D_DEFAULT_SOURCE
|
||||
POSIX_CPPFLAGS = $(POSIX_CPPFLAGS_$(OS_API))
|
||||
|
||||
OP_SYS_LDLIBS_posix_NET_yes = -ltftpfs -lz -ltelnetd
|
||||
OP_SYS_LDLIBS_posix_NET_yes += $(RTEMS_NET_LIB_$(RTEMS_NETWORKING))
|
||||
OP_SYS_LDLIBS_posix_NET_no = -ltftpfs -lz
|
||||
OP_SYS_LDLIBS_score_NET_yes = -lnfs
|
||||
OP_SYS_LDLIBS_score_NET_no = -lnfs
|
||||
OP_SYS_LDLIBS += -lrtemsCom -lCom
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#
|
||||
# Author: Matt Rippa
|
||||
#
|
||||
RTEMS_BSP = mvme2307
|
||||
RTEMS_TARGET_CPU = powerpc
|
||||
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
|
||||
ARCH_DEP_CFLAGS += -DHAVE_PPCBUG
|
||||
@@ -23,3 +22,9 @@ define MUNCH_CMD
|
||||
endef
|
||||
|
||||
include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
|
||||
ifeq ($(shell test $(RTEMS_VERSION) -ge 5; echo $$?),0)
|
||||
RTEMS_BSP = mvme2700
|
||||
else
|
||||
RTEMS_BSP = mvme2307
|
||||
endif
|
||||
|
||||
@@ -25,7 +25,7 @@ include $(CONFIG)/os/CONFIG.Common.RTEMS
|
||||
OP_SYS_LDFLAGS += -Wl,-Ttext,0x100000
|
||||
|
||||
# This check must appear after the above include
|
||||
ifeq ($(RTEMS_VERSION),5)
|
||||
ifeq ($(shell test $(RTEMS_VERSION) -ge 5; echo $$?),0)
|
||||
$(info *** This target is not compatible with the configured RTEMS version.)
|
||||
$(info *** Build the RTEMS-pc686 (-qemu) target for RTEMS 5.x)
|
||||
$(error Can't continue)
|
||||
|
||||
@@ -32,7 +32,7 @@ OP_SYS_LDFLAGS += -Wl,-Ttext,0x100000
|
||||
|
||||
|
||||
# This check must appear after the above include
|
||||
ifneq ($(RTEMS_VERSION),5)
|
||||
ifeq ($(shell test $(RTEMS_VERSION) -lt 5; echo $$?),0)
|
||||
$(info *** This target is not compatible with the configured RTEMS version.)
|
||||
$(info *** Build the RTEMS-pc386 (-qemu) target for RTEMS 4.x)
|
||||
$(error Can't continue)
|
||||
|
||||
11
configure/os/CONFIG.darwin-aarch64-debug.Common
Normal file
11
configure/os/CONFIG.darwin-aarch64-debug.Common
Normal file
@@ -0,0 +1,11 @@
|
||||
# CONFIG.darwin-aarch64-debug.Common
|
||||
#
|
||||
# Definitions for darwin-aarch64-debug host builds - darwin-aarch64 target build with debug compiler flags
|
||||
# Sites may override these definitions in CONFIG_SITE.darwin-aarch64-debug.Common
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.darwin-aarch64.Common
|
||||
|
||||
# Removes -O optimization and adds -g compile option
|
||||
HOST_OPT=NO
|
||||
|
||||
14
configure/os/CONFIG.darwin-aarch64.darwin-aarch64-debug
Normal file
14
configure/os/CONFIG.darwin-aarch64.darwin-aarch64-debug
Normal file
@@ -0,0 +1,14 @@
|
||||
# CONFIG.darwin-aarch64.darwin-aarch64-debug
|
||||
#
|
||||
# Definitions for darwin-aarch64 host - darwin-aarch64-debug target build with debug compiler flags
|
||||
# Sites may override these definitions in CONFIG_SITE.darwin-aarch64.darwin-aarch64-debug
|
||||
#-------------------------------------------------------
|
||||
|
||||
-include $(CONFIG)/os/CONFIG.Common.darwin-aarch64
|
||||
-include $(CONFIG)/os/CONFIG.darwin-aarch64.darwin-aarch64
|
||||
-include $(CONFIG)/os/CONFIG_SITE.Common.darwin-aarch64
|
||||
-include $(CONFIG)/os/CONFIG_SITE.darwin-aarch64.darwin-aarch64
|
||||
|
||||
|
||||
BUILD_CLASS=HOST
|
||||
HOST_OPT = NO
|
||||
11
configure/os/CONFIG.darwin-x86-debug.Common
Normal file
11
configure/os/CONFIG.darwin-x86-debug.Common
Normal file
@@ -0,0 +1,11 @@
|
||||
# CONFIG.darwin-x86-debug.Common
|
||||
#
|
||||
# Definitions for darwin-x86-debug host builds - darwin-x86 target build with debug compiler flags
|
||||
# Sites may override these definitions in CONFIG_SITE.darwin-x86-debug.Common
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.darwin-x86.Common
|
||||
|
||||
# Removes -O optimization and adds -g compile option
|
||||
HOST_OPT=NO
|
||||
|
||||
@@ -2,13 +2,23 @@
|
||||
# Definitions for freebsd-x86_64 host - freebsd-x86_64 target builds
|
||||
# Sites may override these definitions in CONFIG_SITE.freebsd-x86_64.freebsd-x86_64
|
||||
#-------------------------------------------------------
|
||||
GNU_DIR=/usr/local
|
||||
GNU_DIR=/usr
|
||||
|
||||
# Include common gnu compiler definitions
|
||||
include $(CONFIG)/CONFIG.gnuCommon
|
||||
|
||||
GNU_BIN = $(GNU_DIR)/bin
|
||||
GNU_LIB = $(GNU_DIR)/lib
|
||||
|
||||
CMPLR_CLASS = clang
|
||||
|
||||
CC = $(GNU_BIN)/$(CMPLR_PREFIX)cc$(CMPLR_SUFFIX)
|
||||
CCC = $(GNU_BIN)/$(CMPLR_PREFIX)c++$(CMPLR_SUFFIX)
|
||||
CPP = $(CC) -x c -E
|
||||
|
||||
GNU_LDLIBS_YES =
|
||||
|
||||
STATIC_LDFLAGS_YES= -Wl,-Bstatic
|
||||
STATIC_LDFLAGS_NO=
|
||||
STATIC_LDLIBS_YES= -Wl,-Bdynamic
|
||||
STATIC_LDLIBS_NO=
|
||||
|
||||
|
||||
@@ -30,9 +30,26 @@ MSVC_VER = _MSC_VER
|
||||
#ifdef __rtems__
|
||||
#include <rtems/score/cpuopts.h>
|
||||
# if __RTEMS_MAJOR__>=5
|
||||
OS_API = posix
|
||||
OS_API = posix
|
||||
# else
|
||||
OS_API = score
|
||||
OS_API = score
|
||||
# endif
|
||||
# if defined(RTEMS_NETWORKING)
|
||||
/* legacy stack circa RTEMS <= 5 and networking internal to RTEMS */
|
||||
RTEMS_LEGACY_NETWORKING_INTERNAL = yes
|
||||
# else
|
||||
# if !defined(__has_include)
|
||||
/* assume old GCC implies RTEMS < 5 with mis-configured BSP */
|
||||
# error rebuild BSP with --enable-network
|
||||
# elif __has_include(<machine/rtems-net-legacy.h>)
|
||||
/* legacy stack circa RTEMS > 5 */
|
||||
RTEMS_LEGACY_NETWORKING = yes
|
||||
# elif __has_include(<machine/rtems-bsd-version.h>)
|
||||
/* libbsd stack */
|
||||
RTEMS_BSD_NETWORKING = yes
|
||||
# else
|
||||
# error Cannot determine RTEMS network configuration
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -47,8 +64,3 @@ COMMANDLINE_LIBRARY ?= EPICS
|
||||
#else
|
||||
COMMANDLINE_LIBRARY ?= $(strip $(if $(wildcard $(if $(GNU_DIR),$(GNU_DIR)/include/readline/readline.h)), READLINE, EPICS))
|
||||
#endif
|
||||
|
||||
#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE>2
|
||||
OP_SYS_CPPFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
|
||||
#endif
|
||||
|
||||
|
||||
3
documentation/.gitignore
vendored
3
documentation/.gitignore
vendored
@@ -1,3 +0,0 @@
|
||||
*.db
|
||||
epics-base.tag
|
||||
html/
|
||||
@@ -759,10 +759,10 @@ WARN_LOGFILE =
|
||||
# spaces.
|
||||
# Note: If this tag is empty the current directory is searched.
|
||||
|
||||
INPUT = ../mainpage.dox \
|
||||
../RELEASE_NOTES.md \
|
||||
INPUT = ../RELEASE_NOTES.md \
|
||||
../README.md \
|
||||
@TOP@/include
|
||||
@TOP@/include \
|
||||
@TOP@/doc
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||
@@ -1833,7 +1833,7 @@ MAN_LINKS = NO
|
||||
# captures the structure of the code including all documentation.
|
||||
# The default value is: NO.
|
||||
|
||||
GENERATE_XML = NO
|
||||
GENERATE_XML = YES
|
||||
|
||||
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
|
||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
||||
@@ -1841,7 +1841,7 @@ GENERATE_XML = NO
|
||||
# The default directory is: xml.
|
||||
# This tag requires that the tag GENERATE_XML is set to YES.
|
||||
|
||||
XML_OUTPUT = xml
|
||||
XML_OUTPUT = @RTD_SRC@/xml
|
||||
|
||||
# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
|
||||
# listings (including syntax highlighting and cross-referencing information) to
|
||||
@@ -1946,7 +1946,7 @@ ENABLE_PREPROCESSING = YES
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||
|
||||
MACRO_EXPANSION = NO
|
||||
MACRO_EXPANSION = YES
|
||||
|
||||
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
|
||||
# the macro expansion is limited to the macros specified with the PREDEFINED and
|
||||
@@ -1986,7 +1986,17 @@ INCLUDE_FILE_PATTERNS =
|
||||
# recursively expanded use the := operator instead of the = operator.
|
||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||
|
||||
PREDEFINED = __cplusplus
|
||||
PREDEFINED = __cplusplus \
|
||||
LIBCOM_API \
|
||||
DBCORE_API \
|
||||
LIBCA_API \
|
||||
DBRECSTD_API \
|
||||
EPICS_ALWAYS_INLINE \
|
||||
epicsShareExtern \
|
||||
epicsShareClass \
|
||||
epicsShareFunc \
|
||||
epicsShareAPI \
|
||||
epicsStdCall
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||
# tag can be used to specify a list of macro names that should be expanded. The
|
||||
|
||||
4
documentation/HEADER_h.md
Normal file
4
documentation/HEADER_h.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# @HEADER@.h
|
||||
|
||||
```{doxygenfile} @HEADER@.h
|
||||
```
|
||||
@@ -1,34 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<title>Known Problems in EPICS 7.0.3.1</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 style="text-align: center">EPICS 7.0.3.1: Known Problems</h1>
|
||||
|
||||
<p>Any patch files linked below should be applied at the root of the
|
||||
base-7.0.3.1 tree. Download them, then use the GNU Patch program as
|
||||
follows:</p>
|
||||
|
||||
<blockquote><pre>% <b>cd <i>/path/to/</i>base-7.0.3.1</b>
|
||||
% <b>patch -p1 < <i>/path/to/</i>file.patch</b></pre></blockquote>
|
||||
|
||||
<p>The following problems were known by the developers at the time of this
|
||||
release:</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<!-- Items added after release should be formatted thusly:
|
||||
<li>YYYY-MM-DD: Description of problem.
|
||||
<a href="fix.patch">This patch</a> fixes the problem.
|
||||
...</li>
|
||||
-->
|
||||
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,25 +7,168 @@ EXPAND_ME += EPICS_REVISION
|
||||
EXPAND_ME += EPICS_MODIFICATION
|
||||
EXPAND_ME += EPICS_PATCH_LEVEL
|
||||
EXPAND_ME += OS_CLASS CMPLR_CLASS
|
||||
EXPAND_ME += RTD_SRC
|
||||
|
||||
HTMLS += ComponentReference.html
|
||||
DOXYGEN ?= doxygen
|
||||
|
||||
TARGETS += doxygen
|
||||
libcom_HEADERS += adjustment
|
||||
libcom_HEADERS += alarm
|
||||
libcom_HEADERS += alarmString
|
||||
libcom_HEADERS += asTrapWrite
|
||||
libcom_HEADERS += bucketLib
|
||||
libcom_HEADERS += cantProceed
|
||||
libcom_HEADERS += compilerDependencies
|
||||
libcom_HEADERS += cvtFast
|
||||
libcom_HEADERS += dbmf
|
||||
libcom_HEADERS += devLibVME
|
||||
libcom_HEADERS += devLibVMEImpl
|
||||
libcom_HEADERS += ellLib
|
||||
libcom_HEADERS += envDefs
|
||||
libcom_HEADERS += epicsAlgorithm
|
||||
libcom_HEADERS += epicsAssert
|
||||
libcom_HEADERS += epicsAtomic
|
||||
libcom_HEADERS += epicsEvent
|
||||
libcom_HEADERS += epicsExit
|
||||
libcom_HEADERS += epicsExport
|
||||
libcom_HEADERS += epicsGeneralTime
|
||||
libcom_HEADERS += epicsGuard
|
||||
libcom_HEADERS += epicsMessageQueue
|
||||
libcom_HEADERS += epicsMutex
|
||||
libcom_HEADERS += epicsReadline
|
||||
libcom_HEADERS += epicsRingBytes
|
||||
libcom_HEADERS += epicsRingPointer
|
||||
libcom_HEADERS += epicsSignal
|
||||
libcom_HEADERS += epicsSpin
|
||||
libcom_HEADERS += epicsStackTrace
|
||||
libcom_HEADERS += epicsStdio
|
||||
libcom_HEADERS += epicsStdlib
|
||||
libcom_HEADERS += epicsString
|
||||
libcom_HEADERS += epicsTempFile
|
||||
libcom_HEADERS += epicsThread
|
||||
libcom_HEADERS += epicsTime
|
||||
libcom_HEADERS += epicsTypes
|
||||
libcom_HEADERS += epicsUnitTest
|
||||
libcom_HEADERS += errlog
|
||||
libcom_HEADERS += freeList
|
||||
libcom_HEADERS += iocsh
|
||||
libcom_HEADERS += ipAddrToAsciiAsynchronous
|
||||
libcom_HEADERS += logClient
|
||||
libcom_HEADERS += macLib
|
||||
libcom_HEADERS += osiPoolStatus
|
||||
libcom_HEADERS += osiProcess
|
||||
libcom_HEADERS += osiSock
|
||||
libcom_HEADERS += postfix
|
||||
libcom_HEADERS += shareLib
|
||||
libcom_HEADERS += testMain
|
||||
libcom_HEADERS += yajl_alloc
|
||||
libcom_HEADERS += yajl_common
|
||||
libcom_HEADERS += yajl_gen
|
||||
libcom_HEADERS += yajl_parse
|
||||
|
||||
DOXYGEN = doxygen
|
||||
ME = documentation/O.$(T_A)/html
|
||||
GH_FILES = $(ME)/ $(ME)/.nojekyll $(ME)/*.* $(ME)/*/*.*
|
||||
database_HEADERS += chfPlugin
|
||||
database_HEADERS += dbChannel
|
||||
database_HEADERS += dbCommon
|
||||
database_HEADERS += dbDefs
|
||||
database_HEADERS += dbExtractArray
|
||||
database_HEADERS += dbLink
|
||||
database_HEADERS += dbServer
|
||||
database_HEADERS += dbState
|
||||
database_HEADERS += dbStaticLib
|
||||
database_HEADERS += dbUnitTest
|
||||
database_HEADERS += devLib
|
||||
database_HEADERS += devSup
|
||||
database_HEADERS += drvSup
|
||||
database_HEADERS += initHooks
|
||||
|
||||
record_HEADERS += aaiRecord
|
||||
record_HEADERS += aaoRecord
|
||||
record_HEADERS += aiRecord
|
||||
record_HEADERS += aoRecord
|
||||
record_HEADERS += aSubRecord
|
||||
record_HEADERS += biRecord
|
||||
record_HEADERS += boRecord
|
||||
record_HEADERS += calcRecord
|
||||
record_HEADERS += calcoutRecord
|
||||
record_HEADERS += compressRecord
|
||||
record_HEADERS += dfanoutRecord
|
||||
record_HEADERS += eventRecord
|
||||
record_HEADERS += fanoutRecord
|
||||
record_HEADERS += histogramRecord
|
||||
record_HEADERS += int64inRecord
|
||||
record_HEADERS += int64outRecord
|
||||
record_HEADERS += longinRecord
|
||||
record_HEADERS += longoutRecord
|
||||
record_HEADERS += lsiRecord
|
||||
record_HEADERS += lsoRecord
|
||||
record_HEADERS += mbbiRecord
|
||||
record_HEADERS += mbbiDirectRecord
|
||||
record_HEADERS += mbboRecord
|
||||
record_HEADERS += mbboDirectRecord
|
||||
record_HEADERS += permissiveRecord
|
||||
record_HEADERS += printfRecord
|
||||
record_HEADERS += selRecord
|
||||
record_HEADERS += seqRecord
|
||||
record_HEADERS += stateRecord
|
||||
record_HEADERS += stringinRecord
|
||||
record_HEADERS += stringoutRecord
|
||||
record_HEADERS += subRecord
|
||||
record_HEADERS += subArrayRecord
|
||||
record_HEADERS += waveformRecord
|
||||
|
||||
menu_HEADERS += menuAlarmSevr
|
||||
menu_HEADERS += menuAlarmStat
|
||||
menu_HEADERS += menuConvert
|
||||
menu_HEADERS += menuFtype
|
||||
menu_HEADERS += menuIvoa
|
||||
menu_HEADERS += menuOmsl
|
||||
menu_HEADERS += menuPini
|
||||
menu_HEADERS += menuPost
|
||||
menu_HEADERS += menuPriority
|
||||
menu_HEADERS += menuScan
|
||||
menu_HEADERS += menuSimm
|
||||
menu_HEADERS += menuYesNo
|
||||
|
||||
HEADER_TYPES = libcom database record menu
|
||||
|
||||
HEADER_MD_FILES = $(foreach t, $(HEADER_TYPES), \
|
||||
$(addsuffix _h.md, $($t_HEADERS)))
|
||||
API_RST_FILES = $(addsuffix -api.rst, $(HEADER_TYPES))
|
||||
|
||||
RTD_SRC = $(COMMON_DIR)/rtd-src
|
||||
|
||||
DOCS += README.md
|
||||
DOCS += RELEASE_NOTES.md
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
doxygen: Doxyfile ../mainpage.dox $(INSTALL_HTMLS)
|
||||
$(HEADER_MD_FILES): %_h.md: ../HEADER_h.md
|
||||
$(EXPAND_TOOL) -t $(INSTALL_LOCATION) -DHEADER=$* $< $@
|
||||
|
||||
$(API_RST_FILES): %-api.rst: ../%-API.rst
|
||||
@$(RM) $@
|
||||
@$(ECHO) Creating $@
|
||||
@$(CP) $< $@
|
||||
@$(foreach h, $($*_HEADERS), \
|
||||
echo " $h_h.rst" >> $@;)
|
||||
|
||||
ifndef T_A
|
||||
doxygen rtd sphinx: inc
|
||||
$(MAKE) -C O.$(EPICS_HOST_ARCH) $@
|
||||
else
|
||||
|
||||
doxygen: Doxyfile
|
||||
@$(MKDIR) $(RTD_SRC)
|
||||
$(DOXYGEN)
|
||||
rsync -av $(TOP)/html/ html/
|
||||
|
||||
.PHONY: doxygen
|
||||
rtd: doxygen $(API_RST_FILES) $(HEADER_MD_FILES)
|
||||
rsync -av $(INSTALL_DOC)/ $(RTD_SRC)/
|
||||
rsync -av $(HEADER_MD_FILES) $(RTD_SRC)/
|
||||
rsync -av $(API_RST_FILES) $(RTD_SRC)/
|
||||
rsync -av ../index.rst ../conf.py $(RTD_SRC)/
|
||||
|
||||
commit: doxygen
|
||||
$(TOUCH) html/.nojekyll
|
||||
(cd $(TOP) && $(CURDIR)/../commit-gh.sh $(GH_FILES))
|
||||
sphinx: rtd
|
||||
cd $(COMMON_DIR); $(PYTHON) -m sphinx rtd-src readthedocs
|
||||
rsync -av $(COMMON_DIR)/readthedocs $(INSTALL_HTML)/
|
||||
endif
|
||||
|
||||
.PHONY: commit
|
||||
.PHONY: doxygen rtd sphinx
|
||||
|
||||
@@ -1,27 +1,7 @@
|
||||
# Installation Instructions {#install}
|
||||
# Installation instructions
|
||||
|
||||
## EPICS Base Release 7.0.x
|
||||
|
||||
-----
|
||||
|
||||
### Table of Contents
|
||||
|
||||
- [What is EPICS base?](#what-is-epics-base?)
|
||||
- [What is new in this release?](#what-is-new-in-this-release?)
|
||||
- [Copyright](#copyright)
|
||||
- [Supported platforms](#supported-platforms)
|
||||
- [Supported compilers](#supported-compilers)
|
||||
- [Software requirements](#software-requirements)
|
||||
- [Host system storage requirements](#host-system-storage-requirements)
|
||||
- [Documentation](#documentation)
|
||||
- [Directory Structure](#directory-structure)
|
||||
- [Site-specific build configuration](#site-specific-build-configuration)
|
||||
- [Building EPICS base](#building-epics-base)
|
||||
- [Example application and extension](#example-application-and-extension)
|
||||
- [Multiple host platforms](#multiple-host-platforms)
|
||||
|
||||
-----
|
||||
|
||||
### What is EPICS base?
|
||||
|
||||
The Experimental Physics and Industrial Control Systems (EPICS) is an
|
||||
@@ -36,8 +16,8 @@ interfaces) of various types.
|
||||
|
||||
### What is new in this release?
|
||||
|
||||
Please check the `documentation/RELEASE_NOTES.md` file for
|
||||
description of changes and release migration details.
|
||||
Please check the [release notes](RELEASE_NOTES.md)
|
||||
for description of changes and release migration details.
|
||||
|
||||
### Copyright
|
||||
|
||||
@@ -80,8 +60,7 @@ executable must be found through your normal search path.
|
||||
|
||||
#### Unzip and tar (Winzip on WIN32 systems)
|
||||
|
||||
You must have tools available to unzip and untar the EPICS base
|
||||
distribution file.
|
||||
You may need tools to unzip and untar the EPICS base distribution file.
|
||||
|
||||
#### Target systems
|
||||
|
||||
@@ -91,7 +70,7 @@ running as processes on the host platform.
|
||||
|
||||
#### vxWorks
|
||||
|
||||
You must have vxWorks 6.8 or later installed if any of your target
|
||||
You must have vxWorks 6.8 or 6.9 installed if any of your target
|
||||
systems are vxWorks systems; the C++ compiler from older versions cannot
|
||||
compile recently developed code. The vxWorks installation provides the
|
||||
cross-compiler and header files needed to build for these targets. The
|
||||
@@ -120,16 +99,10 @@ readline is available and will then use it. RTEMS targets may be
|
||||
configured to use `LIBTECLA` if available, and on vxWorks the OS's
|
||||
ledLib line-editing library is normally used.
|
||||
|
||||
### Host system storage requirements
|
||||
|
||||
The compressed tar file is approximately 3 MB in size. The
|
||||
distribution source tree takes up approximately 21 MB. A 64-bit host
|
||||
architecture may need around 610 MB to compile, while cross-compiled
|
||||
targets are somewhat smaller.
|
||||
|
||||
### Documentation
|
||||
|
||||
EPICS documentation is available through the [EPICS website](https://epics.anl.gov/) at Argonne.
|
||||
EPICS documentation is available from the
|
||||
[EPICS Documentation Website](https://docs.epics-controls.org/).
|
||||
|
||||
Release specific documentation can also be found in the
|
||||
`base/documentation` directory of the distribution.
|
||||
@@ -143,8 +116,10 @@ Release specific documentation can also be found in the
|
||||
base/configure Build rules and OS-independent config files
|
||||
base/configure/os OS-dependent build config files
|
||||
base/documentation Distribution documentation
|
||||
base/src Source code in various subdirectories
|
||||
base/src Source code for templates and build tools
|
||||
base/modules Source code for distribution submodules
|
||||
base/startup Scripts for setting up path and environment
|
||||
base/test Unit tests for build tools
|
||||
```
|
||||
|
||||
#### Directories created by the build
|
||||
@@ -158,7 +133,8 @@ configuration variable if that has been set.
|
||||
cfg Installed build configuration files
|
||||
db Installed database files
|
||||
dbd Installed database definition files
|
||||
html Installed html documentation
|
||||
doc Installed Markdown documentation
|
||||
html Installed HTML documentation
|
||||
include Installed header files
|
||||
include/os Installed OS-specific header files in subdirs
|
||||
include/compiler Installed compiler-specific header files
|
||||
@@ -169,12 +145,11 @@ configuration variable if that has been set.
|
||||
|
||||
#### `base/documentation` Directory
|
||||
|
||||
This contains documents on how to setup, build, and install EPICS.
|
||||
This contains EPICS reference documentation.
|
||||
|
||||
```
|
||||
README.md This file
|
||||
RELEASE_NOTES.md Notes on release changes
|
||||
KnownProblems.html List of known problems and workarounds
|
||||
```
|
||||
|
||||
#### `base/startup` Directory
|
||||
@@ -272,8 +247,7 @@ need C and C++ compilers in your search path. When building base you
|
||||
must have `echo` in your search path. For Unix host builds you will
|
||||
also need `cp`, `rm`, `mv`, and `mkdir` in your search path. Some Unix
|
||||
systems may also need `ar` and `ranlib`, and the C/C++ compilers may
|
||||
require `as` and `ld` in your path. On Solaris systems you need
|
||||
`uname` in your path.
|
||||
require `as` and `ld` in your path.
|
||||
|
||||
* **`LD_LIBRARY_PATH`**
|
||||
EPICS shared libraries and executables normally contain the full path
|
||||
@@ -290,7 +264,6 @@ Shared libraries are now built by default on all Unix type hosts.
|
||||
|
||||
To configure EPICS, you may want to modify some values set in the
|
||||
following files:
|
||||
>>>>>>> mirror/3.15
|
||||
|
||||
```
|
||||
configure/CONFIG_SITE Build settings. Specify target archs.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# EPICS 7.0 Release Notes {#releasenotes}
|
||||
# EPICS 7.0 Release Notes
|
||||
|
||||
These release notes describe changes that have been made since the previous
|
||||
release of this series of EPICS Base. **Note that changes which were merged up
|
||||
@@ -8,19 +8,106 @@ under the 3.15 release to 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 PVA submodules each have their own individual sets of release notes which
|
||||
should also be read to understand what has changed since earlier releases:
|
||||
The external PVA submodules each have their own individual release notes files.
|
||||
However the entries describing changes included in those submodules since EPICS
|
||||
7.0.5 have now been copied into the appropriate place of this file.
|
||||
|
||||
- [normativeTypes](https://github.com/epics-base/normativeTypesCPP/blob/master/documentation/RELEASE_NOTES.md)
|
||||
- [pvAccess](http://epics-base.github.io/pvAccessCPP/pvarelease_notes.html)
|
||||
- [pvData](http://epics-base.github.io/pvDataCPP/release_notes.html)
|
||||
- [pvDatabase](https://github.com/epics-base/pvDatabaseCPP/blob/master/documentation/RELEASE_NOTES.md)
|
||||
- [pva2pva](https://epics-base.github.io/pva2pva/release_notes.html)
|
||||
- [pvaClient](https://github.com/epics-base/pvaClientCPP/blob/master/documentation/RELEASE_NOTES.md)
|
||||
__This version of EPICS has not been released yet.__
|
||||
|
||||
**This version of EPICS has not been released yet.**
|
||||
## Changes made on the 7.0 branch since 7.0.9
|
||||
|
||||
## Changes made on the 7.0 branch since 7.0.8.1
|
||||
__Add new items below here__
|
||||
|
||||
### Reduce symbol and macro pollution from epicsAtomic.h on WIN32
|
||||
|
||||
`epicsAtomic.h` no longer pulls in as many unneeded declarations and macros from
|
||||
`windows.h`. Prior to this change, including `epicsAtomic.h` at the wrong time
|
||||
could result in unexpected compiler errors. Due to the nature of `windows.h`,
|
||||
some unneeded declarations are still pulled in, however the number is greatly reduced.
|
||||
Code that needs these declarations should explicitly include `windows.h` before `epicsAtomic.h`.
|
||||
|
||||
### epicsExport simplifications
|
||||
|
||||
`epicsExportAddress()`, `epicsExportRegistrar()` and `epicsRegisterFunction()`
|
||||
no longer require to be wrapped in `extern "C" { }` in C++ code.
|
||||
|
||||
### New `dbServerStats()` API for iocStats
|
||||
|
||||
A new routine provides the ability to request channel and client counts from
|
||||
named server layers that implement the `stats()` method, or to get a summary
|
||||
of the counts from all registered server layers. A preprocessor macro
|
||||
`HAS_DBSERVER_STATS` macro is defined in the `dbServer.h` header file to
|
||||
simplify code that needs to support older versions of Base as well.
|
||||
|
||||
-----
|
||||
|
||||
## EPICS Release 7.0.9
|
||||
|
||||
### Core documentation published at ReadTheDocs
|
||||
|
||||
The `documentation` directory's `Makefile` can now run various publication scripts including Sphinx and Doxygen to generate formatted documentation that is now being published
|
||||
[at docs.epics-controls.org](https://docs.epics-controls.org/projects/base/en/latest/index.html)
|
||||
and integrated into the main [EPICS Documentation website](https://docs.epics-controls.org/en/latest/index.html).
|
||||
The best place to find out more about these mechanisms is the
|
||||
[Contribution Guide](https://docs.epics-controls.org/en/latest/CONTRIBUTING.html)
|
||||
although it doesn't currently cover the new processes added to epics-base.
|
||||
|
||||
Much of the documentation generated from .dbd.pod files at build time is now
|
||||
also being converted into MarkDown (.md) files and installed into the top-level
|
||||
`doc` directory. Some users might find it quicker to look up information about a
|
||||
record type by opening these files in a text editor intead of opening a browser
|
||||
and loading the HTML versions or finding and opening the files from the EPICS
|
||||
Documentation site.
|
||||
|
||||
### Post monitors from compress record when it's reset
|
||||
|
||||
Writing into a compress record's `RES` field now posts a monitor event instead
|
||||
of only changing `VAL`. Monitor clients will therefore receive an empty array.
|
||||
|
||||
### The AMSG error message propagates through MSS links
|
||||
|
||||
A database link with the MSS attribute will now propagate not only SEVR and
|
||||
STAT, but also AMSG. This field contains additional information that complements
|
||||
STAT. Links with MS or MSI attributes do not propagate STAT, and therefore do
|
||||
not propagate AMSG, either.
|
||||
|
||||
Channel Access links do not propagate AMSG, regardless of the MSS attribute,
|
||||
because the message is not available as Channel metadata.
|
||||
|
||||
### Reloading record aliases
|
||||
|
||||
Aliases can now be defined more than once as long as they still refer to the
|
||||
same record, unless the global variable `dbRecordsOnceOnly` is non-zero.
|
||||
This allows database files to be loaded multiple times, even if they contain
|
||||
alias definitions.
|
||||
|
||||
### `DBE_PROPERTY` event rate changed
|
||||
|
||||
Updating property fields now only posts `DBE_PROPERTY` events if the
|
||||
field actually changed.
|
||||
|
||||
### Changes to msi related to include paths
|
||||
|
||||
There are two changes to `msi` included here.
|
||||
|
||||
`msi` now treats files included by .template or .substutiions files in a more
|
||||
consistent way: for relative paths, it will always look relative to the current
|
||||
working directory if no `-I` flags are passed, and if they are passed then it
|
||||
will search for the _relative_ path from each of those flags. That is, the
|
||||
following will now find the file `bar.template` located at
|
||||
`/some/path/rel/path/bar.template`
|
||||
```
|
||||
$ cat foo.substitutions
|
||||
file rel/path/bar.template {
|
||||
# contents
|
||||
}
|
||||
$ msi -I /some/path foo.substitutions
|
||||
```
|
||||
|
||||
Note that this does provide one change from previous behaviour: when opening a
|
||||
file from the command line, `msi` will not use the `-I`-specified paths to
|
||||
search for the file, but will only work relative to the current working
|
||||
directory, consistent with most commandline utilities.
|
||||
|
||||
### Allow users to delete previously created records from the database
|
||||
|
||||
@@ -28,16 +115,54 @@ From this release, record instances and aliases that have already been loaded
|
||||
by an IOC can be removed from the database again before the call to iocInit
|
||||
by loading a second instance of the named records but using `"#"` in place of
|
||||
the record type. Values for the fields are not required or advised, just use
|
||||
an empty record body { }. This is useful when a template defines records that
|
||||
an empty record body `{}`. This is useful when a template defines records that
|
||||
are not wanted in some IOCs, without having to split or duplicate the original
|
||||
template.
|
||||
|
||||
For example this will remove the record named "unwanted":
|
||||
|
||||
```
|
||||
record("#", "unwanted") { }
|
||||
record("#", "unwanted") {}
|
||||
```
|
||||
|
||||
### Only keep readline history for interactive sessions
|
||||
|
||||
Previously, all IOCsh commands were persisited in the libreadline history
|
||||
(when readline support is included).
|
||||
Going forward, only interactive commands are saved.
|
||||
|
||||
### Type change to asTrap serverSpecific data
|
||||
|
||||
Change `void*` to `dbChannel*` in `asTrapWriteBeforeWithData()` and
|
||||
`asTrapWriteMessage::serverSpecific` to reflect the reality since
|
||||
the `dbAddr*` to `dbChannel*` migration.
|
||||
External code wishing to support both before and after 3.15 should
|
||||
already be conditionally casting to/from the appropriate type.
|
||||
|
||||
### Fix issues with `_FORTIFY_SOURCE=3`
|
||||
|
||||
This release fixes the false positives failures whhen building with `_FORTIFY_SOURCE` level 3.
|
||||
The override introduced in 7.0.8.1 has been removed.
|
||||
|
||||
### Other
|
||||
|
||||
- genVersionHeader: work with git submodules and worktrees.
|
||||
- avoid UB with self `pthread_join()`
|
||||
- freebsd: Add support for x86 and amd64 builds
|
||||
- Clear AMSG when SEVR becomes zero.
|
||||
- `seqRecord` fix support for link `DLY0`
|
||||
- Add `ABORT_ON_ASSERT` flag to `CONFIG_SITE_ENV`
|
||||
- rationalize osdMutex
|
||||
|
||||
### Submodule updates
|
||||
|
||||
The pvDatabase module was updated to version 4.7.2:
|
||||
|
||||
* Resolved issue with changed field set in the case where the top level (master)
|
||||
field ("_") is not requested by the client, but the master field callback causes
|
||||
all fields to be marked as updated, rather than only those fields that have
|
||||
actually been modified.
|
||||
|
||||
-----
|
||||
|
||||
## EPICS Release 7.0.8.1
|
||||
@@ -277,6 +402,50 @@ The floating point modulo function `FMOD(NUM,DEN)` has been added to the CALC
|
||||
expression engine and is available to all software using that (calc and calcout
|
||||
record types, access security library and some extensions).
|
||||
|
||||
### Submodule updates
|
||||
|
||||
The pvData module was updated to version 8.0.6:
|
||||
|
||||
- Compatible changes
|
||||
- Actually enable JSON-5 output in PVStructure::Formatter::JSON when available.
|
||||
- Fix unaligned access issues for some ARM/Linux targets.
|
||||
|
||||
The pvAccess module was updated to version 7.1.7:
|
||||
|
||||
- Changes
|
||||
- Registering the PVA server with the IOC now sets the `PVAS_SERVER_PORT`
|
||||
variable in the environment.
|
||||
|
||||
The pva2pva module was updated to version 1.4.1:
|
||||
|
||||
- Bug Fixes
|
||||
- `dbLoadGroup` was fixed
|
||||
- Additions
|
||||
- Support for "meta" member at top of array of structs
|
||||
|
||||
The pvDatabase module was updated to version 4.7.1:
|
||||
|
||||
* Added data distributor plugin which can be used for distributing data between
|
||||
a group of clients. The plugin is triggered by the request string of the
|
||||
form:
|
||||
|
||||
`_[distributor=group:<group id>;set:<set_id>;trigger:<field_name>;updates:<n_updates>;mode:<update_mode>]`
|
||||
|
||||
The plugin parameters are optional and are described bellow:
|
||||
|
||||
- group: this parameter indicates a group that client application belongs to (default value: "default"); groups of clients are completely independent of each other
|
||||
|
||||
- set: this parameter designates a client set that application belongs to within its group (default value: "default")
|
||||
|
||||
- trigger: this is the PV structure field that distinguishes different channel updates (default value: "timeStamp"); for example, for area detector images one could use the "uniqueId" field of the NTND structure
|
||||
|
||||
- updates: this parameter configures how many sequential updates a client (or a set of clients) will receive before the data distributor starts updating the next one (default value: "1")
|
||||
|
||||
- mode: this parameter configures how channel updates are to be distributed between clients in a set:
|
||||
- one: update goes to one client per set
|
||||
- all: update goes to all clients in a set
|
||||
- default is "one" if client set id is not specified, and "all" if set id is specified
|
||||
|
||||
-----
|
||||
|
||||
## EPICS Release 7.0.7
|
||||
@@ -355,10 +524,10 @@ changed to `(p)->dtor`.
|
||||
The order over operations when processing a waveformRecord is adjusted
|
||||
so that updates to NORD is posted with the correct timestamp.
|
||||
|
||||
### Automatic COMMANDLINE_LIBRARY w/ newer compilers
|
||||
### Automatic `COMMANDLINE_LIBRARY` with newer compilers
|
||||
|
||||
When built with a compiler supporting `__has_include<>`, the presence
|
||||
of the `<readline/readline.h>` will be used to automatically determine
|
||||
of a `readline/readline.h` header will be used to automatically determine
|
||||
a default value for `COMMANDLINE_LIBRARY`.
|
||||
|
||||
Mingw builds with readline support now link `-ltermcap` instead of `-lcurses`.
|
||||
@@ -527,6 +696,44 @@ or if unsupported (`$TERM` not set, or Windows < 10).
|
||||
The `dbnd` server side filter now passes through alarm and property
|
||||
change events, even when not exceeding the deadband.
|
||||
|
||||
### Submodule updates
|
||||
|
||||
The pvData module was updated to version 8.0.5:
|
||||
|
||||
- Compatible changes
|
||||
- Internal changes to use the YAJL API for generating JSON and JSON-5 output.
|
||||
|
||||
The pvAccess module was updated to version 7.1.6:
|
||||
|
||||
- Changes to caProvider
|
||||
- Bug fix related to enum values.
|
||||
- More internal changes to improve performance when connecting tens of
|
||||
thousands of CA channels.
|
||||
- Several minor internal improvements.
|
||||
|
||||
The pva2pva module was updated to version 1.4.0:
|
||||
|
||||
- Bug Fixes
|
||||
- Apply ACF when writing to atomic group
|
||||
- Additions
|
||||
- Add new "structure" to @ref qsrv_group_map_types
|
||||
- Changes
|
||||
- Add Access Security hooks for single and group writes.
|
||||
- Enable "Async Soft Channel" for output links
|
||||
- When built against Base 7.0.6.1, set timeStamp.userTag from UTAG field.
|
||||
- Add DTYP="QSRV Set UTag" for longin, which sets UTAG=VAL.
|
||||
|
||||
The pvDatabase module was updated to version 4.7.0:
|
||||
|
||||
* Added support for the whole structure (master field) server side plugins.
|
||||
The whole structure is identified as the `_` string, and a pvRequest string
|
||||
that applies a plugin to it takes the form:
|
||||
|
||||
`field(_[XYZ=A:3;B:uniqueId])`
|
||||
|
||||
where `XYZ` is the name of a specific filter plugin that takes parameters
|
||||
`A` and `B` with values `3` and `uniqueId` respectively.
|
||||
|
||||
-----
|
||||
|
||||
## EPICS Release 7.0.6.1
|
||||
@@ -593,6 +800,15 @@ This was done to simplify the code and may have improved performance slightly fo
|
||||
|
||||
Many of the built-in record types have had improvements to their documentation with additional fields added to the tables, rewrites of descriptions and links to other documents added or fixed.
|
||||
|
||||
### Submodule updates
|
||||
|
||||
The pvAccess module was updated to version 7.1.4:
|
||||
|
||||
- Changes to caProvider
|
||||
- Resolve issues with pv structures that don't have a value field
|
||||
- Add NULL checks for handling unusual structures
|
||||
- Speed up channel creation when using large numbers of channels
|
||||
|
||||
-----
|
||||
|
||||
## EPICS Release 7.0.6
|
||||
@@ -603,7 +819,7 @@ These target architectures have been removed:
|
||||
|
||||
+ darwin-ppc, darwin-ppcx86
|
||||
+ linux-386, linux-486, linux-586, linux-686, linux-athlon (cross-build)
|
||||
+ linux-cris, linux-cris_v10, linux-cris_v32 (cross-build)
|
||||
+ linux-cris, linux-cris\_v10, linux-cris\_v32 (cross-build)
|
||||
+ RTEMS-at91rm9200ek, RTEMS-gen68360, RTEMS-mcp750, RTEMS-mvme167,
|
||||
RTEMS-psim (cross-build)
|
||||
|
||||
@@ -621,9 +837,9 @@ running on RTEMS 5:
|
||||
|
||||
- RTEMS-beagleboneblack
|
||||
- RTEMS-pc686
|
||||
- RTEMS-qoriq_e500 (MVME2500)
|
||||
- RTEMS-xilinx_zynq_a9_qemu
|
||||
- RTEMS-xilinx_zynq_zedboard
|
||||
- RTEMS-qoriq\_e500 (MVME2500)
|
||||
- RTEMS-xilinx\_zynq\_a9\_qemu
|
||||
- RTEMS-xilinx\_zynq\_zedboard
|
||||
|
||||
The EPICS support for RTEMS 4 has always relied on RTEMS-specific
|
||||
kernel APIs which cannot be used on an SMP system, so a new port was
|
||||
@@ -635,7 +851,7 @@ to run `make distclean` if switching a single source tree from one
|
||||
to the other (both header files and dependency files are different
|
||||
between the two and must be cleaned out).
|
||||
|
||||
The configuration variable RTEMS_VERSION in the EPICS config file
|
||||
The configuration variable `RTEMS_VERSION` in the EPICS config file
|
||||
`configure/os/CONFIG_SITE.Common.RTEMS` must be set to the full 3-
|
||||
part version number for RTEMS 4 releases, e.g. `4.9.1`, `4.10.2`
|
||||
but for RTEMS 5.1 and later it must only contain the major version
|
||||
@@ -833,6 +1049,39 @@ Test programs written directly in Perl as a `.plt` script should implement a
|
||||
similar timeout for themselves. The "netget" test in Base does this in a way
|
||||
that works on Windows as well as Unix-like hosts.
|
||||
|
||||
### Submodule updates
|
||||
|
||||
The pvAccess module was updated to version 7.1.4:
|
||||
|
||||
- Changes
|
||||
- Adjust argument parsing with pvput (Jesus Vasquez).
|
||||
|
||||
The pva2pva module was updated to version 1.3.1:
|
||||
|
||||
- Bug Fixes
|
||||
- Correct handling for server side filters.
|
||||
- Changes
|
||||
- Syncing softMain.cpp with epics-base
|
||||
|
||||
The pvDatabase module was updated to version 4.6.0:
|
||||
|
||||
* Access Security is now supported.
|
||||
* <b>special</b> has been revised and extended.
|
||||
* addRecord, removeRecord, processRecord, and traceRecord are replaced by pvdbcr versions.
|
||||
* <b>support</b> is DEPRECATED
|
||||
|
||||
The pvaClient module was updated to version 4.8.0:
|
||||
|
||||
* `PvaClientNTMultiData::getChannelChangeFlags` is a new method. It fixes
|
||||
issue #66.
|
||||
* Fix for issue #68. Both `PvaClientArray` and `PvaClientField` are not longer
|
||||
present. Neither was previously implemented.
|
||||
* Several public methods are now protected. They were never meant to be called
|
||||
by clients.
|
||||
* Issue #70 has been fixed.
|
||||
* Changes was made to increase the performance of `pvaMultiChannel`.
|
||||
* doxygen changes were made.
|
||||
|
||||
-----
|
||||
|
||||
## EPICS Release 7.0.5
|
||||
@@ -870,7 +1119,7 @@ compile device supports as loadable modules.
|
||||
### Priority inversion safe Posix mutexes
|
||||
|
||||
On Posix systems, epicsMutex now support priority inheritance if available.
|
||||
The IOC needs to run with SCHED_FIFO engaged to use these.
|
||||
The IOC needs to run with `SCHED_FIFO` engaged to use these.
|
||||
Support for Posix implementations before POSIX.1-2001 (`_XOPEN_SOURCE < 500`,
|
||||
glibc version < 2.3.3) has been dropped.
|
||||
|
||||
@@ -1003,14 +1252,14 @@ properly handle zero-length arrays. The `caget`, `caput` and `camonitor`
|
||||
client programs are known to work with empty arrays as long as they were
|
||||
built with this or a later version of EPICS.
|
||||
|
||||
#### Change to the db_access.h `dbr_size_n(TYPE, COUNT)` macro
|
||||
#### Change to the db\_access.h `dbr_size_n(TYPE, COUNT)` macro
|
||||
|
||||
When called with COUNT=0 this macro no longer returns the number of bytes
|
||||
required for a scalar (1 element) but for an empty array (0 elements).
|
||||
Make sure code that uses this doesn't call it with COUNT=0 when it really
|
||||
means COUNT=1.
|
||||
|
||||
Note that the db_access.h header file is included by cadef.h so the change
|
||||
Note that the db\_access.h header file is included by cadef.h so the change
|
||||
can impact Channel Access client programs that use this macro.
|
||||
|
||||
#### Channel Access support for zero-length arrays
|
||||
@@ -1120,6 +1369,35 @@ GNUmake added the directive `undefine` in version 3.82 to allow variables to
|
||||
be undefined. Support for this has been added to the EPICS Release file parser,
|
||||
so `undefine` can now be used in configure/RELEASE files to unset variables.
|
||||
|
||||
|
||||
### Submodule updates
|
||||
|
||||
The pvData module was updated to version 8.0.4:
|
||||
|
||||
- Incompatible changes
|
||||
- Remove `ByteBuffer::align()`
|
||||
- Compatible changes
|
||||
- Deprecate `SerializableControl::alignBuffer()` and
|
||||
`DeserializableControl::alignData()`
|
||||
- `shared_vector_convert<>()` fix convert of empty, untyped, array
|
||||
|
||||
The pvAccess module was updated to version 7.1.3:
|
||||
|
||||
- Bug fixes
|
||||
- Increase default TCP timeout to 40 seconds.
|
||||
Applies a 4/3 multiplier on `$EPICS_PVA_CONN_TMO` for compatibility.
|
||||
- CA Provider implementation restructured to simplify, reduce duplication
|
||||
and fix issues #163 and #165.
|
||||
- Changes
|
||||
- Enable building of pvtools to all except vxWorks, RTEMS and iOS.
|
||||
|
||||
The pva2pva module was updated to version 1.3.0:
|
||||
|
||||
- Changes
|
||||
- Add `dbLoadGroup()` iocsh function to read group JSON definitions
|
||||
from a file. Mappings in files must refer to full record names
|
||||
instead of fields. eg. 'recname.VAL' instead of 'VAL'.
|
||||
|
||||
-----
|
||||
|
||||
## EPICS Release 7.0.4.1
|
||||
@@ -1185,7 +1463,7 @@ The following launchpad bugs have fixes included in this release:
|
||||
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
|
||||
- [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
|
||||
@@ -1195,7 +1473,7 @@ The following launchpad bugs have fixes included in this release:
|
||||
- [lp: 1868680](https://bugs.launchpad.net/bugs/1868680), Access Security file
|
||||
reload (asInit) fails
|
||||
|
||||
### \*_API macros in EPICS headers
|
||||
### `*_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`)
|
||||
@@ -1429,7 +1707,7 @@ The API functions `epicsGetExecDir()` and `epicsGetExecName()` are also
|
||||
added to `osiFileName.h` to provide runtime access to the directory or
|
||||
filename of the executable with which the process was started.
|
||||
|
||||
### Decouple LINKER_USE_RPATH and STATIC_BUILD
|
||||
### Decouple `LINKER_USE_RPATH` and `STATIC_BUILD`
|
||||
|
||||
Previously, setting `STATIC_BUILD=NO` implied `LINKER_USE_RPATH=NO`.
|
||||
This is no longer the case. Setting `LINKER_USE_RPATH=YES` will
|
||||
@@ -2008,7 +2286,7 @@ number instead, like this:
|
||||
Channel Access does not (and probably never will) directly support 64-bit
|
||||
integer types, so the new field types are presented to the CA server as
|
||||
`DBF_DOUBLE` values. This means that field values larger than 2^52
|
||||
(0x10_0000_0000_0000 = 4503599627370496) cannot be transported over Channel
|
||||
(0x10\_0000\_0000\_0000 = 4503599627370496) cannot be transported over Channel
|
||||
Access without their least significant bits being truncated. The EPICS V4
|
||||
pvAccess network protocol _can_ transport 64-bit data types however, and a
|
||||
future release of the pvaSrv module will connect this ability to the fields of
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e -x
|
||||
# Usage: commit-gh <sub-directory-prefix> <files...>
|
||||
#
|
||||
# Creates a commit containing only the files in the sub-directory provided as an argument
|
||||
#
|
||||
# Does not disturb the working copy or index
|
||||
|
||||
prefix="$1"
|
||||
shift
|
||||
|
||||
# Commit to this branch
|
||||
BRANCH=refs/heads/gh-pages
|
||||
|
||||
# Use the main branch description as the gh-pages commit message
|
||||
MSG=`git describe --tags --always`
|
||||
|
||||
# Scratch space
|
||||
TDIR=`mktemp -d -p $PWD`
|
||||
|
||||
# Automatic cleanup of scratch space
|
||||
trap 'rm -rf $TDIR' INT TERM QUIT EXIT
|
||||
|
||||
export GIT_INDEX_FILE="$TDIR/index"
|
||||
|
||||
# Add listed files to a new (empty) index
|
||||
git update-index --add "$@"
|
||||
|
||||
# Write the index into the repo, get tree hash
|
||||
TREE=`git write-tree --prefix="$prefix"`
|
||||
|
||||
echo "TREE $TREE"
|
||||
git cat-file -p $TREE
|
||||
|
||||
# Create a commit with our new tree
|
||||
# Reference current branch head as parent (if any)
|
||||
CMT=`git commit-tree -m "$MSG" $TREE`
|
||||
|
||||
echo "COMMIT $CMT"
|
||||
git cat-file -p $CMT
|
||||
|
||||
# Update the branch with the new commit tree hash
|
||||
git update-ref $BRANCH $CMT
|
||||
|
||||
echo "Done"
|
||||
130
documentation/conf.py
Normal file
130
documentation/conf.py
Normal file
@@ -0,0 +1,130 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# http://www.sphinx-doc.org/en/master/config
|
||||
|
||||
# -- Path setup --------------------------------------------------------------
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(0, os.path.abspath("."))
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = "EPICS Base Documentation"
|
||||
copyright = "EPICS Controls"
|
||||
author = "The EPICS Collaboration"
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
|
||||
extensions = [
|
||||
"hoverxref.extension",
|
||||
"breathe",
|
||||
"sphinx.ext.mathjax",
|
||||
"sphinx.ext.ifconfig",
|
||||
"sphinx.ext.graphviz",
|
||||
"sphinx_copybutton",
|
||||
"sphinx.ext.intersphinx",
|
||||
'myst_parser',
|
||||
]
|
||||
|
||||
# Setup the breathe extension
|
||||
breathe_projects = {"epics-base": "xml"}
|
||||
|
||||
breathe_default_project = "epics-base"
|
||||
|
||||
# Tell sphinx what the primary language being documented is.
|
||||
primary_domain = "cpp"
|
||||
|
||||
# Tell sphinx what the pygments highlight language should be.
|
||||
highlight_language = "cpp"
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
# templates_path = ()
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "O.*", "venv"]
|
||||
|
||||
# Intersphinx links to subprojects
|
||||
intersphinx_mapping = {
|
||||
"epics": ("https://docs.epics-controls.org/en/latest/", None),
|
||||
}
|
||||
intersphinx_disabled_reftypes = ["*"]
|
||||
hoverxref_role_types = {
|
||||
"hoverxref": "tooltip",
|
||||
"ref": "modal",
|
||||
"confval": "tooltip",
|
||||
"mod": "modal",
|
||||
"class": "modal",
|
||||
"obj": "tooltip",
|
||||
}
|
||||
|
||||
hoverxref_intersphinx_types = {
|
||||
"readthedocs": "modal",
|
||||
"sphinx": "tooltip",
|
||||
}
|
||||
|
||||
hoverxref_domains = [
|
||||
"py",
|
||||
]
|
||||
|
||||
# Enabled Markdown extensions.
|
||||
# See here for what they do:
|
||||
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html
|
||||
myst_enable_extensions = [
|
||||
"amsmath",
|
||||
"colon_fence",
|
||||
"deflist",
|
||||
"dollarmath",
|
||||
"fieldlist",
|
||||
"html_image",
|
||||
"replacements",
|
||||
"smartquotes",
|
||||
"strikethrough",
|
||||
"tasklist",
|
||||
]
|
||||
|
||||
# Allows auto-generated header anchors:
|
||||
# https://myst-parser.readthedocs.io/en/latest/syntax/optional.html#auto-generated-header-anchors
|
||||
myst_heading_anchors = 4
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
# html_static_path = ['_static']
|
||||
|
||||
# html_css_files = [
|
||||
# 'css/custom.css',
|
||||
# ]
|
||||
|
||||
master_doc = "index"
|
||||
|
||||
# html_theme_options = {
|
||||
# 'logo_only': True,
|
||||
# }
|
||||
# html_logo = "images/EPICS_white_logo_v02.png"
|
||||
|
||||
# html_extra_path = ['../html']
|
||||
|
||||
# Breathe directives
|
||||
7
documentation/database-API.rst
Normal file
7
documentation/database-API.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
IOC Database C/C++ APIs
|
||||
=======================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: IOC Header Files
|
||||
|
||||
30
documentation/index.rst
Normal file
30
documentation/index.rst
Normal file
@@ -0,0 +1,30 @@
|
||||
EPICS Base Documentation
|
||||
========================
|
||||
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
EPICS Documentation Index <https://docs.epics-controls.org/en/latest/>
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: General Information
|
||||
|
||||
README
|
||||
RELEASE_NOTES
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: IOC Component Reference
|
||||
|
||||
ComponentReference
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: C/C++ Headers
|
||||
|
||||
libcom-api
|
||||
database-api
|
||||
record-api
|
||||
menu-api
|
||||
7
documentation/libcom-API.rst
Normal file
7
documentation/libcom-API.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
Common Library C/C++ APIs
|
||||
=========================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: LibCom Header Files
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
@mainpage EPICS Base
|
||||
|
||||
Documentation index
|
||||
|
||||
@li @ref releasenotes
|
||||
@li @ref install
|
||||
@li <a href="ComponentReference.html">EPICS Component Reference Manual</a>
|
||||
@li <a href="filters.html">Field Modifiers and Channel Filters</a>
|
||||
@li <a href="links.html">Extensible IOC Database Links</a>
|
||||
@li <a href="CAref.html">Channel Access Reference Manual</a>
|
||||
@li <a href="msi.html">msi: Macro Substitution and Include Tool</a>
|
||||
@li <a href="CA.html">Perl 5 Interface to Channel Access</a>
|
||||
|
||||
*/
|
||||
7
documentation/menu-API.rst
Normal file
7
documentation/menu-API.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
C/C++ Headers from Menus
|
||||
========================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Generated Menu Header Files
|
||||
|
||||
7
documentation/record-API.rst
Normal file
7
documentation/record-API.rst
Normal file
@@ -0,0 +1,7 @@
|
||||
C/C++ Headers from Record Types
|
||||
===============================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:caption: Generated Record Header Files
|
||||
|
||||
6
documentation/requirements.txt
Normal file
6
documentation/requirements.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
sphinx==7.2.6
|
||||
myst-parser==2.0.0
|
||||
breathe==4.35.0
|
||||
sphinx_copybutton==0.5.2
|
||||
sphinx-hoverxref==1.3.0
|
||||
sphinx-rtd-theme==2.0.0
|
||||
@@ -3396,7 +3396,7 @@ void verifyContextRundownChanStillExist (
|
||||
showProgressEnd ( interestLevel );
|
||||
}
|
||||
|
||||
int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
|
||||
void acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
|
||||
unsigned repetitionCount, enum ca_preemptive_callback_select select )
|
||||
{
|
||||
chid chan;
|
||||
@@ -3549,8 +3549,6 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
|
||||
printf ( "\nTest Complete\n" );
|
||||
|
||||
epicsExit ( EXIT_SUCCESS );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ extern "C" {
|
||||
enum appendNumberFlag {appendNumber, dontAppendNumber};
|
||||
int catime ( const char *channelName, unsigned channelCount, enum appendNumberFlag appNF );
|
||||
|
||||
int acctst ( const char *pname, unsigned logggingInterestLevel,
|
||||
EPICS_NORETURN
|
||||
void acctst ( const char *pname, unsigned logggingInterestLevel,
|
||||
unsigned channelCount, unsigned repetitionCount,
|
||||
enum ca_preemptive_callback_select select );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ ifeq ($(wildcard $(PERL_h)),)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (inc,$(strip $(MAKECMDGOALS)))
|
||||
ifneq ($(filter-out inc,$(strip $(MAKECMDGOALS))),)
|
||||
ifeq ($(T_A),$(EPICS_HOST_ARCH)) # No cross-builds (wrong Perl!)
|
||||
ifeq ($(strip $(XSUBPP)),)
|
||||
$(warning Perl's xsubpp program was not found.)
|
||||
|
||||
@@ -16,7 +16,7 @@ USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET
|
||||
# Shared library ABI version.
|
||||
SHRLIB_VERSION = $(EPICS_DATABASE_MAJOR_VERSION).$(EPICS_DATABASE_MINOR_VERSION).$(EPICS_DATABASE_MAINTENANCE_VERSION)
|
||||
|
||||
API_HEADER = dbCoreAPI.h
|
||||
# dbCoreAPI.h generated earlier during libcom/
|
||||
dbCore_API = dbCore
|
||||
|
||||
LIBRARY_IOC += dbCore
|
||||
|
||||
@@ -20,7 +20,7 @@ BPT_DBD += bptTypeJdegF.dbd
|
||||
BPT_DBD += bptTypeKdegC.dbd
|
||||
BPT_DBD += bptTypeKdegF.dbd
|
||||
|
||||
ifneq (inc,$(strip $(MAKECMDGOALS)))
|
||||
ifneq ($(filter-out inc,$(strip $(MAKECMDGOALS))),)
|
||||
DBD += $(BPT_DBD)
|
||||
endif
|
||||
|
||||
@@ -28,5 +28,5 @@ PROD_HOST += makeBpt
|
||||
|
||||
makeBpt_SRCS = makeBpt
|
||||
|
||||
DOCS += menuConvert.md
|
||||
HTMLS += menuConvert.html
|
||||
|
||||
|
||||
@@ -61,6 +61,12 @@ DBDINC += menuScan
|
||||
DBDINC += dbCommon
|
||||
|
||||
dbMenusPod = $(notdir $(wildcard ../db/menu*.dbd.pod))
|
||||
|
||||
DOCS += $(patsubst %.dbd.pod,%.md,$(dbMenusPod))
|
||||
DOCS += dbCommonRecord.md
|
||||
DOCS += dbCommonInput.md
|
||||
DOCS += dbCommonOutput.md
|
||||
|
||||
HTMLS += $(patsubst %.dbd.pod,%.html,$(dbMenusPod))
|
||||
HTMLS += dbCommonRecord.html
|
||||
HTMLS += dbCommonInput.html
|
||||
|
||||
@@ -1325,6 +1325,7 @@ long dbPut(DBADDR *paddr, short dbrType,
|
||||
long status = 0;
|
||||
dbFldDes *pfldDes;
|
||||
int isValueField;
|
||||
int propertyUpdate = paddr->pfldDes->prop && precord->mlis.count;
|
||||
|
||||
if (special == SPC_ATTRIBUTE)
|
||||
return S_db_noMod;
|
||||
@@ -1369,12 +1370,31 @@ long dbPut(DBADDR *paddr, short dbrType,
|
||||
if (nRequest < 1) {
|
||||
recGblSetSevr(precord, LINK_ALARM, INVALID_ALARM);
|
||||
} else {
|
||||
status = dbFastPutConvertRoutine[dbrType][field_type](pbuffer,
|
||||
paddr->pfield, paddr);
|
||||
if (propertyUpdate && paddr->field_size <= MAX_STRING_SIZE) {
|
||||
char propBuffer[MAX_STRING_SIZE];
|
||||
status = dbFastPutConvertRoutine[dbrType][field_type](pbuffer,
|
||||
&propBuffer, paddr);
|
||||
if (!status) {
|
||||
if (memcmp(paddr->pfield, &propBuffer, paddr->field_size) != 0) {
|
||||
memcpy(paddr->pfield, &propBuffer, paddr->field_size);
|
||||
} else {
|
||||
/* suppress DBE_PROPERTY event if property did not change */
|
||||
propertyUpdate = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
status = dbFastPutConvertRoutine[dbrType][field_type](pbuffer,
|
||||
paddr->pfield, paddr);
|
||||
}
|
||||
nRequest = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Post property updates before second dbPutSpecial */
|
||||
/* which may post DBE_VALUE and/or DBE_LOG events */
|
||||
if (propertyUpdate && !status)
|
||||
db_post_events(precord, NULL, DBE_PROPERTY);
|
||||
|
||||
/* Always do special processing if needed */
|
||||
if (special) {
|
||||
long status2 = dbPutSpecial(paddr, 1);
|
||||
@@ -1391,12 +1411,6 @@ long dbPut(DBADDR *paddr, short dbrType,
|
||||
if (precord->mlis.count &&
|
||||
!(isValueField && pfldDes->process_passive))
|
||||
db_post_events(precord, pfieldsave, DBE_VALUE | DBE_LOG);
|
||||
/* If this field is a property (metadata) field,
|
||||
* then post a property change event (even if the field
|
||||
* didn't change).
|
||||
*/
|
||||
if (precord->mlis.count && pfldDes->prop)
|
||||
db_post_events(precord, NULL, DBE_PROPERTY);
|
||||
done:
|
||||
paddr->pfield = pfieldsave;
|
||||
return status;
|
||||
|
||||
@@ -115,10 +115,9 @@ static int dbca_chan_count;
|
||||
* During link modification or IOC shutdown the pca->plink pointer (guarded by caLink.lock)
|
||||
* is used as a flag to indicate that a link is no longer active.
|
||||
*
|
||||
* References to the struct caLink are owned by the dbCaTask, and any scanOnceCallback()
|
||||
* which is in progress.
|
||||
* References to the struct caLink are owned by the dbCaTask.
|
||||
*
|
||||
* The libca and scanOnceCallback callbacks take no action if pca->plink==NULL.
|
||||
* The libca callbacks take no action if pca->plink==NULL.
|
||||
*
|
||||
* dbCaPutLinkCallback causes an additional complication because
|
||||
* when dbCaRemoveLink is called the callback may not have occured.
|
||||
@@ -788,38 +787,6 @@ static long doLocked(struct link *plink, dbLinkUserCallback rtn, void *priv)
|
||||
return status;
|
||||
}
|
||||
|
||||
static void scanComplete(void *raw, dbCommon *prec)
|
||||
{
|
||||
caLink *pca = raw;
|
||||
epicsMutexMustLock(pca->lock);
|
||||
if(!pca->plink) {
|
||||
/* IOC shutdown or link re-targeted. Do nothing. */
|
||||
} else if(pca->scanningOnce==0) {
|
||||
errlogPrintf("dbCa.c complete callback w/ scanningOnce==0\n");
|
||||
} else if(--pca->scanningOnce){
|
||||
/* another scan is queued */
|
||||
if(scanOnceCallback(prec, scanComplete, raw)) {
|
||||
errlogPrintf("dbCa.c failed to re-queue scanOnce\n");
|
||||
} else
|
||||
caLinkInc(pca);
|
||||
}
|
||||
epicsMutexUnlock(pca->lock);
|
||||
caLinkDec(pca);
|
||||
}
|
||||
|
||||
/* must be called with pca->lock held */
|
||||
static void scanLinkOnce(dbCommon *prec, caLink *pca) {
|
||||
if(pca->scanningOnce==0) {
|
||||
if(scanOnceCallback(prec, scanComplete, pca)) {
|
||||
errlogPrintf("dbCa.c failed to queue scanOnce\n");
|
||||
} else
|
||||
caLinkInc(pca);
|
||||
}
|
||||
if(pca->scanningOnce<5)
|
||||
pca->scanningOnce++;
|
||||
/* else too many scans queued */
|
||||
}
|
||||
|
||||
static lset dbCa_lset = {
|
||||
0, 1, /* not Constant, Volatile */
|
||||
NULL, dbCaRemoveLink,
|
||||
@@ -856,7 +823,9 @@ static void connectionCallback(struct connection_handler_args arg)
|
||||
if (precord &&
|
||||
((ppv_link->pvlMask & pvlOptCP) ||
|
||||
((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0)))
|
||||
scanLinkOnce(precord, pca);
|
||||
{
|
||||
link_action |= CA_DBPROCESS;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
pca->hasReadAccess = ca_read_access(arg.chid);
|
||||
@@ -988,7 +957,9 @@ static void eventCallback(struct event_handler_args arg)
|
||||
|
||||
if ((ppv_link->pvlMask & pvlOptCP) ||
|
||||
((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0))
|
||||
scanLinkOnce(precord, pca);
|
||||
{
|
||||
addAction(pca, CA_DBPROCESS);
|
||||
}
|
||||
}
|
||||
done:
|
||||
epicsMutexUnlock(pca->lock);
|
||||
@@ -1061,7 +1032,9 @@ static void accessRightsCallback(struct access_rights_handler_args arg)
|
||||
if (precord &&
|
||||
((ppv_link->pvlMask & pvlOptCP) ||
|
||||
((ppv_link->pvlMask & pvlOptCPP) && precord->scan == 0)))
|
||||
scanLinkOnce(precord, pca);
|
||||
{
|
||||
addAction(pca, CA_DBPROCESS);
|
||||
}
|
||||
done:
|
||||
epicsMutexUnlock(pca->lock);
|
||||
}
|
||||
@@ -1273,6 +1246,13 @@ static void dbCaTask(void *arg)
|
||||
printLinks(pca);
|
||||
}
|
||||
}
|
||||
if (link_action & CA_DBPROCESS) {
|
||||
dbCommon *prec;
|
||||
epicsMutexMustLock(pca->lock);
|
||||
prec = pca->plink->precord;
|
||||
epicsMutexUnlock(pca->lock);
|
||||
db_process(prec);
|
||||
}
|
||||
}
|
||||
SEVCHK(ca_flush_io(), "dbCaTask");
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#define CA_MONITOR_STRING 0x20
|
||||
#define CA_GET_ATTRIBUTES 0x40
|
||||
#define CA_SYNC 0x1000
|
||||
#define CA_DBPROCESS 0x2000
|
||||
/* write type */
|
||||
#define CA_PUT 0x1
|
||||
#define CA_PUT_CALLBACK 0x2
|
||||
|
||||
@@ -635,9 +635,21 @@ long dbChannelGetField(dbChannel *chan, short dbrType, void *pbuffer,
|
||||
{
|
||||
dbCommon *precord = chan->addr.precord;
|
||||
long status = 0;
|
||||
unsigned char local_fl = 0;
|
||||
|
||||
dbScanLock(precord);
|
||||
if (!pfl && (ellCount(&chan->pre_chain) || ellCount(&chan->post_chain))) {
|
||||
pfl = db_create_read_log(chan);
|
||||
if (pfl) {
|
||||
local_fl = 1;
|
||||
pfl = dbChannelRunPreChain(chan, pfl);
|
||||
pfl = dbChannelRunPostChain(chan, pfl);
|
||||
}
|
||||
}
|
||||
status = dbChannelGet(chan, dbrType, pbuffer, options, nRequest, pfl);
|
||||
if (local_fl) {
|
||||
db_delete_field_log(pfl);
|
||||
}
|
||||
dbScanUnlock(precord);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -511,6 +511,10 @@ DBCORE_API long dbChannelGet(dbChannel *chan, short type,
|
||||
* \param[in,out] nRequest Pointer to the element count.
|
||||
* \param[in] pfl Pointer to a db_field_log or NULL.
|
||||
* \returns 0, or an error status value.
|
||||
*
|
||||
* \since UNRELEASED If pfl is NULL and chan has filters, db_create_read_log() will be called
|
||||
* internally to create a temporary db_field_log which is passed to dbChannelGet()
|
||||
* then deallocated.
|
||||
*/
|
||||
DBCORE_API long dbChannelGetField(dbChannel *chan, short type,
|
||||
void *pbuffer, long *options, long *nRequest, void *pfl);
|
||||
|
||||
@@ -285,7 +285,11 @@ Inf (Infinite) value. UDF defaults to TRUE but can be set in a database file.
|
||||
Record and device support routines which write to the VAL field are generally
|
||||
responsible for setting and clearing UDF.
|
||||
|
||||
=fields STAT, SEVR, AMSG, NSTA, NSEV, NAMSG, ACKS, ACKT, UDF
|
||||
The B<UDFS> field specifies the alarm severity that the record will be set to
|
||||
whenever its value is undefined (i.e., the UDF field is 1). This includes the
|
||||
initial severity of the record being undefined after the IOC boots.
|
||||
|
||||
=fields STAT, SEVR, AMSG, NSTA, NSEV, NAMSG, ACKS, ACKT, UDF, UDFS
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -226,25 +226,48 @@ static long dbDbGetValue(struct link *plink, short dbrType, void *pbuffer,
|
||||
}
|
||||
|
||||
if (!status && precord != dbChannelRecord(chan))
|
||||
recGblInheritSevr(plink->value.pv_link.pvlMask & pvlOptMsMode,
|
||||
recGblInheritSevrMsg(plink->value.pv_link.pvlMask & pvlOptMsMode,
|
||||
plink->precord,
|
||||
dbChannelRecord(chan)->stat, dbChannelRecord(chan)->sevr);
|
||||
dbChannelRecord(chan)->stat, dbChannelRecord(chan)->sevr,
|
||||
dbChannelRecord(chan)->amsg);
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Some records get options (precsision, units, ...) for some fields
|
||||
* from an input link. We need to catch the case that this link
|
||||
* points back to the same field or we will end in an infinite recursion.
|
||||
*/
|
||||
static long dbDbGetOptionLoopSafe(const struct link *plink, short dbrType,
|
||||
void *pbuffer, long option)
|
||||
{
|
||||
/* We need to cast away const to set the flags.
|
||||
That's ok because we know that plink is never actually readonly.
|
||||
And we reset everything to its original state.
|
||||
*/
|
||||
struct link *mutable_plink = (struct link *)plink;
|
||||
long status = S_dbLib_badLink;
|
||||
dbChannel *chan = linkChannel(plink);
|
||||
DBADDR *paddr = &chan->addr;
|
||||
long number_elements = 0;
|
||||
|
||||
dbScanLock(paddr->precord);
|
||||
if (!(mutable_plink->flags & DBLINK_FLAG_VISITED)) {
|
||||
mutable_plink->flags |= DBLINK_FLAG_VISITED;
|
||||
status = dbGet(paddr, dbrType, pbuffer, &option, &number_elements, NULL);
|
||||
mutable_plink->flags &= ~DBLINK_FLAG_VISITED;
|
||||
}
|
||||
dbScanUnlock(paddr->precord);
|
||||
return status;
|
||||
}
|
||||
|
||||
static long dbDbGetControlLimits(const struct link *plink, double *low,
|
||||
double *high)
|
||||
{
|
||||
dbChannel *chan = linkChannel(plink);
|
||||
DBADDR *paddr = &chan->addr;
|
||||
struct buffer {
|
||||
DBRctrlDouble
|
||||
double value;
|
||||
} buffer;
|
||||
long options = DBR_CTRL_DOUBLE;
|
||||
long number_elements = 0;
|
||||
long status = dbGet(paddr, DBR_DOUBLE, &buffer, &options, &number_elements,
|
||||
NULL);
|
||||
long status = dbDbGetOptionLoopSafe(plink, DBR_DOUBLE, &buffer, DBR_CTRL_DOUBLE);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -257,16 +280,11 @@ static long dbDbGetControlLimits(const struct link *plink, double *low,
|
||||
static long dbDbGetGraphicLimits(const struct link *plink, double *low,
|
||||
double *high)
|
||||
{
|
||||
dbChannel *chan = linkChannel(plink);
|
||||
DBADDR *paddr = &chan->addr;
|
||||
struct buffer {
|
||||
DBRgrDouble
|
||||
double value;
|
||||
} buffer;
|
||||
long options = DBR_GR_DOUBLE;
|
||||
long number_elements = 0;
|
||||
long status = dbGet(paddr, DBR_DOUBLE, &buffer, &options, &number_elements,
|
||||
NULL);
|
||||
long status = dbDbGetOptionLoopSafe(plink, DBR_DOUBLE, &buffer, DBR_GR_DOUBLE);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -279,16 +297,11 @@ static long dbDbGetGraphicLimits(const struct link *plink, double *low,
|
||||
static long dbDbGetAlarmLimits(const struct link *plink, double *lolo,
|
||||
double *low, double *high, double *hihi)
|
||||
{
|
||||
dbChannel *chan = linkChannel(plink);
|
||||
DBADDR *paddr = &chan->addr;
|
||||
struct buffer {
|
||||
DBRalDouble
|
||||
double value;
|
||||
} buffer;
|
||||
long options = DBR_AL_DOUBLE;
|
||||
long number_elements = 0;
|
||||
long status = dbGet(paddr, DBR_DOUBLE, &buffer, &options, &number_elements,
|
||||
0);
|
||||
long status = dbDbGetOptionLoopSafe(plink, DBR_DOUBLE, &buffer, DBR_AL_DOUBLE);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -302,16 +315,11 @@ static long dbDbGetAlarmLimits(const struct link *plink, double *lolo,
|
||||
|
||||
static long dbDbGetPrecision(const struct link *plink, short *precision)
|
||||
{
|
||||
dbChannel *chan = linkChannel(plink);
|
||||
DBADDR *paddr = &chan->addr;
|
||||
struct buffer {
|
||||
DBRprecision
|
||||
double value;
|
||||
} buffer;
|
||||
long options = DBR_PRECISION;
|
||||
long number_elements = 0;
|
||||
long status = dbGet(paddr, DBR_DOUBLE, &buffer, &options, &number_elements,
|
||||
0);
|
||||
long status = dbDbGetOptionLoopSafe(plink, DBR_DOUBLE, &buffer, DBR_PRECISION);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -322,16 +330,11 @@ static long dbDbGetPrecision(const struct link *plink, short *precision)
|
||||
|
||||
static long dbDbGetUnits(const struct link *plink, char *units, int unitsSize)
|
||||
{
|
||||
dbChannel *chan = linkChannel(plink);
|
||||
DBADDR *paddr = &chan->addr;
|
||||
struct buffer {
|
||||
DBRunits
|
||||
double value;
|
||||
} buffer;
|
||||
long options = DBR_UNITS;
|
||||
long number_elements = 0;
|
||||
long status = dbGet(paddr, DBR_DOUBLE, &buffer, &options, &number_elements,
|
||||
0);
|
||||
long status = dbDbGetOptionLoopSafe(plink, DBR_DOUBLE, &buffer, DBR_UNITS);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
@@ -376,8 +379,8 @@ static long dbDbPutValue(struct link *plink, short dbrType,
|
||||
dbCommon *pdest = dbChannelRecord(chan);
|
||||
long status = dbPut(paddr, dbrType, pbuffer, nRequest);
|
||||
|
||||
recGblInheritSevr(ppv_link->pvlMask & pvlOptMsMode, pdest, psrce->nsta,
|
||||
psrce->nsev);
|
||||
recGblInheritSevrMsg(ppv_link->pvlMask & pvlOptMsMode, pdest, psrce->nsta,
|
||||
psrce->nsev, psrce->namsg);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
|
||||
@@ -75,21 +75,21 @@ static const iocshFuncDef dbbFuncDef = {"dbb",1,dbbArgs,
|
||||
"Set Breakpoint on a record\n"
|
||||
"This command spawns one breakpoint continuation task per lockset,"
|
||||
" in which further record execution is run\n"};
|
||||
static void dbbCallFunc(const iocshArgBuf *args) { dbb(args[0].sval);}
|
||||
static void dbbCallFunc(const iocshArgBuf *args) { iocshSetError(dbb(args[0].sval));}
|
||||
|
||||
/* dbd */
|
||||
static const iocshArg dbdArg0 = { "record name",iocshArgStringRecord};
|
||||
static const iocshArg * const dbdArgs[1] = {&dbdArg0};
|
||||
static const iocshFuncDef dbdFuncDef = {"dbd",1,dbdArgs,
|
||||
"Remove breakpoint from a record.\n"};
|
||||
static void dbdCallFunc(const iocshArgBuf *args) { dbd(args[0].sval);}
|
||||
static void dbdCallFunc(const iocshArgBuf *args) { iocshSetError(dbd(args[0].sval));}
|
||||
|
||||
/* dbc */
|
||||
static const iocshArg dbcArg0 = { "record name",iocshArgStringRecord};
|
||||
static const iocshArg * const dbcArgs[1] = {&dbcArg0};
|
||||
static const iocshFuncDef dbcFuncDef = {"dbc",1,dbcArgs,
|
||||
"Continue processing in a lockset until next breakpoint is found.\n"};
|
||||
static void dbcCallFunc(const iocshArgBuf *args) { dbc(args[0].sval);}
|
||||
static void dbcCallFunc(const iocshArgBuf *args) { iocshSetError(dbc(args[0].sval));}
|
||||
|
||||
/* dbs */
|
||||
static const iocshArg dbsArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -97,12 +97,12 @@ static const iocshArg * const dbsArgs[1] = {&dbsArg0};
|
||||
static const iocshFuncDef dbsFuncDef = {"dbs",1,dbsArgs,
|
||||
"Step through record processing within a lockset.\n"
|
||||
"If called without an argument, automatically steps with the last breakpoint.\n"};
|
||||
static void dbsCallFunc(const iocshArgBuf *args) { dbs(args[0].sval);}
|
||||
static void dbsCallFunc(const iocshArgBuf *args) { iocshSetError(dbs(args[0].sval));}
|
||||
|
||||
/* dbstat */
|
||||
static const iocshFuncDef dbstatFuncDef = {"dbstat",0,0,
|
||||
"Print list of suspended records, and breakpoints set in locksets.\n"};
|
||||
static void dbstatCallFunc(const iocshArgBuf *args) { dbstat();}
|
||||
static void dbstatCallFunc(const iocshArgBuf *args) { iocshSetError(dbstat());}
|
||||
|
||||
/* dbp */
|
||||
static const iocshArg dbpArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -119,7 +119,9 @@ static const iocshFuncDef dbpFuncDef = {
|
||||
" 3 - Fields of minor interest to a System developer.\n"
|
||||
" 4 - Internal record fields.\n"};
|
||||
static void dbpCallFunc(const iocshArgBuf *args)
|
||||
{ dbp(args[0].sval,args[1].ival);}
|
||||
{
|
||||
iocshSetError(dbp(args[0].sval,args[1].ival));
|
||||
}
|
||||
|
||||
/* dbap */
|
||||
static const iocshArg dbapArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -127,7 +129,7 @@ static const iocshArg * const dbapArgs[1] = {&dbapArg0};
|
||||
static const iocshFuncDef dbapFuncDef = {"dbap",1,dbapArgs,
|
||||
"Auto Print.\n"
|
||||
"Toggle automatic printing after processing a record that has a breakpoint.\n"};
|
||||
static void dbapCallFunc(const iocshArgBuf *args) { dbap(args[0].sval);}
|
||||
static void dbapCallFunc(const iocshArgBuf *args) { iocshSetError(dbap(args[0].sval));}
|
||||
|
||||
/* dbsr */
|
||||
static const iocshArg dbsrArg0 = { "interest level",iocshArgInt};
|
||||
@@ -150,7 +152,7 @@ static const iocshFuncDef dbcarFuncDef = {"dbcar",2,dbcarArgs,
|
||||
" 2 - Shows info. for all links.\n"};
|
||||
static void dbcarCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
dbcar(args[0].sval,args[1].ival);
|
||||
iocshSetError(dbcar(args[0].sval,args[1].ival));
|
||||
}
|
||||
|
||||
/* dbjlr */
|
||||
@@ -162,7 +164,7 @@ static const iocshFuncDef dbjlrFuncDef = {"dbjlr",2,dbjlrArgs,
|
||||
"List all JSON links in a record. If no record is specified, print for all\n"};
|
||||
static void dbjlrCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
dbjlr(args[0].sval,args[1].ival);
|
||||
iocshSetError(dbjlr(args[0].sval,args[1].ival));
|
||||
}
|
||||
|
||||
/* dbel */
|
||||
@@ -176,7 +178,7 @@ static const iocshFuncDef dbelFuncDef = {"dbel",2,dbelArgs,
|
||||
"Example: dbel aitest 2\n"};
|
||||
static void dbelCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
dbel(args[0].sval, args[1].ival);
|
||||
iocshSetError(dbel(args[0].sval, args[1].ival));
|
||||
}
|
||||
|
||||
/* dba */
|
||||
@@ -187,7 +189,7 @@ static const iocshFuncDef dbaFuncDef = {"dba",1,dbaArgs,
|
||||
"Print information in the dbAddr structure for a specific field.\n"
|
||||
"If no field is specified, VAL is assumed.\n\n"
|
||||
"Example: dba(\"aitest.HIGH\")\n"};
|
||||
static void dbaCallFunc(const iocshArgBuf *args) { dba(args[0].sval);}
|
||||
static void dbaCallFunc(const iocshArgBuf *args) { iocshSetError(dba(args[0].sval));}
|
||||
|
||||
/* dbl */
|
||||
static const iocshArg dblArg0 = { "record type",iocshArgString};
|
||||
@@ -204,7 +206,7 @@ static const iocshFuncDef dblFuncDef = {"dbl",2,dblArgs,
|
||||
" dbl(\"ai\",\"HIGH LOW VAL PREC\")\n"};
|
||||
static void dblCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
dbl(args[0].sval,args[1].sval);
|
||||
iocshSetError(dbl(args[0].sval,args[1].sval));
|
||||
}
|
||||
|
||||
/* dbnr */
|
||||
@@ -213,7 +215,7 @@ static const iocshArg * const dbnrArgs[1] = {&dbnrArg0};
|
||||
static const iocshFuncDef dbnrFuncDef = {"dbnr",1,dbnrArgs,
|
||||
"List number of records and aliases by type.\n"
|
||||
"If verbose, list all record types regardless of being instanced\n"};
|
||||
static void dbnrCallFunc(const iocshArgBuf *args) { dbnr(args[0].ival);}
|
||||
static void dbnrCallFunc(const iocshArgBuf *args) { iocshSetError(dbnr(args[0].ival));}
|
||||
|
||||
/* dbli */
|
||||
static const iocshArg dbliArg0 = { "pattern",iocshArgString};
|
||||
@@ -221,7 +223,7 @@ static const iocshArg * const dbliArgs[1] = {&dbliArg0};
|
||||
static const iocshFuncDef dbliFuncDef = {"dbli",1,dbliArgs,
|
||||
"List info() tags with names matching pattern.\n\n"
|
||||
"Example: dbli(\"autosave*\")\n"};
|
||||
static void dbliCallFunc(const iocshArgBuf *args) { dbli(args[0].sval);}
|
||||
static void dbliCallFunc(const iocshArgBuf *args) { iocshSetError(dbli(args[0].sval));}
|
||||
|
||||
/* dbla */
|
||||
static const iocshArg dblaArg0 = { "pattern",iocshArgStringRecord};
|
||||
@@ -229,7 +231,7 @@ static const iocshArg * const dblaArgs[1] = {&dblaArg0};
|
||||
static const iocshFuncDef dblaFuncDef = {"dbla",1,dblaArgs,
|
||||
"List record alias()s by alias name pattern.\n\n"
|
||||
"Example: dbla(\"alia*\")\n"};
|
||||
static void dblaCallFunc(const iocshArgBuf *args) { dbla(args[0].sval);}
|
||||
static void dblaCallFunc(const iocshArgBuf *args) { iocshSetError(dbla(args[0].sval));}
|
||||
|
||||
/* dbgrep */
|
||||
static const iocshArg dbgrepArg0 = { "pattern",iocshArgStringRecord};
|
||||
@@ -240,7 +242,7 @@ static const iocshFuncDef dbgrepFuncDef = {"dbgrep",1,dbgrepArgs,
|
||||
" - \"?\", which matches 0 or one characters.\n"
|
||||
" - \"*\", which matches 0 or more characters.\n\n"
|
||||
"Example: dbgrep(\"*gpibAi*\")\n"};
|
||||
static void dbgrepCallFunc(const iocshArgBuf *args) { dbgrep(args[0].sval);}
|
||||
static void dbgrepCallFunc(const iocshArgBuf *args) { iocshSetError(dbgrep(args[0].sval));}
|
||||
|
||||
/* dbgf */
|
||||
static const iocshArg dbgfArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -250,7 +252,7 @@ static const iocshFuncDef dbgfFuncDef = {"dbgf",1,dbgfArgs,
|
||||
"Print current value of record field.\n"
|
||||
"If no field name is specified, VAL is assumed.\n\n"
|
||||
"Example: dbgf(\"aitest.VAL\")\n"};
|
||||
static void dbgfCallFunc(const iocshArgBuf *args) { dbgf(args[0].sval);}
|
||||
static void dbgfCallFunc(const iocshArgBuf *args) { iocshSetError(dbgf(args[0].sval));}
|
||||
|
||||
/* dbpf */
|
||||
static const iocshArg dbpfArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -261,7 +263,7 @@ static const iocshFuncDef dbpfFuncDef = {"dbpf",2,dbpfArgs,
|
||||
"Change value of record field and read it back with dbgf.\n"
|
||||
"If no field is specified, VAL is assumed\n"};
|
||||
static void dbpfCallFunc(const iocshArgBuf *args)
|
||||
{ dbpf(args[0].sval,args[1].sval);}
|
||||
{ iocshSetError(dbpf(args[0].sval,args[1].sval));}
|
||||
|
||||
/* dbpr */
|
||||
static const iocshArg dbprArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -279,14 +281,14 @@ static const iocshFuncDef dbprFuncDef = {
|
||||
"Example: dbpr aitest 3\n"
|
||||
};
|
||||
static void dbprCallFunc(const iocshArgBuf *args)
|
||||
{ dbpr(args[0].sval,args[1].ival);}
|
||||
{ iocshSetError(dbpr(args[0].sval,args[1].ival));}
|
||||
|
||||
/* dbtr */
|
||||
static const iocshArg dbtrArg0 = { "record name",iocshArgStringRecord};
|
||||
static const iocshArg * const dbtrArgs[1] = {&dbtrArg0};
|
||||
static const iocshFuncDef dbtrFuncDef = {"dbtr",1,dbtrArgs,
|
||||
"Process record and then some fields.\n"};
|
||||
static void dbtrCallFunc(const iocshArgBuf *args) { dbtr(args[0].sval);}
|
||||
static void dbtrCallFunc(const iocshArgBuf *args) { iocshSetError(dbtr(args[0].sval));}
|
||||
|
||||
/* dbtgf */
|
||||
static const iocshArg dbtgfArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -296,7 +298,7 @@ static const iocshFuncDef dbtgfFuncDef = {"dbtgf",1,dbtgfArgs,
|
||||
"Get and print the specified field with all possible DBR_* types\n"
|
||||
"Example: dbtgf aitest\n"
|
||||
"Example: dbtgf aitest.VAL\n"};
|
||||
static void dbtgfCallFunc(const iocshArgBuf *args) { dbtgf(args[0].sval);}
|
||||
static void dbtgfCallFunc(const iocshArgBuf *args) { iocshSetError(dbtgf(args[0].sval));}
|
||||
|
||||
/* dbtpf */
|
||||
static const iocshArg dbtpfArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -308,7 +310,7 @@ static const iocshFuncDef dbtpfFuncDef = {"dbtpf",2,dbtpfArgs,
|
||||
"for all possible DBR_* types\n\n"
|
||||
"Example: dbtpf aitest 5.0\n"};
|
||||
static void dbtpfCallFunc(const iocshArgBuf *args)
|
||||
{ dbtpf(args[0].sval,args[1].sval);}
|
||||
{ iocshSetError(dbtpf(args[0].sval,args[1].sval));}
|
||||
|
||||
/* dbior */
|
||||
static const iocshArg dbiorArg0 = { "driver name",iocshArgString};
|
||||
@@ -317,7 +319,7 @@ static const iocshArg * const dbiorArgs[] = {&dbiorArg0,&dbiorArg1};
|
||||
static const iocshFuncDef dbiorFuncDef = {"dbior",2,dbiorArgs,
|
||||
"Driver Report.\n"};
|
||||
static void dbiorCallFunc(const iocshArgBuf *args)
|
||||
{ dbior(args[0].sval,args[1].ival);}
|
||||
{ iocshSetError(dbior(args[0].sval,args[1].ival));}
|
||||
|
||||
/* dbhcr */
|
||||
static const iocshFuncDef dbhcrFuncDef = {"dbhcr",0,0,
|
||||
@@ -327,7 +329,7 @@ static const iocshFuncDef dbhcrFuncDef = {"dbhcr",0,0,
|
||||
"Use the UNIX sort command:\n"
|
||||
"dbhcr > report\n"
|
||||
"sort report > report.sorted\n"};
|
||||
static void dbhcrCallFunc(const iocshArgBuf *args) { dbhcr();}
|
||||
static void dbhcrCallFunc(const iocshArgBuf *args) { iocshSetError(dbhcr());}
|
||||
|
||||
/* gft */
|
||||
static const iocshArg gftArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -336,7 +338,7 @@ static const iocshFuncDef gftFuncDef = {"gft",1,gftArgs,
|
||||
"Report dbChannel info and value.\n"
|
||||
"Example: gft aitest\n"
|
||||
"Example: gft aitest.VAL\n"};
|
||||
static void gftCallFunc(const iocshArgBuf *args) { gft(args[0].sval);}
|
||||
static void gftCallFunc(const iocshArgBuf *args) { iocshSetError(gft(args[0].sval));}
|
||||
|
||||
/* pft */
|
||||
static const iocshArg pftArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -346,7 +348,7 @@ static const iocshFuncDef pftFuncDef = {"pft",2,pftArgs,
|
||||
"dbChannel put value.\n"
|
||||
"Example: pft aitest 5.0\n"};
|
||||
static void pftCallFunc(const iocshArgBuf *args)
|
||||
{ pft(args[0].sval,args[1].sval);}
|
||||
{ iocshSetError(pft(args[0].sval,args[1].sval));}
|
||||
|
||||
/* dbtpn */
|
||||
static const iocshArg dbtpnArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -359,12 +361,12 @@ static const iocshFuncDef dbtpnFuncDef = {"dbtpn",2,dbtpnArgs,
|
||||
"Example: dbtpn aitest\n"
|
||||
"Example: dbtpn aitest 5.0\n"};
|
||||
static void dbtpnCallFunc(const iocshArgBuf *args)
|
||||
{ dbtpn(args[0].sval,args[1].sval);}
|
||||
{ iocshSetError(dbtpn(args[0].sval,args[1].sval));}
|
||||
|
||||
/* dbNotifyDump */
|
||||
static const iocshFuncDef dbNotifyDumpFuncDef = {"dbNotifyDump",0,0,
|
||||
"Report status of any active async processing with completion notification.\n"};
|
||||
static void dbNotifyDumpCallFunc(const iocshArgBuf *args) { dbNotifyDump();}
|
||||
static void dbNotifyDumpCallFunc(const iocshArgBuf *args) { iocshSetError(dbNotifyDump());}
|
||||
|
||||
/* dbPutAttribute */
|
||||
static const iocshArg dbPutAttrArg0 = { "record type",iocshArgString};
|
||||
@@ -375,7 +377,7 @@ static const iocshArg * const dbPutAttrArgs[] =
|
||||
static const iocshFuncDef dbPutAttrFuncDef = {"dbPutAttribute",3,dbPutAttrArgs,
|
||||
"Set/Create record attribute.\n"};
|
||||
static void dbPutAttrCallFunc(const iocshArgBuf *args)
|
||||
{ dbPutAttribute(args[0].sval,args[1].sval,args[2].sval);}
|
||||
{ iocshSetError(dbPutAttribute(args[0].sval,args[1].sval,args[2].sval));}
|
||||
|
||||
/* tpn */
|
||||
static const iocshArg tpnArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -385,7 +387,7 @@ static const iocshFuncDef tpnFuncDef = {"tpn",2,tpnArgs,
|
||||
"Test Process Notify.\n\n"
|
||||
"Example: tpn aitest 5.0\n"};
|
||||
static void tpnCallFunc(const iocshArgBuf *args)
|
||||
{ tpn(args[0].sval,args[1].sval);}
|
||||
{ iocshSetError(tpn(args[0].sval,args[1].sval));}
|
||||
|
||||
/* dblsr */
|
||||
static const iocshArg dblsrArg0 = { "record name",iocshArgStringRecord};
|
||||
@@ -399,7 +401,7 @@ static const iocshFuncDef dblsrFuncDef = {"dblsr",2,dblsrArgs,
|
||||
" 2 - Show each record and all database links in the lock set.\n\n"
|
||||
"Example: dblsr aitest 2\n"};
|
||||
static void dblsrCallFunc(const iocshArgBuf *args)
|
||||
{ dblsr(args[0].sval,args[1].ival);}
|
||||
{ iocshSetError(dblsr(args[0].sval,args[1].ival));}
|
||||
|
||||
/* dbLockShowLocked */
|
||||
static const iocshArg dbLockShowLockedArg0 = { "interest level",iocshArgInt};
|
||||
@@ -412,7 +414,7 @@ static const iocshFuncDef dbLockShowLockedFuncDef = {
|
||||
"Example: dbLockShowLocked 0\n"
|
||||
};
|
||||
static void dbLockShowLockedCallFunc(const iocshArgBuf *args)
|
||||
{ dbLockShowLocked(args[0].ival);}
|
||||
{ iocshSetError(dbLockShowLocked(args[0].ival));}
|
||||
|
||||
/* scanOnceSetQueueSize */
|
||||
static const iocshArg scanOnceSetQueueSizeArg0 = { "size",iocshArgInt};
|
||||
@@ -423,7 +425,7 @@ static const iocshFuncDef scanOnceSetQueueSizeFuncDef = {"scanOnceSetQueueSize",
|
||||
"Must be called before iocInit().\n"};
|
||||
static void scanOnceSetQueueSizeCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
scanOnceSetQueueSize(args[0].ival);
|
||||
iocshSetError(scanOnceSetQueueSize(args[0].ival));
|
||||
}
|
||||
|
||||
/* scanOnceQueueShow */
|
||||
@@ -444,7 +446,7 @@ static const iocshFuncDef scanpplFuncDef = {"scanppl",1,scanpplArgs,
|
||||
"Print info for records with periodic scan.\n"
|
||||
"If rate == 0.0, all periods are shown.\n"};
|
||||
static void scanpplCallFunc(const iocshArgBuf *args)
|
||||
{ scanppl(args[0].dval);}
|
||||
{ iocshSetError(scanppl(args[0].dval));}
|
||||
|
||||
/* scanpel */
|
||||
static const iocshArg scanpelArg0 = { "event name",iocshArgString};
|
||||
@@ -452,7 +454,7 @@ static const iocshArg * const scanpelArgs[1] = {&scanpelArg0};
|
||||
static const iocshFuncDef scanpelFuncDef = {"scanpel",1,scanpelArgs,
|
||||
"Print info for records with SCAN = \"Event\".\n"};
|
||||
static void scanpelCallFunc(const iocshArgBuf *args)
|
||||
{ scanpel(args[0].sval);}
|
||||
{ iocshSetError(scanpel(args[0].sval));}
|
||||
|
||||
/* postEvent */
|
||||
static const iocshArg postEventArg0 = { "event name",iocshArgString};
|
||||
@@ -468,7 +470,7 @@ static void postEventCallFunc(const iocshArgBuf *args)
|
||||
/* scanpiol */
|
||||
static const iocshFuncDef scanpiolFuncDef = {"scanpiol",0,0,
|
||||
"Print info for records with SCAN = \"I/O Intr\".\n"};
|
||||
static void scanpiolCallFunc(const iocshArgBuf *args) { scanpiol();}
|
||||
static void scanpiolCallFunc(const iocshArgBuf *args) { iocshSetError(scanpiol());}
|
||||
|
||||
/* callbackSetQueueSize */
|
||||
static const iocshArg callbackSetQueueSizeArg0 = { "bufsize",iocshArgInt};
|
||||
@@ -479,7 +481,7 @@ static const iocshFuncDef callbackSetQueueSizeFuncDef = {"callbackSetQueueSize",
|
||||
"Must be called before iocInit().\n"};
|
||||
static void callbackSetQueueSizeCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
callbackSetQueueSize(args[0].ival);
|
||||
iocshSetError(callbackSetQueueSize(args[0].ival));
|
||||
}
|
||||
|
||||
/* callbackQueueShow */
|
||||
@@ -504,7 +506,7 @@ static const iocshFuncDef callbackParallelThreadsFuncDef = {"callbackParallelThr
|
||||
"or one of LOW, MEDIUM, or HIGH.\n"};
|
||||
static void callbackParallelThreadsCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
callbackParallelThreads(args[0].ival, args[1].sval);
|
||||
iocshSetError(callbackParallelThreads(args[0].ival, args[1].sval));
|
||||
}
|
||||
|
||||
/* dbStateCreate */
|
||||
@@ -514,7 +516,8 @@ static const iocshFuncDef dbStateCreateFuncDef = {"dbStateCreate", 1, dbStateCre
|
||||
"Allocate new state name for \"state\" filter.\n"};
|
||||
static void dbStateCreateCallFunc (const iocshArgBuf *args)
|
||||
{
|
||||
dbStateCreate(args[0].sval);
|
||||
if (!dbStateCreate(args[0].sval))
|
||||
iocshSetError(-1);
|
||||
}
|
||||
|
||||
/* dbStateSet */
|
||||
@@ -527,6 +530,8 @@ static void dbStateSetCallFunc (const iocshArgBuf *args)
|
||||
|
||||
if (sid)
|
||||
dbStateSet(sid);
|
||||
else
|
||||
iocshSetError(-1);
|
||||
}
|
||||
|
||||
/* dbStateClear */
|
||||
@@ -539,6 +544,8 @@ static void dbStateClearCallFunc (const iocshArgBuf *args)
|
||||
|
||||
if (sid)
|
||||
dbStateClear(sid);
|
||||
else
|
||||
iocshSetError(-1);
|
||||
}
|
||||
|
||||
/* dbStateShow */
|
||||
@@ -552,6 +559,8 @@ static void dbStateShowCallFunc (const iocshArgBuf *args)
|
||||
|
||||
if (sid)
|
||||
dbStateShow(sid, args[1].ival);
|
||||
else
|
||||
iocshSetError(-1);
|
||||
}
|
||||
|
||||
/* dbStateShowAll */
|
||||
|
||||
@@ -391,6 +391,10 @@ typedef struct lset {
|
||||
#define dbGetSevr(link, sevr) \
|
||||
dbGetAlarm(link, NULL, sevr)
|
||||
|
||||
/** @brief Lookup link field name from pointer.
|
||||
* Returns only field name. aka. value of ``dbFldDes::name``
|
||||
* @since 3.16.2
|
||||
*/
|
||||
DBCORE_API const char * dbLinkFieldName(const struct link *plink);
|
||||
|
||||
DBCORE_API void dbInitLink(struct link *plink, short dbfType);
|
||||
|
||||
@@ -62,8 +62,28 @@ DBCORE_API void post_event(int event);
|
||||
DBCORE_API void scanAdd(struct dbCommon *);
|
||||
DBCORE_API void scanDelete(struct dbCommon *);
|
||||
DBCORE_API double scanPeriod(int scan);
|
||||
DBCORE_API int scanOnce(struct dbCommon *);
|
||||
DBCORE_API int scanOnceCallback(struct dbCommon *, once_complete cb, void *usr);
|
||||
/** Shorthand for scanOnceCallback(prec, NULL, NULL)
|
||||
*/
|
||||
DBCORE_API int scanOnce(struct dbCommon *prec);
|
||||
/** @brief scanOnce Request immediate record processing from another thread.
|
||||
*
|
||||
* Queue a request for record processing from the dedicated "Once" thread.
|
||||
* Request may fail if Once queue overflows. See scanOnceSetQueueSize()
|
||||
*
|
||||
* @param prec Record to process
|
||||
* @param cb Function called after target record dbProcess()
|
||||
* Does not wait for async record completion.
|
||||
* @param usr Argumentfor cb
|
||||
* @return Zero on success. Non-zero if the request could not be queued.
|
||||
*/
|
||||
DBCORE_API int scanOnceCallback(struct dbCommon *prec, once_complete cb, void *usr);
|
||||
/** @brief Set Once queue size
|
||||
*
|
||||
* Must be called prior to iocInit()
|
||||
*
|
||||
* @param size New size. May be smaller
|
||||
* @return Zero on success
|
||||
*/
|
||||
DBCORE_API int scanOnceSetQueueSize(int size);
|
||||
DBCORE_API int scanOnceQueueStatus(const int reset, scanOnceQueueStats *result);
|
||||
DBCORE_API void scanOnceQueueShow(const int reset);
|
||||
@@ -77,9 +97,39 @@ DBCORE_API int scanpel(const char *event_name);
|
||||
/*print io_event list*/
|
||||
DBCORE_API int scanpiol(void);
|
||||
|
||||
/** @brief Initialize "I/O Intr" source
|
||||
* @param ppios Pointer to scan list to be initialized
|
||||
*
|
||||
* Afterwards this IOSCANPVT may be assigned during a get_ioint_info() callback.
|
||||
* See typed_dset::get_ioint_info()
|
||||
*
|
||||
* @note There is currently no way to free this allocation.
|
||||
*/
|
||||
DBCORE_API void scanIoInit(IOSCANPVT *ppios);
|
||||
/** @brief Request processing of all associated records from callback threads
|
||||
* @param pios The scan list
|
||||
* @pre pios must be initialized by scanIoInit()
|
||||
* @return
|
||||
*/
|
||||
DBCORE_API unsigned int scanIoRequest(IOSCANPVT pios);
|
||||
/** @brief Process all records on the scan list for the specificed priority.
|
||||
*
|
||||
* Also executes the callback set by scanIoSetComplete()
|
||||
*
|
||||
* @param pios The scan list
|
||||
* @param prio one of priorityLow through priorityHigh (defined in callback.h).
|
||||
* A value between 0 and NUM_CALLBACK_PRIORITIES-1 .
|
||||
* @return Zero if the scan list was empty or 1<<prio
|
||||
* @since 3.16.0.1
|
||||
*/
|
||||
DBCORE_API unsigned int scanIoImmediate(IOSCANPVT pios, int prio);
|
||||
/** @brief Set scan list completion callback
|
||||
*
|
||||
* Replace the callback which will be invoked after record processing begins.
|
||||
* Asynchronous record processing may be ongoing.
|
||||
*
|
||||
* @since 3.15.0.2
|
||||
*/
|
||||
DBCORE_API void scanIoSetComplete(IOSCANPVT, io_scan_complete, void *usr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -127,6 +127,31 @@ int dbServerClient(char *pBuf, size_t bufSize)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int dbServerStats(const char *name, unsigned *channels, unsigned *clients)
|
||||
{
|
||||
dbServer *psrv = (dbServer *)ellFirst(&serverList);
|
||||
if (state != running || !psrv)
|
||||
return -1;
|
||||
|
||||
unsigned tch = 0, tcl = 0, nmatch = 0;
|
||||
for (; psrv; psrv = (dbServer *)ellNext(&psrv->node)) {
|
||||
if (psrv->stats &&
|
||||
(!name || strcmp(name, psrv->name) == 0)) {
|
||||
unsigned lch = 0, lcl = 0;
|
||||
|
||||
psrv->stats(&lch, &lcl);
|
||||
tch += lch;
|
||||
tcl += lcl;
|
||||
nmatch++;
|
||||
if (name)
|
||||
break; /* No duplicate names in serverList */
|
||||
}
|
||||
}
|
||||
if (channels) *channels = tch;
|
||||
if (clients) *clients = tcl;
|
||||
return nmatch;
|
||||
}
|
||||
|
||||
#define STARTSTOP(routine, method, newState) \
|
||||
void routine(void) \
|
||||
{ \
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
* the dbServer interface provides allow the IOC to start, pause and stop
|
||||
* the servers together, and to provide status and debugging information
|
||||
* to the IOC user/developer through a common set of commands.
|
||||
*
|
||||
* @todo No API is provided yet for calling stats() methods.
|
||||
* Nothing in the IOC calls dbStopServers(), not sure where it should go.
|
||||
*/
|
||||
|
||||
#ifndef INC_dbServer_H
|
||||
@@ -59,8 +56,8 @@ typedef struct dbServer {
|
||||
|
||||
/** @brief Get number of channels and clients currently connected.
|
||||
*
|
||||
* @param channels NULL or pointer for returning channel count.
|
||||
* @param clients NULL or pointer for returning client count.
|
||||
* @param channels @c NULL or pointer for returning channel count.
|
||||
* @param clients @c NULL or pointer for returning client count.
|
||||
*/
|
||||
void (* stats) (unsigned *channels, unsigned *clients);
|
||||
|
||||
@@ -145,6 +142,30 @@ DBCORE_API void dbsr(unsigned level);
|
||||
*/
|
||||
DBCORE_API int dbServerClient(char *pBuf, size_t bufSize);
|
||||
|
||||
/** @brief CPP Macro indicating the dbServerStats() routine exists.
|
||||
* @since UNRELEASED
|
||||
*/
|
||||
#define HAS_DBSERVER_STATS
|
||||
|
||||
/** @brief Fetch statistics from server layers.
|
||||
*
|
||||
* This is an API for iocStats and similar to fetch the number of channels
|
||||
* and clients connected to the registered server layers.
|
||||
* If the name given is NULL the statistics returned are the totals from
|
||||
* all registered server layers, otherwise just from the named server.
|
||||
* @param name Server name
|
||||
* @param channels NULL, or where to return the channel count
|
||||
* @param clients NULL or where to return the client count
|
||||
* @returns -1 if the IOC isn't running or no servers are registered, without
|
||||
* writing to the statistics variables. Otherwise it writes to the statistics
|
||||
* variables and returns the number of dbServer::stats() methods called,
|
||||
* 0 if a named server wasn't found or doesn't have a stats() method.
|
||||
*
|
||||
* @since UNRELEASED
|
||||
*/
|
||||
DBCORE_API int dbServerStats(const char *name, unsigned *channels,
|
||||
unsigned *clients);
|
||||
|
||||
/** @brief Initialize all registered servers.
|
||||
*
|
||||
* Calls all dbServer::init() methods.
|
||||
|
||||
@@ -202,7 +202,6 @@ void testdbGetFieldEqual(const char* pv, int dbrType, ...)
|
||||
void testdbVGetFieldEqual(const char* pv, short dbrType, va_list ap)
|
||||
{
|
||||
dbChannel *chan = dbChannelCreate(pv);
|
||||
db_field_log *pfl = NULL;
|
||||
long nReq = 1;
|
||||
union anybuf pod;
|
||||
long status = S_dbLib_recNotFound;
|
||||
@@ -212,18 +211,7 @@ void testdbVGetFieldEqual(const char* pv, short dbrType, va_list ap)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if(ellCount(&chan->filters)) {
|
||||
pfl = db_create_read_log(chan);
|
||||
if (!pfl) {
|
||||
testFail("can't db_create_read_log w/ %s", pv);
|
||||
goto done;
|
||||
}
|
||||
|
||||
pfl = dbChannelRunPreChain(chan, pfl);
|
||||
pfl = dbChannelRunPostChain(chan, pfl);
|
||||
}
|
||||
|
||||
status = dbChannelGetField(chan, dbrType, pod.bytes, NULL, &nReq, pfl);
|
||||
status = dbChannelGetField(chan, dbrType, pod.bytes, NULL, &nReq, NULL);
|
||||
if (status) {
|
||||
testFail("dbGetField(\"%s\", %d, ...) -> %#lx (%s)", pv, dbrType, status, errSymMsg(status));
|
||||
goto done;
|
||||
@@ -261,7 +249,6 @@ void testdbVGetFieldEqual(const char* pv, short dbrType, va_list ap)
|
||||
}
|
||||
|
||||
done:
|
||||
db_delete_field_log(pfl);
|
||||
if(chan)
|
||||
dbChannelDelete(chan);
|
||||
}
|
||||
@@ -288,7 +275,6 @@ done:
|
||||
void testdbGetArrFieldEqual(const char* pv, short dbfType, long nRequest, unsigned long cnt, const void *pbufraw)
|
||||
{
|
||||
dbChannel *chan = dbChannelCreate(pv);
|
||||
db_field_log *pfl = NULL;
|
||||
const long vSize = dbValueSize(dbfType);
|
||||
const long nStore = vSize * nRequest;
|
||||
long status = S_dbLib_recNotFound;
|
||||
@@ -300,24 +286,13 @@ void testdbGetArrFieldEqual(const char* pv, short dbfType, long nRequest, unsign
|
||||
goto done;
|
||||
}
|
||||
|
||||
if(ellCount(&chan->filters)) {
|
||||
pfl = db_create_read_log(chan);
|
||||
if (!pfl) {
|
||||
testFail("can't db_create_read_log w/ %s", pv);
|
||||
goto done;
|
||||
}
|
||||
|
||||
pfl = dbChannelRunPreChain(chan, pfl);
|
||||
pfl = dbChannelRunPostChain(chan, pfl);
|
||||
}
|
||||
|
||||
gbuf = gstore = malloc(nStore);
|
||||
if(!gbuf && nStore!=0) { /* note that malloc(0) is allowed to return NULL on success */
|
||||
testFail("Allocation failed esize=%ld total=%ld", vSize, nStore);
|
||||
return;
|
||||
}
|
||||
|
||||
status = dbChannelGetField(chan, dbfType, gbuf, NULL, &nRequest, pfl);
|
||||
status = dbChannelGetField(chan, dbfType, gbuf, NULL, &nRequest, NULL);
|
||||
if (status) {
|
||||
testFail("dbGetField(\"%s\", %d, ...) -> %#lx", pv, dbfType, status);
|
||||
|
||||
|
||||
@@ -148,6 +148,7 @@ int dbChannel_get_count(
|
||||
long options;
|
||||
long i;
|
||||
long zero = 0;
|
||||
unsigned char local_fl = 0;
|
||||
|
||||
/* The order of the DBR* elements in the "newSt" structures below is
|
||||
* very important and must correspond to the order of processing
|
||||
@@ -156,6 +157,16 @@ int dbChannel_get_count(
|
||||
|
||||
dbScanLock(dbChannelRecord(chan));
|
||||
|
||||
/* If filters are involved in a read, create field log and run filters */
|
||||
if (!pfl && (ellCount(&chan->pre_chain) || ellCount(&chan->post_chain))) {
|
||||
pfl = db_create_read_log(chan);
|
||||
if (pfl) {
|
||||
local_fl = 1;
|
||||
pfl = dbChannelRunPreChain(chan, pfl);
|
||||
pfl = dbChannelRunPostChain(chan, pfl);
|
||||
}
|
||||
}
|
||||
|
||||
switch(buffer_type) {
|
||||
case(oldDBR_STRING):
|
||||
status = dbChannelGet(chan, DBR_STRING, pbuffer, &zero, nRequest, pfl);
|
||||
@@ -800,6 +811,8 @@ int dbChannel_get_count(
|
||||
|
||||
dbScanUnlock(dbChannelRecord(chan));
|
||||
|
||||
if (local_fl) db_delete_field_log(pfl);
|
||||
|
||||
if (status) return -1;
|
||||
return 0;
|
||||
}
|
||||
@@ -1029,3 +1042,17 @@ int db_put_process(processNotify *ppn, notifyPutType type,
|
||||
ppn->status = notifyError;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void db_process(struct dbCommon *prec)
|
||||
{
|
||||
if (prec->pact) {
|
||||
if (dbAccessDebugPUTF && prec->tpro)
|
||||
printf("%s: dbPutField to Active '%s', setting RPRO=1\n",
|
||||
epicsThreadGetNameSelf(), prec->name);
|
||||
prec->rpro = TRUE;
|
||||
} else {
|
||||
/* indicate that dbPutField called dbProcess */
|
||||
prec->putf = TRUE;
|
||||
(void)dbProcess(prec);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ extern "C" {
|
||||
|
||||
#include "dbCoreAPI.h"
|
||||
|
||||
struct dbCommon;
|
||||
|
||||
DBCORE_API extern struct dbBase *pdbbase;
|
||||
DBCORE_API extern volatile int interruptAccept;
|
||||
|
||||
@@ -36,7 +38,9 @@ DBCORE_API int dbChannel_put(struct dbChannel *chan, int src_type,
|
||||
const void *psrc, long no_elements);
|
||||
DBCORE_API int dbChannel_get_count(struct dbChannel *chan,
|
||||
int buffer_type, void *pbuffer, long *nRequest, void *pfl);
|
||||
|
||||
#ifdef EPICS_DBCA_PRIVATE_API
|
||||
DBCORE_API void db_process(struct dbCommon *prec);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -17,7 +17,8 @@ C<MAYBE> or C<NO WAY> would not be accepted as choices for the field.
|
||||
Also, the choices C<yes>, C<No>, and C<Yes> are not valid choices since they
|
||||
don't match the case of C<NO> or C<YES>.
|
||||
The integer values C<0> and C<1> may often be used instead however, they are
|
||||
used as an index into the choices so C<0> becomes C<NO> and C<1> becomes <YES>.
|
||||
used as an index into the choices so C<0> becomes C<NO> and C<1> becomes
|
||||
C<YES>.
|
||||
|
||||
=menu menuYesNo
|
||||
|
||||
|
||||
@@ -190,6 +190,7 @@ unsigned short recGblResetAlarms(void *precord)
|
||||
|
||||
if(strcmp(pdbc->namsg, pdbc->amsg)!=0) {
|
||||
strcpy(pdbc->amsg, pdbc->namsg);
|
||||
pdbc->namsg[0] = '\0';
|
||||
stat_mask = DBE_ALARM;
|
||||
}
|
||||
|
||||
@@ -259,8 +260,8 @@ int recGblSetSevr(void *precord, epicsEnum16 new_stat, epicsEnum16 new_sevr)
|
||||
return recGblSetSevrMsg(precord, new_stat, new_sevr, NULL);
|
||||
}
|
||||
|
||||
void recGblInheritSevr(int msMode, void *precord, epicsEnum16 stat,
|
||||
epicsEnum16 sevr)
|
||||
void recGblInheritSevrMsg(int msMode, void *precord, epicsEnum16 stat,
|
||||
epicsEnum16 sevr, const char *msg)
|
||||
{
|
||||
switch (msMode) {
|
||||
case pvlOptNMS:
|
||||
@@ -273,11 +274,17 @@ void recGblInheritSevr(int msMode, void *precord, epicsEnum16 stat,
|
||||
recGblSetSevr(precord, LINK_ALARM, sevr);
|
||||
break;
|
||||
case pvlOptMSS:
|
||||
recGblSetSevr(precord, stat, sevr);
|
||||
/* Only MSS inherits msg */
|
||||
recGblSetSevrMsg(precord, stat, sevr, "%s", msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void recGblInheritSevr(int msMode, void *precord, epicsEnum16 stat,
|
||||
epicsEnum16 sevr)
|
||||
{
|
||||
recGblInheritSevrMsg(msMode, precord, stat, sevr, NULL);
|
||||
}
|
||||
|
||||
void recGblFwdLink(void *precord)
|
||||
{
|
||||
|
||||
@@ -73,6 +73,8 @@ DBCORE_API int recGblSetSevr(void *precord, epicsEnum16 new_stat,
|
||||
epicsEnum16 new_sevr);
|
||||
DBCORE_API void recGblInheritSevr(int msMode, void *precord, epicsEnum16 stat,
|
||||
epicsEnum16 sevr);
|
||||
DBCORE_API void recGblInheritSevrMsg(int msMode, void *precord, epicsEnum16 stat,
|
||||
epicsEnum16 sevr, const char *msg);
|
||||
DBCORE_API int recGblSetSevrMsg(void *precord, epicsEnum16 new_stat,
|
||||
epicsEnum16 new_sevr,
|
||||
EPICS_PRINTF_FMT(const char *msg), ...) EPICS_PRINTF_STYLE(4,5);
|
||||
|
||||
@@ -1263,24 +1263,50 @@ static void dbRecordInfo(char *name, char *value)
|
||||
}
|
||||
}
|
||||
|
||||
static long createAlias(DBENTRY *pdbentry, const char *alias)
|
||||
{
|
||||
DBENTRY tempEntry;
|
||||
long status;
|
||||
dbRecordNode *precnode = pdbentry->precnode;
|
||||
|
||||
if (precnode->aliasedRecnode) precnode = precnode->aliasedRecnode;
|
||||
dbInitEntry(pdbentry->pdbbase, &tempEntry);
|
||||
status = dbFindRecord(&tempEntry, alias);
|
||||
if (status == 0) {
|
||||
if (tempEntry.precnode->aliasedRecnode != precnode) {
|
||||
if (tempEntry.precnode->aliasedRecnode)
|
||||
fprintf(stderr, ERL_ERROR ": Alias \"%s\" for \"%s\": name already used by an alias for \"%s\"\n",
|
||||
alias, dbGetRecordName(pdbentry),
|
||||
tempEntry.precnode->aliasedRecnode->recordname);
|
||||
else
|
||||
fprintf(stderr, ERL_ERROR ": Alias \"%s\" for \"%s\": name already used by a record\n",
|
||||
alias, dbGetRecordName(pdbentry));
|
||||
status = S_dbLib_recExists;
|
||||
} else if (dbRecordsOnceOnly) {
|
||||
fprintf(stderr, ERL_ERROR ": Alias \"%s\" already defined and dbRecordsOnceOnly set.\n",
|
||||
alias);
|
||||
status = S_dbLib_recExists;
|
||||
}
|
||||
} else {
|
||||
status = dbCreateAlias(pdbentry, alias);
|
||||
}
|
||||
dbFinishEntry(&tempEntry);
|
||||
return status;
|
||||
}
|
||||
|
||||
static void dbRecordAlias(char *name)
|
||||
{
|
||||
DBENTRY *pdbentry;
|
||||
tempListNode *ptempListNode;
|
||||
long status;
|
||||
|
||||
if(dbRecordNameValidate(name))
|
||||
return;
|
||||
|
||||
if (duplicate) return;
|
||||
ptempListNode = (tempListNode *)ellFirst(&tempList);
|
||||
pdbentry = ptempListNode->item;
|
||||
status = dbCreateAlias(pdbentry, name);
|
||||
if (status) {
|
||||
fprintf(stderr, "Can't create alias \"%s\" for \"%s\"\n",
|
||||
name, dbGetRecordName(pdbentry));
|
||||
|
||||
if (createAlias(pdbentry, name) != 0) {
|
||||
yyerror(NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1298,9 +1324,7 @@ static void dbAlias(char *name, char *alias)
|
||||
alias, name);
|
||||
yyerror(NULL);
|
||||
}
|
||||
else if (dbCreateAlias(pdbEntry, alias)) {
|
||||
fprintf(stderr, "Can't create alias \"%s\" referring to \"%s\"\n",
|
||||
alias, name);
|
||||
else if (createAlias(pdbEntry, alias) != 0) {
|
||||
yyerror(NULL);
|
||||
}
|
||||
dbFinishEntry(pdbEntry);
|
||||
|
||||
@@ -207,7 +207,7 @@ static const iocshFuncDef dbPvdTableSizeFuncDef = {
|
||||
};
|
||||
static void dbPvdTableSizeCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
dbPvdTableSize(args[0].ival);
|
||||
iocshSetError(dbPvdTableSize(args[0].ival));
|
||||
}
|
||||
|
||||
/* dbReportDeviceConfig */
|
||||
|
||||
@@ -72,6 +72,7 @@ DBCORE_API extern const maplinkType pamaplinkType[LINK_NTYPES];
|
||||
/* DBLINK Flag bits */
|
||||
#define DBLINK_FLAG_INITIALIZED 1 /* dbInitLink() called */
|
||||
#define DBLINK_FLAG_TSELisTIME 2 /* Use TSEL to get timeStamp */
|
||||
#define DBLINK_FLAG_VISITED 4 /* Used in loop detection */
|
||||
|
||||
struct macro_link {
|
||||
char *macroStr;
|
||||
|
||||
@@ -14,7 +14,8 @@ SRC_DIRS += $(IOCDIR)/dbtemplate
|
||||
PROD_HOST += msi
|
||||
|
||||
msi_SRCS = msi.cpp
|
||||
HTMLS += msi.html
|
||||
msi_SYS_LIBS_WIN32 = shlwapi
|
||||
DOCS += msi.md
|
||||
|
||||
INC += dbLoadTemplate.h
|
||||
INC += dbtoolsIocRegister.h
|
||||
|
||||
@@ -41,6 +41,17 @@ static int var_count, sub_count;
|
||||
int dbTemplateMaxVars = 100;
|
||||
epicsExportAddress(int, dbTemplateMaxVars);
|
||||
|
||||
static
|
||||
int msiLoadRecords(const char *fname, const char *subs)
|
||||
{
|
||||
int ret = dbLoadRecords(fname, subs);
|
||||
if(ret) {
|
||||
fprintf(stderr, "dbLoadRecords(\"%s\", %s)\n", fname, subs);
|
||||
yyerror("Error while reading included file");
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%start substitution_file
|
||||
@@ -167,7 +178,7 @@ pattern_definition: global_definitions
|
||||
fprintf(stderr, "pattern_definition: pattern_values empty\n");
|
||||
fprintf(stderr, " dbLoadRecords(%s)\n", sub_collect+1);
|
||||
#endif
|
||||
dbLoadRecords(db_file_name, sub_collect+1);
|
||||
if(msiLoadRecords(db_file_name, sub_collect+1)) YYABORT;
|
||||
}
|
||||
| O_BRACE pattern_values C_BRACE
|
||||
{
|
||||
@@ -175,7 +186,7 @@ pattern_definition: global_definitions
|
||||
fprintf(stderr, "pattern_definition:\n");
|
||||
fprintf(stderr, " dbLoadRecords(%s)\n", sub_collect+1);
|
||||
#endif
|
||||
dbLoadRecords(db_file_name, sub_collect+1);
|
||||
if(msiLoadRecords(db_file_name, sub_collect+1)) YYABORT;
|
||||
*sub_locals = '\0';
|
||||
sub_count = 0;
|
||||
}
|
||||
@@ -190,7 +201,7 @@ pattern_definition: global_definitions
|
||||
fprintf(stderr, "pattern_definition:\n");
|
||||
fprintf(stderr, " dbLoadRecords(%s)\n", sub_collect+1);
|
||||
#endif
|
||||
dbLoadRecords(db_file_name, sub_collect+1);
|
||||
if(msiLoadRecords(db_file_name, sub_collect+1)) YYABORT;
|
||||
dbmfFree($1);
|
||||
*sub_locals = '\0';
|
||||
sub_count = 0;
|
||||
@@ -250,7 +261,7 @@ variable_substitution: global_definitions
|
||||
fprintf(stderr, "variable_substitution: variable_definitions empty\n");
|
||||
fprintf(stderr, " dbLoadRecords(%s)\n", sub_collect+1);
|
||||
#endif
|
||||
dbLoadRecords(db_file_name, sub_collect+1);
|
||||
if(msiLoadRecords(db_file_name, sub_collect+1)) YYABORT;
|
||||
}
|
||||
| O_BRACE variable_definitions C_BRACE
|
||||
{
|
||||
@@ -258,7 +269,7 @@ variable_substitution: global_definitions
|
||||
fprintf(stderr, "variable_substitution:\n");
|
||||
fprintf(stderr, " dbLoadRecords(%s)\n", sub_collect+1);
|
||||
#endif
|
||||
dbLoadRecords(db_file_name, sub_collect+1);
|
||||
if(msiLoadRecords(db_file_name, sub_collect+1)) YYABORT;
|
||||
*sub_locals = '\0';
|
||||
}
|
||||
| WORD O_BRACE variable_definitions C_BRACE
|
||||
@@ -272,7 +283,7 @@ variable_substitution: global_definitions
|
||||
fprintf(stderr, "variable_substitution:\n");
|
||||
fprintf(stderr, " dbLoadRecords(%s)\n", sub_collect+1);
|
||||
#endif
|
||||
dbLoadRecords(db_file_name, sub_collect+1);
|
||||
if(msiLoadRecords(db_file_name, sub_collect+1)) YYABORT;
|
||||
dbmfFree($1);
|
||||
*sub_locals = '\0';
|
||||
}
|
||||
@@ -328,6 +339,7 @@ int dbLoadTemplate(const char *sub_file, const char *cmd_collect)
|
||||
{
|
||||
FILE *fp;
|
||||
int i;
|
||||
int err;
|
||||
|
||||
line_num = 1;
|
||||
|
||||
@@ -377,7 +389,7 @@ int dbLoadTemplate(const char *sub_file, const char *cmd_collect)
|
||||
yyrestart(fp);
|
||||
}
|
||||
|
||||
yyparse();
|
||||
err = yyparse();
|
||||
|
||||
for (i = 0; i < var_count; i++) {
|
||||
dbmfFree(vars[i]);
|
||||
@@ -390,5 +402,5 @@ int dbLoadTemplate(const char *sub_file, const char *cmd_collect)
|
||||
dbmfFree(db_file_name);
|
||||
db_file_name = NULL;
|
||||
}
|
||||
return 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,10 @@
|
||||
#include <osiFileName.h>
|
||||
#include <osiUnistd.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <shlwapi.h>
|
||||
#endif
|
||||
|
||||
#define MAX_BUFFER_SIZE 4096
|
||||
#define MAX_DEPS 1024
|
||||
|
||||
@@ -61,7 +65,7 @@ typedef struct inputData inputData;
|
||||
static void inputConstruct(inputData **ppvt);
|
||||
static void inputDestruct(inputData * const pvt);
|
||||
static void inputAddPath(inputData * const pvt, const char * const pval);
|
||||
static void inputBegin(inputData * const pvt, const char * const fileName);
|
||||
static void inputBegin(inputData * const pvt, const char * const fileName, bool fromCmdLine);
|
||||
static char *inputNextLine(inputData * const pvt);
|
||||
static void inputNewIncludeFile(inputData * const pvt, const char * const name);
|
||||
static void inputErrPrint(const inputData * const pvt);
|
||||
@@ -83,7 +87,8 @@ static void addMacroReplacements(MAC_HANDLE * const macPvt,
|
||||
const char * const pval);
|
||||
static void makeSubstitutions(inputData * const inputPvt,
|
||||
MAC_HANDLE * const macPvt,
|
||||
const char * const templateName);
|
||||
const char * const templateName,
|
||||
bool fromCmdLine);
|
||||
|
||||
/*Global variables */
|
||||
static int opt_V = 0;
|
||||
@@ -171,7 +176,7 @@ int main(int argc,char **argv)
|
||||
|
||||
if (substitutionName.empty()) {
|
||||
STEP("Single template+substitutions file");
|
||||
makeSubstitutions(inputPvt, macPvt, templateName);
|
||||
makeSubstitutions(inputPvt, macPvt, templateName, true);
|
||||
}
|
||||
else {
|
||||
subInfo *substitutePvt;
|
||||
@@ -203,7 +208,7 @@ int main(int argc,char **argv)
|
||||
macPushScope(macPvt);
|
||||
|
||||
addMacroReplacements(macPvt, macStr);
|
||||
makeSubstitutions(inputPvt, macPvt, filename);
|
||||
makeSubstitutions(inputPvt, macPvt, filename, false);
|
||||
|
||||
if (localScope)
|
||||
macPopScope(macPvt);
|
||||
@@ -276,14 +281,15 @@ static const char *cmdNames[] = {"include","substitute"};
|
||||
|
||||
static void makeSubstitutions(inputData * const inputPvt,
|
||||
MAC_HANDLE * const macPvt,
|
||||
const char * const templateName)
|
||||
const char * const templateName,
|
||||
bool fromCmdLine)
|
||||
{
|
||||
char *input;
|
||||
static char buffer[MAX_BUFFER_SIZE];
|
||||
int n;
|
||||
|
||||
ENTER;
|
||||
inputBegin(inputPvt, templateName);
|
||||
inputBegin(inputPvt, templateName, fromCmdLine);
|
||||
while ((input = inputNextLine(inputPvt))) {
|
||||
int expand=1;
|
||||
char *p;
|
||||
@@ -378,7 +384,7 @@ struct inputData {
|
||||
inputData() { memset(inputBuffer, 0, sizeof(inputBuffer) * sizeof(inputBuffer[0])); };
|
||||
};
|
||||
|
||||
static void inputOpenFile(inputData *pinputData, const char * const filename);
|
||||
static void inputOpenFile(inputData *pinputData, const char * const filename, bool fromCmdLine);
|
||||
static void inputCloseFile(inputData *pinputData);
|
||||
static void inputCloseAllFiles(inputData *pinputData);
|
||||
|
||||
@@ -431,11 +437,11 @@ static void inputAddPath(inputData * const pinputData, const char * const path)
|
||||
EXIT;
|
||||
}
|
||||
|
||||
static void inputBegin(inputData * const pinputData, const char * const fileName)
|
||||
static void inputBegin(inputData * const pinputData, const char * const fileName, bool fromCmdLine)
|
||||
{
|
||||
ENTER;
|
||||
inputCloseAllFiles(pinputData);
|
||||
inputOpenFile(pinputData, fileName);
|
||||
inputOpenFile(pinputData, fileName, fromCmdLine);
|
||||
EXIT;
|
||||
}
|
||||
|
||||
@@ -462,7 +468,7 @@ static void inputNewIncludeFile(inputData * const pinputData,
|
||||
const char * const name)
|
||||
{
|
||||
ENTER;
|
||||
inputOpenFile(pinputData,name);
|
||||
inputOpenFile(pinputData, name, false);
|
||||
EXIT;
|
||||
}
|
||||
|
||||
@@ -493,7 +499,15 @@ static void inputErrPrint(const inputData *const pinputData)
|
||||
EXIT;
|
||||
}
|
||||
|
||||
static void inputOpenFile(inputData *pinputData, const char * const filename)
|
||||
static int isPathRelative(const char * const path) {
|
||||
#ifdef _WIN32
|
||||
return path && PathIsRelativeA(path);
|
||||
#else
|
||||
return path && path[0] != '/';
|
||||
#endif
|
||||
}
|
||||
|
||||
static void inputOpenFile(inputData *pinputData, const char * const filename, bool fromCmdLine)
|
||||
{
|
||||
std::list<std::string>& pathList = pinputData->pathList;
|
||||
std::list<std::string>::iterator pathIt = pathList.end();
|
||||
@@ -505,7 +519,7 @@ static void inputOpenFile(inputData *pinputData, const char * const filename)
|
||||
STEP("Using stdin");
|
||||
fp = stdin;
|
||||
}
|
||||
else if (pathList.empty() || strchr(filename, '/')){
|
||||
else if (fromCmdLine || pathList.empty() || !isPathRelative(filename)){
|
||||
STEPS("Opening ", filename);
|
||||
fp = fopen(filename, "r");
|
||||
}
|
||||
|
||||
@@ -1,445 +0,0 @@
|
||||
<!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1>msi: Macro Substitution and Include Tool</h1>
|
||||
|
||||
<h2>Introduction</h2>
|
||||
|
||||
<p>msi is a general purpose macro substitution/include tool. It accepts as input
|
||||
an ascii template file. It looks for lines containing two reserved command
|
||||
names: <tt>include</tt> and <tt>substitute</tt>. It also looks for and performs
|
||||
substitutions on macros of the form $(var) and ${var}. It uses the macLib
|
||||
routines from EPICS Base to perform the substitutions, so it also accepts the
|
||||
default value and value definition syntax that macLib implements.</p>
|
||||
|
||||
<p>msi also allows substitutions to be specified via a separate substitution
|
||||
file. This substitution file allows the same format as the substitution files
|
||||
accepted by the EPICS IOC's dbLoadTemplate command.</p>
|
||||
|
||||
<h2>Command Syntax:</h2>
|
||||
|
||||
<pre>msi -V -g -D -o<i>outfile</i> -I<i>dir</i> -M<i>subs</i> -S<i>subfile</i> <i>template</i></pre>
|
||||
|
||||
<p>All parameters are optional. The -o, -I, -M, and -S switches may be
|
||||
separated from their associated value string by spaces if desired. Output will
|
||||
be written to stdout unless the -o option is given.</p>
|
||||
|
||||
<p>Switches have the following meanings:</p>
|
||||
|
||||
<dl>
|
||||
<dt><tt>-V</tt></dt>
|
||||
<dd>Verbose warnings; if this parameter is specified then any undefined or
|
||||
recursive macros discovered in the template will be considered an error and
|
||||
will be marked in the output file. An error message will be shown, and when
|
||||
msi terminates it will do so with an exit status of 2.</dd>
|
||||
|
||||
<dt><tt>-g</tt></dt>
|
||||
<dd>When this flag is given all macros defined in a substitution file will
|
||||
have global scope and thus their values will persist until a new value is
|
||||
given for this macro. This flag is provided for backwards compatibility as
|
||||
this was the behavior of previous versions of msi, but it does not follow
|
||||
common scoping rules and is discouraged.</dd>
|
||||
|
||||
<dt><tt>-D</tt></dt>
|
||||
<dd>Output dependency information suitable for including by a Makefile to
|
||||
stdout instead of performing the macro substitutions. The <tt>-o</tt> option
|
||||
must be given to specify the target name for the dependency rules. Other
|
||||
options should be given exactly as will be used in the macro substitution
|
||||
process.</dd>
|
||||
|
||||
<dt><tt>-o</tt> <i>file</i></dt>
|
||||
<dd>Output will be written to the specifed file rather than to the standard
|
||||
output.</dd>
|
||||
|
||||
<dt><tt>-I</tt> <i>dir</i></dt>
|
||||
<dd>This parameter, which may be repeated or contain a colon-separated (or
|
||||
semi-colon separated on Windows) list of directory paths, specifies a search
|
||||
path for include commands. For example:
|
||||
|
||||
<blockquote>
|
||||
<pre>msi -I /home/mrk/examples:. -I.. template</pre>
|
||||
</blockquote>
|
||||
|
||||
specifies that all named files should be searched for in the following
|
||||
locations in the order given:
|
||||
|
||||
<ol>
|
||||
<li><tt>/home/mrk/examples</tt></li>
|
||||
<li><tt>.</tt> (the current directory)</li>
|
||||
<li><tt>..</tt> (the parent of the current directory)</li>
|
||||
</ol>
|
||||
</dd>
|
||||
|
||||
<dt><tt>-M</tt> <i>substitutions</i></dt>
|
||||
<dd>This parameter specifies macro values for the template instance.
|
||||
Multiple macro values can be specified in one substitution parameter, or in
|
||||
multiple <tt>-M</tt> parameters. For example:
|
||||
|
||||
<blockquote>
|
||||
<pre>msi -M "a=aval,b=bval" -Mc=cval template</pre>
|
||||
</blockquote>
|
||||
|
||||
specifies that in the template file each occurrence of:
|
||||
|
||||
<dl>
|
||||
<dd><tt>$(a)</tt> or <tt>${a}</tt> is replaced by <tt>aval</tt></dd>
|
||||
<dd><tt>$(b)</tt> or <tt>${b}</tt> is replaced by <tt>bval</tt></dd>
|
||||
<dd><tt>$(c)</tt> or <tt>${c}</tt> is replaced by <tt>cval</tt></dd>
|
||||
</dl>
|
||||
</dd>
|
||||
|
||||
<dt><tt>-S</tt> <i>subfile</i></dt>
|
||||
<dd>The substitution file. See below for format.</dd>
|
||||
|
||||
<dt><i>template</i></dt>
|
||||
<dd> The input file. If no file is specified then input is taken from
|
||||
stdin, i.e. msi can be used as a filter. See below for a description of
|
||||
commands that can be embedded in the template file.</dd>
|
||||
</dl>
|
||||
|
||||
<p>It is not possible to display usage by just typing <tt>msi</tt> since
|
||||
executing the command with no arguments is a valid command. To show usage
|
||||
specify an illegal switch, e.g.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>msi -help</pre>
|
||||
</blockquote>
|
||||
|
||||
<h2>Exit Status</h2>
|
||||
|
||||
<dl>
|
||||
<dt>0<dd>Success.
|
||||
<dt>1<dd>Can't open/create file, or other I/O error.
|
||||
<dt>2<dd>Undefined macros encountered with the <tt>-V</tt> option specified.
|
||||
</dl>
|
||||
|
||||
<h2>Template File Format</h2>
|
||||
|
||||
<p>This file contains the text to be read and written to the output after macro
|
||||
substitution is performed. If no file is given then input is read from stdin.
|
||||
Variable instances to be substituted by macro values are expressed in the
|
||||
template using the syntax <tt>$(</tt><i>name</i><tt>)</tt> or
|
||||
<tt>${</tt><i>name</i><tt>}</tt>. The template can also provide default values
|
||||
to be used when a macro has not been given a value, using the syntax
|
||||
<tt>$(</tt><i>name</i><tt>=</tt><i>default</i><tt>)</tt> or
|
||||
<tt>${</tt><i>name</i><tt>=</tt><i>default</i><tt>}</tt>.</p>
|
||||
|
||||
<p>For example, using the command</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>msi -M name=Marty template</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>where the file template contains</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>My name is $(name)
|
||||
My age is $(age=none of your business)</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>results in this output:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>My name is Marty
|
||||
My age is none of your business</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>Macro variables and their default values can be expressed in terms of other
|
||||
macros if necessary, to almost any level of complexity. Recursive definitions
|
||||
will generate warning messages on stderr and result in undefined output.</p>
|
||||
|
||||
<p>The template file is read and processed one line at a time, where the
|
||||
maximum length of a line before and/or after macro expansion is 1023 characters
|
||||
— longer input or output lines will cause msi to fail. Within the context
|
||||
of a single line, macro expansion does not occur when the variable instance
|
||||
appears inside a single-quoted string, or where the dollar sign <tt>$</tt> is
|
||||
preceded by a back-slash character <tt>\</tt>, but as with the standard Unix
|
||||
shells, variables inside double quoted strings are expanded properly.</p>
|
||||
|
||||
<p>However neither back-slash characters nor quotes of either variety are
|
||||
removed when generating the output file, so depending on what is being output
|
||||
the single quote behaviour may not be useful and may even be a hinderance. It
|
||||
cannot be disabled in the current version of msi.</p>
|
||||
|
||||
<h3>Template file commands</h3>
|
||||
|
||||
<p>In addition to the regular text and variable instances described above, the
|
||||
template file may also contain commands which allow the insertion of other
|
||||
template files and the ability to set macro values inside the template file
|
||||
itself. These commands are:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>include "file"
|
||||
substitute "var=value,var=value,..."</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>Lines containing commands must be in one of these forms:</p>
|
||||
|
||||
<ul>
|
||||
<li><tt>include "</tt><i>filename</i><tt>"</tt></li>
|
||||
<li><tt>substitute "</tt><i>name1=value1, name2=value2, ...</i><tt>"</tt></li>
|
||||
</ul>
|
||||
|
||||
<p>White space is allowed before and after the command verb, and after the
|
||||
quoted string. If embedded quotes are needed, the backslash character
|
||||
<tt>\</tt> can be used as an escape character. For example</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>substitute "a=\"val\""</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>specifies that (unless <tt>a</tt> is subsequently redefined) wherever a
|
||||
<tt>$(a)</tt> macro appears in the template below this point, the text
|
||||
<tt>"val"</tt> (including the double quote characters) will appear in the
|
||||
output instead.</p>
|
||||
|
||||
<p>If a line does match either syntax above it is just passed to macLib for
|
||||
processing without any notification. Thus the input line:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>include "myfile" #include file</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>would just be passed to macLib, i.e. it would <em>not</em> be considered an
|
||||
include command.</p>
|
||||
|
||||
<p>As an example of these commands, let the Unix command be:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>msi template</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>and file includeFile contain:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>first name is ${first}
|
||||
family name is ${family}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>and template is</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>substitute "first=Marty,family=Kraimer"
|
||||
include "includeFile"
|
||||
substitute "first=Irma,family=Kraimer"
|
||||
include "includeFile"</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>then the following is written to the output.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>Note that the IOC's <tt>dbLoadTemplate</tt> command does not support the
|
||||
<tt>substitute</tt> syntax in template files, although the <tt>include</tt>
|
||||
syntax is supported.</p>
|
||||
|
||||
<h2>Substitution File Format</h2>
|
||||
|
||||
<p>The optional substitution file has three formats: regular, pattern, and
|
||||
dbTemplate format. We will discuss each separately.</p>
|
||||
|
||||
<h3>Regular format</h3>
|
||||
|
||||
<blockquote>
|
||||
<pre>global {gbl_var1=gbl_val1, gbl_var2=gbl_val2, ...}
|
||||
{var1=set1_val1, var2=set1_val2, ...}
|
||||
{var2=set2_val2, var1=set2_val1, ...}
|
||||
global {gbl_var1=gbl_val3, gbl_var2=gbl_val4, ...}
|
||||
{var1=set3_val1, var2=set3_val2, ...}
|
||||
{var2=set4_val2, var1=set4_val1, ...}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>The template file is output with macro substitutions performed once for each
|
||||
set of braces containing macro replacement values.</p>
|
||||
|
||||
<h3>Pattern format</h3>
|
||||
|
||||
<blockquote>
|
||||
<pre>global {gbl_var1=gbl_val1, gbl_var2=gbl_val2, ...}
|
||||
pattern {var1, var2, ...}
|
||||
{set1_val1, set1_val2, ...}
|
||||
{set2_val1, set2_val2, ...}
|
||||
pattern {var2, var1, ...}
|
||||
global {gbl_var1=gbl_val3, gbl_var2=gbl_val4, ...}
|
||||
{set3_val2, set3_val1, ...}
|
||||
{set4_val2, set4_val2, ...}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>This produces the same result as the regular format example above.</p>
|
||||
|
||||
<h3>dbLoadTemplate Format</h3>
|
||||
|
||||
<p>This format is an extension of the format accepted by the EPICS IOC command
|
||||
<tt>dbLoadTemplate</tt>, and allows templates to be expanded on the host rather
|
||||
by using dbLoadTemplate at IOC boot time.</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>global {gbl_var1=gbl_val1, gbl_var2=gbl_val2, ...}
|
||||
file templatefile {
|
||||
<i>pattern format or regular format</i>
|
||||
}
|
||||
file "${WHERE}/template2" {
|
||||
<i>pattern format or regular format</i>
|
||||
}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>For the dbTemplate format, the template filename does not have to be given
|
||||
on the command line, and is usually specified in the substitutions file
|
||||
instead. If a template filename is given on the command line it will override
|
||||
the filenames listed in the substitutions files.</p>
|
||||
|
||||
<h3>Syntax for all formats</h3>
|
||||
|
||||
<p>A comment line may appear anywhere in a substitution file, and will be
|
||||
ignored. A comment line is any line beginning with the character <tt>#</tt>,
|
||||
which must be the very first character on the line.</p>
|
||||
|
||||
<p>Global definitions may supplement or override the macro values supplied on
|
||||
the command-line using the <tt>-M</tt> switch, and set default values that will
|
||||
survive for the remainder of the file unless another global definition of the
|
||||
same macro changes it.</p>
|
||||
|
||||
<p>For definitions within braces given in any of the file formats, a separator
|
||||
must be given between items. A separator is either a comma, or one or more of
|
||||
the standard white space characters (space, formfeed, newline, carriage return,
|
||||
tab or vertical tab).</p>
|
||||
|
||||
<p>Each item within braces can be an alphanumeric token, or a double-quoted
|
||||
string. A back-slash character <tt>\</tt> can be used to escape a quote
|
||||
character needed inside a quoted string. These three sets of substitutions are
|
||||
all equivalent:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>{a=aa b=bb c="\"cc\""}
|
||||
{b="bb",a=aa,c="\"cc\""}
|
||||
{
|
||||
c="\"cc\""
|
||||
b=bb
|
||||
a="aa"
|
||||
}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>Within a substitutions file, the file name may appear inside double quotation
|
||||
marks; these are required if the name contains certain characters or environment
|
||||
variable macros of the form ${ENV_VAR} or $(ENV_VAR), which will be expanded
|
||||
before the file is opened.</p>
|
||||
|
||||
<h3>Regular substitution example</h3>
|
||||
|
||||
<p>Let the command be:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>msi -S substitute template</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>The file <tt>template</tt> contains</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>first name is ${first}
|
||||
family name is ${family}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p> and the file <tt>substitute</tt> is</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>global {family=Kraimer}
|
||||
{first=Marty}
|
||||
{first=Irma}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>The following is the output produced:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer</pre>
|
||||
</blockquote>
|
||||
|
||||
<h3>Pattern substitution example</h3>
|
||||
|
||||
<p>Let the command be:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>msi -S pattern template</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>The file <tt>pattern</tt> contains</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>pattern {first,last}
|
||||
{Marty,Kraimer}
|
||||
{Irma,Kraimer}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>and <tt>template</tt> is the same as the previous example:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>first name is ${first}
|
||||
family name is ${family}</pre>
|
||||
</blockquote>
|
||||
|
||||
<p>This is the output:</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer</pre>
|
||||
</blockquote>
|
||||
|
||||
<h3>dbTemplate example</h3>
|
||||
Let the command be
|
||||
|
||||
<blockquote>
|
||||
<pre>msi -S xxx.substitutions</pre>
|
||||
</blockquote>
|
||||
|
||||
<tt>xxx.substitutions</tt> is
|
||||
|
||||
<blockquote>
|
||||
<pre>file template {
|
||||
pattern {first,last}
|
||||
{Marty,Kraimer}
|
||||
{Irma,Kraimer}
|
||||
pattern {last,first}
|
||||
{Smith,Bill}
|
||||
{Smith,Mary}
|
||||
}
|
||||
file template {
|
||||
{first=Marty,last=Kraimer}
|
||||
{first=Irma,last=Kraimer}
|
||||
}</pre>
|
||||
</blockquote>
|
||||
<tt>template</tt> is the same as in the previous example..
|
||||
|
||||
<p>The following is written to the output</p>
|
||||
|
||||
<blockquote>
|
||||
<pre>first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer
|
||||
first name is Bill
|
||||
last name is Smith
|
||||
first name is Mary
|
||||
last name is Smith
|
||||
first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer</pre>
|
||||
</blockquote>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
396
modules/database/src/ioc/dbtemplate/msi.md
Normal file
396
modules/database/src/ioc/dbtemplate/msi.md
Normal file
@@ -0,0 +1,396 @@
|
||||
# msi: Macro Substitution and Include Tool
|
||||
|
||||
(msitool)=
|
||||
## Introduction
|
||||
|
||||
msi is a general purpose macro substitution/include tool.
|
||||
It accepts as input an ascii template file. It looks for lines containing two reserved
|
||||
command names: `include` and `substitute`. It also looks for and performs
|
||||
substitutions on macros of the form `$(var)` and `${var}`. It uses the
|
||||
macLib routines from EPICS Base to perform the substitutions, so it also
|
||||
accepts the default value and value definition syntax that macLib
|
||||
implements.
|
||||
|
||||
msi also allows substitutions to be specified via a separate
|
||||
substitution file. This substitution file allows the same format as the
|
||||
substitution files accepted by the EPICS IOC's dbLoadTemplate command.
|
||||
|
||||
|
||||
## Command Syntax
|
||||
|
||||
`msi -V -g -o outfile -I dir -M subs -S subfile template`
|
||||
|
||||
All parameters are optional. The -o, -I, -M, and -S switches may be
|
||||
separated from their associated value string by spaces if desired.
|
||||
Output will be written to stdout unless the -o option is given.
|
||||
|
||||
Switches have the following meanings:
|
||||
|
||||
- **-V**
|
||||
|
||||
Verbose warnings; if this parameter is specified then any undefined
|
||||
macro discovered in the template file which does not have an
|
||||
associated default value is considered an error. An error message is
|
||||
generated, and when msi terminates it will do so with an exit status
|
||||
of 2.
|
||||
- **-g**
|
||||
|
||||
When this flag is given all macros defined in a substitution file
|
||||
will have global scope and thus their values will persist until a
|
||||
new value is given for this macro. This flag is provided for
|
||||
backwards compatibility as this was the behavior of previous
|
||||
versions of msi, but it does not follow common scoping rules and is
|
||||
discouraged.
|
||||
- **-o _file_**
|
||||
|
||||
Output will be written to the specifed file rather than to the
|
||||
standard output.
|
||||
- **-I _dir_**
|
||||
|
||||
This parameter, which may be repeated or contain a colon-separated
|
||||
(or semi-colon separated on Windows) list of directory paths,
|
||||
specifies a search path for include commands. For example:
|
||||
|
||||
msi -I /home/mrk/examples:. -I.. template
|
||||
|
||||
specifies that all named files should be searched for in the following locations,
|
||||
in the order given:
|
||||
|
||||
1. /home/mrk/examples
|
||||
2. . (the current directory)
|
||||
3. .. (the parent of the current directory)
|
||||
|
||||
Note that relative path searching is handled as
|
||||
|
||||
$ cat foo.substitutions
|
||||
file rel/path/bar.template {
|
||||
# contents
|
||||
}
|
||||
$ msi -I . -I /some/path foo.substitutions
|
||||
|
||||
which will try to find `bar.template` at the path `./rel/path/` followed by
|
||||
`/some/path/rel/path`.
|
||||
|
||||
|
||||
- **-M _substitutions_**
|
||||
|
||||
This parameter specifies macro values for the template instance.
|
||||
Multiple macro values can be specified in one substitution
|
||||
parameter, or in multiple -M parameters. For example:
|
||||
|
||||
msi -M "a=aval,b=bval" -Mc=cval template
|
||||
|
||||
specifies that in the template file each occurrence of:
|
||||
|
||||
- `$(a)` or `${a}` is replaced by _aval_
|
||||
- `$(b)` or `${b}` is replaced by _bval_
|
||||
- `$(c)` or `${c}` is replaced by _cval_
|
||||
|
||||
- **-S _subfile_**
|
||||
|
||||
The substitution file. See below for format.
|
||||
- **_template_**
|
||||
|
||||
The input file. If no file is specified then input is taken from
|
||||
stdin, i.e. msi can be used as a filter. See below for a description
|
||||
of commands that can be embedded in the template file.
|
||||
|
||||
It is not possible to display usage by just typing msi since executing
|
||||
the command with no arguments is a valid command. To show usage specify
|
||||
an illegal switch, e.g.
|
||||
|
||||
msi -help
|
||||
|
||||
|
||||
## Exit Status
|
||||
|
||||
- **0**
|
||||
Success.
|
||||
- **1**
|
||||
Can't open/create file, or other I/O error.
|
||||
- **2**
|
||||
Undefined macros encountered with the -V option specified.
|
||||
|
||||
|
||||
## Template File Format
|
||||
|
||||
This file contains the text to be read and written to the output after
|
||||
macro substitution is performed. If no file is given then input is read
|
||||
from stdin. Variable instances to be substituted by macro values are
|
||||
expressed in the template using the syntax \$(_name_) or \${_name_}. The
|
||||
template can also provide default values to be used when a macro has not
|
||||
been given a value, using the syntax \$(_name_=_default_) or \${_name_=_default_}.
|
||||
|
||||
For example, using the command
|
||||
|
||||
msi -M name=Marty template
|
||||
|
||||
where the file template contains
|
||||
|
||||
My name is $(name)
|
||||
My age is $(age=none of your business)
|
||||
|
||||
results in this output:
|
||||
|
||||
My name is Marty
|
||||
My age is none of your business
|
||||
|
||||
Macro variables and their default values can be expressed in terms of
|
||||
other macros if necessary, to almost any level of complexity. Recursive
|
||||
definitions will generate warning messages on stderr and result in
|
||||
undefined output.
|
||||
|
||||
The template file is read and processed one line at a time, where the
|
||||
maximum length of a line before and/or after macro expansion is 1023
|
||||
characters; longer input or output lines will cause msi to fail. Within
|
||||
the context of a single line, macro expansion does not occur when the
|
||||
variable instance appears inside a single-quoted string, or where the
|
||||
dollar sign $ is preceded by a back-slash character \, but as with the
|
||||
standard Unix shells, variables inside double quoted strings are
|
||||
expanded properly.
|
||||
|
||||
However neither back-slash characters nor quotes of either variety are
|
||||
removed when generating the output file, so depending on what is being
|
||||
output the single quote behaviour may not be useful and may even be a
|
||||
hinderance. It cannot be disabled in the current version of msi.
|
||||
|
||||
|
||||
### Template file commands
|
||||
|
||||
In addition to the regular text and variable instances described above,
|
||||
the template file may also contain commands which allow the insertion of
|
||||
other template files and the ability to set macro values inside the
|
||||
template file itself. These commands are:
|
||||
|
||||
include "file"
|
||||
substitute "var=value,var=value,..."
|
||||
|
||||
Lines containing commands must be in one of these forms:
|
||||
|
||||
- include "_filename_"
|
||||
|
||||
- substitute "_name1=value1, name2=value2, ..._"
|
||||
|
||||
White space is allowed before and after the command verb, and after the
|
||||
quoted string. If embedded quotes are needed, the backslash character \
|
||||
can be used as an escape character. For example
|
||||
|
||||
substitute "a=\"val\""
|
||||
|
||||
specifies that (unless a is subsequently redefined) wherever a $(a)
|
||||
macro appears in the template below this point, the text
|
||||
"val" (including the double quote characters) will appear in the output
|
||||
instead.
|
||||
|
||||
If a line does match either syntax above it is just passed to macLib for
|
||||
processing without any notification. Thus the input line:
|
||||
|
||||
include "myfile" #include file
|
||||
|
||||
would just be passed to macLib, i.e. it would _not_ be considered an
|
||||
include command.
|
||||
|
||||
As an example of these commands, let the Unix command be:
|
||||
|
||||
msi template
|
||||
|
||||
and file includeFile contain:
|
||||
|
||||
first name is ${first}
|
||||
family name is ${family}
|
||||
|
||||
and template is
|
||||
|
||||
substitute "first=Marty,family=Kraimer"
|
||||
include "includeFile"
|
||||
substitute "first=Irma,family=Kraimer"
|
||||
include "includeFile"
|
||||
|
||||
then the following is written to the output.
|
||||
|
||||
first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer
|
||||
|
||||
Note that the IOC's dbLoadTemplate command does not support the
|
||||
substitute syntax in template files, although the include syntax is
|
||||
supported.
|
||||
|
||||
|
||||
## Substitution File Format
|
||||
|
||||
The optional substitution file has three formats: regular, pattern, and
|
||||
dbTemplate format. We will discuss each separately.
|
||||
|
||||
|
||||
### Regular format
|
||||
|
||||
global {gbl_var1=gbl_val1, gbl_var2=gbl_val2, ...}
|
||||
{var1=set1_val1, var2=set1_val2, ...}
|
||||
{var2=set2_val2, var1=set2_val1, ...}
|
||||
global {gbl_var1=gbl_val3, gbl_var2=gbl_val4, ...}
|
||||
{var1=set3_val1, var2=set3_val2, ...}
|
||||
{var2=set4_val2, var1=set4_val1, ...}
|
||||
|
||||
The template file is output with macro substitutions performed once for
|
||||
each set of braces containing macro replacement values.
|
||||
|
||||
|
||||
### Pattern format
|
||||
|
||||
global {gbl_var1=gbl_val1, gbl_var2=gbl_val2, ...}
|
||||
pattern {var1, var2, ...}
|
||||
{set1_val1, set1_val2, ...}
|
||||
{set2_val1, set2_val2, ...}
|
||||
pattern {var2, var1, ...}
|
||||
global {gbl_var1=gbl_val3, gbl_var2=gbl_val4, ...}
|
||||
{set3_val2, set3_val1, ...}
|
||||
{set4_val2, set4_val2, ...}
|
||||
|
||||
This produces the same result as the regular format example above.
|
||||
|
||||
|
||||
### dbLoadTemplate Format
|
||||
|
||||
This format is an extension of the format accepted by the EPICS IOC
|
||||
command dbLoadTemplate, and allows templates to be expanded on the host
|
||||
rather by using dbLoadTemplate at IOC boot time.
|
||||
|
||||
global {gbl_var1=gbl_val1, gbl_var2=gbl_val2, ...}
|
||||
file templatefile {
|
||||
/pattern format or regular format/
|
||||
}
|
||||
file "${WHERE}/template2" {
|
||||
/pattern format or regular format/
|
||||
}
|
||||
|
||||
For the dbTemplate format, the template filename does not have to be
|
||||
given on the command line, and is usually specified in the substitutions
|
||||
file instead. If a template filename is given on the command line it
|
||||
will override the filenames listed in the substitutions files.
|
||||
|
||||
|
||||
### Syntax for all formats
|
||||
|
||||
A comment line may appear anywhere in a substitution file, and will be
|
||||
ignored. A comment line is any line beginning with the character #,
|
||||
which must be the very first character on the line.
|
||||
|
||||
Global definitions may supplement or override the macro values supplied
|
||||
on the command-line using the -M switch, and set default values that
|
||||
will survive for the remainder of the file unless another global
|
||||
definition of the same macro changes it.
|
||||
|
||||
For definitions within braces given in any of the file formats, a
|
||||
separator must be given between items. A separator is either a comma, or
|
||||
one or more of the standard white space characters (space, formfeed,
|
||||
newline, carriage return, tab or vertical tab).
|
||||
|
||||
Each item within braces can be an alphanumeric token, or a double-quoted
|
||||
string. A back-slash character \ can be used to escape a quote character
|
||||
needed inside a quoted string. These three sets of substitutions are all
|
||||
equivalent:
|
||||
|
||||
{a=aa b=bb c="\"cc\""}
|
||||
{b="bb",a=aa,c="\"cc\""}
|
||||
{
|
||||
c="\"cc\""
|
||||
b=bb
|
||||
a="aa"
|
||||
}
|
||||
|
||||
Within a substitutions file, the file name may appear inside double
|
||||
quotation marks; these are required if the name contains certain
|
||||
characters or environment variable macros of the form `${ENV_VAR}` or
|
||||
`$(ENV_VAR)`, which will be expanded before the file is opened.
|
||||
|
||||
|
||||
### Regular substitution example
|
||||
|
||||
Let the command be:
|
||||
|
||||
msi -S substitute template
|
||||
|
||||
The file template contains
|
||||
|
||||
first name is ${first}
|
||||
family name is ${family}
|
||||
|
||||
and the file `substitute` is
|
||||
|
||||
global {family=Kraimer}
|
||||
{first=Marty}
|
||||
{first=Irma}
|
||||
|
||||
The following is the output produced:
|
||||
|
||||
first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer
|
||||
|
||||
|
||||
### Pattern substitution example
|
||||
|
||||
Let the command be:
|
||||
|
||||
msi -S pattern template
|
||||
|
||||
The file pattern contains
|
||||
|
||||
pattern {first,last}
|
||||
{Marty,Kraimer}
|
||||
{Irma,Kraimer}
|
||||
|
||||
and template is the same as the previous example:
|
||||
|
||||
first name is ${first}
|
||||
family name is ${family}
|
||||
|
||||
This is the output:
|
||||
|
||||
first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer
|
||||
|
||||
|
||||
### dbTemplate example
|
||||
|
||||
Let the command be
|
||||
|
||||
msi -S xxx.substitutions
|
||||
|
||||
`xxx.substitutions` is
|
||||
|
||||
file template {
|
||||
pattern {first,last}
|
||||
{Marty,Kraimer}
|
||||
{Irma,Kraimer}
|
||||
pattern {last,first}
|
||||
{Smith,Bill}
|
||||
{Smith,Mary}
|
||||
}
|
||||
file template {
|
||||
{first=Marty,last=Kraimer}
|
||||
{first=Irma,last=Kraimer}
|
||||
}
|
||||
|
||||
`template` is the same as in the previous example.
|
||||
|
||||
The following is written to the output
|
||||
|
||||
first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer
|
||||
first name is Bill
|
||||
last name is Smith
|
||||
first name is Mary
|
||||
last name is Smith
|
||||
first name is Marty
|
||||
family name is Kraimer
|
||||
first name is Irma
|
||||
family name is Kraimer
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
#include "iocsh.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
IOCSH_STATIC_FUNC void dlload(const char* name)
|
||||
IOCSH_STATIC_FUNC int dlload(const char* name)
|
||||
{
|
||||
if (!epicsLoadLibrary(name)) {
|
||||
printf("epicsLoadLibrary failed: %s\n", epicsLoadError());
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const iocshArg dlloadArg0 = { "path/library.so", iocshArgStringPath};
|
||||
@@ -28,7 +30,7 @@ static const iocshFuncDef dlloadFuncDef = {
|
||||
};
|
||||
static void dlloadCallFunc(const iocshArgBuf *args)
|
||||
{
|
||||
dlload(args[0].sval);
|
||||
iocshSetError(dlload(args[0].sval));
|
||||
}
|
||||
|
||||
static void dlloadRegistar(void) {
|
||||
|
||||
@@ -22,6 +22,9 @@ enum iocStateEnum {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** Query present IOC run state
|
||||
* @since 3.15.8
|
||||
*/
|
||||
DBCORE_API enum iocStateEnum getIocState(void);
|
||||
DBCORE_API int iocInit(void);
|
||||
DBCORE_API int iocBuild(void);
|
||||
|
||||
@@ -493,7 +493,6 @@ static void read_reply ( void *pArg, struct dbChannel *dbch,
|
||||
const int readAccess = asCheckGet ( pciu->asClientPVT );
|
||||
int status;
|
||||
int autosize;
|
||||
int local_fl = 0;
|
||||
long item_count;
|
||||
ca_uint32_t payload_size;
|
||||
dbAddr *paddr=&dbch->addr;
|
||||
@@ -535,21 +534,9 @@ static void read_reply ( void *pArg, struct dbChannel *dbch,
|
||||
return;
|
||||
}
|
||||
|
||||
/* If filters are involved in a read, create field log and run filters */
|
||||
if (!pfl && (ellCount(&dbch->pre_chain) || ellCount(&dbch->post_chain))) {
|
||||
pfl = db_create_read_log(dbch);
|
||||
if (pfl) {
|
||||
local_fl = 1;
|
||||
pfl = dbChannelRunPreChain(dbch, pfl);
|
||||
pfl = dbChannelRunPostChain(dbch, pfl);
|
||||
}
|
||||
}
|
||||
|
||||
status = dbChannel_get_count ( dbch, pevext->msg.m_dataType,
|
||||
pPayload, &item_count, pfl);
|
||||
|
||||
if (local_fl) db_delete_field_log(pfl);
|
||||
|
||||
if ( status < 0 ) {
|
||||
/* Clients recv the status of the operation directly to the
|
||||
* event/put/get callback. (from CA_V41())
|
||||
@@ -616,7 +603,6 @@ static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *p
|
||||
ca_uint32_t payloadSize;
|
||||
void *pPayload;
|
||||
int status;
|
||||
int local_fl = 0;
|
||||
db_field_log *pfl = NULL;
|
||||
|
||||
if ( ! pciu ) {
|
||||
@@ -655,21 +641,9 @@ static int read_action ( caHdrLargeArray *mp, void *pPayloadIn, struct client *p
|
||||
return RSRV_OK;
|
||||
}
|
||||
|
||||
/* If filters are involved in a read, create field log and run filters */
|
||||
if (ellCount(&pciu->dbch->pre_chain) || ellCount(&pciu->dbch->post_chain)) {
|
||||
pfl = db_create_read_log(pciu->dbch);
|
||||
if (pfl) {
|
||||
local_fl = 1;
|
||||
pfl = dbChannelRunPreChain(pciu->dbch, pfl);
|
||||
pfl = dbChannelRunPostChain(pciu->dbch, pfl);
|
||||
}
|
||||
}
|
||||
|
||||
status = dbChannel_get ( pciu->dbch, mp->m_dataType,
|
||||
pPayload, mp->m_count, pfl );
|
||||
|
||||
if (local_fl) db_delete_field_log(pfl);
|
||||
|
||||
if ( status < 0 ) {
|
||||
send_err ( mp, ECA_GETFAIL, pClient, RECORD_NAME ( pciu->dbch ) );
|
||||
SEND_UNLOCK ( pClient );
|
||||
|
||||
@@ -163,9 +163,11 @@ void camsgtask ( void *pParm )
|
||||
|
||||
int casClientInitiatingCurrentThread ( char * pBuf, size_t bufSize )
|
||||
{
|
||||
struct client * pClient = ( struct client * )
|
||||
epicsThreadPrivateGet ( rsrvCurrentClient );
|
||||
struct client * pClient;
|
||||
if ( ! rsrvCurrentClient )
|
||||
return RSRV_ERROR; /* not yet initialized, or disabled via dbServer */
|
||||
|
||||
pClient = ( struct client * ) epicsThreadPrivateGet ( rsrvCurrentClient );
|
||||
if ( ! pClient )
|
||||
return RSRV_ERROR;
|
||||
|
||||
|
||||
@@ -1536,6 +1536,13 @@ struct client *create_tcp_client (SOCKET sock , const osiSockAddr *peerAddr)
|
||||
|
||||
void casStatsFetch ( unsigned *pChanCount, unsigned *pCircuitCount )
|
||||
{
|
||||
if(!clientQlock) { /* not yet initialized, or disabled via dbServer */
|
||||
if(pChanCount)
|
||||
*pChanCount = 0;
|
||||
if(pCircuitCount)
|
||||
*pCircuitCount = 0;
|
||||
return;
|
||||
}
|
||||
LOCK_CLIENTQ;
|
||||
{
|
||||
int circuitCount = ellCount ( &clientQ );
|
||||
|
||||
96
modules/database/src/std/ComponentReference.md
Normal file
96
modules/database/src/std/ComponentReference.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# IOC Component Reference
|
||||
|
||||
This document provides reference information about the record types,
|
||||
menus, link types and channel filters included with EPICS Base.
|
||||
|
||||
## Introduction and IOC Concepts
|
||||
|
||||
- [Introduction to EPICS](https://docs.epics-controls.org/en/latest/getting-started/EPICS_Intro.html)
|
||||
- [Process Database Concepts](https://docs.epics-controls.org/en/latest/process-database/EPICS_Process_Database_Concepts.html)
|
||||
|
||||
## Record Type Definitions
|
||||
|
||||
These sections describe common aspects of the record types:
|
||||
|
||||
```{toctree}
|
||||
:titlesonly:
|
||||
|
||||
dbCommonRecord
|
||||
dbCommonInput
|
||||
dbCommonOutput
|
||||
```
|
||||
|
||||
These are the record types supplied with EPICS Base:
|
||||
|
||||
```{toctree}
|
||||
:titlesonly:
|
||||
|
||||
aaiRecord
|
||||
aaoRecord
|
||||
aiRecord
|
||||
aoRecord
|
||||
aSubRecord
|
||||
biRecord
|
||||
boRecord
|
||||
calcoutRecord
|
||||
calcRecord
|
||||
compressRecord
|
||||
dfanoutRecord
|
||||
eventRecord
|
||||
fanoutRecord
|
||||
histogramRecord
|
||||
int64inRecord
|
||||
int64outRecord
|
||||
longinRecord
|
||||
longoutRecord
|
||||
lsiRecord
|
||||
lsoRecord
|
||||
mbbiDirectRecord
|
||||
mbbiRecord
|
||||
mbboDirectRecord
|
||||
mbboRecord
|
||||
permissiveRecord
|
||||
printfRecord
|
||||
selRecord
|
||||
seqRecord
|
||||
stateRecord
|
||||
stringinRecord
|
||||
stringoutRecord
|
||||
subArrayRecord
|
||||
subRecord
|
||||
waveformRecord
|
||||
```
|
||||
|
||||
## Menu Definitions
|
||||
|
||||
Menu field choices are documented with the record type that defines them, or
|
||||
here for the global menus that are used by multiple record types:
|
||||
|
||||
```{toctree}
|
||||
:titlesonly:
|
||||
|
||||
menuAlarmSevr
|
||||
menuAlarmStat
|
||||
menuConvert
|
||||
menuFtype
|
||||
menuIvoa
|
||||
menuOmsl
|
||||
menuPini
|
||||
menuPost
|
||||
menuPriority
|
||||
menuScan
|
||||
menuSimm
|
||||
menuYesNo
|
||||
```
|
||||
|
||||
## Other Components
|
||||
|
||||
EPICS Base also comes with extensible sets of server Channel Filters and IOC
|
||||
Database Link types, which are documented here:
|
||||
|
||||
```{toctree}
|
||||
:titlesonly:
|
||||
|
||||
filters
|
||||
links
|
||||
```
|
||||
@@ -163,8 +163,8 @@ Database Link types, which are documented here:
|
||||
|
||||
Corrections to these documents can be submitted as patch files to the EPICS
|
||||
core developers, or as GitHub pull requests to the 7.0 branch of Base.
|
||||
These document sources can be found under `modules/database/src` tree, mostly
|
||||
in the `std/rec` and `ioc/db` directories in files with extension `.dbd.pod`.
|
||||
These document sources can be found under C<modules/database/src> tree, mostly
|
||||
in the C<std/rec> and C<ioc/db> directories in files with extension C<.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.
|
||||
with an extended version of Perl's POD (plain old documentation); run
|
||||
C<perldoc pod> for details of POD.
|
||||
@@ -30,6 +30,9 @@ include $(STDDIR)/filters/Makefile
|
||||
include $(STDDIR)/link/Makefile
|
||||
include $(STDDIR)/softIoc/Makefile
|
||||
|
||||
DOCS += ComponentReference.md
|
||||
HTMLS += ComponentReference.html
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
include $(STDDIR)/rec/RULES
|
||||
|
||||
@@ -18,5 +18,5 @@ dbRecStd_SRCS += sync.c
|
||||
dbRecStd_SRCS += decimate.c
|
||||
dbRecStd_SRCS += utag.c
|
||||
|
||||
DOCS += filters.md
|
||||
HTMLS += filters.html
|
||||
|
||||
|
||||
@@ -16,4 +16,5 @@ dbRecStd_SRCS += lnkCalc.c
|
||||
dbRecStd_SRCS += lnkState.c
|
||||
dbRecStd_SRCS += lnkDebug.c
|
||||
|
||||
DOCS += links.md
|
||||
HTMLS += links.html
|
||||
|
||||
@@ -54,8 +54,13 @@ stdRecords_DBD = $(patsubst %,%.dbd,$(stdRecords))
|
||||
|
||||
dbRecStd_SRCS += $(patsubst %,%.c,$(stdRecords))
|
||||
|
||||
DOCS += $(patsubst %.dbd.pod,%.md,$(notdir $(wildcard ../rec/*Record.dbd.pod)))
|
||||
HTMLS += $(patsubst %.dbd.pod,%.html,$(notdir $(wildcard ../rec/*Record.dbd.pod)))
|
||||
|
||||
vpath %.png $(SRC_DIRS)
|
||||
|
||||
DOCS += image/compress-1.png
|
||||
DOCS += image/compress-2.png
|
||||
|
||||
HTMLS += image/compress-1.png
|
||||
HTMLS += image/compress-2.png
|
||||
|
||||
@@ -33,7 +33,7 @@ These fields control where the record will read data from when it is processed:
|
||||
The DTYP field selects which device support layer should be responsible for
|
||||
providing input data to the record.
|
||||
The ai device support layers provided by EPICS Base are documented in the
|
||||
L<Device Support|devSoft> section.
|
||||
L<Device Support Interface> section.
|
||||
External support modules may provide additional device support for this record
|
||||
type.
|
||||
If not set explicitly, the DTYP value defaults to the first device support that
|
||||
|
||||
@@ -384,6 +384,7 @@ static long special(DBADDR *paddr, int after)
|
||||
|
||||
if (special_type == SPC_RESET) {
|
||||
reset(prec);
|
||||
monitor(prec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,12 +220,9 @@ static long special(DBADDR *paddr, int after)
|
||||
return 0;
|
||||
init_common(prec);
|
||||
/* Note: ZRVL..FFVL are also SPC_MOD */
|
||||
if (fieldIndex >= mbbiRecordZRST && fieldIndex <= mbbiRecordFFST) {
|
||||
int event = DBE_PROPERTY;
|
||||
|
||||
if (prec->val == fieldIndex - mbbiRecordZRST)
|
||||
event |= DBE_VALUE | DBE_LOG;
|
||||
db_post_events(prec, &prec->val, event);
|
||||
if (fieldIndex >= mbbiRecordZRST && fieldIndex <= mbbiRecordFFST
|
||||
&& prec->val == fieldIndex - mbbiRecordZRST) {
|
||||
db_post_events(prec, &prec->val, DBE_VALUE | DBE_LOG);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -276,6 +276,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(ONST,DBF_STRING) {
|
||||
prompt("One String")
|
||||
@@ -284,6 +285,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TWST,DBF_STRING) {
|
||||
prompt("Two String")
|
||||
@@ -292,6 +294,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(THST,DBF_STRING) {
|
||||
prompt("Three String")
|
||||
@@ -300,6 +303,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FRST,DBF_STRING) {
|
||||
prompt("Four String")
|
||||
@@ -308,6 +312,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FVST,DBF_STRING) {
|
||||
prompt("Five String")
|
||||
@@ -316,6 +321,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(SXST,DBF_STRING) {
|
||||
prompt("Six String")
|
||||
@@ -324,6 +330,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(SVST,DBF_STRING) {
|
||||
prompt("Seven String")
|
||||
@@ -332,6 +339,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(EIST,DBF_STRING) {
|
||||
prompt("Eight String")
|
||||
@@ -340,6 +348,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(NIST,DBF_STRING) {
|
||||
prompt("Nine String")
|
||||
@@ -348,6 +357,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TEST,DBF_STRING) {
|
||||
prompt("Ten String")
|
||||
@@ -356,6 +366,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(ELST,DBF_STRING) {
|
||||
prompt("Eleven String")
|
||||
@@ -364,6 +375,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TVST,DBF_STRING) {
|
||||
prompt("Twelve String")
|
||||
@@ -372,6 +384,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TTST,DBF_STRING) {
|
||||
prompt("Thirteen String")
|
||||
@@ -380,6 +393,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FTST,DBF_STRING) {
|
||||
prompt("Fourteen String")
|
||||
@@ -388,6 +402,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FFST,DBF_STRING) {
|
||||
prompt("Fifteen String")
|
||||
@@ -396,6 +411,7 @@ Parameters> for more on the record name (NAME) and description (DESC) fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
|
||||
=head3 Alarm Parameters
|
||||
|
||||
@@ -285,12 +285,9 @@ static long special(DBADDR *paddr, int after)
|
||||
return 0;
|
||||
init_common(prec);
|
||||
/* Note: ZRVL..FFVL are also SPC_MOD */
|
||||
if (fieldIndex >= mbboRecordZRST && fieldIndex <= mbboRecordFFST) {
|
||||
int event = DBE_PROPERTY;
|
||||
|
||||
if (prec->val == fieldIndex - mbboRecordZRST)
|
||||
event |= DBE_VALUE | DBE_LOG;
|
||||
db_post_events(prec, &prec->val, event);
|
||||
if (fieldIndex >= mbboRecordZRST && fieldIndex <= mbboRecordFFST
|
||||
&& prec->val == fieldIndex - mbboRecordZRST) {
|
||||
db_post_events(prec, &prec->val, DBE_VALUE | DBE_LOG);
|
||||
}
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -354,6 +354,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(ONST,DBF_STRING) {
|
||||
prompt("One String")
|
||||
@@ -362,6 +363,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TWST,DBF_STRING) {
|
||||
prompt("Two String")
|
||||
@@ -370,6 +372,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(THST,DBF_STRING) {
|
||||
prompt("Three String")
|
||||
@@ -378,6 +381,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FRST,DBF_STRING) {
|
||||
prompt("Four String")
|
||||
@@ -386,6 +390,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FVST,DBF_STRING) {
|
||||
prompt("Five String")
|
||||
@@ -394,6 +399,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(SXST,DBF_STRING) {
|
||||
prompt("Six String")
|
||||
@@ -402,6 +408,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(SVST,DBF_STRING) {
|
||||
prompt("Seven String")
|
||||
@@ -410,6 +417,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(EIST,DBF_STRING) {
|
||||
prompt("Eight String")
|
||||
@@ -418,6 +426,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(NIST,DBF_STRING) {
|
||||
prompt("Nine String")
|
||||
@@ -426,6 +435,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TEST,DBF_STRING) {
|
||||
prompt("Ten String")
|
||||
@@ -434,6 +444,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(ELST,DBF_STRING) {
|
||||
prompt("Eleven String")
|
||||
@@ -442,6 +453,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TVST,DBF_STRING) {
|
||||
prompt("Twelve String")
|
||||
@@ -450,6 +462,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(TTST,DBF_STRING) {
|
||||
prompt("Thirteen String")
|
||||
@@ -458,6 +471,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FTST,DBF_STRING) {
|
||||
prompt("Fourteen String")
|
||||
@@ -466,6 +480,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(FFST,DBF_STRING) {
|
||||
prompt("Fifteen String")
|
||||
@@ -474,6 +489,7 @@ for more information on simulation mode and its fields.
|
||||
pp(TRUE)
|
||||
interest(1)
|
||||
size(26)
|
||||
prop(YES)
|
||||
}
|
||||
field(ZRSV,DBF_MENU) {
|
||||
prompt("State Zero Severity")
|
||||
|
||||
@@ -282,10 +282,10 @@ static void processCallback(epicsCallback *arg)
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
seqRecord *prec = (seqRecord *) paddr->precord;
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY1);
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY0);
|
||||
|
||||
if (fieldOffset >= 0)
|
||||
switch (fieldOffset & 2) {
|
||||
switch (fieldOffset & 3) {
|
||||
case 0: /* DLYn */
|
||||
strcpy(units, "s");
|
||||
break;
|
||||
@@ -299,11 +299,11 @@ static long get_units(DBADDR *paddr, char *units)
|
||||
static long get_precision(const DBADDR *paddr, long *pprecision)
|
||||
{
|
||||
seqRecord *prec = (seqRecord *) paddr->precord;
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY1);
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY0);
|
||||
short precision;
|
||||
|
||||
if (fieldOffset >= 0)
|
||||
switch (fieldOffset & 2) {
|
||||
switch (fieldOffset & 3) {
|
||||
case 0: /* DLYn */
|
||||
*pprecision = seqDLYprecision;
|
||||
return 0;
|
||||
@@ -321,10 +321,10 @@ static long get_precision(const DBADDR *paddr, long *pprecision)
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
seqRecord *prec = (seqRecord *) paddr->precord;
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY1);
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY0);
|
||||
|
||||
if (fieldOffset >= 0)
|
||||
switch (fieldOffset & 2) {
|
||||
switch (fieldOffset & 3) {
|
||||
case 0: /* DLYn */
|
||||
pgd->lower_disp_limit = 0.0;
|
||||
pgd->lower_disp_limit = 10.0;
|
||||
@@ -341,9 +341,9 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
|
||||
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY1);
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY0);
|
||||
|
||||
if (fieldOffset >= 0 && (fieldOffset & 2) == 0) { /* DLYn */
|
||||
if (fieldOffset >= 0 && (fieldOffset & 3) == 0) { /* DLYn */
|
||||
pcd->lower_ctrl_limit = 0.0;
|
||||
pcd->upper_ctrl_limit = seqDLYlimit;
|
||||
}
|
||||
@@ -355,9 +355,9 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
{
|
||||
seqRecord *prec = (seqRecord *) paddr->precord;
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY1);
|
||||
int fieldOffset = dbGetFieldIndex(paddr) - indexof(DLY0);
|
||||
|
||||
if (fieldOffset >= 0 && (fieldOffset & 2) == 2) /* DOn */
|
||||
if (fieldOffset >= 0 && (fieldOffset & 3) == 2) /* DOn */
|
||||
dbGetAlarmLimits(get_dol(prec, fieldOffset),
|
||||
&pad->lower_alarm_limit, &pad->lower_warning_limit,
|
||||
&pad->upper_warning_limit, &pad->upper_alarm_limit);
|
||||
|
||||
@@ -34,6 +34,7 @@ PERL_SCRIPTS += dbdToRecordtypeH.pl
|
||||
PERL_SCRIPTS += dbdExpand.pl
|
||||
PERL_SCRIPTS += dbExpand.pl
|
||||
PERL_SCRIPTS += dbdToHtml.pl
|
||||
PERL_SCRIPTS += dbdToMD.pl
|
||||
PERL_SCRIPTS += registerRecordDeviceDriver.pl
|
||||
|
||||
HTMLS += dbdToHtml.html
|
||||
|
||||
307
modules/database/src/tools/dbdToMD.pl
Normal file
307
modules/database/src/tools/dbdToMD.pl
Normal file
@@ -0,0 +1,307 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2012 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# SPDX-License-Identifier: EPICS
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
|
||||
use strict;
|
||||
|
||||
|
||||
use FindBin qw($Bin);
|
||||
use lib ("$Bin/../../lib/perl");
|
||||
|
||||
use DBD;
|
||||
use DBD::Parser;
|
||||
use EPICS::Getopts;
|
||||
use EPICS::macLib;
|
||||
use EPICS::PodMD;
|
||||
use EPICS::Readfile;
|
||||
|
||||
use Pod::Usage;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
dbdToMD.pl - Convert DBD file with POD to Markdown
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<dbdToMD.pl> [B<-h>] [B<-D>] [B<-I> dir] [B<-o> file] file.dbd.pod
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Generates MArkdown documentation from a B<.dbd.pod> file.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<dbdToMD.pl> understands the following options:
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<-h>
|
||||
|
||||
Help, display usage information.
|
||||
|
||||
=item B<-H>
|
||||
|
||||
Conversion help, display information about converting reference documentation
|
||||
from the EPICS Wiki into a B<.dbd.pod> file for use with this tool.
|
||||
|
||||
=item B<-I>
|
||||
|
||||
Path to look for include files.
|
||||
|
||||
=item B<-o> file
|
||||
|
||||
Name of the output file to be created.
|
||||
|
||||
=back
|
||||
|
||||
If no output filename is set, the file created will be named after the input
|
||||
file, removing any directory components in the path and replacing any
|
||||
B<.dbd.pod> file extension with B<.md>.
|
||||
|
||||
=cut
|
||||
|
||||
our ($opt_h, $opt_H, @opt_I, $opt_o);
|
||||
|
||||
my $tool = 'dbdToMD.pl';
|
||||
|
||||
getopts('hHI@o:') or
|
||||
pod2usage(2);
|
||||
pod2usage(-verbose => 2) if $opt_H;
|
||||
pod2usage(1) if $opt_h;
|
||||
pod2usage("$tool: No input file given.\n") if @ARGV != 1;
|
||||
|
||||
my $dbd = DBD->new();
|
||||
|
||||
my $infile = shift @ARGV;
|
||||
$infile =~ m/\.dbd.pod$/ or
|
||||
pod2usage("$tool: Input file '$infile' must have '.dbd.pod' extension.\n");
|
||||
|
||||
ParseDBD($dbd, Readfile($infile, 0, \@opt_I));
|
||||
|
||||
if (!$opt_o) {
|
||||
($opt_o = $infile) =~ s/\.dbd\.pod$/.md/;
|
||||
$opt_o =~ s/^.*\///;
|
||||
$opt_o =~ s/dbCommonRecord/dbCommon/;
|
||||
}
|
||||
|
||||
(my $title = $opt_o) =~ s/\.md$//;
|
||||
|
||||
open my $out, '>', $opt_o or
|
||||
die "Can't create $opt_o: $!\n";
|
||||
|
||||
$SIG{__DIE__} = sub {
|
||||
die @_ if $^S; # Ignore eval deaths
|
||||
close $out;
|
||||
unlink $opt_o;
|
||||
};
|
||||
|
||||
sub make_fragment {
|
||||
my $fragment = $_[1];
|
||||
$fragment =~ s/\W+/-/g;
|
||||
$fragment = lc($fragment);
|
||||
$_[1] = $fragment;
|
||||
}
|
||||
|
||||
my $podRst = EPICS::PodMD->new(
|
||||
perldoc_url_prefix => '',
|
||||
perldoc_fragment_format => make_fragment,
|
||||
markdown_fragment_format => make_fragment,
|
||||
);
|
||||
|
||||
# Parse the Pod text from the root DBD object
|
||||
my $pod = join "\n",
|
||||
map {
|
||||
# Handle a 'recordtype' Pod directive
|
||||
if (m/^ =recordtype \s+ (\w+) /x) {
|
||||
my $rn = $1;
|
||||
my $rtyp = $dbd->recordtype($rn);
|
||||
die "Unknown recordtype '$rn' in $infile POD directive\n"
|
||||
unless $rtyp;
|
||||
rtypeToMD($rtyp, $dbd);
|
||||
}
|
||||
# Handle a 'menu' Pod directive
|
||||
elsif (m/^ =menu \s+ (\w+) /x) {
|
||||
my $mn = $1;
|
||||
my $menu = $dbd->menu($mn);
|
||||
die "Unknown menu '$mn' in $infile POD directive\n"
|
||||
unless $menu;
|
||||
menuToMD($menu);
|
||||
}
|
||||
elsif (m/^ =title \s+ (.*)/x) {
|
||||
$title = $1;
|
||||
"=head1 $title";
|
||||
}
|
||||
else {
|
||||
$_;
|
||||
}
|
||||
} $dbd->pod;
|
||||
|
||||
$podRst->output_fh($out);
|
||||
$podRst->parse_string_document($pod);
|
||||
close $out;
|
||||
|
||||
sub menuToMD {
|
||||
my ($menu) = @_;
|
||||
my $index = 0;
|
||||
return "| Index | Identifier | Choice String |",
|
||||
"| ----- | ---------- | ------------- |",
|
||||
map({choiceTableRow($_, $index++)} $menu->choices);
|
||||
}
|
||||
|
||||
sub choiceTableRow {
|
||||
my ($ch, $index) = @_;
|
||||
my ($id, $name) = @{$ch};
|
||||
return "| $index | $id | $name |";
|
||||
}
|
||||
|
||||
sub rtypeToMD {
|
||||
my ($rtyp, $dbd) = @_;
|
||||
return map {
|
||||
# Handle a 'fields' Pod directive
|
||||
if (m/^ =fields \s+ (\w+ (?:\s* , \s* \w+ )* )/x) {
|
||||
my @names = split /\s*,\s*/, $1;
|
||||
# Look up the named fields
|
||||
my @fields = map {
|
||||
my $field = $rtyp->field($_);
|
||||
die "Unknown field name '$_' in $infile POD\n"
|
||||
unless $field;
|
||||
$field;
|
||||
} @names;
|
||||
# Generate Pod for the table
|
||||
"| Field | Summary | Type | DCT | Default | Read | Write | CA PP |",
|
||||
"| ----- | ------- | ---- | --- | ------- | ---- | ----- | ----- |",
|
||||
map({fieldTableRow($_, $dbd)} @fields);
|
||||
}
|
||||
# Handle a 'menu' Pod directive
|
||||
elsif (m/^ =menu \s+ (\w+) /x) {
|
||||
my $mn = $1;
|
||||
my $menu = $dbd->menu($mn);
|
||||
die "Unknown menu '$mn' in $infile POD directive\n"
|
||||
unless $menu;
|
||||
menuToMD($menu);
|
||||
}
|
||||
else {
|
||||
# Raw text line
|
||||
$_;
|
||||
}
|
||||
} $rtyp->pod;
|
||||
}
|
||||
|
||||
sub fieldTableRow {
|
||||
my ($fld, $dbd) = @_;
|
||||
my @md;
|
||||
push @md, $fld->name, $fld->attribute('prompt');
|
||||
|
||||
my $type = $fld->public_type;
|
||||
if ($type eq 'STRING') {
|
||||
$type .= ' [' . $fld->attribute('size') . ']';
|
||||
} elsif ($type eq 'MENU') {
|
||||
my $mn = $fld->attribute('menu');
|
||||
my $menu = $dbd->menu($mn);
|
||||
my $mnl = lc($mn);
|
||||
my $url = $menu ? "/menu-$mnl" : "${mn}.md";
|
||||
#just pass a L directive for the parser
|
||||
$type .= " L<$mn|$url>";
|
||||
}
|
||||
push @md, $type;
|
||||
|
||||
push @md, $fld->attribute('promptgroup') ? 'Yes' : 'No';
|
||||
push @md, $fld->attribute('initial') || ' ';
|
||||
push @md, $fld->readable;
|
||||
push @md, $fld->writable;
|
||||
push @md, $fld->attribute('pp') eq 'TRUE' ? 'Yes' : 'No';
|
||||
return '| ' . join(' | ', @md) . ' |';
|
||||
}
|
||||
|
||||
# Native type presented to dbAccess users
|
||||
sub DBD::Recfield::public_type {
|
||||
my $fld = shift;
|
||||
m/^ =type \s+ (.+) /x && return $1 for $fld->comments;
|
||||
my $type = $fld->dbf_type;
|
||||
$type =~ s/^DBF_//;
|
||||
return $type;
|
||||
}
|
||||
|
||||
# Check if this field is readable
|
||||
sub DBD::Recfield::readable {
|
||||
my $fld = shift;
|
||||
m/^ =read \s+ (?i) (Yes|No) /x && return $1 for $fld->comments;
|
||||
return 'Probably'
|
||||
if $fld->attribute('special') eq "SPC_DBADDR";
|
||||
return $fld->dbf_type eq 'DBF_NOACCESS' ? 'No' : 'Yes';
|
||||
}
|
||||
|
||||
# Check if this field is writable
|
||||
sub DBD::Recfield::writable {
|
||||
my $fld = shift;
|
||||
m/^ =write \s+ (?i) (Yes|No) /x && return $1 for $fld->comments;
|
||||
my $special = $fld->attribute('special');
|
||||
return 'No'
|
||||
if $special eq "SPC_NOMOD";
|
||||
return 'Maybe'
|
||||
if $special eq "SPC_DBADDR";
|
||||
return $fld->dbf_type eq "DBF_NOACCESS" ? 'No' : 'Yes';
|
||||
}
|
||||
|
||||
=pod
|
||||
|
||||
=head1 Converting Wiki Record Reference to POD
|
||||
|
||||
If you open the src/std/rec/aiRecord.dbd.pod file in your favourite plain text
|
||||
editor you'll see what input was required to generate the aiRecord.html file.
|
||||
The text markup language we're using is a standard called POD (Plain Old
|
||||
Documentation) which is used by Perl developers, but you don't need to know Perl
|
||||
at all to be able to use it.
|
||||
|
||||
When we add POD markup to a record type, we rename its *Record.dbd file to
|
||||
.dbd.pod in the src/std/rec directory; no other changes are needed for the build
|
||||
system to find it by its new name. The POD content is effectively just a new
|
||||
kind of comment that appears in .dbd.pod files, which the formatter knows how to
|
||||
convert into Markdown. The build also generates a plain *Record.dbd file from this
|
||||
same input file by stripping out all of the POD markup.
|
||||
|
||||
Documentation for Perl's POD markup standard can be found online at
|
||||
L<https://perldoc.perl.org/perlpod.html> or you may be able to type 'perldoc
|
||||
perlpod' into a Linux command-line to see the same text. We added a few POD
|
||||
keywords of our own to handle the table generation, and I'll cover those briefly
|
||||
below.
|
||||
|
||||
POD text can appear almost anywhere in a dbd.pod file. It always starts with a
|
||||
line "=[keyword] [additional text...]" where [keyword] is "title", "head1"
|
||||
through "head4" etc.. The POD text ends with a line "=cut". There must be a
|
||||
blank line above every POD line, and in many cases below it as well.
|
||||
|
||||
The POD keywords we have added are "title", "recordtype", "menu", "fields",
|
||||
"type", "read" and "write". The last 3 are less common but are used in some of
|
||||
the other record types such as the waveform and aSub records.
|
||||
|
||||
The most interesting of our new keywords is "fields", which takes a list of
|
||||
record field names on the same line after the keyword and generates an Markdown
|
||||
Table describing those fields based on the field description found in the DBD
|
||||
parts. In the ai documentation the first such table covers the DTYP and INP
|
||||
fields.
|
||||
|
||||
Note that the "=fields" line must appear inside the DBD's declaration of the
|
||||
record type, i.e. after the line
|
||||
|
||||
recordtype(ai) {
|
||||
|
||||
The "type", "read" and "write" POD keywords are used inside an individual record
|
||||
field declaration and provide information for the "Type", "Read" and "Write"
|
||||
columns of the field's table output for fields where this information is
|
||||
normally supplied by the record support code. Usage examples for these keywords
|
||||
can be found in the aai and aSub record types.
|
||||
|
||||
If you look at the L<aoRecord.dbd.pod> file you'll see that the POD there starts
|
||||
by documenting a record-specific menu definition. The "menu" keyword generates a
|
||||
table that lists all the choices found in the named menu. Any MENU fields in the
|
||||
field tables that refer to a locally-defined menu will generate a link to a
|
||||
document section which must be titled "Menu [menuName]".
|
||||
|
||||
=cut
|
||||
@@ -36,6 +36,7 @@ dbTestIoc_DBD += xLink.dbd
|
||||
dbTestIoc_DBD += devx.dbd
|
||||
dbTestIoc_DBD += jlinkz.dbd
|
||||
dbTestIoc_DBD += dbLinkdset.dbd
|
||||
dbTestIoc_DBD += dbCore.dbd
|
||||
TESTFILES += $(COMMON_DIR)/dbTestIoc.dbd ../xRecord.db
|
||||
|
||||
testHarness_SRCS += dbTestIoc_registerRecordDeviceDriver.cpp
|
||||
@@ -183,6 +184,11 @@ testHarness_SRCS += dbStaticTest.c
|
||||
TESTFILES += ../dbStaticTest.db
|
||||
TESTFILES += ../dbStaticTestAlias1.db
|
||||
TESTFILES += ../dbStaticTestAlias2.db
|
||||
TESTFILES += ../dbStaticTestAliasAgain1.db
|
||||
TESTFILES += ../dbStaticTestAliasAgain2.db
|
||||
TESTFILES += ../dbStaticTestAliasAgain3.db
|
||||
TESTFILES += ../dbStaticTestAliasAgainError1.db
|
||||
TESTFILES += ../dbStaticTestAliasAgainError2.db
|
||||
TESTFILES += ../dbStaticTestRemove.db
|
||||
TESTS += dbStaticTest
|
||||
|
||||
@@ -202,8 +208,8 @@ TESTSPEC_RTEMS = dbTestHarness.boot; epicsRunDbTests
|
||||
|
||||
TESTSCRIPTS_HOST += $(TESTS:%=%.t)
|
||||
ifneq ($(filter $(T_A),$(CROSS_COMPILER_RUNTEST_ARCHS)),)
|
||||
TESTPROD_RTEMS = $(TESTPROD_HOST)
|
||||
TESTSCRIPTS_RTEMS += $(TESTS:%=%.t)
|
||||
TESTPROD += $(TESTPROD_HOST)
|
||||
TESTSCRIPTS += $(TESTS:%=%.t)
|
||||
endif
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
@@ -130,9 +130,11 @@ static void check(short dbr_type) {
|
||||
off = Offset; req = 10; \
|
||||
memset(buf, 0, sizeof(buf)); \
|
||||
(void) dbPutField(&offaddr, DBR_LONG, &off, 1); \
|
||||
dbScanLock(dbChannelRecord(pch)); \
|
||||
pfl = db_create_read_log(pch); \
|
||||
testOk(pfl && pfl->type == dbfl_type_ref, "Valid pfl, type = ref"); \
|
||||
testOk(!dbChannelGetField(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
|
||||
testOk(!dbChannelGet(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
|
||||
dbScanUnlock(dbChannelRecord(pch)); \
|
||||
testOk(req == Size, "Got %ld elements (expected %d)", req, Size); \
|
||||
if (!testOk(!memcmp(buf, Expected, sizeof(Expected)), "Data correct")) \
|
||||
for (i=0; i<Size; i++) \
|
||||
@@ -174,6 +176,7 @@ static void check(short dbr_type) {
|
||||
off = Offset; req = 15; \
|
||||
memset(buf, 0, sizeof(buf)); \
|
||||
(void) dbPutField(&offaddr, DBR_LONG, &off, 1); \
|
||||
dbScanLock(dbChannelRecord(pch)); \
|
||||
pfl = db_create_read_log(pch); \
|
||||
pfl->type = dbfl_type_ref; \
|
||||
pfl->field_type = DBF_CHAR; \
|
||||
@@ -181,7 +184,8 @@ static void check(short dbr_type) {
|
||||
pfl->no_elements = 26; \
|
||||
pfl->dtor = freeArray; \
|
||||
pfl->u.r.field = epicsStrDup("abcdefghijklmnopqrsstuvwxyz"); \
|
||||
testOk(!dbChannelGetField(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
|
||||
testOk(!dbChannelGet(pch, DBR_LONG, buf, NULL, &req, pfl), "Got Field value"); \
|
||||
dbScanUnlock(dbChannelRecord(pch)); \
|
||||
testOk(req == Size, "Got %ld elements (expected %d)", req, Size); \
|
||||
if (!testOk(!memcmp(buf, Expected, sizeof(Expected)), "Data correct")) \
|
||||
for (i=0; i<Size; i++) \
|
||||
|
||||
@@ -40,6 +40,8 @@ void oneReport(unsigned level)
|
||||
void oneStats(unsigned *channels, unsigned *clients)
|
||||
{
|
||||
oneState = STATS_CALLED;
|
||||
if (channels) *channels = 2;
|
||||
if (clients) *clients = 1;
|
||||
}
|
||||
|
||||
int oneClient(char *pbuf, size_t len)
|
||||
@@ -128,8 +130,9 @@ MAIN(dbServerTest)
|
||||
char name[16];
|
||||
char *theName = "The One";
|
||||
int status;
|
||||
unsigned ch=0, cl=0;
|
||||
|
||||
testPlan(25);
|
||||
testPlan(35);
|
||||
|
||||
/* Prove that we handle substring names properly */
|
||||
epicsEnvSet("EPICS_IOC_IGNORE_SERVERS", "none ones");
|
||||
@@ -151,6 +154,9 @@ MAIN(dbServerTest)
|
||||
testDiag("Registering dbServer 'disabled'");
|
||||
testOk(dbRegisterServer(&disabled) == 0, "Registration accepted");
|
||||
|
||||
testOk(dbServerStats("one", &ch, &cl) == -1 && oneState == NOTHING_CALLED,
|
||||
"dbServerStats returns error before IOC running");
|
||||
|
||||
testDiag("Changing server state");
|
||||
dbInitServers();
|
||||
testOk(oneState == INIT_CALLED, "dbInitServers");
|
||||
@@ -163,8 +169,26 @@ MAIN(dbServerTest)
|
||||
|
||||
testDiag("Checking server methods called");
|
||||
dbsr(0);
|
||||
testOk(oneState == REPORT_CALLED, "dbsr called report()");
|
||||
testOk(oneState == REPORT_CALLED, "dbsr called one::report()");
|
||||
|
||||
testDiag("Checking stats functionality");
|
||||
testOk(dbServerStats("none", &ch, &cl) == 0, "Stats: unknown name ignored");
|
||||
testOk(dbServerStats("one", &ch, &cl) == 1 && oneState == STATS_CALLED,
|
||||
"dbServerStats('one') called one::stats()");
|
||||
testOk(ch == 2 && cl == 1, "Stats: ch==%d, cl==%d (expected 2, 1)", ch, cl);
|
||||
|
||||
testOk(dbServerStats("no-routines", &ch, &cl) == 0,
|
||||
"dbServerStats('no-routines') layer not counted");
|
||||
testOk(ch == 0 && cl == 0, "Stats: ch==%d, cl==%d (expected 0, 0)", ch, cl);
|
||||
|
||||
ch = 10; cl = 10; oneState = NOTHING_CALLED;
|
||||
testOk(dbServerStats(NULL, NULL, &cl) == 1 && oneState == STATS_CALLED,
|
||||
"dbServerStats(NULL, &cl) called one::stats()");
|
||||
testOk(dbServerStats(NULL, &ch, NULL) == 1 && oneState == STATS_CALLED,
|
||||
"dbServerStats(NULL, &ch) called one::stats()");
|
||||
testOk(ch == 2 && cl == 1, "Stats: ch==%d, cl==%d (expected 2, 1)", ch, cl);
|
||||
|
||||
testDiag("Checking client identification");
|
||||
oneSim = NULL;
|
||||
name[0] = 0;
|
||||
status = dbServerClient(name, sizeof(name));
|
||||
@@ -188,6 +212,9 @@ MAIN(dbServerTest)
|
||||
status = dbServerClient(name, sizeof(name));
|
||||
testOk(oneState != CLIENT_CALLED_KNOWN, "No call to client() when paused");
|
||||
|
||||
testOk(dbServerStats("one", &ch, &cl) == -1 && oneState != STATS_CALLED,
|
||||
"No call to stats() when paused");
|
||||
|
||||
dbStopServers();
|
||||
testOk(oneState == STOP_CALLED, "dbStopServers");
|
||||
testOk(dbUnregisterServer(&toolate) != 0, "No unreg' if not reg'ed");
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <dbUnitTest.h>
|
||||
#include <testMain.h>
|
||||
#include <epicsString.h>
|
||||
#include <iocsh.h>
|
||||
|
||||
|
||||
static void testEntryRemoved(const char *pv)
|
||||
@@ -321,16 +322,19 @@ static void testDbVerify(const char *record)
|
||||
dbFinishEntry(&entry);
|
||||
}
|
||||
|
||||
static void testWrongAliasRecord(const char *filename)
|
||||
static void testReadDatabase(const char *filename, int expectToFail)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
long status;
|
||||
dbPath(pdbbase,"." OSI_PATH_LIST_SEPARATOR "..");
|
||||
dbOpenFile(pdbbase, filename, &fp);
|
||||
if(!fp) {
|
||||
testAbort("Unable to read %s", filename);
|
||||
testAbort("Unable to open %s", filename);
|
||||
}
|
||||
testOk(dbReadDatabaseFP(&pdbbase, fp, NULL, NULL) != 0,
|
||||
"Wrong alias record in %s is expected to fail", filename);
|
||||
status = dbReadDatabaseFP(&pdbbase, fp, NULL, NULL);
|
||||
testOk(!status == !expectToFail,
|
||||
"Reading %s%s", filename,
|
||||
expectToFail ? " is expected to fail" : "");
|
||||
}
|
||||
|
||||
void dbTestIoc_registerRecordDeviceDriver(struct dbBase *);
|
||||
@@ -341,7 +345,7 @@ MAIN(dbStaticTest)
|
||||
char *ldirDup;
|
||||
FILE *fp = NULL;
|
||||
|
||||
testPlan(340);
|
||||
testPlan(350);
|
||||
testdbPrepare();
|
||||
|
||||
testdbReadDatabase("dbTestIoc.dbd", NULL, NULL);
|
||||
@@ -370,8 +374,21 @@ MAIN(dbStaticTest)
|
||||
}
|
||||
free(ldirDup);
|
||||
|
||||
testWrongAliasRecord("dbStaticTestAlias1.db");
|
||||
testWrongAliasRecord("dbStaticTestAlias2.db");
|
||||
testReadDatabase("dbStaticTestAlias1.db", 1);
|
||||
testReadDatabase("dbStaticTestAlias2.db", 1);
|
||||
|
||||
/* Test re-defining aliases */
|
||||
testReadDatabase("dbStaticTestAliasAgain1.db", 0);
|
||||
testReadDatabase("dbStaticTestAliasAgain1.db", 0);
|
||||
testReadDatabase("dbStaticTestAliasAgain2.db", 0);
|
||||
testReadDatabase("dbStaticTestAliasAgain2.db", 0);
|
||||
testReadDatabase("dbStaticTestAliasAgain3.db", 0);
|
||||
testReadDatabase("dbStaticTestAliasAgain3.db", 0);
|
||||
testReadDatabase("dbStaticTestAliasAgainError1.db", 1);
|
||||
testReadDatabase("dbStaticTestAliasAgainError2.db", 1);
|
||||
iocshCmd("var dbRecordsOnceOnly 1");
|
||||
testReadDatabase("dbStaticTestAliasAgain2.db", 1);
|
||||
testReadDatabase("dbStaticTestAliasAgain3.db", 1);
|
||||
|
||||
testEntry("testrec.VAL");
|
||||
testEntry("testalias.VAL");
|
||||
|
||||
4
modules/database/test/ioc/db/dbStaticTestAliasAgain1.db
Normal file
4
modules/database/test/ioc/db/dbStaticTestAliasAgain1.db
Normal file
@@ -0,0 +1,4 @@
|
||||
# Test re-load alias in record
|
||||
record(x, "testrecAgain") {
|
||||
alias("testaliasAgain1")
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user