Changeset d145ecb in mainline for uspace/lib/riff/src/chunk.c


Ignore:
Timestamp:
2020-09-21T14:02:42Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aaf962e6
Parents:
003c413
Message:

Libriff needs unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/riff/src/chunk.c

    r003c413 rd145ecb  
    152152
    153153        cksize = pos - wchunk->ckstart;
     154        if (pos % 2 != 0)
     155                ++pos;
    154156
    155157        if (fseek(rw->f, wchunk->ckstart - 4, SEEK_SET) < 0)
     
    176178 * @return EOK on success, EIO on error.
    177179 */
    178 errno_t riff_wchunk_write(riffw_t *rw, void *data, size_t bytes)
     180errno_t riff_write(riffw_t *rw, void *data, size_t bytes)
    179181{
    180182        size_t nw;
     
    281283                return rc;
    282284
     285        if (nread != sizeof(vle))
     286                return ELIMIT;
     287
    283288        *v = uint32_t_le2host(vle);
    284289        return EOK;
     
    315320error:
    316321        return rc;
     322}
     323
     324/** Return chunk data size.
     325 *
     326 * @param rchunk RIFF chunk
     327 * @return Pure data size (excluding type+size header) in bytes
     328 */
     329uint32_t riff_rchunk_size(riff_rchunk_t *rchunk)
     330{
     331        return rchunk->cksize;
    317332}
    318333
Note: See TracChangeset for help on using the changeset viewer.