additions and mods for lzma.
[coreboot.git] / src / stream / fs_stream.c
1 #include <console/console.h>
2 #include <stdlib.h>
3 #include <stddef.h>
4 #include <stream/read_bytes.h>
5 #include <string.h>
6 #include <fs/fs.h>
7
8 char *boot_file;
9
10 int stream_init(void)
11 {
12         return file_open(boot_file);
13 }
14
15
16 void stream_fini(void)
17 {
18         return;
19 }
20
21 byte_offset_t stream_skip(byte_offset_t count)
22 {
23         unsigned long pos = file_pos();
24         if (file_seek(count+pos) != count+pos)
25                 return 0;
26         return count;
27 }
28
29 byte_offset_t stream_read(void *vdest, byte_offset_t count)
30 {
31         return file_read(vdest, count);
32 }