newintf.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00020 #ifndef __NEWINTF_H__
00021 #define __NEWINTF_H__
00022
00023 #include <sys/stat.h>
00024 #include <types.h>
00025
00028 typedef struct {
00029 int valid;
00030 int ident;
00031 char tag[8];
00032 BOOL is_tty;
00034 void* (*open)(struct _reent* r, const char *name, int flags, int mode);
00035 int (*close)(struct _reent* r, int fd);
00036 off_t (*lseek)(struct _reent* r, int fd, off_t pos, int whence);
00037 long (*read)(struct _reent* r, int fd, void* buf, size_t cnt);
00038 long (*write)(struct _reent* r, int fd, const void* buf, size_t cnt);
00039 int (*stat)(struct _reent* r, const char *file, struct stat* pstat);
00040 int (*fstat)(struct _reent* r, int fd, struct stat* pstat);
00041 int (*link)(struct _reent* r, const char *old, const char *n);
00042 int (*unlink)(struct _reent* r, const char *file);
00043 } newlib_device_t;
00044
00049 BOOL newlib_init(void);
00052 void newlib_fini(void);
00058 BOOL newlib_add_device(newlib_device_t dev);
00064 BOOL newlib_remove_device(char tag[8]);
00070 newlib_device_t* newlib_get_device(char tag[8]);
00076 BOOL newlib_set_default_device(char tag[8]);
00077
00078 #endif
00079