TEMU  2
The Terma Emulator
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Console.h File Reference

Go to the source code of this file.

Functions

int temu_printf (const char *Fmt,...) __attribute__((format(printf
 
int int temu_printerr (const char *Fmt,...) __attribute__((format(printf
 

Function Documentation

int int temu_printerr ( const char *  Fmt,
  ... 
)

fprintf(stderr, ...) wrapper. The function prints a formatted message to what TEMU considers to be the standard error. This function respects internal rerouting rules. Unlike plain fprintf, which writes to an explicit file.

The function is limited in that it keeps a local fixed length buffer for printing. This buffer is currently 1024 bytes, hence it is not possible to print messages longer than 1023 bytes.

Returns
Number of bytes written
int temu_printf ( const char *  Fmt,
  ... 
)

TEMU maintains three different print I/O systems. The logging system is for logging messages that models generates. The Loggin system is defined in temu-c/Support/Logging.h. Logging is categorised and support a number of severity levels.

The diagnostic I/O is similar to logging, but is more tailored for diagnostics stemming from internal parsers. Diagnostics include a file name and line+column number.

The third type of I/O is the out and err streams. These are essentially directly mapped to stdout and stderr, but TEMU can internally remap these in order to e.g. route or clone I/O to separate files. The I/O streams functions exist primarily to replace printf/cout/cerr and enable programattic rerouting of console i/o.

Printf wrapper. The function prints a formatted message to what TEMU considers to be the standard output. This function respects internal rerouting rules. Unlike plain printf, which writes only to stdout.

The function is limited in that it keeps a local fixed length buffer for printing. This buffer is 1024 bytes, hence it is not possible to print messages longer than 1023 bytes.

Returns
Number of bytes written