Feature #220
openFeature #78: Output system improvements
Support #include in output definition files
Description
Allow including other files in output definition files via #include directives. In this way, one can create "master" output definitions that care composed of smaller definition files specific to individual detectors and spectrometers.
Updated by Ole Hansen over 7 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 20
Updated by Ole Hansen over 7 years ago
- % Done changed from 20 to 80
Added preliminary support for #include in odef files. Commit 8c87c95 in hansenjo/analyzer.
Still needs testing. Also, include path is not supported yet.
Updated by Ole Hansen over 7 years ago
- Status changed from In Progress to Closed
- % Done changed from 80 to 100
Tested #include functionality & tweaked error messages. Working version is in commit b9df86c on hansenjo/removing-vfrom branch
Updated by Ole Hansen over 7 years ago
- Status changed from Closed to In Progress
- % Done changed from 100 to 60
I guess I closed this prematurely. Still to do:
- Prevent infinite recursion if a file refers to a previously included file. In C++, we can use guard definitions. But we don't have logicals yet, and defining macros isn't on the to-do list and would get too complex. Could we use the C preprocessor to handle all this?
- Support searching an include path via an environment variable
Updated by Ole Hansen over 7 years ago
- % Done changed from 60 to 70
Add support for searching various directories for files given in #include statements. The directories are specified as colon-separated strings in the $ANALYZER_CONFIGPATH environment variable, similar to $PATH.
In addition, direct expansion of environment variables in the #include file name is supported, so one can specify things like
#include "$LHRS/variables.odef" #include "$RHRS/variables.odef"
Updated by Ole Hansen about 7 years ago
Added a backport of this feature to the master branch (commit 8ed3305
) on 8/30/2017.
- Protect against infinite recursion, include loops
- Add #include capability to cut definition files
Updated by Ole Hansen almost 7 years ago
- % Done changed from 70 to 80
Added support for #include in cut definition files. To avoid duplicating code, I moved the support functions GetIncludeFileName
and CheckIncludeFilePath
into new files, FileInclude.[Ch]
.