|
Packit |
dd8086 |
/*
|
|
Packit |
dd8086 |
Copyright (C) 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
This program is free software: you can redistribute it and/or modify
|
|
Packit |
dd8086 |
it under the terms of the GNU General Public License as published by
|
|
Packit |
dd8086 |
the Free Software Foundation, either version 3 of the License, or
|
|
Packit |
dd8086 |
(at your option) any later version.
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
This program is distributed in the hope that it will be useful,
|
|
Packit |
dd8086 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
dd8086 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
dd8086 |
GNU General Public License for more details.
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
You should have received a copy of the GNU General Public License
|
|
Packit |
dd8086 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
* \file udf_file.h
|
|
Packit |
dd8086 |
*
|
|
Packit |
dd8086 |
* \brief Routines involving UDF file operations
|
|
Packit |
dd8086 |
*
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
#ifndef UDF_FILE_H
|
|
Packit |
dd8086 |
#define UDF_FILE_H
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
#ifdef __cplusplus
|
|
Packit |
dd8086 |
extern "C" {
|
|
Packit |
dd8086 |
#endif /* __cplusplus */
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Return the file id descriptor of the given file.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
bool udf_get_fileid_descriptor(const udf_dirent_t *p_udf_dirent,
|
|
Packit |
dd8086 |
/*out*/ udf_fileid_desc_t *p_udf_fid);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Return the name of the file
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
const char *udf_get_filename(const udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Return the name of the file
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
bool udf_get_file_entry(const udf_dirent_t *p_udf_dirent,
|
|
Packit |
dd8086 |
/*out*/ udf_file_entry_t *p_udf_fe);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Return the number of hard links of the file. Return 0 if error.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
uint16_t udf_get_link_count(const udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Return the file length the file. Return 2147483647L if error.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
uint64_t udf_get_file_length(const udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Returns a POSIX mode for a given p_udf_dirent.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
mode_t udf_get_posix_filemode(const udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Return the next subdirectory.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
udf_dirent_t *udf_opendir(const udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Attempts to read up to count bytes from UDF directory entry
|
|
Packit |
dd8086 |
p_udf_dirent into the buffer starting at buf. buf should be a
|
|
Packit |
dd8086 |
multiple of UDF_BLOCKSIZE bytes. Reading continues after the
|
|
Packit |
dd8086 |
point at which we last read or from the beginning the first time.
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
If count is zero, read() returns zero and has no other results. If
|
|
Packit |
dd8086 |
count is greater than SSIZE_MAX, the result is unspecified.
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
If there is an error, cast the result to driver_return_code_t for
|
|
Packit |
dd8086 |
the specific error code.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Attempts to read up to count bytes from file descriptor fd into
|
|
Packit |
dd8086 |
the buffer starting at buf.
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
If count is zero, read() returns zero and has no other results. If
|
|
Packit |
dd8086 |
count is greater than SSIZE_MAX, the result is unspecified.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
ssize_t udf_read_block(const udf_dirent_t *p_udf_dirent,
|
|
Packit |
dd8086 |
void * buf, size_t count);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Advances p_udf_direct to the the next directory entry in the
|
|
Packit |
dd8086 |
pointed to by p_udf_dir. It also returns this as the value. NULL
|
|
Packit |
dd8086 |
is returned on reaching the end-of-file or if an error. Also
|
|
Packit |
dd8086 |
p_udf_dirent is free'd. If the end of is not reached the caller
|
|
Packit |
dd8086 |
must call udf_dirent_free() with p_udf_dirent when done with it to
|
|
Packit |
dd8086 |
release resources.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
udf_dirent_t *udf_readdir(udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
free free resources associated with p_udf_dirent.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
bool udf_dirent_free(udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
/**
|
|
Packit |
dd8086 |
Return true if the file is a directory.
|
|
Packit |
dd8086 |
*/
|
|
Packit |
dd8086 |
bool udf_is_dir(const udf_dirent_t *p_udf_dirent);
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
#ifdef __cplusplus
|
|
Packit |
dd8086 |
}
|
|
Packit |
dd8086 |
#endif /* __cplusplus */
|
|
Packit |
dd8086 |
|
|
Packit |
dd8086 |
#endif /*UDF_FILE_H*/
|