|
GitOS
|
#include "disk_streamer.h"#include <kernel.h>#include <common/assert.h>#include <stdbool.h>#include "disk.h"#include "memory/heap/kheap.h"Functions | |
| struct disk_stream * | diskstreamer_new (int disk_id) |
| Allocates and sets up new disk_stream struct. | |
| int | diskstreamer_seek (struct disk_stream *stream, int pos) |
| Seeks into specified offset in stream. | |
| int | diskstreamer_read (struct disk_stream *stream, void *out, int total) |
| Reads specified amount of bytes into buffer. | |
| void | diskstreamer_close (struct disk_stream *stream) |
| Frees allocated disk_stream. | |
| void diskstreamer_close | ( | struct disk_stream * | stream | ) |
| struct disk_stream * diskstreamer_new | ( | int | disk_id | ) |
Allocates and sets up new disk_stream struct.
| disk_id | Disk ID |
References disk_stream::disk, disk_get(), kzalloc(), and disk_stream::pos.
| int diskstreamer_read | ( | struct disk_stream * | stream, |
| void * | out, | ||
| int | total ) |
Reads specified amount of bytes into buffer.
| stream | Stream to read |
| out | Target buffer |
| total | Total amount of bytes to read |
References assert, disk_stream::disk, disk_read_block(), DISK_SECTOR_SIZE, offset, and disk_stream::pos.
| int diskstreamer_seek | ( | struct disk_stream * | stream, |
| int | pos ) |
Seeks into specified offset in stream.
| stream | Stream to seek |
| pos | Bytes from 0 |
References disk_stream::pos.