| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#include <common.h> |
| 23 |
#include <file_stream.h> |
| 24 |
#include <types.h> |
| 25 |
|
| 26 |
#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) |
| 27 |
#include <stdlib.h> |
| 28 |
#endif |
| 29 |
|
| 30 |
#include "libcfile_libcerror.h" |
| 31 |
#include "libcfile_libcnotify.h" |
| 32 |
#include "libcfile_notify.h" |
| 33 |
|
| 34 |
#if !defined( HAVE_LOCAL_LIBCFILE ) |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
void libcfile_notify_set_verbose( |
| 39 |
int verbose ) |
| 40 |
{ |
| 41 |
libcnotify_verbose_set( |
| 42 |
verbose ); |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
int libcfile_notify_set_stream( |
| 49 |
FILE *stream, |
| 50 |
libcerror_error_t **error ) |
| 51 |
{ |
| 52 |
static char *function = "libcfile_notify_set_stream"; |
| 53 |
|
| 54 |
if( libcnotify_stream_set( |
| 55 |
stream, |
| 56 |
error ) != 1 ) |
| 57 |
{ |
| 58 |
libcerror_error_set( |
| 59 |
error, |
| 60 |
LIBCERROR_ERROR_DOMAIN_RUNTIME, |
| 61 |
LIBCERROR_RUNTIME_ERROR_SET_FAILED, |
| 62 |
"%s: unable to set stream.", |
| 63 |
function ); |
| 64 |
|
| 65 |
return( -1 ); |
| 66 |
} |
| 67 |
return( 1 ); |
| 68 |
} |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
int libcfile_notify_stream_open( |
| 75 |
const char *filename, |
| 76 |
libcerror_error_t **error ) |
| 77 |
{ |
| 78 |
static char *function = "libcfile_notify_stream_open"; |
| 79 |
|
| 80 |
if( libcnotify_stream_open( |
| 81 |
filename, |
| 82 |
error ) != 1 ) |
| 83 |
{ |
| 84 |
libcerror_error_set( |
| 85 |
error, |
| 86 |
LIBCERROR_ERROR_DOMAIN_IO, |
| 87 |
LIBCERROR_IO_ERROR_OPEN_FAILED, |
| 88 |
"%s: unable to open stream.", |
| 89 |
function ); |
| 90 |
|
| 91 |
return( -1 ); |
| 92 |
} |
| 93 |
return( 1 ); |
| 94 |
} |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
int libcfile_notify_stream_close( |
| 100 |
libcerror_error_t **error ) |
| 101 |
{ |
| 102 |
static char *function = "libcfile_notify_stream_close"; |
| 103 |
|
| 104 |
if( libcnotify_stream_close( |
| 105 |
error ) != 0 ) |
| 106 |
{ |
| 107 |
libcerror_error_set( |
| 108 |
error, |
| 109 |
LIBCERROR_ERROR_DOMAIN_IO, |
| 110 |
LIBCERROR_IO_ERROR_OPEN_FAILED, |
| 111 |
"%s: unable to open stream.", |
| 112 |
function ); |
| 113 |
|
| 114 |
return( -1 ); |
| 115 |
} |
| 116 |
return( 0 ); |
| 117 |
} |
| 118 |
|
| 119 |
#endif |
| 120 |
|