2002-05-05 10:28:48 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2002 by Daniel Stenberg <daniel@haxx.se>
|
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
#ifndef _SIM_FILE_H_
|
|
|
|
#define _SIM_FILE_H_
|
2003-02-14 23:50:17 +00:00
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
#include <io.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#else
|
2002-06-14 11:00:13 +00:00
|
|
|
#include <stdio.h>
|
2004-06-10 13:29:52 +00:00
|
|
|
#endif
|
|
|
|
|
2002-05-05 10:28:48 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
#ifndef _commit
|
|
|
|
extern int _commit( int handle );
|
2004-06-14 07:00:50 +00:00
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
typedef unsigned int mode_t;
|
|
|
|
#endif
|
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int sim_open(const char *name, int opts);
|
|
|
|
int sim_close(int fd);
|
|
|
|
int sim_rename(const char *oldpath, const char *newpath);
|
2005-01-24 07:15:57 +00:00
|
|
|
off_t sim_filesize(int fd);
|
2004-06-10 13:29:52 +00:00
|
|
|
int sim_creat(const char *name, mode_t mode);
|
|
|
|
int sim_remove(const char *name);
|
2002-06-14 11:00:13 +00:00
|
|
|
|
2003-06-29 16:43:15 +00:00
|
|
|
#ifndef NO_REDEFINES_PLEASE
|
2004-06-10 13:29:52 +00:00
|
|
|
#define open(x,y) sim_open(x,y)
|
|
|
|
#define close(x) sim_close(x)
|
|
|
|
#define filesize(x) sim_filesize(x)
|
|
|
|
#define creat(x,y) sim_creat(x,y)
|
|
|
|
#define remove(x) sim_remove(x)
|
|
|
|
#define rename(x,y) sim_rename(x,y)
|
|
|
|
#ifdef WIN32
|
|
|
|
#define fsync _commit
|
|
|
|
#endif
|
2003-06-29 16:43:15 +00:00
|
|
|
#endif
|
2002-05-05 10:28:48 +00:00
|
|
|
|
2003-02-07 10:10:17 +00:00
|
|
|
#include "../../firmware/include/file.h"
|
2002-06-14 11:00:13 +00:00
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
#ifndef WIN32
|
2003-06-29 16:43:15 +00:00
|
|
|
int open(const char* pathname, int flags);
|
|
|
|
int close(int fd);
|
|
|
|
int printf(const char *format, ...);
|
|
|
|
int ftruncate(int fd, off_t length);
|
2003-07-01 23:43:29 +00:00
|
|
|
int fsync(int fd);
|
2003-02-14 23:50:17 +00:00
|
|
|
|
|
|
|
off_t lseek(int fildes, off_t offset, int whence);
|
|
|
|
ssize_t read(int fd, void *buf, size_t count);
|
2003-02-14 23:52:18 +00:00
|
|
|
ssize_t write(int fd, const void *buf, size_t count);
|
2004-06-10 13:29:52 +00:00
|
|
|
#endif
|
2003-02-14 23:50:17 +00:00
|
|
|
|
|
|
|
#endif
|