DECLARE(3)

Table of Contents

Name

declare declarations for the generation of a product

Synopsis

%declare
C code declarations and procedures

Description

The %declare section of a product description file contains a set of C declarations and procedures that are added to the generated GEN_x.c file, where x is the option character that selects the product. The C code in the precode, postcode, template and proc sections has access to these declarations. Use the static attribute on declarations to avoid conflicts with names defined in the source description declare section. The declarations in the product description declare section are local to GEN_x.c; identifiers that must be shared across more that one product description file should be placed in the source description header section.

Example

The following product description
%declare
static int count;

%precode
count = 0;

%template
%forall f:AFILE %loop
File %(itoa(++count)) is %(tok(f))
%end-loop

would produce output like:
File 1 is alpha
File 2 is beta
File 3 is ...

See Also

HEADER(2)
DECLARE(2)
PRECODE(3)
POSTCODE(3)
PROC(3)
TEMPLATE(3)
GEN_x(5)


© 1990 Lucent Technologies, Inc
© 1998 Harmony Software, Inc