NAME

C::Template - Template toolkit for C.

SYNOPSIS

my $ct = C::Template->new ();
$ct->process ("x.c.tmpl", \%vars, "x.c");

DESCRIPTION

This module is a wrapper around Template which adds two filters, c and cpc.

METHODS

new

my $ct = C::Template->new ();

Create a new object. This incorporates a Template object. To change the include path,

my $ct = C::Template->new ({include_path => '/path/to/include/files'});

process

$ct->process ('input-template', \%vars, 'output');

This processes input-template into output. output is normally a C file.

FILTERS

c

The c filter changes its input into a C string. Percentage signs '%' are not changed.

cpc

The cpc filter changes its input into a C string. Percentage signs are changed from '%' to '%%' so that the string can be used as the format argument for printf-style functions without interpolation of arguments.

BUGS

AUTHOR

Ben Bullock, <bkb@cpan.org>

COPYRIGHT AND LICENCE

Same as Perl.