Debian Codegraph @

libbfio/libbfio_definitions.h

raw symbols SCIP
1 /*
2 * The internal definitions
3 *
4 * Copyright (C) 2009-2024, Joachim Metz <[email protected]>
5 *
6 * Refer to AUTHORS for acknowledgements.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #if !defined( _LIBBFIO_INTERNAL_DEFINITIONS_H )
23 #define _LIBBFIO_INTERNAL_DEFINITIONS_H
24
25 #include <common.h>
26
27 /* Define HAVE_LOCAL_LIBBFIO for local use of libbfio
28 */
29 #if !defined( HAVE_LOCAL_LIBBFIO )
30 #include <libbfio/definitions.h>
31
32 /* The definitions in <libbfio/definitions.h> are copied here
33 * for local use of libbfio
34 */
35 #else
36 #define LIBBFIO_VERSION 20240414
37
38 /* The libbfio version string
39 */
40 #define LIBBFIO_VERSION_STRING "20240414"
41
42 /* The library flags definitions
43 */
44 enum LIBBFIO_FLAGS
45 {
46 /* The IO handle is not managed by the library
47 */
48 LIBBFIO_FLAG_IO_HANDLE_NON_MANAGED = 0x00,
49
50 /* The IO handle is managed by the library
51 */
52 LIBBFIO_FLAG_IO_HANDLE_MANAGED = 0x01,
53
54 /* The IO handle is cloned by the function
55 */
56 LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_FUNCTION = 0x00,
57
58 /* The IO handle is not cloned, but passed as a reference
59 */
60 LIBBFIO_FLAG_IO_HANDLE_CLONE_BY_REFERENCE = 0x02,
61 };
62
63 /* The access flags definitions
64 * bit 1 set to 1 for read access
65 * bit 2 set to 1 for write access
66 * bit 3 set to 1 to truncate an existing file on write
67 * bit 4-8 not used
68 */
69 enum LIBBFIO_ACCESS_FLAGS
70 {
71 LIBBFIO_ACCESS_FLAG_READ = 0x01,
72 LIBBFIO_ACCESS_FLAG_WRITE = 0x02,
73 LIBBFIO_ACCESS_FLAG_TRUNCATE = 0x04
74 };
75
76 /* The file access macros
77 */
78 #define LIBBFIO_OPEN_READ ( LIBBFIO_ACCESS_FLAG_READ )
79 #define LIBBFIO_OPEN_WRITE ( LIBBFIO_ACCESS_FLAG_WRITE )
80 #define LIBBFIO_OPEN_READ_WRITE ( LIBBFIO_ACCESS_FLAG_READ | LIBBFIO_ACCESS_FLAG_WRITE )
81 #define LIBBFIO_OPEN_WRITE_TRUNCATE ( LIBBFIO_ACCESS_FLAG_WRITE | LIBBFIO_ACCESS_FLAG_TRUNCATE )
82 #define LIBBFIO_OPEN_READ_WRITE_TRUNCATE ( LIBBFIO_ACCESS_FLAG_READ | LIBBFIO_ACCESS_FLAG_WRITE | LIBBFIO_ACCESS_FLAG_TRUNCATE )
83
84 #define LIBBFIO_POOL_UNLIMITED_NUMBER_OF_OPEN_HANDLES 0
85
86 #endif /* HAVE_LOCAL_LIBBFIO */
87
88 #endif /* !defined( _LIBBFIO_INTERNAL_DEFINITIONS_H ) */
89