2008-04-12 21:17:49 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (c) 2008 Laurent Vivier <Laurent@lvivier.info>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "libext2.h"
|
2008-04-20 16:25:24 +00:00
|
|
|
#include "ext2.h"
|
2008-04-12 21:17:49 +00:00
|
|
|
#include "ext2_utils.h"
|
|
|
|
|
2008-04-20 16:25:24 +00:00
|
|
|
size_t ext2_read(stream_FILE *_file, void *buf, size_t count)
|
2008-04-12 21:17:49 +00:00
|
|
|
{
|
2008-04-20 16:25:24 +00:00
|
|
|
ext2_FILE *file = (ext2_FILE*)_file;
|
2008-04-12 21:17:49 +00:00
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = ext2_read_data(file->volume, file->inode, file->offset,
|
|
|
|
buf, count);
|
|
|
|
if (ret == -1)
|
|
|
|
return -1;
|
|
|
|
file->offset += ret;
|
|
|
|
return ret;
|
|
|
|
}
|