Merged changes from 3.14 branch
Up to 3.14.12.4 release.
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
|
||||
# Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in file LICENSE that is included with this distribution.
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
#
|
||||
# $Revision-Id$
|
||||
|
||||
#
|
||||
# Common build definitions
|
||||
#
|
||||
@ -82,8 +83,6 @@ endif
|
||||
-include $(CONFIG)/os/CONFIG_SITE.Common.$(T_A)
|
||||
-include $(CONFIG)/os/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
|
||||
|
||||
endif
|
||||
|
||||
# Include <top>/cfg/CONFIG* definitions from tops defined in RELEASE* files
|
||||
#
|
||||
ifneq ($(CONFIG),$(TOP)/configure)
|
||||
@ -96,12 +95,12 @@ endif
|
||||
|
||||
# Include $(INSTALL_CFG)/CONFIG* definitions
|
||||
#
|
||||
ifndef T_A
|
||||
TOP_CFG_CONFIGS = $(wildcard $(INSTALL_CFG)/CONFIG*)
|
||||
ifneq ($(TOP_CFG_CONFIGS),)
|
||||
include $(TOP_CFG_CONFIGS)
|
||||
endif
|
||||
endif
|
||||
|
||||
endif # ifdef T_A
|
||||
|
||||
# User specific definitions
|
||||
#
|
||||
@ -111,3 +110,4 @@ ifdef T_A
|
||||
-include $(HOME)/configure/CONFIG_USER.Common.$(T_A)
|
||||
-include $(HOME)/configure/CONFIG_USER.$(EPICS_HOST_ARCH).$(T_A)
|
||||
endif
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
|
||||
# Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
# $Revision-Id$
|
||||
#
|
||||
@ -12,7 +12,7 @@
|
||||
#
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# Module developers can now define a new type of file, e.g. ABC,
|
||||
# Module developers can now define a new type of file, e.g. ABC,
|
||||
# so that files of type ABC will be installed into a directory
|
||||
# defined by INSTALL_ABC. This is done by creating a new CONFIG<name>
|
||||
# file, e.g. CONFIG_ABC, with the following lines:
|
||||
@ -24,8 +24,14 @@
|
||||
# $(INSTALL_LOCATION). The file type ABC should be target
|
||||
# architecture independent (alh files, medm files, edm files).
|
||||
#
|
||||
# Optional rules necessary for files of type ABC should be put in
|
||||
# a RULES_ABC file.
|
||||
# Files of type ABC are then installed into the INSTALL_ABC
|
||||
# directory by adding a line like the following to a Makefile.
|
||||
#
|
||||
# ABC += <filename1> <filename2> <filename3>
|
||||
#
|
||||
# Rules necessary to create files of type ABC should be put in
|
||||
# a RULES_ABC file. Variables used by those rules should appear
|
||||
# in a CONFIG_ABC file.
|
||||
#
|
||||
# The module developer installs new CONFIG* or RULES* files
|
||||
# into the directory $(INSTALL_LOCATION)/cfg by including the
|
||||
@ -33,16 +39,11 @@
|
||||
#
|
||||
# CFG += CONFIG_ABC RULES_ABC
|
||||
#
|
||||
# Files of type ABC are installed into INSTALL_ABC directory
|
||||
# by adding a line like the following to a Makefile.
|
||||
#
|
||||
# ABC += <filename1> <filename2> <filename3>
|
||||
#
|
||||
# Files in $(INSTALL_LOCATION)/cfg directory are now included by
|
||||
# the base config files so the definitions and rules are available
|
||||
# for use by later src directory Makefiles in the same module or
|
||||
# by other modules with a RELEASE line pointing to the TOP of
|
||||
# the module with RULES_ABC.
|
||||
# CONFIG and RULES files in the $(INSTALL_LOCATION)/cfg directory
|
||||
# are included by the Base config files so their definitions and
|
||||
# rules are available for use by later src directory Makefiles in
|
||||
# the same module, or by other modules with a RELEASE line that
|
||||
# points to the TOP of the module providing these files.
|
||||
|
||||
FILE_TYPE += ADL
|
||||
INSTALL_ADL = $(INSTALL_LOCATION)/adl
|
||||
@ -59,6 +60,6 @@ INSTALL_EDL = $(INSTALL_LOCATION)/edl
|
||||
FILE_TYPE += PERL_MODULES
|
||||
INSTALL_PERL_MODULES = $(INSTALL_LOCATION_LIB)/perl
|
||||
|
||||
INSTALLS_CFG= $(CFG:%= $(INSTALL_CFG)/%)
|
||||
INSTALLS_CFG = $(CFG:%= $(INSTALL_CFG)/%)
|
||||
DIRECTORY_TARGETS += $(foreach type, $(FILE_TYPE),$(INSTALL_$(type)))
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#
|
||||
# Currently Supporting:
|
||||
# cygwin-x86 (cygwin compiler used for host builds)
|
||||
# cygwin-x86_64 (cygwin compiler used for host builds)
|
||||
# darwin-ppc (PowerPC based Apple running OSX)
|
||||
# darwin-ppcx86 (Universal binaries for both CPUs)
|
||||
# darwin-x86 (Intel based Apple running OSX)
|
||||
@ -37,6 +38,7 @@
|
||||
# win32-x86 (MS Visual C++ compiler used for host builds)
|
||||
# win32-x86-mingw (MinGW compiler used for host builds)
|
||||
# windows-x64 (MS Visual C++ compiler used for host builds)
|
||||
# windows-x64-mingw (MinGW compiler used for host builds)
|
||||
|
||||
# Debugging builds:
|
||||
# linux-x86-debug (GNU compiler with -g option for host builds)
|
||||
|
@ -1,10 +1,10 @@
|
||||
#*************************************************************************
|
||||
# Copyright (c) 2006 UChicago Argonne LLC, as Operator of Argonne
|
||||
# Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
|
||||
# National Laboratory.
|
||||
# Copyright (c) 2002 The Regents of the University of California, as
|
||||
# Operator of Los Alamos National Laboratory.
|
||||
# EPICS BASE is distributed subject to a Software License Agreement found
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
# in the file LICENSE that is included with this distribution.
|
||||
#*************************************************************************
|
||||
# $Revision-Id$
|
||||
#
|
||||
@ -36,13 +36,11 @@ endif
|
||||
endif
|
||||
|
||||
#---------------------------------------------
|
||||
# Include existing and new $(INSTALL_CFG)/* definitions
|
||||
# Include our own $(INSTALL_CFG)/RULES* definitions
|
||||
#
|
||||
TOP_CFG_FILES = $(sort $(wildcard $(INSTALL_CFG)/RULES*) \
|
||||
$(wildcard $(INSTALL_CFG)/CONFIG*) \
|
||||
$(addprefix $(INSTALL_CFG)/,$(CFG)))
|
||||
ifneq ($(TOP_CFG_FILES),)
|
||||
include $(TOP_CFG_FILES)
|
||||
TOP_CFG_RULES = $(wildcard $(INSTALL_CFG)/RULES*)
|
||||
ifneq ($(TOP_CFG_RULES),)
|
||||
include $(TOP_CFG_RULES)
|
||||
endif
|
||||
|
||||
#---------------------------------------------------------------
|
||||
|
0
configure/Sample.Makefile
Executable file → Normal file
0
configure/Sample.Makefile
Executable file → Normal file
14
configure/os/CONFIG.Common.cygwin-x86_64
Normal file
14
configure/os/CONFIG.Common.cygwin-x86_64
Normal file
@ -0,0 +1,14 @@
|
||||
# CONFIG.Common.cygwin-x86_64
|
||||
#
|
||||
# $Revision-Id$
|
||||
# This file is maintained by the build community.
|
||||
#
|
||||
# Definitions for cygwin-x86_64 target builds
|
||||
# Sites may override these definitions in CONFIG_SITE.Common.cygwin-x86_64
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.Common.cygwin-x86
|
||||
|
||||
ARCH_DEP_CFLAGS = -m64
|
||||
ARCH_DEP_LDFLAGS = -m64
|
||||
|
15
configure/os/CONFIG.Common.windows-x64-mingw
Normal file
15
configure/os/CONFIG.Common.windows-x64-mingw
Normal file
@ -0,0 +1,15 @@
|
||||
# CONFIG.Common.windows-x64-mingw
|
||||
#
|
||||
# $Revision-Id$
|
||||
# This file is maintained by the build community.
|
||||
#
|
||||
# Definitions for windows-x64-mingw target builds
|
||||
# Sites may override these definitions in CONFIG_SITE.Common.windows-x64-mingw
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.Common.win32-x86-mingw
|
||||
|
||||
ARCH_CLASS = x64
|
||||
|
||||
ARCH_DEP_CFLAGS = -m64
|
||||
ARCH_DEP_LDFLAGS = -m64
|
10
configure/os/CONFIG.cygwin-x86_64.Common
Normal file
10
configure/os/CONFIG.cygwin-x86_64.Common
Normal file
@ -0,0 +1,10 @@
|
||||
# CONFIG.cygwin-x86_64.Common
|
||||
#
|
||||
# $Revision-Id$
|
||||
# This file is maintained by the build community.
|
||||
#
|
||||
# Definitions for cygwin-x86_64 host archs
|
||||
# Sites may override these definitions in CONFIG_SITE.cygwin-x86_64.Common
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.cygwin-x86.Common
|
11
configure/os/CONFIG.cygwin-x86_64.cygwin-x86_64
Normal file
11
configure/os/CONFIG.cygwin-x86_64.cygwin-x86_64
Normal file
@ -0,0 +1,11 @@
|
||||
# CONFIG.cygwin-x86_64.cygwin-x86_64
|
||||
#
|
||||
# $Revision-Id$
|
||||
#
|
||||
# Definitions for cygwin-x86_64 host - cygwin-x86_64 target builds
|
||||
# Sites may override these definitions in CONFIG_SITE.cygwin-x86_64.cygwin-x86_64
|
||||
#-------------------------------------------------------
|
||||
|
||||
# Include common gnu compiler definitions
|
||||
include $(CONFIG)/os/CONFIG.cygwin-x86.cygwin-x86
|
||||
|
@ -59,8 +59,10 @@ COMMANDLINE_LIBRARY=READLINE
|
||||
|
||||
GNU_DIR = /usr
|
||||
|
||||
CC = $(GNU_BIN)/cc
|
||||
CCC = $(GNU_BIN)/c++
|
||||
# Apple soft-links these compilers to clang/clang++
|
||||
CC = cc
|
||||
CCC = c++
|
||||
GNU = NO
|
||||
|
||||
#
|
||||
# Darwin shared libraries
|
||||
|
@ -9,14 +9,15 @@
|
||||
# Include common gnu compiler definitions
|
||||
include $(CONFIG)/CONFIG.gnuCommon
|
||||
|
||||
# gcc, g++, ar, ld, and ranlib must be in user's path
|
||||
CC = gcc
|
||||
CCC = g++
|
||||
AR = ar -rc
|
||||
LD = ld -r
|
||||
RANLIB = ranlib
|
||||
RES=.coff
|
||||
RCCMD = windres $(INCLUDES) $< $@
|
||||
CMPLR_PREFIX =
|
||||
|
||||
CC = $(CMPLR_PREFIX)gcc
|
||||
CCC = $(CMPLR_PREFIX)g++
|
||||
AR = $(CMPLR_PREFIX)ar -rc
|
||||
LD = $(CMPLR_PREFIX)ld -r
|
||||
RANLIB = $(CMPLR_PREFIX)ranlib
|
||||
RES = .coff
|
||||
RCCMD = $(CMPLR_PREFIX)windres $(INCLUDES) $< $@
|
||||
|
||||
# No -fPIC avoids "-fPIC ignored for target (all code is position independent)"
|
||||
SHRLIB_CFLAGS =
|
||||
@ -28,4 +29,4 @@ LOADABLE_SHRLIB_LDFLAGS = -shared \
|
||||
# Override linking with gcc library from CONFIG.gnuCommon
|
||||
GNU_LDLIBS_YES =
|
||||
|
||||
OP_SYS_LDLIBS = -lws2_32
|
||||
OP_SYS_LDLIBS = -lws2_32
|
||||
|
11
configure/os/CONFIG.windows-x64-mingw.Common
Normal file
11
configure/os/CONFIG.windows-x64-mingw.Common
Normal file
@ -0,0 +1,11 @@
|
||||
# CONFIG.windows-x64-mingw.Common
|
||||
#
|
||||
# $Revision-Id$
|
||||
# This file is maintained by the build community.
|
||||
#
|
||||
# Definitions for windows-x64-mingw host archs
|
||||
# Sites may override these definitions in CONFIG_SITE.windows-x64-mingw.Common
|
||||
#-------------------------------------------------------
|
||||
|
||||
include $(CONFIG)/os/CONFIG.win32-x86-mingw.Common
|
||||
|
11
configure/os/CONFIG.windows-x64-mingw.windows-x64-mingw
Normal file
11
configure/os/CONFIG.windows-x64-mingw.windows-x64-mingw
Normal file
@ -0,0 +1,11 @@
|
||||
# CONFIG.windows-x64-mingw.windows-x64-mingw
|
||||
#
|
||||
# $Revision-Id$
|
||||
# This file is maintained by the build community.
|
||||
#
|
||||
# Definitions for windows-x64-mingw target archs
|
||||
# Sites may override these definitions in CONFIG_SITE.windows-x64-mingw.windows-x64-mingw
|
||||
#-------------------------------------------------------
|
||||
|
||||
# Include common gnu compiler definitions
|
||||
include $(CONFIG)/os/CONFIG.win32-x86-mingw.win32-x86-mingw
|
14
configure/os/CONFIG_SITE.Common.cygwin-x86_64
Normal file
14
configure/os/CONFIG_SITE.Common.cygwin-x86_64
Normal file
@ -0,0 +1,14 @@
|
||||
# CONFIG_SITE.Common.cygwin-x86_64
|
||||
#
|
||||
# $Revision-Id$
|
||||
#
|
||||
# Site Specific definitions for cygwin-x86_64 target
|
||||
# Only the local epics system manager should modify this file
|
||||
|
||||
# If readline is installed uncomment the following line
|
||||
# to add command-line editing and history support
|
||||
#COMMANDLINE_LIBRARY = READLINE
|
||||
|
||||
# Uncomment the following line if readline has problems
|
||||
#LDLIBS_READLINE = -lreadline -lcurses
|
||||
|
@ -14,20 +14,21 @@ ARCH_CLASS = x86_64
|
||||
#ARCH_CLASS = i386 x86_64
|
||||
|
||||
#
|
||||
# Comment out the following lines to build with Apple's GCC instead of CLANG.
|
||||
# Uncomment the following 3 lines to build with Apple's GCC instead of CLANG.
|
||||
#
|
||||
CMPLR_CLASS = clang
|
||||
CC = clang
|
||||
CCC = clang++
|
||||
GNU = NO
|
||||
#CMPLR_CLASS = gcc
|
||||
#CC = gcc
|
||||
#CCC = g++
|
||||
#GNU = YES
|
||||
|
||||
|
||||
# To use MacPorts GCC, comment out ALL the settings above this line,
|
||||
# then uncomment (and modify if necessary) the following instead:
|
||||
# To use MacPorts GCC uncomment (and modify if necessary) the following:
|
||||
|
||||
#GNU_DIR = /opt/local
|
||||
#CMPLR_CLASS = gcc
|
||||
#CC = $(GNU_BIN)/gcc -m64
|
||||
#CCC = $(GNU_BIN)/g++ -m64
|
||||
#GNU = YES
|
||||
|
||||
# If you see this or similar errors while building in the src/cap5 directory
|
||||
# gcc: error: unrecognized option '-no-cpp-precomp'
|
||||
|
@ -16,11 +16,16 @@
|
||||
#
|
||||
# Xcode 4.5 dropped support for the ARMv6.
|
||||
#
|
||||
# ARMv7s devices: iPhone 5
|
||||
# ARMv8 (arm64) devices: iPhone 5S
|
||||
# ARMv7s devices: iPhone 5 and 5C, iPad Gen 4
|
||||
# ARMv7 devices: iPhone 3GS, 4 and 4S, iPod Touch Gen 3 to 5
|
||||
# iPad Gen 1 to 3, iPad Mini, Apple TV Gen 2 and 3
|
||||
# ARMv6 devices: iPhone 1 and 3G, iPod Touch Gen 1 and 2
|
||||
# All other devices are ARMv7
|
||||
|
||||
ARCH_CLASS = armv7 armv7s
|
||||
#ARCH_CLASS = arm64
|
||||
#ARCH_CLASS = armv7s arm64
|
||||
ARCH_CLASS = armv7 armv7s arm64
|
||||
#ARCH_CLASS = armv7 armv7s
|
||||
#ARCH_CLASS = armv7
|
||||
#ARCH_CLASS = armv6 armv7
|
||||
#ARCH_CLASS = armv6
|
||||
|
@ -14,11 +14,12 @@
|
||||
#IOS_VERSION = 5.0
|
||||
#IOS_VERSION = 5.1
|
||||
#IOS_VERSION = 6.0
|
||||
IOS_VERSION = 6.1
|
||||
#IOS_VERSION = 6.1
|
||||
IOS_VERSION = 7.0
|
||||
|
||||
|
||||
# Which compiler to use:
|
||||
# CLANG is preferred for recent versions of Xcode
|
||||
# CLANG is required for Xcode 5.0 and later
|
||||
# LLVM_GNU uses the llvm-gcc and llvm-g++ compilers
|
||||
# GNU is needed for older versions of Xcode
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
# CONFIG_SITE.windows-x64-mingw.windows-x64-mingw
|
||||
#
|
||||
# $Revision-Id$
|
||||
#
|
||||
# Site Specific definitions for windows-x64-mingw target
|
||||
# Only the local epics system manager should modify this file
|
||||
|
||||
# Prefix for mingw compiler from cygwin
|
||||
#CMPLR_PREFIX = x86_64-w64-mingw32-
|
@ -165,7 +165,8 @@ $Date$</span></small></p>
|
||||
<li><a href="#ca_pend_io">block for certain requests to complete</a></li>
|
||||
<li><a href="#ca_test_io">test to see if certain requests have
|
||||
completed</a></li>
|
||||
<li><a href="#ca_pend_event">process CA client library background activities</a></li>
|
||||
<li><a href="#ca_pend_event">process CA client library background
|
||||
activities</a></li>
|
||||
<li><a href="#ca_flush_io">flush outstanding requests to the server</a></li>
|
||||
<li><a href="#ca_add_exception_event">replace the default exception
|
||||
handler</a></li>
|
||||
@ -454,26 +455,20 @@ Environment</a> below.</p>
|
||||
|
||||
<h3><a name="firewall">Firewalls</a></h3>
|
||||
|
||||
<p>If you want channel access clients on a machine to be able to see
|
||||
beacons and replies to broadcast PV search requests, you need to permit
|
||||
inbound UDP packets with source port EPICS_CA_SERVER_PORT (default is 5064)
|
||||
or destination port EPICS_CA_REPEATER_PORT (default is 5065). On systems
|
||||
using iptables this can be accomplished by rules like</p>
|
||||
|
||||
<pre>
|
||||
-A INPUT -s 192.168.0.0/22 -p udp --sport 5064 -j ACCEPT
|
||||
-A INPUT -s 192.168.0.0/22 -p udp --dport 5065 -j ACCEPT
|
||||
</pre>
|
||||
<p>If you want channel access clients on a machine to be able to see beacons
|
||||
and replies to broadcast PV search requests, you need to permit inbound UDP
|
||||
packets with source port EPICS_CA_SERVER_PORT (default is 5064) or destination
|
||||
port EPICS_CA_REPEATER_PORT (default is 5065). On systems using iptables this
|
||||
can be accomplished by rules like</p>
|
||||
<pre> -A INPUT -s 192.168.0.0/22 -p udp --sport 5064 -j ACCEPT
|
||||
-A INPUT -s 192.168.0.0/22 -p udp --dport 5065 -j ACCEPT</pre>
|
||||
|
||||
<p>If you want channel access servers (e.g. "soft IOCs") on a machine to be
|
||||
able to be seen by clients, you need to permit inbound TCP or UDP packets with
|
||||
destination port EPICS_CA_SERVER_PORT (default is 5064).
|
||||
On systems using iptables this can be accomplished by rules like</p>
|
||||
|
||||
<pre>
|
||||
-A INPUT -s 192.168.0.0/22 -p udp --dport 5064 -j ACCEPT
|
||||
-A INPUT -s 192.168.0.0/22 -p tcp --dport 5064 -j ACCEPT
|
||||
</pre>
|
||||
destination port EPICS_CA_SERVER_PORT (default is 5064). On systems using
|
||||
iptables this can be accomplished by rules like</p>
|
||||
<pre> -A INPUT -s 192.168.0.0/22 -p udp --dport 5064 -j ACCEPT
|
||||
-A INPUT -s 192.168.0.0/22 -p tcp --dport 5064 -j ACCEPT</pre>
|
||||
|
||||
<p>In all cases the "-s 192.168.0.0/22" specifies the range of addresses from
|
||||
which you wish to accept packets.</p>
|
||||
@ -498,9 +493,8 @@ broadcast address of that subnet is added to the list. For each point to point
|
||||
interface found, the destination address of that link is added to the list.
|
||||
This automatic server address list initialization can be disabled if the EPICS
|
||||
environment variable EPICS_CA_AUTO_ADDR_LIST exists and its value is either
|
||||
of "no" or "NO". The typical default is to enable network interface
|
||||
introspection driven initialization with EPICS_CA_AUTO_ADDR_LIST set to "YES"
|
||||
or "yes".</p>
|
||||
"no" or "NO". The typical default is to enable network interface introspection
|
||||
driven initialization with EPICS_CA_AUTO_ADDR_LIST set to "YES" or "yes".</p>
|
||||
|
||||
<p>Following network interface introspection, any IP addresses specified in the
|
||||
EPICS environment variable EPICS_CA_ADDR_LIST are added to the list of
|
||||
@ -511,8 +505,8 @@ CA servers unless a CA proxy (gateway) is installed. The addresses in
|
||||
EPICS_CA_ADDR_LIST may be dotted IP addresses or host names if the local OS has
|
||||
support for host name to IP address translation. When multiple names are added
|
||||
to EPICS_CA_ADDR_LIST they must be separated by white space. There is no
|
||||
requirement that the addresses specified in the EPICS_CA_ADDR_LIST be
|
||||
broadcast addresses, but this will often be the most convenient choice.</p>
|
||||
requirement that the addresses specified in the EPICS_CA_ADDR_LIST be broadcast
|
||||
addresses, but this will often be the most convenient choice.</p>
|
||||
|
||||
<p>For any IP addresses specified in the EPICS environment variable
|
||||
EPICS_CA_NAME_SERVERS, TCP connections are opened and used for CA client name
|
||||
@ -560,7 +554,7 @@ default to EPICS_CA_SERVER_PORT.</p>
|
||||
<p>Frequently vxWorks systems boot by default with routes limiting access only
|
||||
to the local subnet. If a EPICS system is operating in a WAN environment it may
|
||||
be necessary to configure routes into the vxWorks system which enable a vxWorks
|
||||
based CA server to respond to requests originating outside it's subnet. These
|
||||
based CA server to respond to requests originating outside its subnet. These
|
||||
routing restrictions can also apply to vxWorks base CA clients communicating
|
||||
with off subnet servers. An EPICS system manager can implement an rudimentary,
|
||||
but robust, form of access control for a particular host by not providing
|
||||
@ -865,8 +859,8 @@ the contents of EPICS_CA_ADDR_LIST is used to augment the list. Otherwise, the
|
||||
list is not augmented.</p>
|
||||
|
||||
<p>The EPICS_CAS_BEACON_PORT parameter specifies the destination port for
|
||||
server beacons. The only exception to this occurs when ports are specified
|
||||
in EPICS_CAS_BEACON_ADDR_LIST or possibly in EPICS_CA_ADDR_LIST. If
|
||||
server beacons. The only exception to this occurs when ports are specified in
|
||||
EPICS_CAS_BEACON_ADDR_LIST or possibly in EPICS_CA_ADDR_LIST. If
|
||||
EPICS_CAS_BEACON_PORT is not specified then beacons are sent to the port
|
||||
specified in EPICS_CA_REPEATER_PORT.</p>
|
||||
|
||||
@ -874,7 +868,7 @@ specified in EPICS_CA_REPEATER_PORT.</p>
|
||||
|
||||
<p>The parameter EPICS_CAS_INTF_ADDR_LIST allows a ca server to bind itself to,
|
||||
and therefore accept messages only over, a limited set of the local host's
|
||||
network interfaces (each specified by it's IP address). On UNIX systems type
|
||||
network interfaces (each specified by its IP address). On UNIX systems type
|
||||
"netstat -i" (type "ipconfig" on windows) to see a list of the local host's
|
||||
network interfaces. Specifically, UDP search messages addressed to both the IP
|
||||
addresses in EPICS_CAS_INTF_ADDR_LIST and also to the broadcast addresses of
|
||||
@ -1885,7 +1879,7 @@ order to connect to this new beacon-out-of-range server. The typical situation
|
||||
where a client would not see the server's beacon might be when the client isnt
|
||||
on the same IP subnet as the server, and the client's EPICS_CA_ADDR_LIST was
|
||||
modified to include a destination address for the server, but the server's
|
||||
beacon address list was not modified so that it's beacons are received by the
|
||||
beacon address list was not modified so that its beacons are received by the
|
||||
client.</p>
|
||||
|
||||
<h4><a name="Server1">A Server's IP Address Was Changed</a></h4>
|
||||
@ -2017,8 +2011,8 @@ OS and even between different versions of the same OS.</p>
|
||||
<p>If the subscription update producer in the server produces subscription
|
||||
updates faster than the subscription update consumer in the client consumes
|
||||
them, then events have to be discarded if the buffering in the server
|
||||
isn't allowed to grow to an infinite size. This is a law of nature
|
||||
- based on queuing theory of course.</p>
|
||||
isn't allowed to grow to an infinite size. This is a law of nature –
|
||||
based on queuing theory of course.</p>
|
||||
|
||||
<p>What is done depends on the version of the CA server. All server versions
|
||||
place quotas on the maximum number of subscription updates allowed on the
|
||||
@ -2040,10 +2034,10 @@ server to resume with subscription updates. This prevents slow clients from
|
||||
getting time warped, but also guarantees that intervening events are discarded
|
||||
until the slow client catches up.</p>
|
||||
|
||||
<p>There is currently no message on the IOC's console when a
|
||||
particular client is slow on the uptake. A message of this type used to exist
|
||||
many years ago, but it was a source of confusion (and what we will call
|
||||
message noise) so it was removed. </p>
|
||||
<p>There is currently no message on the IOC's console when a particular client
|
||||
is slow on the uptake. A message of this type used to exist many years ago, but
|
||||
it was a source of confusion (and what we will call message noise) so it was
|
||||
removed.</p>
|
||||
|
||||
<p>There is unfortunately no field in the protocol allowing the server to
|
||||
indicate that an intervening subscription update was discarded. We should
|
||||
@ -2320,7 +2314,7 @@ int main ( int argc, char ** argv )
|
||||
|
||||
<p>Certain CA client initiated requests asynchronously execute an application
|
||||
supplied call back in the client process when a response arrives. The functions
|
||||
ca_put_callback, ca_get_callback, and ca_add_event all request notification of
|
||||
ca_put_callback, ca_get_callback, and ca_create_subscription all request notification of
|
||||
asynchronous completion via this mechanism. The <code>event_handler_args
|
||||
</code>structure is passed <em>by value</em> to the application supplied
|
||||
callback. In this structure the <code>dbr</code> field is a void pointer to any
|
||||
@ -2355,8 +2349,8 @@ void myCallback ( struct event_handler_args args )
|
||||
<h3><a name="Channel1">Channel Access Exceptions</a></h3>
|
||||
|
||||
<p>When the server detects a failure, and there is no client call back function
|
||||
attached to the request, an exception handler is executed in the client.
|
||||
The default exception handler prints a message on the console and exits if the
|
||||
attached to the request, an exception handler is executed in the client. The
|
||||
default exception handler prints a message on the console and exits if the
|
||||
exception condition is severe. Certain internal exceptions within the CA client
|
||||
library, and failures detected by the SEVCHK macro may also cause the exception
|
||||
handler to be invoked. To modify this behavior see <a
|
||||
@ -2423,12 +2417,12 @@ same process).</p>
|
||||
all OS (in past releases the library was thread safe only on vxWorks). When the
|
||||
client library is initialized the programmer may specify if preemptive callback
|
||||
is to be enabled. Preemptive callback is disabled by default. If preemptive
|
||||
callback is enabled, then the user's callback functions might be called by
|
||||
CA's auxiliary threads when the main initiating channel access thread is not
|
||||
inside of a function in the channel access client library. Otherwise, the
|
||||
user's callback functions will be called only when the main initiating channel
|
||||
access thread is executing inside of the CA client library. When the CA client
|
||||
library invokes a user's callback function, it will always wait for the current
|
||||
callback is enabled, then the user's callback functions might be called by CA's
|
||||
auxiliary threads when the main initiating channel access thread is not inside
|
||||
of a function in the channel access client library. Otherwise, the user's
|
||||
callback functions will be called only when the main initiating channel access
|
||||
thread is executing inside of the CA client library. When the CA client library
|
||||
invokes a user's callback function, it will always wait for the current
|
||||
callback to complete prior to executing another callback function. Programmers
|
||||
enabling preemptive callback should be familiar with using mutex locks to
|
||||
create a reliable multi-threaded program.</p>
|
||||
@ -2457,10 +2451,10 @@ address space (process) to be independent of each other. For example, the
|
||||
database CA links and the sequencer are designed to not use the same CA client
|
||||
library threads, network circuits, and data structures. Each thread that calls
|
||||
<a href="#ca_context_create">ca_context_create()</a> for the first time either
|
||||
directly or implicitly when calling any CA library function for the first
|
||||
time, creates a CA client library context. A CA client library context contains
|
||||
all of the threads, network circuits, and data structures required to connect
|
||||
and communicate with the channels that a CA client application has created. The
|
||||
directly or implicitly when calling any CA library function for the first time,
|
||||
creates a CA client library context. A CA client library context contains all
|
||||
of the threads, network circuits, and data structures required to connect and
|
||||
communicate with the channels that a CA client application has created. The
|
||||
priority of auxiliary threads spawned by the CA client library are at fixed
|
||||
offsets from the priority of the thread that called <a
|
||||
href="#ca_context_create">ca_context_create()</a>. An application specific
|
||||
@ -2530,9 +2524,9 @@ questionable practice for the following reasons.</p>
|
||||
<ul>
|
||||
<li>The vxWorks shell thread runs at the very highest priority in the system
|
||||
and therefore socket calls are made at a priority that is above the
|
||||
priority of tNetTask - a practice that has caused the WRS IP kernel
|
||||
to get sick in the past. That symptom was observed some time ago, but we
|
||||
don't know if WRS has fixed the problem.</li>
|
||||
priority of tNetTask. This has caused problems with the WRS IP kernel in
|
||||
the past. That symptom was observed some time ago, but we don't know if
|
||||
WRS has fixed the problem.</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>The vxWorks shell thread runs at the very highest priority in the system
|
||||
@ -2679,7 +2673,7 @@ on a channel.</p>
|
||||
|
||||
<p>The circuit may be initially connected or disconnected depending on the
|
||||
state of the network and the location of the channel. A channel will only enter
|
||||
a connected state after server's address is determined, and only if channel
|
||||
a connected state after the server's address is determined, and only if channel
|
||||
access successfully establishes a virtual circuit through the network to the
|
||||
server. Channel access routines that send a request to a server will return
|
||||
ECA_DISCONNCHID if the channel is currently disconnected.</p>
|
||||
@ -2689,7 +2683,7 @@ a connected state.</p>
|
||||
<ul>
|
||||
<li>The first and simplest method requires that you call ca_pend_io(), and
|
||||
wait for successful completion, prior to using a channel that was created
|
||||
specifying a nil connection call back function pointer.</li>
|
||||
specifying a nill connection call back function pointer.</li>
|
||||
<li>The second method requires that you register a connection handler by
|
||||
supplying a valid connection callback function pointer. This connection
|
||||
handler is called whenever the connection state of the channel changes. If
|
||||
@ -2725,10 +2719,10 @@ time.</p>
|
||||
<dt><code>USERFUNC</code></dt>
|
||||
<dd>Optional address of the user's call back function to be run when the
|
||||
connection state changes. Casual users of channel access may decide to
|
||||
set this field to nil or 0 if they do not need to have a call back
|
||||
set this field to nill or 0 if they do not need to have a call back
|
||||
function run in response to each connection state change event.
|
||||
<p>The following structure is passed <em>by value </em>to the user's
|
||||
connection connection callback function. The <code>op</code> field will
|
||||
connection callback function. The <code>op</code> field will
|
||||
be set by the CA client library to <code>CA_OP_CONN_UP</code> when the
|
||||
channel connects, and to <code>CA_OP_CONN_DOWN</code> when the channel
|
||||
disconnects. See <code><a href="#ca_puser">ca_puser</a></code> if the
|
||||
@ -2745,7 +2739,7 @@ time.</p>
|
||||
<dd>The value of this void pointer argument is retained in
|
||||
storage associated with the specified channel. See the MACROS manual page
|
||||
for reading and writing this field. Casual users of channel access may
|
||||
wish to set this field to nil or 0.</dd>
|
||||
wish to set this field to nill or 0.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><code>PRIORITY</code></dt>
|
||||
@ -2853,7 +2847,7 @@ This allows several requests to be efficiently combined into one message.</p>
|
||||
<h4>Description (IOC Database Specific)</h4>
|
||||
|
||||
<p>A CA put request causes the record to process if the record's SCAN field is
|
||||
set to passive, and the field being written has it's process passive attribute
|
||||
set to passive, and the field being written has its process passive attribute
|
||||
set to true. If such a record is already processing when a put request is
|
||||
initiated the specified field is written immediately, and the record is
|
||||
scheduled to process again as soon as it finishes processing. Earlier instances
|
||||
@ -2861,20 +2855,19 @@ of multiple put requests initiated while the record is being processing may be
|
||||
discarded, but the last put request initiated is always written and
|
||||
processed.</p>
|
||||
|
||||
<p>A CA put <span style="font-style: italic;">callback</span> request causes
|
||||
the record to process if the record's SCAN field is set to passive, and the
|
||||
field being written has it's process passive attribute set to true. For such a
|
||||
record, the user's put callback function is not called until after the record,
|
||||
and any records that the record links to, finish processing. If such a record
|
||||
is already processing when a put <span
|
||||
style="font-style: italic;">callback</span> request is initiated the put <span
|
||||
style="font-style: italic;">callback</span> request is postponed until the
|
||||
record, and any records it links to, finish processing.</p>
|
||||
<p>A CA put <em>callback</em> request causes the record to process if the
|
||||
record's SCAN field is set to passive, and the field being written has its
|
||||
process passive attribute set to true. For such a record, the user's put
|
||||
callback function is not called until after the record, and any records that
|
||||
the record links to, finish processing. If such a record is already processing
|
||||
when a put <em>callback</em> request is initiated the put <em>callback</em>
|
||||
request is postponed until the record, and any records it links to, finish
|
||||
processing.</p>
|
||||
|
||||
<p>If the record's SCAN field is not set to passive, or the field being written
|
||||
has it's process passive attribute set to false then the CA put or CA put
|
||||
callback request cause the specified field to be immediately written, but they
|
||||
do not cause the record to be processed.</p>
|
||||
has its process passive attribute set to false then the CA put or CA put
|
||||
<em>callback</em> request cause the specified field to be immediately written,
|
||||
but they do not cause the record to be processed.</p>
|
||||
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
@ -3056,10 +3049,10 @@ int ca_create_subscription ( chtype TYPE, unsigned long COUNT,
|
||||
invoked whenever the process variable undergoes significant state changes. A
|
||||
significant change can be a change in the process variable's value, alarm
|
||||
status, or alarm severity. In the process control function block database the
|
||||
deadband field determines the magnitude of a significant change for for the
|
||||
deadband field determines the magnitude of a significant change for the
|
||||
process variable's value. Each call to this function consumes resources in the
|
||||
client library and potentially a CA server until one of ca_clear_channel or
|
||||
ca_clear_event is called.</p>
|
||||
ca_clear_subscription is called.</p>
|
||||
|
||||
<p>Subscriptions may be installed or canceled against both connected and
|
||||
disconnected channels. The specified USERFUNC is called once immediately after
|
||||
@ -3067,7 +3060,7 @@ the subscription is installed with the process variable's current state if the
|
||||
process variable is connected. Otherwise, the specified USERFUNC is called
|
||||
immediately after establishing a connection (or reconnection) with the process
|
||||
variable. The specified USERFUNC is called immediately with the process
|
||||
variable's current state from within ca_add_event() if the client and the
|
||||
variable's current state from within ca_create_subscription() if the client and the
|
||||
process variable share the same address space.</p>
|
||||
|
||||
<p>If a subscription is installed on a channel in a disconnected state then the
|
||||
@ -3124,8 +3117,8 @@ indicating the current state of the channel.</p>
|
||||
<dl>
|
||||
<dt><code>PEVID</code></dt>
|
||||
<dd>This is a pointer to user supplied event id which is overwritten if
|
||||
successful. This event id can later be used to clear a specific
|
||||
event. This option may may be omitted by passing a nil pointer.</dd>
|
||||
successful. This event id can later be used to clear a specific event.
|
||||
This option may be omitted by passing a nill pointer.</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><code>MASK</code></dt>
|
||||
@ -3173,7 +3166,7 @@ int ca_clear_subscription ( evid EVID );</pre>
|
||||
|
||||
<p>Cancel a subscription.</p>
|
||||
|
||||
<p>All ca_clear_event() requests such as the above are accumulated (buffered)
|
||||
<p>All cancel-subscription requests such as the above are accumulated (buffered)
|
||||
and not forwarded to the server until one of ca_flush_io, ca_pend_io,
|
||||
ca_pend_event, or ca_sg_pend are called. This allows several requests to be
|
||||
efficiently sent together in one message.</p>
|
||||
@ -3181,7 +3174,7 @@ efficiently sent together in one message.</p>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>EVID</dt>
|
||||
<dd>event id returned by ca_add_event()</dd>
|
||||
<dd>event id returned by ca_create_subscription()</dd>
|
||||
</dl>
|
||||
|
||||
<h4>Returns</h4>
|
||||
@ -3232,9 +3225,9 @@ activities</em>.</p>
|
||||
network delays such as Ethernet collision exponential back off until
|
||||
retransmission delays which can be quite long on overloaded networks.</p>
|
||||
|
||||
<p>Unlike <code><a href="#ca_pend_event">ca_pend_event</a></code>, this routine will
|
||||
not process CA's background activities if none of the selected IO requests are
|
||||
pending.</p>
|
||||
<p>Unlike <code><a href="#ca_pend_event">ca_pend_event</a></code>, this routine
|
||||
will not process CA's background activities if none of the selected IO requests
|
||||
are pending.</p>
|
||||
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
@ -3297,7 +3290,7 @@ activity is processed for TIMEOUT seconds.</p>
|
||||
background activity is processed.</p>
|
||||
|
||||
<p>The ca_pend_event function will <em>not</em> return before the specified
|
||||
time-out expires and all unfinished channel access labor has been processed,
|
||||
timeout expires and all unfinished channel access labor has been processed,
|
||||
and unlike <code><a href="#ca_pend_io">ca_pend_io</a></code> returning from the
|
||||
function does <em>not </em>indicate anything about the status of pending IO
|
||||
requests.</p>
|
||||
@ -3409,7 +3402,7 @@ field should not be used.</p>
|
||||
<dl>
|
||||
<dt><code>USERFUNC</code></dt>
|
||||
<dd>Address of user callback function to be executed when an exceptions
|
||||
occur. Passing a nil value causes the default exception handler to be
|
||||
occur. Passing a nill value causes the default exception handler to be
|
||||
reinstalled. The following structure is passed by value to the user's
|
||||
callback function. Currently, the <code>op</code> field can be one of
|
||||
<code>CA_OP_GET, CA_OP_PUT, CA_OP_CREATE_CHANNEL, CA_OP_ADD_EVENT,
|
||||
@ -3544,7 +3537,7 @@ default handler uses fprintf to send messages to 'stderr'.</p>
|
||||
<dl>
|
||||
<dt><code>PFUNC</code></dt>
|
||||
<dd>The address of a user supplied call back handler to be invoked when CA
|
||||
prints diagnostic messages. Installing a nil pointer will cause the
|
||||
prints diagnostic messages. Installing a nill pointer will cause the
|
||||
default call back handler to be reinstalled.</dd>
|
||||
</dl>
|
||||
|
||||
@ -3591,7 +3584,7 @@ specified channel.</p>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><code>PFUNC</code></dt>
|
||||
<dd>Address of user supplied call back function. A nil pointer uninstalls
|
||||
<dd>Address of user supplied call back function. A nill pointer uninstalls
|
||||
the current handler. The following arguments are passed <em>by value</em>
|
||||
to the supplied callback handler.
|
||||
<pre>typedef struct ca_access_rights {
|
||||
@ -3934,12 +3927,12 @@ prints diagnostics to standard out.</p>
|
||||
|
||||
<h4>Examples</h4>
|
||||
<pre>void ca_test_event ();
|
||||
status = ca_add_event ( type, chid, ca_test_event, NULL, NULL );
|
||||
status = ca_create_subscription ( type, chid, ca_test_event, NULL, NULL );
|
||||
SEVCHK ( status, .... );</pre>
|
||||
|
||||
<h4>See Also</h4>
|
||||
|
||||
<p><a href="#ca_add_event">ca_add_event</a>()</p>
|
||||
<p><a href="#ca_add_event">ca_create_subscription</a>()</p>
|
||||
|
||||
<h3><code><a name="ca_sg_create">ca_sg_create()</a></code></h3>
|
||||
<pre>#include <cadef.h>
|
||||
@ -4285,7 +4278,7 @@ ca_client_status() prints information about the calling threads CA context.</p>
|
||||
|
||||
<h4>Description</h4>
|
||||
|
||||
<p>Returns a pointer to the current thread's CA context. If none then nil is
|
||||
<p>Returns a pointer to the current thread's CA context. If none then nill is
|
||||
returned.</p>
|
||||
|
||||
<h4>See Also</h4>
|
||||
@ -4318,12 +4311,11 @@ preemptively from more than one thread.</p>
|
||||
|
||||
<h4>Returns</h4>
|
||||
|
||||
<p>ECA_ISATTACHED - already attached to a CA context</p>
|
||||
<p>ECA_NORMAL - Normal successful completion</p>
|
||||
|
||||
<p>ECA_NOTTHREADED - the specified context is non-preemptive and therefore does
|
||||
not allow other threads to join</p>
|
||||
<p>ECA_NOTTHREADED - Context is not preemptive so cannot be joined</p>
|
||||
|
||||
<p>ECA_ISATTACHED - the current thread is already attached to a CA context</p>
|
||||
<p>ECA_ISATTACHED - Thread already attached to a CA context</p>
|
||||
|
||||
<h4>See Also</h4>
|
||||
|
||||
|
0
src/ca/client/SearchDest.h
Executable file → Normal file
0
src/ca/client/SearchDest.h
Executable file → Normal file
0
src/ca/client/ca.rc
Executable file → Normal file
0
src/ca/client/ca.rc
Executable file → Normal file
@ -22,12 +22,12 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "envDefs.h"
|
||||
#include "epicsAssert.h"
|
||||
#include "epicsStdioRedirect.h"
|
||||
#include "errlog.h"
|
||||
#include "osiWireFormat.h"
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
* simple stub for testing monitors
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "epicsStdioRedirect.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "cadef.h"
|
||||
|
@ -594,7 +594,7 @@ size_t gdd::describedDataSizeBytes(void) const
|
||||
size_t gdd::getTotalSizeBytes(void) const
|
||||
{
|
||||
size_t sz;
|
||||
unsigned long tsize;
|
||||
size_t tsize;
|
||||
const gdd* pdd;
|
||||
|
||||
// add up size of bounds + size of this DD
|
||||
@ -924,8 +924,8 @@ int gdd::flattenDDs(gddContainer* dd, void* buf, size_t size)
|
||||
gddStatus gdd::convertOffsetsToAddress(void)
|
||||
{
|
||||
aitUint8* pdd = (aitUint8*)this;
|
||||
unsigned long bnds = (unsigned long)(bounds);
|
||||
unsigned long dp = (unsigned long)(dataPointer());
|
||||
size_t bnds = (size_t)(bounds);
|
||||
size_t dp = (size_t)(dataPointer());
|
||||
gdd* tdd;
|
||||
gddContainer* cdd;
|
||||
gddCursor cur;
|
||||
@ -943,7 +943,7 @@ gddStatus gdd::convertOffsetsToAddress(void)
|
||||
|
||||
for(tdd=cur.first();tdd;tdd=cur.next())
|
||||
{
|
||||
if(tdd->next()) tdd->setNext((gdd*)(pdd+(unsigned long)tdd->next()));
|
||||
if(tdd->next()) tdd->setNext((gdd*)(pdd+(size_t)tdd->next()));
|
||||
tdd->convertOffsetsToAddress();
|
||||
}
|
||||
}
|
||||
@ -962,7 +962,7 @@ gddStatus gdd::convertOffsetsToAddress(void)
|
||||
if(str[i].string())
|
||||
{
|
||||
cstr=str[i].string();
|
||||
str[i].installBuf((char *)(pdd+(unsigned long)cstr),
|
||||
str[i].installBuf((char *)(pdd+(size_t)cstr),
|
||||
str[i].length(), str[i].length()+1);
|
||||
}
|
||||
else
|
||||
@ -982,7 +982,7 @@ gddStatus gdd::convertOffsetsToAddress(void)
|
||||
if(str->string())
|
||||
{
|
||||
cstr=str->string();
|
||||
str->installBuf((char *)(pdd+(unsigned long)cstr),
|
||||
str->installBuf((char *)(pdd+(size_t)cstr),
|
||||
str->length(), str->length()+1u);
|
||||
}
|
||||
else
|
||||
|
0
src/ca/legacy/gdd/gdd.rc
Executable file → Normal file
0
src/ca/legacy/gdd/gdd.rc
Executable file → Normal file
0
src/ca/legacy/pcas/build/cas.rc
Executable file → Normal file
0
src/ca/legacy/pcas/build/cas.rc
Executable file → Normal file
@ -884,7 +884,7 @@ caStatus casStrmClient::monitorResponse (
|
||||
}
|
||||
else {
|
||||
ecaStatus = ECA_GETFAIL;
|
||||
}
|
||||
}
|
||||
return monitorFailureResponse ( guard, msg, ecaStatus );
|
||||
}
|
||||
else {
|
||||
@ -926,6 +926,7 @@ caStatus casStrmClient::monitorResponse (
|
||||
int cacStatus = caNetConvert (
|
||||
msg.m_dataType, pPayload, pPayload, true, msg.m_count );
|
||||
if ( cacStatus != ECA_NORMAL ) {
|
||||
pDBRDD->unreference ();
|
||||
return this->sendErrWithEpicsStatus (
|
||||
guard, & msg, chan.getCID(), S_cas_internal, cacStatus );
|
||||
}
|
||||
|
@ -82,9 +82,12 @@ typedef struct scan_element{
|
||||
|
||||
/* PERIODIC */
|
||||
|
||||
#define OVERRUN_REPORT_DELAY 10.0 /* Time between initial reports */
|
||||
#define OVERRUN_REPORT_MAX 3600.0 /* Maximum time between reports */
|
||||
typedef struct periodic_scan_list {
|
||||
scan_list scan_list;
|
||||
double period;
|
||||
const char *name;
|
||||
unsigned long overruns;
|
||||
volatile enum ctl scanCtl;
|
||||
epicsEventId loopEvent;
|
||||
@ -351,8 +354,8 @@ int scanppl(double period) /* print periodic list */
|
||||
ppsl = papPeriodic[i];
|
||||
if (ppsl == NULL) continue;
|
||||
if (period > 0.0 && (fabs(period - ppsl->period) >.05)) continue;
|
||||
sprintf(message, "Scan Period = %g seconds (%lu over-runs)",
|
||||
ppsl->period, ppsl->overruns);
|
||||
sprintf(message, "Records with SCAN = '%s' (%lu over-runs):",
|
||||
ppsl->name, ppsl->overruns);
|
||||
printList(&ppsl->scan_list, message);
|
||||
}
|
||||
return 0;
|
||||
@ -565,7 +568,11 @@ static void periodicTask(void *arg)
|
||||
periodic_scan_list *ppsl = (periodic_scan_list *)arg;
|
||||
epicsTimeStamp next, reported;
|
||||
unsigned int overruns = 0;
|
||||
double report_delay = 10.0;
|
||||
double report_delay = OVERRUN_REPORT_DELAY;
|
||||
double overtime = 0.0;
|
||||
double over_min = 0.0;
|
||||
double over_max = 0.0;
|
||||
const double penalty = (ppsl->period >= 2) ? 1 : (ppsl->period / 2);
|
||||
|
||||
taskwdInsert(0, NULL, NULL);
|
||||
epicsEventSignal(startStopEvent);
|
||||
@ -584,24 +591,40 @@ static void periodicTask(void *arg)
|
||||
epicsTimeGetCurrent(&now);
|
||||
delay = epicsTimeDiffInSeconds(&next, &now);
|
||||
if (delay <= 0.0) {
|
||||
delay = 0.1;
|
||||
if (overtime == 0.0) {
|
||||
overtime = over_min = over_max = -delay;
|
||||
}
|
||||
else {
|
||||
overtime -= delay;
|
||||
if (over_min + delay > 0)
|
||||
over_min = -delay;
|
||||
if (over_max + delay < 0)
|
||||
over_max = -delay;
|
||||
}
|
||||
delay = penalty;
|
||||
ppsl->overruns++;
|
||||
next = now;
|
||||
epicsTimeAddSeconds(&next, delay);
|
||||
if (++overruns >= 10 &&
|
||||
epicsTimeDiffInSeconds(&now, &reported) > report_delay) {
|
||||
errlogPrintf("dbScan warning: %g second scan over-ran %u times\n",
|
||||
ppsl->period, overruns);
|
||||
errlogPrintf("\ndbScan warning from '%s' scan thread:\n"
|
||||
"\tScan processing averages %.2f seconds (%.2f .. %.2f).\n"
|
||||
"\tOver-runs have now happened %u times in a row.\n"
|
||||
"\tTo fix this, move some records to a slower scan rate.\n",
|
||||
ppsl->name, ppsl->period + overtime / overruns,
|
||||
ppsl->period + over_min, ppsl->period + over_max, overruns);
|
||||
|
||||
reported = now;
|
||||
if (report_delay < 1800.0)
|
||||
if (report_delay < (OVERRUN_REPORT_MAX / 2))
|
||||
report_delay *= 2;
|
||||
else
|
||||
report_delay = 3600.0; /* At most hourly */
|
||||
report_delay = OVERRUN_REPORT_MAX;
|
||||
}
|
||||
}
|
||||
else {
|
||||
overruns = 0;
|
||||
report_delay = 10.0;
|
||||
report_delay = OVERRUN_REPORT_DELAY;
|
||||
overtime = 0.0;
|
||||
}
|
||||
|
||||
epicsEventWaitWithTimeout(ppsl->loopEvent, delay);
|
||||
@ -634,6 +657,7 @@ static void initPeriodic(void)
|
||||
|
||||
ppsl->scan_list.lock = epicsMutexMustCreate();
|
||||
ellInit(&ppsl->scan_list.list);
|
||||
ppsl->name = choice;
|
||||
if (status || number == 0) {
|
||||
errlogPrintf("initPeriodic: Bad menuScan choice '%s'\n", choice);
|
||||
ppsl->period = i;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -270,7 +270,7 @@ void recGblTSELwasModified(struct link *plink)
|
||||
/*Note that the VAL value will not be used*/
|
||||
pfieldname = strstr(ppv_link->pvname, ".TIME");
|
||||
if (pfieldname) {
|
||||
strcpy(pfieldname, ".VAL");
|
||||
*pfieldname = 0;
|
||||
ppv_link->pvlMask |= pvlOptTSELisTime;
|
||||
}
|
||||
}
|
||||
|
0
src/ioc/dbCore.rc
Executable file → Normal file
0
src/ioc/dbCore.rc
Executable file → Normal file
@ -31,7 +31,6 @@
|
||||
#include "epicsString.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "dbFldTypes.h"
|
||||
#include "link.h"
|
||||
#include "dbStaticLib.h"
|
||||
@ -113,8 +112,6 @@ static void yyerrorAbort(char *str)
|
||||
{
|
||||
yyerror(str);
|
||||
yyAbort = TRUE;
|
||||
while (ellCount(&tempList))
|
||||
popFirstTemp();
|
||||
}
|
||||
|
||||
static void allocTemp(void *pvoid)
|
||||
@ -257,6 +254,11 @@ static long dbReadCOM(DBBASE **ppdbbase,const char *filename, FILE *fp,
|
||||
my_buffer_ptr = my_buffer;
|
||||
ellAdd(&inputFileList,&pinputFile->node);
|
||||
status = pvt_yy_parse();
|
||||
|
||||
if (yyAbort)
|
||||
while (ellCount(&tempList))
|
||||
popFirstTemp();
|
||||
|
||||
dbFreePath(pdbbase);
|
||||
if(!status) { /*add RTYP and VERS as an attribute */
|
||||
DBENTRY dbEntry;
|
||||
@ -931,7 +933,7 @@ static void dbRecordHead(char *recordType, char *name, int visible)
|
||||
allocTemp(pdbentry);
|
||||
status = dbFindRecordType(pdbentry, recordType);
|
||||
if (status) {
|
||||
epicsPrintf("Record \"%s\" is of unknown type \"%s\" - ",
|
||||
epicsPrintf("Record \"%s\" is of unknown type \"%s\"\n",
|
||||
name, recordType);
|
||||
yyerrorAbort(NULL);
|
||||
return;
|
||||
@ -940,8 +942,8 @@ static void dbRecordHead(char *recordType, char *name, int visible)
|
||||
status = dbCreateRecord(pdbentry,name);
|
||||
if (status==S_dbLib_recExists) {
|
||||
if (strcmp(recordType, dbGetRecordTypeName(pdbentry))!=0) {
|
||||
epicsPrintf("Record \"%s\" already defined with different type "
|
||||
"\"%s\"\n", name, dbGetRecordTypeName(pdbentry));
|
||||
epicsPrintf("Record \"%s\" of type \"%s\" redefined with new type "
|
||||
"\"%s\"\n", name, dbGetRecordTypeName(pdbentry), recordType);
|
||||
yyerror(NULL);
|
||||
duplicate = TRUE;
|
||||
return;
|
||||
|
@ -1899,9 +1899,11 @@ char * dbGetString(DBENTRY *pdbentry)
|
||||
else if(pvlMask&pvlOptCP) ppind=3;
|
||||
else if(pvlMask&pvlOptCPP) ppind=4;
|
||||
else ppind=0;
|
||||
if(plink->value.pv_link.pvname)
|
||||
strcpy(message,plink->value.pv_link.pvname);
|
||||
else
|
||||
if (plink->value.pv_link.pvname) {
|
||||
strcpy(message, plink->value.pv_link.pvname);
|
||||
if (pvlMask & pvlOptTSELisTime)
|
||||
strcat(message, ".TIME");
|
||||
} else
|
||||
strcpy(message,"");
|
||||
strcat(message," ");
|
||||
strcat(message,ppstring[ppind]);
|
||||
|
@ -16,22 +16,29 @@
|
||||
#include "macLib.h"
|
||||
#include "dbmf.h"
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "epicsExport.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbLoadTemplate.h"
|
||||
|
||||
static int line_num;
|
||||
static int yyerror(char* str);
|
||||
|
||||
#define VAR_MAX_VAR_STRING 5000
|
||||
#define VAR_MAX_VARS 100
|
||||
|
||||
static char *sub_collect;
|
||||
static char *sub_collect = NULL;
|
||||
static char *sub_locals;
|
||||
static char** vars = NULL;
|
||||
static char* db_file_name = NULL;
|
||||
static char **vars = NULL;
|
||||
static char *db_file_name = NULL;
|
||||
static int var_count, sub_count;
|
||||
|
||||
/* We allocate MAX_VAR_FACTOR chars in the sub_collect string for each
|
||||
* "variable=value," segment, and will accept at most dbTemplateMaxVars
|
||||
* template variables. The user can adjust that variable to increase
|
||||
* the number of variables or the length allocated for the buffer.
|
||||
*/
|
||||
#define MAX_VAR_FACTOR 50
|
||||
|
||||
int dbTemplateMaxVars = 100;
|
||||
epicsExportAddress(int, dbTemplateMaxVars);
|
||||
|
||||
%}
|
||||
|
||||
%start substitution_file
|
||||
@ -132,10 +139,18 @@ pattern_name: WORD
|
||||
#ifdef ERROR_STUFF
|
||||
fprintf(stderr, "pattern_name: [%d] = %s\n", var_count, $1);
|
||||
#endif
|
||||
vars[var_count] = dbmfMalloc(strlen($1)+1);
|
||||
strcpy(vars[var_count], $1);
|
||||
var_count++;
|
||||
dbmfFree($1);
|
||||
if (var_count >= dbTemplateMaxVars) {
|
||||
fprintf(stderr,
|
||||
"More than dbTemplateMaxVars = %d macro variables used\n",
|
||||
dbTemplateMaxVars);
|
||||
yyerror(NULL);
|
||||
}
|
||||
else {
|
||||
vars[var_count] = dbmfMalloc(strlen($1)+1);
|
||||
strcpy(vars[var_count], $1);
|
||||
var_count++;
|
||||
dbmfFree($1);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
@ -319,14 +334,21 @@ int dbLoadTemplate(const char *sub_file, const char *cmd_collect)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (dbTemplateMaxVars < 1)
|
||||
{
|
||||
fprintf(stderr,"Error: dbTemplateMaxVars = %d, must be +ve\n",
|
||||
dbTemplateMaxVars);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fp = fopen(sub_file, "r");
|
||||
if (!fp) {
|
||||
fprintf(stderr, "dbLoadTemplate: error opening sub file %s\n", sub_file);
|
||||
return -1;
|
||||
}
|
||||
|
||||
vars = (char**)malloc(VAR_MAX_VARS * sizeof(char*));
|
||||
sub_collect = malloc(VAR_MAX_VAR_STRING);
|
||||
vars = malloc(dbTemplateMaxVars * sizeof(char*));
|
||||
sub_collect = malloc(dbTemplateMaxVars * MAX_VAR_FACTOR);
|
||||
if (!vars || !sub_collect) {
|
||||
free(vars);
|
||||
free(sub_collect);
|
||||
|
@ -12,3 +12,5 @@ variable(asCaDebug,int)
|
||||
variable(dbRecordsOnceOnly,int)
|
||||
variable(dbBptNotMonotonic,int)
|
||||
|
||||
# dbLoadTemplate settings
|
||||
variable(dbTemplateMaxVars,int)
|
||||
|
0
src/libCom/Com.rc
Executable file → Normal file
0
src/libCom/Com.rc
Executable file → Normal file
@ -167,16 +167,16 @@ static BUCKETID bucketUnsignedHash (BUCKET *pb, const void *pId)
|
||||
static BUCKETID bucketPointerHash (BUCKET *pb, const void *pId)
|
||||
{
|
||||
void * const *ppId = (void * const *) pId;
|
||||
unsigned long src;
|
||||
size_t src;
|
||||
BUCKETID hashid;
|
||||
|
||||
/*
|
||||
* This makes the assumption that
|
||||
* a pointer will fit inside of a long
|
||||
* This makes the assumption that size_t
|
||||
* can be used to hold a pointer value
|
||||
* (this assumption may not port to all
|
||||
* CPU architectures)
|
||||
*/
|
||||
src = (unsigned long) *ppId;
|
||||
src = (size_t) *ppId;
|
||||
hashid = src;
|
||||
src = src >> pb->hashIdNBits;
|
||||
while(src){
|
||||
|
@ -207,7 +207,7 @@ static int
|
||||
* convert an infix expression to a postfix expression
|
||||
*/
|
||||
epicsShareFunc long
|
||||
postfix(const char *psrc, char * const ppostfix, short *perror)
|
||||
postfix(const char *psrc, char *pout, short *perror)
|
||||
{
|
||||
ELEMENT stack[80];
|
||||
ELEMENT *pstacktop = stack;
|
||||
@ -215,7 +215,7 @@ epicsShareFunc long
|
||||
int operand_needed = TRUE;
|
||||
int runtime_depth = 0;
|
||||
int cond_count = 0;
|
||||
char *pout = ppostfix;
|
||||
char * const pdest = pout;
|
||||
char *pnext;
|
||||
|
||||
if (psrc == NULL || *psrc == '\0' ||
|
||||
@ -251,7 +251,7 @@ epicsShareFunc long
|
||||
goto bad;
|
||||
}
|
||||
psrc = pnext;
|
||||
lit_i = lit_d;
|
||||
lit_i = (int) lit_d;
|
||||
if (lit_d != (double) lit_i) {
|
||||
*pout++ = pel->code;
|
||||
memcpy(pout, &lit_d, sizeof(double));
|
||||
@ -280,7 +280,7 @@ epicsShareFunc long
|
||||
break;
|
||||
|
||||
case STORE_OPERATOR:
|
||||
if (pout == ppostfix || pstacktop > stack ||
|
||||
if (pout == pdest || pstacktop > stack ||
|
||||
*--pout < FETCH_A || *pout > FETCH_L) {
|
||||
*perror = CALC_ERR_BAD_ASSIGNMENT;
|
||||
goto bad;
|
||||
@ -481,7 +481,7 @@ epicsShareFunc long
|
||||
return 0;
|
||||
|
||||
bad:
|
||||
*ppostfix = END_EXPRESSION;
|
||||
*pdest = END_EXPRESSION;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
/* Author: Marty Kraimer Date: 04-07-94 */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
@ -18,6 +17,7 @@
|
||||
#define epicsExportSharedSymbols
|
||||
#include "cantProceed.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsStdioRedirect.h"
|
||||
#include "epicsString.h"
|
||||
#include "dbDefs.h"
|
||||
#include "ellLib.h"
|
||||
@ -35,12 +35,13 @@ typedef struct gphPvt {
|
||||
#define DEFAULT_SIZE 512
|
||||
#define MAX_SIZE 65536
|
||||
|
||||
|
||||
void epicsShareAPI gphInitPvt(gphPvt **ppvt, int size)
|
||||
{
|
||||
gphPvt *pgphPvt;
|
||||
|
||||
if (size & (size - 1)) {
|
||||
printf("gphInitPvt: %d is not a power of 2\n", size);
|
||||
fprintf(stderr, "gphInitPvt: %d is not a power of 2\n", size);
|
||||
size = DEFAULT_SIZE;
|
||||
}
|
||||
|
||||
@ -215,9 +216,10 @@ void epicsShareAPI gphDumpFP(FILE *fp, gphPvt *pgphPvt)
|
||||
ELLLIST **paplist;
|
||||
int h;
|
||||
|
||||
if (pgphPvt == NULL) return;
|
||||
if (pgphPvt == NULL)
|
||||
return;
|
||||
|
||||
printf("Hash table has %d buckets", pgphPvt->size);
|
||||
fprintf(fp, "Hash table has %d buckets", pgphPvt->size);
|
||||
|
||||
paplist = pgphPvt->paplist;
|
||||
for (h = 0; h < pgphPvt->size; h++) {
|
||||
|
@ -3,8 +3,7 @@
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* iocsh.cpp */
|
||||
@ -68,6 +67,7 @@ struct iocshRedirect {
|
||||
const char *mode;
|
||||
FILE *fp;
|
||||
FILE *oldFp;
|
||||
int mustRestore;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -101,7 +101,8 @@ iocshTableUnlock (void)
|
||||
/*
|
||||
* Register a command
|
||||
*/
|
||||
void epicsShareAPI iocshRegister (const iocshFuncDef *piocshFuncDef, iocshCallFunc func)
|
||||
void epicsShareAPI iocshRegister (const iocshFuncDef *piocshFuncDef,
|
||||
iocshCallFunc func)
|
||||
{
|
||||
struct iocshCommand *l, *p, *n;
|
||||
int i;
|
||||
@ -118,7 +119,8 @@ void epicsShareAPI iocshRegister (const iocshFuncDef *piocshFuncDef, iocshCallFu
|
||||
if (i < 0)
|
||||
break;
|
||||
}
|
||||
n = (struct iocshCommand *)callocMustSucceed (1, sizeof *n, "iocshRegister");
|
||||
n = (struct iocshCommand *) callocMustSucceed (1, sizeof *n,
|
||||
"iocshRegister");
|
||||
if (!registryAdd(iocshCmdID, piocshFuncDef->name, (void *)n)) {
|
||||
free (n);
|
||||
iocshTableUnlock ();
|
||||
@ -162,7 +164,8 @@ void epicsShareAPI iocshRegisterVariable (const iocshVarDef *piocshVarDef)
|
||||
for (l = NULL, p = iocshVariableHead ; p != NULL ; l = p, p = p->next) {
|
||||
i = strcmp (piocshVarDef->name, p->pVarDef->name);
|
||||
if (i == 0) {
|
||||
errlogPrintf("Warning -- iocshRegisterVariable redefining %s.\n", piocshVarDef->name);
|
||||
errlogPrintf("Warning: iocshRegisterVariable redefining %s.\n",
|
||||
piocshVarDef->name);
|
||||
p->pVarDef = piocshVarDef;
|
||||
found = 1;
|
||||
break;
|
||||
@ -171,11 +174,13 @@ void epicsShareAPI iocshRegisterVariable (const iocshVarDef *piocshVarDef)
|
||||
break;
|
||||
}
|
||||
if (!found) {
|
||||
n = (struct iocshVariable *)callocMustSucceed(1, sizeof *n, "iocshRegisterVariable");
|
||||
n = (struct iocshVariable *) callocMustSucceed(1, sizeof *n,
|
||||
"iocshRegisterVariable");
|
||||
if (!registryAdd(iocshVarID, piocshVarDef->name, (void *)n)) {
|
||||
free(n);
|
||||
iocshTableUnlock();
|
||||
errlogPrintf("iocshRegisterVariable failed to add %s.\n", piocshVarDef->name);
|
||||
errlogPrintf("iocshRegisterVariable failed to add %s.\n",
|
||||
piocshVarDef->name);
|
||||
return;
|
||||
}
|
||||
if (l == NULL) {
|
||||
@ -225,14 +230,15 @@ showError (const char *filename, int lineno, const char *msg, ...)
|
||||
|
||||
va_start (ap, msg);
|
||||
if (filename)
|
||||
fprintf (stderr, "%s -- Line %d -- ", filename, lineno);
|
||||
vfprintf (stderr, msg, ap);
|
||||
fputc ('\n', stderr);
|
||||
fprintf(epicsGetStderr(), "%s line %d: ", filename, lineno);
|
||||
vfprintf (epicsGetStderr(), msg, ap);
|
||||
fputc ('\n', epicsGetStderr());
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
static int
|
||||
cvtArg (const char *filename, int lineno, char *arg, iocshArgBuf *argBuf, const iocshArg *piocshArg)
|
||||
cvtArg (const char *filename, int lineno, char *arg, iocshArgBuf *argBuf,
|
||||
const iocshArg *piocshArg)
|
||||
{
|
||||
char *endp;
|
||||
|
||||
@ -245,12 +251,13 @@ cvtArg (const char *filename, int lineno, char *arg, iocshArgBuf *argBuf, const
|
||||
errno = 0;
|
||||
argBuf->ival = strtoul (arg, &endp, 0);
|
||||
if (errno == ERANGE) {
|
||||
showError (filename, lineno, "Integer '%s' out of range", arg);
|
||||
showError(filename, lineno, "Integer '%s' out of range",
|
||||
arg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (*endp) {
|
||||
showError (filename, lineno, "Illegal integer '%s'", arg);
|
||||
showError(filename, lineno, "Illegal integer '%s'", arg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -263,7 +270,7 @@ cvtArg (const char *filename, int lineno, char *arg, iocshArgBuf *argBuf, const
|
||||
if (arg && *arg) {
|
||||
argBuf->dval = epicsStrtod (arg, &endp);
|
||||
if (*endp) {
|
||||
showError (filename, lineno, "Illegal double '%s'", arg);
|
||||
showError(filename, lineno, "Illegal double '%s'", arg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -279,7 +286,7 @@ cvtArg (const char *filename, int lineno, char *arg, iocshArgBuf *argBuf, const
|
||||
case iocshArgPersistentString:
|
||||
argBuf->sval = epicsStrDup(arg);
|
||||
if (argBuf->sval == NULL) {
|
||||
showError (filename, lineno, "Out of memory");
|
||||
showError(filename, lineno, "Out of memory");
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@ -288,17 +295,18 @@ cvtArg (const char *filename, int lineno, char *arg, iocshArgBuf *argBuf, const
|
||||
/* Argument must be missing or 0 or pdbbase */
|
||||
if(!arg || !*arg || (*arg == '0') || (strcmp(arg, "pdbbase") == 0)) {
|
||||
if(!iocshPpdbbase || !*iocshPpdbbase) {
|
||||
showError (filename, lineno, "pdbbase not present");
|
||||
showError(filename, lineno, "pdbbase not present");
|
||||
return 0;
|
||||
}
|
||||
argBuf->vval = *iocshPpdbbase;
|
||||
break;
|
||||
}
|
||||
showError (filename, lineno, "Expecting 'pdbbase' got '%s'", arg);
|
||||
showError(filename, lineno, "Expecting 'pdbbase' got '%s'", arg);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
showError (filename, lineno, "Illegal argument type %d", piocshArg->type);
|
||||
showError(filename, lineno, "Illegal argument type %d",
|
||||
piocshArg->type);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
@ -329,6 +337,7 @@ openRedirect(const char *filename, int lineno, struct iocshRedirect *redirect)
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
redirect->mustRestore = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -349,14 +358,17 @@ startRedirect(const char * /*filename*/, int /*lineno*/,
|
||||
case 0:
|
||||
redirect->oldFp = epicsGetThreadStdin();
|
||||
epicsSetThreadStdin(redirect->fp);
|
||||
redirect->mustRestore = 1;
|
||||
break;
|
||||
case 1:
|
||||
redirect->oldFp = epicsGetThreadStdout();
|
||||
epicsSetThreadStdout(redirect->fp);
|
||||
redirect->mustRestore = 1;
|
||||
break;
|
||||
case 2:
|
||||
redirect->oldFp = epicsGetThreadStderr();
|
||||
epicsSetThreadStderr(redirect->fp);
|
||||
redirect->mustRestore = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -377,10 +389,12 @@ stopRedirect(const char *filename, int lineno, struct iocshRedirect *redirect)
|
||||
showError(filename, lineno, "Error closing \"%s\": %s.",
|
||||
redirect->name, strerror(errno));
|
||||
redirect->fp = NULL;
|
||||
switch(i) {
|
||||
case 0: epicsSetThreadStdin(redirect->oldFp); break;
|
||||
case 1: epicsSetThreadStdout(redirect->oldFp); break;
|
||||
case 2: epicsSetThreadStderr(redirect->oldFp); break;
|
||||
if (redirect->mustRestore) {
|
||||
switch(i) {
|
||||
case 0: epicsSetThreadStdin(redirect->oldFp); break;
|
||||
case 1: epicsSetThreadStdout(redirect->oldFp); break;
|
||||
case 2: epicsSetThreadStderr(redirect->oldFp); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
redirect->name = NULL;
|
||||
@ -404,30 +418,31 @@ static void helpCallFunc(const iocshArgBuf *args)
|
||||
if (argc == 1) {
|
||||
int l, col = 0;
|
||||
|
||||
printf ("Type 'help command_name' to get more information about a particular command.\n");
|
||||
fprintf(epicsGetStdout(),
|
||||
"Type 'help <command>' to see the arguments of <command>.\n");
|
||||
iocshTableLock ();
|
||||
for (pcmd = iocshCommandHead ; pcmd != NULL ; pcmd = pcmd->next) {
|
||||
piocshFuncDef = pcmd->pFuncDef;
|
||||
l = strlen (piocshFuncDef->name);
|
||||
if ((l + col) >= 79) {
|
||||
fputc ('\n', stdout);
|
||||
fputc('\n', epicsGetStdout());
|
||||
col = 0;
|
||||
}
|
||||
fputs (piocshFuncDef->name, stdout);
|
||||
fputs(piocshFuncDef->name, epicsGetStdout());
|
||||
col += l;
|
||||
if (col >= 64) {
|
||||
fputc ('\n', stdout);
|
||||
fputc('\n', epicsGetStdout());
|
||||
col = 0;
|
||||
}
|
||||
else {
|
||||
do {
|
||||
fputc (' ', stdout);
|
||||
fputc(' ', epicsGetStdout());
|
||||
col++;
|
||||
} while ((col % 16) != 0);
|
||||
}
|
||||
}
|
||||
if (col)
|
||||
fputc ('\n', stdout);
|
||||
fputc('\n', epicsGetStdout());
|
||||
iocshTableUnlock ();
|
||||
}
|
||||
else {
|
||||
@ -435,18 +450,18 @@ static void helpCallFunc(const iocshArgBuf *args)
|
||||
for (pcmd = iocshCommandHead ; pcmd != NULL ; pcmd = pcmd->next) {
|
||||
piocshFuncDef = pcmd->pFuncDef;
|
||||
if (epicsStrGlobMatch(piocshFuncDef->name, argv[iarg]) != 0) {
|
||||
fputs (piocshFuncDef->name, stdout);
|
||||
fputs(piocshFuncDef->name, epicsGetStdout());
|
||||
for (int a = 0 ; a < piocshFuncDef->nargs ; a++) {
|
||||
const char *cp = piocshFuncDef->arg[a]->name;
|
||||
if ((piocshFuncDef->arg[a]->type == iocshArgArgv)
|
||||
|| (strchr (cp, ' ') == NULL)) {
|
||||
fprintf (stdout, " %s", cp);
|
||||
fprintf(epicsGetStdout(), " %s", cp);
|
||||
}
|
||||
else {
|
||||
fprintf (stdout, " '%s'", cp);
|
||||
fprintf(epicsGetStdout(), " '%s'", cp);
|
||||
}
|
||||
}
|
||||
fprintf (stdout,"\n");;
|
||||
fprintf(epicsGetStdout(),"\n");;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -478,7 +493,6 @@ iocshBody (const char *pathname, const char *commandLine)
|
||||
iocshArgBuf *argBuf = NULL;
|
||||
int argBufCapacity = 0;
|
||||
struct iocshCommand *found;
|
||||
struct iocshFuncDef const *piocshFuncDef;
|
||||
void *readlineContext = NULL;
|
||||
int wasOkToBlock;
|
||||
|
||||
@ -493,7 +507,8 @@ iocshBody (const char *pathname, const char *commandLine)
|
||||
else {
|
||||
fp = fopen (pathname, "r");
|
||||
if (fp == NULL) {
|
||||
fprintf (stderr, "Can't open %s: %s\n", pathname, strerror (errno));
|
||||
fprintf(epicsGetStderr(), "Can't open %s: %s\n", pathname,
|
||||
strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
if ((filename = strrchr (pathname, '/')) == NULL)
|
||||
@ -507,7 +522,7 @@ iocshBody (const char *pathname, const char *commandLine)
|
||||
* Create a command-line input context
|
||||
*/
|
||||
if ((readlineContext = epicsReadlineBegin(fp)) == NULL) {
|
||||
fprintf(stderr, "Can't allocate command-line object.\n");
|
||||
fprintf(epicsGetStderr(), "Can't allocate command-line object.\n");
|
||||
if (fp)
|
||||
fclose(fp);
|
||||
return -1;
|
||||
@ -519,7 +534,7 @@ iocshBody (const char *pathname, const char *commandLine)
|
||||
*/
|
||||
redirects = (struct iocshRedirect *)calloc(NREDIRECTS, sizeof *redirects);
|
||||
if (redirects == NULL) {
|
||||
printf ("Out of memory!\n");
|
||||
fprintf(epicsGetStderr(), "Out of memory!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -604,7 +619,7 @@ iocshBody (const char *pathname, const char *commandLine)
|
||||
argvCapacity += 50;
|
||||
av = (char **)realloc (argv, argvCapacity * sizeof *argv);
|
||||
if (av == NULL) {
|
||||
printf ("Out of memory!\n");
|
||||
fprintf (epicsGetStderr(), "Out of memory!\n");
|
||||
argc = -1;
|
||||
break;
|
||||
}
|
||||
@ -699,17 +714,17 @@ iocshBody (const char *pathname, const char *commandLine)
|
||||
backslash = 0;
|
||||
}
|
||||
if (redirect != NULL) {
|
||||
showError (filename, lineno, "Illegal redirection.");
|
||||
showError(filename, lineno, "Illegal redirection.");
|
||||
continue;
|
||||
}
|
||||
if (argc < 0)
|
||||
break;
|
||||
if (quote != EOF) {
|
||||
showError (filename, lineno, "Unbalanced quote.");
|
||||
showError(filename, lineno, "Unbalanced quote.");
|
||||
continue;
|
||||
}
|
||||
if (backslash) {
|
||||
showError (filename, lineno, "Trailing backslash.");
|
||||
showError(filename, lineno, "Trailing backslash.");
|
||||
continue;
|
||||
}
|
||||
if (inword)
|
||||
@ -730,73 +745,68 @@ iocshBody (const char *pathname, const char *commandLine)
|
||||
stopRedirect(filename, lineno, redirects);
|
||||
continue;
|
||||
}
|
||||
if (openRedirect(filename, lineno, redirects) < 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Look up command
|
||||
* Special command?
|
||||
*/
|
||||
if (argc) {
|
||||
/*
|
||||
* Special command?
|
||||
*/
|
||||
if (strncmp (argv[0], "exit", 4) == 0)
|
||||
break;
|
||||
if ((strcmp (argv[0], "?") == 0)
|
||||
|| (strncmp (argv[0], "help", 4) == 0)) {
|
||||
}
|
||||
if ((argc > 0) && (strcmp(argv[0], "exit") == 0))
|
||||
break;
|
||||
|
||||
/*
|
||||
* Set up redirection
|
||||
*/
|
||||
if ((openRedirect(filename, lineno, redirects) == 0) && (argc > 0)) {
|
||||
/*
|
||||
* Look up command
|
||||
*/
|
||||
found = (iocshCommand *)registryFind (iocshCmdID, argv[0]);
|
||||
if (!found) {
|
||||
showError (filename, lineno, "Command %s not found.", argv[0]);
|
||||
continue;
|
||||
}
|
||||
piocshFuncDef = found->pFuncDef;
|
||||
|
||||
/*
|
||||
* Process arguments and call function
|
||||
*/
|
||||
for (int iarg = 0 ; ; ) {
|
||||
if (iarg == piocshFuncDef->nargs) {
|
||||
startRedirect(filename, lineno, redirects);
|
||||
(*found->func)(argBuf);
|
||||
stopRedirect(filename, lineno, redirects);
|
||||
break;
|
||||
}
|
||||
if (iarg >= argBufCapacity) {
|
||||
void *np;
|
||||
|
||||
argBufCapacity += 20;
|
||||
np = realloc (argBuf, argBufCapacity * sizeof *argBuf);
|
||||
if (np == NULL) {
|
||||
fprintf (stderr, "Out of memory!\n");
|
||||
argBufCapacity -= 20;
|
||||
if (found) {
|
||||
/*
|
||||
* Process arguments and call function
|
||||
*/
|
||||
struct iocshFuncDef const *piocshFuncDef = found->pFuncDef;
|
||||
for (int iarg = 0 ; ; ) {
|
||||
if (iarg == piocshFuncDef->nargs) {
|
||||
startRedirect(filename, lineno, redirects);
|
||||
(*found->func)(argBuf);
|
||||
break;
|
||||
}
|
||||
argBuf = (iocshArgBuf *)np;
|
||||
if (iarg >= argBufCapacity) {
|
||||
void *np;
|
||||
|
||||
argBufCapacity += 20;
|
||||
np = realloc (argBuf, argBufCapacity * sizeof *argBuf);
|
||||
if (np == NULL) {
|
||||
fprintf (epicsGetStderr(), "Out of memory!\n");
|
||||
argBufCapacity -= 20;
|
||||
break;
|
||||
}
|
||||
argBuf = (iocshArgBuf *)np;
|
||||
}
|
||||
if (piocshFuncDef->arg[iarg]->type == iocshArgArgv) {
|
||||
argBuf[iarg].aval.ac = argc-iarg;
|
||||
argBuf[iarg].aval.av = argv+iarg;
|
||||
iarg = piocshFuncDef->nargs;
|
||||
}
|
||||
else {
|
||||
if (!cvtArg (filename, lineno,
|
||||
((iarg < argc) ? argv[iarg+1] : NULL),
|
||||
&argBuf[iarg], piocshFuncDef->arg[iarg]))
|
||||
break;
|
||||
iarg++;
|
||||
}
|
||||
}
|
||||
if (piocshFuncDef->arg[iarg]->type == iocshArgArgv) {
|
||||
argBuf[iarg].aval.ac = argc-iarg;
|
||||
argBuf[iarg].aval.av = argv+iarg;
|
||||
iarg = piocshFuncDef->nargs;
|
||||
}
|
||||
else {
|
||||
if (!cvtArg (filename, lineno,
|
||||
((iarg < argc) ? argv[iarg+1] : NULL),
|
||||
&argBuf[iarg], piocshFuncDef->arg[iarg]))
|
||||
break;
|
||||
iarg++;
|
||||
if ((prompt != NULL) && (strcmp(argv[0], "epicsEnvSet") == 0)) {
|
||||
const char *newPrompt;
|
||||
if ((newPrompt = envGetConfigParamPtr(&IOCSH_PS1)) != NULL)
|
||||
prompt = newPrompt;
|
||||
}
|
||||
}
|
||||
if((prompt != NULL) && (strcmp(argv[0], "epicsEnvSet") == 0)) {
|
||||
const char *newPrompt;
|
||||
if ((newPrompt = envGetConfigParamPtr(&IOCSH_PS1)) != NULL)
|
||||
prompt = newPrompt;
|
||||
else {
|
||||
showError(filename, lineno, "Command %s not found.", argv[0]);
|
||||
}
|
||||
}
|
||||
stopRedirect(filename, lineno, redirects);
|
||||
}
|
||||
if (fp && (fp != stdin))
|
||||
fclose (fp);
|
||||
@ -840,7 +850,8 @@ static void varHandler(const iocshVarDef *v, const char *setString)
|
||||
{
|
||||
switch(v->type) {
|
||||
default:
|
||||
printf("Can't handle variable %s of type %d.\n", v->name, v->type);
|
||||
fprintf(epicsGetStderr(), "Can't handle variable %s of type %d.\n",
|
||||
v->name, v->type);
|
||||
return;
|
||||
case iocshArgInt: break;
|
||||
case iocshArgDouble: break;
|
||||
@ -849,10 +860,10 @@ static void varHandler(const iocshVarDef *v, const char *setString)
|
||||
switch(v->type) {
|
||||
default: break;
|
||||
case iocshArgInt:
|
||||
printf("%s = %d\n", v->name, *(int *)v->pval);
|
||||
fprintf(epicsGetStdout(), "%s = %d\n", v->name, *(int *)v->pval);
|
||||
break;
|
||||
case iocshArgDouble:
|
||||
printf("%s = %g\n", v->name, *(double *)v->pval);
|
||||
fprintf(epicsGetStdout(), "%s = %g\n", v->name, *(double *)v->pval);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -866,7 +877,8 @@ static void varHandler(const iocshVarDef *v, const char *setString)
|
||||
if((*setString != '\0') && (*endp == '\0'))
|
||||
*(int *)v->pval = ltmp;
|
||||
else
|
||||
printf("Invalid value -- value of %s not changed.\n", v->name);
|
||||
fprintf(epicsGetStderr(),
|
||||
"Invalid integer value. Var %s not changed.\n", v->name);
|
||||
break;
|
||||
}
|
||||
case iocshArgDouble:
|
||||
@ -876,7 +888,8 @@ static void varHandler(const iocshVarDef *v, const char *setString)
|
||||
if((*setString != '\0') && (*endp == '\0'))
|
||||
*(double *)v->pval = dtmp;
|
||||
else
|
||||
printf("Invalid value -- value of %s not changed.\n", v->name);
|
||||
fprintf(epicsGetStderr(),
|
||||
"Invalid double value. Var %s not changed.\n", v->name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -893,7 +906,7 @@ static void varCallFunc(const iocshArgBuf *args)
|
||||
else {
|
||||
v = (iocshVariable *)registryFind(iocshVarID, args[0].sval);
|
||||
if (v == NULL) {
|
||||
printf("%s -- no such variable.\n", args[0].sval);
|
||||
fprintf(epicsGetStderr(), "Var %s not found.\n", args[0].sval);
|
||||
}
|
||||
else {
|
||||
varHandler(v->pVarDef, args[1].sval);
|
||||
@ -916,7 +929,8 @@ static void iocshCmdCallFunc(const iocshArgBuf *args)
|
||||
*/
|
||||
|
||||
/* comment */
|
||||
static const iocshArg commentArg0 = { "newline-terminated comment",iocshArgArgv};
|
||||
static const iocshArg commentArg0 = { "newline-terminated comment",
|
||||
iocshArgArgv};
|
||||
static const iocshArg *commentArgs[1] = {&commentArg0};
|
||||
static const iocshFuncDef commentFuncDef = {"#",1,commentArgs};
|
||||
static void commentCallFunc(const iocshArgBuf *)
|
||||
|
@ -9,10 +9,10 @@
|
||||
\*************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include "iocsh.h"
|
||||
#include "epicsStdioRedirect.h"
|
||||
#include "epicsTime.h"
|
||||
#include "epicsThread.h"
|
||||
#include "epicsMutex.h"
|
||||
@ -60,7 +60,7 @@ static void chdirCallFunc(const iocshArgBuf *args)
|
||||
int status;
|
||||
status = chdir(args[0].sval);
|
||||
if (status) {
|
||||
printf ("Invalid directory path ignored\n");
|
||||
fprintf(stderr, "Invalid directory path, ignored\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,11 +86,11 @@ static void epicsEnvSetCallFunc(const iocshArgBuf *args)
|
||||
char *value = args[1].sval;
|
||||
|
||||
if (name == NULL) {
|
||||
printf ("Missing environment variable name argument.\n");
|
||||
fprintf(stderr, "Missing environment variable name argument.\n");
|
||||
return;
|
||||
}
|
||||
if (value == NULL) {
|
||||
printf ("Missing environment variable value argument.\n");
|
||||
fprintf(stderr, "Missing environment variable value argument.\n");
|
||||
return;
|
||||
}
|
||||
epicsEnvSet (name, value);
|
||||
@ -240,7 +240,7 @@ static void threadCallFunc(const iocshArgBuf *args)
|
||||
if (*endp) {
|
||||
tid = epicsThreadGetId (cp);
|
||||
if (!tid) {
|
||||
printf ("\t'%s' is not a known thread name\n", cp);
|
||||
fprintf(stderr, "\t'%s' is not a known thread name\n", cp);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -308,7 +308,7 @@ static void epicsThreadResumeCallFunc(const iocshArgBuf *args)
|
||||
if (*endp) {
|
||||
tid = epicsThreadGetId(cp);
|
||||
if (!tid) {
|
||||
printf("*** argument %d (%s) is not a valid thread name ***\n", i, cp);
|
||||
fprintf(stderr, "'%s' is not a valid thread name\n", cp);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -316,13 +316,13 @@ static void epicsThreadResumeCallFunc(const iocshArgBuf *args)
|
||||
tid =(epicsThreadId)ltmp;
|
||||
epicsThreadGetName(tid, nameBuf, sizeof nameBuf);
|
||||
if (nameBuf[0] == '\0') {
|
||||
printf("*** argument %d (%s) is not a valid thread id ***\n", i, cp);
|
||||
fprintf(stderr, "'%s' is not a valid thread id\n", cp);
|
||||
continue;
|
||||
}
|
||||
|
||||
}
|
||||
if (!epicsThreadIsSuspended(tid)) {
|
||||
printf("*** Thread %s is not suspended ***\n", cp);
|
||||
fprintf(stderr, "Thread %s is not suspended\n", cp);
|
||||
continue;
|
||||
}
|
||||
epicsThreadResume(tid);
|
||||
|
@ -3,8 +3,7 @@
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* $Revision-Id$
|
||||
@ -51,11 +50,11 @@ epicsShareAPI macParseDefns(
|
||||
int quote;
|
||||
int escape;
|
||||
size_t nbytes;
|
||||
const unsigned char **ptr;
|
||||
const unsigned char **end;
|
||||
const char **ptr;
|
||||
const char **end;
|
||||
int *del;
|
||||
char *memCp, **memCpp;
|
||||
const unsigned char *c;
|
||||
const char *c;
|
||||
char *s, *d, **p;
|
||||
enum { preName, inName, preValue, inValue } state;
|
||||
|
||||
@ -68,8 +67,8 @@ epicsShareAPI macParseDefns(
|
||||
numMax = strlen( defns );
|
||||
if ( numMax < altNumMax )
|
||||
numMax = altNumMax;
|
||||
ptr = (const unsigned char **) calloc( numMax, sizeof( char * ) );
|
||||
end = (const unsigned char **) calloc( numMax, sizeof( char * ) );
|
||||
ptr = (const char **) calloc( numMax, sizeof( char * ) );
|
||||
end = (const char **) calloc( numMax, sizeof( char * ) );
|
||||
del = (int *) calloc( numMax, sizeof( int ) );
|
||||
if ( ptr == NULL || end == NULL || del == NULL ) goto error;
|
||||
|
||||
@ -80,7 +79,7 @@ epicsShareAPI macParseDefns(
|
||||
del[0] = FALSE;
|
||||
quote = 0;
|
||||
state = preName;
|
||||
for ( c = (const unsigned char *) defns; *c != '\0'; c++ ) {
|
||||
for ( c = (const char *) defns; *c != '\0'; c++ ) {
|
||||
|
||||
/* handle quotes */
|
||||
if ( quote )
|
||||
@ -226,8 +225,8 @@ epicsShareAPI macParseDefns(
|
||||
}
|
||||
|
||||
/* free workspace */
|
||||
free( ptr );
|
||||
free( end );
|
||||
free( ( void * ) ptr );
|
||||
free( ( void * ) end );
|
||||
free( ( char * ) del );
|
||||
|
||||
/* debug output */
|
||||
@ -240,8 +239,8 @@ epicsShareAPI macParseDefns(
|
||||
/* error exit */
|
||||
error:
|
||||
errlogPrintf( "macParseDefns: failed to allocate memory\n" );
|
||||
if ( ptr != NULL ) free( ptr );
|
||||
if ( end != NULL ) free( end );
|
||||
if ( ptr != NULL ) free( ( void * ) ptr );
|
||||
if ( end != NULL ) free( ( void * ) end );
|
||||
if ( del != NULL ) free( ( char * ) del );
|
||||
*pairs = NULL;
|
||||
return -1;
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
/* Original Authors: David H. Thompson & Sheng Peng (ORNL) */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -19,6 +18,7 @@
|
||||
#include "epicsMutex.h"
|
||||
#include "epicsMessageQueue.h"
|
||||
#include "epicsString.h"
|
||||
#include "epicsStdioRedirect.h"
|
||||
#include "epicsThread.h"
|
||||
#include "epicsTime.h"
|
||||
#include "epicsTimer.h"
|
||||
|
@ -38,8 +38,9 @@
|
||||
* It appears that the only entry point used here that causes
|
||||
* portability problems with W95\W98\WME is TryEnterCriticalSection.
|
||||
*/
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0400
|
||||
#ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x0400
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
|
@ -22,8 +22,8 @@
|
||||
|
||||
#define VC_EXTRALEAN
|
||||
#define STRICT
|
||||
#if _WIN64
|
||||
# define _WIN32_WINNT 0x400 /* defining this drops support for W95 */
|
||||
#ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x400 /* No support for W95 */
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <process.h> /* for _endthread() etc */
|
||||
|
@ -1,12 +1,10 @@
|
||||
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* Copyright (c) 2002 The Regents of the University of California, as
|
||||
* Operator of Los Alamos National Laboratory.
|
||||
* EPICS BASE Versions 3.13.7
|
||||
* and higher are distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* $Revision-Id$ */
|
||||
/*
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "dbDefs.h"
|
||||
#include "epicsEvent.h"
|
||||
#include "epicsExit.h"
|
||||
#include "epicsStdio.h"
|
||||
#include "epicsStdioRedirect.h"
|
||||
#include "epicsThread.h"
|
||||
#include "epicsMutex.h"
|
||||
#include "errlog.h"
|
||||
|
@ -42,6 +42,11 @@ epicsEllTest_SRCS += epicsEllTest.c
|
||||
testHarness_SRCS += epicsEllTest.c
|
||||
TESTS += epicsEllTest
|
||||
|
||||
TESTPROD_HOST += epicsEnvTest
|
||||
epicsEnvTest_SRCS += epicsEnvTest.c
|
||||
testHarness_SRCS += epicsEnvTest.c
|
||||
TESTS += epicsEnvTest
|
||||
|
||||
TESTPROD_HOST += epicsErrlogTest
|
||||
epicsErrlogTest_SRCS += epicsErrlogTest.c
|
||||
epicsErrlogTest_SYS_LIBS_solaris = socket
|
||||
|
78
src/libCom/test/epicsEnvTest.c
Normal file
78
src/libCom/test/epicsEnvTest.c
Normal file
@ -0,0 +1,78 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
|
||||
* National Laboratory.
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
/* epicsEnvTest.c */
|
||||
|
||||
/* Author: Andrew Johnson
|
||||
* Date: 2013-12-13
|
||||
*/
|
||||
|
||||
/* Check environment variable APIs.
|
||||
* TODO: Add tests for envDefs.h routines.
|
||||
*
|
||||
* The thread test is needed on VxWorks 6.x, where the OS can be
|
||||
* configured to maintain separate, totally independent sets
|
||||
* of environment variables for each thread. This configuration
|
||||
* is not supported by EPICS which expects child threads to at
|
||||
* least inherit the partent thread's environment variables.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "envDefs.h"
|
||||
#include "epicsThread.h"
|
||||
#include "epicsUnitTest.h"
|
||||
#include "testMain.h"
|
||||
|
||||
#define PARENT "Parent"
|
||||
#define CHILD "Child"
|
||||
|
||||
static void child(void *arg)
|
||||
{
|
||||
const char *value = getenv(PARENT);
|
||||
|
||||
if (!testOk(value && (strcmp(value, PARENT) == 0),
|
||||
"Child thread sees parent environment values")) {
|
||||
#ifdef vxWorks
|
||||
testDiag("VxWorks image needs ENV_VAR_USE_HOOKS configured as FALSE");
|
||||
#else
|
||||
testDiag("Check OS configuration, environment inheritance needed");
|
||||
#endif
|
||||
}
|
||||
|
||||
epicsEnvSet(CHILD, CHILD);
|
||||
}
|
||||
|
||||
MAIN(epicsEnvTest)
|
||||
{
|
||||
unsigned int stackSize = epicsThreadGetStackSize(epicsThreadStackSmall);
|
||||
const char *value;
|
||||
|
||||
testPlan(3);
|
||||
|
||||
epicsEnvSet(PARENT, PARENT);
|
||||
|
||||
value = getenv(PARENT);
|
||||
if (!testOk(value && (strcmp(value, PARENT) == 0),
|
||||
"epicsEnvSet correctly modifies environment"))
|
||||
testAbort("environment variables not working");
|
||||
|
||||
epicsThreadCreate("child", 50, stackSize, child, NULL);
|
||||
epicsThreadSleep(0.1);
|
||||
|
||||
value = getenv(CHILD);
|
||||
if (value && (strcmp(value, CHILD) == 0))
|
||||
testDiag("Child and parent threads share a common environment");
|
||||
|
||||
value = getenv(PARENT);
|
||||
testOk(value && (strcmp(value, PARENT) == 0),
|
||||
"PARENT environment variable not modified");
|
||||
|
||||
testDone();
|
||||
return 0;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ int epicsThreadTest(void);
|
||||
int epicsTimerTest(void);
|
||||
int epicsAlgorithm(void);
|
||||
int epicsEllTest(void);
|
||||
int epicsEnvTest(void);
|
||||
int epicsErrlogTest(void);
|
||||
int epicsCalcTest(void);
|
||||
int epicsEventTest(void);
|
||||
@ -63,6 +64,8 @@ void epicsRunLibComTests(void)
|
||||
|
||||
runTest(epicsEllTest);
|
||||
|
||||
runTest(epicsEnvTest);
|
||||
|
||||
runTest(epicsErrlogTest);
|
||||
|
||||
runTest(epicsCalcTest);
|
||||
|
0
src/std/dbRecStd.rc
Executable file → Normal file
0
src/std/dbRecStd.rc
Executable file → Normal file
@ -15,6 +15,7 @@
|
||||
#include "errlog.h"
|
||||
#include "recGbl.h"
|
||||
#include "recSup.h"
|
||||
|
||||
#include "lsoRecord.h"
|
||||
#include "printfRecord.h"
|
||||
#include "stringoutRecord.h"
|
||||
|
0
src/std/dev/softDevIoc.rc
Executable file → Normal file
0
src/std/dev/softDevIoc.rc
Executable file → Normal file
@ -41,6 +41,7 @@
|
||||
#include "recGbl.h"
|
||||
#include "cantProceed.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "aaiRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "recGbl.h"
|
||||
#include "cantProceed.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "aaoRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -36,6 +36,7 @@
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#include "menuConvert.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "aiRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -37,10 +37,11 @@
|
||||
#include "menuConvert.h"
|
||||
#include "menuOmsl.h"
|
||||
#include "menuYesNo.h"
|
||||
#include "menuIvoa.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "aoRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuIvoa.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
@ -34,10 +34,12 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "biRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "epicsExport.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
#define initialize NULL
|
||||
|
@ -33,12 +33,13 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "boRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuIvoa.h"
|
||||
#include "menuOmsl.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "boRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "epicsExport.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "calcRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -36,13 +36,13 @@
|
||||
#include "special.h"
|
||||
#include "callback.h"
|
||||
#include "taskwd.h"
|
||||
#include "menuIvoa.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "calcoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuIvoa.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
#define initialize NULL
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "special.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "compressRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#include "menuOmsl.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "dfanoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "eventRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "dbCommon.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "fanoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "histogramRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "longinRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -29,13 +29,14 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "menuYesNo.h"
|
||||
#include "menuIvoa.h"
|
||||
#include "menuOmsl.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "longoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuIvoa.h"
|
||||
#include "menuOmsl.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
#define initialize NULL
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "mbbiDirectRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -33,6 +33,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "mbbiRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -32,12 +32,13 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "mbboDirectRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuOmsl.h"
|
||||
#include "menuIvoa.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "mbboDirectRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "epicsExport.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
@ -33,12 +33,13 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "mbboRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuOmsl.h"
|
||||
#include "menuIvoa.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "mbboRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "epicsExport.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "permissiveRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "selRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "stateRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -33,11 +33,12 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "stringinRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "epicsExport.h"
|
||||
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
#define initialize NULL
|
||||
|
@ -32,14 +32,15 @@
|
||||
#include "errMdef.h"
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "stringoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "menuOmsl.h"
|
||||
#include "menuIvoa.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "stringoutRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "epicsExport.h"
|
||||
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
#define initialize NULL
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "cantProceed.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "subArrayRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include "recSup.h"
|
||||
#include "recGbl.h"
|
||||
#include "special.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "subRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "dbDefs.h"
|
||||
#include "epicsPrint.h"
|
||||
#include "epicsString.h"
|
||||
#include "alarm.h"
|
||||
#include "dbAccess.h"
|
||||
#include "dbEvent.h"
|
||||
@ -34,11 +35,11 @@
|
||||
#include "recGbl.h"
|
||||
#include "cantProceed.h"
|
||||
#include "menuYesNo.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "waveformRecord.h"
|
||||
#undef GEN_SIZE_OFFSET
|
||||
#include "epicsExport.h"
|
||||
#include "epicsString.h"
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
|
0
src/template/base/makeBaseApp.pl
Executable file → Normal file
0
src/template/base/makeBaseApp.pl
Executable file → Normal file
0
src/template/ext/makeBaseExt.pl
Executable file → Normal file
0
src/template/ext/makeBaseExt.pl
Executable file → Normal file
0
src/tools/registerRecordDeviceDriver.pl
Executable file → Normal file
0
src/tools/registerRecordDeviceDriver.pl
Executable file → Normal file
@ -31,7 +31,10 @@ sub GetEpicsHostArch { # no args
|
||||
} elsif ($arch =~ m/arm-linux/) { return "linux-arm";
|
||||
} elsif ($arch =~ m/MSWin32-x86/) { return "win32-x86";
|
||||
} elsif ($arch =~ m/MSWin32-x64/) { return "windows-x64";
|
||||
} elsif ($arch =~ m/cygwin/) { return "cygwin-x86";
|
||||
} elsif ($arch =~ m/cygwin/) {
|
||||
my($kernel, $hostname, $release, $version, $cpu) = POSIX::uname();
|
||||
if ($cpu =~ m/x86_64/) { return "cygwin-x86_64"; }
|
||||
return "cygwin-x86";
|
||||
} elsif ($arch =~ m/darwin/) {
|
||||
my($kernel, $hostname, $release, $version, $cpu) = POSIX::uname();
|
||||
if ($cpu =~ m/Power Macintosh/) { return "darwin-ppc"; }
|
||||
|
Reference in New Issue
Block a user