# c-hash-eval(3)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

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

## SYNOPSIS

n c-hash-eval
c-hash-del
c-hash-set-define "variable" "value"
c-hash-unset-define "variable"

## DESCRIPTION

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 `#define`s 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.

## NOTES

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.

## SEE ALSO

calc(3), $line-scheme(5), narrow-buffer(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>