c-hash-eval - Evaluate C/C++ #defines
c-hash-del - Remove C/C++ #define evaluation
c-hash-set-define - Set a C/C++ #define
c-hash-unset-define - Unset a C/C++ #define
n c-hash-eval
c-hash-del
c-hash-set-define "variable" "value"
c-hash-unset-define "variable"
c-hash-eval evaluates C/C++ '#' lines, hiding sections of code which have been 'hashed' out. c-hash-eval evaluates the following '#' lines:-
#define <variable> ....
#ifdef <variable>
#if ...
#else
#endif
For #defines c-hash-eval creates a user variable "%cd<variable>", setting it to the value found. For #ifdef a simple check for the existence of variable "%cd<variable>" is made. If defined then code between the #ifdef and either its matching #else or #endif is displayed and code between the #else and #endif is hidden. If it is not defined then the reverse happens.
The state of #if's are evaluated using calc(3), the following code is then displayed as for #ifdef.
Code is hidden by setting the $line-scheme(5) to a color similar to the back-ground. If an argument is given to the command the code is also narrowed out using narrow-buffer(2).
c-hash-del undoes the effect of c-hash-eval by restores hidden code.
c-hash-set-define and c-hash-unset-define can be used to manually set and unset #define variables.
c-hash-eval, c-hash-del, c-hash-set-define and c-hash-unset-define are macros defined in cmacros.emf.
Executing c-hash-eval in a project header file (h file) which contains all used #define definitions will set up all #define variables ready for the main C files.
(c) Copyright JASSPA 1999
Last Modified: 1998/08/05
Generated On: 1999/12/01