Debian Codegraph @

libcfile/libcfile_definitions.h

raw symbols SCIP
1 /*
2 * The internal definitions
3 *
4 * Copyright (C) 2008-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( LIBCFILE_INTERNAL_DEFINITIONS_H )
23 #define LIBCFILE_INTERNAL_DEFINITIONS_H
24
25 #include <common.h>
26 #include <types.h>
27
28 /* Define HAVE_LOCAL_LIBCFILE for local use of libcfile
29 */
30 #if !defined( HAVE_LOCAL_LIBCFILE )
31 #include <libcfile/definitions.h>
32
33 /* The definitions in <libcfile/definitions.h> are copied here
34 * for local use of libcfile
35 */
36 #else
37
38 #define LIBCFILE_VERSION 20240414
39
40 /* The libcfile version string
41 */
42 #define LIBCFILE_VERSION_STRING "20240414"
43
44 /* The file access flags
45 * bit 1 set to 1 for read access
46 * bit 2 set to 1 for write access
47 * bit 3 set to 1 to truncate an existing file on write
48 * bit 4-8 not used
49 */
50 enum LIBCFILE_ACCESS_FLAGS
51 {
52 LIBCFILE_ACCESS_FLAG_READ = 0x01,
53 LIBCFILE_ACCESS_FLAG_WRITE = 0x02,
54 LIBCFILE_ACCESS_FLAG_TRUNCATE = 0x04
55 };
56
57 /* The file access macros
58 */
59 #define LIBCFILE_OPEN_READ ( LIBCFILE_ACCESS_FLAG_READ )
60 #define LIBCFILE_OPEN_WRITE ( LIBCFILE_ACCESS_FLAG_WRITE )
61 #define LIBCFILE_OPEN_READ_WRITE ( LIBCFILE_ACCESS_FLAG_READ | LIBCFILE_ACCESS_FLAG_WRITE )
62 #define LIBCFILE_OPEN_WRITE_TRUNCATE ( LIBCFILE_ACCESS_FLAG_WRITE | LIBCFILE_ACCESS_FLAG_TRUNCATE )
63 #define LIBCFILE_OPEN_READ_WRITE_TRUNCATE ( LIBCFILE_ACCESS_FLAG_READ | LIBCFILE_ACCESS_FLAG_WRITE | LIBCFILE_ACCESS_FLAG_TRUNCATE )
64
65 /* The access behavior types
66 */
67 enum LIBCFILE_ACCESS_BEHAVIOR
68 {
69 LIBCFILE_ACCESS_BEHAVIOR_NORMAL,
70 LIBCFILE_ACCESS_BEHAVIOR_RANDOM,
71 LIBCFILE_ACCESS_BEHAVIOR_SEQUENTIAL
72 };
73
74 #endif /* !defined( HAVE_LOCAL_LIBCFILE ) */
75
76 /* Platform specific macros
77 */
78 #if defined( WINAPI )
79
80 #if defined( _MSC_VER )
81 #define LIBCFILE_LARGE_INTEGER_ZERO { 0, 0 }
82
83 #elif defined( __BORLANDC__ )
84 #define LIBCFILE_LARGE_INTEGER_ZERO { 0 }
85
86 #elif defined( __CYGWIN__ )
87 #define LIBCFILE_LARGE_INTEGER_ZERO { { 0, 0 } }
88
89 #elif defined( __MINGW32_VERSION ) || defined( __MINGW64_VERSION_MAJOR )
90 #define LIBCFILE_LARGE_INTEGER_ZERO { { 0, 0 } }
91
92 #endif
93
94 #if !defined( INVALID_FILE_ATTRIBUTES )
95 #define INVALID_FILE_ATTRIBUTES ( (DWORD) -1 )
96 #endif
97
98 #endif /* defined( WINAPI ) */
99
100 #endif
101