udftools

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
file.h
Go to the documentation of this file.
1 /*
2 * libudffs.h
3 *
4 * Copyright (c) 2001-2002 Ben Fennema <bfennema@falcon.csc.calpoly.edu>
5 * Copyright (c) 2016 Pali Rohár <pali.rohar@gmail.com>
6 * All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 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 General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 */
23
24 #ifndef __FILE_H
25 #define __FILE_H
26
27 #include "libudffs.h"
28
29 tag query_tag(struct udf_disc *, struct udf_extent *, struct udf_desc *, uint16_t);
30 extern tag udf_query_tag(struct udf_disc *, uint16_t, uint16_t, uint32_t, struct udf_data *, uint16_t);
31 extern struct udf_desc *udf_create(struct udf_disc *, struct udf_extent *, uint8_t *, uint8_t, uint32_t, struct udf_desc *, uint8_t, uint8_t, uint16_t);
32 extern struct udf_desc *udf_mkdir(struct udf_disc *, struct udf_extent *, uint8_t *, uint8_t, uint32_t, struct udf_desc *);
33 extern void insert_data(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_data *data);
34 extern void insert_fid(struct udf_disc *, struct udf_extent *, struct udf_desc *, struct udf_desc *, uint8_t *, uint8_t, uint8_t);
35 extern int udf_alloc_blocks(struct udf_disc *, struct udf_extent *, uint32_t, uint32_t);
36
37 static inline void clear_bits(uint8_t *bitmap, uint32_t offset, uint64_t length)
38 {
39 for (;length>0;length--)
40 {
41 bitmap[(length+offset-1)/8] &= ~(1 << ((offset+length-1)%8));
42 }
43 }
44
45 static inline struct impUseVolDescImpUse *query_iuvdiu(struct udf_disc *disc)
46 {
47 return (struct impUseVolDescImpUse *)disc->udf_iuvd[0]->impUse;
48 }
49
50 static inline struct logicalVolIntegrityDescImpUse *query_lvidiu(struct udf_disc *disc)
51 {
52 return (struct logicalVolIntegrityDescImpUse *)&(disc->udf_lvid->impUse[le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps) * 2 * sizeof(uint32_t)]);
53 }
54
55 #endif /* __FILE_H */
udf_disc::udf_lvid
struct logicalVolIntegrityDesc * udf_lvid
Definition: libudffs.h:118
udf_query_tag
tag udf_query_tag(struct udf_disc *, uint16_t, uint16_t, uint32_t, struct udf_data *, uint16_t)
create an on-disc format tag from udf_descriptor components
Definition: file.c:129
clear_bits
static void clear_bits(uint8_t *bitmap, uint32_t offset, uint64_t length)
Definition: file.h:37
impUseVolDescImpUse
Definition: osta_udf.h:107
udf_desc::length
uint64_t length
Definition: libudffs.h:148
bitmap
uint8_t bitmap[0]
Definition: ecma_167.h:67
udf_desc::data
struct udf_data * data
Definition: libudffs.h:149
udf_data
Definition: libudffs.h:155
logicalVolIntegrityDesc::impUse
uint8_t impUse[0]
Definition: ecma_167.h:371
udf_create
struct udf_desc * udf_create(struct udf_disc *, struct udf_extent *, uint8_t *, uint8_t, uint32_t, struct udf_desc *, uint8_t, uint8_t, uint16_t)
create a file tag:FE/EFE udf_descriptor and add the file to a directory
Definition: file.c:466
udf_mkdir
struct udf_desc * udf_mkdir(struct udf_disc *, struct udf_extent *, uint8_t *, uint8_t, uint32_t, struct udf_desc *)
create a directory tag:FE/EFE udf_descriptor and add the directory to a parent directory ...
Definition: file.c:587
udf_extent
Definition: libudffs.h:131
query_lvidiu
static struct logicalVolIntegrityDescImpUse * query_lvidiu(struct udf_disc *disc)
Definition: file.h:50
logicalVolDesc::numPartitionMaps
uint32_t numPartitionMaps
Definition: ecma_167.h:306
udf_desc
Definition: libudffs.h:144
udf_desc::offset
uint32_t offset
Definition: libudffs.h:147
udf_disc
Definition: libudffs.h:95
query_tag
tag query_tag(struct udf_disc *, struct udf_extent *, struct udf_desc *, uint16_t)
create an on-disc format tag for a udf_descriptor of a udf_extent with any space_type. For type:PSPACE the block number will be relative to to the first block of the partition, otherwise it will be relative to the first block of the media
Definition: file.c:83
libudffs.h
query_iuvdiu
static struct impUseVolDescImpUse * query_iuvdiu(struct udf_disc *disc)
Definition: file.h:45
impUseVolDesc::impUse
uint8_t impUse[460]
Definition: ecma_167.h:256
logicalVolIntegrityDescImpUse
Definition: osta_udf.h:94
insert_data
void insert_data(struct udf_disc *disc, struct udf_extent *pspace, struct udf_desc *desc, struct udf_data *data)
append a udf_data list to a (hidden) VAT file ???
Definition: file.c:333
insert_fid
void insert_fid(struct udf_disc *, struct udf_extent *, struct udf_desc *, struct udf_desc *, uint8_t *, uint8_t, uint8_t)
create a FID and add it to a directory then increment the file link count
Definition: file.c:385
udf_disc::udf_lvd
struct logicalVolDesc * udf_lvd[2]
Definition: libudffs.h:113
udf_alloc_blocks
int udf_alloc_blocks(struct udf_disc *, struct udf_extent *, uint32_t, uint32_t)
allocate blocks on-disc
Definition: file.c:814
udf_disc::udf_iuvd
struct impUseVolDesc * udf_iuvd[2]
Definition: libudffs.h:116