libcdio  1.1.0rc1
Data Structures | Typedefs | Enumerations | Functions | Variables
udf.h File Reference

The top-level interface header for libudf: UDF filesystem library; applications include this. More...

#include <cdio/cdio.h>
#include <cdio/ecma_167.h>
#include <cdio/posix.h>
#include <cdio/udf_time.h>
#include <cdio/udf_file.h>

Go to the source code of this file.

Data Structures

struct  udf_dirent_s


typedef uint16_t partition_num_t
typedef struct udf_s udf_t
typedef struct udf_file_s udf_file_t
typedef struct udf_dirent_s udf_dirent_t


enum  udf_enum1_t { UDF_BLOCKSIZE = 2048 }


bool udf_close (udf_t *p_udf)
driver_return_code_t udf_read_sectors (const udf_t *p_udf, void *ptr, lsn_t i_start, long int i_blocks)
udf_tudf_open (const char *psz_path)
int16_t udf_get_part_number (const udf_t *p_udf)
udf_dirent_tudf_get_root (udf_t *p_udf, bool b_any_partition, partition_num_t i_partition)
int udf_get_volume_id (udf_t *p_udf, char *psz_volid, unsigned int i_volid)
int udf_get_volumeset_id (udf_t *p_udf, uint8_t *volsetid, unsigned int i_volsetid)
int udf_get_logical_volume_id (udf_t *p_udf, char *psz_logvolid, unsigned int i_logvolid)
udf_dirent_tudf_fopen (udf_dirent_t *p_udf_root, const char *psz_name)
char * udf_mode_string (mode_t i_mode, char *psz_str)
bool udf_get_lba (const udf_file_entry_t *p_udf_fe, uint32_t *start, uint32_t *end)


udf_enum1_t debug_udf_enum1

Detailed Description

The top-level interface header for libudf: UDF filesystem library; applications include this.

Typedef Documentation

typedef uint16_t partition_num_t
typedef struct udf_dirent_s udf_dirent_t
typedef struct udf_file_s udf_file_t
typedef struct udf_s udf_t

Opaque structures.

Enumeration Type Documentation

Imagine the below a #define'd value rather than distinct values of an enum.


Function Documentation

bool udf_close ( udf_t p_udf)

Close UDF and free resources associated with p_udf.

udf_dirent_t* udf_fopen ( udf_dirent_t p_udf_root,
const char *  psz_name 

Return a file pointer matching psz_name.

bool udf_get_lba ( const udf_file_entry_t p_udf_fe,
uint32_t *  start,
uint32_t *  end 
int udf_get_logical_volume_id ( udf_t p_udf,
char *  psz_logvolid,
unsigned int  i_logvolid 

Gets the Logical Volume Identifier string, in 8bit unicode (latin-1) psz_logvolid, place to put the string i_logvolid, size of the buffer psz_logvolid points to returns the size of buffer needed for all data A call to udf_get_root() should have been issued before this call

int16_t udf_get_part_number ( const udf_t p_udf)

Return the partition number of the the opened udf handle. -1 Is returned if we have an error.

udf_dirent_t* udf_get_root ( udf_t p_udf,
bool  b_any_partition,
partition_num_t  i_partition 

Get the root in p_udf. If b_any_partition is false then the root must be in the given partition. NULL is returned if the partition is not found or a root is not found or there is on error.

Caller must free result - use udf_file_free for that.

int udf_get_volume_id ( udf_t p_udf,
char *  psz_volid,
unsigned int  i_volid 

Gets the Volume Identifier string, in 8bit unicode (latin-1) psz_volid, place to put the string i_volid, size of the buffer psz_volid points to returns the size of buffer needed for all data

int udf_get_volumeset_id ( udf_t p_udf,
uint8_t *  volsetid,
unsigned int  i_volsetid 

Gets the Volume Set Identifier, as a 128-byte dstring (not decoded) WARNING This is not a null terminated string volsetid, place to put the data i_volsetid, size of the buffer psz_volsetid points to the buffer should be >=128 bytes to store the whole volumesetidentifier returns the size of the available volsetid information (128) or 0 on error

char* udf_mode_string ( mode_t  i_mode,
char *  psz_str 

udf_mode_string - fill in string PSZ_STR with an ls-style ASCII representation of the i_mode. PSZ_STR is returned.

10 characters are stored in PSZ_STR; a terminating null byte is added. The characters stored in PSZ_STR are:

0 File type. 'd' for directory, 'c' for character special, 'b' for block special, 'm' for multiplex, 'l' for symbolic link, 's' for socket, 'p' for fifo, '-' for regular, '?' for any other file type

1 'r' if the owner may read, '-' otherwise.

2 'w' if the owner may write, '-' otherwise.

3 'x' if the owner may execute, 's' if the file is set-user-id, '-' otherwise. 'S' if the file is set-user-id, but the execute bit isn't set.

4 'r' if group members may read, '-' otherwise.

5 'w' if group members may write, '-' otherwise.

6 'x' if group members may execute, 's' if the file is set-group-id, '-' otherwise. 'S' if it is set-group-id but not executable.

7 'r' if any user may read, '-' otherwise.

8 'w' if any user may write, '-' otherwise.

9 'x' if any user may execute, 't' if the file is "sticky" (will be retained in swap space after execution), '-' otherwise. 'T' if the file is sticky but not executable.

udf_t* udf_open ( const char *  psz_path)

Open an UDF for reading. Maybe in the future we will have a mode. NULL is returned on error.

Caller must free result - use udf_close for that.

driver_return_code_t udf_read_sectors ( const udf_t p_udf,
void *  ptr,
lsn_t  i_start,
long int  i_blocks 

Seek to a position i_start and then read i_blocks. Number of blocks read is returned. One normally expects the return to be equal to i_blocks.

Variable Documentation

udf_enum1_t debug_udf_enum1

This variable is trickery to force the above enum symbol value to be recorded in debug symbol tables. It is used to allow one refer to above enumeration values in a debugger and debugger expressions