The process of creating a Channel is straightforward. As you might expect, it uses the constructor function astChannel:
#include "ast.h" AstChannel *channel; ... channel = astChannel( NULL, NULL, "" );
The first two arguments to astChannel specify the external source and
sink that the Channel is to use. There arguments are pointers to C
functions and we will examine their use in more detail later
( and
).
In this very simple example we have supplied NULL pointers for both the source and sink functions. This requests the default behaviour, which means that textual input will be read from the program's standard input stream (typically, this means your keyboard) while textual output will go to the standard output stream (typically appearing on your screen). On UNIX systems, of course, either of these streams can easily be redirected to files.
AST A Library for Handling World Coordinate Systems in Astronomy