File: libcerror_definitions.h

package info (click to toggle)
libbfio 20140105-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,800 kB
  • ctags: 2,962
  • sloc: ansic: 95,778; sh: 11,974; makefile: 714; sed: 16
file content (323 lines) | stat: -rw-r--r-- 7,489 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
/*
 * The internal definitions
 *
 * Copyright (c) 2008-2014, Joachim Metz <joachim.metz@gmail.com>
 *
 * Refer to AUTHORS for acknowledgements.
 *
 * This software is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this software.  If not, see <http://www.gnu.org/licenses/>.
 */

#if !defined( LIBCERROR_INTERNAL_DEFINITIONS_H )
#define LIBCERROR_INTERNAL_DEFINITIONS_H

#include <common.h>
#include <types.h>

/* Define HAVE_LOCAL_LIBCERROR for local use of libcerror
 */
#if !defined( HAVE_LOCAL_LIBCERROR )
#include <libcerror/definitions.h>

/* The definitions in <libcerror/definitions.h> are copied here
 * for local use of libcerror
 */
#else

#define LIBCERROR_VERSION				20140105

/* The libcstring version string
 */
#define LIBCERROR_VERSION_STRING			"20140105"

/* The error domains
 */
enum LIBCERROR_ERROR_DOMAINS
{
	LIBCERROR_ERROR_DOMAIN_ARGUMENTS		= (int) 'a',
	LIBCERROR_ERROR_DOMAIN_CONVERSION		= (int) 'c',
	LIBCERROR_ERROR_DOMAIN_COMPRESSION		= (int) 'C',
	LIBCERROR_ERROR_DOMAIN_ENCRYPTION		= (int) 'E',
	LIBCERROR_ERROR_DOMAIN_IO			= (int) 'I',
	LIBCERROR_ERROR_DOMAIN_INPUT			= (int) 'i',
	LIBCERROR_ERROR_DOMAIN_MEMORY			= (int) 'm',
	LIBCERROR_ERROR_DOMAIN_OUTPUT			= (int) 'o',
	LIBCERROR_ERROR_DOMAIN_RUNTIME			= (int) 'r',
};

/* The argument error codes
 * to signify errors regarding arguments passed to a function
 */
enum LIBCERROR_ARGUMENT_ERROR
{
	LIBCERROR_ARGUMENT_ERROR_GENERIC		= 0,

	/* The argument contains an invalid value
	 */
	LIBCERROR_ARGUMENT_ERROR_INVALID_VALUE		= 1,

	/* The argument contains a value less than zero
	 */
	LIBCERROR_ARGUMENT_ERROR_VALUE_LESS_THAN_ZERO	= 2,

	/* The argument contains a value zero or less
	 */
	LIBCERROR_ARGUMENT_ERROR_VALUE_ZERO_OR_LESS	= 3,

	/* The argument contains a value that exceeds the maximum
	 * for the specific type
	 */
	LIBCERROR_ARGUMENT_ERROR_VALUE_EXCEEDS_MAXIMUM	= 4,

	/* The argument contains a value that is too small
	 */
	LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_SMALL	= 5,

	/* The argument contains a value that is too large
	 */
	LIBCERROR_ARGUMENT_ERROR_VALUE_TOO_LARGE	= 6,

	/* The argument contains a value that is out of bound
	 */
	LIBCERROR_ARGUMENT_ERROR_VALUE_OUT_OF_BOUNDS	= 7,

	/* The argument contains a value that is not supported
	 */
	LIBCERROR_ARGUMENT_ERROR_UNSUPPORTED_VALUE	= 8,

	/* The argument contains a value that conficts with another argument
	 */
	LIBCERROR_ARGUMENT_ERROR_CONFLICTING_VALUE	= 9
};

/* The conversion error codes
 * to signify errors regarding conversions
 */
enum LIBCERROR_CONVERSION_ERROR
{
	LIBCERROR_CONVERSION_ERROR_GENERIC		= 0,

	/* The conversion failed on the input
	 */
	LIBCERROR_CONVERSION_ERROR_INPUT_FAILED		= 1,

	/* The conversion failed on the output
	 */
	LIBCERROR_CONVERSION_ERROR_OUTPUT_FAILED	= 2
};

/* The compression error codes
 * to signify errors regarding compression
 */
enum LIBCERROR_COMPRESSION_ERROR
{
	LIBCERROR_COMPRESSION_ERROR_GENERIC		= 0,

	/* The compression failed
	 */
	LIBCERROR_COMPRESSION_ERROR_COMPRESS_FAILED	= 1,

	/* The decompression failed
	 */
	LIBCERROR_COMPRESSION_ERROR_DECOMPRESS_FAILED	= 2
};

/* The encryption error codes
 * to signify errors regarding encryption
 */
enum LIBCERROR_ENCRYPTION_ERROR
{
	LIBCERROR_ENCRYPTION_ERROR_GENERIC		= 0,

	/* The encryption failed
	 */
	LIBCERROR_ENCRYPTION_ERROR_ENCRYPT_FAILED	= 1,

	/* The decryption failed
	 */
	LIBCERROR_ENCRYPTION_ERROR_DECRYPT_FAILED	= 2
};

/* The input/output error codes
 * to signify errors regarding input/output
 */
enum LIBCERROR_IO_ERROR
{
	LIBCERROR_IO_ERROR_GENERIC			= 0,

	/* The open failed
	 */
	LIBCERROR_IO_ERROR_OPEN_FAILED			= 1,

	/* The close failed
	 */
	LIBCERROR_IO_ERROR_CLOSE_FAILED			= 2,

	/* The seek failed
	 */
	LIBCERROR_IO_ERROR_SEEK_FAILED			= 3,

	/* The read failed
	 */
	LIBCERROR_IO_ERROR_READ_FAILED			= 4,

	/* The write failed
	 */
	LIBCERROR_IO_ERROR_WRITE_FAILED			= 5,

	/* Access denied
	 */
	LIBCERROR_IO_ERROR_ACCESS_DENIED		= 6,

	/* The resource is invalid i.e. a missing file
	 */
	LIBCERROR_IO_ERROR_INVALID_RESOURCE		= 7,

	/* The ioctl failed
	 */
	LIBCERROR_IO_ERROR_IOCTL_FAILED			= 8,

	/* The unlink failed
	 */
	LIBCERROR_IO_ERROR_UNLINK_FAILED		= 9
};

/* The input error codes
 * to signify errors regarding handing input data
 */
enum LIBCERROR_INPUT_ERROR
{
	LIBCERROR_INPUT_ERROR_GENERIC			= 0,

	/* The input contains invalid data
	 */
	LIBCERROR_INPUT_ERROR_INVALID_DATA		= 1,

	/* The input contains an unsupported signature
	 */
	LIBCERROR_INPUT_ERROR_SIGNATURE_MISMATCH	= 2,

	/* A checksum in the input did not match
	 */
	LIBCERROR_INPUT_ERROR_CHECKSUM_MISMATCH		= 3,

	/* A value in the input did not match a previously
	 * read value or calculated value
	 */
	LIBCERROR_INPUT_ERROR_VALUE_MISMATCH		= 4
};

/* The memory error codes
 * to signify errors regarding memory
 */
enum LIBCERROR_MEMORY_ERROR
{
	LIBCERROR_MEMORY_ERROR_GENERIC			= 0,

	/* There is insufficient memory available
	 */
	LIBCERROR_MEMORY_ERROR_INSUFFICIENT		= 1,

	/* The memory failed to be copied
	 */
	LIBCERROR_MEMORY_ERROR_COPY_FAILED		= 2,

	/* The memory failed to be set
	 */
	LIBCERROR_MEMORY_ERROR_SET_FAILED		= 3
};

/* The runtime error codes
 * to signify errors regarding runtime processing
 */
enum LIBCERROR_RUNTIME_ERROR
{
	LIBCERROR_RUNTIME_ERROR_GENERIC			= 0,

	/* The value is missing
	 */
	LIBCERROR_RUNTIME_ERROR_VALUE_MISSING		= 1,

	/* The value was already set
	 */
	LIBCERROR_RUNTIME_ERROR_VALUE_ALREADY_SET	= 2,

	/* The creation and/or initialization of an internal structure failed
	 */
	LIBCERROR_RUNTIME_ERROR_INITIALIZE_FAILED	= 3,

	/* The resize of an internal structure failed
	 */
	LIBCERROR_RUNTIME_ERROR_RESIZE_FAILED		= 4,

	/* The free and/or finalization of an internal structure failed
	 */
	LIBCERROR_RUNTIME_ERROR_FINALIZE_FAILED		= 5,

	/* The value could not be determined
	 */
	LIBCERROR_RUNTIME_ERROR_GET_FAILED		= 6,

	/* The value could not be set
	 */
	LIBCERROR_RUNTIME_ERROR_SET_FAILED		= 7,

	/* The value could not be appended/prepended
	 */
	LIBCERROR_RUNTIME_ERROR_APPEND_FAILED		= 8,

	/* The value could not be copied
	 */
	LIBCERROR_RUNTIME_ERROR_COPY_FAILED		= 9,

	/* The value could not be removed
	 */
	LIBCERROR_RUNTIME_ERROR_REMOVE_FAILED		= 10,

	/* The value could not be printed
	 */
	LIBCERROR_RUNTIME_ERROR_PRINT_FAILED		= 11,

	/* The value was out of bounds
	 */
	LIBCERROR_RUNTIME_ERROR_VALUE_OUT_OF_BOUNDS	= 12,

	/* The value exceeds the maximum for its specific type
	 */
	LIBCERROR_RUNTIME_ERROR_VALUE_EXCEEDS_MAXIMUM	= 13,

	/* The value is unsupported
	 */
	LIBCERROR_RUNTIME_ERROR_UNSUPPORTED_VALUE	= 14,

	/* An aborted was requested
	 */
	LIBCERROR_RUNTIME_ERROR_ABORT_REQUESTED		= 15
};

/* The output error codes
 */
enum LIBCERROR_OUTPUT_ERROR
{
	LIBCERROR_OUTPUT_ERROR_GENERIC			= 0,

	/* There is insuficient space to write the output
	 */
	LIBCERROR_OUTPUT_ERROR_INSUFFICIENT_SPACE	= 1
};

#endif /* !defined( HAVE_LOCAL_LIBCERROR ) */

#endif