Text Output

Rather than using the standard UNIX function printf for routine text output, a module which is similar in appearance is provided, which allows for installing arbitrary printing output functions. This can be used, for instance, to mirror output to a log file for instance, or to send text to an X window. The primary change is to use a function called print or print_error with exactly the same arguments as for the standard printf function.

public  void  print( STRING format, ... )
public  void  print_error( STRING format, ... )

Takes the same arguments as printf(), but allows installing of a user output function for the final stage of output.

public  void  set_print_function(
    void     (*function) ( STRING ) )
public  void  set_print_error_function(
    void     (*function) ( STRING )

Sets the output function, where all text from calls to print() or print_error will be sent. By default, there is no print function, and output is sent to printf().

public  void  push_print_function()
public  void  push_print_error_function()

Temporarily sets the print or error printing function to go to standard out, and allows the user to set another print function, which will disappear when the corresponding pop function is called.

public  void  pop_print_function()
public  void  pop_print_error_function()

Restores the previous user print or error printing function.