1-48 SOMobjects Base Toolkit: Programmer’s Reference Manual
SOMOutCharRoutine Function
Purpose
Prints a character. This function is replaceable.
Syntax
int (*SOMOutCharRoutine) (char c);
Description
SOMOutCharRoutine is a replaceable character output routine. It is invoked by SOM
whenever a character is generated by one of the SOM error-handling or debugging macros.
The default implementation outputs the specified character to stdout. To change the
destination of character output, store the address of a user-written character output routine
in global variable SOMOutCharRoutine.
Another function, somSetOutChar, may be preferred over the SOMOutCharRoutine
function. The somSetOutChar function enables each application (or thread) to have a
customized character output routine.
Parameters
c The character to be output.
Return Value
Returns 0 if an error occurs and 1 otherwise.
Example
#include <som.h>
#pragma linkage(myCharacterOutputRoutine, system)
/* Define a replacement routine: */
int SOMLINK myCharacterOutputRoutine (char c)
{
(Customized code goes here)
}
...
/* After the next stmt all output */
/* will be sent to the new routine */
SOMOutCharRoutine = myCharacterOutputRoutine;
Related Information
Functions: somVprintf, somPrefixLevel, somLPrintf, somPrintf, somSetOutChar
Kommentare zu diesen Handbüchern