libcdio
2.1.0
|
The top-level interface header for libiso9660: the ISO-9660 filesystem library; applications include this. More...
#include <time.h>
#include <cdio/cdio.h>
#include <cdio/ds.h>
#include <cdio/posix.h>
#include <cdio/types.h>
#include <cdio/xa.h>
#include <cdio/rock.h>
Go to the source code of this file.
Data Structures | |
struct | iso9660_dtime_s |
ISO-9660 shorter-format time structure. See ECMA 9.1.5. More... | |
struct | iso9660_ltime_s |
ISO-9660 longer-format time structure. More... | |
struct | iso9660_dir_s |
Format of an ISO-9660 directory record. More... | |
struct | iso9660_pvd_s |
ISO-9660 Primary Volume Descriptor. More... | |
struct | iso9660_svd_s |
ISO-9660 Supplementary Volume Descriptor. More... | |
struct | iso9660_stat_s |
Unix stat-like version of iso9660_dir. More... | |
Macros | |
#define | EMPTY_ARRAY_SIZE 0 |
#define | ISODCL(from, to) ((to) - (from) + 1) |
#define | MIN_TRACK_SIZE 4*75 |
#define | MIN_ISO_SIZE MIN_TRACK_SIZE |
#define | ISO_MAX_PUBLISHER_ID 128 |
Maximum number of characters in a publisher id. More... | |
#define | ISO_MAX_APPLICATION_ID 128 |
Maximum number of characters in an application id. More... | |
#define | ISO_MAX_VOLUME_ID 32 |
Maximum number of characters in a volume id. More... | |
#define | ISO_MAX_VOLUMESET_ID 128 |
Maximum number of characters in a volume-set id. More... | |
#define | ISO_STANDARD_ID "CD001" |
#define | ISO_EXTENSION_ALL 0xFF |
#define | ISO_EXTENSION_NONE 0x00 |
#define | ISO_EXTENSION_JOLIET |
#define | iso9660_fs_find_lsn iso9660_find_fs_lsn |
#define | iso9660_isdchar iso9660_is_dchar |
#define | iso9660_isachar iso9660_is_achar |
Typedefs | |
typedef uint8_t | iso711_t |
ISO 9660 Integer and Character types. More... | |
typedef int8_t | iso712_t |
typedef uint16_t | iso721_t |
typedef uint16_t | iso722_t |
typedef uint32_t | iso723_t |
typedef uint32_t | iso731_t |
typedef uint32_t | iso732_t |
typedef uint64_t | iso733_t |
typedef char | achar_t |
typedef char | dchar_t |
typedef enum strncpy_pad_check | strncpy_pad_check_t |
typedef struct iso9660_dtime_s | iso9660_dtime_t |
typedef struct iso9660_ltime_s | iso9660_ltime_t |
typedef struct iso9660_dir_s | iso9660_dir_t |
typedef struct iso9660_stat_s | iso9660_stat_t |
typedef struct iso9660_pvd_s | iso9660_pvd_t |
typedef struct iso9660_svd_s | iso9660_svd_t |
typedef CdioList_t | CdioISO9660DirList_t |
A data type for a list of ISO9660 statbuf drectory pointer returned from the variious Cdio iso9660 readdir routines. More... | |
typedef uint8_t | iso_extension_mask_t |
typedef struct _iso9660_s | iso9660_t |
Enumerations | |
enum | iso_enum1_s { ISO_PVD_SECTOR = 16, ISO_EVD_SECTOR = 17, LEN_ISONAME = 31, ISO_MAX_SYSTEM_ID = 32, MAX_ISONAME = 37, ISO_MAX_PREPARER_ID = 128, MAX_ISOPATHNAME = 255, ISO_BLOCKSIZE = 2048 } |
enum | iso_flag_enum_s { ISO_FILE = 0, ISO_EXISTENCE = 1, ISO_DIRECTORY = 2, ISO_ASSOCIATED = 4, ISO_RECORD = 8, ISO_PROTECTION = 16, ISO_DRESERVED1 = 32, ISO_DRESERVED2 = 64, ISO_MULTIEXTENT = 128 } |
enum | iso_vd_enum_s { ISO_VD_BOOT_RECORD = 0, ISO_VD_PRIMARY = 1, ISO_VD_SUPPLEMENTARY = 2, ISO_VD_PARITION = 3, ISO_VD_END = 255 } |
enum | strncpy_pad_check { ISO9660_NOCHECK = 0, ISO9660_7BIT, ISO9660_ACHARS, ISO9660_DCHARS } |
enum | iso_extension_enum_s { ISO_EXTENSION_JOLIET_LEVEL1 = 0x01, ISO_EXTENSION_JOLIET_LEVEL2 = 0x02, ISO_EXTENSION_JOLIET_LEVEL3 = 0x04, ISO_EXTENSION_ROCK_RIDGE = 0x08, ISO_EXTENSION_HIGH_SIERRA = 0x10 } |
Functions | |
bool | iso9660_close (iso9660_t *p_iso) |
iso9660_t * | iso9660_open (const char *psz_path) |
iso9660_t * | iso9660_open_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask) |
iso9660_t * | iso9660_open_fuzzy (const char *psz_path, uint16_t i_fuzz) |
iso9660_t * | iso9660_open_fuzzy_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz) |
bool | iso9660_ifs_fuzzy_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask, uint16_t i_fuzz) |
long int | iso9660_iso_seek_read (const iso9660_t *p_iso, void *ptr, lsn_t start, long int i_size) |
bool | iso9660_fs_read_pvd (const CdIo_t *p_cdio, iso9660_pvd_t *p_pvd) |
bool | iso9660_ifs_read_pvd (const iso9660_t *p_iso, iso9660_pvd_t *p_pvd) |
bool | iso9660_fs_read_superblock (CdIo_t *p_cdio, iso_extension_mask_t iso_extension_mask) |
bool | iso9660_ifs_read_superblock (iso9660_t *p_iso, iso_extension_mask_t iso_extension_mask) |
void | iso9660_set_dtime (const struct tm *tm, iso9660_dtime_t *idr_date) |
void | iso9660_set_dtime_with_timezone (const struct tm *p_tm, int timezone, iso9660_dtime_t *p_idr_date) |
void | iso9660_set_ltime (const struct tm *_tm, iso9660_ltime_t *p_pvd_date) |
void | iso9660_set_ltime_with_timezone (const struct tm *_tm, int timezone, iso9660_ltime_t *p_pvd_date) |
bool | iso9660_get_dtime (const iso9660_dtime_t *idr_date, bool b_localtime, struct tm *tm) |
bool | iso9660_get_ltime (const iso9660_ltime_t *p_ldate, struct tm *p_tm) |
bool | iso9660_is_dchar (int c) |
bool | iso9660_is_achar (int c) |
int | iso9660_name_translate (const char *psz_oldname, char *psz_newname) |
int | iso9660_name_translate_ext (const char *psz_oldname, char *psz_newname, uint8_t i_joliet_level) |
char * | iso9660_strncpy_pad (char dst[], const char src[], size_t len, enum strncpy_pad_check _check) |
bool | iso9660_dirname_valid_p (const char psz_path[]) |
char * | iso9660_pathname_isofy (const char psz_path[], uint16_t i_version) |
bool | iso9660_pathname_valid_p (const char psz_path[]) |
void | iso9660_dir_init_new (void *dir, uint32_t self, uint32_t ssize, uint32_t parent, uint32_t psize, const time_t *dir_time) |
void | iso9660_dir_init_new_su (void *dir, uint32_t self, uint32_t ssize, const void *ssu_data, unsigned int ssu_size, uint32_t parent, uint32_t psize, const void *psu_data, unsigned int psu_size, const time_t *dir_time) |
void | iso9660_dir_add_entry_su (void *dir, const char filename[], uint32_t extent, uint32_t size, uint8_t file_flags, const void *su_data, unsigned int su_size, const time_t *entry_time) |
unsigned int | iso9660_dir_calc_record_size (unsigned int namelen, unsigned int su_len) |
iso9660_stat_t * | iso9660_fs_find_lsn (CdIo_t *p_cdio, lsn_t i_lsn) |
iso9660_stat_t * | iso9660_fs_find_lsn_with_path (CdIo_t *p_cdio, lsn_t i_lsn, char **ppsz_full_filename) |
iso9660_stat_t * | iso9660_ifs_find_lsn (iso9660_t *p_iso, lsn_t i_lsn) |
iso9660_stat_t * | iso9660_ifs_find_lsn_with_path (iso9660_t *p_iso, lsn_t i_lsn, char **ppsz_path) |
void | iso9660_stat_free (iso9660_stat_t *p_stat) |
iso9660_stat_t * | iso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[]) |
iso9660_stat_t * | iso9660_fs_stat_translate (CdIo_t *p_cdio, const char psz_path[]) |
iso9660_stat_t * | iso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[]) |
iso9660_stat_t * | iso9660_ifs_stat_translate (iso9660_t *p_iso, const char psz_path[]) |
CdioISO9660FileList_t * | iso9660_filelist_new (void) |
CdioISO9660DirList_t * | iso9660_dirlist_new (void) |
void | iso9660_filelist_free (CdioISO9660FileList_t *p_filelist) |
void | iso9660_dirlist_free (CdioISO9660DirList_t *p_filelist) |
CdioList_t * | iso9660_fs_readdir (CdIo_t *p_cdio, const char psz_path[]) |
CdioList_t * | iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]) |
char * | iso9660_get_application_id (iso9660_pvd_t *p_pvd) |
bool | iso9660_ifs_get_application_id (iso9660_t *p_iso, cdio_utf8_t **p_psz_app_id) |
uint8_t | iso9660_ifs_get_joliet_level (iso9660_t *p_iso) |
uint8_t | iso9660_get_dir_len (const iso9660_dir_t *p_idr) |
char * | iso9660_dir_to_name (const iso9660_dir_t *p_iso9660_dir) |
mode_t | iso9660_get_posix_filemode (const iso9660_stat_t *p_iso_dirent) |
char * | iso9660_get_preparer_id (const iso9660_pvd_t *p_pvd) |
bool | iso9660_ifs_get_preparer_id (iso9660_t *p_iso, cdio_utf8_t **p_psz_preparer_id) |
char * | iso9660_get_publisher_id (const iso9660_pvd_t *p_pvd) |
bool | iso9660_ifs_get_publisher_id (iso9660_t *p_iso, cdio_utf8_t **p_psz_publisher_id) |
uint8_t | iso9660_get_pvd_type (const iso9660_pvd_t *p_pvd) |
const char * | iso9660_get_pvd_id (const iso9660_pvd_t *p_pvd) |
int | iso9660_get_pvd_space_size (const iso9660_pvd_t *p_pvd) |
int | iso9660_get_pvd_block_size (const iso9660_pvd_t *p_pvd) |
int | iso9660_get_pvd_version (const iso9660_pvd_t *pvd) |
char * | iso9660_get_system_id (const iso9660_pvd_t *p_pvd) |
bool_3way_t | iso9660_have_rr (iso9660_t *p_iso, uint64_t u_file_limit) |
bool | iso9660_ifs_get_system_id (iso9660_t *p_iso, cdio_utf8_t **p_psz_system_id) |
lsn_t | iso9660_get_root_lsn (const iso9660_pvd_t *p_pvd) |
char * | iso9660_get_volume_id (const iso9660_pvd_t *p_pvd) |
bool | iso9660_ifs_get_volume_id (iso9660_t *p_iso, cdio_utf8_t **p_psz_volume_id) |
char * | iso9660_get_volumeset_id (const iso9660_pvd_t *p_pvd) |
bool | iso9660_ifs_get_volumeset_id (iso9660_t *p_iso, cdio_utf8_t **p_psz_volumeset_id) |
void | iso9660_pathtable_init (void *pt) |
unsigned int | iso9660_pathtable_get_size (const void *pt) |
uint16_t | iso9660_pathtable_l_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent) |
uint16_t | iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent) |
void | iso9660_set_pvd (void *pd, const char volume_id[], const char application_id[], const char publisher_id[], const char preparer_id[], uint32_t iso_size, const void *root_dir, uint32_t path_table_l_extent, uint32_t path_table_m_extent, uint32_t path_table_size, const time_t *pvd_time) |
void | iso9660_set_evd (void *pd) |
bool | iso9660_ifs_is_xa (const iso9660_t *p_iso) |
Variables | |
PRAGMA_END_PACKED typedef CdioList_t | CdioISO9660FileList_t |
A data type for a list of ISO9660 statbuf file pointers returned from the various Cdio iso9660 readdir routines. More... | |
enum iso_enum1_s | iso_enums1 |
enum iso_flag_enum_s | iso_flag_enums |
enum iso_vd_enum_s | iso_vd_enums |
const char | ISO_STANDARD_ID [sizeof("CD001") -1] |
PRAGMA_BEGIN_PACKED struct iso9660_dtime_s | GNUC_PACKED |
enum iso_extension_enum_s | iso_extension_enums |
The top-level interface header for libiso9660: the ISO-9660 filesystem library; applications include this.
See also the ISO-9660 specification. The freely available European equivalant standard is called ECMA-119.
#define EMPTY_ARRAY_SIZE 0 |
See section 7.4.1
#define iso9660_fs_find_lsn iso9660_find_fs_lsn |
Given a directory pointer, find the filesystem entry that contains lsn and return information about it.
p_cdio | the CD object to read from |
#define iso9660_isachar iso9660_is_achar |
#define iso9660_isdchar iso9660_is_dchar |
For compatibility with < 0.77
#define ISO_EXTENSION_ALL 0xFF |
#define ISO_EXTENSION_JOLIET |
#define ISO_EXTENSION_NONE 0x00 |
#define ISO_MAX_APPLICATION_ID 128 |
Maximum number of characters in an application id.
#define ISO_MAX_PUBLISHER_ID 128 |
Maximum number of characters in a publisher id.
An ISO filename is: abcd.eee -> filename.ext;version#
For ISO-9660 Level 1, the maximum needed string length is:
#define ISO_MAX_VOLUME_ID 32 |
Maximum number of characters in a volume id.
#define ISO_MAX_VOLUMESET_ID 128 |
Maximum number of characters in a volume-set id.
#define ISO_STANDARD_ID "CD001" |
#define ISODCL | ( | from, | |
to | |||
) | ((to) - (from) + 1) |
#define MIN_ISO_SIZE MIN_TRACK_SIZE |
#define MIN_TRACK_SIZE 4*75 |
typedef char achar_t |
See section 7.3.3
typedef CdioList_t CdioISO9660DirList_t |
A data type for a list of ISO9660 statbuf drectory pointer returned from the variious Cdio iso9660 readdir routines.
typedef char dchar_t |
See section 7.4.1
typedef uint8_t iso711_t |
ISO 9660 Integer and Character types.
These are described in the section 7 of the ISO 9660 (or ECMA 119) specification.
typedef int8_t iso712_t |
See section 7.1.1
typedef uint16_t iso721_t |
See section 7.1.2
typedef uint16_t iso722_t |
See section 7.2.1
typedef uint32_t iso723_t |
See section 7.2.2
typedef uint32_t iso731_t |
See section 7.2.3
typedef uint32_t iso732_t |
See section 7.3.1
typedef uint64_t iso733_t |
See section 7.3.2
typedef struct iso9660_dir_s iso9660_dir_t |
typedef struct iso9660_dtime_s iso9660_dtime_t |
typedef struct iso9660_ltime_s iso9660_ltime_t |
typedef struct iso9660_pvd_s iso9660_pvd_t |
typedef struct iso9660_stat_s iso9660_stat_t |
typedef struct iso9660_svd_s iso9660_svd_t |
typedef struct _iso9660_s iso9660_t |
This is an opaque structure.
typedef uint8_t iso_extension_mask_t |
A mask used in iso9660_ifs_read_vd which allows what kinds of extensions we allow, eg. Joliet, Rock Ridge, etc.
typedef enum strncpy_pad_check strncpy_pad_check_t |
enum iso_enum1_s |
The below isn't really an enumeration one would really use in a program; things are done this way so that in a debugger one can to refer to the enumeration value names such as in a debugger expression and get something. With the more common a #define mechanism, the name/value assocation is lost at run time.
enum iso_extension_enum_s |
An enumeration for some of the ISO_EXTENSION_* #defines below. This isn't really an enumeration one would really use in a program it is here to be helpful in debuggers where wants just to refer to the ISO_EXTENSION_*_ names and get something.
Enumerator | |
---|---|
ISO_EXTENSION_JOLIET_LEVEL1 | |
ISO_EXTENSION_JOLIET_LEVEL2 | |
ISO_EXTENSION_JOLIET_LEVEL3 | |
ISO_EXTENSION_ROCK_RIDGE | |
ISO_EXTENSION_HIGH_SIERRA |
enum iso_flag_enum_s |
An enumeration for some of the ISO_* #defines below. This isn't really an enumeration one would really use in a program it is here to be helpful in debuggers where wants just to refer to the ISO_*_ names and get something.
ISO 9660 directory flags.
enum iso_vd_enum_s |
enum strncpy_pad_check |
Close previously opened ISO 9660 image and free resources associated with the image. Call this when done using using an ISO 9660 image.
p_iso | the ISO-9660 file image to get data from |
void iso9660_dir_add_entry_su | ( | void * | dir, |
const char | filename[], | ||
uint32_t | extent, | ||
uint32_t | size, | ||
uint8_t | file_flags, | ||
const void * | su_data, | ||
unsigned int | su_size, | ||
const time_t * | entry_time | ||
) |
unsigned int iso9660_dir_calc_record_size | ( | unsigned int | namelen, |
unsigned int | su_len | ||
) |
void iso9660_dir_init_new | ( | void * | dir, |
uint32_t | self, | ||
uint32_t | ssize, | ||
uint32_t | parent, | ||
uint32_t | psize, | ||
const time_t * | dir_time | ||
) |
void iso9660_dir_init_new_su | ( | void * | dir, |
uint32_t | self, | ||
uint32_t | ssize, | ||
const void * | ssu_data, | ||
unsigned int | ssu_size, | ||
uint32_t | parent, | ||
uint32_t | psize, | ||
const void * | psu_data, | ||
unsigned int | psu_size, | ||
const time_t * | dir_time | ||
) |
char* iso9660_dir_to_name | ( | const iso9660_dir_t * | p_iso9660_dir | ) |
Return the directory name stored in the iso9660_dir_t
A string is allocated: the caller must deallocate. This routine can return NULL if memory allocation fails.
void iso9660_dirlist_free | ( | CdioISO9660DirList_t * | p_filelist | ) |
Free the passed CdioISOC9660Dirlist_t structure.
CdioISO9660DirList_t* iso9660_dirlist_new | ( | void | ) |
Create a new data structure to hold a list of ISO9660 statbuf entries for directory pointers for the files inside a directory.
bool iso9660_dirname_valid_p | ( | const char | psz_path[] | ) |
Check that psz_path is a valid ISO-9660 directory name.
A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs.
True is returned if psz_path is valid.
void iso9660_filelist_free | ( | CdioISO9660FileList_t * | p_filelist | ) |
Free the passed CdioISOC9660FileList_t structure.
CdioISO9660FileList_t* iso9660_filelist_new | ( | void | ) |
Create a new data structure to hold a list of ISO9660 statbuf-entry pointers for the files inside a directory.
iso9660_stat_t* iso9660_fs_find_lsn | ( | CdIo_t * | p_cdio, |
lsn_t | i_lsn | ||
) |
iso9660_stat_t* iso9660_fs_find_lsn_with_path | ( | CdIo_t * | p_cdio, |
lsn_t | i_lsn, | ||
char ** | ppsz_full_filename | ||
) |
Given a directory pointer, find the filesystem entry that contains LSN and return information about it.
p_cdio | the ISO-9660 file image to get data from. |
i_lsn | the LSN to find |
ppsz_full_filename | the place to store the name of the path that has LSN. On entry this should point to NULL. If not, the value will be freed. On exit a value is malloc'd and the caller is responsible for freeing the result. |
bool iso9660_fs_read_pvd | ( | const CdIo_t * | p_cdio, |
iso9660_pvd_t * | p_pvd | ||
) |
Read the Primary Volume Descriptor for a CD. True is returned if read, and false if there was an error.
bool iso9660_fs_read_superblock | ( | CdIo_t * | p_cdio, |
iso_extension_mask_t | iso_extension_mask | ||
) |
Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable.
CdioList_t* iso9660_fs_readdir | ( | CdIo_t * | p_cdio, |
const char | psz_path[] | ||
) |
Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory.
p_cdio | the CD object to read from |
psz_path | path the read the directory from. |
iso9660_stat_t* iso9660_fs_stat | ( | CdIo_t * | p_cdio, |
const char | psz_path[] | ||
) |
Return file status for psz_path. NULL is returned on error.
p_cdio | the CD object to read from |
psz_path | filename path to look up and get information about |
Important note:
You make get different results looking up "/" versus "/." and the latter may give more complete information. "/" will take information from the PVD only, whereas "/." will force a directory read of "/" and find "." and in that Rock-Ridge information might be found which fills in more stat information. Ideally iso9660_fs_stat should be fixed. Patches anyone?
iso9660_stat_t* iso9660_fs_stat_translate | ( | CdIo_t * | p_cdio, |
const char | psz_path[] | ||
) |
Return file status for path name psz_path. NULL is returned on error. pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased.
p_cdio | the CD object to read from |
psz_path | filename path to look up and get information about |
char* iso9660_get_application_id | ( | iso9660_pvd_t * | p_pvd | ) |
Return the PVD's application ID.
p_pvd | the PVD to get data from |
uint8_t iso9660_get_dir_len | ( | const iso9660_dir_t * | p_idr | ) |
bool iso9660_get_dtime | ( | const iso9660_dtime_t * | idr_date, |
bool | b_localtime, | ||
struct tm * | tm | ||
) |
Get Unix time structure from format use in an ISO 9660 directory index record. Even though tm_wday and tm_yday fields are not explicitly in idr_date, they are calculated from the other fields.
If tm is to reflect the localtime, set "b_localtime" true, otherwise tm will reported in GMT.
bool iso9660_get_ltime | ( | const iso9660_ltime_t * | p_ldate, |
struct tm * | p_tm | ||
) |
Get "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure.
mode_t iso9660_get_posix_filemode | ( | const iso9660_stat_t * | p_iso_dirent | ) |
Returns a POSIX mode for a given p_iso_dirent.
char* iso9660_get_preparer_id | ( | const iso9660_pvd_t * | p_pvd | ) |
Return a string containing the preparer id with trailing blanks removed.
char* iso9660_get_publisher_id | ( | const iso9660_pvd_t * | p_pvd | ) |
Return a string containing the PVD's publisher id with trailing blanks removed.
int iso9660_get_pvd_block_size | ( | const iso9660_pvd_t * | p_pvd | ) |
const char* iso9660_get_pvd_id | ( | const iso9660_pvd_t * | p_pvd | ) |
int iso9660_get_pvd_space_size | ( | const iso9660_pvd_t * | p_pvd | ) |
uint8_t iso9660_get_pvd_type | ( | const iso9660_pvd_t * | p_pvd | ) |
int iso9660_get_pvd_version | ( | const iso9660_pvd_t * | pvd | ) |
Return the primary volume id version number (of pvd). If there is an error 0 is returned.
lsn_t iso9660_get_root_lsn | ( | const iso9660_pvd_t * | p_pvd | ) |
Return the LSN of the root directory for pvd. If there is an error CDIO_INVALID_LSN is returned.
char* iso9660_get_system_id | ( | const iso9660_pvd_t * | p_pvd | ) |
Return a string containing the PVD's system id with trailing blanks removed.
char* iso9660_get_volume_id | ( | const iso9660_pvd_t * | p_pvd | ) |
Get the volume ID in the PVD. psz_volume_id is set to NULL if there is some problem in getting this and false is returned.
char* iso9660_get_volumeset_id | ( | const iso9660_pvd_t * | p_pvd | ) |
Return the volumeset ID in the PVD. NULL is returned if there is some problem in getting this.
bool_3way_t iso9660_have_rr | ( | iso9660_t * | p_iso, |
uint64_t | u_file_limit | ||
) |
Return "yup" if any file has Rock-Ridge extensions. Warning: this can be time consuming. On an ISO 9600 image with lots of files but no Rock-Ridge extensions, the entire directory structure will be scanned up to u_file_limit.
p_iso | the ISO-9660 file image to get data from |
u_file_limit | the maximimum number of (non-rock-ridge) files to consider before giving up and returning "dunno". |
"dunno" can also be returned if there was some error encountered such as not being able to allocate memory in processing.
iso9660_stat_t* iso9660_ifs_find_lsn | ( | iso9660_t * | p_iso, |
lsn_t | i_lsn | ||
) |
Given a directory pointer, find the filesystem entry that contains lsn and return information about it.
p_iso | the ISO-9660 file image to get data from. |
i_lsn | the LSN to find |
iso9660_stat_t* iso9660_ifs_find_lsn_with_path | ( | iso9660_t * | p_iso, |
lsn_t | i_lsn, | ||
char ** | ppsz_path | ||
) |
Given a directory pointer, find the filesystem entry that contains lsn and return information about it.
p_iso | pointer to iso_t |
i_lsn | LSN to find |
ppsz_path | full path of lsn filename. On entry *ppsz_path should be NULL. On return it will be allocated an point to the full path of the file at lsn or NULL if the lsn is not found. You should deallocate ppsz_path when you are done using it. |
bool iso9660_ifs_fuzzy_read_superblock | ( | iso9660_t * | p_iso, |
iso_extension_mask_t | iso_extension_mask, | ||
uint16_t | i_fuzz | ||
) |
Read the Super block of an ISO 9660 image but determine framesize and datastart and a possible additional offset. Generally here we are not reading an ISO 9660 image but a CD-Image which contains an ISO 9660 filesystem.
bool iso9660_ifs_get_application_id | ( | iso9660_t * | p_iso, |
cdio_utf8_t ** | p_psz_app_id | ||
) |
Return the PVD's application ID.
p_iso | the ISO-9660 file image to get data from |
p_psz_app_id | the application id set on success. |
NULL is returned if there is some problem in getting this. The caller must free the resturned result using free() if not null.
uint8_t iso9660_ifs_get_joliet_level | ( | iso9660_t * | p_iso | ) |
Return the Joliet level recognized for p_iso.
bool iso9660_ifs_get_preparer_id | ( | iso9660_t * | p_iso, |
cdio_utf8_t ** | p_psz_preparer_id | ||
) |
Get the preparer ID. psz_preparer_id is set to NULL if there is some problem in getting this and false is returned.
bool iso9660_ifs_get_publisher_id | ( | iso9660_t * | p_iso, |
cdio_utf8_t ** | p_psz_publisher_id | ||
) |
Get the publisher ID. psz_publisher_id is set to NULL if there is some problem in getting this and false is returned.
bool iso9660_ifs_get_system_id | ( | iso9660_t * | p_iso, |
cdio_utf8_t ** | p_psz_system_id | ||
) |
Get the system ID. psz_system_id is set to NULL if there is some problem in getting this and false is returned.
bool iso9660_ifs_get_volume_id | ( | iso9660_t * | p_iso, |
cdio_utf8_t ** | p_psz_volume_id | ||
) |
Get the volume ID in the PVD. psz_volume_id is set to NULL if there is some problem in getting this and false is returned.
bool iso9660_ifs_get_volumeset_id | ( | iso9660_t * | p_iso, |
cdio_utf8_t ** | p_psz_volumeset_id | ||
) |
Get the volumeset ID. psz_systemset_id is set to NULL if there is some problem in getting this and false is returned.
Return true if ISO 9660 image has extended attrributes (XA).
bool iso9660_ifs_read_pvd | ( | const iso9660_t * | p_iso, |
iso9660_pvd_t * | p_pvd | ||
) |
Read the Primary Volume Descriptor for an ISO 9660 image. True is returned if read, and false if there was an error.
bool iso9660_ifs_read_superblock | ( | iso9660_t * | p_iso, |
iso_extension_mask_t | iso_extension_mask | ||
) |
Read the Super block of an ISO 9660 image. This is the Primary Volume Descriptor (PVD) and perhaps a Supplemental Volume Descriptor if (Joliet) extensions are acceptable.
CdioList_t* iso9660_ifs_readdir | ( | iso9660_t * | p_iso, |
const char | psz_path[] | ||
) |
Read psz_path (a directory) and return a list of iso9660_stat_t pointers for the files inside that directory.
p_iso | the ISO-9660 file image to get data from |
psz_path | path the read the directory from. |
iso9660_stat_t* iso9660_ifs_stat | ( | iso9660_t * | p_iso, |
const char | psz_path[] | ||
) |
p_iso | the ISO-9660 file image to get data from |
psz_path | path the look up |
iso9660_stat_t* iso9660_ifs_stat_translate | ( | iso9660_t * | p_iso, |
const char | psz_path[] | ||
) |
p_iso | the ISO-9660 file image to get data from |
psz_path | filename path translate |
bool iso9660_is_achar | ( | int | c | ) |
Return true if c is an ACHAR - These are the DCHAR's plus some ASCII symbols including the space symbol.
bool iso9660_is_dchar | ( | int | c | ) |
Return true if c is a DCHAR - a character that can appear in an an ISO-9600 level 1 directory name. These are the ASCII capital letters A-Z, the digits 0-9 and an underscore.
long int iso9660_iso_seek_read | ( | const iso9660_t * | p_iso, |
void * | ptr, | ||
lsn_t | start, | ||
long int | i_size | ||
) |
Seek to a position and then read i_size blocks.
p_iso | the ISO-9660 file image to get data from |
ptr | place to put returned data. It should be able to store a least i_size bytes |
start | location to start reading from |
i_size | number of blocks to read. Each block is ISO_BLOCKSIZE bytes long. |
int iso9660_name_translate | ( | const char * | psz_oldname, |
char * | psz_newname | ||
) |
Convert an ISO-9660 file name which is in the format usually stored in a ISO 9660 directory entry into what's usually listed as the file name in a listing. Lowercase name, and remove trailing ;1's or .;1's and turn the other ;'s into version numbers.
psz_oldname | the ISO-9660 filename to be translated. |
psz_newname | returned string. The caller allocates this and it should be at least the size of psz_oldname. |
int iso9660_name_translate_ext | ( | const char * | psz_oldname, |
char * | psz_newname, | ||
uint8_t | i_joliet_level | ||
) |
Convert an ISO-9660 file name which is in the format usually stored in a ISO 9660 directory entry into what's usually listed as the file name in a listing. Lowercase name if no Joliet Extension interpretation. Remove trailing ;1's or .;1's and turn the other ;'s into version numbers.
psz_oldname | the ISO-9660 filename to be translated. |
psz_newname | returned string. The caller allocates this and it should be at least the size of psz_oldname. |
i_joliet_level | 0 if not using Joliet Extension. Otherwise the Joliet level. |
iso9660_t* iso9660_open | ( | const char * | psz_path | ) |
Open an ISO 9660 image for reading. Maybe in the future we will have a mode. NULL is returned on error.
psz_path | full path of ISO9660 file. |
iso9660_t* iso9660_open_ext | ( | const char * | psz_path, |
iso_extension_mask_t | iso_extension_mask | ||
) |
Open an ISO 9660 image for reading allowing various ISO 9660 extensions. Maybe in the future we will have a mode. NULL is returned on error.
iso9660_t* iso9660_open_fuzzy | ( | const char * | psz_path, |
uint16_t | i_fuzz | ||
) |
Open an ISO 9660 image for "fuzzy" reading. This means that we will try to guess various internal offset based on internal checks. This may be useful when trying to read an ISO 9660 image contained in a file format that libiso9660 doesn't know natively (or knows imperfectly.)
Some tolerence allowed for positioning the ISO 9660 image. We scan for STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz).
Maybe in the future we will have a mode. NULL is returned on error.
iso9660_t* iso9660_open_fuzzy_ext | ( | const char * | psz_path, |
iso_extension_mask_t | iso_extension_mask, | ||
uint16_t | i_fuzz | ||
) |
Open an ISO 9660 image for reading with some tolerence for positioning of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set the eventual offset to adjust by (as long as that is <= i_fuzz).
Maybe in the future we will have a mode. NULL is returned on error.
char* iso9660_pathname_isofy | ( | const char | psz_path[], |
uint16_t | i_version | ||
) |
Take psz_path and a version number and turn that into a ISO-9660 pathname. (That's just the pathname followd by ";" and the version number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version
bool iso9660_pathname_valid_p | ( | const char | psz_path[] | ) |
Check that psz_path is a valid ISO-9660 pathname.
A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the file prefix and 3 characters in the extension (or portion after a dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs.
True is returned if psz_path is valid.
unsigned int iso9660_pathtable_get_size | ( | const void * | pt | ) |
void iso9660_pathtable_init | ( | void * | pt | ) |
Zero's out pathable. Do this first.
uint16_t iso9660_pathtable_l_add_entry | ( | void * | pt, |
const char | name[], | ||
uint32_t | extent, | ||
uint16_t | parent | ||
) |
uint16_t iso9660_pathtable_m_add_entry | ( | void * | pt, |
const char | name[], | ||
uint32_t | extent, | ||
uint16_t | parent | ||
) |
void iso9660_set_dtime | ( | const struct tm * | tm, |
iso9660_dtime_t * | idr_date | ||
) |
Set time in format used in ISO 9660 directory index record from a Unix time structure.
void iso9660_set_dtime_with_timezone | ( | const struct tm * | p_tm, |
int | timezone, | ||
iso9660_dtime_t * | p_idr_date | ||
) |
Set time in format used in ISO 9660 directory index record from a Unix time structure. timezone is given as an offset correction in minutes.
void iso9660_set_evd | ( | void * | pd | ) |
void iso9660_set_ltime | ( | const struct tm * | _tm, |
iso9660_ltime_t * | p_pvd_date | ||
) |
Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure.
void iso9660_set_ltime_with_timezone | ( | const struct tm * | _tm, |
int | timezone, | ||
iso9660_ltime_t * | p_pvd_date | ||
) |
Set "long" time in format used in ISO 9660 primary volume descriptor from a Unix time structure.
void iso9660_set_pvd | ( | void * | pd, |
const char | volume_id[], | ||
const char | application_id[], | ||
const char | publisher_id[], | ||
const char | preparer_id[], | ||
uint32_t | iso_size, | ||
const void * | root_dir, | ||
uint32_t | path_table_l_extent, | ||
uint32_t | path_table_m_extent, | ||
uint32_t | path_table_size, | ||
const time_t * | pvd_time | ||
) |
=====================================================================
void iso9660_stat_free | ( | iso9660_stat_t * | p_stat | ) |
Free the passed iso9660_stat_t structure.
p_stat | iso9660 stat buffer to free. |
char* iso9660_strncpy_pad | ( | char | dst[], |
const char | src[], | ||
size_t | len, | ||
enum strncpy_pad_check | _check | ||
) |
Pad string src with spaces to size len and copy this to dst. If len is less than the length of src, dst will be truncated to the first len characters of src.
src can also be scanned to see if it contains only ACHARs, DCHARs, 7-bit ASCII chars depending on the enumeration _check.
In addition to getting changed, dst is the return value. Note: this string might not be NULL terminated.
PRAGMA_END_PACKED typedef CdioList_t CdioISO9660FileList_t |
A data type for a list of ISO9660 statbuf file pointers returned from the various Cdio iso9660 readdir routines.
struct iso9660_svd_s GNUC_PACKED |
enum iso_enum1_s iso_enums1 |
enum iso_extension_enum_s iso_extension_enums |
enum iso_flag_enum_s iso_flag_enums |
const char ISO_STANDARD_ID[sizeof("CD001") -1] |
String inside frame which identifies an ISO 9660 filesystem. This string is the "id" field of an iso9660_pvd_t or an iso9660_svd_t.
enum iso_vd_enum_s iso_vd_enums |