fs/romfs/fs_romfsutil.c
int romfs_parsedirentry(struct romfs_mountpt_s *rm, uint32_t offset,
                        uint32_t *poffset, uint32_t *pnext, uint32_t *pinfo,
                        uint32_t *psize)
{
  uint32_t save;
  uint32_t next;
  uint32_t ndx;
  int      ret;

  /* Read the sector into memory */

  ndx = romfs_devcacheread(rm, offset);
  if (ndx < 0)
    {
      return ndx;
    }

  /* Yes.. Save the first 'next' value.  That has the offset needed to
   * traverse the parent directory.  But we may need to change the type
   * after we follow the hard links.
   */

  save = romfs_devread32(rm, ndx + ROMFS_FHDR_NEXT);

  /* Traverse hardlinks as necessary to get to the real file header */

  ret = romfs_followhardlinks(rm, offset, poffset);
  if (ret < 0)
    {
      return ret;
    }

  if (*poffset != offset)
    {
      ndx = romfs_devcacheread(rm, *poffset);
      if (ndx < 0)
        {
          return ndx;
        }
    }

  /* Because everything is chunked and aligned to 16-bit boundaries,
   * we know that most the basic node info fits into the sector.  The
   * associated name may not, however.
   */

  next   = romfs_devread32(rm, ndx + ROMFS_FHDR_NEXT);
  *pnext = (save & RFNEXT_OFFSETMASK) | (next & RFNEXT_ALLMODEMASK);
  *pinfo = romfs_devread32(rm, ndx + ROMFS_FHDR_INFO);
  *psize = romfs_devread32(rm, ndx + ROMFS_FHDR_SIZE);

  return OK;
}
/****************************************************************************
 * Name: romfs_parsedirentry
 *
 * Description:
 *   Return the directory entry at this offset.  If rf is NULL, then the
 *   mount device resources are used.  Otherwise, file resources are used.
 *
 ****************************************************************************/
romfs_parsedirentry
Description:
Return the directory entry at this offset.  If rf is NULL, then the
mount device resources are used.  Otherwise, file resources are used.
romfs_parsedirentry Description : Return the directory entry at this offset . If rf is NULL then the mount device resources are used . Otherwise file resources are used .
int romfs_parsedirentry(struct romfs_mountpt_s *rm, uint32_t offset,
                        uint32_t *poffset, uint32_t *pnext, uint32_t *pinfo,
                        uint32_t *psize)
{
  uint32_t save;
  uint32_t next;
  uint32_t ndx;
  int      ret;
  ndx = romfs_devcacheread(rm, offset);
  if (ndx < 0)
    {
      return ndx;
    }
  save = romfs_devread32(rm, ndx + ROMFS_FHDR_NEXT);
  ret = romfs_followhardlinks(rm, offset, poffset);
  if (ret < 0)
    {
      return ret;
    }
  if (*poffset != offset)
    {
      ndx = romfs_devcacheread(rm, *poffset);
      if (ndx < 0)
        {
          return ndx;
        }
    }
  next   = romfs_devread32(rm, ndx + ROMFS_FHDR_NEXT);
  *pnext = (save & RFNEXT_OFFSETMASK) | (next & RFNEXT_ALLMODEMASK);
  *pinfo = romfs_devread32(rm, ndx + ROMFS_FHDR_INFO);
  *psize = romfs_devread32(rm, ndx + ROMFS_FHDR_SIZE);
  return OK;
}
int romfs_parsedirentry ( struct romfs_mountpt_s * rm , uint32_t offset , uint32_t * poffset , uint32_t * pnext , uint32_t * pinfo , uint32_t * psize ) { uint32_t save ; uint32_t next ; uint32_t ndx ; int ret ; ndx = romfs_devcacheread ( rm , offset ) ; if ( ndx < 0 ) { return ndx ; } save = romfs_devread32 ( rm , ndx + ROMFS_FHDR_NEXT ) ; ret = romfs_followhardlinks ( rm , offset , poffset ) ; if ( ret < 0 ) { return ret ; } if ( * poffset != offset ) { ndx = romfs_devcacheread ( rm , * poffset ) ; if ( ndx < 0 ) { return ndx ; } } next = romfs_devread32 ( rm , ndx + ROMFS_FHDR_NEXT ) ; * pnext = ( save & RFNEXT_OFFSETMASK ) | ( next & RFNEXT_ALLMODEMASK ) ; * pinfo = romfs_devread32 ( rm , ndx + ROMFS_FHDR_INFO ) ; * psize = romfs_devread32 ( rm , ndx + ROMFS_FHDR_SIZE ) ; return OK ; }
Name: romfs_parsedirentry
 Description:
   Return the directory entry at this offset.
Name : romfs_parsedirentry Description : Return the directory entry at this offset .
/* Read the sector into memory */ /* Yes.. Save the first 'next' value.  That has the offset needed to
   * traverse the parent directory.  But we may need to change the type
   * after we follow the hard links.
   */ /* Traverse hardlinks as necessary to get to the real file header */ /* Because everything is chunked and aligned to 16-bit boundaries,
   * we know that most the basic node info fits into the sector.  The
   * associated name may not, however.
   */