2005-10-13 02:39:43 +00:00
|
|
|
/*
|
2005-10-19 05:41:40 +00:00
|
|
|
$Id: udf.h,v 1.2 2005/10/19 05:41:40 rocky Exp $
|
2005-10-13 02:39:43 +00:00
|
|
|
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* \file udf.h
|
|
|
|
|
*
|
|
|
|
|
* \brief The top-level interface header for libudf: the ISO-9660
|
|
|
|
|
* filesystem library; applications include this.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef UDF_H
|
2005-10-19 05:41:40 +00:00
|
|
|
#define UDF_H
|
2005-10-13 02:39:43 +00:00
|
|
|
|
2005-10-19 05:41:40 +00:00
|
|
|
#include <cdio/ecma_167.h>
|
|
|
|
|
|
|
|
|
|
/* FIXME: these probably don't go here. */
|
2005-10-13 02:39:43 +00:00
|
|
|
typedef uint16_t unicode16_t;
|
|
|
|
|
typedef uint8_t ubyte;
|
|
|
|
|
|
2005-10-19 05:41:40 +00:00
|
|
|
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. */
|
|
|
|
|
|
|
|
|
|
uint8_t *sector;
|
|
|
|
|
udf_fileid_desc_t fid;
|
|
|
|
|
uint32_t partition_lba;
|
|
|
|
|
uint32_t dir_lba, dir_end_lba;
|
|
|
|
|
uint32_t sec_size;
|
|
|
|
|
int dir_left;
|
|
|
|
|
} udf_file_t;
|
|
|
|
|
|
2005-10-13 02:39:43 +00:00
|
|
|
/** This is an opaque structure. */
|
|
|
|
|
typedef struct udf_s udf_t;
|
|
|
|
|
|
|
|
|
|
extern enum udf_enum1_s {
|
|
|
|
|
UDF_BLOCKSIZE = 2048
|
|
|
|
|
} udf_enums1;
|
|
|
|
|
|
|
|
|
|
/*!
|
2005-10-19 05:41:40 +00:00
|
|
|
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.
|
2005-10-13 02:39:43 +00:00
|
|
|
*/
|
2005-10-19 05:41:40 +00:00
|
|
|
long int udf_read_sectors (const udf_t *p_udf, void *ptr, lsn_t i_start,
|
|
|
|
|
long int i_blocks);
|
2005-10-13 02:39:43 +00:00
|
|
|
|
|
|
|
|
/*!
|
2005-10-19 05:41:40 +00:00
|
|
|
Open an UDF for reading. Maybe in the future we will have
|
2005-10-13 02:39:43 +00:00
|
|
|
a mode. NULL is returned on error.
|
2005-10-19 05:41:40 +00:00
|
|
|
|
|
|
|
|
Caller must free result - use udf_close for that.
|
2005-10-13 02:39:43 +00:00
|
|
|
*/
|
|
|
|
|
udf_t *udf_open (const char *psz_path);
|
|
|
|
|
|
2005-10-19 05:41:40 +00:00
|
|
|
/*!
|
|
|
|
|
Close UDF and fee resources associated with that.
|
|
|
|
|
*/
|
|
|
|
|
bool udf_close (udf_t *p_udf);
|
|
|
|
|
|
2005-10-13 02:39:43 +00:00
|
|
|
#endif /*UDF_H*/
|