newintf.h

Go to the documentation of this file.
00001 /*
00002         libnewintf -- Interfacing to Newlib for mini-broadway
00003         Newlib interfacing
00004 
00005 Copyright (C) 2010      Alex Marshall <trap15@raidenii.net>
00006 
00007 # This code is licensed to you under the terms of the GNU GPL, version 2;
00008 # see file COPYING or http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
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 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Generated by  doxygen 1.6.3