iso_directory_record_t -> iso9660_dir_t
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: iso9660.h,v 1.4 2003/08/31 01:40:00 rocky Exp $
|
$Id: iso9660.h,v 1.5 2003/08/31 02:51:41 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -56,7 +56,7 @@ enum strncpy_pad_check {
|
|||||||
|
|
||||||
/* Defined fully in iso9660_private.h */
|
/* Defined fully in iso9660_private.h */
|
||||||
typedef struct iso_primary_descriptor iso9660_pvd_t;
|
typedef struct iso_primary_descriptor iso9660_pvd_t;
|
||||||
typedef struct iso_directory_record iso_directory_record_t;
|
typedef struct iso_directory_record iso9660_dir_t;
|
||||||
|
|
||||||
char *
|
char *
|
||||||
iso9660_strncpy_pad(char dst[], const char src[], size_t len,
|
iso9660_strncpy_pad(char dst[], const char src[], size_t len,
|
||||||
@@ -127,14 +127,14 @@ iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent,
|
|||||||
uint16_t parent);
|
uint16_t parent);
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
iso9660_get_dir_len(const iso_directory_record_t *idr);
|
iso9660_get_dir_len(const iso9660_dir_t *idr);
|
||||||
|
|
||||||
#if FIXME
|
#if FIXME
|
||||||
uint8_t
|
uint8_t
|
||||||
iso9660_get_dir_size(const iso_directory_record_t *idr);
|
iso9660_get_dir_size(const iso9660_dir_t *idr);
|
||||||
|
|
||||||
lsn_t
|
lsn_t
|
||||||
iso9660_get_dir_extent(const iso_directory_record_t *idr);#
|
iso9660_get_dir_extent(const iso9660_dir_t *idr);#
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: iso9660.c,v 1.4 2003/08/31 01:40:00 rocky Exp $
|
$Id: iso9660.c,v 1.5 2003/08/31 02:51:41 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
||||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
#include "cdio_assert.h"
|
#include "cdio_assert.h"
|
||||||
#include "bytesex.h"
|
#include "bytesex.h"
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: iso9660.c,v 1.4 2003/08/31 01:40:00 rocky Exp $";
|
static const char _rcsid[] = "$Id: iso9660.c,v 1.5 2003/08/31 02:51:41 rocky Exp $";
|
||||||
|
|
||||||
/* some parameters... */
|
/* some parameters... */
|
||||||
#define SYSTEM_ID "CD-RTOS CD-BRIDGE"
|
#define SYSTEM_ID "CD-RTOS CD-BRIDGE"
|
||||||
@@ -648,7 +648,7 @@ iso9660_pathname_isofy (const char pathname[], uint16_t version)
|
|||||||
|
|
||||||
#if FIXME
|
#if FIXME
|
||||||
lsn_t
|
lsn_t
|
||||||
iso9660_get_dir_extent(const iso_directory_record_t *idr)
|
iso9660_get_dir_extent(const iso9660_dir_t *idr)
|
||||||
{
|
{
|
||||||
if (NULL == idr) return 0;
|
if (NULL == idr) return 0;
|
||||||
return from_733(idr->extent);
|
return from_733(idr->extent);
|
||||||
@@ -656,7 +656,7 @@ iso9660_get_dir_extent(const iso_directory_record_t *idr)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint8_t
|
uint8_t
|
||||||
iso9660_get_dir_len(const iso_directory_record_t *idr)
|
iso9660_get_dir_len(const iso9660_dir_t *idr)
|
||||||
{
|
{
|
||||||
if (NULL == idr) return 0;
|
if (NULL == idr) return 0;
|
||||||
return idr->length;
|
return idr->length;
|
||||||
@@ -664,7 +664,7 @@ iso9660_get_dir_len(const iso_directory_record_t *idr)
|
|||||||
|
|
||||||
#if FIXME
|
#if FIXME
|
||||||
uint8_t
|
uint8_t
|
||||||
iso9660_get_dir_size(const iso_directory_record_t *idr)
|
iso9660_get_dir_size(const iso9660_dir_t *idr)
|
||||||
{
|
{
|
||||||
if (NULL == idr) return 0;
|
if (NULL == idr) return 0;
|
||||||
return from_733(idr->size);
|
return from_733(idr->size);
|
||||||
@@ -712,7 +712,7 @@ iso9660_get_root_lsn(const iso9660_pvd_t *pvd)
|
|||||||
if (NULL == pvd)
|
if (NULL == pvd)
|
||||||
return CDIO_INVALID_LSN;
|
return CDIO_INVALID_LSN;
|
||||||
else {
|
else {
|
||||||
iso_directory_record_t *idr = (void *) pvd->root_directory_record;
|
iso9660_dir_t *idr = (void *) pvd->root_directory_record;
|
||||||
if (NULL == idr) return CDIO_INVALID_LSN;
|
if (NULL == idr) return CDIO_INVALID_LSN;
|
||||||
return(from_733 (idr->extent));
|
return(from_733 (idr->extent));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: cd-info.c,v 1.22 2003/08/29 03:03:07 rocky Exp $
|
$Id: cd-info.c,v 1.23 2003/08/31 02:51:41 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
|
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
|
||||||
@@ -54,6 +54,8 @@
|
|||||||
#include <cdio/util.h>
|
#include <cdio/util.h>
|
||||||
#include <cdio/cd_types.h>
|
#include <cdio/cd_types.h>
|
||||||
|
|
||||||
|
#include "ds.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
# include <linux/version.h>
|
# include <linux/version.h>
|
||||||
@@ -587,6 +589,88 @@ print_vcd_info(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ISO9600_FINISHED
|
||||||
|
static void
|
||||||
|
print_iso9660_recurse (const CdIo *cdio, const char pathname[])
|
||||||
|
{
|
||||||
|
CdioList *entlist;
|
||||||
|
CdioList *dirlist = _cdio_list_new ();
|
||||||
|
CdioListNode *entnode;
|
||||||
|
|
||||||
|
entlist = vcd_image_source_fs_readdir (cdio, pathname);
|
||||||
|
|
||||||
|
printf ("%s:\n", pathname);
|
||||||
|
|
||||||
|
cdio_assert (entlist != NULL);
|
||||||
|
|
||||||
|
/* just iterate */
|
||||||
|
|
||||||
|
_CDIO_LIST_FOREACH (entnode, entlist)
|
||||||
|
{
|
||||||
|
char *_name = _cdio_list_node_data (entnode);
|
||||||
|
char _fullname[4096] = { 0, };
|
||||||
|
vcd_image_stat_t statbuf;
|
||||||
|
|
||||||
|
snprintf (_fullname, sizeof (_fullname), "%s%s", pathname, _name);
|
||||||
|
|
||||||
|
if (vcd_image_source_fs_stat (cdio, _fullname, &statbuf))
|
||||||
|
cdio_assert_not_reached ();
|
||||||
|
|
||||||
|
strncat (_fullname, "/", sizeof (_fullname));
|
||||||
|
|
||||||
|
if (statbuf.type == _STAT_DIR
|
||||||
|
&& strcmp (_name, ".")
|
||||||
|
&& strcmp (_name, ".."))
|
||||||
|
_cdio_list_append (dirlist, strdup (_fullname));
|
||||||
|
|
||||||
|
printf ( " %c %s %d %d [fn %.2d] [LSN %6d] ",
|
||||||
|
(statbuf.type == _STAT_DIR) ? 'd' : '-',
|
||||||
|
vcdinfo_get_xa_attr_str (statbuf.xa.attributes),
|
||||||
|
uint16_from_be (statbuf.xa.user_id),
|
||||||
|
uint16_from_be (statbuf.xa.group_id),
|
||||||
|
statbuf.xa.filenum,
|
||||||
|
statbuf.lsn);
|
||||||
|
|
||||||
|
if (uint16_from_be(statbuf.xa.attributes) & XA_ATTR_MODE2FORM2) {
|
||||||
|
printf ("%9d (%9d)",
|
||||||
|
statbuf.secsize * M2F2_SECTOR_SIZE,
|
||||||
|
statbuf.size);
|
||||||
|
} else {
|
||||||
|
printf ("%9d", statbuf.size);
|
||||||
|
}
|
||||||
|
printf (" %s\n", _name);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_cdio_list_free (entlist, true);
|
||||||
|
|
||||||
|
printf ("\n");
|
||||||
|
|
||||||
|
/* now recurse */
|
||||||
|
|
||||||
|
_CDIO_LIST_FOREACH (entnode, dirlist)
|
||||||
|
{
|
||||||
|
char *_fullname = _cdio_list_node_data (entnode);
|
||||||
|
|
||||||
|
print_iso9660_recurse (cdio, _fullname);
|
||||||
|
}
|
||||||
|
|
||||||
|
_cdio_list_free (dirlist, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_iso9660_fs (const CdIo *cdio)
|
||||||
|
{
|
||||||
|
const iso9660_pvd_t *pvd = vcdinfo_get_pvd(cdio);
|
||||||
|
lsn_t extent = iso9660_get_root_lsn(pvd);
|
||||||
|
|
||||||
|
printf ("ISO9660 filesystem\n");
|
||||||
|
printf (" root dir in PVD set to lsn %d\n\n", extent);
|
||||||
|
|
||||||
|
print_iso9660_recurse (cdio, "/");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_analysis(int ms_offset, cdio_analysis_t cdio_analysis,
|
print_analysis(int ms_offset, cdio_analysis_t cdio_analysis,
|
||||||
cdio_fs_anal_t fs, int first_data, unsigned int num_audio,
|
cdio_fs_anal_t fs, int first_data, unsigned int num_audio,
|
||||||
|
|||||||
Reference in New Issue
Block a user