Tasks related to generating output
The module StringOut provides a possibility of processing the output
associated to a PTG node structure recursively into a string buffer. The buffer is
maintained by calls to Obstack -module-functions. The module PtgOutput is used
to coordinate overrides of the PTG output functions.
This module supplies two C functions:
char *PTG_StringOut(PTGNode root);
- Takes the root to a PTG node structure as argument. Invokes the PTG printing functions and
processes the output into an automatically allocated and growing string buffer.
Upon termination, a pointer to to the start of this buffer is returned.
void FreeStringOut();
- Invocations of the
PTG_StringOut() function can consume quite a lot of memory. It
is possible, that at some time, the string buffers created by this functions are no longer
needed. The memory consumed by this buffers can be returned to the system by an invocation
of the FreeStringOut() function. Please note, that this function frees the space used
by all invocations of PTG_StringOut() together.
Additional information about this module and it's implementation can be
obtained by the derivation
$elipkg/Output/StringOut.fw :fwTexinfo :display
Usage of Module
To include this module into your specification, simply add the following line to one of
your `.specs'-files:
$/Output/StringOut.fw
Restrictions
This module can be included to a specification together with other
applications of the
PtgOutput module functions,
e.g. PrettyPrint and BlockPrint . By doing
so, it is possible to pretty print a PTG node structure into a file or to
process it into a string buffer.
A combination, for example to pretty print a PTG node
structure into character buffer, is not possible.
|