[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.7 Redirecting Output

AutoGen provides a means for redirecting the template output to different files or, in ‘M4’ parlance, to various diversions. It is accomplished by providing a set of Scheme functions named out-* (see section AutoGen Scheme Functions).

out-push-new (see section out-push-new’ - purge and create output file)

This allows you to logically "push" output files onto a stack. If you supply a string name, then a file by that name is created to hold the output. If you do not supply a name, then the text is written to a scratch pad and retrieved by passing a #t argument to the out-pop (see section out-pop’ - close current output file) function.

out-pop (see section out-pop’ - close current output file)

This function closes the current output file and resumes output to the next one in the stack. At least one output must have been pushed onto the output stack with the out-push-new (see section out-push-new’ - purge and create output file) function. If #t is passed in as an argument, then the entire contents of the diversion (or file) is returned.

out-suspend (see section out-suspend’ - suspend current output file)

This function does not close the current output, but instead sets it aside for resumption by the given name with out-resume. The current output must have been pushed on the output queue with out-push-new (see section out-push-new’ - purge and create output file).

out-resume (see section out-resume’ - resume suspended output file)

This will put a named file descriptor back onto the top of stack so that it becomes the current output again.

out-switch (see section out-switch’ - close and create new output)

This closes the current output and creates a new file, purging any preexisting one. This is a shortcut for "pop" followed by "push", but this can also be done at the base level.

out-move (see section out-move’ - change name of output file)

Renames the current output file without closing it.

There are also several functions for determining the output status. See section AutoGen Scheme Functions.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Bruce Korb on August 30, 2014 using texi2html 1.82.