コード例 #1
0
ファイル: iso9660_fs.c プロジェクト: OS2World/MM-SOUND-xine
/*!
  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;
}
コード例 #2
0
ファイル: iso9660_fs.c プロジェクト: flyingtime/boxee
/*!
  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;
}
コード例 #3
0
ファイル: iso9660_fs.c プロジェクト: AaronDnz/xbmc
/*!
  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;
}
コード例 #4
0
ファイル: iso9660_fs.c プロジェクト: AaronDnz/xbmc
/*!
  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;
}