Subject: |
R3.12 Environment Parameter system |
From: |
Andrew Johnson <[email protected]> |
Date: |
Thu, 2 Mar 1995 20:51:09 GMT |
The Environment Parameter system appears to be very poorly, if not actually
broken in R3.12 (well, it was in Beta1). Here's what I think it looks like:
base/include/envDefs.h Declares parameters & defaults
base/src/misc/epicsEnvParams.h Some IOC-only defaults
base/src/misc/epicsEnvParams.c More IOC defaults, some IOC code
base/src/libCom/envSubr.c IOC + host code
resource.def Overrides for IOC
setenv ... Overrides for Host tools
If you have different default settings in envDefs.h and epicsEnvParams.h, the
IOC uses the ones in epicsEnvParams.h but the host tools the ones in envDefs.h.
This is not much use for network stuff, where you need the same port numbers at
both ends for it to work (has the log server port number been fixed? In Beta1
the envDefs.h and epicsEnvParams.c files gave different port numbers). The
epicsPrtEnvParams routine should either print *all* env parameters, or just the
ones which affect the IOC in some way (why IOC_LOG_FILE_LIMIT ???).
Having this multiplicity of files also makes adding a new variable a bit of a
pain. It would be nice to have *all* these defaults in one place, and I think
they should go in the config directory so any site changes only need to happen
there. Here's what I suggest:
1. Remove epicsEnvParams.c from miscLib, and put a revised version of
epicsPrtEnvParams() into envSubr.c within a #ifdef vxWorks section.
2. Throw out epicsEnvParams.h completely.
3. Remove the default settings from envDefs.h
4. Add a file config/epicsEnvDefaults.h containing all defaults, which is
#included by envDefs.h when ENV_PRIVATE_DATA is defined, ie in envSubr.c only.
This way, there is only one location for defaults, and only two places which
need to be changed to add a new environment parameter. I guess it would be
possible to reduce that to one place, but I think it makes more sense to keep
the declaration separate from the default. I'd probably have the defaults as
CPP symbols (DEFAULT_...), and maybe have a CPP macro to declare the ENV_PARAM
structures to make the thing a bit cleaner and more readable.
Does anyone have any comments on this? I'm happy to do the work if it is
thought worthwhile.
- Andrew
,_}\_. Andrew Johnson, Technology Division
/ \ Royal Greenwich Observatory
~~~~~~~| ,--/;. )~~~~ Madingley Road, Cambridge, UK
., |/ (/ U Phone: +44 (0)1223 374823
.`., /_\ . . Email: [email protected]
wwWWWww' WWW: http://www.ast.cam.ac.uk/~anj/
- Navigate by Date:
- Prev:
[none given] Bill McDowell
- Next:
Re: R3.12 Environment Parameter system Marty Kraimer
- Index:
1994
<1995>
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Security Toolkit Ian Foster
- Next:
Re: R3.12 Environment Parameter system Marty Kraimer
- Index:
1994
<1995>
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|