STDIN/STDOUT/STDERR

All,

How would one be able to represent stdin/stdout/stderr in llvm (using the api) for use in functions such as fputs?

One could use the external function fdopen to generate the FILE* and store it in a global variable, but I would be willing to guess that there is a more efficient way.

Thanks,
Billy Moses

How would one be able to represent stdin/stdout/stderr in llvm (using the
api) for use in functions such as fputs?

stdin / stdout / stderr are macros on many systems and expand either to
separate pointers or members of a single global array. The only way that
will work in general is to use stdio.h.

One could use the external function fdopen to generate the FILE* and store
it in a global variable, but I would be willing to guess that there is a
more efficient way.

fdopen will not give you another reference to the pre-defined streams,
but a separate FILE object with its own buffer etc.

Joerg