| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#if !defined( _LIBCERROR_INTERNAL_ERROR_H ) |
| 23 |
#define _LIBCERROR_INTERNAL_ERROR_H |
| 24 |
|
| 25 |
#include <common.h> |
| 26 |
#include <types.h> |
| 27 |
|
| 28 |
#include <stdio.h> |
| 29 |
|
| 30 |
#include "libcerror_extern.h" |
| 31 |
#include "libcerror_types.h" |
| 32 |
|
| 33 |
#if defined( __cplusplus ) |
| 34 |
extern "C" { |
| 35 |
#endif |
| 36 |
|
| 37 |
typedef struct libcerror_internal_error libcerror_internal_error_t; |
| 38 |
|
| 39 |
struct libcerror_internal_error |
| 40 |
{ |
| 41 |
|
| 42 |
|
| 43 |
int domain; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
int code; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
int number_of_messages; |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
system_character_t **messages; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
size_t *sizes; |
| 61 |
}; |
| 62 |
|
| 63 |
int libcerror_error_initialize( |
| 64 |
libcerror_error_t **error, |
| 65 |
int error_domain, |
| 66 |
int error_code ); |
| 67 |
|
| 68 |
LIBCERROR_EXTERN \ |
| 69 |
void libcerror_error_free( |
| 70 |
libcerror_error_t **error ); |
| 71 |
|
| 72 |
int libcerror_error_resize( |
| 73 |
libcerror_internal_error_t *internal_error ); |
| 74 |
|
| 75 |
#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) |
| 76 |
|
| 77 |
void libcerror_error_get_system_format_string( |
| 78 |
const char *format_string, |
| 79 |
size_t format_string_length, |
| 80 |
system_character_t **system_format_string ); |
| 81 |
|
| 82 |
#endif |
| 83 |
|
| 84 |
LIBCERROR_EXTERN \ |
| 85 |
void libcerror_error_set( |
| 86 |
libcerror_error_t **error, |
| 87 |
int error_domain, |
| 88 |
int error_code, |
| 89 |
const char *format_string, |
| 90 |
... ); |
| 91 |
|
| 92 |
LIBCERROR_EXTERN \ |
| 93 |
int libcerror_error_matches( |
| 94 |
libcerror_error_t *error, |
| 95 |
int error_domain, |
| 96 |
int error_code ); |
| 97 |
|
| 98 |
LIBCERROR_EXTERN \ |
| 99 |
int libcerror_error_fprint( |
| 100 |
libcerror_error_t *error, |
| 101 |
FILE *stream ); |
| 102 |
|
| 103 |
LIBCERROR_EXTERN \ |
| 104 |
int libcerror_error_sprint( |
| 105 |
libcerror_error_t *error, |
| 106 |
char *string, |
| 107 |
size_t size ); |
| 108 |
|
| 109 |
LIBCERROR_EXTERN \ |
| 110 |
int libcerror_error_backtrace_fprint( |
| 111 |
libcerror_error_t *error, |
| 112 |
FILE *stream ); |
| 113 |
|
| 114 |
LIBCERROR_EXTERN \ |
| 115 |
int libcerror_error_backtrace_sprint( |
| 116 |
libcerror_error_t *error, |
| 117 |
char *string, |
| 118 |
size_t size ); |
| 119 |
|
| 120 |
#if defined( __cplusplus ) |
| 121 |
} |
| 122 |
#endif |
| 123 |
|
| 124 |
#endif |
| 125 |
|