src/bft/bft_error.c File Reference

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
bft_error.c File Reference
`#include "cs_defs.h"`
`#include <assert.h>`
`#include <stdarg.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "bft_printf.h"`
`#include "bft_error.h"`
Include dependency graph for bft_error.c:

## Functions
void | bft_error (const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
| Calls the error handler (set by bft_error_handler_set() or default). More...
bft_error_handler_t * | bft_error_handler_get (void)
| Returns the error handler associated with the bft_error() function. More...
void | bft_error_handler_set (bft_error_handler_t *const handler)
| Associates an error handler with the bft_error() function. More...

## Function Documentation

void bft_error | ( | const char *const | file_name,
|  | const int | line_num,
|  | const int | sys_error_code,
|  | const char *const | format,
|  |  | ...
| ) |  |

Calls the error handler (set by bft_error_handler_set() or default).

With the default error handler, bft_print_flush() is called, an error message is output to stderr, and the current process exits with an EXIT_FAILURE code.

Parameters

  [in] | file_name | name of source file from which error handler called.
  [in] | line_num | line of source file from which error handler called.
  [in] | sys_error_code | error code if error in system or libc call, 0 otherwise.
  [in] | format | format string, as printf() and family.
  [in] | ... | variable arguments based on format string.

bft_error_handler_t* bft_error_handler_get | ( | void |  | ) |

Returns the error handler associated with the bft_error() function.

Returns
  pointer to the error handler function.

void bft_error_handler_set | ( | bft_error_handler_t *const | handler | ) |

Associates an error handler with the bft_error() function.

Parameters

  [in] | handler | pointer to the error handler function.