libcdio 0.83
|
00001 /* 00002 Copyright (C) 2005, 2006, 2008, 2010 Rocky Bernstein <rocky@gnu.org> 00003 00004 This program is free software: you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation, either version 3 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00026 #ifndef UDF_H 00027 #define UDF_H 00028 00029 #include <cdio/cdio.h> 00030 #include <cdio/ecma_167.h> 00031 #include <cdio/posix.h> 00032 00033 typedef uint16_t partition_num_t; 00034 00036 typedef struct udf_s udf_t; 00037 typedef struct udf_file_s udf_file_t; 00038 00039 typedef struct udf_dirent_s { 00040 char *psz_name; 00041 bool b_dir; /* true if this entry is a directory. */ 00042 bool b_parent; /* True if has parent directory (e.g. not root 00043 directory). If not set b_dir will probably 00044 be true. */ 00045 udf_t *p_udf; 00046 uint32_t i_part_start; 00047 uint32_t i_loc, i_loc_end; 00048 uint64_t dir_left; 00049 uint8_t *sector; 00050 udf_fileid_desc_t *fid; 00051 00052 /* This field has to come last because it is variable in length. */ 00053 udf_file_entry_t fe; 00054 } udf_dirent_t;; 00055 00056 00057 00062 typedef enum { 00063 UDF_BLOCKSIZE = 2048 00064 } udf_enum1_t; 00065 00070 extern udf_enum1_t debug_udf_enum1; 00071 00072 #ifdef __cplusplus 00073 extern "C" { 00074 #endif /* __cplusplus */ 00075 00079 bool udf_close (udf_t *p_udf); 00080 00087 driver_return_code_t udf_read_sectors (const udf_t *p_udf, void *ptr, 00088 lsn_t i_start, long int i_blocks); 00089 00096 udf_t *udf_open (const char *psz_path); 00097 00102 int16_t udf_get_part_number(const udf_t *p_udf); 00103 00112 udf_dirent_t *udf_get_root (udf_t *p_udf, bool b_any_partition, 00113 partition_num_t i_partition); 00114 00121 int udf_get_volume_id(udf_t *p_udf, /*out*/ char *psz_volid, 00122 unsigned int i_volid); 00123 00133 int udf_get_volumeset_id(udf_t *p_udf, /*out*/ uint8_t *volsetid, 00134 unsigned int i_volsetid); 00135 00139 udf_dirent_t *udf_fopen(udf_dirent_t *p_udf_root, const char *psz_name); 00140 00178 char *udf_mode_string (mode_t i_mode, char *psz_str); 00179 00180 bool udf_get_lba(const udf_file_entry_t *p_udf_fe, 00181 /*out*/ uint32_t *start, /*out*/ uint32_t *end); 00182 00183 #ifdef __cplusplus 00184 } 00185 #endif /* __cplusplus */ 00186 00187 #include <cdio/udf_time.h> 00188 #include <cdio/udf_file.h> 00189 00190 #endif /*UDF_H*/