Compare commits

...

195 Commits

Author SHA1 Message Date
Janet B. Anderson
5856008613 R3.13.0.beta2 1996-09-05 14:47:19 +00:00
Marty Kraimer
f3003d9052 Remove rule for RECTYPES 1996-09-05 14:22:31 +00:00
Marty Kraimer
340ffec332 Forgot = 1996-09-05 13:42:25 +00:00
Marty Kraimer
91c6f156ff conversion should not have added .5 (bad for - numbers) 1996-09-05 13:01:27 +00:00
Marty Kraimer
2008c19e7d Forgot to save changes last time 1996-09-05 12:52:42 +00:00
Marty Kraimer
4dcb0e3ae6 Changed AB SLC500 DCM names to show that it is only for SLC500 DCM 1996-09-05 12:37:33 +00:00
Marty Kraimer
74bc7758b5 changed to show that support is for SCL500 Dcm 1996-09-05 12:36:05 +00:00
Jeff Hill
17143d0e12 wait for proper compiler installation 1996-09-04 22:51:58 +00:00
Jeff Hill
40be4d1cd5 allow vxWorks 5.1 and gnu win 32 1996-09-04 22:47:09 +00:00
Jeff Hill
d1ba9be665 installed 1996-09-04 22:41:41 +00:00
Jeff Hill
7f6bd17474 removed until the new gnu compilers are installed 1996-09-04 22:41:12 +00:00
Jeff Hill
6a534ca2b5 fixed gcc warnings 1996-09-04 22:08:50 +00:00
Jeff Hill
26ec4dd5c8 installed 1996-09-04 22:06:47 +00:00
Jeff Hill
a0db9a2eb2 not used 1996-09-04 22:06:24 +00:00
Jeff Hill
b5a102ef79 moved netdb.h include here 1996-09-04 22:04:07 +00:00
Jeff Hill
ed1491bb7b fixed gcc warnings 1996-09-04 21:59:03 +00:00
Jeff Hill
7fabc325bb added level arg to client_stat 1996-09-04 21:58:27 +00:00
Jeff Hill
5b546d2467 added vxWorks support 1996-09-04 21:54:56 +00:00
Jeff Hill
6440239832 allow use with goofy vxWorks 5.2 time spec - which has unsigned sec and
signed nsec
1996-09-04 21:53:36 +00:00
Jeff Hill
cb6c444a19 added hashed fd to fdi convert 1996-09-04 21:50:16 +00:00
Jeff Hill
c251b05020 MS Visual C defines sys_errlist in stdlib.h 1996-09-04 21:48:29 +00:00
Jeff Hill
1f7cc343c5 fixed gcc warning 1996-09-04 21:46:20 +00:00
Janet B. Anderson
d67eb28145 Top level dir no longer passed to MakeRelease 1996-09-04 21:41:36 +00:00
Jeff Hill
3001f7e82f no what on win32 1996-09-04 21:40:28 +00:00
Janet B. Anderson
3982ea7d17 Added info about new targets. 1996-09-04 21:22:34 +00:00
Jeff Hill
3fe00ec2a9 installed 1996-09-04 21:21:01 +00:00
Jeff Hill
11fa08c1e0 installed 1996-09-04 21:02:33 +00:00
Jeff Hill
b8d2273683 added GDD_NAME_PV_NAME 1996-09-04 20:58:55 +00:00
Jeff Hill
77fc9734b1 changes for MS VISC++ 1996-09-04 20:58:18 +00:00
Jeff Hill
289302f603 add GDD_NAME_PV_NAME 1996-09-04 20:55:02 +00:00
Jeff Hill
a01241aa19 fixed gcc warnings 1996-09-04 20:44:19 +00:00
Marty Kraimer
525842b076 added devABANALOG 1996-09-04 20:41:57 +00:00
Marty Kraimer
03a4c8ad01 added devABANALOG 1996-09-04 20:41:10 +00:00
Jeff Hill
8a7158b3c6 installed into CVS 1996-09-04 20:39:59 +00:00
Jeff Hill
08c57574d5 removed os depen stuff 1996-09-04 20:29:08 +00:00
Jeff Hill
a6c40247f1 (char *) cast below is for brain dead wrs prototype 1996-09-04 20:28:18 +00:00
Jeff Hill
86969d7b3a doccasdef.h 1996-09-04 20:27:02 +00:00
Jeff Hill
a3c13f6da6 use correct app type for exist test gdd, correct byte oder for mon mask, and efficient use of PV name gdd 1996-09-04 20:25:53 +00:00
Jeff Hill
0d0566253e added operator -> 1996-09-04 20:23:59 +00:00
Jeff Hill
15fda603a5 init new member cas and add arg to serverToolDebug() 1996-09-04 20:23:17 +00:00
Jeff Hill
7c0895bd82 removed operator -> and added member pv 1996-09-04 20:21:41 +00:00
Jeff Hill
5311ba4c15 removed sizeof(casEventMask::mask) for MSVISC++ 1996-09-04 20:20:44 +00:00
Jeff Hill
27b0c05bcf added missing byte swap on search reply port no 1996-09-04 20:19:47 +00:00
Jeff Hill
435208afa8 include db_access.h 1996-09-04 20:19:02 +00:00
Jeff Hill
0f1f7fc30c moved operator -> here 1996-09-04 20:18:27 +00:00
Jeff Hill
471acea0fc init new chan member 1996-09-04 20:18:03 +00:00
Jeff Hill
e122d8f4a6 use ptr not ref to satisfy MSVISC++ 1996-09-04 20:17:34 +00:00
Jeff Hill
53bde9e545 initialize new member - asyncIO 1996-09-04 20:13:16 +00:00
Jeff Hill
2ccaa6dcb6 added arg to serverToolDebugFunc() 1996-09-04 20:12:04 +00:00
Jeff Hill
8c8b971221 comment 1996-09-04 20:11:43 +00:00
Jeff Hill
dd43f91278 added new files 1996-09-04 20:10:43 +00:00
Jeff Hill
6b3a62de9f added main.cc 1996-09-04 20:09:33 +00:00
Jeff Hill
4bd45337bf add getEnums() stub 1996-09-04 20:08:55 +00:00
Jeff Hill
9351447cf2 removed main() 1996-09-04 20:08:33 +00:00
Jeff Hill
b9cdf72ee1 added defualt copy constructor fer MSVISC++ 1996-09-04 20:07:52 +00:00
Jeff Hill
81000e9391 added include of os specific area 1996-09-04 20:06:15 +00:00
Jeff Hill
19b81912fb added mt makefiles 1996-09-04 20:04:57 +00:00
Jeff Hill
b7df13b4fe fixed gcc warning 1996-09-04 20:02:32 +00:00
Jeff Hill
2f3befc845 test for non-nill piiu under vxWorks 1996-09-04 20:02:00 +00:00
Jeff Hill
826b68b652 string id resource now copies id 1996-09-04 19:57:11 +00:00
Janet B. Anderson
aece23e6ee Removed VPATH (puts ../$(INSTALL_LOCATION) in search path) 1996-09-04 19:19:52 +00:00
Janet B. Anderson
3a9ddfbdbb Change ARCHS and ACTIONS defs to +=. 1996-09-04 18:26:44 +00:00
Janet B. Anderson
11bdb5f6d4 Removed cvsignore files. 1996-09-04 18:22:48 +00:00
Janet B. Anderson
741450ce9e Removed copy of vxWorks files. 1996-09-04 18:18:25 +00:00
Janet B. Anderson
868e6c417d Modified dependency. 1996-09-04 18:17:18 +00:00
Marty Kraimer
0c19e23835 added new rules 1996-09-04 15:29:48 +00:00
Marty Kraimer
342ffb5d83 fixed bugs repoeted in 3.13 beta1 1996-09-04 15:28:56 +00:00
Marty Kraimer
afa44fae79 added routines to obtain options for link field 1996-09-04 15:27:53 +00:00
Marty Kraimer
333b379287 fixed bugs 1996-09-04 15:26:58 +00:00
Marty Kraimer
36f74c934e removed event throttling code 1996-09-04 15:25:54 +00:00
Marty Kraimer
8f41686a98 If process routine found udf true it did not perform normal record completion 1996-09-04 15:25:19 +00:00
Marty Kraimer
75feb3a5d4 Changes for 3.13 1996-09-04 15:23:54 +00:00
Marty Kraimer
50ace741fe removed obsolete event throttling code 1996-09-04 15:23:22 +00:00
Marty Kraimer
036cd8dd26 Added INC+= 1996-08-27 16:11:30 +00:00
Marty Kraimer
9758aa4a45 Error on special gave wrong error message 1996-08-27 16:04:31 +00:00
Marty Kraimer
cf1cb554f6 dbPutField - Call special before converting to DB or CA 1996-08-27 16:03:42 +00:00
Marty Kraimer
ee68f746c6 Sometimes sdr2recordtype can't find field name 1996-08-27 15:48:31 +00:00
Jeff Hill
85f2cf5833 No longer used 1996-08-27 15:45:13 +00:00
Jim Kowalkowski
5819ac0c48 final repairs to string functions, put() functions, and error code printing 1996-08-27 13:05:10 +00:00
Jim Kowalkowski
3e26a12948 completed fixes for the aitString and fixed string management 1996-08-23 20:29:36 +00:00
Jim Kowalkowski
279385ecb9 made dump functions print more useful information 1996-08-23 20:28:46 +00:00
Jim Kowalkowski
75c91c8035 More fixes to make strings and fixed string work better. 1996-08-22 21:05:43 +00:00
Janet B. Anderson
1f39f39d79 R3.13.0.beta1 1996-08-15 14:50:15 +00:00
Marty Kraimer
d807b2ace5 More changes for handling forms 1996-08-14 20:59:07 +00:00
Janet B. Anderson
18c52e5839 CVS:Now allows archname in targets.
--------------------i--------------------------------------------------
1996-08-14 20:47:46 +00:00
Janet B. Anderson
81cd82fcca SPECIAL_LANG not needed any more. 1996-08-14 20:46:24 +00:00
Janet B. Anderson
f1d714a57e Added PHONEY stmnts. 1996-08-14 20:42:46 +00:00
Janet B. Anderson
7ce03e13e8 Removed reference to SPECIAL_LANG 1996-08-14 20:41:17 +00:00
Marty Kraimer
3ca0a1f556 More changes for code that handles forms 1996-08-14 18:50:13 +00:00
Jim Kowalkowski
b8a0083745 fixed a put() function that did not return anything 1996-08-14 16:29:38 +00:00
Janet B. Anderson
11925a7168 Added sch2edif and e2db and flags. 1996-08-14 14:33:48 +00:00
Jim Kowalkowski
e81b990a31 added first() to list class, added first()/last() to iterator. 1996-08-14 12:32:09 +00:00
Jim Kowalkowski
edff93791b fixes for converting aitString to aitInt8* and back
fixes for managing the units field for the dbr types
1996-08-14 12:30:15 +00:00
Jeff Hill
5ca9baaede removed os specific code 1996-08-13 23:16:23 +00:00
Jeff Hill
ea0ff36f65 fixed warning 1996-08-13 23:15:36 +00:00
Jeff Hill
a2b8735fe5 check status in call back 1996-08-13 23:14:59 +00:00
Jeff Hill
cb9583a21a win NT changes 1996-08-13 23:13:35 +00:00
Jeff Hill
3d1180b17f C++ support 1996-08-13 23:07:40 +00:00
Jeff Hill
507a125c2c removed include of netdb.h 1996-08-13 23:00:29 +00:00
Jeff Hill
c5bfbfccc0 added init to mutex class 1996-08-13 22:58:38 +00:00
Jeff Hill
d3e21e87b2 fdMgr.h => fdmanager.h 1996-08-13 22:58:15 +00:00
Jeff Hill
9c05191e9e added init for mutex class 1996-08-13 22:56:14 +00:00
Jeff Hill
9c2248a5c6 doc 1996-08-13 22:54:42 +00:00
Jeff Hill
546bb97e92 fixed little endian problem 1996-08-13 22:54:20 +00:00
Jeff Hill
c556f69387 changes for MVC++ 1996-08-13 22:53:14 +00:00
Jeff Hill
2ec12266ad dfMgr =>fdManager 1996-08-13 22:48:25 +00:00
Jeff Hill
13c03c4cde fixed tabs 1996-08-13 22:45:21 +00:00
Jeff Hill
99deec1134 fdMgr.h => fdManager.h 1996-08-13 22:44:24 +00:00
Jeff Hill
1938a00761 use put convert 1996-08-13 22:43:50 +00:00
Janet B. Anderson
e50d5375f8 Added mangen and capfast rules. 1996-08-13 21:48:00 +00:00
Jeff Hill
30e64505e3 added C++ support 1996-08-13 21:42:57 +00:00
Jeff Hill
0b3df30c4f many sequnecer changes from Andy Kozubal 1996-08-13 15:39:22 +00:00
Jim Kowalkowski
070673fa89 changes for better string manipulation and fixes for the units field 1996-08-13 15:07:48 +00:00
Jeff Hill
bfb6dcc118 fixed problem in ca_import_cancel() 1996-08-12 21:50:41 +00:00
Marty Kraimer
46c39c3253 Fixed various bugs related to forms 1996-08-12 20:17:49 +00:00
Jim Kowalkowski
ad232dd2d9 Re-added the installString() function I took out. 1996-08-12 15:37:46 +00:00
Janet B. Anderson
c40ff7da52 Removed .cvsignore file. 1996-08-12 15:14:01 +00:00
Janet B. Anderson
2af23a4893 SPECIAL_LANG changed for new compilers. 1996-08-09 14:01:27 +00:00
Marty Kraimer
7260cf15fb removed .cvsignore; added comment about cd path to startup file 1996-08-09 13:23:17 +00:00
Jim Kowalkowski
ee2cf25c35 fix getRef(aitString*&) to return the correct value if gdd is scalar 1996-08-09 02:29:16 +00:00
Jim Kowalkowski
08ec0e69d8 rewrite of aitString class - more intuitive now, I think 1996-08-09 02:28:09 +00:00
Marty Kraimer
e906138c55 Mods for handling forms 1996-08-08 19:05:34 +00:00
Marty Kraimer
0e6b238881 Changes for new config rules 1996-08-08 19:04:30 +00:00
Marty Kraimer
82e39acd3a Changed rule for dbExpand 1996-08-08 19:03:55 +00:00
Janet B. Anderson
85ef2f5a10 Added prod rule. 1996-08-07 22:38:13 +00:00
Janet B. Anderson
733ed90bd7 Uninstall rule changes. 1996-08-07 21:00:46 +00:00
Janet B. Anderson
4c8c63c9e1 DIRS now used by src/Makefile 1996-08-07 20:50:35 +00:00
Janet B. Anderson
aeaad63186 Now includes RULES_TOP, changed DIRS def. 1996-08-07 20:49:37 +00:00
Janet B. Anderson
70a87d2c95 Now includes RULES_DIRS, added rules for applications 1996-08-07 20:46:45 +00:00
Janet B. Anderson
41b53c1a67 Simplified syntax 1996-08-07 20:40:25 +00:00
Janet B. Anderson
a4ac96afdc Added VPATH, PHONEY, mangen rule, double colon rules. 1996-08-07 20:37:29 +00:00
Janet B. Anderson
a5d46a7a07 Added VPATH, PHONEY, mangen rule and changed rules to double colen rules 1996-08-07 20:23:31 +00:00
Janet B. Anderson
e37d227975 Now installs only build specific config files. 1996-08-07 20:14:26 +00:00
Janet B. Anderson
adab5e6a1a Make some includes optional 1996-08-07 20:12:37 +00:00
Janet B. Anderson
56a11aa90c New Makefile added. 1996-08-07 20:11:03 +00:00
Janet B. Anderson
969152088f Removed reference to EPICS_BASE 1996-08-07 20:10:00 +00:00
Janet B. Anderson
2a5871e303 Bug fix for SRCS.c 1996-08-07 20:09:03 +00:00
Janet B. Anderson
b5c459b036 Added option for creation of missing parent dirs 1996-08-07 20:08:00 +00:00
Janet B. Anderson
cffd160cf0 installEpics must be installed first. 1996-08-07 20:06:22 +00:00
Jim Kowalkowski
c4aa64946f Fixes to the string class.
Changes units field to a aitString instead of aitInt8.
1996-08-06 19:14:13 +00:00
Jeff Hill
069c404d64 use ca_import_cancel() 1996-08-05 23:50:59 +00:00
Jeff Hill
998e413bed gddScaler => gddScalar 1996-08-05 23:22:58 +00:00
Jeff Hill
8fd7fff71c use ca_import_cancel() 1996-08-05 22:41:08 +00:00
Jeff Hill
d799330ec0 removed READONLY which disagrees with VAX compiler 1996-08-05 21:58:57 +00:00
Jeff Hill
631de381fd fixed delete this confusion 1996-08-05 21:53:43 +00:00
Jeff Hill
f15f4ad524 added -include of HOME/.EPICS_CONFIG 1996-08-05 21:46:57 +00:00
Jeff Hill
13156bee16 removed ; from if 1996-08-05 19:33:40 +00:00
Jeff Hill
090e6ce3d3 fixed removes use of iter.cur() 1996-08-05 19:31:59 +00:00
Jeff Hill
fd2a536131 no change 1996-08-05 19:30:49 +00:00
Jeff Hill
6b6c9ce6a1 os depen code now smaller 1996-08-05 19:29:25 +00:00
Jeff Hill
95f4990b98 space became tab 1996-08-05 19:28:49 +00:00
Jeff Hill
ad2a272e90 added process() 1996-08-05 19:27:28 +00:00
Jeff Hill
7438234eb5 doc 1996-08-05 19:26:51 +00:00
Jeff Hill
67eb929b63 made os specific code smaller 1996-08-05 19:26:15 +00:00
Jeff Hill
5d73bdffb2 removed unused code 1996-08-05 19:25:17 +00:00
Jeff Hill
3c603a7e3f removed ERROR and OK 1996-08-05 19:24:23 +00:00
Jeff Hill
ec34df23fc removed unused proto 1996-08-05 19:21:26 +00:00
Jeff Hill
67dce79b62 removed incorrect ver number 1996-08-05 19:20:29 +00:00
Jeff Hill
70c885000e better msg for lack of fp 1996-08-05 19:18:56 +00:00
Jeff Hill
f2cd63c68f info level => warning several codes 1996-08-05 19:17:47 +00:00
Jeff Hill
7d342b5276 WIN sock specific fd range check 1996-08-05 19:16:27 +00:00
Jeff Hill
20880b3950 fixed O.xxx/Makefile 1996-07-30 21:27:39 +00:00
Marty Kraimer
6bd6481cbd check that recGblInitConstantLink returned TRUE before setting udf FALSE
Add DBE_LOG on call to db_post_event when necessary
1996-07-29 20:40:13 +00:00
Marty Kraimer
2433b09c1c additional include install commands were added 1996-07-29 20:35:04 +00:00
Marty Kraimer
a057f79d75 various bugs fixed 1996-07-29 20:33:43 +00:00
Marty Kraimer
1947538968 These utilities core dumped if given no arguments. 1996-07-29 20:29:00 +00:00
Marty Kraimer
dc6972ba06 "Allen Bradley 1746-HTSP" changed to "AB-1746HSTP1"
VS: ----------------------------------------------------------------------
1996-07-29 20:26:19 +00:00
Marty Kraimer
c4171b7ec0 initial check that argc>=2 1996-07-26 19:26:43 +00:00
Jim Kowalkowski
7f08759c2a Corrected a spelling with from gdd associated with the word Scalar. 1996-07-26 02:30:07 +00:00
Jim Kowalkowski
43b11de6ad Corrected a spelling error associated with the word Scalar from gdd. 1996-07-26 02:29:32 +00:00
Jim Kowalkowski
66ee6135ba Corrected the spelling error from gdd associated with the word Scalar 1996-07-26 02:28:37 +00:00
Jim Kowalkowski
3c4ffb5cc4 Fixed the spelling error with Scalar. 1996-07-26 02:23:18 +00:00
Jeff Hill
72a8c35f55 use pattern rule 1996-07-25 23:50:15 +00:00
Jeff Hill
53f2acfaa1 use RULES_DIRS 1996-07-25 21:38:53 +00:00
Jeff Hill
fe4cfd8091 no longer in use 1996-07-25 21:37:54 +00:00
Jeff Hill
8c2cefc5a4 eliminated for loops and redun recursion 1996-07-25 21:09:43 +00:00
Jeff Hill
dbe9f90ac1 DIRS def before include of RULES_TOP 1996-07-25 21:07:39 +00:00
Jeff Hill
4b47e7a979 use pointer (not ref) for list in iter class 1996-07-25 18:01:42 +00:00
Jeff Hill
d12ce5f58a updated tests to current version 1996-07-25 18:00:21 +00:00
Jeff Hill
f1b751a3d3 fixed missing ref in list decl 1996-07-25 17:58:16 +00:00
Jeff Hill
c324b8f598 instlled 1996-07-24 23:03:16 +00:00
Jeff Hill
64e851e05c use iter.remove() 1996-07-24 23:01:53 +00:00
Jeff Hill
e3fb1f6c90 fixed gnu warning int=>size_t 1996-07-24 22:48:06 +00:00
Jeff Hill
0844d7132f removed OPTIM_YES=-g which caused link fail 1996-07-24 22:47:29 +00:00
Jeff Hill
dd8fa0e290 installed makefiles 1996-07-24 22:26:29 +00:00
Jeff Hill
276dd19293 removed gdd:: from func proto 1996-07-24 22:17:17 +00:00
Jeff Hill
a312de99b0 added remove() to iter class + made node's prev/next private 1996-07-24 22:12:09 +00:00
Jeff Hill
ccfcd95561 removed casSpecificOS.h 1996-07-24 22:05:18 +00:00
Jeff Hill
2e42535459 fixed net proto for gnu compiler 1996-07-24 22:03:36 +00:00
Jeff Hill
d3432d487a added pushOnToEventQueue() 1996-07-24 22:00:50 +00:00
Jeff Hill
c6701f8475 CXXCMPLR = STRICT 1996-07-24 21:57:17 +00:00
Jeff Hill
dba800ebb7 fixed gnu warnings 1996-07-24 21:55:33 +00:00
Jeff Hill
cda87cbf31 made acctst catime into targets 1996-07-24 21:52:36 +00:00
Jim Kowalkowski
376f37eb1e various fixes - dbmapper incorrectly worked with enum types 1996-07-23 17:13:34 +00:00
Janet B. Anderson
2f2f378238 Updated to reflect config dir changes. 1996-07-16 14:18:48 +00:00
234 changed files with 8804 additions and 6286 deletions

View File

@@ -10,6 +10,9 @@
# [-b] - For fully built release
#
# $Log$
# Revision 1.8 1996/07/02 13:45:09 jba
# Added dbd and base/config dirs. Removed epics/config and base/rec.
#
# Revision 1.7 1996/06/25 21:54:42 jba
# Command line parm now base dir
#
@@ -75,9 +78,13 @@ fi
FULLY_BUILT=NO
if [ "${2}" = "-b" ]; then
if [ "${1}" = "-b" ]; then
FULLY_BUILT=YES
shift
if [ "${1}" != "." ]; then
echo "TOP: Cannot create a fully built release.";
exit 1;
fi
fi
# Retrieve EPICS release string from src/include/epicsVersion.h

View File

@@ -16,89 +16,19 @@
TOP=.
include $(TOP)/config/CONFIG_BASE
all: install
DIRS = src config
build:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
install:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
depends:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
clean:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
uninstall:
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
include $(TOP)/config/RULES_TOP
release:
@echo TOP: Creating Release...
@./MakeRelease ${TOP}
@./MakeRelease
built_release: install
built_release:
@echo TOP: Creating Fully Built Release...
@./MakeRelease ${TOP} -b
@./MakeRelease -b $(INSTALL_LOCATION)
# Notes for single architecture build rules:
# CheckArch only has to be run for dirs.% . That
# way it will only be run ONCE when filtering down
# dependencies.
#
# CheckArch does not have to be run for cleans
# because you might want to eliminate binaries for
# an old architecture.
# DIRS RULE syntax: make depends.arch
# e.g.: make depends.mv167
#
# Create dependencies for an architecture. We MUST
# do this separately for each architecture because
# some things may be included on a per architecture
# basis.
build.%:
@echo $*: Building
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs build
install.%:
@echo $*: Installing
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs install
depends.%:
@echo $*: Performing Make Depends
@${MAKE} ${MFLAGS} T_A=$* -f Makefile.subdirs depends
# Illegal Syntax
release.%:
@echo
@echo "The release.arch syntax is not supported by this build."
@echo " Use 'make release' or 'make built_release' instead."
@echo
uninstall.%:
@echo "TOP: Uninstalling $* "
@rm -rf $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
@rm -rf rec.bak rec
uninstall::
@DIR1=`pwd`;cd $(INSTALL_LOCATION);DIR2=`pwd`;cd $$DIR1;\
if [ "$$DIR1" != "$$DIR2" ]; then rm -fr $(INSTALL_LOCATION)/config; fi
clean.%:
@echo "TOP: Cleaning $* "
@find src -type d -name "O.$*" -prune -exec rm -rf {} \;
@find config -type d -name "O.$*" -prune -exec rm -rf {} \;

View File

@@ -1,55 +0,0 @@
#
# base $Id$
#
# EPICS Makefile For Subdirectory Recursions
# by Matthew Needes and Mike Bordua
#
TOP=.
include $(TOP)/config/CONFIG_BASE
all: build
build: dirs
@(for DIR in ${DIRS}; \
do \
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
cd $$TMP; \
done)
install: dirs
@(for DIR in ${DIRS}; \
do \
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
cd $$TMP; \
done)
depends: dirs
@(for DIR in ${DIRS}; \
do \
TMP=`pwd`; echo "${T_A}: $@: $$DIR"; \
cd $$DIR/O.${T_A}; ${MAKE} $@ ; \
cd $$TMP; \
done)
dirs:
@echo ${T_A}: Creating Directories
@for DIR in ${DIRS}; \
do \
TMP=`pwd`; \
cd $$DIR ; \
if [ -f Makefile.${BUILD_TYPE} ] ; then \
test -d O.${T_A} || \
mkdir O.${T_A}; \
test -f O.${T_A}/Makefile || \
( echo "T_A=${T_A}" > O.${T_A}/Makefile; \
echo "include ../Makefile.${BUILD_TYPE}" \
>> O.${T_A}/Makefile;); \
test -f O.${T_A}/.DEPENDS || \
touch O.${T_A}/.DEPENDS; \
fi ; \
cd $$TMP; \
done

180
README
View File

@@ -1,7 +1,7 @@
$Id$
----------------------------------------------------------------------------
3.12 EPICS BASE Notes and Build Instructions.
3.13 EPICS BASE Notes and Build Instructions.
- By Matthew Needes
----------------------------------------------------------------------------
@@ -27,9 +27,9 @@ Notes:
1.2 To add a target architecture to EPICS:
cd config
cp CONFIG_ARCH.mv167 CONFIG_ARCH.YOUR_ARCH
edit CONFIG_ARCH.YOUR_ARCH - For compiler flags / etc.
cd base/config
cp CONFIG.mv167 CONFIG.YOUR_ARCH
edit CONFIG.YOUR_ARCH - For compiler flags / etc.
cp CONFIG.Vx.68k CONFIG.Vx.YOUR_ARCH_CLASS
cp CONFIG_SITE.Vx.68k CONFIG_SITE.Vx.YOUR_ARCH_CLASS
@@ -41,35 +41,51 @@ Notes:
1.3 To build EPICS:
cd epics/base
gnumake - To build and install EPICS.
gnumake - To install include files, build and install EPICS.
(Same as "gnumake inc install")
gnumake all - Same as "gnumake"
gnumake clean - To clean temporary object files. Top level
clean will remove all the O.ARCH dirs, not
only those specified in BUILD_ARCHS.
clean will remove all the O.ARCH dirs, not
only those specified in BUILD_ARCHS.
gnumake uninstall - Only available at the top level directory.
Cleans directories created by the install.
gnumake rebuild - Same as "gnumake clean uninstall all"
1.4 To create an EPICS release:
1.4 "Partial" build commands:
edit src/include/epicsVersion.h - ONLY IF you need to change the EPICS
version number.
The complete set of targets now supported are:
gnumake release - Will create Tar file
action
arch
action.arch
dir
dir.action
dir.arch
dir.action.arch
gnumake built_release - Will create Tar file, after generating
dependencies, INCLUDING BINARIES.
where:
action can be clean, inc, install, depends, or build
action can also be uninstall or rebuild at top level only
dir is the name of a subdirectory.
arch can be host, cross, sun4, solaris, mv167, ...
1.5 "Partial" build commands:
Examples are:
gnumake clean.sun4 - Cleans sun4 binaries in O.sun4 dirs only.
gnumake install.sun4 - Builds sun4 only.
gnumake install.mv167 - Builds mv167 only (a HOST_ARCH build must
be complete before this can be issued).
gnumake inc - To install include files
gnumake install.host - To build and install EPICS for host arch.
gnumake install.cross - To build and install EPICS for Vx archs.
gnumake clean.sun4 - Cleans sun4 binaries in O.sun4 dirs only.
gnumake install.sun4 - Builds sun4 only.
gnumake install.mv167 - Builds mv167 only (a HOST_ARCH build must
be complete before this can be issued).
NOTES:
1. base/MakeRelease will create tar files in the directory ABOVE
base. These tar files are then meant to be untarred at that level.
This release will include the "epics/startup" directory.
2. EPICS binaries and shellscripts are installed into the bin/ARCH and
lib/ARCH directories.
1. EPICS binaries and shellscripts are installed into the directory
$(INSTALL_LOCATION)/bin/ARCH.
2. EPICS libraries are installed into the $(INSTALL_LOCATION)/lib/ARCH
directory.
3. During a normal build (a "make" or "make install"), the "depends"
dependency will NOT be invoked. Only if "make depends" is run
@@ -88,7 +104,7 @@ NOTES:
mv167 target.
----------------------------------------------------------------------------
Part 2 --- Configuration Files in epics/config
Part 2 --- Configuration Files in epics/base/config
----------------------------------------------------------------------------
CONFIG - This file is meant to be included in the low-level EPICS Makefiles.
It includes the other EPICS makefiles, and allows individual developers
@@ -107,7 +123,7 @@ manager. It specifies:
etc.
----------------------------------------------------------------------------
CONFIG_ARCH.ARCH - This file defines a particular architecture. It
CONFIG.ARCH - This file defines a particular architecture. It
contains the following variables:
BUILD_TYPE: Unix / Vx
@@ -115,23 +131,21 @@ contains the following variables:
Architecture dependent build flags. The flag names / contents
depend on your architecture class.
----------------------------------------------------------------------------
CONFIG_SITE.BUILD_TYPE.ARCH_CLASS - Contains definitions of where to
find things, like X11 / Motif, etc.
----------------------------------------------------------------------------
CONFIG.BUILD_TYPE.ARCH_CLASS - Contains definitions pertaining to a
particular architecture class. This file's primary usefulness is to
define compile and link flags.
CONFIG_SITE.ARCH - Contains site specific definitions pertaining to a
particular architecture. This file's primary usefulness is to
define site specific compile and link flags.
----------------------------------------------------------------------------
CONFIG_COMMON - Contains definitions describing the layout of base.
----------------------------------------------------------------------------
CONFIG_BASE
CONFIG_EXTENSIONS - Defines what subdirectories get built by default under
base and extensions.
CONFIG_BASE - Defines what subdirectories get built by default under base.
----------------------------------------------------------------------------
RULES.Vx - Rules for building with VxWorks makefiles.
----------------------------------------------------------------------------
RULES.Unix - Rules for building with Unix makefiles.
----------------------------------------------------------------------------
RULES_TOP - Top level rules for building.
----------------------------------------------------------------------------
RULES_ARCHS
RULES_DIRS - Allows top-level type command syntax in low-level directories.
----------------------------------------------------------------------------
@@ -143,18 +157,18 @@ Filename SYS_MGR ADD_VX_ARCH ADD_UNIX_ARCH DEVELOPER
CONFIG m - - m
CONFIG_SITE m m m -
CONFIG_ARCH.ARCH - c c -
CONFIG_SITE.Unix.ARCH_CLASS m - c* -
CONFIG_SITE.Vx.ARCH_CLASS m c* - -
CONFIG.Unix.ARCH_CLASS - - c* -
CONFIG_SITE_ENV m - - -
CONFIG.ARCH - c c -
CONFIG_SITE.ARCH - c c -
CONFIG.Vx.ARCH_CLASS - c* - -
RULES.Vx - - - -
RULES.Unix - - - -
CONFIG_BASE - - - -
CONFIG_EXTENSIONS - - - -
CONFIG_COMMON - - - -
CONFIG_ENV - - - -
RULES_ARCHS - - - -
RULES_DIRS - - - -
RULES_TOP - - - -
m - Modify an existing file.
c - Create a new file.
@@ -172,63 +186,57 @@ RULES_DIRS - - - -
(files are numbered in the order of their inclusion)
src/db/Makefile.Vx (An example EPICS makefile)
^ ^ ^
| | +--- 3. RULES.Vx
| | Default rules.
| +------- 2. CONFIG
| ^ ^ ^ ^ ^
| | | | | |
| | | | | +- 1. CONFIG_SITE
| | | | | HOST_ARCH = sun4
| | | | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | | | VX_DIR = /vxworks
| | | | | More.
| | | | +--- 2. CONFIG_COMMON
| | | | General info about base.
| | | +----- 3. CONFIG_ARCH.hkv2f
| | | BUILD_TYPE = Vx
| | | ARCH_CLASS = 68k
| | | Arch Specific Compiler Flag Setup
| | +------- 4. CONFIG_SITE.Vx.68k
| | Directory locations
| +--------- 5. CONFIG.Vx.68k
| Compiler/utility setup for ARCH_CLASS
+---------- 1. Target.include
T_A definition (target architecture)
^ ^
| +--- 3. RULES.Vx
| Default rules.
+------- 2. CONFIG
^ ^ ^ ^
| | | |
| | | +- 1. CONFIG_SITE
| | | HOST_ARCH = sun4
| | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | VX_DIR = /vxworks
| | | More.
| | +--- 2. CONFIG_COMMON
| | General info about base.
| +----- 3. CONFIG.hkv2f
| ^ BUILD_TYPE = Vx
| | ARCH_CLASS = 68k
| | Arch Specific Compiler Flag Setup
| +--- a. CONFIG.Vx.68k
| Compiler/utility setup for ARCH_CLASS
+------- 4. CONFIG_SITE.hkv2f
Site Specific setup
---------------------------- sun4 example --------------------------------
(files are numbered in the order of their inclusion)
src/db/Makefile.Unix (An example EPICS makefile)
^ ^ ^
| | +--- 3. RULES.Unix
| | Default rules.
| +------- 2. CONFIG
| ^ ^ ^ ^ ^
| | | | | |
| | | | | +- 1. CONFIG_SITE
| | | | | HOST_ARCH = sun4
| | | | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | | | VX_DIR = /vxworks
| | | | | More.
| | | | +--- 2. CONFIG_COMMON
| | | | General info about base.
| | | +----- 3. CONFIG_ARCH.sun4
| | | BUILD_TYPE = Unix
| | | ARCH_CLASS = sun4
| | | Arch Specific Compiler Flag Setup
| | +------- 4. CONFIG_SITE.Unix.sun4
| | Directory locations
| +--------- 5. CONFIG.Unix.sun4
| Compiler/utility setup for ARCH_CLASS
+---------- 1. Target.include
T_A definition (target architecture)
^ ^
| +--- 3. RULES.Unix
| Default rules.
+------- 2. CONFIG
^ ^ ^ ^
| | | |
| | | +- 1. CONFIG_SITE
| | | HOST_ARCH = sun4
| | | BUILD_ARCHS = $(HOST_ARCH) mv167 hkv2f
| | | VX_DIR = /vxworks
| | | More.
| | +--- 2. CONFIG_COMMON
| | General info about base.
| +----- 3. CONFIG.sun4
| BUILD_TYPE = Unix
| ARCH_CLASS = sun4
| Arch Specific Compiler Flag Setup
+------- 4. CONFIG_SITE.sun4
Directory locations
----------------------------------------------------------------------------
Part 4 --- EPICS dependencies
Part 4 --- EPICS makefile rules
----------------------------------------------------------------------------
Dependencies supported by lower level Makefiles:
Rules supported by lower level Makefiles:
depends - Generate include dependencies
build - Builds objects, using libraries from "build_libs"

View File

@@ -11,16 +11,21 @@ include $(EPICS_BASE)/config/CONFIG_SITE
#
include $(EPICS_BASE)/config/CONFIG_COMMON
ifdef T_A
# assume T_A is the host arch if not specified
ifndef T_A
T_A = $(HOST_ARCH)
endif
# Architecture specific definitions
#
include $(EPICS_BASE)/config/CONFIG.$(T_A)
#
include $(EPICS_BASE)/config/CONFIG_SITE.$(T_A)
endif
-include $(EPICS_BASE)/config/CONFIG_SITE.$(T_A)
# User specific definitions
#
-include $(HOME)/.EPICS_CONFIG
# All EPICS options other than BUILD_TYPE
# may be overridden here.
#
@@ -38,4 +43,3 @@ endif
#VX_WARN=YES
#etc.
#

View File

@@ -22,8 +22,10 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
@@ -43,6 +45,24 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -Bstatic
ACC_SFLAGS_NO=
@@ -91,7 +111,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -102,5 +121,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.Linux

View File

@@ -8,11 +8,16 @@ RANLIB = $(VX_GNU_BIN)/ranlib68k
YACC = $(EYACC)
LEX = $(ELEX)
CC = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
CXX = $(VX_GNU_BIN)/cc68k -B$(VX_GNU_LIB)/gcc-lib/ -nostdinc
CPP = $(VX_GNU_BIN)/cpp68k -nostdinc
#CPP = $(CC) -E
GCC = $(CC)
LD = $(VX_GNU_BIN)/ld68k -r
EPICS_LDLIBS =
MV=mv
RM=rm -f
MKDIR=mkdir
RMDIR=rm -rf
# special c library requirements
SPECIAL_LANG =
@@ -48,14 +53,18 @@ TARGET_CPPFLAGS = $($(basename $@)_CPPFLAGS)
TARGET_SNCFLAGS = $($(basename $@)_SNCFLAGS)
CFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
CXXFLAGS = $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(VX_CFLAGS)
LDFLAGS = $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(VX_LDFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# Build compile line here
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
LINK.c = $(LD) $(LDFLAGS)
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.cc = $(LD) $(LDFLAGS)
CPPSNCFLAGS = $(USR_INCLUDES) $(VX_INCLUDES)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Vx.68k
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = -$(COMPILE.cc) -M $(SRCS.cc) > .DEPENDS

View File

@@ -18,6 +18,8 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_YES = $(ACC)
@@ -37,6 +39,24 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -non_shared
ACC_SFLAGS_NO= -call_shared
@@ -83,7 +103,6 @@ CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(U
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)

View File

@@ -20,6 +20,8 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_YES = $(ACC)
@@ -39,7 +41,25 @@ GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
@@ -91,7 +111,6 @@ CFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CFLAGS) $(USR_CFLAGS) $(ARCH_DEP_CFLAGS) $(U
CCFLAGS = $(UNIX_OPT_FLAGS) $(TARGET_CCFLAGS) $(USR_CCFLAGS) $(ARCH_DEP_CCFLAGS) $(UNIX_CCFLAGS)
CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
ARFLAGS = rv

View File

@@ -21,6 +21,8 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = CC
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -xansi -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -xansi
@@ -42,6 +44,25 @@ C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS =
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -Bstatic
ACC_SFLAGS_NO=
@@ -89,7 +110,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -101,5 +121,5 @@ LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
LOAD.c = ld -shared $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sgi

View File

@@ -20,12 +20,16 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = /opt/gnu/bin/g++
CCC = /opt/SUNWspro/bin/CC
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
ACC_STRICT_INVOKE_W_YES = $(ACC) -Xc -v
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
ACC_LD_FLAGS =
ACC_LD_LIBS =
SUNCC_TRAD_INVOKE_W_NO = $(ACC_TRAD_INVOKE_W_NO)
SUNCC_TRAD_INVOKE_W_YES = $(ACC_TRAD_INVOKE_W_YES)
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w
@@ -33,12 +37,41 @@ GCC_ANSI_INVOKE_W_YES = $(GCC) -ansi
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
GCC_LD_LIBS =
GCC_LD_FLAGS =
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
LD_LIBS_OLD = $($(STANDARD)_LD_LIBS)
LD_LIBS_ANSI = $($(ANSI)_LD_LIBS)
LD_LIBS_STRICT = $($(ANSI)_LD_LIBS)
CCOMPILER_LDLIBS = $(LD_LIBS_$(CMPLR))
LD_FLAGS_OLD = $($(STANDARD)_LD_FLAGS)
LD_FLAGS_ANSI = $($(ANSI)_LD_FLAGS)
LD_FLAGS_STRICT = $($(ANSI)_LD_FLAGS)
CCOMPILER_LDFLAGS = $(LD_FLAGS_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
#ACC_SFLAGS_YES= -dn
ACC_SFLAGS_YES= -Bstatic
@@ -71,8 +104,8 @@ UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
# Operating system flags
OP_SYS_FLAGS = -DUNIX
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDLIBS = $(UNIX_SLIBS) -lm
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
UNIX_LDLIBS = $(UNIX_SLIBS) -lm $(CCOMPILER_LDLIBS)
# Architecture specific build flags
ARCH_DEP_CFLAGS = -DSOLARIS
@@ -99,7 +132,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX = $(CCC)
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -110,5 +142,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -xM $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -xM $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.solaris

View File

@@ -21,13 +21,17 @@ YACC = $(EYACC)
LEX = $(ELEX)
G++ = g++
CCC = /usr/lang/CC
RMDIR = rm -rf
MKDIR = mkdir
ACC_ANSI_INVOKE_W_NO = $(ACC) -w
ACC_ANSI_INVOKE_W_NO = $(ACC) -Xa -w
ACC_ANSI_INVOKE_W_YES = $(ACC) -Xa
ACC_TRAD_INVOKE_W_NO = $(ACC) -Xs -w
ACC_TRAD_INVOKE_W_YES = $(ACC) -Xs
ACC_STRICT_INVOKE_W_NO = $(ACC) -Xc -w
ACC_STRICT_INVOKE_W_YES = $(ACC) -Xc -vc
ACC_LD_FLAGS = -L$(SPECIAL_LANG)
ACC_LD_LIBS =
SUNCC_TRAD_INVOKE_W_NO = $(SUNCC) -w
SUNCC_TRAD_INVOKE_W_YES = $(SUNCC)
GCC_ANSI_INVOKE_W_NO = $(GCC) -ansi -w -D__USE_FIXED_PROTOTYPES__
@@ -36,12 +40,42 @@ GCC_STRICT_INVOKE_W_NO = $(GCC) -ansi -pedantic -D__USE_FIXED_PROTOTYPES__
GCC_STRICT_INVOKE_W_YES = $(GCC) -ansi -Wall -pedantic -D__USE_FIXED_PROTOTYPES__
GCC_TRAD_INVOKE_W_NO = $(GCC) -traditional -w
GCC_TRAD_INVOKE_W_YES = $(GCC) -traditional
GCC_LD_LIBS = -liberty
GCC_LD_FLAGS =
C_OLD = $($(STANDARD)_TRAD_INVOKE_W_$(UNIX_WARN))
C_ANSI = $($(ANSI)_ANSI_INVOKE_W_$(UNIX_WARN))
C_STRICT = $($(ANSI)_STRICT_INVOKE_W_YES)
CC = $(C_$(CMPLR))
LD_LIBS_OLD = $($(STANDARD)_LD_LIBS)
LD_LIBS_ANSI = $($(ANSI)_LD_LIBS)
LD_LIBS_STRICT = $($(ANSI)_LD_LIBS)
CCOMPILER_LDLIBS = $(LD_LIBS_$(CMPLR))
LD_FLAGS_OLD = $($(STANDARD)_LD_FLAGS)
LD_FLAGS_ANSI = $($(ANSI)_LD_FLAGS)
LD_FLAGS_STRICT = $($(ANSI)_LD_FLAGS)
CCOMPILER_LDFLAGS = $(LD_FLAGS_$(CMPLR))
CCC_NORMAL_INVOKE_W_NO = $(CCC) +p
CCC_NORMAL_INVOKE_W_YES = $(CCC) +p +w
CCC_STRICT_INVOKE_W_YES = $(CCC) +p +w
CCC_LD_FLAGS = -L$(SPECIAL_LANG)
CCC_LD_LIBS =
G++_NORMAL_INVOKE_W_NO = $(G++) -ansi -pedantic -w
G++_NORMAL_INVOKE_W_YES = $(G++) -ansi -pedantic -Wall
G++_STRICT_INVOKE_W_YES = $(G++) -ansi -pedantic -Wtraditional -Wall \
-Wmissing-prototypes -Woverloaded-virtual \
-Wwrite-strings -Wconversion -Wstrict-prototypes\
-Wpointer-arith -Winline
CXX_NORMAL = $($(CPLUSPLUS)_NORMAL_INVOKE_W_$(UNIX_WARN))
CXX_STRICT = $($(CPLUSPLUS)_STRICT_INVOKE_W_YES)
# GNU make likes CXX instead of CCC
CXX = $(CXX_$(CXXCMPLR))
# Static Build options
ACC_SFLAGS_YES= -Bstatic
ACC_SFLAGS_NO=
@@ -67,21 +101,9 @@ UNIX_INCLUDES = -I. -I.. -I$(EPICS_BASE_INCLUDE)
OP_SYS_FLAGS = -DUNIX
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB)
UNIX_LDFLAGS = -L$(EPICS_BASE_LIB) $(CCOMPILER_LDFLAGS)
#
# The three nested if stmnts here document the fact that current
# organization here requires that we must use gcc for
# all compilation or not at all (no mixed compiler compilation)
#
UNIX_LDLIBS = -lm
#ifeq ($(ANSI), GCC)
#ifeq ($(STANDARD), GCC)
#ifeq ($(CPLUSPLUS), G++)
UNIX_LDLIBS += -liberty
#endif
#endif
#endif
UNIX_LDLIBS = -lm $(CCOMPILER_LDLIBS)
ARCH_DEP_CFLAGS = -DSUNOS4
ARCH_DEP_CCFLAGS = $(ARCH_DEP_CFLAGS)
@@ -103,7 +125,6 @@ CPPFLAGS += $(TARGET_CPPFLAGS) $(USR_CPPFLAGS)
# GNU make likes CXX instead of CCC
CXXFLAGS = $(CCFLAGS)
CXX =$($(CPLUSPLUS))
LDFLAGS = $(SPECIAL_LDFLAGS) $(TARGET_LDFLAGS) $(USR_LDFLAGS) $(ARCH_DEP_LDFLAGS) $(UNIX_LDFLAGS)
LDLIBS = $(TARGET_LDLIBS) $(USR_LDLIBS) $(ARCH_DEP_LDLIBS) $(UNIX_LDLIBS)
@@ -114,5 +135,5 @@ COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc = $(CXX) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) >> .DEPENDS
DEPENDS_RULE.c = -$(COMPILE.c) -M $(SRCS.c) > .DEPENDS
DEPENDS_RULE.cc = @echo no DEPENDS_RULE.cc defined in CONFIG.Unix.sun4

View File

@@ -2,51 +2,34 @@
# $Id$
#
# the order of following lists are important
# the order of following list is important
DIRS_Vx= \
src/libCom\
src/libvxWorks\
src/bpt\
src/util\
src/sequencer\
src/misc\
src/db\
src/ca\
src/rsrv\
src/dbStatic\
src/dbtools\
src/rec\
src/as\
src/drv/ansi\
src/drv/old\
src/dev\
src/devOpt\
src/iocCore
DIRS_Unix= \
src/tools \
src/include \
src/cxxTemplates \
src/db \
src/toolsComm/antelope \
src/toolsComm/flex \
src/libCom \
src/cvtDctsdr \
src/dbStatic \
src/bpt \
src/ca \
src/gdd \
src/cas/generic \
src/cas/build/singleThread \
src/cas/example \
src/as \
src/util \
src/sequencer \
src/dbtools \
config
DIRS = \
tools \
include \
cxxTemplates \
toolsComm\
libCom \
libvxWorks\
cvtDctsdr \
dbStatic \
db \
bpt \
ca \
gdd \
cas \
util \
misc \
sequencer \
dbtools \
rsrv\
rec\
as \
drv\
dev\
devOpt\
iocCore
DIRS = $(DIRS_$(BUILD_TYPE))
EPICS_BASE = $(TOP)
@@ -55,3 +38,12 @@ include $(TOP)/config/CONFIG
EPICS_BASE = $(INSTALL_LOCATION)
#
# this speeds up the build by turning off implicit rules search
#
.PHONY: $(TOP)/config/CONFIG
.PHONY: $(TOP)/config/CONFIG.* $(TOP)/config/CONFIG_*
.PHONY: $(TOP)/config/RULES.* $(TOP)/config/RULES_* .DEPENDS
.PHONY: $(HOME)/.EPICS_CONFIG
.PHONY: ../Makefile.Vx ../Makefile.Unix ../Makefile.Host Makefile

View File

@@ -36,6 +36,7 @@ EPICS_BASE_DBD = $(EPICS_BASE)/dbd
EPICS_EXTENSIONS_INCLUDE = $(EPICS_EXTENSIONS)/include
EPICS_EXTENSIONS_TEMPLATES = $(EPICS_EXTENSIONS)/templates
DIVIDER = .
# private versions of lex/yacc from EPICS
EYACC = $(EPICS_BASE)/bin/$(HOST_ARCH)/antelope

View File

@@ -34,7 +34,7 @@ endif
# mv162lc
# mv147
# hkv2f
# niCpu030
# niCpu030
#
CROSS_COMPILER_TARGET_ARCHS=mv167
@@ -95,3 +95,15 @@ UNIX_WARN=YES
# must be either YES or NO
VX_WARN=YES
# sch2edif compiler and flags
SCH2EDIF = sch2edif
SCH2EDIF_PATH =
SCH2EDIF_SYSFLAGS = -n -ap -p.+..+$(SCH2EDIF_PATH)+$(EPICS_EXTENSIONS)/templates/capfast/sym+
SCH2EDIF_FLAGS =
# e2db and flags
# - again there is an assumption where edb.def is installed.
E2DB = $(EPICS_EXTENSIONS)/bin/$(HOST_ARCH)/e2db
E2DB_SYSFLAGS = -ate -d $(EPICS_EXTENSIONS)/templates/capfast/edb.def
E2DB_FLAGS =

View File

@@ -11,3 +11,10 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT

View File

@@ -12,3 +12,10 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT

View File

@@ -12,3 +12,10 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT

View File

@@ -14,8 +14,14 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT
# Special C library requirements
SPECIAL_LANG = /usr/lang/SC2.0.1patch
SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)

View File

@@ -11,10 +11,16 @@
# OLD - Standard C - Not appropriate here.
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT
# Unbundled C compiler stuff
SPARCWORKS = /opt/SUNWspro
#SPECIAL_LANG = $(SPARCWORKS)/SC3.0/lib
#SPECIAL_LANG = .
#SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)
#SPECIAL_LANG = $(SPARCWORKS)/lib
SPECIAL_LANG = .

View File

@@ -12,12 +12,20 @@
CMPLR=ANSI
# Default SUN C++ compiler, individual Makefiles will override
# if they are coded to a higher standard.
# STRICT - ANSI C++ force strict warning flags
# NORMAL - ANSI C++ optional warning flags
CXXCMPLR=NORMAL
#CXXCMPLR=STRICT
#CMPLR=STRICT
#ANSI=GCC
#STANDARD=GCC
#CPLUSPLUS=G++
# Special C library requirements
SPECIAL_LANG = /usr/lang/SC2.0.1patch
SPECIAL_LDFLAGS = -L$(SPECIAL_LANG)
#SPECIAL_LANG = /usr/lang/SC3.0.1
#SPECIAL_LANG = /usr/lang/lib
SPECIAL_LANG = .

View File

@@ -10,36 +10,15 @@ CONFIGS += CONFIG_BASE
CONFIGS += CONFIG_COMMON
CONFIGS += CONFIG_ENV
CONFIGS += CONFIG.Linux
CONFIGS += CONFIG.alpha
CONFIGS += CONFIG.hp700
CONFIGS += CONFIG.sgi
CONFIGS += CONFIG.solaris
CONFIGS += CONFIG.sun4
CONFIGS += CONFIG.hkv2f
CONFIGS += CONFIG.mv147
CONFIGS += CONFIG.mv162
CONFIGS += CONFIG.mv162lc
CONFIGS += CONFIG.mv167
CONFIGS += CONFIG.niCpu030
CONFIGS += CONFIG.Vx.68k
CONFIGS += CONFIG_SITE
CONFIGS += CONFIG_SITE_ENV
CONFIGS += CONFIG_SITE.Linux
CONFIGS += CONFIG_SITE.alpha
CONFIGS += CONFIG_SITE.hp700
CONFIGS += CONFIG_SITE.sgi
CONFIGS += CONFIG_SITE.solaris
CONFIGS += CONFIG_SITE.sun4
CONFIGS += CONFIG_SITE.hkv2f
CONFIGS += CONFIG_SITE.mv147
CONFIGS += CONFIG_SITE.mv162lc
CONFIGS += CONFIG_SITE.mv162
CONFIGS += CONFIG_SITE.mv167
CONFIGS += CONFIG_SITE.niCpu030
CONFIGS += $(HOST_ARCH:%=CONFIG.%)
CONFIGS += $(CROSS_COMPILER_TARGET_ARCHS:%=CONFIG.%)
CONFIGS += $(HOST_ARCH:%=CONFIG_SITE.%)
CONFIGS += $(CROSS_COMPILER_TARGET_ARCHS:%=CONFIG_SITE.%)
CONFIGS += RULES.Unix
CONFIGS += RULES.Vx
@@ -49,5 +28,3 @@ CONFIGS += RULES_TOP
include $(TOP)/config/RULES.Unix

View File

@@ -19,19 +19,19 @@ INSTALL_TCLLIBS=$(TCLLIBNAME:%=$(INSTALL_TCLLIB)/%)
INSTALL_TCLINDEX=$(TCLINDEX:%=$(INSTALL_TCLLIB)/%)
INSTALL_CONFIGS=$(CONFIGS:%=$(INSTALL_CONFIG)/%)
all: install
all:: install
pre_build:
pre_build::
build: pre_build $(LIBNAME) $(TARGETS) $(PROD)
build:: pre_build $(LIBNAME) $(TARGETS) $(PROD)
install: build $(INSTALL_INC) $(INSTALL_LIBS) $(TARGETS) $(INSTALL_PROD) \
$(INSTALL_MANS) $(INSTALL_DOCS) $(INSTALL_SCRIPTS) $(INSTALL_TEMPLATE) \
inc:: $(INSTALL_INC)
install:: inc build $(INSTALL_LIBS) $(TARGETS) $(INSTALL_SCRIPTS) $(INSTALL_PROD) \
$(INSTALL_MANS) $(INSTALL_DOCS) $(INSTALL_TEMPLATE) \
$(INSTALL_TCLLIBS) $(INSTALL_TCLINDEX) $(INSTALL_CONFIGS)
depends: $(SRCS.c) $(SRCS.cc)
rm -f .DEPENDS
touch .DEPENDS
depends:: $(SRCS.c) $(SRCS.cc)
ifdef SRCS
echo you have a SRCS in your Makefile
exit 2
@@ -57,7 +57,7 @@ $(TARGETS) $(PROD): $(DEPLIBS)
$(RM) $@
$(LINK.c) -o $@ $< $(LDLIBS)
#$(PROD): $(OBJS) $(DEPLIBS)
#$(PROD): $(OBJS)
# $(RM) $@
# $(LINK.c) -o $@ ${OBJS} $(LDLIBS)
@@ -106,6 +106,38 @@ $(TARGETS) $(PROD): $(DEPLIBS)
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
%.c: %.stt
@echo "converting $<
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $<
# Capfast Rules:
%.db: %.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.db: ../%.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.edf: ../%.sch $(DEPSCHS)
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
# Mangen Rule:
%.1:%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
mv $(<F).nr $(<F).1
# Mangen Rule:
%.1:../%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
mv $(<F).nr $(<F).1
$(LIBNAME): $(LIBOBJS)
@echo Building library $@
$(RM) $@
@@ -136,6 +168,11 @@ $(INSTALL_LIB)/%.a: %.a
$(RANLIB) $(RANLIBFLAGS) $@; \
fi
$(INSTALL_CONFIG)/%: %
@echo "Installing $@"
@test -d $(INSTALL_CONFIG) || mkdir $(INSTALL_CONFIG)
@$(INSTALL) -m 644 $< $(INSTALL_CONFIG)
$(INSTALL_CONFIG)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_CONFIG) || mkdir $(INSTALL_CONFIG)
@@ -151,6 +188,20 @@ $(INSTALL_TCLLIB)/$(TCLINDEX): $(INSTALL_TCLLIBS)
@echo "Updating $@"
@echo eval auto_mkindex $(INSTALL_LIB) "$(TCLLIBNAME)" | tclsh
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: %
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
@@ -175,6 +226,11 @@ $(INSTALL_INCLUDE)/%: ../%
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
$(INSTALL_DOC)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@@ -185,16 +241,18 @@ $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: ../%
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -d -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
$(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)/%: %
@echo "Installing $@"
@test -d $(INSTALL_TEMPLATES) || mkdir $(INSTALL_TEMPLATES)
@test -d $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR) || \
mkdir $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
@$(INSTALL) -d -m 644 $< $(INSTALL_TEMPLATES)/$(TEMPLATES_DIR)
.PRECIOUS: %.o %.c
include .DEPENDS
.PHONY: all inc depends build install pre-build clean
-include .DEPENDS

View File

@@ -1,9 +1,10 @@
# $Id$
INC +=$(RECTYPES) $(MENUS)
INCREC +=$(RECTYPES) $(MENUS)
INSTALL_PROD=$(PROD:%=$(INSTALL_BIN)/%)
INSTALL_LIBS=$(LIBNAME:%=$(INSTALL_BIN)/%)
INSTALL_INC=$(INC:%=$(INSTALL_INCLUDE)/%)
INSTALL_INCREC=$(INCREC:%=$(INSTALL_INCLUDE)/%)
INSTALL_MANS+=$(MAN1:%=$(INSTALL_MAN)/man1/%)
INSTALL_MANS+=$(MAN2:%=$(INSTALL_MAN)/man2/%)
INSTALL_MANS+=$(MAN3:%=$(INSTALL_MAN)/man3/%)
@@ -22,24 +23,24 @@ INSTALL_DBS=$(DBDINSTALL:%=$(INSTALL_DBD)/%)\
$(RECTYPES:%.h=$(INSTALL_DBD)/%.dbd)\
$(MENUS:%.h=$(INSTALL_DBD)/%.dbd)
INSTALL_DBDEXPAND=$(DBDEXPAND:%=$(INSTALL_DBD)/%)
all: install
INSTALL_DBDNAME=$(DBDNAME:%=$(INSTALL_DBD)/%)
pre_build:
all:: install
build: pre_build $(MENUS) $(RECTYPES) $(BPTS)\
$(LIBNAME) $(TARGETS) $(PROD) $(DBDEXPAND)
pre_build::
install: build $(INSTALL_INC)\
build:: pre_build $(MENUS) $(RECTYPES) $(BPTS)\
$(LIBNAME) $(TARGETS) $(PROD)
inc:: $(INSTALL_INC)
install:: inc build $(INSTALL_INCREC)\
$(INSTALL_LIBS) $(TARGETS) $(INSTALL_PROD) $(INSTALL_MANS)\
$(INSTALL_DOCS) $(INSTALL_SCRIPTS)\
$(INSTALL_INSTALLS) $(INSTALL_DBS)\
$(INSTALL_MENUS) $(INSTALL_RECTYPES) $(INSTALL_BPTS)\
$(INSTALL_DBDEXPAND)
$(INSTALL_INSTALLS) $(INSTALL_DBS) $(INSTALL_BPTS)\
$(INSTALL_DBDNAME)
depends: $(SRCS.c) $(SRCS.cc)
rm -f .DEPENDS
touch .DEPENDS
depends:: $(SRCS.c) $(SRCS.cc)
ifdef SRCS
echo you have a SRCS in your Makefile
exit 2
@@ -104,7 +105,7 @@ clean::
$(RM) $@
/bin/mv lex.yy.c $@
#state notation language rule
#state notation language rules
%.c: ../%.st
@echo "preprocessing $*.st"
@$(RM) $*.i
@@ -113,6 +114,31 @@ clean::
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
%.c: %.stt
@echo "converting $<
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $<
# Capfast Rules:
%.db: %.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.db: ../%.edf
$(E2DB) $(E2SR_SYSFLAGS) $(E2SR_FLAGS) $<
%.edf: ../%.sch $(DEPSCHS)
@if [ ! -f cad.rc -a -r ../cad.rc ] ; then ln -s ../cad.rc ; fi
$(SCH2EDIF) $(SCH2EDIF_SYSFLAGS) $(SCH2EDIF_FLAGS) $<
# Mangen Rule:
%.1:%
$(RM) $(<F)
$(RM) $(<F).nr
ln -s $<
$(MANGEN) -s $(<F)
mv $(<F).nr $(<F).1
$(INSTALL_DBD)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
@@ -123,23 +149,37 @@ $(INSTALL_DBD)/%: ../%
@test -d $(INSTALL_DBD) || mkdir $(INSTALL_DBD)
@$(INSTALL) -m 644 $< $(INSTALL_DBD)
%Record.h: %Record.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \
$(USER_DBDFLAGS) $<
%Record.h: ../%Record.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToRecordtypeH \
$(USER_DBDFLAGS) $<
menu%.h: menu%.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToMenuH $<
menu%.h: ../menu%.dbd
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbToMenuH $<
bpt%.dbd: bpt%.data
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt $<
bpt%.dbd: ../bpt%.data
$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/makeBpt $<
%.dbd: ../%.dbd
$(RM) $@
$(DBDNAME): ../$(DBDEXPAND)
@echo expanding dbd
@$(RM) $@
$(EPICS_BASE)/bin/$(HOST_ARCH)/dbExpand\
$(USER_DBDFLAGS) $< > $(<F)
$(USER_DBDFLAGS) $< > $@
$(LIBNAME): $(LIBOBJS)
@echo Building library $@
@@ -164,6 +204,20 @@ $(INSTALL_BIN)/%: $(EPICS_BASE_BIN)/%
@test -d $(INSTALL_BIN) || mkdir $(INSTALL_BIN)
@$(INSTALL) -m 555 $< $(INSTALL_BIN)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
$(INSTALL_MAN)/man6/% \
$(INSTALL_MAN)/man5/% \
$(INSTALL_MAN)/man4/% \
$(INSTALL_MAN)/man3/% \
$(INSTALL_MAN)/man2/% \
$(INSTALL_MAN)/man1/%: %
@echo "Installing $@"
@test -d $(INSTALL_MAN) || mkdir $(INSTALL_MAN)
@test -d $(@D) || mkdir $(@D)
@$(INSTALL) -m 644 $< $(@D)
$(INSTALL_MAN)/man9/% \
$(INSTALL_MAN)/man8/% \
$(INSTALL_MAN)/man7/% \
@@ -188,6 +242,11 @@ $(INSTALL_INCLUDE)/%: ../%
@test -d $(INSTALL_INCLUDE) || mkdir $(INSTALL_INCLUDE)
@$(INSTALL) -m 644 $< $(INSTALL_INCLUDE)
$(INSTALL_DOC)/%: %
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@$(INSTALL) -m 644 $< $(INSTALL_DOC)
$(INSTALL_DOC)/%: ../%
@echo "Installing $@"
@test -d $(INSTALL_DOC) || mkdir $(INSTALL_DOC)
@@ -195,5 +254,7 @@ $(INSTALL_DOC)/%: ../%
.PRECIOUS: %.o %.c
include .DEPENDS
.PHONY: all inc depends build install pre-build clean
-include .DEPENDS

View File

@@ -2,74 +2,89 @@
# $Id$
#
# EPICS RULES_ARCH
# by Matthew Needes and Mike Bordua and Janet Anderson
# by Matthew Needes and Mike Bordua and Janet Andersoni and Jeff Hill
#
all:: install
dirs::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} dir "T_A=${ARCH}"; \
done)
ACTIONS += inc
ACTIONS += build
ACTIONS += install
ACTIONS += depends
depends::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
actionPart = $(word 1, $(subst $(DIVIDER), ,$@))
archPart = $(word 2, $(subst $(DIVIDER), ,$@))
build::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
#
# hostActionArchTargets
#
hostArchs = $(HOST_ARCH) $(filter-out $(HOST_ARCH),$(CROSS_COMPILER_HOST_ARCHS))
hostActionArchTargets = $(foreach x, $(ACTIONS),\
$(foreach arch,$(hostArchs), $(x)$(DIVIDER)$(arch)))
ifeq (Makefile.$(BUILD_TYPE), $(wildcard Makefile.$(BUILD_TYPE)))
hostDirs = $(addprefix O.,$(hostArchs))
$(hostActionArchTargets) : $(hostDirs)
$(MAKE) -C O.$(archPart) -f ../Makefile.$(BUILD_TYPE) T_A=$(archPart) $(actionPart)
$(hostArchs) : % : O.%
$(MAKE) -C O.$@ -f ../Makefile.$(BUILD_TYPE) T_A=$@
else
$(hostActionArchTargets) :
$(hostArchs) :
endif
install::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
#
# crossActionArchTargets
#
crossArchs = $(CROSS_COMPILER_TARGET_ARCHS)
crossActionArchTargets = $(foreach x, $(ACTIONS), \
$(foreach arch, $(CROSS_COMPILER_TARGET_ARCHS), $(x)$(DIVIDER)$(arch)))
ifeq (Makefile.Vx, $(wildcard Makefile.Vx))
crossDirs = $(addprefix O.,$(crossArchs))
$(crossActionArchTargets) : $(crossDirs)
$(MAKE) -C O.$(archPart) -f ../Makefile.Vx T_A=$(archPart) $(actionPart)
$(crossArchs) : % : O.%
$(MAKE) -C O.$@ -f ../Makefile.Vx T_A=$@
else
$(crossActionArchTargets) :
$(crossArchs) :
endif
clean::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} arch "T_A=$${ARCH}" ACTION=$@; \
done)
$(hostDirs) :
$(MKDIR) $@
echo "T_A=$(subst O.,,$@)" > $@/Makefile
echo "include ../Makefile.$(BUILD_TYPE)" >> $@/Makefile
$(crossDirs) :
$(MKDIR) $@
echo "T_A=$(subst O.,,$@)" > $@/Makefile
echo "include ../Makefile.Vx" >> $@/Makefile
#
# host/cross action targets
#
$(ACTIONS) clean : % : %$(DIVIDER)host %$(DIVIDER)cross
HostActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)host)
CrossActionTargets = $(foreach x, $(ACTIONS) clean, $(x)$(DIVIDER)cross)
$(HostActionTargets) : %$(DIVIDER)host : $(addprefix %$(DIVIDER), $(hostArchs))
$(CrossActionTargets) : %$(DIVIDER)cross : $(addprefix %$(DIVIDER), $(crossArchs))
dirs.%::
@${MAKE} dir T_A=$*
#
# arch targets
#
host : $(hostArchs)
cross : $(crossArchs)
depends.%::
@${MAKE} arch T_A=$* ACTION=depends
build.%::
@${MAKE} arch T_A=$* ACTION=build
install.%::
@${MAKE} arch T_A=$* ACTION=install
clean.%::
@${MAKE} arch T_A=$* ACTION=clean
${BUILD_ARCHS}::
@${MAKE} arch T_A=$@ ACTION=install
arch: dir
@if [ -f Makefile.${BUILD_TYPE} ] ; then \
echo "${T_A}: ${ACTION}"; \
cd O.${T_A}; ${MAKE} ${ACTION} ; \
fi
dir:
@if [ -f Makefile.${BUILD_TYPE} ] ; then \
test -f ./.cvsignore || \
echo "O.*" > ./.cvsignore; \
test -d O.${T_A} || \
( echo "Creating O.${T_A}"; mkdir O.${T_A};); \
test -f O.${T_A}/Makefile || \
( echo "T_A=${T_A}" > O.${T_A}/Makefile; \
echo "include ../Makefile.${BUILD_TYPE}" \
>> O.${T_A}/Makefile;); \
test -f O.${T_A}/.DEPENDS || \
touch O.${T_A}/.DEPENDS; \
fi
#
# special clean rule
#
clean$(DIVIDER)% :
$(RMDIR) O.$*
.PHONY : $(HostActionTargets)
.PHONY : $(CrossActionTargets)
.PHONY : $(crossActionArchTargets)
.PHONY : $(hostActionArchTargets)
.PHONY : $(hostArchs) $(crossArchs)
.PHONY : $(ACTIONS) clean all host cross

View File

@@ -1,70 +1,42 @@
#
# $Id$
#
# Top level rules For Subdirectory Recursions
#
all:: install
dirs::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
depends::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
build::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
ARCHS += $(BUILD_ARCHS) host cross
ACTIONS += clean inc install depends
dirPart = $(word 1, $(subst $(DIVIDER), ,$@))
actionArchPart = $(subst $(dirPart)$(DIVIDER), ,$@)
dirActionArchTargets = $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(foreach arch, $(ARCHS), \
$(dir)$(DIVIDER)$(action)$(DIVIDER)$(arch))))
dirArchTargets += $(foreach dir, $(DIRS), \
$(foreach arch, $(ARCHS),\
$(dir)$(DIVIDER)$(arch)))
dirActionTargets += $(foreach dir, $(DIRS), \
$(foreach action, $(ACTIONS),\
$(dir)$(DIVIDER)$(action)))
actionArchTargets = $(foreach action, $(ACTIONS),\
$(foreach arch, $(ARCHS), \
$(action)$(DIVIDER)$(arch)))
all:: inc install
dirs.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
rebuild:: clean uninstall all
$(DIRS) $(dirActionTargets) $(dirArchTargets)$(dirActionArchTargets) ::
$(MAKE) -C $(dirPart) $(actionArchPart)
depends.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
$(ARCHS) $(ACTIONS) $(actionArchTargets):%: $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%)
build.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
.PHONY : $(DIRS)
.PHONY : $(ARCHS) $(ACTIONS)
.PHONY : $(dirActionTargets) $(dirArchTargets)
.PHONY : $(dirActionArchTargets)
.PHONY : $(actionArchTargets)

View File

@@ -2,95 +2,49 @@
# $Id$
#
all:: install
include $(TOP)/config/RULES_DIRS
dirs::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
uninstall$(DIVIDER)%::
@$(RMDIR) $(INSTALL_LOCATION_BIN)/$* $(INSTALL_LOCATION_LIB)/$* \
$(INSTALL_LOCATION)/dbd $(INSTALL_MAN) $(INSTALL_INCLUDE)
@$(RMDIR) rec.bak rec
depends::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
build::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean::
@echo "TOP: Cleaning
@for DIR in ${DIRS}; do \
find $$DIR/src -type d -name "O.*" -prune -exec rm -rf {} \; ; \
done
uninstall::
@(for ARCH in ${BUILD_ARCHS}; do \
${MAKE} $@.$${ARCH}; \
done)
dirs.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
depends.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
build.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
install.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
clean.%::
@for DIR in ${DIRS}; do \
echo "$@: $$DIR"; \
if [ -d $$DIR ]; then TMP=`pwd`; cd $$DIR; ${MAKE} $@; cd $${TMP}; fi; \
done
uninstall.%::
@echo "TOP: Uninstalling $* "
@rm -rf ./bin/$* ./lib/$* dbd include man
@rm -rf rec.bak rec
DIRNAME=$(notdir $(shell pwd))
uninstall:: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))
tar:
@echo "TOP: Creating $(DIRNAME).Tar file..."
@ls Makefile* | xargs tar vcf ${DIRNAME}.Tar
@if [ -f .current_rel_hist ]; then \
ls .current_rel_hist | xargs tar vrf ${DIRNAME}.Tar ; \
fi
@if [ -f EPICS_BASE ]; then \
ls EPICS_BASE | xargs tar vrf ${DIRNAME}.Tar ; \
fi
@for DIR in ${DIRS}; do \
@DIRNAME=$(notdir $(shell pwd)); \
echo "TOP: Creating $$DIRNAME.Tar file..."; \
ls Makefile* | xargs tar vcf $$DIRNAME.Tar; \
if [ -f .current_rel_hist ]; then \
ls .current_rel_hist | xargs tar vrf $$DIRNAME.Tar ; \
fi ;\
if [ -f EPICS_BASE ]; then \
ls EPICS_BASE | xargs tar vrf $$DIRNAME.Tar ; \
fi ;\
for DIR in ${DIRS}; do \
find $${DIR} -name CVS -prune -o ! -type d -print \
| grep -v "/O\..*$$" | xargs tar vrf ${DIRNAME}.Tar; \
| grep -v "/O\..*$$" | xargs tar vrf $$DIRNAME.Tar; \
done
help:
@echo "Usage: gnumake [options] [target] ..."
@echo "Targets supported by all Makefiles:"
@echo " install - Installs executables in bin/<arch> (default rule)"
@echo " build - Builds objects, using libraries from "build_libs"
@echo " clean - Cleans objects. Clean removes the" O.<arch> dirs
@echo " in all except the O.<arch> level Makefile"
@echo " depends - Generates include dependencies"
@echo "\"Partial\" build targets supported by Makefiles:"
@echo " install.<arch> - Builds and installs <arch> only.
@echo " clean.<arch> - Cleans <arch> binaries in O.<arch> dirs only."
@echo " build.<arch> - Builds <arch> only.
@echo " depends.<arch> - Generates <arch> dependencies only.
@echo "Targets supported by top level Makefile:"
@echo " uninstall - Cleans directories created by the install."
@echo " tar - Create tar file "
@echo "Indiv. object targets are supported by O.<arch> level Makefile .e.g"
@echo " xxxRecord.o
.PHONY : uninstall tar help
.PHONY : $(addprefix uninstall$(DIVIDER), $(BUILDARCHS))

View File

@@ -1,42 +1,14 @@
# $Id$
# Author: Robert Zieman (ANL)
# Date: 6/03/91
#
# Experimental Physics and Industrial Control System (EPICS)
#
# Copyright 1991, the Regents of the University of California,
# and the University of Chicago Board of Governors.
#
# This software was produced under U.S. Government contracts:
# (W-7405-ENG-36) at the Los Alamos National Laboratory,
# and (W-31-109-ENG-38) at Argonne National Laboratory.
#
# Initial development by:
# The Controls and Automation Group (AT-8)
# Ground Test Accelerator
# Accelerator Technology Division
# Los Alamos National Laboratory
#
# Co-developed with
# The Controls and Computing Group
# Accelerator Systems Division
# Advanced Photon Source
# Argonne National Laboratory
#
# Modification Log:
# -----------------
# .01 mm-dd-yy iii Comment
# .02 08-16-93 rcz moving most of these pre-builds back to the
# object area Imakefile and adding DependTarget($(EARLYSRC))
#
# ...
# $Id$
#
all: bld_errSym
TOP = ..
include $(TOP)/config/CONFIG_BASE
bld_errSym:
cd libCom; ../../tools/blderrSymTbl
#
# Directories to build defined in CONFIG_BASE
#
include $(TOP)/config/RULES_DIRS
clean:
/bin/rm -f libCom/errInc.o

View File

@@ -3,9 +3,13 @@ include $(TOP)/config/CONFIG_BASE
INC += cvtTable.h
SRCS.c = ../makeBpt
OBJS = makeBpt
SRCS.c = ../makeBpt.c
OBJS = makeBpt.o
PROD = makeBpt
include $(TOP)/config/RULES.Unix
$(PROD): $(OBJS) $(DEPLIBS)
$(RM) $@
$(LINK.c) -o $@ ${OBJS} $(LDLIBS)

View File

@@ -1,13 +1,11 @@
TOP = ../../..
include $(TOP)/config/CONFIG_BASE
CMPLR = STRICT
USR_LDLIBS = -lca -lCom -lm
USR_LDLIBS = -lca -lCom
USR_LDFLAGS = -L.
DEPLIBS_BASE = $(INSTALL_LIB)
DEPLIBS = ./libca.a\
$(DEPLIBS_BASE)/libCom.a
DEPLIBS = ./libca.a $(DEPLIBS_BASE)/libCom.a
INC += cadef.h
INC += caerr.h
@@ -32,15 +30,7 @@ LIBNAME = libca.a
PROD = caRepeater
TARGETS = acctst catime
include $(TOP)/config/RULES.Unix
acctst: acctst.o $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a
$(LINK.c) -o $@ $< $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a \
$(ARCH_DEP_LDLIBS) -lm
catime: catime.o $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a
$(LINK.c) -o $@ $< $(LIBOBJS) $(DEPLIBS_BASE)/libCom.a \
$(ARCH_DEP_LDLIBS) -lm

View File

@@ -99,6 +99,9 @@
/************************************************************************/
/*
* $Log$
* Revision 1.84 1996/07/10 23:30:09 jhill
* fixed GNU warnings
*
* Revision 1.83 1996/07/09 22:43:29 jhill
* silence gcc warnings and default CLOCKS_PER_SEC if it isnt defined (for sunos4 and gcc)
*
@@ -1544,14 +1547,16 @@ void *usrarg
piiu = chix->piiu;
if(!CA_V41(CA_PROTOCOL_VERSION, piiu->minor_version_number)){
return ECA_NOSUPPORT;
if (piiu) {
if(!CA_V41(CA_PROTOCOL_VERSION, piiu->minor_version_number)){
return ECA_NOSUPPORT;
}
}
#ifdef vxWorks
if (!piiu) {
CACLIENTPUTNOTIFY *ppn;
int size;
unsigned size;
size = dbr_size_n(type,count);
LOCK;

View File

@@ -7,6 +7,9 @@ static char *sccsId = "@(#) $Id$";
/*
* $Log$
* Revision 1.35 1996/07/01 19:49:15 jhill
* turned on analog value wrap-around test
*
* Revision 1.34 1996/06/19 17:59:02 jhill
* many 3.13 beta changes
*
@@ -100,7 +103,7 @@ int acctst(char *pname)
NULL);
}
#else /* not vxWorks */
main(int argc, char **argv)
int main(int argc, char **argv)
{
if(argc == 2){
doacctst(argv[1]);
@@ -513,7 +516,7 @@ int doacctst(char *pname)
status = ca_clear_event(mid[i]);
if(status != ECA_NORMAL){
printf(
"Clear of event %d %x failed because \"%s\"\n",
"Clear of event %ld %x failed because \"%s\"\n",
i,
mid[i]->id,
ca_message(status));
@@ -582,7 +585,7 @@ int doacctst(char *pname)
if (pfloat)
for (i = 0; i < NUM; i++) {
for (j = 0; j < NUM; j++)
sprintf(&pstring[j][0], "%d", j + 100);
sprintf(&pstring[j][0], "%ld", j + 100l);
SEVCHK(ca_array_put(
DBR_STRING,
NUM,
@@ -752,8 +755,6 @@ unsigned iterations)
void null_event(struct event_handler_args args)
{
static int i;
dbr_double_t fval = 3.8;
int status;
unsigned *pInc = (unsigned *) args.usr;
if (pInc) {

View File

@@ -78,13 +78,32 @@ int cac_select_io(struct timeval *ptimeout, int flags)
continue;
}
if (piiu->sock_chan>=FD_SETSIZE) {
#ifdef WIN32
/* Under WIN32, FD_SETSIZE is the number of sockets,
* not the max. file descriptor value that you may select() !
*
* Of course it's not allowed to look into fd_count,
* but what shall we do? -kuk-
*/
if (pfdi->readMask.fd_count >= FD_SETSIZE)
{
ca_printf(
"%s.%d: file number > FD_SETSIZE=%d ignored\n",
__FILE__, __LINE__, FD_SETSIZE);
"%s.%d: no room for fd %d in fd_set (FD_SETSIZE=%d)\n",
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
continue;
}
#else
if (piiu->sock_chan>=FD_SETSIZE)
{
ca_printf(
"%s.%d: file number %d > FD_SETSIZE=%d ignored\n",
__FILE__, __LINE__, piiu->sock_chan, FD_SETSIZE);
continue;
}
#endif
/*
* Dont bother receiving if we have insufficient
* space for the maximum UDP message

View File

@@ -124,22 +124,22 @@ HDRVERSIONID(caerrh, "@(#) $Id$")
#define ECA_ADDFAIL DEFMSG(CA_K_WARNING, 21)
#define ECA_BADCOUNT DEFMSG(CA_K_WARNING, 22)
#define ECA_BADSTR DEFMSG(CA_K_ERROR, 23)
#define ECA_DISCONN DEFMSG(CA_K_INFO, 24)
#define ECA_DBLCHNL DEFMSG(CA_K_INFO, 25)
#define ECA_DISCONN DEFMSG(CA_K_WARNING, 24)
#define ECA_DBLCHNL DEFMSG(CA_K_WARNING, 25)
#define ECA_EVDISALLOW DEFMSG(CA_K_ERROR, 26)
#define ECA_BUILDGET DEFMSG(CA_K_WARNING, 27)
#define ECA_NEEDSFP DEFMSG(CA_K_INFO, 28)
#define ECA_NEEDSFP DEFMSG(CA_K_WARNING, 28)
#define ECA_OVEVFAIL DEFMSG(CA_K_WARNING, 29)
#define ECA_BADMONID DEFMSG(CA_K_ERROR, 30)
#define ECA_NEWADDR DEFMSG(CA_K_INFO, 31)
#define ECA_NEWADDR DEFMSG(CA_K_WARNING, 31)
#define ECA_NEWCONN DEFMSG(CA_K_INFO, 32)
#define ECA_NOCACTX DEFMSG(CA_K_WARNING, 33)
#define ECA_DEFUNCT DEFMSG(CA_K_FATAL, 34)
#define ECA_EMPTYSTR DEFMSG(CA_K_WARNING, 35)
#define ECA_NOREPEATER DEFMSG(CA_K_INFO, 36)
#define ECA_NOCHANMSG DEFMSG(CA_K_INFO, 37)
#define ECA_DLCKREST DEFMSG(CA_K_INFO, 38)
#define ECA_SERVBEHIND DEFMSG(CA_K_INFO, 39)
#define ECA_NOREPEATER DEFMSG(CA_K_WARNING, 36)
#define ECA_NOCHANMSG DEFMSG(CA_K_WARNNING, 37)
#define ECA_DLCKREST DEFMSG(CA_K_WARNING, 38)
#define ECA_SERVBEHIND DEFMSG(CA_K_WARNING, 39)
#define ECA_NOCAST DEFMSG(CA_K_WARNING, 40)
#define ECA_BADMASK DEFMSG(CA_K_ERROR, 41)
#define ECA_IODONE DEFMSG(CA_K_INFO, 42)
@@ -192,7 +192,7 @@ READONLY char *ca_message_text[]
"A monitor by that id cant be found",
"Remote channel has new network address",
"New or resumed network connection",
"Attempt to import from a task without a CA context failed",
"Specified task isnt a member of a CA context",
"Attempt to use defunct CA feature failed",
"The supplied string is empty",
"Unable to spawn the CA repeater thread- auto reconnect will fail",

File diff suppressed because it is too large Load Diff

View File

@@ -88,7 +88,7 @@ int local_addr(int s, struct sockaddr_in *plcladdr)
#endif
for ( pifreq = ifconf.ifc_req;
ifconf.ifc_len >= sizeof(*pifreq);
((size_t)ifconf.ifc_len) >= sizeof(*pifreq);
pifreq++, ifconf.ifc_len -= sizeof(*pifreq)) {
status = socket_ioctl(s, SIOCGIFFLAGS, pifreq);

View File

@@ -47,6 +47,9 @@
/* address in use so that test works on UNIX */
/* kernels that support multicast */
/* $Log$
* Revision 1.63 1996/07/09 22:41:28 jhill
* silence gcc warning
*
* Revision 1.62 1996/06/19 17:59:06 jhill
* many 3.13 beta changes
*
@@ -1662,7 +1665,7 @@ void caAddConfiguredAddr(ELLLIST *pList, ENV_PARAM *pEnv,
addr.in.sin_family = AF_INET;
addr.in.sin_port = htons(port);
addr.in.sin_addr.s_addr = inet_addr(pToken);
if(addr.in.sin_addr.s_addr == -1){
if (addr.in.sin_addr.s_addr == ~0ul) {
ca_printf(
"%s: Parsing '%s'\n",
__FILE__,

View File

@@ -32,6 +32,12 @@
/************************************************************************/
/* $Log$
* Revision 1.55 1996/08/05 19:21:26 jhill
* removed unused proto
*
* Revision 1.54 1996/06/20 21:43:15 jhill
* restored io_done_sem (removed by cleanup)
*
* Revision 1.53 1996/06/20 21:19:35 jhill
* fixed posix signal problem with "cc -Xc"
*
@@ -470,7 +476,6 @@ struct ca_static{
int ca_event_tid;
int ca_tid;
int recv_tid;
unsigned ca_local_ticks;
#endif
};
@@ -595,8 +600,6 @@ unsigned short port,
int net_proto
);
int ca_check_for_fp(void);
void caSetupBCastAddrList (ELLLIST *pList, SOCKET sock, unsigned port);
int ca_os_independent_init (void);

View File

@@ -219,11 +219,6 @@ static char *os_depenhSccsId = "$Id$";
#define LOCAL static
#endif
/* delay for when a poll is used */
/* NOTE: DELAYTICKS must be less than TICKSPERSEC */
#define DELAYTICKS 50L /* (adjust units below) */
#define TICKSPERSEC 1000L /* mili sec per sec */
/*
* BSD prototypes missing from SUNOS4, MULTINET and
* perhaps other environments
@@ -231,14 +226,6 @@ static char *os_depenhSccsId = "$Id$";
#include <epicsTypes.h>
#include <bsdProto.h>
/*
* order of ops is important here
*
* NOTE: large OS dependent SYFREQ might cause an overflow
*/
#define LOCALTICKS ((SYSFREQ*DELAYTICKS)/TICKSPERSEC)
#if defined(vxWorks)
# define VXTASKIDNONE 0
# define LOCK semTake(client_lock, WAIT_FOREVER);
@@ -256,8 +243,6 @@ static char *os_depenhSccsId = "$Id$";
# define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
# define MYERRNO (errnoGet()&0xffff)
# define POST_IO_EV semGive(io_done_sem)
# define SYSFREQ ((long) sysClkRateGet()) /* usually 60 Hz */
# define time(A) (tickGet()/SYSFREQ)
typedef int SOCKET;
# define INVALID_SOCKET (-1)
#endif
@@ -272,7 +257,6 @@ static char *os_depenhSccsId = "$Id$";
# define socket_ioctl(A,B,C) ioctl(A,B,C)
# define MYERRNO errno
# define POST_IO_EV
# define SYSFREQ 1000000L /* 1 MHz */
typedef int SOCKET;
# define INVALID_SOCKET (-1)
#endif
@@ -298,7 +282,6 @@ static char *os_depenhSccsId = "$Id$";
# endif
# endif
# define POST_IO_EV
# define SYSFREQ 10000000L /* 10 MHz */
# define LOCK
# define UNLOCK
# define LOCKEVENTS
@@ -326,7 +309,6 @@ static char *os_depenhSccsId = "$Id$";
# define socket_ioctl(A,B,C) ioctlsocket(A,B,C)
# define MYERRNO WSAGetLastError()
# define POST_IO_EV
# define SYSFREQ 1000000L /* 1 MHz */
#endif /*WIN32*/

View File

@@ -63,6 +63,9 @@
* datagram socket (and watching for ECONNREFUSED)
*
* $Log$
* Revision 1.36 1996/07/12 00:40:48 jhill
* fixed client disconnect problem under solaris
*
* Revision 1.32.6.1 1996/07/12 00:39:59 jhill
* fixed client disconnect problem under solaris
*
@@ -115,13 +118,13 @@ LOCAL void fanOut(struct sockaddr_in *pFrom, const char *pMsg, unsigned msgSize)
*/
void ca_repeater()
{
int status;
int size;
SOCKET sock;
struct sockaddr_in from;
struct sockaddr_in local;
int from_size = sizeof from;
unsigned short port;
int status;
int size;
SOCKET sock;
struct sockaddr_in from;
struct sockaddr_in local;
int from_size = sizeof from;
unsigned short port;
port = caFetchPortConfig(
&EPICS_CA_REPEATER_PORT,
@@ -186,7 +189,7 @@ void ca_repeater()
* both zero length message and a registration message
* will register a new client
*/
if(size >= sizeof(*pMsg)){
if( ((size_t)size) >= sizeof(*pMsg)){
if(ntohs(pMsg->m_cmmd) == REPEATER_REGISTER){
register_new_client(&local, &from);

View File

@@ -29,6 +29,12 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.23 1996/08/05 19:18:56 jhill
* better msg for lack of fp
*
* Revision 1.22 1996/06/19 17:59:31 jhill
* many 3.13 beta changes
*
* Revision 1.21 1995/10/18 16:44:36 jhill
* select time out must be greater than a vxWorks tick
*
@@ -51,6 +57,17 @@ LOCAL void ca_extra_event_labor(void *pArg);
LOCAL int cac_os_depen_exit_tid (struct ca_static *pcas, int tid);
LOCAL int cac_add_task_variable (struct ca_static *ca_temp);
LOCAL void deleteCallBack(CALLBACK *pcb);
LOCAL void ca_check_for_fp();
/*
* order of ops is important here
*
* NOTE: large OS dependent SYFREQ might cause an overflow
* NOTE: POLLDELAY must be less than TICKSPERSEC
*/
#define POLLDELAY 50 /* milli sec */
#define TICKSPERSEC 1000 /* milli sec per sec */
#define LOCALTICKS ((sysClkRateGet()*POLLDELAY)/TICKSPERSEC)
@@ -103,8 +120,8 @@ void cac_gettimeval(struct timeval *pt)
void cac_block_for_io_completion(struct timeval *pTV)
{
struct timeval itimeout;
unsigned long ticks;
unsigned long rate = sysClkRateGet();
int ticks;
int rate = sysClkRateGet();
#ifdef NOASYNCRECV
cac_mux_io(pTV);
@@ -117,7 +134,7 @@ void cac_block_for_io_completion(struct timeval *pTV)
itimeout.tv_sec = 0;
cac_mux_io(&itimeout);
ticks = pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC;
ticks = (int) (pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC);
ticks = min(LOCALTICKS, ticks);
semTake(io_done_sem, ticks);
@@ -171,8 +188,8 @@ void os_specific_sg_io_complete(CASG *pcasg)
void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
{
struct timeval itimeout;
unsigned long ticks;
unsigned long rate = sysClkRateGet();
int ticks;
int rate = sysClkRateGet();
#ifdef NOASYNCRECV
cac_mux_io(pTV);
@@ -185,7 +202,7 @@ void cac_block_for_sg_completion(CASG *pcasg, struct timeval *pTV)
itimeout.tv_sec = 0;
cac_mux_io(&itimeout);
ticks = pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC;
ticks = (int) (pTV->tv_sec*rate + (pTV->tv_usec*rate)/USEC_PER_SEC);
ticks = min(LOCALTICKS, ticks);
semTake (pcasg->sem, ticks);
@@ -209,10 +226,7 @@ LOCAL int cac_add_task_variable (struct ca_static *ca_temp)
TVIU *ptviu;
int status;
status = ca_check_for_fp();
if(status != ECA_NORMAL){
return status;
}
ca_check_for_fp();
# ifdef DEBUG
ca_printf("CAC: adding task variable\n");
@@ -342,7 +356,6 @@ int cac_os_depen_init(struct ca_static *pcas)
ellInit(&pcas->ca_putNotifyQue);
pcas->ca_tid = taskIdSelf();
pcas->ca_local_ticks = LOCALTICKS;
pcas->ca_client_lock = semMCreate(SEM_DELETE_SAFE);
assert(pcas->ca_client_lock);
pcas->ca_event_lock = semMCreate(SEM_DELETE_SAFE);
@@ -620,10 +633,7 @@ int ca_import(int tid)
struct ca_static *pcas;
TVIU *ptviu;
status = ca_check_for_fp();
if(status != ECA_NORMAL){
return status;
}
ca_check_for_fp();
/*
* just return success if they have already done
@@ -671,8 +681,26 @@ int ca_import(int tid)
*/
int ca_import_cancel(int tid)
{
int status;
TVIU *ptviu;
int status;
TVIU *ptviu;
struct ca_static *pcas;
if (tid == taskIdSelf()) {
pcas = NULL;
}
else {
pcas = ca_static;
}
/*
* Attempt to attach to the specified context
*/
ca_static = (struct ca_static *)
taskVarGet(tid, (int *)&ca_static);
if (ca_static == (struct ca_static *) ERROR){
ca_static = pcas;
return ECA_NOCACTX;
}
LOCK;
ptviu = (TVIU *) ellFirst(&ca_static->ca_taskVarList);
@@ -684,16 +712,20 @@ int ca_import_cancel(int tid)
}
if(!ptviu){
ca_static = pcas;
UNLOCK;
return ECA_NOCACTX;
}
ellDelete(&ca_static->ca_taskVarList, &ptviu->node);
free(ptviu);
UNLOCK;
status = taskVarDelete(tid, (void *)&ca_static);
assert (status == OK);
ca_static = pcas;
return ECA_NORMAL;
}
@@ -701,15 +733,14 @@ int ca_import_cancel(int tid)
/*
* ca_check_for_fp()
*/
int ca_check_for_fp()
LOCAL void ca_check_for_fp()
{
int options;
assert(taskOptionsGet(taskIdSelf(), &options) == OK);
if (!(options & VX_FP_TASK)) {
return ECA_NEEDSFP;
ca_signal(ECA_NEEDSFP, taskName(taskIdSelf()));
}
return ECA_NORMAL;
}

View File

@@ -32,8 +32,14 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.20 1995/12/19 19:36:20 jhill
* function prototype changes
*
* Revision 1.19 1995/11/29 19:15:42 jhill
* added $Log$ to the header
* added $Log$
* Revision 1.20 1995/12/19 19:36:20 jhill
* function prototype changes
* to the header
*
*/
@@ -466,7 +472,7 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
SetConsoleTitle("Channel Access Status");
freopen( "CONOUT$", "a", stderr );
}
fprintf(stderr, "Process attached to ca.dll R3.12.1\n");
fprintf(stderr, "Process attached to ca.dll\n");
#endif /* init. winsock */
if ((status = WSAStartup(MAKEWORD(1,1), &WsaData)) != 0) {
fprintf(stderr,"Cant init winsock \n");
@@ -497,13 +503,13 @@ BOOL epicsShareAPI DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
case DLL_THREAD_ATTACH:
#if _DEBUG
fprintf(stderr, "Thread attached to ca.dll R3.12.1\n");
fprintf(stderr, "Thread attached to ca.dll\n");
#endif
break;
case DLL_THREAD_DETACH:
#if _DEBUG
fprintf(stderr, "Thread detached from ca.dll R3.12.1\n");
fprintf(stderr, "Thread detached from ca.dll\n");
#endif
break;

View File

@@ -0,0 +1,8 @@
TOP=../../../..
include $(TOP)/config/CONFIG_BASE
include $(TOP)/config/RULES_ARCHS

View File

@@ -0,0 +1,91 @@
CAS = ../../..
TOP = $(CAS)/../..
SRC = $(CAS)/generic
CA = $(CAS)/../ca
IOSRC = $(CAS)/io/bsdSocket
OSSRC = $(CAS)/os/vxWorks
VPATH = $(SRC) $(IOSRC) $(OSSRC)
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA)\
-I$(TOP)/src/include/os/vxWorks
DEPLIBS_BASE = $(EPICS_BASE_LIB)
SRCS.cc += $(SRC)/caServer.cc
SRCS.cc += $(SRC)/caServerI.cc
SRCS.cc += $(SRC)/casCoreClient.cc
SRCS.cc += $(SRC)/casClient.cc
SRCS.cc += $(SRC)/casDGClient.cc
SRCS.cc += $(SRC)/casStrmClient.cc
SRCS.cc += $(SRC)/casPV.cc
SRCS.cc += $(SRC)/casPVI.cc
SRCS.cc += $(SRC)/casChannel.cc
SRCS.cc += $(SRC)/casChannelI.cc
SRCS.cc += $(SRC)/casClientMon.cc
SRCS.cc += $(SRC)/casChanDelEv.cc
SRCS.cc += $(SRC)/casMsgIO.cc
SRCS.cc += $(SRC)/casAsyncIO.cc
SRCS.cc += $(SRC)/casAsyncIOI.cc
SRCS.cc += $(SRC)/casEventSys.cc
SRCS.cc += $(SRC)/casMonitor.cc
SRCS.cc += $(SRC)/casMonEvent.cc
SRCS.cc += $(SRC)/outBuf.cc
SRCS.cc += $(SRC)/inBuf.cc
SRCS.cc += $(SRC)/casEventMask.cc
SRCS.cc += $(OSSRC)/caServerOS.cc
SRCS.cc += $(OSSRC)/casDGOS.cc
SRCS.cc += $(OSSRC)/casStreamOS.cc
SRCS.cc += $(IOSRC)/caServerIO.cc
SRCS.cc += $(IOSRC)/casDGIO.cc
SRCS.cc += $(IOSRC)/casStreamIO.cc
SRCS.c += $(IOSRC)/sigPipeIgnore.c
LIBOBJS += caServer.o
LIBOBJS += caServerI.o
LIBOBJS += casCoreClient.o
LIBOBJS += casClient.o
LIBOBJS += casDGClient.o
LIBOBJS += casStrmClient.o
LIBOBJS += casPV.o
LIBOBJS += casPVI.o
LIBOBJS += casChannel.o
LIBOBJS += casChannelI.o
LIBOBJS += casClientMon.o
LIBOBJS += casChanDelEv.o
LIBOBJS += casMsgIO.o
LIBOBJS += casAsyncIO.o
LIBOBJS += casAsyncIOI.o
LIBOBJS += casEventSys.o
LIBOBJS += casMonitor.o
LIBOBJS += casMonEvent.o
LIBOBJS += outBuf.o
LIBOBJS += inBuf.o
LIBOBJS += casEventMask.o
LIBOBJS += caServerOS.o
LIBOBJS += casDGOS.o
LIBOBJS += casStreamOS.o
LIBOBJS += caServerIO.o
LIBOBJS += casDGIO.o
LIBOBJS += casStreamIO.o
LIBOBJS += sigPipeIgnore.o
LIBNAME = libcas.o
include $(TOP)/config/RULES.Vx
obj: $(LIBOBJS)
test.o:
clean::
@$(RM) -rf Templates.DB

View File

@@ -9,7 +9,10 @@ VPATH = $(SRC) $(IOSRC) $(OSSRC)
include $(TOP)/config/CONFIG_BASE
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA)
CXXCMPLR = STRICT
USR_INCLUDES = -I$(SRC) -I$(OSSRC) -I$(IOSRC) -I$(CA) \
-I$(TOP)/src/include/os/$(T_A)
DEPLIBS_BASE = $(EPICS_BASE_LIB)

View File

@@ -4,6 +4,8 @@ TOP = $(CAS)/../..
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES =
USR_LDLIBS = -lcas -lca -lCom -lgdd
@@ -14,12 +16,14 @@ DEPLIBSWOCAS = $(DEPLIBS_BASE)/libca.a $(DEPLIBS_BASE)/libCom.a \
$(DEPLIBS_BASE)/libgdd.a
DEPLIBS = $(DEPLIBS_BASE)/libcas.a $(DEPLIBSWOCAS)
SRCS.cc += ../main.cc
SRCS.cc += ../exServer.cc
SRCS.cc += ../exPV.cc
SRCS.cc += ../exSyncPV.cc
SRCS.cc += ../exAsyncPV.cc
SRCS.cc += ../exChannel.cc
OBJS += main.o
OBJS += exServer.o
OBJS += exPV.o
OBJS += exSyncPV.o
@@ -67,16 +71,21 @@ excas: $(OBJS) $(DEPLIBS)
$(LINK.cc) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
#
# fast link (without library build)
# fast link (without waiting for library build)
#
#PURIFY = /remote/lear_local/pure/purify-3.0a-sunos4/purify
nolib: $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(PURIFY) $(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
#
# build with purify
#
purify: $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
$(PURIFY) -best-effort $(LINK.cc) -o $@ $(OBJS) $(GLOMBOBJ) $(DEPLIBSWOCAS)
clean::
@$(RM) excas
@$(RM) nolib
@$(RM) purify
@$(RM) -rf Templates.DB
@$(RM) core

View File

@@ -64,7 +64,7 @@ void exPV::scanPV()
//
this->currentTime = osiTime::getCurrent();
pDD = new gddScaler (gddAppType_value, aitEnumFloat32);
pDD = new gddScalar (gddAppType_value, aitEnumFloat32);
if (!pDD) {
return;
}
@@ -140,7 +140,7 @@ caStatus exPV::update(gdd &valueIn)
this->info.getName().string, valueIn);
# endif
if (valueIn.isScaler()) {
if (valueIn.isScalar()) {
pNewValue = &valueIn;
pNewValue->reference();
}
@@ -149,7 +149,7 @@ caStatus exPV::update(gdd &valueIn)
// this does not modify the current value
// (because it may be referenced in the event queue)
//
pNewValue = new gddScaler (gddAppType_value, aitEnumFloat32);
pNewValue = new gddScalar (gddAppType_value, aitEnumFloat32);
if (!pNewValue) {
return S_casApp_noMemory;
}
@@ -255,10 +255,10 @@ void exPV::show(unsigned level)
caStatus exPV::getStatus(gdd &value)
{
if (this->pValue) {
value.putConvert(this->pValue->getStat());
value.put(this->pValue->getStat());
}
else {
value.putConvert(epicsAlarmUDF);
value.put((aitUint16)epicsAlarmUDF);
}
return S_cas_success;
}
@@ -269,10 +269,10 @@ caStatus exPV::getStatus(gdd &value)
caStatus exPV::getSeverity(gdd &value)
{
if (this->pValue) {
value.putConvert(this->pValue->getSevr());
value.put(this->pValue->getSevr());
}
else {
value.putConvert(epicsSevInvalid);
value.put((aitUint16)epicsSevInvalid);
}
return S_cas_success;
}
@@ -299,7 +299,7 @@ inline aitTimeStamp exPV::getTS()
caStatus exPV::getSeconds(gdd &value)
{
aitUint32 sec (this->getTS().tv_sec);
value.putConvert (sec);
value.put(sec);
return S_cas_success;
}
@@ -309,7 +309,7 @@ caStatus exPV::getSeconds(gdd &value)
caStatus exPV::getNanoseconds(gdd &value)
{
aitUint32 nsec (this->getTS().tv_nsec);
value.putConvert (nsec);
value.put(nsec);
return S_cas_success;
}
@@ -318,7 +318,7 @@ caStatus exPV::getNanoseconds(gdd &value)
//
caStatus exPV::getPrecision(gdd &prec)
{
prec.putConvert(4u);
prec.put(4u);
return S_cas_success;
}
@@ -327,7 +327,7 @@ caStatus exPV::getPrecision(gdd &prec)
//
caStatus exPV::getHighLimit(gdd &value)
{
value.putConvert(info.getHopr());
value.put(info.getHopr());
return S_cas_success;
}
@@ -336,7 +336,7 @@ caStatus exPV::getHighLimit(gdd &value)
//
caStatus exPV::getLowLimit(gdd &value)
{
value.putConvert(info.getLopr());
value.put(info.getLopr());
return S_cas_success;
}
@@ -350,6 +350,14 @@ caStatus exPV::getUnits(gdd &units)
return S_cas_success;
}
//
// exPV::getEnums()
//
caStatus exPV::getEnums(gdd &)
{
return S_cas_noConvert;
}
//
// exPV::getValue()
//

View File

@@ -7,9 +7,7 @@
// Example EPICS CA server
//
#include <exServer.h>
#include <fdMgr.h>
const pvInfo exServer::pvList[] = {
pvInfo (1.0e-1, "jane", 10.0f, 0.0f, excasIoSync),
@@ -18,68 +16,11 @@ const pvInfo exServer::pvList[] = {
pvInfo (2.0, "freddy", 10.0f, -10.0f, excasIoAsync)
};
//
// static data for exServer
//
gddAppFuncTable<exPV> exServer::ft;
//
// main()
//
int main (int argc, const char **argv)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
unsigned debugLevel = 0u;
float executionTime;
aitBool forever = aitTrue;
int i;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
for (i=1; i<argc; i++) {
if (sscanf(argv[i], "-d %u", &debugLevel)==1) {
continue;
}
if (sscanf(argv[i],"-t %f", &executionTime)==1) {
forever = aitFalse;
continue;
}
printf ("usage: %s -d<debug level> -t<execution time>\n",
argv[0]);
return (1);
}
pCAS->setDebugLevel(debugLevel);
if (forever) {
osiTime delay(1000u,0u);
//
// loop here forever
//
while (aitTrue) {
fileDescriptorManager.process(delay);
}
}
else {
osiTime total(executionTime);
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untime the specified execution time
// expires
//
while (delay < total) {
fileDescriptorManager.process(delay);
delay = osiTime::getCurrent() - begin;
}
}
return (0);
}
//
// exServer::exServer()
//
@@ -102,6 +43,7 @@ exServer::exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate,
ft.installReadFunc("alarmLowWarning",exPV::getLowLimit);
ft.installReadFunc("units",exPV::getUnits);
ft.installReadFunc("value",exPV::getValue);
ft.installReadFunc("enums",exPV::getEnums);
}
//

View File

@@ -62,6 +62,17 @@ public:
{
}
//
// for use when MSVC++ will not build a defualt copy constructor
// for this class
//
pvInfo (const pvInfo &copyIn) :
scanRate(copyIn.scanRate), name(copyIn.name),
hopr(copyIn.hopr), lopr(copyIn.lopr),
ioType(copyIn.ioType)
{
}
const double getScanRate () const { return this->scanRate; }
const aitString &getName () const { return this->name; }
const double getHopr () const { return this->hopr; }
@@ -77,29 +88,6 @@ private:
class exPV;
//
// exServer
//
class exServer : public caServer {
public:
exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate=0x3ff,
unsigned maxSimultaneousIO=1u);
void show (unsigned level);
caStatus pvExistTest (const casCtx &ctxIn, const char *pPVName,
gdd &canonicalPVName);
casPV *createPV (const casCtx &ctxIn, const char *pPVName);
static const pvInfo *findPV(const char *pName);
static gddAppFuncTableStatus read(exPV &pv, gdd &value)
{
return exServer::ft.read(pv, value);
}
private:
static const pvInfo pvList[];
static gddAppFuncTable<exPV> ft;
};
//
// exScanTimer
@@ -172,6 +160,7 @@ public:
gddAppFuncTableStatus getLowLimit(gdd &value);
gddAppFuncTableStatus getUnits(gdd &value);
gddAppFuncTableStatus getValue(gdd &value);
gddAppFuncTableStatus getEnums(gdd &value);
//
//
@@ -191,6 +180,29 @@ private:
static osiTime currentTime;
};
//
// exServer
//
class exServer : public caServer {
public:
exServer(unsigned pvMaxNameLength, unsigned pvCountEstimate=0x3ff,
unsigned maxSimultaneousIO=1u);
void show (unsigned level);
caStatus pvExistTest (const casCtx &ctxIn, const char *pPVName,
gdd &canonicalPVName);
casPV *createPV (const casCtx &ctxIn, const char *pPVName);
static const pvInfo *findPV(const char *pName);
static gddAppFuncTableStatus read(exPV &pv, gdd &value)
{
return exServer::ft.read(pv, value);
}
private:
static const pvInfo pvList[];
static gddAppFuncTable<exPV> ft;
};
//
// exSyncPV
//

61
src/cas/example/main.cc Normal file
View File

@@ -0,0 +1,61 @@
#include <exServer.h>
#include <fdManager.h>
//
// main()
//
int main (int argc, const char **argv)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
unsigned debugLevel = 0u;
float executionTime;
aitBool forever = aitTrue;
int i;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
for (i=1; i<argc; i++) {
if (sscanf(argv[i], "-d %u", &debugLevel)==1) {
continue;
}
if (sscanf(argv[i],"-t %f", &executionTime)==1) {
forever = aitFalse;
continue;
}
printf ("usage: %s -d<debug level> -t<execution time>\n",
argv[0]);
return (1);
}
pCAS->setDebugLevel(debugLevel);
if (forever) {
osiTime delay(1000u,0u);
//
// loop here forever
//
while (aitTrue) {
fileDescriptorManager.process(delay);
}
}
else {
osiTime total(executionTime);
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untime the specified execution time
// expires
//
while (delay < total) {
fileDescriptorManager.process(delay);
delay = osiTime::getCurrent() - begin;
}
}
delete pCAS;
return (0);
}

View File

@@ -0,0 +1,43 @@
#include <exServer.h>
#include <taskLib.h>
//
// main()
//
int excas (unsigned debugLevel=0u, unsigned delaySec=0)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
pCAS->setDebugLevel(debugLevel);
if (delaySec==0u) {
//
// loop here forever
//
while (aitTrue) {
taskDelay(10);
}
}
else {
osiTime total( ((float)delaySec) );
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untill the specified execution time
// expires
//
while (delay < total) {
taskDelay(10);
delay = osiTime::getCurrent() - begin;
}
}
delete pCAS;
return (0);
}

View File

@@ -1,6 +1,6 @@
this directory contains the generic source for
the EPICS ca server
this directory contains the generic (os and io independent) source for
the EPICS ca server library

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -48,14 +51,6 @@
#define TRUE 1
#endif
#ifndef OK
#define OK 0
#endif
#ifndef ERROR
#define ERROR (-1)
#endif
#ifndef NELEMENTS
#define NELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
#endif

View File

@@ -29,6 +29,15 @@
*
* History
* $Log$
* Revision 1.3 1996/08/13 22:56:12 jhill
* added init for mutex class
*
* Revision 1.2 1996/08/05 19:25:17 jhill
* removed unused code
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -135,6 +144,10 @@ caStatus caServerI::init()
int status;
int resLibStatus;
if (this->osiMutex::init()) {
return S_cas_noMemory;
}
status = caServerIO::init();
if (status) {
return status;
@@ -253,75 +266,6 @@ void caServerI::connectCB()
}
}
#if 0
//
// caServerI::elapsedTimeCompare()
//
int caServerI::elapsedTimeCompare(
const caTime &stamp1, const caTime &stamp2)
{
if (stamp1.sec == stamp2.sec) {
if (stamp1.nsec == stamp2.nsec) {
return 0;
}
else if (stamp1.nsec > stamp2.nsec) {
return 1;
}
return -1;
}
else if (stamp1.sec > stamp2.sec) {
return 1;
}
return -1;
}
#endif
#if 0
//
// caServerI::getElapsedTime()
//
caTime caServerI::getElapsedTime (const caTime &stamp)
{
caTime elapsed;
caTime current;
caTime local = stamp;
//
// OS dependent function - see casOSDInLine.h
//
current = caServerI::getTime();
//
// this indicates wrap around
//
if (local.sec>current.sec) {
unsigned long tmp;
tmp = ULONG_MAX - local.sec;
assert (tmp < ULONG_MAX - current.sec);
current.sec += tmp;
local.sec = 0;
}
//
// borrow
//
if (local.nsec > current.nsec) {
assert (current.sec>0);
assert (current.sec>=local.sec);
current.sec--;
assert (2*CAServerNSecInSec < ULONG_MAX);
current.nsec += CAServerNSecInSec;
}
elapsed.sec = current.sec - local.sec;
elapsed.nsec = current.nsec - local.nsec;
return elapsed;
}
#endif
//
// caServerI::advanceBeaconPeriod()
@@ -359,10 +303,10 @@ void casVerifyFunc(const char *pFile, unsigned line, const char *pExp)
//
// serverToolDebugFunc()
//
void serverToolDebugFunc(const char *pFile, unsigned line)
void serverToolDebugFunc(const char *pFile, unsigned line, const char *pComment)
{
fprintf(stderr,
"Bad server tool response detected at line %u in \"%s\"\n",
line, pFile);
"Bad server tool response detected at line %u in \"%s\" because \"%s\"\n",
line, pFile, pComment);
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.2 1996/06/26 21:18:50 jhill
* now matches gdd api revisions
*
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
@@ -45,7 +48,9 @@
// casAsyncIOI::casAsyncIOI()
//
casAsyncIOI::casAsyncIOI(const casCtx &ctx, casAsyncIO &ioIn, gdd *pDD) :
msg(*ctx.getMsg()), client(*ctx.getClient()),
msg(*ctx.getMsg()),
client(*ctx.getClient()),
asyncIO(ioIn),
pChan(ctx.getChannel()),
pDesc(pDD),
completionStatus(S_cas_internal),
@@ -56,10 +61,7 @@ casAsyncIOI::casAsyncIOI(const casCtx &ctx, casAsyncIO &ioIn, gdd *pDD) :
{
assert (&this->client);
assert (&this->msg);
//
// casAsyncIOI must be a base of casAsyncIO
//
assert (this == (casAsyncIOI *)&ioIn);
assert (&this->asyncIO);
if (this->pChan) {
this->pChan->installAsyncIO(*this);

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -52,5 +55,13 @@ inline void casAsyncIOI::unlock()
client.unlock();
}
//
// casAsyncIO * casAsyncIOI::operator -> ()
//
inline casAsyncIO * casAsyncIOI::operator -> ()
{
return &this->asyncIO;
}
#endif // casAsyncIOIIL_h

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.3 1996/08/13 22:52:31 jhill
* changes for MVC++
*
* Revision 1.2 1996/07/01 19:56:09 jhill
* one last update prior to first release
*
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
@@ -57,10 +63,10 @@ casChannel::~casChannel()
casPV *casChannel::getPV()
{
casPVI &pvi(this->casChannelI::getPVI());
casPVI *pPVI = &this->casChannelI::getPVI();
if (&pvi!=NULL) {
return pvi.intefaceObjectPointer();
if (pPVI!=NULL) {
return pPVI->interfaceObjectPointer();
}
else {
return NULL;

View File

@@ -29,11 +29,15 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
*
*/
#include <server.h>
#include <casEventSysIL.h> // casEventSys inline func
#include <casAsyncIOIIL.h> // casAsyncIOI inline func
#include <casPVIIL.h> // casPVI inline func
@@ -43,14 +47,12 @@
casChannelI::casChannelI(const casCtx &ctx, casChannel &chanAdapter) :
client(* (casStrmClient *) ctx.getClient()),
pv(*ctx.getPV()),
chan(chanAdapter),
cid(ctx.getMsg()->m_cid)
{
assert(&this->client);
assert(&this->pv);
//
// enforce that casChannelI is always a base of casChannel
//
assert(&chanAdapter == (casChannel *) this);
assert(&this->chan);
this->client.installChannel(*this);
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.2 1996/07/01 19:56:10 jhill
* one last update prior to first release
*
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
@@ -39,6 +42,14 @@
#ifndef casChannelIIL_h
#define casChannelIIL_h
//
// casChannelI::operator -> ()
//
inline casChannel * casChannelI::operator -> ()
{
return &this->chan;
}
//
// casChannelI::lock()
//
@@ -162,5 +173,6 @@ inline const caResId casChannelI::getSID()
return this->uintId::getId();
}
#endif // casChannelIIL_h

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.3 1996/08/13 22:56:13 jhill
* added init for mutex class
*
* Revision 1.2 1996/07/09 22:54:31 jhill
* store msg copy in the ctx
*
* Revision 1.1.1.1 1996/06/20 00:28:14 jhill
* ca server installation
*
@@ -38,6 +44,7 @@
#include <server.h>
#include <casClientIL.h> // inline func for casClient
#include <db_access.h>
VERSIONID(camsgtaskc,"%W% %G%")
@@ -87,6 +94,10 @@ caStatus casClient::init()
if (status) {
return status;
}
status = this->casCoreClient::init();
if (status) {
return status;
}
serverDebugLevel = this->ctx.getServer()->getDebugLevel();
if (serverDebugLevel>0u) {

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -219,7 +222,7 @@ caStatus casCoreClient::asyncIOCompletion(casChannelI *pChan,
pAsyncIoCallBack pCB;
pCB = casCoreClient::asyncIOJumpTable[msg.m_cmmd];
if (!pCB) {
if (pCB==NULL) {
return S_casApp_noSupport;
}

View File

@@ -29,6 +29,15 @@
*
* History
* $Log$
* Revision 1.4 1996/08/13 22:54:20 jhill
* fixed little endian problem
*
* Revision 1.3 1996/08/05 19:26:15 jhill
* made os specific code smaller
*
* Revision 1.2 1996/06/26 21:18:52 jhill
* now matches gdd api revisions
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
@@ -89,8 +98,7 @@ caStatus casDGClient::searchAction()
// longest PV name then just ignore this request
// (and let the client to try again later)
//
// set correct appl type here !!!!
pCanonicalName = new gddAtomic(0u, aitEnumString, 1u);
pCanonicalName = new gddScalar(gddAppType_name, aitEnumString);
if (!pCanonicalName) {
return S_cas_success;
}
@@ -290,3 +298,56 @@ void casDGClient::ioBlockedSignal()
//
}
//
// casDGClient::process()
//
void casDGClient::process()
{
caStatus status;
casFlushCondition flushCond;
casFillCondition fillCond;
//
// force all replies to be sent to the client
// that made the request
//
this->clear();
//
// read in new input
//
fillCond = this->fill();
if (fillCond == casFillDisconnect) {
casVerify(0);
return;
}
//
// verify that we have a message to process
//
if (this->inBuf::bytesPresent()>0u) {
//
// process the message
//
status = this->processMsg();
if (status) {
errMessage (status,
"unexpected error processing stateless protocol");
//
// clear the input buffer so this will
// not effect future input
//
this->clear();
}
else {
//
// force all replies to go to the sender
//
flushCond = this->flush();
if (flushCond!=casFlushCompleted) {
this->clear();
casVerify(0);
}
}
}
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:16 jhill
* ca server installation
*
*
*/
@@ -91,7 +94,7 @@ inline casEventMask casEventRegistry::maskAllocator()
{
casEventMask evMask;
if (this->allocator>=CHAR_BIT*sizeof(casEventMask::mask)) {
if (this->allocator>=CHAR_BIT*sizeof(evMask.mask)) {
return evMask;
}
evMask.mask = 1u<<(this->allocator++);

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -140,7 +143,7 @@ casProcCond casEventSys::process()
* not accepted so return to the head of the list
* (we will try again later)
*/
this->insertEventQueue(*pEvent);
this->pushOnToEventQueue(*pEvent);
cond = casProcOk;
break;
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.5 1996/07/01 19:56:11 jhill
* one last update prior to first release
*
* Revision 1.4 1996/06/26 23:32:17 jhill
* changed where caProto.h comes from (again)
*
@@ -125,7 +128,7 @@ inline ioBlockedList::~ioBlockedList ()
// ioBlockedList::signal ()
//
// works from a temporary list to avoid problems
// where the virtual function adds ites to the
// where the virtual function adds items to the
// list
//
inline void ioBlockedList::signal ()
@@ -353,14 +356,7 @@ public:
caServer *getCAS();
//
// casAsyncIOI must always be a base for casAsyncIO
// (the constructor assert fails if this isnt the case)
//
casAsyncIO * operator -> ()
{
return (casAsyncIO *) this;
}
inline casAsyncIO * operator -> ();
void setServerDelete()
{
@@ -393,6 +389,7 @@ private:
caHdr const msg;
casCoreClient &client;
casAsyncIO &asyncIO;
casChannelI *pChan; // optional
gdd *pDesc; // optional
caStatus completionStatus;
@@ -461,24 +458,19 @@ public:
return casChanT;
}
//
// casChannelI must always be a base for casPV
// (the constructor assert fails if this isnt the case)
//
casChannel * operator -> ()
{
return (casChannel *) this;
}
inline void lock();
inline void unlock();
inline void clientDestroy();
inline casChannel * operator -> ();
protected:
tsDLList<casMonitor> monitorList;
tsDLList<casAsyncIOI> ioInProgList;
casCoreClient &client;
casPVI &pv;
casChannel &chan;
caResId const cid; // client id
unsigned clientDestroyPending:1;
};
@@ -493,7 +485,6 @@ public:
inline ~casPVListChan();
};
class caServer;
class caServerI;
class casCtx;
class casChannel;
@@ -509,7 +500,7 @@ public:
// The PV name here must be the canonical and unique name
// for the PV in this system
//
casPVI (caServerI &cas, const char * const pName, casPV &pvAdapter);
casPVI (caServerI &cas, const char * const pNameIn, casPV &pvAdapter);
~casPVI();
//
@@ -556,23 +547,12 @@ public:
inline void postEvent (const casEventMask &select, gdd &event);
casPV *intefaceObjectPointer() const
{
return (casPV *) this;
}
inline casPV *interfaceObjectPointer() const;
//
// casPVI must always be a base for casPV
// (the constructor assert fails if this isnt the case)
//
casPV * operator -> () const
{
return intefaceObjectPointer();
}
inline casPV * operator -> () const;
caServer *getExtServer();
//
// bestDBRType()
//
@@ -585,6 +565,7 @@ public:
private:
tsDLList<casPVListChan> chanList;
caServerI &cas;
casPV &pv;
unsigned nMonAttached;
unsigned nIOAttached;
};

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.3 1996/07/01 19:56:11 jhill
* one last update prior to first release
*
* Revision 1.2 1996/06/26 21:18:56 jhill
* now matches gdd api revisions
*
@@ -177,7 +180,7 @@ void casMonitor::push(gdd &newValue)
pLog->assign(*this, pValue);
gddStatus = pValue->unreference();
assert(!gddStatus);
client.insertEventQueue(*pLog, &this->overFlowEvent);
client.insertEventQueue(*pLog, this->overFlowEvent);
}
else {
//

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.3 1996/07/01 19:56:13 jhill
* one last update prior to first release
*
* Revision 1.2 1996/06/26 21:18:57 jhill
* now matches gdd api revisions
*
@@ -49,16 +52,14 @@
//
casPVI::casPVI(caServerI &casIn, const char * const pNameIn,
casPV &pvAdapterIn) :
cas(casIn),
stringId(pNameIn),
cas(casIn),
pv(pvAdapterIn),
nMonAttached(0u),
nIOAttached(0u)
{
assert(&cas);
//
// casPVI must always be a base of casPV
//
assert(&pvAdapterIn == (casPV *)this);
assert(&this->cas);
assert(&this->pv);
this->cas.installPV(*this);
}
@@ -108,22 +109,22 @@ caStatus casPVI::verifyPVName(gdd &name)
//
gddStatus = name.reference();
if (gddStatus) {
serverToolDebug();
serverToolDebug("GDD PV name must not be \"no ref\"");
return S_cas_badPVName;
}
gddStatus = name.unreference();
if (gddStatus) {
serverToolDebug();
serverToolDebug("corruption expected");
return S_cas_badPVName;
}
if (name.primitiveType() != aitEnumString) {
serverToolDebug();
serverToolDebug("GDD PV name must be stored as an aitString");
return S_cas_badPVName;
}
if (name.dimension() != 1u) {
serverToolDebug();
if (name.dimension() != 0u) {
serverToolDebug("GDD Dimension must be zero (gddScaler)");
return S_cas_badPVName;
}

View File

@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.4 1996/07/01 19:56:13 jhill
* one last update prior to first release
*
* Revision 1.3 1996/06/26 21:18:58 jhill
* now matches gdd api revisions
*
@@ -47,6 +50,26 @@
#include <dbMapper.h>
//
// casPVI::interfaceObjectPointer()
//
// casPVI must always be a base for casPV
// (the constructor assert fails if this isnt the case)
//
inline casPV *casPVI::interfaceObjectPointer() const
{
return &this->pv;
}
//
// casPVI::operator -> ()
//
casPV * casPVI::operator -> () const
{
return interfaceObjectPointer();
}
//
// casPVI::lock()
//
@@ -88,8 +111,7 @@ inline void casPVI::removeChannel(casPVListChan &chan)
//
inline aitBool casPVI::okToBeginNewIO() const
{
if (this->nIOAttached >= (*this)->maxSimultAsyncOps())
{
if (this->nIOAttached >= (*this)->maxSimultAsyncOps()) {
return aitFalse;
}
else {
@@ -178,7 +200,6 @@ inline void casPVI::postEvent (const casEventMask &select, gdd &event)
}
}
#endif // casPVIIL_h

View File

@@ -29,6 +29,15 @@
*
* History
* $Log$
* Revision 1.8 1996/08/05 23:22:57 jhill
* gddScaler => gddScalar
*
* Revision 1.7 1996/08/05 19:26:51 jhill
* doc
*
* Revision 1.5 1996/07/09 22:53:33 jhill
* init stat and sev in gdd
*
* Revision 1.4 1996/07/01 19:56:14 jhill
* one last update prior to first release
*
@@ -110,8 +119,7 @@ inline caStatus casStrmClient::createChannel (const char *pName)
int gddStatus;
gdd *pCanonicalName;
// set correct appl type here !!!!
pCanonicalName = new gddAtomic(0u, aitEnumString, 1u);
pCanonicalName = new gddScalar(gddAppType_name, aitEnumString);
if (!pCanonicalName) {
return S_cas_noMemory;
}
@@ -1052,6 +1060,11 @@ caStatus casStrmClient::eventAddAction ()
return S_cas_success;
}
//
// place monitor mask in correct byte order
//
pMonInfo->m_mask = ntohs (pMonInfo->m_mask);
if (pMonInfo->m_mask&DBE_VALUE) {
mask |= this->getCAS().getAdapter()->valueEventMask;
}
@@ -1346,7 +1359,7 @@ caStatus casStrmClient::write()
status = this->writeArrayData();
}
else {
status = this->writeScalerData();
status = this->writeScalarData();
}
(*pPV)->endTransaction();
@@ -1356,9 +1369,9 @@ caStatus casStrmClient::write()
//
// casStrmClient::writeScalerData()
// casStrmClient::writeScalarData()
//
caStatus casStrmClient::writeScalerData()
caStatus casStrmClient::writeScalarData()
{
gdd *pDD;
const caHdr *pHdr = this->ctx.getMsg();
@@ -1371,7 +1384,7 @@ caStatus casStrmClient::writeScalerData()
return S_cas_badType;
}
pDD = new gddScaler (gddAppType_value, type);
pDD = new gddScalar (gddAppType_value, type);
if (!pDD) {
return S_cas_noMemory;
}
@@ -1560,15 +1573,15 @@ caStatus createDBRDD (unsigned dbrType, aitIndex dbrCount, gdd *&pDescRet)
pVal = pCont->getDD(valIndex);
assert (pVal);
gddStatus = pVal->setBound (0, 0u, dbrCount);
assert (gddStatus==0)
assert (gddStatus==0);
}
else if (pDescRet->isAtomic()) {
gddAtomic *pAtomic = (gddAtomic *) pDescRet;
gddStatus = pAtomic->setBound(0, 0u, dbrCount);
assert (gddStatus==0)
assert (gddStatus==0);
}
else {
assert(dbrCount==1u);
assert (dbrCount==1u);
}
}
@@ -1677,6 +1690,7 @@ casPVI *caServerI::createPV (gdd &name)
{
casPVI *pPVI;
caStatus status;
aitString *pNameStr;
//
// dont proceed unless its a valid PV name
@@ -1694,15 +1708,15 @@ casPVI *caServerI::createPV (gdd &name)
// way currently to test) it will prove fatal
// to the server
//
aitString aitStr(name);
stringId id (aitStr.string());
name.getRef(pNameStr);
stringId id (pNameStr->string());
this->lock ();
pPVI = this->stringResTbl.lookup (id);
if (!pPVI) {
casPV *pPV;
pPV = (*this)->createPV (this->ctx, aitStr.string());
pPV = (*this)->createPV (this->ctx, pNameStr->string());
if (pPV) {
pPVI = (casPVI *) pPV;
}

View File

@@ -30,6 +30,12 @@
* Modification Log:
* -----------------
* $Log$
* Revision 1.5 1996/08/13 22:54:42 jhill
* doc
*
* Revision 1.4 1996/07/01 19:56:15 jhill
* one last update prior to first release
*
* Revision 1.3 1996/06/26 23:08:55 jhill
* took path out of casInternal.h include
*
@@ -249,6 +255,8 @@ public:
}
};
class caServerI;
//
// caServer - Channel Access Server API Class
//
@@ -268,10 +276,6 @@ public:
unsigned maxSimultaneousIO=1u);
virtual ~caServer();
//
// Need VF that returns pointer to derived type ?
//
//caStatus enableClients ();
//caStatus disableClients ();
@@ -477,6 +481,10 @@ public:
casChannel(const casCtx &ctx);
virtual ~casChannel();
//
// Called when the user name and the host name are changed
// for a live connection.
//
virtual void setOwner(const char * const pUserName,
const char * const pHostName);
@@ -535,5 +543,5 @@ public:
casPV *getPV();
};
#endif /* ifdef includecasdefh (this must be the last line in this file) */
#endif // ifdef includecasdefh (this must be the last line in this file)

View File

@@ -29,6 +29,12 @@
*
* History
* $Log$
* Revision 1.2 1996/08/13 22:53:59 jhill
* fixed little endian problem
*
* Revision 1.1.1.1 1996/06/20 00:28:15 jhill
* ca server installation
*
*
*/
@@ -133,16 +139,12 @@ caHdr **ppMsg
void outBuf::commitMsg ()
{
caHdr *mp;
bufSizeT size;
bufSizeT extSize;
bufSizeT diff;
assert (this->bufSize);
mp = (caHdr *) &this->pBuf[this->stack];
extSize = CA_MESSAGE_ALIGN(mp->m_postsize);
assert((extSize&0x7)==0);
//
// Guarantee that all portions of outgoing messages
@@ -173,12 +175,12 @@ assert((extSize&0x7)==0);
*/
mp->m_cmmd = htons (mp->m_cmmd);
mp->m_postsize = htons (mp->m_postsize);
mp->m_type = htons (mp->m_type);
mp->m_count = htons (mp->m_count);
mp->m_cid = htonl (mp->m_cid);
mp->m_available = htonl (mp->m_available);
size = sizeof(caHdr) + mp->m_postsize;
this->stack += size;
this->stack += sizeof(caHdr) + extSize;
assert (this->stack <= this->bufSize);
this->mutex.unlock();

View File

@@ -29,6 +29,21 @@
*
* History
* $Log$
* Revision 1.9 1996/08/13 22:56:14 jhill
* added init for mutex class
*
* Revision 1.8 1996/08/05 23:22:58 jhill
* gddScaler => gddScalar
*
* Revision 1.7 1996/08/05 19:27:28 jhill
* added process()
*
* Revision 1.5 1996/07/24 22:00:50 jhill
* added pushOnToEventQueue()
*
* Revision 1.4 1996/07/09 22:51:14 jhill
* store copy of msg in ctx
*
* Revision 1.3 1996/06/26 21:19:04 jhill
* now matches gdd api revisions
*
@@ -63,21 +78,13 @@ HDRVERSIONID(serverh, "%W% %G%")
//
// ANSI C
//
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <limits.h>
//
// EPICS
//
#define epicsAssertAuthor "Jeff Hill johill@lanl.gov"
#include <epicsAssert.h>
#include <db_access.h>
//
// CA
@@ -87,20 +94,13 @@ HDRVERSIONID(serverh, "%W% %G%")
#include <casdef.h>
#include <osiTime.h>
//
// gdd
//
#if 0
#include <dbMapper.h>
#include <gddApps.h>
#endif
//
// CAS
//
void casVerifyFunc(const char *pFile, unsigned line, const char *pExp);
void serverToolDebugFunc(const char *pFile, unsigned line);
#define serverToolDebug() {serverToolDebugFunc(__FILE__, __LINE__); }
void serverToolDebugFunc(const char *pFile, unsigned line, const char *pComment);
#define serverToolDebug(COMMENT) \
{serverToolDebugFunc(__FILE__, __LINE__, COMMENT); }
#define casVerify(EXP) {if ((EXP)==0) casVerifyFunc(__FILE__, __LINE__, #EXP); }
caStatus createDBRDD(unsigned dbrType, aitIndex dbrCount, gdd *&pDescRet);
caStatus copyBetweenDD(gdd &dest, gdd &src);
@@ -162,8 +162,8 @@ private:
virtual void osdShow (unsigned level) const = 0;
};
#include <casIOD.h> // IO dependent
#include <casOSD.h> // OS dependent
#include <casIOD.h> // IO dependent
enum casProcCond {casProcOk, casProcDisconnect};
@@ -200,6 +200,13 @@ public:
eventsOff(aitFalse)
{
}
init()
{
if (mutex.init()) {
return S_cas_noMemory;
}
return S_cas_success;
}
~casEventSys();
void show(unsigned level);
@@ -212,7 +219,9 @@ public:
void removeFromEventQueue(casEvent &);
inline void addToEventQueue(casEvent &);
void insertEventQueue(casEvent &insert, casEvent *pPrev=NULL);
void insertEventQueue(casEvent &insert, casEvent &prevEvent);
void pushOnToEventQueue(casEvent &event);
aitBool full();
@@ -249,10 +258,20 @@ private:
//
// casEventSys::insertEventQueue()
//
inline void casEventSys::insertEventQueue(casEvent &insert, casEvent *pPrevEvent)
inline void casEventSys::insertEventQueue(casEvent &insert, casEvent &prevEvent)
{
this->mutex.lock();
this->eventLogQue.insert(insert, pPrevEvent);
this->eventLogQue.insertAfter(insert, prevEvent);
this->mutex.unlock();
}
//
// casEventSys::pushOnToEventQueue()
//
inline void casEventSys::pushOnToEventQueue(casEvent &event)
{
this->mutex.lock();
this->eventLogQue.push(event);
this->mutex.unlock();
}
@@ -303,11 +322,6 @@ public:
private:
};
//
// ndim == 0 => scaler
// otherwise pIndexArray points to an array of ndim items
//
#define nDimScaler 0U
class casCtx {
public:
casCtx() :
@@ -519,6 +533,13 @@ class casCoreClient : public osiMutex, public ioBlocked,
public casEventSys {
public:
casCoreClient(caServerI &serverInternal);
caStatus init()
{
if (this->osiMutex::init()) {
return S_cas_noMemory;
}
return this->casEventSys::init();
}
virtual ~casCoreClient();
virtual void destroy();
virtual caStatus disconnectChan(caResId id);
@@ -793,7 +814,7 @@ private:
caStatus channelCreateFailed (const caHdr *mp, caStatus createStatus);
caStatus writeArrayData();
caStatus writeScalerData();
caStatus writeScalarData();
caStatus writeString();
};
@@ -835,6 +856,10 @@ public:
}
void destroy();
protected:
void process();
private:
void ioBlockedSignal(); // dummy
@@ -856,10 +881,8 @@ private:
class casClientMon;
//
// caServerI
//
class caServerI : public caServerOS, public caServerIO,
class caServerI :
public caServerOS, public caServerIO,
public osiMutex, public ioBlockedList,
private uintResTable<casRes>,
public casEventRegistry {
@@ -895,11 +918,6 @@ public:
void removeClient(casStrmClient *pClient);
casStrmClient *firstClient() const
{
return clientList.first();
}
unsigned getMaxSimultaneousIO() const {return this->maxSimultaneousIO;}
//
@@ -951,7 +969,7 @@ public:
return &this->adapter;
}
uintResTable<casRes> &getResTable() {return *this;}
//uintResTable<casRes> &getResTable() {return *this;}
void installItem(casRes &res)
{

View File

@@ -276,7 +276,10 @@ xSendStatus casDGIO::osdSend(const char *pBuf, bufSizeT size,
return xSendOK;
}
status = sendto(this->sock, pBuf, size, 0,
//
// (char *) cast below is for brain dead wrs prototype
//
status = sendto(this->sock, (char *) pBuf, size, 0,
&this->lastRecvAddr.sa,
sizeof(this->lastRecvAddr.sa));
if (status>0) {

View File

@@ -7,48 +7,28 @@
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.3 1996/08/13 23:00:29 jhill
// removed include of netdb.h
//
// Revision 1.2 1996/07/24 22:03:36 jhill
// fixed net proto for gnu compiler
//
// Revision 1.1.1.1 1996/06/20 00:28:18 jhill
// ca server installation
//
//
#ifndef includeCASIODH
#define includeCASIODH
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#if 0 // func proto do not have args for C++
#include <arpa/inet.h>
#include <netdb.h>
#endif
#ifdef __cplusplus
}
#endif
#include <bsdProto.h>
typedef int SOCKET;
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#include <osiSock.h>
// ca
#include <addrList.h>
void hostNameFromIPAddr (const caAddr *pAddr,
char *pBuf, unsigned bufSize);
//
// assuming al posix machines are IEEE fload will be wrong
//
#define ntohf(A) (A)
#define ntohd(A) (A)
#define htonf(A) (A)
#define htond(A) (A)
class caServerIO {
public:

View File

@@ -5,6 +5,9 @@
//
//
// $Log$
// Revision 1.3 1996/07/09 22:55:22 jhill
// added cast
//
// Revision 1.2 1996/06/21 02:18:11 jhill
// SOLARIS port
//
@@ -20,7 +23,9 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#ifndef SUNOS4 // the SUNOS4 prototypes are trad C - see bsdProto.h
#include <arpa/inet.h>
#endif
//

View File

@@ -6,6 +6,9 @@
*
*
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
@@ -108,6 +111,6 @@ casServerReg::~casServerReg()
//
int caServerOS::getFD()
{
return cas.caServerIO::getFD();
return cas.caServerIO::getFD();
}

View File

@@ -6,6 +6,9 @@
*
*
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
@@ -166,54 +169,9 @@ casProcCond casDGOS::processInput ()
//
void casDGReadReg::callBack()
{
caStatus status;
casFlushCondition flushCond;
casFillCondition fillCond;
assert (os.pRdReg);
//
// force all replies to be sent to the client
// that made the request
//
os.clear();
//
// read in new input
//
fillCond = os.fill();
if (fillCond == casFillDisconnect) {
casVerify(0);
return;
}
//
// verify that we have a message to process
//
if (os.inBuf::bytesPresent()>0u) {
//
// process the message
//
status = os.processMsg();
if (status) {
errMessage (status,
"unexpected error processing stateless protocol");
//
// clear the input buffer so this will
// not effect future input
//
os.clear();
}
else {
//
// force all replies to go to the sender
//
flushCond = os.flush();
if (flushCond!=casFlushCompleted) {
os.clear();
casVerify(0);
}
}
}
os.process();
}
//

View File

@@ -7,6 +7,12 @@
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.2 1996/08/13 22:58:15 jhill
// fdMgr.h => fdmanager.h
//
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
#ifndef includeCASOSDH
@@ -22,11 +28,18 @@ extern "C" {
//
# include <netinet/in.h>
//
// g++ 2.7.2 does not fix this file under sunos4 so I
// have provided the prototype elsewhere (in osiSock.h for now)
//
#if !(defined(SUNOS4) && defined(__GNUC__))
# include <netdb.h>
#endif
} // extern "C"
#include <osiMutex.h>
#include <osiTimer.h>
#include <fdMgr.h>
#include <fdManager.h>
class caServerI;

View File

@@ -1,46 +0,0 @@
/*
* $Id$
* Some of this isnt posix - its BSD
*
* $Log$
*/
#ifndef includeCasSpecificOSH
#define includeCasSpecificOSH
#include <singleThread.h>
#include <unistd.h>
#include <errno.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/types.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <bsdProto.h>
#ifdef __cplusplus
}
#endif
typedef int SOCKET;
#define SOCKERRNO errno
#define socket_close(S) close(S)
#define socket_ioctl(A,B,C) ioctl(A,B,C)
#define ntohf(A) (A)
#define ntohd(A) (A)
#define htonf(A) (A)
#define htond(A) (A)
#endif /* ifndef includeCasSpecificOSH (no new code below this line) */

View File

@@ -1,11 +1,15 @@
//
// osiMutex - OS independent mutex
// (NOOP on single threaded OS)
//
class osiMutex {
public:
//
// constructor that returns status
// (since g++ does not have exceptions)
//
int init() {return 0;}
void lock() {};
void unlock() {};
private:

View File

@@ -2,6 +2,7 @@
WORK IN PROGRESS
this directory contains the vxWorks os dependent source for
the EPICS ca server
the EPICS ca server. This is a multi-threaded port of the
server.

View File

@@ -0,0 +1,124 @@
/*
*
* caServerOS.c
* $Id$
*
*
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
#include <taskLib.h>
#include <task_params.h>
//
// CA server
//
#include <server.h>
//
// aServerOS::operator -> ()
//
inline caServerI * caServerOS::operator -> ()
{
return &this->cas;
}
//
// casBeaconTimer::expire()
//
void casBeaconTimer::expire()
{
os->sendBeacon ();
}
//
// casBeaconTimer::again()
//
osiBool casBeaconTimer::again()
{
return osiTrue;
}
//
// casBeaconTimer::delay()
//
const osiTime casBeaconTimer::delay()
{
return os->getBeaconPeriod();
}
//
// caServerOS::init()
//
caStatus caServerOS::init()
{
this->pBTmr = new casBeaconTimer((*this)->getBeaconPeriod(), *this);
if (!this->pBTmr) {
ca_printf("CAS: Unable to start server beacon\n");
return S_cas_noMemory;
}
//
// WRS still passes pointers in ints
//
assert (sizeof(int)==sizeof(&this->cas));
this->tid = taskSpawn (
REQ_SRVR_NAME,
REQ_SRVR_PRI,
REQ_SRVR_OPT,
REQ_SRVR_STACK,
(FUNCPTR) caServerEntry, // get your act together WRS
(int) &this->cas, // get your act together WRS
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->tid==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
//
// caServerOS::~caServerOS()
//
caServerOS::~caServerOS()
{
if (this->pBTmr) {
delete this->pBTmr;
}
if (taskIdVerify(this->tid)==OK)
{
taskDelete(this->tid);
}
}
//
// caServer()
//
void caServer(caServerI *pCAS)
{
//
// forever
//
while (TRUE) {
pCAS->connectCB();
printf("process timer q here?\n");
}
}

View File

@@ -0,0 +1,77 @@
class casStreamEvWakeup;
//
// casStreamOS
//
class casStreamOS : public casStrmClient {
friend int casStrmServer (casStreamOS *);
friend int casStrmEvent (casStreamOS *);
public:
casStreamOS(caServerI &, casMsgIO &);
caStatus init();
~casStreamOS();
//
// process any incomming messages
//
casProcCond processInput();
caStatus start();
void sendBlockSignal();
void ioBlockedSignal();
void eventSignal();
void eventFlush();
void show(unsigned level);
private:
SEM_ID eventSignalSem;
int clientTId;
int eventTId;
};
//
// vxWorks task entry
//
int casStrmServer (casStreamOS *);
int casStrmEvent (casStreamOS *);
class casDGEvWakeup;
//
// casDGOS
//
class casDGOS : public casDGClient {
friend int casDGServer (casDGOS *);
friend int casDGEvent (casDGOS *);
public:
casDGOS(caServerI &cas);
caStatus init();
~casDGOS();
//
// process any incomming messages
//
casProcCond processInput();
caStatus start();
void sendBlockSignal() {}
void eventSignal();
void eventFlush();
void show(unsigned level);
private:
SEM_ID eventSignalSem;
int clientTId;
int eventTId;
};
//
// vxWorks task entry
//
int casDGServer (casDGOS *);
int casDGEvent (casDGOS *);

View File

@@ -0,0 +1,211 @@
/*
*
* casDGOS.c
* $Id$
*
*
* $Log$
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
//
// CA server
//
#include <taskLib.h> // vxWorks
#include <server.h>
#include <casClientIL.h> // casClient inline func
#include <task_params.h> // EPICS task priorities
//
// casDGOS::eventSignal()
//
void casDGOS::eventSignal()
{
STATUS st;
st = semGive(this->eventSignalSem);
assert (st==OK);
}
//
// casDGOS::eventFlush()
//
void casDGOS::eventFlush()
{
this->flush();
}
//
// casDGOS::casDGOS()
//
casDGOS::casDGOS(caServerI &cas) :
eventSignalSem(NULL),
casDGClient(cas),
clientTId(ERROR),
eventTId(ERROR)
{
}
//
// casDGOS::init()
//
caStatus casDGOS::init()
{
caStatus status;
this->eventSignalSem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if (this->eventSignalSem == NULL) {
return S_cas_noMemory;
}
//
// init the base classes
//
status = this->casDGClient::init();
return status;
}
//
// casDGOS::~casDGOS()
//
casDGOS::~casDGOS()
{
if (taskIdVerify(this->clientTId)==OK) {
taskDelete(this->clientTId);
}
if (taskIdVerify(this->eventTId)==OK) {
taskDelete(this->eventTId);
}
if (this->eventSignalSem) {
semDelete(this->eventSignalSem);
}
}
//
// casDGOS::show()
//
void casDGOS::show(unsigned level)
{
this->casDGClient::show(level);
printf ("casDGOS at %x\n", (unsigned) this);
if (taskIdVerify(this->clientTId) == OK) {
taskShow(this->clientTId, level);
}
if (taskIdVerify(this->eventTId) == OK) {
taskShow(this->eventTId, level);
}
if (this->eventSignalSem) {
semShow(this->eventSignalSem, level);
}
}
/*
* casClientStart ()
*/
caStatus casDGOS::start()
{
//
// no (void *) vxWorks task arg
//
assert (sizeof(int) >= sizeof(this));
this->clientTId = taskSpawn(
CAST_SRVR_NAME,
CAST_SRVR_PRI,
CAST_SRVR_OPT,
CAST_SRVR_STACK,
(FUNCPTR) casDGServer, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->clientTId==ERROR) {
return S_cas_noMemory;
}
this->eventTId = taskSpawn(
CA_EVENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CAST_SRVR_STACK,
(FUNCPTR) casDGEvent, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->eventTId==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casDGOS::processInput ()
* - a noop
*/
casProcCond casDGOS::processInput ()
{
return casProcOk;
}
//
// casDGServer()
//
int casDGServer (casDGOS *pDGOS)
{
caStatus status;
//
// block for the next DG until the connection closes
//
while (TRUE) {
status = pDGOS->processInput();
if (status) {
errMessage(status, "casDGServer (casDGOS *pDGOS)");
}
}
}
//
// casDGEvent()
//
int casDGEvent (casDGOS *pDGOS)
{
STATUS status;
casProcCond cond;
//
// Wait for event queue entry
//
while (TRUE) {
status = semTake(pDGOS->eventSignalSem, WAIT_FOREVER);
assert (status!=OK);
cond = pDGOS->casEventSys::process();
if (cond != casProcOk) {
printf("DG event sys process failed\n");
}
}
}

View File

@@ -0,0 +1,92 @@
//
// $Id$
//
// casOSD.h - Channel Access Server OS Dependent for posix
//
//
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
#ifndef includeCASOSDH
#define includeCASOSDH
#include <unistd.h>
#include <errno.h>
extern "C" {
//
// for htons() etc
//
# include <netinet/in.h>
# include <ioLib.h>
} // extern "C"
#include <osiMutex.h>
#include <osiTimer.h>
class caServerI;
class caServerOS;
//
// casBeaconTimer
//
class casBeaconTimer : public osiTimer {
public:
casBeaconTimer (const osiTime &delay, caServerOS &osIn) :
os (osIn), osiTimer(delay) {}
void expire();
const osiTime delay();
osiBool again();
const char *name()
{
return "casBeaconTimer";
}
private:
caServerOS &os;
int taskId;
};
class casServerReg;
class caServerOS;
//
// vxWorks task entry
//
int caServerEntry(caServerI *pCAS);
//
// caServerOS
//
class caServerOS {
friend class casServerReg;
friend int caServerEntry(caServerOS *pOS);
public:
caServerOS (caServerI &casIn) :
cas (casIn), pBTmr (NULL), tid(ERROR) {}
caStatus init ();
~caServerOS ();
//caStatus start ();
inline caServerI * operator -> ();
//int getFD();
private:
caServerI &cas;
casBeaconTimer *pBTmr;
int tid;
};
// no additions below this line
#endif // includeCASOSDH

View File

@@ -0,0 +1,280 @@
//
// casStreamOS.cc
// $Id$
//
//
// $Log$
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
//
//
// CA server
//
#include<server.h>
#include <casClientIL.h> // casClient inline func
#include <task_params.h> // EPICS task priorities
//
// casStreamOS::ioBlockedSignal()
//
void casStreamOS::ioBlockedSignal()
{
printf("in casStreamOS::ioBlockedSignal()\n");
}
//
// casStreamOS::eventSignal()
//
void casStreamOS::eventSignal()
{
STATUS st;
st = semGive(this->eventSignalSem);
assert (st==OK);
}
//
// casStreamOS::eventFlush()
//
void casStreamOS::eventFlush()
{
this->flush();
}
//
// casStreamOS::casStreamOS()
//
casStreamOS::casStreamOS(caServerI &cas, casMsgIO &ioIn) :
casStrmClient(cas, ioIn),
eventSignalSem(NULL),
clientTId(NULL),
eventTId(NULL)
{
}
//
// casStreamOS::init()
//
caStatus casStreamOS::init()
{
caStatus status;
this->eventSignalSem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if (this->eventSignalSem == NULL) {
return S_cas_noMemory;
}
//
// init the base classes
//
status = this->casStrmClient::init();
if (status) {
return status;
}
return S_cas_success;
}
//
// casStreamOS::~casStreamOS()
//
casStreamOS::~casStreamOS()
{
//
// attempt to flush out any remaining messages
//
this->flush();
if (taskIdVerify(this->clientTId)==OK &&
this->clientTId != taskIdSelf()) {
taskDelete(this->clientTId);
}
if (taskIdVerify(this->eventTId)==OK &&
this->eventTId != taskIdSelf()) {
taskDelete(this->eventTId);
}
if (this->eventSignalSem) {
semDelete(this->eventSignalSem);
}
}
//
// casStreamOS::show()
//
void casStreamOS::show(unsigned level)
{
this->casStrmClient::show(level);
printf("casStreamOS at %x\n", (unsigned) this);
if (taskIdVerify(this->clientTId)==OK) {
taskShow(this->clientTId, level);
}
if (taskIdVerify(this->eventTId)==OK) {
taskShow(this->eventTId, level);
}
if (this->eventSignalSem) {
semShow(this->eventSignalSem, level);
}
}
//
// casClientStart ()
//
caStatus casStreamOS::start()
{
//
// no (void *) vxWorks task arg
//
assert (sizeof(int) >= sizeof(this));
this->clientTId = taskSpawn(
CA_CLIENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CA_CLIENT_STACK,
(FUNCPTR) casStrmServer, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->clientTId==ERROR) {
return S_cas_noMemory;
}
this->eventTId = taskSpawn(
CA_EVENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CA_CLIENT_STACK,
(FUNCPTR) casStrmEvent, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->eventTId==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
//
// casStreamOS::sendBlockSignal()
//
void casStreamOS::sendBlockSignal()
{
printf("in casStreamOS::sendBlockSignal()\n");
}
//
// casStreamOS::processInput()
//
casProcCond casStreamOS::processInput()
{
caStatus status;
# ifdef DEBUG
printf(
"Resp bytes to send=%d, Req bytes pending %d\n",
this->outBuf::bytesPresent(),
this->inBuf::bytesPresent());
# endif
status = this->processMsg();
switch (status) {
case S_cas_partialMessage:
case S_cas_ioBlocked:
case S_cas_success:
return casProcOk;
default:
errMessage (status,
"unexpected error processing client's input");
return casProcDisconnect;
}
}
//
// casStrmServer()
//
int casStrmServer (casStreamOS *pStrmOS)
{
casFillCondition fillCond;
casProcCond procCond;
caStatus status;
//
// block for the next DG until the connection closes
//
while (TRUE) {
//
// copy in new messages
//
fillCond = pStrmOS->fill();
procCond = pStrmOS->processInput();
if (fillCond == casFillDisconnect ||
procCond == casProcDisconnect) {
delete pStrmOS;
//
// NO CODE HERE
// (see delete above)
//
return OK;
}
else if (pStrmOS->inBuf::full()==aitTrue) {
//
// If there isnt any space then temporarily
// stop calling this routine until problem is resolved
// either by:
// (1) sending or
// (2) a blocked IO op unblocks
//
delete pStrmOS;
//
// NO CODE HERE
// (see delete above)
//
return OK;
}
}
}
//
// casStrmEvent()
//
int casStrmEvent(casStreamOS *pStrmOS)
{
STATUS status;
casProcCond cond;
//
// Wait for event queue entry
//
while (TRUE) {
status = semTake(pStrmOS->eventSignalSem, WAIT_FOREVER);
assert (status!=OK);
cond = pStrmOS->casEventSys::process();
if (cond != casProcOk) {
printf("Stream event sys process failed\n");
}
}
}

View File

@@ -0,0 +1,51 @@
//
// osiMutex - OS independent mutex
// (vxWorks version)
//
#include <semLib.h>
#include <assert.h>
class osiMutex {
public:
osiMutex()
{
mutex = NULL;
}
//
// constructor that returns status
// (since g++ does not have exceptions)
//
int init ()
{
this->mutex = semMCreate(SEM_Q_PRIORITY|SEM_INVERSION_SAFE);
if (this->mutex==NULL)
{
return -1;
}
return 0;
}
~osiMutex()
{
STATUS s;
s = semDelete (this->mutex);
assert (s==OK);
}
void lock()
{
STATUS s;
assert(this->mutex);
s = semTake (this->mutex, WAIT_FOREVER);
assert (s==OK);
}
void unlock()
{
STATUS s;
s = semGive (this->mutex);
assert (s==OK);
}
private:
SEM_ID mutex;
};

View File

@@ -1,659 +0,0 @@
/*
*
* vxWorks_depen.c
* %W% %G%
*
* vxWorks dependent routines for the CA server
*
*
*/
#include <server.h>
#include <inetLib.h>
VERSIONID(vxWorks_depenc,"%W% %G%")
#define MUTEX_SEM_OPTIONS \
(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int arg),
int init_func_arg
);
LOCAL void osDepenTimerCB(void *pciu);
LOCAL void osDepenSendCB(void *pClient);
int caServerTask(struct rsrv *pRsrv);
LOCAL int caMaxFreeBlockPoll(void);
size_t caMaxFreeBlock;
###### no event flush currently (only needed in multi thread env) ####
status = caeqAddFlushEvent (client->evuser, XXXX, client);
assert (status==OK);
/*
* caGetElapsedTime()
*/
caStatus caGetElapsedTime(caElapsedTimeVal *pElapsed)
{
ULONG ticks;
ULONG rate;
ticks = tickGet();
rate = sysClkRateGet();
pElapsed->tv_sec = ticks * rate;
pElapsed->tv_usec = ((ticks % rate)*CAServerUSecInSec)/rate;
return S_cas_success;
}
/*
* caOutOfMemory()
*/
int caOutOfMemory(void)
{
int status;
static int pollTaskStarted;
if(!pollTaskStarted){
caMaxFreeBlock = memFindMax();
status = taskSpawn(
MAXFREEBLOCKTASKNAME,
MAXFREEBLOCKTASKPRI,
MAXFREEBLOCKTASKOPT,
MAXFREEBLOCKTASKSTACK,
caMaxFreeBlockPoll,
0,0,0,0,0,0,0,0,0,0);
if(status>=0){
pollTaskStarted = TRUE;
}
}
return (caMaxFreeBlock<MAX_BLOCK_THRESHOLD);
}
/*
* caMaxFreeBlockPoll()
*/
LOCAL int caMaxFreeBlockPoll(void)
{
while(TRUE){
caMaxFreeBlock = memFindMax();
taskDelay(MAXFREEBLOCKPOLL*sysClkRateGet());
}
}
/*
* casPutCBStartTimer()
*/
caStatus casPutCBStartTimer(
casChanInUse *pciu,
unsigned timeOutSec
)
{
struct client *pClient = pciu->client;
caserver *pRsrv = pClient->cc.pRsrv;
struct timeval tv;
if(pClient->cc.osSpecific.pPutCBAlarm){
tv.tv_sec = timeOutSec;
tv.tv_usec = 0;
pClient->cc.osSpecific.pPutCBAlarm
= fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
osDepenTimerCB,
pciu);
if(!pClient->cc.osSpecific.pPutCBAlarm){
return S_cas_noMemory;
}
}
return S_cas_success;
}
/*
* osDepenTimerCB()
*/
LOCAL void osDepenTimerCB(void *pParam)
{
casChanInUse *pciu = (casChanInUse *)pParam;
pciu->client->cc.osSpecific.pPutCBAlarm = NULL;
casPutCBTimer(pciu);
}
/*
* casPutCBCancelTimer()
*/
void casPutCBCancelTimer(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.pPutCBAlarm){
status = fdmgr_clear_timeout(
pRsrv->osSpecific.pfdctx,
pClient->cc.osSpecific.pPutCBAlarm);
assert(status==0);
pClient->cc.osSpecific.pPutCBAlarm = NULL;
}
}
/*
* casDisableSocketRecvIOCallback()
*/
caStatus casDisableSocketRecvIOCallback(struct client *pClient)
{
int status;
if(pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_clear_callback(
pClient->cc.pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read);
assert(status==0);
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* casEnableSocketRecvIOCallback()
*/
caStatus casEnableSocketRecvIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read,
pClient->cc.pCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casWaitForIO ()
*/
caStatus casWaitForIO (struct rsrv *pRsrv, caTime *pDelay)
{
struct timeval tv;
tv.tv_sec = caTime->sec;
tv.tv_usec = caTime->nsec / NSecPerUsec;
status = fdmgr_pend_event(pRsrv->osSpecific.pfdctx, &tv);
if (status) {
return S_cas_internal;
}
return S_cas_success;
}
/*
* casArmSocketSendIOCallback()
*/
caStatus casArmSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write,
osDepenSendCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockSendIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casCancelSocketSendIOCallback()
*/
caStatus casCancelSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_clear_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write);
assert(status==0);
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* osDepenSendCB()
*/
LOCAL void osDepenSendCB(void *pParam)
{
struct client *pClient = (struct client *) pParam;
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
(*pClient->sendHandler)(pClient);
}
/*
* casOSSpecificDelete()
*/
void casOSSpecificDelete(struct rsrv *pRsrv)
{
int status;
if(taskIdVerify(pRsrv->osSpecific.selectTask) == OK){
taskwdRemove(taskDelete(pRsrv->osSpecific.selectTask));
taskDelete(pRsrv->osSpecific.selectTask);
}
if(pRsrv->osSpecific.clientQLock){
status = semDelete(pRsrv->osSpecific.clientQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeChanQLock){
status = semDelete(pRsrv->osSpecific.freeChanQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeEventQLock){
status = semDelete(pRsrv->osSpecific.freeEventQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pvQLock){
status = semDelete(pRsrv->osSpecific.pvQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pfdctx){
status = fdmgr_delete(pRsrv->osSpecific.pfdctx);
assert(status==OK);
}
}
/*
* casOSSpecificInit()
*/
caStatus casOSSpecificInit(struct rsrv *pRsrv)
{
pRsrv->osSpecific.clientQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.clientQLock){
return S_cas_noMemory;
}
pRsrv->osSpecific.freeChanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeChanQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.freeEventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeEventQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pvQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.pvQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pfdctx = fdmgr_init();
if(!pRsrv->osSpecific.pfdctx){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificStartServer()
*/
caStatus casOSSpecificStartServer(caserver *pRsrv)
{
int status;
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pRsrv->server_sock,
fdi_read,
rsrv_connect,
pRsrv);
if(status < 0){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
status = taskSpawn(
REQ_SRVR_NAME,
REQ_SRVR_PRI,
REQ_SRVR_OPT,
RSP_SRVR_STACK,
caServerTask,
(int)pRsrv,
0,0,0,0,0,0,0,0,0);
if(status == ERROR){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.selectTask = status;
return S_cas_success;
}
/*
* caServerTask()
*/
int caServerTask(caserver *pRsrv)
{
struct timeval tv;
caTime delay;
struct client *pClient;
int nchars;
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
while(TRUE){
delay.sec = 100;
delay.usec = 0;
status = caServerProcess (pRsrv, &delay);
assert (status == S_cas_success);
}
}
/*
* casSchedualBeacon()
*/
void casSchedualBeacon(struct rsrv *pRsrv)
{
fdmgrAlarm *tmp;
struct timeval tv;
tv.tv_sec = pRsrv->delayToNextBeacon.tv_sec;
tv.tv_usec = pRsrv->delayToNextBeacon.tv_usec;
tmp = fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
casSendBeacon,
pRsrv);
if(!tmp){
ca_printf("CAS: Unable to keep beacon going\n");
}
}
/*
* casOSSpecificClientInit()
*/
caStatus casOSSpecificClientInit(struct client *client)
{
client->cc.osSpecific.eventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.eventQLock){
return S_cas_noMemory;
}
client->cc.osSpecific.chanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.chanQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.putNotifyLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.putNotifyLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.lock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.accessRightsQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.accessRightsQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificClientDelete()
*/
void casOSSpecificClientDelete(struct client *client)
{
int status;
if(client->cc.osSpecific.eventQLock){
status = semDelete(client->cc.osSpecific.eventQLock);
assert(status==OK);
}
if(client->cc.osSpecific.chanQLock){
status = semDelete(client->cc.osSpecific.chanQLock);
assert(status==OK);
}
if(client->cc.osSpecific.putNotifyLock){
status = semDelete(client->cc.osSpecific.putNotifyLock);
assert(status==OK);
}
if(client->cc.osSpecific.lock){
status = semDelete(client->cc.osSpecific.lock);
assert(status==OK);
}
if(client->cc.osSpecific.accessRightsQLock){
status = semDelete(client->cc.osSpecific.accessRightsQLock);
assert(status==OK);
}
}
/*
* caeqOSSpecificInit()
*/
caStatus caeqOSSpecificInit(caEventUser *evuser)
{
evuser->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!evuser->osSpecific.lock){
return S_cas_noMemory;
}
evuser->osSpecific.ppendsem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if(!evuser->osSpecific.ppendsem){
semDelete(evuser->osSpecific.lock);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificDelete()
*/
void caeqOSSpecificDelete(caEventUser *evuser)
{
int status;
if(taskIdVerify(evuser->osSpecific.taskid)==OK){
taskwdRemove(evuser->osSpecific.taskid);
taskDelete(evuser->osSpecific.taskid);
}
status = semDelete(evuser->osSpecific.lock);
assert(status == OK);
status = semDelete(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqOSSpecificPVInit ()
*/
caStatus caeqOSSpecificPVInit (casPVInUse *pPV)
{
pPV->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if (!pPV->osSpecific.lock) {
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificPVDelete ()
*/
void caeqOSSpecificPVDelete (casPVInUse *pPV)
{
int status;
status = semDelete (pPV->osSpecific.lock);
assert (status == OK);
}
/*
* caeqOSSpecificEventNotify()
*/
void caeqOSSpecificEventNotify(caEventUser *evuser)
{
int status;
status = semGive(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqStartEvents()
*/
int caeqStartEvents(
struct event_user *evuser,
char *taskname, /* defaulted if NULL */
void (*init_func)(),
int init_func_arg,
int priority_offset
)
{
int status;
int taskpri;
/* only one ca_pend_event thread may be started for each evuser ! */
while(!vxTas(&evuser->osSpecific.pendlck))
return ERROR;
status = taskPriorityGet(taskIdSelf(), &taskpri);
if(status == ERROR){
return ERROR;
}
taskpri += priority_offset;
if(!taskname){
taskname = EVENT_PEND_NAME;
}
status = taskSpawn(
taskname,
taskpri,
EVENT_PEND_OPT,
EVENT_PEND_STACK,
event_task,
(int)evuser,
(int)init_func,
(int)init_func_arg,
0,0,0,0,0,0,0);
if(status == ERROR){
return ERROR;
}
evuser->osSpecific.taskid = status;
return OK;
}
/*
* EVENT_TASK()
*/
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int init_func_arg),
int init_func_arg
)
{
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
/* init hook */
if(init_func){
(*init_func)(init_func_arg);
}
/*
* No need to lock getix as I only allow one thread to call this
* routine at a time
*/
while(TRUE){
caeqEventProcess(evuser);
status = semTake(evuser->osSpecific.ppendsem, WAIT_FOREVER);
assert(status == OK);
}
}
/*
* caeqOSSpecificClose()
*/
void caeqOSSpecificClose(caEventUser *pEvUser)
{
return;
}
/*
* asciiIPAddr
*/
void asciiIPAddr (struct in_addr addr, char *pBuf, unsigned bufSize)
{
char pName[INET_ADDR_LEN];
inet_ntoa_b (addr, pName);
strncpy (pBuf, pName, bufSize);
pBuf[bufSize-1] = '\0';
}

View File

@@ -1,659 +0,0 @@
/*
*
* vxWorks_depen.c
* %W% %G%
*
* vxWorks dependent routines for the CA server
*
*
*/
#include<casdef.h>
#include <inetLib.h>
VERSIONID(vxWorks_depenc,"%W% %G%")
#define MUTEX_SEM_OPTIONS \
(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE)
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int arg),
int init_func_arg
);
LOCAL void osDepenTimerCB(void *pciu);
LOCAL void osDepenSendCB(void *pClient);
int caServerTask(struct rsrv *pRsrv);
LOCAL int caMaxFreeBlockPoll(void);
size_t caMaxFreeBlock;
###### no event flush currently (only needed in multi thread env) ####
status = caeqAddFlushEvent (client->evuser, XXXX, client);
assert (status==OK);
/*
* caGetElapsedTime()
*/
caStatus caGetElapsedTime(caElapsedTimeVal *pElapsed)
{
ULONG ticks;
ULONG rate;
ticks = tickGet();
rate = sysClkRateGet();
pElapsed->tv_sec = ticks * rate;
pElapsed->tv_usec = ((ticks % rate)*CAServerUSecInSec)/rate;
return S_cas_success;
}
/*
* caOutOfMemory()
*/
int caOutOfMemory(void)
{
int status;
static int pollTaskStarted;
if(!pollTaskStarted){
caMaxFreeBlock = memFindMax();
status = taskSpawn(
MAXFREEBLOCKTASKNAME,
MAXFREEBLOCKTASKPRI,
MAXFREEBLOCKTASKOPT,
MAXFREEBLOCKTASKSTACK,
caMaxFreeBlockPoll,
0,0,0,0,0,0,0,0,0,0);
if(status>=0){
pollTaskStarted = TRUE;
}
}
return (caMaxFreeBlock<MAX_BLOCK_THRESHOLD);
}
/*
* caMaxFreeBlockPoll()
*/
LOCAL int caMaxFreeBlockPoll(void)
{
while(TRUE){
caMaxFreeBlock = memFindMax();
taskDelay(MAXFREEBLOCKPOLL*sysClkRateGet());
}
}
/*
* casPutCBStartTimer()
*/
caStatus casPutCBStartTimer(
casChanInUse *pciu,
unsigned timeOutSec
)
{
struct client *pClient = pciu->client;
caserver *pRsrv = pClient->cc.pRsrv;
struct timeval tv;
if(pClient->cc.osSpecific.pPutCBAlarm){
tv.tv_sec = timeOutSec;
tv.tv_usec = 0;
pClient->cc.osSpecific.pPutCBAlarm
= fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
osDepenTimerCB,
pciu);
if(!pClient->cc.osSpecific.pPutCBAlarm){
return S_cas_noMemory;
}
}
return S_cas_success;
}
/*
* osDepenTimerCB()
*/
LOCAL void osDepenTimerCB(void *pParam)
{
casChanInUse *pciu = (casChanInUse *)pParam;
pciu->client->cc.osSpecific.pPutCBAlarm = NULL;
casPutCBTimer(pciu);
}
/*
* casPutCBCancelTimer()
*/
void casPutCBCancelTimer(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.pPutCBAlarm){
status = fdmgr_clear_timeout(
pRsrv->osSpecific.pfdctx,
pClient->cc.osSpecific.pPutCBAlarm);
assert(status==0);
pClient->cc.osSpecific.pPutCBAlarm = NULL;
}
}
/*
* casDisableSocketRecvIOCallback()
*/
caStatus casDisableSocketRecvIOCallback(struct client *pClient)
{
int status;
if(pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_clear_callback(
pClient->cc.pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read);
assert(status==0);
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* casEnableSocketRecvIOCallback()
*/
caStatus casEnableSocketRecvIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockRecvIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_read,
pClient->cc.pCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockRecvIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casWaitForIO ()
*/
caStatus casWaitForIO (struct rsrv *pRsrv, caTime *pDelay)
{
struct timeval tv;
tv.tv_sec = caTime->sec;
tv.tv_usec = caTime->nsec / NSecPerUsec;
status = fdmgr_pend_event(pRsrv->osSpecific.pfdctx, &tv);
if (status) {
return S_cas_internal;
}
return S_cas_success;
}
/*
* casArmSocketSendIOCallback()
*/
caStatus casArmSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(!pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write,
osDepenSendCB,
pClient);
if(status){
return S_cas_noMemory;
}
pClient->cc.osSpecific.sockSendIOCallbackEnabled = TRUE;
}
return S_cas_success;
}
/*
* casCancelSocketSendIOCallback()
*/
caStatus casCancelSocketSendIOCallback(struct client *pClient)
{
caserver *pRsrv = pClient->cc.pRsrv;
int status;
if(pClient->cc.osSpecific.sockSendIOCallbackEnabled){
status = fdmgr_clear_callback(
pRsrv->osSpecific.pfdctx,
pClient->cc.sock,
fdi_write);
assert(status==0);
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
}
return S_cas_success;
}
/*
* osDepenSendCB()
*/
LOCAL void osDepenSendCB(void *pParam)
{
struct client *pClient = (struct client *) pParam;
pClient->cc.osSpecific.sockSendIOCallbackEnabled = FALSE;
(*pClient->sendHandler)(pClient);
}
/*
* casOSSpecificDelete()
*/
void casOSSpecificDelete(struct rsrv *pRsrv)
{
int status;
if(taskIdVerify(pRsrv->osSpecific.selectTask) == OK){
taskwdRemove(taskDelete(pRsrv->osSpecific.selectTask));
taskDelete(pRsrv->osSpecific.selectTask);
}
if(pRsrv->osSpecific.clientQLock){
status = semDelete(pRsrv->osSpecific.clientQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeChanQLock){
status = semDelete(pRsrv->osSpecific.freeChanQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.freeEventQLock){
status = semDelete(pRsrv->osSpecific.freeEventQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pvQLock){
status = semDelete(pRsrv->osSpecific.pvQLock);
assert(status==OK);
}
if(pRsrv->osSpecific.pfdctx){
status = fdmgr_delete(pRsrv->osSpecific.pfdctx);
assert(status==OK);
}
}
/*
* casOSSpecificInit()
*/
caStatus casOSSpecificInit(struct rsrv *pRsrv)
{
pRsrv->osSpecific.clientQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.clientQLock){
return S_cas_noMemory;
}
pRsrv->osSpecific.freeChanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeChanQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.freeEventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.freeEventQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pvQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!pRsrv->osSpecific.pvQLock){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.pfdctx = fdmgr_init();
if(!pRsrv->osSpecific.pfdctx){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificStartServer()
*/
caStatus casOSSpecificStartServer(caserver *pRsrv)
{
int status;
status = fdmgr_add_callback(
pRsrv->osSpecific.pfdctx,
pRsrv->server_sock,
fdi_read,
rsrv_connect,
pRsrv);
if(status < 0){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
status = taskSpawn(
REQ_SRVR_NAME,
REQ_SRVR_PRI,
REQ_SRVR_OPT,
RSP_SRVR_STACK,
caServerTask,
(int)pRsrv,
0,0,0,0,0,0,0,0,0);
if(status == ERROR){
casOSSpecificDelete(pRsrv);
return S_cas_noMemory;
}
pRsrv->osSpecific.selectTask = status;
return S_cas_success;
}
/*
* caServerTask()
*/
int caServerTask(caserver *pRsrv)
{
struct timeval tv;
caTime delay;
struct client *pClient;
int nchars;
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
while(TRUE){
delay.sec = 100;
delay.usec = 0;
status = caServerProcess (pRsrv, &delay);
assert (status == S_cas_success);
}
}
/*
* casSchedualBeacon()
*/
void casSchedualBeacon(struct rsrv *pRsrv)
{
fdmgrAlarm *tmp;
struct timeval tv;
tv.tv_sec = pRsrv->delayToNextBeacon.tv_sec;
tv.tv_usec = pRsrv->delayToNextBeacon.tv_usec;
tmp = fdmgr_add_timeout(
pRsrv->osSpecific.pfdctx,
&tv,
casSendBeacon,
pRsrv);
if(!tmp){
ca_printf("CAS: Unable to keep beacon going\n");
}
}
/*
* casOSSpecificClientInit()
*/
caStatus casOSSpecificClientInit(struct client *client)
{
client->cc.osSpecific.eventQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.eventQLock){
return S_cas_noMemory;
}
client->cc.osSpecific.chanQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.chanQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.putNotifyLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.putNotifyLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.lock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
client->cc.osSpecific.accessRightsQLock = semMCreate(MUTEX_SEM_OPTIONS);
if(!client->cc.osSpecific.accessRightsQLock){
casOSSpecificClientDelete(client);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casOSSpecificClientDelete()
*/
void casOSSpecificClientDelete(struct client *client)
{
int status;
if(client->cc.osSpecific.eventQLock){
status = semDelete(client->cc.osSpecific.eventQLock);
assert(status==OK);
}
if(client->cc.osSpecific.chanQLock){
status = semDelete(client->cc.osSpecific.chanQLock);
assert(status==OK);
}
if(client->cc.osSpecific.putNotifyLock){
status = semDelete(client->cc.osSpecific.putNotifyLock);
assert(status==OK);
}
if(client->cc.osSpecific.lock){
status = semDelete(client->cc.osSpecific.lock);
assert(status==OK);
}
if(client->cc.osSpecific.accessRightsQLock){
status = semDelete(client->cc.osSpecific.accessRightsQLock);
assert(status==OK);
}
}
/*
* caeqOSSpecificInit()
*/
caStatus caeqOSSpecificInit(caEventUser *evuser)
{
evuser->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if(!evuser->osSpecific.lock){
return S_cas_noMemory;
}
evuser->osSpecific.ppendsem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if(!evuser->osSpecific.ppendsem){
semDelete(evuser->osSpecific.lock);
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificDelete()
*/
void caeqOSSpecificDelete(caEventUser *evuser)
{
int status;
if(taskIdVerify(evuser->osSpecific.taskid)==OK){
taskwdRemove(evuser->osSpecific.taskid);
taskDelete(evuser->osSpecific.taskid);
}
status = semDelete(evuser->osSpecific.lock);
assert(status == OK);
status = semDelete(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqOSSpecificPVInit ()
*/
caStatus caeqOSSpecificPVInit (casPVInUse *pPV)
{
pPV->osSpecific.lock = semMCreate(MUTEX_SEM_OPTIONS);
if (!pPV->osSpecific.lock) {
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* caeqOSSpecificPVDelete ()
*/
void caeqOSSpecificPVDelete (casPVInUse *pPV)
{
int status;
status = semDelete (pPV->osSpecific.lock);
assert (status == OK);
}
/*
* caeqOSSpecificEventNotify()
*/
void caeqOSSpecificEventNotify(caEventUser *evuser)
{
int status;
status = semGive(evuser->osSpecific.ppendsem);
assert(status == OK);
}
/*
* caeqStartEvents()
*/
int caeqStartEvents(
struct event_user *evuser,
char *taskname, /* defaulted if NULL */
void (*init_func)(),
int init_func_arg,
int priority_offset
)
{
int status;
int taskpri;
/* only one ca_pend_event thread may be started for each evuser ! */
while(!vxTas(&evuser->osSpecific.pendlck))
return ERROR;
status = taskPriorityGet(taskIdSelf(), &taskpri);
if(status == ERROR){
return ERROR;
}
taskpri += priority_offset;
if(!taskname){
taskname = EVENT_PEND_NAME;
}
status = taskSpawn(
taskname,
taskpri,
EVENT_PEND_OPT,
EVENT_PEND_STACK,
event_task,
(int)evuser,
(int)init_func,
(int)init_func_arg,
0,0,0,0,0,0,0);
if(status == ERROR){
return ERROR;
}
evuser->osSpecific.taskid = status;
return OK;
}
/*
* EVENT_TASK()
*/
LOCAL int event_task(
struct event_user *evuser,
void (*init_func)(int init_func_arg),
int init_func_arg
)
{
int status;
taskwdInsert((int)taskIdCurrent,NULL,NULL);
/* init hook */
if(init_func){
(*init_func)(init_func_arg);
}
/*
* No need to lock getix as I only allow one thread to call this
* routine at a time
*/
while(TRUE){
caeqEventProcess(evuser);
status = semTake(evuser->osSpecific.ppendsem, WAIT_FOREVER);
assert(status == OK);
}
}
/*
* caeqOSSpecificClose()
*/
void caeqOSSpecificClose(caEventUser *pEvUser)
{
return;
}
/*
* asciiIPAddr
*/
void asciiIPAddr (struct in_addr addr, char *pBuf, unsigned bufSize)
{
char pName[INET_ADDR_LEN];
inet_ntoa_b (addr, pName);
strncpy (pBuf, pName, bufSize);
pBuf[bufSize-1] = '\0';
}

View File

@@ -1,256 +0,0 @@
#include <vxWorks.h>
#include <taskLib.h>
#include <errnoLib.h>
#include <logLib.h>
#include <tickLib.h>
#include <sysLib.h>
#include <vxLib.h>
#include <ioLib.h>
#include <usrLib.h>
#include <semLib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sockLib.h> /* for sendto() setsockopt() etc */
#include <netinet/in.h>
#include <netinet/tcp.h>
/*
* EPICS on vxWorks
*/
#include <task_params.h>
#include <taskwd.h>
#include <fdmgr.h>
extern size_t caMaxFreeBlock;
#define MAXFREEBLOCKPOLL 5 /* sec */
#define MAXFREEBLOCKTASKNAME "caMemPoll"
#define MAXFREEBLOCKTASKPRI 255
#define MAXFREEBLOCKTASKOPT (VX_FP_TASK)
#define MAXFREEBLOCKTASKSTACK 4095
/*
* per server locks
* ================
*/
#define LOCK_CLIENTQ(PRSRV) \
{ \
int status; \
status = semTake((PRSRV)->osSpecific.clientQLock, WAIT_FOREVER); \
assert(status==OK); \
}
#define UNLOCK_CLIENTQ(PRSRV) \
{ \
int status; \
status = semGive((PRSRV)->osSpecific.clientQLock); \
assert(status==OK); \
}
#define LOCK_FREE_CHAN_Q(PRSRV) \
{\
int status;\
status = semTake((PRSRV)->osSpecific.freeChanQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_FREE_CHAN_Q(PRSRV) \
{ \
int status;\
status = semGive((PRSRV)->osSpecific.freeChanQLock);\
assert(status==OK);\
}
#define LOCK_FREE_EVENT_Q(PRSRV) \
{\
int status;\
status = semTake((PRSRV)->osSpecific.freeEventQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_FREE_EVENT_Q(PRSRV) \
{ \
int status;\
status = semGive((PRSRV)->osSpecific.freeEventQLock);\
assert(status==OK);\
}
#define LOCK_PVQ(PRSRV) \
{ \
int status; \
status = semTake((PRSRV)->osSpecific.pvQLock, WAIT_FOREVER); \
assert(status==OK); \
}
#define UNLOCK_PVQ(PRSRV) \
{ \
int status;\
status = semGive((PRSRV)->osSpecific.pvQLock);\
assert(status==OK);\
}
/*
* per client locks
* ================
*/
#define SEND_LOCK(CLIENT) \
{\
int status;\
status = semTake((CLIENT)->cc.osSpecific.lock, WAIT_FOREVER);\
assert(status==OK);\
}
#define SEND_UNLOCK(CLIENT) \
{ \
int status;\
status = semGive((CLIENT)->cc.osSpecific.lock);\
assert(status==OK);\
}
#define LOCK_CHAN_Q(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.chanQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_CHAN_Q(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.chanQLock);\
assert(status==OK);\
}
#define LOCK_EVENT_Q(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.eventQLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_EVENT_Q(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.eventQLock);\
assert(status==OK);\
}
#define LOCK_PUT_NOTIFY(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.putNotifyLock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_PUT_NOTIFY(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.putNotifyLock);\
assert(status==OK);\
}
#define LOCK_ACCESS_RIGHTS_Q(PCLIENT) \
{\
int status;\
status = semTake((PCLIENT)->cc.osSpecific.accessRightsQLock, \
WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_ACCESS_RIGHTS_Q(PCLIENT) \
{ \
int status;\
status = semGive((PCLIENT)->cc.osSpecific.accessRightsQLock);\
assert(status==OK);\
}
/*
* event system locks
* ==================
*/
#define CA_EVENT_LOCK(PEVUSER) \
{ \
int status;\
status = semTake((PEVUSER)->osSpecific.lock, WAIT_FOREVER);\
assert(status==OK);\
}
#define CA_EVENT_UNLOCK(PEVUSER) \
{ \
int status;\
status = semGive((PEVUSER)->osSpecific.lock);\
assert(status==OK);\
}
#define LOCK_PV(PPV) \
{ \
int status;\
status = semTake((PPV)->osSpecific.lock, WAIT_FOREVER);\
assert(status==OK);\
}
#define UNLOCK_PV(PPV) \
{ \
int status;\
status = semGive((PPV)->osSpecific.lock);\
assert(status==OK);\
}
/*
* vxWorks specific addition to event_user struct
*/
typedef struct {
SEM_ID lock;
SEM_ID ppendsem;
int taskid;
char pendlck;
}caeqOsSpecific;
typedef struct {
SEM_ID lock;
}caPVOsSpecific;
/*
* vxWorks specific addition to rsrv struct
*/
typedef struct {
fdctx *pfdctx;
SEM_ID clientQLock;
SEM_ID pvQLock;
SEM_ID freeChanQLock;
SEM_ID freeEventQLock;
int selectTask;
}rsrvOsSpecific;
/*
* vxWorks specific addition to client struct
*/
typedef struct {
SEM_ID lock;
SEM_ID putNotifyLock;
SEM_ID chanQLock;
SEM_ID eventQLock;
SEM_ID accessRightsQLock;
fdmgrAlarm *pPutCBAlarm;
unsigned sockSendIOCallbackEnabled:1;
unsigned sockRecvIOCallbackEnabled:1;
}clientOsSpecific;
typedef int SOCKET;
#define SOCKERRNO errno
#define socket_close(S) close(S)
/* vxWorks still has brain dead func proto for ioctl() */
#define socket_ioctl(A,B,C) ioctl(A,B,(int)C)
/* leave task around for debugging if we fail */
#define abort(A) taskSuspend(0)

View File

@@ -259,6 +259,7 @@ gen_rectype:
if(pfldDes->field_type==DBF_NOACCESS) {
char *prtn;
char fldname[5];
char *ptemp;
strcpy(fldname,pfldDes->fldname);
pstr = fldname;
@@ -277,8 +278,21 @@ gen_rectype:
pfldDes->fldname,recordtypeInclude);
break;
}
if(!(pstr = strstr(includeLine,fldname))) continue;
if(isalnum(*(pstr + strlen(fldname)))) continue;
ptemp = &includeLine[0];
while(TRUE) {
if(!ptemp) break;
if(!(pstr = strstr(ptemp,fldname))) {
ptemp = NULL;
break;
}
if(isalnum(*(pstr-1))
|| isalnum(*(pstr + strlen(fldname)))) {
ptemp = pstr + 1;
continue;
}
break;
}
if(!ptemp) continue;
break;
}
if(!prtn) continue;

View File

@@ -29,6 +29,18 @@
*
* History
* $Log$
* Revision 1.4 1996/08/05 19:31:59 jhill
* fixed removes use of iter.cur()
*
* Revision 1.3 1996/07/25 17:58:16 jhill
* fixed missing ref in list decl
*
* Revision 1.2 1996/07/24 22:12:02 jhill
* added remove() to iter class + made node's prev/next private
*
* Revision 1.1.1.1 1996/06/20 22:15:55 jhill
* installed ca server templates
*
*
* NOTES:
* .01 Storage for identifier must persist until an item is deleted
@@ -38,14 +50,20 @@
#ifndef INCresourceLibh
#define INCresourceLibh
#include <tsSLList.h>
#include <limits.h>
#include <string.h>
#include <math.h>
#include <tsSLList.h>
typedef int resLibStatus;
typedef unsigned resTableIndex;
const unsigned resTableIndexBitWidth = (sizeof(resTableIndex)*CHAR_BIT);
//
// class T must derive class ID
//
template <class T, class ID>
class resTable {
public:
@@ -94,14 +112,10 @@ public:
while (pList<&this->pTable[this->hashIdMask+1]) {
tsSLIter<T> iter(*pList);
T *pItem;
T *pNextItem;
pItem = iter();
while (pItem) {
pNextItem = iter();
while ( (pItem = iter()) ) {
iter.remove();
delete pItem;
this->nInUse--;
pItem = pNextItem;
}
pList++;
}
@@ -159,10 +173,10 @@ public:
// T must derive from ID
//
tsSLList<T> &list = this->pTable[this->hash(res)];
tsSLNode<T> *pPrev;
tsSLIter<T> iter(list);
pPrev = this->find(list, res);
if (pPrev) {
this->find(iter, res);
if (iter.current()) {
return -1;
}
list.add(res);
@@ -172,31 +186,25 @@ public:
T *remove (const ID &idIn)
{
tsSLList<T> &list = this->pTable[this->hash(idIn)];
tsSLNode<T> *pPrev;
T *pItem;
tsSLIter<T> iter(this->pTable[this->hash(idIn)]);
T *pCur;
pPrev = this->find(list, idIn);
if (!pPrev) {
return 0;
this->find(iter, idIn);
pCur = iter.current();
if (pCur) {
this->nInUse--;
iter.remove();
}
this->nInUse--;
pItem = pPrev->next();
list.remove(*pItem, *pPrev);
return pItem;
return pCur;
}
T *lookup (const ID &idIn)
{
tsSLList<T> &list = this->pTable[this->hash(idIn)];
tsSLNode<T> *pPrev;
tsSLIter<T> iter(this->pTable[this->hash(idIn)]);
pPrev = this->find(list, idIn);
if (pPrev) {
return pPrev->next();
}
return NULL;
this->find(iter, idIn);
return iter.current();
}
private:
@@ -213,22 +221,25 @@ private:
}
//
// beware - this returns a pointer to the node just prior to the
// the item found on the list
// find
// searches from where the iterator points to the
// end of the list for idIn
//
tsSLNode<T> *find(tsSLList<T> &list, const ID &idIn)
// iterator points to the item found upon return
// (or NULL if nothing matching was found)
//
void find (tsSLIter<T> &iter, const ID &idIn)
{
tsSLIter<T> iter(list);
T *pItem;
ID *pId;
while ( (pItem = iter()) ) {
pId = pItem;
if (*pId == idIn) {
return iter.prev();
break;
}
}
return NULL;
return;
}
};
@@ -242,7 +253,7 @@ private:
//
class uintId {
public:
uintId(unsigned idIn=~0u) : id(idIn) {}
uintId(unsigned idIn=UINT_MAX) : id(idIn) {}
resTableIndex resourceHash(unsigned nBitsId) const
{
@@ -261,7 +272,7 @@ public:
//
return hashid;
}
int operator == (const uintId &idIn)
{
return this->id == idIn.id;
@@ -281,11 +292,15 @@ protected:
template <class ITEM>
class uintRes : public uintId, public tsSLNode<ITEM> {
friend class uintResTable<ITEM>;
public:
uintRes(unsigned idIn=UINT_MAX) : uintId(idIn) {}
};
//
// special resource table which uses
// unsigned integer keys allocated in chronological sequence
//
// NOTE: ITEM must public inherit from uintRes<ITEM>
//
template <class ITEM>
class uintResTable : public resTable<ITEM, uintId> {
@@ -354,17 +369,33 @@ private:
//
class stringId {
public:
stringId (char const * const idIn) : id(idIn) {}
stringId (char const * const idIn) :
pStr(new char [strlen(idIn)+1u])
{
if (this->pStr!=NULL) {
strcpy(this->pStr, idIn);
}
}
~ stringId()
{
if (this->pStr!=NULL) {
delete [] this->pStr;
}
}
resTableIndex resourceHash(unsigned nBitsId) const
{
const char *pStr = this->id;
resTableIndex hashid;
unsigned i;
if (this->pStr==NULL) {
return 0u;
}
hashid = 0u;
for (i=0u; pStr[i]; i++) {
hashid += pStr[i] * (i+1u);
for (i=0u; this->pStr[i]; i++) {
hashid += this->pStr[i] * (i+1u);
}
hashid = hashid % (1u<<nBitsId);
@@ -374,20 +405,25 @@ public:
int operator == (const stringId &idIn)
{
return strcmp(this->id,idIn.id)==0;
if (this->pStr!=NULL && idIn.pStr!=NULL) {
return strcmp(this->pStr,idIn.pStr)==0;
}
else {
return 0u; // not equal
}
}
const char * resourceName()
{
return id;
return this->pStr;
}
void show (unsigned)
{
printf ("resource id = %s\n", id);
printf ("resource id = %s\n", this->pStr);
}
private:
char const * const id;
char * const pStr;
};
#endif // INCresourceLibh

View File

@@ -0,0 +1,7 @@
TOP=../../..
include $(TOP)/config/CONFIG_BASE
include $(TOP)/config/RULES_ARCHS

View File

@@ -0,0 +1,35 @@
TOP = ../../../..
include $(TOP)/config/CONFIG_BASE
SRCS.cc += ../resourceLibTest.cc
SRCS.cc += ../tsDLListBench.cc
SRCS.cc += ../tsDLListTest.cc
SRCS.cc += ../tsSLListBench.cc
SRCS.cc += ../tsSLListTest.cc
TARGETS += buildHere
#TARGETS += resourceLibTest
#TARGETS += tsDLListBench
#TARGETS += tsDLListTest
#TARGETS += tsSLListTest
include $(TOP)/config/RULES.Unix
buildHere: resourceLibTest tsDLListBench tsDLListTest tsSLListBench tsSLListTest
resourceLibTest: resourceLibTest.o
$(LINK.cc) -o $@ $<
tsDLListBench: tsDLListBench.o
$(LINK.cc) -o $@ $<
tsDLListTest: tsDLListTest.o
$(LINK.cc) -o $@ $<
tsSLListBench: tsSLListBench.o
$(LINK.cc) -o $@ $<
tsSLListTest: tsSLListTest.o
$(LINK.cc) -o $@ $<

View File

@@ -5,106 +5,145 @@
#include <stdio.h>
#include <resourceLib.h>
class uintId {
public:
uintId (unsigned idIn) : id(idIn) {}
resourceTableID resourceHash(unsigned nBitsId) const
{
unsigned src = this->id;
resourceTableID hashid;
hashid = src;
src = src >> nBitsId;
while (src) {
hashid = hashid ^ src;
src = src >> nBitsId;
}
//
// the result here is always masked to the
// proper size after it is returned to the resource class
//
return hashid;
}
int operator == (const uintId &idIn)
{
return this->id == idIn.id;
}
private:
unsigned const id;
};
#ifdef SUNOS4
#ifndef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC 1000000
#endif
#endif
class fred : public uintId, tsSLNode<fred> {
public:
fred (const char *pNameIn, unsigned idIn) :
pName(pNameIn), uintId(idIn) {}
void show (unsigned)
{
printf("fred %s\n", pName);
}
private:
const char * const pName;
};
class jane : public stringId, tsSLNode<jane> {
public:
jane (const char *pNameIn) : stringId(pNameIn) {}
};
main()
{
unsigned i;
clock_t start, finish;
double duration;
const int LOOPS = 500000;
resourceTable<fred,uintId> tbl;
fred fred1("fred1",0x1000a432);
fred fred2("fred2",0x0000a432);
fred *pFred;
uintId id1(0x1000a432);
uintId id2(0x0000a432);
int status;
unsigned i;
clock_t start, finish;
double duration;
const int LOOPS = 50000;
resTable<fred,uintId> intTbl;
resTable<jane,stringId> strTbl;
fred fred1("fred1",0x1000a432);
fred fred2("fred2",0x0000a432);
jane jane1("jane1");
jane jane2("jane2");
fred *pFred;
jane *pJane;
uintId uintId1(0x1000a432);
uintId uintId2(0x0000a432);
stringId strId1("jane1");
stringId strId2("jane2");
int status;
status = tbl.init(8);
status = intTbl.init(8);
if (status) {
return -1;
}
status = tbl.add(fred1);
status = intTbl.add(fred1);
assert (!status);
status = tbl.add(fred2);
status = intTbl.add(fred2);
assert (!status);
start = clock();
for(i=0; i<LOOPS; i++){
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id1);
pFred = intTbl.lookup(uintId1);
assert(pFred==&fred1);
pFred = tbl.lookup(id2);
pFred = intTbl.lookup(uintId2);
assert(pFred==&fred2);
}
finish = clock();
duration = finish-start;
duration /= CLOCKS_PER_SEC;
printf("It took %15.10f total sec\n", duration);
printf("It took %15.10f total sec for integer hash lookups\n", duration);
duration /= LOOPS;
duration /= 10;
duration *= 1e6;
printf("It took %15.10f u sec per hash lookup\n", duration);
printf("It took %15.10f u sec per integer hash lookup\n", duration);
tbl.show(10u);
intTbl.show(10u);
tbl.remove(id1);
tbl.remove(id2);
intTbl.remove(uintId1);
intTbl.remove(uintId2);
status = strTbl.init(8);
if (status) {
return -1;
}
status = strTbl.add(jane1);
assert (!status);
status = strTbl.add(jane2);
assert (!status);
start = clock();
for(i=0; i<LOOPS; i++){
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId1);
assert(pJane==&jane1);
pJane = strTbl.lookup(strId2);
assert(pJane==&jane2);
}
finish = clock();
duration = finish-start;
duration /= CLOCKS_PER_SEC;
printf("It took %15.10f total sec for string hash lookups\n", duration);
duration /= LOOPS;
duration /= 10;
duration *= 1e6;
printf("It took %15.10f u sec per string hash lookup\n", duration);
strTbl.show(10u);
strTbl.remove(strId1);
strTbl.remove(strId2);
return 0;
}

View File

@@ -35,9 +35,9 @@ main ()
list.add(*pFred);
list.add(*pFredII);
pFredBack = list.first();
pFredBack = iter();
assert(pFredBack == pFred);
pFredBack = list.last();
pFredBack = iter();
assert(pFredBack == pFredII);
list.remove(*pFred);
list.add(*pFred);
@@ -51,6 +51,7 @@ main ()
list.add(* new fred("C"));
list.add(* new fred("D"));
iter.reset();
while (pFredBack = iter()) {
pFredBack->show();
}

View File

@@ -3,6 +3,7 @@
#include <tsSLList.h>
#include <assert.h>
#include <stdio.h>
#include <time.h>
class fred : public tsSLNode<fred> {

View File

@@ -3,6 +3,7 @@
#include <tsSLList.h>
#include <assert.h>
#include <stdio.h>
class fred : public tsSLNode<fred> {
public:
@@ -34,14 +35,22 @@ main ()
list.add(*pFred);
list.add(*pFredII);
pFredBack = list.first();
pFredBack = iter();
assert(pFredBack == pFredII);
list.remove(*pFred, *pFredII);
list.remove(*pFredII); // removes *pFred !!
list.add(*pFred);
pFredBack = list.get();
assert (pFredBack == pFred);
pFredBack = list.get();
assert (pFredBack == pFredII);
list.add(*pFredII);
list.add(*pFred);
iter.reset();
pFredBack = iter();
iter.remove();
iter.remove();
pFredBack = list.get();
assert (pFredBack == 0);
list.add(*pFred);
list.add(*pFredII);
list.add(* new fred("C"));

View File

@@ -31,6 +31,15 @@
*
* History
* $Log$
* Revision 1.3 1996/07/25 18:01:41 jhill
* use pointer (not ref) for list in iter class
*
* Revision 1.2 1996/07/24 22:12:03 jhill
* added remove() to iter class + made node's prev/next private
*
* Revision 1.1.1.1 1996/06/20 22:15:55 jhill
* installed ca server templates
*
*
*/
@@ -42,6 +51,7 @@
//
template <class T>
class tsDLList {
friend class tsDLIter<T>;
private:
//
// clear()
@@ -59,7 +69,8 @@ public:
}
//
// adds addList to this (and removes all items from addList)
// installs items in addList on the list
// (and removes all items from addList)
//
tsDLList (tsDLList<T> &addList)
{
@@ -67,24 +78,9 @@ public:
addList.clear();
}
//
// first()
//
T *first() const
{
return (T *) this->pFirst;
}
//
// last()
//
T *last() const
{
return (T *) this->pLast;
}
//
// count()
// (returns the number of items on the list)
//
unsigned count() const
{
@@ -93,7 +89,8 @@ public:
//
// add() -
// adds addList to this (and removes all items from addList)
// adds addList to the end of the list
// (and removes all items from addList)
//
void add (tsDLList<T> &addList)
{
@@ -129,7 +126,8 @@ public:
//
// add() - an item
// add()
// (add an item to the end of the list)
//
void add (T &item)
{
@@ -149,24 +147,28 @@ public:
}
//
// insert()
// pItemBefore==0 => make item be the first item on the list
// pItemBefore!=0 => place item in the list immediately after
// pItemBefore
// get ()
//
void insert (T &item, T *pItemBefore=0)
T * get()
{
if (pItemBefore) {
item.tsDLNode<T>::pPrev = pItemBefore;
item.tsDLNode<T>::pNext =
pItemBefore->tsDLNode<T>::pNext;
pItemBefore->tsDLNode<T>::pNext = &item;
}
else {
item.tsDLNode<T>::pPrev = 0;
item.tsDLNode<T>::pNext = this->pFirst;
this->pFirst = &item;
T *pItem = this->pFirst;
if (pItem) {
this->remove (*pItem);
}
return pItem;
}
//
// insertAfter()
// (place item in the list immediately after itemBefore)
//
void insertAfter (T &item, T &itemBefore)
{
item.tsDLNode<T>::pPrev = &itemBefore;
item.tsDLNode<T>::pNext = itemBefore.tsDLNode<T>::pNext;
itemBefore.tsDLNode<T>::pNext = &item;
if (item.tsDLNode<T>::pNext) {
item.tsDLNode<T>::pNext->tsDLNode<T>::pPrev = &item;
@@ -178,6 +180,26 @@ public:
this->itemCount++;
}
//
// insertBefore ()
// (place item in the list immediately before itemAfter)
//
void insertBefore (T &item, T &itemAfter)
{
item.tsDLNode<T>::pNext = &itemAfter;
item.tsDLNode<T>::pPrev = itemAfter.tsDLNode<T>::pPrev;
itemAfter.tsDLNode<T>::pPrev = &item;
if (item.tsDLNode<T>::pPrev) {
item.tsDLNode<T>::pPrev->tsDLNode<T>::pNext = &item;
}
else {
this->pFirst = &item;
}
this->itemCount++;
}
//
// remove ()
//
@@ -202,20 +224,49 @@ public:
this->itemCount--;
}
//
// get ()
//
T * get()
{
T *pItem = this->pFirst;
if (pItem) {
this->remove (*pItem);
}
return pItem;
//
// pop ()
// (returns the first item on the list)
T * pop()
{
return this->get();
}
//
// push ()
// (add an item at the beginning of the list)
//
void push (T &item)
{
item.tsDLNode<T>::pPrev = 0;
item.tsDLNode<T>::pNext = this->pFirst;
if (this->itemCount) {
this->pFirst->tsDLNode<T>::pPrev = &item;
}
else {
this->pLast = &item;
}
this->pFirst = &item;
this->itemCount++;
}
//
// find
// returns -1 if the item isnt on the list
// and the node number (beginning with zero if
// it is)
//
int find(T &item);
T *first(void) const { return pFirst; }
protected:
T *getFirst(void) const { return pFirst; }
T *getLast(void) const { return pLast; }
private:
T *pFirst;
T *pLast;
@@ -232,13 +283,14 @@ friend class tsDLIter<T>;
public:
tsDLNode() : pNext(0), pPrev(0) {}
//
// when someone copies int a class deriving from this
// when someone copies in a class deriving from this
// do _not_ change the node pointers
//
void operator = (tsDLNode<T> &) {}
T *getPrev() {return this->pPrev;}
T *getNext() {return this->pNext;}
protected:
T *getNext(void) { return pNext; }
T *getPrev(void) { return pPrev; }
private:
T *pNext;
T *pPrev;
@@ -251,7 +303,7 @@ template <class T>
class tsDLIter {
public:
tsDLIter(tsDLList<T> &listIn) :
list(listIn), pCurrent(0) {}
pList(&listIn), pCurrent(0) {}
void reset ()
{
@@ -261,7 +313,7 @@ public:
void reset (tsDLList<T> &listIn)
{
this->reset();
this->list = listIn;
this->pList = &listIn;
}
void operator = (tsDLList<T> &listIn)
@@ -269,11 +321,29 @@ public:
this->reset(listIn);
}
T * operator () ()
T * current ()
{
return this->pCurrent;
}
T * prev ()
{
T *pCur = this->pCurrent;
if (pCur==0) {
pCur = this->list.first();
pCur = this->pList->pLast;
}
else {
pCur = pCur->tsDLNode<T>::pPrev;
}
this->pCurrent = pCur;
return pCur;
}
T * next ()
{
T *pCur = this->pCurrent;
if (pCur==0) {
pCur = this->pList->pFirst;
}
else {
pCur = pCur->tsDLNode<T>::pNext;
@@ -281,10 +351,72 @@ public:
this->pCurrent = pCur;
return pCur;
}
T * first()
{
this->pCurrent = this->pList->pFirst;
return this->pCurrent;
}
T * last()
{
this->pCurrent = this->pList->pLast;
return this->pCurrent;
}
T * operator () ()
{
return this->next();
}
//
// remove ()
// remove current item
// (and move current to be the next item
// in the list)
//
void remove ()
{
T *pCur = this->pCurrent;
if (pCur) {
//
// move current to the next item
//
this->next();
//
// delete current item
//
this->pList->remove(*pCur);
}
}
protected:
tsDLList<T> *getList() { return pList; }
private:
tsDLList<T> &list;
tsDLList<T> *pList;
T *pCurrent;
};
//
// find
// returns -1 if the item isnt on the list
// and the node number (beginning with zero if
// it is)
//
template <class T>
inline int tsDLList<T>::find(T &item)
{
tsDLIter<T> iter(*this);
tsDLNode<T> *pItem;
int itemNo=0;
while ( (pItem = iter()) ) {
if (pItem == &item) {
return itemNo;
}
itemNo++;
}
return -1;
}
#endif // tsDLListH_include

View File

@@ -31,6 +31,15 @@
*
* History
* $Log$
* Revision 1.3 1996/07/25 18:01:42 jhill
* use pointer (not ref) for list in iter class
*
* Revision 1.2 1996/07/24 22:12:04 jhill
* added remove() to iter class + made node's prev/next private
*
* Revision 1.1.1.1 1996/06/20 22:15:55 jhill
* installed ca server templates
*
*
*/
@@ -40,15 +49,6 @@
template <class T>
class tsSLList : public tsSLNode<T> {
public:
tsSLList () {}
//
// first()
//
T *first() const
{
return this->tsSLNode<T>::pNext;
}
//
// insert()
@@ -71,12 +71,16 @@ public:
//
// remove ()
// **** removes item after "itemBefore" ****
// (itemBefore might be the list header object and therefore
// will not always be of type T)
//
void remove (T &item, tsSLNode<T> &itemBefore)
void remove (tsSLNode<T> &itemBefore)
{
itemBefore.tsSLNode<T>::pNext = item.tsSLNode<T>::pNext;
T *pItem = itemBefore.tsSLNode<T>::pNext;
if (pItem) {
itemBefore.tsSLNode<T>::pNext = pItem->tsSLNode<T>::pNext;
}
}
//
@@ -85,11 +89,19 @@ public:
T * get()
{
T *pItem = this->tsSLNode<T>::pNext;
if (pItem) {
this->remove(*pItem, *this);
}
this->remove(*this);
return pItem;
}
T * pop()
{
return get();
}
void push(T &item)
{
this->add(item);
}
};
//
@@ -103,12 +115,11 @@ public:
tsSLNode() : pNext(0) {}
//
// when someone copies int a class deriving from this
// when someone copies into a class deriving from this
// do _not_ change the node pointers
//
void operator = (tsSLNode<T> &) {}
T *next() {return this->pNext;}
private:
T *pNext;
};
@@ -116,36 +127,68 @@ private:
template <class T>
class tsSLIter {
public:
tsSLIter(tsSLList<T> &listIn) :
pCurrent(0), pPrevious(0), list(listIn) {}
tsSLIter(tsSLList<T> &listIn) :
pCurrent(0), pPrevious(0), pList(&listIn) {}
void reset()
{
this->pCurrent = 0;
this->pPrevious = 0;
}
void reset (tsSLList<T> &listIn)
{
this->pList = &listIn;
this->reset();
}
void operator = (tsSLList<T> &listIn)
{
list = listIn;
pCurrent = 0;
pPrevious = 0;
this->reset(listIn);
}
T * current ()
{
return this->pCurrent;
}
T * next ()
{
if (this->pCurrent) {
this->pPrevious = this->pCurrent;
}
else {
this->pPrevious = this->pList;
}
this->pCurrent = this->pPrevious->pNext;
return this->pCurrent;
}
// this should move current?
//tsSLNode<T> * prev () const
//{
// return this->pPrevious;
//}
T * operator () ()
{
tsSLNode<T> *pPrev = this->pCurrent;
T *pCur;
if (pPrev==0) {
pPrev = &this->list;
}
this->pPrevious = pPrev;
pCur = pPrev->pNext;
this->pCurrent = pCur;
return pCur;
return this->next();
}
tsSLNode<T> * prev () const
//
// remove current node
//
void remove ()
{
return this->pPrevious;
if (this->pCurrent) {
this->pCurrent =
this->pCurrent->tsSLNode<T>::pNext;
this->pPrevious->pNext = this->pCurrent;
}
}
private:
T *pCurrent;
tsSLNode<T> *pPrevious;
tsSLList<T> &list;
tsSLList<T> *pList;
};

Some files were not shown because too many files have changed in this diff Show More