Project

General

Profile

Actions

Feature #220

open

Feature #78: Output system improvements

Support #include in output definition files

Added by Ole Hansen over 5 years ago. Updated almost 5 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Target version:
Start date:
Due date:
% Done:

80%

Estimated time:
8.00 h
Spent time:
Responsible:

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.

Actions #1

Updated by Ole Hansen over 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 20
Actions #2

Updated by Ole Hansen over 5 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.

Actions #3

Updated by Ole Hansen over 5 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

Actions #4

Updated by Ole Hansen over 5 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
Actions #5

Updated by Ole Hansen over 5 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" 

Actions #6

Updated by Ole Hansen about 5 years ago

Added a backport of this feature to the master branch (commit 8ed3305) on 8/30/2017.

Still to do:
  • Protect against infinite recursion, include loops
  • Add #include capability to cut definition files
Actions #7

Updated by Ole Hansen about 5 years ago

  • Target version changed from 1.6 to 1.7
Actions #8

Updated by Ole Hansen almost 5 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].

Actions

Also available in: Atom PDF