pang-io: rework api for memory-mapped io
On real hardwareit will use memory-mapped io. Rework pang-io so that it more closely aligns with this paradigm. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct pang_io;
|
||||
struct fat12_partition;
|
||||
struct fat12_dirent {
|
||||
char filename[256];
|
||||
@ -29,7 +30,7 @@ uint32_t fat12_read_u32(void *ptr);
|
||||
void fat12_set_cluster(void *fat, uint32_t cluster, uint32_t value);
|
||||
uint32_t fat12_get_cluster(void *fat, uint32_t cluster);
|
||||
|
||||
int fat12_defrag(int fd);
|
||||
int fat12_mkfs(int fd, uint32_t bytes);
|
||||
int fat12_defrag(struct pang_io *io);
|
||||
int fat12_mkfs(struct pang_io *io, uint32_t bytes);
|
||||
|
||||
#endif /* PANG_O_LIN_FAT12_H__ */
|
11
include/io.h
11
include/io.h
@ -11,10 +11,11 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
ssize_t pang_write(int fd, const void *buf, size_t count);
|
||||
ssize_t pang_read(int fd, void *buf, size_t count);
|
||||
off_t pang_seek(int fd, off_t offset, int whence);
|
||||
int pang_open(const char *pathname, int flags);
|
||||
int pang_close(int fd);
|
||||
struct pang_io;
|
||||
|
||||
ssize_t pang_write(struct pang_io *io, off_t offset, const void *buf, size_t count);
|
||||
ssize_t pang_read(struct pang_io *io, off_t offset, void *buf, size_t count);
|
||||
struct pang_io *pang_open(const char *pathname);
|
||||
int pang_close(struct pang_io **io);
|
||||
|
||||
#endif /* PANG_O_LIN_IO_H__ */
|
Reference in New Issue
Block a user