libexplain  1.4.D001
Functions | Variables
libexplain/output/stderr.c File Reference
#include <libexplain/ac/stdlib.h>
#include <libexplain/output/stderr.h>
#include <libexplain/wrap_and_print.h>

Go to the source code of this file.

Functions

static void message (explain_output_t *op, const char *text)
explain_output_texplain_output_stderr_new (void)

Variables

static const
explain_output_vtable_t 
vtable
explain_output_t explain_output_static_stderr = { &vtable, 0 }

Function Documentation

The explain_output_stderr_new function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to stderr, and exits via exit(2);

This is the default output handler.

Long error messages will be wrapped to fit the size of the current terminal line.

You can select whether or not the second and subsequent lines of wrapped error messages are indented.

  • calling the explain_option_hanging_indent_set function at the beginning of main(); or,
  • setting the EXPLAIN_OPTIONS environment variable, setting the "hanging-indent=N" option; or,
  • the default is not to indent the second and subsequent lines of wrapped error messages.

The above list is in order of highest precedence to lowest. A hanging indent of zero means "no indent".

Returns:
NULL on error (i.e. malloc failed), or a pointer to a new dynamically allocated instance of the stderrr class.

Definition at line 55 of file stderr.c.

static void message ( explain_output_t op,
const char *  text 
) [static]

Definition at line 27 of file stderr.c.


Variable Documentation

Definition at line 51 of file stderr.c.

Initial value:
{
    0, 
    message,
    0, 
    sizeof(explain_output_t)
}

Definition at line 42 of file stderr.c.