Added iso9660 driver (not yet working).
[planlOS.git] / system / modules / iso9660 / file.c
blob71f9732444735222964fc20c717b93a8322b6f3e
1 /*
2 * iso9660 - An iso9660 CDI driver with Rockridge support
4 * Copyright (C) 2008 Janosch Gräf
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 3 of the License, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, see <http://www.gnu.org/licenses/>.
20 #include "cdi/fs.h"
21 #include "cdi/cache.h"
23 #include "iso9660_cdi.h"
25 /**
26 * Reads from file
27 * @param stream CDI FS stream
28 * @param start Offset in flie
29 * @param size How many bytes to read
30 * @param buffer Buffer to store data in
31 * @return How many bytes read
33 size_t iso9660_fs_file_read(struct cdi_fs_stream *stream,uint64_t start,size_t size,void *buffer) {
34 debug("iso9660_fs_file_read(0x%x,0x%x,0x%x,0x%x,0x%x)\n",stream,start,size,buffer);
35 struct iso9660_fs_res *res = (struct iso9660_fs_res*)stream->res;
37 if (start>res->data_size) return 0;
38 if (start+size>res->data_size) size = res->data_size-start;
40 iso9660_read(res,start,size,buffer);
41 //cdi_cache_entry_read(res->cache_entry,start,size,buffer);
42 return size;