udftools

- Main Page
- Classes
- Files

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
file.h File Reference
`#include "libudffs.h"`
Include dependency graph for file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
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 More...
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 More...
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 More...
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 More...
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 ??? More...
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 More...
int | udf_alloc_blocks (struct udf_disc *, struct udf_extent *, uint32_t, uint32_t)
| allocate blocks on-disc More...
static void | clear_bits (uint8_t *bitmap, uint32_t offset, uint64_t length)
static struct impUseVolDescImpUse * | query_iuvdiu (struct udf_disc *disc)
static struct logicalVolIntegrityDescImpUse * | query_lvidiu (struct udf_disc *disc)

## Function Documentation

static void clear_bits | ( | uint8_t * | bitmap,
|  | uint32_t | offset,
|  | uint64_t | length
| ) |  |
| inline static

Definition at line 37 of file file.h.

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 ???

Parameters

  disc | the udf_disc
  pspace | the type:PSPACE udf_extent for on-disc allocations
  desc | the file tag:FE/EFE udf_descriptor of a VAT file
  data | the udf_data list head

Returns
  void

Definition at line 333 of file file.c.

void insert_fid | ( | struct udf_disc * | disc,
|  | struct udf_extent * | pspace,
|  | struct udf_desc * | desc,
|  | struct udf_desc * | parent,
|  | uint8_t * | name,
|  | uint8_t | length,
|  | uint8_t | filechar
| ) |  |

create a FID and add it to a directory then increment the file link count

Parameters

  disc | the udf_disc
  pspace | the type:PSPACE udf_extent for on-disc allocations
  desc | the file tag:FE/EFE udf_descriptor
  parent | the directory tag:FE/EFE udf_descriptor
  name | the file name - the first byte is the OSTA unicode compression type
  length | the length of the file name in bytes
  filechar | the file characteristics

Returns
  void

Definition at line 385 of file file.c.

static struct impUseVolDescImpUse* query_iuvdiu | ( | struct udf_disc * | disc | ) |
| static

Definition at line 45 of file file.h.

static struct logicalVolIntegrityDescImpUse* query_lvidiu | ( | struct udf_disc * | disc | ) |
| static

Definition at line 50 of file file.h.

tag query_tag | ( | struct udf_disc * | disc,
|  | struct udf_extent * | ext,
|  | struct udf_desc * | desc,
|  | uint16_t | SerialNum
| ) |  |

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

For a more detailed discussion of partition and extends see the comments at the top of extent.c in this directory.

An information control block (ICB) is an on-disc structure used to store information about files such as allocation descriptors. The structure of the ICB hierarchy can be quite complex for write-once media which use various strategies of linked lists to preserve multiple historial file versions. Strategy type 4 is normally used on rewritable media where an ICB containing 'direct entries' can be updated as needed.

Every file has a file entry/extended file entry (tag:FE/EFE) udf_descriptor which is in the root of the ICB hierarchy for the file. For normal files the FE/EFE can be thought of as the 'inode' for the file as it contains the location of the on-disc extents of the file. Small amounts of data can be recorded directly in the allocation descriptor area of the FE/EFE ICB if it is deemed useful. This 'INICB' feature is used for directories with strategy type 4.

A file identifier descriptor (tag:FID) udf_descriptor is a 40+ byte structure recorded in a directory file to describe the parent directory and any files or subdirectories. The unnamed parent entry is always recorded first and the parent of the root directory is the root directory, generally referred to as '<root>'. All other files/directories must have a non-zero length name. Along with the name and attributes of the file a FID contains the location of the file FE/EFE 'inode' ICB. While not required, this may be recorded adjacent to the file data on-disc for convenience.

The notation tag:FE/EFE means a udf_descriptor with an ident of either TAG_IDENT_FE or TAG_IDENT_EFE with the on-disc format FE/EFE structure stored in the first udf_data item on the udf_data list of that udf_descriptor. The 16-byte on-disc format tag will be at the beginning of that structure. Additional information such as the FID structure for directory entries will be stored in subsequent entries on the list.

Parameters

  disc | the udf_disc
  ext | the udf_extent containing the udf_descriptor
  desc | the udf_descriptor
  SerialNum | the serial number to assign

Returns
  the tag

Definition at line 83 of file file.c.

int udf_alloc_blocks | ( | struct udf_disc * | disc,
|  | struct udf_extent * | pspace,
|  | uint32_t | start,
|  | uint32_t | blocks
| ) |  |

allocate blocks on-disc

Parameters

  disc | the udf_disc
  start | the starting block offset for the allocation search
  blocks | the number of blocks to allocate

Returns
  the starting block number of the on-disc allocation

Definition at line 814 of file file.c.

struct udf_desc* udf_create | ( | struct udf_disc * | disc,
|  | struct udf_extent * | pspace,
|  | uint8_t * | name,
|  | uint8_t | length,
|  | uint32_t | offset,
|  | struct udf_desc * | parent,
|  | uint8_t | filechar,
|  | uint8_t | filetype,
|  | uint16_t | flags
| ) |  |

create a file tag:FE/EFE udf_descriptor and add the file to a directory

Parameters

  disc | the udf_disc
  pspace | the type:PSPACE udf_extent for on-disc allocations
  name | the file name - the first byte is the OSTA unicode compression type
  length | the length of the file name in bytes
  offset | the starting block number to search for on-disc allocations
  parent | the directory tag:FE/EFE udf_descriptor
  filechar | file characteristics
  filetype | the file type
  flags | the file flags

Returns
  the in-memory address of file tag:FE/EFE udf_descriptor

Definition at line 466 of file file.c.

struct udf_desc* udf_mkdir | ( | struct udf_disc * | disc,
|  | struct udf_extent * | pspace,
|  | uint8_t * | name,
|  | uint8_t | length,
|  | uint32_t | offset,
|  | struct udf_desc * | parent
| ) |  |

create a directory tag:FE/EFE udf_descriptor and add the directory to a parent directory

Parameters

  disc | the udf_disc
  pspace | the type:PSPACE udf_extent for on-disc allocations
  name | the file name - the first byte is the OSTA unicode compression type
  length | the length of the file name in bytes
  offset | the starting block number to search for on-disc allocations
  parent | the parent directory tag:FE/EFE udf_descriptor

Returns
  the in-memory address of the directory tag:FE/EFE udf_descriptor

Definition at line 587 of file file.c.

tag udf_query_tag | ( | struct udf_disc * | disc,
|  | uint16_t | Ident,
|  | uint16_t | SerialNum,
|  | uint32_t | Location,
|  | struct udf_data * | data,
|  | uint16_t | length
| ) |  |

create an on-disc format tag from udf_descriptor components

Parameters

  disc | the udf_disc
  Ident | the tag:Ident to assign
  SerialNum | the serial number to assign
  Location | the block number of the on-disc tag:Ident udf_descriptor
  data | the udf_data list head
  length | the summed data length

Returns
  the tag

Definition at line 129 of file file.c.