Debian Codegraph @

src/dvdread_internal.h

raw symbols SCIP
1 /*
2 * This file is part of libdvdread.
3 *
4 * libdvdread is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * libdvdread is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with libdvdread; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #ifndef LIBDVDREAD_DVDREAD_INTERNAL_H
20 #define LIBDVDREAD_DVDREAD_INTERNAL_H
21
22 #include <stdint.h>
23 #include <stddef.h>
24 #include <sys/types.h>
25
26 #ifdef _WIN32
27 # include <unistd.h>
28 #endif /* _WIN32 */
29
30 #include "dvdread/dvd_reader.h"
31 #include "dvdread/ifo_types.h"
32 #include "logger.h"
33
34 #define container_of(ptr, type, member) \
35 ((type *)(((char *)(ptr)) - offsetof(type, member)))
36
37 /* to determine set paths */
38 #define DVD_TYPE_STRING(type) ((type==DVD_V)? "VIDEO":"AUDIO")
39 #define STREAM_TYPE_STRING(type) ((type==DVD_V)? 'V':'A')
40
41 typedef enum{
42 DVD_V = 0,
43 DVD_A = 1,
44 DVD_VR = 2,
45 } dvd_type_t;
46
47 struct dvd_reader_s
48 {
49 dvd_reader_device_t *rd;
50 dvd_type_t dvd_type;
51 void *priv; /* User provided context */
52 dvd_logger_cb logcb;
53 dvd_reader_filesystem_h* fs;
54 /* Set 100 flags for BUP fallback, most signifiant left
55 [0] for upper remaining VTS, [1] for the first Main + 63 VTS */
56 uint64_t ifoBUPflags[2];
57 };
58
59 struct ifo_handle_private_s
60 {
61 ifo_handle_t handle;
62 dvd_reader_t *ctx;
63 dvd_file_t *file;
64 };
65
66 enum TagIdentifier {
67 /* ECMA 167 3/7.2.1 */
68 PrimaryVolumeDescriptor = 1,
69 AnchorVolumeDescriptorPointer = 2,
70 VolumeDescriptorPointer = 3,
71 ImplementationUseVolumeDescriptor = 4,
72 PartitionDescriptor = 5,
73 LogicalVolumeDescriptor = 6,
74 UnallocatedSpaceDescriptor = 7,
75 TerminatingDescriptor = 8,
76 LogicalVolumeIntegrityDescriptor = 9,
77 /* ECMA 167 4/7.2.1 */
78 FileSetDescriptor = 256,
79 FileIdentifierDescriptor = 257,
80 AllocationExtentDescriptor = 258,
81 IndirectEntry = 259,
82 TerminalEntry = 260,
83 FileEntry = 261,
84 ExtendedAttributeHeaderDescriptor = 262,
85 UnallocatedSpaceEntry = 263,
86 SpaceBitmapDescriptor = 264,
87 PartitionIntegrityEntry = 265,
88 ExtendedFileEntry = 266,
89 };
90
91 int InternalUDFReadBlocksRaw(const dvd_reader_t *, uint32_t lb_number,
92 size_t block_count, unsigned char *data, int encrypted);
93
94 void *GetUDFCacheHandle(dvd_reader_t *);
95 void SetUDFCacheHandle(dvd_reader_t *, void *cache);
96 void FreeUDFCache(void *cache);
97
98 #endif /* LIBDVDREAD_DVDREAD_INTERNAL_H */