Esempio n. 1
0
/*!
  Get file status for psz_path into stat. NULL is returned on error.
 */
iso9660_stat_t *
iso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[])
{
  iso9660_stat_t *p_root;
  char **splitpath;
  iso9660_stat_t *stat;

  if (!p_iso)    return NULL;
  if (!psz_path) return NULL;

  p_root = _ifs_stat_root (p_iso);
  if (!p_root) return NULL;

  splitpath = _cdio_strsplit (psz_path, '/');
  stat = _fs_iso_stat_traverse (p_iso, p_root, splitpath);
  free(p_root);
  _cdio_strfreev (splitpath);

  return stat;
}
Esempio n. 2
0
/*!
  Get file status for pathname into stat. 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.
 */
iso9660_stat_t *
iso9660_ifs_stat_translate (iso9660_t *p_iso, const char pathname[])
{
  iso9660_stat_t *p_root;
  char **p_psz_splitpath;
  iso9660_stat_t *p_stat;

  if (!p_iso)    return NULL;
  if (!pathname) return NULL;

  p_root = _fs_stat_iso_root (p_iso);
  if (NULL == p_root) return NULL;

  p_psz_splitpath = _cdio_strsplit (pathname, '/');
  p_stat = _fs_iso_stat_traverse (p_iso, p_root, p_psz_splitpath, true);
  free(p_root);
  _cdio_strfreev (p_psz_splitpath);

  return p_stat;
}
Esempio n. 3
0
/*!
  Get file status for pathname into stat. NULL is returned on error.
 */
iso9660_stat_t *
iso9660_ifs_stat (iso9660_t *p_iso, const char pathname[])
{
  iso9660_stat_t *p_root;
  char **splitpath;
  iso9660_stat_t *stat;

  if (!p_iso)    return NULL;
  if (!pathname) return NULL;

  p_root = _fs_stat_iso_root (p_iso);
  if (!p_root) return NULL;

  splitpath = _cdio_strsplit (pathname, '/');
  stat = _fs_iso_stat_traverse (p_iso, p_root, splitpath, false);
  free(p_root);
  /*** FIXME _cdio_strfreev (splitpath); ***/

  return stat;
}
Esempio n. 4
0
/*!
  Get file status for pathname into stat. As with libc's stat, 0 is returned
  if no error and -1 on error.
 */
int
iso9660_fs_stat (const CdIo *cdio, const char pathname[], 
		 /*out*/ iso9660_stat_t *stat, bool is_mode2)
{
  iso9660_stat_t _root;
  int retval;
  char **splitpath;

  cdio_assert (cdio != NULL);
  cdio_assert (pathname != NULL);
  cdio_assert (stat != NULL);

  _fs_stat_root (cdio, &_root, is_mode2);

  splitpath = _cdio_strsplit (pathname, '/');
  retval = _fs_stat_traverse (cdio, &_root, splitpath, stat, is_mode2);
  _cdio_strfreev (splitpath);

  return retval;
}
Esempio n. 5
0
/*!
  Get file status for psz_path into stat. NULL is returned on error.
 */
iso9660_stat_t *
iso9660_fs_stat (CdIo_t *p_cdio, const char psz_path[])
{
  iso9660_stat_t *p_root;
  char **p_psz_splitpath;
  iso9660_stat_t *p_stat;

  if (!p_cdio)   return NULL;
  if (!psz_path) return NULL;

  p_root = _fs_stat_root (p_cdio);

  if (!p_root)   return NULL;

  p_psz_splitpath = _cdio_strsplit (psz_path, '/');
  p_stat = _fs_stat_traverse (p_cdio, p_root, p_psz_splitpath);
  free(p_root);
  _cdio_strfreev (p_psz_splitpath);

  return p_stat;
}
Esempio n. 6
0
/*!
  Get file status for pathname into stat. 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.
 */
iso9660_stat_t *
iso9660_fs_stat_translate (CdIo_t *p_cdio, const char pathname[], 
			   bool b_mode2)
{
  iso9660_stat_t *p_root;
  char **p_psz_splitpath;
  iso9660_stat_t *p_stat;

  if (!p_cdio)  return NULL;
  if (pathname) return NULL;

  p_root = _fs_stat_root (p_cdio);
  if (!p_root) return NULL;

  p_psz_splitpath = _cdio_strsplit (pathname, '/');
  p_stat = _fs_stat_traverse (p_cdio, p_root, p_psz_splitpath, b_mode2, true);
  free(p_root);
  _cdio_strfreev (p_psz_splitpath);

  return p_stat;
}
Esempio n. 7
0
/*!
  Get file status for psz_path into stat. 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.
 */
static iso9660_stat_t *
fs_stat_translate (void *p_image, stat_root_t stat_root, 
		   stat_traverse_t stat_traverse,
		   const char psz_path[])
{
  iso9660_stat_t *p_root;
  char **p_psz_splitpath;
  iso9660_stat_t *p_stat;

  if (!p_image)  return NULL;
  if (!psz_path) return NULL;

  p_root = stat_root (p_image);
  if (!p_root) return NULL;

  p_psz_splitpath = _cdio_strsplit (psz_path, '/');
  p_stat = stat_traverse (p_image, p_root, p_psz_splitpath);
  free(p_root);
  _cdio_strfreev (p_psz_splitpath);

  return p_stat;
}
Esempio n. 8
0
/*!
  Get file status for pathname into stat. NULL is returned on error.
 */
iso9660_stat_t *
iso9660_fs_stat (CdIo_t *p_cdio, const char pathname[])
{
  iso9660_stat_t *p_root;
  char **p_psz_splitpath;
  iso9660_stat_t *p_stat;
  /* A bit of a hack, we'll assume track 1 contains ISO_PVD_SECTOR.*/
  bool b_mode2;

  if (!p_cdio)   return NULL;
  if (!pathname) return NULL;

  p_root = _fs_stat_root (p_cdio);
  if (!p_root) return NULL;

  b_mode2 = cdio_get_track_green(p_cdio, 1);
  p_psz_splitpath = _cdio_strsplit (pathname, '/');
  p_stat = _fs_stat_traverse (p_cdio, p_root, p_psz_splitpath, b_mode2, false);
  free(p_root);
  _cdio_strfreev (p_psz_splitpath);

  return p_stat;
}