/* Return a pointer to a ISO 9660 stat buffer or NULL if there's an error */ static iso9660_stat_t * _fs_stat_root (CdIo_t *p_cdio) { if (!p_cdio) return NULL; { iso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL; generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env; iso9660_dir_t *p_iso9660_dir; iso9660_stat_t *p_stat; bool_3way_t b_xa; if (!p_env->i_joliet_level) iso_extension_mask &= ~ISO_EXTENSION_JOLIET; /* FIXME try also with Joliet.*/ if ( !iso9660_fs_read_superblock (p_cdio, iso_extension_mask) ) { cdio_warn("Could not read ISO-9660 Superblock."); return NULL; } switch(cdio_get_discmode(p_cdio)) { case CDIO_DISC_MODE_CD_XA: b_xa = yep; break; case CDIO_DISC_MODE_CD_DATA: b_xa = nope; break; default: b_xa = dunno; } #ifdef HAVE_JOLIET p_iso9660_dir = p_env->i_joliet_level ? &(p_env->svd.root_directory_record) : &(p_env->pvd.root_directory_record) ; #else p_iso9660_dir = &(p_env->pvd.root_directory_record) ; #endif p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, b_xa, p_env->i_joliet_level); return p_stat; } }
/* Return a pointer to a ISO 9660 stat buffer or NULL if there's an error */ static iso9660_stat_t * _fs_stat_root (CdIo_t *p_cdio) { if (!p_cdio) return NULL; { iso_extension_mask_t iso_extension_mask = ISO_EXTENSION_ALL; generic_img_private_t *p_env = (generic_img_private_t *) p_cdio->env; bool b_mode2 = cdio_get_track_green(p_cdio, 1); iso9660_dir_t *p_iso9660_dir; iso9660_stat_t *p_stat; if (!p_env->i_joliet_level) iso_extension_mask &= ~ISO_EXTENSION_JOLIET; /* FIXME try also with Joliet.*/ if ( !iso9660_fs_read_superblock (p_cdio, iso_extension_mask) ) { cdio_warn("Could not read ISO-9660 Superblock."); return NULL; } #ifdef HAVE_JOLIET p_iso9660_dir = p_env->i_joliet_level ? &(p_env->svd.root_directory_record) : &(p_env->pvd.root_directory_record) ; #else p_iso9660_dir = &(p_env->pvd.root_directory_record) ; #endif p_stat = _iso9660_dir_to_statbuf (p_iso9660_dir, b_mode2, p_env->i_joliet_level); return p_stat; } }
/*! 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. */ bool ISO9660::FS::read_superblock (iso_extension_mask_t iso_extension_mask) { return iso9660_fs_read_superblock (p_cdio, iso_extension_mask); }