udf.h: Mostly add a couple more routines and more fields in udf_file_t

ecma_167.h: more udf_ prefixes, add extern debugger symbols.
This commit is contained in:
rocky
2005-10-21 12:33:46 +00:00
parent a6472512f6
commit 50ad6d7559
2 changed files with 46 additions and 17 deletions

View File

@@ -55,6 +55,7 @@
#include <cdio/types.h>
/** Tag Identifier (ECMA 167r3 3/7.2.1) */
typedef enum {
TAGID_PRI_VOL = 0x0001,
TAGID_ANCHOR = 0x0002,
@@ -76,7 +77,7 @@ typedef enum {
TAGID_SBD = 0x0108,
TAGID_PIE = 0x0109,
TAGID_EFE = 0x010A,
} tag_id_enum_t ;
} tag_id_t ;
/** Character Set Type (ECMA 167r3 1/7.2.1.1) */
typedef enum {
@@ -542,23 +543,24 @@ struct udf_fileid_desc_s
typedef struct udf_fileid_desc_s udf_fileid_desc_t;
#define UDF_FID_SIZE 38
#define UDF_FILE_CHAR_VIS (1 << 0) /* Visible */
#define UDF_FILE_CHAR_DIR (1 << 1) /* Directory */
#define UDF_FILE_CHAR_DEL (1 << 2) /* Deleted */
#define UDF_FILE_CHAR_PAR (1 << 3) /* Parent Directory */
#define UDF_FILE_CHAR_META (1 << 4) /* Stream metadata */
/** File Characteristics (ECMA 167r3 4/14.4.3) */
#define FID_FILE_CHAR_HIDDEN 0x01
#define FID_FILE_CHAR_DIRECTORY 0x02
#define FID_FILE_CHAR_DELETED 0x04
#define FID_FILE_CHAR_PARENT 0x08
#define FID_FILE_CHAR_METADATA 0x10
/** File Characteristics (ECMA 167r3 4/14.4.3)
Imagine the below enumeration values are #defines to be used in a
bitmask rather than distinct values of an enum.
*/
typedef enum {
UDF_FILE_HIDDEN = (1 << 0),
UDF_FILE_DIRECTORY = (1 << 1),
UDF_FILE_DELETED = (1 << 2),
UDF_FILE_PARENT = (1 << 3),
UDF_FILE_METADATA = (1 << 4)
} file_characteristics_t;
/** Allocation Ext Descriptor (ECMA 167r3 4/14.5) */
struct allocExtDesc
{
udf_tag_t tag;
udf_tag_t tag;
udf_Uint32_t previous_alloc_ext_loc;
udf_Uint32_t i_alloc_descs;
} GNUC_PACKED;
@@ -920,4 +922,13 @@ struct extended_file_entry
PRAGMA_END_PACKED
/** The below variables are trickery to force the above enum symbol
values to be recorded in debug symbol tables. They are used to
allow one refer to the enumeration value names in the typedefs
above in a debugger and debugger expressions
*/
extern file_characteristics_t debug_file_characteristics;
extern tag_id_t debug_tagid;
#endif /* _ECMA_167_H */

View File

@@ -1,5 +1,5 @@
/*
$Id: udf.h,v 1.4 2005/10/19 07:06:35 rocky Exp $
$Id: udf.h,v 1.5 2005/10/21 12:33:46 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
This program is free software; you can redistribute it and/or modify
@@ -37,21 +37,35 @@ typedef uint8_t ubyte;
typedef struct
{
char *psz_name;
bool b_dir; /* true if this entry is a directory. */
bool b_root; /* True if root directory, so b_dir should be
true if this is true. */
bool b_dir; /* true if this entry is a directory. */
bool b_parent; /* True if has parent directory (e.g. not root
directory). If not set b_dir will probably
be true. */
uint32_t i_part_start;
uint32_t dir_lba, dir_end_lba;
uint64_t dir_left;
uint8_t *sector;
udf_fileid_desc_t *fid;
} udf_file_t;
/** This is an opaque structure. */
typedef struct udf_s udf_t;
/**
Imagine the below a #define'd value rather than distinct values of
an enum.
*/
typedef enum {
UDF_BLOCKSIZE = 2048
} udf_enum1_t;
/** 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 */
extern udf_enum1_t debug_udf_enums1;
/*!
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.
@@ -67,6 +81,10 @@ long int udf_read_sectors (const udf_t *p_udf, void *ptr, lsn_t i_start,
*/
udf_t *udf_open (const char *psz_path);
udf_file_t *udf_get_sub(udf_t *p_udf, udf_file_t *p_file);
udf_file_t *udf_get_next(udf_t *p_udf, udf_file_t * p_file);
/*!
Close UDF and free resources associated with p_udf.
*/