6#ifndef __LIBDRAGON_SYSTEM_H
7#define __LIBDRAGON_SYSTEM_H
42#define MAX_FILESYSTEMS 10
44#define MAX_OPEN_HANDLES 4096
77 void *(*open)(
char *name,
int flags );
102 int (*
lseek)(
void *file,
int ptr,
int dir );
116 int (*
read)(
void *file, uint8_t *ptr,
int len );
129 int (*
write)(
void *file, uint8_t *ptr,
int len );
162 int (*findfirst)(
char *path,
dir_t *dir );
195 int (*stdin_read)(
char *data,
unsigned int len );
206 int (*stdout_write)(
char *data,
unsigned int len );
217 int (*stderr_write)(
char *data,
unsigned int len );
int hook_time_call(time_t(*time_fn)(void))
Hook into gettimeofday with a current time callback.
Definition system.c:1306
int hook_stdio_calls(stdio_t *stdio_calls)
Hook into stdio for STDIN, STDOUT and STDERR callbacks.
Definition system.c:1272
int unhook_stdio_calls(stdio_t *stdio_calls)
Unhook from stdio.
Definition system.c:1292
int unhook_time_call(time_t(*time_fn)(void))
Unhook from gettimeofday current time callback.
Definition system.c:1318
int detach_filesystem(const char *const prefix)
Unregister a filesystem from newlib.
Definition system.c:350
int attach_filesystem(const char *const prefix, filesystem_t *filesystem)
Register a filesystem with newlib.
Definition system.c:289
Directory entry structure.
Definition dir.h:34
Filesystem hook structure.
Definition system.h:64
Standard I/O hook structure.
Definition system.h:184
int read(int fileno, char *ptr, int len)
Read data from a file.
Definition system.c:927
int lseek(int file, int ptr, int dir)
Seek to a location in a file.
Definition system.c:825
int fstat(int fileno, struct stat *st)
Return stats on an open file handle.
Definition system.c:673
int stat(const char *file, struct stat *st)
Return file stats based on a file name.
Definition system.c:1041
int close(int fildes)
Close a file.
Definition system.c:577
int unlink(char *name)
Remove a file based on filename.
Definition system.c:1098
int write(int file, char *ptr, int len)
Write data to a file.
Definition system.c:1149