Add codecs to librbcodec.

Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
This commit is contained in:
Sean Bartell 2011-06-25 21:32:25 -04:00 committed by Nils Wallménius
parent a0009907de
commit f40bfc9267
757 changed files with 122 additions and 122 deletions

View file

@ -0,0 +1,16 @@
/* Memory buffer reader, simulates file read
@ gama
*/
#include "mbreader.h"
int mbread(struct mbreader_t *md, void *buf, size_t n)
{
if (!md) return -1;
size_t read_bytes = (md->offset+n) > md->size ?
md->size-md->offset : n;
memcpy(buf,md->ptr + md->offset,read_bytes);
md->offset += read_bytes;
return read_bytes;
}