1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/inc/remotefs/os_io.h
Bogdan Marinescu e7702bb0e2 Manual merge of remotefs/ into trunk. Tested with the simulator and (partially) on a ET-STM32 board. Other changes:
- FAT changed to support the new opendir/readdir/closedir mechanism, and to use lseek directly instead of ioctl (also fixed a bug in FAT's lseek that always returned 0 instead of file position).
- ET-STM32 console moved to UART2@19200bps (to allow RFS to run on UART0). If UART0 is needee for console, remember to disable RFS.
- freed 700+ bytes of RAM by changing the devman implementation to keep pointers instead of actual DM_DEVICE structures
- other minor code changes and fixes
2010-02-01 18:47:41 +00:00

30 lines
785 B
C

// OS interface for file I/O manipulation
#ifndef __OS_IO_H__
#define __OS_IO_H__
#include "type.h"
#ifdef WIN32_BUILD
#define PLATFORM_PATH_SEPARATOR '\\'
#define PLATFORM_MAX_FNAME_LEN 2048
#else
#define PLATFORM_PATH_SEPARATOR '/'
#define PLATFORM_MAX_FNAME_LEN 2048
#endif
int os_open( const char *pathname, int flags, int mode );
u32 os_open_sys_flags_to_rfs_flags( int sysflags );
s32 os_write( int fd, const void *buf, u32 count );
s32 os_read( int fd, void *buf, u32 count );
int os_close( int fd );
s32 os_lseek( int fd, s32 offset, int whence );
u32 os_lseek_sys_whence_to_rfs_whence( int syswhence );
int os_isdir( const char *name );
u32 os_opendir( const char* name );
void os_readdir( u32 d, const char **pname );
int os_closedir( u32 d );
#endif